Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2404169imm; Wed, 16 May 2018 12:19:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoQCO5Kt1ZBWx/aeRLqroYvwPahuRBib+PpAuwUpm4vpikM+evobEt12KiP78/7vYNyGXIH X-Received: by 2002:a17:902:7d87:: with SMTP id a7-v6mr2247010plm.264.1526498386051; Wed, 16 May 2018 12:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526498385; cv=none; d=google.com; s=arc-20160816; b=x+SPazFQz/lRVpS/CriK0qHNCIwPSCgDInbIskQtQ12cgfRmmIGi0zbNWNoygz4tJ8 kIJtSBYYuadugQOzsU+gmzIi7NQVNeCFNH3ECALwfKHzRAG/5r1wA64aOkR9ycoa+V48 K9sSq0fswkbM3z6vAec5vfhpAc/W9EhkoM4PvUAUUuXSL1S9PQBz+TwnKnZdME5SeZ5N clgu4mjVXrU5vb5l6GJm8xOphrx/8/4n75ByauuJgbwWh+Ag4LSEiDpBcuAICENpVWHQ rollfHr5zTnuY8Eyn/0NAPWN0bTiguk8WTpJO27fJ1lT5wyaYfAhd2wS84vA/H9ljSpc uWXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=VwAL2ueUG9U1o0yAa2X6BaRtmjeQZqBpYoyNMeyBxZk=; b=Wo0GPTliJ6CwnmJiitDWijEVZNtfT+1RR5WeJJs4r7f6KexFx8bPlOWxsYUjGaqbkx buztkrXgp+iA/Ua9O/A/Q5KUaBBf0HEPDwg0mCipsnZ/vCnNkjQakuDyIGdQF5w0oyxc 4eM9WB88XwgelUPB43UJA8NvuZYEaIVpkncluAr8Y3rRkTrW3icbWIFoF6VtPX8mXOcZ oFJxhcurIlxi8JUVQVqlmFNlLiAxPbjZwKP91+GZ3ea4KRIouqt9AyvDCRI4h5vxJV/A jeLuUE4Jrigen+1gAILKK/Jomj8gkmTloe7fLi1JirOL4qbYIqbSGmSAi7cuCnX+1UN+ Bjvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n29-v6si2464472pgc.4.2018.05.16.12.19.31; Wed, 16 May 2018 12:19:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751430AbeEPTTA convert rfc822-to-8bit (ORCPT + 99 others); Wed, 16 May 2018 15:19:00 -0400 Received: from mga03.intel.com ([134.134.136.65]:62918 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbeEPTS5 (ORCPT ); Wed, 16 May 2018 15:18:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 12:18:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,406,1520924400"; d="scan'208";a="41508945" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by orsmga007.jf.intel.com with ESMTP; 16 May 2018 12:18:57 -0700 Received: from orsmsx112.amr.corp.intel.com (10.22.240.13) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 16 May 2018 12:18:56 -0700 Received: from orsmsx108.amr.corp.intel.com ([169.254.2.198]) by ORSMSX112.amr.corp.intel.com ([169.254.3.64]) with mapi id 14.03.0319.002; Wed, 16 May 2018 12:18:56 -0700 From: "Moore, Robert" To: "Rafael J. Wysocki" , Linux ACPI CC: "Zhang, Rui" , Linux PM , LKML , "Schmauss, Erik" , "Wang, Wendy" Subject: RE: [PATCH 1/2] ACPICA: Introduce acpi_dispatch_gpe() Thread-Topic: [PATCH 1/2] ACPICA: Introduce acpi_dispatch_gpe() Thread-Index: AQHT7Q9zFf4ZLtB3okuE5+Gc7MpnD6Qyuxpw Date: Wed, 16 May 2018 19:18:56 +0000 Message-ID: <94F2FBAB4432B54E8AACC7DFDE6C92E3B776DF31@ORSMSX108.amr.corp.intel.com> References: <2406722.gU2bUHd7bl@aspire.rjw.lan> <1877957.ohNgiH8Sko@aspire.rjw.lan> In-Reply-To: <1877957.ohNgiH8Sko@aspire.rjw.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmU2OTk5M2MtMjMzYy00YzAzLThjZTgtM2U4Y2RkM2Y3Y2U3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJrUXlaSW0rd3BNUm5iK3RITEd2RzQ0cVNhVUpwbVpOaElNSm1yV3FrWlROWHRSZ1NVb2xoWDlcL0p2UFpsQWdHayJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm not sure why this is necessary, please explain. Is the implication here that some driver is going to poll on acpi_dispatch_gpe? Bob > -----Original Message----- > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > Sent: Wednesday, May 16, 2018 5:12 AM > To: Linux ACPI > Cc: Zhang, Rui ; Linux PM pm@vger.kernel.org>; LKML ; Schmauss, Erik > ; Moore, Robert ; Wang, > Wendy > Subject: [PATCH 1/2] ACPICA: Introduce acpi_dispatch_gpe() > > From: Rafael J. Wysocki > > Introduce acpi_dispatch_gpe() as a wrapper around acpi_ev_detect_gpe() > for checking if the given GPE (as represented by a GPE device handle and > a GPE number) is currently active and dispatching it (if that's the > case) outside of interrupt context. > > Signed-off-by: Rafael J. Wysocki > --- > drivers/acpi/acpica/evgpe.c | 6 ++++++ > drivers/acpi/acpica/evxfgpe.c | 22 ++++++++++++++++++++++ > include/acpi/acpixf.h | 1 + > 3 files changed, 29 insertions(+) > > Index: linux-pm/drivers/acpi/acpica/evgpe.c > =================================================================== > --- linux-pm.orig/drivers/acpi/acpica/evgpe.c > +++ linux-pm/drivers/acpi/acpica/evgpe.c > @@ -634,6 +634,12 @@ acpi_ev_detect_gpe(struct acpi_namespace > > flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); > > + if (!gpe_event_info) { > + gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, > gpe_number); > + if (!gpe_event_info) > + goto error_exit; > + } > + > /* Get the info block for the entire GPE register */ > > gpe_register_info = gpe_event_info->register_info; > Index: linux-pm/drivers/acpi/acpica/evxfgpe.c > =================================================================== > --- linux-pm.orig/drivers/acpi/acpica/evxfgpe.c > +++ linux-pm/drivers/acpi/acpica/evxfgpe.c > @@ -639,6 +639,28 @@ ACPI_EXPORT_SYMBOL(acpi_get_gpe_status) > > > /*********************************************************************** > ******** > * > + * FUNCTION: acpi_gispatch_gpe > + * > + * PARAMETERS: gpe_device - Parent GPE Device. NULL for > GPE0/GPE1 > + * gpe_number - GPE level within the GPE block > + * > + * RETURN: None > + * > + * DESCRIPTION: Detect and dispatch a General Purpose Event to either a > function > + * (e.g. EC) or method (e.g. _Lxx/_Exx) handler. > + * > + > +*********************************************************************** > +*******/ void acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number) > +{ > + ACPI_FUNCTION_TRACE(acpi_dispatch_gpe); > + > + acpi_ev_detect_gpe(gpe_device, NULL, gpe_number); } > + > +ACPI_EXPORT_SYMBOL(acpi_dispatch_gpe) > + > +/********************************************************************** > +********* > + * > * FUNCTION: acpi_finish_gpe > * > * PARAMETERS: gpe_device - Namespace node for the GPE Block > Index: linux-pm/include/acpi/acpixf.h > =================================================================== > --- linux-pm.orig/include/acpi/acpixf.h > +++ linux-pm/include/acpi/acpixf.h > @@ -753,6 +753,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_sta > u32 gpe_number, > acpi_event_status > *event_status)) > +void acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number); > ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status > acpi_disable_all_gpes(void)) > ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status > acpi_enable_all_runtime_gpes(void)) > ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status > acpi_enable_all_wakeup_gpes(void))