linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Subject: pinctrl: imx1-core: Fix debug output in .pin_config_set callback
       [not found] <55A85B59.5060906@gtsys.com.hk>
@ 2015-07-17  7:38 ` Uwe Kleine-König
  2015-07-17  7:56   ` Markus Pargmann
  2015-07-17  7:58   ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2015-07-17  7:38 UTC (permalink / raw)
  To: linux-arm-kernel

imx1_pinconf_set assumes that the array of pins in struct
imx1_pinctrl_soc_info can be indexed by pin id to get the
pinctrl_pin_desc for a pin. This used to be correct up to commit
607af165c047 which removed some entries from the array and so made it
wrong to access the array by pin id.

The result of this bug is a wrong pin name in the output for small pin
ids and an oops for the bigger ones.

This patch is the result of a discussion that includes patches by Markus
Pargmann and Chris Ruehl.

Fixes: 607af165c047 ("pinctrl: i.MX27: Remove nonexistent pad definitions")
Cc: stable at vger.kernel.org
Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/freescale/pinctrl-imx1-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
index 5fd4437cee15..88a7fac11bd4 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
@@ -403,14 +403,13 @@ static int imx1_pinconf_set(struct pinctrl_dev *pctldev,
 			     unsigned num_configs)
 {
 	struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
-	const struct imx1_pinctrl_soc_info *info = ipctl->info;
 	int i;
 
 	for (i = 0; i != num_configs; ++i) {
 		imx1_write_bit(ipctl, pin_id, configs[i] & 0x01, MX1_PUEN);
 
 		dev_dbg(ipctl->dev, "pinconf set pullup pin %s\n",
-			info->pins[pin_id].name);
+			pin_desc_get(pctldev, pin_id)->name);
 	}
 
 	return 0;
-- 
2.1.4

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

* [PATCH] Subject: pinctrl: imx1-core: Fix debug output in .pin_config_set callback
  2015-07-17  7:38 ` [PATCH] Subject: pinctrl: imx1-core: Fix debug output in .pin_config_set callback Uwe Kleine-König
@ 2015-07-17  7:56   ` Markus Pargmann
  2015-07-17  7:58   ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Pargmann @ 2015-07-17  7:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 17, 2015 at 09:38:43AM +0200, Uwe Kleine-K?nig wrote:
> imx1_pinconf_set assumes that the array of pins in struct
> imx1_pinctrl_soc_info can be indexed by pin id to get the
> pinctrl_pin_desc for a pin. This used to be correct up to commit
> 607af165c047 which removed some entries from the array and so made it
> wrong to access the array by pin id.
> 
> The result of this bug is a wrong pin name in the output for small pin
> ids and an oops for the bigger ones.
> 
> This patch is the result of a discussion that includes patches by Markus
> Pargmann and Chris Ruehl.
> 
> Fixes: 607af165c047 ("pinctrl: i.MX27: Remove nonexistent pad definitions")
> Cc: stable at vger.kernel.org
> Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Reviewed-by: Markus Pargmann <mpa@pengutronix.de>

> ---
>  drivers/pinctrl/freescale/pinctrl-imx1-core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
> index 5fd4437cee15..88a7fac11bd4 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
> @@ -403,14 +403,13 @@ static int imx1_pinconf_set(struct pinctrl_dev *pctldev,
>  			     unsigned num_configs)
>  {
>  	struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
> -	const struct imx1_pinctrl_soc_info *info = ipctl->info;
>  	int i;
>  
>  	for (i = 0; i != num_configs; ++i) {
>  		imx1_write_bit(ipctl, pin_id, configs[i] & 0x01, MX1_PUEN);
>  
>  		dev_dbg(ipctl->dev, "pinconf set pullup pin %s\n",
> -			info->pins[pin_id].name);
> +			pin_desc_get(pctldev, pin_id)->name);
>  	}
>  
>  	return 0;
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150717/ecd666ac/attachment.sig>

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

* [PATCH] Subject: pinctrl: imx1-core: Fix debug output in .pin_config_set callback
  2015-07-17  7:38 ` [PATCH] Subject: pinctrl: imx1-core: Fix debug output in .pin_config_set callback Uwe Kleine-König
  2015-07-17  7:56   ` Markus Pargmann
@ 2015-07-17  7:58   ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2015-07-17  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 17, 2015 at 9:38 AM, Uwe Kleine-K?nig
<u.kleine-koenig@pengutronix.de> wrote:

> imx1_pinconf_set assumes that the array of pins in struct
> imx1_pinctrl_soc_info can be indexed by pin id to get the
> pinctrl_pin_desc for a pin. This used to be correct up to commit
> 607af165c047 which removed some entries from the array and so made it
> wrong to access the array by pin id.
>
> The result of this bug is a wrong pin name in the output for small pin
> ids and an oops for the bigger ones.
>
> This patch is the result of a discussion that includes patches by Markus
> Pargmann and Chris Ruehl.
>
> Fixes: 607af165c047 ("pinctrl: i.MX27: Remove nonexistent pad definitions")
> Cc: stable at vger.kernel.org
> Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Patch applied for fixes with Markus' review tag.

Yours,
Linus Walleij

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

end of thread, other threads:[~2015-07-17  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <55A85B59.5060906@gtsys.com.hk>
2015-07-17  7:38 ` [PATCH] Subject: pinctrl: imx1-core: Fix debug output in .pin_config_set callback Uwe Kleine-König
2015-07-17  7:56   ` Markus Pargmann
2015-07-17  7:58   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).