From: Bjorn Helgaas <bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: "S,
Naveen B" <naveen.b.s-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
lhms-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
"Tolentino,
Matthew E"
<matthew.e.tolentino-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] ACPI based Memory Hotplug Driver Patch
Date: Thu, 9 Sep 2004 09:52:15 -0600 [thread overview]
Message-ID: <200409090952.15392.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <FEB6C4E97F6CAF41978FB2059D5454180F37E8-OkeUvhg1trkFyVwBAnZdSLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
Nice work!
On Thursday 09 September 2004 4:54 am, S, Naveen B wrote:
> +acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
> +{
> + acpi_status status;
> + struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
> + struct acpi_resource *resource = NULL;
> + struct acpi_resource_address16 *address16 = NULL;
> + struct acpi_resource_address32 *address32 = NULL;
> + struct acpi_resource_address64 *address64 = NULL;
You can use acpi_resource_to_address64() to keep from having to write
the same code for address16, address32, and address64.
> + status = acpi_get_current_resources(mem_device->handle, &buffer);
> + if (ACPI_FAILURE(status))
> + return_VALUE(-EINVAL);
> +
> + resource = (struct acpi_resource *) buffer.pointer;
> +
> + switch (resource->id) {
> + case ACPI_RSTYPE_ADDRESS16:
I'm not sure you should assume the range will be the only item in _CRS
(i.e., you may need to iterate over all items using acpi_walk_resources()).
> +static int
> +acpi_memory_check_device(struct acpi_memory_device *mem_device)
Could you just use acpi_bus_get_status() instead of defining this?
> +static int
> +acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
> +{
> + ...
> + /* Evalute _STA to check if the device is disabled */
> + status = acpi_evaluate_integer(mem_device->handle, "_STA",
> + NULL, ¤t_status);
acpi_bus_get_status() again?
> +static acpi_status is_memory_device(acpi_handle handle)
(Different indent style). Seems like this should check _CID as well
as _HID? Could it leverage acpi_match_ids() somehow?
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
next prev parent reply other threads:[~2004-09-09 15:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-09 10:54 [PATCH] ACPI based Memory Hotplug Driver Patch S, Naveen B
[not found] ` <FEB6C4E97F6CAF41978FB2059D5454180F37E8-OkeUvhg1trkFyVwBAnZdSLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-09-09 13:11 ` Dmitry Torokhov
2004-09-09 15:50 ` [Lhms-devel] " Dave Hansen
2004-09-09 15:52 ` Bjorn Helgaas [this message]
2004-09-10 13:45 ` Keiichiro Tokunaga
[not found] ` <20040910224510.7f78b1b5.tokunaga.keiich-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2004-09-11 6:08 ` [Lhms-devel] " Hirokazu Takahashi
[not found] ` <20040911.150854.71102255.taka-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org>
2004-09-11 7:14 ` Dave Hansen
2004-09-10 14:02 ` Keiichiro Tokunaga
[not found] ` <20040910230200.73eb0374.tokunaga.keiich-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2004-09-10 17:32 ` [Lhms-devel] " Dave Hansen
2004-09-13 8:23 ` Keiichiro Tokunaga
[not found] ` <20040913172318.791db349.tokunaga.keiich-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2004-09-13 8:41 ` Dave Hansen
2004-09-14 2:58 ` Keiichiro Tokunaga
[not found] ` <20040914115844.1e12203d.tokunaga.keiich-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2004-09-14 4:11 ` Dave Hansen
2004-09-14 9:29 ` Keiichiro Tokunaga
[not found] ` <20040914182956.49c9381d.tokunaga.keiich-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2004-09-14 17:12 ` Dave Hansen
2004-09-15 0:08 ` Keiichiro Tokunaga
[not found] ` <20040915090827.7f86a54f.tokunaga.keiich-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2004-09-15 0:17 ` Dave Hansen
2004-09-16 2:51 ` Keiichiro Tokunaga
2004-09-14 16:21 ` Joel Schopp
2004-09-16 10:47 ` [PATCH] /sys/firmware/acpi/memory/ for showing info of ACPI memory object Keiichiro Tokunaga
[not found] ` <20040916194725.562b50f0.tokunaga.keiich-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2004-09-24 8:46 ` Keiichiro Tokunaga
-- strict thread matches above, loose matches on Subject: below --
2004-09-10 12:20 [PATCH] ACPI based Memory Hotplug Driver Patch S, Naveen B
2004-09-13 12:56 S, Naveen B
2004-09-13 17:50 S, Naveen B
[not found] ` <FEB6C4E97F6CAF41978FB2059D5454180F3802-OkeUvhg1trkFyVwBAnZdSLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-09-14 8:06 ` Keiichiro Tokunaga
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=200409090952.15392.bjorn.helgaas@hp.com \
--to=bjorn.helgaas-vxdhtt5mjny@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=lhms-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=matthew.e.tolentino-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=naveen.b.s-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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