From: Kristoffer E. <kri...@gm...> - 2007-10-06 22:46:58
|
Greetings, Since I've been debugging the pcmcia driver, I thought of something andriy said 1-2 years ago when pcmcia was buggy. In order for 2.6.17 to have working pcmcia we needed to add this patch below. Andriy said he knew this wasn't the best way to solve it, but we should use it until he talked to you. Currently this isn't applied to neither jlime-current.git or any other git tree. Could you please give me some quick feedback on why this might be nessecary (or was). I always assumed It would be obselete ones MMIO transition was over. --- linux-2.6.17/include/asm-sh/io.h_orig 2006-09-17 22:52:10.000000000 +0000 +++ linux-2.6.17/include/asm-sh/io.h 2006-09-17 22:54:01.000000000 +0000 @@ -138,17 +138,17 @@ #define readl_relaxed(a) readl(a) /* Simple MMIO */ -#define ioread8(a) readb(a) -#define ioread16(a) readw(a) -#define ioread16be(a) be16_to_cpu(__raw_readw((a))) -#define ioread32(a) readl(a) -#define ioread32be(a) be32_to_cpu(__raw_readl((a))) - -#define iowrite8(v,a) writeb((v),(a)) -#define iowrite16(v,a) writew((v),(a)) -#define iowrite16be(v,a) __raw_writew(cpu_to_be16((v)),(a)) -#define iowrite32(v,a) writel((v),(a)) -#define iowrite32be(v,a) __raw_writel(cpu_to_be32((v)),(a)) +#define ioread8(a) inb(a) +#define ioread16(a) inw(a) +#define ioread16be(a) be16_to_cpu(inw((a))) +#define ioread32(a) inl(a) +#define ioread32be(a) be32_to_cpu(inl((a))) + +#define iowrite8(v,a) outb((v),(a)) +#define iowrite16(v,a) outw((v),(a)) +#define iowrite16be(v,a) outw(cpu_to_be16((v)),(a)) +#define iowrite32(v,a) outl((v),(a)) +#define iowrite32be(v,a) outl(cpu_to_be32((v)),(a)) #define ioread8_rep(a,d,c) insb((a),(d),(c)) #define ioread16_rep(a,d,c) insw((a),(d),(c)) |
From: Kristoffer E. <kri...@gm...> - 2007-10-09 17:57:08
|
Greetings, Since I've been debugging the pcmcia driver, I thought of something andriy said 1-2 years ago when pcmcia was buggy. In order for 2.6.17 to have working pcmcia we needed to add this patch below. Andriy said he knew this wasn't the best way to solve it, but we should use it until he talked to you. Currently this isn't applied to neither jlime-current.git or any other git tree. Could you please give me some quick feedback on why this might be nessecary (or was). I always assumed It would be obselete ones MMIO transition was over. --- linux-2.6.17/include/asm-sh/io.h_orig 2006-09-17 22:52:10.000000000 +0000 +++ linux-2.6.17/include/asm-sh/io.h 2006-09-17 22:54:01.000000000 +0000 @@ -138,17 +138,17 @@ #define readl_relaxed(a) readl(a) /* Simple MMIO */ -#define ioread8(a) readb(a) -#define ioread16(a) readw(a) -#define ioread16be(a) be16_to_cpu(__raw_readw((a))) -#define ioread32(a) readl(a) -#define ioread32be(a) be32_to_cpu(__raw_readl((a))) - -#define iowrite8(v,a) writeb((v),(a)) -#define iowrite16(v,a) writew((v),(a)) -#define iowrite16be(v,a) __raw_writew(cpu_to_be16((v)),(a)) -#define iowrite32(v,a) writel((v),(a)) -#define iowrite32be(v,a) __raw_writel(cpu_to_be32((v)),(a)) +#define ioread8(a) inb(a) +#define ioread16(a) inw(a) +#define ioread16be(a) be16_to_cpu(inw((a))) +#define ioread32(a) inl(a) +#define ioread32be(a) be32_to_cpu(inl((a))) + +#define iowrite8(v,a) outb((v),(a)) +#define iowrite16(v,a) outw((v),(a)) +#define iowrite16be(v,a) outw(cpu_to_be16((v)),(a)) +#define iowrite32(v,a) outl((v),(a)) +#define iowrite32be(v,a) outl(cpu_to_be32((v)),(a)) #define ioread8_rep(a,d,c) insb((a),(d),(c)) #define ioread16_rep(a,d,c) insw((a),(d),(c)) |
From: Paul M. <le...@li...> - 2007-10-09 10:12:45
|
On Sun, Oct 07, 2007 at 12:46:48AM -0700, Kristoffer Ericson wrote: > Since I've been debugging the pcmcia driver, I thought of something > andriy said 1-2 years ago when pcmcia was buggy. In order for 2.6.17 > to have working pcmcia we needed to add this patch below. > It was probably necessary because it forced all of the MMIO accesses to the PIO address trapping/fixup that the old hd64461 I/O routines did. The proper way to fix this is to get the port mapping right in the driver itself and just stick with regular MMIO accesses. There's no reason why this _requires_ non-MMIO, so it's purely a convenience thing. If this actually fixes PCMCIA for you today, then it bears a closer looking at, but at a quick glance I don't see it having any impact these days. |
From: Kristoffer E. <kri...@gm...> - 2007-10-09 18:01:00
|
Sorry, accidently sent the old message again. :( On Tue, 9 Oct 2007 19:12:23 +0900 Paul Mundt <le...@li...> wrote: > On Sun, Oct 07, 2007 at 12:46:48AM -0700, Kristoffer Ericson wrote: > > Since I've been debugging the pcmcia driver, I thought of something > > andriy said 1-2 years ago when pcmcia was buggy. In order for 2.6.17 > > to have working pcmcia we needed to add this patch below. > > > It was probably necessary because it forced all of the MMIO accesses to > the PIO address trapping/fixup that the old hd64461 I/O routines did. The > proper way to fix this is to get the port mapping right in the driver > itself and just stick with regular MMIO accesses. There's no reason why > this _requires_ non-MMIO, so it's purely a convenience thing. Thats what I thought, nice to have it confirmed though. The port mapping should be fixed, so the pcmcia driver most likely suffers from some API change. Before we created a "junk" IRQ by setting irq_desc[].chip = &blabla_type, Im guessing the irq_desc now requires an actual interrupt action now. > > If this actually fixes PCMCIA for you today, then it bears a closer > looking at, but at a quick glance I don't see it having any impact these > days. I tried it and it didn't do anything, so you are quite correct. Thanx for feedback |