linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
@ 2021-01-19 10:52 Yong Wu
  2021-01-27 13:00 ` Paul Kocialkowski
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yong Wu @ 2021-01-19 10:52 UTC (permalink / raw)
  To: Joerg Roedel, Rob Herring, Matthias Brugger, Will Deacon, Robin Murphy
  Cc: Krzysztof Kozlowski, Paul Kocialkowski, Tomasz Figa,
	linux-mediatek, srv_heupstream, devicetree, linux-kernel,
	linux-arm-kernel, iommu, Nicolas Boichat, Yong Wu, Frank Rowand

The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
supplanting dma_pfn_offset") always update dma_range_map even though it was
already set, like in the sunxi_mbus driver. the issue is reported at [1].
This patch avoid this(Updating it only when dev has valid dma-ranges).

Meanwhile, dma_range_map contains the devices' dma_ranges information,
This patch moves dma_range_map before of_iommu_configure. The iommu
driver may need to know the dma_address requirements of its iommu
consumer devices.

[1] https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/

CC: Rob Herring <robh+dt@kernel.org>
CC: Frank Rowand <frowand.list@gmail.com>
Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset"),
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
 drivers/of/device.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/of/device.c b/drivers/of/device.c
index aedfaaafd3e7..1122daa8e273 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
 	mask = DMA_BIT_MASK(ilog2(end) + 1);
 	dev->coherent_dma_mask &= mask;
 	*dev->dma_mask &= mask;
-	/* ...but only set bus limit if we found valid dma-ranges earlier */
-	if (!ret)
+	/* ...but only set bus limit and range map if we found valid dma-ranges earlier */
+	if (!ret) {
 		dev->bus_dma_limit = end;
+		dev->dma_range_map = map;
+	}
 
 	coherent = of_dma_is_coherent(np);
 	dev_dbg(dev, "device is%sdma coherent\n",
@@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
 
 	iommu = of_iommu_configure(dev, np, id);
 	if (PTR_ERR(iommu) == -EPROBE_DEFER) {
+		/* Don't touch range map if it wasn't set from a valid dma-ranges */
+		if (!ret)
+			dev->dma_range_map = NULL;
 		kfree(map);
 		return -EPROBE_DEFER;
 	}
@@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
 
 	arch_setup_dma_ops(dev, dma_start, size, iommu, coherent);
 
-	dev->dma_range_map = map;
 	return 0;
 }
 EXPORT_SYMBOL_GPL(of_dma_configure_id);
-- 
2.18.0


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

* Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
  2021-01-19 10:52 [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges Yong Wu
@ 2021-01-27 13:00 ` Paul Kocialkowski
  2021-01-27 13:13   ` Robin Murphy
  2021-01-27 19:07 ` Rob Herring
  2021-01-27 20:00 ` Rob Herring
  2 siblings, 1 reply; 8+ messages in thread
From: Paul Kocialkowski @ 2021-01-27 13:00 UTC (permalink / raw)
  To: Yong Wu
  Cc: Joerg Roedel, Rob Herring, Matthias Brugger, Will Deacon,
	Robin Murphy, Krzysztof Kozlowski, Tomasz Figa, linux-mediatek,
	srv_heupstream, devicetree, linux-kernel, linux-arm-kernel,
	iommu, Nicolas Boichat, Frank Rowand

[-- Attachment #1: Type: text/plain, Size: 2760 bytes --]

Hi,

On Tue 19 Jan 21, 18:52, Yong Wu wrote:
> The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
> supplanting dma_pfn_offset") always update dma_range_map even though it was
> already set, like in the sunxi_mbus driver. the issue is reported at [1].
> This patch avoid this(Updating it only when dev has valid dma-ranges).
> 
> Meanwhile, dma_range_map contains the devices' dma_ranges information,
> This patch moves dma_range_map before of_iommu_configure. The iommu
> driver may need to know the dma_address requirements of its iommu
> consumer devices.

Just a gentle ping on this issue, it would be nice to have this fix merged
ASAP, in the next RC :)

Cheers,

Paul

> [1] https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/
> 
> CC: Rob Herring <robh+dt@kernel.org>
> CC: Frank Rowand <frowand.list@gmail.com>
> Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset"),
> Suggested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/of/device.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/of/device.c b/drivers/of/device.c
> index aedfaaafd3e7..1122daa8e273 100644
> --- a/drivers/of/device.c
> +++ b/drivers/of/device.c
> @@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>  	mask = DMA_BIT_MASK(ilog2(end) + 1);
>  	dev->coherent_dma_mask &= mask;
>  	*dev->dma_mask &= mask;
> -	/* ...but only set bus limit if we found valid dma-ranges earlier */
> -	if (!ret)
> +	/* ...but only set bus limit and range map if we found valid dma-ranges earlier */
> +	if (!ret) {
>  		dev->bus_dma_limit = end;
> +		dev->dma_range_map = map;
> +	}
>  
>  	coherent = of_dma_is_coherent(np);
>  	dev_dbg(dev, "device is%sdma coherent\n",
> @@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>  
>  	iommu = of_iommu_configure(dev, np, id);
>  	if (PTR_ERR(iommu) == -EPROBE_DEFER) {
> +		/* Don't touch range map if it wasn't set from a valid dma-ranges */
> +		if (!ret)
> +			dev->dma_range_map = NULL;
>  		kfree(map);
>  		return -EPROBE_DEFER;
>  	}
> @@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>  
>  	arch_setup_dma_ops(dev, dma_start, size, iommu, coherent);
>  
> -	dev->dma_range_map = map;
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(of_dma_configure_id);
> -- 
> 2.18.0
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
  2021-01-27 13:00 ` Paul Kocialkowski
@ 2021-01-27 13:13   ` Robin Murphy
  2021-01-27 19:09     ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Robin Murphy @ 2021-01-27 13:13 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, Christoph Hellwig, Marek Szyprowski
  Cc: Joerg Roedel, Matthias Brugger, Will Deacon, Krzysztof Kozlowski,
	Tomasz Figa, linux-mediatek, srv_heupstream, devicetree,
	linux-kernel, linux-arm-kernel, iommu, Nicolas Boichat, Yong Wu,
	Paul Kocialkowski

[ + Christoph, Marek ]

On 2021-01-27 13:00, Paul Kocialkowski wrote:
> Hi,
> 
> On Tue 19 Jan 21, 18:52, Yong Wu wrote:
>> The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
>> supplanting dma_pfn_offset") always update dma_range_map even though it was
>> already set, like in the sunxi_mbus driver. the issue is reported at [1].
>> This patch avoid this(Updating it only when dev has valid dma-ranges).
>>
>> Meanwhile, dma_range_map contains the devices' dma_ranges information,
>> This patch moves dma_range_map before of_iommu_configure. The iommu
>> driver may need to know the dma_address requirements of its iommu
>> consumer devices.
> 
> Just a gentle ping on this issue, it would be nice to have this fix merged
> ASAP, in the next RC :)

Ack to that - Rob, Frank, do you want to take this through the OF tree, 
or shall we take it through the DMA-mapping tree like the original culprit?

Thanks,
Robin.

> 
> Cheers,
> 
> Paul
> 
>> [1] https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/
>>
>> CC: Rob Herring <robh+dt@kernel.org>
>> CC: Frank Rowand <frowand.list@gmail.com>
>> Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset"),
>> Suggested-by: Robin Murphy <robin.murphy@arm.com>
>> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
>> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> ---
>>   drivers/of/device.c | 10 +++++++---
>>   1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/of/device.c b/drivers/of/device.c
>> index aedfaaafd3e7..1122daa8e273 100644
>> --- a/drivers/of/device.c
>> +++ b/drivers/of/device.c
>> @@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>>   	mask = DMA_BIT_MASK(ilog2(end) + 1);
>>   	dev->coherent_dma_mask &= mask;
>>   	*dev->dma_mask &= mask;
>> -	/* ...but only set bus limit if we found valid dma-ranges earlier */
>> -	if (!ret)
>> +	/* ...but only set bus limit and range map if we found valid dma-ranges earlier */
>> +	if (!ret) {
>>   		dev->bus_dma_limit = end;
>> +		dev->dma_range_map = map;
>> +	}
>>   
>>   	coherent = of_dma_is_coherent(np);
>>   	dev_dbg(dev, "device is%sdma coherent\n",
>> @@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>>   
>>   	iommu = of_iommu_configure(dev, np, id);
>>   	if (PTR_ERR(iommu) == -EPROBE_DEFER) {
>> +		/* Don't touch range map if it wasn't set from a valid dma-ranges */
>> +		if (!ret)
>> +			dev->dma_range_map = NULL;
>>   		kfree(map);
>>   		return -EPROBE_DEFER;
>>   	}
>> @@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>>   
>>   	arch_setup_dma_ops(dev, dma_start, size, iommu, coherent);
>>   
>> -	dev->dma_range_map = map;
>>   	return 0;
>>   }
>>   EXPORT_SYMBOL_GPL(of_dma_configure_id);
>> -- 
>> 2.18.0
>>
> 

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

* Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
  2021-01-19 10:52 [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges Yong Wu
  2021-01-27 13:00 ` Paul Kocialkowski
@ 2021-01-27 19:07 ` Rob Herring
  2021-01-27 19:31   ` Robin Murphy
  2021-01-27 20:00 ` Rob Herring
  2 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2021-01-27 19:07 UTC (permalink / raw)
  To: Yong Wu
  Cc: Joerg Roedel, Matthias Brugger, Will Deacon, Robin Murphy,
	Krzysztof Kozlowski, Paul Kocialkowski, Tomasz Figa,
	moderated list:ARM/Mediatek SoC support, srv_heupstream,
	devicetree, linux-kernel, linux-arm-kernel, Linux IOMMU,
	Nicolas Boichat, Frank Rowand

On Tue, Jan 19, 2021 at 4:52 AM Yong Wu <yong.wu@mediatek.com> wrote:
>
> The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
> supplanting dma_pfn_offset") always update dma_range_map even though it was
> already set, like in the sunxi_mbus driver. the issue is reported at [1].
> This patch avoid this(Updating it only when dev has valid dma-ranges).

only when dev *doesn't* have valid dma-ranges?

> Meanwhile, dma_range_map contains the devices' dma_ranges information,
> This patch moves dma_range_map before of_iommu_configure. The iommu
> driver may need to know the dma_address requirements of its iommu
> consumer devices.
>
> [1] https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/
>
> CC: Rob Herring <robh+dt@kernel.org>
> CC: Frank Rowand <frowand.list@gmail.com>
> Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset"),
> Suggested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/of/device.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/device.c b/drivers/of/device.c
> index aedfaaafd3e7..1122daa8e273 100644
> --- a/drivers/of/device.c
> +++ b/drivers/of/device.c
> @@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>         mask = DMA_BIT_MASK(ilog2(end) + 1);
>         dev->coherent_dma_mask &= mask;
>         *dev->dma_mask &= mask;
> -       /* ...but only set bus limit if we found valid dma-ranges earlier */
> -       if (!ret)
> +       /* ...but only set bus limit and range map if we found valid dma-ranges earlier */
> +       if (!ret) {
>                 dev->bus_dma_limit = end;
> +               dev->dma_range_map = map;
> +       }
>
>         coherent = of_dma_is_coherent(np);
>         dev_dbg(dev, "device is%sdma coherent\n",
> @@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>
>         iommu = of_iommu_configure(dev, np, id);
>         if (PTR_ERR(iommu) == -EPROBE_DEFER) {
> +               /* Don't touch range map if it wasn't set from a valid dma-ranges */
> +               if (!ret)
> +                       dev->dma_range_map = NULL;
>                 kfree(map);
>                 return -EPROBE_DEFER;
>         }
> @@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>
>         arch_setup_dma_ops(dev, dma_start, size, iommu, coherent);
>
> -       dev->dma_range_map = map;
>         return 0;
>  }
>  EXPORT_SYMBOL_GPL(of_dma_configure_id);
> --
> 2.18.0
>

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

* Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
  2021-01-27 13:13   ` Robin Murphy
@ 2021-01-27 19:09     ` Rob Herring
  2021-01-27 19:36       ` Robin Murphy
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2021-01-27 19:09 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Frank Rowand, Christoph Hellwig, Marek Szyprowski, Joerg Roedel,
	Matthias Brugger, Will Deacon, Krzysztof Kozlowski, Tomasz Figa,
	moderated list:ARM/Mediatek SoC support, srv_heupstream,
	devicetree, linux-kernel, linux-arm-kernel, Linux IOMMU,
	Nicolas Boichat, Yong Wu, Paul Kocialkowski

On Wed, Jan 27, 2021 at 7:13 AM Robin Murphy <robin.murphy@arm.com> wrote:
>
> [ + Christoph, Marek ]
>
> On 2021-01-27 13:00, Paul Kocialkowski wrote:
> > Hi,
> >
> > On Tue 19 Jan 21, 18:52, Yong Wu wrote:
> >> The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
> >> supplanting dma_pfn_offset") always update dma_range_map even though it was
> >> already set, like in the sunxi_mbus driver. the issue is reported at [1].
> >> This patch avoid this(Updating it only when dev has valid dma-ranges).
> >>
> >> Meanwhile, dma_range_map contains the devices' dma_ranges information,
> >> This patch moves dma_range_map before of_iommu_configure. The iommu
> >> driver may need to know the dma_address requirements of its iommu
> >> consumer devices.
> >
> > Just a gentle ping on this issue, it would be nice to have this fix merged
> > ASAP, in the next RC :)
>
> Ack to that - Rob, Frank, do you want to take this through the OF tree,
> or shall we take it through the DMA-mapping tree like the original culprit?

I've already got some fixes queued up and can take it.

Suggested-by doesn't mean you are happy with the implementation. So
Acked-by or Reviewed-by?

Rob

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

* Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
  2021-01-27 19:07 ` Rob Herring
@ 2021-01-27 19:31   ` Robin Murphy
  0 siblings, 0 replies; 8+ messages in thread
From: Robin Murphy @ 2021-01-27 19:31 UTC (permalink / raw)
  To: Rob Herring, Yong Wu
  Cc: devicetree, Nicolas Boichat, srv_heupstream, Will Deacon,
	Frank Rowand, linux-kernel, Krzysztof Kozlowski,
	Paul Kocialkowski, Tomasz Figa, Linux IOMMU,
	moderated list:ARM/Mediatek SoC support, Matthias Brugger,
	linux-arm-kernel

On 2021-01-27 19:07, Rob Herring wrote:
> On Tue, Jan 19, 2021 at 4:52 AM Yong Wu <yong.wu@mediatek.com> wrote:
>>
>> The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
>> supplanting dma_pfn_offset") always update dma_range_map even though it was
>> already set, like in the sunxi_mbus driver. the issue is reported at [1].
>> This patch avoid this(Updating it only when dev has valid dma-ranges).
> 
> only when dev *doesn't* have valid dma-ranges?

I believe the intent is to mean when a valid "dma-ranges" property is 
specified in DT. The implementation allows DT to take precedence even if 
platform code *has* already installed a dma_range_map, although we 
shouldn't expect that to ever happen (except perhaps in the wild early 
days of platform bringup).

Robin.

>> Meanwhile, dma_range_map contains the devices' dma_ranges information,
>> This patch moves dma_range_map before of_iommu_configure. The iommu
>> driver may need to know the dma_address requirements of its iommu
>> consumer devices.
>>
>> [1] https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/
>>
>> CC: Rob Herring <robh+dt@kernel.org>
>> CC: Frank Rowand <frowand.list@gmail.com>
>> Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset"),
>> Suggested-by: Robin Murphy <robin.murphy@arm.com>
>> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
>> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> ---
>>   drivers/of/device.c | 10 +++++++---
>>   1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/of/device.c b/drivers/of/device.c
>> index aedfaaafd3e7..1122daa8e273 100644
>> --- a/drivers/of/device.c
>> +++ b/drivers/of/device.c
>> @@ -162,9 +162,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>>          mask = DMA_BIT_MASK(ilog2(end) + 1);
>>          dev->coherent_dma_mask &= mask;
>>          *dev->dma_mask &= mask;
>> -       /* ...but only set bus limit if we found valid dma-ranges earlier */
>> -       if (!ret)
>> +       /* ...but only set bus limit and range map if we found valid dma-ranges earlier */
>> +       if (!ret) {
>>                  dev->bus_dma_limit = end;
>> +               dev->dma_range_map = map;
>> +       }
>>
>>          coherent = of_dma_is_coherent(np);
>>          dev_dbg(dev, "device is%sdma coherent\n",
>> @@ -172,6 +174,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>>
>>          iommu = of_iommu_configure(dev, np, id);
>>          if (PTR_ERR(iommu) == -EPROBE_DEFER) {
>> +               /* Don't touch range map if it wasn't set from a valid dma-ranges */
>> +               if (!ret)
>> +                       dev->dma_range_map = NULL;
>>                  kfree(map);
>>                  return -EPROBE_DEFER;
>>          }
>> @@ -181,7 +186,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
>>
>>          arch_setup_dma_ops(dev, dma_start, size, iommu, coherent);
>>
>> -       dev->dma_range_map = map;
>>          return 0;
>>   }
>>   EXPORT_SYMBOL_GPL(of_dma_configure_id);
>> --
>> 2.18.0
>>
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
> 

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

* Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
  2021-01-27 19:09     ` Rob Herring
@ 2021-01-27 19:36       ` Robin Murphy
  0 siblings, 0 replies; 8+ messages in thread
From: Robin Murphy @ 2021-01-27 19:36 UTC (permalink / raw)
  To: Rob Herring
  Cc: Frank Rowand, Christoph Hellwig, Marek Szyprowski, Joerg Roedel,
	Matthias Brugger, Will Deacon, Krzysztof Kozlowski, Tomasz Figa,
	moderated list:ARM/Mediatek SoC support, srv_heupstream,
	devicetree, linux-kernel, linux-arm-kernel, Linux IOMMU,
	Nicolas Boichat, Yong Wu, Paul Kocialkowski

On 2021-01-27 19:09, Rob Herring wrote:
> On Wed, Jan 27, 2021 at 7:13 AM Robin Murphy <robin.murphy@arm.com> wrote:
>>
>> [ + Christoph, Marek ]
>>
>> On 2021-01-27 13:00, Paul Kocialkowski wrote:
>>> Hi,
>>>
>>> On Tue 19 Jan 21, 18:52, Yong Wu wrote:
>>>> The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
>>>> supplanting dma_pfn_offset") always update dma_range_map even though it was
>>>> already set, like in the sunxi_mbus driver. the issue is reported at [1].
>>>> This patch avoid this(Updating it only when dev has valid dma-ranges).
>>>>
>>>> Meanwhile, dma_range_map contains the devices' dma_ranges information,
>>>> This patch moves dma_range_map before of_iommu_configure. The iommu
>>>> driver may need to know the dma_address requirements of its iommu
>>>> consumer devices.
>>>
>>> Just a gentle ping on this issue, it would be nice to have this fix merged
>>> ASAP, in the next RC :)
>>
>> Ack to that - Rob, Frank, do you want to take this through the OF tree,
>> or shall we take it through the DMA-mapping tree like the original culprit?
> 
> I've already got some fixes queued up and can take it.

Brilliant, thanks!

> Suggested-by doesn't mean you are happy with the implementation. So
> Acked-by or Reviewed-by?

It still feels slightly awkward to give a tag to say "yes, this is 
exactly what I suggested", but for the avoidance of doubt,

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

Cheers,
Robin.

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

* Re: [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges
  2021-01-19 10:52 [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges Yong Wu
  2021-01-27 13:00 ` Paul Kocialkowski
  2021-01-27 19:07 ` Rob Herring
@ 2021-01-27 20:00 ` Rob Herring
  2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2021-01-27 20:00 UTC (permalink / raw)
  To: Yong Wu
  Cc: Krzysztof Kozlowski, iommu, linux-arm-kernel, linux-mediatek,
	linux-kernel, Paul Kocialkowski, Tomasz Figa, Robin Murphy,
	Matthias Brugger, devicetree, Rob Herring, Frank Rowand,
	Will Deacon, srv_heupstream, Nicolas Boichat, Joerg Roedel

On Tue, 19 Jan 2021 18:52:03 +0800, Yong Wu wrote:
> The commit e0d072782c73 ("dma-mapping: introduce DMA range map,
> supplanting dma_pfn_offset") always update dma_range_map even though it was
> already set, like in the sunxi_mbus driver. the issue is reported at [1].
> This patch avoid this(Updating it only when dev has valid dma-ranges).
> 
> Meanwhile, dma_range_map contains the devices' dma_ranges information,
> This patch moves dma_range_map before of_iommu_configure. The iommu
> driver may need to know the dma_address requirements of its iommu
> consumer devices.
> 
> [1] https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/
> 
> CC: Rob Herring <robh+dt@kernel.org>
> CC: Frank Rowand <frowand.list@gmail.com>
> Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset"),
> Suggested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/of/device.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 

Applied, thanks!

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

end of thread, other threads:[~2021-01-27 20:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 10:52 [PATCH v2] of/device: Update dma_range_map only when dev has valid dma-ranges Yong Wu
2021-01-27 13:00 ` Paul Kocialkowski
2021-01-27 13:13   ` Robin Murphy
2021-01-27 19:09     ` Rob Herring
2021-01-27 19:36       ` Robin Murphy
2021-01-27 19:07 ` Rob Herring
2021-01-27 19:31   ` Robin Murphy
2021-01-27 20:00 ` Rob Herring

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).