• David Brownell's avatar
    [PATCH] SPI: define null tx_buf to mean "shift out zeroes" · 4b1badf5
    David Brownell authored
    Some issues were recently turned up with the current specification of what
    it means for spi_transfer.tx_buf to be null, as part of transfers which are
    (from the SPI protocol driver perspective) pure reads.
    
    Specifically, that it seems better to change the TX behaviour there from
    "undefined" to "will shift zeroes".  This lets protocol drivers (like the
    ads7846 driver) depend on that behavior.  It's what most controller drivers
    in the tree are already doing (with one exception and one case of driver
    wanting-to-oops), it's what Microwire hardware will necessarily be doing,
    and it removes an issue whereby certain security audits would need to
    define such a value anyway as part of removing covert channels.
    
    This patch changes the specification to require shifting zeroes, and
    updates all currently merged SPI controller drivers to do so.
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    4b1badf5
spi_s3c24xx.c 9.41 KB