Re: [Qemu-devel] [PATCH 1/1] ACPI: Call ACPI remove handler whenhandling ACPI eject event

From: qemulist
Date: Thu Oct 20 2011 - 05:38:10 EST


On Wed, Oct 19, 2011 at 09:35:46PM +0800, Gong Chen wrote:
> On Wed, Oct 19, 2011 at 10:47 AM, <pingfank@xxxxxxxxxxxxxxxxxx> wrote:
> > From: Liu Ping Fan <pingfank@xxxxxxxxxxxxxxxxxx>
> >
> > Call the remove handler for ACPI_NOTIFY_EJECT_REQUEST
> >
> > Signed-off-by: Liu Ping Fan <pingfank@xxxxxxxxxxxxxxxxxx>
> > ---
> > Âdrivers/acpi/bus.c   Â|  Â2 +-
> > Âdrivers/acpi/scan.c   |  Â2 +-
> > Âinclude/acpi/acpi_bus.h | Â Â2 ++
> > Â3 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> > index 437ddbf..d06ec6d 100644
> > --- a/drivers/acpi/bus.c
> > +++ b/drivers/acpi/bus.c
> > @@ -764,7 +764,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
> > Â Â Â Â Â Â Â Âbreak;
> >
> > Â Â Â Âcase ACPI_NOTIFY_EJECT_REQUEST:
> > - Â Â Â Â Â Â Â /* TBD */
> > + Â Â Â Â Â Â Â acpi_os_hotplug_execute(acpi_bus_hot_remove_device, handle);
> > Â Â Â Â Â Â Â Âbreak;
> >
> > Â Â Â Âcase ACPI_NOTIFY_DEVICE_CHECK_LIGHT:
> > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> > index 449c556..3b97b61 100644
> > --- a/drivers/acpi/scan.c
> > +++ b/drivers/acpi/scan.c
> > @@ -83,7 +83,7 @@ acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, cha
> > Â}
> > Âstatic DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
> >
> > -static void acpi_bus_hot_remove_device(void *context)
> > +void acpi_bus_hot_remove_device(void *context)
> > Â{
> > Â Â Â Âstruct acpi_device *device;
> > Â Â Â Âacpi_handle handle = context;
> > diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> > index 6cd5b64..b19c09d 100644
> > --- a/include/acpi/acpi_bus.h
> > +++ b/include/acpi/acpi_bus.h
> > @@ -310,6 +310,8 @@ extern int unregister_acpi_notifier(struct notifier_block *);
> >
> > Âextern int register_acpi_bus_notifier(struct notifier_block *nb);
> > Âextern void unregister_acpi_bus_notifier(struct notifier_block *nb);
> > +extern void acpi_bus_hot_remove_device(void *context);
> > +
> > Â/*
> > Â* External Functions
> > Â*/
> > --
> > 1.7.4.4
> >
>
> I preferred the patch from Shen before. Here is the link:
> https://lkml.org/lkml/2011/9/24/15
> As Bjorn said, "long-term goal to move the hotplug flow out of drivers and into
> the ACPI core". An arbitrary change in the global level just mess up the codes.
Got it, thanks. And so will this feature emerge in upstream soon?

Thanks and regards,
pingfan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/