mbox series

[resend,0/2] gpio: mpc8xxx: honour shadow register when writing gpdat

Message ID 20200128120423.16667-1-rasmus.villemoes@prevas.dk
Headers show
Series gpio: mpc8xxx: honour shadow register when writing gpdat | expand

Message

Rasmus Villemoes Jan. 28, 2020, 12:04 p.m. UTC
[resending with Mario's correct address, sorry for the double post]

The driver correctly uses the shadow register when asked for the
current value of an output gpio. Unfortunately, it does RMW on the
gpdat register both when setting a gpio as input and output. These two
patches fix that.

Aside: Apparently, the mpc8309 also partially suffers from the errata
preventing outputs from being read back - the bits corresponding to
gpios 0-7 are always read as 0, while at least the value of gpio10 is
correctly reflected when reading gpdat. Which is how I noticed these
bugs - I couldn't understand why turning one LED on would turn off
another.

Rasmus Villemoes (2):
  gpio: mpc8xxx: don't modify gpdat when setting gpio as input
  gpio: mpc8xxx: don't do RMW on gpdat register when setting value

 drivers/gpio/mpc8xxx_gpio.c | 41 ++++++++++++++-----------------------
 1 file changed, 15 insertions(+), 26 deletions(-)

Comments

Rasmus Villemoes Feb. 11, 2020, 2:39 p.m. UTC | #1
On 28/01/2020 13.04, Rasmus Villemoes wrote:

> Rasmus Villemoes (2):
>   gpio: mpc8xxx: don't modify gpdat when setting gpio as input
>   gpio: mpc8xxx: don't do RMW on gpdat register when setting value
> 
>  drivers/gpio/mpc8xxx_gpio.c | 41 ++++++++++++++-----------------------
>  1 file changed, 15 insertions(+), 26 deletions(-)

ping
Rasmus Villemoes March 3, 2020, 12:19 p.m. UTC | #2
On 28/01/2020 13.04, Rasmus Villemoes wrote:
> [resending with Mario's correct address, sorry for the double post]
> 
> The driver correctly uses the shadow register when asked for the
> current value of an output gpio. Unfortunately, it does RMW on the
> gpdat register both when setting a gpio as input and output. These two
> patches fix that.

Ping. Any chance these fixes can make it to 2020.04 ?

Rasmus
Rasmus Villemoes March 23, 2020, 12:13 a.m. UTC | #3
On 03/03/2020 13.19, Rasmus Villemoes wrote:
> On 28/01/2020 13.04, Rasmus Villemoes wrote:
>> [resending with Mario's correct address, sorry for the double post]
>>
>> The driver correctly uses the shadow register when asked for the
>> current value of an output gpio. Unfortunately, it does RMW on the
>> gpdat register both when setting a gpio as input and output. These two
>> patches fix that.
> 
> Ping. Any chance these fixes can make it to 2020.04 ?

Ping^3.

Tom, will you consider applying these directly? It's been two months and
I haven't got any response. Or advise on what I could do.

Thanks,
Rasmus
Tom Rini March 23, 2020, 8:45 p.m. UTC | #4
On Mon, Mar 23, 2020 at 01:13:01AM +0100, Rasmus Villemoes wrote:
> On 03/03/2020 13.19, Rasmus Villemoes wrote:
> > On 28/01/2020 13.04, Rasmus Villemoes wrote:
> >> [resending with Mario's correct address, sorry for the double post]
> >>
> >> The driver correctly uses the shadow register when asked for the
> >> current value of an output gpio. Unfortunately, it does RMW on the
> >> gpdat register both when setting a gpio as input and output. These two
> >> patches fix that.
> > 
> > Ping. Any chance these fixes can make it to 2020.04 ?
> 
> Ping^3.
> 
> Tom, will you consider applying these directly? It's been two months and
> I haven't got any response. Or advise on what I could do.

I suppose that if Mario doesn't speak up soon I'll take a look at
picking them up myself, thanks!
Rasmus Villemoes March 31, 2020, 12:30 p.m. UTC | #5
On 23/03/2020 21.45, Tom Rini wrote:
> On Mon, Mar 23, 2020 at 01:13:01AM +0100, Rasmus Villemoes wrote:
>> On 03/03/2020 13.19, Rasmus Villemoes wrote:
>>> On 28/01/2020 13.04, Rasmus Villemoes wrote:
>>>> [resending with Mario's correct address, sorry for the double post]
>>>>
>>>> The driver correctly uses the shadow register when asked for the
>>>> current value of an output gpio. Unfortunately, it does RMW on the
>>>> gpdat register both when setting a gpio as input and output. These two
>>>> patches fix that.
>>>
>>> Ping. Any chance these fixes can make it to 2020.04 ?
>>
>> Ping^3.
>>
>> Tom, will you consider applying these directly? It's been two months and
>> I haven't got any response. Or advise on what I could do.
> 
> I suppose that if Mario doesn't speak up soon I'll take a look at
> picking them up myself, thanks!
> 

Thanks. And in the unlikely event you have plenty of time, can I also
have you look at the

https://patchwork.ozlabs.org/project/uboot/list/?series=157899

series? The mpc8xxx_spi driver is mostly unusable without the 4/5 patch,
at least for accessing flash devices - perhaps some other spi
peripherals never encounter the "transfer size is 3 mod 4".

Thanks,
Rasmus