Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2834138imm; Mon, 13 Aug 2018 00:59:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzh2O9XcmQN8lcigiM/Zg6L+bzchIHO1FOkh3FuKmDweJ6R0BDVzKZcf0hg+34FeXU6SHVe X-Received: by 2002:a62:b0c:: with SMTP id t12-v6mr17953704pfi.36.1534147182706; Mon, 13 Aug 2018 00:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534147182; cv=none; d=google.com; s=arc-20160816; b=HXioD9dJlWEwGWFz+0DZoC+FTyQeko3i8ymDpGnBIKzgkEKxP8mih6TzClraTLrA1K /qrknTuThAOhEfWvoZWE0kOp9rs0vbZ0DQKdHDLjRbefxeACTbDyAT+RdPx/Ajss174h VsXBNAgFzf8TNGxLiUo4BVdjpRPX4j78MQ4JDgVAR5KGk3x4VdYouVClOieBUtWm9KwZ QrMeHZxFVrtvgCPm05lyhFROYNLSyqkp4WMmt40vwLpySjp5rF269OyeEi4VQ7zCBkx7 zuWyCFK1GTjdYfqs8VxaoI60CHSdKinc12yHc6QZlbc2xNKPHsRVJFy/X2y2JNSj0FMm VIhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=40yd5JgfkZiTVkqvUsUJb3AId7EACjLOfDUisl4ZleM=; b=UkV+w8DNWcVfU+dhQavHslVpEVAXOAuxWipTcGKHwP5WwubIJF2v45/WHuY6tc88Bv CNUvEBt6zb9cEan4Hst1t2kiDq5z8E/3v5SaX+hxUWEqHCTYO+UJFNOcM5dVSu0XphCt Z8Hq+opa2/jdYtELXWP1xN5sOjbAalUuqEi34XMyNK8Cuhe+4iBObLCl8hqt1erBKbkF yh3yoPpPgks/H7Mn67/VlHI7Up1PTBP2o5/FYTaMZspcRjhpMrMk0/rkPGlmrYgaU/n3 obER1kRJSFdPKmqTii+J3sqdCF2mty5ogU5xNmdhVHUnxxE4GmlI3EplmUfO7ehpnh0F pz/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si13707017pld.256.2018.08.13.00.59.26; Mon, 13 Aug 2018 00:59:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728603AbeHMKib (ORCPT + 99 others); Mon, 13 Aug 2018 06:38:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:45432 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726704AbeHMKib (ORCPT ); Mon, 13 Aug 2018 06:38:31 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8DBE8ACEF; Mon, 13 Aug 2018 07:57:23 +0000 (UTC) Message-ID: <1534146566.10070.5.camel@suse.com> Subject: Re: [Query] USB device autosuspend and its runtime usage count. From: Oliver Neukum To: Anshuman Gupta , linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Date: Mon, 13 Aug 2018 09:49:26 +0200 In-Reply-To: <1534142758-387-1-git-send-email-anshuman.gupta@intel.com> References: <1534142758-387-1-git-send-email-anshuman.gupta@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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