From patchwork Tue May 24 06:15:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 576199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 516A3C433EF for ; Tue, 24 May 2022 06:16:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234812AbiEXGQc (ORCPT ); Tue, 24 May 2022 02:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234347AbiEXGQP (ORCPT ); Tue, 24 May 2022 02:16:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD4871145C for ; Mon, 23 May 2022 23:16:12 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id E7F8121A57; Tue, 24 May 2022 06:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1653372970; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TIvrQ462R+eF1sPkMKiFUKQXOs8xzYLjraEVlKJzRlM=; b=LSJqzHsrgZ9H5m+DPWN+vFen4yDXR9ClRDFlRWYIrfu+6seKgM9n93q8iBVhm6AQnJySS9 bNZYzjETvmiHaeXSwlXMkzQEoYB6JXinzpIbr4aGhQkmlvc4UnKNK95JtGvNcb9zUoSiF8 zS/KnI6fX0H5oij+WxZql2VYgxRTVu0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1653372970; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TIvrQ462R+eF1sPkMKiFUKQXOs8xzYLjraEVlKJzRlM=; b=nK7o0UPcQADd2n9j8QX3FVXVdOyl8ZCQTX+fQRHtl9PdGue6l/eq4jeNPTvCMrzRKqRHrI fO1Pry/JRu5/KOBQ== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id C95882C14F; Tue, 24 May 2022 06:16:10 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 16045) id B6E88519464C; Tue, 24 May 2022 08:16:10 +0200 (CEST) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke , Johannes Thumshirn Subject: [PATCH 10/16] fnic: use fc_block_rport() correctly Date: Tue, 24 May 2022 08:15:56 +0200 Message-Id: <20220524061602.86760-11-hare@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220524061602.86760-1-hare@suse.de> References: <20220524061602.86760-1-hare@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use fc_block_rport() instead of fc_block_scsi_eh() and evaluate the return value to avoid issuing TMF commands when the port is still blocked. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/scsi/fnic/fnic_scsi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 3d64877bda8d..694957dc1ce2 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -1733,9 +1733,6 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) unsigned long abt_issued_time; DECLARE_COMPLETION_ONSTACK(tm_done); - /* Wait for rport to unblock */ - fc_block_scsi_eh(sc); - /* Get local-port, check ready and link up */ lp = shost_priv(sc->device->host); @@ -1745,6 +1742,10 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) term_stats = &fnic->fnic_stats.term_stats; rport = starget_to_rport(scsi_target(sc->device)); + ret = fc_block_rport(rport); + if (ret) + return ret; + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "Abort Cmd called FCID 0x%x, LUN 0x%llx TAG %x flags %x\n",