Repository navigation
spi: s3c64xx: turn the channels off before clearing the packet count - #150
Conversation
|
Thank you for tracking this down. Google's Pixel 7 driver does the same in |
s3c64xx_flush_fifo() clears PACKET_CNT, and with it PACKET_CNT_EN, while RXCH_ON is still set. For the duration of that write the controller is receiving with no packet count, so it runs SCK freely; with automatic chip select the slave stays selected and shifts out bits that the flush then throws away. Slaves that restart their protocol on every chip-select cycle don't notice. A slave that streams across cycles does: the Pixel 9a's GNSS core, which talks CHPP over this controller, lost two to six bits per transfer, so every read arrived at a different bit offset and frames that crossed reads failed their CRC. With the channels turned off first, as Google's driver for this controller does, every read arrives at bit 0 with a valid CRC and the receiver gets a fix. Turn RX and TX off before clearing the packet count. Link: https://android.googlesource.com/kernel/google-modules/soc/gs/+/204078758737776959ecc85c527a00fd2cabb62f/drivers/spi/spi-s3c64xx.c Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
|
Added the Link: to Google's file, pinned to the google-modules soc/gs commit 204078758737776959ecc85c527a00fd2cabb62f (the June 2025 sync, which is the tree I compared against; its flush_fifo() turns the channels off before clearing the count). Nothing else changed; the sign-off is unchanged and checkpatch is clean. |
e6c971d to
badc176
Compare
|
Tested on my 7 Pro on 7.3.0-rc6-omamobile-push1-gc32dd8e2d33e (my test kernel plus this commit): all three SPI users run with no SPI errors. Touch works; GNSS streamed about 5,300 NMEA lines over 150 s with no errors; both speaker amplifiers came up with protection and played tones on each speaker and both, with no amplifier errors and no watchdog mute. Merged, thanks. The |
s3c64xx_flush_fifo()clears PACKET_CNT, and with it PACKET_CNT_EN, while RXCH_ON is still set. For the length of that write the controller receives with no packet count and runs SCK freely; with automatic chip select the slave stays selected and shifts out bits the flush then discards. Google's driver for this controller turns the channels off first. This does the same, one write moved.Slaves that restart on every chip-select cycle (the touchscreens) don't notice. The Pixel 9a's GNSS core streams CHPP across cycles and lost two to six bits per transfer: every read arrived at a different bit offset and frames that crossed reads failed their CRC. This was the GNSS link problem tracked on #137 since 10-28.
Tested on the palmtop (the 9a), on the integration kernel with this commit and the GNSS SPI's swap-mode and pin settings from #137: every CHPP read at bit 0 with a valid CRC32, and a 10-minute GNSS session with 38 of 43 GGA sentences fixed (10-13 satellites, HDOP about 1), no ACK timeouts, bad checksums or link errors. The touchscreen on the other PERIC1 SPI bus and the rest of the smoke report were unchanged on the same boot. Not tested on the Pixel 7 Pro; its SPI users there (touch) restart per transfer, so no change is expected, but a boot with touch working would confirm it.
checkpatch --strict: 0 errors, 0 warnings.