From: Toshi Kani <toshi.kani@hp.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux PCI <linux-pci@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Yinghai Lu <yinghai@kernel.org>
Subject: Re: [Update][PATCH 4/6] ACPI / hotplug: Simplify device ejection routines
Date: Wed, 06 Nov 2013 17:17:05 -0700 [thread overview]
Message-ID: <1383783425.1847.52.camel@misato.fc.hp.com> (raw)
In-Reply-To: <1642586.5aH3MlB2GZ@vostro.rjw.lan>
On Thu, 2013-11-07 at 01:14 +0100, Rafael J. Wysocki wrote:
> On Wednesday, November 06, 2013 04:27:01 PM Toshi Kani wrote:
> > On Mon, 2013-11-04 at 14:36 +0100, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > >
> > > Simplify handle_root_bridge_removal() and acpi_eject_store() by
> > > getting rid of struct acpi_eject_event and passing device objects
> > > directly to async routines executed via acpi_os_hotplug_execute().
> > :
> > > static ssize_t
> > > acpi_eject_store(struct device *d, struct device_attribute *attr,
> > > const char *buf, size_t count)
> > > {
> > > struct acpi_device *acpi_device = to_acpi_device(d);
> > > - struct acpi_eject_event *ej_event;
> > > acpi_object_type not_used;
> > > acpi_status status;
> > > - int ret;
> > >
> > > if (!count || buf[0] != '1')
> > > return -EINVAL;
> > > @@ -518,28 +519,17 @@ acpi_eject_store(struct device *d, struc
> > > if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable)
> > > return -ENODEV;
> > >
> > > - ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
> > > - if (!ej_event) {
> > > - ret = -ENOMEM;
> > > - goto err_out;
> > > - }
> > > acpi_evaluate_hotplug_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT,
> > > ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
> > > - ej_event->device = acpi_device;
> > > - ej_event->event = ACPI_OST_EC_OSPM_EJECT;
> > > get_device(&acpi_device->dev);
> > > - status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event);
> > > + status = acpi_os_hotplug_execute(acpi_eject_store_work, acpi_device);
> > > if (ACPI_SUCCESS(status))
> > > return count;
> > >
> > > put_device(&acpi_device->dev);
> > > - kfree(ej_event);
> > > - ret = status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN;
> >
> > Why are you deleting the above line as part of this change?
>
> Ah, because I forgot that acpi_os_hotplug_execute() can also return AE_NO_MEMORY. :-)
>
> Good catch, updated pach follows.
Looks good. The rest of the patches also look good. For patch 4-6:
Acked-by: Toshi Kani <toshi.kani@hp.com>
Thanks,
-Toshi
next prev parent reply other threads:[~2013-11-07 0:21 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-04 0:17 [PATCH 0/3] ACPI scan and hotplug fixes for 3.14 Rafael J. Wysocki
2013-11-04 0:18 ` [PATCH 1/3] ACPI / scan: Start matching drivers after trying scan handlers Rafael J. Wysocki
2013-11-04 0:21 ` [PATCH 2/3] ACPI / hotplug: Refuse to hot-remove all objects with disabled hotplug Rafael J. Wysocki
2013-11-04 0:21 ` [PATCH 3/3] ACPI / hotplug: Merge device hot-removal routines Rafael J. Wysocki
2013-11-04 0:41 ` [PATCH on top of 3/3] ACPI / hotplug: Remove unnecessary get_device() and put_device() Rafael J. Wysocki
2013-11-04 13:26 ` [PATCH 3/3] ACPI / hotplug: Merge device hot-removal routines Rafael J. Wysocki
2013-11-04 13:29 ` [Update][PATCH 0/6] ACPI scan and hotplug fixes Rafael J. Wysocki
2013-11-04 13:30 ` [Update][PATCH 1/6] ACPI / scan: Start matching drivers after trying scan handlers Rafael J. Wysocki
2013-11-05 23:27 ` Toshi Kani
2013-11-04 13:32 ` [Update][PATCH 2/6] ACPI / hotplug: Refuse to hot-remove all objects with disabled hotplug Rafael J. Wysocki
2013-11-05 23:27 ` [fixup][PATCH " Rafael J. Wysocki
2013-11-06 0:39 ` Toshi Kani
2013-11-06 1:35 ` Rafael J. Wysocki
2013-11-06 1:32 ` Toshi Kani
2013-11-04 13:33 ` [Update][PATCH 3/6] ACPI / hotplug: Fix handle_root_bridge_removal() Rafael J. Wysocki
2013-11-06 23:21 ` Toshi Kani
2013-11-04 13:36 ` [Update][PATCH 4/6] ACPI / hotplug: Simplify device ejection routines Rafael J. Wysocki
2013-11-06 23:27 ` Toshi Kani
2013-11-07 0:14 ` Rafael J. Wysocki
2013-11-07 0:17 ` Toshi Kani [this message]
2013-11-07 0:35 ` Rafael J. Wysocki
2013-11-04 13:36 ` [Update][PATCH 5/6] ACPI / hotplug: Make acpi_bus_hot_remove_device() internal Rafael J. Wysocki
2013-11-04 13:36 ` [Update][PATCH 6/6] ACPI / hotplug: Merge device hot-removal routines Rafael J. Wysocki
2013-11-05 23:32 ` [PATCH 0/3] More ACPI hotplug updates (was: [Update][PATCH 0/6] ACPI scan and hotplug fixes) Rafael J. Wysocki
2013-11-05 23:34 ` [PATCH 1/3] ACPI / hotplug: Carry out PCI root eject directly Rafael J. Wysocki
2013-11-06 1:42 ` [Update][PATCH " Rafael J. Wysocki
2013-11-05 23:36 ` [PATCH 2/3] ACPI / hotplug: Do not execute "insert in progress" _OST Rafael J. Wysocki
2013-11-05 23:48 ` [PATCH 3/3] ACPI / hotplug: Consolidate deferred execution of ACPI hotplug routines Rafael J. Wysocki
2013-11-06 1:44 ` [Update][PATCH " Rafael J. Wysocki
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=1383783425.1847.52.camel@misato.fc.hp.com \
--to=toshi.kani@hp.com \
--cc=bhelgaas@google.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox