From patchwork Wed May 17 14:20:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yazen Ghannam X-Patchwork-Id: 9731221 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 A3C4960363 for ; Wed, 17 May 2017 14:21:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9579F285FD for ; Wed, 17 May 2017 14:21:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A3F0287A5; Wed, 17 May 2017 14:21:03 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2ADB285FD for ; Wed, 17 May 2017 14:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbdEQOVB (ORCPT ); Wed, 17 May 2017 10:21:01 -0400 Received: from mail-by2nam01on0077.outbound.protection.outlook.com ([104.47.34.77]:36259 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751360AbdEQOVA (ORCPT ); Wed, 17 May 2017 10:21:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LHH10Lrj6lonDTnknUS1qpzjuAK1gNT0AB5xoP+mAgM=; b=LMzz0pdtU0QtFRjCs85Hrlz3ep+rP+okEBadK0iE/M3ZW/VIoG5z1aaqpOTHh0OlzX3ZFgdN2QalupVft3hzt0qZuyvTEtmfB3Ubb9B7ZfItCpX47k2crHMVJ8I/+saO6lZcRmIYwdOqk7DRHXrRmip5T5QE0d1gWHztphPSNBk= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from yaz-diesel.amd.com (165.204.78.1) by CY4PR1201MB0134.namprd12.prod.outlook.com (10.172.78.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Wed, 17 May 2017 14:20:57 +0000 From: Yazen Ghannam To: CC: , , , , , Yazen Ghannam Subject: [PATCH] x86/ACPI/cstate: Allow ACPI C1 FFH MWAIT use on AMD systems Date: Wed, 17 May 2017 09:20:19 -0500 Message-ID: <1495030819-4347-1-git-send-email-Yazen.Ghannam@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR12CA0051.namprd12.prod.outlook.com (10.175.83.141) To CY4PR1201MB0134.namprd12.prod.outlook.com (10.172.78.16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7ce3d706-04bc-40e4-591e-08d49d2fefe9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:CY4PR1201MB0134; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0134; 3:JT0M5KjwAyRLhkP51yAweAcwb3UGmV1YgCr4hECCqfEhVf31bxPpFXUpWZTZZ99fFl3LTWywmlUDULwOn+vnqlzaUTHFZ48+1bdQjnl6DLDDFW4z2Ft2U/PnnsL1eixtakLAh7BpAXLASR0mafhDkduNoa1Mrbgdskk9o3Brh7IIJQimu1k7s114rnC8mBC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PIBQezLf5TXZfdVtG1Eq7cftKb/f+yM1tCLveeovubPHNskxYtHXlCPk5EUxvF48NUw/PBO8GzmwwF3QXYpfUMoZiTpAGj9hFJ7WRCAt7KyDRDZvF4QnSBUtIs/XUxpDPnXiySRpWNS5ievUxBZRjZdJuMSeZNKJFZHoioXGWk+lkwdj9yo7mJ0uZywoDPnafWwZohUeIIaSZfWuasJ8wTjHc3ZPBalfPOS7SoRZkAtNp3abhnCdza/uyDk02PhC/GxZxA698wRA+kM0500/3RAxrJZd1/gnHm3x4H7ZUVR9PZ1iO/T5Fu3TXzt1Hjoix2VEgNsrhT4R+8Jzg57CX5EFfgEb8aNbOwMAdMw1c8XlUjwEBq2WwaWddbd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123555025)(20161123558100)(20161123564025)(6072148); SRVR:CY4PR1201MB0134; BCL:0; PCL:0; RULEID:; SRVR:CY4PR1201MB0134; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0134; 4:k4j02q3Su9o1xmj0aYsqHNZeqP5AQ9ms0XJaD0dsneQscYR+RQjnbSckWkGyT5OSdvefq4/uWWoiMMwTiBaEnAZuxwNAXTykm9nhLl2q6GDvyveQnbFguBuoCQfcwe6fhZHF84NzwxSn16jBJ8KWL9TqZUcmKkrfv4+SrccUKiuSGdirbtCt1TAdbgG3rnaMO04G5S3mQJqUO450ou9mctPXA9DTnumdLWu5bQiyOnYX5tQp8cGKJwB3WeEzof8gabT4j3/T4qONq2Wi97hkgrV9K78JAxf24PTGobA9OHJk3A6HgMJ7IWzCHXJ4Qw47X1+1IurD5cOFV4KVCgmwdFDcJUedeQSg5mM6TWDYyhRP65uEBADCxkJ1J1k74FYNnNEhNrPZ21jpgp16v9lKpreoWpueRNJ+HfzNvGKzbk5zPhjwVLcii9bZ7tp4E1YE1UAhbJq0+VsiGFO5a7bMjdscB9jMBKxfXlB3AYrRLl8J4dJ126F1mTZMuQrGWK/5XewZqGQpT6WxP/aJrr6EuagRRZ/9pNn6vgNGTG3HF9Xfbdf0X49mVB0oBc2hPLHKPCDNOujJh4D6UH69LKM+oUFNoRIfn5GveavRiFSJpVJzKfHFZJRXCysbvr0mxBACIjuIlsK3Vvxq2enh6BHxc5TtfOjQoAWzPHXUpYR4plIMrUU+C0fZLbhho/aB2/CFeFKVm+g8GiOi2a2B/U5CRobhCm4xchc65AsHxyB/bIZoFucZ92OriC5r/LsoVetoeWdivgNpA6k1KVsGGEmj1eQgtTVsWwanbcCwCQkc/Eg8o2B2R1EIEF8vl5VIPOK6urihUNDNLSxhefMYTSAtcg== X-Forefront-PRVS: 0310C78181 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(3846002)(48376002)(50466002)(305945005)(8676002)(7736002)(47776003)(6916009)(6666003)(110136004)(189998001)(53936002)(6486002)(54906002)(38730400002)(86362001)(42186005)(81166006)(2351001)(5003940100001)(5660300001)(53416004)(25786009)(66066001)(50986999)(72206003)(50226002)(2906002)(36756003)(478600001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0134; H:yaz-diesel.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR1201MB0134; 23:UPlrvdNDrHkuwnA9xr5GqzEuCfSRPvkVn/iGMmZ?= =?us-ascii?Q?OsViZboFTchFP67ADpVAAQyODDP7heEpXZgnXIy3h0UaXoMHVEHUHjs1U8ff?= =?us-ascii?Q?E4pbTsCB9mPVdVaFIvnOyUkMRl8I9u8vKPS+f+TTefhNzUZxZPbnSV1W1NNC?= =?us-ascii?Q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YR2T8aLep+LdyR+0i2j8EnAQUCJgBbnx0jhtA8Z81zPOhA/qo10CJ1NsJo3o0P2mEQpa/Xriob/ijR1SfWNoedNLpoEg1+1QQENIpI5RCGOMiMOpVvw7BxpkTRelKNP8A/qhnMmIBe1DNp1ssZwzOfJ038RGDk4DibuiG5bN/C4sD2CGsPgnqlW7dPOIm5FmhnaWFLMnLTbSNKbVt1pKoKEURITqnJ4koQ==; 20:8DuLqt/xuQ32Az3Lo3KS9Qg5870ImBOuqeeENqzAKWqn7c5s3rm4NNAe5JDuIliwSpXOv95ZO2M+16JSeKnnWLOsIEC5oWYIZrugRpqzM0VabEoVPJPiziyUVzmZtLMx35PFSfxbdVrkjXm0APZrnToQZYXbbuta0G2g4koD4EF86ChmouDaAqoigbGMo+YQ6LVsB3Z5bnwz4TzUIe7dtrg6thgzClE4VRvaG2X2ib6fm+4gIICOrpxnPvp/4eac X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2017 14:20:57.6200 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0134 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yazen Ghannam AMD systems support the Monitor/Mwait instructions and these can be used for ACPI C1 in the same way as on Intel systems, with appropriate BIOS support. Allow ffh_cstate_init() to succeed on AMD systems and make the Cstate description vendor-agnostic. Signed-off-by: Yazen Ghannam --- arch/x86/kernel/acpi/cstate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 8a908ae..4c5dd5d 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c @@ -109,7 +109,7 @@ static long acpi_processor_ffh_cstate_probe_cpu(void *_cx) cx->type); } snprintf(cx->desc, - ACPI_CX_DESC_LEN, "ACPI FFH INTEL MWAIT 0x%x", + ACPI_CX_DESC_LEN, "ACPI FFH X86 MWAIT 0x%x", cx->address); out: return retval; @@ -169,7 +169,8 @@ static int __init ffh_cstate_init(void) { struct cpuinfo_x86 *c = &boot_cpu_data; - if (c->x86_vendor != X86_VENDOR_INTEL) + if (c->x86_vendor != X86_VENDOR_INTEL && + c->x86_vendor != X86_VENDOR_AMD) return -1; cpu_cstate_entry = alloc_percpu(struct cstate_entry);