From: Lan Tianyu <tianyu.lan@intel.com>
To: "Moore, Robert" <robert.moore@intel.com>
Cc: "Zheng, Lv" <lv.zheng@intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"lenb@kernel.org" <lenb@kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] ACPICA: Add acpi_check_gpe_method() to check GPE method
Date: Fri, 11 Jul 2014 10:35:19 +0800 [thread overview]
Message-ID: <53BF4D67.8020100@intel.com> (raw)
In-Reply-To: <94F2FBAB4432B54E8AACC7DFDE6C92E37D1BFA16@ORSMSX112.amr.corp.intel.com>
On 2014年07月11日 03:32, Moore, Robert wrote:
> Since what is returned by this interface is essentially a piece of information about the particular GPE, I think that it might be better to generalize this interface to a "GetInfo" type of interface that returns a few pieces of information about the GPE.
>
Hi Bob:
Thanks for your review. Yes, that's good suggestion. But Rafael has new
solution to fix the issue. So this patch maybe not necessary.
>
>
>> -----Original Message-----
>> From: Lan, Tianyu
>> Sent: Monday, July 07, 2014 11:58 PM
>> To: Moore, Robert; Zheng, Lv; Wysocki, Rafael J; lenb@kernel.org
>> Cc: Lan, Tianyu; linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org
>> Subject: [RFC PATCH 1/2] ACPICA: Add acpi_check_gpe_method() to check GPE
>> method
>>
>> This patch is to expose acpi_check_gpe_method() to check whether there is
>> a GPE method for the given gpe. Enabling ACPI button devices' gpes will
>> depend on the new function's result.
>>
>> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
>> ---
>> drivers/acpi/acpica/evxface.c | 39
>> ++++++++++++++++++++++++++++++++++++++-
>> include/acpi/acpixf.h | 3 +++
>> 2 files changed, 41 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
>> index 11e5803..0fcb248 100644
>> --- a/drivers/acpi/acpica/evxface.c
>> +++ b/drivers/acpi/acpica/evxface.c
>> @@ -717,6 +717,44 @@ ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
>>
>>
>> /*************************************************************************
>> ******
>> *
>> + * FUNCTION: acpi_check_gpe_method
>> + *
>> + * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for
>> FADT
>> + * defined GPEs)
>> + * gpe_number - The event to remove a handler
>> + *
>> + * RETURN: Status
>> + *
>> + * DESCRIPTION: Check whether the given GPE has associated event method.
>> + *
>> +
>> +***********************************************************************
>> +*******/
>> +acpi_status
>> +acpi_check_gpe_method(acpi_handle gpe_device, u32 gpe_number) {
>> + struct acpi_gpe_event_info *gpe_event_info;
>> + acpi_status status = AE_NOT_EXIST;
>> + acpi_cpu_flags flags;
>> +
>> + ACPI_FUNCTION_TRACE(acpi_check_gpe_method);
>> +
>> + flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
>> + gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
>> + if (!gpe_event_info) {
>> + status = AE_ERROR;
>> + goto unlock_and_exit;
>> + }
>> +
>> + if (gpe_event_info->flags & ACPI_GPE_DISPATCH_METHOD)
>> + status = AE_OK;
>> +
>> +unlock_and_exit:
>> + acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
>> + return status;
>> +}
>> +ACPI_EXPORT_SYMBOL(acpi_check_gpe_method)
>> +
>> +/**********************************************************************
>> +*********
>> + *
>> * FUNCTION: acpi_install_gpe_handler
>> *
>> * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for
>> FADT
>> @@ -821,7 +859,6 @@ free_and_exit:
>> ACPI_FREE(handler);
>> goto unlock_and_exit;
>> }
>> -
>> ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler)
>>
>>
>> /*************************************************************************
>> ******
>> diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index
>> 35b525c..5b475c6 100644
>> --- a/include/acpi/acpixf.h
>> +++ b/include/acpi/acpixf.h
>> @@ -554,6 +554,9 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
>> address,
>> void *context))
>> ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
>> + acpi_check_gpe_method(acpi_handle gpe_device,
>> + u32 gpe_number))
>> +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
>> acpi_remove_gpe_handler(acpi_handle gpe_device,
>> u32 gpe_number,
>> acpi_gpe_handler
>> --
>> 1.8.4.rc0.1.g8f6a3e5.dirty
>
--
Best regards
Tianyu Lan
prev parent reply other threads:[~2014-07-11 2:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 6:57 [RFC PATCH 1/2] ACPICA: Add acpi_check_gpe_method() to check GPE method Lan Tianyu
2014-07-08 6:57 ` [RFC PATCH 2/2] ACPI/Wakup: Enable button wakeup GPEs if these GPEs have associated GPE methods Lan Tianyu
2014-07-08 13:26 ` Rafael J. Wysocki
2014-07-09 3:08 ` Lan Tianyu
2014-07-09 13:00 ` Rafael J. Wysocki
2014-07-08 13:19 ` [RFC PATCH 1/2] ACPICA: Add acpi_check_gpe_method() to check GPE method Rafael J. Wysocki
2014-07-10 19:32 ` Moore, Robert
2014-07-11 2:35 ` Lan Tianyu [this message]
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=53BF4D67.8020100@intel.com \
--to=tianyu.lan@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.com \
/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