All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
@ 2018-07-17 15:24 Niklas Söderlund
  2018-07-18  7:42   ` Geert Uytterhoeven
  2018-07-18  9:22   ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Niklas Söderlund @ 2018-07-17 15:24 UTC (permalink / raw)
  To: stable
  Cc: Geert Uytterhoeven, linux-renesas-soc, linux-gpio, Niklas Söderlund

The datasheet does not document any registers to control drive strength,
and no drive strength registers are for this reason described for this
SoC. The flags indicating that drive strength can be controlled are
however set for some pins in the driver.

This leads to a NULL pointer dereference when the sh-pfc core tries to
access the struct describing the drive strength registers, for example
when reading the sysfs file pinconf-pins.

Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins

Fixes: b92ac66a1819602b ("pinctrl: sh-pfc: Add R8A77970 PFC support")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

---
 drivers/pinctrl/sh-pfc/pfc-r8a77970.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

---

Hi,

This is a backport of commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a
from Linusw linux-pinctrl.git tree. It's applicable for v4.16 and v4.17.

This is my first backport patch submission for stable, please let me
know if I can improve the format of this patch commit message or subject
in any way.

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77970.c b/drivers/pinctrl/sh-pfc/pfc-r8a77970.c
index b1bb7263532b3bf9..049b374aa4ae4698 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77970.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77970.c
@@ -22,12 +22,12 @@
 #include "sh_pfc.h"
 
 #define CPU_ALL_PORT(fn, sfx)						\
-	PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),	\
-	PORT_GP_CFG_28(1, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),	\
-	PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),	\
-	PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),	\
-	PORT_GP_CFG_6(4, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),	\
-	PORT_GP_CFG_15(5, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH)
+	PORT_GP_22(0, fn, sfx),	\
+	PORT_GP_28(1, fn, sfx),	\
+	PORT_GP_17(2, fn, sfx),	\
+	PORT_GP_17(3, fn, sfx),	\
+	PORT_GP_6(4, fn, sfx),	\
+	PORT_GP_15(5, fn, sfx)
 /*
  * F_() : just information
  * FM() : macro for FN_xxx / xxx_MARK
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
  2018-07-17 15:24 [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag Niklas Söderlund
@ 2018-07-18  7:42   ` Geert Uytterhoeven
  2018-07-18  9:22   ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2018-07-18  7:42 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: stable, Geert Uytterhoeven, Linux-Renesas, open list:GPIO SUBSYSTEM

Hi Niklas,

Thanks for your backport!

On Tue, Jul 17, 2018 at 5:24 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:

commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a upstream.

> The datasheet does not document any registers to control drive strength,
> and no drive strength registers are for this reason described for this
> SoC. The flags indicating that drive strength can be controlled are
> however set for some pins in the driver.
>
> This leads to a NULL pointer dereference when the sh-pfc core tries to
> access the struct describing the drive strength registers, for example
> when reading the sysfs file pinconf-pins.
>
> Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins
>
> Fixes: b92ac66a1819602b ("pinctrl: sh-pfc: Add R8A77970 PFC support")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> ---

> This is a backport of commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a
> from Linusw linux-pinctrl.git tree. It's applicable for v4.16 and v4.17.

Which is now upstream.

Gr{oetje,eeting}s,

                        Geert

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
@ 2018-07-18  7:42   ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2018-07-18  7:42 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: stable, Geert Uytterhoeven, Linux-Renesas, open list:GPIO SUBSYSTEM

Hi Niklas,

Thanks for your backport!

On Tue, Jul 17, 2018 at 5:24 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:

commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a upstream.

> The datasheet does not document any registers to control drive strength,
> and no drive strength registers are for this reason described for this
> SoC. The flags indicating that drive strength can be controlled are
> however set for some pins in the driver.
>
> This leads to a NULL pointer dereference when the sh-pfc core tries to
> access the struct describing the drive strength registers, for example
> when reading the sysfs file pinconf-pins.
>
> Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins
>
> Fixes: b92ac66a1819602b ("pinctrl: sh-pfc: Add R8A77970 PFC support")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> ---

> This is a backport of commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a
> from Linusw linux-pinctrl.git tree. It's applicable for v4.16 and v4.17.

Which is now upstream.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
  2018-07-18  7:42   ` Geert Uytterhoeven
  (?)
@ 2018-07-18  9:16   ` Simon Horman
  -1 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2018-07-18  9:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Niklas Söderlund, stable, Geert Uytterhoeven, Linux-Renesas,
	open list:GPIO SUBSYSTEM

On Wed, Jul 18, 2018 at 09:42:05AM +0200, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> Thanks for your backport!
> 
> On Tue, Jul 17, 2018 at 5:24 PM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> 
> commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a upstream.
> 
> > The datasheet does not document any registers to control drive strength,
> > and no drive strength registers are for this reason described for this
> > SoC. The flags indicating that drive strength can be controlled are
> > however set for some pins in the driver.
> >
> > This leads to a NULL pointer dereference when the sh-pfc core tries to
> > access the struct describing the drive strength registers, for example
> > when reading the sysfs file pinconf-pins.
> >
> > Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins
> >
> > Fixes: b92ac66a1819602b ("pinctrl: sh-pfc: Add R8A77970 PFC support")
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> 
> > ---
> 
> > This is a backport of commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a
> > from Linusw linux-pinctrl.git tree. It's applicable for v4.16 and v4.17.
> 
> Which is now upstream.
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
  2018-07-17 15:24 [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag Niklas Söderlund
@ 2018-07-18  9:22   ` Greg KH
  2018-07-18  9:22   ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2018-07-18  9:22 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: stable, Geert Uytterhoeven, linux-renesas-soc, linux-gpio

On Tue, Jul 17, 2018 at 05:24:17PM +0200, Niklas Söderlund wrote:
> The datasheet does not document any registers to control drive strength,
> and no drive strength registers are for this reason described for this
> SoC. The flags indicating that drive strength can be controlled are
> however set for some pins in the driver.
> 
> This leads to a NULL pointer dereference when the sh-pfc core tries to
> access the struct describing the drive strength registers, for example
> when reading the sysfs file pinconf-pins.
> 
> Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins
> 
> Fixes: b92ac66a1819602b ("pinctrl: sh-pfc: Add R8A77970 PFC support")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> ---
>  drivers/pinctrl/sh-pfc/pfc-r8a77970.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> ---
> 
> Hi,
> 
> This is a backport of commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a
> from Linusw linux-pinctrl.git tree. It's applicable for v4.16 and v4.17.

4.16.y is long end-of-life, nothing I can do there anymore, sorry.

> This is my first backport patch submission for stable, please let me
> know if I can improve the format of this patch commit message or subject
> in any way.

Works just fine, now queued up for 4.17.y, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
@ 2018-07-18  9:22   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2018-07-18  9:22 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: stable, Geert Uytterhoeven, linux-renesas-soc, linux-gpio

On Tue, Jul 17, 2018 at 05:24:17PM +0200, Niklas S�derlund wrote:
> The datasheet does not document any registers to control drive strength,
> and no drive strength registers are for this reason described for this
> SoC. The flags indicating that drive strength can be controlled are
> however set for some pins in the driver.
> 
> This leads to a NULL pointer dereference when the sh-pfc core tries to
> access the struct describing the drive strength registers, for example
> when reading the sysfs file pinconf-pins.
> 
> Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins
> 
> Fixes: b92ac66a1819602b ("pinctrl: sh-pfc: Add R8A77970 PFC support")
> Signed-off-by: Niklas S�derlund <niklas.soderlund+renesas@ragnatech.se>
> 
> ---
>  drivers/pinctrl/sh-pfc/pfc-r8a77970.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> ---
> 
> Hi,
> 
> This is a backport of commit 550b6f7e8cf93fc2753aa01e655ed5471012ab5a
> from Linusw linux-pinctrl.git tree. It's applicable for v4.16 and v4.17.

4.16.y is long end-of-life, nothing I can do there anymore, sorry.

> This is my first backport patch submission for stable, please let me
> know if I can improve the format of this patch commit message or subject
> in any way.

Works just fine, now queued up for 4.17.y, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-18  9:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 15:24 [PATCH -stable] pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag Niklas Söderlund
2018-07-18  7:42 ` Geert Uytterhoeven
2018-07-18  7:42   ` Geert Uytterhoeven
2018-07-18  9:16   ` Simon Horman
2018-07-18  9:22 ` Greg KH
2018-07-18  9:22   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.