From: Nam Cao <namcao@linutronix.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: broonie@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] spi: spl022: switch to use default spi_transfer_one_message()
Date: Thu, 14 Dec 2023 08:49:55 +0100 [thread overview]
Message-ID: <20231214084955.7245c538@namcao> (raw)
In-Reply-To: <CACRpkdZfuKmg8gY1J+prF0L0=S7PSW+0ZuqM3HhNrB1sXcNG5g@mail.gmail.com>
On Thu, 14 Dec 2023 01:19:04 +0100 Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Nov 29, 2023 at 5:32 PM Nam Cao <namcao@linutronix.de> wrote:
> > Except for polling mode, this driver's transfer_one_message() makes use
> > of interrupt handler and tasklet. This is problematic because
> > spi_transfer_delay_exec(), who may sleep, is called in interrupt handler
> > and tasklet. This causes the following warning:
> > BUG: sleeping function called from invalid context at drivers/spi/spi.c:1428
> >
> > Switch to use the default spi_transfer_one_message() instead, which
> > calls spi_transfer_delay_exec() appropriately.
> >
> > Signed-off-by: Nam Cao <namcao@linutronix.de>
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > Tested with polling mode and interrupt mode, NOT with DMA mode.
> > Support with testing very appreciated!
>
> FWIW I tested this now on a device using DMA for the transfers
> and everything works fine like before.
Thanks for spending time reviewing and testing!
Best regards,
Nam
next prev parent reply other threads:[~2023-12-14 7:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 16:31 [PATCH v2 0/2] spi: spl022: fix sleeping in interrupt context Nam Cao
2023-11-29 16:31 ` [PATCH v2 1/2] spi: introduce SPI_TRANS_FAIL_IO for error reporting Nam Cao
2023-11-29 16:31 ` [PATCH v2 2/2] spi: spl022: switch to use default spi_transfer_one_message() Nam Cao
2023-12-14 0:19 ` Linus Walleij
2023-12-14 7:49 ` Nam Cao [this message]
2023-12-04 15:47 ` [PATCH v2 0/2] spi: spl022: fix sleeping in interrupt context 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=20231214084955.7245c538@namcao \
--to=namcao@linutronix.de \
--cc=broonie@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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).