* [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset
@ 2017-07-20 17:01 Thierry Reding
2017-07-31 10:58 ` Thierry Reding
2017-08-02 12:25 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Thierry Reding @ 2017-07-20 17:01 UTC (permalink / raw)
To: Linus Walleij; +Cc: Barry Song, linux-gpio, linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
The GPIO offset is never initialized, which means that it will end up
being zero as per the devm_kzalloc() of the parent structure.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
I have no idea how the driver could've ever worked for anything other
than instances with a single bank, but maybe it did and I missed some
detail.
drivers/pinctrl/sirf/pinctrl-atlas7.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
index 36b5c8d5471e..a2ca4a9472c7 100644
--- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
+++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
@@ -6078,6 +6078,7 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
bank = &a7gc->banks[idx];
/* Set ctrl registers' base of this bank */
bank->base = ATLAS7_GPIO_BASE(a7gc, idx);
+ bank->gpio_offset = idx * NGPIO_OF_BANK;
/* Get interrupt number from DTS */
ret = of_irq_get(np, idx);
--
2.13.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset
2017-07-20 17:01 [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset Thierry Reding
@ 2017-07-31 10:58 ` Thierry Reding
2017-08-02 12:25 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2017-07-31 10:58 UTC (permalink / raw)
To: Linus Walleij; +Cc: Barry Song, linux-gpio, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]
On Thu, Jul 20, 2017 at 07:01:07PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> The GPIO offset is never initialized, which means that it will end up
> being zero as per the devm_kzalloc() of the parent structure.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> I have no idea how the driver could've ever worked for anything other
> than instances with a single bank, but maybe it did and I missed some
> detail.
>
> drivers/pinctrl/sirf/pinctrl-atlas7.c | 1 +
> 1 file changed, 1 insertion(+)
Any comments on this one?
Thierry
>
> diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
> index 36b5c8d5471e..a2ca4a9472c7 100644
> --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
> +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
> @@ -6078,6 +6078,7 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
> bank = &a7gc->banks[idx];
> /* Set ctrl registers' base of this bank */
> bank->base = ATLAS7_GPIO_BASE(a7gc, idx);
> + bank->gpio_offset = idx * NGPIO_OF_BANK;
>
> /* Get interrupt number from DTS */
> ret = of_irq_get(np, idx);
> --
> 2.13.3
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset
2017-07-20 17:01 [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset Thierry Reding
2017-07-31 10:58 ` Thierry Reding
@ 2017-08-02 12:25 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2017-08-02 12:25 UTC (permalink / raw)
To: Thierry Reding
Cc: Barry Song, linux-gpio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Thu, Jul 20, 2017 at 7:01 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> The GPIO offset is never initialized, which means that it will end up
> being zero as per the devm_kzalloc() of the parent structure.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> I have no idea how the driver could've ever worked for anything other
> than instances with a single bank, but maybe it did and I missed some
> detail.
Patch applied.
I went in and attack-patched this driver, see:
commit 4e6fd26dcf5d70a7700a4c15d8f239103bdce91d
"pinctrl: sirf/atlas7: stop poking around in GPIO internals"
I don't know if I may have upset the SirF developers or something,
or if I was an especially big asshole for not noticing the problem I
fixed already in the first iteration of the patch, or if I have done something
else evil, but I just haven't heard from the developers since.
If the problem is me, I'm sorry :(
I would like to have this driver up-to-date and verified working.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-02 12:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20 17:01 [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset Thierry Reding
2017-07-31 10:58 ` Thierry Reding
2017-08-02 12:25 ` 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).