[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVXFVOiXRiqRsE46_xmOzK_dExNvkBaJVwjiZ9adhwqRRwY+g@mail.gmail.com>
Date: Wed, 25 Jul 2012 20:35:28 +0800
From: Ming Lei <ming.lei@...onical.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Borislav Petkov <borislav.petkov@....com>,
linux-kernel@...r.kernel.org, Matthew Garrett <mjg@...hat.com>,
linux-usb <linux-usb@...r.kernel.org>,
Alan Stern <stern@...land.harvard.edu>,
Oliver Neukum <oneukum@...e.de>
Subject: Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware
CC usb guys and list
On Wed, Jul 25, 2012 at 1:53 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> I really think the isight thing is a totally different thing entirely.
>
> And quite frankly, that's just a BUG in the USB implementation. If the
> USB ID changes, it shouldn't be considered a "resume" thing at all,
> but a probe thing, and that should not be done in early resume - it
> should be done *after* the resume is done.
IMO, usbcore may have found the ID changes during resume(reset_resume),
and make the device disconnect. The disconnect event will be handled
in hubd kthread, which is woken up before usermodehelper_enable()(see
thaw_processes), so request_firmware will return failure during probe()
inside hubd kthread.
The cache firmware patch set may not help the situation, because the
original isight usb device for downloading firmware has been disconnected
before system suspend, so firmware loader can't cache the firmware for
the device.
The below patch should fix the problem above.
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 19db29f..eb8355f 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -185,16 +185,18 @@ void thaw_processes(void)
printk("Restarting tasks ... ");
- thaw_workqueues();
-
read_lock(&tasklist_lock);
do_each_thread(g, p) {
- __thaw_task(p);
+ if (!(p->flags & (PF_KTHREAD | PF_WQ_WORKER)))
+ __thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
usermodehelper_enable();
+ /* let kthread see usermodehelper enabled flag */
+ thaw_kernel_threads();
+
schedule();
printk("done.\n");
}
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists