<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi/bnx2fc, branch v4.4.156</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>scsi: bnx2fc: Fix check in SCSI completion handler for timed out request</title>
<updated>2018-05-30T05:48:57+00:00</updated>
<author>
<name>Chad Dupuis</name>
<email>chad.dupuis@cavium.com</email>
</author>
<published>2018-01-24T16:07:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=daa67456210c7a502831f152a3dda4d59497b026'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: bnx2fc: fix race condition in bnx2fc_get_host_stats()</title>
<updated>2018-04-13T17:50:11+00:00</updated>
<author>
<name>Maurizio Lombardi</name>
<email>mlombard@redhat.com</email>
</author>
<published>2017-05-24T12:09:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a051639c498ad0f6e52db7e09230da866fa9cb0'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ 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;
</pre>
</div>
</content>
</entry>
<entry>
<title>bnx2fc: Update version number to 2.9.6.</title>
<updated>2015-11-10T01:32:34+00:00</updated>
<author>
<name>Chad Dupuis</name>
<email>chad.dupuis@qlogic.com</email>
</author>
<published>2015-10-19T19:40:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=edb394b512098e9d68923db8340230c3caa4893f'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>bnx2fc: Remove explicit logouts.</title>
<updated>2015-11-10T01:31:34+00:00</updated>
<author>
<name>Chad Dupuis</name>
<email>chad.dupuis@qlogic.com</email>
</author>
<published>2015-10-19T19:40:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=50a87414695fc5009ba776a61f48d3d67ffdd6ed'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>bnx2fc: Fix FCP RSP residual parsing.</title>
<updated>2015-11-10T01:30:49+00:00</updated>
<author>
<name>Chad Dupuis</name>
<email>chad.dupuis@qlogic.com</email>
</author>
<published>2015-10-19T19:40:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=adcf7dfbea80382457a552b4eb7aa2b7d9f76dac'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>bnx2fc: Set ELS transfer length correctly for middle path commands.</title>
<updated>2015-11-10T01:30:03+00:00</updated>
<author>
<name>Chad Dupuis</name>
<email>chad.dupuis@qlogic.com</email>
</author>
<published>2015-10-19T19:40:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1fffa19991b5a907303ca3f09cf3d8e91b0bd911'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>bnx2fc: Remove 'NetXtreme II' from source files.</title>
<updated>2015-11-10T01:29:04+00:00</updated>
<author>
<name>Chad Dupuis</name>
<email>chad.dupuis@qlogic.com</email>
</author>
<published>2015-10-19T19:40:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=de909d8740b74bed0f8274cdb818f7ce410a4a4a'/>
<id>de909d8740b74bed0f8274cdb818f7ce410a4a4a</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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>bnx2fc: Update copyright for 2015.</title>
<updated>2015-11-10T01:28:03+00:00</updated>
<author>
<name>Chad Dupuis</name>
<email>chad.dupuis@qlogic.com</email>
</author>
<published>2015-10-19T19:40:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=97586090a9d7bfb697a9a27ba9eca7e00a7d3b13'/>
<id>97586090a9d7bfb697a9a27ba9eca7e00a7d3b13</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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: use host wide tags by default</title>
<updated>2015-11-10T01:11:57+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-10-08T08:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=64d513ac31bd02a3c9b69ef04444f36c196f9a9d'/>
<id>64d513ac31bd02a3c9b69ef04444f36c196f9a9d</id>
<content type='text'>
This patch changes the !blk-mq path to the same defaults as the blk-mq
I/O path by always enabling block tagging, and always using host wide
tags.  We've had blk-mq available for a few releases so bugs with
this mode should have been ironed out, and this ensures we get better
coverage of over tagging setup over different configs.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch changes the !blk-mq path to the same defaults as the blk-mq
I/O path by always enabling block tagging, and always using host wide
tags.  We've had blk-mq available for a few releases so bugs with
this mode should have been ironed out, and this ensures we get better
coverage of over tagging setup over different configs.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bnx2fc: reduce stack usage in __bnx2fc_enable</title>
<updated>2015-11-10T01:10:24+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2015-10-07T13:11:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=720ba808e9ca276919f566bbe2b4e09c79f25faa'/>
<id>720ba808e9ca276919f566bbe2b4e09c79f25faa</id>
<content type='text'>
When the bnx2fc driver was changed to read the npiv table from
nvram, the stack of the __bnx2fc_enable function gained an
additional 1028 byte structure that gcc rightfully warns about:

drivers/scsi/bnx2fc/bnx2fc_fcoe.c: In function '__bnx2fc_enable':
drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2134:1: warning: the frame size of 1128 bytes is larger than 1024 bytes [-Wframe-larger-than=]

In order to avoid a possible kernel stack overflow and to get rid
of the warning, this changes the function to use a dynamic allocation
of the structure using kzalloc.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 2971ff67bd3 ("bnx2fc: Read npiv table from nvram and create vports.")
Acked-by: Chad Dupuis &lt;chad.dupuis@qlogic.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the bnx2fc driver was changed to read the npiv table from
nvram, the stack of the __bnx2fc_enable function gained an
additional 1028 byte structure that gcc rightfully warns about:

drivers/scsi/bnx2fc/bnx2fc_fcoe.c: In function '__bnx2fc_enable':
drivers/scsi/bnx2fc/bnx2fc_fcoe.c:2134:1: warning: the frame size of 1128 bytes is larger than 1024 bytes [-Wframe-larger-than=]

In order to avoid a possible kernel stack overflow and to get rid
of the warning, this changes the function to use a dynamic allocation
of the structure using kzalloc.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 2971ff67bd3 ("bnx2fc: Read npiv table from nvram and create vports.")
Acked-by: Chad Dupuis &lt;chad.dupuis@qlogic.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Odin.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
