lkml.org 
[lkml]   [2003]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: PCI driver module unload race?
Date

> diff -Nru a/drivers/base/bus.c b/drivers/base/bus.c
> --- a/drivers/base/bus.c Mon Mar 10 13:52:15 2003
> +++ b/drivers/base/bus.c Mon Mar 10 13:52:15 2003
> @@ -263,14 +263,25 @@
> if (dev->bus->match(dev,drv)) {
> dev->driver = drv;
> if (drv->probe) {
> - if ((error = drv->probe(dev))) {

It seems that the semaphore in bus_add_device() makes this unnecessary.

[..]
> diff -Nru a/drivers/base/power.c b/drivers/base/power.c
> --- a/drivers/base/power.c Mon Mar 10 13:52:15 2003
> +++ b/drivers/base/power.c Mon Mar 10 13:52:15 2003
> @@ -41,10 +41,17 @@
> list_for_each(node,&devices_subsys.kset.list) {
> struct device * dev = to_dev(node);
> if (dev->driver && dev->driver->suspend) {
> - pr_debug("suspending device %s\n",dev->name);
> - error = dev->driver->suspend(dev,state,level);

This change is no good.
Either the semaphore protects you or it doesn't. If it doesn't you can't
even trust the dev pointer, because suspend() can sleep.

Regards
Oliver

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.073 / U:0.304 seconds]
©2003-2014 Jasper Spaans. Advertise on this site