Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1591698rwi; Mon, 31 Oct 2022 19:33:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6C9lH7A4weEgGNhUQk0+U8rC+dq48jPNxuGMKxFuTGq47NAPKFweyirUQsVixBl5J3Soo4 X-Received: by 2002:a17:906:4795:b0:794:8b93:2e43 with SMTP id cw21-20020a170906479500b007948b932e43mr16178556ejc.184.1667270023663; Mon, 31 Oct 2022 19:33:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667270023; cv=pass; d=google.com; s=arc-20160816; b=AB6ZktwsSmMtYM6dOYQQ2Jz2bqL4MDbLPerr7fSxutFacrY+kuTBcLEw4ImDbMEZbj 7bte4h+dIy+46X8cutBCs1gpNlH8WQ+HviVzirSNBYsKExsORbu+ZnPn+YpntEmmaWA7 JQnSheR1n4FR35McD8gTVm/gQUw8CoqtatdkBRDjkbOdbgGudfG4QEKrHLB03vgLt8Ig EnLIt/D0ikeGY+Z4KKCE2dGXw8eXMF/XMzOyMIIRbP+Yhl8iCO7gzQMPI8sP02TK7PB7 CeGoS522lSalU2E76CbLLZKKwEllNz0MAmrSKEVqZ0UYwsnjZZwPaW+Bf4x2TiwBaj31 BfBA== 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=uS5BYMz6nYGNLLKT4plkApeySoXK3XmRUeGaozOFktA=; b=aJ9nLsCPXqyhuc8q8Dqr8z7ejJgVdhbJPtTborSj7moOdJ/xwH593PqMukClNBOoKI R87meKNyYRfigtzyjfuWfAymJm9Qo9Z/pHJnn+Uvuqf2115WAVBfnhdegzqqYOTMHnMk iBQcg4aYSsRknHx/6mRYtCMQp1IzISkJJPDJtKDq/akIaZdFevSKohZTFC3JAuXYTh+C 8fu6BHYzXAtoiacaHQFksmXQIGH1+qcU8xn8eGJwffM06v4VuFHGCzdnV2ADksFskh1i SPbj+HDmEPdlxsZhNJryoppZH2H4Dv953YvxUo3cNU0yUNGNOyg3yZd9msFYZAisCj74 KDnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Q6931j84; 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 s15-20020a056402520f00b0045907cec72dsi11709672edd.320.2022.10.31.19.33.20; Mon, 31 Oct 2022 19:33:43 -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=Q6931j84; 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 S229958AbiKAB6p (ORCPT + 97 others); Mon, 31 Oct 2022 21:58:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbiKAB6e (ORCPT ); Mon, 31 Oct 2022 21:58:34 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2063.outbound.protection.outlook.com [40.107.94.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE79BCD6; Mon, 31 Oct 2022 18:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jzLyKARa8I4m/+KXqm1jUF2V8tD5mMFn9W4LRbqIFSrBaSD4dHKgXeTwKe4gMeWN9KRp0ul2KENOJdtk7JVyPld2wwj46NAqqrvg+i5y/uINdsE0Me55/FjyIYMkVSGez52aersHaYmv/Q2l04d7ZRCcBg5aeU+mzin8AaV2j/aVDB8OAMCEYr/iQ7RFOlNT5nelNgMBmtStaBtgG6hQzOSQGFrslPX88RprYloIVUi4y67v4S/5SG0Yk/ZVH6mAOG/CzSkvHBGhsUsAXb+Lqo8xXT3i43KbsvLN12nNtzTqy+1X/vOD3iptSiO7vJDnXtGpy13Q2FGD2KkfTaypxQ== 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=uS5BYMz6nYGNLLKT4plkApeySoXK3XmRUeGaozOFktA=; b=X/FEn5C8bR99p+VnEa0VVbECB2p+TFHoBzxXTfsv6TJTFCSzREpDTYCTtIXSOfOAV0/jomdfu3Z00/2V6f0fcACQdScAtCMO7CMVTFn0ueyzQf7rZLimKSk8LP3FWgJGwgLIDAivuCV1AXaaXRzw7gtPaDnGgyjPjvUDAwevMcxpFqh9erK+8fKOcoHNI5oinvTvoLLriYVQ3CQGqBPeG6fP+TxI23Ci9GIe//W5pYGFTTDSRymaxELOqgSEQ3q2gy+IKSg5hq47NOxxD+gFIGl0jOzQRM1MSgZ/k+Qpqa3Vd4AQzVSaZZs8QM9Cf2LHleYsyq6AGLzvIuY7j7IQRA== 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=uS5BYMz6nYGNLLKT4plkApeySoXK3XmRUeGaozOFktA=; b=Q6931j84R7Y/Q4WLrnGdeLY1R81b0m0Xg4OBDfsv47YzZPlDheDOshuCnpbKYkHLEJCNxY4G3jRwgfZlcfrFbGVX0sJotJmyQ5JU5ofKzE2OM120OR/sOQ903zQJv7ku30HM7uabhmKOE2yu7fNVUOp+oXA0Y+3c7ERLHsNNE1k= 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 DM4PR12MB5819.namprd12.prod.outlook.com (2603:10b6:8:63::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Tue, 1 Nov 2022 01:58:31 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::f8c0:db03:2d30:792c]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::f8c0:db03:2d30:792c%3]) with mapi id 15.20.5769.016; Tue, 1 Nov 2022 01:58:31 +0000 Message-ID: Date: Mon, 31 Oct 2022 20:58:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1] platform/x86: intel_pmc_core: promote S0ix failure warn() to WARN() Content-Language: en-US To: Sven van Ashbrook Cc: Rajneesh Bhardwaj , Hans de Goede , LKML , "S-k, Shyam-sundar" , "rrangel@chromium.org" , "platform-driver-x86@vger.kernel.org" , Rajneesh Bhardwaj , Rafael J Wysocki , Rajat Jain , David E Box , Mark Gross References: <20221027151908.v1.1.I295e65357f06f162b46ea6fc6c03be37e3978bdc@changeid> <4b7304c0-8dd5-9add-7c84-4e9f0aa9396b@redhat.com> From: Mario Limonciello In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DS7PR03CA0124.namprd03.prod.outlook.com (2603:10b6:5:3b4::9) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|DM4PR12MB5819:EE_ X-MS-Office365-Filtering-Correlation-Id: 941d4a2a-f9dc-4d61-3ea0-08dabbac937a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BNepRADZ5p4biUUw/WQ9cZYpBGuQywC/h3DjYzZ5I74Hf0BjFDzISNk6QaaG+J11qziaxJaPrzRUW7eCMPGKnrQAnAGUD3p4b5u5pcTUtFYIZWP8SzuoaWUm+oobTb6EUlDjY/RB8aHAc9pDmhOyGbIhd46QYIZ83Pi3LAbiCgQH0VDQUj89kDDnY5pzmkiT0vG2yBg3s7ouEGiuCuUTWuE03E4yAuff2ywvPeWkXqCfLtjAi4B1o/AVVNUHycD37BCB4gQsdotglEZwsb4Phd3AJ1pOFR4/fURNk6gyR8L39/PgjQjWpnA/TSwErqODoRiz/dYjsqg4xtG9mQo8fDAE2FhBrdr23DqTJIAGIcDo5QVcHxPDYTsgcpRgGyya5W6JpDy/qTGBX7IYIGS7/PPPA6UsF4h4rAHyVn0Gtn1rYbHqibuI9ALKGDtVFB6QjOZ/nie6nAXDBM4e9B7cJuFZPclzY9WGDVZRSeV0Jyv+gy46WUML05cJv0oi3jrFzHykju86GhWSprcFxb9dGmRg+KgwS1V84h3Pk6o3os2VaUGll7D6P71wVDQlq3X+ZBTuVwZ5+F+C9AQyfjBFDq+eOI0phZpZcSWYZCilFomMZTRDGrhIAJ4Do2Ohbdhos6NksiJbKv38LChUHDCO3yxZKidPQtxzOU/rZ+kDvEfUcSm5Uhce8wbQc4Z9HexvKykfZzYpkOR1h8fjs7MCs9whJGTC6GpnTfNcaCYWrXxed6PX8yRtFVdzVwO+6emTxp9lC6U9Bg3blxPcZNMqSQvpaEnyvqbL3eU8Yw3hzzSPLSjBjm+woWvzXOS8xp9RIuVQwxWTiilAVUxLrVXBTw== 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:(13230022)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(451199015)(6512007)(6666004)(53546011)(2616005)(6506007)(83380400001)(478600001)(186003)(44832011)(2906002)(6916009)(6486002)(54906003)(66946007)(8936002)(7416002)(66556008)(5660300002)(66476007)(4326008)(8676002)(41300700001)(316002)(66899015)(86362001)(31696002)(36756003)(38100700002)(31686004)(32563001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cDg0TFRTL3RxOXJack4yb09oL2sxYjJPT3ZoOVIrNHVGdEpPK2p6SkVhQStt?= =?utf-8?B?YWdyTDV6a0txNU1XWk9XckxOZDEzWXpHblExNDZmZnhQOWRGK0FIN2ZMVUR2?= =?utf-8?B?NFF6cHhoRWc4dnM5Wnh4dm4xN0JobThPVXZ5ZnpqbmFwM3NLSzZIRE44VzRH?= =?utf-8?B?MmROdm9aWCtjcXZPemw5b1IvZUF5bGVZSFFoQ1dBbytwNytUOGJ6MXJ3Y3ZQ?= =?utf-8?B?TUEweTlSRUJxRmlUTVJUcWlGOFA4YmhLS1Z5ODR1M0lPQ3IweHNUNGZJUlRi?= =?utf-8?B?ZlYzbUtINE16NTl4TlhDRHZ2dGpJODUwaUE1bVZhTUlXOTJZRnBk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QlVleXBDVGR4YUpBU1JzMy9EaEhWL0U5ZDFXa2hr?= =?utf-8?Q?OjmEOaCb8P2ACT3JIU1ycwv1Zj74c45g/bVEln6wWzZs?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 941d4a2a-f9dc-4d61-3ea0-08dabbac937a X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2022 01:58:31.0471 (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: 2QugXSU+Mn1BhdbH30+hMoCp56mCR5N4o9PlPB5dwak/igdnH9Ng4clFpMA0fya6mfTZy848ZuazDpwrslvjmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5819 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 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 10/31/22 20:38, Sven van Ashbrook wrote: > On Mon, Oct 31, 2022 at 3:39 PM Limonciello, Mario > wrote: >> >> Just thinking about it a little bit more, it could be a lot nicer to have something like: >> >> /sys/power/suspend_stats/last_hw_deepest_state > > While I agree that reporting through a framework is generally better > than getting infrastructure to grep for specific strings, I believe > that a simple sysfs file is probably too simplistic. > > 1. We need more sophisticated reporting than just last_hw_deepest_state: > > - sometimes the system enters the deep state we want, yet after a > while moves back up and gets "stuck" in an intermediate state (below > S0). Or, the system enters the deep state we want, but moves back to > S0 after a time without apparent reason. These platform-dependent > failures are not so easily describable in a generic framework. I actually thought that by putting the duration of time put in last_hw_deepest_state you'll be able to catch this by comparing the duration of the suspend to the duration of last_hw_deepest_state. If you're below some threshold of percent for suspends that are at least some other threshold long you can trigger the failure. This then lets you tune your framework to find the right place for those thresholds too without needing to change the kernel. > > - ChromeOS in particular has multiple independent S0ix / S3 / s2idle > failure report sources. We have the kernel warning above; also our > Embedded Controller monitors suspend failure cases which the simple > kernel warning cannot catch, reported through a separate WARN_ONCE(). > > 2. A simple sysfs file will need to be polled by the infrastructure > after every suspend; it would be preferable to have some signal or > callback which the infrastructure could register itself with. The interface to trigger a suspend is writing a value into /sys/power/state. You'll get a return code from this, but this return code does not represent whether you got to the deepest state, just whether the suspend succeeded or not. So what would an ideal interface that sends a signal that the last "successful" suspend didn't get to the deepest state look like to you? > > The generic infrastructure to support this sounds like quite a bit of > work, and for what gain? Compared to simply matching a log string and > sending the whole dmesg if there's a match. I would like to think it's cheaper to read the sysfs file, do a local comparison on HW deepest time to the suspend time and then only send the the dmesg up for further analysis. > > Is the light worth the candle? I wrote an RFC that I sent out for it with my ideas at least.