Skip to content

[PW_SID:1086971] microchip core-qspi gpio-cs fixes + cleanup#1831

Closed
linux-riscv-bot wants to merge 3 commits into
workflowfrom
pw1086971
Closed

[PW_SID:1086971] microchip core-qspi gpio-cs fixes + cleanup#1831
linux-riscv-bot wants to merge 3 commits into
workflowfrom
pw1086971

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1086971 applied to workflow

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

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>
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: "[v2,1/3] spi: microchip-core-qspi: control built-in cs manually"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 117.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/3] 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: 1065.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/3] 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: 1434.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2,1/3] 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: 21.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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: 1062.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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: 1439.53 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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: 20.08 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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: 21.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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.88 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 48ac52ec97bc ("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: "[v2,2/3] 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: 78.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v2,2/3] 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.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/3] 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: 1064.55 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/3] 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: 1437.95 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v2,3/3] spi: microchip-core-qspi: remove some inline markings"
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: "[v2,3/3] spi: microchip-core-qspi: remove some inline markings"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1086971 branch April 29, 2026 00:22
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