linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers
@ 2018-08-22  7:36 Kunihiko Hayashi
  2018-08-22  7:36 ` [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset Kunihiko Hayashi
                   ` (14 more replies)
  0 siblings, 15 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:36 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Add support to get and control a list of resets for the device, and
add the flag indicating whether to use the reset. Existing drivers
set 0 to this flags.

This series solves the issue of the previous patch [1] that was already
reverted [2].
[1] https://www.spinics.net/lists/linux-ide/msg55299.html
[2] https://www.spinics.net/lists/linux-ide/msg55379.html

Kunihiko Hayashi (14):
  ata: ahci-platform: add reset control support and the flag to specify
    using reset
  ata: ahci_brcm: add second argument of ahci_platform_get_resources()
  ata: ahci_ceva: add second argument of ahci_platform_get_resources()
  ata: ahci_da850: add second argument of ahci_platform_get_resources()
  ata: ahci_dm816: add second argument of ahci_platform_get_resources()
  ata: ahci_imx: add second argument of ahci_platform_get_resources()
  ata: ahci_brcm: add second argument of ahci_platform_get_resources()
  ata: ahci_mvebu: add second argument of ahci_platform_get_resources()
  ata: ahci_qoriq: add second argument of ahci_platform_get_resources()
  ata: ahci_seattle: add second argument of
    ahci_platform_get_resources()
  ata: ahci_st: add second argument of ahci_platform_get_resources()
  ata: ahci_sunxi: add second argument of ahci_platform_get_resources()
  ata: ahci_tegra: add second argument of ahci_platform_get_resources()
  ata: ahci_xgene: add second argument of ahci_platform_get_resources()

 .../devicetree/bindings/ata/ahci-platform.txt      |  1 +
 drivers/ata/ahci.h                                 |  1 +
 drivers/ata/ahci_brcm.c                            |  2 +-
 drivers/ata/ahci_ceva.c                            |  2 +-
 drivers/ata/ahci_da850.c                           |  2 +-
 drivers/ata/ahci_dm816.c                           |  2 +-
 drivers/ata/ahci_imx.c                             |  2 +-
 drivers/ata/ahci_mtk.c                             |  2 +-
 drivers/ata/ahci_mvebu.c                           |  2 +-
 drivers/ata/ahci_platform.c                        |  3 +-
 drivers/ata/ahci_qoriq.c                           |  2 +-
 drivers/ata/ahci_seattle.c                         |  2 +-
 drivers/ata/ahci_st.c                              |  2 +-
 drivers/ata/ahci_sunxi.c                           |  2 +-
 drivers/ata/ahci_tegra.c                           |  2 +-
 drivers/ata/ahci_xgene.c                           |  2 +-
 drivers/ata/libahci_platform.c                     | 35 ++++++++++++++++++----
 include/linux/ahci_platform.h                      |  4 ++-
 18 files changed, 49 insertions(+), 21 deletions(-)

-- 
2.7.4


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

* [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
@ 2018-08-22  7:36 ` Kunihiko Hayashi
  2018-08-22  9:34   ` Sergei Shtylyov
  2018-08-22  7:36 ` [PATCH 02/14] ata: ahci_brcm: add second argument of ahci_platform_get_resources() Kunihiko Hayashi
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:36 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi, Thierry Reding

Add support to get and control a list of resets for the device
as optional and shared. These resets must be kept de-asserted until
the device is enabled.

This is specified as shared because some SoCs like UniPhier series
have common reset controls with all ahci controller instances.

However, 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 make a path to occur double controls of resets.

Now this add the flag to ahci_platform_get_resources() indicating
whether to use the resources, currently resets only, and existing
drivers set 0 to this flags.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 .../devicetree/bindings/ata/ahci-platform.txt      |  1 +
 drivers/ata/ahci.h                                 |  1 +
 drivers/ata/ahci_platform.c                        |  3 +-
 drivers/ata/libahci_platform.c                     | 35 ++++++++++++++++++----
 include/linux/ahci_platform.h                      |  4 ++-
 5 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index 6637666..5d5bd45 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -29,6 +29,7 @@ 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 1609eba..6a1515f 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -350,6 +350,7 @@ 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/ahci_platform.c b/drivers/ata/ahci_platform.c
index 564570e..46f0bd7 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -43,7 +43,8 @@ static int ahci_probe(struct platform_device *pdev)
 	struct ahci_host_priv *hpriv;
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev,
+					    AHCI_PLATFORM_GET_RESETS);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 8fbb532..c92c10d 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -25,6 +25,7 @@
 #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);
@@ -195,7 +196,8 @@ EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators);
  * following order:
  * 1) Regulator
  * 2) Clocks (through ahci_platform_enable_clks)
- * 3) Phys
+ * 3) Resets
+ * 4) Phys
  *
  * If resource enabling fails at any point the previous enabled resources
  * are disabled in reverse order.
@@ -215,12 +217,19 @@ int ahci_platform_enable_resources(struct ahci_host_priv *hpriv)
 	if (rc)
 		goto disable_regulator;
 
-	rc = ahci_platform_enable_phys(hpriv);
+	rc = reset_control_deassert(hpriv->rsts);
 	if (rc)
 		goto disable_clks;
 
+	rc = ahci_platform_enable_phys(hpriv);
+	if (rc)
+		goto disable_resets;
+
 	return 0;
 
+disable_resets:
+	reset_control_assert(hpriv->rsts);
+
 disable_clks:
 	ahci_platform_disable_clks(hpriv);
 
@@ -238,13 +247,16 @@ EXPORT_SYMBOL_GPL(ahci_platform_enable_resources);
  * This function disables all ahci_platform managed resources in the
  * following order:
  * 1) Phys
- * 2) Clocks (through ahci_platform_disable_clks)
- * 3) Regulator
+ * 2) Resets
+ * 3) Clocks (through ahci_platform_disable_clks)
+ * 4) 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);
@@ -332,6 +344,7 @@ static int ahci_platform_get_regulator(struct ahci_host_priv *hpriv, u32 port,
 /**
  * ahci_platform_get_resources - Get platform resources
  * @pdev: platform device to get resources for
+ * @flags: bitmap representing the resource to get
  *
  * This function allocates an ahci_host_priv struct, and gets the following
  * resources, storing a reference to them inside the returned struct:
@@ -340,12 +353,14 @@ static int ahci_platform_get_regulator(struct ahci_host_priv *hpriv, u32 port,
  * 2) regulator for controlling the targets power (optional)
  * 3) 0 - AHCI_MAX_CLKS clocks, as specified in the devs devicetree node,
  *    or for non devicetree enabled platforms a single clock
- * 4) phys (optional)
+ * 4) resets, if flags has AHCI_PLATFORM_GET_RESETS (optional)
+ * 5) phys (optional)
  *
  * RETURNS:
  * The allocated ahci_host_priv on success, otherwise an ERR_PTR value
  */
-struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
+struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
+						   unsigned int flags)
 {
 	struct device *dev = &pdev->dev;
 	struct ahci_host_priv *hpriv;
@@ -393,6 +408,14 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev)
 		hpriv->clks[i] = clk;
 	}
 
+	if (flags & AHCI_PLATFORM_GET_RESETS) {
+		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);
 
 	/*
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h
index 1b0a17b..eaedca5f 100644
--- a/include/linux/ahci_platform.h
+++ b/include/linux/ahci_platform.h
@@ -30,7 +30,7 @@ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv);
 int ahci_platform_enable_resources(struct ahci_host_priv *hpriv);
 void ahci_platform_disable_resources(struct ahci_host_priv *hpriv);
 struct ahci_host_priv *ahci_platform_get_resources(
-	struct platform_device *pdev);
+	struct platform_device *pdev, unsigned int flags);
 int ahci_platform_init_host(struct platform_device *pdev,
 			    struct ahci_host_priv *hpriv,
 			    const struct ata_port_info *pi_template,
@@ -43,4 +43,6 @@ int ahci_platform_resume_host(struct device *dev);
 int ahci_platform_suspend(struct device *dev);
 int ahci_platform_resume(struct device *dev);
 
+#define AHCI_PLATFORM_GET_RESETS	0x01
+
 #endif /* _AHCI_PLATFORM_H */
-- 
2.7.4


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

* [PATCH 02/14] ata: ahci_brcm: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
  2018-08-22  7:36 ` [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset Kunihiko Hayashi
@ 2018-08-22  7:36 ` Kunihiko Hayashi
  2018-08-22  7:36 ` [PATCH 03/14] ata: ahci_ceva: " Kunihiko Hayashi
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:36 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_brcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index ea43081..f3d5577 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -425,7 +425,7 @@ static int brcm_ahci_probe(struct platform_device *pdev)
 
 	brcm_sata_phys_enable(priv);
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 	hpriv->plat_data = priv;
-- 
2.7.4


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

* [PATCH 03/14] ata: ahci_ceva: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
  2018-08-22  7:36 ` [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset Kunihiko Hayashi
  2018-08-22  7:36 ` [PATCH 02/14] ata: ahci_brcm: add second argument of ahci_platform_get_resources() Kunihiko Hayashi
@ 2018-08-22  7:36 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 04/14] ata: ahci_da850: " Kunihiko Hayashi
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:36 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_ceva.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index 5ecc9d4..dc78c98 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -213,7 +213,7 @@ static int ceva_ahci_probe(struct platform_device *pdev)
 
 	cevapriv->ahci_pdev = pdev;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 04/14] ata: ahci_da850: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (2 preceding siblings ...)
  2018-08-22  7:36 ` [PATCH 03/14] ata: ahci_ceva: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 05/14] ata: ahci_dm816: " Kunihiko Hayashi
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_da850.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
index 9b34dff..ebaa657 100644
--- a/drivers/ata/ahci_da850.c
+++ b/drivers/ata/ahci_da850.c
@@ -171,7 +171,7 @@ static int ahci_da850_probe(struct platform_device *pdev)
 	u32 mpy;
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 05/14] ata: ahci_dm816: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (3 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 04/14] ata: ahci_da850: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 06/14] ata: ahci_imx: " Kunihiko Hayashi
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_dm816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_dm816.c b/drivers/ata/ahci_dm816.c
index fbd827c..89509c3 100644
--- a/drivers/ata/ahci_dm816.c
+++ b/drivers/ata/ahci_dm816.c
@@ -148,7 +148,7 @@ static int ahci_dm816_probe(struct platform_device *pdev)
 	struct ahci_host_priv *hpriv;
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 06/14] ata: ahci_imx: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (4 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 05/14] ata: ahci_dm816: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 07/14] ata: ahci_brcm: " Kunihiko Hayashi
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 6822e2f..b00799d 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -1127,7 +1127,7 @@ static int imx_ahci_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 07/14] ata: ahci_brcm: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (5 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 06/14] ata: ahci_imx: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 08/14] ata: ahci_mvebu: " Kunihiko Hayashi
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi, Matthias Brugger

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_mtk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
index 0ae6971..8bc1a26 100644
--- a/drivers/ata/ahci_mtk.c
+++ b/drivers/ata/ahci_mtk.c
@@ -142,7 +142,7 @@ static int mtk_ahci_probe(struct platform_device *pdev)
 	if (!plat)
 		return -ENOMEM;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 08/14] ata: ahci_mvebu: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (6 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 07/14] ata: ahci_brcm: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 09/14] ata: ahci_qoriq: " Kunihiko Hayashi
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_mvebu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index 72d90b4..f9cb51b 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -158,7 +158,7 @@ static int ahci_mvebu_probe(struct platform_device *pdev)
 	const struct mbus_dram_target_info *dram;
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 09/14] ata: ahci_qoriq: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (7 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 08/14] ata: ahci_mvebu: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 10/14] ata: ahci_seattle: " Kunihiko Hayashi
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_qoriq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index cfdef4d..ce59253 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -250,7 +250,7 @@ static int ahci_qoriq_probe(struct platform_device *pdev)
 	struct resource *res;
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 10/14] ata: ahci_seattle: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (8 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 09/14] ata: ahci_qoriq: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 11/14] ata: ahci_st: " Kunihiko Hayashi
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_seattle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c
index 1d31c0c..e57b6f9 100644
--- a/drivers/ata/ahci_seattle.c
+++ b/drivers/ata/ahci_seattle.c
@@ -164,7 +164,7 @@ static int ahci_seattle_probe(struct platform_device *pdev)
 	int rc;
 	struct ahci_host_priv *hpriv;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 11/14] ata: ahci_st: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (9 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 10/14] ata: ahci_seattle: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 12/14] ata: ahci_sunxi: " Kunihiko Hayashi
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi, Patrice Chotard

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
index bc345f2..21c5c44 100644
--- a/drivers/ata/ahci_st.c
+++ b/drivers/ata/ahci_st.c
@@ -156,7 +156,7 @@ static int st_ahci_probe(struct platform_device *pdev)
 	if (!drv_data)
 		return -ENOMEM;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 	hpriv->plat_data = drv_data;
-- 
2.7.4


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

* [PATCH 12/14] ata: ahci_sunxi: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (10 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 11/14] ata: ahci_st: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 13/14] ata: ahci_tegra: " Kunihiko Hayashi
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi, Maxime Ripard

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_sunxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
index b264374..631610b 100644
--- a/drivers/ata/ahci_sunxi.c
+++ b/drivers/ata/ahci_sunxi.c
@@ -181,7 +181,7 @@ static int ahci_sunxi_probe(struct platform_device *pdev)
 	struct ahci_host_priv *hpriv;
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 13/14] ata: ahci_tegra: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (11 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 12/14] ata: ahci_sunxi: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  7:37 ` [PATCH 14/14] ata: ahci_xgene: " Kunihiko Hayashi
  2018-08-22  9:27 ` [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Hans de Goede
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi, Thierry Reding

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
index 64d8484..004f260 100644
--- a/drivers/ata/ahci_tegra.c
+++ b/drivers/ata/ahci_tegra.c
@@ -494,7 +494,7 @@ static int tegra_ahci_probe(struct platform_device *pdev)
 	int ret;
 	unsigned int i;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* [PATCH 14/14] ata: ahci_xgene: add second argument of ahci_platform_get_resources()
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (12 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 13/14] ata: ahci_tegra: " Kunihiko Hayashi
@ 2018-08-22  7:37 ` Kunihiko Hayashi
  2018-08-22  9:27 ` [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Hans de Goede
  14 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22  7:37 UTC (permalink / raw)
  To: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Kunihiko Hayashi

Adding a flag to indicate whether acqiring the optional resources
as the second argument of ahci_platform_get_resources(),
add the argument as initial value 0.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/ata/ahci_xgene.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index ad58da7..7e157e1 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -759,7 +759,7 @@ static int xgene_ahci_probe(struct platform_device *pdev)
 					      &xgene_ahci_v2_port_info };
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev);
+	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
-- 
2.7.4


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

* Re: [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers
  2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
                   ` (13 preceding siblings ...)
  2018-08-22  7:37 ` [PATCH 14/14] ata: ahci_xgene: " Kunihiko Hayashi
@ 2018-08-22  9:27 ` Hans de Goede
  2018-08-22 10:06   ` Kunihiko Hayashi
  14 siblings, 1 reply; 19+ messages in thread
From: Hans de Goede @ 2018-08-22  9:27 UTC (permalink / raw)
  To: Kunihiko Hayashi, Tejun Heo, Rob Herring, Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel

Hi,

On 22-08-18 09:36, Kunihiko Hayashi wrote:
> Add support to get and control a list of resets for the device, and
> add the flag indicating whether to use the reset. Existing drivers
> set 0 to this flags.
> 
> This series solves the issue of the previous patch [1] that was already
> reverted [2].
> [1] https://www.spinics.net/lists/linux-ide/msg55299.html
> [2] https://www.spinics.net/lists/linux-ide/msg55379.html
> 
> Kunihiko Hayashi (14):
>    ata: ahci-platform: add reset control support and the flag to specify
>      using reset
>    ata: ahci_brcm: add second argument of ahci_platform_get_resources()
>    ata: ahci_ceva: add second argument of ahci_platform_get_resources()
>    ata: ahci_da850: add second argument of ahci_platform_get_resources()
>    ata: ahci_dm816: add second argument of ahci_platform_get_resources()
>    ata: ahci_imx: add second argument of ahci_platform_get_resources()
>    ata: ahci_brcm: add second argument of ahci_platform_get_resources()
>    ata: ahci_mvebu: add second argument of ahci_platform_get_resources()
>    ata: ahci_qoriq: add second argument of ahci_platform_get_resources()
>    ata: ahci_seattle: add second argument of
>      ahci_platform_get_resources()
>    ata: ahci_st: add second argument of ahci_platform_get_resources()
>    ata: ahci_sunxi: add second argument of ahci_platform_get_resources()
>    ata: ahci_tegra: add second argument of ahci_platform_get_resources()
>    ata: ahci_xgene: add second argument of ahci_platform_get_resources()

When you change a function prototype, you must also change all
the callers in a single commit, so that all intermediate commits
will compile without errors, otherwise you will break git bisect.

Otherwise this looks good.

I suggest you split this like this:

1) Add a flags argument to ahci_platform_get_resources(),
    without adding support for any flags yet, so this just
    changes the function prototype and passes 0 for the new
    flags argument *everywhere* without any other changes
2) Add support for a AHCI_PLATFORM_GET_RESETS flag, basically
    your current first patch, minus the prototype patches
3) A patch which passes AHCI_PLATFORM_GET_RESETS for the
    generic ahci_platform driver (so break this out of your
    first patch). Also describe in the commit message of this
    patch why / for which platforms this is necessary.

The idea of doing 3. separately is that we can easily revert
it in case of problems while keeping the core functionality
in place. Note I do not expect this to be necessary.

Regards,

Hans


> 
>   .../devicetree/bindings/ata/ahci-platform.txt      |  1 +
>   drivers/ata/ahci.h                                 |  1 +
>   drivers/ata/ahci_brcm.c                            |  2 +-
>   drivers/ata/ahci_ceva.c                            |  2 +-
>   drivers/ata/ahci_da850.c                           |  2 +-
>   drivers/ata/ahci_dm816.c                           |  2 +-
>   drivers/ata/ahci_imx.c                             |  2 +-
>   drivers/ata/ahci_mtk.c                             |  2 +-
>   drivers/ata/ahci_mvebu.c                           |  2 +-
>   drivers/ata/ahci_platform.c                        |  3 +-
>   drivers/ata/ahci_qoriq.c                           |  2 +-
>   drivers/ata/ahci_seattle.c                         |  2 +-
>   drivers/ata/ahci_st.c                              |  2 +-
>   drivers/ata/ahci_sunxi.c                           |  2 +-
>   drivers/ata/ahci_tegra.c                           |  2 +-
>   drivers/ata/ahci_xgene.c                           |  2 +-
>   drivers/ata/libahci_platform.c                     | 35 ++++++++++++++++++----
>   include/linux/ahci_platform.h                      |  4 ++-
>   18 files changed, 49 insertions(+), 21 deletions(-)
> 

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

* Re: [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset
  2018-08-22  7:36 ` [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset Kunihiko Hayashi
@ 2018-08-22  9:34   ` Sergei Shtylyov
  2018-08-22 10:06     ` Kunihiko Hayashi
  0 siblings, 1 reply; 19+ messages in thread
From: Sergei Shtylyov @ 2018-08-22  9:34 UTC (permalink / raw)
  To: Kunihiko Hayashi, Tejun Heo, Hans de Goede, Rob Herring,
	Mark Rutland, linux-ide
  Cc: devicetree, linux-kernel, Thierry Reding

Hello!

On 8/22/2018 10:36 AM, Kunihiko Hayashi wrote:

> Add support to get and control a list of resets for the device
> as optional and shared. These resets must be kept de-asserted until
> the device is enabled.
> 
> This is specified as shared because some SoCs like UniPhier series
> have common reset controls with all ahci controller instances.
> 
> However, 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 make a path to occur double controls of resets.
> 
> Now this add the flag to ahci_platform_get_resources() indicating
> whether to use the resources, currently resets only, and existing
> drivers set 0 to this flags.
> 
> Suggested-by: Hans de Goede <hdegoede@redhat.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
[...]

> diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h
> index 1b0a17b..eaedca5f 100644
> --- a/include/linux/ahci_platform.h
> +++ b/include/linux/ahci_platform.h
> @@ -30,7 +30,7 @@ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv);
>   int ahci_platform_enable_resources(struct ahci_host_priv *hpriv);
>   void ahci_platform_disable_resources(struct ahci_host_priv *hpriv);
>   struct ahci_host_priv *ahci_platform_get_resources(
> -	struct platform_device *pdev);
> +	struct platform_device *pdev, unsigned int flags);

    That breaks all the users of this API. You should fix the callers in this 
same patch to avoid breakage.

[...]

MBR, Sergei

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

* Re: [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers
  2018-08-22  9:27 ` [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Hans de Goede
@ 2018-08-22 10:06   ` Kunihiko Hayashi
  0 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22 10:06 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Tejun Heo, Rob Herring, Mark Rutland, linux-ide, devicetree,
	linux-kernel

Hi Hans,

Thank you for your comment.

On Wed, 22 Aug 2018 11:27:18 +0200 <hdegoede@redhat.com> wrote:

> Hi,
> 
> On 22-08-18 09:36, Kunihiko Hayashi wrote:
> > Add support to get and control a list of resets for the device, and
> > add the flag indicating whether to use the reset. Existing drivers
> > set 0 to this flags.
> > > This series solves the issue of the previous patch [1] that was already
> > reverted [2].
> > [1] https://www.spinics.net/lists/linux-ide/msg55299.html
> > [2] https://www.spinics.net/lists/linux-ide/msg55379.html
> > > Kunihiko Hayashi (14):
> >    ata: ahci-platform: add reset control support and the flag to specify
> >      using reset
> >    ata: ahci_brcm: add second argument of ahci_platform_get_resources()
> >    ata: ahci_ceva: add second argument of ahci_platform_get_resources()
> >    ata: ahci_da850: add second argument of ahci_platform_get_resources()
> >    ata: ahci_dm816: add second argument of ahci_platform_get_resources()
> >    ata: ahci_imx: add second argument of ahci_platform_get_resources()
> >    ata: ahci_brcm: add second argument of ahci_platform_get_resources()
> >    ata: ahci_mvebu: add second argument of ahci_platform_get_resources()
> >    ata: ahci_qoriq: add second argument of ahci_platform_get_resources()
> >    ata: ahci_seattle: add second argument of
> >      ahci_platform_get_resources()
> >    ata: ahci_st: add second argument of ahci_platform_get_resources()
> >    ata: ahci_sunxi: add second argument of ahci_platform_get_resources()
> >    ata: ahci_tegra: add second argument of ahci_platform_get_resources()
> >    ata: ahci_xgene: add second argument of ahci_platform_get_resources()
> 
> When you change a function prototype, you must also change all
> the callers in a single commit, so that all intermediate commits
> will compile without errors, otherwise you will break git bisect.

Surely, these splitted patches will make git bisect fail.
I'll collect them in a single commit.

> Otherwise this looks good.
> 
> I suggest you split this like this:
> 
> 1) Add a flags argument to ahci_platform_get_resources(),
>     without adding support for any flags yet, so this just
>     changes the function prototype and passes 0 for the new
>     flags argument *everywhere* without any other changes
> 2) Add support for a AHCI_PLATFORM_GET_RESETS flag, basically
>     your current first patch, minus the prototype patches
> 3) A patch which passes AHCI_PLATFORM_GET_RESETS for the
>     generic ahci_platform driver (so break this out of your
>     first patch). Also describe in the commit message of this
>     patch why / for which platforms this is necessary.
> 
> The idea of doing 3. separately is that we can easily revert
> it in case of problems while keeping the core functionality
> in place. Note I do not expect this to be necessary.

Your split plan will be very useful for bisecting. I'll try it next.

---
Best Regards,
Kunihiko Hayashi



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

* Re: [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset
  2018-08-22  9:34   ` Sergei Shtylyov
@ 2018-08-22 10:06     ` Kunihiko Hayashi
  0 siblings, 0 replies; 19+ messages in thread
From: Kunihiko Hayashi @ 2018-08-22 10:06 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Tejun Heo, Hans de Goede, Rob Herring, Mark Rutland, linux-ide,
	devicetree, linux-kernel, Thierry Reding

Hi Sergei,

On Wed, 22 Aug 2018 12:34:30 +0300 <sergei.shtylyov@cogentembedded.com> wrote:

> Hello!
> 
> On 8/22/2018 10:36 AM, Kunihiko Hayashi wrote:
> 
> > Add support to get and control a list of resets for the device
> > as optional and shared. These resets must be kept de-asserted until
> > the device is enabled.
> > > This is specified as shared because some SoCs like UniPhier series
> > have common reset controls with all ahci controller instances.
> > > However, 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 make a path to occur double controls of resets.
> > > Now this add the flag to ahci_platform_get_resources() indicating
> > whether to use the resources, currently resets only, and existing
> > drivers set 0 to this flags.
> > > Suggested-by: Hans de Goede <hdegoede@redhat.com>
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> [...]
> 
> > diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h
> > index 1b0a17b..eaedca5f 100644
> > --- a/include/linux/ahci_platform.h
> > +++ b/include/linux/ahci_platform.h
> > @@ -30,7 +30,7 @@ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv);
> >   int ahci_platform_enable_resources(struct ahci_host_priv *hpriv);
> >   void ahci_platform_disable_resources(struct ahci_host_priv *hpriv);
> >   struct ahci_host_priv *ahci_platform_get_resources(
> > -	struct platform_device *pdev);
> > +	struct platform_device *pdev, unsigned int flags);
> 
>     That breaks all the users of this API. You should fix the callers in this same patch to avoid breakage.

Thank you for your point.
Indeed, these splitted patches break git bisect. I'll fix it.

---
Best Regards,
Kunihiko Hayashi



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

end of thread, other threads:[~2018-08-22 10:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22  7:36 [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Kunihiko Hayashi
2018-08-22  7:36 ` [PATCH 01/14] ata: ahci-platform: add reset control support and the flag to specify using reset Kunihiko Hayashi
2018-08-22  9:34   ` Sergei Shtylyov
2018-08-22 10:06     ` Kunihiko Hayashi
2018-08-22  7:36 ` [PATCH 02/14] ata: ahci_brcm: add second argument of ahci_platform_get_resources() Kunihiko Hayashi
2018-08-22  7:36 ` [PATCH 03/14] ata: ahci_ceva: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 04/14] ata: ahci_da850: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 05/14] ata: ahci_dm816: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 06/14] ata: ahci_imx: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 07/14] ata: ahci_brcm: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 08/14] ata: ahci_mvebu: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 09/14] ata: ahci_qoriq: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 10/14] ata: ahci_seattle: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 11/14] ata: ahci_st: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 12/14] ata: ahci_sunxi: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 13/14] ata: ahci_tegra: " Kunihiko Hayashi
2018-08-22  7:37 ` [PATCH 14/14] ata: ahci_xgene: " Kunihiko Hayashi
2018-08-22  9:27 ` [PATCH 00/14] ata: ahci-platform: add reset control support except for existing drivers Hans de Goede
2018-08-22 10:06   ` Kunihiko Hayashi

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