From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jiri Kosina <jkosina@suse.cz>, Oliver Neukum <oneukum@suse.de>,
<linux-pm@lists.linux-foundation.org>,
list <linux-usb@vger.kernel.org>,
Kernel development list <linux-kernel@vger.kernel.org>,
<jslaby@suse.cz>
Subject: Re: [linux-pm] s2ram slow (radeon) / failing (usb)
Date: Thu, 6 May 2010 22:59:24 +0200 [thread overview]
Message-ID: <20100506225924.3131a5ea@neptune.home> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1005061426160.1708-100000@iolanthe.rowland.org>
On Thu, 06 May 2010 Alan Stern <stern@rowland.harvard.edu> wrote:
> On Thu, 6 May 2010, Bruno [UTF-8] Prémont wrote:
>
> > > Bruno, can you confirm that the hang occurs during one of those
> > > cancel_work_sync() calls?
> >
> > No, it's not one of the cancel_work_sync() that hangs but it's the
> > del_timer_sync() right before them that hangs!
> > (del_timer_sync() also hangs if I put it last, so the cancel_work_sync()
> > don't hang anything)
> >
> > static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
> > {
> > del_timer_sync(&usbhid->io_retry); /* this one never returns */
> > cancel_work_sync(&usbhid->restart_work);
> > cancel_work_sync(&usbhid->reset_work);
> > }
>
> Okay, I see what the problem is. In usbhid_start() there's a bunch of
> statements initializing parts of the usbhid structure. When probing
> fails those statements don't get executed, so the timer and workqueue
> things aren't set up properly.
>
> This patch should fix it.
This very much reminds me the resume issue with the same keyboard on a
!CONFIG_SMP system back in February when the fix was to copy/move
usbhid->intf = intf; from usbhid_start() to usbhid_probe()!
Hopefully these are all those initializations that need to be taken
care of...
With this patch system now it passes "devices" level pm_test as well as
full suspend process, even multiple times in a row (though it's still
damn slow to resume IF no_console_suspend is passed to kernel - radeon
KMS?, but that's a new branch from start of this thread)
Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Tested-By: Bruno Prémont <bonbons@linux-vserver.org>
Now it can continue hunting the next issues preventing smooth S3
experience...
Thanks,
Bruno
> Index: usb-2.6/drivers/hid/usbhid/hid-core.c
> ===================================================================
> --- usb-2.6.orig/drivers/hid/usbhid/hid-core.c
> +++ usb-2.6/drivers/hid/usbhid/hid-core.c
> @@ -998,13 +998,6 @@ static int usbhid_start(struct hid_devic
> }
> }
>
> - init_waitqueue_head(&usbhid->wait);
> - INIT_WORK(&usbhid->reset_work, hid_reset);
> - INIT_WORK(&usbhid->restart_work, __usbhid_restart_queues);
> - setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
> -
> - spin_lock_init(&usbhid->lock);
> -
> usbhid->urbctrl = usb_alloc_urb(0, GFP_KERNEL);
> if (!usbhid->urbctrl) {
> ret = -ENOMEM;
> @@ -1180,6 +1173,12 @@ static int usbhid_probe(struct usb_inter
> usbhid->intf = intf;
> usbhid->ifnum = interface->desc.bInterfaceNumber;
>
> + init_waitqueue_head(&usbhid->wait);
> + INIT_WORK(&usbhid->reset_work, hid_reset);
> + INIT_WORK(&usbhid->restart_work, __usbhid_restart_queues);
> + setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
> + spin_lock_init(&usbhid->lock);
> +
> ret = hid_add_device(hid);
> if (ret) {
> if (ret != -ENODEV)
>
next prev parent reply other threads:[~2010-05-06 20:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-02 13:56 s2ram slow (radeon) / failing (usb) Bruno Prémont
2010-05-02 15:07 ` Alan Stern
2010-05-02 20:06 ` Bruno Prémont
2010-05-02 20:16 ` Rafael J. Wysocki
2010-05-02 20:56 ` Bruno Prémont
2010-05-02 22:04 ` Alan Stern
2010-05-02 21:59 ` Alan Stern
2010-05-03 6:34 ` Bruno Prémont
2010-05-03 13:57 ` Alan Stern
2010-05-03 14:48 ` Bruno Prémont
2010-05-03 15:04 ` Alan Stern
2010-05-03 19:23 ` Bruno Prémont
2010-05-03 19:39 ` Alan Stern
2010-05-03 19:46 ` Bruno Prémont
2010-05-03 20:11 ` Alan Stern
2010-05-03 20:57 ` Bruno Prémont
2010-05-03 21:11 ` Bruno Prémont
2010-05-04 6:42 ` [linux-pm] " Oliver Neukum
2010-05-04 8:37 ` Jiri Kosina
2010-05-04 21:04 ` Bruno Prémont
2010-05-05 12:58 ` Jiri Kosina
2010-05-05 19:17 ` Bruno Prémont
2010-05-05 20:30 ` Bruno Prémont
2010-05-05 20:53 ` Bruno Prémont
2010-05-05 20:55 ` Jiri Kosina
2010-05-05 21:35 ` Alan Stern
2010-05-06 17:47 ` Bruno Prémont
2010-05-06 18:40 ` Alan Stern
2010-05-06 20:59 ` Bruno Prémont [this message]
2010-05-07 8:29 ` Jiri Kosina
2010-05-07 21:18 ` s2ram slow resume - radeon versus no_console_suspend? Bruno Prémont
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100506225924.3131a5ea@neptune.home \
--to=bonbons@linux-vserver.org \
--cc=jkosina@suse.cz \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).