From 15fc1b5c86128f91c8c6699c3b0d9615740b13f1 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 5 Jun 2019 14:44:05 +0200 Subject: Revert "HID: Increase maximum report size allowed by hid_field_extract()" This reverts commit 94a9992f7dbdfb28976b565af220e0c4a117144a. The commit allows for more than 32 bits in hid_field_extract(), but the return value is a 32 bits int. So basically what this commit is doing is just silencing those legitimate errors. Revert to a previous situation in the hope that a proper fix will be impletemented. Fixes: 94a9992f7dbd ("HID: Increase maximum report size allowed by hid_field_extract()") Cc: stable@vger.kernel.org # v5.1 Acked-by: Jiri Kosina Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/hid/hid-core.c') diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 92387fc0bf18..4407cf549908 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1314,10 +1314,10 @@ static u32 __extract(u8 *report, unsigned offset, int n) u32 hid_field_extract(const struct hid_device *hid, u8 *report, unsigned offset, unsigned n) { - if (n > 256) { - hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n", + if (n > 32) { + hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", n, current->comm); - n = 256; + n = 32; } return __extract(report, offset, n); -- cgit v1.2.3-59-g8ed1b From e0b7f9bc0246bc642d1de2ff3ff133730584c956 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 5 Jun 2019 14:44:06 +0200 Subject: Revert "HID: core: Do not call request_module() in async context" This reverts commit 4ceabaf7909d109db6afbffc4ed182741fc32043. This patch and a025a18fe are giving extended timeouts on boot for at least Ubuntu and openSUSE. Revert them until we get a better fix. Acked-by: Jiri Kosina Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/hid/hid-core.c') diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 4407cf549908..aeae545859d4 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -2370,9 +2369,8 @@ int hid_add_device(struct hid_device *hdev) * not first have hid-generic binding only to have it replaced * immediately afterwards with a specialized driver. */ - if (!current_is_async()) - request_module("hid:b%04Xg%04Xv%08Xp%08X", hdev->bus, - hdev->group, hdev->vendor, hdev->product); + request_module("hid:b%04Xg%04Xv%08Xp%08X", + hdev->bus, hdev->group, hdev->vendor, hdev->product); hid_debug_register(hdev, dev_name(&hdev->dev)); ret = device_add(&hdev->dev); -- cgit v1.2.3-59-g8ed1b From f9482dabfd1686987cc6044e06ae0e4c05915518 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 5 Jun 2019 14:44:07 +0200 Subject: Revert "HID: core: Call request_module before doing device_add" This reverts commit a025a18fecd4429f4ca66b1746001263c052ecbb. This patch and 4ceabaf79 are giving extended timeouts on boot for at least Ubuntu and openSUSE. Revert them until we get a better fix. Link: https://bugzilla.kernel.org/show_bug.cgi?id=203741 Acked-by: Jiri Kosina Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'drivers/hid/hid-core.c') diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index aeae545859d4..39eba8106d40 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2364,14 +2364,6 @@ int hid_add_device(struct hid_device *hdev) dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus, hdev->vendor, hdev->product, atomic_inc_return(&id)); - /* - * Try loading the module for the device before the add, so that we do - * not first have hid-generic binding only to have it replaced - * immediately afterwards with a specialized driver. - */ - request_module("hid:b%04Xg%04Xv%08Xp%08X", - hdev->bus, hdev->group, hdev->vendor, hdev->product); - hid_debug_register(hdev, dev_name(&hdev->dev)); ret = device_add(&hdev->dev); if (!ret) -- cgit v1.2.3-59-g8ed1b