diff mbox series

[v3,1/9] spi: bcm-qspi: Handle clock probe deferral

Message ID 20200420190853.45614-2-kdasu.kdev@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/9] spi: bcm-qspi: Handle clock probe deferral | expand

Commit Message

Kamal Dasu April 20, 2020, 7:08 p.m. UTC
From: Florian Fainelli <f.fainelli@gmail.com>

The clock provider may not be ready by the time spi-bcm-qspi gets
probed, handle probe deferral using devm_clk_get_optional().

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
---
 drivers/spi/spi-bcm-qspi.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Mark Brown April 21, 2020, 3:06 p.m. UTC | #1
On Mon, 20 Apr 2020 15:08:45 -0400, Kamal Dasu wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> 
> The clock provider may not be ready by the time spi-bcm-qspi gets
> probed, handle probe deferral using devm_clk_get_optional().
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> 
> [...]

Applied to

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

Thanks!

[1/9] spi: bcm-qspi: Handle clock probe deferral
      commit: 0392727c261bab65a35cd4f82ee9459bc237591d
[2/9] dt: bindings: spi: Add support for mspi on brcmstb SoCs
      (not applied)
[3/9] spi: bcm-qspi: Handle lack of MSPI_REV offset
      (not applied)
[4/9] spi: bcm-qspi: Drive MSPI peripheral SSb pin on cs_change
      commit: 742d5958062488d03082a9ff01a6afb3cf7bd634
[5/9] spi: bcm-qspi: when tx/rx buffer is NULL set to 0
      commit: 4df3bea7f9d2ddd9ac2c29ba945c7c4db2def29c
[6/9] spi: bcm-qspi: Make PM suspend/resume work with SCMI clock management
      commit: 1b7ad8c405c3dc0ad6c2dc61fe21fe7a446cceeb
[7/9] spi: bcm-qspi: Use fastbr setting to allow faster MSPI speeds
      (not applied)
[8/9] spi: bcm-qspi: add support for MSPI sys clk 108Mhz
      (not applied)
[9/9] spi: bcm-qspi: MSPI_SPCR0_MSB MSTR bit exists only on legacy controllers
      (not applied)

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
Florian Fainelli April 21, 2020, 5:11 p.m. UTC | #2
On 4/21/2020 8:06 AM, Mark Brown wrote:
> On Mon, 20 Apr 2020 15:08:45 -0400, Kamal Dasu wrote:
>> From: Florian Fainelli <f.fainelli@gmail.com>
>>
>> The clock provider may not be ready by the time spi-bcm-qspi gets
>> probed, handle probe deferral using devm_clk_get_optional().
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
>>
>> [...]
> 
> Applied to
> 
>     https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.7

It would be nice if the URL could be clickable, e.g.:

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/log/?h=for-5.7

> 
> Thanks!
> 
> [1/9] spi: bcm-qspi: Handle clock probe deferral
>        commit: 0392727c261bab65a35cd4f82ee9459bc237591d
> [2/9] dt: bindings: spi: Add support for mspi on brcmstb SoCs
>        (not applied)
> [3/9] spi: bcm-qspi: Handle lack of MSPI_REV offset
>        (not applied)
> [4/9] spi: bcm-qspi: Drive MSPI peripheral SSb pin on cs_change
>        commit: 742d5958062488d03082a9ff01a6afb3cf7bd634
> [5/9] spi: bcm-qspi: when tx/rx buffer is NULL set to 0
>        commit: 4df3bea7f9d2ddd9ac2c29ba945c7c4db2def29c
> [6/9] spi: bcm-qspi: Make PM suspend/resume work with SCMI clock management
>        commit: 1b7ad8c405c3dc0ad6c2dc61fe21fe7a446cceeb
> [7/9] spi: bcm-qspi: Use fastbr setting to allow faster MSPI speeds
>        (not applied)
> [8/9] spi: bcm-qspi: add support for MSPI sys clk 108Mhz
>        (not applied)
> [9/9] spi: bcm-qspi: MSPI_SPCR0_MSB MSTR bit exists only on legacy controllers
>        (not applied)
> 
> 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
>
Mark Brown April 21, 2020, 5:15 p.m. UTC | #3
On Tue, Apr 21, 2020 at 10:11:52AM -0700, Florian Fainelli wrote:

> > Applied to

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

> It would be nice if the URL could be clickable, e.g.:

> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/log/?h=for-5.7

That then doesn't work with git itself unfortunately, someone's got to
loose out :/
Florian Fainelli April 21, 2020, 5:17 p.m. UTC | #4
On 4/21/2020 10:15 AM, Mark Brown wrote:
> On Tue, Apr 21, 2020 at 10:11:52AM -0700, Florian Fainelli wrote:
> 
>>> Applied to
> 
>>>      https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.7
> 
>> It would be nice if the URL could be clickable, e.g.:
> 
>> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/log/?h=for-5.7
> 
> That then doesn't work with git itself unfortunately, someone's got to
> loose out :/
> 

Could you provide both links with a market at the front, e.g.:

Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 
for-5.7
CGIT URL: 
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/log/?h=for-5.7
Mark Brown April 21, 2020, 5:20 p.m. UTC | #5
On Tue, Apr 21, 2020 at 10:17:10AM -0700, Florian Fainelli wrote:

> > That then doesn't work with git itself unfortunately, someone's got to
> > loose out :/

> Could you provide both links with a market at the front, e.g.:

> Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
> for-5.7
> CGIT URL: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/log/?h=for-5.7

Ask Konstantin to implement it (I'm using b4 ty now) and I might!
Konstantin Ryabitsev April 21, 2020, 6:31 p.m. UTC | #6
On Tue, Apr 21, 2020 at 06:20:05PM +0100, Mark Brown wrote:
> > Could you provide both links with a market at the front, e.g.:
> 
> > Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
> > for-5.7
> > CGIT URL: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/log/?h=for-5.7
> 
> Ask Konstantin to implement it (I'm using b4 ty now) and I might!

You can do this already in the template, if your treename is set to the 
https URL.

----
Applied to

Git:   ${treename} ${branch}
Link:  ${treename}/log/?h=${branch}
----

-K
Mark Brown April 21, 2020, 6:54 p.m. UTC | #7
On Mon, 20 Apr 2020 15:08:45 -0400, Kamal Dasu wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> 
> The clock provider may not be ready by the time spi-bcm-qspi gets
> probed, handle probe deferral using devm_clk_get_optional().
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> 
> [...]

Applied to

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

Thanks!

[1/9] spi: bcm-qspi: Handle clock probe deferral
      commit: 0392727c261bab65a35cd4f82ee9459bc237591d
[2/9] dt: bindings: spi: Add support for mspi on brcmstb SoCs
      (not applied)
[3/9] spi: bcm-qspi: Handle lack of MSPI_REV offset
      (not applied)
[4/9] spi: bcm-qspi: Drive MSPI peripheral SSb pin on cs_change
      commit: 742d5958062488d03082a9ff01a6afb3cf7bd634
[5/9] spi: bcm-qspi: when tx/rx buffer is NULL set to 0
      commit: 4df3bea7f9d2ddd9ac2c29ba945c7c4db2def29c
[6/9] spi: bcm-qspi: Make PM suspend/resume work with SCMI clock management
      commit: 1b7ad8c405c3dc0ad6c2dc61fe21fe7a446cceeb
[7/9] spi: bcm-qspi: Use fastbr setting to allow faster MSPI speeds
      (not applied)
[8/9] spi: bcm-qspi: add support for MSPI sys clk 108Mhz
      (not applied)
[9/9] spi: bcm-qspi: MSPI_SPCR0_MSB MSTR bit exists only on legacy controllers
      (not applied)

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
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index 23d295f36c80..74f4579c3f6a 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -1222,6 +1222,11 @@  int bcm_qspi_probe(struct platform_device *pdev,
 	}
 
 	qspi = spi_master_get_devdata(master);
+
+	qspi->clk = devm_clk_get_optional(&pdev->dev, NULL);
+	if (IS_ERR(qspi->clk))
+		return PTR_ERR(qspi->clk);
+
 	qspi->pdev = pdev;
 	qspi->trans_pos.trans = NULL;
 	qspi->trans_pos.byte = 0;
@@ -1335,13 +1340,6 @@  int bcm_qspi_probe(struct platform_device *pdev,
 		qspi->soc_intc = NULL;
 	}
 
-	qspi->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(qspi->clk)) {
-		dev_warn(dev, "unable to get clock\n");
-		ret = PTR_ERR(qspi->clk);
-		goto qspi_probe_err;
-	}
-
 	ret = clk_prepare_enable(qspi->clk);
 	if (ret) {
 		dev_err(dev, "failed to prepare clock\n");