From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux PCI <linux-pci@vger.kernel.org>,
"Moore, Robert" <robert.moore@intel.com>,
Toshi Kani <toshi.kani@hp.com>, Yinghai Lu <yinghai@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Aaron Lu <aaron.lu@intel.com>, Lv Zheng <lv.zheng@intel.com>
Subject: Re: [PATCH 7/10] ACPI / hotplug: Move container-specific code out of the core
Date: Fri, 29 Nov 2013 11:36:55 +0900 [thread overview]
Message-ID: <5297FDC7.6000007@jp.fujitsu.com> (raw)
In-Reply-To: <2547688.l8Q1XKb3Ol@vostro.rjw.lan>
Hi Rafael,
Replying to this mail may be wrong.
Do you remember following your patch?
http://lkml.org/lkml/2013/2/23/97
I want to add autoeject variable in acpi_hotplug_profile structure and
set autoecjet of container device "false".
Currently, I have a problem on ejecting container device. Since linux-3.12,
container device is removed by acpi_scan_hot_remove.
I think this has two problems.
1. easily fail
My container device has CPU device and Memory device, and maximum size of
memory is 3Tbyte. In my environment, hot removing container device fails
on offlining memory if memory is used by application.
I think if offlininig memory, we must retly to offline memory several
times.
2. cannot work with userland's application
Hot removing CPU and memory on container device, we need take care of
userland application. Before linux-3.12, container device just notifies
KOBJ_OFFLINE to udev. So by using udev, if application binds to removed
CPU or node, applications can change them before hot removing container
device.
Currently, KOBJ_OFFLINE is notified to udev. But acpi_scan_hot_remove
also runs simultaneously for hot removing container device. So when
applications runs for corresponding to the deletion of the devices,
the devices may have been deleted.
I don't know what devices are on hotpluggable conatainer device of other
vendors. At least, my container device cannot be hot removed correctly.
Then I want to add autoeject variable in acpi_hotplug_profile so that user
can change the parameter to "true" or "false".
Thanks,
Yasuaki Ishimatsu
(2013/11/18 1:36), Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Move container-specific uevents from the core hotplug code to the
> container scan handler's .attach() and .detach() callbacks.
>
> This way the core will not have to special-case containers and
> the uevents will be guaranteed to happen every time a container
> is either scanned or trimmed as appropriate.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/acpi/container.c | 11 ++++++++---
> drivers/acpi/scan.c | 8 +-------
> include/acpi/acpi_bus.h | 7 -------
> 3 files changed, 9 insertions(+), 17 deletions(-)
>
> Index: linux-pm/drivers/acpi/container.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/container.c
> +++ linux-pm/drivers/acpi/container.c
> @@ -44,19 +44,24 @@ static const struct acpi_device_id conta
> {"", 0},
> };
>
> -static int container_device_attach(struct acpi_device *device,
> +static int container_device_attach(struct acpi_device *adev,
> const struct acpi_device_id *not_used)
> {
> - /* This is necessary for container hotplug to work. */
> + kobject_uevent(&adev->dev.kobj, KOBJ_ONLINE);
> return 1;
> }
>
> +static void container_device_detach(struct acpi_device *adev)
> +{
> + kobject_uevent(&adev->dev.kobj, KOBJ_OFFLINE);
> +}
> +
> static struct acpi_scan_handler container_handler = {
> .ids = container_device_ids,
> .attach = container_device_attach,
> + .detach = container_device_detach,
> .hotplug = {
> .enabled = true,
> - .mode = AHM_CONTAINER,
> },
> };
>
> Index: linux-pm/drivers/acpi/scan.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/scan.c
> +++ linux-pm/drivers/acpi/scan.c
> @@ -206,9 +206,6 @@ static int acpi_scan_hot_remove(struct a
> acpi_status status;
> unsigned long long sta;
>
> - if (device->handler && device->handler->hotplug.mode == AHM_CONTAINER)
> - kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
> -
> /*
> * Carry out two passes here and ignore errors in the first pass,
> * because if the devices in question are memory blocks and
> @@ -288,10 +285,7 @@ static int acpi_scan_device_check(struct
> dev_warn(&adev->dev, "Namespace scan failure\n");
> return error;
> }
> - if (adev->handler) {
> - if (adev->handler->hotplug.mode == AHM_CONTAINER)
> - kobject_uevent(&adev->dev.kobj, KOBJ_ONLINE);
> - } else {
> + if (!adev->handler) {
> dev_warn(&adev->dev, "Enumeration failure\n");
> return -ENODEV;
> }
> Index: linux-pm/include/acpi/acpi_bus.h
> ===================================================================
> --- linux-pm.orig/include/acpi/acpi_bus.h
> +++ linux-pm/include/acpi/acpi_bus.h
> @@ -91,16 +91,9 @@ struct acpi_device;
> * -----------------
> */
>
> -enum acpi_hotplug_mode {
> - AHM_GENERIC = 0,
> - AHM_CONTAINER,
> - AHM_COUNT
> -};
> -
> struct acpi_hotplug_profile {
> struct kobject kobj;
> bool enabled:1;
> - enum acpi_hotplug_mode mode;
> int (*scan_dependent)(struct acpi_device *adev);
> };
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2013-11-29 2:36 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-17 16:29 [PATCH 0/10] ACPI: Device objects for all namespace nodes and PCI root hotplug integration Rafael J. Wysocki
2013-11-17 16:31 ` [PATCH 1/10] ACPICA: Delete all attached data objects on node deletion Rafael J. Wysocki
2013-11-17 16:31 ` [PATCH 2/10] ACPI / scan: Define non-empty device removal handler Rafael J. Wysocki
2013-11-17 16:33 ` [PATCH 3/10] ACPI / scan: Add acpi_device objects for all device nodes in the namespace Rafael J. Wysocki
2013-11-17 16:33 ` [PATCH 4/10] ACPI / hotplug: Do not fail bus and device checks for disabled hotplug Rafael J. Wysocki
2013-11-17 16:34 ` [PATCH 5/10] ACPI / hotplug: Introduce common hotplug function acpi_device_hotplug() Rafael J. Wysocki
2013-11-17 16:35 ` [PATCH 6/10] ACPI / hotplug: Make ACPI PCI root hotplug use common hotplug code Rafael J. Wysocki
2013-11-17 16:36 ` [PATCH 7/10] ACPI / hotplug: Move container-specific code out of the core Rafael J. Wysocki
2013-11-29 2:36 ` Yasuaki Ishimatsu [this message]
2013-11-29 13:08 ` Rafael J. Wysocki
2013-12-03 2:46 ` Yasuaki Ishimatsu
2013-12-03 13:15 ` Rafael J. Wysocki
2013-12-04 5:43 ` Yasuaki Ishimatsu
2013-12-13 2:56 ` Yasuaki Ishimatsu
2013-12-13 4:56 ` Rafael J. Wysocki
2013-12-13 5:17 ` Yasuaki Ishimatsu
2013-12-14 5:07 ` Rafael J. Wysocki
2013-12-23 13:58 ` Rafael J. Wysocki
2013-12-23 14:00 ` [PATCH 1/2][Untested] ACPI / hotplug: Add demand_offline hotplug profile flag Rafael J. Wysocki
2013-12-26 3:10 ` Yasuaki Ishimatsu
2013-12-26 4:10 ` Yasuaki Ishimatsu
2013-12-27 0:58 ` Rafael J. Wysocki
2013-12-27 5:18 ` Yasuaki Ishimatsu
2013-12-27 5:34 ` Yasuaki Ishimatsu
2013-12-27 11:52 ` Rafael J. Wysocki
2013-12-27 11:51 ` Rafael J. Wysocki
2013-12-27 22:21 ` [PATCH 0/2] ACPI / hotplug / driver core: Special handling for container devices Rafael J. Wysocki
2013-12-27 22:23 ` [PATCH 1/2] ACPI / hotplug: Add demand_offline hotplug profile flag Rafael J. Wysocki
2013-12-27 22:28 ` [PATCH 2/2] ACPI / hotplug / driver core: Handle containers in a special way Rafael J. Wysocki
2013-12-29 3:58 ` Greg Kroah-Hartman
2013-12-29 3:59 ` [PATCH 0/2] ACPI / hotplug / driver core: Special handling for container devices Greg Kroah-Hartman
2013-12-29 14:20 ` Rafael J. Wysocki
2013-12-27 0:33 ` [PATCH 1/2][Untested] ACPI / hotplug: Add demand_offline hotplug profile flag Rafael J. Wysocki
2013-12-23 14:02 ` [PATCH 2/2][Untested] ACPI / hotplug / driver core: Handle containers in a special way Rafael J. Wysocki
2013-12-24 0:41 ` [Update][PATCH 2/2] " Rafael J. Wysocki
2013-12-26 1:01 ` [PATCH 7/10] ACPI / hotplug: Move container-specific code out of the core Rafael J. Wysocki
2013-12-26 2:53 ` Yasuaki Ishimatsu
2013-12-27 0:31 ` Rafael J. Wysocki
2013-11-17 16:36 ` [PATCH 8/10] ACPI / hotplug: Rework generic code to handle suprise removals Rafael J. Wysocki
2013-11-17 16:37 ` [PATCH 9/10] ACPI / hotplug: Drop unfinished global notification handling routines Rafael J. Wysocki
2013-11-17 16:38 ` [PATCH 10/10] ACPI: Introduce acpi_set_device_status() Rafael J. Wysocki
2013-11-19 14:30 ` [PATCH 0/10] ACPI: Device objects for all namespace nodes and PCI root hotplug integration Mika Westerberg
2013-11-19 20:51 ` Rafael J. Wysocki
2013-11-19 21:05 ` Mika Westerberg
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=5297FDC7.6000007@jp.fujitsu.com \
--to=isimatu.yasuaki@jp.fujitsu.com \
--cc=aaron.lu@intel.com \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
--cc=rui.zhang@intel.com \
--cc=toshi.kani@hp.com \
--cc=yinghai@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.