diff mbox series

target: fix warning on realtime kernels

Message ID 20210531121326.3649-1-mlombard@redhat.com (mailing list archive)
State Accepted
Commit 515da6f4295c2c42b8c54572cce3d2dd1167c41e
Headers show
Series target: fix warning on realtime kernels | expand

Commit Message

Maurizio Lombardi May 31, 2021, 12:13 p.m. UTC
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()

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 drivers/target/target_core_transport.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Bart Van Assche May 31, 2021, 9:11 p.m. UTC | #1
On 5/31/21 5:13 AM, Maurizio Lombardi wrote:
> 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()

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Martin K. Petersen June 2, 2021, 5:45 a.m. UTC | #2
On Mon, 31 May 2021 14:13:26 +0200, Maurizio Lombardi wrote:

> 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
Chaitanya Kulkarni June 3, 2021, 6:05 p.m. UTC | #3
On 5/31/21 05:13, Maurizio Lombardi wrote:
> 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()
>
> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
diff mbox series

Patch

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 8fbfe75c5744..09526e6bc0bb 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -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;