All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
@ 2020-12-02 14:25 Maxim Kochetkov
  2020-12-02 23:57 ` Vladimir Oltean
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Kochetkov @ 2020-12-02 14:25 UTC (permalink / raw)
  Cc: olteanv, broonie, linux-spi, Maxim Kochetkov

If cs-gpios property is used in devicetree then ctlr->num_chipselect value
may be changed by spi_get_gpio_descs().
So use ctlr->max_native_cs instead of ctlr->num_chipselect to set SPI_MCR

Fixes: 4fcc7c2292de (spi: spi-fsl-dspi: Don't access reserved fields in SPI_MCR)
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 drivers/spi/spi-fsl-dspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 1a08c1d584ab..028736687488 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -1165,7 +1165,7 @@ static int dspi_init(struct fsl_dspi *dspi)
 	unsigned int mcr;
 
 	/* Set idle states for all chip select signals to high */
-	mcr = SPI_MCR_PCSIS(GENMASK(dspi->ctlr->num_chipselect - 1, 0));
+	mcr = SPI_MCR_PCSIS(GENMASK(dspi->ctlr->max_native_cs - 1, 0));
 
 	if (dspi->devtype_data->trans_mode == DSPI_XSPI_MODE)
 		mcr |= SPI_MCR_XSPI;
@@ -1250,7 +1250,7 @@ static int dspi_probe(struct platform_device *pdev)
 
 	pdata = dev_get_platdata(&pdev->dev);
 	if (pdata) {
-		ctlr->num_chipselect = pdata->cs_num;
+		ctlr->num_chipselect = ctlr->max_native_cs = pdata->cs_num;
 		ctlr->bus_num = pdata->bus_num;
 
 		/* Only Coldfire uses platform data */
@@ -1263,7 +1263,7 @@ static int dspi_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "can't get spi-num-chipselects\n");
 			goto out_ctlr_put;
 		}
-		ctlr->num_chipselect = cs_num;
+		ctlr->num_chipselect = ctlr->max_native_cs = cs_num;
 
 		of_property_read_u32(np, "bus-num", &bus_num);
 		ctlr->bus_num = bus_num;
-- 
2.29.2


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

* Re: [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
  2020-12-02 14:25 [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR Maxim Kochetkov
@ 2020-12-02 23:57 ` Vladimir Oltean
  2020-12-03  4:40   ` Maxim Kochetkov
  0 siblings, 1 reply; 9+ messages in thread
From: Vladimir Oltean @ 2020-12-02 23:57 UTC (permalink / raw)
  To: Maxim Kochetkov; +Cc: broonie, linux-spi

On Wed, Dec 02, 2020 at 05:25:52PM +0300, Maxim Kochetkov wrote:
> If cs-gpios property is used in devicetree then ctlr->num_chipselect value
> may be changed by spi_get_gpio_descs().
> So use ctlr->max_native_cs instead of ctlr->num_chipselect to set SPI_MCR
> 
> Fixes: 4fcc7c2292de (spi: spi-fsl-dspi: Don't access reserved fields in SPI_MCR)
> Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
> ---

In this case, it looks like Mark did really apply it, Maxim, I'm not
sure why you resent:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?h=for-5.10&id=2c2b3ad2c4c801bab1eec7264ea6991b1e4e8f2c

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

* Re: [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
  2020-12-02 23:57 ` Vladimir Oltean
@ 2020-12-03  4:40   ` Maxim Kochetkov
  0 siblings, 0 replies; 9+ messages in thread
From: Maxim Kochetkov @ 2020-12-03  4:40 UTC (permalink / raw)
  To: Vladimir Oltean; +Cc: broonie, linux-spi

I'm sorry for that.
I checked at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/ 
before resend and didn't find any updates.

03.12.2020 02:57, Vladimir Oltean пишет:
> On Wed, Dec 02, 2020 at 05:25:52PM +0300, Maxim Kochetkov wrote:
>> If cs-gpios property is used in devicetree then ctlr->num_chipselect value
>> may be changed by spi_get_gpio_descs().
>> So use ctlr->max_native_cs instead of ctlr->num_chipselect to set SPI_MCR
>>
>> Fixes: 4fcc7c2292de (spi: spi-fsl-dspi: Don't access reserved fields in SPI_MCR)
>> Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
>> ---
> 
> In this case, it looks like Mark did really apply it, Maxim, I'm not
> sure why you resent:
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?h=for-5.10&id=2c2b3ad2c4c801bab1eec7264ea6991b1e4e8f2c
> 

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

* Re: [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
  2020-12-02 23:55       ` Vladimir Oltean
@ 2020-12-03  8:02         ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2020-12-03  8:02 UTC (permalink / raw)
  To: Vladimir Oltean; +Cc: Maxim Kochetkov, linux-spi

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

On Thu, Dec 03, 2020 at 01:55:34AM +0200, Vladimir Oltean wrote:
> On Wed, Dec 02, 2020 at 02:22:20PM +0000, Mark Brown wrote:

> > If the patch isn't actually applied then yes.

> Do you frequently send out emails that you've applied a patch and then
> not apply it?

There was an issue the other day where b4 had a bug which caused it to
send out mails for everything it had in its database, including things
I'd downloaded to test but not applied for whatever reason.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
  2020-12-02 14:22     ` Mark Brown
@ 2020-12-02 23:55       ` Vladimir Oltean
  2020-12-03  8:02         ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Vladimir Oltean @ 2020-12-02 23:55 UTC (permalink / raw)
  To: Mark Brown; +Cc: Maxim Kochetkov, linux-spi

On Wed, Dec 02, 2020 at 02:22:20PM +0000, Mark Brown wrote:
> On Wed, Dec 02, 2020 at 05:20:00PM +0300, Maxim Kochetkov wrote:
>
> > Should I resend it?
>
> If the patch isn't actually applied then yes.

Do you frequently send out emails that you've applied a patch and then
not apply it?

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

* Re: [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
  2020-12-02 14:20   ` Maxim Kochetkov
@ 2020-12-02 14:22     ` Mark Brown
  2020-12-02 23:55       ` Vladimir Oltean
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2020-12-02 14:22 UTC (permalink / raw)
  To: Maxim Kochetkov; +Cc: olteanv, linux-spi

[-- Attachment #1: Type: text/plain, Size: 135 bytes --]

On Wed, Dec 02, 2020 at 05:20:00PM +0300, Maxim Kochetkov wrote:

> Should I resend it?

If the patch isn't actually applied then yes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
  2020-12-01 13:57 ` Mark Brown
@ 2020-12-02 14:20   ` Maxim Kochetkov
  2020-12-02 14:22     ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Kochetkov @ 2020-12-02 14:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: olteanv, linux-spi

Should I resend it?

01.12.2020 16:57, Mark Brown пишет:
> On Tue, 1 Dec 2020 11:59:16 +0300, Maxim Kochetkov wrote:
>> If cs-gpios property is used in devicetree then ctlr->num_chipselect value
>> may be changed by spi_get_gpio_descs().
>> So use ctlr->max_native_cs instead of ctlr->num_chipselect to set SPI_MCR
> 
> Applied to
> 
>     https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
> 
> Thanks!
> 
> [1/1] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
>        (no commit info)
> 
> 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: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
  2020-12-01  8:59 Maxim Kochetkov
@ 2020-12-01 13:57 ` Mark Brown
  2020-12-02 14:20   ` Maxim Kochetkov
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2020-12-01 13:57 UTC (permalink / raw)
  To: Maxim Kochetkov; +Cc: olteanv, linux-spi

On Tue, 1 Dec 2020 11:59:16 +0300, Maxim Kochetkov wrote:
> If cs-gpios property is used in devicetree then ctlr->num_chipselect value
> may be changed by spi_get_gpio_descs().
> So use ctlr->max_native_cs instead of ctlr->num_chipselect to set SPI_MCR

Applied to

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

Thanks!

[1/1] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
      (no commit info)

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

* [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR
@ 2020-12-01  8:59 Maxim Kochetkov
  2020-12-01 13:57 ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Kochetkov @ 2020-12-01  8:59 UTC (permalink / raw)
  Cc: olteanv, broonie, linux-spi, Maxim Kochetkov

If cs-gpios property is used in devicetree then ctlr->num_chipselect value
may be changed by spi_get_gpio_descs().
So use ctlr->max_native_cs instead of ctlr->num_chipselect to set SPI_MCR

Fixes: 4fcc7c2292de (spi: spi-fsl-dspi: Don't access reserved fields in SPI_MCR)
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 drivers/spi/spi-fsl-dspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 1a08c1d584ab..028736687488 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -1165,7 +1165,7 @@ static int dspi_init(struct fsl_dspi *dspi)
 	unsigned int mcr;
 
 	/* Set idle states for all chip select signals to high */
-	mcr = SPI_MCR_PCSIS(GENMASK(dspi->ctlr->num_chipselect - 1, 0));
+	mcr = SPI_MCR_PCSIS(GENMASK(dspi->ctlr->max_native_cs - 1, 0));
 
 	if (dspi->devtype_data->trans_mode == DSPI_XSPI_MODE)
 		mcr |= SPI_MCR_XSPI;
@@ -1250,7 +1250,7 @@ static int dspi_probe(struct platform_device *pdev)
 
 	pdata = dev_get_platdata(&pdev->dev);
 	if (pdata) {
-		ctlr->num_chipselect = pdata->cs_num;
+		ctlr->num_chipselect = ctlr->max_native_cs = pdata->cs_num;
 		ctlr->bus_num = pdata->bus_num;
 
 		/* Only Coldfire uses platform data */
@@ -1263,7 +1263,7 @@ static int dspi_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "can't get spi-num-chipselects\n");
 			goto out_ctlr_put;
 		}
-		ctlr->num_chipselect = cs_num;
+		ctlr->num_chipselect = ctlr->max_native_cs = cs_num;
 
 		of_property_read_u32(np, "bus-num", &bus_num);
 		ctlr->bus_num = bus_num;
-- 
2.29.2


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

end of thread, other threads:[~2020-12-03  8:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 14:25 [PATCH] spi: spi-fsl-dspi: Use max_native_cs instead of num_chipselect to set SPI_MCR Maxim Kochetkov
2020-12-02 23:57 ` Vladimir Oltean
2020-12-03  4:40   ` Maxim Kochetkov
  -- strict thread matches above, loose matches on Subject: below --
2020-12-01  8:59 Maxim Kochetkov
2020-12-01 13:57 ` Mark Brown
2020-12-02 14:20   ` Maxim Kochetkov
2020-12-02 14:22     ` Mark Brown
2020-12-02 23:55       ` Vladimir Oltean
2020-12-03  8:02         ` Mark Brown

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.