Problems with pcmcia code

Russell King rmk+pcmcia at arm.linux.org.uk
Tue Oct 21 18:15:36 BST 2003


On Tue, Oct 21, 2003 at 10:50:36AM -0500, Larry W. Finger wrote:
> 1. The system only recognizes a card insertion every second time.
> 2. When the insertion event is recognized, the system fails to read the CIS 
> and tries to load memory_cs. Only after cardmgr is restarted with a "kill 
> -HUP" is the card properly recognized.
...
> If not, please indicate what additional material would be helpful.

I think we need some more useful debugging printks in here so we can see
what the socket driver is being asked to do.

> Yenta: ISA IRQ list 0038, PCI irq11
> Socket status: 30000007

Ok, no card inserted.

> yenta_events: cb_event = 0x0, events = 0x0, csc = 0x0
> yenta_interrupt: events = 0x0
> yenta_events: cb_event = 0x0, events = 0x0, csc = 0x0
> yenta_interrupt: events = 0x0

For some reason, we're seeing loads of these, yet there aren't any
events pending.  Maybe there's some other device sharing IRQ11 ?

> ================================================================
> When my Adaptec APA-1460B SlimSCSI card is plugged into socket 0,
> my only one, the following is added. No beeps are heard.
> =================================================================
> 
> yenta_events: cb_event = 0x0, events = 0x0, csc = 0x0
> yenta_interrupt: events = 0x0

We seem to receive a hardware interrupt, but there are no events pending.
Can you also display the contents of the CB_SOCKET_STATE register here
as well please?

> ==================================================================
> When the card is unplugged, the following is added. Again no beeps are
> heard.
> ===================================================================
> 
> yenta_events: cb_event = 0x6, events = 0x80, csc = 0x0
> yenta_interrupt: events = 0x80

The bridge now tells is that the card was removed.

> ====================================================================
> When the card is again plugged in, the following is added. This time a high-low
> beep combination is heard as the system tries (and fails) to bind memory_cs.
> =====================================================================
> 
> yenta_events: cb_event = 0x6, events = 0x80, csc = 0x0
> yenta_interrupt: events = 0x80

and now tells is that it was inserted.

> With further plugging and unplugging, the system alternates between
> ignoring the event and trying to load memory_cs. Only if a 'kill -HUP'
> is issued to cardmgr will the SCSI card be recognized.

Can you apply the patch below and do a similar description to the
above, and include what happens after you kill -HUP cardmgr and the
card is properly recognised please?

Thanks.

--- orig/drivers/pcmcia/yenta_socket.c.old	Sun Sep 28 09:54:57 2003
+++ orig/drivers/pcmcia/yenta_socket.c	Tue Oct 21 17:13:50 2003
@@ -161,7 +161,7 @@
 		val |= (status & I365_CS_READY) ? SS_READY : 0;
 		val |= (status & I365_CS_POWERON) ? SS_POWERON : 0;
 	}
-
+printk("yenta_get_status: state %08x ret %08x\n", state, val);
 	*value = val;
 	return 0;
 }
@@ -247,7 +247,7 @@
 {
 	struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
 	u16 bridge;
-
+printk("yenta_set_socket: flags %08x csc_mask %08x vcc %d vpp %d irq %d\n", state->flags, state->csc_mask, state->Vcc, state->Vpp, state->io_irq);
 	yenta_set_power(socket, state);
 	socket->io_irq = state->io_irq;
 	bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~(CB_BRIDGE_CRST | CB_BRIDGE_INTR);
@@ -308,7 +308,7 @@
 	struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
 	int map;
 	unsigned char ioctl, addr, enable;
-
+printk("yenta_set_io_map: map %d flags %x speed %d start %08x stop %08x\n", io->map, io->flags, io->speed, io->start, io->stop);
 	map = io->map;
 
 	if (map > 1)
@@ -344,7 +344,7 @@
 	unsigned char addr, enable;
 	unsigned int start, stop, card_start;
 	unsigned short word;
-
+printk("yenta_set_mem_map: map %d flags %x speed %d start %08lx stop %08lx card %08x\n", mem->map, mem->flags, mem->speed, mem->sys_start, mem->sys_stop, mem->card_start);
 	map = mem->map;
 	start = mem->sys_start;
 	stop = mem->sys_stop;


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core



More information about the linux-pcmcia mailing list