From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Toshi Kani <toshi.kani@hp.com>
Cc: linux-acpi@vger.kernel.org, lenb@kernel.org,
linux-kernel@vger.kernel.org, bhelgaas@google.com,
isimatu.yasuaki@jp.fujitsu.com, liuj97@gmail.com
Subject: Re: [PATCH v3 1/4] ACPI: Support system notify handler via .sys_notify
Date: Wed, 28 Nov 2012 22:09:54 +0100 [thread overview]
Message-ID: <5550104.xSe1fX9Ich@vostro.rjw.lan> (raw)
In-Reply-To: <1354134699.26955.290.camel@misato.fc.hp.com>
On Wednesday, November 28, 2012 01:31:39 PM Toshi Kani wrote:
> On Wed, 2012-11-28 at 19:28 +0100, Rafael J. Wysocki wrote:
> > On Wednesday, November 28, 2012 09:54:43 AM Toshi Kani wrote:
> > > > > > > > By using acpi_install_notify_handler(), each driver needs to walk
> > > > > > > > through the entire ACPI namespace to find its associated ACPI devices
> > > > > > > > and call it to register one by one. I think this is more work for
> > > > > > > > non-ACPI drivers than defining acpi_driver.
> > > > > > >
> > > > > > > I'm not really sure what you mean. The drivers in question already know
> > > > > > > what the relevant ACPI device nodes are (because they need them anyway
> > > > > > > for other purposes), so they don't need to look for them specifically and
> > > > > > > acpi_install_notify_handler() doesn't do any namespace walking. So what
> > > > > > > you said above simply doesn't make sense from this viewpoint.
> > > > > >
> > > > > > Yes, if drivers already know the relevant ACPI devices, then walking the
> > > > > > ACPI namespace is not necessary. I was referring the case like
> > > > > > processor_driver.c, acpi_memhotplug.c, and container.c in my statement.
> > > > >
> > > > > BTW, when an ACPI device is marked as non-present, which is the case
> > > > > before hot-add, we do not create an acpi_device object and therefore do
> > > > > not bind it with a driver. This is why these drivers walk the ACPI
> > > > > namespace and install their notify handlers regardless of device status.
> > > >
> > > > So maybe we should create struct acpi_device objects in that case too?
> > >
> > > I think it has some challenge as well. We bind an ACPI driver with
> > > device_register(), which calls device_add()-> kobject_add(). So, all
> > > non-present ACPI device objects will show up in sysfs, unless we can
> > > change the core. This will change user interface. There can be quite
> > > many non-present devices in ACPI namespace depending on FW
> > > implementation.
> >
> > If additional devices appear in sysfs, that's not a problem. If there
> > were fewer of them, that would be a real one. :-)
>
> I see. I guess this means that once we expose all non-present devices
> in sysfs, we cannot go back to the current way. So, we need to be very
> careful. Anyway, this model requires separate handling for static ACPI
> [1] and dynamic ACPI [2], which may make the state model complicated.
>
> 1. Static ACPI - No creation / deletion of acpi_device at hot-plug.
> 2. Dynamic ACPI - Create acpi_device at hot-add, delete at hot-remove.
Sure. The complication here is that we'll need to handle the removal of
a bunch of struct acpi_device objects when a whole table goes away.
However, first, we don't seem to handle table unloading now. At least
acpi_unload_parent_table() is not called from anywhere as far as I can
say. Second, we'll need to handle the removal of struct acpi_device objects
_anyway_ on table unload, this way or another.
> [1] ACPI namespace is static and contains the maximum possible config.
> [2] ACPI namespace is dynamic. SSDT is loaded at hot-add, and unloaded
> at hot-remove.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2012-11-28 21:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-08 20:23 [PATCH v3 0/4] ACPI: Refactor system notify handling Toshi Kani
2012-11-08 20:23 ` [PATCH v3 1/4] ACPI: Support system notify handler via .sys_notify Toshi Kani
2012-11-24 22:01 ` Rafael J. Wysocki
2012-11-24 22:07 ` Rafael J. Wysocki
2012-11-26 19:25 ` Toshi Kani
2012-11-24 22:37 ` Rafael J. Wysocki
2012-11-26 19:06 ` Toshi Kani
2012-11-26 20:44 ` Rafael J. Wysocki
2012-11-26 21:09 ` Toshi Kani
2012-11-26 21:24 ` Toshi Kani
2012-11-27 23:59 ` Rafael J. Wysocki
2012-11-28 16:54 ` Toshi Kani
2012-11-28 18:28 ` Rafael J. Wysocki
2012-11-28 20:31 ` Toshi Kani
2012-11-28 21:09 ` Rafael J. Wysocki [this message]
2012-11-28 21:23 ` Toshi Kani
2012-11-28 21:55 ` Rafael J. Wysocki
2012-11-28 22:33 ` Toshi Kani
2012-11-28 22:49 ` Rafael J. Wysocki
2012-11-28 22:48 ` Toshi Kani
2012-11-27 23:57 ` Rafael J. Wysocki
2012-11-26 23:17 ` Rafael J. Wysocki
2012-11-26 17:44 ` Toshi Kani
2012-11-28 0:29 ` Rafael J. Wysocki
2012-11-28 16:33 ` Toshi Kani
2012-11-08 20:23 ` [PATCH v3 2/4] ACPI: Update processor_driver to use .sys_notify Toshi Kani
2012-11-08 20:23 ` [PATCH v3 3/4] ACPI: Update acpi_memhotplug " Toshi Kani
2012-11-08 20:23 ` [PATCH v3 4/4] ACPI: Update container " Toshi Kani
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=5550104.xSe1fX9Ich@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=bhelgaas@google.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuj97@gmail.com \
--cc=toshi.kani@hp.com \
/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