<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/scsi/bnx2fc, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-02-03T08:27:53Z</updated>
<entry>
<title>scsi: bnx2fc: Flush destroy_work queue before calling bnx2fc_interface_put()</title>
<updated>2022-02-03T08:27:53Z</updated>
<author>
<name>John Meneghini</name>
</author>
<published>2022-01-15T04:00:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a12fe8248a38437b95b942bbe85aced72e6e2eb'/>
<id>urn:sha1:2a12fe8248a38437b95b942bbe85aced72e6e2eb</id>
<content type='text'>
commit 847f9ea4c5186fdb7b84297e3eeed9e340e83fce upstream.

The bnx2fc_destroy() functions are removing the interface before calling
destroy_work. This results multiple WARNings from sysfs_remove_group() as
the controller rport device attributes are removed too early.

Replace the fcoe_port's destroy_work queue. It's not needed.

The problem is easily reproducible with the following steps.

Example:

  $ dmesg -w &amp;
  $ systemctl enable --now fcoe
  $ fipvlan -s -c ens2f1
  $ fcoeadm -d ens2f1.802
  [  583.464488] host2: libfc: Link down on port (7500a1)
  [  583.472651] bnx2fc: 7500a1 - rport not created Yet!!
  [  583.490468] ------------[ cut here ]------------
  [  583.538725] sysfs group 'power' not found for kobject 'rport-2:0-0'
  [  583.568814] WARNING: CPU: 3 PID: 192 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
  [  583.607130] Modules linked in: dm_service_time 8021q garp mrp stp llc bnx2fc cnic uio rpcsec_gss_krb5 auth_rpcgss nfsv4 ...
  [  583.942994] CPU: 3 PID: 192 Comm: kworker/3:2 Kdump: loaded Not tainted 5.14.0-39.el9.x86_64 #1
  [  583.984105] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013
  [  584.016535] Workqueue: fc_wq_2 fc_rport_final_delete [scsi_transport_fc]
  [  584.050691] RIP: 0010:sysfs_remove_group+0x6f/0x80
  [  584.074725] Code: ff 5b 48 89 ef 5d 41 5c e9 ee c0 ff ff 48 89 ef e8 f6 b8 ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 ...
  [  584.162586] RSP: 0018:ffffb567c15afdc0 EFLAGS: 00010282
  [  584.188225] RAX: 0000000000000000 RBX: ffffffff8eec4220 RCX: 0000000000000000
  [  584.221053] RDX: ffff8c1586ce84c0 RSI: ffff8c1586cd7cc0 RDI: ffff8c1586cd7cc0
  [  584.255089] RBP: 0000000000000000 R08: 0000000000000000 R09: ffffb567c15afc00
  [  584.287954] R10: ffffb567c15afbf8 R11: ffffffff8fbe7f28 R12: ffff8c1486326400
  [  584.322356] R13: ffff8c1486326480 R14: ffff8c1483a4a000 R15: 0000000000000004
  [  584.355379] FS:  0000000000000000(0000) GS:ffff8c1586cc0000(0000) knlGS:0000000000000000
  [  584.394419] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  [  584.421123] CR2: 00007fe95a6f7840 CR3: 0000000107674002 CR4: 00000000000606e0
  [  584.454888] Call Trace:
  [  584.466108]  device_del+0xb2/0x3e0
  [  584.481701]  device_unregister+0x13/0x60
  [  584.501306]  bsg_unregister_queue+0x5b/0x80
  [  584.522029]  bsg_remove_queue+0x1c/0x40
  [  584.541884]  fc_rport_final_delete+0xf3/0x1d0 [scsi_transport_fc]
  [  584.573823]  process_one_work+0x1e3/0x3b0
  [  584.592396]  worker_thread+0x50/0x3b0
  [  584.609256]  ? rescuer_thread+0x370/0x370
  [  584.628877]  kthread+0x149/0x170
  [  584.643673]  ? set_kthread_struct+0x40/0x40
  [  584.662909]  ret_from_fork+0x22/0x30
  [  584.680002] ---[ end trace 53575ecefa942ece ]---

Link: https://lore.kernel.org/r/20220115040044.1013475-1-jmeneghi@redhat.com
Fixes: 0cbf32e1681d ("[SCSI] bnx2fc: Avoid calling bnx2fc_if_destroy with unnecessary locks")
Tested-by: Guangwu Zhang &lt;guazhang@redhat.com&gt;
Co-developed-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Signed-off-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Signed-off-by: John Meneghini &lt;jmeneghi@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scsi: bnx2fc: Fix Kconfig warning &amp; CNIC build errors</title>
<updated>2021-03-03T15:44:20Z</updated>
<author>
<name>Randy Dunlap</name>
</author>
<published>2021-02-13T19:24:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=856f42d9f70225af875ecbec3cb48f26e72929cb'/>
<id>urn:sha1:856f42d9f70225af875ecbec3cb48f26e72929cb</id>
<content type='text'>
[ Upstream commit eefb816acb0162e94a85a857f3a55148f671d5a5 ]

CNIC depends on MMU, but since 'select' does not follow any dependency
chains, SCSI_BNX2X_FCOE also needs to depend on MMU, so that erroneous
configs are not generated, which cause build errors in cnic.

WARNING: unmet direct dependencies detected for CNIC
  Depends on [n]: NETDEVICES [=y] &amp;&amp; ETHERNET [=y] &amp;&amp; NET_VENDOR_BROADCOM [=y] &amp;&amp; PCI [=y] &amp;&amp; (IPV6 [=n] || IPV6 [=n]=n) &amp;&amp; MMU [=n]
  Selected by [y]:
  - SCSI_BNX2X_FCOE [=y] &amp;&amp; SCSI_LOWLEVEL [=y] &amp;&amp; SCSI [=y] &amp;&amp; PCI [=y] &amp;&amp; (IPV6 [=n] || IPV6 [=n]=n) &amp;&amp; LIBFC [=y] &amp;&amp; LIBFCOE [=y]

riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L154':
cnic.c:(.text+0x1094): undefined reference to `uio_event_notify'
riscv64-linux-ld: cnic.c:(.text+0x10bc): undefined reference to `uio_event_notify'
riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L1442':
cnic.c:(.text+0x96a8): undefined reference to `__uio_register_device'
riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L0 ':
cnic.c:(.text.unlikely+0x68): undefined reference to `uio_unregister_device'

Link: https://lore.kernel.org/r/20210213192428.22537-1-rdunlap@infradead.org
Fixes: 853e2bd2103a ("[SCSI] bnx2fc: Broadcom FCoE offload driver")
Cc: Saurav Kashyap &lt;skashyap@marvell.com&gt;
Cc: Javed Hasan &lt;jhasan@marvell.com&gt;
Cc: GR-QLogic-Storage-Upstream@marvell.com
Cc: "James E.J. Bottomley" &lt;jejb@linux.ibm.com&gt;
Cc: "Martin K. Petersen" &lt;martin.petersen@oracle.com&gt;
Cc: linux-scsi@vger.kernel.org
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: bnx2fc: fix incorrect cast to u64 on shift operation</title>
<updated>2019-06-22T06:18:23Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2019-05-04T16:48:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f80a35fcb9e922d8731125ed09714019e07b24f5'/>
<id>urn:sha1:f80a35fcb9e922d8731125ed09714019e07b24f5</id>
<content type='text'>
[ Upstream commit d0c0d902339249c75da85fd9257a86cbb98dfaa5 ]

Currently an int is being shifted and the result is being cast to a u64
which leads to undefined behaviour if the shift is more than 31 bits. Fix
this by casting the integer value 1 to u64 before the shift operation.

Addresses-Coverity: ("Bad shift operation")
Fixes: 7b594769120b ("[SCSI] bnx2fc: Handle REC_TOV error code from firmware")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Acked-by: Saurav Kashyap &lt;skashyap@marvell.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: bnx2fc: Fix NULL dereference in error handling</title>
<updated>2019-01-13T09:05:31Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2018-11-01T05:25:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebcdd1195ee26fbc172cde4915e9b1ae2c4bfd7e'/>
<id>urn:sha1:ebcdd1195ee26fbc172cde4915e9b1ae2c4bfd7e</id>
<content type='text'>
[ Upstream commit 9ae4f8420ed7be4b13c96600e3568c144d101a23 ]

If "interface" is NULL then we can't release it and trying to will only
lead to an Oops.

Fixes: aea71a024914 ("[SCSI] bnx2fc: Introduce interface structure for each vlan interface")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: bnx2fc: Fix check in SCSI completion handler for timed out request</title>
<updated>2018-05-30T05:48:57Z</updated>
<author>
<name>Chad Dupuis</name>
</author>
<published>2018-01-24T16:07:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=daa67456210c7a502831f152a3dda4d59497b026'/>
<id>urn:sha1:daa67456210c7a502831f152a3dda4d59497b026</id>
<content type='text'>
[ Upstream commit ecf7ff49945f5741fa1da112f994939f942031d3 ]

When a request times out we set the io_req flag BNX2FC_FLAG_IO_COMPL so
that if a subsequent completion comes in on that task ID we will ignore
it.  The issue is that in the check for this flag there is a missing
return so we will continue to process a request which may have already
been returned to the ownership of the SCSI layer.  This can cause
unpredictable results.

Solution is to add in the missing return.

[mkp: typo plus title shortening]

Signed-off-by: Chad Dupuis &lt;chad.dupuis@cavium.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Tested-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scsi: bnx2fc: fix race condition in bnx2fc_get_host_stats()</title>
<updated>2018-04-13T17:50:11Z</updated>
<author>
<name>Maurizio Lombardi</name>
</author>
<published>2017-05-24T12:09:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a051639c498ad0f6e52db7e09230da866fa9cb0'/>
<id>urn:sha1:2a051639c498ad0f6e52db7e09230da866fa9cb0</id>
<content type='text'>
[ Upstream commit c2dd893a3b0772d1c680e109b9d5715d7f73022b ]

If multiple tasks attempt to read the stats, it may happen that the
start_req_done completion is re-initialized while still being used by
another task, causing a list corruption.

This patch fixes the bug by adding a mutex to serialize the calls to
bnx2fc_get_host_stats().

WARNING: at lib/list_debug.c:48 list_del+0x6e/0xa0() (Not tainted)
Hardware name: PowerEdge R820
list_del corruption. prev-&gt;next should be ffff882035627d90, but was ffff884069541588

Pid: 40267, comm: perl Not tainted 2.6.32-642.3.1.el6.x86_64 #1
Call Trace:
 [&lt;ffffffff8107c691&gt;] ? warn_slowpath_common+0x91/0xe0
 [&lt;ffffffff8107c796&gt;] ? warn_slowpath_fmt+0x46/0x60
 [&lt;ffffffff812ad16e&gt;] ? list_del+0x6e/0xa0
 [&lt;ffffffff81547eed&gt;] ? wait_for_common+0x14d/0x180
 [&lt;ffffffff8106c4a0&gt;] ? default_wake_function+0x0/0x20
 [&lt;ffffffff81547fd3&gt;] ? wait_for_completion_timeout+0x13/0x20
 [&lt;ffffffffa05410b1&gt;] ? bnx2fc_get_host_stats+0xa1/0x280 [bnx2fc]
 [&lt;ffffffffa04cf630&gt;] ? fc_stat_show+0x90/0xc0 [scsi_transport_fc]
 [&lt;ffffffffa04cf8b6&gt;] ? show_fcstat_tx_frames+0x16/0x20 [scsi_transport_fc]
 [&lt;ffffffff8137c647&gt;] ? dev_attr_show+0x27/0x50
 [&lt;ffffffff8113b9be&gt;] ? __get_free_pages+0xe/0x50
 [&lt;ffffffff812170e1&gt;] ? sysfs_read_file+0x111/0x200
 [&lt;ffffffff8119a305&gt;] ? vfs_read+0xb5/0x1a0
 [&lt;ffffffff8119b0b6&gt;] ? fget_light_pos+0x16/0x50
 [&lt;ffffffff8119a651&gt;] ? sys_read+0x51/0xb0
 [&lt;ffffffff810ee1fe&gt;] ? __audit_syscall_exit+0x25e/0x290
 [&lt;ffffffff8100b0d2&gt;] ? system_call_fastpath+0x16/0x1b

Signed-off-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Acked-by: Chad Dupuis &lt;chad.dupuis@cavium.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bnx2fc: Update version number to 2.9.6.</title>
<updated>2015-11-10T01:32:34Z</updated>
<author>
<name>Chad Dupuis</name>
</author>
<published>2015-10-19T19:40:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=edb394b512098e9d68923db8340230c3caa4893f'/>
<id>urn:sha1:edb394b512098e9d68923db8340230c3caa4893f</id>
<content type='text'>
Signed-off-by: Giridhar Malavali &lt;giridhar.malavali@qlogic.com&gt;
Signed-off-by: Chad Dupuis &lt;chad.dupuis@qlogic.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</content>
</entry>
<entry>
<title>bnx2fc: Remove explicit logouts.</title>
<updated>2015-11-10T01:31:34Z</updated>
<author>
<name>Chad Dupuis</name>
</author>
<published>2015-10-19T19:40:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50a87414695fc5009ba776a61f48d3d67ffdd6ed'/>
<id>urn:sha1:50a87414695fc5009ba776a61f48d3d67ffdd6ed</id>
<content type='text'>
Explicit logouts from bnx2fc were causing race conditions in either returning
stale SCSI commands or not allowing a target to log back in.

Signed-off-by: Giridhar Malavali &lt;giridhar.malavali@qlogic.com&gt;
Signed-off-by: Chad Dupuis &lt;chad.dupuis@qlogic.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</content>
</entry>
<entry>
<title>bnx2fc: Fix FCP RSP residual parsing.</title>
<updated>2015-11-10T01:30:49Z</updated>
<author>
<name>Chad Dupuis</name>
</author>
<published>2015-10-19T19:40:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=adcf7dfbea80382457a552b4eb7aa2b7d9f76dac'/>
<id>urn:sha1:adcf7dfbea80382457a552b4eb7aa2b7d9f76dac</id>
<content type='text'>
Signed-off-by: Giridhar Malavali &lt;giridhar.malavali@qlogic.com&gt;
Signed-off-by: Chad Dupuis &lt;chad.dupuis@qlogic.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</content>
</entry>
<entry>
<title>bnx2fc: Set ELS transfer length correctly for middle path commands.</title>
<updated>2015-11-10T01:30:03Z</updated>
<author>
<name>Chad Dupuis</name>
</author>
<published>2015-10-19T19:40:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1fffa19991b5a907303ca3f09cf3d8e91b0bd911'/>
<id>urn:sha1:1fffa19991b5a907303ca3f09cf3d8e91b0bd911</id>
<content type='text'>
Signed-off-by: Giridhar Malavali &lt;giridhar.malavali@qlogic.com&gt;
Signed-off-by: Chad Dupuis &lt;chad.dupuis@qlogic.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</content>
</entry>
</feed>
