[PATCH] Implement retry on linux sysfs pnp id file.
Kay Sievers
kay.sievers at vrfy.org
Mon Sep 22 20:55:02 PDT 2008
On Tue, 2008-09-23 at 00:51 -0700, Danny Kukawka wrote:
> On Montag, 22. September 2008, Drew Moseley wrote:
> > > Can you send the patch with diff -Nur or plain git diff?
> >
> > Updated patch below.
> >
> > > I'm currently not sure if we should do this. IMO the kernel should get
> > > fixed instead to provide the sysfs file only if the content/information
> > > is really available. Did you report the problem to the kernel guys?
> >
> > I've spoken w/ some kernel guys locally and they are of the opinion that
> > with sysfs, unfortunately, that's the way it has to be. There is
> > precedence for this kind of sleep already in hald/linux/blockdev.c which
> > is what I modelled this patch after.
>
> This is a really dirty hack.
>
> @Kay: Is this behavior normal? Is there a way to fix sysfs instead of sending
> HAL into a loop?
Yep, "fix the kernel" is usually the right answer. There is almost
never a valid "the way it has to be" in sysfs. We fixed almost all know
issues so far, so this should be fixed too.
In:
drivers/pnp/core.c
we have:
ret = device_register(&dev->dev);
if (ret)
return ret;
pnp_interface_attach_device(dev);
Which is broken, the attributes must not be created after the device
registration, they should be converted to "default bus attributes" and
all will work fine.
Kay
More information about the hal
mailing list