Re: [PATCH for-5.3] spi: bcm2835: Fix 3-wire mode if DMA is enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 03.07.19 um 12:29 schrieb Lukas Wunner:
> Commit 6935224da248 ("spi: bcm2835: enable support of 3-wire mode")
> added 3-wire support to the BCM2835 SPI driver by setting the REN bit
> (Read Enable) in the CS register when receiving data.  The REN bit puts
> the transmitter in high-impedance state.  The driver recognizes that
> data is to be received by checking whether the rx_buf of a transfer is
> non-NULL.
>
> Commit 3ecd37edaa2a ("spi: bcm2835: enable dma modes for transfers
> meeting certain conditions") subsequently broke 3-wire support because
> it set the SPI_MASTER_MUST_RX flag which causes spi_map_msg() to replace
> rx_buf with a dummy buffer if it is NULL.  As a result, rx_buf is
> *always* non-NULL if DMA is enabled.
>
> Reinstate 3-wire support by not only checking whether rx_buf is non-NULL,
> but also checking that it is not the dummy buffer.
>
> Fixes: 3ecd37edaa2a ("spi: bcm2835: enable dma modes for transfers meeting certain conditions")
> Reported-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
> Signed-off-by: Lukas Wunner <lukas@xxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx # v4.2+
> Cc: Martin Sperl <kernel@xxxxxxxxxxxxxxxx>

Acked-by: Stefan Wahren <wahrenst@xxxxxxx>

Please use my new address in the future





[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux