[PATCH v3 5/5] drivers/mailbox: Add aspeed ast2400/ast2500 mbox driver

Cyril Bur cyrilbur at gmail.com
Wed Jan 11 15:06:02 AEDT 2017


On Wed, 2017-01-11 at 14:54 +1100, Joel Stanley wrote:
> On Wed, Jan 11, 2017 at 11:33 AM, Joel Stanley <joel at jms.id.au> wrote:
> > > +       if ((file->f_flags & O_NONBLOCK) &&
> > > +               !(mbox_inb(mbox, MBOX_BMC_CTRL) & MBOX_CTRL_RECV))
> > > +                       return -EAGAIN;
> > > +       else if (wait_event_interruptible(mbox->queue,
> > > +                        mbox_inb(mbox, MBOX_BMC_CTRL) & MBOX_CTRL_RECV))
> > 
> > You read MBOX_BMC_CTRL twice. Is that intentional?
> 
> In fact, you keep reading it forever thanks to the magic of the
> wait_event_interruptible macro.
> 

Heh, yes. Although your spidey senses were correct the if condition is
wrong.

> Carry on.
> 
> Cheers,
> 
> Joel


More information about the openbmc mailing list