Skip to content

Commit 066f79a

Browse files
BStroessermartinkpetersen
authored andcommitted
scsi: target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN
In case command ring buffer becomes inconsistent, tcmu sets device flag TCMU_DEV_BIT_BROKEN. If the bit is set, tcmu rejects new commands from LIO core with TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, and no longer processes completions from the ring. The reset_ring attribute can be used to completely clean up the command ring, so after reset_ring the ring no longer is inconsistent. Therefore reset_ring also should reset bit TCMU_DEV_BIT_BROKEN to allow normal processing. Link: https://lore.kernel.org/r/[email protected] Acked-by: Mike Christie <[email protected]> Signed-off-by: Bodo Stroesser <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8fed04e commit 066f79a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/target/target_core_user.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,6 +2073,7 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level)
20732073
mb->cmd_tail = 0;
20742074
mb->cmd_head = 0;
20752075
tcmu_flush_dcache_range(mb, sizeof(*mb));
2076+
clear_bit(TCMU_DEV_BIT_BROKEN, &udev->flags);
20762077

20772078
del_timer(&udev->cmd_timer);
20782079

0 commit comments

Comments
 (0)