public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ACPI: CPU hot-remove support
@ 2012-11-01 14:42 Toshi Kani
  2012-11-01 14:42 ` [PATCH v3 1/2] ACPI: Export functions for hot-remove Toshi Kani
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Toshi Kani @ 2012-11-01 14:42 UTC (permalink / raw)
  To: linux-acpi, lenb, rjw
  Cc: linux-kernel, isimatu.yasuaki, imammedo, vijaymohan.pandarathil,
	prarit, bhelgaas, Toshi Kani

This patchset adds support of CPU hot-remove via an ACPI eject
notification to the ACPI processor driver.  The CPU hot-remove
operation shares the same code path with the sysfs eject operation.

The patchset also exports two functions necessary to initiate
hot-remove operations from modules, such as the processor driver.

The patchset is based on the current Linus's tree.

v3:
- Added patch 1/2 to export functions for hot-remove

v2:
- Rebased to the latest baseline

---
Toshi Kani (2):
 ACPI: Export functions for hot-remove
 ACPI: Add ACPI CPU hot-remove support

---
 drivers/acpi/osl.c              |  1 +
 drivers/acpi/processor_driver.c | 27 +++++++++++++++++----------
 drivers/acpi/scan.c             |  1 +
 3 files changed, 19 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] ACPI: Export functions for hot-remove
  2012-11-01 14:42 [PATCH v3 0/2] ACPI: CPU hot-remove support Toshi Kani
@ 2012-11-01 14:42 ` Toshi Kani
  2012-11-01 14:42 ` [PATCH v3 2/2] ACPI: Add ACPI CPU hot-remove support Toshi Kani
  2012-11-02 12:46 ` [PATCH v3 0/2] ACPI: " Rafael J. Wysocki
  2 siblings, 0 replies; 5+ messages in thread
From: Toshi Kani @ 2012-11-01 14:42 UTC (permalink / raw)
  To: linux-acpi, lenb, rjw
  Cc: linux-kernel, isimatu.yasuaki, imammedo, vijaymohan.pandarathil,
	prarit, bhelgaas, Toshi Kani

Exported acpi_os_hotplug_execute() and acpi_bus_hot_remove_device()
so that they can be called from modules for hot-remove operations.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
 drivers/acpi/osl.c  | 1 +
 drivers/acpi/scan.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 9eaf708..7dfe91d 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -986,6 +986,7 @@ acpi_status acpi_os_hotplug_execute(acpi_osd_exec_callback function,
 {
 	return __acpi_os_execute(0, function, context, 1);
 }
+EXPORT_SYMBOL(acpi_os_hotplug_execute);
 
 void acpi_os_wait_events_complete(void)
 {
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 1fcb867..a81845e 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -157,6 +157,7 @@ err_out:
 	kfree(context);
 	return;
 }
+EXPORT_SYMBOL(acpi_bus_hot_remove_device);
 
 static ssize_t
 acpi_eject_store(struct device *d, struct device_attribute *attr,
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] ACPI: Add ACPI CPU hot-remove support
  2012-11-01 14:42 [PATCH v3 0/2] ACPI: CPU hot-remove support Toshi Kani
  2012-11-01 14:42 ` [PATCH v3 1/2] ACPI: Export functions for hot-remove Toshi Kani
@ 2012-11-01 14:42 ` Toshi Kani
  2012-11-02 12:46 ` [PATCH v3 0/2] ACPI: " Rafael J. Wysocki
  2 siblings, 0 replies; 5+ messages in thread
From: Toshi Kani @ 2012-11-01 14:42 UTC (permalink / raw)
  To: linux-acpi, lenb, rjw
  Cc: linux-kernel, isimatu.yasuaki, imammedo, vijaymohan.pandarathil,
	prarit, bhelgaas, Toshi Kani

Added support of CPU hot-remove via an ACPI eject notification.
It calls acpi_bus_hot_remove_device(), which shares the same code
path with the sysfs eject operation.  acpi_os_hotplug_execute()
runs the hot-remove operation in kacpi_hotplug_wq and serializes
it between ACPI hot-remove and sysfs eject requests.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Tested-by: IgorMammedov <imammedo@redhat.com>
Tested-by: Vijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
Tested-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/acpi/processor_driver.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index bd4e5dc..ac63b6f 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -695,8 +695,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
 static void acpi_processor_hotplug_notify(acpi_handle handle,
 					  u32 event, void *data)
 {
-	struct acpi_processor *pr;
 	struct acpi_device *device = NULL;
+	struct acpi_eject_event *ej_event = NULL;
 	u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
 	int result;
 
@@ -728,20 +728,27 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
 				  "received ACPI_NOTIFY_EJECT_REQUEST\n"));
 
 		if (acpi_bus_get_device(handle, &device)) {
-			printk(KERN_ERR PREFIX
-				    "Device don't exist, dropping EJECT\n");
+			pr_err(PREFIX "Device don't exist, dropping EJECT\n");
 			break;
 		}
-		pr = acpi_driver_data(device);
-		if (!pr) {
-			printk(KERN_ERR PREFIX
-				    "Driver data is NULL, dropping EJECT\n");
+		if (!acpi_driver_data(device)) {
+			pr_err(PREFIX "Driver data is NULL, dropping EJECT\n");
 			break;
 		}
 
-		/* REVISIT: update when eject is supported */
-		ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED;
-		break;
+		ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
+		if (!ej_event) {
+			pr_err(PREFIX "No memory, dropping EJECT\n");
+			break;
+		}
+
+		ej_event->handle = handle;
+		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
+		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
+					(void *)ej_event);
+
+		/* eject is performed asynchronously */
+		return;
 
 	default:
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/2] ACPI: CPU hot-remove support
  2012-11-01 14:42 [PATCH v3 0/2] ACPI: CPU hot-remove support Toshi Kani
  2012-11-01 14:42 ` [PATCH v3 1/2] ACPI: Export functions for hot-remove Toshi Kani
  2012-11-01 14:42 ` [PATCH v3 2/2] ACPI: Add ACPI CPU hot-remove support Toshi Kani
@ 2012-11-02 12:46 ` Rafael J. Wysocki
  2012-11-02 14:07   ` Toshi Kani
  2 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-11-02 12:46 UTC (permalink / raw)
  To: Toshi Kani
  Cc: linux-acpi, lenb, linux-kernel, isimatu.yasuaki, imammedo,
	vijaymohan.pandarathil, prarit, bhelgaas

On Thursday, November 01, 2012 08:42:11 AM Toshi Kani wrote:
> This patchset adds support of CPU hot-remove via an ACPI eject
> notification to the ACPI processor driver.  The CPU hot-remove
> operation shares the same code path with the sysfs eject operation.
> 
> The patchset also exports two functions necessary to initiate
> hot-remove operations from modules, such as the processor driver.
> 
> The patchset is based on the current Linus's tree.
> 
> v3:
> - Added patch 1/2 to export functions for hot-remove
> 
> v2:
> - Rebased to the latest baseline
> 
> ---
> Toshi Kani (2):
>  ACPI: Export functions for hot-remove
>  ACPI: Add ACPI CPU hot-remove support

Both patches applied to the linux-next branch of the linux-pm.git
tree as v3.8 material.

Thanks,
Rafael


> ---
>  drivers/acpi/osl.c              |  1 +
>  drivers/acpi/processor_driver.c | 27 +++++++++++++++++----------
>  drivers/acpi/scan.c             |  1 +
>  3 files changed, 19 insertions(+), 10 deletions(-)
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/2] ACPI: CPU hot-remove support
  2012-11-02 12:46 ` [PATCH v3 0/2] ACPI: " Rafael J. Wysocki
@ 2012-11-02 14:07   ` Toshi Kani
  0 siblings, 0 replies; 5+ messages in thread
From: Toshi Kani @ 2012-11-02 14:07 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-acpi, lenb, linux-kernel, isimatu.yasuaki, imammedo,
	vijaymohan.pandarathil, prarit, bhelgaas

On Fri, 2012-11-02 at 13:46 +0100, Rafael J. Wysocki wrote:
> On Thursday, November 01, 2012 08:42:11 AM Toshi Kani wrote:
> > This patchset adds support of CPU hot-remove via an ACPI eject
> > notification to the ACPI processor driver.  The CPU hot-remove
> > operation shares the same code path with the sysfs eject operation.
> > 
> > The patchset also exports two functions necessary to initiate
> > hot-remove operations from modules, such as the processor driver.
> > 
> > The patchset is based on the current Linus's tree.
> > 
> > v3:
> > - Added patch 1/2 to export functions for hot-remove
> > 
> > v2:
> > - Rebased to the latest baseline
> > 
> > ---
> > Toshi Kani (2):
> >  ACPI: Export functions for hot-remove
> >  ACPI: Add ACPI CPU hot-remove support
> 
> Both patches applied to the linux-next branch of the linux-pm.git
> tree as v3.8 material.

Great!!  Thanks Rafael!
-Toshi


> 
> Thanks,
> Rafael
> 
> 
> > ---
> >  drivers/acpi/osl.c              |  1 +
> >  drivers/acpi/processor_driver.c | 27 +++++++++++++++++----------
> >  drivers/acpi/scan.c             |  1 +
> >  3 files changed, 19 insertions(+), 10 deletions(-)
> > 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-02 14:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 14:42 [PATCH v3 0/2] ACPI: CPU hot-remove support Toshi Kani
2012-11-01 14:42 ` [PATCH v3 1/2] ACPI: Export functions for hot-remove Toshi Kani
2012-11-01 14:42 ` [PATCH v3 2/2] ACPI: Add ACPI CPU hot-remove support Toshi Kani
2012-11-02 12:46 ` [PATCH v3 0/2] ACPI: " Rafael J. Wysocki
2012-11-02 14:07   ` Toshi Kani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox