From: Greg Kroah-Hartman Date: Sat, 13 Nov 2021 11:37:28 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v5.4.160~164 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3520500a8e818e6b5a4eb3c6c7cc844e403247fc;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: input-elantench-fix-misreporting-trackpoint-coordinates.patch input-i8042-add-quirk-for-fujitsu-lifebook-t725.patch libata-fix-read-log-timeout-value.patch ocfs2-fix-data-corruption-on-truncate.patch --- diff --git a/queue-4.14/input-elantench-fix-misreporting-trackpoint-coordinates.patch b/queue-4.14/input-elantench-fix-misreporting-trackpoint-coordinates.patch new file mode 100644 index 00000000000..331c6ad2d21 --- /dev/null +++ b/queue-4.14/input-elantench-fix-misreporting-trackpoint-coordinates.patch @@ -0,0 +1,45 @@ +From be896bd3b72b44126c55768f14c22a8729b0992e Mon Sep 17 00:00:00 2001 +From: Phoenix Huang +Date: Sun, 7 Nov 2021 22:00:03 -0800 +Subject: Input: elantench - fix misreporting trackpoint coordinates + +From: Phoenix Huang + +commit be896bd3b72b44126c55768f14c22a8729b0992e upstream. + +Some firmwares occasionally report bogus data from trackpoint, with X or Y +displacement being too large (outside of [-127, 127] range). Let's drop such +packets so that we do not generate jumps. + +Signed-off-by: Phoenix Huang +Tested-by: Yufei Du +Link: https://lore.kernel.org/r/20210729010940.5752-1-phoenix@emc.com.tw +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/mouse/elantech.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/drivers/input/mouse/elantech.c ++++ b/drivers/input/mouse/elantech.c +@@ -431,6 +431,19 @@ static void elantech_report_trackpoint(s + case 0x16008020U: + case 0x26800010U: + case 0x36808000U: ++ ++ /* ++ * This firmware misreport coordinates for trackpoint ++ * occasionally. Discard packets outside of [-127, 127] range ++ * to prevent cursor jumps. ++ */ ++ if (packet[4] == 0x80 || packet[5] == 0x80 || ++ packet[1] >> 7 == packet[4] >> 7 || ++ packet[2] >> 7 == packet[5] >> 7) { ++ elantech_debug("discarding packet [%6ph]\n", packet); ++ break; ++ ++ } + x = packet[4] - (int)((packet[1]^0x80) << 1); + y = (int)((packet[2]^0x80) << 1) - packet[5]; + diff --git a/queue-4.14/input-i8042-add-quirk-for-fujitsu-lifebook-t725.patch b/queue-4.14/input-i8042-add-quirk-for-fujitsu-lifebook-t725.patch new file mode 100644 index 00000000000..539912f03e0 --- /dev/null +++ b/queue-4.14/input-i8042-add-quirk-for-fujitsu-lifebook-t725.patch @@ -0,0 +1,54 @@ +From 16e28abb7290c4ca3b3a0f333ba067f34bb18c86 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 3 Nov 2021 08:00:19 +0100 +Subject: Input: i8042 - Add quirk for Fujitsu Lifebook T725 + +From: Takashi Iwai + +commit 16e28abb7290c4ca3b3a0f333ba067f34bb18c86 upstream. + +Fujitsu Lifebook T725 laptop requires, like a few other similar +models, the nomux and notimeout options to probe the touchpad +properly. This patch adds the corresponding quirk entries. + +BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1191980 +Tested-by: Neal Gompa +Cc: +Signed-off-by: Takashi Iwai +Link: https://lore.kernel.org/r/20211103070019.13374-1-tiwai@suse.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/serio/i8042-x86ia64io.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/input/serio/i8042-x86ia64io.h ++++ b/drivers/input/serio/i8042-x86ia64io.h +@@ -277,6 +277,13 @@ static const struct dmi_system_id __init + }, + }, + { ++ /* Fujitsu Lifebook T725 laptop */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"), ++ }, ++ }, ++ { + /* Fujitsu Lifebook U745 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), +@@ -845,6 +852,13 @@ static const struct dmi_system_id __init + }, + }, + { ++ /* Fujitsu Lifebook T725 laptop */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"), ++ }, ++ }, ++ { + /* Fujitsu U574 laptop */ + /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ + .matches = { diff --git a/queue-4.14/libata-fix-read-log-timeout-value.patch b/queue-4.14/libata-fix-read-log-timeout-value.patch new file mode 100644 index 00000000000..22569edf968 --- /dev/null +++ b/queue-4.14/libata-fix-read-log-timeout-value.patch @@ -0,0 +1,88 @@ +From 68dbbe7d5b4fde736d104cbbc9a2fce875562012 Mon Sep 17 00:00:00 2001 +From: Damien Le Moal +Date: Thu, 4 Nov 2021 17:31:58 +0900 +Subject: libata: fix read log timeout value + +From: Damien Le Moal + +commit 68dbbe7d5b4fde736d104cbbc9a2fce875562012 upstream. + +Some ATA drives are very slow to respond to READ_LOG_EXT and +READ_LOG_DMA_EXT commands issued from ata_dev_configure() when the +device is revalidated right after resuming a system or inserting the +ATA adapter driver (e.g. ahci). The default 5s timeout +(ATA_EH_CMD_DFL_TIMEOUT) used for these commands is too short, causing +errors during the device configuration. Ex: + +... +ata9: SATA max UDMA/133 abar m524288@0x9d200000 port 0x9d200400 irq 209 +ata9: SATA link up 6.0 Gbps (SStatus 133 SControl 300) +ata9.00: ATA-9: XXX XXXXXXXXXXXXXXX, XXXXXXXX, max UDMA/133 +ata9.00: qc timeout (cmd 0x2f) +ata9.00: Read log page 0x00 failed, Emask 0x4 +ata9.00: Read log page 0x00 failed, Emask 0x40 +ata9.00: NCQ Send/Recv Log not supported +ata9.00: Read log page 0x08 failed, Emask 0x40 +ata9.00: 27344764928 sectors, multi 16: LBA48 NCQ (depth 32), AA +ata9.00: Read log page 0x00 failed, Emask 0x40 +ata9.00: ATA Identify Device Log not supported +ata9.00: failed to set xfermode (err_mask=0x40) +ata9: SATA link up 6.0 Gbps (SStatus 133 SControl 300) +ata9.00: configured for UDMA/133 +... + +The timeout error causes a soft reset of the drive link, followed in +most cases by a successful revalidation as that give enough time to the +drive to become fully ready to quickly process the read log commands. +However, in some cases, this also fails resulting in the device being +dropped. + +Fix this by using adding the ata_eh_revalidate_timeouts entries for the +READ_LOG_EXT and READ_LOG_DMA_EXT commands. This defines a timeout +increased to 15s, retriable one time. + +Reported-by: Geert Uytterhoeven +Tested-by: Geert Uytterhoeven +Cc: stable@vger.kernel.org +Signed-off-by: Damien Le Moal +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/libata-eh.c | 8 ++++++++ + include/linux/libata.h | 2 +- + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/ata/libata-eh.c ++++ b/drivers/ata/libata-eh.c +@@ -114,6 +114,12 @@ static const unsigned long ata_eh_identi + ULONG_MAX, + }; + ++static const unsigned long ata_eh_revalidate_timeouts[] = { ++ 15000, /* Some drives are slow to read log pages when waking-up */ ++ 15000, /* combined time till here is enough even for media access */ ++ ULONG_MAX, ++}; ++ + static const unsigned long ata_eh_flush_timeouts[] = { + 15000, /* be generous with flush */ + 15000, /* ditto */ +@@ -150,6 +156,8 @@ static const struct ata_eh_cmd_timeout_e + ata_eh_cmd_timeout_table[ATA_EH_CMD_TIMEOUT_TABLE_SIZE] = { + { .commands = CMDS(ATA_CMD_ID_ATA, ATA_CMD_ID_ATAPI), + .timeouts = ata_eh_identify_timeouts, }, ++ { .commands = CMDS(ATA_CMD_READ_LOG_EXT, ATA_CMD_READ_LOG_DMA_EXT), ++ .timeouts = ata_eh_revalidate_timeouts, }, + { .commands = CMDS(ATA_CMD_READ_NATIVE_MAX, ATA_CMD_READ_NATIVE_MAX_EXT), + .timeouts = ata_eh_other_timeouts, }, + { .commands = CMDS(ATA_CMD_SET_MAX, ATA_CMD_SET_MAX_EXT), +--- a/include/linux/libata.h ++++ b/include/linux/libata.h +@@ -409,7 +409,7 @@ enum { + /* This should match the actual table size of + * ata_eh_cmd_timeout_table in libata-eh.c. + */ +- ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 6, ++ ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 7, + + /* Horkage types. May be set by libata or controller on drives + (some horkage may be drive/controller pair dependent */ diff --git a/queue-4.14/ocfs2-fix-data-corruption-on-truncate.patch b/queue-4.14/ocfs2-fix-data-corruption-on-truncate.patch new file mode 100644 index 00000000000..778a2f86f87 --- /dev/null +++ b/queue-4.14/ocfs2-fix-data-corruption-on-truncate.patch @@ -0,0 +1,91 @@ +From 839b63860eb3835da165642923120d305925561d Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Fri, 5 Nov 2021 13:34:55 -0700 +Subject: ocfs2: fix data corruption on truncate + +From: Jan Kara + +commit 839b63860eb3835da165642923120d305925561d upstream. + +Patch series "ocfs2: Truncate data corruption fix". + +As further testing has shown, commit 5314454ea3f ("ocfs2: fix data +corruption after conversion from inline format") didn't fix all the data +corruption issues the customer started observing after 6dbf7bb55598 +("fs: Don't invalidate page buffers in block_write_full_page()") This +time I have tracked them down to two bugs in ocfs2 truncation code. + +One bug (truncating page cache before clearing tail cluster and setting +i_size) could cause data corruption even before 6dbf7bb55598, but before +that commit it needed a race with page fault, after 6dbf7bb55598 it +started to be pretty deterministic. + +Another bug (zeroing pages beyond old i_size) used to be harmless +inefficiency before commit 6dbf7bb55598. But after commit 6dbf7bb55598 +in combination with the first bug it resulted in deterministic data +corruption. + +Although fixing only the first problem is needed to stop data +corruption, I've fixed both issues to make the code more robust. + +This patch (of 2): + +ocfs2_truncate_file() did unmap invalidate page cache pages before +zeroing partial tail cluster and setting i_size. Thus some pages could +be left (and likely have left if the cluster zeroing happened) in the +page cache beyond i_size after truncate finished letting user possibly +see stale data once the file was extended again. Also the tail cluster +zeroing was not guaranteed to finish before truncate finished causing +possible stale data exposure. The problem started to be particularly +easy to hit after commit 6dbf7bb55598 "fs: Don't invalidate page buffers +in block_write_full_page()" stopped invalidation of pages beyond i_size +from page writeback path. + +Fix these problems by unmapping and invalidating pages in the page cache +after the i_size is reduced and tail cluster is zeroed out. + +Link: https://lkml.kernel.org/r/20211025150008.29002-1-jack@suse.cz +Link: https://lkml.kernel.org/r/20211025151332.11301-1-jack@suse.cz +Fixes: ccd979bdbce9 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem") +Signed-off-by: Jan Kara +Reviewed-by: Joseph Qi +Cc: Mark Fasheh +Cc: Joel Becker +Cc: Junxiao Bi +Cc: Changwei Ge +Cc: Gang He +Cc: Jun Piao +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + fs/ocfs2/file.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/fs/ocfs2/file.c ++++ b/fs/ocfs2/file.c +@@ -490,10 +490,11 @@ int ocfs2_truncate_file(struct inode *in + * greater than page size, so we have to truncate them + * anyway. + */ +- unmap_mapping_range(inode->i_mapping, new_i_size + PAGE_SIZE - 1, 0, 1); +- truncate_inode_pages(inode->i_mapping, new_i_size); + + if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { ++ unmap_mapping_range(inode->i_mapping, ++ new_i_size + PAGE_SIZE - 1, 0, 1); ++ truncate_inode_pages(inode->i_mapping, new_i_size); + status = ocfs2_truncate_inline(inode, di_bh, new_i_size, + i_size_read(inode), 1); + if (status) +@@ -512,6 +513,9 @@ int ocfs2_truncate_file(struct inode *in + goto bail_unlock_sem; + } + ++ unmap_mapping_range(inode->i_mapping, new_i_size + PAGE_SIZE - 1, 0, 1); ++ truncate_inode_pages(inode->i_mapping, new_i_size); ++ + status = ocfs2_commit_truncate(osb, inode, di_bh); + if (status < 0) { + mlog_errno(status); diff --git a/queue-4.14/series b/queue-4.14/series index 8b3b1a4413a..bb5f9366dec 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -1,3 +1,7 @@ xhci-fix-usb-3.1-enumeration-issues-by-increasing-roothub-power-on-good-delay.patch binder-use-euid-from-cred-instead-of-using-task.patch binder-use-cred-instead-of-task-for-selinux-checks.patch +input-elantench-fix-misreporting-trackpoint-coordinates.patch +input-i8042-add-quirk-for-fujitsu-lifebook-t725.patch +libata-fix-read-log-timeout-value.patch +ocfs2-fix-data-corruption-on-truncate.patch