Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751621AbdITBpt (ORCPT ); Tue, 19 Sep 2017 21:45:49 -0400 Received: from mail-yw0-f182.google.com ([209.85.161.182]:44423 "EHLO mail-yw0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbdITBpr (ORCPT ); Tue, 19 Sep 2017 21:45:47 -0400 X-Google-Smtp-Source: AOwi7QDC/YFiBokW/vIEeI7NmsZ+3toAEHqq8CZb5ybehielM7Gc2oGv/EaDPJsaJh1pPjIMNYKSfKdNfVUtOT4AhdU= MIME-Version: 1.0 In-Reply-To: <20170920013746.GA33367@dtor-ws> References: <20170920013746.GA33367@dtor-ws> From: Guenter Roeck Date: Tue, 19 Sep 2017 18:45:46 -0700 Message-ID: Subject: Re: [PATCH] HID: hidraw: fix power sequence when closing device To: Dmitry Torokhov Cc: Jiri Kosina , Benjamin Tissoires , Benson Leung , Oliver Neukum , Guenter Roeck , linux-input@vger.kernel.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 34 On Tue, Sep 19, 2017 at 6:37 PM, Dmitry Torokhov wrote: > We should not try to bring HID device out of full power state before > calling hid_hw_close(), so that transport driver operates on powered up > device (making this inverse of the opening sequence). > > Signed-off-by: Dmitry Torokhov Reviewed-by: Guenter Roeck > --- > drivers/hid/hidraw.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c > index ec530454e6f6..5fbe0f81ab2e 100644 > --- a/drivers/hid/hidraw.c > +++ b/drivers/hid/hidraw.c > @@ -337,8 +337,8 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit) > kfree(hidraw); > } else { > /* close device for last reader */ > - hid_hw_power(hidraw->hid, PM_HINT_NORMAL); > hid_hw_close(hidraw->hid); > + hid_hw_power(hidraw->hid, PM_HINT_NORMAL); > } > } > } > -- > 2.14.1.821.g8fa685d3b7-goog > > > -- > Dmitry