From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Wolfram Sang <wsa@kernel.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Cosmin Tanislav <demonsingur@gmail.com>,
Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
stable@vger.kernel.org, Luca Ceresoli <luca.ceresoli@bootlin.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v2 1/3] i2c: atr: Fix client detach
Date: Tue, 10 Dec 2024 10:04:16 +0200 [thread overview]
Message-ID: <b01e8c0d-8847-48d5-b198-ae000fdb2b20@ideasonboard.com> (raw)
In-Reply-To: <20241122-i2c-atr-fixes-v2-1-0acd325b6916@ideasonboard.com>
Hi Wolfram,
On 22/11/2024 14:26, Tomi Valkeinen wrote:
> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>
> i2c-atr catches the BUS_NOTIFY_DEL_DEVICE event on the bus and removes
> the translation by calling i2c_atr_detach_client().
>
> However, BUS_NOTIFY_DEL_DEVICE happens when the device is about to be
> removed from this bus, i.e. before removal, and thus before calling
> .remove() on the driver. If the driver happens to do any i2c
> transactions in its remove(), they will fail.
>
> Fix this by catching BUS_NOTIFY_REMOVED_DEVICE instead, thus removing
> the translation only after the device is actually removed.
>
> Fixes: a076a860acae ("media: i2c: add I2C Address Translator (ATR) support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> ---
> drivers/i2c/i2c-atr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/i2c-atr.c b/drivers/i2c/i2c-atr.c
> index f21475ae5921..0d54d0b5e327 100644
> --- a/drivers/i2c/i2c-atr.c
> +++ b/drivers/i2c/i2c-atr.c
> @@ -412,7 +412,7 @@ static int i2c_atr_bus_notifier_call(struct notifier_block *nb,
> dev_name(dev), ret);
> break;
>
> - case BUS_NOTIFY_DEL_DEVICE:
> + case BUS_NOTIFY_REMOVED_DEVICE:
> i2c_atr_detach_client(client->adapter, client);
> break;
>
>
Can you pick this one up (ignore the two other patches in this series),
or should I send it as a separate patch?
Tomi
next prev parent reply other threads:[~2024-12-10 8:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 12:26 [PATCH v2 0/3] i2c: atr: A few i2c-atr fixes Tomi Valkeinen
2024-11-22 12:26 ` [PATCH v2 1/3] i2c: atr: Fix client detach Tomi Valkeinen
2024-11-22 14:07 ` Andy Shevchenko
2024-12-10 8:01 ` Tomi Valkeinen
2024-11-26 8:14 ` Luca Ceresoli
2024-11-29 12:44 ` Tomi Valkeinen
2024-12-02 16:21 ` Romain Gantois
2024-12-10 8:04 ` Tomi Valkeinen [this message]
2025-01-09 10:09 ` Wolfram Sang
2024-11-22 12:26 ` [PATCH v2 2/3] i2c: atr: Allow unmapped addresses from nested ATRs Tomi Valkeinen
2024-11-22 14:09 ` Andy Shevchenko
2024-11-26 8:16 ` Luca Ceresoli
2024-11-26 8:35 ` Tomi Valkeinen
2024-11-27 12:19 ` Luca Ceresoli
2024-11-28 17:50 ` Tomi Valkeinen
2024-11-29 11:53 ` Luca Ceresoli
2024-11-29 13:31 ` Tomi Valkeinen
2024-12-03 9:39 ` Luca Ceresoli
2024-12-03 10:35 ` Cosmin Tanislav
2024-12-04 17:20 ` Luca Ceresoli
2024-11-26 8:34 ` Romain Gantois
2024-11-29 11:53 ` Luca Ceresoli
2024-11-22 12:26 ` [PATCH v2 3/3] i2c: atr: Fix lockdep for " Tomi Valkeinen
2024-11-22 14:13 ` [PATCH v2 0/3] i2c: atr: A few i2c-atr fixes Andy Shevchenko
2024-12-03 8:06 ` Tomi Valkeinen
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=b01e8c0d-8847-48d5-b198-ae000fdb2b20@ideasonboard.com \
--to=tomi.valkeinen@ideasonboard.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=demonsingur@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=tomi.valkeinen+renesas@ideasonboard.com \
--cc=wsa+renesas@sang-engineering.com \
--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 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®