]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 May 2020 20:34:17 +0000 (22:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 May 2020 20:34:17 +0000 (22:34 +0200)
added patches:
mfd-intel-lpss-use-devm_ioremap_uc-for-mmio.patch
revert-software-node-simplify-software_node_release-function.patch

queue-5.4/mfd-intel-lpss-use-devm_ioremap_uc-for-mmio.patch [new file with mode: 0644]
queue-5.4/revert-software-node-simplify-software_node_release-function.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/mfd-intel-lpss-use-devm_ioremap_uc-for-mmio.patch b/queue-5.4/mfd-intel-lpss-use-devm_ioremap_uc-for-mmio.patch
new file mode 100644 (file)
index 0000000..ed03a5a
--- /dev/null
@@ -0,0 +1,49 @@
+From a8ff78f7f773142eb8a8befe5a95dd6858ebd635 Mon Sep 17 00:00:00 2001
+From: Tuowen Zhao <ztuowen@gmail.com>
+Date: Wed, 16 Oct 2019 15:06:29 -0600
+Subject: mfd: intel-lpss: Use devm_ioremap_uc for MMIO
+
+From: Tuowen Zhao <ztuowen@gmail.com>
+
+commit a8ff78f7f773142eb8a8befe5a95dd6858ebd635 upstream.
+
+Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci
+in MTRR. This will cause the system to hang during boot. If possible,
+this bug could be corrected with a firmware update.
+
+This patch use devm_ioremap_uc to overwrite/ignore the MTRR settings
+by forcing the use of strongly uncachable pages for intel-lpss.
+
+The BIOS bug is present on Dell XPS 13 7390 2-in-1:
+
+[    0.001734]   5 base 4000000000 mask 6000000000 write-combining
+
+4000000000-7fffffffff : PCI Bus 0000:00
+  4000000000-400fffffff : 0000:00:02.0 (i915)
+  4010000000-4010000fff : 0000:00:15.0 (intel-lpss-pci)
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=203485
+Cc: <stable@vger.kernel.org> # v4.19+
+Tested-by: AceLan Kao <acelan.kao@canonical.com>
+Signed-off-by: Tuowen Zhao <ztuowen@gmail.com>
+Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Tested-by: Roman Gilg <subdiff@gmail.com>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/intel-lpss.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mfd/intel-lpss.c
++++ b/drivers/mfd/intel-lpss.c
+@@ -384,7 +384,7 @@ int intel_lpss_probe(struct device *dev,
+       if (!lpss)
+               return -ENOMEM;
+-      lpss->priv = devm_ioremap(dev, info->mem->start + LPSS_PRIV_OFFSET,
++      lpss->priv = devm_ioremap_uc(dev, info->mem->start + LPSS_PRIV_OFFSET,
+                                 LPSS_PRIV_SIZE);
+       if (!lpss->priv)
+               return -ENOMEM;
diff --git a/queue-5.4/revert-software-node-simplify-software_node_release-function.patch b/queue-5.4/revert-software-node-simplify-software_node_release-function.patch
new file mode 100644 (file)
index 0000000..b9bd91a
--- /dev/null
@@ -0,0 +1,92 @@
+From 7589238a8cf37331607c3222a64ac3140b29532d Mon Sep 17 00:00:00 2001
+From: Brendan Higgins <brendanhiggins@google.com>
+Date: Thu, 27 Feb 2020 16:00:01 -0800
+Subject: Revert "software node: Simplify software_node_release() function"
+
+From: Brendan Higgins <brendanhiggins@google.com>
+
+commit 7589238a8cf37331607c3222a64ac3140b29532d upstream.
+
+This reverts commit 3df85a1ae51f6b256982fe9d17c2dc5bfb4cc402.
+
+The reverted commit says "It's possible to release the node ID
+immediately when fwnode_remove_software_node() is called, no need to
+wait for software_node_release() with that." However, releasing the node
+ID before waiting for software_node_release() to be called causes the
+node ID to be released before the kobject and the underlying sysfs
+entry; this means there is a period of time where a sysfs entry exists
+that is associated with an unallocated node ID.
+
+Once consequence of this is that there is a race condition where it is
+possible to call fwnode_create_software_node() with no parent node
+specified (NULL) and have it fail with -EEXIST because the node ID that
+was assigned is still associated with a stale sysfs entry that hasn't
+been cleaned up yet.
+
+Although it is difficult to reproduce this race condition under normal
+conditions, it can be deterministically reproduced with the following
+minconfig on UML:
+
+CONFIG_KUNIT_DRIVER_PE_TEST=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_OBJECTS=y
+CONFIG_DEBUG_OBJECTS_TIMERS=y
+CONFIG_DEBUG_KOBJECT_RELEASE=y
+CONFIG_KUNIT=y
+
+Running the tests with this configuration causes the following failure:
+
+<snip>
+kobject: 'node0' ((____ptrval____)): kobject_release, parent (____ptrval____) (delayed 400)
+       ok 1 - pe_test_uints
+sysfs: cannot create duplicate filename '/kernel/software_nodes/node0'
+CPU: 0 PID: 28 Comm: kunit_try_catch Not tainted 5.6.0-rc3-next-20200227 #14
+<snip>
+kobject_add_internal failed for node0 with -EEXIST, don't try to register things with the same name in the same directory.
+kobject: 'node0' ((____ptrval____)): kobject_release, parent (____ptrval____) (delayed 100)
+       # pe_test_uint_arrays: ASSERTION FAILED at drivers/base/test/property-entry-test.c:123
+       Expected node is not error, but is: -17
+       not ok 2 - pe_test_uint_arrays
+<snip>
+
+Reported-by: Heidi Fahim <heidifahim@google.com>
+Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
+Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Cc: 5.3+ <stable@vger.kernel.org> # 5.3+
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/base/swnode.c |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+--- a/drivers/base/swnode.c
++++ b/drivers/base/swnode.c
+@@ -679,6 +679,13 @@ static void software_node_release(struct
+ {
+       struct swnode *swnode = kobj_to_swnode(kobj);
++      if (swnode->parent) {
++              ida_simple_remove(&swnode->parent->child_ids, swnode->id);
++              list_del(&swnode->entry);
++      } else {
++              ida_simple_remove(&swnode_root_ids, swnode->id);
++      }
++
+       if (swnode->allocated) {
+               property_entries_free(swnode->node->properties);
+               kfree(swnode->node);
+@@ -844,13 +851,6 @@ void fwnode_remove_software_node(struct
+       if (!swnode)
+               return;
+-      if (swnode->parent) {
+-              ida_simple_remove(&swnode->parent->child_ids, swnode->id);
+-              list_del(&swnode->entry);
+-      } else {
+-              ida_simple_remove(&swnode_root_ids, swnode->id);
+-      }
+-
+       kobject_put(&swnode->kobj);
+ }
+ EXPORT_SYMBOL_GPL(fwnode_remove_software_node);
index 6b6f52299f59b164bbe787d4390d1f35b9d17917..f2de96f8b66f1835973c034557ae59ea437e6b32 100644 (file)
@@ -30,3 +30,5 @@ net-systemport-suppress-warnings-on-failed-rx-skb-al.patch
 drm-i915-extend-wadisabledarbfclkgating-to-icl-ehl-tgl.patch
 sctp-fix-shutdown-ctsn-ack-in-the-peer-restart-case.patch
 drm-amdgpu-fix-oops-when-pp_funcs-is-unset-in-acpi-event.patch
+revert-software-node-simplify-software_node_release-function.patch
+mfd-intel-lpss-use-devm_ioremap_uc-for-mmio.patch