From: Mark Brown <broonie@kernel.org>
To: Daisuke Yamane <yamane07ynct@gmail.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: a3700: fix hang caused by a3700_spi_transfer_one_fifo()
Date: Tue, 30 Jun 2020 12:11:37 +0100 [thread overview]
Message-ID: <20200630111137.GI5272@sirena.org.uk> (raw)
In-Reply-To: <20200629174421.25784-1-yamane07ynct@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]
On Tue, Jun 30, 2020 at 02:44:21AM +0900, Daisuke Yamane wrote:
> transfer_one() must call spi_finalize_current_transfer() before
> returning to inform current transfer has finished. Otherwise spi driver
> doesn't issue next transfer, and hang.
To be clear it can also return a positive value and then finalize later,
there's no need to finalize before returning (otherwise finalizing would
be a bit redundant) and if the driver doesn't return a positive value
there should be no need to finalize at all.
> However a3700_spi_transfer_one_fifo() doesn't call it if waiting for
> "wfifo empty" or "xfer ready" has timed out.
> Thus, this patch corrects error handling of them.
The core shouldn't be waiting at all if the driver returned an error, we
only wait if the return value was positive. Looking at the code it's
not clear to me how we manage to end up waiting - it looks like the
driver passes back the error correctly and the core looks like it does
the right thing. Have you seen hangs in operation?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-06-30 11:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-29 17:44 Daisuke Yamane
2020-06-30 11:11 ` Mark Brown [this message]
2020-07-01 13:18 ` Daisuke Yamane
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=20200630111137.GI5272@sirena.org.uk \
--to=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=yamane07ynct@gmail.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
all inboxes | Powered by JetHome®