From patchwork Fri Jul 15 07:45:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fu.wei@linaro.org X-Patchwork-Id: 9231271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A35460865 for ; Fri, 15 Jul 2016 07:46:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49E082816B for ; Fri, 15 Jul 2016 07:46:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E29828304; Fri, 15 Jul 2016 07:46:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BE9072818B for ; Fri, 15 Jul 2016 07:46:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNxoQ-0002bU-Nx; Fri, 15 Jul 2016 07:45:30 +0000 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNxoN-0001q9-G0 for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2016 07:45:28 +0000 Received: by mail-oi0-x22a.google.com with SMTP id j185so146025360oih.0 for ; Fri, 15 Jul 2016 00:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CJO4lbfAGMYoq/5Vji5ZlJfOTk2jv6aIgjZTDpu0Zf0=; b=bLhZfncvIzQ+eOCh0NCBpXXND3rmLGFMkvxSmcKVWnW3X8gwTKie1eBIQT0VNByGMj v8sMJmdbVsBJEQxNWWRisGAnZslG6BkiOMpTULGBokbvOAEHddjW3hLx4r0yKQ7paZoJ ufbVxLpFfiHb9dkDhoshZoXMEYo1V0XGv9Jkc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CJO4lbfAGMYoq/5Vji5ZlJfOTk2jv6aIgjZTDpu0Zf0=; b=Gh/o9laxbCL4nraFrmbmuXiBE6nDwsHHah+kJSdJi+46Pva7CZHbWFxOjRIn0QrFjo Hon4UWzgRitluUMpf3XMAE/uhmRaM83yOcJe9q5qPsOdfui3IPKpsr8BX6B3p45Sh/4S wM2bv7WnK8bh4ehH6uLfA7DAKzxUUT5scQfxYUkplbYNF5SRihSEfqTbbdk8aVTY8ERV EFHxSIHmBAOIjUttUPNFJ4ZsMCnVW7uZTlr9ikaAFMi+JawxlmyLZ2WOEc1+LVl1Hhsp UjjKkzx8Svv2wz+NUHlMX9dHdYi/ois16XCSSm5m/yzRc1fRntqbnO/YRDBd59O7coBP DFrA== X-Gm-Message-State: ALyK8tJV6koJ1U6wXRBgACU4GYhnU3PHUBacvqBaxWneC5Xm4ho1bNzYe05LyYGXpWp2EBwTrvJ4CML8f8ZL5Zc5 X-Received: by 10.157.9.170 with SMTP id q39mr12142553otd.88.1468568706542; Fri, 15 Jul 2016 00:45:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.212.22 with HTTP; Fri, 15 Jul 2016 00:45:05 -0700 (PDT) In-Reply-To: References: <1468432402-4872-1-git-send-email-fu.wei@linaro.org> <1468432402-4872-5-git-send-email-fu.wei@linaro.org> <20160713210857.GA9500@roeck-us.net> From: Fu Wei Date: Fri, 15 Jul 2016 15:45:05 +0800 Message-ID: Subject: Re: [PATCH v7 4/9] acpi/arm64: Add GTDT table parse driver To: "Rafael J. Wysocki" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160715_004527_640255_1B44CDB5 X-CRM114-Status: GOOD ( 25.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linaro-acpi@lists.linaro.org" , Catalin Marinas , Will Deacon , rruigrok@codeaurora.org, Wim Van Sebroeck , Jiri Slaby , wei@redhat.com, Lorenzo Pieralisi , Al Stone , Timur Tabi , Daniel Lezcano , ACPI Devel Maling List , kvalo@codeaurora.org, Guenter Roeck , Len Brown , harba@codeaurora.org, Julien Grall , "linux-watchdog@vger.kernel.org" , Arnd Bergmann , Marc Zyngier , Jon Masters , Christopher Covington , Thomas Gleixner , mchehab@kernel.org, "linux-arm-kernel@lists.infradead.org" , G Gregory , Greg Kroah-Hartman , "Rafael J. Wysocki" , Linux Kernel Mailing List , Leo Duran , Hanjun Guo , Suravee Suthikulanit , Sudeep Holla , Andrew Morton , David Miller , Christoffer Dall Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Rafael, On 14 July 2016 at 05:43, Rafael J. Wysocki wrote: > On Wed, Jul 13, 2016 at 11:08 PM, Guenter Roeck wrote: >> On Wed, Jul 13, 2016 at 10:30:37PM +0200, Rafael J. Wysocki wrote: >>> On Wed, Jul 13, 2016 at 7:53 PM, wrote: >>> > From: Fu Wei >>> > >>> > This patch adds support for parsing arch timer in GTDT, >>> > provides some kernel APIs to parse all the PPIs and >>> > always-on info in GTDT and export them. >>> > >>> > By this driver, we can simplify arm_arch_timer drivers, and >>> > separate the ACPI GTDT knowledge from it. >>> > >>> > Signed-off-by: Fu Wei >>> > Signed-off-by: Hanjun Guo >>> > --- >>> > drivers/acpi/Kconfig | 5 ++ >>> > drivers/acpi/Makefile | 1 + >>> > drivers/acpi/arm64/Kconfig | 15 ++++ >>> > drivers/acpi/arm64/Makefile | 1 + >>> > drivers/acpi/arm64/acpi_gtdt.c | 170 +++++++++++++++++++++++++++++++++++++++++ >>> > include/linux/acpi.h | 6 ++ >>> > 6 files changed, 198 insertions(+) >>> > >>> > diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig >>> > index b7e2e77..1cdc7d2 100644 >>> > --- a/drivers/acpi/Kconfig >>> > +++ b/drivers/acpi/Kconfig >>> > @@ -521,4 +521,9 @@ config XPOWER_PMIC_OPREGION >>> > >>> > endif >>> > >>> > +if ARM64 >>> > +source "drivers/acpi/arm64/Kconfig" >>> > + >>> > +endif >>> > + >>> > endif # ACPI >>> > diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile >>> > index 251ce85..1a94ff7 100644 >>> > --- a/drivers/acpi/Makefile >>> > +++ b/drivers/acpi/Makefile >>> > @@ -99,5 +99,6 @@ obj-$(CONFIG_ACPI_EXTLOG) += acpi_extlog.o >>> > obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o >>> > obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o >>> > obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o >>> > +obj-$(CONFIG_ARM64) += arm64/ >>> > >>> > video-objs += acpi_video.o video_detect.o >>> > diff --git a/drivers/acpi/arm64/Kconfig b/drivers/acpi/arm64/Kconfig >>> > new file mode 100644 >>> > index 0000000..ff5c253 >>> > --- /dev/null >>> > +++ b/drivers/acpi/arm64/Kconfig >>> > @@ -0,0 +1,15 @@ >>> > +# >>> > +# ACPI Configuration for ARM64 >>> > +# >>> > + >>> > +menu "The ARM64-specific ACPI Support" >>> > + >>> > +config ACPI_GTDT >>> > + bool "ACPI GTDT table Support" >>> >>> This should depend on ARM64. >>> >>> Also I wonder if it needs to be user-selectable? Wouldn't it be >>> better to enable it by default when building for ARM64 with ACPI? >>> >> It is currently selected in patch 9, in the watchdog driver's Kconfig >> entry. > > Well, it still doesn't have to be user-selectable for that. :-) Actually it is also automatically selected by [PATCH v7 6/9]: > >> Not sure if I like that; maybe the watchdog driver should depend >> on it instead ? > > If the watchdog is not the only user of it (and I don't think it is), > it would be better to arrange things this way. > There are two user: (1) arm_arch_timer(which will select CLKSRC_ACPI if ACPI, then CLKSRC_ACPI will select ACPI_GTDT if ARM64) So arm_arch_timer will automatically selecte ACPI_GTDT if ARM64 && ACPI (2) sbsa_gwdt (which will select ACPI_GTDT if ACPI in [PATCH v7 9/9]) So sbsa_gwdt will automatically selecte ACPI_GTDT if ARM64 && ACPI && ARM_ARCH_TIMER So ACPI_GTDT is automatically selected by both of two users. But like Timur said before: maybe we just "selecte ACPI_GTDT if ACPI" for ARM64, because ARM64 require GTDT if we use ACPI. > Thanks, > Rafael diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 47352d2..71d5b30 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -8,6 +8,7 @@ config CLKSRC_OF config CLKSRC_ACPI bool select CLKSRC_PROBE + select ACPI_GTDT if ARM64 config CLKSRC_PROBE bool