diff mbox series

[v2,1/2] ide/Falcon: Remove in_interrupt() usage.

Message ID 20201120092421.1023428-2-bigeasy@linutronix.de
State New
Headers show
Series ide: Remove in_interrupt(). | expand

Commit Message

Sebastian Andrzej Siewior Nov. 20, 2020, 9:24 a.m. UTC
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.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Jens Axboe <axboe@kernel.dk>
---
 drivers/ide/falconide.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Andrew Morton Nov. 20, 2020, 10:35 p.m. UTC | #1
On Fri, 20 Nov 2020 10:24:20 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> 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.
> 
> ...
>
> --- a/drivers/ide/falconide.c
> +++ b/drivers/ide/falconide.c
> @@ -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;
>  	}

The current mainline falconide_get_lock() is very different:

static void falconide_release_lock(void)
{
	if (falconide_intr_lock == 0) {
		printk(KERN_ERR "%s: bug\n", __func__);
		return;
	}
	falconide_intr_lock = 0;
	stdma_release();
}
Sebastian Andrzej Siewior Nov. 21, 2020, 12:44 p.m. UTC | #2
On 2020-11-20 14:35:35 [-0800], Andrew Morton wrote:
> On Fri, 20 Nov 2020 10:24:20 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> 
> > 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.
> > 
> > ...
> >
> > --- a/drivers/ide/falconide.c
> > +++ b/drivers/ide/falconide.c
> > @@ -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;
> >  	}
> 
> The current mainline falconide_get_lock() is very different:

I have this patch on-top of next-20201120 so it should apply. You
realize that the above hunk is against falconide_get_lock() while
the below is falconide_release_lock().
If there is something wrong with the patch (or its commit message) I'm
sorry but I don't understand your signal :)

> static void falconide_release_lock(void)
> {
> 	if (falconide_intr_lock == 0) {
> 		printk(KERN_ERR "%s: bug\n", __func__);
> 		return;
> 	}
> 	falconide_intr_lock = 0;
> 	stdma_release();
> }

Sebastian
Andrew Morton Nov. 24, 2020, 3:46 a.m. UTC | #3
On Sat, 21 Nov 2020 13:44:24 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> On 2020-11-20 14:35:35 [-0800], Andrew Morton wrote:
> > On Fri, 20 Nov 2020 10:24:20 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> > 
> > > 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.
> > > 
> > > ...
> > >
> > > --- a/drivers/ide/falconide.c
> > > +++ b/drivers/ide/falconide.c
> > > @@ -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;
> > >  	}
> > 
> > The current mainline falconide_get_lock() is very different:
> 
> I have this patch on-top of next-20201120 so it should apply. You
> realize that the above hunk is against falconide_get_lock() while
> the below is falconide_release_lock().
> If there is something wrong with the patch (or its commit message) I'm
> sorry but I don't understand your signal :)
> 

oops, sorry, the MIME-encoded email messed me up, then I went and
confused myself.  Got it now, thanks ;)
diff mbox series

Patch

diff --git a/drivers/ide/falconide.c b/drivers/ide/falconide.c
index dbeb2605e5f6e..77af4c1a3f38c 100644
--- a/drivers/ide/falconide.c
+++ b/drivers/ide/falconide.c
@@ -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;
 	}