linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
@ 2018-02-14 16:27 Gregory CLEMENT
  2018-02-27 15:15 ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Gregory CLEMENT @ 2018-02-14 16:27 UTC (permalink / raw)
  To: linux-arm-kernel

On the CP110 components whic are present on the Armada 7K/8K SoC we need
to explicitly enable the registers clock. However it is not needed for
the AP8xx componenet, that's why this clock is optional.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
 .../devicetree/bindings/dma/mv-xor-v2.txt          |  6 +++++-
 drivers/dma/mv_xor_v2.c                            | 23 +++++++++++++++++-----
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
index 217a90eaabe7..9c38bbe7e6d7 100644
--- a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
+++ b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
@@ -11,7 +11,11 @@ Required properties:
   interrupts.
 
 Optional properties:
-- clocks: Optional reference to the clock used by the XOR engine.
+- clocks: Optional reference to the clocks used by the XOR engine.
+- clock-names: mandatory if there is a second clock, in this case the
+   name must be "core" for the first clock and "reg" for the second
+   one
+
 
 Example:
 
diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
index f652a0e0f5a2..93b3d80ce701 100644
--- a/drivers/dma/mv_xor_v2.c
+++ b/drivers/dma/mv_xor_v2.c
@@ -163,6 +163,7 @@ struct mv_xor_v2_device {
 	void __iomem *dma_base;
 	void __iomem *glob_base;
 	struct clk *clk;
+	struct clk *reg_clk;
 	struct tasklet_struct irq_tasklet;
 	struct list_head free_sw_desc;
 	struct dma_device dmadev;
@@ -749,13 +750,24 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
+	xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg");
+	if (!IS_ERR(xor_dev->reg_clk)) {
+		ret = clk_prepare_enable(xor_dev->reg_clk);
+		if (ret)
+			return ret;
+	} else if (PTR_ERR(xor_dev->reg_clk) == -EPROBE_DEFER) {
 		return -EPROBE_DEFER;
+	}
+
+	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) {
+		ret = EPROBE_DEFER;
+		goto disable_reg_clk;
+	}
 	if (!IS_ERR(xor_dev->clk)) {
 		ret = clk_prepare_enable(xor_dev->clk);
 		if (ret)
-			return ret;
+			goto disable_reg_clk;
 	}
 
 	ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1,
@@ -866,8 +878,9 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
 free_msi_irqs:
 	platform_msi_domain_free_irqs(&pdev->dev);
 disable_clk:
-	if (!IS_ERR(xor_dev->clk))
-		clk_disable_unprepare(xor_dev->clk);
+	clk_disable_unprepare(xor_dev->clk);
+disable_reg_clk:
+	clk_disable_unprepare(xor_dev->reg_clk);
 	return ret;
 }
 
-- 
2.15.1

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

* [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
  2018-02-14 16:27 [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock Gregory CLEMENT
@ 2018-02-27 15:15 ` Vinod Koul
  2018-02-27 15:19   ` Gregory CLEMENT
  0 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2018-02-27 15:15 UTC (permalink / raw)
  To: linux-arm-kernel

Pls do CC DT folks and Rob for bindings update

On Wed, Feb 14, 2018 at 05:27:33PM +0100, Gregory CLEMENT wrote:
> On the CP110 components whic are present on the Armada 7K/8K SoC we need

/s/whic/which

> to explicitly enable the registers clock. However it is not needed for

/s/registers/register

> the AP8xx componenet, that's why this clock is optional.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> ---
>  .../devicetree/bindings/dma/mv-xor-v2.txt          |  6 +++++-
>  drivers/dma/mv_xor_v2.c                            | 23 +++++++++++++++++-----
>  2 files changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
> index 217a90eaabe7..9c38bbe7e6d7 100644
> --- a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
> +++ b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
> @@ -11,7 +11,11 @@ Required properties:
>    interrupts.
>  
>  Optional properties:
> -- clocks: Optional reference to the clock used by the XOR engine.
> +- clocks: Optional reference to the clocks used by the XOR engine.
> +- clock-names: mandatory if there is a second clock, in this case the
> +   name must be "core" for the first clock and "reg" for the second
> +   one
> +
>  
>  Example:
>  
> diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
> index f652a0e0f5a2..93b3d80ce701 100644
> --- a/drivers/dma/mv_xor_v2.c
> +++ b/drivers/dma/mv_xor_v2.c
> @@ -163,6 +163,7 @@ struct mv_xor_v2_device {
>  	void __iomem *dma_base;
>  	void __iomem *glob_base;
>  	struct clk *clk;
> +	struct clk *reg_clk;
>  	struct tasklet_struct irq_tasklet;
>  	struct list_head free_sw_desc;
>  	struct dma_device dmadev;
> @@ -749,13 +750,24 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
> +	xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg");

is this an exiting property?

> +	if (!IS_ERR(xor_dev->reg_clk)) {
> +		ret = clk_prepare_enable(xor_dev->reg_clk);
> +		if (ret)
> +			return ret;
> +	} else if (PTR_ERR(xor_dev->reg_clk) == -EPROBE_DEFER) {
>  		return -EPROBE_DEFER;
> +	}
> +
> +	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) {
> +		ret = EPROBE_DEFER;
> +		goto disable_reg_clk;
> +	}
>  	if (!IS_ERR(xor_dev->clk)) {
>  		ret = clk_prepare_enable(xor_dev->clk);
>  		if (ret)
> -			return ret;
> +			goto disable_reg_clk;
>  	}
>  
>  	ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1,
> @@ -866,8 +878,9 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
>  free_msi_irqs:
>  	platform_msi_domain_free_irqs(&pdev->dev);
>  disable_clk:
> -	if (!IS_ERR(xor_dev->clk))
> -		clk_disable_unprepare(xor_dev->clk);
> +	clk_disable_unprepare(xor_dev->clk);
> +disable_reg_clk:
> +	clk_disable_unprepare(xor_dev->reg_clk);
>  	return ret;
>  }
>  
> -- 
> 2.15.1
> 

-- 
~Vinod

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

* [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
  2018-02-27 15:15 ` Vinod Koul
@ 2018-02-27 15:19   ` Gregory CLEMENT
  2018-03-01  8:25     ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Gregory CLEMENT @ 2018-02-27 15:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vinod,
 
 On mar., f?vr. 27 2018, Vinod Koul <vinod.koul@intel.com> wrote:

> Pls do CC DT folks and Rob for bindings update
>
> On Wed, Feb 14, 2018 at 05:27:33PM +0100, Gregory CLEMENT wrote:
>> On the CP110 components whic are present on the Armada 7K/8K SoC we need
>
> /s/whic/which
>
>> to explicitly enable the registers clock. However it is not needed for
>
> /s/registers/register
>
>> the AP8xx componenet, that's why this clock is optional.
>> 
>> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
>> ---
>>  .../devicetree/bindings/dma/mv-xor-v2.txt          |  6 +++++-
>>  drivers/dma/mv_xor_v2.c                            | 23 +++++++++++++++++-----
>>  2 files changed, 23 insertions(+), 6 deletions(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
>> index 217a90eaabe7..9c38bbe7e6d7 100644
>> --- a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
>> +++ b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
>> @@ -11,7 +11,11 @@ Required properties:
>>    interrupts.
>>  
>>  Optional properties:
>> -- clocks: Optional reference to the clock used by the XOR engine.
>> +- clocks: Optional reference to the clocks used by the XOR engine.
>> +- clock-names: mandatory if there is a second clock, in this case the
>> +   name must be "core" for the first clock and "reg" for the second
>> +   one
>> +
>>  
>>  Example:
>>  
>> diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
>> index f652a0e0f5a2..93b3d80ce701 100644
>> --- a/drivers/dma/mv_xor_v2.c
>> +++ b/drivers/dma/mv_xor_v2.c
>> @@ -163,6 +163,7 @@ struct mv_xor_v2_device {
>>  	void __iomem *dma_base;
>>  	void __iomem *glob_base;
>>  	struct clk *clk;
>> +	struct clk *reg_clk;
>>  	struct tasklet_struct irq_tasklet;
>>  	struct list_head free_sw_desc;
>>  	struct dma_device dmadev;
>> @@ -749,13 +750,24 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
>>  	if (ret)
>>  		return ret;
>>  
>> -	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
>> -	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
>> +	xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg");
>
> is this an exiting property?

It is the name of the new optional clock described in the first part of
this patch.

About the typo, do you need a new version or do you plan to fix them
while applying the patch?

Thanks,

Gregory


>
>> +	if (!IS_ERR(xor_dev->reg_clk)) {
>> +		ret = clk_prepare_enable(xor_dev->reg_clk);
>> +		if (ret)
>> +			return ret;
>> +	} else if (PTR_ERR(xor_dev->reg_clk) == -EPROBE_DEFER) {
>>  		return -EPROBE_DEFER;
>> +	}
>> +
>> +	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
>> +	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) {
>> +		ret = EPROBE_DEFER;
>> +		goto disable_reg_clk;
>> +	}
>>  	if (!IS_ERR(xor_dev->clk)) {
>>  		ret = clk_prepare_enable(xor_dev->clk);
>>  		if (ret)
>> -			return ret;
>> +			goto disable_reg_clk;
>>  	}
>>  
>>  	ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1,
>> @@ -866,8 +878,9 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
>>  free_msi_irqs:
>>  	platform_msi_domain_free_irqs(&pdev->dev);
>>  disable_clk:
>> -	if (!IS_ERR(xor_dev->clk))
>> -		clk_disable_unprepare(xor_dev->clk);
>> +	clk_disable_unprepare(xor_dev->clk);
>> +disable_reg_clk:
>> +	clk_disable_unprepare(xor_dev->reg_clk);
>>  	return ret;
>>  }
>>  
>> -- 
>> 2.15.1
>> 
>
> -- 
> ~Vinod
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

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

* [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
  2018-02-27 15:19   ` Gregory CLEMENT
@ 2018-03-01  8:25     ` Vinod Koul
  2018-03-01  8:37       ` Gregory CLEMENT
  0 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2018-03-01  8:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 27, 2018 at 04:19:56PM +0100, Gregory CLEMENT wrote:
> Hi Vinod,
>  
>  On mar., f?vr. 27 2018, Vinod Koul <vinod.koul@intel.com> wrote:
> 
> > Pls do CC DT folks and Rob for bindings update
> >
> > On Wed, Feb 14, 2018 at 05:27:33PM +0100, Gregory CLEMENT wrote:
> >> On the CP110 components whic are present on the Armada 7K/8K SoC we need
> >
> > /s/whic/which
> >
> >> to explicitly enable the registers clock. However it is not needed for
> >
> > /s/registers/register
> >
> >> the AP8xx componenet, that's why this clock is optional.
> >> 
> >> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> >> ---
> >>  .../devicetree/bindings/dma/mv-xor-v2.txt          |  6 +++++-
> >>  drivers/dma/mv_xor_v2.c                            | 23 +++++++++++++++++-----
> >>  2 files changed, 23 insertions(+), 6 deletions(-)
> >> 
> >> diff --git a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
> >> index 217a90eaabe7..9c38bbe7e6d7 100644
> >> --- a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
> >> +++ b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt
> >> @@ -11,7 +11,11 @@ Required properties:
> >>    interrupts.
> >>  
> >>  Optional properties:
> >> -- clocks: Optional reference to the clock used by the XOR engine.
> >> +- clocks: Optional reference to the clocks used by the XOR engine.
> >> +- clock-names: mandatory if there is a second clock, in this case the
> >> +   name must be "core" for the first clock and "reg" for the second
> >> +   one
> >> +
> >>  
> >>  Example:
> >>  
> >> diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
> >> index f652a0e0f5a2..93b3d80ce701 100644
> >> --- a/drivers/dma/mv_xor_v2.c
> >> +++ b/drivers/dma/mv_xor_v2.c
> >> @@ -163,6 +163,7 @@ struct mv_xor_v2_device {
> >>  	void __iomem *dma_base;
> >>  	void __iomem *glob_base;
> >>  	struct clk *clk;
> >> +	struct clk *reg_clk;
> >>  	struct tasklet_struct irq_tasklet;
> >>  	struct list_head free_sw_desc;
> >>  	struct dma_device dmadev;
> >> @@ -749,13 +750,24 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
> >>  	if (ret)
> >>  		return ret;
> >>  
> >> -	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
> >> -	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
> >> +	xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg");
> >
> > is this an exiting property?
> 
> It is the name of the new optional clock described in the first part of
> this patch.

okay I am missing something then, you are reading "reg" but property added is
"clock-names", where are you reading this?

> 
> About the typo, do you need a new version or do you plan to fix them
> while applying the patch?
> 
> Thanks,
> 
> Gregory
> 
> 
> >
> >> +	if (!IS_ERR(xor_dev->reg_clk)) {
> >> +		ret = clk_prepare_enable(xor_dev->reg_clk);
> >> +		if (ret)
> >> +			return ret;
> >> +	} else if (PTR_ERR(xor_dev->reg_clk) == -EPROBE_DEFER) {
> >>  		return -EPROBE_DEFER;
> >> +	}
> >> +
> >> +	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
> >> +	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) {
> >> +		ret = EPROBE_DEFER;
> >> +		goto disable_reg_clk;
> >> +	}
> >>  	if (!IS_ERR(xor_dev->clk)) {
> >>  		ret = clk_prepare_enable(xor_dev->clk);
> >>  		if (ret)
> >> -			return ret;
> >> +			goto disable_reg_clk;
> >>  	}
> >>  
> >>  	ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1,
> >> @@ -866,8 +878,9 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
> >>  free_msi_irqs:
> >>  	platform_msi_domain_free_irqs(&pdev->dev);
> >>  disable_clk:
> >> -	if (!IS_ERR(xor_dev->clk))
> >> -		clk_disable_unprepare(xor_dev->clk);
> >> +	clk_disable_unprepare(xor_dev->clk);
> >> +disable_reg_clk:
> >> +	clk_disable_unprepare(xor_dev->reg_clk);
> >>  	return ret;
> >>  }
> >>  
> >> -- 
> >> 2.15.1
> >> 
> >
> > -- 
> > ~Vinod
> > --
> > To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> > the body of a message to majordomo at vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> -- 
> Gregory Clement, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> http://bootlin.com
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
~Vinod

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

* [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
  2018-03-01  8:25     ` Vinod Koul
@ 2018-03-01  8:37       ` Gregory CLEMENT
  2018-03-02  4:23         ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Gregory CLEMENT @ 2018-03-01  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vinod,
 
 On jeu., mars 01 2018, Vinod Koul <vinod.koul@intel.com> wrote:


>> >>  Optional properties:
>> >> -- clocks: Optional reference to the clock used by the XOR engine.
>> >> +- clocks: Optional reference to the clocks used by the XOR engine.
>> >> +- clock-names: mandatory if there is a second clock, in this case the
>> >> +   name must be "core" for the first clock and "reg" for the second
>> >> +   one
>> >> +
>> >>  
>> >>  Example:
>> >>  
>> >> diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
>> >> index f652a0e0f5a2..93b3d80ce701 100644
>> >> --- a/drivers/dma/mv_xor_v2.c
>> >> +++ b/drivers/dma/mv_xor_v2.c
>> >> @@ -163,6 +163,7 @@ struct mv_xor_v2_device {
>> >>  	void __iomem *dma_base;
>> >>  	void __iomem *glob_base;
>> >>  	struct clk *clk;
>> >> +	struct clk *reg_clk;
>> >>  	struct tasklet_struct irq_tasklet;
>> >>  	struct list_head free_sw_desc;
>> >>  	struct dma_device dmadev;
>> >> @@ -749,13 +750,24 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
>> >>  	if (ret)
>> >>  		return ret;
>> >>  
>> >> -	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
>> >> -	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
>> >> +	xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg");
>> >
>> > is this an exiting property?
>> 
>> It is the name of the new optional clock described in the first part of
>> this patch.
>
> okay I am missing something then, you are reading "reg" but property added is
> "clock-names", where are you reading this?

"reg" is actually the _name_ of the clock given by the clock-names
property.

With devm_clk_get the second parameter is a pointer to the name of the
clock name. When it is NULL then, the first clock is used, else in the
common clock framework looks for the clock associated with the name
given.

With this patch both clock have now a name, but in order to be backward
compatible, I don't use the name for the first clock. It allows to still
use this clock with a device tree using the old binding.

Gregory


>
>> 
>> About the typo, do you need a new version or do you plan to fix them
>> while applying the patch?
>> 
>> Thanks,
>> 
>> Gregory
>> 
>> 
>> >
>> >> +	if (!IS_ERR(xor_dev->reg_clk)) {
>> >> +		ret = clk_prepare_enable(xor_dev->reg_clk);
>> >> +		if (ret)
>> >> +			return ret;
>> >> +	} else if (PTR_ERR(xor_dev->reg_clk) == -EPROBE_DEFER) {
>> >>  		return -EPROBE_DEFER;
>> >> +	}
>> >> +
>> >> +	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
>> >> +	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) {
>> >> +		ret = EPROBE_DEFER;
>> >> +		goto disable_reg_clk;
>> >> +	}
>> >>  	if (!IS_ERR(xor_dev->clk)) {
>> >>  		ret = clk_prepare_enable(xor_dev->clk);
>> >>  		if (ret)
>> >> -			return ret;
>> >> +			goto disable_reg_clk;
>> >>  	}
>> >>  
>> >>  	ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1,
>> >> @@ -866,8 +878,9 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
>> >>  free_msi_irqs:
>> >>  	platform_msi_domain_free_irqs(&pdev->dev);
>> >>  disable_clk:
>> >> -	if (!IS_ERR(xor_dev->clk))
>> >> -		clk_disable_unprepare(xor_dev->clk);
>> >> +	clk_disable_unprepare(xor_dev->clk);
>> >> +disable_reg_clk:
>> >> +	clk_disable_unprepare(xor_dev->reg_clk);
>> >>  	return ret;
>> >>  }
>> >>  
>> >> -- 
>> >> 2.15.1
>> >> 
>> >
>> > -- 
>> > ~Vinod
>> > --
>> > To unsubscribe from this list: send the line "unsubscribe dmaengine" in
>> > the body of a message to majordomo at vger.kernel.org
>> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
>> -- 
>> Gregory Clement, Bootlin (formerly Free Electrons)
>> Embedded Linux and Kernel engineering
>> http://bootlin.com
>> --
>> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
>> the body of a message to majordomo at vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> -- 
> ~Vinod

-- 
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

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

* [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
  2018-03-01  8:37       ` Gregory CLEMENT
@ 2018-03-02  4:23         ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2018-03-02  4:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 01, 2018 at 09:37:03AM +0100, Gregory CLEMENT wrote:
> Hi Vinod,
>  
>  On jeu., mars 01 2018, Vinod Koul <vinod.koul@intel.com> wrote:
> 
> 
> >> >>  Optional properties:
> >> >> -- clocks: Optional reference to the clock used by the XOR engine.
> >> >> +- clocks: Optional reference to the clocks used by the XOR engine.
> >> >> +- clock-names: mandatory if there is a second clock, in this case the
> >> >> +   name must be "core" for the first clock and "reg" for the second
> >> >> +   one
> >> >> +
> >> >>  
> >> >>  Example:
> >> >>  
> >> >> diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
> >> >> index f652a0e0f5a2..93b3d80ce701 100644
> >> >> --- a/drivers/dma/mv_xor_v2.c
> >> >> +++ b/drivers/dma/mv_xor_v2.c
> >> >> @@ -163,6 +163,7 @@ struct mv_xor_v2_device {
> >> >>  	void __iomem *dma_base;
> >> >>  	void __iomem *glob_base;
> >> >>  	struct clk *clk;
> >> >> +	struct clk *reg_clk;
> >> >>  	struct tasklet_struct irq_tasklet;
> >> >>  	struct list_head free_sw_desc;
> >> >>  	struct dma_device dmadev;
> >> >> @@ -749,13 +750,24 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
> >> >>  	if (ret)
> >> >>  		return ret;
> >> >>  
> >> >> -	xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
> >> >> -	if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
> >> >> +	xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg");
> >> >
> >> > is this an exiting property?
> >> 
> >> It is the name of the new optional clock described in the first part of
> >> this patch.
> >
> > okay I am missing something then, you are reading "reg" but property added is
> > "clock-names", where are you reading this?
> 
> "reg" is actually the _name_ of the clock given by the clock-names
> property.
> 
> With devm_clk_get the second parameter is a pointer to the name of the
> clock name. When it is NULL then, the first clock is used, else in the
> common clock framework looks for the clock associated with the name
> given.
> 
> With this patch both clock have now a name, but in order to be backward
> compatible, I don't use the name for the first clock. It allows to still
> use this clock with a device tree using the old binding.

Okay fine then, it might help to add this to changelog

> 
> Gregory
> 
> 
> >
> >> 
> >> About the typo, do you need a new version or do you plan to fix them
> >> while applying the patch?

please send an update

Thanks
-- 
~Vinod

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

end of thread, other threads:[~2018-03-02  4:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 16:27 [PATCH] dmaengine: mv_xor_v2: Fix clock resource by adding a register clock Gregory CLEMENT
2018-02-27 15:15 ` Vinod Koul
2018-02-27 15:19   ` Gregory CLEMENT
2018-03-01  8:25     ` Vinod Koul
2018-03-01  8:37       ` Gregory CLEMENT
2018-03-02  4:23         ` 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).