diff mbox

HID: asus: Stop underlying hardware on remove

Message ID 20170530203946.9346-1-carlo@caione.org (mailing list archive)
State New, archived
Headers show

Commit Message

Carlo Caione May 30, 2017, 8:39 p.m. UTC
From: Carlo Caione <carlo@endlessm.com>

We are missing a call to hid_hw_stop() on the remove hook.
Among other things this is causing an Oops when (re-)starting GNOME /
upowerd / ... after the module has been already rmmod-ed.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
---
 drivers/hid/hid-asus.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Benjamin Tissoires June 2, 2017, 7:31 a.m. UTC | #1
On May 30 2017 or thereabouts, Carlo Caione wrote:
> From: Carlo Caione <carlo@endlessm.com>
> 
> We are missing a call to hid_hw_stop() on the remove hook.
> Among other things this is causing an Oops when (re-)starting GNOME /
> upowerd / ... after the module has been already rmmod-ed.

Good catch:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

> 
> Signed-off-by: Carlo Caione <carlo@endlessm.com>
> ---
>  drivers/hid/hid-asus.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 16df6cc..2e9642d 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -536,6 +536,8 @@ static void asus_remove(struct hid_device *hdev)
>  		drvdata->kbd_backlight->removed = true;
>  		cancel_work_sync(&drvdata->kbd_backlight->work);
>  	}
> +
> +	hid_hw_stop(hdev);
>  }
>  
>  static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> -- 
> 2.9.3
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Kosina June 2, 2017, 12:14 p.m. UTC | #2
On Tue, 30 May 2017, Carlo Caione wrote:

> From: Carlo Caione <carlo@endlessm.com>
> 
> We are missing a call to hid_hw_stop() on the remove hook.
> Among other things this is causing an Oops when (re-)starting GNOME /
> upowerd / ... after the module has been already rmmod-ed.
> 
> Signed-off-by: Carlo Caione <carlo@endlessm.com>

Applied to for-4.12/upstream-fixes, thanks.
diff mbox

Patch

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 16df6cc..2e9642d 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -536,6 +536,8 @@  static void asus_remove(struct hid_device *hdev)
 		drvdata->kbd_backlight->removed = true;
 		cancel_work_sync(&drvdata->kbd_backlight->work);
 	}
+
+	hid_hw_stop(hdev);
 }
 
 static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,