linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: rcar-fcp: Drop local dma_parms
@ 2020-09-03 21:12 Robin Murphy
  2020-09-03 21:53 ` Laurent Pinchart
  2020-09-04 11:32 ` Kieran Bingham
  0 siblings, 2 replies; 4+ messages in thread
From: Robin Murphy @ 2020-09-03 21:12 UTC (permalink / raw)
  To: laurent.pinchart, mchehab; +Cc: linux-media, linux-renesas-soc

Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms
for platform devices"), struct platform_device already provides a
dma_parms structure, so we can save allocating another one.

Also the DMA segment size is simply a size, not a bitmask.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/media/platform/rcar-fcp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c
index 5c6b00737fe7..13a84c7e3586 100644
--- a/drivers/media/platform/rcar-fcp.c
+++ b/drivers/media/platform/rcar-fcp.c
@@ -22,7 +22,6 @@
 struct rcar_fcp_device {
 	struct list_head list;
 	struct device *dev;
-	struct device_dma_parameters dma_parms;
 };
 
 static LIST_HEAD(fcp_devices);
@@ -138,8 +137,7 @@ static int rcar_fcp_probe(struct platform_device *pdev)
 
 	fcp->dev = &pdev->dev;
 
-	fcp->dev->dma_parms = &fcp->dma_parms;
-	dma_set_max_seg_size(fcp->dev, DMA_BIT_MASK(32));
+	dma_set_max_seg_size(fcp->dev, UINT_MAX);
 
 	pm_runtime_enable(&pdev->dev);
 
-- 
2.28.0.dirty


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

* Re: [PATCH] media: rcar-fcp: Drop local dma_parms
  2020-09-03 21:12 [PATCH] media: rcar-fcp: Drop local dma_parms Robin Murphy
@ 2020-09-03 21:53 ` Laurent Pinchart
  2020-09-04  9:54   ` Robin Murphy
  2020-09-04 11:32 ` Kieran Bingham
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2020-09-03 21:53 UTC (permalink / raw)
  To: Robin Murphy; +Cc: mchehab, linux-media, linux-renesas-soc

Hi Robin,

Thank you for the patch.

On Thu, Sep 03, 2020 at 10:12:27PM +0100, Robin Murphy wrote:
> Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms
> for platform devices"), struct platform_device already provides a
> dma_parms structure, so we can save allocating another one.
> 
> Also the DMA segment size is simply a size, not a bitmask.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Looks good to me, I like the simplification.

Should I get this upstream, or do you have other similar patches
tree-wide that you plan to get merged in one go ?

> ---
>  drivers/media/platform/rcar-fcp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c
> index 5c6b00737fe7..13a84c7e3586 100644
> --- a/drivers/media/platform/rcar-fcp.c
> +++ b/drivers/media/platform/rcar-fcp.c
> @@ -22,7 +22,6 @@
>  struct rcar_fcp_device {
>  	struct list_head list;
>  	struct device *dev;
> -	struct device_dma_parameters dma_parms;
>  };
>  
>  static LIST_HEAD(fcp_devices);
> @@ -138,8 +137,7 @@ static int rcar_fcp_probe(struct platform_device *pdev)
>  
>  	fcp->dev = &pdev->dev;
>  
> -	fcp->dev->dma_parms = &fcp->dma_parms;
> -	dma_set_max_seg_size(fcp->dev, DMA_BIT_MASK(32));
> +	dma_set_max_seg_size(fcp->dev, UINT_MAX);
>  
>  	pm_runtime_enable(&pdev->dev);
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH] media: rcar-fcp: Drop local dma_parms
  2020-09-03 21:53 ` Laurent Pinchart
@ 2020-09-04  9:54   ` Robin Murphy
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Murphy @ 2020-09-04  9:54 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: mchehab, linux-media, linux-renesas-soc

On 2020-09-03 22:53, Laurent Pinchart wrote:
> Hi Robin,
> 
> Thank you for the patch.
> 
> On Thu, Sep 03, 2020 at 10:12:27PM +0100, Robin Murphy wrote:
>> Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms
>> for platform devices"), struct platform_device already provides a
>> dma_parms structure, so we can save allocating another one.
>>
>> Also the DMA segment size is simply a size, not a bitmask.
>>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> 
> Looks good to me, I like the simplification.
> 
> Should I get this upstream, or do you have other similar patches
> tree-wide that you plan to get merged in one go ?

No, there's no dependency here - I did these as individual per-driver 
patches so that they can be applied however, please go ahead :)

Thanks,
Robin.

>> ---
>>   drivers/media/platform/rcar-fcp.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c
>> index 5c6b00737fe7..13a84c7e3586 100644
>> --- a/drivers/media/platform/rcar-fcp.c
>> +++ b/drivers/media/platform/rcar-fcp.c
>> @@ -22,7 +22,6 @@
>>   struct rcar_fcp_device {
>>   	struct list_head list;
>>   	struct device *dev;
>> -	struct device_dma_parameters dma_parms;
>>   };
>>   
>>   static LIST_HEAD(fcp_devices);
>> @@ -138,8 +137,7 @@ static int rcar_fcp_probe(struct platform_device *pdev)
>>   
>>   	fcp->dev = &pdev->dev;
>>   
>> -	fcp->dev->dma_parms = &fcp->dma_parms;
>> -	dma_set_max_seg_size(fcp->dev, DMA_BIT_MASK(32));
>> +	dma_set_max_seg_size(fcp->dev, UINT_MAX);
>>   
>>   	pm_runtime_enable(&pdev->dev);
>>   
> 

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

* Re: [PATCH] media: rcar-fcp: Drop local dma_parms
  2020-09-03 21:12 [PATCH] media: rcar-fcp: Drop local dma_parms Robin Murphy
  2020-09-03 21:53 ` Laurent Pinchart
@ 2020-09-04 11:32 ` Kieran Bingham
  1 sibling, 0 replies; 4+ messages in thread
From: Kieran Bingham @ 2020-09-04 11:32 UTC (permalink / raw)
  To: Robin Murphy, laurent.pinchart, mchehab; +Cc: linux-media, linux-renesas-soc

Hi Robin,

On 03/09/2020 22:12, Robin Murphy wrote:
> Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms
> for platform devices"), struct platform_device already provides a
> dma_parms structure, so we can save allocating another one.
> 
> Also the DMA segment size is simply a size, not a bitmask.

I recall following some precedence here.

But I'm happy with this update, I assume you'll update the other usages
of this?

git grep dma_set_max_seg_size | grep DMA_BIT_MASK
shows:

> drivers/gpu/drm/arm/display/komeda/komeda_dev.c:	dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
> drivers/gpu/drm/exynos/exynos_drm_dma.c:	dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
> drivers/gpu/drm/mediatek/mtk_drm_drv.c:	ret = dma_set_max_seg_size(dma_dev, (unsigned int)DMA_BIT_MASK(32));
> drivers/gpu/drm/msm/msm_drv.c:	dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
> drivers/media/platform/qcom/venus/core.c:	dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
> drivers/media/platform/rcar-fcp.c:	dma_set_max_seg_size(fcp->dev, DMA_BIT_MASK(32));


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

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/rcar-fcp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c
> index 5c6b00737fe7..13a84c7e3586 100644
> --- a/drivers/media/platform/rcar-fcp.c
> +++ b/drivers/media/platform/rcar-fcp.c
> @@ -22,7 +22,6 @@
>  struct rcar_fcp_device {
>  	struct list_head list;
>  	struct device *dev;
> -	struct device_dma_parameters dma_parms;
>  };
>  
>  static LIST_HEAD(fcp_devices);
> @@ -138,8 +137,7 @@ static int rcar_fcp_probe(struct platform_device *pdev)
>  
>  	fcp->dev = &pdev->dev;
>  
> -	fcp->dev->dma_parms = &fcp->dma_parms;
> -	dma_set_max_seg_size(fcp->dev, DMA_BIT_MASK(32));
> +	dma_set_max_seg_size(fcp->dev, UINT_MAX);
>  
>  	pm_runtime_enable(&pdev->dev);
>  
> 


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

end of thread, other threads:[~2020-09-04 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 21:12 [PATCH] media: rcar-fcp: Drop local dma_parms Robin Murphy
2020-09-03 21:53 ` Laurent Pinchart
2020-09-04  9:54   ` Robin Murphy
2020-09-04 11:32 ` Kieran Bingham

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