Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1364560rwl; Wed, 12 Apr 2023 11:38:02 -0700 (PDT) X-Google-Smtp-Source: AKy350ZcMLw5x+3bpoZEHhNKT2Elt/OF79rb46VX7iMCg/my08+oUPNa+ThvUG+CEpQjMTCQ4CxD X-Received: by 2002:a17:903:1c6:b0:1a1:d655:1ce4 with SMTP id e6-20020a17090301c600b001a1d6551ce4mr8460805plh.38.1681324682218; Wed, 12 Apr 2023 11:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681324682; cv=none; d=google.com; s=arc-20160816; b=FmJ1Z+KItrwvQNPx1QpN8rB64TYv4twkmh3nDPtVK0iHfMtzC4t+Ze5B4A1K8h5xZD tEpDO/H8MGJBjqzpwrZHbrocfyEpya/ZpJwiAZaewSMth9rsOzuTAwc5q5tHHvA3OZ4Y /iAu9Nph+gT2zDxXToCdqVAPTtxWN07qAIeWI9Lkjm67GTIrfb183lcCZO2P5tEqOu6d H08Q3LJxWGPXnl7J76EIp3KDpOzZK9H+96tDMY9FWlWEp0qwXf82Zk/G+24WibYnqJEv d1eo0lWXdDggPEYPFEY8r3CwBqPtgotgYMbn798Ry/4PMWUyz9pEYDGKlIIuVq3TEZN6 CMSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=lys0pTR4xlavWty7JK/FaixfpoD3SHxEsz2bLhEqCkI=; b=rwyMu/68vYV+cZaCgETqd7hzKZyF+qTrF1y1qgM8f/MAwO5KGLB5FrD0jXBaxhxcZF xPUdChYzQ9e7J9CP2Pucy0yVPVCSpyO4xYM1J+bmXOW8dDRkX/uXTu748l6ddvcqGuEr +sHeodtBI3oQZ7H045hbe5HGuL6n8Ss+67RnwHDxd+kHnzpegjsoYgzXaw3XwBciXhVh haALZ10aJUWRkLVPm7aWo19AeVoZjnjre39rYjZlfAeVBkgY1STYX+OyOekcwXd+vpje d723S2d9ymPe9zdBZVxTV10Frs3ra5yHAX1/5Y8k0oPpEpcVwV7/y7frWkNbgwtRSRg/ dlbg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y64-20020a638a43000000b004fc274006ddsi12838844pgd.670.2023.04.12.11.37.50; Wed, 12 Apr 2023 11:38:02 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229867AbjDLSgD convert rfc822-to-8bit (ORCPT + 99 others); Wed, 12 Apr 2023 14:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbjDLSgB (ORCPT ); Wed, 12 Apr 2023 14:36:01 -0400 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5EFA2D77; Wed, 12 Apr 2023 11:35:29 -0700 (PDT) Received: by mail-ej1-f44.google.com with SMTP id q23so21751773ejz.3; Wed, 12 Apr 2023 11:35:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681324528; x=1683916528; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IT1P4dXeA0tf8CXzbQiysNKJY0hmov5O9TWOsfyQMAg=; b=ZFBHSKWrUMbj1d9DUeuTpiTQqubDwKTeokHeNei8BQc5LkA8U1hKQaWoAkSDkV/cSn PvkVZEtxsNzCvSBhJMf2MqDMQHdpa0N+xc3sablf1h9P110MKVYCOWzvpWPohAuZtFRq 5z4CFSou5k+SytUXuDHrHq1fpqJmJELv/oljeI2PVMz4ORAbmvltyDQMAUu8NNY2tD9T b8oIOzKDZhnvhAn3nkaIXdMD0miu5EclSfo5Fb6TAQfgj3xjFKasPs2tV6HfPCG73Pwk B7W9fEl8byljq9Wj0TUFm2RTbMUes8JmvdtHLnfllXkoZyY/mwcoeQgrAkkcVwo/rXOt iKxQ== X-Gm-Message-State: AAQBX9fMswzoEOzmEH2gMT9yRJDU/wmyTbGH43I3K3+u12ANP7kgAkn1 idMrMuPuCRIgcxgAuUrRTDfbP0fWU8T5zBhfhi4zLkjC X-Received: by 2002:a17:907:789:b0:946:a095:b314 with SMTP id xd9-20020a170907078900b00946a095b314mr7330202ejb.2.1681324528071; Wed, 12 Apr 2023 11:35:28 -0700 (PDT) MIME-Version: 1.0 References: <20230410205305.1649678-1-daniel.lezcano@linaro.org> <20230410205305.1649678-2-daniel.lezcano@linaro.org> <87119ec6-43e1-6062-93dc-be133fdeb88a@linaro.org> In-Reply-To: <87119ec6-43e1-6062-93dc-be133fdeb88a@linaro.org> From: "Rafael J. Wysocki" Date: Wed, 12 Apr 2023 20:35:16 +0200 Message-ID: Subject: Re: [PATCH v2 1/7] thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace To: Daniel Lezcano Cc: "Rafael J. Wysocki" , rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Kunihiko Hayashi , Tim Zimmermann Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 On Tue, Apr 11, 2023 at 10:10 PM Daniel Lezcano wrote: > > On 11/04/2023 20:16, Rafael J. Wysocki wrote: > > On Mon, Apr 10, 2023 at 10:53 PM Daniel Lezcano > > wrote: > >> > >> The pch_critical() callback accesses the thermal zone device structure > >> internals, it dereferences the thermal zone struct device and the 'type'. > >> > >> For the former, the driver related device should be use instead and > >> for the latter an accessor already exists. Use them instead of > >> accessing the internals. > >> > >> Signed-off-by: Daniel Lezcano > >> --- > >> drivers/thermal/intel/intel_pch_thermal.c | 5 ++++- > >> 1 file changed, 4 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c > >> index dce50d239357..0de46057db2a 100644 > >> --- a/drivers/thermal/intel/intel_pch_thermal.c > >> +++ b/drivers/thermal/intel/intel_pch_thermal.c > >> @@ -127,7 +127,10 @@ static int pch_thermal_get_temp(struct thermal_zone_device *tzd, int *temp) > >> > >> static void pch_critical(struct thermal_zone_device *tzd) > >> { > >> - dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type); > >> + struct pch_thermal_device *ptd = thermal_zone_device_priv(tzd); > >> + > >> + dev_dbg(&ptd->pdev->dev, "%s: critical temperature reached\n", > >> + thermal_zone_device_type(tzd)); > > > > No, this just makes the code more complex than it is and the only > > reason seems to be "cleanliness". > > > > Something like > > > > thermal_zone_dbg(tzd, "critical temperature reached\n"); > > > > would work, the above doesn't. Sorry. > > Why not add a trace directly in handle_critical_trips() in > thermal_core.c and remove this one ? That would work too.