* [PATCH 1/1] spi: Fix SPI slave probe failure
@ 2024-06-17 15:30 Amit Kumar Mahapatra
2024-06-19 13:07 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Amit Kumar Mahapatra @ 2024-06-17 15:30 UTC (permalink / raw)
To: broonie
Cc: linux-spi, linux-kernel, git, amitrkcian2002, Amit Kumar Mahapatra
While adding a SPI device, the SPI core ensures that multiple logical CS
doesn't map to the same physical CS. For example, spi->chip_select[0] !=
spi->chip_select[1] and so forth. However, unlike the SPI master, the SPI
slave doesn't have the list of chip selects, this leads to probe failure
when the SPI controller is configured as slave. Update the
__spi_add_device() function to perform this check only if the SPI
controller is configured as master.
Fixes: 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core")
Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
---
BRANCH: for-next
---
drivers/spi/spi.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9721adf048b5..e7e4201e93b5 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -689,10 +689,12 @@ static int __spi_add_device(struct spi_device *spi)
* Make sure that multiple logical CS doesn't map to the same physical CS.
* For example, spi->chip_select[0] != spi->chip_select[1] and so on.
*/
- for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
- status = spi_dev_check_cs(dev, spi, idx, spi, idx + 1);
- if (status)
- return status;
+ if (!spi_controller_is_target(ctlr)) {
+ for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
+ status = spi_dev_check_cs(dev, spi, idx, spi, idx + 1);
+ if (status)
+ return status;
+ }
}
/* Set the bus ID string */
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] spi: Fix SPI slave probe failure
2024-06-17 15:30 [PATCH 1/1] spi: Fix SPI slave probe failure Amit Kumar Mahapatra
@ 2024-06-19 13:07 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-06-19 13:07 UTC (permalink / raw)
To: Amit Kumar Mahapatra; +Cc: linux-spi, linux-kernel, git, amitrkcian2002
On Mon, 17 Jun 2024 21:00:52 +0530, Amit Kumar Mahapatra wrote:
> While adding a SPI device, the SPI core ensures that multiple logical CS
> doesn't map to the same physical CS. For example, spi->chip_select[0] !=
> spi->chip_select[1] and so forth. However, unlike the SPI master, the SPI
> slave doesn't have the list of chip selects, this leads to probe failure
> when the SPI controller is configured as slave. Update the
> __spi_add_device() function to perform this check only if the SPI
> controller is configured as master.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: Fix SPI slave probe failure
commit: 2c1b7bbe253986619fa5623a13055316e730e746
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:[~2024-06-19 13:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-17 15:30 [PATCH 1/1] spi: Fix SPI slave probe failure Amit Kumar Mahapatra
2024-06-19 13:07 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®