ide: Remove in_interrupt()
cover ide: Remove in_interrupt()
In the discussion about preempt count consistency across kernel configurations:
https://lore.kernel.org/r/[email protected]/
it was concluded that the usage of in_interrupt() and related context checks should be removed from non-core code.
This ide subsystem has two in_interrupts() checks before mutex/wait-event invocations.
Sebastian
PATCH 1/2 ide/Falcon: Remove in_interrupt() usage.
falconide_get_lock() is called by ide_lock_host() and its caller (ide_issue_rq()) has already a might_sleep() check.
stdma_lock() has wait_event() which also has a might_sleep() check.
Remove the in_interrupt() check.
--- drivers/ide/falconide.c | 2 -- 1 file changed, 2 deletions(-)
drivers/ide/falconide.c +0 -2
@@ -51,8 +51,6 @@ static void falconide_release_lock(void)static void falconide_get_lock (irq_handler_t handler,void *data) {if (falconide_intr_lock ==0 ) { -if (in_interrupt () >0 ) -panic ("Falcon IDE hasn't ST-DMA lock in interrupt" );stdma_lock (handler, data); falconide_intr_lock =1 ; }
Signature · 1 line
2.29.2
PATCH 2/2 ide: Remove BUG_ON(in_interrupt() || irqs_disabled()) from ide_unregister()
In reply to Sebastian Andrzej SiewiorBoth BUG_ON() were introduced in commit
4015c949fb465 ("[PATCH] update ide core")
when ide_unregister() was extended with semaphore based locking. Both checks won't complain about disabled preemption which is also wrong.
The might_sleep() in today's mutex_lock() will complain about the missuses.
Remove the BUG_ON() statements.
--- drivers/ide/ide-probe.c | 3 --- 1 file changed, 3 deletions(-)
drivers/ide/ide-probe.c +0 -3
@@ -1539,9 +1539,6 @@ EXPORT_SYMBOL_GPL(ide_port_unregister_devices);static void ide_unregister (ide_hwif_t *hwif) { -BUG_ON (in_interrupt ()); -BUG_ON (irqs_disabled ()); -mutex_lock (&ide_cfg_mtx);if (hwif->present) {
Signature · 1 line
2.29.2
Quoted 10 lines · Sebastian Andrzej Siewior
In the discussion about preempt count consistency across kernel configurations:
https://lore.kernel.org/r/[email protected]/
it was concluded that the usage of
in_interrupt()and related context checks should be removed from non-core code.This ide subsystem has two
in_interrupts()checks before mutex/wait-event invocations.
Signature · 1 line
Jens Axboe
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Sebastian Andrzej Siewior
In the discussion about preempt count consistency across kernel configurations:
Quoted 7 lines
Quoted 5 lines
it was concluded that the usage of
in_interrupt()and related context checks should be removed from non-core code.This ide subsystem has two
in_interrupts()checks before mutex/wait-event invocations.Acked-by Jens Axboe <[email protected]>
Andrew, are you okay with routing these two patches via your tree?
Sebastian
Quoted 10 lines · On Thu, 19 Nov 2020 17:51:33 +0100 Sebastian Andrzej Siewior…
Quoted 9 lines · Jens Axboe
Quoted 8 lines · Sebastian Andrzej Siewior
In the discussion about preempt count consistency across kernel configurations:
https://lore.kernel.org/r/[email protected]/
it was concluded that the usage of
in_interrupt()and related context checks should be removed from non-core code.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
This ide subsystem has two
in_interrupts()checks before mutex/wait-event invocations.Acked-by Jens Axboe <[email protected]>Andrew, are you okay with routing these two patches via your tree?
Sure, but I'm not subscribed to linux-ide. Please resend, cc myself and linux-kernel?