From patchwork Tue Feb 21 18:06:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 60195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp151532wrd; Tue, 21 Feb 2023 10:10:20 -0800 (PST) X-Google-Smtp-Source: AK7set/OpHEnC7WUWwewdls2OnqbS5v37q4Bl1hBwjfnceNpHwz1VJiWI3JLSjyH1o1UQADTXIqy X-Received: by 2002:a05:6a20:7343:b0:c7:6f24:7059 with SMTP id v3-20020a056a20734300b000c76f247059mr18209891pzc.17.1677003019914; Tue, 21 Feb 2023 10:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677003019; cv=none; d=google.com; s=arc-20160816; b=YOqIF7agDWfq1eh00HXMRgzKg3Y3swuEBR+NDDvNbGVO6lIr+ZGTxMzG5j9Ye/EREg sm+jiprSKOEmaQ7FAGRJsfDhK+cZPEHYZIltLAMJm0Wp64OECnO68KhUCDtfb0lu3yKe mv6419BwVhtiMZYoVKW3cD2g3jaEgRSacRGmV0Sqdwarkl1n8w+dof+/KhVE/NmzjONV aes+d2b+HfOFVML4UqJwNztJMv4Et7ksR3H1lCriyZc9axlRGJ2gxs4+yQHo7ttFwMIy gczEMgRdpP95ytf0ZAvuDhS8MF416Mf+Usq2Z7ZzoJ7HWJ3WqorK9u9B8LU+r6tXDUsM TIXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jzE7tCtv9nXhTqCLmkAtvvd9XPqHKuG/dItaNXtPrVU=; b=tGby/hBEjd4OfGTvRSBroD6K6hmxXmSsZroJJNOYUm8LnZzIBEmBSA4bECWxHzbX3h /6NN8cdpE1zTr8mmzrWCrWCB/L0fmy7+lK1609HUJh8Y6HlJtD1msMk7XQ+LWS9rRwqB iDcsAa54ylGWelCVJIJRGvznCQ75Hbmmp1VDxcu1ZZcr7kvD72PQ9jixgMX8Sflwr0Xy hlwbfRzW270fm7e5RN8io74ZB+TVOfItC7KHy0ej5mbcZYEkanu1Vpltpg/B9IzlYt+x 75SGNHVNYaoEr8iwDWjcCQO1REroNHdxtdDNqDdW53dRKT6wDEPJZDHNKIMAfyd2TanR IKZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Thv7yiSJ; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g30-20020a63521e000000b0047943945625si7821656pgb.720.2023.02.21.10.10.04; Tue, 21 Feb 2023 10:10:19 -0800 (PST) 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=@linaro.org header.s=google header.b=Thv7yiSJ; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbjBUSIR (ORCPT + 99 others); Tue, 21 Feb 2023 13:08:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230271AbjBUSID (ORCPT ); Tue, 21 Feb 2023 13:08:03 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6AF30295 for ; Tue, 21 Feb 2023 10:07:40 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id t15so5520627wrz.7 for ; Tue, 21 Feb 2023 10:07:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jzE7tCtv9nXhTqCLmkAtvvd9XPqHKuG/dItaNXtPrVU=; b=Thv7yiSJS6LdT+pw2gxqAfpkdidxjv3XmZIyc14lPv8RHnC0hdzHCCjPuekBBiEdAN yXjZemMYp0R3N1qEOanoTIBH7YQeddzDvp6fJC5UT3WQ2by+MV9oIUTnt7LNxgz3kNt7 baNqeqz/cjrZKoQHUXMp2TeieMzhvc3WFZFasKpvUEMzVOplplYlg7+1ZtGEqJF05bO9 3cTnILD76iuRP5mLQCykaMR1LAmID5l2JMk2rCxGwYA9LBXwpGWls6Yjfl/6UrSwFnlA Uh32c7QCHjs+wnZnE7BP90YNDambSpgEvmO+MXfiMmy64CEp+lMDCp2t/352+WOfdpn2 8EPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jzE7tCtv9nXhTqCLmkAtvvd9XPqHKuG/dItaNXtPrVU=; b=RBqhNdQ4si1x30f/l4s8MANGKUnmIix6zRyPOgY09z77OlGnTyhVEwLMem5mNZ5vg+ 1qozcR2Gun7Ix6JkR5u25kteoBDCwSwU3jAMmwEi80oodsmJ3CzAe9EUe9Qbfeu2lz+O CfSoict1JOFdvhF2LxoVyM5jCyA/3oOD5fGDnVjeXfApjoobighYWx/u8eF3/i1YrbdY Ez0Ic72kTPP5mqcpoRL6rSqWvSqtGYPqPYHAMRmu/0VCtkwQIuq76rVIxxoGgOl9qYP/ Z+DniPwSn1dzorTFlVM0beM3oRSA7fJb6p5T7ZzLl5YMwusdJaJdxjRCJT3cWzJFlql3 IdLg== X-Gm-Message-State: AO0yUKVlpZRXJbDH0KNmVf3TvbyCXcYfHJrocYFLEn2OgDhTlqlVtIMb /nu45ugoZWjGhHTSwD1WGdcy0g== X-Received: by 2002:a5d:6112:0:b0:2c5:7c7a:78f5 with SMTP id v18-20020a5d6112000000b002c57c7a78f5mr4549225wrt.52.1677002858926; Tue, 21 Feb 2023 10:07:38 -0800 (PST) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:1e9:315c:bb40:e382]) by smtp.gmail.com with ESMTPSA id c128-20020a1c3586000000b003e21558ee9dsm5107815wma.2.2023.02.21.10.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 10:07:38 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Amit Kucheria , Zhang Rui Subject: [PATCH v2 02/16] thermal/core: Show a debug message when get_temp() fails Date: Tue, 21 Feb 2023 19:06:56 +0100 Message-Id: <20230221180710.2781027-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230221180710.2781027-1-daniel.lezcano@linaro.org> References: <20230221180710.2781027-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758465118799507485?= X-GMAIL-MSGID: =?utf-8?q?1758465118799507485?= The different thermal drivers are showing an error in case the get_temp() fails. Actually no traces should be displayed in the backend ops but in the call site of this ops. Furthermore, the message is often a dev_dbg message where the tz->device is used, thus using the internal of the structure from the driver. Show a debug message if the thermal_zone_get_temp() fails to read the sensor temperature, so code showing the message is factored out and the tz->device accesss is in the scope of the thermal core framework. Signed-off-by: Daniel Lezcano Acked-by: Rafael J. Wysocki --- drivers/thermal/thermal_helpers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c index 0f648131b0b5..9558339f5633 100644 --- a/drivers/thermal/thermal_helpers.c +++ b/drivers/thermal/thermal_helpers.c @@ -107,6 +107,9 @@ int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp) *temp = tz->emul_temperature; } + if (ret) + dev_dbg(&tz->device, "Failed to get temperature: %d\n", ret); + return ret; }