* [PATCH] collie: don't read GPSR
@ 2011-06-17 14:11 Dmitry Eremin-Solenikov
2011-06-17 14:49 ` Lothar Waßmann
2011-06-17 15:07 ` Eric Miao
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-17 14:11 UTC (permalink / raw)
To: linux-arm-kernel
On StrongARM GPSR is write-only according to docs, so don't read from
it. Just set the required GPIO.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-sa1100/collie.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index f28025e..3f32ba2 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -339,7 +339,7 @@ static void __init collie_init(void)
PCFR = PCFR_OPDE;
- GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
+ GPSR = _COLLIE_GPIO_UCB1x00_RESET;
platform_scoop_config = &collie_pcmcia_config;
--
1.7.5.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] collie: don't read GPSR
2011-06-17 14:11 [PATCH] collie: don't read GPSR Dmitry Eremin-Solenikov
@ 2011-06-17 14:49 ` Lothar Waßmann
2011-06-17 15:07 ` Eric Miao
1 sibling, 0 replies; 4+ messages in thread
From: Lothar Waßmann @ 2011-06-17 14:49 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Dmitry Eremin-Solenikov writes:
> On StrongARM GPSR is write-only according to docs, so don't read from
> it. Just set the required GPIO.
>
Anyway GPSR (and GPCR) is a bit oriented register that allows
asserting individual bits without the need for read-modify-write
cycles, making the access inherently multithread safe. Using
read-modify-write on this register is contrary to the HW design.
A quick grep of the kernel source shows another abuse like this in
drivers/video/sa1100fb.c: GPSR |= SHANNON_GPIO_DISP_EN;
drivers/video/sa1100fb.c: GPCR |= SHANNON_GPIO_DISP_EN;
Lothar Wa?mann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] collie: don't read GPSR
2011-06-17 14:11 [PATCH] collie: don't read GPSR Dmitry Eremin-Solenikov
2011-06-17 14:49 ` Lothar Waßmann
@ 2011-06-17 15:07 ` Eric Miao
2011-06-17 15:35 ` Dmitry Eremin-Solenikov
1 sibling, 1 reply; 4+ messages in thread
From: Eric Miao @ 2011-06-17 15:07 UTC (permalink / raw)
To: linux-arm-kernel
Would it be better to switch to use gpio_* API instead of manipulating
GPxR directly?
On Fri, Jun 17, 2011 at 10:11 PM, Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com> wrote:
> On StrongARM GPSR is write-only according to docs, so don't read from
> it. Just set the required GPIO.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> ?arch/arm/mach-sa1100/collie.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
> index f28025e..3f32ba2 100644
> --- a/arch/arm/mach-sa1100/collie.c
> +++ b/arch/arm/mach-sa1100/collie.c
> @@ -339,7 +339,7 @@ static void __init collie_init(void)
>
> ? ? ? ?PCFR = PCFR_OPDE;
>
> - ? ? ? GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
> + ? ? ? GPSR = _COLLIE_GPIO_UCB1x00_RESET;
>
>
> ? ? ? ?platform_scoop_config = &collie_pcmcia_config;
> --
> 1.7.5.3
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] collie: don't read GPSR
2011-06-17 15:07 ` Eric Miao
@ 2011-06-17 15:35 ` Dmitry Eremin-Solenikov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-17 15:35 UTC (permalink / raw)
To: linux-arm-kernel
On 6/17/11, Eric Miao <eric.y.miao@gmail.com> wrote:
> Would it be better to switch to use gpio_* API instead of manipulating
> GPxR directly?
Yes. Probably. But this would require a much bigger cleanup effort. Waiting
for spare time for it.
> On Fri, Jun 17, 2011 at 10:11 PM, Dmitry Eremin-Solenikov
> <dbaryshkov@gmail.com> wrote:
>> On StrongARM GPSR is write-only according to docs, so don't read from
>> it. Just set the required GPIO.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>> arch/arm/mach-sa1100/collie.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
>> index f28025e..3f32ba2 100644
>> --- a/arch/arm/mach-sa1100/collie.c
>> +++ b/arch/arm/mach-sa1100/collie.c
>> @@ -339,7 +339,7 @@ static void __init collie_init(void)
>>
>> PCFR = PCFR_OPDE;
>>
>> - GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
>> + GPSR = _COLLIE_GPIO_UCB1x00_RESET;
>>
>>
>> platform_scoop_config = &collie_pcmcia_config;
>> --
>> 1.7.5.3
>>
>>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-06-17 15:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17 14:11 [PATCH] collie: don't read GPSR Dmitry Eremin-Solenikov
2011-06-17 14:49 ` Lothar Waßmann
2011-06-17 15:07 ` Eric Miao
2011-06-17 15:35 ` Dmitry Eremin-Solenikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox