From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benson Leung Subject: Re: [PATCH] HID: usbhid: get/put around clearing needs_remote_wakeup Date: Tue, 25 Nov 2014 07:29:16 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-ob0-f178.google.com ([209.85.214.178]:62267 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbaKYP3R (ORCPT ); Tue, 25 Nov 2014 10:29:17 -0500 Received: by mail-ob0-f178.google.com with SMTP id gq1so606644obb.9 for ; Tue, 25 Nov 2014 07:29:16 -0800 (PST) In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Alan Stern Cc: johan@kernel.org, Jiri Kosina , linux-usb@vger.kernel.org, "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sameer Nanda On Tue, Nov 25, 2014 at 7:24 AM, Alan Stern wrote: > On Mon, 24 Nov 2014, Benson Leung wrote: > >> Hi Alan, >> >> >> On Sat, Nov 22, 2014 at 7:55 AM, Alan Stern wrote: >> > There is no USB wrapper for pm_runtime_idle calls, but one could be >> > added. Still, in the meantime can you check to see what happens if you >> > add >> > >> > pm_runtime_idle(&usbhid->intf->dev); >> > >> > in usbhid_close() just after needs_remote_wakeup is set to 0? You can >> > do the same thing in usbhid_stop() if you want. >> >> I tried using this in lieu of usb_autopm_get/put_interface: >> >> usbhid->intf->needs_remote_wakeup = 0; >> pm_runtime_idle(&usbhid->intf->dev); >> pm_runtime_idle(usbhid->intf->dev.parent); >> >> It did not work. I see the autosuspend_check() that was kicked off as >> a result of hid_hw_power, which falls into the "remote wakeup needed >> for autosuspend" branch, but I don't see another autosuspend_check() >> that picks up the updated value of needs_remote_wakeup. > > Well, why not? > > In order to work on the kernel effectively, you need the right > mind-set. Don't just tell people when something goes wrong -- figure > out why the problem occurred and propose a way to fix it. Sure. I'll dig into this deeper today. I got to this late yesterday and I ran out of time before I could find out what was not behaving correctly. > > Alan Stern > -- Benson Leung Software Engineer, Chrom* OS bleung@chromium.org