[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200319091850.GM20730@hirez.programming.kicks-ass.net>
Date: Thu, 19 Mar 2020 10:18:50 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>, Will Deacon <will@...nel.org>,
"Paul E . McKenney" <paulmck@...nel.org>,
Joel Fernandes <joel@...lfernandes.org>,
Steven Rostedt <rostedt@...dmis.org>,
Randy Dunlap <rdunlap@...radead.org>,
Michael Ellerman <mpe@...erman.id.au>,
Arnd Bergmann <arnd@...db.de>, linuxppc-dev@...ts.ozlabs.org,
Logan Gunthorpe <logang@...tatee.com>,
Kurt Schwemmer <kurt.schwemmer@...rosemi.com>,
Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
Oleg Nesterov <oleg@...hat.com>,
Davidlohr Bueso <dave@...olabs.net>
Subject: Re: [patch V2 07/15] powerpc/ps3: Convert half completion to rcuwait
On Thu, Mar 19, 2020 at 10:00:24AM +0100, Sebastian Andrzej Siewior wrote:
> On 2020-03-18 21:43:09 [+0100], Thomas Gleixner wrote:
> > --- a/arch/powerpc/platforms/ps3/device-init.c
> > +++ b/arch/powerpc/platforms/ps3/device-init.c
> > @@ -725,12 +728,12 @@ static int ps3_notification_read_write(s
> > unsigned long flags;
> > int res;
> >
> > - init_completion(&dev->done);
> > spin_lock_irqsave(&dev->lock, flags);
> > res = write ? lv1_storage_write(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
> > &dev->tag)
> > : lv1_storage_read(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
> > &dev->tag);
> > + dev->done = false;
> > spin_unlock_irqrestore(&dev->lock, flags);
> > if (res) {
> > pr_err("%s:%u: %s failed %d\n", __func__, __LINE__, op, res);
> > @@ -738,14 +741,10 @@ static int ps3_notification_read_write(s
> > }
> > pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op);
> >
> > - res = wait_event_interruptible(dev->done.wait,
> > - dev->done.done || kthread_should_stop());
> > + rcuwait_wait_event(&dev->wait, dev->done || kthread_should_stop(), TASK_IDLE);
> > +
> …
>
> Not sure it matters but this struct `dev' is allocated on stack. Should
> the interrupt fire *before* rcuwait_wait_event() set wait.task to NULL
> then it is of random value on the first invocation of rcuwait_wake_up().
> ->
>
> diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
> index 197347c3c0b24..e87360a0fb40d 100644
> --- a/arch/powerpc/platforms/ps3/device-init.c
> +++ b/arch/powerpc/platforms/ps3/device-init.c
> @@ -809,6 +809,7 @@ static int ps3_probe_thread(void *data)
> }
>
> spin_lock_init(&dev.lock);
> + rcuwait_init(&dev.wait);
>
> res = request_irq(irq, ps3_notification_interrupt, 0,
> "ps3_notification", &dev);
>
Very good, sorry for that.
Powered by blists - more mailing lists