Skip to contentSkip to conversation

pcmcia no worky in 2.5.6[32]

PATCH New Dominik Brodowski 2 participants 5 messages Mar 3, 2003 – Mar 6, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 6 lines

Hey,

since 2.5.62, I've not been able to get pcmcia working.

Hardware: toshiba 100CS

Quoted 8 lines

I've attached my .config for 2.5.63,
and a dmesg directly after boot for 2.5.61 and 2.5.63

any other details needed, please let me know

thanks,

/ Brett

Could you please try this patch? It *should* fix this problem:

drivers/pcmcia/i82365.c renamed from drivers/pcmcia/i82365.c.original +3 -3
@@ -1628,11 +1628,11 @@
 	request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
 #endif
     
-    platform_device_register(&i82365_device);
-
     i82365_data.nsock = sockets;
     i82365_device.dev.class_data = &i82365_data;
-    
+
+    platform_device_register(&i82365_device);
+
     /* Finally, schedule a polling interrupt */
     if (poll_interval != 0) {
 	poll_timer.function = pcic_interrupt_wrapper;
#1 lore raw
Quoted 9 lines · Dominik Brodowski
Quoted 9 lines

Hey,

since 2.5.62, I've not been able to get pcmcia working.

Hardware: toshiba 100CS

I've attached my .config for 2.5.63,
and a dmesg directly after boot for 2.5.61 and 2.5.63

Quoted 8 lines
Quoted 5 lines

any other details needed, please let me know

thanks,

/ Brett

Could you please try this patch? It *should* fix this problem:

Sadly, it didn't do a thing
same dmesg/no pcmcia as vanilla 2.5.63

any other ideas ??

thanks,

/ Brett

Quoted 24 lines
drivers/pcmcia/i82365.c renamed from drivers/pcmcia/i82365.c.original +3 -4
@@ -1628,11 +1628,11 @@
 	request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
 #endif
 
-    platform_device_register(&i82365_device);
-
     i82365_data.nsock = sockets;
     i82365_device.dev.class_data = &i82365_data;
-    
+
+    platform_device_register(&i82365_device);
+
     /* Finally, schedule a polling interrupt */
     if (poll_interval != 0) {
 	poll_timer.function = pcic_interrupt_wrapper;
 
-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw

Hi,

Quoted 17 lines · Brett
Quoted 15 lines · Dominik Brodowski
Quoted 14 lines

Hey,

since 2.5.62, I've not been able to get pcmcia working.

Hardware: toshiba 100CS

I've attached my .config for 2.5.63,
and a dmesg directly after boot for 2.5.61 and 2.5.63

any other details needed, please let me know

thanks,

/ Brett

Quoted 7 lines
Quoted 2 lines

Could you please try this patch? It *should* fix this problem:

Sadly, it didn't do a thing
same dmesg/no pcmcia as vanilla 2.5.63

any other ideas ??

Yes: platform_match within the pcmcia core wasn't doing was it was supposed to do... and it still doesn't work in 2.5.64. So could you please try if it works with this patch against 2.5.64?

Many thanks,
Dominik

drivers/base/platform.c +2 -5
diff -ruN linux-original/drivers/base/platform.c linux/drivers/base/platform.c
@@ -59,12 +59,9 @@
 
 static int platform_match(struct device * dev, struct device_driver * drv)
 {
-	char name[BUS_ID_SIZE];
+	struct platform_device *pdev = container_of(dev, struct platform_device, dev);
 
-	if (sscanf(dev->bus_id,"%s",name))
-		return (strcmp(name,drv->name) == 0);
-
-	return 0;
+	return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);
 }
 
 struct bus_type platform_bus_type = {
drivers/pcmcia/hd64465_ss.c +1 -1
diff -ruN linux-original/drivers/pcmcia/hd64465_ss.c linux/drivers/pcmcia/hd64465_ss.c
@@ -1070,8 +1070,8 @@
 	}
 
 /*	hd64465_io_debug = 0; */
-	platform_device_register(&hd64465_device);
 	hd64465_device.dev.class_data = &hd64465_data;
+	platform_device_register(&hd64465_device);
 
 	return 0;
 }
drivers/pcmcia/i82365.c +2 -2
diff -ruN linux-original/drivers/pcmcia/i82365.c linux/drivers/pcmcia/i82365.c
@@ -1628,11 +1628,11 @@
 	request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
 #endif
     
-    platform_device_register(&i82365_device);
-
     i82365_data.nsock = sockets;
     i82365_device.dev.class_data = &i82365_data;
     
+    platform_device_register(&i82365_device);
+
     /* Finally, schedule a polling interrupt */
     if (poll_interval != 0) {
 	poll_timer.function = pcic_interrupt_wrapper;
drivers/pcmcia/tcic.c +2 -2
diff -ruN linux-original/drivers/pcmcia/tcic.c linux/drivers/pcmcia/tcic.c
@@ -452,8 +452,6 @@
 	sockets++;
     }
 
-    platform_device_register(&tcic_device);
-
     switch (socket_table[0].id) {
     case TCIC_ID_DB86082:
 	printk("DB86082"); break;
@@ -527,6 +525,8 @@
     tcic_data.nsock = sockets;
     tcic_device.dev.class_data = &tcic_data;
 
+    platform_device_register(&tcic_device);
+
     return 0;
     
 } /* init_tcic */
#3 lore raw
Quoted 23 lines · Dominik Brodowski

Hi,

Quoted 20 lines · Brett
Quoted 17 lines · Dominik Brodowski
Quoted 6 lines

Hey,

since 2.5.62, I've not been able to get pcmcia working.

Hardware: toshiba 100CS

Quoted 8 lines

I've attached my .config for 2.5.63,
and a dmesg directly after boot for 2.5.61 and 2.5.63

any other details needed, please let me know

thanks,

/ Brett

Could you please try this patch? It *should* fix this problem:

Quoted 9 lines
Quoted 4 lines

Sadly, it didn't do a thing
same dmesg/no pcmcia as vanilla 2.5.63

any other ideas ??

Yes: platform_match within the pcmcia core wasn't doing was it was supposed to do... and it still doesn't work in 2.5.64. So could you please try if it works with this patch against 2.5.64?

Yep, the patch fixed it.
Now happy in 2.5.64 with pcmcia again

many thanks,

/ Brett

Quoted 72 lines

diff -ruN linux-original/drivers/base/platform.c linux/drivers/base/platform.c

drivers/base/platform.c +2 -5
@@ -59,12 +59,9 @@
 
 static int platform_match(struct device * dev, struct device_driver * drv)
 {
-	char name[BUS_ID_SIZE];
+	struct platform_device *pdev = container_of(dev, struct platform_device, dev);
 
-	if (sscanf(dev->bus_id,"%s",name))
-		return (strcmp(name,drv->name) == 0);
-
-	return 0;
+	return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);
 }
 
 struct bus_type platform_bus_type = {

diff -ruN linux-original/drivers/pcmcia/hd64465_ss.c linux/drivers/pcmcia/hd64465_ss.c

drivers/pcmcia/hd64465_ss.c +1 -1
@@ -1070,8 +1070,8 @@
 	}
 
 /*	hd64465_io_debug = 0; */
-	platform_device_register(&hd64465_device);
 	hd64465_device.dev.class_data = &hd64465_data;
+	platform_device_register(&hd64465_device);
 
 	return 0;
 }

diff -ruN linux-original/drivers/pcmcia/i82365.c linux/drivers/pcmcia/i82365.c

drivers/pcmcia/i82365.c +2 -2
@@ -1628,11 +1628,11 @@
 	request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
 #endif
 
-    platform_device_register(&i82365_device);
-
     i82365_data.nsock = sockets;
     i82365_device.dev.class_data = &i82365_data;
 
+    platform_device_register(&i82365_device);
+
     /* Finally, schedule a polling interrupt */
     if (poll_interval != 0) {
 	poll_timer.function = pcic_interrupt_wrapper;

diff -ruN linux-original/drivers/pcmcia/tcic.c linux/drivers/pcmcia/tcic.c

drivers/pcmcia/tcic.c +2 -2
@@ -452,8 +452,6 @@
 	sockets++;
     }
 
-    platform_device_register(&tcic_device);
-
     switch (socket_table[0].id) {
     case TCIC_ID_DB86082:
 	printk("DB86082"); break;
@@ -527,6 +525,8 @@
     tcic_data.nsock = sockets;
     tcic_device.dev.class_data = &tcic_data;
 
+    platform_device_register(&tcic_device);
+
     return 0;
 
 } /* init_tcic */
#4 lore raw

PATCH 1/1 pcmcia: it works again! [Was: Re: [PATCH] Re: pcmcia no worky in 2.5.6[32]]

Hi Linus,

Quoted 10 lines · Brett
Quoted 3 lines

Yes: platform_match within the pcmcia core wasn't doing was it was supposed to do... and it still doesn't work in 2.5.64. So could you please try if it works with this patch against 2.5.64?

Yep, the patch fixed it.
Now happy in 2.5.64 with pcmcia again

many thanks,

/ Brett

please apply this patch:

platform_device_register may only be called after all class-specific device data is initialized, or else the class-type add_device call (which enables the pcmcia sockets) will fail.

 hd64465_ss.c |    2 +-
 i82365.c     |    4 ++--
 tcic.c       |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Dominik

drivers/pcmcia/hd64465_ss.c +1 -1
diff -ruN linux-original/drivers/pcmcia/hd64465_ss.c linux/drivers/pcmcia/hd64465_ss.c
@@ -1070,8 +1070,8 @@
 	}
 
 /*	hd64465_io_debug = 0; */
-	platform_device_register(&hd64465_device);
 	hd64465_device.dev.class_data = &hd64465_data;
+	platform_device_register(&hd64465_device);
 
 	return 0;
 }
drivers/pcmcia/i82365.c +2 -2
diff -ruN linux-original/drivers/pcmcia/i82365.c linux/drivers/pcmcia/i82365.c
@@ -1628,11 +1628,11 @@
 	request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
 #endif
     
-    platform_device_register(&i82365_device);
-
     i82365_data.nsock = sockets;
     i82365_device.dev.class_data = &i82365_data;
     
+    platform_device_register(&i82365_device);
+
     /* Finally, schedule a polling interrupt */
     if (poll_interval != 0) {
 	poll_timer.function = pcic_interrupt_wrapper;
drivers/pcmcia/tcic.c +2 -2
diff -ruN linux-original/drivers/pcmcia/tcic.c linux/drivers/pcmcia/tcic.c
@@ -452,8 +452,6 @@
 	sockets++;
     }
 
-    platform_device_register(&tcic_device);
-
     switch (socket_table[0].id) {
     case TCIC_ID_DB86082:
 	printk("DB86082"); break;
@@ -527,6 +525,8 @@
     tcic_data.nsock = sockets;
     tcic_device.dev.class_data = &tcic_data;
 
+    platform_device_register(&tcic_device);
+
     return 0;
     
 } /* init_tcic */