public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Crash in atmel_cs due to fake device
@ 2004-04-30 18:26 Pavel Roskin
  2004-04-30 21:50 ` Simon Kelley
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2004-04-30 18:26 UTC (permalink / raw)
  To: Simon Kelley, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Crash in atmel_cs due to fake device
  2004-04-30 18:26 [PATCH] Crash in atmel_cs due to fake device Pavel Roskin
@ 2004-04-30 21:50 ` Simon Kelley
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Kelley @ 2004-04-30 21:50 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-kernel

Pavel Roskin wrote:
> 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.
> 

Thanks for that: I've followed the conversation about this and is seems 
that a patch like this is the best short-term fix. I'm happy to do this 
and leave the device people to progress their final vision on their own 
time. I'll check that the patch fixes things tomorrow sometime and give 
a final  OK then.

Cheers,

Simon.


C

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-30 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-30 18:26 [PATCH] Crash in atmel_cs due to fake device Pavel Roskin
2004-04-30 21:50 ` Simon Kelley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox