From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Rong Zhang <i@rong.moe>
Cc: Hongyan Xu <getshell@seu.edu.cn>,
Hans de Goede <hansg@kernel.org>, Zehao Gao <gaozehao@iie.ac.cn>,
Hyunjung Ko <hj351016@gmail.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
"Derek J.Clark" <derekjohn.clark@gmail.com>,
Mark Pearson <mpearson-lenovo@squebb.ca>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] platform/x86: lenovo: cancel fastcharger work on detach
Date: Mon, 16 Nov 2026 15:29:10 +0200 (EET) [thread overview]
Message-ID: <91e97984-fab7-f86b-c9d6-affd4ca117d4@linux.intel.com> (raw)
In-Reply-To: <ab88da4911164925279b071519825fc344e998fc.camel@rong.moe>
On Mon, 16 Nov 2026, Rong Zhang wrote:
> Hi Hongyan,
>
> On Sun, 2026-11-15 at 19:47 +0800, Hongyan Xu wrote:
> > The extcon callback schedules a worker which uses managed serdev,
> > pinctrl and GPIO resources. Releasing those resources while the
> > worker remains pending or running can access invalid state.
> >
> > Install managed work cancellation after the UART is opened and
> > before registering the managed notifier. Reverse devres order
> > then unregisters and waits for notifier callbacks, drains the
> > worker and only afterwards closes the UART and frees its pin
> > resources. This depends on the preceding all-connector notifier
> > synchronization patch; resource order alone is insufficient.
> >
> > The actual lc824206xa supplier notifies from work context, and
> > this consumer callback only schedules work. The callback must not
> > outlive synchronized unregister or republish after cancellation.
> >
> > Found by the author's in-house static analysis tool.
> >
> > Fixes: b2ed33e8d486 ("platform/x86: Add lenovo-yoga-tab2-pro-1380-fastcharger driver")
> > Cc: stable@vger.kernel.org
> > Link: https://lore.kernel.org/all/20260806060526.1189-1-getshell@seu.edu.cn/
> > Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
> > Signed-off-by: Zehao Gao <gaozehao@iie.ac.cn>
>
> The submitter's S-o-b should be placed at last.
>
> (+CC Zehao)
>
> And how did Zehao contribute to the series? You didn't even CC them!
>
> (+CC Hyunjung)
>
> Hyunjung is also working on this. See
> https://msgid.link/20261116122001.3096223-1-hj351016@gmail.com
Yeah, and I'll prioritize that work over this because otherwise LLM users
could just steal other people's patches before I can process them.
The extcon part was reported by sashiko as a response to Hyunjung's patch
so I suspect this submitter's LLM got that idea from there (of course
without attributing it to sashiko).
The extcon fix might not have been submitted before AFAIK but that's not
pdx86 material anyway.
--
i.
> Thanks,
> Rong
>
> > ---
> >
> > Discovery: found by the author's in-house static analysis tool.
> >
> > .../platform/x86/lenovo/yoga-tab2-pro-1380-fastcharger.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/platform/x86/lenovo/yoga-tab2-pro-1380-fastcharger.c b/drivers/platform/x86/lenovo/yoga-tab2-pro-1380-fastcharger.c
> > index 9e2ac80..51ff383 100644
> > --- a/drivers/platform/x86/lenovo/yoga-tab2-pro-1380-fastcharger.c
> > +++ b/drivers/platform/x86/lenovo/yoga-tab2-pro-1380-fastcharger.c
> > @@ -8,6 +8,7 @@
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >
> > #include <linux/delay.h>
> > +#include <linux/devm-helpers.h>
> > #include <linux/err.h>
> > #include <linux/errno.h>
> > #include <linux/extcon.h>
> > @@ -160,7 +161,6 @@ static int yt2_1380_fc_serdev_probe(struct serdev_device *serdev)
> >
> > fc->dev = dev;
> > fc->nb.notifier_call = yt2_1380_fc_extcon_evt;
> > - INIT_WORK(&fc->work, yt2_1380_fc_worker);
> >
> > /*
> > * Do this first since it may return -EPROBE_DEFER.
> > @@ -209,6 +209,10 @@ static int yt2_1380_fc_serdev_probe(struct serdev_device *serdev)
> > serdev_device_set_baudrate(serdev, 600);
> > serdev_device_set_flow_control(serdev, false);
> >
> > + ret = devm_work_autocancel(dev, &fc->work, yt2_1380_fc_worker);
> > + if (ret)
> > + return ret;
> > +
> > ret = devm_extcon_register_notifier_all(dev, fc->extcon, &fc->nb);
> > if (ret)
> > return dev_err_probe(dev, ret, "registering extcon notifier\n");
>
--
i.
next prev parent reply other threads:[~2026-11-16 13:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 11:47 [PATCH v2 0/2] extcon: synchronize all-connector removal and fix Lenovo fastcharger teardown Hongyan Xu
2026-11-15 11:47 ` [PATCH v2 1/2] extcon: synchronize all-connector notifier removal Hongyan Xu
2026-11-16 11:28 ` Ilpo Järvinen
2026-11-15 11:47 ` [PATCH v2 2/2] platform/x86: lenovo: cancel fastcharger work on detach Hongyan Xu
2026-11-16 12:59 ` Rong Zhang
2026-11-16 13:29 ` Ilpo Järvinen [this message]
2026-11-16 12:58 ` [PATCH v2 0/2] extcon: synchronize all-connector removal and fix Lenovo fastcharger teardown Rong Zhang
2026-11-16 14:30 ` Hongyan Xu
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=91e97984-fab7-f86b-c9d6-affd4ca117d4@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=cw00.choi@samsung.com \
--cc=derekjohn.clark@gmail.com \
--cc=gaozehao@iie.ac.cn \
--cc=getshell@seu.edu.cn \
--cc=hansg@kernel.org \
--cc=hj351016@gmail.com \
--cc=i@rong.moe \
--cc=linux-kernel@vger.kernel.org \
--cc=mpearson-lenovo@squebb.ca \
--cc=myungjoo.ham@samsung.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@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
all inboxes | Powered by JetHome®