Re: 2.6.21-rc4-mm1

From: Andrew Morton
Date: Sat Mar 24 2007 - 01:07:31 EST


On Fri, 23 Mar 2007 11:10:29 +0100 Cornelia Huck <cornelia.huck@xxxxxxxxxx> wrote:

> On Thu, 22 Mar 2007 13:55:51 -0500,
> Larry Finger <larry.finger@xxxxxxxxxxxx> wrote:
>
> > Cornelia Huck wrote:
> > > On Thu, 22 Mar 2007 07:23:06 -0500,
> > >
> > > This would indicate that dev_uevent had been called. But how could
> > > kobject_uevent then return an error without moaning about an uevent()
> > > error code? Maybe the following debug patch could shed some light on
> > > this (all moaning is prefixed with kobject_uevent_env, so it should be
> > > easy to spot)...
> >
> > I applied the debug patch, but I don't see any error codes being returned. This time I also got the
> > General Protection Faults. An excerpt of the log is attached.
>
> Hm, I think I have an idea about what happened.
>
> The firmware class tried to suppress the first KOBJ_ADD uevent by
> returning -ENODEV in firmware_uevent if FW_STATUS_READY was not set.
> This only worked as long as the return code of kobject_uevent was not
> checked in device_add. hack-to-make-wireless-work.patch made that first
> uevent return successfully, but this possible triggered some udev rule
> too early, leading to firmware load failures.
>
> The following (completely untested) patch uses uevent_suppress to stop
> the uevent from being generated during device_add. Does this work for
> you?
>
> ---
> drivers/base/firmware_class.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- linux-2.6.orig/drivers/base/firmware_class.c
> +++ linux-2.6/drivers/base/firmware_class.c
> @@ -333,6 +333,7 @@ static int fw_register_device(struct dev
> f_dev->parent = device;
> f_dev->class = &firmware_class;
> dev_set_drvdata(f_dev, fw_priv);
> + f_dev->uevent_suppress = 1;
> retval = device_register(f_dev);
> if (retval) {
> printk(KERN_ERR "%s: device_register failed\n",
> @@ -385,6 +386,7 @@ static int fw_setup_device(struct firmwa
> set_bit(FW_STATUS_READY, &fw_priv->status);
> else
> set_bit(FW_STATUS_READY_NOHOTPLUG, &fw_priv->status);
> + f_dev->uevent_suppress = 0;
> *dev_p = f_dev;
> goto out;

hm.

Would I be right in guessing that this was all triggered by
uevent-improve-error-checking-and-handling.patch?

If so, do you think I should labour on with
uevent-improve-error-checking-and-handling.patch plus your fix, or should I
drop the lot? (I'm inclined toward the latter, but I'm still not
sure which patch(es) need to be dropped).

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