* [PATCH 0/2] DaVinci: GPIO: fixes @ 2013-11-08 6:45 Prabhakar Lad 2013-11-08 6:45 ` [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio Prabhakar Lad ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Prabhakar Lad @ 2013-11-08 6:45 UTC (permalink / raw) To: linux-arm-kernel From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> This patch series fixes gpio driver regestration and offset check for unbanked gpio. Lad, Prabhakar (2): gpio: davinci: Fix a check for unbanked gpio ARM: davinci: Fix number of resources passed to davinci_gpio_register() call arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- drivers/gpio/gpio-davinci.c | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio 2013-11-08 6:45 [PATCH 0/2] DaVinci: GPIO: fixes Prabhakar Lad @ 2013-11-08 6:45 ` Prabhakar Lad 2013-11-12 6:18 ` Sekhar Nori 2013-11-08 6:45 ` [PATCH 2/2] ARM: davinci: Fix number of resources passed to davinci_gpio_register() call Prabhakar Lad 2013-11-11 15:43 ` [PATCH 0/2] DaVinci: GPIO: fixes Grygorii Strashko 2 siblings, 1 reply; 9+ messages in thread From: Prabhakar Lad @ 2013-11-08 6:45 UTC (permalink / raw) To: linux-arm-kernel From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> This patch fixes a check for offset in gpio_to_irq_unbanked() and also assigns gpio_irq, gpio_unbanked of chips[0] to appropriate values which is used in gpio_to_irq_unbanked() function. Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> --- drivers/gpio/gpio-davinci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 8847adf..84be701 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -327,7 +327,7 @@ static int gpio_to_irq_unbanked(struct gpio_chip *chip, unsigned offset) * NOTE: we assume for now that only irqs in the first gpio_chip * can provide direct-mapped IRQs to AINTC (up to 32 GPIOs). */ - if (offset < d->irq_base) + if (offset < d->gpio_unbanked) return d->gpio_irq + offset; else return -ENODEV; @@ -419,6 +419,8 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) /* pass "bank 0" GPIO IRQs to AINTC */ chips[0].chip.to_irq = gpio_to_irq_unbanked; + chips[0].gpio_irq = bank_irq; + chips[0].gpio_unbanked = pdata->gpio_unbanked; binten = BIT(0); /* AINTC handles mask/unmask; GPIO handles triggering */ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio 2013-11-08 6:45 ` [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio Prabhakar Lad @ 2013-11-12 6:18 ` Sekhar Nori 2013-11-18 10:48 ` Linus Walleij 0 siblings, 1 reply; 9+ messages in thread From: Sekhar Nori @ 2013-11-12 6:18 UTC (permalink / raw) To: linux-arm-kernel On Friday 08 November 2013 12:15 PM, Prabhakar Lad wrote: > From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> > > This patch fixes a check for offset in gpio_to_irq_unbanked() > and also assigns gpio_irq, gpio_unbanked of chips[0] to > appropriate values which is used in gpio_to_irq_unbanked() > function. > > Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> > Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> You should note explicitly that this patch fixes broken unbanked IRQ support. You mostly just described what you are doing. I will fixup while committing. Thanks, Sekhar > --- > drivers/gpio/gpio-davinci.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c > index 8847adf..84be701 100644 > --- a/drivers/gpio/gpio-davinci.c > +++ b/drivers/gpio/gpio-davinci.c > @@ -327,7 +327,7 @@ static int gpio_to_irq_unbanked(struct gpio_chip *chip, unsigned offset) > * NOTE: we assume for now that only irqs in the first gpio_chip > * can provide direct-mapped IRQs to AINTC (up to 32 GPIOs). > */ > - if (offset < d->irq_base) > + if (offset < d->gpio_unbanked) > return d->gpio_irq + offset; > else > return -ENODEV; > @@ -419,6 +419,8 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) > > /* pass "bank 0" GPIO IRQs to AINTC */ > chips[0].chip.to_irq = gpio_to_irq_unbanked; > + chips[0].gpio_irq = bank_irq; > + chips[0].gpio_unbanked = pdata->gpio_unbanked; > binten = BIT(0); > > /* AINTC handles mask/unmask; GPIO handles triggering */ > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio 2013-11-12 6:18 ` Sekhar Nori @ 2013-11-18 10:48 ` Linus Walleij 2013-11-20 14:13 ` Sekhar Nori 0 siblings, 1 reply; 9+ messages in thread From: Linus Walleij @ 2013-11-18 10:48 UTC (permalink / raw) To: linux-arm-kernel On Tue, Nov 12, 2013 at 7:18 AM, Sekhar Nori <nsekhar@ti.com> wrote: > On Friday 08 November 2013 12:15 PM, Prabhakar Lad wrote: >> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> >> >> This patch fixes a check for offset in gpio_to_irq_unbanked() >> and also assigns gpio_irq, gpio_unbanked of chips[0] to >> appropriate values which is used in gpio_to_irq_unbanked() >> function. >> >> Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> >> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> > > You should note explicitly that this patch fixes broken unbanked IRQ > support. You mostly just described what you are doing. > > I will fixup while committing. So you're carrying this patch Sekhar? Thanks: Acked-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio 2013-11-18 10:48 ` Linus Walleij @ 2013-11-20 14:13 ` Sekhar Nori 0 siblings, 0 replies; 9+ messages in thread From: Sekhar Nori @ 2013-11-20 14:13 UTC (permalink / raw) To: linux-arm-kernel On Monday 18 November 2013 04:18 PM, Linus Walleij wrote: > On Tue, Nov 12, 2013 at 7:18 AM, Sekhar Nori <nsekhar@ti.com> wrote: >> On Friday 08 November 2013 12:15 PM, Prabhakar Lad wrote: >>> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> >>> >>> This patch fixes a check for offset in gpio_to_irq_unbanked() >>> and also assigns gpio_irq, gpio_unbanked of chips[0] to >>> appropriate values which is used in gpio_to_irq_unbanked() >>> function. >>> >>> Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> >>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> >> >> You should note explicitly that this patch fixes broken unbanked IRQ >> support. You mostly just described what you are doing. >> >> I will fixup while committing. > > So you're carrying this patch Sekhar? Yes, and I would have sent this for upstream already if not for I going under the weather a bit past couple of days. Thanks, Sekhar ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] ARM: davinci: Fix number of resources passed to davinci_gpio_register() call 2013-11-08 6:45 [PATCH 0/2] DaVinci: GPIO: fixes Prabhakar Lad 2013-11-08 6:45 ` [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio Prabhakar Lad @ 2013-11-08 6:45 ` Prabhakar Lad 2013-11-11 15:43 ` [PATCH 0/2] DaVinci: GPIO: fixes Grygorii Strashko 2 siblings, 0 replies; 9+ messages in thread From: Prabhakar Lad @ 2013-11-08 6:45 UTC (permalink / raw) To: linux-arm-kernel From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> The davinci_gpio_register() function expects the number of resources as the second parameter, but size of resources was passed to it due to which it was causing unexpected behaviour. This patch fixes the same by passing the ARRAY_SIZE of resources. Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> --- arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index ef9ff1f..536ce52 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -906,7 +906,7 @@ static struct davinci_gpio_platform_data dm355_gpio_platform_data = { int __init dm355_gpio_register(void) { return davinci_gpio_register(dm355_gpio_resources, - sizeof(dm355_gpio_resources), + ARRAY_SIZE(dm355_gpio_resources), &dm355_gpio_platform_data); } /*----------------------------------------------------------------------*/ diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 1511a06..9c96520 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -720,7 +720,7 @@ static struct davinci_gpio_platform_data dm365_gpio_platform_data = { int __init dm365_gpio_register(void) { return davinci_gpio_register(dm365_gpio_resources, - sizeof(dm365_gpio_resources), + ARRAY_SIZE(dm365_gpio_resources), &dm365_gpio_platform_data); } diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 143a321..72a3aa7 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -792,7 +792,7 @@ static struct davinci_gpio_platform_data dm644_gpio_platform_data = { int __init dm644x_gpio_register(void) { return davinci_gpio_register(dm644_gpio_resources, - sizeof(dm644_gpio_resources), + ARRAY_SIZE(dm644_gpio_resources), &dm644_gpio_platform_data); } /*----------------------------------------------------------------------*/ diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 2a73f29..d1b646c 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -769,7 +769,7 @@ static struct davinci_gpio_platform_data dm646x_gpio_platform_data = { int __init dm646x_gpio_register(void) { return davinci_gpio_register(dm646x_gpio_resources, - sizeof(dm646x_gpio_resources), + ARRAY_SIZE(dm646x_gpio_resources), &dm646x_gpio_platform_data); } /*----------------------------------------------------------------------*/ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 0/2] DaVinci: GPIO: fixes 2013-11-08 6:45 [PATCH 0/2] DaVinci: GPIO: fixes Prabhakar Lad 2013-11-08 6:45 ` [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio Prabhakar Lad 2013-11-08 6:45 ` [PATCH 2/2] ARM: davinci: Fix number of resources passed to davinci_gpio_register() call Prabhakar Lad @ 2013-11-11 15:43 ` Grygorii Strashko 2013-11-12 6:18 ` Sekhar Nori 2 siblings, 1 reply; 9+ messages in thread From: Grygorii Strashko @ 2013-11-11 15:43 UTC (permalink / raw) To: linux-arm-kernel Hi Sekhar, Prabhakar Lad On 11/08/2013 08:45 AM, Prabhakar Lad wrote:> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> > > This patch series fixes gpio driver regestration > and offset check for unbanked gpio. > > Lad, Prabhakar (2): > gpio: davinci: Fix a check for unbanked gpio > ARM: davinci: Fix number of resources passed to > davinci_gpio_register() call I've verified both patches - looks ok. Patch 1 - restores unbanked GPIO IRQs functionality Patch 2 - allows to register GPIO Platform devices and boot without issues. Could we move forward with these patches? > > arch/arm/mach-davinci/dm355.c | 2 +- > arch/arm/mach-davinci/dm365.c | 2 +- > arch/arm/mach-davinci/dm644x.c | 2 +- > arch/arm/mach-davinci/dm646x.c | 2 +- > drivers/gpio/gpio-davinci.c | 4 +++- > 5 files changed, 7 insertions(+), 5 deletions(-) > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 0/2] DaVinci: GPIO: fixes 2013-11-11 15:43 ` [PATCH 0/2] DaVinci: GPIO: fixes Grygorii Strashko @ 2013-11-12 6:18 ` Sekhar Nori 2013-11-12 8:39 ` Grygorii Strashko 0 siblings, 1 reply; 9+ messages in thread From: Sekhar Nori @ 2013-11-12 6:18 UTC (permalink / raw) To: linux-arm-kernel On Monday 11 November 2013 09:13 PM, Grygorii Strashko wrote: > Hi Sekhar, Prabhakar Lad > > On 11/08/2013 08:45 AM, Prabhakar Lad wrote:> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> >> >> This patch series fixes gpio driver regestration >> and offset check for unbanked gpio. >> >> Lad, Prabhakar (2): >> gpio: davinci: Fix a check for unbanked gpio >> ARM: davinci: Fix number of resources passed to >> davinci_gpio_register() call > > I've verified both patches - looks ok. > Patch 1 - restores unbanked GPIO IRQs functionality > Patch 2 - allows to register GPIO Platform devices and boot without issues. > > Could we move forward with these patches? Prabhakar, both patches look good to me. Thanks for the fixes. Also Grygorii, have you actually verified that the unbanked IRQ support works? Only DM365 uses it. What do I add for you? Tested-by: or Acked-by: Thanks, Sekhar ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 0/2] DaVinci: GPIO: fixes 2013-11-12 6:18 ` Sekhar Nori @ 2013-11-12 8:39 ` Grygorii Strashko 0 siblings, 0 replies; 9+ messages in thread From: Grygorii Strashko @ 2013-11-12 8:39 UTC (permalink / raw) To: linux-arm-kernel Hi Sekhar, On 11/12/2013 08:18 AM, Sekhar Nori wrote: > On Monday 11 November 2013 09:13 PM, Grygorii Strashko wrote: >> Hi Sekhar, Prabhakar Lad >> >> On 11/08/2013 08:45 AM, Prabhakar Lad wrote:> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com> >>> >>> This patch series fixes gpio driver regestration >>> and offset check for unbanked gpio. >>> >>> Lad, Prabhakar (2): >>> gpio: davinci: Fix a check for unbanked gpio >>> ARM: davinci: Fix number of resources passed to >>> davinci_gpio_register() call >> >> I've verified both patches - looks ok. >> Patch 1 - restores unbanked GPIO IRQs functionality >> Patch 2 - allows to register GPIO Platform devices and boot without issues. >> >> Could we move forward with these patches? > > Prabhakar, both patches look good to me. Thanks for the fixes. > > Also Grygorii, have you actually verified that the unbanked IRQ support > works? Only DM365 uses it. Yes, I've verified it, but on Keystone which has similar GPIO IP which supports only unbanked IRQs. > > What do I add for you? Tested-by: or Acked-by: Reported-and-Reviewed-and-Tested-by: Grygorii Strashko <grygorii.strashko@ti.com> :P ^Up to you :), but if I understand things right "Acked-by:" included all above Regards, - grygorii ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-11-20 14:13 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-11-08 6:45 [PATCH 0/2] DaVinci: GPIO: fixes Prabhakar Lad 2013-11-08 6:45 ` [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio Prabhakar Lad 2013-11-12 6:18 ` Sekhar Nori 2013-11-18 10:48 ` Linus Walleij 2013-11-20 14:13 ` Sekhar Nori 2013-11-08 6:45 ` [PATCH 2/2] ARM: davinci: Fix number of resources passed to davinci_gpio_register() call Prabhakar Lad 2013-11-11 15:43 ` [PATCH 0/2] DaVinci: GPIO: fixes Grygorii Strashko 2013-11-12 6:18 ` Sekhar Nori 2013-11-12 8:39 ` Grygorii Strashko
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).