+++ /dev/null
-From foo@baz Tue May 1 14:59:17 PDT 2018
-From: Bart Van Assche <bart.vanassche@wdc.com>
-Date: Wed, 28 Feb 2018 10:15:33 -0800
-Subject: block: Fix a race between request queue removal and the block cgroup controller
-
-From: Bart Van Assche <bart.vanassche@wdc.com>
-
-[ Upstream commit a063057d7c731cffa7d10740e8ebc2970df8dbb3 ]
-
-Avoid that the following race can occur:
-
-blk_cleanup_queue() blkcg_print_blkgs()
- spin_lock_irq(lock) (1) spin_lock_irq(blkg->q->queue_lock) (2,5)
- q->queue_lock = &q->__queue_lock (3)
- spin_unlock_irq(lock) (4)
- spin_unlock_irq(blkg->q->queue_lock) (6)
-
-(1) take driver lock;
-(2) busy loop for driver lock;
-(3) override driver lock with internal lock;
-(4) unlock driver lock;
-(5) can take driver lock now;
-(6) but unlock internal lock.
-
-This change is safe because only the SCSI core and the NVME core keep
-a reference on a request queue after having called blk_cleanup_queue().
-Neither driver accesses any of the removed data structures between its
-blk_cleanup_queue() and blk_put_queue() calls.
-
-Reported-by: Joseph Qi <joseph.qi@linux.alibaba.com>
-Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
-Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
-Cc: Jan Kara <jack@suse.com>
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- block/blk-core.c | 31 +++++++++++++++++++++++++++++++
- block/blk-sysfs.c | 7 -------
- 2 files changed, 31 insertions(+), 7 deletions(-)
-
---- a/block/blk-core.c
-+++ b/block/blk-core.c
-@@ -723,6 +723,37 @@ void blk_cleanup_queue(struct request_qu
- del_timer_sync(&q->backing_dev_info->laptop_mode_wb_timer);
- blk_sync_queue(q);
-
-+ /*
-+ * I/O scheduler exit is only safe after the sysfs scheduler attribute
-+ * has been removed.
-+ */
-+ WARN_ON_ONCE(q->kobj.state_in_sysfs);
-+
-+ /*
-+ * Since the I/O scheduler exit code may access cgroup information,
-+ * perform I/O scheduler exit before disassociating from the block
-+ * cgroup controller.
-+ */
-+ if (q->elevator) {
-+ ioc_clear_queue(q);
-+ elevator_exit(q, q->elevator);
-+ q->elevator = NULL;
-+ }
-+
-+ /*
-+ * Remove all references to @q from the block cgroup controller before
-+ * restoring @q->queue_lock to avoid that restoring this pointer causes
-+ * e.g. blkcg_print_blkgs() to crash.
-+ */
-+ blkcg_exit_queue(q);
-+
-+ /*
-+ * Since the cgroup code may dereference the @q->backing_dev_info
-+ * pointer, only decrease its reference count after having removed the
-+ * association with the block cgroup controller.
-+ */
-+ bdi_put(q->backing_dev_info);
-+
- if (q->mq_ops)
- blk_mq_free_queue(q);
- percpu_ref_exit(&q->q_usage_counter);
---- a/block/blk-sysfs.c
-+++ b/block/blk-sysfs.c
-@@ -798,13 +798,6 @@ static void __blk_release_queue(struct w
- if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags))
- blk_stat_remove_callback(q, q->poll_cb);
- blk_stat_free_callback(q->poll_cb);
-- bdi_put(q->backing_dev_info);
-- blkcg_exit_queue(q);
--
-- if (q->elevator) {
-- ioc_clear_queue(q);
-- elevator_exit(q, q->elevator);
-- }
-
- blk_free_queue_stats(q->stats);
-
--- /dev/null
+From foo@baz Wed May 2 08:55:03 PDT 2018
+From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
+Date: Mon, 8 Jan 2018 14:35:52 -0800
+Subject: rcu: Create RCU-specific workqueues with rescuers
+
+From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
+
+[ Upstream commit ad7c946b35ad455417fdd4bc0e17deda4011841b ]
+
+RCU's expedited grace periods can participate in out-of-memory deadlocks
+due to all available system_wq kthreads being blocked and there not being
+memory available to create more. This commit prevents such deadlocks
+by allocating an RCU-specific workqueue_struct at early boot time, and
+providing it with a rescuer to ensure forward progress. This uses the
+shiny new init_rescuer() function provided by Tejun (but indirectly).
+
+This commit also causes SRCU to use this new RCU-specific
+workqueue_struct. Note that SRCU's use of workqueues never blocks them
+waiting for readers, so this should be safe from a forward-progress
+viewpoint. Note that this moves SRCU from system_power_efficient_wq
+to a normal workqueue. In the unlikely event that this results in
+measurable degradation, a separate power-efficient workqueue will be
+creates for SRCU.
+
+Reported-by: Prateek Sood <prsood@codeaurora.org>
+Reported-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Acked-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/rcu/rcu.h | 1 +
+ kernel/rcu/srcutree.c | 8 +++-----
+ kernel/rcu/tree.c | 6 ++++++
+ kernel/rcu/tree_exp.h | 2 +-
+ 4 files changed, 11 insertions(+), 6 deletions(-)
+
+--- a/kernel/rcu/rcu.h
++++ b/kernel/rcu/rcu.h
+@@ -470,6 +470,7 @@ void show_rcu_gp_kthreads(void);
+ void rcu_force_quiescent_state(void);
+ void rcu_bh_force_quiescent_state(void);
+ void rcu_sched_force_quiescent_state(void);
++extern struct workqueue_struct *rcu_gp_wq;
+ #endif /* #else #ifdef CONFIG_TINY_RCU */
+
+ #ifdef CONFIG_RCU_NOCB_CPU
+--- a/kernel/rcu/srcutree.c
++++ b/kernel/rcu/srcutree.c
+@@ -492,8 +492,7 @@ static bool srcu_queue_delayed_work_on(i
+ */
+ static void srcu_schedule_cbs_sdp(struct srcu_data *sdp, unsigned long delay)
+ {
+- srcu_queue_delayed_work_on(sdp->cpu, system_power_efficient_wq,
+- &sdp->work, delay);
++ srcu_queue_delayed_work_on(sdp->cpu, rcu_gp_wq, &sdp->work, delay);
+ }
+
+ /*
+@@ -691,8 +690,7 @@ static void srcu_funnel_gp_start(struct
+ rcu_seq_state(sp->srcu_gp_seq) == SRCU_STATE_IDLE) {
+ WARN_ON_ONCE(ULONG_CMP_GE(sp->srcu_gp_seq, sp->srcu_gp_seq_needed));
+ srcu_gp_start(sp);
+- queue_delayed_work(system_power_efficient_wq, &sp->work,
+- srcu_get_delay(sp));
++ queue_delayed_work(rcu_gp_wq, &sp->work, srcu_get_delay(sp));
+ }
+ spin_unlock_irqrestore_rcu_node(sp, flags);
+ }
+@@ -1225,7 +1223,7 @@ static void srcu_reschedule(struct srcu_
+ spin_unlock_irq_rcu_node(sp);
+
+ if (pushgp)
+- queue_delayed_work(system_power_efficient_wq, &sp->work, delay);
++ queue_delayed_work(rcu_gp_wq, &sp->work, delay);
+ }
+
+ /*
+--- a/kernel/rcu/tree.c
++++ b/kernel/rcu/tree.c
+@@ -4193,6 +4193,8 @@ static void __init rcu_dump_rcu_node_tre
+ pr_cont("\n");
+ }
+
++struct workqueue_struct *rcu_gp_wq;
++
+ void __init rcu_init(void)
+ {
+ int cpu;
+@@ -4219,6 +4221,10 @@ void __init rcu_init(void)
+ rcu_cpu_starting(cpu);
+ rcutree_online_cpu(cpu);
+ }
++
++ /* Create workqueue for expedited GPs and for Tree SRCU. */
++ rcu_gp_wq = alloc_workqueue("rcu_gp", WQ_MEM_RECLAIM, 0);
++ WARN_ON(!rcu_gp_wq);
+ }
+
+ #include "tree_exp.h"
+--- a/kernel/rcu/tree_exp.h
++++ b/kernel/rcu/tree_exp.h
+@@ -606,7 +606,7 @@ static void _synchronize_rcu_expedited(s
+ rew.rew_rsp = rsp;
+ rew.rew_s = s;
+ INIT_WORK_ONSTACK(&rew.rew_work, wait_rcu_exp_gp);
+- schedule_work(&rew.rew_work);
++ queue_work(rcu_gp_wq, &rew.rew_work);
+ }
+
+ /* Wait for expedited grace period to complete. */
drm-omapdrm-dss-move-initialization-code-from-component-bind-to-probe.patch
arm-dts-dra71-evm-correct-evm_sd-regulator-max-voltage.patch
drm-amdgpu-disable-gfx-ring-and-disable-pq-wptr-in-hw_fini.patch
-block-fix-a-race-between-request-queue-removal-and-the-block-cgroup-controller.patch
drm-amdgpu-adjust-timeout-for-ib_ring_tests-v2.patch
serial-xuartps-fix-out-of-bounds-access-through-dt-alias.patch
serial-sh-sci-fix-out-of-bounds-access-through-dt-alias.patch
bluetooth-btusb-add-device-id-for-rtl8822be.patch
bluetooth-btusb-add-support-for-intel-bluetooth-device-22560.patch
kdb-make-mdr-command-repeat.patch
+xhci-show-what-usb-release-number-the-xhc-supports-from-protocol-capablity.patch
+rcu-create-rcu-specific-workqueues-with-rescuers.patch
--- /dev/null
+From foo@baz Wed May 2 08:53:15 PDT 2018
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+Date: Fri, 16 Mar 2018 16:33:06 +0200
+Subject: xhci: Show what USB release number the xHC supports from protocol capablity
+
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+
+[ Upstream commit 0ee78c101425aae681c631ba59c6ac7f44b1d83a ]
+
+xhci driver displays the supported xHC USB revision in a message during
+driver load:
+
+"Host supports USB 3.1 Enhanced SuperSpeed"
+
+Get the USB minor revision number from the xhci protocol capability.
+This will show the correct supported revisions for new USB 3.2 and later
+hosts
+
+Don't rely on the SBRN (serial bus revision number) register, it's often
+showing 0x30 (USB3.0) for hosts that support USB 3.1
+
+Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/xhci.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -4768,6 +4768,7 @@ int xhci_gen_setup(struct usb_hcd *hcd,
+ * quirks
+ */
+ struct device *dev = hcd->self.sysdev;
++ unsigned int minor_rev;
+ int retval;
+
+ /* Accept arbitrarily long scatter-gather lists */
+@@ -4795,12 +4796,19 @@ int xhci_gen_setup(struct usb_hcd *hcd,
+ */
+ hcd->has_tt = 1;
+ } else {
+- /* Some 3.1 hosts return sbrn 0x30, can't rely on sbrn alone */
+- if (xhci->sbrn == 0x31 || xhci->usb3_rhub.min_rev >= 1) {
+- xhci_info(xhci, "Host supports USB 3.1 Enhanced SuperSpeed\n");
++ /*
++ * Some 3.1 hosts return sbrn 0x30, use xhci supported protocol
++ * minor revision instead of sbrn
++ */
++ minor_rev = xhci->usb3_rhub.min_rev;
++ if (minor_rev) {
+ hcd->speed = HCD_USB31;
+ hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
+ }
++ xhci_info(xhci, "Host supports USB 3.%x %s SuperSpeed\n",
++ minor_rev,
++ minor_rev ? "Enhanced" : "");
++
+ /* xHCI private pointer was set in xhci_pci_probe for the second
+ * registered roothub.
+ */