Commit b6d76d6
scsi: ufs: core: Fix handling of lrbp->cmd
[ Upstream commit 549e91a ]
ufshcd_queuecommand() may be called two times in a row for a SCSI command
before it is completed. Hence make the following changes:
- In the functions that submit a command, do not check the old value of
lrbp->cmd nor clear lrbp->cmd in error paths.
- In ufshcd_release_scsi_cmd(), do not clear lrbp->cmd.
See also scsi_send_eh_cmnd().
This commit prevents that the following appears if a command times out:
WARNING: at drivers/ufs/core/ufshcd.c:2965 ufshcd_queuecommand+0x6f8/0x9a8
Call trace:
ufshcd_queuecommand+0x6f8/0x9a8
scsi_send_eh_cmnd+0x2c0/0x960
scsi_eh_test_devices+0x100/0x314
scsi_eh_ready_devs+0xd90/0x114c
scsi_error_handler+0x2b4/0xb70
kthread+0x16c/0x1e0
Fixes: 5a0b0cb ("[SCSI] ufs: Add support for sending NOP OUT UPIU")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230524203659.1394307-3-bvanassche@acm.org
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ Removed the change in ufshcd_advanced_rpmb_req_handler() due to missing
commit:6ff265fc5ef6("scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg") ]
Signed-off-by: Rajani Kantha <681739313@139.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent cfa7458 commit b6d76d6
1 file changed
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2821 | 2821 | | |
2822 | 2822 | | |
2823 | 2823 | | |
2824 | | - | |
2825 | 2824 | | |
2826 | 2825 | | |
2827 | 2826 | | |
| |||
2837 | 2836 | | |
2838 | 2837 | | |
2839 | 2838 | | |
2840 | | - | |
2841 | 2839 | | |
2842 | 2840 | | |
2843 | 2841 | | |
| |||
3047 | 3045 | | |
3048 | 3046 | | |
3049 | 3047 | | |
3050 | | - | |
| 3048 | + | |
3051 | 3049 | | |
3052 | 3050 | | |
3053 | 3051 | | |
| |||
5357 | 5355 | | |
5358 | 5356 | | |
5359 | 5357 | | |
5360 | | - | |
5361 | 5358 | | |
5362 | 5359 | | |
5363 | 5360 | | |
| |||
6936 | 6933 | | |
6937 | 6934 | | |
6938 | 6935 | | |
6939 | | - | |
6940 | 6936 | | |
6941 | 6937 | | |
6942 | 6938 | | |
| |||
0 commit comments