From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08063C7CFCB for ; Fri, 13 Dec 2019 20:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3992F24747 for ; Fri, 13 Dec 2019 20:39:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MQ9l8tB7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728537AbfLMRbX (ORCPT ); Fri, 13 Dec 2019 12:31:23 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36638 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbfLMRbW (ORCPT ); Fri, 13 Dec 2019 12:31:22 -0500 Received: by mail-pf1-f193.google.com with SMTP id x184so1825147pfb.3; Fri, 13 Dec 2019 09:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rAse+HUSmAaqHJABAbnX0rRs7xuvJErVIeGJ5dj9few=; b=MQ9l8tB7Eji8SPxaWILyz05JwsHf8cIRm4+r/t5FGHu9snbvMU2PA7sak8miuVlRIK CffoteJoRgqSMhHiy/rOkcoZvZTYOceGobicLOSrngq/yAlbBMp/th1bgSC3mPeonNbF QCQKp7b+bd8+Ap9DpM3K6mSoIkOKl1IH/LVDUE5HxgmyNZY7tVMqjg2d/wOzJ3lWZuzl bzpFWUqWJOQIwZI7L8CqJWBeBoV+uhtHnjGN2ax2oazcu2kbwrlrWbMIjmkdrtFrQY2W /9uNs9/rmbaTMdo7hDnrGJHw+cJhw0g2pT3Pakei9oWWTwEKnNzJmHL3ayoH3yLTX10M smuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=rAse+HUSmAaqHJABAbnX0rRs7xuvJErVIeGJ5dj9few=; b=KchvybgMQkCtmV2AY2hWIV7ehLsIxt2x3mNVU3Vm8zH9G8qxqXqeHgQlQtqXe6dSKn AgbSLp8zU23c3JckxYWygKYgQB6woWt32d25hImONIBQY2lwBmWZMmyye9yemeHPV5zH oGqtrNrIw5kutM8mV6vN3TsR2NzIvgX7ofBmEtwKlMjcX52lY/k5+rtwR48cXA7cJmN+ Gy8glKTHEaJkfNmXIEqpZwpIda0TvU2Row2wU24BLT3Ym2jHFXf1SCjml8X+OAhuiw/e NU08NU/cc3SUHDVHjgNBpWH33z3JtAhxtCN7b/Y8e0divuDqKptoJNgQiCZBp5LiH4JL vYdw== X-Gm-Message-State: APjAAAXafi5ppmlHZOlNOwcFS6nPQg4TZfvqAts6M47W583mU/J3eGix BN0HDkp7m9tzSLhjNs29SI0= X-Google-Smtp-Source: APXvYqwhUACNgTJzGRRy1jtJOv0oTmko6DYqndJTw3CeclwzY4A7VkH70DpTXSUoyWYjH9suvPQynQ== X-Received: by 2002:a62:5290:: with SMTP id g138mr627671pfb.54.1576258282234; Fri, 13 Dec 2019 09:31:22 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id k60sm10828136pjh.22.2019.12.13.09.31.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2019 09:31:21 -0800 (PST) Date: Fri, 13 Dec 2019 09:31:19 -0800 From: Guenter Roeck To: Amit Kucheria Cc: schaecsn@gmx.net, jdelvare@suse.com, Heiko Stuebner , Linux PM list , Daniel Lezcano , LKML , Eduardo Valentin , linux-rockchip@lists.infradead.org, Zhang Rui , lakml Subject: Re: [RESEND PATCH] thermal: rockchip: enable hwmon Message-ID: <20191213173119.GA4231@roeck-us.net> References: <20191212061702.BFE2D6E85603@corona.crabdance.com> <20191212232859.E09FC6E85603@corona.crabdance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 13, 2019 at 10:09:49AM +0530, Amit Kucheria wrote: > Fix Guenter's email. > > On Fri, Dec 13, 2019 at 10:08 AM Amit Kucheria > wrote: > > > > Hi Stefan, > > > > On Fri, Dec 13, 2019 at 4:59 AM Stefan Schaeckeler wrote: > > > > > > Hello Amit, > > > > > > > On Thu, Dec 12, 2019 at 11:47 AM Stefan Schaeckeler wrote: > > > > > > > > > > By default, of-based thermal drivers do not enable hwmon. > > > > > Explicitly enable hwmon for both, the soc and gpu temperature > > > > > sensor. > > > > > > > > Is there any reason you need to expose this in hwmon? > > > > > > Why hwmon: > > > > > > The soc embedds temperature sensors and hwmon is the standard way to expose > > > sensors. > > > > Let me rephrase - is there something in the hwmon subsystem that is > > needed that isn't provided by the thermal subsystem inside > > /sys/class/thermal? > > Doesn't the sentence below answer that question ? > > > Sensors exposed by hwmon are automagically found by userland clients. Users > > > want to run sensors(1) and expect them to show up. > > > > > > > That is a good point. In which case, I wonder if we should just fix > > this in of-thermal.c instead of requiring individual drivers to do > > write boilerplate code. I'm thinking of a flag that the driver could > > set to enable the thermal_hwmon interface for of-thermal drivers. It seems to me that would be outside the scope of this patch. > > > > > Why in rockchip_thermal.c: > > > > > > drivers/thermal/ provides a high-level hwmon api in thermal_hwmon.[hc] which is > > > used by at least these thermal drivers: rcar_gen3_thermal.c, rcar_thermal.c, > > > st/stm_thermal.c, and broadcom/bcm2835_thermal.c. I want to hook up > > > rockchip_thermal.c exactly the same way. > > > > > > Apparently, other architectures hook up the cpu temperature sensors to hwmon > > > elsewhere. Most seem to do this in hwmon/, e.g. hwmon/coretemp.c. These drivers > > > are written from scratch. Utilizing thermal_hwmon.[ch] for chips which have > > > already drivers in drivers/thermal/ seems to be more elegant. > > > There should either be a hwmon driver with a bridge to thermal, or a thermal driver with a bridge to hwmon, but not both. A couple of existing drivers implement both, but that should really be fixed. Guenter