From: Mark Brown <broonie@kernel.org>
To: "wuxu.wu" <wuxu.wu@huawei.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
hushiyuan@huawei.com
Subject: Re: [PATCH] spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls
Date: Fri, 27 Dec 2019 00:50:19 +0000 [thread overview]
Message-ID: <20191227005019.GI27497@sirena.org.uk> (raw)
In-Reply-To: <1576900099-40754-1-git-send-email-wuxu.wu@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]
On Sat, Dec 21, 2019 at 11:48:19AM +0800, wuxu.wu wrote:
> dw_spi_irq()nd dw_spi_transfer_one concurrent calls.
>
> I find a panic in dw_writer(): txw = *(u8 *)(dws->tx);
Please fix the indentation of your commit log, it's indented by a
tab - look at other patches people are posting for examples...
> [ 1025.321302] Call trace:
> [ 1025.321309] machine_kexec+0x58/0x3e8
> [ 1025.321319] __crash_kexec+0x98/0x148
Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative then it's
usually better to pull out the relevant sections.
> [ 1025.321365] dw_spi_irq+0x48/0x70
> [ 1025.321377] __handle_irq_event_percpu+0x74/0x278
>
> Signed-off-by: wuxu.wu <wuxu.wu@huawei.com>
> ---
The Signed-off-by here has the right indenttion for the
changelog.
> static void dw_writer(struct dw_spi *dws)
> {
> - u32 max = tx_max(dws);
> + u32 max
> u16 txw = 0;
> + unsigned long flags;
>
> + spin_lock_irqsave(&dws->buf_lock, flags);
We shouldn't use spin_lock_irqsave() here since this is called
from interrupt context by interrupt_transfer() - we should use
plain old spin_lock() here. Otherwise the code change looks
good, well spotted!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next parent reply other threads:[~2019-12-27 0:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1576900099-40754-1-git-send-email-wuxu.wu@huawei.com>
2019-12-27 0:50 ` Mark Brown [this message]
[not found] <1577418669-34821-1-git-send-email-wuxu.wu@huawei.com>
2019-12-31 0:29 ` [PATCH] spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls Mark Brown
[not found] <1576767380-12947-1-git-send-email-wuxu.wu@huawei.com>
2019-12-19 16:41 ` 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=20191227005019.GI27497@sirena.org.uk \
--to=broonie@kernel.org \
--cc=hushiyuan@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=wuxu.wu@huawei.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).