linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: bcm63xx: fix shared reset
@ 2025-05-29 13:09 Álvaro Fernández Rojas
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-spi: " Álvaro Fernández Rojas
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Álvaro Fernández Rojas @ 2025-05-29 13:09 UTC (permalink / raw)
  To: dgcbueu, florian.fainelli, william.zhang, kursad.oney,
	jonas.gorski, bcm-kernel-feedback-list, broonie, p.zabel,
	linux-spi, linux-kernel
  Cc: Álvaro Fernández Rojas

Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI and
HSSPI controllers, so reset shouldn't be exclusive.

Álvaro Fernández Rojas (2):
  spi: bcm63xx-spi: fix shared reset
  spi: bcm63xx-hsspi: fix shared reset

 drivers/spi/spi-bcm63xx-hsspi.c | 2 +-
 drivers/spi/spi-bcm63xx.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.39.5


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

* [PATCH] spi: bcm63xx-spi: fix shared reset
  2025-05-29 13:09 [PATCH] spi: bcm63xx: fix shared reset Álvaro Fernández Rojas
@ 2025-05-29 13:09 ` Álvaro Fernández Rojas
  2025-05-29 21:48   ` Florian Fainelli
  2025-05-30 15:41   ` Mark Brown
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-hsspi: " Álvaro Fernández Rojas
  2025-06-02  9:31 ` [PATCH] spi: bcm63xx: " Philipp Zabel
  2 siblings, 2 replies; 9+ messages in thread
From: Álvaro Fernández Rojas @ 2025-05-29 13:09 UTC (permalink / raw)
  To: dgcbueu, florian.fainelli, william.zhang, kursad.oney,
	jonas.gorski, bcm-kernel-feedback-list, broonie, p.zabel,
	linux-spi, linux-kernel
  Cc: Álvaro Fernández Rojas

Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI
and HSSPI controllers, so reset shouldn't be exclusive.

Fixes: 38807adeaf1e ("spi: bcm63xx-spi: add reset support")
Reported-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 drivers/spi/spi-bcm63xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index c8f64ec69344..b56210734caa 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -523,7 +523,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
 		return PTR_ERR(clk);
 	}
 
-	reset = devm_reset_control_get_optional_exclusive(dev, NULL);
+	reset = devm_reset_control_get_optional_shared(dev, NULL);
 	if (IS_ERR(reset))
 		return PTR_ERR(reset);
 
-- 
2.39.5


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

* [PATCH] spi: bcm63xx-hsspi: fix shared reset
  2025-05-29 13:09 [PATCH] spi: bcm63xx: fix shared reset Álvaro Fernández Rojas
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-spi: " Álvaro Fernández Rojas
@ 2025-05-29 13:09 ` Álvaro Fernández Rojas
  2025-05-29 21:48   ` Florian Fainelli
  2025-05-30 15:41   ` Mark Brown
  2025-06-02  9:31 ` [PATCH] spi: bcm63xx: " Philipp Zabel
  2 siblings, 2 replies; 9+ messages in thread
From: Álvaro Fernández Rojas @ 2025-05-29 13:09 UTC (permalink / raw)
  To: dgcbueu, florian.fainelli, william.zhang, kursad.oney,
	jonas.gorski, bcm-kernel-feedback-list, broonie, p.zabel,
	linux-spi, linux-kernel
  Cc: Álvaro Fernández Rojas

Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI
and HSSPI controllers, so reset shouldn't be exclusive.

Fixes: 0eeadddbf09a ("spi: bcm63xx-hsspi: add reset support")
Reported-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 drivers/spi/spi-bcm63xx-hsspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index 644b44d2aef2..18261cbd413b 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -745,7 +745,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 
-	reset = devm_reset_control_get_optional_exclusive(dev, NULL);
+	reset = devm_reset_control_get_optional_shared(dev, NULL);
 	if (IS_ERR(reset))
 		return PTR_ERR(reset);
 
-- 
2.39.5


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

* Re: [PATCH] spi: bcm63xx-spi: fix shared reset
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-spi: " Álvaro Fernández Rojas
@ 2025-05-29 21:48   ` Florian Fainelli
  2025-05-30 15:41   ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Florian Fainelli @ 2025-05-29 21:48 UTC (permalink / raw)
  To: Álvaro Fernández Rojas, dgcbueu, william.zhang,
	kursad.oney, jonas.gorski, bcm-kernel-feedback-list, broonie,
	p.zabel, linux-spi, linux-kernel

On 5/29/25 06:09, Álvaro Fernández Rojas wrote:
> Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI
> and HSSPI controllers, so reset shouldn't be exclusive.
> 
> Fixes: 38807adeaf1e ("spi: bcm63xx-spi: add reset support")
> Reported-by: Jonas Gorski <jonas.gorski@gmail.com>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH] spi: bcm63xx-hsspi: fix shared reset
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-hsspi: " Álvaro Fernández Rojas
@ 2025-05-29 21:48   ` Florian Fainelli
  2025-05-30 15:41   ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Florian Fainelli @ 2025-05-29 21:48 UTC (permalink / raw)
  To: Álvaro Fernández Rojas, dgcbueu, william.zhang,
	kursad.oney, jonas.gorski, bcm-kernel-feedback-list, broonie,
	p.zabel, linux-spi, linux-kernel

On 5/29/25 06:09, Álvaro Fernández Rojas wrote:
> Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI
> and HSSPI controllers, so reset shouldn't be exclusive.
> 
> Fixes: 0eeadddbf09a ("spi: bcm63xx-hsspi: add reset support")
> Reported-by: Jonas Gorski <jonas.gorski@gmail.com>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH] spi: bcm63xx-spi: fix shared reset
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-spi: " Álvaro Fernández Rojas
  2025-05-29 21:48   ` Florian Fainelli
@ 2025-05-30 15:41   ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2025-05-30 15:41 UTC (permalink / raw)
  To: dgcbueu, florian.fainelli, william.zhang, kursad.oney,
	jonas.gorski, bcm-kernel-feedback-list, p.zabel, linux-spi,
	linux-kernel, Álvaro Fernández Rojas

On Thu, 29 May 2025 15:09:14 +0200, Álvaro Fernández Rojas wrote:
> Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI
> and HSSPI controllers, so reset shouldn't be exclusive.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: bcm63xx-spi: fix shared reset
      commit: 5ad20e3d8cfe3b2e42bbddc7e0ebaa74479bb589

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

* Re: [PATCH] spi: bcm63xx-hsspi: fix shared reset
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-hsspi: " Álvaro Fernández Rojas
  2025-05-29 21:48   ` Florian Fainelli
@ 2025-05-30 15:41   ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2025-05-30 15:41 UTC (permalink / raw)
  To: dgcbueu, florian.fainelli, william.zhang, kursad.oney,
	jonas.gorski, bcm-kernel-feedback-list, p.zabel, linux-spi,
	linux-kernel, Álvaro Fernández Rojas

On Thu, 29 May 2025 15:09:15 +0200, Álvaro Fernández Rojas wrote:
> Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI
> and HSSPI controllers, so reset shouldn't be exclusive.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: bcm63xx-hsspi: fix shared reset
      commit: 3d6d84c8f2f66d3fd6a43a1e2ce8e6b54c573960

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

* Re: [PATCH] spi: bcm63xx: fix shared reset
  2025-05-29 13:09 [PATCH] spi: bcm63xx: fix shared reset Álvaro Fernández Rojas
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-spi: " Álvaro Fernández Rojas
  2025-05-29 13:09 ` [PATCH] spi: bcm63xx-hsspi: " Álvaro Fernández Rojas
@ 2025-06-02  9:31 ` Philipp Zabel
  2025-06-05  7:45   ` Jonas Gorski
  2 siblings, 1 reply; 9+ messages in thread
From: Philipp Zabel @ 2025-06-02  9:31 UTC (permalink / raw)
  To: Álvaro Fernández Rojas, dgcbueu, florian.fainelli,
	william.zhang, kursad.oney, jonas.gorski,
	bcm-kernel-feedback-list, broonie, linux-spi, linux-kernel

On Do, 2025-05-29 at 15:09 +0200, Álvaro Fernández Rojas wrote:
> Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI and
> HSSPI controllers, so reset shouldn't be exclusive.
> 
> Álvaro Fernández Rojas (2):
>   spi: bcm63xx-spi: fix shared reset

Both drivers currently enable the SPI clock before triggering a reset.
Can the hardware cope with being reset before the clock is enabled?
That could happen for the second device to be bound [1], unless the SPI
clock is shared as well or already running for another reason.

[1] https://docs.kernel.org/driver-api/reset.html#triggering

regards
Philipp

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

* Re: [PATCH] spi: bcm63xx: fix shared reset
  2025-06-02  9:31 ` [PATCH] spi: bcm63xx: " Philipp Zabel
@ 2025-06-05  7:45   ` Jonas Gorski
  0 siblings, 0 replies; 9+ messages in thread
From: Jonas Gorski @ 2025-06-05  7:45 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Álvaro Fernández Rojas, dgcbueu, florian.fainelli,
	william.zhang, kursad.oney, bcm-kernel-feedback-list, broonie,
	linux-spi, linux-kernel

On Mon, Jun 2, 2025 at 11:31 AM Philipp Zabel <p.zabel@pengutronix.de> wrote:
>
> On Do, 2025-05-29 at 15:09 +0200, Álvaro Fernández Rojas wrote:
> > Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI and
> > HSSPI controllers, so reset shouldn't be exclusive.
> >
> > Álvaro Fernández Rojas (2):
> >   spi: bcm63xx-spi: fix shared reset
>
> Both drivers currently enable the SPI clock before triggering a reset.
> Can the hardware cope with being reset before the clock is enabled?
> That could happen for the second device to be bound [1], unless the SPI
> clock is shared as well or already running for another reason.
>
> [1] https://docs.kernel.org/driver-api/reset.html#triggering

In a completely unscientific test, I disabled both SPI clocks and
triggered the reset, and the hardware didn't seem to mind. It also
didn't seem to have any observable effect, as all registers I checked
kept their previous values (both with and without clocks enabled).
Neither disabling the clocks nor asserting the reset prevented my from
reading the registers of either block, so their effects seem to be
rather limited.

That being said, the bootloader (in the one device I tested) seems to
keep both clocks enabled, so they would still both be enabled during
the reset of whichever is probed first.

Regards,
Jonas

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

end of thread, other threads:[~2025-06-05  7:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29 13:09 [PATCH] spi: bcm63xx: fix shared reset Álvaro Fernández Rojas
2025-05-29 13:09 ` [PATCH] spi: bcm63xx-spi: " Álvaro Fernández Rojas
2025-05-29 21:48   ` Florian Fainelli
2025-05-30 15:41   ` Mark Brown
2025-05-29 13:09 ` [PATCH] spi: bcm63xx-hsspi: " Álvaro Fernández Rojas
2025-05-29 21:48   ` Florian Fainelli
2025-05-30 15:41   ` Mark Brown
2025-06-02  9:31 ` [PATCH] spi: bcm63xx: " Philipp Zabel
2025-06-05  7:45   ` Jonas Gorski

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