Commit 549e91a
scsi: ufs: core: Fix handling of lrbp->cmd
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent fe8637f commit 549e91a
1 file changed
+1
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2945 | 2945 | | |
2946 | 2946 | | |
2947 | 2947 | | |
2948 | | - | |
2949 | 2948 | | |
2950 | 2949 | | |
2951 | 2950 | | |
| |||
2961 | 2960 | | |
2962 | 2961 | | |
2963 | 2962 | | |
2964 | | - | |
2965 | 2963 | | |
2966 | 2964 | | |
2967 | 2965 | | |
| |||
3180 | 3178 | | |
3181 | 3179 | | |
3182 | 3180 | | |
3183 | | - | |
| 3181 | + | |
3184 | 3182 | | |
3185 | 3183 | | |
3186 | 3184 | | |
| |||
5422 | 5420 | | |
5423 | 5421 | | |
5424 | 5422 | | |
5425 | | - | |
5426 | 5423 | | |
5427 | 5424 | | |
5428 | 5425 | | |
| |||
7037 | 7034 | | |
7038 | 7035 | | |
7039 | 7036 | | |
7040 | | - | |
7041 | 7037 | | |
7042 | 7038 | | |
7043 | 7039 | | |
| |||
7209 | 7205 | | |
7210 | 7206 | | |
7211 | 7207 | | |
7212 | | - | |
7213 | 7208 | | |
7214 | 7209 | | |
7215 | 7210 | | |
| |||
0 commit comments