[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190701115506.42rr4o4hbuvwytjc@wunner.de>
Date: Mon, 1 Jul 2019 13:55:06 +0200
From: Lukas Wunner <lukas@...ner.de>
To: "Sa, Nuno" <Nuno.Sa@...log.com>
Cc: "wahrenst@....net" <wahrenst@....net>,
"linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
"bcm-kernel-feedback-list@...adcom.com"
<bcm-kernel-feedback-list@...adcom.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"kernel@...tin.sperl.org" <kernel@...tin.sperl.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"sbranden@...adcom.com" <sbranden@...adcom.com>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"rjui@...adcom.com" <rjui@...adcom.com>,
"linux-rpi-kernel@...ts.infradead.org"
<linux-rpi-kernel@...ts.infradead.org>,
"eric@...olt.net" <eric@...olt.net>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] spi: spi-bcm2835.c: Fix 3-wire mode
On Mon, Jul 01, 2019 at 07:24:23AM +0000, Sa, Nuno wrote:
> The problem is in spi_map_msg() which
> allocates dummy buffers (because of the ctrl flags). As a result, in
> bcm2835_spi_transfer_one() we set "cs |= BCM2835_SPI_CS_REN;" when we
> want to do tx only. I believe this was the actual problem...
I see. In that case, try:
/* handle all the 3-wire mode */
- if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf))
+ if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf != ctlr->dummy_rx))
cs |= BCM2835_SPI_CS_REN;
else
cs &= ~BCM2835_SPI_CS_REN;
Use master->dummy_rx instead of ctlr->dummy_rx prior to commit
5f336ea53b6b ("spi: bcm2835: Replace spi_master by spi_controller").
This could be something that users of your cape might use on older
kernels in lieu of my upcoming patch set to drop MUST_RX / MUST_TX.
Thanks,
Lukas
Powered by blists - more mailing lists