Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Linus Walleij
On Tue, Aug 30, 2016 at 11:42 PM, Russell King - ARM Linux
 wrote:
> On Tue, Aug 30, 2016 at 11:25:19PM +0200, Linus Walleij wrote:

>> > +#define to_gpio_reg(x) container_of(x, struct gpio_reg, gc)
>>
>> You don't need that trickery anymore, just:
>>
>> > +static int gpio_reg_get_direction(struct gpio_chip *gc, unsigned offset)
>> > +{
>> > +   struct gpio_reg *r = to_gpio_reg(gc);
>>
>> struct gpio_reg *r = gpiochip_get_data(gc);
>>
>> (applied everywhere)
>
> I prefer my method by a long shot

Sure it's no strong preference. Keep it like this if you like.
I'm very happy with the series either way!

Yours,
Linus Walleij

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Russell King - ARM Linux
On Tue, Aug 30, 2016 at 11:25:19PM +0200, Linus Walleij wrote:
> On Mon, Aug 29, 2016 at 12:24 PM, Russell King
>  wrote:
> 
> > Add a simple, generic, single register fixed-direction GPIO driver.
> > This is able to support a single register where a fixed number of
> > bits are used for input and a fixed number of bits used for output.
> >
> > Signed-off-by: Russell King 
> 
> Clever, I like it!
> 
> >  include/linux/gpio-reg.h |  12 
> 
> Can we put this in include/linux/gpio/gpio-reg.h?
> 
> I try to do some scopeing to  there.

Sure, I'll just have to hunt through all the patches to find an occurance
of the include to fix them all up...

> > +#define to_gpio_reg(x) container_of(x, struct gpio_reg, gc)
> 
> You don't need that trickery anymore, just:
> 
> > +static int gpio_reg_get_direction(struct gpio_chip *gc, unsigned offset)
> > +{
> > +   struct gpio_reg *r = to_gpio_reg(gc);
> 
> struct gpio_reg *r = gpiochip_get_data(gc);
> 
> (applied everywhere)

I prefer my method by a long shot - it's always going to work because
the gpiochip is embedded within the gpio_reg structure, and the compiler
is inteligent enough to keep a single pointer around.  With your
suggestion, the compiler has no idea that 'r' and 'gc' are actually
the same pointer, but a different type, and we end up having to carry
around identical pointers in two registers rather than just one.

It makes more sense to use gpiochip_get_data() if gpio_chip were a const
data structure that was never embedded, but the way *gpiochip_add*()
writes to the structure and the presence of members like "base" prevents
that.

> 
> > +   if (dev)
> > +   ret = devm_gpiochip_add_data(dev, >gc, r);
> > +   else
> > +   ret = gpiochip_add_data(>gc, r);
> 
> Aha both device and device-less, I see.

Yes, to avoid problems with the transition to it - the legacy APIs
(such as ASSABET_BCR_frob(), etc) can be called really early, so we
need the gpiochip available early as well so we can keep the legacy
APIs working until they can be killed off.  There's some corner
cases in the assabet code which make that difficult at the moment.

This whole patch set is still very much a work-in-progress - there's
more that needs doing, but I wanted to get _this_ out there so that
people can reviewing it, and hopefully get it queued for the next
merge window.

> Apart from that it looks nice, any other questionmarks were
> fixed in the other replies.
> 
> Yours,
> Linus Walleij

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Robert Jarzmik
Russell King - ARM Linux  writes:

> If you can wait a day or two, I'll push a branch out for everything in
> all these multiple series.
Sure, just ping me when you have something.

Cheers.

-- 
Robert

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [RFC PATCH 00/33] SA11x0/PXA GPIO rework (Core + PCMCIA only)

2016-08-30 Thread Linus Walleij
On Mon, Aug 29, 2016 at 12:23 PM, Russell King - ARM Linux
 wrote:

> Following on from the PCMCIA fixes, this series reworks GPIO on SA11x0
> and PXA platforms.  This is a subset of a larger series, which I'm
> splitting up due to its size.  This part contains the base and PCMCIA
> updates.  Further updates for IrDA drivers, DMA engine, serial, and
> ethernet will follow in time.

For all the GPIO patches:
Acked-by: Linus Walleij 

With the smallish changes needed to patch 5/33 that one is acked too.

In fact I would ACK it anyway, because the net total cleanup is so
nice on the kernel at large... SA11x0 has never been prettier than
after this series.

I suspect you want to keep the series together and queue it in the ARM
tree? Else tell me what to apply in the GPIO tree.

Yours,
Linus Walleij

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Linus Walleij
On Mon, Aug 29, 2016 at 12:24 PM, Russell King
 wrote:

> Add a simple, generic, single register fixed-direction GPIO driver.
> This is able to support a single register where a fixed number of
> bits are used for input and a fixed number of bits used for output.
>
> Signed-off-by: Russell King 

Clever, I like it!

>  include/linux/gpio-reg.h |  12 

Can we put this in include/linux/gpio/gpio-reg.h?

I try to do some scopeing to  there.

> +#define to_gpio_reg(x) container_of(x, struct gpio_reg, gc)

You don't need that trickery anymore, just:

> +static int gpio_reg_get_direction(struct gpio_chip *gc, unsigned offset)
> +{
> +   struct gpio_reg *r = to_gpio_reg(gc);

struct gpio_reg *r = gpiochip_get_data(gc);

(applied everywhere)

> +   if (dev)
> +   ret = devm_gpiochip_add_data(dev, >gc, r);
> +   else
> +   ret = gpiochip_add_data(>gc, r);

Aha both device and device-less, I see.

Apart from that it looks nice, any other questionmarks were
fixed in the other replies.

Yours,
Linus Walleij

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Russell King - ARM Linux
On Tue, Aug 30, 2016 at 06:42:03PM +0200, Robert Jarzmik wrote:
> Russell King - ARM Linux  writes:
> 
> > On Mon, Aug 29, 2016 at 09:39:54PM +0200, Robert Jarzmik wrote:
> >> Maybe this one would deserve a doxygen comment ?
> >
> > Does this solve it?
> Oh yes, that's very nice, especially the "1 = in" for which I have always a
> doubt.
> 
> Reviewed-by: Robert Jarzmik 
> 
> I hope to have an "attempt" to test all your series on the lubbock board in 
> the
> next days. The "attempt" part is because last time I checked pcmcia support 
> was
> broken on lubbock (ie. CONFIG_PCMCIA_SA activated implies an Oops), and I
> don't remember having repaired it (and it's disabled on my test farm which is 
> a
> sign I was not very confident about this part).
> 
> If you happen to have somewhere a branch I can pull, with all your series (at
> least "[RFC PATCH 00/33] SA11x0/PXA GPIO rework (Core + PCMCIA only)" and
> "[PATCH 0/8] SA11x0/PXA remainder & cleanups"), that would spare me the 
> multiple
> git-am to make the test(s).

If you can wait a day or two, I'll push a branch out for everything in
all these multiple series.

Thanks.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Robert Jarzmik
Russell King - ARM Linux  writes:

> On Mon, Aug 29, 2016 at 09:39:54PM +0200, Robert Jarzmik wrote:
>> Maybe this one would deserve a doxygen comment ?
>
> Does this solve it?
Oh yes, that's very nice, especially the "1 = in" for which I have always a
doubt.

Reviewed-by: Robert Jarzmik 

I hope to have an "attempt" to test all your series on the lubbock board in the
next days. The "attempt" part is because last time I checked pcmcia support was
broken on lubbock (ie. CONFIG_PCMCIA_SA activated implies an Oops), and I
don't remember having repaired it (and it's disabled on my test farm which is a
sign I was not very confident about this part).

If you happen to have somewhere a branch I can pull, with all your series (at
least "[RFC PATCH 00/33] SA11x0/PXA GPIO rework (Core + PCMCIA only)" and
"[PATCH 0/8] SA11x0/PXA remainder & cleanups"), that would spare me the multiple
git-am to make the test(s).

Cheers.

--
Robert

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[Bug 88801] SCM PCMCIA CompactFlash Adapter seems not to be recognized

2016-08-30 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=88801

--- Comment #49 from Alan  ---
The synchronize cache failed is unrelated - it may even be a drive firmware
funny, and in the cases you hot unplug the card I'd expect to see it in the
trace anyway.

I'll get the pflags patch upstreamed ASAP

-- 
You are receiving this mail because:
You are the assignee for the bug.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[Bug 88801] SCM PCMCIA CompactFlash Adapter seems not to be recognized

2016-08-30 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=88801

--- Comment #48 from Elmar Stellnberger  ---
Created attachment 231431
  --> https://bugzilla.kernel.org/attachment.cgi?id=231431=edit
dmesg with the proposed fix: issue resolved / no backtrace

Yes, that in deed does resolve the issue (no backtrace any more).
however that error message persists: Synchronize Cache(10) failed: ...

-- 
You are receiving this mail because:
You are the assignee for the bug.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


[Bug 88801] SCM PCMCIA CompactFlash Adapter seems not to be recognized

2016-08-30 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=88801

--- Comment #47 from Alan  ---
I'll submit the patch for the flags one once Elmar confirms its a fix.

-- 
You are receiving this mail because:
You are the assignee for the bug.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Russell King - ARM Linux
On Tue, Aug 30, 2016 at 09:08:03AM +0300, Alexander Shiyan wrote:
> >Вторник, 30 августа 2016, 2:12 +03:00 от Russell King - ARM Linux 
> >:
> >
> >On Mon, Aug 29, 2016 at 09:39:54PM +0200, Robert Jarzmik wrote:
> >> Hi Russell,
> >> 
> >> Russell King < rmk+ker...@armlinux.org.uk > writes:
> >> 
> >> > Add a simple, generic, single register fixed-direction GPIO driver.
> >> > This is able to support a single register where a fixed number of
> >> > bits are used for input and a fixed number of bits used for output.
> >> >
> >> > Signed-off-by: Russell King < rmk+ker...@armlinux.org.uk >
> 
> There is a GPIO driver which already performs these tasks.
> Plaease take a look on the gpio-74xx-mmio driver.

I did, and no it doesn't, because:

1. It is either all-in or all-out, it doesn't support a mixture of
   fixed-directions for a single register.
2. It is DT-only, I need it for legacy platforms.
3. It uses the bgpio stuff, which is unsuitable for reasons already
   covered in a previous reply.

So, gpio-74xx-mmio is unsuitable.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

2016-08-30 Thread Alexander Shiyan
>Вторник, 30 августа 2016, 2:12 +03:00 от Russell King - ARM Linux 
>:
>
>On Mon, Aug 29, 2016 at 09:39:54PM +0200, Robert Jarzmik wrote:
>> Hi Russell,
>> 
>> Russell King < rmk+ker...@armlinux.org.uk > writes:
>> 
>> > Add a simple, generic, single register fixed-direction GPIO driver.
>> > This is able to support a single register where a fixed number of
>> > bits are used for input and a fixed number of bits used for output.
>> >
>> > Signed-off-by: Russell King < rmk+ker...@armlinux.org.uk >

There is a GPIO driver which already performs these tasks.
Plaease take a look on the gpio-74xx-mmio driver.

---

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia