From patchwork Tue Feb 28 11:22:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 62435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2955007wrd; Tue, 28 Feb 2023 03:24:46 -0800 (PST) X-Google-Smtp-Source: AK7set+oqbUG4rB8P+tKTBQtwNJYKjyj5ntqoi08fyZbgY/3buvRzQlJWBL737ncuey1kHnx3750 X-Received: by 2002:a17:90b:2248:b0:237:d867:222c with SMTP id hk8-20020a17090b224800b00237d867222cmr2884499pjb.42.1677583486564; Tue, 28 Feb 2023 03:24:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677583486; cv=none; d=google.com; s=arc-20160816; b=B5u2TFtaxu2wYQbT4iT5dlpfE8dpW8pS92HIMUYSxk8UCh+TubDMTsOQnu24Ewkfzs BjHwOary8kUQHTaWS2tQvwNw3tDbt+WC3OMTjIdBufItp1+SKWSExKb2JbsKGiFROIEU lmXLXiBsHjVaS0h60Sg76lSDlZuG9klNQycdnnOS6a3kFFD4/hp/6ZrZD4SfZ+mvLcRc ta4E48JntsBVFz143CRoyIIBwcHfm7KMkCHQsMZPBzLPmcVX4oxWlOxlOqvQX6UViGhj FAUmATVZMTeIVGAV4387HFQMlJ/8tfEmuYcLmxV+MAayfVw52r+CpnyyTDAYu3Wn4cdK fyoA== 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=PFAVaVAjSTjzt59jZtf/qm8YllLRpCi77KTHCmDfI3h/Alax26k7pxBZ5VQ/dVHNwf 5yxGFv7mBnu4yqSG2zc3vG74yUw7elEbCNPHhwz9KbOGgvPCRRd/NnHiAb82FLLABbVs E/vnXLOk74KZ1uYRWnYfmLT0rp0RWV+XkDjzjijf38BuSvo8emGTDd8ZUwNb6Gi83rGi CWygWz+t9957kgwkiiuwfgrPDKwpVNjk9NSOwahh37IwRpR1oWONVdIcxGTp0teh5cUD FsLzHk/rX3k8HI3g/fahyk+SLRuFpawpwQl2ev4p8O5ioABmZ/3YzZ1WV0khSBgecoIq ixKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UTo1WZIh; 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 ck14-20020a17090afe0e00b00230cb79e2b3si12560395pjb.104.2023.02.28.03.24.33; Tue, 28 Feb 2023 03:24:46 -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=UTo1WZIh; 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 S231560AbjB1LXn (ORCPT + 99 others); Tue, 28 Feb 2023 06:23:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbjB1LXf (ORCPT ); Tue, 28 Feb 2023 06:23:35 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC0E166CA for ; Tue, 28 Feb 2023 03:23:15 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id c18so6141426wmr.3 for ; Tue, 28 Feb 2023 03:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677583394; 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=UTo1WZIhqmcN7wwdxDBuiP6Ftgr+rLh5SArLgTbxPKLwp5MOgvHozjAy8Ai4QkqCIM +aWGs5earODOd3p4flLKDkVaXo/AIwY/pi340K/DWcSJPQoXz/sDRCEAHH3Jk6I3riaf cu3Ps1D/MNc8KWplvUJ5lDHXS5K1katSy6g2pGWwZn82crh13WpZozVvDNn69OgudtbB zNhv/Iek36bGxNE25wdNREu4DLO4EVTex7JEj5oHWh8oskMHI0tUtgN3D+H+yBBzSCqq DDopp/fMXoyvAI2fxSVcwAIE2P09zMKanRy8aFQ4dTZyHeuPIQT5oy7lgHF9HzQrMLke RsZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677583394; 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=GQ6jYdT1MnjIOx7jyaJ5h6tOr+X89NnOcH75UxUKLzMxpRQBz36ZKKtSNEej92L9Go EuNo56Wy3qYM0aJXdkeoqZr52kkvJEhdf6JOtB5aRhCSOQHAycTEgF7G7tK6AXJ19vwv Ipj6U6PhNDu1vHsbDOS+MilTs3tTOE8DAXnHI8JOGLe6IEyfiaGiTIu3OBTezmbFi6JF uNGPRkRDcqmZaBGgSQxA4Lz+6uz0zIvv+8RihGSD3ObwVQz/sB/g1LjeGe0WCoLRMraW JXiuMKYx3U/QUY+oj4V42KxzkMSbr87T1nHHcQrECmu9xEnduk19hT0hjZDiwZb/yBQn pbUg== X-Gm-Message-State: AO0yUKWKpRwl3wR0CGqsvRC5saHVKmPGvy68UiQJ9r9oe6jEZlQZoFqP tgDKPIX+3DgtNn70i8vF3C/mfg== X-Received: by 2002:a05:600c:43d6:b0:3ea:f710:bdad with SMTP id f22-20020a05600c43d600b003eaf710bdadmr1863338wmn.29.1677583393866; Tue, 28 Feb 2023 03:23:13 -0800 (PST) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6830:6390:2815:b6a5]) by smtp.gmail.com with ESMTPSA id z5-20020a5d6545000000b002c5501a5803sm9598130wrv.65.2023.02.28.03.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 03:23:13 -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 v4 05/19] thermal/core: Show a debug message when get_temp() fails Date: Tue, 28 Feb 2023 12:22:24 +0100 Message-Id: <20230228112238.2312273-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230228112238.2312273-1-daniel.lezcano@linaro.org> References: <20230228112238.2312273-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?1759073782047009470?= X-GMAIL-MSGID: =?utf-8?q?1759073782047009470?= 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; }