Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1651883
| From | Sricharan R <sricharan@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v6 3/6] ACPI/IORT: Ignore all errors except EPROBE_DEFER |
| Date | 2017-05-27 15:50 +0200 |
| Message-ID | <tLKgp-4Gs-13@gated-at.bofh.it> (permalink) |
| References | <tLKgp-4Gs-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
While deferring the probe of IOMMU masters, xlate and
add_device callbacks called from iort_iommu_configure
can pass back error values like -ENODEV, which means
the IOMMU cannot be connected with that master for real
reasons. Before the IOMMU probe deferral, all such errors
were ignored. Now all those errors are propagated back,
killing the master's probe for such errors. Instead ignore
all the errors except EPROBE_DEFER, which is the only one
of concern and let the master work without IOMMU, thus
restoring the old behavior. Also make explicit that
acpi_dma_configure handles only -EPROBE_DEFER from
iort_iommu_configure.
Fixes: 5a1bb638d567 ("drivers: acpi: Handle IOMMU lookup failure with deferred probing or error")
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
---
drivers/acpi/arm64/iort.c | 6 ++++++
drivers/acpi/scan.c | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index c5fecf9..16e101f 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -782,6 +782,12 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
if (err)
ops = ERR_PTR(err);
+ /* Ignore all other errors apart from EPROBE_DEFER */
+ if (IS_ERR(ops) && (PTR_ERR(ops) != -EPROBE_DEFER)) {
+ dev_dbg(dev, "Adding to IOMMU failed: %ld\n", PTR_ERR(ops));
+ ops = NULL;
+ }
+
return ops;
}
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e39ec7b..3a10d757 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1371,8 +1371,8 @@ int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr)
iort_set_dma_mask(dev);
iommu = iort_iommu_configure(dev);
- if (IS_ERR(iommu))
- return PTR_ERR(iommu);
+ if (IS_ERR(iommu) && PTR_ERR(iommu) == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1);
/*
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6 1/6] iommu: of: Fix check for returning EPROBE_DEFER Sricharan R <sricharan@codeaurora.org> - 2017-05-27 15:50 +0200
[PATCH v6 5/6] ACPI/IORT: Move the check to get iommu_ops from translated fwspec Sricharan R <sricharan@codeaurora.org> - 2017-05-27 15:50 +0200
[PATCH v6 3/6] ACPI/IORT: Ignore all errors except EPROBE_DEFER Sricharan R <sricharan@codeaurora.org> - 2017-05-27 15:50 +0200
Re: [PATCH v6 3/6] ACPI/IORT: Ignore all errors except EPROBE_DEFER "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-05-27 21:30 +0200
Re: [PATCH v6 3/6] ACPI/IORT: Ignore all errors except EPROBE_DEFER Sricharan R <sricharan@codeaurora.org> - 2017-05-29 07:10 +0200
Re: [PATCH v6 3/6] ACPI/IORT: Ignore all errors except EPROBE_DEFER Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-05-30 11:10 +0200
[PATCH v6 6/6] arm: dma-mapping: Reset the device's dma_ops Sricharan R <sricharan@codeaurora.org> - 2017-05-27 15:50 +0200
[PATCH v6 4/6] ARM: dma-mapping: Don't tear down third-party mappings Sricharan R <sricharan@codeaurora.org> - 2017-05-27 15:50 +0200
[PATCH v6 2/6] iommu: of: Ignore all errors except EPROBE_DEFER Sricharan R <sricharan@codeaurora.org> - 2017-05-27 16:00 +0200
Re: [PATCH v6 1/6] iommu: of: Fix check for returning EPROBE_DEFER Joerg Roedel <joro@8bytes.org> - 2017-05-30 11:40 +0200
csiph-web