linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller
@ 2021-03-12 20:45 Jim Quinlan
  2021-03-12 20:45 ` [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert Jim Quinlan
  2021-04-06 15:42 ` [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller Lorenzo Pieralisi
  0 siblings, 2 replies; 11+ messages in thread
From: Jim Quinlan @ 2021-03-12 20:45 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, james.quinlan, jim2101024
  Cc: Florian Fainelli, Hans de Goede, Jens Axboe, Jim Quinlan,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	Lorenzo Pieralisi, Rob Herring

v5 -- Improved (I hope) commit description (Bjorn).
   -- Rnamed error labels (Krzyszt).
   -- Fixed typos.

v4 -- does not rely on a pending commit, unlike v3.

v3 -- discard commit from v2; instead rely on the new function
      reset_control_rearm provided in a recent commit [1] applied
      to reset/next.
   -- New commit to correct pcie-brcmstb.c usage of a reset controller
      to use reset/rearm verses deassert/assert.

v2 -- refactor rescal-reset driver to implement assert/deassert rather than
      reset because the reset call only fires once per lifetime and we need
      to reset after every resume from S2 or S3.
   -- Split the use of "ahci" and "rescal" controllers in separate fields
      to keep things simple.

v1 -- original

Jim Quinlan (2):
  ata: ahci_brcm: Fix use of BCM7216 reset controller
  PCI: brcmstb: Use reset/rearm instead of deassert/assert

 drivers/ata/ahci_brcm.c               | 46 +++++++++++++--------------
 drivers/pci/controller/pcie-brcmstb.c | 19 +++++++----
 2 files changed, 36 insertions(+), 29 deletions(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
  2021-03-12 20:45 [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller Jim Quinlan
@ 2021-03-12 20:45 ` Jim Quinlan
  2021-03-29 16:06   ` Lorenzo Pieralisi
  2021-03-29 16:10   ` Lorenzo Pieralisi
  2021-04-06 15:42 ` [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller Lorenzo Pieralisi
  1 sibling, 2 replies; 11+ messages in thread
From: Jim Quinlan @ 2021-03-12 20:45 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, james.quinlan, jim2101024
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Florian Fainelli,
	Philipp Zabel, Jim Quinlan,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

The Broadcom STB PCIe RC uses a reset control "rescal" for certain chips.
The "rescal" implements a "pulse reset" so using assert/deassert is wrong
for this device.  Instead, we use reset/rearm.  We need to use rearm so
that we can reset it after a suspend/resume cycle; w/o using "rearm", the
"rescal" device will only ever fire once.

Of course for suspend/resume to work we also need to put the reset/rearm
calls in the suspend and resume routines.

Fixes: 740d6c3708a9 ("PCI: brcmstb: Add control of rescal reset")
Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/pci/controller/pcie-brcmstb.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index e330e6811f0b..3b35d629035e 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1148,6 +1148,7 @@ static int brcm_pcie_suspend(struct device *dev)
 
 	brcm_pcie_turn_off(pcie);
 	ret = brcm_phy_stop(pcie);
+	reset_control_rearm(pcie->rescal);
 	clk_disable_unprepare(pcie->clk);
 
 	return ret;
@@ -1163,9 +1164,13 @@ static int brcm_pcie_resume(struct device *dev)
 	base = pcie->base;
 	clk_prepare_enable(pcie->clk);
 
+	ret = reset_control_reset(pcie->rescal);
+	if (ret)
+		goto err_disable_clk;
+
 	ret = brcm_phy_start(pcie);
 	if (ret)
-		goto err;
+		goto err_reset;
 
 	/* Take bridge out of reset so we can access the SERDES reg */
 	pcie->bridge_sw_init_set(pcie, 0);
@@ -1180,14 +1185,16 @@ static int brcm_pcie_resume(struct device *dev)
 
 	ret = brcm_pcie_setup(pcie);
 	if (ret)
-		goto err;
+		goto err_reset;
 
 	if (pcie->msi)
 		brcm_msi_set_regs(pcie->msi);
 
 	return 0;
 
-err:
+err_reset:
+	reset_control_rearm(pcie->rescal);
+err_disable_clk:
 	clk_disable_unprepare(pcie->clk);
 	return ret;
 }
@@ -1197,7 +1204,7 @@ static void __brcm_pcie_remove(struct brcm_pcie *pcie)
 	brcm_msi_remove(pcie);
 	brcm_pcie_turn_off(pcie);
 	brcm_phy_stop(pcie);
-	reset_control_assert(pcie->rescal);
+	reset_control_rearm(pcie->rescal);
 	clk_disable_unprepare(pcie->clk);
 }
 
@@ -1278,13 +1285,13 @@ static int brcm_pcie_probe(struct platform_device *pdev)
 		return PTR_ERR(pcie->perst_reset);
 	}
 
-	ret = reset_control_deassert(pcie->rescal);
+	ret = reset_control_reset(pcie->rescal);
 	if (ret)
 		dev_err(&pdev->dev, "failed to deassert 'rescal'\n");
 
 	ret = brcm_phy_start(pcie);
 	if (ret) {
-		reset_control_assert(pcie->rescal);
+		reset_control_rearm(pcie->rescal);
 		clk_disable_unprepare(pcie->clk);
 		return ret;
 	}
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
  2021-03-12 20:45 ` [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert Jim Quinlan
@ 2021-03-29 16:06   ` Lorenzo Pieralisi
  2021-03-29 16:10   ` Lorenzo Pieralisi
  1 sibling, 0 replies; 11+ messages in thread
From: Lorenzo Pieralisi @ 2021-03-29 16:06 UTC (permalink / raw)
  To: Jim Quinlan
  Cc: Bjorn Helgaas, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, james.quinlan, Rob Herring,
	Bjorn Helgaas, Florian Fainelli, Philipp Zabel, Jim Quinlan,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

On Fri, Mar 12, 2021 at 03:45:55PM -0500, Jim Quinlan wrote:
> The Broadcom STB PCIe RC uses a reset control "rescal" for certain chips.
> The "rescal" implements a "pulse reset" so using assert/deassert is wrong
> for this device.  Instead, we use reset/rearm.  We need to use rearm so
> that we can reset it after a suspend/resume cycle; w/o using "rearm", the
> "rescal" device will only ever fire once.
> 
> Of course for suspend/resume to work we also need to put the reset/rearm
> calls in the suspend and resume routines.
> 
> Fixes: 740d6c3708a9 ("PCI: brcmstb: Add control of rescal reset")
> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/pci/controller/pcie-brcmstb.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)

Should I take this patch in the PCI queue ?

Thanks,
Lorenzo

> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index e330e6811f0b..3b35d629035e 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -1148,6 +1148,7 @@ static int brcm_pcie_suspend(struct device *dev)
>  
>  	brcm_pcie_turn_off(pcie);
>  	ret = brcm_phy_stop(pcie);
> +	reset_control_rearm(pcie->rescal);
>  	clk_disable_unprepare(pcie->clk);
>  
>  	return ret;
> @@ -1163,9 +1164,13 @@ static int brcm_pcie_resume(struct device *dev)
>  	base = pcie->base;
>  	clk_prepare_enable(pcie->clk);
>  
> +	ret = reset_control_reset(pcie->rescal);
> +	if (ret)
> +		goto err_disable_clk;
> +
>  	ret = brcm_phy_start(pcie);
>  	if (ret)
> -		goto err;
> +		goto err_reset;
>  
>  	/* Take bridge out of reset so we can access the SERDES reg */
>  	pcie->bridge_sw_init_set(pcie, 0);
> @@ -1180,14 +1185,16 @@ static int brcm_pcie_resume(struct device *dev)
>  
>  	ret = brcm_pcie_setup(pcie);
>  	if (ret)
> -		goto err;
> +		goto err_reset;
>  
>  	if (pcie->msi)
>  		brcm_msi_set_regs(pcie->msi);
>  
>  	return 0;
>  
> -err:
> +err_reset:
> +	reset_control_rearm(pcie->rescal);
> +err_disable_clk:
>  	clk_disable_unprepare(pcie->clk);
>  	return ret;
>  }
> @@ -1197,7 +1204,7 @@ static void __brcm_pcie_remove(struct brcm_pcie *pcie)
>  	brcm_msi_remove(pcie);
>  	brcm_pcie_turn_off(pcie);
>  	brcm_phy_stop(pcie);
> -	reset_control_assert(pcie->rescal);
> +	reset_control_rearm(pcie->rescal);
>  	clk_disable_unprepare(pcie->clk);
>  }
>  
> @@ -1278,13 +1285,13 @@ static int brcm_pcie_probe(struct platform_device *pdev)
>  		return PTR_ERR(pcie->perst_reset);
>  	}
>  
> -	ret = reset_control_deassert(pcie->rescal);
> +	ret = reset_control_reset(pcie->rescal);
>  	if (ret)
>  		dev_err(&pdev->dev, "failed to deassert 'rescal'\n");
>  
>  	ret = brcm_phy_start(pcie);
>  	if (ret) {
> -		reset_control_assert(pcie->rescal);
> +		reset_control_rearm(pcie->rescal);
>  		clk_disable_unprepare(pcie->clk);
>  		return ret;
>  	}
> -- 
> 2.17.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
  2021-03-12 20:45 ` [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert Jim Quinlan
  2021-03-29 16:06   ` Lorenzo Pieralisi
@ 2021-03-29 16:10   ` Lorenzo Pieralisi
  2021-03-29 16:50     ` Florian Fainelli
  1 sibling, 1 reply; 11+ messages in thread
From: Lorenzo Pieralisi @ 2021-03-29 16:10 UTC (permalink / raw)
  To: Jim Quinlan
  Cc: Bjorn Helgaas, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, james.quinlan, Rob Herring,
	Bjorn Helgaas, Florian Fainelli, Philipp Zabel, Jim Quinlan,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

On Fri, Mar 12, 2021 at 03:45:55PM -0500, Jim Quinlan wrote:
> The Broadcom STB PCIe RC uses a reset control "rescal" for certain chips.
> The "rescal" implements a "pulse reset" so using assert/deassert is wrong
> for this device.  Instead, we use reset/rearm.  We need to use rearm so
> that we can reset it after a suspend/resume cycle; w/o using "rearm", the
> "rescal" device will only ever fire once.
> 
> Of course for suspend/resume to work we also need to put the reset/rearm
> calls in the suspend and resume routines.

Actually - I am sorry but it looks like you will have to split the patch
in two since this is two logical changes.

Thanks,
Lorenzo

> Fixes: 740d6c3708a9 ("PCI: brcmstb: Add control of rescal reset")
> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/pci/controller/pcie-brcmstb.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index e330e6811f0b..3b35d629035e 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -1148,6 +1148,7 @@ static int brcm_pcie_suspend(struct device *dev)
>  
>  	brcm_pcie_turn_off(pcie);
>  	ret = brcm_phy_stop(pcie);
> +	reset_control_rearm(pcie->rescal);
>  	clk_disable_unprepare(pcie->clk);
>  
>  	return ret;
> @@ -1163,9 +1164,13 @@ static int brcm_pcie_resume(struct device *dev)
>  	base = pcie->base;
>  	clk_prepare_enable(pcie->clk);
>  
> +	ret = reset_control_reset(pcie->rescal);
> +	if (ret)
> +		goto err_disable_clk;
> +
>  	ret = brcm_phy_start(pcie);
>  	if (ret)
> -		goto err;
> +		goto err_reset;
>  
>  	/* Take bridge out of reset so we can access the SERDES reg */
>  	pcie->bridge_sw_init_set(pcie, 0);
> @@ -1180,14 +1185,16 @@ static int brcm_pcie_resume(struct device *dev)
>  
>  	ret = brcm_pcie_setup(pcie);
>  	if (ret)
> -		goto err;
> +		goto err_reset;
>  
>  	if (pcie->msi)
>  		brcm_msi_set_regs(pcie->msi);
>  
>  	return 0;
>  
> -err:
> +err_reset:
> +	reset_control_rearm(pcie->rescal);
> +err_disable_clk:
>  	clk_disable_unprepare(pcie->clk);
>  	return ret;
>  }
> @@ -1197,7 +1204,7 @@ static void __brcm_pcie_remove(struct brcm_pcie *pcie)
>  	brcm_msi_remove(pcie);
>  	brcm_pcie_turn_off(pcie);
>  	brcm_phy_stop(pcie);
> -	reset_control_assert(pcie->rescal);
> +	reset_control_rearm(pcie->rescal);
>  	clk_disable_unprepare(pcie->clk);
>  }
>  
> @@ -1278,13 +1285,13 @@ static int brcm_pcie_probe(struct platform_device *pdev)
>  		return PTR_ERR(pcie->perst_reset);
>  	}
>  
> -	ret = reset_control_deassert(pcie->rescal);
> +	ret = reset_control_reset(pcie->rescal);
>  	if (ret)
>  		dev_err(&pdev->dev, "failed to deassert 'rescal'\n");
>  
>  	ret = brcm_phy_start(pcie);
>  	if (ret) {
> -		reset_control_assert(pcie->rescal);
> +		reset_control_rearm(pcie->rescal);
>  		clk_disable_unprepare(pcie->clk);
>  		return ret;
>  	}
> -- 
> 2.17.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
  2021-03-29 16:10   ` Lorenzo Pieralisi
@ 2021-03-29 16:50     ` Florian Fainelli
  2021-03-29 16:58       ` Lorenzo Pieralisi
  0 siblings, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2021-03-29 16:50 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Jim Quinlan
  Cc: Bjorn Helgaas, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, james.quinlan, Rob Herring,
	Bjorn Helgaas, Florian Fainelli, Philipp Zabel, Jim Quinlan,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

On 3/29/21 9:10 AM, Lorenzo Pieralisi wrote:
> On Fri, Mar 12, 2021 at 03:45:55PM -0500, Jim Quinlan wrote:
>> The Broadcom STB PCIe RC uses a reset control "rescal" for certain chips.
>> The "rescal" implements a "pulse reset" so using assert/deassert is wrong
>> for this device.  Instead, we use reset/rearm.  We need to use rearm so
>> that we can reset it after a suspend/resume cycle; w/o using "rearm", the
>> "rescal" device will only ever fire once.
>>
>> Of course for suspend/resume to work we also need to put the reset/rearm
>> calls in the suspend and resume routines.
> 
> Actually - I am sorry but it looks like you will have to split the patch
> in two since this is two logical changes.

I do not believe this can be easily split, since there is currently a
misused of the reset controller API and this patch fixes all call sites
at once. It would not really make sense to fix probe/remove and then
leave suspend/resume broken in the same manner.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
  2021-03-29 16:50     ` Florian Fainelli
@ 2021-03-29 16:58       ` Lorenzo Pieralisi
  2021-03-29 17:01         ` Florian Fainelli
  0 siblings, 1 reply; 11+ messages in thread
From: Lorenzo Pieralisi @ 2021-03-29 16:58 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Jim Quinlan, Bjorn Helgaas, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, james.quinlan, Rob Herring,
	Bjorn Helgaas, Philipp Zabel, Jim Quinlan,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

On Mon, Mar 29, 2021 at 09:50:13AM -0700, Florian Fainelli wrote:
> On 3/29/21 9:10 AM, Lorenzo Pieralisi wrote:
> > On Fri, Mar 12, 2021 at 03:45:55PM -0500, Jim Quinlan wrote:
> >> The Broadcom STB PCIe RC uses a reset control "rescal" for certain chips.
> >> The "rescal" implements a "pulse reset" so using assert/deassert is wrong
> >> for this device.  Instead, we use reset/rearm.  We need to use rearm so
> >> that we can reset it after a suspend/resume cycle; w/o using "rearm", the
> >> "rescal" device will only ever fire once.
> >>
> >> Of course for suspend/resume to work we also need to put the reset/rearm
> >> calls in the suspend and resume routines.
> > 
> > Actually - I am sorry but it looks like you will have to split the patch
> > in two since this is two logical changes.
> 
> I do not believe this can be easily split, since there is currently a
> misused of the reset controller API and this patch fixes all call sites
> at once. It would not really make sense to fix probe/remove and then
> leave suspend/resume broken in the same manner.

Right - I was reading the previous versions of the set, it makes sense
to keep it in one logical change.

Do you want me to take it or you prefer an ACK so that it can go via
a different tree ?

Thanks,
Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
  2021-03-29 16:58       ` Lorenzo Pieralisi
@ 2021-03-29 17:01         ` Florian Fainelli
  0 siblings, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2021-03-29 17:01 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Jim Quinlan, Bjorn Helgaas, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, james.quinlan, Rob Herring,
	Bjorn Helgaas, Philipp Zabel, Jim Quinlan,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list

On 3/29/21 9:58 AM, Lorenzo Pieralisi wrote:
> On Mon, Mar 29, 2021 at 09:50:13AM -0700, Florian Fainelli wrote:
>> On 3/29/21 9:10 AM, Lorenzo Pieralisi wrote:
>>> On Fri, Mar 12, 2021 at 03:45:55PM -0500, Jim Quinlan wrote:
>>>> The Broadcom STB PCIe RC uses a reset control "rescal" for certain chips.
>>>> The "rescal" implements a "pulse reset" so using assert/deassert is wrong
>>>> for this device.  Instead, we use reset/rearm.  We need to use rearm so
>>>> that we can reset it after a suspend/resume cycle; w/o using "rearm", the
>>>> "rescal" device will only ever fire once.
>>>>
>>>> Of course for suspend/resume to work we also need to put the reset/rearm
>>>> calls in the suspend and resume routines.
>>>
>>> Actually - I am sorry but it looks like you will have to split the patch
>>> in two since this is two logical changes.
>>
>> I do not believe this can be easily split, since there is currently a
>> misused of the reset controller API and this patch fixes all call sites
>> at once. It would not really make sense to fix probe/remove and then
>> leave suspend/resume broken in the same manner.
> 
> Right - I was reading the previous versions of the set, it makes sense
> to keep it in one logical change.
> 
> Do you want me to take it or you prefer an ACK so that it can go via
> a different tree ?

I would be comfortable with you taking this via the PCI driver trees, we
would want an Ack from Jens that he is okay with taking the ahci_brcm.c
change as well through your tree.

Thank you!
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller
  2021-03-12 20:45 [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller Jim Quinlan
  2021-03-12 20:45 ` [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert Jim Quinlan
@ 2021-04-06 15:42 ` Lorenzo Pieralisi
  2021-04-06 16:38   ` Florian Fainelli
  1 sibling, 1 reply; 11+ messages in thread
From: Lorenzo Pieralisi @ 2021-04-06 15:42 UTC (permalink / raw)
  To: linux-pci, james.quinlan, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, Jim Quinlan, Bjorn Helgaas
  Cc: Lorenzo Pieralisi, Rob Herring,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	Florian Fainelli,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	Jim Quinlan, Hans de Goede, Jens Axboe,
	open list:LIBATA SUBSYSTEM Serial and Parallel ATA drivers,
	open list

On Fri, 12 Mar 2021 15:45:53 -0500, Jim Quinlan wrote:
> v5 -- Improved (I hope) commit description (Bjorn).
>    -- Rnamed error labels (Krzyszt).
>    -- Fixed typos.
> 
> v4 -- does not rely on a pending commit, unlike v3.
> 
> v3 -- discard commit from v2; instead rely on the new function
>       reset_control_rearm provided in a recent commit [1] applied
>       to reset/next.
>    -- New commit to correct pcie-brcmstb.c usage of a reset controller
>       to use reset/rearm verses deassert/assert.
> 
> [...]

Applied to pci/brcmstb, thanks!

[1/2] ata: ahci_brcm: Fix use of BCM7216 reset controller
      https://git.kernel.org/lpieralisi/pci/c/92b9cb55a9
[2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
      https://git.kernel.org/lpieralisi/pci/c/a24fd1d646

Thanks,
Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller
  2021-04-06 15:42 ` [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller Lorenzo Pieralisi
@ 2021-04-06 16:38   ` Florian Fainelli
  0 siblings, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2021-04-06 16:38 UTC (permalink / raw)
  To: Lorenzo Pieralisi, linux-pci, james.quinlan,
	Nicolas Saenz Julienne, bcm-kernel-feedback-list, Jim Quinlan,
	Bjorn Helgaas
  Cc: Rob Herring,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	Jim Quinlan, Hans de Goede, Jens Axboe,
	open list:LIBATA SUBSYSTEM Serial and Parallel ATA drivers,
	open list



On 4/6/2021 8:42 AM, Lorenzo Pieralisi wrote:
> On Fri, 12 Mar 2021 15:45:53 -0500, Jim Quinlan wrote:
>> v5 -- Improved (I hope) commit description (Bjorn).
>>    -- Rnamed error labels (Krzyszt).
>>    -- Fixed typos.
>>
>> v4 -- does not rely on a pending commit, unlike v3.
>>
>> v3 -- discard commit from v2; instead rely on the new function
>>       reset_control_rearm provided in a recent commit [1] applied
>>       to reset/next.
>>    -- New commit to correct pcie-brcmstb.c usage of a reset controller
>>       to use reset/rearm verses deassert/assert.
>>
>> [...]
> 
> Applied to pci/brcmstb, thanks!
> 
> [1/2] ata: ahci_brcm: Fix use of BCM7216 reset controller
>       https://git.kernel.org/lpieralisi/pci/c/92b9cb55a9
> [2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert
>       https://git.kernel.org/lpieralisi/pci/c/a24fd1d646

Thanks a lot!
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller
  2021-04-28 20:53 ` Bjorn Helgaas
@ 2021-04-28 21:03   ` Florian Fainelli
  0 siblings, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2021-04-28 21:03 UTC (permalink / raw)
  To: Bjorn Helgaas, Jim Quinlan
  Cc: Jim Quinlan, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, Florian Fainelli, Hans de Goede,
	Jens Axboe, Jim Quinlan, linux-arm-kernel, linux-ide,
	linux-kernel, linux-rpi-kernel, Lorenzo Pieralisi, Rob Herring,
	Amjad Ouled-Ameur, Philipp Zabel



On 4/28/2021 1:53 PM, Bjorn Helgaas wrote:
> [+cc Amjad, Philipp: possible issue with 557acb3d2cd9 ("reset: make
> shared pulsed reset controls re-triggerable") below; report at
> https://lore.kernel.org/linux-ide/20210428200058.GA366202@bjorn-Precision-5520/]
> 
> On Wed, Apr 28, 2021 at 04:34:00PM -0400, Jim Quinlan wrote:
>> On Wed, Apr 28, 2021 at 4:01 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>>> On Fri, Mar 12, 2021 at 03:45:53PM -0500, Jim Quinlan wrote:
>>>> v5 -- Improved (I hope) commit description (Bjorn).
>>>>    -- Rnamed error labels (Krzyszt).
>>>>    -- Fixed typos.
>>>>
>>>> v4 -- does not rely on a pending commit, unlike v3.
>>>>
>>>> v3 -- discard commit from v2; instead rely on the new function
>>>>       reset_control_rearm provided in a recent commit [1] applied
>>>>       to reset/next.
>>>>    -- New commit to correct pcie-brcmstb.c usage of a reset controller
>>>>       to use reset/rearm verses deassert/assert.
>>>>
>>>> v2 -- refactor rescal-reset driver to implement assert/deassert rather than
>>>>       reset because the reset call only fires once per lifetime and we need
>>>>       to reset after every resume from S2 or S3.
>>>>    -- Split the use of "ahci" and "rescal" controllers in separate fields
>>>>       to keep things simple.
>>>>
>>>> v1 -- original
>>>>
>>>> Jim Quinlan (2):
>>>>   ata: ahci_brcm: Fix use of BCM7216 reset controller
>>>>   PCI: brcmstb: Use reset/rearm instead of deassert/assert
>>>>
>>>>  drivers/ata/ahci_brcm.c               | 46 +++++++++++++--------------
>>>>  drivers/pci/controller/pcie-brcmstb.c | 19 +++++++----
>>>>  2 files changed, 36 insertions(+), 29 deletions(-)
>>>
>>> Tripped over these errors while build testing with the .config below.
>>> This is on the pci/brcmstb branch from
>>> git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
>>>
>>> Dropping the pci/brcmstb branch while we get this figured out.  This will
>>> remove the following commits:
>>>
>>>   a24fd1d6469f ("PCI: brcmstb: Use reset/rearm instead of deassert/assert")
>>>   92b9cb55a9b6 ("ata: ahci_brcm: Fix use of BCM7216 reset controller")
>>>   b5d9209d5083 ("PCI: brcmstb: Fix error return code in brcm_pcie_probe()")
>>
>> Hi Bjorn,
>>
>> I believe the problem is that the commit
>>
>> 557acb3d2cd9c82de19f944f6cc967a347735385
>> "reset: make shared pulsed reset controls re-triggerable"
>>
>> defined reset_control_rearm() for the CONFIG_RESET_CONTROLLER=y  case
>> but forgot to define  an empty function for the unset case.  Your test
>> .config has this CONFIG unset.
>>
>> Would you like me to resubmit this with an additional commit that
>> fixes this?
> 
> The fix could be a patch along those lines, or it could be a Kconfig
> change that makes this config impossible.  I didn't look deeper to see
> what makes sense.  But I don't think the fix should be "manually avoid
> this configuration."
> 
> It looks like 557acb3d2cd9 ("reset: make shared pulsed reset controls
> re-triggerable") appeared in v5.11, so if a patch is the right thing,
> it should probably be marked for stable ("v5.11+").

All of the other reset controller API have inline stubs when
CONFIG_RESET_CONTROLLER is disabled, not having one for
reset_control_rearm() seems like an oversight (easy to make since if you
introduce the API you obviously needed it and did not consider the case
where it may not be available).

I agree this would be stable material.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller
       [not found] <CA+-6iNyN4UB3Sb14RJ9Jb2rXn_u-iwHzny1LYXEq3=VddWWxPg@mail.gmail.com>
@ 2021-04-28 20:53 ` Bjorn Helgaas
  2021-04-28 21:03   ` Florian Fainelli
  0 siblings, 1 reply; 11+ messages in thread
From: Bjorn Helgaas @ 2021-04-28 20:53 UTC (permalink / raw)
  To: Jim Quinlan
  Cc: Jim Quinlan, linux-pci, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, Florian Fainelli, Hans de Goede,
	Jens Axboe, Jim Quinlan, linux-arm-kernel, linux-ide,
	linux-kernel, linux-rpi-kernel, Lorenzo Pieralisi, Rob Herring,
	Amjad Ouled-Ameur, Philipp Zabel

[+cc Amjad, Philipp: possible issue with 557acb3d2cd9 ("reset: make
shared pulsed reset controls re-triggerable") below; report at
https://lore.kernel.org/linux-ide/20210428200058.GA366202@bjorn-Precision-5520/]

On Wed, Apr 28, 2021 at 04:34:00PM -0400, Jim Quinlan wrote:
> On Wed, Apr 28, 2021 at 4:01 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Fri, Mar 12, 2021 at 03:45:53PM -0500, Jim Quinlan wrote:
> > > v5 -- Improved (I hope) commit description (Bjorn).
> > >    -- Rnamed error labels (Krzyszt).
> > >    -- Fixed typos.
> > >
> > > v4 -- does not rely on a pending commit, unlike v3.
> > >
> > > v3 -- discard commit from v2; instead rely on the new function
> > >       reset_control_rearm provided in a recent commit [1] applied
> > >       to reset/next.
> > >    -- New commit to correct pcie-brcmstb.c usage of a reset controller
> > >       to use reset/rearm verses deassert/assert.
> > >
> > > v2 -- refactor rescal-reset driver to implement assert/deassert rather than
> > >       reset because the reset call only fires once per lifetime and we need
> > >       to reset after every resume from S2 or S3.
> > >    -- Split the use of "ahci" and "rescal" controllers in separate fields
> > >       to keep things simple.
> > >
> > > v1 -- original
> > >
> > > Jim Quinlan (2):
> > >   ata: ahci_brcm: Fix use of BCM7216 reset controller
> > >   PCI: brcmstb: Use reset/rearm instead of deassert/assert
> > >
> > >  drivers/ata/ahci_brcm.c               | 46 +++++++++++++--------------
> > >  drivers/pci/controller/pcie-brcmstb.c | 19 +++++++----
> > >  2 files changed, 36 insertions(+), 29 deletions(-)
> >
> > Tripped over these errors while build testing with the .config below.
> > This is on the pci/brcmstb branch from
> > git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
> >
> > Dropping the pci/brcmstb branch while we get this figured out.  This will
> > remove the following commits:
> >
> >   a24fd1d6469f ("PCI: brcmstb: Use reset/rearm instead of deassert/assert")
> >   92b9cb55a9b6 ("ata: ahci_brcm: Fix use of BCM7216 reset controller")
> >   b5d9209d5083 ("PCI: brcmstb: Fix error return code in brcm_pcie_probe()")
> 
> Hi Bjorn,
> 
> I believe the problem is that the commit
> 
> 557acb3d2cd9c82de19f944f6cc967a347735385
> "reset: make shared pulsed reset controls re-triggerable"
> 
> defined reset_control_rearm() for the CONFIG_RESET_CONTROLLER=y  case
> but forgot to define  an empty function for the unset case.  Your test
> .config has this CONFIG unset.
> 
> Would you like me to resubmit this with an additional commit that
> fixes this?

The fix could be a patch along those lines, or it could be a Kconfig
change that makes this config impossible.  I didn't look deeper to see
what makes sense.  But I don't think the fix should be "manually avoid
this configuration."

It looks like 557acb3d2cd9 ("reset: make shared pulsed reset controls
re-triggerable") appeared in v5.11, so if a patch is the right thing,
it should probably be marked for stable ("v5.11+").

Bjorn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-04-28 21:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 20:45 [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller Jim Quinlan
2021-03-12 20:45 ` [PATCH v5 2/2] PCI: brcmstb: Use reset/rearm instead of deassert/assert Jim Quinlan
2021-03-29 16:06   ` Lorenzo Pieralisi
2021-03-29 16:10   ` Lorenzo Pieralisi
2021-03-29 16:50     ` Florian Fainelli
2021-03-29 16:58       ` Lorenzo Pieralisi
2021-03-29 17:01         ` Florian Fainelli
2021-04-06 15:42 ` [PATCH v5 0/2] ata: ahci_brcm: Fix use of BCM7216 reset controller Lorenzo Pieralisi
2021-04-06 16:38   ` Florian Fainelli
     [not found] <CA+-6iNyN4UB3Sb14RJ9Jb2rXn_u-iwHzny1LYXEq3=VddWWxPg@mail.gmail.com>
2021-04-28 20:53 ` Bjorn Helgaas
2021-04-28 21:03   ` Florian Fainelli

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