Re: [linux-pm] s2ram slow (radeon) / failing (usb)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bruno Prémont
Date: Wednesday, May 5, 2010 - 1:53 pm

On Wed, 05 May 2010 Bruno Prémont <bonbons@linux-vserver.org> wrote:


Something like the delow diff causes the HID registration to fail
gracefully and `echo devices > pm_test` suspend attempt to pass.

(note, to be manually applied, is edited copy from console, so does
 not preserve tabs and line numbers may not match due to debug printks
 added all over the place)


I don't know what impact it could have on auto-probing of device
if a specialized HID driver that would fix reports or whatever was
loaded later on when device is already plugged into USB.

Thanks,
Bruno


@@ -1770,11 +1779,13 @@ int hid_add_device(struct hid_device *hdev)
                     hdev->vendor, hdev->product, atomic_inc_return(&id));
 
        ret = device_add(&hdev->dev);
-       if (!ret)
+       if (ret == 0 && !hdev->dev.driver) {
+               device_del(&hdev->dev);
+               ret = -ENODEV;
+       } else {
                hdev->status |= HID_STAT_ADDED;
-
-       hid_debug_register(hdev, dev_name(&hdev->dev));
-
+               hid_debug_register(hdev, dev_name(&hdev->dev));
+       }
        return ret;
 }
 EXPORT_SYMBOL_GPL(hid_add_device);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: s2ram slow (radeon) / failing (usb), Alan Stern, (Mon May 3, 1:11 pm)
Re: s2ram slow (radeon) / failing (usb), Bruno Prémont, (Mon May 3, 2:11 pm)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Oliver Neukum, (Mon May 3, 11:42 pm)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Jiri Kosina, (Tue May 4, 1:37 am)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Bruno Prémont, (Tue May 4, 2:04 pm)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Jiri Kosina, (Wed May 5, 5:58 am)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Bruno Prémont, (Wed May 5, 12:17 pm)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Bruno Prémont, (Wed May 5, 1:30 pm)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Bruno Prémont, (Wed May 5, 1:53 pm)
Re: [linux-pm] s2ram slow (radeon) / failing (usb), Jiri Kosina, (Wed May 5, 1:55 pm)