[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YmUNnq5tH8mykNOF@kroah.com>
Date: Sun, 24 Apr 2022 10:43:10 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Muhammad Usama Anjum <usama.anjum@...labora.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>,
Collabora Kernel ML <kernel@...labora.com>,
groeck@...omium.org, bleung@...omium.org, dtor@...omium.org,
gwendal@...omium.org, vbendeb@...omium.org, andy@...radead.org,
Ayman Bagabas <ayman.bagabas@...il.com>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Blaž Hrastnik <blaz@...n.io>,
Darren Hart <dvhart@...radead.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Jeremy Soller <jeremy@...tem76.com>,
Mattias Jacobsson <2pi@....nu>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Rajat Jain <rajatja@...gle.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Enric Balletbo i Serra <eballetbo@...il.com>
Subject: Re: [PATCH v8] platform: x86: Add ChromeOS ACPI device driver
On Fri, Apr 15, 2022 at 10:08:15PM +0500, Muhammad Usama Anjum wrote:
> + i = 0;
> + list_for_each_entry(aag, &chromeos_acpi.groups, list) {
> + chromeos_acpi.dev_groups[i] = &aag->group;
> + i++;
> + }
> +
> + ret = sysfs_create_groups(&dev->kobj, chromeos_acpi.dev_groups);
You have raced with userspace and lost here :(
Use the default groups pointer in the platform driver for this, and use
the is_visible() callback to know to show, or not show, the attribute
instead of building up dynamic lists of attributes at runtime. That
will save you lots of crazy logic and housekeeping _AND_ userspace tools
will work properly as well.
thanks,
greg k-h
Powered by blists - more mailing lists