[PATCH] Crash in atmel_cs due to fake device

From: Pavel Roskin (proski_at_gnu.org)
Date: 04/30/04

  • Next message: Jonathan Corbet: "Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP"
    Date:	Fri, 30 Apr 2004 14:26:41 -0400 (EDT)
    To: Simon Kelley <simon@thekelleys.org.uk>, linux-kernel@vger.kernel.org
    
    

    Hi, Simon and everybody!

    Since PCMCIA devices are not devices for the kernel, atmel_cs uses a fake
    device for calling request_firmware(). The fake device has .bus_id
    initialized, but it's not enough for Linux 2.6.6-rc3. The kernel would
    oops while trying to create a link from /sys/class/firmware/pcmcia/device
    to the location of the device in sysfs.

    To work around this problem, .kobj.k_name should be defined in the fake
    device. I know, it's ugly as hell, but I don't see a better solution
    until PCMCIA device drivers are converted to the device model.

    The patch has been compile tested only, but I have tested a similar patch
    with another driver, which is not in the kernel yet (spectrum_cs). I'm
    quite sure that atmel_cs is affected by this problem.

    =============================
    --- linux.orig/drivers/net/wireless/atmel_cs.c
    +++ linux/drivers/net/wireless/atmel_cs.c
    @@ -350,6 +350,9 @@ static struct {
     /* This is strictly temporary, until PCMCIA devices get integrated into the device model. */
     static struct device atmel_device = {
             .bus_id = "pcmcia",
    + .kobj = {
    + .k_name = "atmel_cs"
    + }
     };

     static void atmel_config(dev_link_t *link)
    =============================

    -- 
    Regards,
    Pavel Roskin
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Jonathan Corbet: "Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP"

    Relevant Pages

    • Re: [PATCH] Crash in atmel_cs due to fake device
      ... > Since PCMCIA devices are not devices for the kernel, atmel_cs uses a fake ... > The patch has been compile tested only, but I have tested a similar patch ...
      (Linux-Kernel)
    • Re: Trying to install yoper
      ... It makes it till it gets to a line that gives me a kernel ... You might want to post this query to the Yoper forums at www.yoper.com ... Larry Gagnon ... to reply via email remove "fake" ...
      (comp.os.linux.misc)
    • Re: I need to make a system() call from the kernel
      ... > to make a systemcall from an event that happens in the kernel. ... Thomas D. Shepard ... (Email address is fake.) ...
      (comp.os.linux)