Commit 342d00a
committed
FROMLIST: spi: qcom-geni: Fix cs_change handling on the last transfer
Commit b99181c ("spi-geni-qcom: remove manual CS control") introduced
automatic CS control via the FRAGMENTATION bit, but missed the case where
cs_change is set on the last transfer in a message.
For the last transfer, cs_change means that CS should remain asserted after
the message completes. Since GENI SPI controls CS through FRAGMENTATION,
set FRAGMENTATION for this case as well as for non-last transfers where
cs_change is not set.
Additionally, setup_gsi_xfer() was storing FRAGMENTATION (BIT(2) = 4) in
peripheral.fragmentation, which is a boolean field consumed by
gpi_create_spi_tre() via u32_encode_bits(..., TRE_SPI_GO_FRAG). Storing 4
causes u32_encode_bits to mask it to 0, silently disabling the FRAG bit in
the GPI TRE regardless of the cs_change logic. Store 1 instead.
Without these fixes, TPM TIS SPI transfers deassert CS between
single-transfer messages that use cs_change to keep CS asserted across the
header, wait-state, and data phases, breaking TCG SPI flow control:
tpm_tis_spi: probe of spi11.0 failed with error -110
Update both setup_se_xfer() and setup_gsi_xfer() to handle this condition.
Link: https://lore.kernel.org/all/20260529-fix-spi-fragmentation-bit-logic-v1-1-3b30f1a3dd7d@oss.qualcomm.com/
Fixes: b99181c ("spi-geni-qcom: remove manual CS control")
Cc: stable@vger.kernel.org
Signed-off-by: Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>1 parent 07adbc9 commit 342d00a
1 file changed
Lines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
447 | 452 | | |
448 | 453 | | |
449 | 454 | | |
| |||
849 | 854 | | |
850 | 855 | | |
851 | 856 | | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
856 | 867 | | |
857 | 868 | | |
858 | 869 | | |
| |||
0 commit comments