* pcmcia IDE broken in 2.6.18-rc1
@ 2006-07-08 14:55 Pavel Machek
2006-07-08 16:47 ` Andrew Morton
2006-07-08 17:36 ` Alan Cox
0 siblings, 2 replies; 9+ messages in thread
From: Pavel Machek @ 2006-07-08 14:55 UTC (permalink / raw)
To: Andrew Morton, kernel list
Hi!
When I insert the card, I get
pccard: PCMCIA card inserted into slot 0
cs: memory probe 0xe8000000-0xefffffff: excluding
0xe8000000-0xefffffff
cs: memory probe 0xc0200000-0xcfffffff: excluding
0xc0200000-0xc11fffff 0xc1a00000-0xc61fffff 0xc6a00000-0xc71fffff
0xc7a00000-0xc81fffff 0xc8a00000-0xc91fffff 0xc9a00000-0xca1fffff
0xcaa00000-0xcb1fffff 0xcba00000-0xcc1fffff 0xcca00000-0xcd1fffff
0xcda00000-0xce1fffff 0xcea00000-0xcf1fffff 0xcfa00000-0xd01fffff
pcmcia: registering new device pcmcia0.0
PM: Adding info for pcmcia:0.0
ide2: I/O resource 0xF887E00E-0xF887E00E not free.
ide2: ports already in use, skipping probe
ide2: I/O resource 0xF887E01E-0xF887E01E not free.
ide2: ports already in use, skipping probe
...
it ends with
ide-cs: ide_register() at 0xf999c000 & 0xf999c00e, irq 7 failed
:-(. Back to 2.6.17 once again, I'm afraid...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-08 14:55 pcmcia IDE broken in 2.6.18-rc1 Pavel Machek
@ 2006-07-08 16:47 ` Andrew Morton
2006-07-13 18:00 ` Jan Engelhardt
2006-07-08 17:36 ` Alan Cox
1 sibling, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2006-07-08 16:47 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-kernel
On Sat, 8 Jul 2006 16:55:43 +0200
Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> When I insert the card, I get
>
> pccard: PCMCIA card inserted into slot 0
> cs: memory probe 0xe8000000-0xefffffff: excluding
> 0xe8000000-0xefffffff
> cs: memory probe 0xc0200000-0xcfffffff: excluding
> 0xc0200000-0xc11fffff 0xc1a00000-0xc61fffff 0xc6a00000-0xc71fffff
> 0xc7a00000-0xc81fffff 0xc8a00000-0xc91fffff 0xc9a00000-0xca1fffff
> 0xcaa00000-0xcb1fffff 0xcba00000-0xcc1fffff 0xcca00000-0xcd1fffff
> 0xcda00000-0xce1fffff 0xcea00000-0xcf1fffff 0xcfa00000-0xd01fffff
> pcmcia: registering new device pcmcia0.0
> PM: Adding info for pcmcia:0.0
> ide2: I/O resource 0xF887E00E-0xF887E00E not free.
> ide2: ports already in use, skipping probe
> ide2: I/O resource 0xF887E01E-0xF887E01E not free.
> ide2: ports already in use, skipping probe
> ...
>
> it ends with
>
> ide-cs: ide_register() at 0xf999c000 & 0xf999c00e, irq 7 failed
>
> :-(. Back to 2.6.17 once again, I'm afraid...
Appears to be the same bug as http://lkml.org/lkml/2006/6/15/155
That debugging effort dried up at "Can you do some more tracing on hwif."
You're our only hope. Can you debug it a bit please?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-08 14:55 pcmcia IDE broken in 2.6.18-rc1 Pavel Machek
2006-07-08 16:47 ` Andrew Morton
@ 2006-07-08 17:36 ` Alan Cox
2006-07-08 17:41 ` Andrew Morton
1 sibling, 1 reply; 9+ messages in thread
From: Alan Cox @ 2006-07-08 17:36 UTC (permalink / raw)
To: Pavel Machek; +Cc: Andrew Morton, kernel list
Ar Sad, 2006-07-08 am 16:55 +0200, ysgrifennodd Pavel Machek:
> ide2: I/O resource 0xF887E00E-0xF887E00E not free.
> ide2: ports already in use, skipping probe
> ide2: I/O resource 0xF887E01E-0xF887E01E not free.
> ide2: ports already in use, skipping probe
Looks like ioremap values not I/O ports. Probably the various IDE layer
changes from 2.6.17-mm.
My first guess would be the PCMCIA layer changes to use mmio ports are
not setting hwif->mmio (I think its ->mmio) to 2 and doing their own
resource management.
Alan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-08 17:36 ` Alan Cox
@ 2006-07-08 17:41 ` Andrew Morton
2006-07-08 21:35 ` Alan Cox
2006-07-09 22:47 ` Pavel Machek
0 siblings, 2 replies; 9+ messages in thread
From: Andrew Morton @ 2006-07-08 17:41 UTC (permalink / raw)
To: Alan Cox; +Cc: pavel, linux-kernel
On Sat, 08 Jul 2006 18:36:39 +0100
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Ar Sad, 2006-07-08 am 16:55 +0200, ysgrifennodd Pavel Machek:
> > ide2: I/O resource 0xF887E00E-0xF887E00E not free.
> > ide2: ports already in use, skipping probe
> > ide2: I/O resource 0xF887E01E-0xF887E01E not free.
> > ide2: ports already in use, skipping probe
>
>
> Looks like ioremap values not I/O ports. Probably the various IDE layer
> changes from 2.6.17-mm.
>
> My first guess would be the PCMCIA layer changes to use mmio ports are
> not setting hwif->mmio (I think its ->mmio) to 2 and doing their own
> resource management.
>
5040cb8b7e61b7a03e8837920b9eb2c839bb1947 looks like a good one to try
reverting.
commit 5040cb8b7e61b7a03e8837920b9eb2c839bb1947
Author: Thomas Kleffel <tk@maintech.de>
Date: Sun May 14 15:16:30 2006 +0200
[PATCH] pcmcia: Make ide_cs work with the memory space of CF-Cards if IO space is not available
This patch enables ide_cs to access CF-cards via their common memory
rather than via their IO space.
Signed-off-by: Thomas Kleffel <tk@maintech.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 602797a..b7e459e 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_dev
kfree(link->priv);
} /* ide_detach */
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
+static void idecs_mmio_fixup(ide_hwif_t *hwif)
+{
+ default_hwif_mmiops(hwif);
+ hwif->mmio = 2;
+
+ ide_undecoded_slave(hwif);
+}
+
+static int idecs_register(unsigned long io, unsigned long ctl,
+ unsigned long irq, struct pcmcia_device *handle, int is_mmio)
{
hw_regs_t hw;
memset(&hw, 0, sizeof(hw));
@@ -154,7 +163,19 @@ static int idecs_register(unsigned long
hw.irq = irq;
hw.chipset = ide_pci;
hw.dev = &handle->dev;
- return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
+
+ if(is_mmio)
+ return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
+ else
+ return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
+}
+
+void outb_io(unsigned char value, unsigned long port) {
+ outb(value, port);
+}
+
+void outb_mem(unsigned char value, unsigned long port) {
+ writeb(value, (void __iomem *) port);
}
/*======================================================================
@@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_devi
} *stk = NULL;
cistpl_cftable_entry_t *cfg;
int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
- unsigned long io_base, ctl_base;
+ unsigned long io_base, ctl_base, is_mmio, try_slave;
+ void (*my_outb)(unsigned char, unsigned long);
DEBUG(0, "ide_config(0x%p)\n", link);
@@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_devi
/* Not sure if this is right... look up the current Vcc */
CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
- pass = io_base = ctl_base = 0;
+ pass = io_base = ctl_base = is_mmio = try_slave = 0;
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
tuple.Attributes = 0;
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_devi
goto next_entry;
io_base = link->io.BasePort1;
ctl_base = link->io.BasePort1 + 0x0e;
+
+ if (io->win[0].len >= 0x20)
+ try_slave = 1;
+
} else goto next_entry;
/* If we've got this far, we're done */
break;
}
+ if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
+ win_req_t req;
+ memreq_t map;
+ cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
+
+ if (mem->win[0].len < 16)
+ goto next_entry;
+
+ req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
+ req.Attributes |= WIN_ENABLE;
+ req.Base = mem->win[0].host_addr;
+ req.Size = 0;
+
+ req.AccessSpeed = 0;
+ if (pcmcia_request_window(&link, &req, &link->win) != 0)
+ goto next_entry;
+ map.Page = 0; map.CardOffset = mem->win[0].card_addr;
+ if (pcmcia_map_mem_page(link->win, &map) != 0)
+ goto next_entry;
+
+ io_base = (unsigned long) ioremap(req.Base, req.Size);
+ ctl_base = io_base + 0x0e;
+ is_mmio = 1;
+
+ if (mem->win[0].len >= 0x20)
+ try_slave = 1;
+
+ break;
+ }
+
next_entry:
if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_devi
CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+ if(is_mmio)
+ my_outb = outb_mem;
+ else
+ my_outb = outb_io;
+
/* disable drive interrupts during IDE probe */
- outb(0x02, ctl_base);
+ my_outb(0x02, ctl_base);
/* special setup for KXLC005 card */
if (is_kme)
- outb(0x81, ctl_base+1);
+ my_outb(0x81, ctl_base+1);
/* retry registration in case device is still spinning up */
for (hd = -1, i = 0; i < 10; i++) {
- hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
+ hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio);
if (hd >= 0) break;
- if (link->io.NumPorts1 == 0x20) {
- outb(0x02, ctl_base + 0x10);
+ if (try_slave) {
+ my_outb(0x02, ctl_base + 0x10);
hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
- link->irq.AssignedIRQ, link);
+ link->irq.AssignedIRQ, link, is_mmio);
if (hd >= 0) {
io_base += 0x10;
ctl_base += 0x10;
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-08 17:41 ` Andrew Morton
@ 2006-07-08 21:35 ` Alan Cox
2006-07-08 22:04 ` Andrew Morton
2006-07-09 22:47 ` Pavel Machek
1 sibling, 1 reply; 9+ messages in thread
From: Alan Cox @ 2006-07-08 21:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: pavel, linux-kernel
Ar Sad, 2006-07-08 am 10:41 -0700, ysgrifennodd Andrew Morton:
> + io_base = (unsigned long) ioremap(req.Base, req.Size);
> + ctl_base = io_base + 0x0e;
> + is_mmio = 1;
Where does this get unmapped ?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-08 21:35 ` Alan Cox
@ 2006-07-08 22:04 ` Andrew Morton
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2006-07-08 22:04 UTC (permalink / raw)
To: Alan Cox; +Cc: pavel, linux-kernel, Thomas Kleffel, Dominik Brodowski
On Sat, 08 Jul 2006 22:35:47 +0100
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Ar Sad, 2006-07-08 am 10:41 -0700, ysgrifennodd Andrew Morton:
> > + io_base = (unsigned long) ioremap(req.Base, req.Size);
> > + ctl_base = io_base + 0x0e;
> > + is_mmio = 1;
>
> Where does this get unmapped ?
I don't think it does. (drivers/ide/legacy/ide-cs.c:312)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-08 17:41 ` Andrew Morton
2006-07-08 21:35 ` Alan Cox
@ 2006-07-09 22:47 ` Pavel Machek
2006-07-09 23:13 ` Andrew Morton
1 sibling, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2006-07-09 22:47 UTC (permalink / raw)
To: Andrew Morton; +Cc: Alan Cox, linux-kernel
Hi!
> > > ide2: I/O resource 0xF887E00E-0xF887E00E not free.
> > > ide2: ports already in use, skipping probe
> > > ide2: I/O resource 0xF887E01E-0xF887E01E not free.
> > > ide2: ports already in use, skipping probe
> >
> >
> > Looks like ioremap values not I/O ports. Probably the various IDE layer
> > changes from 2.6.17-mm.
> >
> > My first guess would be the PCMCIA layer changes to use mmio ports are
> > not setting hwif->mmio (I think its ->mmio) to 2 and doing their own
> > resource management.
> >
>
> 5040cb8b7e61b7a03e8837920b9eb2c839bb1947 looks like a good one to try
> reverting.
2.6.18-rc1-mm1 works okay. Is that enough, or do you want me to try
reverting just this patch?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-09 22:47 ` Pavel Machek
@ 2006-07-09 23:13 ` Andrew Morton
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2006-07-09 23:13 UTC (permalink / raw)
To: Pavel Machek; +Cc: alan, linux-kernel, Thomas Kleffel, Dominik Brodowski
On Mon, 10 Jul 2006 00:47:08 +0200
Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > > > ide2: I/O resource 0xF887E00E-0xF887E00E not free.
> > > > ide2: ports already in use, skipping probe
> > > > ide2: I/O resource 0xF887E01E-0xF887E01E not free.
> > > > ide2: ports already in use, skipping probe
> > >
> > >
> > > Looks like ioremap values not I/O ports. Probably the various IDE layer
> > > changes from 2.6.17-mm.
> > >
> > > My first guess would be the PCMCIA layer changes to use mmio ports are
> > > not setting hwif->mmio (I think its ->mmio) to 2 and doing their own
> > > resource management.
> > >
> >
> > 5040cb8b7e61b7a03e8837920b9eb2c839bb1947 looks like a good one to try
> > reverting.
>
> 2.6.18-rc1-mm1 works okay. Is that enough, or do you want me to try
> reverting just this patch?
Nope, that's fine, thanks. I think we can say that
5040cb8b7e61b7a03e8837920b9eb2c839bb1947 is busted.
Let's give Thomas and Dominik a few days to think about it before we do the
deed..
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: pcmcia IDE broken in 2.6.18-rc1
2006-07-08 16:47 ` Andrew Morton
@ 2006-07-13 18:00 ` Jan Engelhardt
0 siblings, 0 replies; 9+ messages in thread
From: Jan Engelhardt @ 2006-07-13 18:00 UTC (permalink / raw)
To: Andrew Morton; +Cc: Pavel Machek, linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1681 bytes --]
>> When I insert the card, I get
>>
>> pccard: PCMCIA card inserted into slot 0
>> cs: memory probe 0xe8000000-0xefffffff: excluding
>> 0xe8000000-0xefffffff
>> cs: memory probe 0xc0200000-0xcfffffff: excluding
>> 0xc0200000-0xc11fffff 0xc1a00000-0xc61fffff 0xc6a00000-0xc71fffff
>> 0xc7a00000-0xc81fffff 0xc8a00000-0xc91fffff 0xc9a00000-0xca1fffff
>> 0xcaa00000-0xcb1fffff 0xcba00000-0xcc1fffff 0xcca00000-0xcd1fffff
>> 0xcda00000-0xce1fffff 0xcea00000-0xcf1fffff 0xcfa00000-0xd01fffff
>> pcmcia: registering new device pcmcia0.0
>> PM: Adding info for pcmcia:0.0
>> ide2: I/O resource 0xF887E00E-0xF887E00E not free.
>> ide2: ports already in use, skipping probe
>> ide2: I/O resource 0xF887E01E-0xF887E01E not free.
>> ide2: ports already in use, skipping probe
>> ...
>>
>> it ends with
>>
>> ide-cs: ide_register() at 0xf999c000 & 0xf999c00e, irq 7 failed
>>
>> :-(. Back to 2.6.17 once again, I'm afraid...
>
>Appears to be the same bug as http://lkml.org/lkml/2006/6/15/155
As I am one of the probably few people who have some PCMCIA-IDE-drive (Sony
PCGA-CD51/A), running 2.6.18-rc1 gives me no problems.
pccard: PCMCIA card inserted into slot 0
kernel: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia: registering new device pcmcia0.0
Probind IDE interface ide2...
hde: TOSHIBA CD-ROM XM-7002Bc, ATAPI CD/DVD-ROM drive
ide2 at 0x180-0x198,0x386 on irq 3
ide-cs: hde: Vpp = 0.0
pcmcia: Detected deprecated PCMCIA ioctl usage from process: hald
Seems fine. I can mount and read it w/o problems.
$ rpm -q pcmciautils
pcmciautils-012-11 (SUSE Linux 10.1)
CONFIG_ISA=y
# CONFIG_RESOURCES_64BIT is not set
Just 2¢, ask for more if needed :)
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-07-13 18:01 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-08 14:55 pcmcia IDE broken in 2.6.18-rc1 Pavel Machek
2006-07-08 16:47 ` Andrew Morton
2006-07-13 18:00 ` Jan Engelhardt
2006-07-08 17:36 ` Alan Cox
2006-07-08 17:41 ` Andrew Morton
2006-07-08 21:35 ` Alan Cox
2006-07-08 22:04 ` Andrew Morton
2006-07-09 22:47 ` Pavel Machek
2006-07-09 23:13 ` Andrew Morton
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.