public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>, linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Query] USB device autosuspend and its runtime usage count.
Date: Mon, 13 Aug 2018 09:49:26 +0200	[thread overview]
Message-ID: <1534146566.10070.5.camel@suse.com> (raw)
In-Reply-To: <1534142758-387-1-git-send-email-anshuman.gupta@intel.com>

On Mo, 2018-08-13 at 12:15 +0530, Anshuman Gupta wrote:
> Hi ,
> I need to test a functionality with USB autosuspend with latest kernel          
> Linux 4.18-rc8. I am trying to autosuspend a USB key board, i enabled       
> its autosuspend by doing echo "auto" to its "control" attributes.
> I am expecting USB keyboard to go to autosuspend after autosuspend_delay_ms.
> But USB key board is not going to autosuspend because its runtime usage
> count is not equal to zero.
> 
> Below are the log snippets:
> 
> root@intel-Kabylake-Client-platform:# cat /sys/bus/usb/devices/1-5/power/runtime_enabled
> enabled
> root@intel-Kabylake-Client-platform:# cat /sys/bus/usb/devices/1-5/power/control
> auto
> root@intel-Kabylake-Client-platform:# cat /sys/bus/usb/devices/1-5/power/autosuspend_delay_ms
> 2000
> root@intel-Kabylake-Client-platform:# cat /sys/bus/usb/devices/1-5/power/runtime_status
> active
> root@intel-Kabylake-Client-platform:# cat /sys/bus/usb/devices/1-5/power/runtime_usage
> 1
> root@intel-Kabylake-Client-platform:# sleep 60; cat /sys/bus/usb/devices/1-5/power/runtime_usage
> 1
> 
> My USB keyboard runtime usage reference count is not decreasing to zero.
> Here am i missing something regarding runtime usage count or is it some issue with
> my kernel or OS?

Very hard to say without further information. Is the HID device the
only interface of the whole device?
Does the device support remote wakeup?
Is an LED on?

Usbhid does support autosuspend, but its criteria must be met.
And all interface drivers must call the device idle.
Or you have discovered a kernel bug.

	Regards
		Oliver


  reply	other threads:[~2018-08-13  7:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13  6:45 [Query] USB device autosuspend and its runtime usage count Anshuman Gupta
2018-08-13  7:49 ` Oliver Neukum [this message]
2018-08-13 10:45   ` Anshuman Gupta
2018-08-13 12:49     ` Oliver Neukum
2018-08-13 14:04     ` Alan Stern

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=1534146566.10070.5.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=anshuman.gupta@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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