From patchwork Tue Jan 6 11:11:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 5573171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 332A89F357 for ; Tue, 6 Jan 2015 11:15:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4ADD020211 for ; Tue, 6 Jan 2015 11:15:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 291A92020E for ; Tue, 6 Jan 2015 11:15:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y8S3f-0005v4-1Q; Tue, 06 Jan 2015 11:12:19 +0000 Received: from mail-pd0-f181.google.com ([209.85.192.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y8S3L-0005QY-HL for linux-arm-kernel@lists.infradead.org; Tue, 06 Jan 2015 11:12:07 +0000 Received: by mail-pd0-f181.google.com with SMTP id v10so30202646pde.12 for ; Tue, 06 Jan 2015 03:11:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=fECaLTZMXlV7wMSU0/wwqHPwkE+yvaALSNlN8fOaWfA=; b=AAQU5UzcGq+L3kkacaU72Ln0s5vSFf3RFIHSlTszwlQdhfTaM8OsoX4dhaOY000z8C frQkYKcvZgfErYtgAwU6nJMo/d5yCtsjoHU0szFhBjpQ0btRBO/E4o4lpIy62aXgOPWW 0srTxc0MMok2Yka3RUVJ1gcqJ2bZdc7uEDXR70r936i87wAUfHHwt9GQi8ToxONlBqUp I6StfwZ7/ZGOm/Z3bwPeQjzpCSHww4c1quKa09ekwzclUk/Ck/MQ64TKLiCCtAe9BJWI EfXD/9Ni+96CXx6VO1YRoMjp4Co8FojOoFHJaetwU7yz2p0PIbY7uzE6h1BOpmT/jR0U EBWQ== X-Gm-Message-State: ALoCoQn/tG/17iCKTwg6BREXehmaregErXErJODLoMSHCwxLdl5X6M6dxEm9lQ6d3qaTT+lVydHm X-Received: by 10.70.140.229 with SMTP id rj5mr154183026pdb.60.1420542698238; Tue, 06 Jan 2015 03:11:38 -0800 (PST) Received: from [10.10.3.98] ([167.160.116.93]) by mx.google.com with ESMTPSA id ul5sm57122407pab.36.2015.01.06.03.11.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jan 2015 03:11:37 -0800 (PST) Message-ID: <54ABC2CB.6@linaro.org> Date: Tue, 06 Jan 2015 19:11:07 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Catalin Marinas Subject: Re: [PATCH v5 18/18] Documentation: ACPI for ARM64 References: <1413553034-20956-1-git-send-email-hanjun.guo@linaro.org> <1413553034-20956-19-git-send-email-hanjun.guo@linaro.org> <20141224171815.GD13399@e104818-lin.cambridge.arm.com> <54A90A4C.60908@linaro.org> <20150105110533.GA14967@e104818-lin.cambridge.arm.com> In-Reply-To: <20150105110533.GA14967@e104818-lin.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150106_031159_619995_6BEDC99D X-CRM114-Status: GOOD ( 17.97 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , "linaro-acpi@lists.linaro.org" , Will Deacon , Lv Zheng , Rob Herring , Lorenzo Pieralisi , Al Stone , Daniel Lezcano , Robert Moore , "linux-acpi@vger.kernel.org" , "jcm@redhat.com" , "grant.likely@linaro.org" , Charles Garcia-Tobin , Robert Richter , Jason Cooper , Arnd Bergmann , Marc Zyngier , Liviu Dudau , Mark Brown , Bjorn Helgaas , "linux-arm-kernel@lists.infradead.org" , "graeme.gregory@linaro.org" , "Kangkang.Shen@huawei.com" , Randy Dunlap , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , Sudeep Holla , Olof Johansson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2015?01?05? 19:05, Catalin Marinas wrote: > On Sun, Jan 04, 2015 at 09:39:24AM +0000, Hanjun Guo wrote: >> On 2014?12?25? 01:18, Catalin Marinas wrote: >> [...] >>> >>> In addition to the above and _DSD requirements/banning, I would also add >>> some clear statements around: >>> >>> _OSC: only global/published capabilities are allowed. For >>> device-specific _OSC we need a process or maybe we can ban them entirely >>> and rely on _DSD once we clarify the process. >>> >>> _OSI: firmware must not check for certain _OSI strings. Here I'm not >>> sure what we would have to do for ARM Linux. Reporting "Windows" does >>> not make any sense but not reporting anything can, as Matthew Garrett >>> pointed out, can be interpreted by firmware as "Linux". In addition to >>> any statements in this document, I suggest you patch >>> drivers/acpi/acpica/utosi.c accordingly, maybe report "Linux" for ARM >>> and print a kernel warning so that we notice earlier. >>> >>> ACPI_OS_NAME: this is globally defined as "Microsoft Windows NT". It >>> doesn't make much sense in the ARM context. Could we change it to >>> "Linux" when CONFIG_ARM64? I think we can introduce a Kconfig such as CONFIG_ACPI_OS_NAME_LINUX, selected by ARM64 and change ACPI_OS_NAME to "Linux" when CONFIG_ACPI_OS_NAME_LINUX defined. (we can not add CONFIG_ARM64 in ACPICA code directly since it will be used by windows too) some code like below: >> >> We will work on this both on ASWG and linux ACPI driver side, as Dong >> and Charles pointed out, _OSI things can be solved in ACPI spec, when >> that is done, we can modify the kernel driver to fix the problems above. > > Which driver? the ACPICA core driver as you suggested, sorry for the confusion. > > What about ACPI_OS_NAME? Would you suggest it is fine to report > "Microsoft Windows NT" on an ARM system? That _OS_ not _OSI. No, not at all. I prefer "Linux" In include/acpi/acconfig.h, when ACPI_OS_NAME defined, it says: "OS name, used for the _OS object. The _OS object is essentially obsolete,..." for some legacy reasons, we needed "Microsoft Windows NT", but ACPI for ARM64 on linux is totally new, I think we can change it to "Linux" when CONFIG_ARM64 as you suggested. Thanks Hanjun diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index b1f9a20..de567a3 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1,5 +1,6 @@ config ARM64 def_bool y + select ACPI_OS_NAME_LINUX if ACPI select ARCH_BINFMT_ELF_RANDOMIZE_PIE select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_GCOV_PROFILE_ALL diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 8951cef..11a10ac 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -369,6 +369,10 @@ config ACPI_REDUCED_HARDWARE_ONLY If you are unsure what to do, do not enable this option. +config ACPI_OS_NAME_LINUX + bool "Using Linux for _OS method" if EXPERT + def_bool n + source "drivers/acpi/apei/Kconfig" config ACPI_EXTLOG diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 5a0a3e5..db5e13e 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -69,7 +69,11 @@ * code that will not execute the _OSI method unless _OS matches the string * below. Therefore, change this string at your own risk. */ +#ifndef ACPI_OS_NAME_USING_LINUX #define ACPI_OS_NAME "Microsoft Windows NT" +#else +#define ACPI_OS_NAME "Linux" +#endif /* Maximum objects in the various object caches */ diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 1ba7c19..45d51d2 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -69,6 +69,10 @@ #define ACPI_REDUCED_HARDWARE 1 #endif +#ifdef CONFIG_ACPI_OS_NAME_LINUX +#define ACPI_OS_NAME_USING_LINUX 1 +#endif + #include #include #include