Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: intel: Check number of chip selects after reading the descriptor
@ 2023-02-15 11:00 Mika Westerberg
  2023-02-15 17:08 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2023-02-15 11:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: Marcin Witkowski, Mika Westerberg, linux-spi

The flash decriptor contains the number of flash components that we use
to figure out how many flash chips there are connected. Therefore we
need to read it first before deciding how many chip selects the
controller has.

Reported-by: Marcin Witkowski <marcin.witkowski@intel.com>
Fixes: 3f03c618bebb ("spi: intel: Add support for second flash chip")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/spi/spi-intel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-intel.c b/drivers/spi/spi-intel.c
index f619212b0d5c..627287925fed 100644
--- a/drivers/spi/spi-intel.c
+++ b/drivers/spi/spi-intel.c
@@ -1368,14 +1368,14 @@ static int intel_spi_populate_chip(struct intel_spi *ispi)
 	if (!spi_new_device(ispi->master, &chip))
 		return -ENODEV;
 
-	/* Add the second chip if present */
-	if (ispi->master->num_chipselect < 2)
-		return 0;
-
 	ret = intel_spi_read_desc(ispi);
 	if (ret)
 		return ret;
 
+	/* Add the second chip if present */
+	if (ispi->master->num_chipselect < 2)
+		return 0;
+
 	chip.platform_data = NULL;
 	chip.chip_select = 1;
 
-- 
2.39.1


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

* Re: [PATCH] spi: intel: Check number of chip selects after reading the descriptor
  2023-02-15 11:00 [PATCH] spi: intel: Check number of chip selects after reading the descriptor Mika Westerberg
@ 2023-02-15 17:08 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-02-15 17:08 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: Marcin Witkowski, linux-spi

On Wed, 15 Feb 2023 13:00:40 +0200, Mika Westerberg wrote:
> The flash decriptor contains the number of flash components that we use
> to figure out how many flash chips there are connected. Therefore we
> need to read it first before deciding how many chip selects the
> controller has.
> 
> 

Applied to

   broonie/spi.git for-next

Thanks!

[1/1] spi: intel: Check number of chip selects after reading the descriptor
      commit: 574fbb95cd9d88bdc9c9c4c64223a38a61d7de9a

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] 2+ messages in thread

end of thread, other threads:[~2023-02-15 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 11:00 [PATCH] spi: intel: Check number of chip selects after reading the descriptor Mika Westerberg
2023-02-15 17:08 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox