Re: [PATCH] Driver core: add new device to bus's list before probing

From: Kay Sievers
Date: Thu Jul 30 2009 - 16:57:31 EST


On Thu, Jul 30, 2009 at 15:27, Alan Stern<stern@xxxxxxxxxxxxxxxxxxx> wrote:
> This patch (as1271) affects when new devices get linked into their
> bus's list of devices. ÂCurrently this happens after probing, and it
> doesn't happen at all if probing fails. ÂClearly this is wrong,
> because at that point quite a few symbolic links have already been
> created in sysfs. ÂWe are committed to adding the device, so it should
> be linked into the bus's list regardless.
>
> In addition, this needs to happen before the uevent announcing the new
> device gets issued. ÂOtherwise user programs might try to access the
> device before it has been added to the bus.
>
> To fix both these problems, the patch moves the call to
> klist_add_tail() forward from bus_attach_device() to bus_add_device().
> Since bus_attach_device() now does nothing but probe for drivers, it
> has been renamed to bus_probe_device(). ÂAnd lastly, the kerneldoc is
> updated.

Thanks for doing this that quickly. You are doing a really great job.

> Kay, do you want this merged into 2.6.31 or are you okay with waiting
> for 2.6.32-rc1? ÂIt changes a major core routine. ÂOn the other hand,
> the problem it fixes does affect real users.

I think it should go into -next and we wait a few days. It seems like
the proper fix, but we should make sure, we didn't miss something.

After that, it would be nice if we can get that into 2.6.31, as we
have several problems already, which are likely solved by this.

Thanks,
Kay
--
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/