From: Greg Kroah-Hartman Date: Wed, 7 Aug 2019 15:57:07 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.2.8~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=020735f191f1a3f25adc70aa2056394a3b1d3375;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: arm64-cpufeature-fix-feature-comparison-for-ctr_el0.-cwg-erg.patch hid-add-quirk-for-hp-x1200-pixart-oem-mouse.patch hid-wacom-fix-bit-shift-for-cintiq-companion-2.patch spi-bcm2835-fix-3-wire-mode-if-dma-is-enabled.patch --- diff --git a/queue-4.14/arm64-cpufeature-fix-feature-comparison-for-ctr_el0.-cwg-erg.patch b/queue-4.14/arm64-cpufeature-fix-feature-comparison-for-ctr_el0.-cwg-erg.patch new file mode 100644 index 00000000000..c9eed875727 --- /dev/null +++ b/queue-4.14/arm64-cpufeature-fix-feature-comparison-for-ctr_el0.-cwg-erg.patch @@ -0,0 +1,69 @@ +From 147b9635e6347104b91f48ca9dca61eb0fbf2a54 Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Tue, 30 Jul 2019 15:40:20 +0100 +Subject: arm64: cpufeature: Fix feature comparison for CTR_EL0.{CWG,ERG} + +From: Will Deacon + +commit 147b9635e6347104b91f48ca9dca61eb0fbf2a54 upstream. + +If CTR_EL0.{CWG,ERG} are 0b0000 then they must be interpreted to have +their architecturally maximum values, which defeats the use of +FTR_HIGHER_SAFE when sanitising CPU ID registers on heterogeneous +machines. + +Introduce FTR_HIGHER_OR_ZERO_SAFE so that these fields effectively +saturate at zero. + +Fixes: 3c739b571084 ("arm64: Keep track of CPU feature registers") +Cc: # 4.4.x- +Reviewed-by: Suzuki K Poulose +Acked-by: Mark Rutland +Signed-off-by: Will Deacon +Signed-off-by: Catalin Marinas +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/include/asm/cpufeature.h | 7 ++++--- + arch/arm64/kernel/cpufeature.c | 8 ++++++-- + 2 files changed, 10 insertions(+), 5 deletions(-) + +--- a/arch/arm64/include/asm/cpufeature.h ++++ b/arch/arm64/include/asm/cpufeature.h +@@ -44,9 +44,10 @@ + */ + + enum ftr_type { +- FTR_EXACT, /* Use a predefined safe value */ +- FTR_LOWER_SAFE, /* Smaller value is safe */ +- FTR_HIGHER_SAFE,/* Bigger value is safe */ ++ FTR_EXACT, /* Use a predefined safe value */ ++ FTR_LOWER_SAFE, /* Smaller value is safe */ ++ FTR_HIGHER_SAFE, /* Bigger value is safe */ ++ FTR_HIGHER_OR_ZERO_SAFE, /* Bigger value is safe, but 0 is biggest */ + }; + + #define FTR_STRICT true /* SANITY check strict matching required */ +--- a/arch/arm64/kernel/cpufeature.c ++++ b/arch/arm64/kernel/cpufeature.c +@@ -178,8 +178,8 @@ static const struct arm64_ftr_bits ftr_c + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */ + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 29, 1, 1), /* DIC */ + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 28, 1, 1), /* IDC */ +- ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 24, 4, 0), /* CWG */ +- ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 20, 4, 0), /* ERG */ ++ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, 24, 4, 0), /* CWG */ ++ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, 20, 4, 0), /* ERG */ + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DMINLINE_SHIFT, 4, 1), + /* + * Linux can handle differing I-cache policies. Userspace JITs will +@@ -411,6 +411,10 @@ static s64 arm64_ftr_safe_value(const st + case FTR_LOWER_SAFE: + ret = new < cur ? new : cur; + break; ++ case FTR_HIGHER_OR_ZERO_SAFE: ++ if (!cur || !new) ++ break; ++ /* Fallthrough */ + case FTR_HIGHER_SAFE: + ret = new > cur ? new : cur; + break; diff --git a/queue-4.14/hid-add-quirk-for-hp-x1200-pixart-oem-mouse.patch b/queue-4.14/hid-add-quirk-for-hp-x1200-pixart-oem-mouse.patch new file mode 100644 index 00000000000..fd4746cb2f9 --- /dev/null +++ b/queue-4.14/hid-add-quirk-for-hp-x1200-pixart-oem-mouse.patch @@ -0,0 +1,47 @@ +From 49869d2ea9eecc105a10724c1abf035151a3c4e2 Mon Sep 17 00:00:00 2001 +From: Sebastian Parschauer +Date: Wed, 24 Jul 2019 20:40:03 +0200 +Subject: HID: Add quirk for HP X1200 PIXART OEM mouse + +From: Sebastian Parschauer + +commit 49869d2ea9eecc105a10724c1abf035151a3c4e2 upstream. + +The PixArt OEM mice are known for disconnecting every minute in +runlevel 1 or 3 if they are not always polled. So add quirk +ALWAYS_POLL for this one as well. + +Jonathan Teh (@jonathan-teh) reported and tested the quirk. +Reference: https://github.com/sriemer/fix-linux-mouse/issues/15 + +Signed-off-by: Sebastian Parschauer +CC: stable@vger.kernel.org +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/hid/hid-ids.h | 1 + + drivers/hid/usbhid/hid-quirks.c | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -537,6 +537,7 @@ + #define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A 0x0b4a + #define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE 0x134a + #define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A 0x094a ++#define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0641 0x0641 + + #define USB_VENDOR_ID_HUION 0x256c + #define USB_DEVICE_ID_HUION_TABLET 0x006e +--- a/drivers/hid/usbhid/hid-quirks.c ++++ b/drivers/hid/usbhid/hid-quirks.c +@@ -100,6 +100,7 @@ static const struct hid_blacklist { + { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A, HID_QUIRK_ALWAYS_POLL }, + { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE, HID_QUIRK_ALWAYS_POLL }, + { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A, HID_QUIRK_ALWAYS_POLL }, ++ { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0641, HID_QUIRK_ALWAYS_POLL }, + { USB_VENDOR_ID_IDEACOM, USB_DEVICE_ID_IDEACOM_IDC6680, HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C007, HID_QUIRK_ALWAYS_POLL }, + { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C077, HID_QUIRK_ALWAYS_POLL }, diff --git a/queue-4.14/hid-wacom-fix-bit-shift-for-cintiq-companion-2.patch b/queue-4.14/hid-wacom-fix-bit-shift-for-cintiq-companion-2.patch new file mode 100644 index 00000000000..28303640a8e --- /dev/null +++ b/queue-4.14/hid-wacom-fix-bit-shift-for-cintiq-companion-2.patch @@ -0,0 +1,50 @@ +From 693c3dab4e50403f91bca4b52fc6d8562a3180f6 Mon Sep 17 00:00:00 2001 +From: Aaron Armstrong Skomra +Date: Tue, 23 Jul 2019 11:09:15 -0700 +Subject: HID: wacom: fix bit shift for Cintiq Companion 2 + +From: Aaron Armstrong Skomra + +commit 693c3dab4e50403f91bca4b52fc6d8562a3180f6 upstream. + +The bit indicating BTN_6 on this device is overshifted +by 2 bits, resulting in the incorrect button being +reported. + +Also fix copy-paste mistake in comments. + +Signed-off-by: Aaron Armstrong Skomra +Reviewed-by: Ping Cheng +Link: https://github.com/linuxwacom/xf86-input-wacom/issues/71 +Fixes: c7f0522a1ad1 ("HID: wacom: Slim down wacom_intuos_pad processing") +Cc: # v4.5+ +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/wacom_wac.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/hid/wacom_wac.c ++++ b/drivers/hid/wacom_wac.c +@@ -537,14 +537,14 @@ static int wacom_intuos_pad(struct wacom + */ + buttons = (data[4] << 1) | (data[3] & 0x01); + } else if (features->type == CINTIQ_COMPANION_2) { +- /* d-pad right -> data[4] & 0x10 +- * d-pad up -> data[4] & 0x20 +- * d-pad left -> data[4] & 0x40 +- * d-pad down -> data[4] & 0x80 +- * d-pad center -> data[3] & 0x01 ++ /* d-pad right -> data[2] & 0x10 ++ * d-pad up -> data[2] & 0x20 ++ * d-pad left -> data[2] & 0x40 ++ * d-pad down -> data[2] & 0x80 ++ * d-pad center -> data[1] & 0x01 + */ + buttons = ((data[2] >> 4) << 7) | +- ((data[1] & 0x04) << 6) | ++ ((data[1] & 0x04) << 4) | + ((data[2] & 0x0F) << 2) | + (data[1] & 0x03); + } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) { diff --git a/queue-4.14/series b/queue-4.14/series index 941dc541cb6..20e81da2a02 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -2,3 +2,7 @@ scsi-fcoe-embed-fc_rport_priv-in-fcoe_rport-structure.patch arm-dts-add-pinmuxing-for-i2c2-and-i2c3-for-logicpd-.patch arm-dts-add-pinmuxing-for-i2c2-and-i2c3-for-logicpd-.patch-16786 tcp-be-more-careful-in-tcp_fragment.patch +arm64-cpufeature-fix-feature-comparison-for-ctr_el0.-cwg-erg.patch +hid-wacom-fix-bit-shift-for-cintiq-companion-2.patch +hid-add-quirk-for-hp-x1200-pixart-oem-mouse.patch +spi-bcm2835-fix-3-wire-mode-if-dma-is-enabled.patch diff --git a/queue-4.14/spi-bcm2835-fix-3-wire-mode-if-dma-is-enabled.patch b/queue-4.14/spi-bcm2835-fix-3-wire-mode-if-dma-is-enabled.patch new file mode 100644 index 00000000000..93120c7a6b2 --- /dev/null +++ b/queue-4.14/spi-bcm2835-fix-3-wire-mode-if-dma-is-enabled.patch @@ -0,0 +1,54 @@ +From 8d8bef50365847134b51c1ec46786bc2873e4e47 Mon Sep 17 00:00:00 2001 +From: Lukas Wunner +Date: Wed, 3 Jul 2019 12:29:31 +0200 +Subject: spi: bcm2835: Fix 3-wire mode if DMA is enabled +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lukas Wunner + +commit 8d8bef50365847134b51c1ec46786bc2873e4e47 upstream. + +Commit 6935224da248 ("spi: bcm2835: enable support of 3-wire mode") +added 3-wire support to the BCM2835 SPI driver by setting the REN bit +(Read Enable) in the CS register when receiving data. The REN bit puts +the transmitter in high-impedance state. The driver recognizes that +data is to be received by checking whether the rx_buf of a transfer is +non-NULL. + +Commit 3ecd37edaa2a ("spi: bcm2835: enable dma modes for transfers +meeting certain conditions") subsequently broke 3-wire support because +it set the SPI_MASTER_MUST_RX flag which causes spi_map_msg() to replace +rx_buf with a dummy buffer if it is NULL. As a result, rx_buf is +*always* non-NULL if DMA is enabled. + +Reinstate 3-wire support by not only checking whether rx_buf is non-NULL, +but also checking that it is not the dummy buffer. + +Fixes: 3ecd37edaa2a ("spi: bcm2835: enable dma modes for transfers meeting certain conditions") +Reported-by: Nuno Sá +Signed-off-by: Lukas Wunner +Cc: stable@vger.kernel.org # v4.2+ +Cc: Martin Sperl +Acked-by: Stefan Wahren +Link: https://lore.kernel.org/r/328318841455e505370ef8ecad97b646c033dc8a.1562148527.git.lukas@wunner.de +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-bcm2835.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-bcm2835.c ++++ b/drivers/spi/spi-bcm2835.c +@@ -554,7 +554,8 @@ static int bcm2835_spi_transfer_one(stru + bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv); + + /* handle all the 3-wire mode */ +- if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf)) ++ if (spi->mode & SPI_3WIRE && tfr->rx_buf && ++ tfr->rx_buf != ctlr->dummy_rx) + cs |= BCM2835_SPI_CS_REN; + else + cs &= ~BCM2835_SPI_CS_REN;