<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/scsi, branch v5.11</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-02-09T02:51:25Z</updated>
<entry>
<title>scsi: scsi_debug: Fix a memory leak</title>
<updated>2021-02-09T02:51:25Z</updated>
<author>
<name>Maurizio Lombardi</name>
<email>mlombard@redhat.com</email>
</author>
<published>2021-02-08T11:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f852c596f2ee6f0eb364ea8f28f89da6da0ae7b5'/>
<id>urn:sha1:f852c596f2ee6f0eb364ea8f28f89da6da0ae7b5</id>
<content type='text'>
The sdebug_q_arr pointer must be freed when the module is unloaded.

$ cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff888e1cfb0000 (size 4096):
  comm "modprobe", pid 165555, jiffies 4325987516 (age 685.194s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;00000000458f4f5d&gt;] 0xffffffffc06702d9
    [&lt;000000003edc4b1f&gt;] do_one_initcall+0xe9/0x57d
    [&lt;00000000da7d518c&gt;] do_init_module+0x1d1/0x6f0
    [&lt;000000009a6a9248&gt;] load_module+0x36bd/0x4f50
    [&lt;00000000ddb0c3ce&gt;] __do_sys_init_module+0x1db/0x260
    [&lt;000000009532db57&gt;] do_syscall_64+0xa5/0x420
    [&lt;000000002916b13d&gt;] entry_SYSCALL_64_after_hwframe+0x6a/0xdf

Fixes: 87c715dcde63 ("scsi: scsi_debug: Add per_host_store option")
Link: https://lore.kernel.org/r/20210208111734.34034-1-mlombard@redhat.com
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Fix EEH encountering oops with NVMe traffic</title>
<updated>2021-01-29T18:41:39Z</updated>
<author>
<name>James Smart</name>
<email>jsmart2021@gmail.com</email>
</author>
<published>2021-01-27T22:16:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8c65830ae1629b03e5d65e9aafae7e2cf5f8b743'/>
<id>urn:sha1:8c65830ae1629b03e5d65e9aafae7e2cf5f8b743</id>
<content type='text'>
In testing, in a configuration with Redfish and native NVMe multipath when
an EEH is injected, a kernel oops is being encountered:

(unreliable)
lpfc_nvme_ls_req+0x328/0x720 [lpfc]
__nvme_fc_send_ls_req.constprop.13+0x1d8/0x3d0 [nvme_fc]
nvme_fc_create_association+0x224/0xd10 [nvme_fc]
nvme_fc_reset_ctrl_work+0x110/0x154 [nvme_fc]
process_one_work+0x304/0x5d

the NBMe transport is issuing a Disconnect LS request, which the driver
receives and tries to post but the work queue used by the driver is already
being torn down by the eeh.

Fix by validating the validity of the work queue before proceeding with the
LS transmit.

Link: https://lore.kernel.org/r/20210127221601.84878-1-jsmart2021@gmail.com
Reviewed-by: Ewan D. Milne &lt;emilne@redhat.com&gt;
Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: qla2xxx: Fix description for parameter ql2xenforce_iocb_limit</title>
<updated>2021-01-21T02:43:31Z</updated>
<author>
<name>Enzo Matsumiya</name>
<email>ematsumiya@suse.de</email>
</author>
<published>2021-01-18T18:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa2c24e7f415e9c13635cee22ff4e15a80215551'/>
<id>urn:sha1:aa2c24e7f415e9c13635cee22ff4e15a80215551</id>
<content type='text'>
Parameter ql2xenforce_iocb_limit is enabled by default.

Link: https://lore.kernel.org/r/20210118184922.23793-1-ematsumiya@suse.de
Fixes: 89c72f4245a8 ("scsi: qla2xxx: Add IOCB resource tracking")
Reviewed-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Signed-off-by: Enzo Matsumiya &lt;ematsumiya@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ibmvfc: Set default timeout to avoid crash during migration</title>
<updated>2021-01-15T03:02:59Z</updated>
<author>
<name>Brian King</name>
<email>brking@linux.vnet.ibm.com</email>
</author>
<published>2021-01-12T15:06:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=764907293edc1af7ac857389af9dc858944f53dc'/>
<id>urn:sha1:764907293edc1af7ac857389af9dc858944f53dc</id>
<content type='text'>
While testing live partition mobility, we have observed occasional crashes
of the Linux partition. What we've seen is that during the live migration,
for specific configurations with large amounts of memory, slow network
links, and workloads that are changing memory a lot, the partition can end
up being suspended for 30 seconds or longer. This resulted in the following
scenario:

CPU 0                          CPU 1
-------------------------------  ----------------------------------
scsi_queue_rq                    migration_store
 -&gt; blk_mq_start_request          -&gt; rtas_ibm_suspend_me
  -&gt; blk_add_timer                 -&gt; on_each_cpu(rtas_percpu_suspend_me
              _______________________________________V
             |
             V
    -&gt; IPI from CPU 1
     -&gt; rtas_percpu_suspend_me
                                     -&gt; __rtas_suspend_last_cpu

-- Linux partition suspended for &gt; 30 seconds --
                                      -&gt; for_each_online_cpu(cpu)
                                           plpar_hcall_norets(H_PROD
 -&gt; scsi_dispatch_cmd
                                      -&gt; scsi_times_out
                                       -&gt; scsi_abort_command
                                        -&gt; queue_delayed_work
  -&gt; ibmvfc_queuecommand_lck
   -&gt; ibmvfc_send_event
    -&gt; ibmvfc_send_crq
     - returns H_CLOSED
   &lt;- returns SCSI_MLQUEUE_HOST_BUSY
-&gt; __blk_mq_requeue_request

                                      -&gt; scmd_eh_abort_handler
                                       -&gt; scsi_try_to_abort_cmd
                                         - returns SUCCESS
                                       -&gt; scsi_queue_insert

Normally, the SCMD_STATE_COMPLETE bit would protect against the command
completion and the timeout, but that doesn't work here, since we don't
check that at all in the SCSI_MLQUEUE_HOST_BUSY path.

In this case we end up calling scsi_queue_insert on a request that has
already been queued, or possibly even freed, and we crash.

The patch below simply increases the default I/O timeout to avoid this race
condition. This is also the timeout value that nearly all IBM SAN storage
recommends setting as the default value.

Link: https://lore.kernel.org/r/1610463998-19791-1-git-send-email-brking@linux.vnet.ibm.com
Signed-off-by: Brian King &lt;brking@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: Fix memleak in vnic_dev_init_devcmd2</title>
<updated>2021-01-13T04:32:53Z</updated>
<author>
<name>Dinghao Liu</name>
<email>dinghao.liu@zju.edu.cn</email>
</author>
<published>2020-12-25T08:35:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6e3ae76728ccde49271d9f5acfebbea0c5625a3'/>
<id>urn:sha1:d6e3ae76728ccde49271d9f5acfebbea0c5625a3</id>
<content type='text'>
When ioread32() returns 0xFFFFFFFF, we should execute cleanup functions
like other error handling paths before returning.

Link: https://lore.kernel.org/r/20201225083520.22015-1-dinghao.liu@zju.edu.cn
Acked-by: Karan Tilak Kumar &lt;kartilak@cisco.com&gt;
Signed-off-by: Dinghao Liu &lt;dinghao.liu@zju.edu.cn&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: libfc: Avoid invoking response handler twice if ep is already completed</title>
<updated>2021-01-13T04:07:32Z</updated>
<author>
<name>Javed Hasan</name>
<email>jhasan@marvell.com</email>
</author>
<published>2020-12-15T19:47:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b2b0f16fa65e910a3ec8771206bb49ee87a54ac5'/>
<id>urn:sha1:b2b0f16fa65e910a3ec8771206bb49ee87a54ac5</id>
<content type='text'>
A race condition exists between the response handler getting called because
of exchange_mgr_reset() (which clears out all the active XIDs) and the
response we get via an interrupt.

Sequence of events:

	 rport ba0200: Port timeout, state PLOGI
	 rport ba0200: Port entered PLOGI state from PLOGI state
	 xid 1052: Exchange timer armed : 20000 msecs      xid timer armed here
	 rport ba0200: Received LOGO request while in state PLOGI
	 rport ba0200: Delete port
	 rport ba0200: work event 3
	 rport ba0200: lld callback ev 3
	 bnx2fc: rport_event_hdlr: event = 3, port_id = 0xba0200
	 bnx2fc: ba0200 - rport not created Yet!!
	 /* Here we reset any outstanding exchanges before
	 freeing rport using the exch_mgr_reset() */
	 xid 1052: Exchange timer canceled
	 /* Here we got two responses for one xid */
	 xid 1052: invoking resp(), esb 20000000 state 3
	 xid 1052: invoking resp(), esb 20000000 state 3
	 xid 1052: fc_rport_plogi_resp() : ep-&gt;resp_active 2
	 xid 1052: fc_rport_plogi_resp() : ep-&gt;resp_active 2

Skip the response if the exchange is already completed.

Link: https://lore.kernel.org/r/20201215194731.2326-1-jhasan@marvell.com
Signed-off-by: Javed Hasan &lt;jhasan@marvell.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: scsi_transport_srp: Don't block target in failfast state</title>
<updated>2021-01-13T03:56:49Z</updated>
<author>
<name>Martin Wilck</name>
<email>mwilck@suse.com</email>
</author>
<published>2021-01-11T14:25:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72eeb7c7151302ef007f1acd018cbf6f30e50321'/>
<id>urn:sha1:72eeb7c7151302ef007f1acd018cbf6f30e50321</id>
<content type='text'>
If the port is in SRP_RPORT_FAIL_FAST state when srp_reconnect_rport() is
entered, a transition to SDEV_BLOCK would be illegal, and a kernel WARNING
would be triggered. Skip scsi_target_block() in this case.

Link: https://lore.kernel.org/r/20210111142541.21534-1-mwilck@suse.com
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Martin Wilck &lt;mwilck@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: Fix tm request when non-fatal error happens</title>
<updated>2021-01-08T03:50:48Z</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2021-01-07T18:53:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eeb1b55b6e25c5f7265ff45cd050f3bc2cc423a4'/>
<id>urn:sha1:eeb1b55b6e25c5f7265ff45cd050f3bc2cc423a4</id>
<content type='text'>
When non-fatal error like line-reset happens, ufshcd_err_handler() starts
to abort tasks by ufshcd_try_to_abort_task(). When it tries to issue a task
management request, we hit two warnings:

WARNING: CPU: 7 PID: 7 at block/blk-core.c:630 blk_get_request+0x68/0x70
WARNING: CPU: 4 PID: 157 at block/blk-mq-tag.c:82 blk_mq_get_tag+0x438/0x46c

After fixing the above warnings we hit another tm_cmd timeout which may be
caused by unstable controller state:

__ufshcd_issue_tm_cmd: task management cmd 0x80 timed-out

Then, ufshcd_err_handler() enters full reset, and kernel gets stuck. It
turned out ufshcd_print_trs() printed too many messages on console which
requires CPU locks. Likewise hba-&gt;silence_err_logs, we need to avoid too
verbose messages. This is actually not an error case.

Link: https://lore.kernel.org/r/20210107185316.788815-3-jaegeuk@kernel.org
Fixes: 69a6c269c097 ("scsi: ufs: Use blk_{get,put}_request() to allocate and free TMFs")
Reviewed-by: Can Guo &lt;cang@codeaurora.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: Fix livelock of ufshcd_clear_ua_wluns()</title>
<updated>2021-01-08T03:50:48Z</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2021-01-07T18:53:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ee7ee530bc2bae6268247988d86722c65d02a37'/>
<id>urn:sha1:4ee7ee530bc2bae6268247988d86722c65d02a37</id>
<content type='text'>
When gate_work/ungate_work experience an error during hibern8_enter or exit
we can livelock:

 ufshcd_err_handler()
   ufshcd_scsi_block_requests()
   ufshcd_reset_and_restore()
     ufshcd_clear_ua_wluns() -&gt; stuck
   ufshcd_scsi_unblock_requests()

In order to avoid this, ufshcd_clear_ua_wluns() can be called per recovery
flows such as suspend/resume, link_recovery, and error_handler.

Link: https://lore.kernel.org/r/20210107185316.788815-2-jaegeuk@kernel.org
Fixes: 1918651f2d7e ("scsi: ufs: Clear UAC for RPMB after ufshcd resets")
Reviewed-by: Can Guo &lt;cang@codeaurora.org&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ibmvfc: Fix missing cast of ibmvfc_event pointer to u64 handle</title>
<updated>2021-01-08T03:32:56Z</updated>
<author>
<name>Tyrel Datwyler</name>
<email>tyreld@linux.ibm.com</email>
</author>
<published>2021-01-06T20:37:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=901d01c8e50c35a182073219a38b9c6391e59144'/>
<id>urn:sha1:901d01c8e50c35a182073219a38b9c6391e59144</id>
<content type='text'>
Commit 2aa0102c6688 ("scsi: ibmvfc: Use correlation token to tag commands")
sets the vfcFrame correlation token to the pointer handle of the associated
ibmvfc_event. However, that commit failed to cast the pointer to an
appropriate type which in this case is a u64. As such sparse warnings are
generated for both correlation token assignments.

 ibmvfc.c:2375:36: sparse: incorrect type in argument 1 (different base types)
 ibmvfc.c:2375:36: sparse: expected unsigned long long [usertype] val
 ibmvfc.c:2375:36: sparse: got struct ibmvfc_event *[assigned] evt

Add the appropriate u64 casts when assigning an ibmvfc_event as a
correlation token.

Link: https://lore.kernel.org/r/20210106203721.1054693-1-tyreld@linux.ibm.com
Fixes: 2aa0102c6688 ("scsi: ibmvfc: Use correlation token to tag commands")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Tyrel Datwyler &lt;tyreld@linux.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
