From: Keshavamurthy Anil S <anil.s.keshavamurthy-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Bjorn Helgaas <bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
Cc: Keshavamurthy Anil S
<anil.s.keshavamurthy-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
naveen.b.s-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: ACPI hot-plug notification help needed
Date: Wed, 3 Aug 2005 12:36:27 -0700 [thread overview]
Message-ID: <20050803123627.A4443@unix-os.sc.intel.com> (raw)
In-Reply-To: <200508021641.26007.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>; from bjorn.helgaas-VXdhtT5mjnY@public.gmane.org on Tue, Aug 02, 2005 at 04:41:25PM -0600
On Tue, Aug 02, 2005 at 04:41:25PM -0600, Bjorn Helgaas wrote:
> Here's a patch (not ready for merging) that makes
> acpi_bus_notify() pass the handle, rather than the device,
> down to acpi_bus_check_device(), which then adds the device
> if it didn't previously exist.
>
> Is this heading down the right track?
Let me restate the goal of this patch here to make sure
we are know what we are doing.
We are trying to get away with all drivers having to explicitly
install a hotplug notify handler for all of their devices described
in the namespace. With this changes, the ACPI core would then
be responsible for handling this hotplug event, responsible for
creating acpi_device's and calling respective drivers add() method.
Yes, your patch is certainly on the right track but need lot
more carefull though and desing so as not to break existing
features and functionality.
See more comments below.
>
> +static int
> acpi_bus_check_device (
> - struct acpi_device *device,
> + acpi_handle handle,
> int *status_changed)
> {
> acpi_status status = 0;
> + struct acpi_device *device = NULL;
> struct acpi_device_status old_status;
> + int result;
>
> ACPI_FUNCTION_TRACE("acpi_bus_check_device");
>
> + /*
> + * If no device exists for this namespace node, a DEVICE_CHECK
> + * notification means the device has appeared.
> + */
> + if (acpi_bus_get_device(handle, &device)) {
As Kenji stated in a separate e-mail, you need to check _STA
before calling acpi_bus_add_device().
> + result = acpi_bus_add_device(handle);
> + if (status_changed && result == 0)
> + *status_changed = 1;
> + return_VALUE(result);
> + }
> +
Once the devices are added by calling acpi_bus_add_device(),
I think you also need to call acpi_bus_start() to actuall start
the devices.
In case of a root bridge hotplug, after the root bridge
has been successfully added by calling acpi_bus_add_device(),
the root bridge driver (acpiphp.ko see acpiphp_glue.c) needs
to configure the bridge before we call acpi_bus_start(), so
need some intraction with the ACPI core and the drivers
between acpi_bus_add() and acpi_bus_start() calls.
Cheers,
Anil
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
next prev parent reply other threads:[~2005-08-03 19:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-25 23:35 ACPI hot-plug notification help needed Bjorn Helgaas
[not found] ` <200507251735.23394.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2005-07-26 0:39 ` Keshavamurthy Anil S
[not found] ` <20050725173911.A24040-39QZ/XbsZ5/mO6KZMuUCQVaTQe2KTcn/@public.gmane.org>
2005-07-26 19:56 ` Bjorn Helgaas
[not found] ` <200507261356.08152.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2005-07-27 0:05 ` Keshavamurthy Anil S
[not found] ` <20050726170459.A5591-39QZ/XbsZ5/mO6KZMuUCQVaTQe2KTcn/@public.gmane.org>
2005-07-27 23:06 ` Bjorn Helgaas
[not found] ` <200508011620.02609.bjorn.helgaas@hp.com>
[not found] ` <20050801170345.A16268@unix-os.sc.intel.com>
[not found] ` <20050801170345.A16268-39QZ/XbsZ5/mO6KZMuUCQVaTQe2KTcn/@public.gmane.org>
2005-08-02 22:41 ` Bjorn Helgaas
[not found] ` <200508021641.26007.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2005-08-03 4:37 ` Kenji Kaneshige
2005-08-03 19:36 ` Keshavamurthy Anil S [this message]
[not found] ` <20050803123627.A4443-39QZ/XbsZ5/mO6KZMuUCQVaTQe2KTcn/@public.gmane.org>
2005-08-03 20:27 ` Bjorn Helgaas
[not found] ` <200508031427.11057.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2005-08-03 20:55 ` Keshavamurthy Anil S
[not found] ` <20050803135511.B5010-39QZ/XbsZ5/mO6KZMuUCQVaTQe2KTcn/@public.gmane.org>
2005-08-03 21:13 ` Bjorn Helgaas
[not found] ` <200508031513.30570.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2005-08-03 21:41 ` Keshavamurthy Anil S
-- strict thread matches above, loose matches on Subject: below --
2005-07-26 4:28 S, Naveen B
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=20050803123627.A4443@unix-os.sc.intel.com \
--to=anil.s.keshavamurthy-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=bjorn.helgaas-VXdhtT5mjnY@public.gmane.org \
--cc=naveen.b.s-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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