* [PATCH v4 1/2] ata: ahci_brcm: Perform reset after obtaining resources
2020-01-17 23:53 [PATCH v4 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Florian Fainelli
@ 2020-01-17 23:53 ` Florian Fainelli
2020-01-17 23:53 ` [PATCH v4 2/2] ata: ahci_brcm: BCM7216 reset is self de-asserting Florian Fainelli
2020-01-18 0:14 ` [PATCH v4 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-01-17 23:53 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, Jens Axboe, Rob Herring, Mark Rutland,
Hans de Goede, Philipp Zabel, Tejun Heo, Jaedon Shin,
open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
bcm-kernel-feedback-list
Resources such as clocks, PHYs, regulators are likely to get a probe
deferral return code, which could lead to the AHCI controller being
reset a few times until it gets successfully probed. Since this is
typically the most time consuming operation, move it after the resources
have been acquired.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/ata/ahci_brcm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 7ac1141c6ad0..e32c8fe729ff 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -456,13 +456,9 @@ static int brcm_ahci_probe(struct platform_device *pdev)
if (IS_ERR(priv->rcdev))
return PTR_ERR(priv->rcdev);
- reset_control_deassert(priv->rcdev);
-
hpriv = ahci_platform_get_resources(pdev, 0);
- if (IS_ERR(hpriv)) {
- ret = PTR_ERR(hpriv);
- goto out_reset;
- }
+ if (IS_ERR(hpriv))
+ return PTR_ERR(hpriv);
hpriv->plat_data = priv;
hpriv->flags = AHCI_HFLAG_WAKE_BEFORE_STOP | AHCI_HFLAG_NO_WRITE_TO_RO;
@@ -479,6 +475,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
break;
}
+ ret = reset_control_deassert(priv->rcdev);
+ if (ret)
+ return ret;
+
ret = ahci_platform_enable_clks(hpriv);
if (ret)
goto out_reset;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH v4 2/2] ata: ahci_brcm: BCM7216 reset is self de-asserting
2020-01-17 23:53 [PATCH v4 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Florian Fainelli
2020-01-17 23:53 ` [PATCH v4 1/2] ata: ahci_brcm: Perform reset after obtaining resources Florian Fainelli
@ 2020-01-17 23:53 ` Florian Fainelli
2020-01-18 0:14 ` [PATCH v4 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-01-17 23:53 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, Jens Axboe, Rob Herring, Mark Rutland,
Hans de Goede, Philipp Zabel, Tejun Heo, Jaedon Shin,
open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
bcm-kernel-feedback-list
The BCM7216 reset controller line is self-deasserting, unlike other
platforms, so make use of reset_control_reset() instead of
reset_control_deassert().
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/ata/ahci_brcm.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index e32c8fe729ff..6853dbb4131d 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -352,7 +352,8 @@ static int brcm_ahci_suspend(struct device *dev)
else
ret = 0;
- reset_control_assert(priv->rcdev);
+ if (priv->version != BRCM_SATA_BCM7216)
+ reset_control_assert(priv->rcdev);
return ret;
}
@@ -364,7 +365,10 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev)
struct brcm_ahci_priv *priv = hpriv->plat_data;
int ret = 0;
- ret = reset_control_deassert(priv->rcdev);
+ if (priv->version == BRCM_SATA_BCM7216)
+ ret = reset_control_reset(priv->rcdev);
+ else
+ ret = reset_control_deassert(priv->rcdev);
if (ret)
return ret;
@@ -475,7 +479,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
break;
}
- ret = reset_control_deassert(priv->rcdev);
+ if (priv->version == BRCM_SATA_BCM7216)
+ ret = reset_control_reset(priv->rcdev);
+ else
+ ret = reset_control_deassert(priv->rcdev);
if (ret)
return ret;
@@ -520,7 +527,8 @@ static int brcm_ahci_probe(struct platform_device *pdev)
out_disable_clks:
ahci_platform_disable_clks(hpriv);
out_reset:
- reset_control_assert(priv->rcdev);
+ if (priv->version != BRCM_SATA_BCM7216)
+ reset_control_assert(priv->rcdev);
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4 0/2] ata: ahci_brcm: Follow-up changes for BCM7216
2020-01-17 23:53 [PATCH v4 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Florian Fainelli
2020-01-17 23:53 ` [PATCH v4 1/2] ata: ahci_brcm: Perform reset after obtaining resources Florian Fainelli
2020-01-17 23:53 ` [PATCH v4 2/2] ata: ahci_brcm: BCM7216 reset is self de-asserting Florian Fainelli
@ 2020-01-18 0:14 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2020-01-18 0:14 UTC (permalink / raw)
To: Florian Fainelli, linux-kernel
Cc: Rob Herring, Mark Rutland, Hans de Goede, Philipp Zabel,
Tejun Heo, Jaedon Shin,
open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
bcm-kernel-feedback-list
On 1/17/20 4:53 PM, Florian Fainelli wrote:
> Hi Jens,
>
> These three patches are a follow-up to my previous series titled: ata:
> ahci_brcm: Fixes and new device support.
>
> After submitting the BCM7216 RESCAL reset driver, Philipp the reset
> controller maintained indicated that the reset line should be self
> de-asserting and so reset_control_reset() should be used instead.
>
> These three patches update the driver in that regard. It would be great if
> you could apply those and get them queued up for 5.6 since they are
> directly related to the previous series.
Thanks, applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread