• Serge Semin's avatar
    tty: max310x: Don't pass stacked buffers to SPI · b7382c73
    Serge Semin authored
    SPI transfer tx/rx buffers must be DMA-safe and the structure
    documentation clearly states this. Data declared on the system stack isn't
    DMA-safe [1]. Instead at least kernel memory should be used for the
    buffers. In order to fix this here we can create the buffers at the device
    probing stage and use them without any synchronization, since batch
    read/write methods are called from non-reentrant contexts - either from
    rx-event IRQ threaded handler or from the tx workqueue item.
    
    [1] Documentation/DMA-API-HOWTO.txt
    Signed-off-by: default avatarSerge Semin <fancer.lancer@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    b7382c73
max310x.c 41.1 KB