From patchwork Mon Feb 27 21:48:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 733177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3vXFhl2fdSz9s8T; Tue, 28 Feb 2017 08:48:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b="wYAgiAKV"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ciTA4-0003Bg-7L; Mon, 27 Feb 2017 21:48:52 +0000 Received: from mail-io0-f177.google.com ([209.85.223.177]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ciT9o-00036e-Us for kernel-team@lists.ubuntu.com; Mon, 27 Feb 2017 21:48:37 +0000 Received: by mail-io0-f177.google.com with SMTP id l7so27854340ioe.3 for ; Mon, 27 Feb 2017 13:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=qmQIAViy9gOJE+lNTQLD7w2nLU7QHKfXjUd8j/zJLiU=; b=wYAgiAKVrq5Zc+TuiexOMROTFsZ8dViPZTrXnHQrxmiObqxp8T1lT2LSEJbYxgeYlp zeAwE9u3Rsosz0Z8O2dChenJujlb/a/TezhLq5tXwLnTyheUK8uyzvG9/Qycjkb/S8wV 5PNFC74MP2Zv9lGxj+MfrKq6/iz41s3uJjBQmdaYuFWednTBEw5Y4Jh8ZTJZdnxhqFam FtJ26o3XQRIgE7yRyY7daGc84z0yRw5baLG+fv7DdHoG/WSyxSYRXc1J8HUTlfnQ9P2H rrEYWKI85VmFtIHsdiY3e76A4aql76mTlK9BCjA48nTn+/JVcHgewvrNkDVqgA9XEcrT 0uKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=qmQIAViy9gOJE+lNTQLD7w2nLU7QHKfXjUd8j/zJLiU=; b=bkxYaPYnGYl1N4o72XVQn8nVGw3g925pS+lZ48S/YBpDbpnImdgrE+B0oRxssTyuh1 i3gT2M9edNPnCGd5wQQXeksvxXEoYHKpgvGUo5L9Af6smM3Q8AdZ2xrzuEQ4NSsCdTvZ hj73qCeY86NkjoMV0Tv8LO5x4H3i4uqm6wGNrodDvO03v5PaRY8FHJzxHmv63hSM1yya dosIRU41bNVssMkgZg+t3ibgjruHVfmUgOj5pJC8H2c9nIZWZ9zsydiEaE05eaQkfaxZ 97ssO3J+kcDHpcBIM4yKJ5pnRmvKOGfFYWOisnsBEHDgC6o/OZaNyNtwWgFREctgPk/v va0g== X-Gm-Message-State: AMke39lgB1YVVh/lfLmdARFzP9qWPVkPlcCAYQIW+jEYRUlu9cvcAAWHmhEnYd1PNOFwvNH/ X-Received: by 10.107.48.142 with SMTP id w136mr6842775iow.16.1488232115415; Mon, 27 Feb 2017 13:48:35 -0800 (PST) Received: from localhost ([2605:a601:aa7:8220:d525:2d8c:d0b4:d509]) by smtp.gmail.com with ESMTPSA id z194sm655iof.18.2017.02.27.13.48.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 13:48:34 -0800 (PST) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/3][Yakkety SRU] scsi: cxlflash: Improve EEH recovery time Date: Mon, 27 Feb 2017 15:48:30 -0600 Message-Id: <1488232110-77449-4-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488232110-77449-1-git-send-email-seth.forshee@canonical.com> References: <1488232110-77449-1-git-send-email-seth.forshee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: "Matthew R. Ochs" BugLink: http://bugs.launchpad.net/bugs/1623750 When an EEH occurs during device initialization, the port timeout logic can cause excessive delays as MMIO reads will fail. Depending on where they are experienced, these delays can lead to a prolonged reset, causing an unnecessary triggering of other timeout logic in the SCSI stack or user applications. To expedite recovery, the port timeout logic is updated to decay the timeout at a much faster rate when in the presence of a likely EEH frozen event. Signed-off-by: Matthew R. Ochs Acked-by: Uma Krishnan Signed-off-by: Martin K. Petersen (cherry picked from commit 05dab43230fdc0d14ca885b473a2740fe017ecb1) Signed-off-by: Seth Forshee --- drivers/scsi/cxlflash/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 4ef523505364..42970a40d49b 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -1040,6 +1040,8 @@ static int wait_port_online(__be64 __iomem *fc_regs, u32 delay_us, u32 nretry) do { msleep(delay_us / 1000); status = readq_be(&fc_regs[FC_MTIP_STATUS / 8]); + if (status == U64_MAX) + nretry /= 2; } while ((status & FC_MTIP_STATUS_MASK) != FC_MTIP_STATUS_ONLINE && nretry--); @@ -1071,6 +1073,8 @@ static int wait_port_offline(__be64 __iomem *fc_regs, u32 delay_us, u32 nretry) do { msleep(delay_us / 1000); status = readq_be(&fc_regs[FC_MTIP_STATUS / 8]); + if (status == U64_MAX) + nretry /= 2; } while ((status & FC_MTIP_STATUS_MASK) != FC_MTIP_STATUS_OFFLINE && nretry--);