From: Mark Brown <broonie@kernel.org>
To: Yun Zhou <yun.zhou@windriver.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
ying.xue@windriver.com
Subject: Re: [PATCH] spi: disable chipselect after complete transfer
Date: Wed, 9 Feb 2022 13:40:43 +0000 [thread overview]
Message-ID: <YgPEWyEj7lbQJgAn@sirena.org.uk> (raw)
In-Reply-To: <20220209100042.22941-1-yun.zhou@windriver.com>
[-- Attachment #1: Type: text/plain, Size: 936 bytes --]
On Wed, Feb 09, 2022 at 06:00:42PM +0800, Yun Zhou wrote:
> If there are 2 slaves or more on a spi bus, e.g. A and B, we processed a
> transfer to A, the CS will be selected for A whose 'last_cs_enable' will
> be recorded to true at the same time. Then we processed a transfer to B,
> the CS will be switched to B. And then if we transmit data to A again, it
> will not enable CS back to A because 'last_cs_enable' is true.
> In addition, if CS is not disabled, Some controllers in automatic
> transmission state will receive unpredictable data, such as Cadence SPI
> controller.
This sounds like you've got an issue with mixing devices with and
without CS_HIGH - that is probably broken but...
> out:
> - if (ret != 0 || !keep_cs)
> - spi_set_cs(msg->spi, false, false);
> + spi_set_cs(msg->spi, false, false);
...this will obviously break cs_change support, clearly that's not OK.
The last_cs_high should be moved to the device.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-02-09 13:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 10:00 [PATCH] spi: disable chipselect after complete transfer Yun Zhou
2022-02-09 13:40 ` Mark Brown [this message]
2022-02-10 2:03 ` Yun Zhou
2022-02-10 11:18 ` Mark Brown
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=YgPEWyEj7lbQJgAn@sirena.org.uk \
--to=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=ying.xue@windriver.com \
--cc=yun.zhou@windriver.com \
/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).