Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp842868lqe; Sun, 7 Apr 2024 06:33:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0r2caaMOs6LsNPhZyzyNeefwm3y1QO8puihZsDBYXcyMMiKa4nMlE4WDX5vjlqhF2qKojGOxg1JSDw67F9BwN6aeF+9GG8quQfJ2RFg== X-Google-Smtp-Source: AGHT+IEnVOWURF4uqRZeYKoK480ldPGVfW318BARBV10w6RYKED5irqWyU2l6u8kb1DEwkMzDeFE X-Received: by 2002:a2e:97d5:0:b0:2d6:cd05:1894 with SMTP id m21-20020a2e97d5000000b002d6cd051894mr3345189ljj.0.1712496801251; Sun, 07 Apr 2024 06:33:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712496801; cv=pass; d=google.com; s=arc-20160816; b=Y1DaW5243Wj7NB1q7kbfdsJHufETnTEy3AhWMskVI6Dxi0gbkmmi1tGTvQ9m/Tm0dQ 3KH1k0UP5dTfi+Wxfn91WHYkRsgJkqfLD2lfGMNtcy2pnI/n3Pm/mz5G9h84rxueC52h oada/PLGDVuSMs9oe4YH9bDK4bgBfdNwlFeExims2J4kE0esfS4kbhxcTYllVFUlnfai 8mXAEBiJS0uXQOQhJbxmljH0KdKiWReXxpd8I/PVGfB85UxTb0I8t/M+10NjkMLzhtjf S1T1FOEzvFpnIv03H78LyCMNZ7E8jxm+YyrR4K1AXW8bWrpd1y3a+ZzM7QIjAlyASJF+ LXFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gCybcwTD6wFOKIFB1IWzIFqR0cSDX9d1eWzJxXij7Tg=; fh=qTNSCfO9t2dECpaNfQOtQJvyml0J7d5yxS3p6ukKy9I=; b=ctu0ppBOWYYPnYQSUcrXzHxOHu1ftFAvfVRziNUq5AzhkeAP5Yns2+SaiZ20VAYavh ILWc5u3YK144XnnOhk9W2oc4hChWVS+zT6AIw3o+L4ESAS8X9LKYBA7E7wE+iZaEugBs ZvDOuRH51uDWHhtwTCzVRy1ckhMPDBPFZBJ/Nzb6TcYIb0Qupy9LBR92d/tz3Uy0T8m7 93tQVUzUQm4r9G7HJQieft203lgtGGJW0HIiUbfBj573tdKVJuGbqTAYRSyIcnPjbElY lTVjuRL6HNDWYR8Yilfsr5JY2B6aIxzxv0xuyHQnEUweehA53rcbPaCLlKbbfuRQYUMM oDgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QSHHswxx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r18-20020a056402235200b0056c3b5f50b2si1788869eda.118.2024.04.07.06.33.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 06:33:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QSHHswxx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CB5E21F21263 for ; Sun, 7 Apr 2024 13:33:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EA103FB82; Sun, 7 Apr 2024 13:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QSHHswxx" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA2DE12FB0E; Sun, 7 Apr 2024 13:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712495613; cv=none; b=fHkcVkAwP4aAh0Ivjc4Ordb1YjiC7lFO9ZlSLGW4vIstvAj7KfI/LNXLt/AapRAzuZi4evD1tYu1VvPYJEc7KT4VERXXadCvIB/yTKFMpM7GAhTD+hIqRvcCz54TE8lG4G/QIsG1T7iTJGN5zmDI/CMgymJ3DAHcEHHuRepagC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712495613; c=relaxed/simple; bh=MYI9hucmJjrC1y+/yT6Q0wmTFDq0qLdPEo07FDuWJbg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H1VDV3YdGO0Y28yoH/LUlbpduJZxX83FkxgIpCIHVsnMoJneGpnr0f5Pc0PbQR54UORSrtIJAxTKKpyXvdmN7XjINYbLEHR5rC9s9J/71d6cN5wmvrlm0DLVrEfVAre3LnMY/MV6VM6aHJP4PsIrhgq8pR414poSYe5PXrMnz/M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QSHHswxx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65E22C433F1; Sun, 7 Apr 2024 13:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712495613; bh=MYI9hucmJjrC1y+/yT6Q0wmTFDq0qLdPEo07FDuWJbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSHHswxxY2R5Ilvo/RBItWyhheRRRaD3Qg74bNwgOQFGRFvTiqbRThI1Gf3+r1Zjx 7GCXRObiZQwVzAQLlHVTVWx+3Oc3abbeW/pDgWG4LkepOZJvyZjmE1d5oby6rFGCbg 15zYnshK50Q9Ba493XGGrBauOnJyjW6gyyubJ41w4pw3voABZeLNmtS3DcjBQN73S+ sQ98CAKnwmbTf38slmfLiS3UvQkBFEFgEQE3AxNZerK8sLxgUc4FDgaQiYYb00X2td LywikdnVt8XFu3SWLgxeRyLmTlOi+HTCxo/2cp2mAdEMIcqTSjIIUR1cSGE+xvDUBL Vp/Gb2sUNRRUA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Saurav Kashyap , Guangwu Zhang , Nilesh Javali , "Martin K . Petersen" , Sasha Levin , jhasan@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 10/13] scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload Date: Sun, 7 Apr 2024 09:13:09 -0400 Message-ID: <20240407131316.1052393-10-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240407131316.1052393-1-sashal@kernel.org> References: <20240407131316.1052393-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.84 Content-Transfer-Encoding: quoted-printable From: Saurav Kashyap [ Upstream commit c214ed2a4dda35b308b0b28eed804d7ae66401f9 ] The session resources are used by FW and driver when session is offloaded, once session is uploaded these resources are not used. The lock is not required as these fields won't be used any longer. The offload and upload calls are sequential, hence lock is not required. This will suppress following BUG_ON(): [ 449.843143] ------------[ cut here ]------------ [ 449.848302] kernel BUG at mm/vmalloc.c:2727! [ 449.853072] invalid opcode: 0000 [#1] PREEMPT SMP PTI [ 449.858712] CPU: 5 PID: 1996 Comm: kworker/u24:2 Not tainted 5.14.0-118.= el9.x86_64 #1 Rebooting. [ 449.867454] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.3.4 1= 1/08/2016 [ 449.876966] Workqueue: fc_rport_eq fc_rport_work [libfc] [ 449.882910] RIP: 0010:vunmap+0x2e/0x30 [ 449.887098] Code: 00 65 8b 05 14 a2 f0 4a a9 00 ff ff 00 75 1b 55 48 89 = fd e8 34 36 79 00 48 85 ed 74 0b 48 89 ef 31 f6 5d e9 14 fc ff ff 5d c3 <0f= > 0b 0f 1f 44 00 00 41 57 41 56 49 89 ce 41 55 49 89 fd 41 54 41 [ 449.908054] RSP: 0018:ffffb83d878b3d68 EFLAGS: 00010206 [ 449.913887] RAX: 0000000080000201 RBX: ffff8f4355133550 RCX: 000000000d4= 00005 [ 449.921843] RDX: 0000000000000001 RSI: 0000000000001000 RDI: ffffb83da53= f5000 [ 449.929808] RBP: ffff8f4ac6675800 R08: ffffb83d878b3d30 R09: 00000000000= efbdf [ 449.937774] R10: 0000000000000003 R11: ffff8f434573e000 R12: 00000000000= 01000 [ 449.945736] R13: 0000000000001000 R14: ffffb83da53f5000 R15: ffff8f43d4e= a3ae0 [ 449.953701] FS: 0000000000000000(0000) GS:ffff8f529fc80000(0000) knlGS:= 0000000000000000 [ 449.962732] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 449.969138] CR2: 00007f8cf993e150 CR3: 0000000efbe10003 CR4: 00000000003= 706e0 [ 449.977102] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 00000000000= 00000 [ 449.985065] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 00000000000= 00400 [ 449.993028] Call Trace: [ 449.995756] __iommu_dma_free+0x96/0x100 [ 450.000139] bnx2fc_free_session_resc+0x67/0x240 [bnx2fc] [ 450.006171] bnx2fc_upload_session+0xce/0x100 [bnx2fc] [ 450.011910] bnx2fc_rport_event_handler+0x9f/0x240 [bnx2fc] [ 450.018136] fc_rport_work+0x103/0x5b0 [libfc] [ 450.023103] process_one_work+0x1e8/0x3c0 [ 450.027581] worker_thread+0x50/0x3b0 [ 450.031669] ? rescuer_thread+0x370/0x370 [ 450.036143] kthread+0x149/0x170 [ 450.039744] ? set_kthread_struct+0x40/0x40 [ 450.044411] ret_from_fork+0x22/0x30 [ 450.048404] Modules linked in: vfat msdos fat xfs nfs_layout_nfsv41_file= s rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver dm_service_time qedf qed c= rc8 bnx2fc libfcoe libfc scsi_transport_fc intel_rapl_msr intel_rapl_common= x86_pkg_temp_thermal intel_powerclamp dcdbas rapl intel_cstate intel_uncor= e mei_me pcspkr mei ipmi_ssif lpc_ich ipmi_si fuse zram ext4 mbcache jbd2 l= oop nfsv3 nfs_acl nfs lockd grace fscache netfs irdma ice sd_mod t10_pi sg = ib_uverbs ib_core 8021q garp mrp stp llc mgag200 i2c_algo_bit drm_kms_helpe= r syscopyarea sysfillrect sysimgblt mxm_wmi fb_sys_fops cec crct10dif_pclmu= l ahci crc32_pclmul bnx2x drm ghash_clmulni_intel libahci rfkill i40e libat= a megaraid_sas mdio wmi sunrpc lrw dm_crypt dm_round_robin dm_multipath dm_= snapshot dm_bufio dm_mirror dm_region_hash dm_log dm_zero dm_mod linear rai= d10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid= 6_pq libcrc32c crc32c_intel raid1 raid0 iscsi_ibft squashfs be2iscsi bnx2i = cnic uio cxgb4i cxgb4 tls [ 450.048497] libcxgbi libcxgb qla4xxx iscsi_boot_sysfs iscsi_tcp libiscs= i_tcp libiscsi scsi_transport_iscsi edd ipmi_devintf ipmi_msghandler [ 450.159753] ---[ end trace 712de2c57c64abc8 ]--- Reported-by: Guangwu Zhang Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20240315071427.31842-1-skashyap@marvell.com Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/bnx2fc/bnx2fc_tgt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_= tgt.c index 2c246e80c1c4d..d91659811eb3c 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c +++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c @@ -833,7 +833,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba = *hba, =20 BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n"); =20 - spin_lock_bh(&tgt->cq_lock); ctx_base_ptr =3D tgt->ctx_base; tgt->ctx_base =3D NULL; =20 @@ -889,7 +888,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba = *hba, tgt->sq, tgt->sq_dma); tgt->sq =3D NULL; } - spin_unlock_bh(&tgt->cq_lock); =20 if (ctx_base_ptr) iounmap(ctx_base_ptr); --=20 2.43.0