Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1337850rdh; Fri, 27 Oct 2023 11:04:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzp1Lkf7Xj+M3nzxWQgz7evWBIB5avBNWB7de/1k4btCrsZP689PsEwqxWwUHPcWLTSIOt X-Received: by 2002:a67:c004:0:b0:457:cd98:490b with SMTP id v4-20020a67c004000000b00457cd98490bmr3938775vsi.0.1698429864202; Fri, 27 Oct 2023 11:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698429864; cv=none; d=google.com; s=arc-20160816; b=Cqtr5clWjsYpYviQw6aZiUWXV1xOq+Rm/KbNPccaxAuQLA1fvec2wXlXcpJOITHGH8 a/0uTSRQCxydVcgm31fUDhPFJdkU69WePY2cmdBc+WW45zGP/dgiY2xNoqDArKHVSs0N xo2ix0OiOiQ57XAeKpHO9eldY8a/J2F8QlvgwF9keGOCrVOSj/Yg+dHL697fn716aewI 9tJw7PgW3BIwuJ4DxAyo8YLV8ThlOoUoioQ4ZoaHz96+5djLvdpgfYmnRMI36JrUCWx5 ckQ4q5fWRKINVXVvNaT8D1ctotxkBH8B/hviMRCm4V5m9U3JVDkMuYyuTuad5eXFG/UE 4S8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1D6OFyw4RNHfPlxgw5qFNbr6To2OoRiKFym8MHW4nCk=; fh=bKSAdOD9sjDLFpuVEw2QY/iOhn17PgYAzgX/PkCBS1w=; b=zbF4t30+LVySyEV1mymONrNqUFTTJmmO29mYo5hyRIKxug59ic/VxqgaaM8PMFlc5N EAV3+rAeWi3yoOuzY803d1nPBojFK/IferALrCgCpZRSEkcNL4ph88koodT0k0PyyyFv mlLt4Qtfay8AWw7gz+cjHnhrhm4HPDyEQRhk+IpucFUuDw3osVZf7vYmKcxXSa3ucYcB Cq/Q6SaXnhu90AhDPx3mqbUir7xYcn2cxqw+IQWb+TEoJEBatQlfEMWtnwntTZc7wTIm P8mN6NG87lr2/Y+btqL/Zt5nueXdht8EUNrYo0GWKIdCfhAqLSrYUwc4KxjcBh4c9rCS NEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=cfBCav95; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b19-20020a056102233300b0044c0364a39esi348569vsa.711.2023.10.27.11.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:04:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=cfBCav95; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8A5A682F9270; Fri, 27 Oct 2023 11:04:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346249AbjJ0SEM (ORCPT + 99 others); Fri, 27 Oct 2023 14:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346410AbjJ0SDz (ORCPT ); Fri, 27 Oct 2023 14:03:55 -0400 Received: from alln-iport-8.cisco.com (alln-iport-8.cisco.com [173.37.142.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A84810CE; Fri, 27 Oct 2023 11:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3879; q=dns/txt; s=iport; t=1698429824; x=1699639424; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hZgDvmmCEAxvPN4JkZ38Ljv3qILjjtSEDDA9V6Ihu/s=; b=cfBCav95SGczJCxmrOQ1+u8vSc15WxQuuaOo7mRDbGsV5T31PcvqbPyp WQZtpls+yQiNwun8pATLmxxBdMTp5jfPm/Fb6HoNoqKT5tr/hJcEO4mPI dZEbsiYfm2kFYxkhtJWCI6SuD6DVmxKP9cz20mqB4RlpZ7eXXllKyyv3F g=; X-CSE-ConnectionGUID: +dRoE+PVTdWIfHCNLxoZCg== X-CSE-MsgGUID: S5qad4KTQNmigAWMqLmvOw== X-IronPort-AV: E=Sophos;i="6.03,256,1694736000"; d="scan'208";a="181166900" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by alln-iport-8.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 18:03:42 +0000 Received: from localhost.cisco.com ([10.193.101.253]) (authenticated bits=0) by rcdn-core-11.cisco.com (8.15.2/8.15.2) with ESMTPSA id 39RI39Ol029226 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Oct 2023 18:03:41 GMT From: Karan Tilak Kumar To: sebaddel@cisco.com Cc: arulponn@cisco.com, djhawar@cisco.com, gcboffa@cisco.com, mkai2@cisco.com, satishkh@cisco.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Karan Tilak Kumar Subject: [PATCH v2 09/13] scsi: fnic: Remove usage of host_lock Date: Fri, 27 Oct 2023 11:02:58 -0700 Message-Id: <20231027180302.418676-10-kartilak@cisco.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231027180302.418676-1-kartilak@cisco.com> References: <20231027180302.418676-1-kartilak@cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-User: kartilak@cisco.com X-Outbound-SMTP-Client: 10.193.101.253, [10.193.101.253] X-Outbound-Node: rcdn-core-11.cisco.com X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:04:19 -0700 (PDT) Remove usage of host_lock. Replace with fnic_lock, where necessary. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Signed-off-by: Karan Tilak Kumar --- drivers/scsi/fnic/fnic_scsi.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index f32781f8fdd0..9a1beb3e7269 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -170,17 +170,14 @@ __fnic_set_state_flags(struct fnic *fnic, unsigned long st_flags, unsigned long clearbits) { unsigned long flags = 0; - unsigned long host_lock_flags = 0; spin_lock_irqsave(&fnic->fnic_lock, flags); - spin_lock_irqsave(fnic->lport->host->host_lock, host_lock_flags); if (clearbits) fnic->state_flags &= ~st_flags; else fnic->state_flags |= st_flags; - spin_unlock_irqrestore(fnic->lport->host->host_lock, host_lock_flags); spin_unlock_irqrestore(&fnic->fnic_lock, flags); return; @@ -479,12 +476,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc) atomic_inc(&fnic->in_flight); - /* - * Release host lock, use driver resource specific locks from here. - * Don't re-enable interrupts in case they were disabled prior to the - * caller disabling them. - */ - spin_unlock(lp->host->host_lock); fnic_priv(sc)->state = FNIC_IOREQ_NOT_INITED; fnic_priv(sc)->flags = FNIC_NO_FLAGS; @@ -569,8 +560,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc) mempool_free(io_req, fnic->io_req_pool); } atomic_dec(&fnic->in_flight); - /* acquire host lock before returning to SCSI */ - spin_lock(lp->host->host_lock); return ret; } else { atomic64_inc(&fnic_stats->io_stats.active_ios); @@ -598,8 +587,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc) spin_unlock_irqrestore(io_lock, flags); atomic_dec(&fnic->in_flight); - /* acquire host lock before returning to SCSI */ - spin_lock(lp->host->host_lock); return ret; } @@ -1477,18 +1464,17 @@ static inline int fnic_queue_abort_io_req(struct fnic *fnic, int tag, struct fnic_io_req *io_req) { struct vnic_wq_copy *wq = &fnic->hw_copy_wq[0]; - struct Scsi_Host *host = fnic->lport->host; struct misc_stats *misc_stats = &fnic->fnic_stats.misc_stats; unsigned long flags; - spin_lock_irqsave(host->host_lock, flags); + spin_lock_irqsave(&fnic->fnic_lock, flags); if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED))) { - spin_unlock_irqrestore(host->host_lock, flags); + spin_unlock_irqrestore(&fnic->fnic_lock, flags); return 1; } else atomic_inc(&fnic->in_flight); - spin_unlock_irqrestore(host->host_lock, flags); + spin_unlock_irqrestore(&fnic->fnic_lock, flags); spin_lock_irqsave(&fnic->wq_copy_lock[0], flags); @@ -1923,20 +1909,19 @@ static inline int fnic_queue_dr_io_req(struct fnic *fnic, struct fnic_io_req *io_req) { struct vnic_wq_copy *wq = &fnic->hw_copy_wq[0]; - struct Scsi_Host *host = fnic->lport->host; struct misc_stats *misc_stats = &fnic->fnic_stats.misc_stats; struct scsi_lun fc_lun; int ret = 0; unsigned long intr_flags; - spin_lock_irqsave(host->host_lock, intr_flags); + spin_lock_irqsave(&fnic->fnic_lock, intr_flags); if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED))) { - spin_unlock_irqrestore(host->host_lock, intr_flags); + spin_unlock_irqrestore(&fnic->fnic_lock, intr_flags); return FAILED; } else atomic_inc(&fnic->in_flight); - spin_unlock_irqrestore(host->host_lock, intr_flags); + spin_unlock_irqrestore(&fnic->fnic_lock, intr_flags); spin_lock_irqsave(&fnic->wq_copy_lock[0], intr_flags); -- 2.31.1