]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jul 2018 07:27:47 +0000 (09:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jul 2018 07:27:47 +0000 (09:27 +0200)
added patches:
block-do-not-use-interruptible-wait-anywhere.patch
mtd-rawnand-denali_dt-set-clk_x_rate-to-200-mhz-unconditionally.patch
pci-hv-disable-enable-irqs-rather-than-bh-in-hv_compose_msi_msg.patch

queue-4.14/block-do-not-use-interruptible-wait-anywhere.patch [new file with mode: 0644]
queue-4.14/mtd-rawnand-denali_dt-set-clk_x_rate-to-200-mhz-unconditionally.patch [new file with mode: 0644]
queue-4.14/pci-hv-disable-enable-irqs-rather-than-bh-in-hv_compose_msi_msg.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/block-do-not-use-interruptible-wait-anywhere.patch b/queue-4.14/block-do-not-use-interruptible-wait-anywhere.patch
new file mode 100644 (file)
index 0000000..5b7845c
--- /dev/null
@@ -0,0 +1,72 @@
+From 1dc3039bc87ae7d19a990c3ee71cfd8a9068f428 Mon Sep 17 00:00:00 2001
+From: Alan Jenkins <alan.christopher.jenkins@gmail.com>
+Date: Thu, 12 Apr 2018 19:11:58 +0100
+Subject: block: do not use interruptible wait anywhere
+
+From: Alan Jenkins <alan.christopher.jenkins@gmail.com>
+
+commit 1dc3039bc87ae7d19a990c3ee71cfd8a9068f428 upstream.
+
+When blk_queue_enter() waits for a queue to unfreeze, or unset the
+PREEMPT_ONLY flag, do not allow it to be interrupted by a signal.
+
+The PREEMPT_ONLY flag was introduced later in commit 3a0a529971ec
+("block, scsi: Make SCSI quiesce and resume work reliably").  Note the SCSI
+device is resumed asynchronously, i.e. after un-freezing userspace tasks.
+
+So that commit exposed the bug as a regression in v4.15.  A mysterious
+SIGBUS (or -EIO) sometimes happened during the time the device was being
+resumed.  Most frequently, there was no kernel log message, and we saw Xorg
+or Xwayland killed by SIGBUS.[1]
+
+[1] E.g. https://bugzilla.redhat.com/show_bug.cgi?id=1553979
+
+Without this fix, I get an IO error in this test:
+
+# dd if=/dev/sda of=/dev/null iflag=direct & \
+  while killall -SIGUSR1 dd; do sleep 0.1; done & \
+  echo mem > /sys/power/state ; \
+  sleep 5; killall dd  # stop after 5 seconds
+
+The interruptible wait was added to blk_queue_enter in
+commit 3ef28e83ab15 ("block: generic request_queue reference counting").
+Before then, the interruptible wait was only in blk-mq, but I don't think
+it could ever have been correct.
+
+Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-core.c |    9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+--- a/block/blk-core.c
++++ b/block/blk-core.c
+@@ -779,7 +779,6 @@ EXPORT_SYMBOL(blk_alloc_queue);
+ int blk_queue_enter(struct request_queue *q, bool nowait)
+ {
+       while (true) {
+-              int ret;
+               if (percpu_ref_tryget_live(&q->q_usage_counter))
+                       return 0;
+@@ -796,13 +795,11 @@ int blk_queue_enter(struct request_queue
+                */
+               smp_rmb();
+-              ret = wait_event_interruptible(q->mq_freeze_wq,
+-                              !atomic_read(&q->mq_freeze_depth) ||
+-                              blk_queue_dying(q));
++              wait_event(q->mq_freeze_wq,
++                         !atomic_read(&q->mq_freeze_depth) ||
++                         blk_queue_dying(q));
+               if (blk_queue_dying(q))
+                       return -ENODEV;
+-              if (ret)
+-                      return ret;
+       }
+ }
diff --git a/queue-4.14/mtd-rawnand-denali_dt-set-clk_x_rate-to-200-mhz-unconditionally.patch b/queue-4.14/mtd-rawnand-denali_dt-set-clk_x_rate-to-200-mhz-unconditionally.patch
new file mode 100644 (file)
index 0000000..b44f96e
--- /dev/null
@@ -0,0 +1,49 @@
+From 3f6e6986045d47f87bd982910821b7ab9758487e Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Sat, 23 Jun 2018 01:06:34 +0900
+Subject: mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally
+
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+
+commit 3f6e6986045d47f87bd982910821b7ab9758487e upstream.
+
+Since commit 1bb88666775e ("mtd: nand: denali: handle timing parameters
+by setup_data_interface()"), denali_dt.c gets the clock rate from the
+clock driver.  The driver expects the frequency of the bus interface
+clock, whereas the clock driver of SOCFPGA provides the core clock.
+Thus, the setup_data_interface() hook calculates timing parameters
+based on a wrong frequency.
+
+To make it work without relying on the clock driver, hard-code the clock
+frequency, 200MHz.  This is fine for existing DT of UniPhier, and also
+fixes the issue of SOCFPGA because both platforms use 200 MHz for the
+bus interface clock.
+
+Fixes: 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()")
+Cc: linux-stable <stable@vger.kernel.org> #4.14+
+Reported-by: Philipp Rosenberger <p.rosenberger@linutronix.de>
+Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Tested-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mtd/nand/denali_dt.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/mtd/nand/denali_dt.c
++++ b/drivers/mtd/nand/denali_dt.c
+@@ -122,7 +122,11 @@ static int denali_dt_probe(struct platfo
+       if (ret)
+               return ret;
+-      denali->clk_x_rate = clk_get_rate(dt->clk);
++      /*
++       * Hardcode the clock rate for the backward compatibility.
++       * This works for both SOCFPGA and UniPhier.
++       */
++      denali->clk_x_rate = 200000000;
+       ret = denali_init(denali);
+       if (ret)
diff --git a/queue-4.14/pci-hv-disable-enable-irqs-rather-than-bh-in-hv_compose_msi_msg.patch b/queue-4.14/pci-hv-disable-enable-irqs-rather-than-bh-in-hv_compose_msi_msg.patch
new file mode 100644 (file)
index 0000000..403ac44
--- /dev/null
@@ -0,0 +1,73 @@
+From 35a88a18d7ea58600e11590405bc93b08e16e7f5 Mon Sep 17 00:00:00 2001
+From: Dexuan Cui <decui@microsoft.com>
+Date: Mon, 9 Jul 2018 13:16:07 -0500
+Subject: PCI: hv: Disable/enable IRQs rather than BH in hv_compose_msi_msg()
+
+From: Dexuan Cui <decui@microsoft.com>
+
+commit 35a88a18d7ea58600e11590405bc93b08e16e7f5 upstream.
+
+Commit de0aa7b2f97d ("PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()")
+uses local_bh_disable()/enable(), because hv_pci_onchannelcallback() can
+also run in tasklet context as the channel event callback, so bottom halves
+should be disabled to prevent a race condition.
+
+With CONFIG_PROVE_LOCKING=y in the recent mainline, or old kernels that
+don't have commit f71b74bca637 ("irq/softirqs: Use lockdep to assert IRQs
+are disabled/enabled"), when the upper layer IRQ code calls
+hv_compose_msi_msg() with local IRQs disabled, we'll see a warning at the
+beginning of __local_bh_enable_ip():
+
+  IRQs not enabled as expected
+    WARNING: CPU: 0 PID: 408 at kernel/softirq.c:162 __local_bh_enable_ip
+
+The warning exposes an issue in de0aa7b2f97d: local_bh_enable() can
+potentially call do_softirq(), which is not supposed to run when local IRQs
+are disabled. Let's fix this by using local_irq_save()/restore() instead.
+
+Note: hv_pci_onchannelcallback() is not a hot path because it's only called
+when the PCI device is hot added and removed, which is infrequent.
+
+Fixes: de0aa7b2f97d ("PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()")
+Signed-off-by: Dexuan Cui <decui@microsoft.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Cc: stable@vger.kernel.org
+Cc: Stephen Hemminger <sthemmin@microsoft.com>
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pci/host/pci-hyperv.c |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/pci/host/pci-hyperv.c
++++ b/drivers/pci/host/pci-hyperv.c
+@@ -1091,6 +1091,7 @@ static void hv_compose_msi_msg(struct ir
+       struct pci_bus *pbus;
+       struct pci_dev *pdev;
+       struct cpumask *dest;
++      unsigned long flags;
+       struct compose_comp_ctxt comp;
+       struct tran_int_desc *int_desc;
+       struct {
+@@ -1182,14 +1183,15 @@ static void hv_compose_msi_msg(struct ir
+                * the channel callback directly when channel->target_cpu is
+                * the current CPU. When the higher level interrupt code
+                * calls us with interrupt enabled, let's add the
+-               * local_bh_disable()/enable() to avoid race.
++               * local_irq_save()/restore() to avoid race:
++               * hv_pci_onchannelcallback() can also run in tasklet.
+                */
+-              local_bh_disable();
++              local_irq_save(flags);
+               if (hbus->hdev->channel->target_cpu == smp_processor_id())
+                       hv_pci_onchannelcallback(hbus);
+-              local_bh_enable();
++              local_irq_restore(flags);
+               if (hpdev->state == hv_pcichild_ejecting) {
+                       dev_err_once(&hbus->hdev->device,
index 1c299055bcb913647831d118ab643446c044688a..9fb7029068aaa9cb8451230ac28697d13bd1645a 100644 (file)
@@ -54,3 +54,6 @@ xhci-fix-usb3-null-pointer-dereference-at-logical-disconnect.patch
 media-rc-oops-in-ir_timer_keyup-after-device-unplug.patch
 clocksource-initialize-cs-wd_list.patch
 crypto-af_alg-initialize-sg_num_bytes-in-error-code-path.patch
+mtd-rawnand-denali_dt-set-clk_x_rate-to-200-mhz-unconditionally.patch
+block-do-not-use-interruptible-wait-anywhere.patch
+pci-hv-disable-enable-irqs-rather-than-bh-in-hv_compose_msi_msg.patch