* [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
@ 2012-05-17 7:35 ` Shawn Guo
0 siblings, 0 replies; 13+ messages in thread
From: Shawn Guo @ 2012-05-17 7:35 UTC (permalink / raw)
To: Grant Likely, Linus Walleij
Cc: Lothar Waßmann, Ryan Mallon, H Hartley Sweeten, Sascha Hauer,
Hans J. Koch, linux-arm-kernel, linux-kernel, Shawn Guo
It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
missing initialization of basic_mmio_gpio shadow variables) manged to
fix in gpio-mxc driver, so that other platform specific drivers do not
suffer from the same problem over and over again.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/gpio/gpio-generic.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
index e38dd0c..cfc9439 100644
--- a/drivers/gpio/gpio-generic.c
+++ b/drivers/gpio/gpio-generic.c
@@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
return ret;
bgc->data = bgc->read_reg(bgc->reg_dat);
+ if (bgc->gc.set == bgpio_set_set)
+ bgc->data = bgc->read_reg(bgc->reg_set);
+ if (bgc->reg_dir)
+ bgc->dir = bgc->read_reg(bgc->reg_dir);
return ret;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
2012-05-17 7:35 ` Shawn Guo
@ 2012-05-17 15:47 ` H Hartley Sweeten
-1 siblings, 0 replies; 13+ messages in thread
From: H Hartley Sweeten @ 2012-05-17 15:47 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday, May 17, 2012 12:35 AM, Shawn Guo wrote:
> It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
> missing initialization of basic_mmio_gpio shadow variables) manged to
> fix in gpio-mxc driver, so that other platform specific drivers do not
> suffer from the same problem over and over again.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/gpio/gpio-generic.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
> index e38dd0c..cfc9439 100644
> --- a/drivers/gpio/gpio-generic.c
> +++ b/drivers/gpio/gpio-generic.c
> @@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
> return ret;
>
> bgc->data = bgc->read_reg(bgc->reg_dat);
> + if (bgc->gc.set == bgpio_set_set)
> + bgc->data = bgc->read_reg(bgc->reg_set);
> + if (bgc->reg_dir)
> + bgc->dir = bgc->read_reg(bgc->reg_dir);
>
> return ret;
> }
This change is fine for ep93xx.
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
@ 2012-05-17 15:47 ` H Hartley Sweeten
0 siblings, 0 replies; 13+ messages in thread
From: H Hartley Sweeten @ 2012-05-17 15:47 UTC (permalink / raw)
To: Shawn Guo, Grant Likely, Linus Walleij
Cc: Lothar Waßmann, Ryan Mallon, Sascha Hauer, Hans J. Koch,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
On Thursday, May 17, 2012 12:35 AM, Shawn Guo wrote:
> It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
> missing initialization of basic_mmio_gpio shadow variables) manged to
> fix in gpio-mxc driver, so that other platform specific drivers do not
> suffer from the same problem over and over again.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/gpio/gpio-generic.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
> index e38dd0c..cfc9439 100644
> --- a/drivers/gpio/gpio-generic.c
> +++ b/drivers/gpio/gpio-generic.c
> @@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
> return ret;
>
> bgc->data = bgc->read_reg(bgc->reg_dat);
> + if (bgc->gc.set == bgpio_set_set)
> + bgc->data = bgc->read_reg(bgc->reg_set);
> + if (bgc->reg_dir)
> + bgc->dir = bgc->read_reg(bgc->reg_dir);
>
> return ret;
> }
This change is fine for ep93xx.
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
2012-05-17 7:35 ` Shawn Guo
@ 2012-05-18 13:51 ` Shawn Guo
-1 siblings, 0 replies; 13+ messages in thread
From: Shawn Guo @ 2012-05-18 13:51 UTC (permalink / raw)
To: linux-arm-kernel
Hi Grant, Linus,
Can we manage to get it in with the upcoming merge window, as it fixes
a bug that we may not want to live with for another cycle?
Regards,
Shawn
On Thu, May 17, 2012 at 03:35:02PM +0800, Shawn Guo wrote:
> It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
> missing initialization of basic_mmio_gpio shadow variables) manged to
> fix in gpio-mxc driver, so that other platform specific drivers do not
> suffer from the same problem over and over again.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/gpio/gpio-generic.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
> index e38dd0c..cfc9439 100644
> --- a/drivers/gpio/gpio-generic.c
> +++ b/drivers/gpio/gpio-generic.c
> @@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
> return ret;
>
> bgc->data = bgc->read_reg(bgc->reg_dat);
> + if (bgc->gc.set == bgpio_set_set)
> + bgc->data = bgc->read_reg(bgc->reg_set);
> + if (bgc->reg_dir)
> + bgc->dir = bgc->read_reg(bgc->reg_dir);
>
> return ret;
> }
> --
> 1.7.5.4
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
@ 2012-05-18 13:51 ` Shawn Guo
0 siblings, 0 replies; 13+ messages in thread
From: Shawn Guo @ 2012-05-18 13:51 UTC (permalink / raw)
To: Grant Likely, Linus Walleij
Cc: Lothar Waßmann, Ryan Mallon, H Hartley Sweeten, Sascha Hauer,
Hans J. Koch, linux-arm-kernel, linux-kernel
Hi Grant, Linus,
Can we manage to get it in with the upcoming merge window, as it fixes
a bug that we may not want to live with for another cycle?
Regards,
Shawn
On Thu, May 17, 2012 at 03:35:02PM +0800, Shawn Guo wrote:
> It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
> missing initialization of basic_mmio_gpio shadow variables) manged to
> fix in gpio-mxc driver, so that other platform specific drivers do not
> suffer from the same problem over and over again.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/gpio/gpio-generic.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
> index e38dd0c..cfc9439 100644
> --- a/drivers/gpio/gpio-generic.c
> +++ b/drivers/gpio/gpio-generic.c
> @@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
> return ret;
>
> bgc->data = bgc->read_reg(bgc->reg_dat);
> + if (bgc->gc.set == bgpio_set_set)
> + bgc->data = bgc->read_reg(bgc->reg_set);
> + if (bgc->reg_dir)
> + bgc->dir = bgc->read_reg(bgc->reg_dir);
>
> return ret;
> }
> --
> 1.7.5.4
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
2012-05-17 7:35 ` Shawn Guo
` (2 preceding siblings ...)
(?)
@ 2012-05-19 5:44 ` Grant Likely
2012-05-19 5:45 ` Grant Likely
-1 siblings, 1 reply; 13+ messages in thread
From: Grant Likely @ 2012-05-19 5:44 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 17 May 2012 15:35:02 +0800, Shawn Guo <shawn.guo@linaro.org> wrote:
> It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
> missing initialization of basic_mmio_gpio shadow variables) manged to
> fix in gpio-mxc driver, so that other platform specific drivers do not
> suffer from the same problem over and over again.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/gpio/gpio-generic.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
> index e38dd0c..cfc9439 100644
> --- a/drivers/gpio/gpio-generic.c
> +++ b/drivers/gpio/gpio-generic.c
> @@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
> return ret;
>
> bgc->data = bgc->read_reg(bgc->reg_dat);
> + if (bgc->gc.set == bgpio_set_set)
> + bgc->data = bgc->read_reg(bgc->reg_set);
> + if (bgc->reg_dir)
> + bgc->dir = bgc->read_reg(bgc->reg_dir);
This assumes that the set and dir registers are actually readable
which isn't the case on some hardware. There needs to be a mechanism
for drivers using bgpio_init to control how data & dir are initialized
(possibly with some flags; maybe replace the big_endian arg with a
flags arg).
g.
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
2012-05-19 5:44 ` Grant Likely
@ 2012-05-19 5:45 ` Grant Likely
0 siblings, 0 replies; 13+ messages in thread
From: Grant Likely @ 2012-05-19 5:45 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, May 18, 2012 at 11:44 PM, Grant Likely
<grant.likely@secretlab.ca> wrote:
> On Thu, 17 May 2012 15:35:02 +0800, Shawn Guo <shawn.guo@linaro.org> wrote:
>> It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
>> missing initialization of basic_mmio_gpio shadow variables) manged to
>> fix in gpio-mxc driver, so that other platform specific drivers do not
>> suffer from the same problem over and over again.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> ---
>> ?drivers/gpio/gpio-generic.c | ? ?4 ++++
>> ?1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
>> index e38dd0c..cfc9439 100644
>> --- a/drivers/gpio/gpio-generic.c
>> +++ b/drivers/gpio/gpio-generic.c
>> @@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
>> ? ? ? ? ? ? ? return ret;
>>
>> ? ? ? bgc->data = bgc->read_reg(bgc->reg_dat);
>> + ? ? if (bgc->gc.set == bgpio_set_set)
>> + ? ? ? ? ? ? bgc->data = bgc->read_reg(bgc->reg_set);
>> + ? ? if (bgc->reg_dir)
>> + ? ? ? ? ? ? bgc->dir = bgc->read_reg(bgc->reg_dir);
>
> This assumes that the set and dir registers are actually readable
> which isn't the case on some hardware. ?There needs to be a mechanism
> for drivers using bgpio_init to control how data & dir are initialized
> (possibly with some flags; maybe replace the big_endian arg with a
> flags arg).
If you can turn it around quickly, I'll still try to get it in for v3.5
g.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly
@ 2012-05-19 5:45 ` Grant Likely
0 siblings, 0 replies; 13+ messages in thread
From: Grant Likely @ 2012-05-19 5:45 UTC (permalink / raw)
To: Shawn Guo, Linus Walleij
Cc: Lothar Waßmann, Ryan Mallon, H Hartley Sweeten, Sascha Hauer,
Hans J. Koch, linux-arm-kernel, linux-kernel
On Fri, May 18, 2012 at 11:44 PM, Grant Likely
<grant.likely@secretlab.ca> wrote:
> On Thu, 17 May 2012 15:35:02 +0800, Shawn Guo <shawn.guo@linaro.org> wrote:
>> It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
>> missing initialization of basic_mmio_gpio shadow variables) manged to
>> fix in gpio-mxc driver, so that other platform specific drivers do not
>> suffer from the same problem over and over again.
>>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> ---
>> drivers/gpio/gpio-generic.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
>> index e38dd0c..cfc9439 100644
>> --- a/drivers/gpio/gpio-generic.c
>> +++ b/drivers/gpio/gpio-generic.c
>> @@ -394,6 +394,10 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
>> return ret;
>>
>> bgc->data = bgc->read_reg(bgc->reg_dat);
>> + if (bgc->gc.set == bgpio_set_set)
>> + bgc->data = bgc->read_reg(bgc->reg_set);
>> + if (bgc->reg_dir)
>> + bgc->dir = bgc->read_reg(bgc->reg_dir);
>
> This assumes that the set and dir registers are actually readable
> which isn't the case on some hardware. There needs to be a mechanism
> for drivers using bgpio_init to control how data & dir are initialized
> (possibly with some flags; maybe replace the big_endian arg with a
> flags arg).
If you can turn it around quickly, I'll still try to get it in for v3.5
g.
^ permalink raw reply [flat|nested] 13+ messages in thread