Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4141703rwe; Tue, 30 Aug 2022 05:28:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR6D9GBemPQN7+ldomvltgvJbqKbXbf9FsFcMvjx/hDz59fCgF45eSd8Ja3sUpl5dhshBop9 X-Received: by 2002:a05:6a00:2395:b0:536:8296:51d5 with SMTP id f21-20020a056a00239500b00536829651d5mr21396549pfc.84.1661862512659; Tue, 30 Aug 2022 05:28:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661862512; cv=pass; d=google.com; s=arc-20160816; b=vrDCzdJuzpV/3+znN6Y1/g2zk08q4Lw8TQ6gTnPGtZ5IUfjOVOjVQ4IJkx09Mwqlcm jsFJB61LEd80IqvjV0d8SYBxpOh874MfVw6szQYnGQ6kPqizVV+pPYmzounBqumjYJTj tBpPTBtS9oWKPJDqQsSWLWifjdq4HMcacTFeCN8lhb1QHQle1p+APNOWr7XAJCJPfFZw CQ6OJXGxVXrC1I/T1V5VzhzsHkeQGmKSVraVH0ukmroGE4AsYH8zILcl6P0r6iJ5+XPF qy89kOMP/lvEXJC/o4Ya1BkY+lmmbizcr2qZwh9OiHe8DvmukWX/+mX7LmqYDCnetFQb U7eA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=UUEyeX0Pa+lr+AKuT4D9J0k+71g5Yxg3eLh1D1YK8iA=; b=ON2wVnbJT6ycXaLMfxbk2emzkfWIUwMbc8o2TZkL6Bf81HdI/NWNECkIjeKi7W0Vmx eu5h4Y70IJG9eYiSyGwc6x7lgieicvYfszNlnHpRjfn58DdhxtD1cuvCAOXZnild00Oo cIedcMuuVXDByVhA/DFZvgjYLON80iTKfdatZv1xjFvzihRlAhcap5COyNHOCFW5BQup JD0Iq1YrRIUuEGlEjnSaxDGLLhd7RvjilG8ILTdeQhKEv6v+xShS0YREL9MUK56G9SWD BgNxR/7EAOoz44YF6+VNrTsBcGBcLNNRV/bsC7TBeE+oIr4WL4MT0nywOZw7077+NQut xYOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="z/SnFvlD"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu14-20020a17090b388e00b001fdb2692f15si8189023pjb.174.2022.08.30.05.28.22; Tue, 30 Aug 2022 05:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="z/SnFvlD"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230394AbiH3LoL (ORCPT + 99 others); Tue, 30 Aug 2022 07:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbiH3Lnp (ORCPT ); Tue, 30 Aug 2022 07:43:45 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C7375C345; Tue, 30 Aug 2022 04:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=buux+e1XW8bupaWBI0dtVWBeFssKw90ewhTpS0195bcec0E489msEtaxKlzc1KBTKWY1vlzkDMSqN1JSUj6bVi+gGpqnlpSCgFKIYbSdpWc6bEdW0VxZf00JWMEQ4nAmLV2dZzoLS/YaLB5e4IUICpo3QBa6PKkVjvs0bCpbEE8hPzkylzwqev6nNSU7UKbMPJaZ3nz/PcoFlloMX2zKlWsV3jgw2AknX/CKEL3o1OBAAJ9J+ZkDwaXY3iVmpQhVwFkufuUYbTWX4KsaQspsmHI9wUIXrZU2J9PQCwfHaLL9ceJChmGNbXHt1KTAPOvdv+H88ZwqcprYd6m30snIMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UUEyeX0Pa+lr+AKuT4D9J0k+71g5Yxg3eLh1D1YK8iA=; b=RWszRB+G10mS5tUUlRB83NUqjR6rnN0qYyfhn0sNBJy5H7bU1EE3a3n6fTUV+hiihYUf5Wb4t4mDXQOlSuur8ezDG37siGQ1nEZVLx0Crvvs/zard+41ewO+fHzQIVop/ie5XAZGLFnfnVGZ+iG21P5rzUzBrosMSm+uotW8+yQzW0OOe7DbEXMd6GcXg6QgTsczzZmL/tGj5sDky8JZhSjguTPfAe5YBj01QUZUdVAMlz29XwYX3WMsDa4FUtld9VJYQgnNJaEZq9EwuBmkVyZ3kxpnyP4EgLvYCd/j0J5XuI8cWSAUgr8iL3R40pCaRQn7Y2mKs+t3xVRx+dPEEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UUEyeX0Pa+lr+AKuT4D9J0k+71g5Yxg3eLh1D1YK8iA=; b=z/SnFvlDZ8bUPIMgkdAX0+H779JwenMHPQ1beCnJTFeCOKBqePMPA4uZ+QTUUygvo3bI6o4YE963vVT04zL73sRUEslxtvUsbO4nXvIfg1p0fvdMDYyHqa9LmT2uCYLwwN3zPTaaMWzuNIFvaptVIwDxPonDP5I6JBcf0owN7s0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by CO6PR12MB5394.namprd12.prod.outlook.com (2603:10b6:5:35f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Tue, 30 Aug 2022 11:42:35 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::e00a:1f8c:dcd1:afc3]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::e00a:1f8c:dcd1:afc3%6]) with mapi id 15.20.5566.021; Tue, 30 Aug 2022 11:42:35 +0000 Message-ID: <88b5f4aa-d238-efb6-82fd-e227c42cc10c@amd.com> Date: Tue, 30 Aug 2022 06:42:33 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v3 1/4] ACPI: s2idle: Add a new ->check() callback for platform_s2idle_ops Content-Language: en-US To: "Rafael J. Wysocki" , Hans de Goede Cc: Len Brown , Pavel Machek , ACPI Devel Maling List , Linux Kernel Mailing List , Linux PM , Shyam-sundar S-k References: <20220829162953.5947-1-mario.limonciello@amd.com> <20220829162953.5947-2-mario.limonciello@amd.com> From: "Limonciello, Mario" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:610:54::25) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2948ce1-05b5-400c-1bd9-08da8a7cbb57 X-MS-TrafficTypeDiagnostic: CO6PR12MB5394:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Eg/krIGECG4ZvD9H0AVvt+I1sligb7bYdWneVW2fHo2cTJEf3Nuu//bmVguyn7qvtWF3JGAL+gwZG+CO/uoTN+GFWjHFsZkD4A7Su2wBBEyhsIht57vyDKjhpu3io3PLdIfTdW27K852IaESukaH7Zc525WWbHiM9DGJSHFYMhCUoWqeruFe4bWNM7xlP8hWLsv1FWDeyVLjt6DCpXjtybihRg6io5ln/VjCx/AwF8IHW6fxahOfgx04Gdx/7Vc+ga9FsSGLfawMdJOuPBuJJHZsVdAK9G/Zh4eVR3PJ7GGqTOHU7CyPvrqWDKYfbPAwTbNh3WJVyqrM24RH6gLVJZtaqv0c4wL0IDhMip885bqQbBprTub2Jmg0VLN8UfSKCyn7+0xWfvKTl1KXwkQyPqkzpW7UpJo05zkouz/gBAKQ9E2cAousbE+L5nJ0qHzfhW7OGiBaMtGtUEo6z92k/a7ygX121wE5t7osBUGsb86QMjJQnVCwMXd4LGjD8ra2OSuq7Urq2RbVt0DsNgpzyWhzhJq/k670O3rmVyudSycHmMLSWKKR7Pl5r+B6Y9XXgjrlfqAltAzzt7heNc55ju8tk/Hp9mIeqjfjsovJr3IHTRohSoWYFdXMoV1OwbdbA9iOfM0d3QdRFFFgK92sqqvvT0iSI3QYNGCgDdl8jLd7aN/Q+FiJ011M2tOzKvFmWUVOF6oUJxkK15olah+vMiRYsyKwZp49iav9/BrNAaxM4RjZXJ7oHQzDRFsAZaZOXWNfGxBeLzcQrAGvVWDcrzUlOvjZ0Te7Z+mONBKxs0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(366004)(396003)(376002)(39860400002)(346002)(478600001)(6512007)(26005)(6506007)(66476007)(83380400001)(53546011)(186003)(41300700001)(6486002)(5660300002)(316002)(54906003)(2616005)(110136005)(2906002)(4326008)(66556008)(66946007)(8936002)(8676002)(36756003)(86362001)(31696002)(31686004)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RlFtbDcrNmF3a0xudU5uYkFtMXdCZEx6Y2NDMytiRklxdDdVY2cvdTJsVUE4?= =?utf-8?B?Z2xSaXJiNkNOVHVncks2VHkybDJlL1pPVWtLSWx0cGE2U0p0dUF3Yk5hWExl?= =?utf-8?B?cmUwR0VITTRDdy8yaVgzY3pNNVRIUDRXemNJVHN0N1RwQjdWS3Q5Qkc3dGxW?= =?utf-8?B?bTRtVnc2WlFGaTJjZ1NXQjN1ODhpZUtJdWo3TStyb01oeittV2lnU1M4ZUhk?= =?utf-8?B?YURmM3lLWUxWeXBjaDVvU2FJUENmZXpmcE5iWUZjUldNZng2SkVoUGZTeFlW?= =?utf-8?B?Q2dCQlp4YzRvQmZJTGQzeHlJNFZmY3ZuSWZvQ1BYRUxnQ1BRMHVVU0dmQjFZ?= =?utf-8?B?MjFHRmlvWjRjbGZiY1hvV1Ntc1MxazRjRXJhRzI4MnZBMTNxTDVNblgwbXBp?= =?utf-8?B?cWEySFV2eT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 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2022 11:42:35.1222 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lKjya83vcRhZZI2OeqQYI0N10ycBYz2S8yPHC1gufq1vtnfvB5ai4927GUqF7R4nr/IFE5vpb6QpZEFYP5Ubbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5394 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/2022 06:39, Rafael J. Wysocki wrote: > On Mon, Aug 29, 2022 at 6:29 PM Mario Limonciello > wrote: >> >> On some platforms it is found that Linux more aggressively enters s2idle >> than Windows enters Modern Standby and this uncovers some synchronization >> issues for the platform. To aid in debugging this class of problems in >> the future, add support for an extra optional callback intended for >> drivers to emit extra debugging. >> >> Signed-off-by: Mario Limonciello > > Acked-by: Rafael J. Wysocki > > and I'm assuming that this is for Hans. Thanks, and yeah I think it makes more sense for this to go through platform-x86. > >> --- >> v2->v3: >> * Rename to *check >> v1->v2: >> * Add a prototype for `acpi_s2idle_enter` >> >> drivers/acpi/sleep.h | 1 + >> drivers/acpi/x86/s2idle.c | 14 ++++++++++++++ >> include/linux/acpi.h | 1 + >> include/linux/suspend.h | 1 + >> kernel/power/suspend.c | 3 +++ >> 5 files changed, 20 insertions(+) >> >> diff --git a/drivers/acpi/sleep.h b/drivers/acpi/sleep.h >> index 7fe41ee489d6..d960a238be4e 100644 >> --- a/drivers/acpi/sleep.h >> +++ b/drivers/acpi/sleep.h >> @@ -18,6 +18,7 @@ static inline acpi_status acpi_set_waking_vector(u32 wakeup_address) >> extern int acpi_s2idle_begin(void); >> extern int acpi_s2idle_prepare(void); >> extern int acpi_s2idle_prepare_late(void); >> +extern void acpi_s2idle_check(void); >> extern bool acpi_s2idle_wake(void); >> extern void acpi_s2idle_restore_early(void); >> extern void acpi_s2idle_restore(void); >> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c >> index f9ac12b778e6..474aa46f82f6 100644 >> --- a/drivers/acpi/x86/s2idle.c >> +++ b/drivers/acpi/x86/s2idle.c >> @@ -486,6 +486,19 @@ int acpi_s2idle_prepare_late(void) >> return 0; >> } >> >> +void acpi_s2idle_check(void) >> +{ >> + struct acpi_s2idle_dev_ops *handler; >> + >> + if (!lps0_device_handle || sleep_no_lps0) >> + return; >> + >> + list_for_each_entry(handler, &lps0_s2idle_devops_head, list_node) { >> + if (handler->check) >> + handler->check(); >> + } >> +} >> + >> void acpi_s2idle_restore_early(void) >> { >> struct acpi_s2idle_dev_ops *handler; >> @@ -527,6 +540,7 @@ static const struct platform_s2idle_ops acpi_s2idle_ops_lps0 = { >> .begin = acpi_s2idle_begin, >> .prepare = acpi_s2idle_prepare, >> .prepare_late = acpi_s2idle_prepare_late, >> + .check = acpi_s2idle_check, >> .wake = acpi_s2idle_wake, >> .restore_early = acpi_s2idle_restore_early, >> .restore = acpi_s2idle_restore, >> diff --git a/include/linux/acpi.h b/include/linux/acpi.h >> index 6f64b2f3dc54..acaa2ddc067d 100644 >> --- a/include/linux/acpi.h >> +++ b/include/linux/acpi.h >> @@ -1075,6 +1075,7 @@ acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state, >> struct acpi_s2idle_dev_ops { >> struct list_head list_node; >> void (*prepare)(void); >> + void (*check)(void); >> void (*restore)(void); >> }; >> int acpi_register_lps0_dev(struct acpi_s2idle_dev_ops *arg); >> diff --git a/include/linux/suspend.h b/include/linux/suspend.h >> index 70f2921e2e70..03ed42ed2c7f 100644 >> --- a/include/linux/suspend.h >> +++ b/include/linux/suspend.h >> @@ -191,6 +191,7 @@ struct platform_s2idle_ops { >> int (*begin)(void); >> int (*prepare)(void); >> int (*prepare_late)(void); >> + void (*check)(void); >> bool (*wake)(void); >> void (*restore_early)(void); >> void (*restore)(void); >> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c >> index 827075944d28..c6272d466e58 100644 >> --- a/kernel/power/suspend.c >> +++ b/kernel/power/suspend.c >> @@ -136,6 +136,9 @@ static void s2idle_loop(void) >> break; >> } >> >> + if (s2idle_ops && s2idle_ops->check) >> + s2idle_ops->check(); >> + >> s2idle_enter(); >> } >> >> -- >> 2.34.1 >>