LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements
@ 2021-10-07 11:12 Claudiu Beznea
  2021-10-07 11:12 ` [PATCH 1/4] dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path Claudiu Beznea
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Claudiu Beznea @ 2021-10-07 11:12 UTC (permalink / raw)
  To: ludovic.desroches, tudor.ambarus, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel, Claudiu Beznea

Hi,

The following series adds some fixes and code enhancements for at_xdmac
driver.

Thank you,
Claudiu Beznea

Claudiu Beznea (4):
  dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path
  dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro
  dmaengine: at_xdmac: use __maybe_unused for pm functions
  dmaengine: at_xdmac: use pm_ptr()

 drivers/dma/at_xdmac.c | 67 ++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 35 deletions(-)

-- 
2.25.1


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

* [PATCH 1/4] dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path
  2021-10-07 11:12 [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Claudiu Beznea
@ 2021-10-07 11:12 ` Claudiu Beznea
  2021-10-15  7:49   ` Tudor.Ambarus
  2021-10-07 11:12 ` [PATCH 2/4] dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro Claudiu Beznea
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Claudiu Beznea @ 2021-10-07 11:12 UTC (permalink / raw)
  To: ludovic.desroches, tudor.ambarus, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel, Claudiu Beznea

at_xdmac could be used on SoCs which supports backup mode (where most
of the SoC power, including power to DMA controller, is closed at suspend
time). Thus, on resume, the settings which were previously done need to be
restored. Do the same for axi configuration.

Fixes: f40566f220a1 ("dmaengine: at_xdmac: add AXI priority support and recommended settings")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/dma/at_xdmac.c | 51 ++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index ab78e0f6afd7..c66ad5706cb5 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1926,6 +1926,30 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan)
 	return;
 }
 
+static void at_xdmac_axi_config(struct platform_device *pdev)
+{
+	struct at_xdmac	*atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
+	bool dev_m2m = false;
+	u32 dma_requests;
+
+	if (!atxdmac->layout->axi_config)
+		return; /* Not supported */
+
+	if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
+				  &dma_requests)) {
+		dev_info(&pdev->dev, "controller in mem2mem mode.\n");
+		dev_m2m = true;
+	}
+
+	if (dev_m2m) {
+		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
+		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
+	} else {
+		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
+		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
+	}
+}
+
 #ifdef CONFIG_PM
 static int atmel_xdmac_prepare(struct device *dev)
 {
@@ -1975,6 +1999,7 @@ static int atmel_xdmac_resume(struct device *dev)
 	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
 	struct at_xdmac_chan	*atchan;
 	struct dma_chan		*chan, *_chan;
+	struct platform_device	*pdev = container_of(dev, struct platform_device, dev);
 	int			i;
 	int ret;
 
@@ -1982,6 +2007,8 @@ static int atmel_xdmac_resume(struct device *dev)
 	if (ret)
 		return ret;
 
+	at_xdmac_axi_config(pdev);
+
 	/* Clear pending interrupts. */
 	for (i = 0; i < atxdmac->dma.chancnt; i++) {
 		atchan = &atxdmac->chan[i];
@@ -2007,30 +2034,6 @@ static int atmel_xdmac_resume(struct device *dev)
 }
 #endif /* CONFIG_PM_SLEEP */
 
-static void at_xdmac_axi_config(struct platform_device *pdev)
-{
-	struct at_xdmac	*atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
-	bool dev_m2m = false;
-	u32 dma_requests;
-
-	if (!atxdmac->layout->axi_config)
-		return; /* Not supported */
-
-	if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
-				  &dma_requests)) {
-		dev_info(&pdev->dev, "controller in mem2mem mode.\n");
-		dev_m2m = true;
-	}
-
-	if (dev_m2m) {
-		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
-		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
-	} else {
-		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
-		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
-	}
-}
-
 static int at_xdmac_probe(struct platform_device *pdev)
 {
 	struct at_xdmac	*atxdmac;
-- 
2.25.1


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

* [PATCH 2/4] dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro
  2021-10-07 11:12 [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Claudiu Beznea
  2021-10-07 11:12 ` [PATCH 1/4] dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path Claudiu Beznea
@ 2021-10-07 11:12 ` Claudiu Beznea
  2021-10-15  7:50   ` Tudor.Ambarus
  2021-10-07 11:12 ` [PATCH 3/4] dmaengine: at_xdmac: use __maybe_unused for pm functions Claudiu Beznea
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Claudiu Beznea @ 2021-10-07 11:12 UTC (permalink / raw)
  To: ludovic.desroches, tudor.ambarus, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel, Claudiu Beznea

AT_XDMAC_CC_PERID() should be used to setup bits 24..30 of XDMAC_CC
register. Using it without parenthesis around 0x7f & (i) will lead to
setting all the time zero for bits 24..30 of XDMAC_CC as the << operator
has higher precedence over bitwise &. Thus, add paranthesis around
0x7f & (i).

Fixes: 15a03850ab8f ("dmaengine: at_xdmac: fix macro typo")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/dma/at_xdmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index c66ad5706cb5..e18abbd56fb5 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -155,7 +155,7 @@
 #define		AT_XDMAC_CC_WRIP	(0x1 << 23)	/* Write in Progress (read only) */
 #define			AT_XDMAC_CC_WRIP_DONE		(0x0 << 23)
 #define			AT_XDMAC_CC_WRIP_IN_PROGRESS	(0x1 << 23)
-#define		AT_XDMAC_CC_PERID(i)	(0x7f & (i) << 24)	/* Channel Peripheral Identifier */
+#define		AT_XDMAC_CC_PERID(i)	((0x7f & (i)) << 24)	/* Channel Peripheral Identifier */
 #define AT_XDMAC_CDS_MSP	0x2C	/* Channel Data Stride Memory Set Pattern */
 #define AT_XDMAC_CSUS		0x30	/* Channel Source Microblock Stride */
 #define AT_XDMAC_CDUS		0x34	/* Channel Destination Microblock Stride */
-- 
2.25.1


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

* [PATCH 3/4] dmaengine: at_xdmac: use __maybe_unused for pm functions
  2021-10-07 11:12 [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Claudiu Beznea
  2021-10-07 11:12 ` [PATCH 1/4] dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path Claudiu Beznea
  2021-10-07 11:12 ` [PATCH 2/4] dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro Claudiu Beznea
@ 2021-10-07 11:12 ` Claudiu Beznea
  2021-10-15  8:01   ` Tudor.Ambarus
  2021-10-07 11:12 ` [PATCH 4/4] dmaengine: at_xdmac: use pm_ptr() Claudiu Beznea
  2021-10-18  6:12 ` [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Vinod Koul
  4 siblings, 1 reply; 10+ messages in thread
From: Claudiu Beznea @ 2021-10-07 11:12 UTC (permalink / raw)
  To: ludovic.desroches, tudor.ambarus, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel, Claudiu Beznea

Use __maybe_unused for pm functions.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/dma/at_xdmac.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index e18abbd56fb5..12371396fcc0 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1950,8 +1950,7 @@ static void at_xdmac_axi_config(struct platform_device *pdev)
 	}
 }
 
-#ifdef CONFIG_PM
-static int atmel_xdmac_prepare(struct device *dev)
+static int __maybe_unused atmel_xdmac_prepare(struct device *dev)
 {
 	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
 	struct dma_chan		*chan, *_chan;
@@ -1965,12 +1964,8 @@ static int atmel_xdmac_prepare(struct device *dev)
 	}
 	return 0;
 }
-#else
-#	define atmel_xdmac_prepare NULL
-#endif
 
-#ifdef CONFIG_PM_SLEEP
-static int atmel_xdmac_suspend(struct device *dev)
+static int __maybe_unused atmel_xdmac_suspend(struct device *dev)
 {
 	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
 	struct dma_chan		*chan, *_chan;
@@ -1994,7 +1989,7 @@ static int atmel_xdmac_suspend(struct device *dev)
 	return 0;
 }
 
-static int atmel_xdmac_resume(struct device *dev)
+static int __maybe_unused atmel_xdmac_resume(struct device *dev)
 {
 	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
 	struct at_xdmac_chan	*atchan;
@@ -2032,7 +2027,6 @@ static int atmel_xdmac_resume(struct device *dev)
 	}
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static int at_xdmac_probe(struct platform_device *pdev)
 {
-- 
2.25.1


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

* [PATCH 4/4] dmaengine: at_xdmac: use pm_ptr()
  2021-10-07 11:12 [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Claudiu Beznea
                   ` (2 preceding siblings ...)
  2021-10-07 11:12 ` [PATCH 3/4] dmaengine: at_xdmac: use __maybe_unused for pm functions Claudiu Beznea
@ 2021-10-07 11:12 ` Claudiu Beznea
  2021-10-15  8:03   ` Tudor.Ambarus
  2021-10-18  6:12 ` [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Vinod Koul
  4 siblings, 1 reply; 10+ messages in thread
From: Claudiu Beznea @ 2021-10-07 11:12 UTC (permalink / raw)
  To: ludovic.desroches, tudor.ambarus, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel, Claudiu Beznea

Use pm_ptr() macro to fill at_xdmac_driver.driver.pm.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/dma/at_xdmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index 12371396fcc0..7fb19bd18ac3 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -2231,7 +2231,7 @@ static struct platform_driver at_xdmac_driver = {
 	.driver = {
 		.name		= "at_xdmac",
 		.of_match_table	= of_match_ptr(atmel_xdmac_dt_ids),
-		.pm		= &atmel_xdmac_dev_pm_ops,
+		.pm		= pm_ptr(&atmel_xdmac_dev_pm_ops),
 	}
 };
 
-- 
2.25.1


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

* Re: [PATCH 1/4] dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path
  2021-10-07 11:12 ` [PATCH 1/4] dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path Claudiu Beznea
@ 2021-10-15  7:49   ` Tudor.Ambarus
  0 siblings, 0 replies; 10+ messages in thread
From: Tudor.Ambarus @ 2021-10-15  7:49 UTC (permalink / raw)
  To: Claudiu.Beznea, Ludovic.Desroches, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel

On 10/7/21 2:12 PM, Claudiu Beznea wrote:
> at_xdmac could be used on SoCs which supports backup mode (where most
> of the SoC power, including power to DMA controller, is closed at suspend
> time). Thus, on resume, the settings which were previously done need to be
> restored. Do the same for axi configuration.
> 
> Fixes: f40566f220a1 ("dmaengine: at_xdmac: add AXI priority support and recommended settings")
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/dma/at_xdmac.c | 51 ++++++++++++++++++++++--------------------
>  1 file changed, 27 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index ab78e0f6afd7..c66ad5706cb5 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -1926,6 +1926,30 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan)
>  	return;
>  }
>  
> +static void at_xdmac_axi_config(struct platform_device *pdev)
> +{
> +	struct at_xdmac	*atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
> +	bool dev_m2m = false;
> +	u32 dma_requests;
> +
> +	if (!atxdmac->layout->axi_config)
> +		return; /* Not supported */
> +
> +	if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
> +				  &dma_requests)) {
> +		dev_info(&pdev->dev, "controller in mem2mem mode.\n");
> +		dev_m2m = true;
> +	}
> +
> +	if (dev_m2m) {
> +		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
> +		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
> +	} else {
> +		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
> +		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
> +	}
> +}
> +
>  #ifdef CONFIG_PM
>  static int atmel_xdmac_prepare(struct device *dev)
>  {
> @@ -1975,6 +1999,7 @@ static int atmel_xdmac_resume(struct device *dev)
>  	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct at_xdmac_chan	*atchan;
>  	struct dma_chan		*chan, *_chan;
> +	struct platform_device	*pdev = container_of(dev, struct platform_device, dev);
>  	int			i;
>  	int ret;
>  
> @@ -1982,6 +2007,8 @@ static int atmel_xdmac_resume(struct device *dev)
>  	if (ret)
>  		return ret;
>  
> +	at_xdmac_axi_config(pdev);
> +
>  	/* Clear pending interrupts. */
>  	for (i = 0; i < atxdmac->dma.chancnt; i++) {
>  		atchan = &atxdmac->chan[i];
> @@ -2007,30 +2034,6 @@ static int atmel_xdmac_resume(struct device *dev)
>  }
>  #endif /* CONFIG_PM_SLEEP */
>  
> -static void at_xdmac_axi_config(struct platform_device *pdev)
> -{
> -	struct at_xdmac	*atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
> -	bool dev_m2m = false;
> -	u32 dma_requests;
> -
> -	if (!atxdmac->layout->axi_config)
> -		return; /* Not supported */
> -
> -	if (!of_property_read_u32(pdev->dev.of_node, "dma-requests",
> -				  &dma_requests)) {
> -		dev_info(&pdev->dev, "controller in mem2mem mode.\n");
> -		dev_m2m = true;
> -	}
> -
> -	if (dev_m2m) {
> -		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M);
> -		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M);
> -	} else {
> -		at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M);
> -		at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M);
> -	}
> -}
> -
>  static int at_xdmac_probe(struct platform_device *pdev)
>  {
>  	struct at_xdmac	*atxdmac;
> 


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

* Re: [PATCH 2/4] dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro
  2021-10-07 11:12 ` [PATCH 2/4] dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro Claudiu Beznea
@ 2021-10-15  7:50   ` Tudor.Ambarus
  0 siblings, 0 replies; 10+ messages in thread
From: Tudor.Ambarus @ 2021-10-15  7:50 UTC (permalink / raw)
  To: Claudiu.Beznea, Ludovic.Desroches, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel

On 10/7/21 2:12 PM, Claudiu Beznea wrote:
> AT_XDMAC_CC_PERID() should be used to setup bits 24..30 of XDMAC_CC
> register. Using it without parenthesis around 0x7f & (i) will lead to
> setting all the time zero for bits 24..30 of XDMAC_CC as the << operator
> has higher precedence over bitwise &. Thus, add paranthesis around
> 0x7f & (i).
> 
> Fixes: 15a03850ab8f ("dmaengine: at_xdmac: fix macro typo")
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/dma/at_xdmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index c66ad5706cb5..e18abbd56fb5 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -155,7 +155,7 @@
>  #define		AT_XDMAC_CC_WRIP	(0x1 << 23)	/* Write in Progress (read only) */
>  #define			AT_XDMAC_CC_WRIP_DONE		(0x0 << 23)
>  #define			AT_XDMAC_CC_WRIP_IN_PROGRESS	(0x1 << 23)
> -#define		AT_XDMAC_CC_PERID(i)	(0x7f & (i) << 24)	/* Channel Peripheral Identifier */
> +#define		AT_XDMAC_CC_PERID(i)	((0x7f & (i)) << 24)	/* Channel Peripheral Identifier */
>  #define AT_XDMAC_CDS_MSP	0x2C	/* Channel Data Stride Memory Set Pattern */
>  #define AT_XDMAC_CSUS		0x30	/* Channel Source Microblock Stride */
>  #define AT_XDMAC_CDUS		0x34	/* Channel Destination Microblock Stride */
> 


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

* Re: [PATCH 3/4] dmaengine: at_xdmac: use __maybe_unused for pm functions
  2021-10-07 11:12 ` [PATCH 3/4] dmaengine: at_xdmac: use __maybe_unused for pm functions Claudiu Beznea
@ 2021-10-15  8:01   ` Tudor.Ambarus
  0 siblings, 0 replies; 10+ messages in thread
From: Tudor.Ambarus @ 2021-10-15  8:01 UTC (permalink / raw)
  To: Claudiu.Beznea, Ludovic.Desroches, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel

On 10/7/21 2:12 PM, Claudiu Beznea wrote:
> Use __maybe_unused for pm functions.

Explaining why would be nice. E.g. avoiding ifdefs throughout the code,
and stop defining atmel_xdmac_prepare as NULL.

> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/dma/at_xdmac.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index e18abbd56fb5..12371396fcc0 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -1950,8 +1950,7 @@ static void at_xdmac_axi_config(struct platform_device *pdev)
>  	}
>  }
>  
> -#ifdef CONFIG_PM
> -static int atmel_xdmac_prepare(struct device *dev)
> +static int __maybe_unused atmel_xdmac_prepare(struct device *dev)
>  {
>  	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct dma_chan		*chan, *_chan;
> @@ -1965,12 +1964,8 @@ static int atmel_xdmac_prepare(struct device *dev)
>  	}
>  	return 0;
>  }
> -#else
> -#	define atmel_xdmac_prepare NULL
> -#endif
>  
> -#ifdef CONFIG_PM_SLEEP
> -static int atmel_xdmac_suspend(struct device *dev)
> +static int __maybe_unused atmel_xdmac_suspend(struct device *dev)
>  {
>  	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct dma_chan		*chan, *_chan;
> @@ -1994,7 +1989,7 @@ static int atmel_xdmac_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int atmel_xdmac_resume(struct device *dev)
> +static int __maybe_unused atmel_xdmac_resume(struct device *dev)
>  {
>  	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct at_xdmac_chan	*atchan;
> @@ -2032,7 +2027,6 @@ static int atmel_xdmac_resume(struct device *dev)
>  	}
>  	return 0;
>  }
> -#endif /* CONFIG_PM_SLEEP */
>  
>  static int at_xdmac_probe(struct platform_device *pdev)
>  {
> 


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

* Re: [PATCH 4/4] dmaengine: at_xdmac: use pm_ptr()
  2021-10-07 11:12 ` [PATCH 4/4] dmaengine: at_xdmac: use pm_ptr() Claudiu Beznea
@ 2021-10-15  8:03   ` Tudor.Ambarus
  0 siblings, 0 replies; 10+ messages in thread
From: Tudor.Ambarus @ 2021-10-15  8:03 UTC (permalink / raw)
  To: Claudiu.Beznea, Ludovic.Desroches, vkoul
  Cc: linux-arm-kernel, dmaengine, linux-kernel

On 10/7/21 2:12 PM, Claudiu Beznea wrote:
> Use pm_ptr() macro to fill at_xdmac_driver.driver.pm.

I would amend the commit message with:
If CONFIG_PM is enabled, this macro will resolve to its argument,
otherwise to NULL.

Nitpick anyway, so:
> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/dma/at_xdmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index 12371396fcc0..7fb19bd18ac3 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -2231,7 +2231,7 @@ static struct platform_driver at_xdmac_driver = {
>  	.driver = {
>  		.name		= "at_xdmac",
>  		.of_match_table	= of_match_ptr(atmel_xdmac_dt_ids),
> -		.pm		= &atmel_xdmac_dev_pm_ops,
> +		.pm		= pm_ptr(&atmel_xdmac_dev_pm_ops),
>  	}
>  };
>  
> 


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

* Re: [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements
  2021-10-07 11:12 [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Claudiu Beznea
                   ` (3 preceding siblings ...)
  2021-10-07 11:12 ` [PATCH 4/4] dmaengine: at_xdmac: use pm_ptr() Claudiu Beznea
@ 2021-10-18  6:12 ` Vinod Koul
  4 siblings, 0 replies; 10+ messages in thread
From: Vinod Koul @ 2021-10-18  6:12 UTC (permalink / raw)
  To: Claudiu Beznea
  Cc: ludovic.desroches, tudor.ambarus, linux-arm-kernel, dmaengine,
	linux-kernel

On 07-10-21, 14:12, Claudiu Beznea wrote:
> Hi,
> 
> The following series adds some fixes and code enhancements for at_xdmac
> driver.

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2021-10-18  6:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 11:12 [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Claudiu Beznea
2021-10-07 11:12 ` [PATCH 1/4] dmaengine: at_xdmac: call at_xdmac_axi_config() on resume path Claudiu Beznea
2021-10-15  7:49   ` Tudor.Ambarus
2021-10-07 11:12 ` [PATCH 2/4] dmaengine: at_xdmac: fix AT_XDMAC_CC_PERID() macro Claudiu Beznea
2021-10-15  7:50   ` Tudor.Ambarus
2021-10-07 11:12 ` [PATCH 3/4] dmaengine: at_xdmac: use __maybe_unused for pm functions Claudiu Beznea
2021-10-15  8:01   ` Tudor.Ambarus
2021-10-07 11:12 ` [PATCH 4/4] dmaengine: at_xdmac: use pm_ptr() Claudiu Beznea
2021-10-15  8:03   ` Tudor.Ambarus
2021-10-18  6:12 ` [PATCH 0/4] dmaengine: at_xdmac: fixes and code enhancements Vinod Koul

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