From: Toshi Kani <toshi.kani@hp.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
lenb@kernel.org, liuj97@gmail.com,
isimatu.yasuaki@jp.fujitsu.com
Subject: Re: [RFC PATCH 1/5] ACPI: Add acpi_lookup_driver() function
Date: Thu, 06 Sep 2012 17:52:42 -0600 [thread overview]
Message-ID: <1346975562.4732.256.camel@misato.fc.hp.com> (raw)
In-Reply-To: <1346430252.4732.163.camel@misato.fc.hp.com>
(snip)
:
> > > +
> > > + /* set HID to this device object */
> > > + acpi_device_set_id(device);
> > > +
> > > + /* lookup a matching driver */
> > > + (void) bus_for_each_drv(device->dev.bus, NULL,
> > > + device, acpi_match_driver);
> > > + driver = device->driver;
> >
> > This path is used when we receive a Notify to a device and a matching
> > driver has been registered, but the driver is not bound to the device.
> > For example, it may be a newly-added device where we haven't bound a
> > driver to it yet.
> >
> > Is there anything that prevents us from unloading the driver between
> > here (the point where we capture the "struct acpi_driver *") and the
> > point where we call "driver->ops.sys_notify"?
>
> Hi Bjorn,
>
> That's a very good question. I will look into how we protect a driver
> from unloading when we try to attach & probe a driver in the
> acpi_add_single_object() path, and see if we can use a similar way to
> protect it here as well.
I have protected this path in version 2, which I just sent out. It
calls .sys_notify() directly from bus_for_each_drv(), which protects the
driver entry by increasing its reference count while the callback
function is being called.
Thanks,
-Toshi
next prev parent reply other threads:[~2012-09-06 23:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 20:16 [RFC PATCH 0/5] ACPI: Refactor system notify handling Toshi Kani
2012-08-30 20:16 ` [RFC PATCH 1/5] ACPI: Add acpi_lookup_driver() function Toshi Kani
2012-08-31 5:42 ` Bjorn Helgaas
2012-08-31 16:24 ` Toshi Kani
2012-09-06 23:52 ` Toshi Kani [this message]
2012-08-30 20:16 ` [RFC PATCH 2/5] ACPI: Support system notify handler via .sys_notify Toshi Kani
2012-08-30 20:16 ` [RFC PATCH 3/5] ACPI: Update processor_driver to use .sys_notify Toshi Kani
2012-08-30 20:16 ` [RFC PATCH 4/5] ACPI: Update acpi_memhotplug " Toshi Kani
2012-08-30 20:16 ` [RFC PATCH 5/5] 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=1346975562.4732.256.camel@misato.fc.hp.com \
--to=toshi.kani@hp.com \
--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 \
/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