public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Arnaldo Carvalho de Melo <acme@conectiva.com.br>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Patrick Mochel <mochel@osdl.org>
Subject: Re: bug in init_i82365 wrt sysfs
Date: Fri, 10 Oct 2003 09:01:04 +0100	[thread overview]
Message-ID: <20031010090104.A23806@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20031010035940.GA9668@conectiva.com.br>; from acme@conectiva.com.br on Fri, Oct 10, 2003 at 12:59:40AM -0300

On Fri, Oct 10, 2003 at 12:59:40AM -0300, Arnaldo Carvalho de Melo wrote:
> Call Trace:
>  [<c01dbf4c>] class_device_create_file+0x1c/0x30
>  [<c2805188>] init_i82365+0xe8/0x1e8 [i82365]
>  [<c0139cff>] sys_init_module+0x15f/0x2f0
>  [<c0109897>] syscall_call+0x7/0xb

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.

Below is a completely untested patch.  Arnaldo - please test whether this
fixes your problem.

===== drivers/pcmcia/i82365.c 1.46 vs edited =====
--- 1.46/drivers/pcmcia/i82365.c	Sun Sep 28 00:04:09 2003
+++ edited/drivers/pcmcia/i82365.c	Fri Oct 10 08:59:26 2003
@@ -1211,6 +1211,7 @@
     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 CLASS_DEVICE_ATTR(exca, S_IRUGO, show_exca, NULL);
 static CLASS_DEVICE_ATTR(info, S_IRUGO, show_info, NULL);
+#endif
 
 /*====================================================================*/
 
@@ -1414,10 +1416,12 @@
 			    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 */


-- 
Russell King (rmk@arm.linux.org.uk)	http://www.arm.linux.org.uk/personal/
      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

  parent reply	other threads:[~2003-10-10  8:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10  3:59 bug in init_i82365 wrt sysfs Arnaldo Carvalho de Melo
2003-10-10  4:03 ` Arnaldo Carvalho de Melo
2003-10-10  8:01 ` Russell King [this message]
2003-10-11  1:07   ` Arnaldo Carvalho de Melo
2003-10-14 23:13   ` Patrick Mochel
2003-10-15  7:54     ` Russell King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031010090104.A23806@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=acme@conectiva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox