From patchwork Sun Feb 26 22:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 61673 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2131103wrd; Sun, 26 Feb 2023 14:56:13 -0800 (PST) X-Google-Smtp-Source: AK7set+KgVkITaOE/J0S8979A+ZblvVDNFItzrgOJKrePDvkRd2QJjdd6oG5asMLfesXpLFpEGGE X-Received: by 2002:a17:902:e741:b0:19c:f005:92d5 with SMTP id p1-20020a170902e74100b0019cf00592d5mr5991179plf.5.1677452173113; Sun, 26 Feb 2023 14:56:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677452173; cv=none; d=google.com; s=arc-20160816; b=BN2IrBaxLlSuTKoTSVi8TQ1erE+VbueYrwUSYhWRf9bK/eZ94VXx7503NTh7fxHUQb MTNtm9N1vQiRlsLS1eB/Da/bLotymjjFHq/RTqDjMTpCzZNxhnzc7yOzHIvQpkVSbyHc owkNVj1t0uWKsI09gIeO2GHRO7LCOrT2CYDxa/nxQqmGdlUpXsbCR0MJ7GGT8uJlZDtA YzWQDYYFrI25AIEMLgs/zsfiqJoUCM111wpZiwybjJSwmCPJApwnaG2kjlCJFERUc7mI o78Wk8NOkGVHZRfJz/9G6r6nIWFnCSvaHTG2Q9/hxPC3kEua6m8QQ36VSFYFyfOM30i8 u4mg== 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=8cRPoTQKkI6Vh2gx5bELOPsRnRzqaEtxSxLlrGiyoRc=; b=SUTUYm/TaNdypDhLBh3NdIDVL/0FXuAbKqhBUIRpFr6yssk2c3SS1oWQFjBkWzLZtt BkOlch0AQ/c6tKqRDrpg/3o0MelL31HepJltofkZxwAsOz+BufD0OfhNLYwo2/OKoW6P R1JfFZi+EwnlIDej8AMzdgUaonNE7TKF0Zn6t6YfypmnwUS0ciYImmvF4Ats3rJ1vUKo PI6lJTCzjI105MtGn3qCOEkakb/UEI+haCHU2dMBIIRyL3bhxU3UqzeuE4S223B9GSFX TPk9SBXLm8tF0DSMpNwbZF1+fGqADqsq/svRhnE6oKdOZHHejpoYCm/K6QR6vKUHgjrd 7wNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AwlI9+h3; 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 k2-20020a170902d58200b0019cd6d089b7si5706398plh.385.2023.02.26.14.55.59; Sun, 26 Feb 2023 14:56:13 -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=AwlI9+h3; 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 S229780AbjBZWzk (ORCPT + 99 others); Sun, 26 Feb 2023 17:55:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjBZWzP (ORCPT ); Sun, 26 Feb 2023 17:55:15 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E654516AE7 for ; Sun, 26 Feb 2023 14:54:52 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id p26so3144006wmc.4 for ; Sun, 26 Feb 2023 14:54:52 -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=8cRPoTQKkI6Vh2gx5bELOPsRnRzqaEtxSxLlrGiyoRc=; b=AwlI9+h33C/jXhy9hGSXpoqDifHlXB8N01uteX63jb4g3pYnKDNsjEM+g14J292EY4 0ifvKScwydnHi5F0t1xAVhPNiB9YcSaXLOWwFt4i540arg/Vz2izeTM58KqljbHjJwtm ZdO1l9lACbRH1MhmytHdH5lMDDN7rLpvv5tHlx6Rv0jz3+JCgCcXBrvrKpJgNp6yIvOF mgf1fLSCbnzdYAG9xELuDZgPJArkFTFx1FN8LNAyDegDEYewE0oprXkWD7JAzDT32Ogv PV9EP3MD5djjxLq6NlXU1o7gn7HuaRtRjcKEfPz5OLgBblTwzpj8WIWQjeUnuEUH8yOv rXPA== 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=8cRPoTQKkI6Vh2gx5bELOPsRnRzqaEtxSxLlrGiyoRc=; b=LmngzSwW9tfcrrVwXJU7G1QLo1lw/bVaNrd/pc9hKTJOypn4PTkZq9fY8lK62D+khf XLQvypS0hC2P08pm0bV+SXFOvIVfkP/TFsiy5vv1d22z01zZYIkgGkBlFO2GLK1bhdrP L2GFhMEh6nqnvHQb+XxNZE0D2UrbAFTpg5s40etTr29Wihm6669ZkVFbt5Bgb3xSogV9 r4xGPbORf5tgklBEH/558VcsoA1DhKse3dKLWwxVoLTANQ1lEnm2J7xDK+4Bj5GYncfd j3hTNnM/2d141uJO+kCMReobSmScfa1iP/ZANK3Qw1SIcdsjgK2Jb0NlpiqumUJnACE5 dW/A== X-Gm-Message-State: AO0yUKVDCqZ9ymvwnjP2wIpulZHYad7svhFTkgxvrS/VJtmMflBqbb2L qw0QX3Lg5VKaXjRJ+kT+1axcpg== X-Received: by 2002:a05:600c:4aa7:b0:3e2:66b:e90e with SMTP id b39-20020a05600c4aa700b003e2066be90emr12139451wmp.10.1677452089802; Sun, 26 Feb 2023 14:54:49 -0800 (PST) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:8baa:6b32:391b:62de]) by smtp.gmail.com with ESMTPSA id d10-20020a05600c3aca00b003eb369abd92sm6138074wms.2.2023.02.26.14.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 14:54:49 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J . Wysocki" , Amit Kucheria , Zhang Rui Subject: [PATCH v3 05/20] thermal/core: Show a debug message when get_temp() fails Date: Sun, 26 Feb 2023 23:53:51 +0100 Message-Id: <20230226225406.979703-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230226225406.979703-1-daniel.lezcano@linaro.org> References: <20230226225406.979703-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=unavailable 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?1758936089587210219?= X-GMAIL-MSGID: =?utf-8?q?1758936089587210219?= 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; }