Re: [PATCH] serio: PS2 gpio bit banging driver for the serio bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

thanks for reviewing. Commented the ones which still holds.

On Mon, 7 Aug 2017 11:03:53 +0200
Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:

> On Tue, Aug 1, 2017 at 12:24 AM, Danilo Krummrich
> <danilokrummrich@xxxxxxxxxxxxx> wrote:
> 
> 
> When you add DT bindings you have to CC devicetree@xxxxxxxxxxxxxxx
> 
I will do prospectively.

> > +#include <linux/gpio.h>
> 
> Use only:
> 
> #include <linux/gpio/consumer.h>
> 
Done in v6.

> > +#include <linux/of_gpio.h>
> 
> Should not be needed.
> 
> 
Removed in v6.

> > +static int ps2_gpio_write(struct serio *serio, unsigned char val)
> > +{
> > +       struct ps2_gpio_data *drvdata = serio->port_data;
> > +
> > +       drvdata->mode = PS2_MODE_TX;
> > +       drvdata->tx_byte = val;
> > +       /* Make sure ISR running on other CPU notice changes. */
> > +       barrier();
> 
> This seems overengineered, is this really needed?
> 
> If we have races like this, the error is likely elsewhere, and should be
> fixed in the GPIO driver MMIO access or so.
> 
Yes, seems it can be removed. I didn't saw any explicit barriers in the GPIO
driver (I'm testing on bcm2835), but it seems MMIO operations on SMP archs
does contain barriers. Not sure if all do. If some do not this barrier might
be needed to ensure ISR on other CPU notice the correct mode and byte to send.

-- 
Danilo Krummrich <danilokrummrich@xxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux