]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Dec 2021 20:57:35 +0000 (21:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Dec 2021 20:57:35 +0000 (21:57 +0100)
added patches:
hid-add-hid_is_usb-function-to-make-it-simpler-for-usb-detection.patch
hid-add-usb_hid-dependancy-on-some-usb-hid-drivers.patch
hid-add-usb_hid-dependancy-to-hid-chicony.patch
hid-add-usb_hid-dependancy-to-hid-prodikeys.patch
hid-introduce-hid_is_using_ll_driver.patch

queue-4.4/hid-add-hid_is_usb-function-to-make-it-simpler-for-usb-detection.patch [new file with mode: 0644]
queue-4.4/hid-add-usb_hid-dependancy-on-some-usb-hid-drivers.patch [new file with mode: 0644]
queue-4.4/hid-add-usb_hid-dependancy-to-hid-chicony.patch [new file with mode: 0644]
queue-4.4/hid-add-usb_hid-dependancy-to-hid-prodikeys.patch [new file with mode: 0644]
queue-4.4/hid-introduce-hid_is_using_ll_driver.patch [new file with mode: 0644]
queue-4.4/series [new file with mode: 0644]

diff --git a/queue-4.4/hid-add-hid_is_usb-function-to-make-it-simpler-for-usb-detection.patch b/queue-4.4/hid-add-hid_is_usb-function-to-make-it-simpler-for-usb-detection.patch
new file mode 100644 (file)
index 0000000..d50c451
--- /dev/null
@@ -0,0 +1,43 @@
+From f83baa0cb6cfc92ebaf7f9d3a99d7e34f2e77a8a Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed, 1 Dec 2021 19:35:01 +0100
+Subject: HID: add hid_is_usb() function to make it simpler for USB detection
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit f83baa0cb6cfc92ebaf7f9d3a99d7e34f2e77a8a upstream.
+
+A number of HID drivers already call hid_is_using_ll_driver() but only
+for the detection of if this is a USB device or not.  Make this more
+obvious by creating hid_is_usb() and calling the function that way.
+
+Also converts the existing hid_is_using_ll_driver() functions to use the
+new call.
+
+Cc: Jiri Kosina <jikos@kernel.org>
+Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Cc: linux-input@vger.kernel.org
+Cc: stable@vger.kernel.org
+Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Link: https://lore.kernel.org/r/20211201183503.2373082-1-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/hid.h |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/include/linux/hid.h
++++ b/include/linux/hid.h
+@@ -765,6 +765,11 @@ static inline bool hid_is_using_ll_drive
+       return hdev->ll_driver == driver;
+ }
++static inline bool hid_is_usb(struct hid_device *hdev)
++{
++      return hid_is_using_ll_driver(hdev, &usb_hid_driver);
++}
++
+ #define       PM_HINT_FULLON  1<<5
+ #define PM_HINT_NORMAL        1<<1
diff --git a/queue-4.4/hid-add-usb_hid-dependancy-on-some-usb-hid-drivers.patch b/queue-4.4/hid-add-usb_hid-dependancy-on-some-usb-hid-drivers.patch
new file mode 100644 (file)
index 0000000..ac86d07
--- /dev/null
@@ -0,0 +1,54 @@
+From f237d9028f844a86955fc9da59d7ac4a5c55d7d5 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 2 Dec 2021 12:48:19 +0100
+Subject: HID: add USB_HID dependancy on some USB HID drivers
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit f237d9028f844a86955fc9da59d7ac4a5c55d7d5 upstream.
+
+Some HID drivers are only for USB drivers, yet did not depend on
+CONFIG_USB_HID.  This was hidden by the fact that the USB functions were
+stubbed out in the past, but now that drivers are checking for USB
+devices properly, build errors can occur with some random
+configurations.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Link: https://lore.kernel.org/r/20211202114819.2511954-1-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/Kconfig |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/hid/Kconfig
++++ b/drivers/hid/Kconfig
+@@ -173,7 +173,7 @@ config HID_CHICONY
+ config HID_CORSAIR
+       tristate "Corsair devices"
+-      depends on HID && USB && LEDS_CLASS
++      depends on USB_HID && LEDS_CLASS
+       ---help---
+       Support for Corsair devices that are not fully compliant with the
+       HID standard.
+@@ -389,7 +389,7 @@ config HID_LENOVO
+ config HID_LOGITECH
+       tristate "Logitech devices"
+-      depends on HID
++      depends on USB_HID
+       default !EXPERT
+       ---help---
+       Support for Logitech devices that are not fully compliant with HID standard.
+@@ -693,7 +693,7 @@ config HID_SAITEK
+ config HID_SAMSUNG
+       tristate "Samsung InfraRed remote control or keyboards"
+-      depends on HID
++      depends on USB_HID
+       ---help---
+       Support for Samsung InfraRed remote control or keyboards.
diff --git a/queue-4.4/hid-add-usb_hid-dependancy-to-hid-chicony.patch b/queue-4.4/hid-add-usb_hid-dependancy-to-hid-chicony.patch
new file mode 100644 (file)
index 0000000..2968a80
--- /dev/null
@@ -0,0 +1,36 @@
+From d080811f27936f712f619f847389f403ac873b8f Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Fri, 3 Dec 2021 08:59:27 +0100
+Subject: HID: add USB_HID dependancy to hid-chicony
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit d080811f27936f712f619f847389f403ac873b8f upstream.
+
+The chicony HID driver only controls USB devices, yet did not have a
+dependancy on USB_HID.  This causes build errors on some configurations
+like sparc when building due to new changes to the chicony driver.
+
+Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
+Cc: stable@vger.kernel.org
+Cc: Jiri Kosina <jikos@kernel.org>
+Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Link: https://lore.kernel.org/r/20211203075927.2829218-1-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/Kconfig |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hid/Kconfig
++++ b/drivers/hid/Kconfig
+@@ -166,7 +166,7 @@ config HID_CHERRY
+ config HID_CHICONY
+       tristate "Chicony devices"
+-      depends on HID
++      depends on USB_HID
+       default !EXPERT
+       ---help---
+       Support for Chicony Tactical pad and special keys on Chicony keyboards.
diff --git a/queue-4.4/hid-add-usb_hid-dependancy-to-hid-prodikeys.patch b/queue-4.4/hid-add-usb_hid-dependancy-to-hid-prodikeys.patch
new file mode 100644 (file)
index 0000000..d01a1da
--- /dev/null
@@ -0,0 +1,36 @@
+From 30cb3c2ad24b66fb7639a6d1f4390c74d6e68f94 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Fri, 3 Dec 2021 09:12:31 +0100
+Subject: HID: add USB_HID dependancy to hid-prodikeys
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 30cb3c2ad24b66fb7639a6d1f4390c74d6e68f94 upstream.
+
+The prodikeys HID driver only controls USB devices, yet did not have a
+dependancy on USB_HID.  This causes build errors on some configurations
+like nios2 when building due to new changes to the prodikeys driver.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Cc: stable@vger.kernel.org
+Cc: Jiri Kosina <jikos@kernel.org>
+Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Link: https://lore.kernel.org/r/20211203081231.2856936-1-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/Kconfig |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/hid/Kconfig
++++ b/drivers/hid/Kconfig
+@@ -183,7 +183,7 @@ config HID_CORSAIR
+ config HID_PRODIKEYS
+       tristate "Prodikeys PC-MIDI Keyboard support"
+-      depends on HID && SND
++      depends on USB_HID && SND
+       select SND_RAWMIDI
+       ---help---
+       Support for Prodikeys PC-MIDI Keyboard device support.
diff --git a/queue-4.4/hid-introduce-hid_is_using_ll_driver.patch b/queue-4.4/hid-introduce-hid_is_using_ll_driver.patch
new file mode 100644 (file)
index 0000000..50ec0f5
--- /dev/null
@@ -0,0 +1,128 @@
+From fc2237a724a9e448599076d7d23497f51e2f7441 Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <killertofu@gmail.com>
+Date: Mon, 24 Jul 2017 09:46:18 -0700
+Subject: HID: introduce hid_is_using_ll_driver
+
+From: Jason Gerecke <killertofu@gmail.com>
+
+commit fc2237a724a9e448599076d7d23497f51e2f7441 upstream.
+
+Although HID itself is transport-agnostic, occasionally a driver may
+want to interact with the low-level transport that a device is connected
+through. To do this, we need to know what kind of bus is in use. The
+first guess may be to look at the 'bus' field of the 'struct hid_device',
+but this field may be emulated in some cases (e.g. uhid).
+
+More ideally, we can check which ll_driver a device is using. This
+function introduces a 'hid_is_using_ll_driver' function and makes the
+'struct hid_ll_driver' of the four most common transports accessible
+through hid.h.
+
+Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
+Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/i2c-hid/i2c-hid.c |    3 ++-
+ drivers/hid/uhid.c            |    3 ++-
+ drivers/hid/usbhid/hid-core.c |    3 ++-
+ include/linux/hid.h           |   11 +++++++++++
+ net/bluetooth/hidp/core.c     |    3 ++-
+ 5 files changed, 19 insertions(+), 4 deletions(-)
+
+--- a/drivers/hid/i2c-hid/i2c-hid.c
++++ b/drivers/hid/i2c-hid/i2c-hid.c
+@@ -789,7 +789,7 @@ static int i2c_hid_power(struct hid_devi
+       return 0;
+ }
+-static struct hid_ll_driver i2c_hid_ll_driver = {
++struct hid_ll_driver i2c_hid_ll_driver = {
+       .parse = i2c_hid_parse,
+       .start = i2c_hid_start,
+       .stop = i2c_hid_stop,
+@@ -799,6 +799,7 @@ static struct hid_ll_driver i2c_hid_ll_d
+       .output_report = i2c_hid_output_report,
+       .raw_request = i2c_hid_raw_request,
+ };
++EXPORT_SYMBOL_GPL(i2c_hid_ll_driver);
+ static int i2c_hid_init_irq(struct i2c_client *client)
+ {
+--- a/drivers/hid/uhid.c
++++ b/drivers/hid/uhid.c
+@@ -372,7 +372,7 @@ static int uhid_hid_output_report(struct
+       return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT);
+ }
+-static struct hid_ll_driver uhid_hid_driver = {
++struct hid_ll_driver uhid_hid_driver = {
+       .start = uhid_hid_start,
+       .stop = uhid_hid_stop,
+       .open = uhid_hid_open,
+@@ -381,6 +381,7 @@ static struct hid_ll_driver uhid_hid_dri
+       .raw_request = uhid_hid_raw_request,
+       .output_report = uhid_hid_output_report,
+ };
++EXPORT_SYMBOL_GPL(uhid_hid_driver);
+ #ifdef CONFIG_COMPAT
+--- a/drivers/hid/usbhid/hid-core.c
++++ b/drivers/hid/usbhid/hid-core.c
+@@ -1272,7 +1272,7 @@ static int usbhid_idle(struct hid_device
+       return hid_set_idle(dev, ifnum, report, idle);
+ }
+-static struct hid_ll_driver usb_hid_driver = {
++struct hid_ll_driver usb_hid_driver = {
+       .parse = usbhid_parse,
+       .start = usbhid_start,
+       .stop = usbhid_stop,
+@@ -1285,6 +1285,7 @@ static struct hid_ll_driver usb_hid_driv
+       .output_report = usbhid_output_report,
+       .idle = usbhid_idle,
+ };
++EXPORT_SYMBOL_GPL(usb_hid_driver);
+ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id)
+ {
+--- a/include/linux/hid.h
++++ b/include/linux/hid.h
+@@ -754,6 +754,17 @@ struct hid_ll_driver {
+       int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype);
+ };
++extern struct hid_ll_driver i2c_hid_ll_driver;
++extern struct hid_ll_driver hidp_hid_driver;
++extern struct hid_ll_driver uhid_hid_driver;
++extern struct hid_ll_driver usb_hid_driver;
++
++static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
++              struct hid_ll_driver *driver)
++{
++      return hdev->ll_driver == driver;
++}
++
+ #define       PM_HINT_FULLON  1<<5
+ #define PM_HINT_NORMAL        1<<1
+--- a/net/bluetooth/hidp/core.c
++++ b/net/bluetooth/hidp/core.c
+@@ -734,7 +734,7 @@ static void hidp_stop(struct hid_device
+       hid->claimed = 0;
+ }
+-static struct hid_ll_driver hidp_hid_driver = {
++struct hid_ll_driver hidp_hid_driver = {
+       .parse = hidp_parse,
+       .start = hidp_start,
+       .stop = hidp_stop,
+@@ -743,6 +743,7 @@ static struct hid_ll_driver hidp_hid_dri
+       .raw_request = hidp_raw_request,
+       .output_report = hidp_output_report,
+ };
++EXPORT_SYMBOL_GPL(hidp_hid_driver);
+ /* This function sets up the hid device. It does not add it
+    to the HID system. That is done in hidp_add_connection(). */
diff --git a/queue-4.4/series b/queue-4.4/series
new file mode 100644 (file)
index 0000000..8d9c0e5
--- /dev/null
@@ -0,0 +1,5 @@
+hid-introduce-hid_is_using_ll_driver.patch
+hid-add-hid_is_usb-function-to-make-it-simpler-for-usb-detection.patch
+hid-add-usb_hid-dependancy-to-hid-prodikeys.patch
+hid-add-usb_hid-dependancy-to-hid-chicony.patch
+hid-add-usb_hid-dependancy-on-some-usb-hid-drivers.patch