All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
@ 2012-07-20 20:58 Sean Paul
  2012-07-20 21:06 ` Doug Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sean Paul @ 2012-07-20 20:58 UTC (permalink / raw)
  To: grant.likely, linus.walleij, linux-kernel; +Cc: olofj, dianders, seanpaul

Move gpc4 to the end of the automatically processed gpio controllers so
we don't taint the automatic offset calculation.

This bug caused all controllers coming after gpc4 to map to the
incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
GPIO 0 in gpd0.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpio/gpio-samsung.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index b6453d0..e4599b4 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -2454,12 +2454,6 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
 		},
 	}, {
 		.chip	= {
-			.base	= EXYNOS5_GPC4(0),
-			.ngpio	= EXYNOS5_GPIO_C4_NR,
-			.label	= "GPC4",
-		},
-	}, {
-		.chip	= {
 			.base	= EXYNOS5_GPD0(0),
 			.ngpio	= EXYNOS5_GPIO_D0_NR,
 			.label	= "GPD0",
@@ -2513,6 +2507,12 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
 			.label	= "GPY6",
 		},
 	}, {
+		.chip	= {
+			.base	= EXYNOS5_GPC4(0),
+			.ngpio	= EXYNOS5_GPIO_C4_NR,
+			.label	= "GPC4",
+		},
+	}, {
 		.config	= &samsung_gpio_cfgs[9],
 		.irq_base = IRQ_EINT(0),
 		.chip	= {
@@ -2833,7 +2833,7 @@ static __init void exynos5_gpiolib_init(void)
 	}
 
 	/* need to set base address for gpc4 */
-	exynos5_gpios_1[11].base = gpio_base1 + 0x2E0;
+	exynos5_gpios_1[20].base = gpio_base1 + 0x2E0;
 
 	/* need to set base address for gpx */
 	chip = &exynos5_gpios_1[21];
-- 
1.7.7.3


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

* Re: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
  2012-07-20 20:58 [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses Sean Paul
@ 2012-07-20 21:06 ` Doug Anderson
  2012-07-30  8:04   ` 박상수
  2012-07-27 23:09 ` Linus Walleij
  2012-08-05  9:59 ` Linus Walleij
  2 siblings, 1 reply; 7+ messages in thread
From: Doug Anderson @ 2012-07-20 21:06 UTC (permalink / raw)
  To: Sean Paul
  Cc: grant.likely, linus.walleij, linux-kernel, olofj, Sangsu Park,
	Thomas Abraham, Kukjin Kim

Acked-by: Doug Anderson <dianders@chromium.org>

---

On Fri, Jul 20, 2012 at 1:58 PM, Sean Paul <seanpaul@chromium.org> wrote:
>
> Move gpc4 to the end of the automatically processed gpio controllers so
> we don't taint the automatic offset calculation.
>
> This bug caused all controllers coming after gpc4 to map to the
> incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
> GPIO 0 in gpd0.
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/gpio/gpio-samsung.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> index b6453d0..e4599b4 100644
> --- a/drivers/gpio/gpio-samsung.c
> +++ b/drivers/gpio/gpio-samsung.c
> @@ -2454,12 +2454,6 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
>                 },
>         }, {
>                 .chip   = {
> -                       .base   = EXYNOS5_GPC4(0),
> -                       .ngpio  = EXYNOS5_GPIO_C4_NR,
> -                       .label  = "GPC4",
> -               },
> -       }, {
> -               .chip   = {
>                         .base   = EXYNOS5_GPD0(0),
>                         .ngpio  = EXYNOS5_GPIO_D0_NR,
>                         .label  = "GPD0",
> @@ -2513,6 +2507,12 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
>                         .label  = "GPY6",
>                 },
>         }, {
> +               .chip   = {
> +                       .base   = EXYNOS5_GPC4(0),
> +                       .ngpio  = EXYNOS5_GPIO_C4_NR,
> +                       .label  = "GPC4",
> +               },
> +       }, {
>                 .config = &samsung_gpio_cfgs[9],
>                 .irq_base = IRQ_EINT(0),
>                 .chip   = {
> @@ -2833,7 +2833,7 @@ static __init void exynos5_gpiolib_init(void)
>         }
>
>         /* need to set base address for gpc4 */
> -       exynos5_gpios_1[11].base = gpio_base1 + 0x2E0;
> +       exynos5_gpios_1[20].base = gpio_base1 + 0x2E0;
>
>         /* need to set base address for gpx */
>         chip = &exynos5_gpios_1[21];
> --
> 1.7.7.3
>

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

* Re: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
  2012-07-20 20:58 [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses Sean Paul
  2012-07-20 21:06 ` Doug Anderson
@ 2012-07-27 23:09 ` Linus Walleij
  2012-07-31 23:27   ` Kukjin Kim
  2012-08-05  9:59 ` Linus Walleij
  2 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-07-27 23:09 UTC (permalink / raw)
  To: Sean Paul, Kukjin Kim, Sangsu Park
  Cc: grant.likely, linus.walleij, linux-kernel, olofj, dianders

On Fri, Jul 20, 2012 at 10:58 PM, Sean Paul <seanpaul@chromium.org> wrote:

> Move gpc4 to the end of the automatically processed gpio controllers so
> we don't taint the automatic offset calculation.
>
> This bug caused all controllers coming after gpc4 to map to the
> incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
> GPIO 0 in gpd0.
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Samsung people, please comment on this patch.

Yours,
Linus Walleij

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

* RE: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
  2012-07-20 21:06 ` Doug Anderson
@ 2012-07-30  8:04   ` 박상수
  2012-07-30  8:37     ` Thomas Abraham
  0 siblings, 1 reply; 7+ messages in thread
From: 박상수 @ 2012-07-30  8:04 UTC (permalink / raw)
  To: 'Doug Anderson', 'Sean Paul'
  Cc: grant.likely, linus.walleij, linux-kernel, olofj,
	'Thomas Abraham', 'Kukjin Kim'



> -----Original Message-----
> From: dianders@google.com [mailto:dianders@google.com] On Behalf Of Doug Anderson
> Sent: Saturday, July 21, 2012 6:07 AM
> To: Sean Paul
> Cc: grant.likely@secretlab.ca; linus.walleij@stericsson.com; linux-kernel@vger.kernel.org;
> olofj@chromium.org; Sangsu Park; Thomas Abraham; Kukjin Kim
> Subject: Re: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
> 
> Acked-by: Doug Anderson <dianders@chromium.org>
> 
> ---
> 
> On Fri, Jul 20, 2012 at 1:58 PM, Sean Paul <seanpaul@chromium.org> wrote:
> >
> > Move gpc4 to the end of the automatically processed gpio controllers
> > so we don't taint the automatic offset calculation.
> >
> > This bug caused all controllers coming after gpc4 to map to the
> > incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
> > GPIO 0 in gpd0.
> >
> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> > ---
> >  drivers/gpio/gpio-samsung.c |   14 +++++++-------
> >  1 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> > index b6453d0..e4599b4 100644
> > --- a/drivers/gpio/gpio-samsung.c
> > +++ b/drivers/gpio/gpio-samsung.c
> > @@ -2454,12 +2454,6 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
> >                 },
> >         }, {
> >                 .chip   = {
> > -                       .base   = EXYNOS5_GPC4(0),
> > -                       .ngpio  = EXYNOS5_GPIO_C4_NR,
> > -                       .label  = "GPC4",
> > -               },
> > -       }, {
> > -               .chip   = {
> >                         .base   = EXYNOS5_GPD0(0),
> >                         .ngpio  = EXYNOS5_GPIO_D0_NR,
> >                         .label  = "GPD0", @@ -2513,6 +2507,12 @@
> > static struct samsung_gpio_chip exynos5_gpios_1[] = {
> >                         .label  = "GPY6",
> >                 },
> >         }, {
> > +               .chip   = {
> > +                       .base   = EXYNOS5_GPC4(0),
> > +                       .ngpio  = EXYNOS5_GPIO_C4_NR,
> > +                       .label  = "GPC4",
> > +               },
> > +       }, {
> >                 .config = &samsung_gpio_cfgs[9],
> >                 .irq_base = IRQ_EINT(0),
> >                 .chip   = {
> > @@ -2833,7 +2833,7 @@ static __init void exynos5_gpiolib_init(void)
> >         }
> >
> >         /* need to set base address for gpc4 */
> > -       exynos5_gpios_1[11].base = gpio_base1 + 0x2E0;
> > +       exynos5_gpios_1[20].base = gpio_base1 + 0x2E0;
> >
> >         /* need to set base address for gpx */
> >         chip = &exynos5_gpios_1[21];
> > --
> > 1.7.7.3
> >

I think that this modification is right.
Thanks.


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

* Re: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
  2012-07-30  8:04   ` 박상수
@ 2012-07-30  8:37     ` Thomas Abraham
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Abraham @ 2012-07-30  8:37 UTC (permalink / raw)
  To: 박상수
  Cc: Doug Anderson, Sean Paul, grant.likely, linus.walleij,
	linux-kernel, olofj, Kukjin Kim

On 30 July 2012 13:34, 박상수 <sangsu4u.park@samsung.com> wrote:
>
>
>> -----Original Message-----
>> From: dianders@google.com [mailto:dianders@google.com] On Behalf Of Doug Anderson
>> Sent: Saturday, July 21, 2012 6:07 AM
>> To: Sean Paul
>> Cc: grant.likely@secretlab.ca; linus.walleij@stericsson.com; linux-kernel@vger.kernel.org;
>> olofj@chromium.org; Sangsu Park; Thomas Abraham; Kukjin Kim
>> Subject: Re: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
>>
>> Acked-by: Doug Anderson <dianders@chromium.org>
>>
>> ---
>>
>> On Fri, Jul 20, 2012 at 1:58 PM, Sean Paul <seanpaul@chromium.org> wrote:
>> >
>> > Move gpc4 to the end of the automatically processed gpio controllers
>> > so we don't taint the automatic offset calculation.
>> >
>> > This bug caused all controllers coming after gpc4 to map to the
>> > incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
>> > GPIO 0 in gpd0.
>> >
>> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
>> > ---
>> >  drivers/gpio/gpio-samsung.c |   14 +++++++-------
>> >  1 files changed, 7 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
>> > index b6453d0..e4599b4 100644
>> > --- a/drivers/gpio/gpio-samsung.c
>> > +++ b/drivers/gpio/gpio-samsung.c
>> > @@ -2454,12 +2454,6 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
>> >                 },
>> >         }, {
>> >                 .chip   = {
>> > -                       .base   = EXYNOS5_GPC4(0),
>> > -                       .ngpio  = EXYNOS5_GPIO_C4_NR,
>> > -                       .label  = "GPC4",
>> > -               },
>> > -       }, {
>> > -               .chip   = {
>> >                         .base   = EXYNOS5_GPD0(0),
>> >                         .ngpio  = EXYNOS5_GPIO_D0_NR,
>> >                         .label  = "GPD0", @@ -2513,6 +2507,12 @@
>> > static struct samsung_gpio_chip exynos5_gpios_1[] = {
>> >                         .label  = "GPY6",
>> >                 },
>> >         }, {
>> > +               .chip   = {
>> > +                       .base   = EXYNOS5_GPC4(0),
>> > +                       .ngpio  = EXYNOS5_GPIO_C4_NR,
>> > +                       .label  = "GPC4",
>> > +               },
>> > +       }, {
>> >                 .config = &samsung_gpio_cfgs[9],
>> >                 .irq_base = IRQ_EINT(0),
>> >                 .chip   = {
>> > @@ -2833,7 +2833,7 @@ static __init void exynos5_gpiolib_init(void)
>> >         }
>> >
>> >         /* need to set base address for gpc4 */
>> > -       exynos5_gpios_1[11].base = gpio_base1 + 0x2E0;
>> > +       exynos5_gpios_1[20].base = gpio_base1 + 0x2E0;
>> >
>> >         /* need to set base address for gpx */
>> >         chip = &exynos5_gpios_1[21];
>> > --
>> > 1.7.7.3
>> >
>
> I think that this modification is right.
> Thanks.

Reviewed-by: Thomas Abraham <thomas.abraham@linaro.org>

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

* RE: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
  2012-07-27 23:09 ` Linus Walleij
@ 2012-07-31 23:27   ` Kukjin Kim
  0 siblings, 0 replies; 7+ messages in thread
From: Kukjin Kim @ 2012-07-31 23:27 UTC (permalink / raw)
  To: 'Linus Walleij', 'Sean Paul', 'Sangsu Park'
  Cc: grant.likely, linus.walleij, linux-kernel, olofj, dianders

Linus Walleij wrote:
> 
> On Fri, Jul 20, 2012 at 10:58 PM, Sean Paul <seanpaul@chromium.org> wrote:
> 
> > Move gpc4 to the end of the automatically processed gpio controllers so
> > we don't taint the automatic offset calculation.
> >
> > This bug caused all controllers coming after gpc4 to map to the
> > incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
> > GPIO 0 in gpd0.
> >
> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> 
> Samsung people, please comment on this patch.
> 
Looks good to me, please keep going on.
And feel free to add my ack on this.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


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

* Re: [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses
  2012-07-20 20:58 [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses Sean Paul
  2012-07-20 21:06 ` Doug Anderson
  2012-07-27 23:09 ` Linus Walleij
@ 2012-08-05  9:59 ` Linus Walleij
  2 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-08-05  9:59 UTC (permalink / raw)
  To: Sean Paul; +Cc: grant.likely, linus.walleij, linux-kernel, olofj, dianders

On Fri, Jul 20, 2012 at 10:58 PM, Sean Paul <seanpaul@chromium.org> wrote:

> Move gpc4 to the end of the automatically processed gpio controllers so
> we don't taint the automatic offset calculation.
>
> This bug caused all controllers coming after gpc4 to map to the
> incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
> GPIO 0 in gpd0.
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Patch applied with some Acks and Reviewed-by's.

Thanks,
Linus Walleij

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

end of thread, other threads:[~2012-08-05  9:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 20:58 [PATCH] gpio: samsung: Fix off-by-one bug in gpio addresses Sean Paul
2012-07-20 21:06 ` Doug Anderson
2012-07-30  8:04   ` 박상수
2012-07-30  8:37     ` Thomas Abraham
2012-07-27 23:09 ` Linus Walleij
2012-07-31 23:27   ` Kukjin Kim
2012-08-05  9:59 ` Linus Walleij

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.