* linux-3.4-rc1 PXA2xx PCMCIA possible regression
@ 2012-04-04 1:57 Paul Parsons
2012-04-04 2:50 ` Rob Herring
2012-04-04 13:08 ` Russell King - ARM Linux
0 siblings, 2 replies; 6+ messages in thread
From: Paul Parsons @ 2012-04-04 1:57 UTC (permalink / raw)
To: linux-arm-kernel
On linux-3.3 the PCMCIA/CF on my hx4700 worked OK.
On linux-3.4-rc1 the PCMCIA/CF has stopped working:
pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
pcmcia 0.0: pcmcia: registering new device pcmcia0.0 (IRQ: 156)
pata_pcmcia: probe of 0.0 failed with error -12
I've traced the -ENOMEM error back to pcmcia_init_one() in
drivers/ata/pata_pcmcia.c:
237 /* iomap */
238 ret = -ENOMEM;
239 io_addr = devm_ioport_map(&pdev->dev, io_base, 8);
240 ctl_addr = devm_ioport_map(&pdev->dev, ctl_base, 1);
241 if (!io_addr || !ctl_addr)
242 goto failed;
Both calls to devm_ioport_map() return NULL.
The ultimate source of both NULL values appears to be __io() and
thence __typesafe_io(), both defined in arch/arm/include/asm/io.h
^ permalink raw reply [flat|nested] 6+ messages in thread
* linux-3.4-rc1 PXA2xx PCMCIA possible regression
2012-04-04 1:57 linux-3.4-rc1 PXA2xx PCMCIA possible regression Paul Parsons
@ 2012-04-04 2:50 ` Rob Herring
2012-04-04 10:43 ` Paul Parsons
2012-04-04 13:08 ` Russell King - ARM Linux
1 sibling, 1 reply; 6+ messages in thread
From: Rob Herring @ 2012-04-04 2:50 UTC (permalink / raw)
To: linux-arm-kernel
On 04/03/2012 08:57 PM, Paul Parsons wrote:
> On linux-3.3 the PCMCIA/CF on my hx4700 worked OK.
>
> On linux-3.4-rc1 the PCMCIA/CF has stopped working:
>
> pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
> pcmcia 0.0: pcmcia: registering new device pcmcia0.0 (IRQ: 156)
> pata_pcmcia: probe of 0.0 failed with error -12
>
> I've traced the -ENOMEM error back to pcmcia_init_one() in
> drivers/ata/pata_pcmcia.c:
>
> 237 /* iomap */
> 238 ret = -ENOMEM;
> 239 io_addr = devm_ioport_map(&pdev->dev, io_base, 8);
> 240 ctl_addr = devm_ioport_map(&pdev->dev, ctl_base, 1);
> 241 if (!io_addr || !ctl_addr)
> 242 goto failed;
>
> Both calls to devm_ioport_map() return NULL.
>
> The ultimate source of both NULL values appears to be __io() and
> thence __typesafe_io(), both defined in arch/arm/include/asm/io.h
I broke it with the io.h clean-up. It seems PCMCIA drivers rely on
__io() just being a cast. The easy fix is just restore that behavior for
PCMCIA:
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index df0ac0b..1b50c28 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_PCMCIA)
+#define __io(a) __typesafe_io(a)
#else
#define __io(a) ({ (void)(a); __typesafe_io(0); })
#endif
Can you please test this change. This is what we'll have to do for 3.4,
but this is not really the right solution. io_base should not be a
virtual address here, but an i/o address in the range of 0-64K. We need
to move PCMCIA to the fixed i/o mapping I've posted:
http://www.spinics.net/lists/arm-kernel/msg162547.html
I've been trying to get PCMCIA to work on spitz in QEMU to test out
fixes, but haven't had much luck. I'm not getting a card detected even
though QEMU thinks one is present.
Rob
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* linux-3.4-rc1 PXA2xx PCMCIA possible regression
2012-04-04 2:50 ` Rob Herring
@ 2012-04-04 10:43 ` Paul Parsons
0 siblings, 0 replies; 6+ messages in thread
From: Paul Parsons @ 2012-04-04 10:43 UTC (permalink / raw)
To: linux-arm-kernel
Hello Rob,
--- On Wed, 4/4/12, Rob Herring <robherring2@gmail.com> wrote:
> On 04/03/2012 08:57 PM, Paul Parsons
> wrote:
> > On linux-3.3 the PCMCIA/CF on my hx4700 worked OK.
> >
> > On linux-3.4-rc1 the PCMCIA/CF has stopped working:
> >
> > pcmcia_socket pcmcia_socket0: pccard: PCMCIA card
> inserted into slot 0
> > pcmcia 0.0: pcmcia: registering new device pcmcia0.0
> (IRQ: 156)
> > pata_pcmcia: probe of 0.0 failed with error -12
> >
> > I've traced the -ENOMEM error back to pcmcia_init_one()
> in
> > drivers/ata/pata_pcmcia.c:
> >
> >? ? 237??? ???
> /* iomap */
> >? ? 238??? ???
> ret = -ENOMEM;
> >? ? 239??? ???
> io_addr = devm_ioport_map(&pdev->dev, io_base, 8);
> >? ? 240??? ???
> ctl_addr = devm_ioport_map(&pdev->dev, ctl_base, 1);
> >? ? 241??? ???
> if (!io_addr || !ctl_addr)
> >? ? 242??? ???
> ??? goto failed;
> >
> > Both calls to devm_ioport_map() return NULL.
> >
> > The ultimate source of both NULL values appears to be
> __io() and
> > thence __typesafe_io(), both defined in
> arch/arm/include/asm/io.h
>
> I broke it with the io.h clean-up. It seems PCMCIA drivers
> rely on
> __io() just being a cast. The easy fix is just restore that
> behavior for
> PCMCIA:
>
> diff --git a/arch/arm/include/asm/io.h
> b/arch/arm/include/asm/io.h
> index df0ac0b..1b50c28 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_PCMCIA)
> +#define __io(a)? ? ? ? ? ?
> ? ? __typesafe_io(a)
> #else
> #define __io(a)? ? ? ? ? ?
> ? ? ({ (void)(a); __typesafe_io(0); })
> #endif
>
>
> Can you please test this change. This is what we'll have to
> do for 3.4,
> but this is not really the right solution. io_base should
> not be a
> virtual address here, but an i/o address in the range of
> 0-64K. We need
> to move PCMCIA to the fixed i/o mapping I've posted:
>
> http://www.spinics.net/lists/arm-kernel/msg162547.html
>
> I've been trying to get PCMCIA to work on spitz in QEMU to
> test out
> fixes, but haven't had much luck. I'm not getting a card
> detected even
> though QEMU thinks one is present.
Yes, this change fixes the PCMCIA/CF on my hx4700 (PXA270).
Thanks,
Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
* linux-3.4-rc1 PXA2xx PCMCIA possible regression
2012-04-04 1:57 linux-3.4-rc1 PXA2xx PCMCIA possible regression Paul Parsons
2012-04-04 2:50 ` Rob Herring
@ 2012-04-04 13:08 ` Russell King - ARM Linux
2012-04-04 13:55 ` Paul Parsons
1 sibling, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2012-04-04 13:08 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 04, 2012 at 02:57:22AM +0100, Paul Parsons wrote:
> On linux-3.3 the PCMCIA/CF on my hx4700 worked OK.
>
> On linux-3.4-rc1 the PCMCIA/CF has stopped working:
>
> pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
> pcmcia 0.0: pcmcia: registering new device pcmcia0.0 (IRQ: 156)
> pata_pcmcia: probe of 0.0 failed with error -12
I see no PCMCIA support for HX4700 in mainline. Where is it?
^ permalink raw reply [flat|nested] 6+ messages in thread
* linux-3.4-rc1 PXA2xx PCMCIA possible regression
2012-04-04 13:08 ` Russell King - ARM Linux
@ 2012-04-04 13:55 ` Paul Parsons
2012-04-04 14:21 ` Russell King - ARM Linux
0 siblings, 1 reply; 6+ messages in thread
From: Paul Parsons @ 2012-04-04 13:55 UTC (permalink / raw)
To: linux-arm-kernel
Hello Russell,
--- On Wed, 4/4/12, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> On Wed, Apr 04, 2012 at 02:57:22AM
> +0100, Paul Parsons wrote:
> > On linux-3.3 the PCMCIA/CF on my hx4700 worked OK.
> >
> > On linux-3.4-rc1 the PCMCIA/CF has stopped working:
> >
> > pcmcia_socket pcmcia_socket0: pccard: PCMCIA card
> inserted into slot 0
> > pcmcia 0.0: pcmcia: registering new device pcmcia0.0
> (IRQ: 156)
> > pata_pcmcia: probe of 0.0 failed with error -12
>
> I see no PCMCIA support for HX4700 in mainline.? Where
> is it?
It is languishing in pending patch land:
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/089266.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/088988.html
Regards,
Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
* linux-3.4-rc1 PXA2xx PCMCIA possible regression
2012-04-04 13:55 ` Paul Parsons
@ 2012-04-04 14:21 ` Russell King - ARM Linux
0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2012-04-04 14:21 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 04, 2012 at 02:55:21PM +0100, Paul Parsons wrote:
> It is languishing in pending patch land:
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/089266.html
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/088988.html
These links aren't working for me at the moment. I found the patches
in my mailbox nevertheless.
As you're using the PXA stuff, that selects PCMCIA_SOC_COMMON, which means
this part of Rob's patch is rubbish, because you'll get the 4GB IO space
precisely because of PCMCIA_SOC_COMMON being enabled.
#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)
So it all hinges around what we supply for the __io() macro.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-04-04 14:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04 1:57 linux-3.4-rc1 PXA2xx PCMCIA possible regression Paul Parsons
2012-04-04 2:50 ` Rob Herring
2012-04-04 10:43 ` Paul Parsons
2012-04-04 13:08 ` Russell King - ARM Linux
2012-04-04 13:55 ` Paul Parsons
2012-04-04 14:21 ` Russell King - ARM Linux
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).