From patchwork Mon Feb 27 21:48:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 733175 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 3vXFhY10smz9s9r; Tue, 28 Feb 2017 08:48:45 +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="FhFMRutF"; 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 1ciT9t-00037g-SH; Mon, 27 Feb 2017 21:48:41 +0000 Received: from mail-it0-f52.google.com ([209.85.214.52]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ciT9l-00036P-VI for kernel-team@lists.ubuntu.com; Mon, 27 Feb 2017 21:48:34 +0000 Received: by mail-it0-f52.google.com with SMTP id 203so68166334ith.0 for ; Mon, 27 Feb 2017 13:48:33 -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=hePCKDcy6jV7aylJPqTftLilsQzUCZ1qDehQMeCLgwo=; b=FhFMRutFt5GxTbIWyrmRBZH4cxpvNPle8BulBIqyFiwUt2+vIX+/203ejesEf85HjT M8P+Vm9i+HmWszZDEiqyGKfTiVf/MtM4aX73lHKqvCHe4djUGIria159g91o7JEWjOzw +20EM0s2KFvyCSpmsWTv2FxL6twFVIm4z/g4nzo7Fbt4iaob1d3LNPVw0LQ7JCI33uqk utq2gF5uFIZ5S9W3ZEbkPDlTHlBaALMkg4E0M16ydu0rGIWktZROMsqCsU33Rgg/2trT +5YaclmDMtUB7SBpqMcIaYihm4TL6VqdgIaJ/07RpKVjvAIqutkcaTL+dGgYuzOmerbi J7iw== 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=hePCKDcy6jV7aylJPqTftLilsQzUCZ1qDehQMeCLgwo=; b=Rf3J3o0omtVbMBGM9o6flyfUhVwauK+suyzHFCMXmJR7ZVJKETqWlsFcA00lDKujPd JEn7TCSQz0VFIi5j9DV73VmxaH91W+dYjQJTmtYMtlcdjCUScESUvGhu1T/dcvREzfJ3 gXj8Np4ltR6ZwbWBafYv3fwKCIskwwcXZ2udLCqmDPKBOwVf3g58AUDRF2f0ipNjjhI+ nVd4AFocVxJbGpfmA1MFsv/BLSKSdhBokNFnRRGBpl4+l8rHqpvwCr9PCmp8xL/ztRE+ HVMUfytfnDxrQMCbzUhyOsxnYNmh/yf2QyB/sr/xw5wWFwmdgF+IKXJcXpDpAYTs33ou 9K7A== X-Gm-Message-State: AMke39l/iTrmdMvKWMAtC+jVKN++ht9io4QPIimAc92Mako0zmXfJijOOEBbWlYOXUTNDFYt X-Received: by 10.36.127.73 with SMTP id r70mr17497296itc.11.1488232112525; Mon, 27 Feb 2017 13:48:32 -0800 (PST) Received: from localhost ([2605:a601:aa7:8220:d525:2d8c:d0b4:d509]) by smtp.gmail.com with ESMTPSA id v136sm1992ita.0.2017.02.27.13.48.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 13:48:31 -0800 (PST) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/3][Yakkety SRU] scsi: cxlflash: Scan host only after the port is ready for I/O Date: Mon, 27 Feb 2017 15:48:28 -0600 Message-Id: <1488232110-77449-2-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: Uma Krishnan BugLink: http://bugs.launchpad.net/bugs/1623750 When a port link is established, the AFU sends a 'link up' interrupt. After the link is up, corresponding initialization steps are performed on the card. Following that, when the card is ready for I/O, the AFU sends 'login succeeded' interrupt. Today, cxlflash invokes scsi_scan_host() upon receipt of both interrupts. SCSI commands sent to the port prior to the 'login succeeded' interrupt will fail with 'port not available' error. This is not desirable. Moreover, when async_scan is active for the host, subsequent scan calls are terminated with error. Due to this, the scsi_scan_host() call performed after 'login succeeded' interrupt could portentially return error and the devices may not be scanned properly. To avoid this problem, scsi_scan_host() should be called only after the 'login succeeded' interrupt. Signed-off-by: Uma Krishnan Acked-by: Matthew R. Ochs Signed-off-by: Martin K. Petersen (cherry picked from commit bbbfae962b7c221237c0f92547ee0c83f7204747) Signed-off-by: Seth Forshee --- drivers/scsi/cxlflash/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 228b99ee0483..4c2559adf723 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -1181,7 +1181,7 @@ static const struct asyc_intr_info ainfo[] = { {SISL_ASTATUS_FC0_LOGI_F, "login failed", 0, CLR_FC_ERROR}, {SISL_ASTATUS_FC0_LOGI_S, "login succeeded", 0, SCAN_HOST}, {SISL_ASTATUS_FC0_LINK_DN, "link down", 0, 0}, - {SISL_ASTATUS_FC0_LINK_UP, "link up", 0, SCAN_HOST}, + {SISL_ASTATUS_FC0_LINK_UP, "link up", 0, 0}, {SISL_ASTATUS_FC1_OTHER, "other error", 1, CLR_FC_ERROR | LINK_RESET}, {SISL_ASTATUS_FC1_LOGO, "target initiated LOGO", 1, 0}, {SISL_ASTATUS_FC1_CRC_T, "CRC threshold exceeded", 1, LINK_RESET}, @@ -1189,7 +1189,7 @@ static const struct asyc_intr_info ainfo[] = { {SISL_ASTATUS_FC1_LOGI_F, "login failed", 1, CLR_FC_ERROR}, {SISL_ASTATUS_FC1_LOGI_S, "login succeeded", 1, SCAN_HOST}, {SISL_ASTATUS_FC1_LINK_DN, "link down", 1, 0}, - {SISL_ASTATUS_FC1_LINK_UP, "link up", 1, SCAN_HOST}, + {SISL_ASTATUS_FC1_LINK_UP, "link up", 1, 0}, {0x0, "", 0, 0} /* terminator */ };