Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4639033rwd; Tue, 23 May 2023 10:14:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uQnf6wFjQB3m3DpS37iTveAQI7jdOFi0n3ggiLCoF9KyUeOIHBqfClex1Wsw9gmYjyhjY X-Received: by 2002:a05:6a20:4282:b0:10c:6:61d1 with SMTP id o2-20020a056a20428200b0010c000661d1mr6413413pzj.39.1684862062133; Tue, 23 May 2023 10:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684862062; cv=none; d=google.com; s=arc-20160816; b=ArlhXF5W8ydk9WCHdDIQUx9paCgz1kA+7xTG6I51gxHqHdZEYvtdkzsMgtEklZCfT1 wdkTj4DkMP2yEIKkts1X+brXC/NMYiCfkLqsbYDDjpUWRxdtDgl6S4MXxIl/8tvOX6n7 AOdbsoo10qze8TaOLYqmqqEv4gsIasS4GVS3ZOyg0H18/UmJqUY6JtbTWShTFsYsLVAc PAMlHNWHS/5oUQsvosSM59uK/KWaW3UvpkKssV1B83Akb6avmQE9Azv20GzMeKIdWX7k kbjKmvzimhUWq8Jf91/mraODZz3bi8i6cuGWBDtENs1RY8eZvyJ+tTNl8vxlxa3t/9ly kjPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=nlYPkHwB+DWb5+6yWiU1AHc/pwUd+wHpmPBlr9c2OVo=; b=Urw+/KZiWPhKShKvCwO5cueeB6q+XG0J6JqncdfhADrRJWOqwC30s0RPEJRMzOduug HJtiqYfrHuL4pPB+RlAnp3kYA9P218dZ9n3eYStqU+g2BNzhaSgjuyVAp/5PAT9Lluks HN8iOBmCEZxZWQ+2DgmZfR541GfOgPr1z8GxLbAkR43E8hgzCUxffW6Md9tW4XqjIG4h ZW0eVVqmrWsEhVUEoAd+lqO9sJddmIstrXEI6u5oU9DavSWwNMBHIfYhexX2LaHBeFZ7 nR8WrHk/U93nNWDYeWGqAKQ/gcAs3RwIDDZ4J5L4l8ssdeMxSPUN+DLb1MXU8Qwa66V6 eoLA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020aa796ab000000b00625559a78a2si1446591pfk.107.2023.05.23.10.14.06; Tue, 23 May 2023 10:14:22 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237822AbjEWQt1 (ORCPT + 99 others); Tue, 23 May 2023 12:49:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233485AbjEWQt0 (ORCPT ); Tue, 23 May 2023 12:49:26 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0418E5 for ; Tue, 23 May 2023 09:49:25 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id c4f33e1d-f989-11ed-b3cf-005056bd6ce9; Tue, 23 May 2023 19:49:23 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Tue, 23 May 2023 19:49:22 +0300 To: Mario Limonciello Cc: rafael@kernel.org, hdegoede@redhat.com, linus.walleij@linaro.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, Shyam-sundar.S-k@amd.com, Basavaraj.Natikar@amd.com Subject: Re: [PATCH v2 2/4] ACPI: x86: Add pm_debug_messages for LPS0 _DSM state tracking Message-ID: References: <20230522200033.2605-1-mario.limonciello@amd.com> <20230522200033.2605-2-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230522200033.2605-2-mario.limonciello@amd.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, May 22, 2023 at 03:00:31PM -0500, Mario Limonciello kirjoitti: > Enabling debugging messages for the state requires turning on dynamic > debugging for the file. To make it more accessible, use > `pm_debug_messages` and clearer strings for what is happening. ... > + switch (state) { > + case ACPI_LPS0_SCREEN_OFF: > + return "screen off"; > + case ACPI_LPS0_SCREEN_ON: > + return "screen on"; > + case ACPI_LPS0_ENTRY: > + return "lps0 entry"; > + case ACPI_LPS0_EXIT: > + return "lps0 exit"; > + case ACPI_LPS0_MS_ENTRY: > + return "lps0 ms entry"; > + case ACPI_LPS0_MS_EXIT: > + return "lps0 ms exit"; No default? > + } ... > + switch (state) { > + case ACPI_LPS0_SCREEN_ON_AMD: > + return "screen on"; > + case ACPI_LPS0_SCREEN_OFF_AMD: > + return "screen off"; > + case ACPI_LPS0_ENTRY_AMD: > + return "lps0 entry"; > + case ACPI_LPS0_EXIT_AMD: > + return "lps0 exit"; > + } > + } > + > + return "unknown"; Make it default in each switch-case. That way we might have an option to alter them if needed. ... > - acpi_handle_debug(lps0_device_handle, "_DSM function %u evaluation %s\n", > - func, out_obj ? "successful" : "failed"); > + lps0_dsm_state = func; > + if (pm_debug_messages_on) { > + acpi_handle_info(lps0_device_handle, > + "%s transitioned to state %s\n", > + out_obj ? "Successfully" : "Failed to", > + acpi_sleep_dsm_state_to_str(lps0_dsm_state)); > + } Can we keep the original choice (i.e. ? "successful" : "failed"); ) unmodified? The rationale is that we migh add something like str_successful_failed() to the string_helpers.h for wider use and common standardization. -- With Best Regards, Andy Shevchenko