Commit f3ee24a
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent bf37fe5 commit f3ee24a
1 file changed
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2917 | 2917 | | |
2918 | 2918 | | |
2919 | 2919 | | |
2920 | | - | |
2921 | 2920 | | |
2922 | 2921 | | |
2923 | 2922 | | |
| |||
2933 | 2932 | | |
2934 | 2933 | | |
2935 | 2934 | | |
2936 | | - | |
2937 | 2935 | | |
2938 | 2936 | | |
2939 | 2937 | | |
| |||
3152 | 3150 | | |
3153 | 3151 | | |
3154 | 3152 | | |
3155 | | - | |
| 3153 | + | |
3156 | 3154 | | |
3157 | 3155 | | |
3158 | 3156 | | |
| |||
5391 | 5389 | | |
5392 | 5390 | | |
5393 | 5391 | | |
5394 | | - | |
5395 | 5392 | | |
5396 | 5393 | | |
5397 | 5394 | | |
| |||
7006 | 7003 | | |
7007 | 7004 | | |
7008 | 7005 | | |
7009 | | - | |
7010 | 7006 | | |
7011 | 7007 | | |
7012 | 7008 | | |
| |||
7178 | 7174 | | |
7179 | 7175 | | |
7180 | 7176 | | |
7181 | | - | |
7182 | 7177 | | |
7183 | 7178 | | |
7184 | 7179 | | |
| |||
0 commit comments