Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1083378ybl; Wed, 11 Dec 2019 12:13:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzLk6+g5c879lcW3pZsKgu2lyv7cxet1d4GwgBkibvik8ptz/e3/si7QC3sOlONWJKEAdex X-Received: by 2002:a05:6830:154c:: with SMTP id l12mr3705683otp.275.1576095190297; Wed, 11 Dec 2019 12:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576095190; cv=none; d=google.com; s=arc-20160816; b=E3/SS5GC8sAnW8vLGFvLGkz1iihjKZUwVVmElIJsAWg/ZsW+fY/2kY+xpFjSFYypXo SRkWa8BaAaBbUaa5eKbiQeBGvl9ExNcURHYcYU2HcjdtCYNyi/ElEFJnbr3XMEbOGn19 x6xzPr7S6G2m69uopO4/nhTBS6RVg+qJBD+w1pZwUPM40VV85pDSrF9IYPQfFoxJPT/+ XUeI44Q/nCMXTLO7avI2nolxwhiEU5gPS5PVsAyho1tfvuVUTDjSdbtZvQ4Td+vQsnao A01r1vrPnHmuQt0/mt7xc0l+MfcsvOtckG+NaXu8AxODGWcAPEme7sBZdoBQQ0vuk5+K EE+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3M5Fud8kZlxBERQgQ5pLqsW1xJISN6Eh/zfvWG18ntY=; b=d8XcrgK9lgEGj6iA5Qo4UlE4+c4fmgEIfyagOiImzxbfS2r1Or1eWg4Ij8MPeDOGMb 7jPa2FZQ1L7Mos3Q02kGCDGIUlnHojsYaeECm9Fb7nie/Ml7GuV0e0BTkziYw1ukEncr zgOVRIGS3Sp9XdalGiuOS3+Mfy5g1ueGlqEae/omk7z1oPmu1rBu/9xggBqfUuWIihvD 48KLZWVh4DLDXOMtzOCke61TbCehEbU2/nBHVLlJRVmZyMbNTPc5xlIjsKx8hHi3KEiU JzGUYXoZ4ZrgxPPF7U+L5YRuspsjw+T3044JhQO2Z+MdwB+d75hgKXJyD/NnFfCeMAGn NS6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Nm5l3Ck3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si1751771otk.225.2019.12.11.12.12.58; Wed, 11 Dec 2019 12:13:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Nm5l3Ck3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726592AbfLKUMH (ORCPT + 99 others); Wed, 11 Dec 2019 15:12:07 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33550 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbfLKUMH (ORCPT ); Wed, 11 Dec 2019 15:12:07 -0500 Received: by mail-ed1-f66.google.com with SMTP id r21so9885830edq.0 for ; Wed, 11 Dec 2019 12:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3M5Fud8kZlxBERQgQ5pLqsW1xJISN6Eh/zfvWG18ntY=; b=Nm5l3Ck3dtONtgXmMx3028yxkYfjn5E+7EQDuUYstl2zM4t7BvuOF4bEUKBqBvjnBI lYeV5t7Wc7CH/osJtJu8iHJq0c24a7kqSEzm5ojFfMaQ5cBO+1r0Zatjf7ICdpcBcg6v UKskqUCpaTc880p3ngXX6FJr1xJ1EeAgpHCD5uXa+SfpgXVl8ENzqvs3LOTRqijw/v7U dlFMC2sRzIwfYU4I5FsDJyVEDh9ZNe1hkByxGxBeDBC1yx62cYs1gjbiWpFhIztoh0FY Fxg2chcdBsk0eGO4Y80N9ZDhLRCFrLXd4L+DKte5i7o023shy80nXNBUUpsc51LehfVi Xdwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3M5Fud8kZlxBERQgQ5pLqsW1xJISN6Eh/zfvWG18ntY=; b=QycCfJIoSBGDKZu9F/jh4VqT5GwIGSLCacLAqIOvix2KHlLYv+GSSyd7QMDiNqEoPX VgcbiJBSZ4Ywl2GOrk++ExBlwg5gdOJuyuKA1NRd7AY9z/WIS0nnCSkG8Hohlff94e8R F76oR4PmEuqU+78+n0Q7K0bsS3YVa3ZjyXbAFOqRiK6LTi6A1fp3Axy7Dsx79VlbIxu5 YcePaPTMonQ09UvnxQehEG8ZpoQWqI7GlPeAVnUeeUNOpJbLaTeRt61fdu16HVii3nfP S1lH9qMRyBNRPU+uvxtqrdV8iFmEPCHkqL9cmxib2PwO10e41gu/NVJNuf4iOp82FEZ0 CSIg== X-Gm-Message-State: APjAAAXdlvAx/fMFk0ZaKqFfBT8hH/1OhCEywiQdsQ56sL7qfs3ir5F8 YNxmyAUb1Ma67jTTFuvMu76M41k70GJxLJ3Y2Ic/Mw== X-Received: by 2002:a17:906:3647:: with SMTP id r7mr5241097ejb.320.1576095124739; Wed, 11 Dec 2019 12:12:04 -0800 (PST) MIME-Version: 1.0 References: <20191205071953.121511-1-wvw@google.com> <69dd3a7a-c5fe-3ae7-8a4d-c3939870eed8@linaro.org> <0603228e-5f0b-d335-30ce-67cf0626a489@linaro.org> <20191211085400.GB500800@kroah.com> In-Reply-To: <20191211085400.GB500800@kroah.com> From: Wei Wang Date: Wed, 11 Dec 2019 12:11:53 -0800 Message-ID: Subject: Re: [PATCH v3 0/3] thermal: introduce by-name softlink To: Greg Kroah-Hartman Cc: Daniel Lezcano , Wei Wang , Zhang Rui , Eduardo Valentin , Amit Kucheria , Linux PM list , LKML , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 11, 2019 at 12:54 AM Greg Kroah-Hartman wrote: > > On Tue, Dec 10, 2019 at 09:54:11PM +0100, Daniel Lezcano wrote: > > On 10/12/2019 21:01, Wei Wang wrote: > > > On Tue, Dec 10, 2019 at 6:36 AM Daniel Lezcano > > > wrote: > > >> > > >> On 05/12/2019 08:19, Wei Wang wrote: > > >>> The paths thermal_zone%d and cooling_device%d are not intuitive and the > > >>> numbers are subject to change due to device tree change. This usually > > >>> leads to tree traversal in userspace code. > > tree traversal is supposed to be done in userspace code :) > Yes, that can be done in userspace, but given the amount of thermal zones we have in some mobile devices, this will bring a lot of convenience. e.g. this is on Pixel 4 XL: coral:/ # ls /sys/devices/virtual/thermal/ cdev-by-name cooling_device15 cooling_device22 cooling_device3 cooling_device9 thermal_zone15 thermal_zone22 thermal_zone3 thermal_zone37 thermal_zone44 thermal_zone51 thermal_zone59 thermal_zone66 thermal_zone73 thermal_zone80 thermal_zone88 cooling_device0 cooling_device16 cooling_device23 cooling_device30 thermal_zone0 thermal_zone16 thermal_zone23 thermal_zone30 thermal_zone38 thermal_zone45 thermal_zone52 thermal_zone6 thermal_zone67 thermal_zone74 thermal_zone81 thermal_zone9 cooling_device1 cooling_device17 cooling_device24 cooling_device31 thermal_zone1 thermal_zone17 thermal_zone24 thermal_zone31 thermal_zone39 thermal_zone46 thermal_zone53 thermal_zone60 thermal_zone68 thermal_zone75 thermal_zone82 tz-by-name cooling_device10 cooling_device18 cooling_device25 cooling_device4 thermal_zone10 thermal_zone18 thermal_zone25 thermal_zone32 thermal_zone4 thermal_zone47 thermal_zone54 thermal_zone61 thermal_zone69 thermal_zone76 thermal_zone83 cooling_device11 cooling_device19 cooling_device26 cooling_device5 thermal_zone11 thermal_zone19 thermal_zone26 thermal_zone33 thermal_zone40 thermal_zone48 thermal_zone55 thermal_zone62 thermal_zone7 thermal_zone77 thermal_zone84 cooling_device12 cooling_device2 cooling_device27 cooling_device6 thermal_zone12 thermal_zone2 thermal_zone27 thermal_zone34 thermal_zone41 thermal_zone49 thermal_zone56 thermal_zone63 thermal_zone70 thermal_zone78 thermal_zone85 cooling_device13 cooling_device20 cooling_device28 cooling_device7 thermal_zone13 thermal_zone20 thermal_zone28 thermal_zone35 thermal_zone42 thermal_zone5 thermal_zone57 thermal_zone64 thermal_zone71 thermal_zone79 thermal_zone86 cooling_device14 cooling_device21 cooling_device29 cooling_device8 thermal_zone14 thermal_zone21 thermal_zone29 thermal_zone36 thermal_zone43 thermal_zone50 thermal_zone58 thermal_zone65 thermal_zone72 thermal_zone8 thermal_zone87 > But what userspace code needs to do this, and for what? In Android, thermal daemon and thermal HAL as well as some init.rc script would use those thermal paths for managing and monitoring thermal. The daemon/HAL could have logic pipled in, however Android's init.rc script would be really tricky. On a related note, we also create /dev/block/by-name links from userspace. Thanks! -Wei > > thanks, > > greg k-h