All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "ata: ahci-platform: add reset control support"
@ 2018-04-09  1:32 Kunihiko Hayashi
  2018-04-09  7:02 ` Hans de Goede
  2018-04-09 22:12 ` Tejun Heo
  0 siblings, 2 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2018-04-09  1:32 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, linux-ide
  Cc: Thierry Reding, Rob Herring, Mark Rutland, devicetree,
	linux-kernel, Kunihiko Hayashi

This reverts commit f0f56716fc3e5d547fd7811eb218a30ed0695605.

According to Thierry's view,
https://www.spinics.net/lists/linux-ide/msg55357.html
some hardware-specific drivers already use their own resets,
and the common reset might make a path to occur double controls of resets.

For now, revert the commit that adds reset control support to ahci-platform,
and hold until the solution is confirmed not be affect all hardware-specific
drivers.

Fixes: f0f56716fc3e ("ata: ahci-platform: add reset control support")
Reported-by: Thierry Reding <thierry.reding@gmail.com>
Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 .../devicetree/bindings/ata/ahci-platform.txt      |  1 -
 drivers/ata/ahci.h                                 |  1 -
 drivers/ata/libahci_platform.c                     | 24 +++-------------------
 3 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index f4006d3..c760ecb 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -30,7 +30,6 @@ compatible:
 Optional properties:
 - dma-coherent      : Present if dma operations are coherent
 - clocks            : a list of phandle + clock specifier pairs
-- resets            : a list of phandle + reset specifier pairs
 - target-supply     : regulator for SATA target power
 - phys              : reference to the SATA PHY node
 - phy-names         : must be "sata-phy"
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 4356ef1..a9d996e 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -350,7 +350,6 @@ struct ahci_host_priv {
 	u32			em_msg_type;	/* EM message type */
 	bool			got_runtime_pm; /* Did we do pm_runtime_get? */
 	struct clk		*clks[AHCI_MAX_CLKS]; /* Optional */
-	struct reset_control	*rsts;		/* Optional */
 	struct regulator	**target_pwrs;	/* Optional */
 	/*
 	 * If platform uses PHYs. There is a 1:1 relation between the port number and
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 46a7624..30cc8f1 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -25,7 +25,6 @@
 #include <linux/phy/phy.h>
 #include <linux/pm_runtime.h>
 #include <linux/of_platform.h>
-#include <linux/reset.h>
 #include "ahci.h"
 
 static void ahci_host_stop(struct ata_host *host);
@@ -196,8 +195,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators);
  * following order:
  * 1) Regulator
  * 2) Clocks (through ahci_platform_enable_clks)
- * 3) Resets
- * 4) Phys
+ * 3) Phys
  *
  * If resource enabling fails at any point the previous enabled resources
  * are disabled in reverse order.
@@ -217,19 +215,12 @@ int ahci_platform_enable_resources(struct ahci_host_priv *hpriv)
 	if (rc)
 		goto disable_regulator;
 
-	rc = reset_control_deassert(hpriv->rsts);
-	if (rc)
-		goto disable_clks;
-
 	rc = ahci_platform_enable_phys(hpriv);
 	if (rc)
-		goto disable_resets;
+		goto disable_clks;
 
 	return 0;
 
-disable_resets:
-	reset_control_assert(hpriv->rsts);
-
 disable_clks:
 	ahci_platform_disable_clks(hpriv);
 
@@ -248,15 +239,12 @@ EXPORT_SYMBOL_GPL(ahci_platform_enable_resources);
  * following order:
  * 1) Phys
  * 2) Clocks (through ahci_platform_disable_clks)
- * 3) Resets
- * 4) Regulator
+ * 3) Regulator
  */
 void ahci_platform_disable_resources(struct ahci_host_priv *hpriv)
 {
 	ahci_platform_disable_phys(hpriv);
 
-	reset_control_assert(hpriv->rsts);
-
 	ahci_platform_disable_clks(hpriv);
 
 	ahci_platform_disable_regulators(hpriv);
@@ -405,12 +393,6 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
 		hpriv->clks[i] = clk;
 	}
 
-	hpriv->rsts = devm_reset_control_array_get_optional_shared(dev);
-	if (IS_ERR(hpriv->rsts)) {
-		rc = PTR_ERR(hpriv->rsts);
-		goto err_out;
-	}
-
 	hpriv->nports = child_nodes = of_get_child_count(dev->of_node);
 
 	/*
-- 
2.7.4

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

* Re: [PATCH] Revert "ata: ahci-platform: add reset control support"
  2018-04-09  1:32 [PATCH] Revert "ata: ahci-platform: add reset control support" Kunihiko Hayashi
@ 2018-04-09  7:02 ` Hans de Goede
  2018-04-18  8:36   ` Thierry Reding
  2018-04-09 22:12 ` Tejun Heo
  1 sibling, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2018-04-09  7:02 UTC (permalink / raw)
  To: Kunihiko Hayashi, Tejun Heo, linux-ide
  Cc: Thierry Reding, Rob Herring, Mark Rutland, devicetree, linux-kernel

HI,

On 09-04-18 03:32, Kunihiko Hayashi wrote:
> This reverts commit f0f56716fc3e5d547fd7811eb218a30ed0695605.
> 
> According to Thierry's view,
> https://www.spinics.net/lists/linux-ide/msg55357.html
> some hardware-specific drivers already use their own resets,
> and the common reset might make a path to occur double controls of resets.
> 
> For now, revert the commit that adds reset control support to ahci-platform,
> and hold until the solution is confirmed not be affect all hardware-specific
> drivers.
> 
> Fixes: f0f56716fc3e ("ata: ahci-platform: add reset control support")
> Reported-by: Thierry Reding <thierry.reding@gmail.com>
> Suggested-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>   .../devicetree/bindings/ata/ahci-platform.txt      |  1 -
>   drivers/ata/ahci.h                                 |  1 -
>   drivers/ata/libahci_platform.c                     | 24 +++-------------------
>   3 files changed, 3 insertions(+), 23 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> index f4006d3..c760ecb 100644
> --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> @@ -30,7 +30,6 @@ compatible:
>   Optional properties:
>   - dma-coherent      : Present if dma operations are coherent
>   - clocks            : a list of phandle + clock specifier pairs
> -- resets            : a list of phandle + reset specifier pairs
>   - target-supply     : regulator for SATA target power
>   - phys              : reference to the SATA PHY node
>   - phy-names         : must be "sata-phy"
> diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
> index 4356ef1..a9d996e 100644
> --- a/drivers/ata/ahci.h
> +++ b/drivers/ata/ahci.h
> @@ -350,7 +350,6 @@ struct ahci_host_priv {
>   	u32			em_msg_type;	/* EM message type */
>   	bool			got_runtime_pm; /* Did we do pm_runtime_get? */
>   	struct clk		*clks[AHCI_MAX_CLKS]; /* Optional */
> -	struct reset_control	*rsts;		/* Optional */
>   	struct regulator	**target_pwrs;	/* Optional */
>   	/*
>   	 * If platform uses PHYs. There is a 1:1 relation between the port number and
> diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> index 46a7624..30cc8f1 100644
> --- a/drivers/ata/libahci_platform.c
> +++ b/drivers/ata/libahci_platform.c
> @@ -25,7 +25,6 @@
>   #include <linux/phy/phy.h>
>   #include <linux/pm_runtime.h>
>   #include <linux/of_platform.h>
> -#include <linux/reset.h>
>   #include "ahci.h"
>   
>   static void ahci_host_stop(struct ata_host *host);
> @@ -196,8 +195,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators);
>    * following order:
>    * 1) Regulator
>    * 2) Clocks (through ahci_platform_enable_clks)
> - * 3) Resets
> - * 4) Phys
> + * 3) Phys
>    *
>    * If resource enabling fails at any point the previous enabled resources
>    * are disabled in reverse order.
> @@ -217,19 +215,12 @@ int ahci_platform_enable_resources(struct ahci_host_priv *hpriv)
>   	if (rc)
>   		goto disable_regulator;
>   
> -	rc = reset_control_deassert(hpriv->rsts);
> -	if (rc)
> -		goto disable_clks;
> -
>   	rc = ahci_platform_enable_phys(hpriv);
>   	if (rc)
> -		goto disable_resets;
> +		goto disable_clks;
>   
>   	return 0;
>   
> -disable_resets:
> -	reset_control_assert(hpriv->rsts);
> -
>   disable_clks:
>   	ahci_platform_disable_clks(hpriv);
>   
> @@ -248,15 +239,12 @@ EXPORT_SYMBOL_GPL(ahci_platform_enable_resources);
>    * following order:
>    * 1) Phys
>    * 2) Clocks (through ahci_platform_disable_clks)
> - * 3) Resets
> - * 4) Regulator
> + * 3) Regulator
>    */
>   void ahci_platform_disable_resources(struct ahci_host_priv *hpriv)
>   {
>   	ahci_platform_disable_phys(hpriv);
>   
> -	reset_control_assert(hpriv->rsts);
> -
>   	ahci_platform_disable_clks(hpriv);
>   
>   	ahci_platform_disable_regulators(hpriv);
> @@ -405,12 +393,6 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
>   		hpriv->clks[i] = clk;
>   	}
>   
> -	hpriv->rsts = devm_reset_control_array_get_optional_shared(dev);
> -	if (IS_ERR(hpriv->rsts)) {
> -		rc = PTR_ERR(hpriv->rsts);
> -		goto err_out;
> -	}
> -
>   	hpriv->nports = child_nodes = of_get_child_count(dev->of_node);
>   
>   	/*
> 

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

* Re: [PATCH] Revert "ata: ahci-platform: add reset control support"
  2018-04-09  1:32 [PATCH] Revert "ata: ahci-platform: add reset control support" Kunihiko Hayashi
  2018-04-09  7:02 ` Hans de Goede
@ 2018-04-09 22:12 ` Tejun Heo
  1 sibling, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2018-04-09 22:12 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Hans de Goede, linux-ide, Thierry Reding, Rob Herring,
	Mark Rutland, devicetree, linux-kernel

On Mon, Apr 09, 2018 at 10:32:34AM +0900, Kunihiko Hayashi wrote:
> This reverts commit f0f56716fc3e5d547fd7811eb218a30ed0695605.
> 
> According to Thierry's view,
> https://www.spinics.net/lists/linux-ide/msg55357.html
> some hardware-specific drivers already use their own resets,
> and the common reset might make a path to occur double controls of resets.
> 
> For now, revert the commit that adds reset control support to ahci-platform,
> and hold until the solution is confirmed not be affect all hardware-specific
> drivers.
> 
> Fixes: f0f56716fc3e ("ata: ahci-platform: add reset control support")
> Reported-by: Thierry Reding <thierry.reding@gmail.com>
> Suggested-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>

Applied to libata/for-4.17-fixes.

Thanks.

-- 
tejun

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

* Re: [PATCH] Revert "ata: ahci-platform: add reset control support"
  2018-04-09  7:02 ` Hans de Goede
@ 2018-04-18  8:36   ` Thierry Reding
  2018-04-26 19:20     ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2018-04-18  8:36 UTC (permalink / raw)
  To: Tejun Heo, linux-ide
  Cc: Kunihiko Hayashi, Rob Herring, Mark Rutland, Hans de Goede,
	devicetree, linux-kernel

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

On Mon, Apr 09, 2018 at 09:02:33AM +0200, Hans de Goede wrote:
> HI,
> 
> On 09-04-18 03:32, Kunihiko Hayashi wrote:
> > This reverts commit f0f56716fc3e5d547fd7811eb218a30ed0695605.
> > 
> > According to Thierry's view,
> > https://www.spinics.net/lists/linux-ide/msg55357.html
> > some hardware-specific drivers already use their own resets,
> > and the common reset might make a path to occur double controls of resets.
> > 
> > For now, revert the commit that adds reset control support to ahci-platform,
> > and hold until the solution is confirmed not be affect all hardware-specific
> > drivers.
> > 
> > Fixes: f0f56716fc3e ("ata: ahci-platform: add reset control support")
> > Reported-by: Thierry Reding <thierry.reding@gmail.com>
> > Suggested-by: Hans de Goede <hdegoede@redhat.com>
> > Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> 
> Acked-by: Hans de Goede <hdegoede@redhat.com>

Hi Tejun,

I see that you've applied this to your for-next branch. However, this is
a fix that needs to go into v4.17 because that's where the regression
was introduced. Is there any way you can promote this to a fixes branch?

Thanks,
Thierry

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

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

* Re: [PATCH] Revert "ata: ahci-platform: add reset control support"
  2018-04-18  8:36   ` Thierry Reding
@ 2018-04-26 19:20     ` Tejun Heo
  2018-04-27  9:28       ` Thierry Reding
  0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2018-04-26 19:20 UTC (permalink / raw)
  To: Thierry Reding
  Cc: linux-ide, Kunihiko Hayashi, Rob Herring, Mark Rutland,
	Hans de Goede, devicetree, linux-kernel

Hello,

On Wed, Apr 18, 2018 at 10:36:47AM +0200, Thierry Reding wrote:
> I see that you've applied this to your for-next branch. However, this is
> a fix that needs to go into v4.17 because that's where the regression
> was introduced. Is there any way you can promote this to a fixes branch?

It's in for-4.17-fixes.  I'll push it out early next week.

Thanks.

-- 
tejun

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

* Re: [PATCH] Revert "ata: ahci-platform: add reset control support"
  2018-04-26 19:20     ` Tejun Heo
@ 2018-04-27  9:28       ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2018-04-27  9:28 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-ide, Kunihiko Hayashi, Rob Herring, Mark Rutland,
	Hans de Goede, devicetree, linux-kernel

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

On Thu, Apr 26, 2018 at 12:20:40PM -0700, Tejun Heo wrote:
> Hello,
> 
> On Wed, Apr 18, 2018 at 10:36:47AM +0200, Thierry Reding wrote:
> > I see that you've applied this to your for-next branch. However, this is
> > a fix that needs to go into v4.17 because that's where the regression
> > was introduced. Is there any way you can promote this to a fixes branch?
> 
> It's in for-4.17-fixes.  I'll push it out early next week.

Great, thanks!

Thierry

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

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

end of thread, other threads:[~2018-04-27  9:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-09  1:32 [PATCH] Revert "ata: ahci-platform: add reset control support" Kunihiko Hayashi
2018-04-09  7:02 ` Hans de Goede
2018-04-18  8:36   ` Thierry Reding
2018-04-26 19:20     ` Tejun Heo
2018-04-27  9:28       ` Thierry Reding
2018-04-09 22:12 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.