From: Greg Kroah-Hartman Date: Mon, 16 Mar 2020 11:00:46 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.19.111~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa37fc341e44b3c42975e609cadc2217832f5876;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch --- diff --git a/queue-4.9/drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch b/queue-4.9/drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch new file mode 100644 index 00000000000..4ecbb5fbac8 --- /dev/null +++ b/queue-4.9/drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch @@ -0,0 +1,34 @@ +From d785476c608c621b345dd9396e8b21e90375cb0e Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Fri, 8 Nov 2019 14:45:27 +0000 +Subject: drm/amd/display: remove duplicated assignment to grph_obj_type + +From: Colin Ian King + +commit d785476c608c621b345dd9396e8b21e90375cb0e upstream. + +Variable grph_obj_type is being assigned twice, one of these is +redundant so remove it. + +Addresses-Coverity: ("Evaluation order violation") +Signed-off-by: Colin Ian King +Signed-off-by: Alex Deucher +Cc: +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +@@ -363,8 +363,7 @@ bool amdgpu_atombios_get_connector_info_ + router.ddc_valid = false; + router.cd_valid = false; + for (j = 0; j < ((le16_to_cpu(path->usSize) - 8) / 2); j++) { +- uint8_t grph_obj_type= +- grph_obj_type = ++ uint8_t grph_obj_type = + (le16_to_cpu(path->usGraphicObjIds[j]) & + OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; + diff --git a/queue-4.9/iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch b/queue-4.9/iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch new file mode 100644 index 00000000000..b316e44166f --- /dev/null +++ b/queue-4.9/iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch @@ -0,0 +1,53 @@ +From 81ee85d0462410de8eeeec1b9761941fd6ed8c7b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 9 Mar 2020 19:25:10 +0100 +Subject: iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint + +From: Hans de Goede + +commit 81ee85d0462410de8eeeec1b9761941fd6ed8c7b upstream. + +Quoting from the comment describing the WARN functions in +include/asm-generic/bug.h: + + * WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report + * significant kernel issues that need prompt attention if they should ever + * appear at runtime. + * + * Do not use these macros when checking for invalid external inputs + +The (buggy) firmware tables which the dmar code was calling WARN_TAINT +for really are invalid external inputs. They are not under the kernel's +control and the issues in them cannot be fixed by a kernel update. +So logging a backtrace, which invites bug reports to be filed about this, +is not helpful. + +Fixes: 556ab45f9a77 ("ioat2: catch and recover from broken vtd configurations v6") +Signed-off-by: Hans de Goede +Acked-by: Lu Baolu +Link: https://lore.kernel.org/r/20200309182510.373875-1-hdegoede@redhat.com +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=701847 +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iommu/intel-iommu.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/iommu/intel-iommu.c ++++ b/drivers/iommu/intel-iommu.c +@@ -4085,10 +4085,11 @@ static void quirk_ioat_snb_local_iommu(s + + /* we know that the this iommu should be at offset 0xa000 from vtbar */ + drhd = dmar_find_matched_drhd_unit(pdev); +- if (WARN_TAINT_ONCE(!drhd || drhd->reg_base_addr - vtbar != 0xa000, +- TAINT_FIRMWARE_WORKAROUND, +- "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n")) ++ if (!drhd || drhd->reg_base_addr - vtbar != 0xa000) { ++ pr_warn_once(FW_BUG "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n"); ++ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); + pdev->dev.archdata.iommu = DUMMY_DEVICE_DOMAIN_INFO; ++ } + } + DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_SNB, quirk_ioat_snb_local_iommu); + diff --git a/queue-4.9/series b/queue-4.9/series index c6cf38593f7..f574b968716 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -28,3 +28,7 @@ slip-make-slhc_compress-more-robust-against-malicious-packets.patch bonding-alb-make-sure-arp-header-is-pulled-before-accessing-it.patch cgroup-memcg-net-do-not-associate-sock-with-unrelated-cgroup.patch net-phy-fix-mdio-bus-pm-phy-resuming.patch +virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch +iommu-vt-d-quirk_ioat_snb_local_iommu-replace-warn_taint-with-pr_warn-add_taint.patch +workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch +drm-amd-display-remove-duplicated-assignment-to-grph_obj_type.patch diff --git a/queue-4.9/virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch b/queue-4.9/virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch new file mode 100644 index 00000000000..2a4251ce798 --- /dev/null +++ b/queue-4.9/virtio-blk-fix-hw_queue-stopped-on-arbitrary-error.patch @@ -0,0 +1,51 @@ +From f5f6b95c72f7f8bb46eace8c5306c752d0133daa Mon Sep 17 00:00:00 2001 +From: Halil Pasic +Date: Thu, 13 Feb 2020 13:37:27 +0100 +Subject: virtio-blk: fix hw_queue stopped on arbitrary error + +From: Halil Pasic + +commit f5f6b95c72f7f8bb46eace8c5306c752d0133daa upstream. + +Since nobody else is going to restart our hw_queue for us, the +blk_mq_start_stopped_hw_queues() is in virtblk_done() is not sufficient +necessarily sufficient to ensure that the queue will get started again. +In case of global resource outage (-ENOMEM because mapping failure, +because of swiotlb full) our virtqueue may be empty and we can get +stuck with a stopped hw_queue. + +Let us not stop the queue on arbitrary errors, but only on -EONSPC which +indicates a full virtqueue, where the hw_queue is guaranteed to get +started by virtblk_done() before when it makes sense to carry on +submitting requests. Let us also remove a stale comment. + +Signed-off-by: Halil Pasic +Cc: Jens Axboe +Fixes: f7728002c1c7 ("virtio_ring: fix return code on DMA mapping fails") +Link: https://lore.kernel.org/r/20200213123728.61216-2-pasic@linux.ibm.com +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/virtio_blk.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/block/virtio_blk.c ++++ b/drivers/block/virtio_blk.c +@@ -215,10 +215,12 @@ static int virtio_queue_rq(struct blk_mq + err = __virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num); + if (err) { + virtqueue_kick(vblk->vqs[qid].vq); +- blk_mq_stop_hw_queue(hctx); ++ /* Don't stop the queue if -ENOMEM: we may have failed to ++ * bounce the buffer due to global resource outage. ++ */ ++ if (err == -ENOSPC) ++ blk_mq_stop_hw_queue(hctx); + spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags); +- /* Out of mem doesn't actually happen, since we fall back +- * to direct descriptors */ + if (err == -ENOMEM || err == -ENOSPC) + return BLK_MQ_RQ_QUEUE_BUSY; + return BLK_MQ_RQ_QUEUE_ERROR; diff --git a/queue-4.9/workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch b/queue-4.9/workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch new file mode 100644 index 00000000000..8d9a1f9da53 --- /dev/null +++ b/queue-4.9/workqueue-don-t-use-wq_select_unbound_cpu-for-bound-works.patch @@ -0,0 +1,61 @@ +From aa202f1f56960c60e7befaa0f49c72b8fa11b0a8 Mon Sep 17 00:00:00 2001 +From: Hillf Danton +Date: Fri, 24 Jan 2020 20:14:45 -0500 +Subject: workqueue: don't use wq_select_unbound_cpu() for bound works + +From: Hillf Danton + +commit aa202f1f56960c60e7befaa0f49c72b8fa11b0a8 upstream. + +wq_select_unbound_cpu() is designed for unbound workqueues only, but +it's wrongly called when using a bound workqueue too. + +Fixing this ensures work queued to a bound workqueue with +cpu=WORK_CPU_UNBOUND always runs on the local CPU. + +Before, that would happen only if wq_unbound_cpumask happened to include +it (likely almost always the case), or was empty, or we got lucky with +forced round-robin placement. So restricting +/sys/devices/virtual/workqueue/cpumask to a small subset of a machine's +CPUs would cause some bound work items to run unexpectedly there. + +Fixes: ef557180447f ("workqueue: schedule WORK_CPU_UNBOUND work on wq_unbound_cpumask CPUs") +Cc: stable@vger.kernel.org # v4.5+ +Signed-off-by: Hillf Danton +[dj: massage changelog] +Signed-off-by: Daniel Jordan +Cc: Tejun Heo +Cc: Lai Jiangshan +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/workqueue.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -1384,14 +1384,16 @@ static void __queue_work(int cpu, struct + WARN_ON_ONCE(!is_chained_work(wq))) + return; + retry: +- if (req_cpu == WORK_CPU_UNBOUND) +- cpu = wq_select_unbound_cpu(raw_smp_processor_id()); +- + /* pwq which will be used unless @work is executing elsewhere */ +- if (!(wq->flags & WQ_UNBOUND)) +- pwq = per_cpu_ptr(wq->cpu_pwqs, cpu); +- else ++ if (wq->flags & WQ_UNBOUND) { ++ if (req_cpu == WORK_CPU_UNBOUND) ++ cpu = wq_select_unbound_cpu(raw_smp_processor_id()); + pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu)); ++ } else { ++ if (req_cpu == WORK_CPU_UNBOUND) ++ cpu = raw_smp_processor_id(); ++ pwq = per_cpu_ptr(wq->cpu_pwqs, cpu); ++ } + + /* + * If @work was previously on a different pool, it might still be