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 X-Patchwork-Id: 269784 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38C3FC433E7 for ; Thu, 15 Oct 2020 10:21:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9BAD2224A 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);