From 0f3edb4c7b851a3e2893e64bb695b84b98e0a416 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 29 Dec 2003 05:43:54 -0800 Subject: [PATCH] [PATCH] Fix init_i82365 sysfs ordering oops From: Russell King This oops has been caused by the need to register the class before registering any objects against it. Unfortunately, the class needs to be registered asynchronously in a separate thread to avoid driver model deadlock with yenta with cardbus cards inserted or standard PCMCIA cards not being detected correctly due to a race. I think the only real solution is to remove the class_device_create_file calls from all socket drivers. This is just a simple commenting out of the calls, and should be suitable for the remainder of the -test kernels. Due to the number of cases that we're encountering with PCMCIA, I'm beginning to wonder if the driver model could be fixed to be more kind to PCMCIA by avoiding some of these ordering dependencies. None of this would be a problem if the driver model would allow PCI device drivers to register PCI devices while their probe or remove functions were executing. --- drivers/pcmcia/i82365.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 40881f3e7d24b..08cb40f8f2e1c 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -1211,6 +1211,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) return 0; } /* i365_set_mem_map */ +#if 0 /* driver model ordering issue */ /*====================================================================== Routines for accessing socket information and register dumps via @@ -1250,6 +1251,7 @@ static ssize_t show_exca(struct class_device *class_dev, char *buf) static CLASS_DEVICE_ATTR(exca, S_IRUGO, show_exca, NULL); static CLASS_DEVICE_ATTR(info, S_IRUGO, show_info, NULL); +#endif /*====================================================================*/ @@ -1414,10 +1416,12 @@ static int __init init_i82365(void) pcmcia_unregister_socket(&socket[i].socket); break; } +#if 0 /* driver model ordering issue */ class_device_create_file(&socket[i].socket.dev, &class_device_attr_info); class_device_create_file(&socket[i].socket.dev, &class_device_attr_exca); +#endif } /* Finally, schedule a polling interrupt */ -- 2.53.0