From: Huang Wei <huangwei@kylinos.cn>
To: Marco Giunta <marco_giunta@outlook.it>
Cc: "Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: ideapad-laptop: Report camera switch as SW_CAMERA_LENS_COVER
Date: Sun, 20 Sep 2026 14:42:18 +0800 [thread overview]
Message-ID: <20260920064218.619667-1-huangwei@kylinos.cn> (raw)
In-Reply-To: <SN6PR19MB23039910DD1918BEE3825BAFFC862@SN6PR19MB2303.namprd19.prod.outlook.com>
Hi Marco,
I went through the patch and the approach looks right to me - matching
what lenovo-wmi-camera does with SW_CAMERA_LENS_COVER is the correct
call, and reporting the initial state before input_register_device()
is the right way for EVIOCGSW to pick it up.
I initially wondered whether the lazy device creation could race
against a concurrent notification, but ideapad_wmi_notify() holds
ideapad_shared_mutex across the whole handler, so the init is
serialized. It might be worth a comment on the init function saying
it relies on that, since it's not obvious from the code itself - I
had to go and check.
One small thing: if ideapad_camera_switch_init() fails, the state
carried by that event is dropped, and every later event retries the
registration and warns again. Probably fine in practice, but a
persistent failure would log one warning per toggle.
Thanks also for the notes on the alternatives and the
suspend-staleness limitation, that context is really helpful for
review.
Huang Wei
next prev parent reply other threads:[~2026-09-20 6:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 8:41 Marco Giunta
2026-09-20 6:42 ` Huang Wei [this message]
2026-09-20 9:58 ` Marco Giunta
2026-09-20 10:29 ` Huang Wei
2026-09-20 10:58 ` Marco Giunta
2026-09-20 20:28 ` [PATCH v2] " Marco Giunta
2026-09-21 2:36 ` Huang Wei
2026-09-21 14:50 ` Rong Zhang
2026-09-21 15:03 ` Rong Zhang
2026-09-21 19:00 ` Marco Giunta
2026-09-22 11:08 ` Huang Wei
2026-09-22 12:18 ` Rong Zhang
2026-09-22 15:52 ` Mark Pearson
2026-09-22 15:58 ` Rong Zhang
2026-09-22 16:42 ` Rong Zhang
2026-09-22 17:32 ` Mark Pearson
2026-09-22 18:47 ` Rong Zhang
2026-09-23 11:17 ` Marco Giunta
2026-09-23 12:39 ` Rong Zhang
2026-09-23 13:11 ` Marco Giunta
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=20260920064218.619667-1-huangwei@kylinos.cn \
--to=huangwei@kylinos.cn \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marco_giunta@outlook.it \
--cc=platform-driver-x86@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®