Skip to contentSkip to conversation

acpi,memory-hotplug : remove memory device by acpi_bus_remove()

PATCH In review Yasuaki Ishimatsu 3 participants 5 messages Oct 4, 2012 – Oct 19, 2012

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 acpi,memory-hotplug : export the function acpi_bus_remove()

From: Wen Congyang <[email protected]>

The function acpi_bus_remove() can remove a acpi device from acpi bus. When a acpi device is removed, we need to call this function to remove the acpi device from acpi bus. So export this function.

---
 drivers/acpi/scan.c     |    3 ++-
 include/acpi/acpi_bus.h |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/acpi/scan.c +2 -1
Index: linux-3.6/drivers/acpi/scan.c
===================================================================
@@ -1224,7 +1224,7 @@ static int acpi_device_set_context(struc
 	return -ENODEV;
 }
 
-static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
+int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
 {
 	if (!dev)
 		return -EINVAL;
@@ -1246,6 +1246,7 @@ static int acpi_bus_remove(struct acpi_d
 
 	return 0;
 }
+EXPORT_SYMBOL(acpi_bus_remove);
 
 static int acpi_add_single_object(struct acpi_device **child,
 				  acpi_handle handle, int type,
include/acpi/acpi_bus.h +1 -0
Index: linux-3.6/include/acpi/acpi_bus.h
===================================================================
@@ -360,6 +360,7 @@ bool acpi_bus_power_manageable(acpi_hand
 bool acpi_bus_can_wakeup(acpi_handle handle);
 int acpi_power_resource_register_device(struct device *dev, acpi_handle handle);
 void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle);
+int acpi_bus_remove(struct acpi_device *dev, int rmdevice);
 #ifdef CONFIG_ACPI_PROC_EVENT
 int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
 int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
#2 lore raw

PATCH 2/2 acpi,memory-hotplug : call acpi_bus_remo() to remove memory device

In reply to Yasuaki Ishimatsu

From: Wen Congyang <[email protected]>

The memory device has been ejected and powoffed, so we can call acpi_bus_remove() to remove the memory device from acpi bus.

---
 drivers/acpi/acpi_memhotplug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpi_memhotplug.c +2 -1
Index: linux-3.6/drivers/acpi/acpi_memhotplug.c
===================================================================
@@ -424,8 +424,9 @@ static void acpi_memory_device_notify(ac
 		}
 
 		/*
-		 * TBD: Invoke acpi_bus_remove to cleanup data structures
+		 * Invoke acpi_bus_remove() to remove memory device
 		 */
+		acpi_bus_remove(device, 1);
 
 		/* _EJ0 succeeded; _OST is not necessary */
 		return;
#3 lore raw

Re: [PATCH 2/2] acpi,memory-hotplug : call acpi_bus_remo() to remove memory device

Quoted 17 lines · Yasuaki Ishimatsu

From: Wen Congyang <[email protected]>

The memory device has been ejected and powoffed, so we can call acpi_bus_remove() to remove the memory device from acpi bus.

---
 drivers/acpi/acpi_memhotplug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-3.6/drivers/acpi/acpi_memhotplug.c
===================================================================

drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:52.471250299 +0900 static void acpi_memory_device_notify(ac · line 429

Quoted 7 lines
drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:52.471250299 +0900 renamed from drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:47.802249170 +0900 +2 -1
@@ -424,8 +424,9 @@ static void acpi_memory_device_notify(ac
                }
 
                /*
-                * TBD: Invoke acpi_bus_remove to cleanup data structures
+                * Invoke acpi_bus_remove() to remove memory device
                 */
+               acpi_bus_remove(device, 1);

why not using acpi_bus_trim instead?

Yinghai

#4 lore raw

Re: [PATCH 2/2] acpi,memory-hotplug : call acpi_bus_remo() to remove memory device

At 10/04/2012 10:41 AM, Yinghai Lu Wrote:

Quoted 21 lines
Quoted 19 lines · Yasuaki Ishimatsu

From: Wen Congyang <[email protected]>

The memory device has been ejected and powoffed, so we can call acpi_bus_remove() to remove the memory device from acpi bus.

---
 drivers/acpi/acpi_memhotplug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-3.6/drivers/acpi/acpi_memhotplug.c
===================================================================

drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:52.471250299 +0900 renamed from drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:47.802249170 +0900 +0 -0
@@ -424,8 +424,9 @@ static void acpi_memory_device_notify(ac
                }
 
Quoted 7 lines

drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:52.471250299 +0900 static void acpi_memory_device_notify(ac · line 429

Quoted 5 lines
drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:52.471250299 +0900 renamed from drivers/acpi/acpi_memhotplug.c 2012-10-03 18:17:47.802249170 +0900 +2 -1
                /*
-                * TBD: Invoke acpi_bus_remove to cleanup data structures
+                * Invoke acpi_bus_remove() to remove memory device
                 */
+               acpi_bus_remove(device, 1);

why not using acpi_bus_trim instead?

Sorry for late reply. It's OK to use acpi_bus_trim(), and I will update this patch soon.

Thanks
Wen Congyang

Quoted 3 lines

Yinghai

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>