Skip to contentSkip to conversation

ACPI: Call ACPI remove handler when handling ACPI eject

PATCH In review [email protected] 4 participants 5 messages Oct 19, 2011 – Oct 21, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ACPI: Call ACPI remove handler when handling ACPI eject

From: Liu Ping Fan <[email protected]>

When I tried to enable cpu hotplug feature for qemu-kvm, I found that the ACPI device eject event just skipped by kernel.

static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) {
case ACPI_NOTIFY_EJECT_REQUEST:

		/* TBD */---> skipped from here
}

But I notice, in drivers/acpi/dock.c, dock_notify()->handle_eject_request() will handle such event for ACPI _dock device. So what we shall do, changing Qemu's SeaBIOS or changing the kernel? If changing SeaBIOS, will it affect guest MS-Window?

Thanks,
ping fan

#1 lore raw

PATCH 1/1 ACPI: Call ACPI remove handler when handling ACPI eject event

From: Liu Ping Fan <[email protected]>

Call the remove handler for ACPI_NOTIFY_EJECT_REQUEST

---
 drivers/acpi/bus.c      |    2 +-
 drivers/acpi/scan.c     |    2 +-
 include/acpi/acpi_bus.h |    2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/acpi/bus.c +1 -1
index 437ddbf..d06ec6d 100644
@@ -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:
drivers/acpi/scan.c +1 -1
index 449c556..3b97b61 100644
@@ -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;
include/acpi/acpi_bus.h +2 -0
index 6cd5b64..b19c09d 100644
@@ -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
  */
Signature · 1 line
1.7.4.4
#2 lore raw

Re: [PATCH 1/1] ACPI: Call ACPI remove handler when handling ACPI eject event

Quoted 51 lines · On Wed, Oct 19, 2011 at 10:47 AM, <[email protected]> wrote:

From: Liu Ping Fan <[email protected]>

Call the remove handler for ACPI_NOTIFY_EJECT_REQUEST

---
 drivers/acpi/bus.c      |    2 +-
 drivers/acpi/scan.c     |    2 +-
 include/acpi/acpi_bus.h |    2 ++

 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/acpi/bus.c +0 -0
index 437ddbf..d06ec6d 100644
@@ -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:

drivers/acpi/scan.c +1 -1
index 449c556..3b97b61 100644
@@ -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;
include/acpi/acpi_bus.h +2 -1
index 6cd5b64..b19c09d 100644
@@ -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
  */
--
Quoted 2 lines

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. --
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

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

Quoted 44 lines · Gong Chen
Quoted 43 lines · On Wed, Oct 19, 2011 at 10:47 AM, <[email protected]> wrote:

From: Liu Ping Fan <[email protected]>

Call the remove handler for ACPI_NOTIFY_EJECT_REQUEST

---
 drivers/acpi/bus.c      |    2 +-
 drivers/acpi/scan.c     |    2 +-
 include/acpi/acpi_bus.h |    2 ++

 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/acpi/bus.c +0 -0
index 437ddbf..d06ec6d 100644
@@ -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:

drivers/acpi/scan.c +1 -1
index 449c556..3b97b61 100644
@@ -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;
include/acpi/acpi_bus.h +0 -0
index 6cd5b64..b19c09d 100644
@@ -310,6 +310,8 @@ extern int unregister_acpi_notifier(struct notifier_block *);
 
Quoted 15 lines
Quoted 10 lines
include/acpi/acpi_bus.h +2 -1
  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-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

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

Quoted 62 lines · 于 2011/10/20 17:37, [email protected] 写道:
Quoted 44 lines · Gong Chen
Quoted 43 lines · On Wed, Oct 19, 2011 at 10:47 AM,<[email protected]> wrote:

From: Liu Ping Fan<[email protected]>

Call the remove handler for ACPI_NOTIFY_EJECT_REQUEST

---
  drivers/acpi/bus.c      |    2 +-
  drivers/acpi/scan.c     |    2 +-
  include/acpi/acpi_bus.h |    2 ++
  3 files changed, 4 insertions(+), 2 deletions(-)
drivers/acpi/bus.c +1 -1
index 437ddbf..d06ec6d 100644
@@ -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:
drivers/acpi/scan.c +1 -1
index 449c556..3b97b61 100644
@@ -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;
include/acpi/acpi_bus.h +0 -0
index 6cd5b64..b19c09d 100644
@@ -310,6 +310,8 @@ extern int unregister_acpi_notifier(struct notifier_block *);
 
Quoted 15 lines
Quoted 10 lines
include/acpi/acpi_bus.h +2 -1
  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?

Quoted 8 lines

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

It's up to the maintainer, should be Len Brown :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html