From: Greg Kroah-Hartman Date: Sat, 11 Apr 2020 11:52:34 +0000 (+0200) Subject: 5.5-stable patches X-Git-Tag: v4.4.219~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1747cef4633ec03ef6d925f54631b51ef246576f;p=thirdparty%2Fkernel%2Fstable-queue.git 5.5-stable patches added patches: driver-core-reevaluate-dev-links.need_for_probe-as-suppliers-are-added.patch iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch --- diff --git a/queue-5.5/driver-core-reevaluate-dev-links.need_for_probe-as-suppliers-are-added.patch b/queue-5.5/driver-core-reevaluate-dev-links.need_for_probe-as-suppliers-are-added.patch new file mode 100644 index 00000000000..2b6d35b8185 --- /dev/null +++ b/queue-5.5/driver-core-reevaluate-dev-links.need_for_probe-as-suppliers-are-added.patch @@ -0,0 +1,66 @@ +From 1745d299af5b373abad08fa29bff0d31dc6aff21 Mon Sep 17 00:00:00 2001 +From: Saravana Kannan +Date: Fri, 21 Feb 2020 17:40:34 -0800 +Subject: driver core: Reevaluate dev->links.need_for_probe as suppliers are added + +From: Saravana Kannan + +commit 1745d299af5b373abad08fa29bff0d31dc6aff21 upstream. + +A previous patch 03324507e66c ("driver core: Allow +fwnode_operations.add_links to differentiate errors") forgot to update +all call sites to fwnode_operations.add_links. This patch fixes that. + +Legend: +-> Denotes RHS is an optional/potential supplier for LHS +=> Denotes RHS is a mandatory supplier for LHS + +Example: + +Device A => Device X +Device A -> Device Y + +Before this patch: +1. Device A is added. +2. Device A is marked as waiting for mandatory suppliers +3. Device X is added +4. Device A is left marked as waiting for mandatory suppliers + +Step 4 is wrong since all mandatory suppliers of Device A have been +added. + +After this patch: +1. Device A is added. +2. Device A is marked as waiting for mandatory suppliers +3. Device X is added +4. Device A is no longer considered as waiting for mandatory suppliers + +This is the correct behavior. + +Fixes: 03324507e66c ("driver core: Allow fwnode_operations.add_links to differentiate errors") +Signed-off-by: Saravana Kannan +Link: https://lore.kernel.org/r/20200222014038.180923-2-saravanak@google.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/core.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -523,9 +523,13 @@ static void device_link_add_missing_supp + + mutex_lock(&wfs_lock); + list_for_each_entry_safe(dev, tmp, &wait_for_suppliers, +- links.needs_suppliers) +- if (!fwnode_call_int_op(dev->fwnode, add_links, dev)) ++ links.needs_suppliers) { ++ int ret = fwnode_call_int_op(dev->fwnode, add_links, dev); ++ if (!ret) + list_del_init(&dev->links.needs_suppliers); ++ else if (ret != -ENODEV) ++ dev->links.need_for_probe = false; ++ } + mutex_unlock(&wfs_lock); + } + diff --git a/queue-5.5/iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch b/queue-5.5/iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch new file mode 100644 index 00000000000..a647606b209 --- /dev/null +++ b/queue-5.5/iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch @@ -0,0 +1,72 @@ +From 9235cb13d7d17baba0b3a9277381258361e95c16 Mon Sep 17 00:00:00 2001 +From: Lu Baolu +Date: Wed, 15 Jan 2020 11:03:58 +0800 +Subject: iommu/vt-d: Allow devices with RMRRs to use identity domain + +From: Lu Baolu + +commit 9235cb13d7d17baba0b3a9277381258361e95c16 upstream. + +Since commit ea2447f700cab ("intel-iommu: Prevent devices with +RMRRs from being placed into SI Domain"), the Intel IOMMU driver +doesn't allow any devices with RMRR locked to use the identity +domain. This was added to to fix the issue where the RMRR info +for devices being placed in and out of the identity domain gets +lost. This identity maps all RMRRs when setting up the identity +domain, so that devices with RMRRs could also use it. + +Signed-off-by: Lu Baolu +Signed-off-by: Joerg Roedel +Cc: Alan Stern +Cc: John Donnelly +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iommu/intel-iommu.c | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +--- a/drivers/iommu/intel-iommu.c ++++ b/drivers/iommu/intel-iommu.c +@@ -2767,10 +2767,8 @@ static int __init si_domain_init(int hw) + } + + /* +- * Normally we use DMA domains for devices which have RMRRs. But we +- * loose this requirement for graphic and usb devices. Identity map +- * the RMRRs for graphic and USB devices so that they could use the +- * si_domain. ++ * Identity map the RMRRs so that devices with RMRRs could also use ++ * the si_domain. + */ + for_each_rmrr_units(rmrr) { + for_each_active_dev_scope(rmrr->devices, rmrr->devices_cnt, +@@ -2778,9 +2776,6 @@ static int __init si_domain_init(int hw) + unsigned long long start = rmrr->base_address; + unsigned long long end = rmrr->end_address; + +- if (device_is_rmrr_locked(dev)) +- continue; +- + if (WARN_ON(end < start || + end >> agaw_to_width(si_domain->agaw))) + continue; +@@ -2919,9 +2914,6 @@ static int device_def_domain_type(struct + if (dev_is_pci(dev)) { + struct pci_dev *pdev = to_pci_dev(dev); + +- if (device_is_rmrr_locked(dev)) +- return IOMMU_DOMAIN_DMA; +- + /* + * Prevent any device marked as untrusted from getting + * placed into the statically identity mapping domain. +@@ -2959,9 +2951,6 @@ static int device_def_domain_type(struct + return IOMMU_DOMAIN_DMA; + } else if (pci_pcie_type(pdev) == PCI_EXP_TYPE_PCI_BRIDGE) + return IOMMU_DOMAIN_DMA; +- } else { +- if (device_has_rmrr(dev)) +- return IOMMU_DOMAIN_DMA; + } + + return (iommu_identity_mapping & IDENTMAP_ALL) ? diff --git a/queue-5.5/series b/queue-5.5/series index 0a052632b38..1867846ab98 100644 --- a/queue-5.5/series +++ b/queue-5.5/series @@ -27,6 +27,8 @@ bluetooth-rfcomm-fix-odebug-bug-in-rfcomm_dev_ioctl.patch rdma-cm-update-num_paths-in-cma_resolve_iboe_route-error-flow.patch blk-mq-keep-set-nr_hw_queues-and-set-map.nr_queues-in-sync.patch fbcon-fix-null-ptr-deref-in-fbcon_switch.patch +driver-core-reevaluate-dev-links.need_for_probe-as-suppliers-are-added.patch +iommu-vt-d-allow-devices-with-rmrrs-to-use-identity-domain.patch tools-accounting-getdelays.c-fix-netlink-attribute-length.patch hwrng-imx-rngc-fix-an-error-path.patch acpi-pm-add-acpi_register_wakeup_handler.patch