Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions drivers/thunderbolt/apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iommu.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/mutex.h>
Expand Down Expand Up @@ -2052,6 +2053,20 @@ static int apple_nhi_probe(struct platform_device *pdev)
goto err;
}

/*
* The rings must never run untranslated. The DART is populated with
* the NHI, so it is normally bound first; but once the driver core
* has stopped waiting for missing suppliers (DART driver not loaded
* yet), the NHI would probe without its IOMMU. Defer, and fail the
* ACIO start now instead of letting it wait for the NHI to time out.
*/
if (of_property_present(pdev->dev.of_node, "iommus") &&
!device_iommu_mapped(&pdev->dev)) {
dev_warn(&pdev->dev, "DART not bound yet, not starting the NHI\n");
ret = -EPROBE_DEFER;
goto err;
}

anhi = devm_kzalloc(&pdev->dev, sizeof(*anhi), GFP_KERNEL);
if (!anhi) {
ret = -ENOMEM;
Expand Down
Loading