From: Greg Kroah-Hartman Date: Mon, 20 Dec 2021 09:43:38 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.4.296~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6539643c230fda943075ee8c9339c662c86e15dd;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: pci-msi-clear-pci_msix_flags_maskall-on-error.patch timekeeping-really-make-sure-wall_to_monotonic-isn-t-positive.patch usb-serial-option-add-telit-fn990-compositions.patch --- diff --git a/queue-4.9/pci-msi-clear-pci_msix_flags_maskall-on-error.patch b/queue-4.9/pci-msi-clear-pci_msix_flags_maskall-on-error.patch new file mode 100644 index 00000000000..65ce4afb5ff --- /dev/null +++ b/queue-4.9/pci-msi-clear-pci_msix_flags_maskall-on-error.patch @@ -0,0 +1,46 @@ +From 94185adbfad56815c2c8401e16d81bdb74a79201 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Tue, 14 Dec 2021 12:42:14 +0100 +Subject: PCI/MSI: Clear PCI_MSIX_FLAGS_MASKALL on error + +From: Thomas Gleixner + +commit 94185adbfad56815c2c8401e16d81bdb74a79201 upstream. + +PCI_MSIX_FLAGS_MASKALL is set in the MSI-X control register at MSI-X +interrupt setup time. It's cleared on success, but the error handling path +only clears the PCI_MSIX_FLAGS_ENABLE bit. + +That's incorrect as the reset state of the PCI_MSIX_FLAGS_MASKALL bit is +zero. That can be observed via lspci: + + Capabilities: [b0] MSI-X: Enable- Count=67 Masked+ + +Clear the bit in the error path to restore the reset state. + +Fixes: 438553958ba1 ("PCI/MSI: Enable and mask MSI-X early") +Reported-by: Stefan Roese +Signed-off-by: Thomas Gleixner +Tested-by: Stefan Roese +Cc: linux-pci@vger.kernel.org +Cc: Bjorn Helgaas +Cc: Michal Simek +Cc: Marek Vasut +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/87tufevoqx.ffs@tglx +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/msi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pci/msi.c ++++ b/drivers/pci/msi.c +@@ -871,7 +871,7 @@ out_free: + free_msi_irqs(dev); + + out_disable: +- pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0); ++ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0); + + return ret; + } diff --git a/queue-4.9/series b/queue-4.9/series index 7c092aa12d6..a0106000857 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -13,3 +13,6 @@ soc-tegra-fuse-fix-bitwise-vs.-logical-or-warning.patch igbvf-fix-double-free-in-igbvf_probe.patch ixgbe-set-x550-mdio-speed-before-talking-to-phy.patch usb-gadget-brequesttype-is-a-bitfield-not-a-enum.patch +pci-msi-clear-pci_msix_flags_maskall-on-error.patch +usb-serial-option-add-telit-fn990-compositions.patch +timekeeping-really-make-sure-wall_to_monotonic-isn-t-positive.patch diff --git a/queue-4.9/timekeeping-really-make-sure-wall_to_monotonic-isn-t-positive.patch b/queue-4.9/timekeeping-really-make-sure-wall_to_monotonic-isn-t-positive.patch new file mode 100644 index 00000000000..a7fc5fb8b1a --- /dev/null +++ b/queue-4.9/timekeeping-really-make-sure-wall_to_monotonic-isn-t-positive.patch @@ -0,0 +1,65 @@ +From 4e8c11b6b3f0b6a283e898344f154641eda94266 Mon Sep 17 00:00:00 2001 +From: Yu Liao +Date: Mon, 13 Dec 2021 21:57:27 +0800 +Subject: timekeeping: Really make sure wall_to_monotonic isn't positive + +From: Yu Liao + +commit 4e8c11b6b3f0b6a283e898344f154641eda94266 upstream. + +Even after commit e1d7ba873555 ("time: Always make sure wall_to_monotonic +isn't positive") it is still possible to make wall_to_monotonic positive +by running the following code: + + int main(void) + { + struct timespec time; + + clock_gettime(CLOCK_MONOTONIC, &time); + time.tv_nsec = 0; + clock_settime(CLOCK_REALTIME, &time); + return 0; + } + +The reason is that the second parameter of timespec64_compare(), ts_delta, +may be unnormalized because the delta is calculated with an open coded +substraction which causes the comparison of tv_sec to yield the wrong +result: + + wall_to_monotonic = { .tv_sec = -10, .tv_nsec = 900000000 } + ts_delta = { .tv_sec = -9, .tv_nsec = -900000000 } + +That makes timespec64_compare() claim that wall_to_monotonic < ts_delta, +but actually the result should be wall_to_monotonic > ts_delta. + +After normalization, the result of timespec64_compare() is correct because +the tv_sec comparison is not longer misleading: + + wall_to_monotonic = { .tv_sec = -10, .tv_nsec = 900000000 } + ts_delta = { .tv_sec = -10, .tv_nsec = 100000000 } + +Use timespec64_sub() to ensure that ts_delta is normalized, which fixes the +issue. + +Fixes: e1d7ba873555 ("time: Always make sure wall_to_monotonic isn't positive") +Signed-off-by: Yu Liao +Signed-off-by: Thomas Gleixner +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20211213135727.1656662-1-liaoyu15@huawei.com +Signed-off-by: Greg Kroah-Hartman +--- + kernel/time/timekeeping.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/kernel/time/timekeeping.c ++++ b/kernel/time/timekeeping.c +@@ -1198,8 +1198,7 @@ int do_settimeofday64(const struct times + timekeeping_forward_now(tk); + + xt = tk_xtime(tk); +- ts_delta.tv_sec = ts->tv_sec - xt.tv_sec; +- ts_delta.tv_nsec = ts->tv_nsec - xt.tv_nsec; ++ ts_delta = timespec64_sub(*ts, xt); + + if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) { + ret = -EINVAL; diff --git a/queue-4.9/usb-serial-option-add-telit-fn990-compositions.patch b/queue-4.9/usb-serial-option-add-telit-fn990-compositions.patch new file mode 100644 index 00000000000..ee13766b8ad --- /dev/null +++ b/queue-4.9/usb-serial-option-add-telit-fn990-compositions.patch @@ -0,0 +1,42 @@ +From 2b503c8598d1b232e7fc7526bce9326d92331541 Mon Sep 17 00:00:00 2001 +From: Daniele Palmas +Date: Fri, 10 Dec 2021 11:07:14 +0100 +Subject: USB: serial: option: add Telit FN990 compositions + +From: Daniele Palmas + +commit 2b503c8598d1b232e7fc7526bce9326d92331541 upstream. + +Add the following Telit FN990 compositions: + +0x1070: tty, adb, rmnet, tty, tty, tty, tty +0x1071: tty, adb, mbim, tty, tty, tty, tty +0x1072: rndis, tty, adb, tty, tty, tty, tty +0x1073: tty, adb, ecm, tty, tty, tty, tty + +Signed-off-by: Daniele Palmas +Link: https://lore.kernel.org/r/20211210100714.22587-1-dnlplm@gmail.com +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1195,6 +1195,14 @@ static const struct usb_device_id option + .driver_info = NCTRL(2) | RSVD(3) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1063, 0xff), /* Telit LN920 (ECM) */ + .driver_info = NCTRL(0) | RSVD(1) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1070, 0xff), /* Telit FN990 (rmnet) */ ++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1071, 0xff), /* Telit FN990 (MBIM) */ ++ .driver_info = NCTRL(0) | RSVD(1) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1072, 0xff), /* Telit FN990 (RNDIS) */ ++ .driver_info = NCTRL(2) | RSVD(3) }, ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */ ++ .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), + .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),