Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736519 > unrolled thread

[PATCH] iommu/of: Remove PCI host bridge node check

Started byRobin Murphy <robin.murphy@arm.com>
First post2017-09-21 12:20 +0200
Last post2017-09-22 12:10 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iommu/of: Remove PCI host bridge node check Robin Murphy <robin.murphy@arm.com> - 2017-09-21 12:20 +0200
    [PATCH v2] iommu/of: Remove PCI host bridge node check Robin Murphy <robin.murphy@arm.com> - 2017-09-21 12:30 +0200
      Re: [PATCH v2] iommu/of: Remove PCI host bridge node check Jean-Philippe Brucker <jean-philippe.brucker@arm.com> - 2017-09-21 13:10 +0200
      Re: [PATCH v2] iommu/of: Remove PCI host bridge node check Joerg Roedel <joro@8bytes.org> - 2017-09-22 11:00 +0200
        Re: [PATCH v2] iommu/of: Remove PCI host bridge node check Robin Murphy <robin.murphy@arm.com> - 2017-09-22 12:00 +0200
          Re: [PATCH v2] iommu/of: Remove PCI host bridge node check Joerg Roedel <joro@8bytes.org> - 2017-09-22 12:10 +0200

#1736519 — [PATCH] iommu/of: Remove PCI host bridge node check

FromRobin Murphy <robin.murphy@arm.com>
Date2017-09-21 12:20 +0200
Subject[PATCH] iommu/of: Remove PCI host bridge node check
Message-ID<us6Km-7Zx-7@gated-at.bofh.it>
of_pci_iommu_init() tries to be clever and stop its alias walk at the
device represented by master_np, in case of weird PCI topologies where
the bridge to the IOMMU and the rest of the system is not at the root.
It turns out this is a bit short-sighted, since there are plenty of
other callers of pci_for_each_dma_alias() which would also need the same
behaviour in that situation, and the only platform so far with such a
topology (Cavium ThunderX2) already solves it more generally via a PCI
quirk. As this check is effectively redundant, and returning a boolean
value as an int is a bit broken anyway, let's just get rid of it.

Reported-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/iommu/of_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index e60e3dba85a0..6f34dea8aef9 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -160,7 +160,7 @@ static int of_pci_iommu_init(struct pci_dev *pdev, u16 alias, void *data)
 	if (err)
 		return err;
 
-	return info->np == pdev->bus->dev.of_node;
+	return 0;
 }
 
 const struct iommu_ops *of_iommu_configure(struct device *dev,
-- 
2.13.4.dirty

[toc] | [next] | [standalone]


#1736522 — [PATCH v2] iommu/of: Remove PCI host bridge node check

FromRobin Murphy <robin.murphy@arm.com>
Date2017-09-21 12:30 +0200
Subject[PATCH v2] iommu/of: Remove PCI host bridge node check
Message-ID<us6U2-83f-3@gated-at.bofh.it>
In reply to#1736519
of_pci_iommu_init() tries to be clever and stop its alias walk at the
device represented by master_np, in case of weird PCI topologies where
the bridge to the IOMMU and the rest of the system is not at the root.
It turns out this is a bit short-sighted, since there are plenty of
other callers of pci_for_each_dma_alias() which would also need the same
behaviour in that situation, and the only platform so far with such a
topology (Cavium ThunderX2) already solves it more generally via a PCI
quirk. As this check is effectively redundant, and returning a boolean
value as an int is a bit broken anyway, let's just get rid of it.

Reported-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---

Ugh, I'm really failing to spot the obvious today...

 drivers/iommu/of_iommu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index e60e3dba85a0..50947ebb6d17 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -157,10 +157,7 @@ static int of_pci_iommu_init(struct pci_dev *pdev, u16 alias, void *data)
 
 	err = of_iommu_xlate(info->dev, &iommu_spec);
 	of_node_put(iommu_spec.np);
-	if (err)
-		return err;
-
-	return info->np == pdev->bus->dev.of_node;
+	return err;
 }
 
 const struct iommu_ops *of_iommu_configure(struct device *dev,
-- 
2.13.4.dirty

[toc] | [prev] | [next] | [standalone]


#1736538 — Re: [PATCH v2] iommu/of: Remove PCI host bridge node check

FromJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Date2017-09-21 13:10 +0200
SubjectRe: [PATCH v2] iommu/of: Remove PCI host bridge node check
Message-ID<us7wK-cK-5@gated-at.bofh.it>
In reply to#1736522
On 21/09/17 11:20, Robin Murphy wrote:
> of_pci_iommu_init() tries to be clever and stop its alias walk at the
> device represented by master_np, in case of weird PCI topologies where
> the bridge to the IOMMU and the rest of the system is not at the root.
> It turns out this is a bit short-sighted, since there are plenty of
> other callers of pci_for_each_dma_alias() which would also need the same
> behaviour in that situation, and the only platform so far with such a
> topology (Cavium ThunderX2) already solves it more generally via a PCI
> quirk. As this check is effectively redundant, and returning a boolean
> value as an int is a bit broken anyway, let's just get rid of it.
> 
> Reported-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>

This fixes the 4.14-rc1 issue I had with PCI probing on the FastModel

Tested-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>

> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
> 
> Ugh, I'm really failing to spot the obvious today...
> 
>  drivers/iommu/of_iommu.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
> index e60e3dba85a0..50947ebb6d17 100644
> --- a/drivers/iommu/of_iommu.c
> +++ b/drivers/iommu/of_iommu.c
> @@ -157,10 +157,7 @@ static int of_pci_iommu_init(struct pci_dev *pdev, u16 alias, void *data)
>  
>  	err = of_iommu_xlate(info->dev, &iommu_spec);
>  	of_node_put(iommu_spec.np);
> -	if (err)
> -		return err;
> -
> -	return info->np == pdev->bus->dev.of_node;
> +	return err;
>  }
>  
>  const struct iommu_ops *of_iommu_configure(struct device *dev,
> 

[toc] | [prev] | [next] | [standalone]


#1737292 — Re: [PATCH v2] iommu/of: Remove PCI host bridge node check

FromJoerg Roedel <joro@8bytes.org>
Date2017-09-22 11:00 +0200
SubjectRe: [PATCH v2] iommu/of: Remove PCI host bridge node check
Message-ID<usrYu-3Z9-11@gated-at.bofh.it>
In reply to#1736522
Hey Robin,

On Thu, Sep 21, 2017 at 11:20:58AM +0100, Robin Murphy wrote:
> of_pci_iommu_init() tries to be clever and stop its alias walk at the
> device represented by master_np, in case of weird PCI topologies where
> the bridge to the IOMMU and the rest of the system is not at the root.
> It turns out this is a bit short-sighted, since there are plenty of
> other callers of pci_for_each_dma_alias() which would also need the same
> behaviour in that situation, and the only platform so far with such a
> topology (Cavium ThunderX2) already solves it more generally via a PCI
> quirk. As this check is effectively redundant, and returning a boolean
> value as an int is a bit broken anyway, let's just get rid of it.
> 
> Reported-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Can you send me a Fixes: tag for this please? No need to resend the
whole patch, I just need the tag.

Thanks,

	Joerg

[toc] | [prev] | [next] | [standalone]


#1737350 — Re: [PATCH v2] iommu/of: Remove PCI host bridge node check

FromRobin Murphy <robin.murphy@arm.com>
Date2017-09-22 12:00 +0200
SubjectRe: [PATCH v2] iommu/of: Remove PCI host bridge node check
Message-ID<ussUx-4xr-3@gated-at.bofh.it>
In reply to#1737292
On 22/09/17 09:56, Joerg Roedel wrote:
> Hey Robin,
> 
> On Thu, Sep 21, 2017 at 11:20:58AM +0100, Robin Murphy wrote:
>> of_pci_iommu_init() tries to be clever and stop its alias walk at the
>> device represented by master_np, in case of weird PCI topologies where
>> the bridge to the IOMMU and the rest of the system is not at the root.
>> It turns out this is a bit short-sighted, since there are plenty of
>> other callers of pci_for_each_dma_alias() which would also need the same
>> behaviour in that situation, and the only platform so far with such a
>> topology (Cavium ThunderX2) already solves it more generally via a PCI
>> quirk. As this check is effectively redundant, and returning a boolean
>> value as an int is a bit broken anyway, let's just get rid of it.
>>
>> Reported-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> 
> Can you send me a Fixes: tag for this please? No need to resend the
> whole patch, I just need the tag.

Sure, I'd go for:

Fixes: d87beb749281 ("iommu/of: Handle PCI aliases properly")

The check itself originally dates back to b996444cf35e ("iommu/of:
Handle iommu-map property for PCI") but it's really not worth
backporting past the above refactoring - it's only with da4b02750a9f
("iommu/of: Fix of_iommu_configure() for disabled IOMMUs") in 4.14-rc1
that it started to have noticeable ill effects.

Thanks,
Robin.

[toc] | [prev] | [next] | [standalone]


#1737368 — Re: [PATCH v2] iommu/of: Remove PCI host bridge node check

FromJoerg Roedel <joro@8bytes.org>
Date2017-09-22 12:10 +0200
SubjectRe: [PATCH v2] iommu/of: Remove PCI host bridge node check
Message-ID<ust4e-4Qp-17@gated-at.bofh.it>
In reply to#1737350
On Fri, Sep 22, 2017 at 10:51:30AM +0100, Robin Murphy wrote:
> 
> Fixes: d87beb749281 ("iommu/of: Handle PCI aliases properly")
> 
> The check itself originally dates back to b996444cf35e ("iommu/of:
> Handle iommu-map property for PCI") but it's really not worth
> backporting past the above refactoring - it's only with da4b02750a9f
> ("iommu/of: Fix of_iommu_configure() for disabled IOMMUs") in 4.14-rc1
> that it started to have noticeable ill effects.

Thanks, applied to iommu/fixes.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web