* [PATCH 0/2] ata: ahci_brcm: Follow-up changes for BCM7216
@ 2020-01-06 18:58 Florian Fainelli
2020-01-06 18:58 ` [PATCH 1/2] ata: ahci_brcm: Perform reset after obtaining resources Florian Fainelli
2020-01-06 18:58 ` [PATCH 2/2] ata: ahci_brcm: BCM7216 reset is self de-asserting Florian Fainelli
0 siblings, 2 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-01-06 18:58 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
Hi Jens,
These two 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 two 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!
Florian Fainelli (2):
ata: ahci_brcm: Perform reset after obtaining resources
ata: ahci_brcm: BCM7216 reset is self de-asserting
drivers/ata/ahci_brcm.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ata: ahci_brcm: Perform reset after obtaining resources
2020-01-06 18:58 [PATCH 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Florian Fainelli
@ 2020-01-06 18:58 ` Florian Fainelli
2020-01-06 19:02 ` Florian Fainelli
2020-01-06 18:58 ` [PATCH 2/2] ata: ahci_brcm: BCM7216 reset is self de-asserting Florian Fainelli
1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2020-01-06 18:58 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
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 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 13ceca687104..c3137ec9fb1c 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -453,10 +453,6 @@ static int brcm_ahci_probe(struct platform_device *pdev)
else
reset_name = "ahci";
- priv->rcdev = devm_reset_control_get(&pdev->dev, reset_name);
- if (!IS_ERR_OR_NULL(priv->rcdev))
- reset_control_deassert(priv->rcdev);
-
hpriv = ahci_platform_get_resources(pdev, 0);
if (IS_ERR(hpriv)) {
ret = PTR_ERR(hpriv);
@@ -478,6 +474,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
break;
}
+ priv->rcdev = devm_reset_control_get(&pdev->dev, reset_name);
+ if (!IS_ERR_OR_NULL(priv->rcdev))
+ reset_control_deassert(priv->rcdev);
+
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 2/2] ata: ahci_brcm: BCM7216 reset is self de-asserting
2020-01-06 18:58 [PATCH 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Florian Fainelli
2020-01-06 18:58 ` [PATCH 1/2] ata: ahci_brcm: Perform reset after obtaining resources Florian Fainelli
@ 2020-01-06 18:58 ` Florian Fainelli
1 sibling, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-01-06 18:58 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
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 c3137ec9fb1c..5c9fcdb8df96 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -363,8 +363,12 @@ static int brcm_ahci_resume(struct device *dev)
struct brcm_ahci_priv *priv = hpriv->plat_data;
int ret = 0;
- if (!IS_ERR_OR_NULL(priv->rcdev))
- ret = reset_control_deassert(priv->rcdev);
+ if (!IS_ERR_OR_NULL(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,8 +479,12 @@ static int brcm_ahci_probe(struct platform_device *pdev)
}
priv->rcdev = devm_reset_control_get(&pdev->dev, reset_name);
- if (!IS_ERR_OR_NULL(priv->rcdev))
- reset_control_deassert(priv->rcdev);
+ if (!IS_ERR_OR_NULL(priv->rcdev)) {
+ if (priv->version == BRCM_SATA_BCM7216)
+ reset_control_reset(priv->rcdev);
+ else
+ reset_control_deassert(priv->rcdev);
+ }
ret = ahci_platform_enable_clks(hpriv);
if (ret)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ata: ahci_brcm: Perform reset after obtaining resources
2020-01-06 18:58 ` [PATCH 1/2] ata: ahci_brcm: Perform reset after obtaining resources Florian Fainelli
@ 2020-01-06 19:02 ` Florian Fainelli
0 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-01-06 19:02 UTC (permalink / raw)
To: linux-kernel
Cc: 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
On 1/6/20 10:58 AM, Florian Fainelli wrote:
> 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 | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
> index 13ceca687104..c3137ec9fb1c 100644
> --- a/drivers/ata/ahci_brcm.c
> +++ b/drivers/ata/ahci_brcm.c
> @@ -453,10 +453,6 @@ static int brcm_ahci_probe(struct platform_device *pdev)
> else
> reset_name = "ahci";
>
> - priv->rcdev = devm_reset_control_get(&pdev->dev, reset_name);
> - if (!IS_ERR_OR_NULL(priv->rcdev))
> - reset_control_deassert(priv->rcdev);
> -
> hpriv = ahci_platform_get_resources(pdev, 0);
> if (IS_ERR(hpriv)) {
> ret = PTR_ERR(hpriv);
> @@ -478,6 +474,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
> break;
> }
I forgot to update the error label path because of this move I will
submit a v2 shortly, sorry about that.
--
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-06 19:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 18:58 [PATCH 0/2] ata: ahci_brcm: Follow-up changes for BCM7216 Florian Fainelli
2020-01-06 18:58 ` [PATCH 1/2] ata: ahci_brcm: Perform reset after obtaining resources Florian Fainelli
2020-01-06 19:02 ` Florian Fainelli
2020-01-06 18:58 ` [PATCH 2/2] ata: ahci_brcm: BCM7216 reset is self de-asserting Florian Fainelli
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.