Skip to content

[PW_SID:1084338] microchip core-qspi gpio-cs fixes + cleanup#1805

Closed
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw1084338
Closed

[PW_SID:1084338] microchip core-qspi gpio-cs fixes + cleanup#1805
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw1084338

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1084338 applied to workflow__riscv__fixes

Name: microchip core-qspi gpio-cs fixes + cleanup
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1084338
Version: 1

Linux RISC-V bot and others added 6 commits April 5, 2026 01:35
The coreQSPI IP supports only a single chip select, which is
automagically operated by the hardware - set low when the transmit
buffer first gets written to and set high when the number of bytes
written to the TOTALBYTES field of the FRAMES register have been sent on
the bus. Additional devices must use GPIOs for their chip selects.
It was reported to me that if there are two devices attached to this
QSPI controller that the in-built chip select is set low while linux
tries to access the device attached to the GPIO.

This went undetected as the boards that connected multiple devices to
the SPI controller all exclusively used GPIOs for chip selects, not
relying on the built-in chip select at all. It turns out that this was
because the built-in chip select, when controlled automagically, is set
low when active and high when inactive, thereby ruling out its use for
active-high devices or devices that need to transmit with the chip
select disabled.

Modify the driver so that it controls chip select directly, retaining
the behaviour for mem_ops of setting the chip select active for the
entire duration of the transfer in the exec_op callback. For regular
transfers, implement the set_cs callback for the core to use.

As part of this, the existing setup callback, mchp_coreqspi_setup_op(),
is removed. Modifying the CLKIDLE field is not safe to do during
operation when there are multiple devices, so this code is removed
entirely. Setting the MASTER and ENABLE fields is something that can be
done once at probe, it doesn't need to be re-run for each device.
Instead the new setup callback sets the built-in chip select to its
inactive state for active-low devices, as the reset value of the chip
select in software controlled mode is low.

Fixes: 8f9cf02 ("spi: microchip-core-qspi: Add regular transfers")
Fixes: 8596124 ("spi: microchip-core-qspi: Add support for microchip fpga qspi controllers")
CC: stable@vger.kernel.org
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…ead-only dual/quad operations

The core will deal with reads by creating clock cycles itself, there's
no need to generate clock cycles by transmitting garbage data at the
driver level. Further, transmitting garbage data just bricks the transfer
since QSPI doesn't have a dedicated master-out line like MOSI in regular
SPI. I'm not entirely sure if the transfer is bricked because of the
garbage data being transmitted on the bus or because the core loses
track of whether it is supposed to be sending or receiving data.

Fixes: 8f9cf02 ("spi: microchip-core-qspi: Add regular transfers")
CC: stable@vger.kernel.org
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…ead of which controller

When prepare_message callbacks fail, the SPI core already reports which
controller the failure happened on. The corresponding code in the mem_ops
portion of the driver already reports the device a timeout occurred on,
so make the regular part of the driver do the same.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
I noticed this define was incorrect, it should be UpperAddress, but in
renaming it it became clear there were actually no users. Just get rid
of it.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Remove inline markings from a number of functions that are called as
part of mem ops callbacks. None of them are either particularly trivial
or sensitive to overhead of a function call. Just let the compiler
decide what to do with them.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 142.15 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1018.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1376.38 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.18 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.43 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 85.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v1,1/5] spi: microchip-core-qspi: control built-in cs manually"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 135.55 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1020.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1373.93 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.41 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.53 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.96 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#36: FILE: drivers/spi/spi-microchip-core-qspi.c:701:
+	if (t->tx_nbits == SPI_NBITS_QUAD || t->rx_nbits == SPI_NBITS_QUAD ||
+			t->tx_nbits == SPI_NBITS_DUAL ||

total: 0 errors, 0 warnings, 1 checks, 29 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit b284a62cb1d5 ("spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 29 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.65 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
kdoc
Desc: Detects for kdoc errors
Duration: 0.93 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v1,2/5] spi: microchip-core-qspi: don't attempt to transmit during emulated read-only dual/quad operations"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v1,3/5] spi: microchip-core-qspi: report device on which timeout occured instead of which controller"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v1,3/5] spi: microchip-core-qspi: report device on which timeout occured instead of which controller"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v1,3/5] spi: microchip-core-qspi: report device on which timeout occured instead of which controller"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 136.05 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1017.36 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1372.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 24.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 25.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.79 seconds
Result: WARNING
Output:

WARNING: Possible repeated word: 'it'
#7: 
renaming it it became clear there were actually no users. Just get rid

total: 0 errors, 1 warnings, 0 checks, 7 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 365f0f0375da ("spi: microchip-core-qspi: remove an unused define") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 0 checks, 7 lines checked
WARNING: Possible repeated word: 'it'


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.96 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v1,4/5] spi: microchip-core-qspi: remove an unused define"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 135.93 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1013.66 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1376.17 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.54 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 25.57 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.78 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.10 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v1,5/5] spi: microchip-core-qspi: remove some inline markings"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 506e7f6 to 01805bc Compare April 24, 2026 14:53
@linux-riscv-bot linux-riscv-bot deleted the pw1084338 branch April 28, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants