From patchwork Thu Oct 15 03:27:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E01831580 for ; Thu, 15 Oct 2020 10:21:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAF5D2224A for ; Thu, 15 Oct 2020 10:21:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="P1GksUGm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729057AbgJOKVK (ORCPT ); Thu, 15 Oct 2020 06:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbgJOKVJ (ORCPT ); Thu, 15 Oct 2020 06:21:09 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4BBFC061755 for ; Thu, 15 Oct 2020 03:21:09 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id j7so1627587pgk.5 for ; Thu, 15 Oct 2020 03:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RAuF4aghLCCHMupup6qBfmRcjICpJqbj4Rdy6W3SkdY=; b=P1GksUGmHrv7XrYY8s65/5QTMKXbdxr6b4GsgX1wC1b2vp8k/tQl9nmgYfPjBiTpNv L7ZCF27uil+MKTMFG90v2pmch1dwIzdwgdsRikuE8EWIqaet3UUHFNH65Iw0Sj8MxO2b 4mAlENQSgTUwrOBJztoqSjfklfLlTNpxpBkxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RAuF4aghLCCHMupup6qBfmRcjICpJqbj4Rdy6W3SkdY=; b=sWecDojWgzBY1usHteAoKetkA3XylIAM9K8ezO+7HOpJaeY6ocNnOakuaebVEZJIH1 TavI7NrO0q7trdaEdd/CsEN0NTcQVyY0jF2fQA/c0nfx74togxTLEejZhO8DRl+axNt+ ls5B0PR/NI6MqSOydfR0j6QXB/Tcn5KmgFln+IF2Iv4JbrWkewbREe8eE8RDx9sNwxn7 xEJbsCmyZhagoyxxzB+iNkQOHR+p1Fz7NYEF4IWMzik7lkajW13a4y7BuF+ENRqVyssB GyPoSc3iR1f+Lh1HCSIJTUWCF7AdXuzDUPfvrybU61QqD0AzcHRC4Vif0A5pmUyi+DcK AN8w== X-Gm-Message-State: AOAM53328lMA0mkPqwMzJc26NfkvswT4Mg5gcf6d/HOxrYp3IEah/GUO 6oiMor9Rnq9CJaa7YIEZ5Oul0AHUr/clQM4S6uF4Boq4RxnKKzU8rjuFtgxDGCCme5wxqyi32o2 bv8bYyadO/DozknESMlYoQ3FEHQmtwti3Kbqx/8+3+k6AIUZm5QNdwBC7um1LTy50ndhzwn+CW8 gb1+z+YpQZUmU= X-Google-Smtp-Source: ABdhPJydv7rqEFXYRjHKjyLTYFwwa6yZO4KLFTLPBsz78IB7Jc4ummhmd96M79OlGx4592CUMtIkCg== X-Received: by 2002:aa7:9009:0:b029:154:f822:27c9 with SMTP id m9-20020aa790090000b0290154f82227c9mr3516177pfo.48.1602757268972; Thu, 15 Oct 2020 03:21:08 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:08 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 01/17] scsi: Added a new definition in scsi_cmnd.h Date: Thu, 15 Oct 2020 08:57:26 +0530 Message-Id: <1602732462-10443-2-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added a new definition SCMD_NORETRIES_ABORT in scsi_cmnd.h The SCMD_NORETRIES_ABORT defines the third bit postion in scmd->state Signed-off-by: Muneendra --- v3: No change v2: Modified the commit log --- include/scsi/scsi_cmnd.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 69ade4fb71aa..8dec4ec6bd5f 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -64,6 +64,9 @@ struct scsi_pointer { /* for scmd->state */ #define SCMD_STATE_COMPLETE 0 #define SCMD_STATE_INFLIGHT 1 +#define SCMD_NORETRIES_ABORT 2 /* If this bit is set then there won't be any + * retries of scmd on abort success + */ struct scsi_cmnd { struct scsi_request req; From patchwork Thu Oct 15 03:27:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838843 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E7DA1580 for ; Thu, 15 Oct 2020 10:21:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 636F92224A for ; Thu, 15 Oct 2020 10:21:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ZiFgKS1t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730186AbgJOKVN (ORCPT ); Thu, 15 Oct 2020 06:21:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbgJOKVM (ORCPT ); Thu, 15 Oct 2020 06:21:12 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC7BCC061755 for ; Thu, 15 Oct 2020 03:21:12 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id p11so1377439pld.5 for ; Thu, 15 Oct 2020 03:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=deBUfJISIYst000OEDgrLUjrNj+qrBezfHtaSNkyP4k=; b=ZiFgKS1td0TEYvkuL1eAYAMXZTQzjuwKXOkBjWi0ReaP3xKud5zZMOKvHeqp/sOSht cUnwCjshViD3polAORtus5X1qj/VIc2CHRj5VKX9yTc7ew/QKYMD9O3emEp3SCcJAcTv j5ZRILQ8zQOCOIYDYR1LXiJRy19TFcHxPyh6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=deBUfJISIYst000OEDgrLUjrNj+qrBezfHtaSNkyP4k=; b=QEXVzv0nF+VaXVoqZX0b5/WqVZ5L3wMpUr7poEP+Edh3pqGbTH1fASa8mNvc8HAdTO Av0D107UpXhUop2G56wEccH/FQhG+eXMHr0z594/GM/JwfSWVtK05t2Ti/MC4b5r0GVD Kwtcy3ACw3jnSSTv1DIOAcDJZF1s4V/zzvVTvsYqu0SpYHAQA5XW2cDj+4jTPouX3uhE iGWWsgJ/TqseVahrMFEU39HxdTe1IzQP3bCeXB7Im8ROVU1nVrQatBUEJ8WF4dWx6pt4 bSbGJUOA305vFFsOYcvSPNivOYdYVys3mr0+ldt0i6kQp2mhaJB7bb7iPmfhpoc7wayz ZPBg== X-Gm-Message-State: AOAM533BBVXsSOfpZrdtNGyXx4UGqBgis7ujhLxegDyHPwLI3rGckIY1 x0B+iWdVWKqOyp7lD7XaWAagxRfGq//OC3Iur3FjiH35jxjTEABmDi8OA3CFHRB3QUrLgXtMBtL ZH8dBGsMyjmEq+CJn2tXGcL/zljOVMyaCtsIzRO2pEshhDkWc1vJGsesyTWd2GKHeZMRNOHc3VD iF+dlm+XASDUA= X-Google-Smtp-Source: ABdhPJwyde47nPJaBcKVgbSk25fCAb6ow8L5jM5HbmSZ5b+TkKMo4eAtzgz2zXkbwvr07MqLUEIplA== X-Received: by 2002:a17:90a:2e0f:: with SMTP id q15mr3600099pjd.29.1602757271878; Thu, 15 Oct 2020 03:21:11 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:11 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 02/17] scsi: Added a new error code in scsi.h Date: Thu, 15 Oct 2020 08:57:27 +0530 Message-Id: <1602732462-10443-3-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added a new error code DID_TRANSPORT_MARGINAL to handle marginal errors in scsi.h Clearing the SCMD_NORETRIES_ABORT bit in state flag before blk_mq_start_request Signed-off-by: Muneendra --- v3: Rearranged the patch by merging second hunk of the previous(v2) patch3 to this patch v2: Newpatch --- drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 1a2e9bab42ef..2b5dea07498e 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1660,6 +1660,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, req->rq_flags |= RQF_DONTPREP; } else { clear_bit(SCMD_STATE_COMPLETE, &cmd->state); + clear_bit(SCMD_NORETRIES_ABORT, &cmd->state); } cmd->flags &= SCMD_PRESERVED_FLAGS; diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 5339baadc082..5b287ad8b727 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -159,6 +159,7 @@ static inline int scsi_is_wlun(u64 lun) * paths might yield different results */ #define DID_ALLOC_FAILURE 0x12 /* Space allocation on the device failed */ #define DID_MEDIUM_ERROR 0x13 /* Medium error */ +#define DID_TRANSPORT_MARGINAL 0x14 /* Transport marginal errors */ #define DRIVER_OK 0x00 /* Driver status */ /* From patchwork Thu Oct 15 03:27:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838845 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6EBA81744 for ; Thu, 15 Oct 2020 10:21:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 458F422249 for ; Thu, 15 Oct 2020 10:21:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="PKvq21cB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730629AbgJOKVQ (ORCPT ); Thu, 15 Oct 2020 06:21:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbgJOKVP (ORCPT ); Thu, 15 Oct 2020 06:21:15 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91268C061755 for ; Thu, 15 Oct 2020 03:21:15 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id a1so1738279pjd.1 for ; Thu, 15 Oct 2020 03:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GU7MKdzHFZFkuzGoIm+K4K01Py2CI1GrQCHU3Ka/wCo=; b=PKvq21cB5Jx8SjlkavHFPl0Y3uEOkC6vT3NQn0pMgYS4qsodtOC4h4QDPV6qLz1e3l 3DAIFC8nCn2Fe1gac7zHSgFNKg5LhQl+Zy4GWTihZZzzdvCBgUCiorfY3AoX8X9wajN1 xQYbbwCRtHCykk3XcMT8FeM1M0IQNsLY/8Wwg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GU7MKdzHFZFkuzGoIm+K4K01Py2CI1GrQCHU3Ka/wCo=; b=S8NbP/ZgLlh6KmP7LlBkx1yiP5ryzY0g1E39H5npQVSJ615Qkc1ZDaCpUUwZkvpExD iZrEeM7DzmvZtJ212KH4z+0lcG3zYFZdUqfP+xggUYJcmWKwMqpfRpIm4uZU5PwedaJZ npgaa6iqeChe/TPQWpDsmrlen0fKfYVBrVHpB8qXAZBAyN0qYx9gSCWtUVpJ/ju4IMca Zw23rFYg6DybKNCTis3zY9g+NkgMViUc9DWV7wFZGfiVYx3v+K08RA+8DOL+Pn/i94ew 9oMEnFOt9wHdQkaYCflrDFWEIwxxq9HGpxXqTDNWPIJmOZ3gry9kjL1fr1zgSJPwuUaa FeZg== X-Gm-Message-State: AOAM530CrfHiiyU+NXRELBc8tWGbJe3kPFA0CQigKUcU/bPmgJ070hwt HpViQKIxrk9wJn3ohE41k+zKiasTAh4QRW9Ch4vrm/QfHa4PSjMvylRos3nrJMVo82s7LFj5xMU 1DLtmVoZDS3zYZsoNWhs2QpQSQEUwprCtZiJA9y7RNuq+eRGDzs/eDpIhMsEf70GDU15lrxpy9C BkxyMO1CDcCho= X-Google-Smtp-Source: ABdhPJxnfPLoKBiLbnhNxUY6qPdzEGqa0eiZYNUvADUcEqSCkix2aC/FQxUuzHFZmLrLqNz+MPlWhQ== X-Received: by 2002:a17:90a:a60e:: with SMTP id c14mr3764516pjq.31.1602757274747; Thu, 15 Oct 2020 03:21:14 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:14 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 03/17] scsi: No retries on abort success Date: Thu, 15 Oct 2020 08:57:28 +0530 Message-Id: <1602732462-10443-4-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Made an additional check in scsi_noretry_cmd to verify whether user has decided not to do retries on abort success by setting the SCMD_NORETRIES_ABORT bit If SCMD_NORETRIES_ABORT bit is set we are making sure there won't be any retries done on the same path and also setting the host byte as DID_TRANSPORT_MARGINAL so that the error can be propogated as recoverable transport error to the blk layers. Added a code in scsi_result_to_blk_status to translate a new error DID_TRANSPORT_MARGINAL to the corresponding blk_status_t i.e BLK_STS_TRANSPORT Signed-off-by: Muneendra --- v3: Merged first part of the previous patch(v2 patch3) with this patch. v2: set the hostbyte as DID_TRANSPORT_MARGINAL instead of DID_TRANSPORT_FAILFAST. --- drivers/scsi/scsi_error.c | 10 ++++++++++ drivers/scsi/scsi_lib.c | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index ae80daa5d831..aa30c1c9e9db 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1763,6 +1763,16 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) return 0; check_type: + /* + * Check whether caller has decided not to do retries on + * abort success by setting the SCMD_NORETRIES_ABORT bit + */ + if ((test_bit(SCMD_NORETRIES_ABORT, &scmd->state)) && + (scmd->request->cmd_flags & REQ_FAILFAST_TRANSPORT)) { + set_host_byte(scmd, DID_TRANSPORT_MARGINAL); + return 1; + } + /* * assume caller has checked sense and determined * the check condition was retryable. diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 2b5dea07498e..9606bad1542f 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -629,6 +629,7 @@ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result) return BLK_STS_OK; return BLK_STS_IOERR; case DID_TRANSPORT_FAILFAST: + case DID_TRANSPORT_MARGINAL: return BLK_STS_TRANSPORT; case DID_TARGET_FAILURE: set_host_byte(cmd, DID_OK); From patchwork Thu Oct 15 03:27:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838847 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4658E1744 for ; Thu, 15 Oct 2020 10:21:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14E7D2224A for ; Thu, 15 Oct 2020 10:21:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="KRJVGlNa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731061AbgJOKVU (ORCPT ); Thu, 15 Oct 2020 06:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbgJOKVT (ORCPT ); Thu, 15 Oct 2020 06:21:19 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A322C061755 for ; Thu, 15 Oct 2020 03:21:19 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id a1so1738371pjd.1 for ; Thu, 15 Oct 2020 03:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z1FC3pUFkwS9yzzl3wibbLMwFNi6rUktgCaXt92PeRA=; b=KRJVGlNaCznBBMx6cZNUCH1fui1SQhSBi+T3CPCYBfbPONRyntJc45PkAuOJbZ2Fx1 gBqViUKuc+jPH999YkGoQGy+BpWdPjaaVtBvmBPR/qoM1eYtDyYh4PslsTqxIXhhW+hY 0c4UlsHxzO7Lna3K/z59Uxf39TFUPJOfY3o3w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z1FC3pUFkwS9yzzl3wibbLMwFNi6rUktgCaXt92PeRA=; b=eAOAJtHfLOIks7XHwckMHpxcC0XpP6QMEQMrPTQSRVKJ38QMK8uASSRM+8gYBoMSUD tDRB0Y+YZnPLdqgewTUWeyWUyr7VmGSf2qqmukC5RZ/6eAMGA8rIbz4QHyOgAawNsNWq KduIFH3JieuInYdBkSuDPu7vDgB9pZeEeBQXKWP4TVsgvpUj/Bgfydt8Q578ElBNDAMe Qn1pL3+VAmIKo9iV5Wv2S7w2HCmxAz0PTB6nHAHd6KsTkBBcvtIBN66BPajvnNbNwQ2W 9ZDLjKZmNVO4qXYA+AxXG4DPKwLs3KSm+jw7nqp1/GDnml4PEIqHymd1c9q9ckyPyNXw Sutw== X-Gm-Message-State: AOAM532zj9nKnRkkY7GHhvZSrVN0b7N5iLOm3gLR8JuAM6LWvCTAg3yZ igPNfPVAcWviIiR3IsXh4wWfTP6VQu7u+4hl7eGckV0/CCcHbljqjFtid/ziz2RWEdEaSONrzcc +BKtWE4ffAXzRgl6yWaaEYYKqTWH/yqdvSOC7ZQ91326isBPueeFhVxFtQZsW+SeV0PZpsAMNlz fpE8NgPFtH8rQ= X-Google-Smtp-Source: ABdhPJwFnbUL5A8euW9x20KOuKqWZLBb4ddsRrgPFUuol7GM4wP6OJdzDbaZqJNDNlD67/zHBvFEtw== X-Received: by 2002:a17:902:ff14:b029:d3:f1e5:c992 with SMTP id f20-20020a170902ff14b02900d3f1e5c992mr3493743plj.72.1602757278043; Thu, 15 Oct 2020 03:21:18 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:17 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 04/17] scsi: Added routine to set/clear SCMD_NORETRIES_ABORT bit for outstanding io on scsi_dev Date: Thu, 15 Oct 2020 08:57:29 +0530 Message-Id: <1602732462-10443-5-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added a new routine scsi_chg_noretries_abort_io_device(). This functions accepts two arguments Scsi_device and a bool(set). When set is passed as 1 this routine will set SCMD_NORETRIES_ABORT bit in scmd->state for all the io's on the scsi device associated with remote port. When set is passed as 0 This routine will clear SCMD_NORETRIES_ABORT bit in scmd->state for all the io's on the scsi device associated with remote port. Export the symbol so the routine can be called by scsi_transport_fc.c Added new function declaration scsi_chg_noretries_abort_io_device in scsi_priv.h Signed-off-by: Muneendra --- v3: Used the existing scsi command iterators scsi_host_busy_iter. Set the SCMD_NORETRIES_ABORT to every command instead of only the inflight ios. Modified the scsi_chg_noretries_abort_io_device argument type from int to bool v2: Renamed the below functions as scsi_set_noretries_abort_io_device ->scsi_chg_noretries_abort_io_device __scsi_set_noretries_abort_io_device->__scsi_set_noretries_abort_io_device which accepts the value as an arg to set/clear the SCMD_NORETRIES_ABORT bit --- drivers/scsi/scsi_error.c | 65 +++++++++++++++++++++++++++++++++++++++ drivers/scsi/scsi_priv.h | 2 ++ 2 files changed, 67 insertions(+) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index aa30c1c9e9db..70e70fdfb00c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -279,6 +279,71 @@ void scsi_eh_scmd_add(struct scsi_cmnd *scmd) call_rcu(&scmd->rcu, scsi_eh_inc_host_failed); } +static bool +scsi_clear_noretries_abort_io(struct scsi_cmnd *scmd, void *priv, bool reserved) +{ + struct scsi_device *sdev = scmd->device; + + /* only clear SCMD_NORETRIES_ABORT on ios on a specific sdev */ + if (sdev != priv) + return true; + + /*Clear the SCMD_NORETRIES_ABORT bit*/ + clear_bit(SCMD_NORETRIES_ABORT, &scmd->state); + return true; +} + +static bool +scsi_set_noretries_abort_io(struct scsi_cmnd *scmd, void *priv, bool reserved) +{ + struct scsi_device *sdev = scmd->device; + + /* only set SCMD_NORETRIES_ABORT on ios on a specific sdev */ + if (sdev != priv) + return true; + /* we don't want this command reissued on abort success + * so set SCMD_NORETRIES_ABORT bit to ensure it + * won't get reissued + */ + set_bit(SCMD_NORETRIES_ABORT, &scmd->state); + return true; +} + +static int +__scsi_chg_noretries_abort_io_device(struct scsi_device *sdev, bool set) +{ + + if (sdev->sdev_state != SDEV_RUNNING) + return -EINVAL; + + blk_mq_quiesce_queue(sdev->request_queue); + if (set) + scsi_host_busy_iter(sdev->host, scsi_set_noretries_abort_io, sdev); + else + scsi_host_busy_iter(sdev->host, scsi_clear_noretries_abort_io, sdev); + + blk_mq_unquiesce_queue(sdev->request_queue); + return 0; +} + +/* + * scsi_chg_noretries_abort_io_device - set/clear the SCMD_NORETRIES_ABORT + * bit for all the pending io's on a device + * @sdev: scsi_device + */ +int +scsi_chg_noretries_abort_io_device(struct scsi_device *sdev, bool set) +{ + struct Scsi_Host *shost = sdev->host; + int ret = -EINVAL; + + mutex_lock(&shost->scan_mutex); + ret = __scsi_chg_noretries_abort_io_device(sdev, set); + mutex_unlock(&shost->scan_mutex); + return ret; +} +EXPORT_SYMBOL(scsi_chg_noretries_abort_io_device); + /** * scsi_times_out - Timeout function for normal scsi commands. * @req: request that is timing out. diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 180636d54982..9ccd3b716cf9 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -82,6 +82,8 @@ void scsi_eh_ready_devs(struct Scsi_Host *shost, int scsi_eh_get_sense(struct list_head *work_q, struct list_head *done_q); int scsi_noretry_cmd(struct scsi_cmnd *scmd); +extern int scsi_chg_noretries_abort_io_device(struct scsi_device *sdev, + bool set); /* scsi_lib.c */ extern int scsi_maybe_unblock_host(struct scsi_device *sdev); From patchwork Thu Oct 15 03:27:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBDFA1580 for ; Thu, 15 Oct 2020 10:21:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8D842224A for ; Thu, 15 Oct 2020 10:21:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="dgNT7NT/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388994AbgJOKVW (ORCPT ); Thu, 15 Oct 2020 06:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbgJOKVW (ORCPT ); Thu, 15 Oct 2020 06:21:22 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE14DC061755 for ; Thu, 15 Oct 2020 03:21:21 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id n9so1614422pgf.9 for ; Thu, 15 Oct 2020 03:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5oGfbT65mhwBN2T4MdY/LRKmR4m5XMOeEnacApuYHsI=; b=dgNT7NT/ruCZ1zCkcen8vJNG9fOurambaPQxp4ep3QagAPtZ3Zjzoq/fcH/EAMK8Nk XGLtt2vqbZ9YvxPME3Xt6mNqdBDtP/6QVIsdn54M/Q9nrkjwm5yz1g8m1WoSnm/ia845 w2Dq9WwDUfkcGNJD55q1iPEpv89/HtbtmOKVE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5oGfbT65mhwBN2T4MdY/LRKmR4m5XMOeEnacApuYHsI=; b=gzsFrjQAEX2DB112BAB/8waEiaNUOQjW1CtL/mi0erlc5OABiqDgRxIiNysFdv/Pwn +ktRPbBxcUmUFNBxT1ONR2qCEr7fLu+EshIHG7QarODuUiAdFVjv3cVVzRUn2BdjTVJj 4lDHU0wxsGS5oer3K5NkF/tS4yLXG69/uUby14sqeT/Fb3A/36yYp6iRMy62kl/wASMW 077l05ZF9AufnNxEs9ZEcVcTQAWfsq7PucZG3wQMV/CztaXdaADxuFkb+RFqQdrK7OG9 4MO9RgNfzXcbJrcB5RMuaDuZzcF9uQvqRL8+uAJxm/m1NG7U3c6L/95EumxlO7I5qQut 9XoQ== X-Gm-Message-State: AOAM5307WZORt058+Eg66UZ7P3AGnLK32CRI4nD2jIELT10Juw+Jxmt8 Y1vHtJr0Expf+n+5Ykl7owbA2+wnx/meFLuM40ciiB8AXvAeDGhkxTEw7dGPdYqcGwAuPNRapRJ chj+UWKqYChie4rVUHRXYgPyGFXezv09WHSKPJBM3FHygqRso2D4n4IKMcFChppLZJb+cDG293e fQTyYGAYJ26Q0= X-Google-Smtp-Source: ABdhPJxMxxFvtmWPbDKgAl0FcuKeOu7E8k7MiuA5Xq1WMYmjPlkIcGz5w8bwAI84APHynbqwTn2L2A== X-Received: by 2002:a63:f744:: with SMTP id f4mr2807547pgk.34.1602757280870; Thu, 15 Oct 2020 03:21:20 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:20 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 05/17] scsi_transport_fc: Added a new rport state FC_PORTSTATE_MARGINAL Date: Thu, 15 Oct 2020 08:57:30 +0530 Message-Id: <1602732462-10443-6-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added a new rport state FC_PORTSTATE_MARGINAL. Added a new inline function fc_rport_chkmarginal_set_noretries which will set the SCMD_NORETRIES_ABORT bit in cmd->state if rport state is marginal. Added a new argumet scsi_cmnd to the function fc_remote_port_chkready. Made changes in fc_remote_port_chkready function to treat marginal and online as same.If scsi_cmd is passed fc_rport_chkmarginal_set_noretries will be called. Also made changes in fc_remote_port_delete,fc_user_scan_tgt, fc_timeout_deleted_rport functions to handle the new rport state FC_PORTSTATE_MARGINAL. Signed-off-by: Muneendra --- v3: Rearranged the patch so that all the changes with respect to new rport state is part of this patch. Added a new argument to scsi_cmd to fc_remote_port_chkready v2: New patch --- drivers/scsi/scsi_transport_fc.c | 40 +++++++++++++++++++------------- include/scsi/scsi_transport_fc.h | 26 ++++++++++++++++++++- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 2ff7f06203da..df66a51d62e6 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -142,20 +142,23 @@ fc_enum_name_search(host_event_code, fc_host_event_code, static struct { enum fc_port_state value; char *name; + int matchlen; } fc_port_state_names[] = { - { FC_PORTSTATE_UNKNOWN, "Unknown" }, - { FC_PORTSTATE_NOTPRESENT, "Not Present" }, - { FC_PORTSTATE_ONLINE, "Online" }, - { FC_PORTSTATE_OFFLINE, "Offline" }, - { FC_PORTSTATE_BLOCKED, "Blocked" }, - { FC_PORTSTATE_BYPASSED, "Bypassed" }, - { FC_PORTSTATE_DIAGNOSTICS, "Diagnostics" }, - { FC_PORTSTATE_LINKDOWN, "Linkdown" }, - { FC_PORTSTATE_ERROR, "Error" }, - { FC_PORTSTATE_LOOPBACK, "Loopback" }, - { FC_PORTSTATE_DELETED, "Deleted" }, + { FC_PORTSTATE_UNKNOWN, "Unknown", 7}, + { FC_PORTSTATE_NOTPRESENT, "Not Present", 11 }, + { FC_PORTSTATE_ONLINE, "Online", 6 }, + { FC_PORTSTATE_OFFLINE, "Offline", 7 }, + { FC_PORTSTATE_BLOCKED, "Blocked", 7 }, + { FC_PORTSTATE_BYPASSED, "Bypassed", 8 }, + { FC_PORTSTATE_DIAGNOSTICS, "Diagnostics", 11 }, + { FC_PORTSTATE_LINKDOWN, "Linkdown", 8 }, + { FC_PORTSTATE_ERROR, "Error", 5 }, + { FC_PORTSTATE_LOOPBACK, "Loopback", 8 }, + { FC_PORTSTATE_DELETED, "Deleted", 7 }, + { FC_PORTSTATE_MARGINAL, "Marginal", 8 }, }; fc_enum_name_search(port_state, fc_port_state, fc_port_state_names) +fc_enum_name_match(port_state, fc_port_state, fc_port_state_names) #define FC_PORTSTATE_MAX_NAMELEN 20 @@ -2095,7 +2098,8 @@ fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, u64 lun) if (rport->scsi_target_id == -1) continue; - if (rport->port_state != FC_PORTSTATE_ONLINE) + if ((rport->port_state != FC_PORTSTATE_ONLINE) && + (rport->port_state != FC_PORTSTATE_MARGINAL)) continue; if ((channel == rport->channel) && @@ -2958,7 +2962,8 @@ fc_remote_port_delete(struct fc_rport *rport) spin_lock_irqsave(shost->host_lock, flags); - if (rport->port_state != FC_PORTSTATE_ONLINE) { + if ((rport->port_state != FC_PORTSTATE_ONLINE) && + (rport->port_state != FC_PORTSTATE_MARGINAL)) { spin_unlock_irqrestore(shost->host_lock, flags); return; } @@ -3100,7 +3105,8 @@ fc_timeout_deleted_rport(struct work_struct *work) * target, validate it still is. If not, tear down the * scsi_target on it. */ - if ((rport->port_state == FC_PORTSTATE_ONLINE) && + if (((rport->port_state == FC_PORTSTATE_ONLINE) || + (rport->port_state == FC_PORTSTATE_MARGINAL)) && (rport->scsi_target_id != -1) && !(rport->roles & FC_PORT_ROLE_FCP_TARGET)) { dev_printk(KERN_ERR, &rport->dev, @@ -3243,7 +3249,8 @@ fc_scsi_scan_rport(struct work_struct *work) struct fc_internal *i = to_fc_internal(shost->transportt); unsigned long flags; - if ((rport->port_state == FC_PORTSTATE_ONLINE) && + if (((rport->port_state == FC_PORTSTATE_ONLINE) || + (rport->port_state == FC_PORTSTATE_ONLINE)) && (rport->roles & FC_PORT_ROLE_FCP_TARGET) && !(i->f->disable_target_scan)) { scsi_scan_target(&rport->dev, rport->channel, @@ -3747,7 +3754,8 @@ static blk_status_t fc_bsg_rport_prep(struct fc_rport *rport) !(rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT)) return BLK_STS_RESOURCE; - if (rport->port_state != FC_PORTSTATE_ONLINE) + if ((rport->port_state != FC_PORTSTATE_ONLINE) && + (rport->port_state != FC_PORTSTATE_MARGINAL)) return BLK_STS_IOERR; return BLK_STS_OK; diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 1c7dd35cb7a0..7d010324c1e3 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,7 @@ enum fc_port_state { FC_PORTSTATE_ERROR, FC_PORTSTATE_LOOPBACK, FC_PORTSTATE_DELETED, + FC_PORTSTATE_MARGINAL, }; @@ -707,6 +709,23 @@ struct fc_function_template { unsigned long disable_target_scan:1; }; +/** + * fc_rport_chkmarginal_set_noretries - Set the SCMD_NORETRIES_ABORT bit + * in cmd->state if port state is marginal prior to initiating + * io to the port. + * @rport: remote port to be checked + * @scmd: scsi_cmd to set/clear the SCMD_NORETRIES_ABORT bit on Marginal state + **/ +static inline void +fc_rport_chkmarginal_set_noretries(struct fc_rport *rport, struct scsi_cmnd *cmd) +{ + if ((rport->port_state == FC_PORTSTATE_MARGINAL) && + (cmd->request->cmd_flags & REQ_FAILFAST_TRANSPORT)) + set_bit(SCMD_NORETRIES_ABORT, &cmd->state); + else + clear_bit(SCMD_NORETRIES_ABORT, &cmd->state); + +} /** * fc_remote_port_chkready - called to validate the remote port state @@ -715,20 +734,25 @@ struct fc_function_template { * Returns a scsi result code that can be returned by the LLDD. * * @rport: remote port to be checked + * @cmd: scsi_cmd to set/clear the SCMD_NORETRIES_ABORT bit on Marginal state **/ static inline int -fc_remote_port_chkready(struct fc_rport *rport) +fc_remote_port_chkready(struct fc_rport *rport, struct scsi_cmnd *cmd) { int result; switch (rport->port_state) { case FC_PORTSTATE_ONLINE: + case FC_PORTSTATE_MARGINAL: if (rport->roles & FC_PORT_ROLE_FCP_TARGET) result = 0; else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) result = DID_IMM_RETRY << 16; else result = DID_NO_CONNECT << 16; + + if (cmd) + fc_rport_chkmarginal_set_noretries(rport, cmd); break; case FC_PORTSTATE_BLOCKED: if (rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT) From patchwork Thu Oct 15 03:27:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF52D1744 for ; Thu, 15 Oct 2020 10:21:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B2032224A for ; Thu, 15 Oct 2020 10:21:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="H6hR9Pe1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389216AbgJOKVZ (ORCPT ); Thu, 15 Oct 2020 06:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVZ (ORCPT ); Thu, 15 Oct 2020 06:21:25 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFC26C061755 for ; Thu, 15 Oct 2020 03:21:24 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id r10so1612913pgb.10 for ; Thu, 15 Oct 2020 03:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T8B9akbRZwipPegQunnvBAXugv0e1h0PbYHIixJnhIE=; b=H6hR9Pe1rCQpUKVyXAjlVsMpi5SyApeCDN4PPq53GULhm/Dp58um/h4ikJbOVbDGfd ZkJGTk50S3MvPTa0TrGiZVbuM3fc2LLVuPB6wbY0P72MYOkQ77blFT/Wu7wgTYFHgocc u5t2LjjemWrf59Dpoq8VHcs+I//Xq7V62Qpv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T8B9akbRZwipPegQunnvBAXugv0e1h0PbYHIixJnhIE=; b=ap6ND26ltIPIKU2yGDFWULq3STX2C2d/nagPjhh5HYWEhZsGliaGWGlGpiGtdijfoH /2qLop42sQGwfg0XLfJnqK/z+vDbVPntJHmcLWj7YOmzkpF0zBQOHYVJgdO02QrWb54G cARsRDyBqaKOef4MjTqsdhdL6kbMiGe/sRKDCT+Cy4LB8le36QX2HtEgk0J1fwqZ22hN 2IPtvCLBPACf5LuL8J1h7Xfyd0eT/fo2DU4waLJ0woezDeVxjL1XvRyF+lUmtsXawexX 8MgJFDakPaAHUAZFkOomlRv9gHC1rRjF53YHJHI1YbNHtRhdHACj/XYj9xG3qflT4Wqc /qmg== X-Gm-Message-State: AOAM533zPrR0BTBD7btH3YE0hYYKOUcVOeStDEn98fCuPxTqCnYLmvtV l1YIfcrpQ26jUATcvx+hvhg9YATFxrK2YuAvSegjo+HimZyfL+HECVxnBJiDGuViMf3nvzHLSsL won/YZELEJxUz7QWFaoNcPoeHp5TE4bOXMi85VaITOL4tKVT3SPGwOMvc+g2KphZFzVne50kfIu QLK8gWkCXPnB4= X-Google-Smtp-Source: ABdhPJz+16fHdFPMcv67z5110G0iwcP53YBOyEGzS8q9l/1d3bkH9qcnhw+vQZ8najLZ5rpdKKqwcQ== X-Received: by 2002:a63:d111:: with SMTP id k17mr2571274pgg.299.1602757283856; Thu, 15 Oct 2020 03:21:23 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:23 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 06/17] scsi_transport_fc: Added store fucntionality to set the rport port_state using sysfs Date: Thu, 15 Oct 2020 08:57:31 +0530 Message-Id: <1602732462-10443-7-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added a store functionality to set rport port_state using sysfs under fc_remote_ports/rport-*/port_state With this functionality the user can move the port_state from Marginal->Online and Online->Marginal. On Marginal :This interface will set SCMD_NORETRIES_ABORT bit in scmd->state for all the io's on the scsi device associated with remote port. On Online :This interface will clear SCMD_NORETRIES_ABORT bit in scmd->state for all the pending io's on the scsi device associated with remote port. Below is the interface provided to set the port state to Marginal and Online. echo "Marginal" >> /sys/class/fc_remote_ports/rport-X\:Y-Z/port_state echo "Online" >> /sys/class/fc_remote_ports/rport-X\:Y-Z/port_state Signed-off-by: Muneendra Reported-by: kernel test robot --- v3: Removed the port_state from starget attributes. Enabled the store functionality for port_state under remote port. used the starget_for_each_device to traverse around all the devices under rport v2: Changed from a noretries_abort attribute under fc_transport/target*/ to port_state for changing the port_state to a marginal state --- drivers/scsi/scsi_transport_fc.c | 85 +++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index df66a51d62e6..ac5283b645a6 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -943,7 +943,88 @@ show_fc_rport_roles (struct device *dev, struct device_attribute *attr, static FC_DEVICE_ATTR(rport, roles, S_IRUGO, show_fc_rport_roles, NULL); -fc_private_rport_rd_enum_attr(port_state, FC_PORTSTATE_MAX_NAMELEN); +static void +device_chg_noretries_abort(struct scsi_device *sdev, void *data) +{ + scsi_chg_noretries_abort_io_device(sdev, *(bool *)data); +} + +static int +target_chg_noretries_abort(struct device *dev, void *data) +{ + if (scsi_is_target_device(dev)) + starget_for_each_device(to_scsi_target(dev), data, + device_chg_noretries_abort); + return 0; +} + +static void scsi_target_chg_noretries_abort(struct device *dev, bool set) +{ + if (scsi_is_target_device(dev)) + starget_for_each_device(to_scsi_target(dev), &set, + device_chg_noretries_abort); + else + device_for_each_child(dev, &set, target_chg_noretries_abort); +} + +/* + * Sets port_state to Marginal/Online. + * On Marginal it Sets no retries on abort in scmd->state for all + * outstanding io of all the scsi_devs + * This only allows ONLINE->MARGINAL and MARGINAL->ONLINE + */ +static ssize_t fc_rport_set_marginal_state(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct fc_rport *rport = transport_class_to_rport(dev); + enum fc_port_state port_state; + int ret = 0; + + ret = get_fc_port_state_match(buf, &port_state); + + if (port_state == FC_PORTSTATE_MARGINAL) { + /* + * Change the state to marginal only if the + * current rport state is Online + * Allow only Online->marginal + */ + if (rport->port_state == FC_PORTSTATE_ONLINE) { + rport->port_state = port_state; + scsi_target_chg_noretries_abort(&rport->dev, 1); + } + } else if (port_state == FC_PORTSTATE_ONLINE) { + /* + * Change the state to Online only if the + * current rport state is Marginal + * Allow only MArginal->Online + */ + if (rport->port_state == FC_PORTSTATE_MARGINAL) { + rport->port_state = port_state; + scsi_target_chg_noretries_abort(&rport->dev, 0); + } + } else + return -EINVAL; + return count; +} + +static ssize_t +show_fc_rport_port_state(struct device *dev, + struct device_attribute *attr, char *buf) +{ + const char *name; + struct fc_rport *rport = transport_class_to_rport(dev); + + name = get_fc_port_state_name(rport->port_state); + if (!name) + return -EINVAL; + + return snprintf(buf, 20, "%s\n", name); +} + +static FC_DEVICE_ATTR(rport, port_state, 0444 | 0200, + show_fc_rport_port_state, fc_rport_set_marginal_state); + fc_private_rport_rd_attr(scsi_target_id, "%d\n", 20); /* @@ -2266,7 +2347,7 @@ fc_attach_transport(struct fc_function_template *ft) SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_name); SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_id); SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(roles); - SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_state); + SETUP_PRIVATE_RPORT_ATTRIBUTE_RW(port_state); SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(scsi_target_id); SETUP_PRIVATE_RPORT_ATTRIBUTE_RW(fast_io_fail_tmo); From patchwork Thu Oct 15 03:27:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1297D1580 for ; Thu, 15 Oct 2020 10:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF48C2224A for ; Thu, 15 Oct 2020 10:21:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="hyIwpOXz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389220AbgJOKV2 (ORCPT ); Thu, 15 Oct 2020 06:21:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKV1 (ORCPT ); Thu, 15 Oct 2020 06:21:27 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3103C061755 for ; Thu, 15 Oct 2020 03:21:27 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id b26so1756270pff.3 for ; Thu, 15 Oct 2020 03:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7O0SfMi6GwI6PmzflUQvkrCIYczvFtIHH9lUhbDQhGA=; b=hyIwpOXza3q0ySoGLBrTPCpuHakPESbIderD7muVdUx1dBaPZ+se4fuLZmzwxbscuX p7yZiZTR1zcaPe0eOsQEHXYuj6AMYCcoI3boWc3uSU664Gve3NKdqajrW8tIR/r9pAQY AXos9o2xgP4sW8tkNGpEOVfsEyOSC9rTAXpIU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7O0SfMi6GwI6PmzflUQvkrCIYczvFtIHH9lUhbDQhGA=; b=S9NKZbEKw6mVHdhihngqb8iyTwkQFTfvfJIulkdGAoSkf6gSE8rqPASG8CF+rA7+IW DxFluYH9AzHqiP5q9usOfb9ig9K84rj0WY4Vun2xnH84yWz/Zb9SFhaScY7UOOKD+lMF /9db4nteSfhjgoLCyUbki6dBl53lZ55gs9m9qI03norJnzQYHrVq8MwTCR9dxShk+tcw IWNNrnIcVOxeRSrKVcQV59COA5nwWjIZreS3Kcuo8jVdmv0rZVv1kuTs7mJ42NDKzJlS CmpFkrhulXFfHJHg82tyOzmpfrUZXCPQSmShFgIMZW+l8nZfM5D2WESlc37REi9J/kfR PhPw== X-Gm-Message-State: AOAM532J1BX2Ed4iEjxcuKWX+gl+UA/wgjbh4oNdO84dl2/ZEbECb3yn oAOrMPLkc6LfmXIIHi+OYTkq/138a0YobXsjHg2fkWiVP9e1iTjDGRiHaJqz/xIbHojtkaqa78e u5uIy0bQwK+CDIH8vfFEhSSChk7vbV6bCAH7QEZXoG4T5B462sOFJx1jOGhGFqS+qZFPBpJ7Q8E wF4AE7MigLdUY= X-Google-Smtp-Source: ABdhPJwYhrkzqApZS+IO15mTogfM11jApk9KSbap5tRzjt3IkeKhGByrgoOhVpgyz2hjt/uPaMz8Ig== X-Received: by 2002:aa7:9f88:0:b029:152:80df:4c52 with SMTP id z8-20020aa79f880000b029015280df4c52mr3493491pfr.54.1602757286780; Thu, 15 Oct 2020 03:21:26 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:26 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 07/17] scsi:lpfc: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:32 +0530 Message-Id: <1602732462-10443-8-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: Removed calling fc_rport_chkmarginal_set_noretries to set the SCMD_NORETRIES_ABORT bit. Modified the fc_remote_port_chkready fucntion by passing new argument scsi_cmd which internally checks and sets the same. v2: New Patch --- drivers/scsi/lpfc/lpfc_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 5e802c8b22a9..35231dc30a99 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -4521,7 +4521,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) if (unlikely(!rdata) || unlikely(!rport)) goto out_fail_command; - err = fc_remote_port_chkready(rport); + err = fc_remote_port_chkready(rport, cmnd); if (err) { cmnd->result = err; goto out_fail_command; @@ -5519,7 +5519,7 @@ lpfc_slave_alloc(struct scsi_device *sdev) unsigned long flags; struct lpfc_name target_wwpn; - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; if (phba->cfg_fof) { From patchwork Thu Oct 15 03:27:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 778951580 for ; Thu, 15 Oct 2020 10:21:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EF6822249 for ; Thu, 15 Oct 2020 10:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="BRTPSd/M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389222AbgJOKVb (ORCPT ); Thu, 15 Oct 2020 06:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVa (ORCPT ); Thu, 15 Oct 2020 06:21:30 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA866C061755 for ; Thu, 15 Oct 2020 03:21:30 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 10so1756901pfp.5 for ; Thu, 15 Oct 2020 03:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yxbu20dvy5s+KB2bm6yI1B5SZwCHlvFL/2jDWEjn0Gk=; b=BRTPSd/MgIkRbah71dU4dj1CUR8NCjoRhng6v6csQ1S4GQNigBGnB2N/Xil0nBnqZP 7kkL1Jgrnf98fBidTiRcIfN2iUIyGYwT00e1j7DvcT8RWBBqvFanqzZ5DWGDBlzn5VlI EHqA+WHxxdqbViiDwgP9u0a/IGeUOBg60rPb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yxbu20dvy5s+KB2bm6yI1B5SZwCHlvFL/2jDWEjn0Gk=; b=LM0ZJYhV4WscJs/nFfj2sxuDjv07r/vM4VQinCb8TBaWI2G8tCxdtUgs03l70u1K7L j8VcesMwYCC5+xZ3pzj4Je1DkVAWvphRvjN6OMkxnO0z0Hw37sS8xZS570Pc2qg8dHk7 uu/cUvrrbSEdOYgvOzecpFpTGNYry/g+gp4Ylp/o2AuZQk+4JyESXcABYtb3GS70w3yy IzUP2+u6p3ciIQnhpeFBylvhOJr8s7XvmzbB2mt6tUVqdrcQNtr1Optp53uTvWxSYgJ/ dh7xElGpWCrn9br0qs5tzaPpbzPr/2PKHKaJ+s8Zeybhkdz6nlvPvbKEXViduGvA8ZwI jBOA== X-Gm-Message-State: AOAM5301JZi8Hs1sTbyinP8Ol9LnXjtATMaQ7A1OGx17f3D2VZWRvgKA /tcB3hTUhYIs57457DP0NmHc5YtfEonJraI92OrtTvz+CzZCfJqUDTF92J2DzyDBJAwBXmczIgd gyjN9MhFjYj2sSa4BxT0Q6K5NSJsj+HDzJdodIjvfbtU3SAVdej6PGr4Pg3gRC3szRfidDF0zAG 5NNitGahQ+teE= X-Google-Smtp-Source: ABdhPJyMwMv62jxsvC+/60XpN0/mObPWrSU3P54pB7mcAWbu0J3j+iLEO2bZfVVRn8wvhCs5ARlaAw== X-Received: by 2002:a62:dd02:0:b029:142:2501:398c with SMTP id w2-20020a62dd020000b02901422501398cmr3361482pff.81.1602757289799; Thu, 15 Oct 2020 03:21:29 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:29 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 08/17] scsi:qla2xx: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:33 +0530 Message-Id: <1602732462-10443-9-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/qla2xxx/qla_os.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 2bb015b58609..f2be1667cc37 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -867,7 +867,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) goto qc24_fail_command; } - rval = fc_remote_port_chkready(rport); + rval = fc_remote_port_chkready(rport, cmd); if (rval) { cmd->result = rval; ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3003, @@ -958,7 +958,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, srb_t *sp; int rval; - rval = rport ? fc_remote_port_chkready(rport) : FC_PORTSTATE_OFFLINE; + rval = rport ? fc_remote_port_chkready(rport, cmd) : FC_PORTSTATE_OFFLINE; if (rval) { cmd->result = rval; ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x3076, @@ -1847,7 +1847,7 @@ qla2xxx_slave_alloc(struct scsi_device *sdev) { struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; sdev->hostdata = *(fc_port_t **)rport->dd_data; From patchwork Thu Oct 15 03:27:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 488DC1580 for ; Thu, 15 Oct 2020 10:21:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 214DB2224A for ; Thu, 15 Oct 2020 10:21:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="WwPf0GMF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389227AbgJOKVd (ORCPT ); Thu, 15 Oct 2020 06:21:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVd (ORCPT ); Thu, 15 Oct 2020 06:21:33 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60A79C061755 for ; Thu, 15 Oct 2020 03:21:33 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id f5so1638712pgb.1 for ; Thu, 15 Oct 2020 03:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TYmvj6yiWGXfqVJr1c+9931Oj6DWNDChph4J0sZEIl4=; b=WwPf0GMFpe5o5jezNZnDv8YRLykXoCxrOR+ZFY6N7uCundi+LTdjJe/x2tWOi1Ua2s yvfKkzjm/7J4+D0bgWgmCFi+50nBxzJZ4ukypi0h83TFA+NlYK2QytBvoo8KScK9nr8s cV0cwkUhFyLEg+S/AZPNBl3RQAEqnE1rMbIec= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TYmvj6yiWGXfqVJr1c+9931Oj6DWNDChph4J0sZEIl4=; b=Run1zNX3ZWG86ZVqRSDwze+nFH/3mzRSu636cXwbI7+sjYEq6xl7/Mn7Zy7cStg4ek xbk48EGktnC7uCHay+QRBbKiAuvW/drS8VB6/rPdZJEjxTWkqJxZjAlsZnU+No5HfjHP nF1FA5Hq6XBarUnT+VHAe2YvBuXwNrR3mtIjrjHlBWxGJ5LxCtbjpl9YSBGJu60GZsEV /+mdesos3q9Ahb1ts/R+gFPcRDnsbtp6tCrma+rA+HQABnzTdAzqJ39SHFgAkv8+ala7 zWr9GQlBEamiTf11CbRWAbcGm0uVJS3j4AkLsU4Udh05bnHQcRS1w/J5Z3tGNhutVmSB COag== X-Gm-Message-State: AOAM533j5tZYzN6+NP0vgAkkRjk51B+55k63xhWVj7Hs2p45IPFcN6c7 8KAH8iMQA8o+wnY7w1rC/OPBqxNuvIYRisCKh0BV+HeZJrVGRcXk/JR7BkpgtOFZE1HTkjMZe9i OOppLs0dwQjuFO+ypQVgR1IXFvW6SYmRO4xTDiE9Cp5623k7F3szqRGECmIAlfO0sENIerumOwn g+3sis0E1FPk8= X-Google-Smtp-Source: ABdhPJz6SvMiobtuOeP7pitZEZi/RuJ4AyG2FKYT3KzgIGAYtwcNg+hwsVcSiJbZMxqaYaebiZi0fg== X-Received: by 2002:a63:ef4f:: with SMTP id c15mr2813787pgk.140.1602757292508; Thu, 15 Oct 2020 03:21:32 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:31 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 09/17] scsi:qedf: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:34 +0530 Message-Id: <1602732462-10443-10-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/qedf/qedf_els.c | 2 +- drivers/scsi/qedf/qedf_io.c | 4 ++-- drivers/scsi/qedf/qedf_main.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c index 625e58ccb8c8..278921555def 100644 --- a/drivers/scsi/qedf/qedf_els.c +++ b/drivers/scsi/qedf/qedf_els.c @@ -35,7 +35,7 @@ static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op, QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Sending ELS\n"); - rc = fc_remote_port_chkready(fcport->rport); + rc = fc_remote_port_chkready(fcport->rport, NULL); if (rc) { QEDF_ERR(&(qedf->dbg_ctx), "els 0x%x: rport not ready\n", op); rc = -EAGAIN; diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 4869ef813dc4..0673b28ede2b 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -975,7 +975,7 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) return 0; } - rval = fc_remote_port_chkready(rport); + rval = fc_remote_port_chkready(rport, sc_cmd); if (rval) { QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_IO, "fc_remote_port_chkready failed=0x%x for port_id=0x%06x.\n", @@ -2438,7 +2438,7 @@ int qedf_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags) io_req, io_req->xid, ref_cnt); } - rval = fc_remote_port_chkready(rport); + rval = fc_remote_port_chkready(rport, sc_cmd); if (rval) { QEDF_ERR(NULL, "device_reset rport not ready\n"); rc = FAILED; diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 46d185cb9ea8..59990400be08 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -761,7 +761,7 @@ static int qedf_eh_abort(struct scsi_cmnd *sc_cmd) goto drop_rdata_kref; } - if (fc_remote_port_chkready(rport)) { + if (fc_remote_port_chkready(rport, sc_cmd)) { refcount = kref_read(&io_req->refcount); QEDF_ERR(&qedf->dbg_ctx, "rport not ready, io_req=%p, xid=0x%x sc_cmd=%p op=0x%02x, refcount=%d, port_id=%06x\n", From patchwork Thu Oct 15 03:27:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838859 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 101A01580 for ; Thu, 15 Oct 2020 10:21:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAD0522249 for ; Thu, 15 Oct 2020 10:21:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="cAEDL8nV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389233AbgJOKVg (ORCPT ); Thu, 15 Oct 2020 06:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVg (ORCPT ); Thu, 15 Oct 2020 06:21:36 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 371E5C061755 for ; Thu, 15 Oct 2020 03:21:36 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id n9so1617267pgt.8 for ; Thu, 15 Oct 2020 03:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kT40iJa9Wr0fT3Ln4M6QZw3w/Zd1czMGvTOm94bl6xE=; b=cAEDL8nVgKPylcZiPe+p7y0c3auMaBvuHsCFXkI7aDusceWeeVIWxOa9S7kXzsPKWz 46ZyLiJaz7bVkVENiITvSq6wFo1zWw6hIRT50XXsc5iHamZ9dNXymbgIFIMkBAT8tAd1 bAw0snq8tYU3CzE6sqrsa4Eut87FLo/ATAalY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kT40iJa9Wr0fT3Ln4M6QZw3w/Zd1czMGvTOm94bl6xE=; b=s4m8f8M15fVEbn4cUssZJkbugFRjTwsj5LS9GysxB3g/BXvJJPiM2vBqkijvP7SSCr TWsfQ+Qq9nVpF171bLxOb/T5RmdOtoFIrBCaAhThx51rVQcxjkrDAxwHxqY89xeTdeJC wU+Yi2JLuO1aVR7Eribk7Em3rCLBAbwdIfRFk7z5Cb+F7Ob9bj1GJ8V3zVF8dEYdOgHF c7MRx05JX9MfdRoaAFMD7+rUm4pjCNC5Dgf9NXLNACYOLDm4ACF1FqaAH5M8GZ4V4q/k TSdpDHtCH6IrpE+noF6hHLfAtQvr+R2zAuIMQMqDTcFf1CWW+HVpRqbNf3jt3qoq1dw3 eJVQ== X-Gm-Message-State: AOAM532kVnsWbKpswkoRukkPEskFM/o09Dy77jdEdQsehWsakKFybVXu k8g2t23zAoMj4j7/66aZQ98uIIWVd8aqVHVtoGkm8XiyXoHryjusYRLImma4ay2DEzZsaKndif3 ObfmEocFpzaxs14Tqu6nk1HDwLsou4yw2BZzV2SYETETguW0yl1WA0pbB2WxZjOd+5eKzEinlMU 7UPNV/EDPvbiM= X-Google-Smtp-Source: ABdhPJycAiaXz5ErVxWyR6LJJizKs0i6RvulAMdc0OZwlMctGORZpF6DKzG3HNxtlYeMuAbkOjipQQ== X-Received: by 2002:a63:3e06:: with SMTP id l6mr2745285pga.179.1602757295375; Thu, 15 Oct 2020 03:21:35 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:34 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 10/17] scsi:libfc: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:35 +0530 Message-Id: <1602732462-10443-11-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/libfc/fc_fcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index e11d4f002bd4..5b7a85dbc6c1 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -1867,7 +1867,7 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd) int rc = 0; struct fc_stats *stats; - rval = fc_remote_port_chkready(rport); + rval = fc_remote_port_chkready(rport, sc_cmd); if (rval) { sc_cmd->result = rval; sc_cmd->scsi_done(sc_cmd); @@ -2239,7 +2239,7 @@ int fc_slave_alloc(struct scsi_device *sdev) { struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; scsi_change_queue_depth(sdev, FC_FCP_DFLT_QUEUE_DEPTH); From patchwork Thu Oct 15 03:27:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838861 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F14211580 for ; Thu, 15 Oct 2020 10:21:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8E2B22249 for ; Thu, 15 Oct 2020 10:21:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="abtyiINV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389241AbgJOKVj (ORCPT ); Thu, 15 Oct 2020 06:21:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVj (ORCPT ); Thu, 15 Oct 2020 06:21:39 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32F3BC061755 for ; Thu, 15 Oct 2020 03:21:39 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id y1so1374349plp.6 for ; Thu, 15 Oct 2020 03:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A5jzPrDZZ/cQ4kZ35qy+EheUut8LKE/CA7w1dJ+05AU=; b=abtyiINVVzyCmJhDiygtqLm+915Yt/qsRVpYbL+MpguBYVsI0s1JYXK2f/yW5vcK8e zo9ekznqKrhPoOsYt0l453fZVVjvHszU+EisHOygxCh7CHsznR+zzlK3EUrJ9dqz0VFd tv2f1tYkBXDNBZH5/tLI07+ZGkfBeKm68x7Gw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A5jzPrDZZ/cQ4kZ35qy+EheUut8LKE/CA7w1dJ+05AU=; b=fKGbw4fMCq6+F9fu6l1U0dHFUg25jE+uACDZNEuwApqVABB6D0kldNJFTgApD/Zenr c+Sm2eCEZMnyGgI6ToVRv46RYmqU6Bozcwda7vcsbpK49PFaB+9Jg1WJWyoPE1kbJ0YR FA2J6+2UcJzXYZdTfOLFRpdDDVDqPJ0ZAFVWRA/Rx3q6xM3VMdKfDLr7ck9SnxeOzCGz XskZ+WehB7aCvg3+Gc59NDH7hj7/XSpUxzvVHg71B8LxDlM0pYkiccs/xBHeNZ/I+zfm ti4G3uEBP+gKqo0EmhlwI35bATs4yEGehjpm2Abd95u4HBE0I+/Ee2ub7HStp1JQwANH KHxA== X-Gm-Message-State: AOAM532FgfQ0OU5aDfVPfO2Z21kJRaSW/vmWxhUJ5CSvzI/C4i3zCJtr fCtVeJrkO4MYBYuoNKMkNYObA+5iM61RRApS76bgfg0y2yRwy+QVdy6AvJS0nvCuZI5BH0bBjEc tyvmTrovxmPAob6GHEWL20qU2cSYGIDWIqs5yJs4EMl0qLjny2ij4Rn5xyjdeXPcLQHihTL79f0 lCk3XCXy8PTP8= X-Google-Smtp-Source: ABdhPJzFiXX09lyP2KhzG6eV4q9T26gFqONnpjELmApHUIdAQEkUiIBT0yoZUceG6gtKkWgw3mPhag== X-Received: by 2002:a17:90a:c28a:: with SMTP id f10mr3673144pjt.30.1602757298256; Thu, 15 Oct 2020 03:21:38 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:37 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 11/17] scsi:ibmvfc: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:36 +0530 Message-Id: <1602732462-10443-12-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Also fixed the checkpatch error "do not use assignment in if condition" Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/ibmvscsi/ibmvfc.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index e09e0310b4c8..0c9334e8f036 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -1663,8 +1663,15 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, struct ibmvfc_event *evt; int rc; - if (unlikely((rc = fc_remote_port_chkready(rport))) || - unlikely((rc = ibmvfc_host_chkready(vhost)))) { + rc = fc_remote_port_chkready(rport, cmnd); + if (unlikely(rc)) { + cmnd->result = rc; + done(cmnd); + return 0; + } + + rc = ibmvfc_host_chkready(vhost); + if (unlikely(rc)) { cmnd->result = rc; done(cmnd); return 0; @@ -1934,8 +1941,19 @@ static int ibmvfc_bsg_request(struct bsg_job *job) spin_lock_irqsave(vhost->host->host_lock, flags); - if (unlikely(rc || (rport && (rc = fc_remote_port_chkready(rport)))) || - unlikely((rc = ibmvfc_host_chkready(vhost)))) { + if (unlikely(rc)) { + spin_unlock_irqrestore(vhost->host->host_lock, flags); + goto out; + } + + rc = fc_remote_port_chkready(rport, NULL); + if (rport && rc) { + spin_unlock_irqrestore(vhost->host->host_lock, flags); + goto out; + } + + rc = ibmvfc_host_chkready(vhost); + if (unlikely(rc)) { spin_unlock_irqrestore(vhost->host->host_lock, flags); goto out; } @@ -2910,7 +2928,7 @@ static int ibmvfc_slave_alloc(struct scsi_device *sdev) struct ibmvfc_host *vhost = shost_priv(shost); unsigned long flags = 0; - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; spin_lock_irqsave(shost->host_lock, flags); From patchwork Thu Oct 15 03:27:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838863 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76CE01580 for ; Thu, 15 Oct 2020 10:21:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CE112224A for ; Thu, 15 Oct 2020 10:21:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Msv2rVIs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389245AbgJOKVn (ORCPT ); Thu, 15 Oct 2020 06:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389243AbgJOKVm (ORCPT ); Thu, 15 Oct 2020 06:21:42 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE5FC061755 for ; Thu, 15 Oct 2020 03:21:42 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id u3so1736353pjr.3 for ; Thu, 15 Oct 2020 03:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4/GAtVgC24BwoogjJsIEcKonml1BrIlHY3WmHjgaPig=; b=Msv2rVIs4JuzQpjG/kIFA/t1mWv4ToS5qqfMTe8E2cvJZu3YX7mHBws6I/MbMmirBS WlYBvSJn+llCT5qF7Rp+nzmqXEKEo67RfwTwJ1QQmFekDORNZBFe2+CPQ5FUj1jVeR0h /Tnk3SgfcBFJDnSWBZTnd9c7zWRjmZ3pvZ+fs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4/GAtVgC24BwoogjJsIEcKonml1BrIlHY3WmHjgaPig=; b=FvyY42tfcyeICvL6J0NVcMS9MHpDgtle2bkeJpPeyxWOjfVcWJTGyPxGD/Zd9qRYn3 EhoOk+eKPp5TztJzaqsvNLuAyjvK6JOwQRuEhqp4KB/63brV0043/fJomA9NBZ/HW+yz sXOsA7XBAHXfKxk8wWDoQdgGfd/EGp2MmNfHm/mD2+HF8CxdsWmuiSUQb+AyjEWonhiU yQ09KfOEXNpL6JTZH1U3X0cAaX3HIG7wCetQ1GfUl4OVZyKsg99fyPc9HlXAgB1F1LGR MQa+f3RgJP6y+uQyu9ZjqmH997sNtiDkepP+AiZIeV4KQuGJJh2+hvvJ8JR/jBlIxyDk QbwA== X-Gm-Message-State: AOAM530nguVw3E4iqSpIkYVael1W7ZAl0WMb7y9W/5AQG2ELTYIHAAig QOl/ws/FckB94c3YHrd6YEYIklkefdpjO3V7gVLuCwHikjMyAQHHdgZkp1LlVQEMePU1o/WwDq2 MKY138G5pt6OR69r1BmdbsO2tObBdnEJZspROhoq/xnX4Znn8npPB8whAoQo7hKzYXfoW4gIfMH TrMHy5u/5m6h0= X-Google-Smtp-Source: ABdhPJyKN2fT8qu1eMxmjHd5suE8Ijv6p6AZvdB4GkIp074cTXuW4AMnamreFLaQIsfKZbLyB2DWXw== X-Received: by 2002:a17:90a:dd46:: with SMTP id u6mr3859376pjv.67.1602757301386; Thu, 15 Oct 2020 03:21:41 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:40 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 12/17] scsi:fnic: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:37 +0530 Message-Id: <1602732462-10443-13-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/fnic/fnic_main.c | 2 +- drivers/scsi/fnic/fnic_scsi.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 5f8a7ef8f6a8..f312b4be2846 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -100,7 +100,7 @@ static int fnic_slave_alloc(struct scsi_device *sdev) { struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; scsi_change_queue_depth(sdev, fnic_max_qdepth); diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index d1f7b84bbfe8..943b2bf7aaa4 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -452,7 +452,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ return 0; } - ret = fc_remote_port_chkready(rport); + ret = fc_remote_port_chkready(rport, sc); if (ret) { FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "rport is not ready\n"); @@ -1938,7 +1938,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) * port is up, then send abts to the remote port to terminate * the IO. Else, just locally terminate the IO in the firmware */ - if (fc_remote_port_chkready(rport) == 0) + if (fc_remote_port_chkready(rport, sc) == 0) task_req = FCPIO_ITMF_ABT_TASK; else { atomic64_inc(&fnic_stats->misc_stats.rport_not_ready); @@ -2364,7 +2364,7 @@ int fnic_device_reset(struct scsi_cmnd *sc) goto fnic_device_reset_end; /* Check if remote port up */ - if (fc_remote_port_chkready(rport)) { + if (fc_remote_port_chkready(rport, sc)) { atomic64_inc(&fnic_stats->misc_stats.rport_not_ready); goto fnic_device_reset_end; } From patchwork Thu Oct 15 03:27:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 352AD1580 for ; Thu, 15 Oct 2020 10:21:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B16222249 for ; Thu, 15 Oct 2020 10:21:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="a11SvQYU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389250AbgJOKVp (ORCPT ); Thu, 15 Oct 2020 06:21:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVp (ORCPT ); Thu, 15 Oct 2020 06:21:45 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59851C061755 for ; Thu, 15 Oct 2020 03:21:45 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id y14so1604732pgf.12 for ; Thu, 15 Oct 2020 03:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=42i1EVubyEeOXdRAb010a7Lx2ZRwVe+fs9iNXngBgEY=; b=a11SvQYUdhSJl8uIdI8mF17bf6vf/4Mqu0+yXGtm/C1CWchUaXviqx4TpM3f/AJ9c3 EIXOGrpfGw8G3WP+qD+nE5RaVI3djWK8OM+zanVGaABCsgB44tJOemeVjcACyoCEbo31 F3j/xAUXRjw2/dzGZr3g+rwYAmo12nC5YOCd4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=42i1EVubyEeOXdRAb010a7Lx2ZRwVe+fs9iNXngBgEY=; b=IUiW9H+SpLnR6JlaX9qT7SwAyLB1UohjMSnlkDDJAOY7+BtC7ffvHRdl4o+CbZ8doS qAxN9gJezcgmJOiMrQF/aG40ORr6hEDi6FASveORJFQMMc9ul7/4+Ew4JrBNicAO9pFv kPZK7YExokhxm0PMB8pPKn/qfkJPp+5Z4ow6YvUk6ZWWuz5/j2ZsE0OGWmMSKJHVB6XF KjGxQ8pKNS00/7Yvnvh2mWdfiHTQ7tEoBzidpunnlEDZyYKTym42wkhuw48Dzr592Lt+ oOg17QkD4pOlLTV1KJWWBPaxOA6ukkZ5GS2KpD0gXwKhz0cf3RDPpShNaBmMGZ8CRdYS ehTw== X-Gm-Message-State: AOAM530mbCXLxQv2Xm8gXTDHG5aN6ezHAN+nzhhkHhUNYY2Ex5T0uWxi kOXfZISZ/v/Kok082V5IGep0zS8bOlAvtQ1fzjgyV08CxZdik3sXwVdlDLi86FGk9AVvo6PNBSe uv2lle7QNzkWcJxo8m0px/tessqsKglpR5ZErgUDxcxAusU/zUl+BEpcIVUqpfwP97UaCt4kq6t ohMiOJ53VsjEQ= X-Google-Smtp-Source: ABdhPJzZ/eTN2aV3RuhpbZma3t8yID6o1FbB+9YBHl1N5IA7u2DfWkUiRCXHb7RAn9Heq/mfL++PMA== X-Received: by 2002:a65:620e:: with SMTP id d14mr2731109pgv.363.1602757304495; Thu, 15 Oct 2020 03:21:44 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:43 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 13/17] scsi:bnx2fc: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:38 +0530 Message-Id: <1602732462-10443-14-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/bnx2fc/bnx2fc_els.c | 2 +- drivers/scsi/bnx2fc/bnx2fc_io.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c index 754f2e82d955..aea0e2e6c8b4 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_els.c +++ b/drivers/scsi/bnx2fc/bnx2fc_els.c @@ -686,7 +686,7 @@ static int bnx2fc_initiate_els(struct bnx2fc_rport *tgt, unsigned int op, u32 did, sid; u16 xid; - rc = fc_remote_port_chkready(rport); + rc = fc_remote_port_chkready(rport, NULL); if (rc) { printk(KERN_ERR PFX "els 0x%x: rport not ready\n", op); rc = -EINVAL; diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 1a0dc18d6915..bed00287f8f1 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c @@ -1849,7 +1849,7 @@ int bnx2fc_queuecommand(struct Scsi_Host *host, int rc = 0; int rval; - rval = fc_remote_port_chkready(rport); + rval = fc_remote_port_chkready(rport, sc_cmd); if (rval) { sc_cmd->result = rval; sc_cmd->scsi_done(sc_cmd); From patchwork Thu Oct 15 03:27:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838867 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46BBE1744 for ; Thu, 15 Oct 2020 10:21:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DDAB22249 for ; Thu, 15 Oct 2020 10:21:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="HyYdyKae" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389252AbgJOKVs (ORCPT ); Thu, 15 Oct 2020 06:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVs (ORCPT ); Thu, 15 Oct 2020 06:21:48 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DDDC061755 for ; Thu, 15 Oct 2020 03:21:48 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id y14so1604797pgf.12 for ; Thu, 15 Oct 2020 03:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w4bhq/xMyxoG1rkdg2X4dHBzp4hLg7UaymYWxaYLxzc=; b=HyYdyKaeOZrwEk4K+7lIRCQ/3Od5okohbz9E7FfbzGL1JBPaF3xo9xQUGI/YBt499u 5XVy8CxVV+5pWoNYQh2tO87QHbAgxO8Gafhlf8KO711pGTH7SEYdWOW3q+8a9A73pj4k fW9LuRZORoi8Hx9ry5qGlcFLlSZAm6DJvvUjI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w4bhq/xMyxoG1rkdg2X4dHBzp4hLg7UaymYWxaYLxzc=; b=oZSqpyhNBE0YoXqxZXts36gCGuQliOMt4y5TjDvFbs5ZSsAiwBKcIf51HA7tV75vB+ frN8PmzW3bx0M/QZBLYrj4pnR9tkmJPBnnJeJt0osoiEeZrYQbv2mbaa0dxvYKA1eD6X Jru+p2fz3SDQJml72MErE/Av9Fw2aRIcNjfzV9FzW/SaaNvit6f2I6o7kzmnyil9poce NlHhSlmGBO/oMeX8g9MLWTBQyg3lEBoaw7ZVrvd1b98pQu9D2/P8tsBC4xt/W7e5V3IT 2uvHTTWdST6Ydxu3+yHSqcIbVsp9gEV0+WjFWs1iGmbpO7XYmYacbXHCtB3oP8jTXBKV 1pdA== X-Gm-Message-State: AOAM531AHrqhGwRdErn7P+k+2PNgsGeWY/LYqo/KaS7IyixtBpf4g+Pp hGJ0xXHpiIUW4kXZvMh6N52LIXCYvWoTK3kDU4ms1SrsYS/7PXuea7pwjmU+1SeNY/NkvVxLPYn D7FUUNaLCQZCeMs87Ld9A90yX/vYlMj3/qjUWZTVOxNxBv82lonLs509SWtSc+RCUdR6c9ZgCC/ Fi6ufzIAbVggQ= X-Google-Smtp-Source: ABdhPJxr8xYokhj9LMo+GKDAmh2M5257Azs0dNkFCPvyWQPTDi/hN9APp0M5Owy8s5Rio8Prxr7S2Q== X-Received: by 2002:a63:470a:: with SMTP id u10mr2878688pga.48.1602757307456; Thu, 15 Oct 2020 03:21:47 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:46 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 14/17] scsi:csio: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:39 +0530 Message-Id: <1602732462-10443-15-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/csiostor/csio_scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 55e74da2f3cb..2df093b49808 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -1788,7 +1788,7 @@ csio_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmnd) sqset = &hw->sqset[ln->portid][blk_mq_rq_cpu(cmnd->request)]; - nr = fc_remote_port_chkready(rport); + nr = fc_remote_port_chkready(rport, cmnd); if (nr) { cmnd->result = nr; CSIO_INC_STATS(scsim, n_rn_nr_error); @@ -2095,7 +2095,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd) * the former case, since LUN reset is a TMF I/O on the wire, and we * need a valid session to issue it. */ - if (fc_remote_port_chkready(rn->rport)) { + if (fc_remote_port_chkready(rn->rport, cmnd)) { csio_err(hw, "LUN reset cannot be issued on non-ready" " remote node ssni:0x%x (LUN:%llu)\n", @@ -2223,7 +2223,7 @@ csio_slave_alloc(struct scsi_device *sdev) { struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; sdev->hostdata = *((struct csio_lnode **)(rport->dd_data)); From patchwork Thu Oct 15 03:27:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 408C61580 for ; Thu, 15 Oct 2020 10:21:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16D4A2224A for ; Thu, 15 Oct 2020 10:21:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="QA2NYLcj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389257AbgJOKVv (ORCPT ); Thu, 15 Oct 2020 06:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389099AbgJOKVv (ORCPT ); Thu, 15 Oct 2020 06:21:51 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9A8C061755 for ; Thu, 15 Oct 2020 03:21:51 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id e10so1767681pfj.1 for ; Thu, 15 Oct 2020 03:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZpxT8338r2d2t8w/r7yQoJ8T+dt0cI+iYrUYzx7SyQ4=; b=QA2NYLcj1VXLOluGtxiUWsL7RaVSzttPFnuHiUVNf4KToog9+J8TCxjIEZAvUqShDr wfjQGl1Inj5Wl9rGlA/YgeHiqJkicYsD2Qg4MVTuCR8GOdzkJvl7SVwvIo2YC9GJJkqk Ls83hiHelIiJzid3TI6ZjxZs8/iSbvXFmu1Ns= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZpxT8338r2d2t8w/r7yQoJ8T+dt0cI+iYrUYzx7SyQ4=; b=suggv6xpIu9PCE/ecw7qAQsDqmX8apUVARiwJDQrKsY0rqh4KAKvBtcIvYsnsFzuTR otgplnSfx/Hp8xhfRruuRDDK8apOlxKVDWPfXohmcizMdilfSm9CttZUNLj8wDPxfDhR 9jXtwb/MORdPo0vAzmUsWVMBTWE/YrYZJFTD4SQaSG4kC4kQH3gmJbhFvdSntTAX1O/l RsXY19cXsT6SIfqBvFCA/1qvVlT/M8QPrQcyeKyFjeXF1/CdEZsa8pj8rEe1LGdgWL86 cXUivobEMT4ZUHi3Nye913A0DY7DPSTs25iaSNApbG4SUOabLD9AAKEOKiqAPu4X5b7H /5aA== X-Gm-Message-State: AOAM5302U9nrHKYX87xwjOvNg0mvjhuPLJfeqVquVGmpO49QVQuvhj4u QD70mpxyr2QCewLvHjBuWAF4TivmVlxH8x6/i5vYUwUhb17iHBtp+jvo90BWwXSLOF8G/0QEM4l Uczfgv7FGnucistdtzINCMW+HF7POu0BpNavhbDk7Kd5TqWnans5j7rjUbIFyfW44V3e4pr7CDx ncgAEwjYioGLI= X-Google-Smtp-Source: ABdhPJyKj5vooWcoc0Xi8ZfLkI+zzhVyVFBk0MZw3YMUxXn3pH43RNGfOUC1fqBYOvt2MdU2RU5MXw== X-Received: by 2002:a63:ba49:: with SMTP id l9mr2891509pgu.246.1602757310373; Thu, 15 Oct 2020 03:21:50 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:49 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 15/17] scsi:bfa: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:40 +0530 Message-Id: <1602732462-10443-16-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/scsi/bfa/bfad_im.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 22f06be2606f..550ce8cdbce2 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -956,7 +956,7 @@ bfad_im_slave_alloc(struct scsi_device *sdev) struct bfad_itnim_data_s *itnim_data; struct bfa_s *bfa; - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; itnim_data = (struct bfad_itnim_data_s *) rport->dd_data; @@ -1213,7 +1213,7 @@ bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd int sg_cnt = 0; struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); - rc = fc_remote_port_chkready(rport); + rc = fc_remote_port_chkready(rport, cmnd); if (rc) { cmnd->result = rc; done(cmnd); From patchwork Thu Oct 15 03:27:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838871 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13B3C1744 for ; Thu, 15 Oct 2020 10:21:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE2D42224A for ; Thu, 15 Oct 2020 10:21:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="XmppoG7R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389099AbgJOKVy (ORCPT ); Thu, 15 Oct 2020 06:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbgJOKVy (ORCPT ); Thu, 15 Oct 2020 06:21:54 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D0B4C061755 for ; Thu, 15 Oct 2020 03:21:54 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 10so1757444pfp.5 for ; Thu, 15 Oct 2020 03:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5X+ysws4DMlER2UbEO7uC9vgi++xt8Bhpe5IylL+I+k=; b=XmppoG7RJFsOK8Kgxg8fcrb1S0uxDNtUq6igYFWzzb3jhXa2eef+J5dT8NRt0olgG/ r3ouxh8TJiKFbqUo9+FJ5f1mJFyPcBqGQx0kv//gudfO/RCRzIIaFFXbvc0yWWsfzDKw gVWUfuNtwhRNs4OPCEeKSJpmzEAlof3a3uMpU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5X+ysws4DMlER2UbEO7uC9vgi++xt8Bhpe5IylL+I+k=; b=dKWpJBmAhBRXpdd9qvjP3LBwd9iDKQeZdfHeeXPIbNRbj0gpHZ//020ZSg4SVqybHc 1EfbU281t6UeWtLWsvlCZoc8uZ5TLcpP+VouaA2FFv3r0Vooq2/NhBqB4x433lhoXZSG UxAagEEHD7vSn142zqIfdKkmF2J9rqVzRnHzVlTDltRI0iC7dyFgCpsj7WGxZOODGrwC Cxi4NGbdjLuG0kN3Sku9Z+KUcd3QOvzj/4EtIXdArppEReIbz9BHP45Cnuu9MA2MmRJB koLPycnqaxA4bPy7dMPdxUovYr+SEeb1GTG9vPVnfWTwOMenS9JzPE3ygTqJ4N4+a9k2 Z/nA== X-Gm-Message-State: AOAM533Vcq84ibZMnxjv6BqxP6ukZHOKZ3v5lIOH07NPWgliCCzs6389 FqKrZoNPz8nza31um81r1XrE8SXiidjO985vHOMcTa4PGMeSnzYG7fSBzR1fY0dX62FTeYBdg10 vf3d2+n3V7r+ytPh/ADcqH6gT1Xz8Jn4T7OZXSUW3mufsewYw+QeR2p99vdRW6qJAi0ojP8t7XL o2N+mvAUU/FYk= X-Google-Smtp-Source: ABdhPJzzIaSZNnHOqxadL9OyXKkUPrnchbLJUhCjv+XkY0OZaROK0wxFVdD/s8kFhiNcap8m8p0rEA== X-Received: by 2002:a62:8389:0:b029:152:416d:f026 with SMTP id h131-20020a6283890000b0290152416df026mr3573469pfe.64.1602757313300; Thu, 15 Oct 2020 03:21:53 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:52 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 16/17] scsi:zfcp: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:41 +0530 Message-Id: <1602732462-10443-17-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra Reviewed-by: Benjamin Block --- v3: New Patch --- drivers/s390/scsi/zfcp_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index d58bf79892f2..732e15e3a839 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -74,7 +74,7 @@ int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) scpnt->result = 0; scpnt->host_scribble = NULL; - scsi_result = fc_remote_port_chkready(rport); + scsi_result = fc_remote_port_chkready(rport, scpnt); if (unlikely(scsi_result)) { scpnt->result = scsi_result; zfcp_dbf_scsi_fail_send(scpnt); From patchwork Thu Oct 15 03:27:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11838873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 226B017C9 for ; Thu, 15 Oct 2020 10:21:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB9A72224A for ; Thu, 15 Oct 2020 10:21:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="I4Cf3uDj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389261AbgJOKV5 (ORCPT ); Thu, 15 Oct 2020 06:21:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389258AbgJOKV5 (ORCPT ); Thu, 15 Oct 2020 06:21:57 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14916C061755 for ; Thu, 15 Oct 2020 03:21:57 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id n9so1617771pgt.8 for ; Thu, 15 Oct 2020 03:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7QFVfyHO4AIyGbvZ7y0VU0rKvXYixIV0W1gR8F9fOrU=; b=I4Cf3uDjIDBii45GFub9btzd+CQr/fd2tTofzmuTNLQ/uOLP9ZkScGCD0xvQnEtS2w K/jcFuKwopkJvw1y0Odtn4y/DaV0Qw9euBKjqpzXStzYsWLqqJ8agLl1DPGJ+3iiAYBJ UhZPC4ttD/ExTGiLxp5DbAMpyDOj+SpB7Wb2s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7QFVfyHO4AIyGbvZ7y0VU0rKvXYixIV0W1gR8F9fOrU=; b=ulPi3Av6KtV3921M/C9CWreIjxfE42B6K+4EQjNKdjMU0QB6VRF5mXL1Q9zfvZAdwG lD6gf5x/LSYyp3WSJpWLa+2Myr3wxt+8RV8IAiPBkrOjyK/m9C+8BGCS77NMfHbMWaND kPJ81Xvt+sGjz7bddXDSI1054ddZWJlBl8y6Om4aT5rgcZaComC+RmNP6dohmgNB5d45 nFldDJZtO2iOZMgy8XwJUKy4yvO530zl9OJRj6+0Ue3KYGP67NMunkJIMRf+KfPlpCyl oGmV0iYxE5eoLNgp7dFT5Jog6+UL34LFke3JhcUJT9ctym0dcpKstCGUbtWw3GmNWax3 sArA== X-Gm-Message-State: AOAM53095lEKcvcoi2ZPvr73wDk5nQWRY+ALpn+/c0UlQrkLpDs1tXiF RIRZoWN4reCINnfTbykBArwHKS2uARw5kENTch7V0z/p3p/Ll5bcXHJ9AYKZAMdxEr9/XylYw6g tZ6HesKRwNrprkmvjOoxydytOp+dAs3wHP7VUATHQ7XdodGEdE45hW6wUEmjsFhQSSsMa02cl7U ymeN65bRdMnHQ= X-Google-Smtp-Source: ABdhPJx3aGiJGiE6gvfvxHXA9fcAVe8gFmeUhpTme0ntZ9V0LTiIDjh6n8E+QaDvGPdeipOOx7E+4w== X-Received: by 2002:aa7:875a:0:b029:155:7c08:f2ed with SMTP id g26-20020aa7875a0000b02901557c08f2edmr3663691pfo.52.1602757316208; Thu, 15 Oct 2020 03:21:56 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 194sm2802258pfz.182.2020.10.15.03.21.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2020 03:21:55 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v3 17/17] scsi:mpt: Added changes to fc_remote_port_chkready Date: Thu, 15 Oct 2020 08:57:42 +0530 Message-Id: <1602732462-10443-18-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> References: <1602732462-10443-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added changes to pass a new argument to fc_remote_port_chkready Signed-off-by: Muneendra --- v3: New Patch --- drivers/message/fusion/mptfc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index f92b0433f599..e6f7fa891455 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -199,7 +199,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, hd = shost_priv(SCpnt->device->host); ioc = hd->ioc; spin_lock_irqsave(shost->host_lock, flags); - while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY + while ((ready = fc_remote_port_chkready(rport, SCpnt) >> 16) == DID_IMM_RETRY || (loops > 0 && ioc->active == 0)) { spin_unlock_irqrestore(shost->host_lock, flags); dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT @@ -606,7 +606,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) starget = scsi_target(sdev); rport = starget_to_rport(starget); - if (!rport || fc_remote_port_chkready(rport)) + if (!rport || fc_remote_port_chkready(rport, NULL)) return -ENXIO; hd = shost_priv(sdev->host); @@ -653,7 +653,7 @@ mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) return 0; } - err = fc_remote_port_chkready(rport); + err = fc_remote_port_chkready(rport, SCpnt); if (unlikely(err)) { SCpnt->result = err; SCpnt->scsi_done(SCpnt);