linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] bus: fsl-mc: don't assume an iommu is always present
@ 2020-09-16 10:52 Laurentiu Tudor
  2020-09-16 10:52 ` [PATCH v2 2/2] bus: fsl-mc: MC control registers are not always available Laurentiu Tudor
  0 siblings, 1 reply; 2+ messages in thread
From: Laurentiu Tudor @ 2020-09-16 10:52 UTC (permalink / raw)
  To: linux-kernel, gregkh
  Cc: diana.craciun, ioana.ciornei, anda-alexandra.dorneanu, Laurentiu Tudor

There are certain scenarios where an iommu is not present, e.g.
booting in a VM. Let's support these scenarios by dropping the
check.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
Changes in v2:
 - none

 drivers/bus/fsl-mc/fsl-mc-bus.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index b69794e7364d..b0449df117e8 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -908,9 +908,6 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 	u32 mc_portal_size, mc_stream_id;
 	struct resource *plat_res;
 
-	if (!iommu_present(&fsl_mc_bus_type))
-		return -EPROBE_DEFER;
-
 	mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL);
 	if (!mc)
 		return -ENOMEM;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2 2/2] bus: fsl-mc: MC control registers are not always available
  2020-09-16 10:52 [PATCH v2 1/2] bus: fsl-mc: don't assume an iommu is always present Laurentiu Tudor
@ 2020-09-16 10:52 ` Laurentiu Tudor
  0 siblings, 0 replies; 2+ messages in thread
From: Laurentiu Tudor @ 2020-09-16 10:52 UTC (permalink / raw)
  To: linux-kernel, gregkh
  Cc: diana.craciun, ioana.ciornei, anda-alexandra.dorneanu, Laurentiu Tudor

As per the device tree binding, in certain scenarios such as
virtualization scenarios, the MC control registers are not
available so don't error out if they are not present.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
Changes in v2:
 - dropped useless NULL check
 - restore IS_ERR() usage

 drivers/bus/fsl-mc/fsl-mc-bus.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index b0449df117e8..b4177eccbf50 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -916,10 +916,9 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 
 	plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	mc->fsl_mc_regs = devm_ioremap_resource(&pdev->dev, plat_res);
-	if (IS_ERR(mc->fsl_mc_regs))
-		return PTR_ERR(mc->fsl_mc_regs);
 
-	if (IS_ENABLED(CONFIG_ACPI) && !dev_of_node(&pdev->dev)) {
+	if (!IS_ERR(mc->fsl_mc_regs) && IS_ENABLED(CONFIG_ACPI) &&
+	    !dev_of_node(&pdev->dev)) {
 		mc_stream_id = readl(mc->fsl_mc_regs + FSL_MC_FAPR);
 		/*
 		 * HW ORs the PL and BMT bit, places the result in bit 15 of
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-16 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 10:52 [PATCH v2 1/2] bus: fsl-mc: don't assume an iommu is always present Laurentiu Tudor
2020-09-16 10:52 ` [PATCH v2 2/2] bus: fsl-mc: MC control registers are not always available Laurentiu Tudor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).