Skip to contentSkip to conversation

target: fix warning on realtime kernels

PATCH Applied Maurizio Lombardi 4 participants 4 messages May 31, 2021 – Jun 3, 2021 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: fix warning on realtime kernels

On realtime kernels, spin_lock_irq*(spinlock_t) do not disable the interrupts, a call to irqs_disabled()
will return false thus firing a warning in __transport_wait_for_tasks()

This patch removes the warning and also replaces assert_spin_locked with lockdep_assert_held()

---
 drivers/target/target_core_transport.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/target/target_core_transport.c +1 -3
index 8fbfe75c5744..09526e6bc0bb 100644
@@ -3121,9 +3121,7 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop,
 	__releases(&cmd->t_state_lock)
 	__acquires(&cmd->t_state_lock)
 {
-
-	assert_spin_locked(&cmd->t_state_lock);
-	WARN_ON_ONCE(!irqs_disabled());
+	lockdep_assert_held(&cmd->t_state_lock);
 
 	if (fabric_stop)
 		cmd->transport_state |= CMD_T_FABRIC_STOP;
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Maurizio Lombardi

On realtime kernels, spin_lock_irq*(spinlock_t) do not disable the interrupts, a call to irqs_disabled()
will return false thus firing a warning in __transport_wait_for_tasks()

This patch removes the warning and also replaces assert_spin_locked with lockdep_assert_held()

#2 lore raw
In reply to Maurizio Lombardi
Quoted 6 lines · Maurizio Lombardi

On realtime kernels, spin_lock_irq*(spinlock_t) do not disable the interrupts, a call to irqs_disabled()
will return false thus firing a warning in __transport_wait_for_tasks()

This patch removes the warning and also replaces assert_spin_locked with lockdep_assert_held()

Applied to 5.13/scsi-fixes, thanks!

[1/1] target: fix warning on realtime kernels

      https://git.kernel.org/mkp/scsi/c/515da6f4295c
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
Reviewed-by on v1 1/1
#3 lore raw
In reply to Maurizio Lombardi
Quoted 8 lines · Maurizio Lombardi

On realtime kernels, spin_lock_irq*(spinlock_t) do not disable the interrupts, a call to irqs_disabled()
will return false thus firing a warning in __transport_wait_for_tasks()

This patch removes the warning and also replaces assert_spin_locked with lockdep_assert_held()

Looks good.