Re: [PATCH] driver model/scsi: synchronize pm calls with probe/remove

From: Dmitry Torokhov
Date: Mon Mar 21 2005 - 09:42:01 EST


On Mon, 21 Mar 2005 18:18:46 +0900, Tejun Heo <htejun@xxxxxxxxx> wrote:
> Hello, Dmitry, Mochel and James.
>
> I've been looking at sd code and found seemingly bogus 'if (!sdkp)'
> tests with /* this can happen */ comment. I've digged changelog and
> found out that this was to prevent oops which occurs if some driver
> gets stuck inside ->probe and the machine goes down and calls back
> ->remove. IMHO, we should avoid this problem by fixing driver ->probe
> or ->remove callbacks instead of detecting and bypassing
> half-initialized/destroyed devices in pm callbacks.
>
> This patch read-locks a device's bus using device_pm_down_read_bus()
> before invoking any pm callback.

Hi Tejun,

There are talks about getting rid of bus's rwsem and replacing it with
a per-device semaphore to serialize probe, remove, suspend and resume.
This should resolve entire host of problems including this one, if I
unrerstand it correctly.

Please take a look here:
http://seclists.org/lists/linux-kernel/2005/Mar/5847.html

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