Re: [PATCH] fixed bug in usbsevseg using USB autosuspend incorrectly

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

 



Am Sonntag, 7. März 2010 22:45:42 schrieb Harrison Metzger:
>  /* sysfs_streq can't replace this completely
> @@ -68,12 +69,16 @@ static void update_display_powered(struc
>  {
>         int rc;
>  
> -       if (!mydev->shadow_power && mydev->powered) {
> +       if (mydev->powered && !mydev->has_interface_pm) {
>                 rc = usb_autopm_get_interface(mydev->intf);
>                 if (rc < 0)
>                         return;
> +               mydev->has_interface_pm = 1;
>         }
>  
> +       if (mydev->shadow_power != 1)
> +               return;
> +

This looks wrong, because even if you use autosuspend you
cannot be sure usb_autopm_get_interface() calls resume(),
as for example lsusb can have woken the driver before.

What is the problem in the logic you are seeing?

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux