From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83091C2B9F4 for ; Thu, 17 Jun 2021 18:28:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F310613DF for ; Thu, 17 Jun 2021 18:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232184AbhFQSbB (ORCPT ); Thu, 17 Jun 2021 14:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231547AbhFQSbB (ORCPT ); Thu, 17 Jun 2021 14:31:01 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 034D5C061574 for ; Thu, 17 Jun 2021 11:28:53 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id gt18so11548682ejc.11 for ; Thu, 17 Jun 2021 11:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1ukYDH8l86ZtCuh9VXyQHQvq9HK7Dq55KqG98CYPGfc=; b=pHWIJxR2Y9kiD6+8Ayqkox9rCkjc1uKT1O5h5b8n9NjaAOtSotBeZKY3zijAyFtyoW j4AS7/TC9JV3Ktl1TvzSVwU+T+iUaWoUJOvMfGDJRXSsiGfV6Cdbojw2Nfw2xGYGu+EZ acD3xg349jsu+6Br2XqnEqVcQZKPL1RxkH02aIeNy7dBW7o37o7+E0aqcMMTcVHZAQHM 1W/hYFIKC9l1AQ2AXKKRUFjtfzhG4bZvgjIR859jX23jg9nR6viVwuk8yI7xpSOTfCMx UOsXnk8i171fGVmg9FNIexKhujtPFaOPZ076w9h8cUBioGwZGFu30usCBdcCtJCtk6uF nb3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1ukYDH8l86ZtCuh9VXyQHQvq9HK7Dq55KqG98CYPGfc=; b=k+ALRFQ6+KdDbskWyuCx1q/pt/Pvllf8MVeeZHsdoa487UpDlXCvX6nIX0oVFlFs9k xx4UUK/ll+ZXQbuLzuGvhvwmrFBWDq6X5pfZ/1/SREPQAlfrQ+Zu0/o6d219oxbe37/r 8WZTCnSzwDy9riFITw9Nu8pAtDGrVLT+LHDnidJnYWxkoEYsvpHSO++Sho9zpN2+yjAW FUaURB5axgQ9152pT90i+w+ZyBmZdZ8JyQ/cW729sLzcog2L5OqkDz+J84tozwYKrUSo Wax+imXI3bMULdkuZ73op3DC+xMu5AaJ+uYaCtOMiRrIC26APFLMJfMUhQhXn/d19cmq aZxA== X-Gm-Message-State: AOAM532Whlh6xjJUAck9oTq/Mhp5CHSwEuJRlh2o/Q35qxoa0m6yXncj 2blSryb6jP3d+kRpdtZMfbU= X-Google-Smtp-Source: ABdhPJz6KolF2vgbJUVXqbzSOil/mnaKB5WdwGUzDd67++YdhVXEUT+1VrHtITZmylRVg79nNYcv9w== X-Received: by 2002:a17:906:b6c5:: with SMTP id ec5mr6705485ejb.290.1623954531626; Thu, 17 Jun 2021 11:28:51 -0700 (PDT) Received: from ?IPv6:2a02:908:1984:a6c0::47cb? ([2a02:908:1984:a6c0::47cb]) by smtp.gmail.com with ESMTPSA id t8sm4167877eju.14.2021.06.17.11.28.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Jun 2021 11:28:51 -0700 (PDT) Subject: Re: [PATCH 5/5] ACPI: PM: Adjust behavior for field problems on AMD systems To: Mario Limonciello , "Rafael J . Wysocki" , Len Brown , linux-acpi@vger.kernel.org Cc: teohhanhui@gmail.com, Shyam-sundar.S-k@amd.com References: <20210617164212.584-1-mario.limonciello@amd.com> <20210617164212.584-5-mario.limonciello@amd.com> From: Julian Sikorski Message-ID: Date: Thu, 17 Jun 2021 20:28:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210617164212.584-5-mario.limonciello@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org W dniu 17.06.2021 o 18:42, Mario Limonciello pisze: > Some AMD Systems with uPEP _HID AMD004/AMDI005 have an off by one bug > in their function mask return. This means that they will call entrance > but not exit for matching functions. > > Other AMD systems with this HID should use the Microsoft generic UUID. > > AMD systems with uPEP HID AMDI006 should be using the Microsoft method. > > Signed-off-by: Mario Limonciello > --- > drivers/acpi/x86/s2idle.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c > index 3f2a90648ec9..816bf2c34b7a 100644 > --- a/drivers/acpi/x86/s2idle.c > +++ b/drivers/acpi/x86/s2idle.c > @@ -371,12 +371,27 @@ static int lps0_device_attach(struct acpi_device *adev, > return 0; > > if (acpi_s2idle_vendor_amd()) { > + /* AMD0004, AMDI0005: > + * - Should use rev_id 0x0 > + * - function mask > 0x3: Should use AMD method, but has off by one bug > + * - function mask = 0x3: Should use Microsoft method > + * AMDI0006: > + * - should use rev_id 0x0 > + * - function mask = 0x3: Should use Microsoft method > + */ > + const char *hid = acpi_device_hid(adev); > rev_id = 0; > lps0_dsm_func_mask = validate_dsm(adev->handle, > ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); > lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle, > ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id, > &lps0_dsm_guid_microsoft); > + if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") || > + !strcmp(hid, "AMDI0005"))) { > + lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; > + acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", > + ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); > + } > } else { > rev_id = 1; > lps0_dsm_func_mask = validate_dsm(adev->handle, > Tested-by: Julian Sikorski