From: Thierry Reding <thierry.reding@gmail.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: Wolfram Sang <wsa@kernel.org>, Jon Hunter <jonathanh@nvidia.com>,
linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH v2] i2c: tegra: Fix failure during probe deferral cleanup
Date: Tue, 25 Jul 2023 18:25:34 +0200 [thread overview]
Message-ID: <ZL_3fhE-ve08ZZRp@orome> (raw)
In-Reply-To: <20230707132619.2998382-1-thierry.reding@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]
On Fri, Jul 07, 2023 at 03:26:19PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> If the driver fails to obtain a DMA channel, it will initiate cleanup
> and try to release the DMA channel that couldn't be retrieved. This will
> cause a crash because the cleanup will try to dereference an ERR_PTR()-
> encoded error code.
>
> However, there's nothing to clean up at this point yet, so we can avoid
> this by simply resetting the DMA channel to NULL instead of storing the
> error code.
>
> Fixes: fcc8a89a1c83 ("i2c: tegra: Share same DMA channel for RX and TX")
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> Changes in v2:
> - simplify patch by setting dma_chan = NULL on channel request failure
>
> drivers/i2c/busses/i2c-tegra.c | 1 +
> 1 file changed, 1 insertion(+)
Hi Andy, Wolfram,
do you have any reservations about this? This fixes a bug that was
introduced in v6.5-rc1, so it'd be great if this could make v6.5.
Thanks,
Thierry
>
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index f155e9028f94..2a13f11edfd1 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -460,6 +460,7 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
> i2c_dev->dma_chan = dma_request_chan(i2c_dev->dev, "tx");
> if (IS_ERR(i2c_dev->dma_chan)) {
> err = PTR_ERR(i2c_dev->dma_chan);
> + i2c_dev->dma_chan = NULL;
> goto err_out;
> }
>
> --
> 2.41.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-07-25 16:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 13:26 [PATCH v2] i2c: tegra: Fix failure during probe deferral cleanup Thierry Reding
2023-07-20 15:42 ` Akhil R
2023-07-25 16:25 ` Thierry Reding [this message]
2023-07-25 21:34 ` Andi Shyti
2023-07-27 15:05 ` Thierry Reding
2023-07-27 19:57 ` Andi Shyti
2023-08-14 13:34 ` Wolfram Sang
-- strict thread matches above, loose matches on Subject: below --
2023-07-17 17:15 Akhil R
2023-07-17 17:25 ` Shanker Donthineni
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=ZL_3fhE-ve08ZZRp@orome \
--to=thierry.reding@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=wsa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.