[PATCH 2/2] mailbox: apple: Implement poll_data() operation

Russell King (Oracle) linux at armlinux.org.uk
Tue Sep 6 00:58:25 PDT 2022


On Mon, Sep 05, 2022 at 07:03:39PM +0200, Sven Peter wrote:
> 
> 
> On Mon, Sep 5, 2022, at 18:48, Russell King wrote:
> > From: Hector Martin <marcan at marcan.st>
> >
> > This allows clients running in atomic context to poll for messages to
> > arrive.
> >
> > Signed-off-by: Hector Martin <marcan at marcan.st>
> > Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
> 
> Reviewed-by: Sven Peter <sven at svenpeter.dev>
> 
> with one small comment below:
> 
> > ---
> >  drivers/mailbox/apple-mailbox.c | 37 ++++++++++++++++++++++++++++++---
> >  1 file changed, 34 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mailbox/apple-mailbox.c b/drivers/mailbox/apple-mailbox.c
> > index 33e7acf71e3e..1c14ff63f3d3 100644
> > --- a/drivers/mailbox/apple-mailbox.c
> > +++ b/drivers/mailbox/apple-mailbox.c
> > @@ -26,6 +26,7 @@
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/spinlock.h>
> >  #include <linux/types.h>
> > 
> >  #define APPLE_ASC_MBOX_CONTROL_FULL  BIT(16)
> > @@ -101,6 +102,7 @@ struct apple_mbox {
> > 
> >  	struct device *dev;
> >  	struct mbox_controller controller;
> > +	spinlock_t rx_lock;
> >  };
> > 
> >  static const struct of_device_id apple_mbox_of_match[];
> > @@ -204,13 +206,16 @@ static irqreturn_t apple_mbox_send_empty_irq(int 
> > irq, void *data)
> >  	return IRQ_HANDLED;
> >  }
> > 
> > -static irqreturn_t apple_mbox_recv_irq(int irq, void *data)
> > +static int apple_mbox_poll(struct apple_mbox *apple_mbox)
> >  {
> > -	struct apple_mbox *apple_mbox = data;
> > +
> 
> small nit: there's a spurious white line here

Thanks, well spotted. Will fix.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list