-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AXI SPI Engine driver modifies SPI xfer length. #2299
Comments
Fixing this is likely going to break things that depend on this buggy behavoir. For example, in the linux/drivers/iio/adc/ad_pulsar.c Lines 359 to 382 in b8d0e51
For a single conversion (reading the |
I guess my comments in #2300 can also be applied in here |
30707b0 introduced a function
spi_engine_update_xfer_len()
that modifies thelen
field of each xfer in an SPI message. However, modifying thestruct spi_transfer
is problematic.Since
spi_engine_compile_message()
actually gets called twice per message (once is a "dry" run to calculate the size, then again to actually write the commands to memory),spi_engine_update_xfer_len()
is getting called twice and therefore modifies the length twice. This probably has gone unnoticed since the first call usually sets the length to1
and the second call can't make it any smaller.Modifying the members of
struct spi_transfer
in the SPI controller doesn't seem like a good idea in general since it doesn't own that memory. For example, a client driver may be reusing thestruct spi_transfer
and not write the length again before each transaction.(The commit in question is not in the mainline kernel, but it fixes a potential issue that may still exist in the mainline kernel.)
The text was updated successfully, but these errors were encountered: