Skip to contentSkip to conversation

yenta-socket oops with 2.5.73-mm3, 2.5.74, 2.5.74-mm1

DISCUSSION Claus-Justus Heine 1 participant 1 message Jul 6, 2003 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi,

have the same problem, however ...

Quoted 3 lines

void pcmcia_parse_events(struct pcmcia_socket *s, u_int events) {
+ if (unlikely(&s->init_done == 0))

... this cannot work because of the "&". Of course, the _address_ of s->init_done is always non-zero. Also, the problems are related to yenta_socket.c

The interrupt occurs during irq-probing in yenta-socket.c, so the problem should be fixed _inside_ yenta-socket.c and not touch any other part of the pcmcia stuff.

I.e. add that "init_done" flag to "struct yenta_socket"; not to struct socket. It should work then, just trying now ...

Greetings

Claus

P.s.:
I'm not subscribed to linux-kernel, please Cc: to my address. Thanks.

yenta_socket.c renamed from yenta_socket.c.old +11 -3
@@ -426,7 +426,8 @@
 
 	events = yenta_events(socket);
 	if (events) {
-		pcmcia_parse_events(&socket->socket, events);
+		if (likely(socket->init_done))
+			pcmcia_parse_events(&socket->socket, events);
 		return IRQ_HANDLED;
 	}
 	return IRQ_NONE;
@@ -501,8 +502,8 @@
 	socket->socket.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD | SS_CAP_CARDBUS;
 	socket->socket.map_size = 0x1000;
 	socket->socket.pci_irq = socket->cb_irq;
-	socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
 	socket->socket.cb_dev = socket->dev;
+	socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
 
 	printk("Yenta IRQ list %04x, PCI irq%d\n", socket->socket.irq_mask, socket->cb_irq);
 }
@@ -821,6 +822,7 @@
 {
 	struct yenta_socket *socket;
 	struct cardbus_override_struct *d;
+	int ret;
 	
 	socket = kmalloc(sizeof(struct yenta_socket), GFP_KERNEL);
 	if (!socket)
@@ -888,12 +890,18 @@
 		add_timer(&socket->poll_timer);
 	}
 
+	socket->init_done = 0; /* should still be 0, paranoya ... */
+
 	/* Figure out what the dang thing can do for the PCMCIA layer... */
 	yenta_get_socket_capabilities(socket, isa_interrupts);
 	printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
 
 	/* Register it with the pcmcia layer.. */
-	return pcmcia_register_socket(&socket->socket);
+	ret = pcmcia_register_socket(&socket->socket);
+	if (ret == 0) {
+		socket->init_done = 1;
+	}
+	return ret;
 }
 
 
yenta_socket.h renamed from yenta_socket.h.old +2 -0
@@ -103,6 +103,8 @@
 
 	struct pcmcia_socket socket;
 
+	unsigned int init_done:1; /* used during initialization */
+
 	/* A few words of private data for special stuff of overrides... */
 	unsigned int private[8];
 };