Re: [PATCH] input: Fix USB autosuspend on bcm5974

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

 



Hi Matthew,

On Thu, Oct 06, 2011 at 05:36:37PM -0400, Matthew Garrett wrote:
> The bcm5974 code takes a USB autosuspend reference on device open but
> only releases it if there's an error. Repeated opens will bump the count,

No, there won't be repeated opens as input core will not issue another
open unless everyone closes the device first (and then bcm5974_close
will drop the reference that is being held).

> which is clearly wrong. It's also unnecessary - the only part of the
> driver operation that is incompatible with autosuspend is the initial
> setup, and after that the device generates appropriate remote wakeups.
> Making the unreference unconditional fixes this.

... and makes counter unbalanced on close. If we change bcm5974_open()
as you are suggesting we need to adjust bcm5974_close() accordingly.

> 
> Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx>
> ---
>  drivers/input/mouse/bcm5974.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
> index 5ec617e..38d0286 100644
> --- a/drivers/input/mouse/bcm5974.c
> +++ b/drivers/input/mouse/bcm5974.c
> @@ -764,8 +764,7 @@ static int bcm5974_open(struct input_dev *input)
>  
>  	mutex_unlock(&dev->pm_mutex);
>  
> -	if (error)
> -		usb_autopm_put_interface(dev->intf);
> +	usb_autopm_put_interface(dev->intf);
>  
>  	return error;
>  }

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux