[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Random hang when waking from sleep on ibook G4 + 2.6.14.3 kernel



Le lundi 06 février 2006 à 14:52 +0000, Joerg Sommer a écrit :
> Benjamin Cama <benoar@free.fr> wrote:
> > - Did the 2.6.13.1 solve the oops problem when an USB peripheral was
> > plugged when sleeping ? (compared to my 2.6.12)
> 
> Yes. This was the reason I switched to the 2.6.13.1.

Ok. As this seems to be a strange problem, i'll try to explain what i
found when investigating the 2.6.12 oops (not the problem i experienced
with 2.6.14.3): this may have already been seen here on the list, but
i'd like to know what exactly caused this oops, and if its fix in
2.6.13.1 was "intentional" or not. Please correct me if you think i made
a mistake in my debugging process, as i'm new to kernel debugging...
The 2.6.12 kernel oopsed in the hid_resume() function in
drivers/usb/input/hid-core.c. I disassembled it with objdump and tried
to follow what happened; but i'm not very good at ppc assembly. What i
found is that the pointer returned by usb_get_intfdata(intf) was NULL,
and that it caused the oops when it was dereferenced in the if
statement. As a reminder, here is this function (hint: the intf
parameter was not null, according to the kernel registers dump):

static int hid_resume(struct usb_interface *intf)
{
        struct hid_device *hid = usb_get_intfdata (intf);
        int status;

        intf->dev.power.power_state = PMSG_ON;
        if (hid->open)  // OOPS HERE
                status = usb_submit_urb(hid->urbin, GFP_NOIO);
        else
                status = 0;
        dev_dbg(&intf->dev, "resume status %d\n", status);
        return status;
}

A naive answer would be to test if hid is null before dereferencing, but
naturally the problem lied elsewhere, as this piece of code seems to
work for 2.6.13.1, like Joerg said (the code is still the same for 14.3.
In fact this extract _is_ from 14.3 but i'm pretty sure it was the same
in 2.6.12).
So i'd like to know : did someone correct this very problem ? Or was it
fixed by some other change that wasn't aimed particulary at this bug ?
Or should i rather ask this to the usb mailing list ?

I don't know if this bug is related to my 2.6.14.3 (and later, according
to Joerg) problem, but as i don't know how to solve it, i try to do my
best to find anything that could help.

And as a side note, i recently got another oops when plugging my mouse
just after waking my ibook, but before the usb subsystem was initialised
(yes, i'm still unplugging my mouse on every sleep, because i don't want
to guess if my kernel will hang or not on the next wake). I'll try to
find more details on this later.

And thanks to Joerg for your answers.

Benjamin Cama



Reply to: