All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: fix __io macro for PCMCIA
@ 2012-04-04  3:11 Rob Herring
  2012-04-04  7:55 ` Arnd Bergmann
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Rob Herring @ 2012-04-04  3:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
broken as PCMCIA depends on __io() being just a cast. This needs a better
fix with a fixed i/o address mapping, but for now we just restore things
to the previous behavior.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
Cc: Paul Parsons <lost.distance@yahoo.com>
---
 arch/arm/include/asm/io.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index df0ac0b..00262a4 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
  */
 #ifdef CONFIG_NEED_MACH_IO_H
 #include <mach/io.h>
+#elif defined(CONFIG_PCCARD)
+#define __io(a)		__typesafe_io(a)
 #else
 #define __io(a)		({ (void)(a); __typesafe_io(0); })
 #endif
@@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
  * readb() et.al. on such platforms.
  */
 #ifndef IO_SPACE_LIMIT
-#if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)
+#if defined(CONFIG_PCCARD)
 #define IO_SPACE_LIMIT ((resource_size_t)0xffffffff)
-#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
+#elif defined(CONFIG_PCI) || defined(CONFIG_ISA)
 #define IO_SPACE_LIMIT ((resource_size_t)0xffff)
 #else
 #define IO_SPACE_LIMIT ((resource_size_t)0)
-- 
1.7.5.4

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04  3:11 [PATCH] ARM: fix __io macro for PCMCIA Rob Herring
@ 2012-04-04  7:55 ` Arnd Bergmann
  2012-04-04  9:03 ` Russell King - ARM Linux
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Arnd Bergmann @ 2012-04-04  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 04 April 2012, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> broken as PCMCIA depends on __io() being just a cast. This needs a better
> fix with a fixed i/o address mapping, but for now we just restore things
> to the previous behavior.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
> Cc: Paul Parsons <lost.distance@yahoo.com>

Yes, I suppose it's the only sane way for v3.4.

Acked-by: Arnd Bergmann <arnd@arndb.de>

Russell, do you want to take it in your tree? Otherwise I'll put it into
arm-soc since that is where things broke.

	Arnd

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04  3:11 [PATCH] ARM: fix __io macro for PCMCIA Rob Herring
  2012-04-04  7:55 ` Arnd Bergmann
@ 2012-04-04  9:03 ` Russell King - ARM Linux
  2012-04-04 10:27   ` Arnd Bergmann
  2012-04-04 10:02 ` Joachim Eastwood
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Russell King - ARM Linux @ 2012-04-04  9:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 03, 2012 at 10:11:52PM -0500, Rob Herring wrote:
> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> broken as PCMCIA depends on __io() being just a cast. This needs a better
> fix with a fixed i/o address mapping, but for now we just restore things
> to the previous behavior.

And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia?
This is broken and your assumption above is wrong.

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04  3:11 [PATCH] ARM: fix __io macro for PCMCIA Rob Herring
  2012-04-04  7:55 ` Arnd Bergmann
  2012-04-04  9:03 ` Russell King - ARM Linux
@ 2012-04-04 10:02 ` Joachim Eastwood
  2012-04-04 12:45   ` Rob Herring
  2012-04-04 11:05 ` Paul Parsons
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Joachim Eastwood @ 2012-04-04 10:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 4, 2012 at 5:11 AM, Rob Herring <robherring2@gmail.com> wrote:
> From: Rob Herring <rob.herring@calxeda.com>
>
> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> broken as PCMCIA depends on __io() being just a cast. This needs a better
> fix with a fixed i/o address mapping, but for now we just restore things
> to the previous behavior.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
> Cc: Paul Parsons <lost.distance@yahoo.com>
> ---
> ?arch/arm/include/asm/io.h | ? ?6 ++++--
> ?1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index df0ac0b..00262a4 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
> ?*/
> ?#ifdef CONFIG_NEED_MACH_IO_H
> ?#include <mach/io.h>
> +#elif defined(CONFIG_PCCARD)
> +#define __io(a) ? ? ? ? ? ? ? ?__typesafe_io(a)
> ?#else
> ?#define __io(a) ? ? ? ? ? ? ? ?({ (void)(a); __typesafe_io(0); })
> ?#endif
> @@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
> ?* readb() et.al. on such platforms.
> ?*/
> ?#ifndef IO_SPACE_LIMIT
> -#if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)
> +#if defined(CONFIG_PCCARD)
> ?#define IO_SPACE_LIMIT ((resource_size_t)0xffffffff)
> -#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
> +#elif defined(CONFIG_PCI) || defined(CONFIG_ISA)
> ?#define IO_SPACE_LIMIT ((resource_size_t)0xffff)
> ?#else
> ?#define IO_SPACE_LIMIT ((resource_size_t)0)
> --
> 1.7.5.4

This doesn't work on my AT91RM9200 board. It still fails with the same
error as without this patch.
  [   80.500000] pata_pcmcia: probe of 0.0 failed with error -12

regards
Joachim Eastwood

> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04  9:03 ` Russell King - ARM Linux
@ 2012-04-04 10:27   ` Arnd Bergmann
  2012-04-04 12:56     ` Russell King - ARM Linux
  0 siblings, 1 reply; 18+ messages in thread
From: Arnd Bergmann @ 2012-04-04 10:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 04 April 2012, Russell King - ARM Linux wrote:
> On Tue, Apr 03, 2012 at 10:11:52PM -0500, Rob Herring wrote:
> > With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> > broken as PCMCIA depends on __io() being just a cast. This needs a better
> > fix with a fixed i/o address mapping, but for now we just restore things
> > to the previous behavior.
> 
> And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia?
> This is broken and your assumption above is wrong.

I would think they all still use their own mach/io.h. Which ones are you
thinking of?

	Arnd

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04  3:11 [PATCH] ARM: fix __io macro for PCMCIA Rob Herring
                   ` (2 preceding siblings ...)
  2012-04-04 10:02 ` Joachim Eastwood
@ 2012-04-04 11:05 ` Paul Parsons
  2012-04-04 14:23 ` Russell King - ARM Linux
  2012-04-04 22:48 ` [PATCH v2] " Rob Herring
  5 siblings, 0 replies; 18+ messages in thread
From: Paul Parsons @ 2012-04-04 11:05 UTC (permalink / raw)
  To: linux-arm-kernel

--- On Wed, 4/4/12, Rob Herring <robherring2@gmail.com> wrote:
> With commit c334bc1 (ARM: make mach/io.h include optional),
> PCMCIA was
> broken as PCMCIA depends on __io() being just a cast. This
> needs a better
> fix with a fixed i/o address mapping, but for now we just
> restore things
> to the previous behavior.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
> Cc: Paul Parsons <lost.distance@yahoo.com>
> ---
>  arch/arm/include/asm/io.h |? ? 6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/io.h
> b/arch/arm/include/asm/io.h
> index df0ac0b..00262a4 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -118,6 +118,8 @@ static inline void __iomem
> *__typesafe_io(unsigned long addr)
> ? */
>  #ifdef CONFIG_NEED_MACH_IO_H
>  #include <mach/io.h>
> +#elif defined(CONFIG_PCCARD)
> +#define __io(a)??? ???
> __typesafe_io(a)
>  #else
>  #define __io(a)??? ??? ({
> (void)(a); __typesafe_io(0); })
>  #endif
> @@ -134,9 +136,9 @@ static inline void __iomem
> *__typesafe_io(unsigned long addr)
> ? * readb() et.al. on such platforms.
> ? */
>  #ifndef IO_SPACE_LIMIT
> -#if defined(CONFIG_PCMCIA_SOC_COMMON) ||
> defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)
> +#if defined(CONFIG_PCCARD)
>  #define IO_SPACE_LIMIT ((resource_size_t)0xffffffff)
> -#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) ||
> defined(CONFIG_PCCARD)
> +#elif defined(CONFIG_PCI) || defined(CONFIG_ISA)
>  #define IO_SPACE_LIMIT ((resource_size_t)0xffff)
>  #else
>  #define IO_SPACE_LIMIT ((resource_size_t)0)
> -- 

This works for me on my hx4700 (PXA270) running linux-3.4-rc1.

Tested-by: Paul Parsons <lost.distance@yahoo.com>

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04 10:02 ` Joachim Eastwood
@ 2012-04-04 12:45   ` Rob Herring
  2012-04-04 12:49     ` Joachim Eastwood
  0 siblings, 1 reply; 18+ messages in thread
From: Rob Herring @ 2012-04-04 12:45 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/04/2012 05:02 AM, Joachim Eastwood wrote:
> On Wed, Apr 4, 2012 at 5:11 AM, Rob Herring <robherring2@gmail.com> wrote:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
>> broken as PCMCIA depends on __io() being just a cast. This needs a better
>> fix with a fixed i/o address mapping, but for now we just restore things
>> to the previous behavior.
>>
>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
>> Cc: Paul Parsons <lost.distance@yahoo.com>
>> ---
>>  arch/arm/include/asm/io.h |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
>> index df0ac0b..00262a4 100644
>> --- a/arch/arm/include/asm/io.h
>> +++ b/arch/arm/include/asm/io.h
>> @@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
>>  */
>>  #ifdef CONFIG_NEED_MACH_IO_H
>>  #include <mach/io.h>
>> +#elif defined(CONFIG_PCCARD)
>> +#define __io(a)                __typesafe_io(a)
>>  #else
>>  #define __io(a)                ({ (void)(a); __typesafe_io(0); })
>>  #endif
>> @@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
>>  * readb() et.al. on such platforms.
>>  */
>>  #ifndef IO_SPACE_LIMIT
>> -#if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)
>> +#if defined(CONFIG_PCCARD)
>>  #define IO_SPACE_LIMIT ((resource_size_t)0xffffffff)
>> -#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
>> +#elif defined(CONFIG_PCI) || defined(CONFIG_ISA)
>>  #define IO_SPACE_LIMIT ((resource_size_t)0xffff)
>>  #else
>>  #define IO_SPACE_LIMIT ((resource_size_t)0)
>> --
>> 1.7.5.4
> 
> This doesn't work on my AT91RM9200 board. It still fails with the same
> error as without this patch.
>   [   80.500000] pata_pcmcia: probe of 0.0 failed with error -12
> 

Are you building as a module? I need to add the module variant of the
define.

Otherwise, that doesn't make sense as this should be the same
definitions as the at91 io.h header. Can you add some #warning lines to
make sure you are picking up the correct definitions.

Rob

> regards
> Joachim Eastwood
> 
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04 12:45   ` Rob Herring
@ 2012-04-04 12:49     ` Joachim Eastwood
  0 siblings, 0 replies; 18+ messages in thread
From: Joachim Eastwood @ 2012-04-04 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 4, 2012 at 2:45 PM, Rob Herring <robherring2@gmail.com> wrote:
> On 04/04/2012 05:02 AM, Joachim Eastwood wrote:
>> On Wed, Apr 4, 2012 at 5:11 AM, Rob Herring <robherring2@gmail.com> wrote:
>>> From: Rob Herring <rob.herring@calxeda.com>
>>>
>>> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
>>> broken as PCMCIA depends on __io() being just a cast. This needs a better
>>> fix with a fixed i/o address mapping, but for now we just restore things
>>> to the previous behavior.
>>>
>>> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
>>> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
>>> Cc: Paul Parsons <lost.distance@yahoo.com>
>>> ---
>>> ?arch/arm/include/asm/io.h | ? ?6 ++++--
>>> ?1 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
>>> index df0ac0b..00262a4 100644
>>> --- a/arch/arm/include/asm/io.h
>>> +++ b/arch/arm/include/asm/io.h
>>> @@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
>>> ?*/
>>> ?#ifdef CONFIG_NEED_MACH_IO_H
>>> ?#include <mach/io.h>
>>> +#elif defined(CONFIG_PCCARD)
>>> +#define __io(a) ? ? ? ? ? ? ? ?__typesafe_io(a)
>>> ?#else
>>> ?#define __io(a) ? ? ? ? ? ? ? ?({ (void)(a); __typesafe_io(0); })
>>> ?#endif
>>> @@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
>>> ?* readb() et.al. on such platforms.
>>> ?*/
>>> ?#ifndef IO_SPACE_LIMIT
>>> -#if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)
>>> +#if defined(CONFIG_PCCARD)
>>> ?#define IO_SPACE_LIMIT ((resource_size_t)0xffffffff)
>>> -#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
>>> +#elif defined(CONFIG_PCI) || defined(CONFIG_ISA)
>>> ?#define IO_SPACE_LIMIT ((resource_size_t)0xffff)
>>> ?#else
>>> ?#define IO_SPACE_LIMIT ((resource_size_t)0)
>>> --
>>> 1.7.5.4
>>
>> This doesn't work on my AT91RM9200 board. It still fails with the same
>> error as without this patch.
>> ? [ ? 80.500000] pata_pcmcia: probe of 0.0 failed with error -12
>>
>
> Are you building as a module? I need to add the module variant of the
> define.

That explains it I guess. Yes, I am building it as a module.

regards
Joachim Eastwood

> Otherwise, that doesn't make sense as this should be the same
> definitions as the at91 io.h header. Can you add some #warning lines to
> make sure you are picking up the correct definitions.
>
> Rob
>
>> regards
>> Joachim Eastwood
>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04 10:27   ` Arnd Bergmann
@ 2012-04-04 12:56     ` Russell King - ARM Linux
  2012-04-04 13:04       ` Russell King - ARM Linux
  0 siblings, 1 reply; 18+ messages in thread
From: Russell King - ARM Linux @ 2012-04-04 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 04, 2012 at 10:27:30AM +0000, Arnd Bergmann wrote:
> On Wednesday 04 April 2012, Russell King - ARM Linux wrote:
> > On Tue, Apr 03, 2012 at 10:11:52PM -0500, Rob Herring wrote:
> > > With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> > > broken as PCMCIA depends on __io() being just a cast. This needs a better
> > > fix with a fixed i/o address mapping, but for now we just restore things
> > > to the previous behavior.
> > 
> > And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia?
> > This is broken and your assumption above is wrong.
> 
> I would think they all still use their own mach/io.h. Which ones are you
> thinking of?

But they don't need the IO_SPACE_LIMIT messed around with - it should
remain at 64K not 4GB.

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04 12:56     ` Russell King - ARM Linux
@ 2012-04-04 13:04       ` Russell King - ARM Linux
  2012-04-04 13:47         ` Rob Herring
  0 siblings, 1 reply; 18+ messages in thread
From: Russell King - ARM Linux @ 2012-04-04 13:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 04, 2012 at 01:56:24PM +0100, Russell King - ARM Linux wrote:
> On Wed, Apr 04, 2012 at 10:27:30AM +0000, Arnd Bergmann wrote:
> > On Wednesday 04 April 2012, Russell King - ARM Linux wrote:
> > > On Tue, Apr 03, 2012 at 10:11:52PM -0500, Rob Herring wrote:
> > > > With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> > > > broken as PCMCIA depends on __io() being just a cast. This needs a better
> > > > fix with a fixed i/o address mapping, but for now we just restore things
> > > > to the previous behavior.
> > > 
> > > And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia?
> > > This is broken and your assumption above is wrong.
> > 
> > I would think they all still use their own mach/io.h. Which ones are you
> > thinking of?
> 
> But they don't need the IO_SPACE_LIMIT messed around with - it should
> remain at 64K not 4GB.

Actually, we've done the whole io.h removal in totally the wrong bloody
order - because in removing all these so-called unnecessary io.h headers,
we've removed all those IO_SPACE_LIMIT definitions which overrode the
generic ones.

What we should have done is sorted out the PCMCIA/PCI/ISA IO space _first_
before removing any mach/io.h headers.

The fix for this is to restore those io.h headers which defined
IO_SPACE_LIMIT to something else other than the asm/io.h default until
the proper process in the above paragraph has been followed, and not
to work around it by buggering with the generic - and correct -
definition.

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04 13:04       ` Russell King - ARM Linux
@ 2012-04-04 13:47         ` Rob Herring
  2012-04-04 14:16           ` Russell King - ARM Linux
  0 siblings, 1 reply; 18+ messages in thread
From: Rob Herring @ 2012-04-04 13:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/04/2012 08:04 AM, Russell King - ARM Linux wrote:
> On Wed, Apr 04, 2012 at 01:56:24PM +0100, Russell King - ARM Linux wrote:
>> On Wed, Apr 04, 2012 at 10:27:30AM +0000, Arnd Bergmann wrote:
>>> On Wednesday 04 April 2012, Russell King - ARM Linux wrote:
>>>> On Tue, Apr 03, 2012 at 10:11:52PM -0500, Rob Herring wrote:
>>>>> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
>>>>> broken as PCMCIA depends on __io() being just a cast. This needs a better
>>>>> fix with a fixed i/o address mapping, but for now we just restore things
>>>>> to the previous behavior.
>>>>
>>>> And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia?
>>>> This is broken and your assumption above is wrong.
>>>
>>> I would think they all still use their own mach/io.h. Which ones are you
>>> thinking of?
>>
>> But they don't need the IO_SPACE_LIMIT messed around with - it should
>> remain at 64K not 4GB.
> 
> Actually, we've done the whole io.h removal in totally the wrong bloody
> order - because in removing all these so-called unnecessary io.h headers,
> we've removed all those IO_SPACE_LIMIT definitions which overrode the
> generic ones.
> 
> What we should have done is sorted out the PCMCIA/PCI/ISA IO space _first_
> before removing any mach/io.h headers.
> 
> The fix for this is to restore those io.h headers which defined
> IO_SPACE_LIMIT to something else other than the asm/io.h default until
> the proper process in the above paragraph has been followed, and not
> to work around it by buggering with the generic - and correct -
> definition.
> 

If you look at who defined IO_SPACE_LIMIT, you'll see most were just
wrong (i.e. 0xffffffff and no PCMCIA/ISA/PCI). Is there any PCMCIA
enabled ARM platform that doesn't require IO_SPACE_LIMIT to be 0xffffffff?

CONFIG_PCMCIA_SOC_COMMON is pretty much specific to PXA and SA11xx and
we already have a special case for it in asm/io.h. I'm simply extending
that to the few other platforms using PCMCIA. So it's not really any
more buggered than it already was.

Also, with this patch, building a PCMCIA enabled platform and non-PCMCIA
platform together are compatible. Adding io.h will mean any PCMCIA
platform could not be part of a single kernel build (other issues aside).

Rob

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04 13:47         ` Rob Herring
@ 2012-04-04 14:16           ` Russell King - ARM Linux
  0 siblings, 0 replies; 18+ messages in thread
From: Russell King - ARM Linux @ 2012-04-04 14:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 04, 2012 at 08:47:04AM -0500, Rob Herring wrote:
> On 04/04/2012 08:04 AM, Russell King - ARM Linux wrote:
> > On Wed, Apr 04, 2012 at 01:56:24PM +0100, Russell King - ARM Linux wrote:
> >> On Wed, Apr 04, 2012 at 10:27:30AM +0000, Arnd Bergmann wrote:
> >>> On Wednesday 04 April 2012, Russell King - ARM Linux wrote:
> >>>> On Tue, Apr 03, 2012 at 10:11:52PM -0500, Rob Herring wrote:
> >>>>> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> >>>>> broken as PCMCIA depends on __io() being just a cast. This needs a better
> >>>>> fix with a fixed i/o address mapping, but for now we just restore things
> >>>>> to the previous behavior.
> >>>>
> >>>> And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia?
> >>>> This is broken and your assumption above is wrong.
> >>>
> >>> I would think they all still use their own mach/io.h. Which ones are you
> >>> thinking of?
> >>
> >> But they don't need the IO_SPACE_LIMIT messed around with - it should
> >> remain at 64K not 4GB.
> > 
> > Actually, we've done the whole io.h removal in totally the wrong bloody
> > order - because in removing all these so-called unnecessary io.h headers,
> > we've removed all those IO_SPACE_LIMIT definitions which overrode the
> > generic ones.
> > 
> > What we should have done is sorted out the PCMCIA/PCI/ISA IO space _first_
> > before removing any mach/io.h headers.
> > 
> > The fix for this is to restore those io.h headers which defined
> > IO_SPACE_LIMIT to something else other than the asm/io.h default until
> > the proper process in the above paragraph has been followed, and not
> > to work around it by buggering with the generic - and correct -
> > definition.
> > 
> 
> If you look at who defined IO_SPACE_LIMIT, you'll see most were just
> wrong (i.e. 0xffffffff and no PCMCIA/ISA/PCI). Is there any PCMCIA
> enabled ARM platform that doesn't require IO_SPACE_LIMIT to be 0xffffffff?

I thought I'd pointed that out already and why you're wrong above.
Think: what if you have PCI IO space at 0x7c000000 and you have a cardbus
bridge on your PCI bus.  Hint: ARM platforms have exactly this.

You're going to end up setting their IO_SPACE_LIMIT to 4GB instead of
the _correct_ 64K which they've had for _years_.

You're not making this better with this stuff, you're making things worse
in the name of 'less files, oh that must be good'.  No, it isn't good
if you end up breaking stuff in the process.

> CONFIG_PCMCIA_SOC_COMMON is pretty much specific to PXA and SA11xx and
> we already have a special case for it in asm/io.h. I'm simply extending
> that to the few other platforms using PCMCIA. So it's not really any
> more buggered than it already was.

Which is wrong, as I've already pointed out in this thread.

The generic definitions in asm/io.h are _correct_.  PCMCIA without
soc-common is standard PCMCIA, which has a single 64K IO window
unless the platform is using some special code.

PCMCIA with soc-common is indeterminant, and we default to a 4GB
_until_ the platforms are all fixed to use proper IO windows.

> Also, with this patch, building a PCMCIA enabled platform and non-PCMCIA
> platform together are compatible. Adding io.h will mean any PCMCIA
> platform could not be part of a single kernel build (other issues aside).

Look, it's pretty simple.  The kernel was working just fine before your
conversion.  Your conversion happened.  The kernel stops working on certain
platforms.  That means your conversion to remove mach/io.h was incorrect
and your analysis of what was required was wrong.

If that wasn't the case, there wouldn't be this fundamental issue that's
caused this breakage.

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

* [PATCH] ARM: fix __io macro for PCMCIA
  2012-04-04  3:11 [PATCH] ARM: fix __io macro for PCMCIA Rob Herring
                   ` (3 preceding siblings ...)
  2012-04-04 11:05 ` Paul Parsons
@ 2012-04-04 14:23 ` Russell King - ARM Linux
  2012-04-04 22:48 ` [PATCH v2] " Rob Herring
  5 siblings, 0 replies; 18+ messages in thread
From: Russell King - ARM Linux @ 2012-04-04 14:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 03, 2012 at 10:11:52PM -0500, Rob Herring wrote:
> @@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
>   * readb() et.al. on such platforms.
>   */
>  #ifndef IO_SPACE_LIMIT
> -#if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)
> +#if defined(CONFIG_PCCARD)
>  #define IO_SPACE_LIMIT ((resource_size_t)0xffffffff)
> -#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
> +#elif defined(CONFIG_PCI) || defined(CONFIG_ISA)
>  #define IO_SPACE_LIMIT ((resource_size_t)0xffff)
>  #else
>  #define IO_SPACE_LIMIT ((resource_size_t)0)

Now that we have a better understanding of the PCMCIA implementation on
HX4700, I'm NAKing at least the above part on the grounds its totally
wrong and bogus - the original unpatched is correct, and the modified
version is likely to introduce further problems for platforms which do
things properly.

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

* [PATCH v2] ARM: fix __io macro for PCMCIA
  2012-04-04  3:11 [PATCH] ARM: fix __io macro for PCMCIA Rob Herring
                   ` (4 preceding siblings ...)
  2012-04-04 14:23 ` Russell King - ARM Linux
@ 2012-04-04 22:48 ` Rob Herring
  2012-04-04 23:03   ` Paul Parsons
                     ` (3 more replies)
  5 siblings, 4 replies; 18+ messages in thread
From: Rob Herring @ 2012-04-04 22:48 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Herring <rob.herring@calxeda.com>

With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
broken. PCMCIA depends on __io() returning a valid i/o address, and most
ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff for PCMCIA. This
needs a better fix with a fixed i/o address mapping, but for now we just
restore things to the previous behavior.

This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if PCI is enabled,
but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to 0xffffffff,
so it doesn't need an io.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
Cc: Paul Parsons <lost.distance@yahoo.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 arch/arm/Kconfig                      |    1 +
 arch/arm/include/asm/io.h             |    2 +-
 arch/arm/mach-at91/include/mach/io.h  |   27 +++++++++++++++++++
 arch/arm/mach-omap1/include/mach/io.h |   45 +++++++++++++++++++++++++++++++++
 arch/arm/mach-pxa/Kconfig             |    1 +
 arch/arm/mach-pxa/include/mach/io.h   |   17 ++++++++++++
 arch/arm/plat-omap/Kconfig            |    1 +
 7 files changed, 93 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-at91/include/mach/io.h
 create mode 100644 arch/arm/mach-omap1/include/mach/io.h
 create mode 100644 arch/arm/mach-pxa/include/mach/io.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9318084..cf006d4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -338,6 +338,7 @@ config ARCH_AT91
 	select HAVE_CLK
 	select CLKDEV_LOOKUP
 	select IRQ_DOMAIN
+	select NEED_MACH_IO_H if PCCARD
 	help
 	  This enables support for systems based on the Atmel AT91RM9200,
 	  AT91SAM9 processors.
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index df0ac0b..9af5563 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -119,7 +119,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
 #ifdef CONFIG_NEED_MACH_IO_H
 #include <mach/io.h>
 #else
-#define __io(a)		({ (void)(a); __typesafe_io(0); })
+#define __io(a)		__typesafe_io((a) & IO_SPACE_LIMIT)
 #endif
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/io.h b/arch/arm/mach-at91/include/mach/io.h
new file mode 100644
index 0000000..2d9ca04
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/io.h
@@ -0,0 +1,27 @@
+/*
+ * arch/arm/mach-at91/include/mach/io.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_IO_H
+#define __ASM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT		0xFFFFFFFF
+#define __io(a)			__typesafe_io(a)
+
+#endif
diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h
new file mode 100644
index 0000000..ce4f800
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/io.h
@@ -0,0 +1,45 @@
+/*
+ * arch/arm/mach-omap1/include/mach/io.h
+ *
+ * IO definitions for TI OMAP processors and boards
+ *
+ * Copied from arch/arm/mach-sa1100/include/mach/io.h
+ * Copyright (C) 1997-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Modifications:
+ *  06-12-1997	RMK	Created.
+ *  07-04-1999	RMK	Major cleanup
+ */
+
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+/*
+ * We don't actually have real ISA nor PCI buses, but there is so many
+ * drivers out there that might just work if we fake them...
+ */
+#define __io(a)		__typesafe_io(a)
+
+#endif
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 109ccd2..fe2d1f8 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -113,6 +113,7 @@ config MACH_ARMCORE
 	select IWMMXT
 	select PXA25x
 	select MIGHT_HAVE_PCI
+	select NEED_MACH_IO_H if PCI
 
 config MACH_EM_X270
 	bool "CompuLab EM-x270 platform"
diff --git a/arch/arm/mach-pxa/include/mach/io.h b/arch/arm/mach-pxa/include/mach/io.h
new file mode 100644
index 0000000..cd78b7f
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/io.h
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/mach-pxa/include/mach/io.h
+ *
+ * Copied from asm/arch/sa1100/io.h
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+/*
+ * We don't actually have real ISA nor PCI buses, but there is so many
+ * drivers out there that might just work if we fake them...
+ */
+#define __io(a)		__typesafe_io(a)
+
+#endif
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index ce1e9b9..ad95c7a 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -17,6 +17,7 @@ config ARCH_OMAP1
 	select IRQ_DOMAIN
 	select HAVE_IDE
 	select NEED_MACH_MEMORY_H
+	select NEED_MACH_IO_H if PCCARD
 	help
 	  "Systems based on omap7xx, omap15xx or omap16xx"
 
-- 
1.7.5.4

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

* [PATCH v2] ARM: fix __io macro for PCMCIA
  2012-04-04 22:48 ` [PATCH v2] " Rob Herring
@ 2012-04-04 23:03   ` Paul Parsons
  2012-04-05  0:47   ` Tony Lindgren
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 18+ messages in thread
From: Paul Parsons @ 2012-04-04 23:03 UTC (permalink / raw)
  To: linux-arm-kernel

--- On Wed, 4/4/12, Rob Herring <robherring2@gmail.com> wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> With commit c334bc1 (ARM: make mach/io.h include optional),
> PCMCIA was
> broken. PCMCIA depends on __io() returning a valid i/o
> address, and most
> ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff
> for PCMCIA. This
> needs a better fix with a fixed i/o address mapping, but for
> now we just
> restore things to the previous behavior.
> 
> This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if
> PCI is enabled,
> but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to
> 0xffffffff,
> so it doesn't need an io.h.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
> Cc: Paul Parsons <lost.distance@yahoo.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/Kconfig? ? ? ? ? ?
> ? ? ? ? ? |? ? 1 +
>  arch/arm/include/asm/io.h? ? ? ? ?
> ???|? ? 2 +-
>  arch/arm/mach-at91/include/mach/io.h?
> |???27 +++++++++++++++++++
>  arch/arm/mach-omap1/include/mach/io.h |???45
> +++++++++++++++++++++++++++++++++
>  arch/arm/mach-pxa/Kconfig? ? ? ? ?
> ???|? ? 1 +
>  arch/arm/mach-pxa/include/mach/io.h???|???17
> ++++++++++++
>  arch/arm/plat-omap/Kconfig? ? ? ?
> ? ? |? ? 1 +
>  7 files changed, 93 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/mach-at91/include/mach/io.h
>  create mode 100644 arch/arm/mach-omap1/include/mach/io.h
>  create mode 100644 arch/arm/mach-pxa/include/mach/io.h
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 9318084..cf006d4 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -338,6 +338,7 @@ config ARCH_AT91
>  ??? select HAVE_CLK
>  ??? select CLKDEV_LOOKUP
>  ??? select IRQ_DOMAIN
> +??? select NEED_MACH_IO_H if PCCARD
>  ??? help
>  ??? ? This enables support for systems
> based on the Atmel AT91RM9200,
>  ??? ? AT91SAM9 processors.
> diff --git a/arch/arm/include/asm/io.h
> b/arch/arm/include/asm/io.h
> index df0ac0b..9af5563 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -119,7 +119,7 @@ static inline void __iomem
> *__typesafe_io(unsigned long addr)
>  #ifdef CONFIG_NEED_MACH_IO_H
>  #include <mach/io.h>
>  #else
> -#define __io(a)??? ??? ({
> (void)(a); __typesafe_io(0); })
> +#define __io(a)??? ???
> __typesafe_io((a) & IO_SPACE_LIMIT)
>  #endif
>  
>  /*
> diff --git a/arch/arm/mach-at91/include/mach/io.h
> b/arch/arm/mach-at91/include/mach/io.h
> new file mode 100644
> index 0000000..2d9ca04
> --- /dev/null
> +++ b/arch/arm/mach-at91/include/mach/io.h
> @@ -0,0 +1,27 @@
> +/*
> + * arch/arm/mach-at91/include/mach/io.h
> + *
> + *? Copyright (C) 2003 SAN People
> + *
> + * This program is free software; you can redistribute it
> and/or modify
> + * it under the terms of the GNU General Public License as
> published by
> + * the Free Software Foundation; either version 2 of the
> License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be
> useful,
> + * but WITHOUT ANY WARRANTY; without even the implied
> warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.? See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General
> Public License
> + * along with this program; if not, write to the Free
> Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> MA? 02111-1307? USA
> + */
> +
> +#ifndef __ASM_ARCH_IO_H
> +#define __ASM_ARCH_IO_H
> +
> +#define IO_SPACE_LIMIT??? ???
> 0xFFFFFFFF
> +#define __io(a)??? ???
> ??? __typesafe_io(a)
> +
> +#endif
> diff --git a/arch/arm/mach-omap1/include/mach/io.h
> b/arch/arm/mach-omap1/include/mach/io.h
> new file mode 100644
> index 0000000..ce4f800
> --- /dev/null
> +++ b/arch/arm/mach-omap1/include/mach/io.h
> @@ -0,0 +1,45 @@
> +/*
> + * arch/arm/mach-omap1/include/mach/io.h
> + *
> + * IO definitions for TI OMAP processors and boards
> + *
> + * Copied from arch/arm/mach-sa1100/include/mach/io.h
> + * Copyright (C) 1997-1999 Russell King
> + *
> + * This program is free software; you can redistribute it
> and/or modify it
> + * under the terms of the GNU General Public License as
> published by the
> + * Free Software Foundation; either version 2 of the
> License, or (at your
> + * option) any later version.
> + *
> + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR
> IMPLIED
> + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
> WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> DISCLAIMED. IN
> + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
> INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF
> + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
> CAUSED AND ON
> + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> SUCH DAMAGE.
> + *
> + * You should have received a copy of the GNU General
> Public License along
> + * with this program; if not, write to the Free Software
> Foundation, Inc.,
> + * 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> + * Modifications:
> + *? 06-12-1997??? RMK???
> Created.
> + *? 07-04-1999??? RMK???
> Major cleanup
> + */
> +
> +#ifndef __ASM_ARM_ARCH_IO_H
> +#define __ASM_ARM_ARCH_IO_H
> +
> +#define IO_SPACE_LIMIT 0xffffffff
> +
> +/*
> + * We don't actually have real ISA nor PCI buses, but there
> is so many
> + * drivers out there that might just work if we fake
> them...
> + */
> +#define __io(a)??? ???
> __typesafe_io(a)
> +
> +#endif
> diff --git a/arch/arm/mach-pxa/Kconfig
> b/arch/arm/mach-pxa/Kconfig
> index 109ccd2..fe2d1f8 100644
> --- a/arch/arm/mach-pxa/Kconfig
> +++ b/arch/arm/mach-pxa/Kconfig
> @@ -113,6 +113,7 @@ config MACH_ARMCORE
>  ??? select IWMMXT
>  ??? select PXA25x
>  ??? select MIGHT_HAVE_PCI
> +??? select NEED_MACH_IO_H if PCI
>  
>  config MACH_EM_X270
>  ??? bool "CompuLab EM-x270 platform"
> diff --git a/arch/arm/mach-pxa/include/mach/io.h
> b/arch/arm/mach-pxa/include/mach/io.h
> new file mode 100644
> index 0000000..cd78b7f
> --- /dev/null
> +++ b/arch/arm/mach-pxa/include/mach/io.h
> @@ -0,0 +1,17 @@
> +/*
> + * arch/arm/mach-pxa/include/mach/io.h
> + *
> + * Copied from asm/arch/sa1100/io.h
> + */
> +#ifndef __ASM_ARM_ARCH_IO_H
> +#define __ASM_ARM_ARCH_IO_H
> +
> +#define IO_SPACE_LIMIT 0xffffffff
> +
> +/*
> + * We don't actually have real ISA nor PCI buses, but there
> is so many
> + * drivers out there that might just work if we fake
> them...
> + */
> +#define __io(a)??? ???
> __typesafe_io(a)
> +
> +#endif
> diff --git a/arch/arm/plat-omap/Kconfig
> b/arch/arm/plat-omap/Kconfig
> index ce1e9b9..ad95c7a 100644
> --- a/arch/arm/plat-omap/Kconfig
> +++ b/arch/arm/plat-omap/Kconfig
> @@ -17,6 +17,7 @@ config ARCH_OMAP1
>  ??? select IRQ_DOMAIN
>  ??? select HAVE_IDE
>  ??? select NEED_MACH_MEMORY_H
> +??? select NEED_MACH_IO_H if PCCARD
>  ??? help
>  ??? ? "Systems based on omap7xx,
> omap15xx or omap16xx"
>  
> -- 
> 1.7.5.4

This works for me on my hx4700 (PXA270) running linux-3.4-rc1.

Tested-by: Paul Parsons <lost.distance@yahoo.com>

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

* [PATCH v2] ARM: fix __io macro for PCMCIA
  2012-04-04 22:48 ` [PATCH v2] " Rob Herring
  2012-04-04 23:03   ` Paul Parsons
@ 2012-04-05  0:47   ` Tony Lindgren
  2012-04-05 10:10   ` Joachim Eastwood
  2012-04-05 18:29   ` Olof Johansson
  3 siblings, 0 replies; 18+ messages in thread
From: Tony Lindgren @ 2012-04-05  0:47 UTC (permalink / raw)
  To: linux-arm-kernel

* Rob Herring <robherring2@gmail.com> [120404 15:51]:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> broken. PCMCIA depends on __io() returning a valid i/o address, and most
> ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff for PCMCIA. This
> needs a better fix with a fixed i/o address mapping, but for now we just
> restore things to the previous behavior.
> 
> This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if PCI is enabled,
> but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to 0xffffffff,
> so it doesn't need an io.h.

Acked-by: Tony Lindgren <tony@atomide.com>

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

* [PATCH v2] ARM: fix __io macro for PCMCIA
  2012-04-04 22:48 ` [PATCH v2] " Rob Herring
  2012-04-04 23:03   ` Paul Parsons
  2012-04-05  0:47   ` Tony Lindgren
@ 2012-04-05 10:10   ` Joachim Eastwood
  2012-04-05 18:29   ` Olof Johansson
  3 siblings, 0 replies; 18+ messages in thread
From: Joachim Eastwood @ 2012-04-05 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 5, 2012 at 12:48 AM, Rob Herring <robherring2@gmail.com> wrote:
> From: Rob Herring <rob.herring@calxeda.com>
>
> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> broken. PCMCIA depends on __io() returning a valid i/o address, and most
> ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff for PCMCIA. This
> needs a better fix with a fixed i/o address mapping, but for now we just
> restore things to the previous behavior.
>
> This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if PCI is enabled,
> but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to 0xffffffff,
> so it doesn't need an io.h.
>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
> Cc: Paul Parsons <lost.distance@yahoo.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Tony Lindgren <tony@atomide.com>

Works for me on AT91RM9200 using at91_cf and pata_pcmcia.

Tested-by: Joachim Eastwood <joachim.eastwood@jotron.com>


>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2] ARM: fix __io macro for PCMCIA
  2012-04-04 22:48 ` [PATCH v2] " Rob Herring
                     ` (2 preceding siblings ...)
  2012-04-05 10:10   ` Joachim Eastwood
@ 2012-04-05 18:29   ` Olof Johansson
  3 siblings, 0 replies; 18+ messages in thread
From: Olof Johansson @ 2012-04-05 18:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 04, 2012 at 05:48:04PM -0500, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
> broken. PCMCIA depends on __io() returning a valid i/o address, and most
> ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff for PCMCIA. This
> needs a better fix with a fixed i/o address mapping, but for now we just
> restore things to the previous behavior.
> 
> This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if PCI is enabled,
> but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to 0xffffffff,
> so it doesn't need an io.h.
> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
> Cc: Paul Parsons <lost.distance@yahoo.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Tony Lindgren <tony@atomide.com>

Thanks, applied to fixes.


-Olof

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

end of thread, other threads:[~2012-04-05 18:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04  3:11 [PATCH] ARM: fix __io macro for PCMCIA Rob Herring
2012-04-04  7:55 ` Arnd Bergmann
2012-04-04  9:03 ` Russell King - ARM Linux
2012-04-04 10:27   ` Arnd Bergmann
2012-04-04 12:56     ` Russell King - ARM Linux
2012-04-04 13:04       ` Russell King - ARM Linux
2012-04-04 13:47         ` Rob Herring
2012-04-04 14:16           ` Russell King - ARM Linux
2012-04-04 10:02 ` Joachim Eastwood
2012-04-04 12:45   ` Rob Herring
2012-04-04 12:49     ` Joachim Eastwood
2012-04-04 11:05 ` Paul Parsons
2012-04-04 14:23 ` Russell King - ARM Linux
2012-04-04 22:48 ` [PATCH v2] " Rob Herring
2012-04-04 23:03   ` Paul Parsons
2012-04-05  0:47   ` Tony Lindgren
2012-04-05 10:10   ` Joachim Eastwood
2012-04-05 18:29   ` Olof Johansson

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.