mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Cc: broonie@kernel.org, tudor.ambarus@linaro.org,
	pratyush@kernel.org, miquel.raynal@bootlin.com, richard@nod.at,
	vigneshr@ti.com, sbinding@opensource.cirrus.com, lee@kernel.org,
	james.schulman@cirrus.com, david.rhodes@cirrus.com,
	rf@opensource.cirrus.com, perex@perex.cz, tiwai@suse.com,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	michael@walle.cc, linux-mtd@lists.infradead.org,
	nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
	claudiu.beznea@tuxon.dev, michal.simek@amd.com,
	linux-arm-kernel@lists.infradead.org,
	alsa-devel@alsa-project.org, patches@opensource.cirrus.com,
	linux-sound@vger.kernel.org, git@amd.com,
	amitrkcian2002@gmail.com
Subject: Re: [PATCH v11 03/10] spi: Add multi-cs memories support in SPI core
Date: Fri, 12 Jan 2024 11:11:07 -0800	[thread overview]
Message-ID: <3d3a11b1-8396-4d8e-9bb3-61ecb67e7efa@roeck-us.net> (raw)
In-Reply-To: <20231125092137.2948-4-amit.kumar-mahapatra@amd.com>

Hi,

On Sat, Nov 25, 2023 at 02:51:30PM +0530, Amit Kumar Mahapatra wrote:
> AMD-Xilinx GQSPI controller has two advanced mode that allows the
> controller to consider two flashes as one single device.
> 
> One of these two mode is the parallel mode in which each byte of data is
> stored in both devices, the even bits in the lower flash & the odd bits in
> the upper flash. The byte split is automatically handled by the QSPI
> controller.
> 
> The other mode is the stacked mode in which both the flashes share the
> same SPI bus but each of the device contain half of the data. In this mode,
> the controller does not follow CS requests but instead internally wires the
> two CS levels with the value of the most significant address bit.
> 
> For supporting both these modes SPI core need to be updated for providing
> multiple CS for a single SPI device.
> 
> For adding multi CS support the SPI device need to be aware of all the CS
> values. So, the "chip_select" member in the spi_device structure is now an
> array that holds all the CS values.
> 
> spi_device structure now has a "cs_index_mask" member. This acts as an
> index to the chip_select array. If nth bit of spi->cs_index_mask is set
> then the driver would assert spi->chip_select[n].
> 
> In parallel mode all the chip selects are asserted/de-asserted
> simultaneously and each byte of data is stored in both devices, the even
> bits in one, the odd bits in the other. The split is automatically handled
> by the GQSPI controller. The GQSPI controller supports a maximum of two
> flashes connected in parallel mode. A SPI_CONTROLLER_MULTI_CS flag bit is
> added in the spi controller flags, through ctlr->flags the spi core
> will make sure that the controller is capable of handling multiple chip
> selects at once.
> 
> For supporting multiple CS via GPIO the cs_gpiod member of the spi_device
> structure is now an array that holds the gpio descriptor for each
> chipselect.
> 
> CS GPIO is not tested on our hardware, but it has been tested by @Stefan
> https://lore.kernel.org/all/005001da1efc$619ad5a0$24d080e0$@opensource.cirrus.com/
> 

With this patch in the mainline kernel, two of my qemu emulations
(quanta-q71l-bmc and almetto-bmc) fail to instantiate the first SPI
controller and thus fail to boot from SPI. The error message is

[    3.006458] spi_master spi0: No. of CS is more than max. no. of supported CS
[    3.006775] spi_master spi0: Failed to create SPI device for /ahb/spi@1e620000/flash@0

The problem is no longer seen after reverting this patch.

Bisect log attached for reference.

Guenter

---
# bad: [70d201a40823acba23899342d62bc2644051ad2e] Merge tag 'f2fs-for-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
# good: [0dd3ee31125508cd67f7e7172247f05b7fd1753a] Linux 6.7
git bisect start 'HEAD' 'v6.7'
# bad: [de927f6c0b07d9e698416c5b287c521b07694cac] Merge tag 's390-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
git bisect bad de927f6c0b07d9e698416c5b287c521b07694cac
# bad: [35f11a3710cdcbbc5090d14017a6295454e0cc73] Merge tag 'mtd/for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
git bisect bad 35f11a3710cdcbbc5090d14017a6295454e0cc73
# good: [d30e51aa7b1f6fa7dd78d4598d1e4c047fcc3fb9] Merge tag 'slab-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab
git bisect good d30e51aa7b1f6fa7dd78d4598d1e4c047fcc3fb9
# good: [fb46e22a9e3863e08aef8815df9f17d0f4b9aede] Merge tag 'mm-stable-2024-01-08-15-31' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
git bisect good fb46e22a9e3863e08aef8815df9f17d0f4b9aede
# good: [063a7ce32ddc2c4f2404b0dfd29e60e3dbcdffac] Merge tag 'lsm-pr-20240105' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm
git bisect good 063a7ce32ddc2c4f2404b0dfd29e60e3dbcdffac
# bad: [f6cd66231aa58599526584ff4df1bdde8d86eac8] spi: stm32: add st,stm32mp25-spi compatible supporting STM32MP25 soc
git bisect bad f6cd66231aa58599526584ff4df1bdde8d86eac8
# good: [18f78b5e609b19b56237f0dae47068d44b8b0ecd] spi: axi-spi-engine: improvements round 2
git bisect good 18f78b5e609b19b56237f0dae47068d44b8b0ecd
# bad: [9d93c8d97b4cdb5edddb4c5530881c90eecb7e44] spi: spi-ti-qspi: switch to use modern name
git bisect bad 9d93c8d97b4cdb5edddb4c5530881c90eecb7e44
# bad: [e6b7e64cb11966b26646a362677ca5a08481157e] spi: st-ssc4: switch to use modern name
git bisect bad e6b7e64cb11966b26646a362677ca5a08481157e
# bad: [c3aeaf2f0ec8af93189488bda3928a1ac7752388] spi: pxa2xx: Use inclusive language
git bisect bad c3aeaf2f0ec8af93189488bda3928a1ac7752388
# good: [f05e2f61fe88092e0d341ea27644a84e3386358d] ALSA: hda/cs35l56: Use set/get APIs to access spi->chip_select
git bisect good f05e2f61fe88092e0d341ea27644a84e3386358d
# bad: [88a50c1663ffa9f6b31705c6bf7a887a2c8d9434] spi: Add support for stacked/parallel memories
git bisect bad 88a50c1663ffa9f6b31705c6bf7a887a2c8d9434
# bad: [4d8ff6b0991d5e86b17b235fc46ec62e9195cb9b] spi: Add multi-cs memories support in SPI core
git bisect bad 4d8ff6b0991d5e86b17b235fc46ec62e9195cb9b
# first bad commit: [4d8ff6b0991d5e86b17b235fc46ec62e9195cb9b] spi: Add multi-cs memories support in SPI core

  reply	other threads:[~2024-01-12 19:11 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-25  9:21 [PATCH v11 00/10] spi: Add support for stacked/parallel memories Amit Kumar Mahapatra
2023-11-25  9:21 ` [PATCH v11 01/10] mfd: tps6594: Use set/get APIs to access spi->chip_select Amit Kumar Mahapatra
2023-12-01  9:57   ` (subset) " Lee Jones
2023-12-01 18:50     ` Mark Brown
2023-12-06 13:45       ` Lee Jones
2023-12-07 13:38       ` [GIT PULL] Immutable branch between MFD and SPI due for the v6.8 merge window Lee Jones
2023-12-07 16:20         ` Mark Brown
2023-11-25  9:21 ` [PATCH v11 02/10] ALSA: hda/cs35l56: Use set/get APIs to access spi->chip_select Amit Kumar Mahapatra
2023-11-25  9:21 ` [PATCH v11 03/10] spi: Add multi-cs memories support in SPI core Amit Kumar Mahapatra
2024-01-12 19:11   ` Guenter Roeck [this message]
2024-01-12 19:16     ` Mark Brown
2024-01-12 20:05       ` Guenter Roeck
2024-01-20 17:05     ` Guenter Roeck
2024-01-21  1:04       ` Mark Brown
2024-01-21 16:58         ` Guenter Roeck
2024-01-21 18:06           ` Michael Walle
2024-01-21 19:29             ` Guenter Roeck
2024-01-21 21:17               ` Mark Brown
2024-01-21 21:15             ` Mark Brown
2024-01-21  9:42     ` Linux regression tracking #adding (Thorsten Leemhuis)
2024-01-23 15:45       ` Linux regression tracking #update (Thorsten Leemhuis)
2023-11-25  9:21 ` [PATCH v11 04/10] mtd: spi-nor: Convert macros with inline functions Amit Kumar Mahapatra
2023-11-25  9:21 ` [PATCH v11 05/10] mtd: spi-nor: Add APIs to set/get nor->params Amit Kumar Mahapatra
2023-11-25  9:21 ` [PATCH v11 06/10] mtd: spi-nor: Move write enable inside specific write & erase APIs Amit Kumar Mahapatra
2023-11-25  9:21 ` [PATCH v11 07/10] mtd: spi-nor: Add stacked memories support in spi-nor Amit Kumar Mahapatra
2023-12-06 14:30   ` Tudor Ambarus
2023-12-06 14:43     ` Tudor Ambarus
2023-12-08 17:06       ` Mahapatra, Amit Kumar
2023-12-11  3:44         ` Tudor Ambarus
2023-12-08 17:05     ` Mahapatra, Amit Kumar
2023-12-11  3:33       ` Tudor Ambarus
2023-12-11  6:56         ` Mahapatra, Amit Kumar
2023-12-11  9:35           ` Tudor Ambarus
2023-12-11 13:37             ` Mahapatra, Amit Kumar
2023-12-12 15:02               ` Tudor Ambarus
2023-12-15  7:55                 ` Mahapatra, Amit Kumar
2023-12-15  8:09                   ` Tudor Ambarus
2023-12-15 10:02                     ` Mahapatra, Amit Kumar
2023-12-15 10:33                       ` Tudor Ambarus
2023-12-15 11:20                         ` Mahapatra, Amit Kumar
2023-12-19  8:26                           ` Tudor Ambarus
2023-12-21  6:54                             ` Mahapatra, Amit Kumar
2024-02-09 11:06                               ` Tudor Ambarus
2024-02-09 16:13                                 ` Tudor Ambarus
2024-03-13 16:03                                   ` Mahapatra, Amit Kumar
2024-07-26 12:35                                     ` Mahapatra, Amit Kumar
     [not found]                                       ` < <IA0PR12MB769944254171C39FF4171B52DCB42@IA0PR12MB7699.namprd12.prod.outlook.com>
2024-07-26 12:55                                         ` Michael Walle
2024-07-31  8:58                                           ` Michal Simek
2024-07-31  9:19                                             ` Michael Walle
2024-07-31 13:40                                               ` Michal Simek
2024-07-31 14:11                                                 ` Michael Walle
2024-08-01  6:22                                                   ` Michal Simek
2024-08-01  6:37                                                     ` Frager, Neal
2024-08-01  9:28                                                       ` Mahapatra, Amit Kumar
     [not found]                                                       ` < <CH2PR12MB50044242FE253D7B0E3425ABF0B22@CH2PR12MB5004.namprd12.prod.outlook.com>
2024-08-05  8:14                                                         ` Michael Walle
2024-08-05  8:27                                                     ` Michael Walle
2024-08-05 11:00                                                       ` Michal Simek
2024-08-07 13:21                                                         ` Mahapatra, Amit Kumar
2024-08-12  7:29                                                   ` Miquel Raynal
2024-08-12  7:37                                                     ` Michael Walle
2024-08-12  8:39                                                       ` Miquel Raynal
2024-08-12  8:38                                       ` Miquel Raynal
2024-08-12  9:45                                         ` Tudor Ambarus
2024-08-14  7:13                                         ` Mahapatra, Amit Kumar
2024-08-14  8:46                                           ` Miquel Raynal
2024-08-14 12:53                                             ` Mahapatra, Amit Kumar
2024-08-14 14:46                                               ` Miquel Raynal
2024-08-19 10:28                                                 ` Mahapatra, Amit Kumar
2024-03-13 16:03                                 ` Mahapatra, Amit Kumar
2023-12-07 17:24   ` Tudor Ambarus
2023-11-25  9:21 ` [PATCH v11 08/10] spi: spi-zynqmp-gqspi: Add stacked memories support in GQSPI driver Amit Kumar Mahapatra
2023-11-25  9:21 ` [PATCH v11 09/10] mtd: spi-nor: Add parallel memories support in spi-nor Amit Kumar Mahapatra
2023-11-25  9:21 ` [PATCH v11 10/10] spi: spi-zynqmp-gqspi: Add parallel memories support in GQSPI driver Amit Kumar Mahapatra
2023-12-07 22:35 ` (subset) [PATCH v11 00/10] spi: Add support for stacked/parallel memories Mark Brown
2023-12-12 12:34 ` Michael Walle
2023-12-15  7:28   ` Mahapatra, Amit Kumar
2023-12-18 22:10 ` Richard Weinberger
2023-12-19  8:12   ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d3a11b1-8396-4d8e-9bb3-61ecb67e7efa@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amit.kumar-mahapatra@amd.com \
    --cc=amitrkcian2002@gmail.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=david.rhodes@cirrus.com \
    --cc=git@amd.com \
    --cc=james.schulman@cirrus.com \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=michal.simek@amd.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=pratyush@kernel.org \
    --cc=rf@opensource.cirrus.com \
    --cc=richard@nod.at \
    --cc=sbinding@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    --cc=tudor.ambarus@linaro.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®