* [PATCH] target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN
@ 2020-04-09 10:10 Bodo Stroesser
2020-04-09 15:29 ` Mike Christie
2020-04-13 18:03 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Bodo Stroesser @ 2020-04-09 10:10 UTC (permalink / raw)
To: linux-scsi, target-devel; +Cc: mchristi, martin.petersen, Bodo Stroesser
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.
Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
---
drivers/target/target_core_user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 0b9dfa6b17bc..f769bb1e3735 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -2073,6 +2073,7 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level)
mb->cmd_tail = 0;
mb->cmd_head = 0;
tcmu_flush_dcache_range(mb, sizeof(*mb));
+ clear_bit(TCMU_DEV_BIT_BROKEN, &udev->flags);
del_timer(&udev->cmd_timer);
--
2.12.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN
2020-04-09 10:10 [PATCH] target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN Bodo Stroesser
@ 2020-04-09 15:29 ` Mike Christie
2020-04-13 18:03 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Mike Christie @ 2020-04-09 15:29 UTC (permalink / raw)
To: Bodo Stroesser, linux-scsi, target-devel; +Cc: martin.petersen
On 04/09/2020 05:10 AM, Bodo Stroesser wrote:
> 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.
>
> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
> ---
> drivers/target/target_core_user.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index 0b9dfa6b17bc..f769bb1e3735 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -2073,6 +2073,7 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level)
> mb->cmd_tail = 0;
> mb->cmd_head = 0;
> tcmu_flush_dcache_range(mb, sizeof(*mb));
> + clear_bit(TCMU_DEV_BIT_BROKEN, &udev->flags);
>
> del_timer(&udev->cmd_timer);
>
>
Acked-by: Mike Christie <mchristi@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN
2020-04-09 10:10 [PATCH] target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN Bodo Stroesser
2020-04-09 15:29 ` Mike Christie
@ 2020-04-13 18:03 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-04-13 18:03 UTC (permalink / raw)
To: Bodo Stroesser; +Cc: linux-scsi, target-devel, mchristi, martin.petersen
Bodo,
> 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.
Applied to 5.7/scsi-fixes, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-13 18:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-09 10:10 [PATCH] target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN Bodo Stroesser
2020-04-09 15:29 ` Mike Christie
2020-04-13 18:03 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).