From: Lukas Wunner <lukas@wunner.de>
To: "Sa, Nuno" <Nuno.Sa@analog.com>
Cc: "wahrenst@gmx.net" <wahrenst@gmx.net>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
"bcm-kernel-feedback-list@broadcom.com"
<bcm-kernel-feedback-list@broadcom.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"kernel@martin.sperl.org" <kernel@martin.sperl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"sbranden@broadcom.com" <sbranden@broadcom.com>,
"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
"rjui@broadcom.com" <rjui@broadcom.com>,
"linux-rpi-kernel@lists.infradead.org"
<linux-rpi-kernel@lists.infradead.org>,
"eric@anholt.net" <eric@anholt.net>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] spi: spi-bcm2835.c: Fix 3-wire mode
Date: Mon, 1 Jul 2019 13:55:06 +0200 [thread overview]
Message-ID: <20190701115506.42rr4o4hbuvwytjc@wunner.de> (raw)
In-Reply-To: <54323339606a36febc6a8633a8d3a7db84b975c4.camel@analog.com>
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
next prev parent reply other threads:[~2019-07-01 11:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 12:30 [PATCH] spi: spi-bcm2835.c: Fix 3-wire mode Nuno Sá
2019-06-28 15:23 ` Stefan Wahren
2019-06-28 19:00 ` Lukas Wunner
2019-07-01 7:24 ` Sa, Nuno
2019-07-01 11:55 ` Lukas Wunner [this message]
2019-07-01 14:21 ` Sa, Nuno
2019-07-03 10:43 ` Lukas Wunner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190701115506.42rr4o4hbuvwytjc@wunner.de \
--to=lukas@wunner.de \
--cc=Nuno.Sa@analog.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=broonie@kernel.org \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=kernel@martin.sperl.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).