lkml.org 
[lkml]   [2017]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] serio: PS2 gpio bit banging driver for the serio bus
Hi Linus,

thanks for reviewing. Commented the ones which still holds.

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

> On Tue, Aug 1, 2017 at 12:24 AM, Danilo Krummrich
> <danilokrummrich@dk-develop.de> wrote:
>
>
> When you add DT bindings you have to CC devicetree@vger.kernel.org
>
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@dk-develop.de>

\
 
 \ /
  Last update: 2017-08-07 18:21    [W:0.150 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site