From: Greg Kroah-Hartman Date: Mon, 8 Feb 2021 12:48:34 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v4.4.257~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=869a60f1526492bf215145db8de01c7c55af3d4b;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: input-goodix-add-support-for-goodix-gt9286-chip.patch input-ili210x-implement-pressure-reporting-for-ili251x.patch input-xpad-sync-supported-devices-with-fork-on-github.patch md-set-prev_flush_start-and-flush_bio-in-an-atomic-way.patch --- diff --git a/queue-5.10/input-goodix-add-support-for-goodix-gt9286-chip.patch b/queue-5.10/input-goodix-add-support-for-goodix-gt9286-chip.patch new file mode 100644 index 00000000000..432dfad6b09 --- /dev/null +++ b/queue-5.10/input-goodix-add-support-for-goodix-gt9286-chip.patch @@ -0,0 +1,43 @@ +From 2dce6db70c77bbe639f5cd9cc796fb8f2694a7d0 Mon Sep 17 00:00:00 2001 +From: AngeloGioacchino Del Regno +Date: Sat, 9 Jan 2021 22:14:39 -0800 +Subject: Input: goodix - add support for Goodix GT9286 chip + +From: AngeloGioacchino Del Regno + +commit 2dce6db70c77bbe639f5cd9cc796fb8f2694a7d0 upstream. + +The Goodix GT9286 is a capacitive touch sensor IC based on GT1x. + +This chip can be found on a number of smartphones, including the +F(x)tec Pro 1 and the Elephone U. + +This has been tested on F(x)Tec Pro1 (MSM8998). + +Signed-off-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20210109135512.149032-2-angelogioacchino.delregno@somainline.org +Reviewed-by: Bastien Nocera +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/touchscreen/goodix.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/input/touchscreen/goodix.c ++++ b/drivers/input/touchscreen/goodix.c +@@ -157,6 +157,7 @@ static const struct goodix_chip_id goodi + { .id = "5663", .data = >1x_chip_data }, + { .id = "5688", .data = >1x_chip_data }, + { .id = "917S", .data = >1x_chip_data }, ++ { .id = "9286", .data = >1x_chip_data }, + + { .id = "911", .data = >911_chip_data }, + { .id = "9271", .data = >911_chip_data }, +@@ -1445,6 +1446,7 @@ static const struct of_device_id goodix_ + { .compatible = "goodix,gt927" }, + { .compatible = "goodix,gt9271" }, + { .compatible = "goodix,gt928" }, ++ { .compatible = "goodix,gt9286" }, + { .compatible = "goodix,gt967" }, + { } + }; diff --git a/queue-5.10/input-ili210x-implement-pressure-reporting-for-ili251x.patch b/queue-5.10/input-ili210x-implement-pressure-reporting-for-ili251x.patch new file mode 100644 index 00000000000..bb5703fde74 --- /dev/null +++ b/queue-5.10/input-ili210x-implement-pressure-reporting-for-ili251x.patch @@ -0,0 +1,124 @@ +From 60159e9e7bc7e528c103b6b6d47dfd83af29669c Mon Sep 17 00:00:00 2001 +From: Marek Vasut +Date: Sun, 3 Jan 2021 17:43:04 -0800 +Subject: Input: ili210x - implement pressure reporting for ILI251x + +From: Marek Vasut + +commit 60159e9e7bc7e528c103b6b6d47dfd83af29669c upstream. + +The ILI251x seems to report pressure information in the 5th byte of +each per-finger touch data element. On the available hardware, this +information has the values ranging from 0x0 to 0xa, which is also +matching the downstream example code. Report pressure information +on the ILI251x. + +Signed-off-by: Marek Vasut +Link: https://lore.kernel.org/r/20201224071238.160098-1-marex@denx.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/touchscreen/ili210x.c | 26 +++++++++++++++++++------- + 1 file changed, 19 insertions(+), 7 deletions(-) + +--- a/drivers/input/touchscreen/ili210x.c ++++ b/drivers/input/touchscreen/ili210x.c +@@ -29,11 +29,13 @@ struct ili2xxx_chip { + void *buf, size_t len); + int (*get_touch_data)(struct i2c_client *client, u8 *data); + bool (*parse_touch_data)(const u8 *data, unsigned int finger, +- unsigned int *x, unsigned int *y); ++ unsigned int *x, unsigned int *y, ++ unsigned int *z); + bool (*continue_polling)(const u8 *data, bool touch); + unsigned int max_touches; + unsigned int resolution; + bool has_calibrate_reg; ++ bool has_pressure_reg; + }; + + struct ili210x { +@@ -82,7 +84,8 @@ static int ili210x_read_touch_data(struc + + static bool ili210x_touchdata_to_coords(const u8 *touchdata, + unsigned int finger, +- unsigned int *x, unsigned int *y) ++ unsigned int *x, unsigned int *y, ++ unsigned int *z) + { + if (touchdata[0] & BIT(finger)) + return false; +@@ -137,7 +140,8 @@ static int ili211x_read_touch_data(struc + + static bool ili211x_touchdata_to_coords(const u8 *touchdata, + unsigned int finger, +- unsigned int *x, unsigned int *y) ++ unsigned int *x, unsigned int *y, ++ unsigned int *z) + { + u32 data; + +@@ -169,7 +173,8 @@ static const struct ili2xxx_chip ili211x + + static bool ili212x_touchdata_to_coords(const u8 *touchdata, + unsigned int finger, +- unsigned int *x, unsigned int *y) ++ unsigned int *x, unsigned int *y, ++ unsigned int *z) + { + u16 val; + +@@ -235,7 +240,8 @@ static int ili251x_read_touch_data(struc + + static bool ili251x_touchdata_to_coords(const u8 *touchdata, + unsigned int finger, +- unsigned int *x, unsigned int *y) ++ unsigned int *x, unsigned int *y, ++ unsigned int *z) + { + u16 val; + +@@ -245,6 +251,7 @@ static bool ili251x_touchdata_to_coords( + + *x = val & 0x3fff; + *y = get_unaligned_be16(touchdata + 1 + (finger * 5) + 2); ++ *z = touchdata[1 + (finger * 5) + 4]; + + return true; + } +@@ -261,6 +268,7 @@ static const struct ili2xxx_chip ili251x + .continue_polling = ili251x_check_continue_polling, + .max_touches = 10, + .has_calibrate_reg = true, ++ .has_pressure_reg = true, + }; + + static bool ili210x_report_events(struct ili210x *priv, u8 *touchdata) +@@ -268,14 +276,16 @@ static bool ili210x_report_events(struct + struct input_dev *input = priv->input; + int i; + bool contact = false, touch; +- unsigned int x = 0, y = 0; ++ unsigned int x = 0, y = 0, z = 0; + + for (i = 0; i < priv->chip->max_touches; i++) { +- touch = priv->chip->parse_touch_data(touchdata, i, &x, &y); ++ touch = priv->chip->parse_touch_data(touchdata, i, &x, &y, &z); + + input_mt_slot(input, i); + if (input_mt_report_slot_state(input, MT_TOOL_FINGER, touch)) { + touchscreen_report_pos(input, &priv->prop, x, y, true); ++ if (priv->chip->has_pressure_reg) ++ input_report_abs(input, ABS_MT_PRESSURE, z); + contact = true; + } + } +@@ -437,6 +447,8 @@ static int ili210x_i2c_probe(struct i2c_ + max_xy = (chip->resolution ?: SZ_64K) - 1; + input_set_abs_params(input, ABS_MT_POSITION_X, 0, max_xy, 0, 0); + input_set_abs_params(input, ABS_MT_POSITION_Y, 0, max_xy, 0, 0); ++ if (priv->chip->has_pressure_reg) ++ input_set_abs_params(input, ABS_MT_PRESSURE, 0, 0xa, 0, 0); + touchscreen_parse_properties(input, true, &priv->prop); + + error = input_mt_init_slots(input, priv->chip->max_touches, diff --git a/queue-5.10/input-xpad-sync-supported-devices-with-fork-on-github.patch b/queue-5.10/input-xpad-sync-supported-devices-with-fork-on-github.patch new file mode 100644 index 00000000000..4b62d9dfbb3 --- /dev/null +++ b/queue-5.10/input-xpad-sync-supported-devices-with-fork-on-github.patch @@ -0,0 +1,69 @@ +From 9bbd77d5bbc9aff8cb74d805c31751f5f0691ba8 Mon Sep 17 00:00:00 2001 +From: Benjamin Valentin +Date: Thu, 21 Jan 2021 19:24:17 -0800 +Subject: Input: xpad - sync supported devices with fork on GitHub + +From: Benjamin Valentin + +commit 9bbd77d5bbc9aff8cb74d805c31751f5f0691ba8 upstream. + +There is a fork of this driver on GitHub [0] that has been updated +with new device IDs. + +Merge those into the mainline driver, so the out-of-tree fork is not +needed for users of those devices anymore. + +[0] https://github.com/paroj/xpad + +Signed-off-by: Benjamin Valentin +Link: https://lore.kernel.org/r/20210121142523.1b6b050f@rechenknecht2k11 +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/joystick/xpad.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +--- a/drivers/input/joystick/xpad.c ++++ b/drivers/input/joystick/xpad.c +@@ -215,9 +215,17 @@ static const struct xpad_device { + { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, + { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, + { 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE }, +- { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02a0, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02a1, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02a2, "PDP Wired Controller for Xbox One - Crimson Red", 0, XTYPE_XBOXONE }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02a7, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02a8, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02ad, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02b3, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE }, ++ { 0x0e6f, 0x02b8, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE }, + { 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 }, + { 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE }, + { 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 }, +@@ -296,6 +304,9 @@ static const struct xpad_device { + { 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 }, + { 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 }, + { 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 }, ++ { 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE }, ++ { 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 }, ++ { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE }, + { 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, + { 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 }, + { 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 }, +@@ -429,8 +440,12 @@ static const struct usb_device_id xpad_t + XPAD_XBOX360_VENDOR(0x162e), /* Joytech X-Box 360 controllers */ + XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ + XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ ++ XPAD_XBOX360_VENDOR(0x20d6), /* PowerA Controllers */ ++ XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */ + XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */ + XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */ ++ XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */ ++ XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */ + { } + }; + diff --git a/queue-5.10/md-set-prev_flush_start-and-flush_bio-in-an-atomic-way.patch b/queue-5.10/md-set-prev_flush_start-and-flush_bio-in-an-atomic-way.patch new file mode 100644 index 00000000000..631464ab3ea --- /dev/null +++ b/queue-5.10/md-set-prev_flush_start-and-flush_bio-in-an-atomic-way.patch @@ -0,0 +1,65 @@ +From dc5d17a3c39b06aef866afca19245a9cfb533a79 Mon Sep 17 00:00:00 2001 +From: Xiao Ni +Date: Thu, 10 Dec 2020 14:33:32 +0800 +Subject: md: Set prev_flush_start and flush_bio in an atomic way + +From: Xiao Ni + +commit dc5d17a3c39b06aef866afca19245a9cfb533a79 upstream. + +One customer reports a crash problem which causes by flush request. It +triggers a warning before crash. + + /* new request after previous flush is completed */ + if (ktime_after(req_start, mddev->prev_flush_start)) { + WARN_ON(mddev->flush_bio); + mddev->flush_bio = bio; + bio = NULL; + } + +The WARN_ON is triggered. We use spin lock to protect prev_flush_start and +flush_bio in md_flush_request. But there is no lock protection in +md_submit_flush_data. It can set flush_bio to NULL first because of +compiler reordering write instructions. + +For example, flush bio1 sets flush bio to NULL first in +md_submit_flush_data. An interrupt or vmware causing an extended stall +happen between updating flush_bio and prev_flush_start. Because flush_bio +is NULL, flush bio2 can get the lock and submit to underlayer disks. Then +flush bio1 updates prev_flush_start after the interrupt or extended stall. + +Then flush bio3 enters in md_flush_request. The start time req_start is +behind prev_flush_start. The flush_bio is not NULL(flush bio2 hasn't +finished). So it can trigger the WARN_ON now. Then it calls INIT_WORK +again. INIT_WORK() will re-initialize the list pointers in the +work_struct, which then can result in a corrupted work list and the +work_struct queued a second time. With the work list corrupted, it can +lead in invalid work items being used and cause a crash in +process_one_work. + +We need to make sure only one flush bio can be handled at one same time. +So add spin lock in md_submit_flush_data to protect prev_flush_start and +flush_bio in an atomic way. + +Reviewed-by: David Jeffery +Signed-off-by: Xiao Ni +Signed-off-by: Song Liu +Signed-off-by: Jack Wang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/md.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -639,8 +639,10 @@ static void md_submit_flush_data(struct + * could wait for this and below md_handle_request could wait for those + * bios because of suspend check + */ ++ spin_lock_irq(&mddev->lock); + mddev->last_flush = mddev->start_flush; + mddev->flush_bio = NULL; ++ spin_unlock_irq(&mddev->lock); + wake_up(&mddev->sb_wait); + + if (bio->bi_iter.bi_size == 0) { diff --git a/queue-5.10/series b/queue-5.10/series index 5d48f0c8720..5a2b7174980 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -108,3 +108,7 @@ x86-debug-fix-dr6-handling.patch x86-debug-prevent-data-breakpoints-on-__per_cpu_offset.patch x86-debug-prevent-data-breakpoints-on-cpu_dr7.patch x86-apic-add-extra-serialization-for-non-serializing-msrs.patch +input-goodix-add-support-for-goodix-gt9286-chip.patch +input-xpad-sync-supported-devices-with-fork-on-github.patch +input-ili210x-implement-pressure-reporting-for-ili251x.patch +md-set-prev_flush_start-and-flush_bio-in-an-atomic-way.patch