diff options
| author | Arpith Alexander <arpith99@gmail.com> | 2026-11-03 18:44:35 +0530 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-11-04 13:42:30 +0000 |
| commit | 5072a9fae45a043cad80f74f4f19fc98803630ab (patch) | |
| tree | 4b6aaab48ccf82e86bb27860460be16e7bfe931f /tools/lib/python | |
| parent | 2d0953ab69d316589624b0517fdce01f8e630bf0 (diff) | |
spi: ljca: Don't require data in write replies
Commit 0fe4573c822c ("spi: ljca: validate the response length before
copying the data") made ljca_spi_read_write() reject any response whose
payload, as announced by r_packet->len, is not contained in the data
received.
That is right for reads, but the adapter acknowledges a write with only
the packet header: r_packet->len holds the number of bytes written and
no payload follows. The reply is 2 bytes long, so
"ret < sizeof(*r_packet) + r_packet->len" is true and every write fails
with -EIO.
Where the Intel Visual Sensing Controller (IVSC) is connected through
the LJCA, as on the Dell XPS 13 9340, its initialisation fails and the
camera behind it is lost:
spi_ljca usb_ljca.ljca-spi.0: transfer failed len: 256
vsc-tp spi-INTC10D0:00: SPI transfer failed: -5
intel_vsc intel_vsc: error -ENODEV: init hw failed
Only require the payload to be present when there is a receive buffer
to copy it into. Write acks are still checked for a non-zero length that
does not exceed the request.
Fixes: 0fe4573c822c ("spi: ljca: validate the response length before copying the data")
Cc: stable@vger.kernel.org # 6.8+
Signed-off-by: Arpith Alexander <arpith99@gmail.com>
Reviewed-by: Weibin Liu <liuwb@xiaopeng.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://patch.msgid.link/20261103131435.21838-1-arpith99@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
