Re: Oops calling sysfs_create_link() from pci_probe()

From: Greg KH
Date: Fri Jun 17 2005 - 00:57:59 EST

On Thu, Jun 16, 2005 at 03:57:34PM -0400, Luben Tuikov wrote:
> Hi,
> I'm calling
> sysfs_create_link(&class->kobj,
> &pcidev->driver->driver.kobj, "driver");
> To create a link from a syfs directory of an object which I've
> created with class_device_regsiter(), to point to the
> driver directory of the pci driver.

Ick, why? Shouldn't something like this be done in the driver core, and
not in the individual drivers?

> This is effectively called at the bottom of the pci_driver->probe
> function.
> But I get this oops:
> printing eip:
> c0229e7b
> *pde = 00000000
> Oops: 0000 [#1]
> Modules linked in: aic94xx sas_class
> CPU: 0
> EIP: 0060:[<c0229e7b>] Not tainted VLI
> EFLAGS: 00010296 (2.6.12-rc6)
> EIP is at kref_get+0xb/0x50

Looks like one of the kobjects that you are wanting to link is not fully
initialized and registered with sysfs. Where are you getting that
"&class->kobj" from?

Have a pointer to your patch anywhere?

Also, try turning on kobject and driver core debugging, you should get a
lot of helpful information in your syslog right before this oops.


greg k-h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at