Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1003461ybi; Sat, 27 Jul 2019 00:40:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvMVzcLNS59d54eNZbZjGBDDql3tu+uPAE+7abEq74zEHykGhpafxbvg4IMzWTQn1Kd9iR X-Received: by 2002:a17:90a:8a91:: with SMTP id x17mr102405935pjn.95.1564213238327; Sat, 27 Jul 2019 00:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564213238; cv=none; d=google.com; s=arc-20160816; b=D9KROwx90ZjchIrBe82uGUZIn0akB960hpoaKns/QMxavonfd4+AhJwjPWud/M6Ed2 XDVcduabDfHx3l3h12gDrrIhCsH3YJDgBNciKyXS0qXV7fyVuJX4FnU7hs6nckCHLONQ lqhgiCrH33LPqvcXIZ91qhY7W1jqek1I9oNT7i+Ni3hnawp+C+CroDkCG+LWiw7Shuji xiahTFFCby2yhdSP2DwX/dhEcJUquIGYuM/nd9AYRcjC+ISyyPP7DdeLTonji5GIl/j7 HANBhzkb88RLnfZcQr7mW7rkEYtWnm+XRYz3jLFadqwtpGhpFIWtZv/QIoxCa7qEzdif qOcg== 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=cxunsPUwif5aLQDZ7sw3iCnfCxZR3QXtrcqccdvRBUE=; b=nHDJVCkxJMq1X1GHenX8RIuk7+/Fz9dMcaZ1C1K1Mozprgwx+UlXU1yZEZuxSYwIyF ojoGNqhBCxnVaXi+qWWrGGYP8SGB8jFD5ZResUB86gARSKN+1m0YcxlxrRoJtUZyXORQ qY6qUkSoRXODdmJyxv3bMQF9zNNo2SgiODk1iG3jwYupU5avQH5VRSicjcPnCDSfIcao PtD0P3dUmuUyZyjEZdDCxigV5PTY5+yTVj0Vh7YI5YMyZ0AaxSOK33M0G594Tt6j83u3 qKGSNvRCKM7m5JCn+B9ymr8KlsuDtaCkn4oJ9WQ5PAfQRZi7AjvE2qpxTU+1a3OV3lsB 6IfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XQpiTYZ9; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35si21638978plb.249.2019.07.27.00.40.23; Sat, 27 Jul 2019 00:40:38 -0700 (PDT) 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=@linaro.org header.s=google header.b=XQpiTYZ9; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbfG0H3H (ORCPT + 99 others); Sat, 27 Jul 2019 03:29:07 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:43552 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728213AbfG0H3H (ORCPT ); Sat, 27 Jul 2019 03:29:07 -0400 Received: by mail-vs1-f65.google.com with SMTP id j26so37611593vsn.10 for ; Sat, 27 Jul 2019 00:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cxunsPUwif5aLQDZ7sw3iCnfCxZR3QXtrcqccdvRBUE=; b=XQpiTYZ9xP8kfuOvYF5UuVjyCjzkKJXv8g3Uy277K6shi7janlZkKs6gC84q0Lqz+E HS7YZrUlR8AzAU7yRr2GouwVT5cXzacTo754kna36L2MIaoC7rsGZiJxyC3Oj7iazlxG AM1+JYop6aeIqnowiHLVPH2Bgin+wBEnqkCbhWDED/S7tTvVCxyI84P69AMqT7DkMVzp ipMLorv6F3KFpPN1BADJ0HDasXB/xghZuoHfJLZtxa1DZTTUlMpwy4bXY2EKY3zGTO/n MgYxyRWJhrIkvhZ43bE0F3kCNyaV6hoAUsGYy5myn2W/+FSwjwmj+lCPo+KnvPSZXn20 WCtQ== 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=cxunsPUwif5aLQDZ7sw3iCnfCxZR3QXtrcqccdvRBUE=; b=Zc8xBGOWVJduhQuQqw1MFz9kRWzOQsjfKA47jS/OabTfVnx/8KVfKsvHDqU0q8jMMZ gtwHdJ8t88tjnqK3m23mHYNoihknNbOQLh5k+8e11wLS0P1teldfTSFc40Ug6UyP4NLt mSwy4domRveD0zuvNnQtkJ85g1wCpOlctlfjQ1rO+ruv9d2mLV00WnRYeTODsHZCXTGp /gyDSIPyKm+GlCN8UQVAK24fjY4xYUyhgzkLoXGNLSZId1+kziWy+1NlXUQtkucwRMZ+ Yt4sBLcTwnZvXGqv7kzJgIKM/lDgUp7ZgbliVPFhKIZyx6rJHQzzUwKjAu1xzwL9qmAW YKGg== X-Gm-Message-State: APjAAAWgt6VaYRtXyfZfbscaIlIrxcB48XcaRYalM1ESH0hM1jPwDeaK mj0LEBTdUlb2IAdjkfY2/X696BCcQw2qiG7pcIM= X-Received: by 2002:a67:fb87:: with SMTP id n7mr32787176vsr.9.1564212545563; Sat, 27 Jul 2019 00:29:05 -0700 (PDT) MIME-Version: 1.0 References: <20190726103605.GB3327@onstation.org> <20190726112954.GA3984@onstation.org> In-Reply-To: <20190726112954.GA3984@onstation.org> From: Amit Kucheria Date: Sat, 27 Jul 2019 12:58:54 +0530 Message-ID: Subject: Re: [PATCH 00/15] thermal: qcom: tsens: Add interrupt support To: Brian Masney Cc: LKML , linux-arm-msm , Bjorn Andersson , Eduardo Valentin , Andy Gross , Andy Gross , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui , Marc Gonzalez , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux PM list 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 Fri, Jul 26, 2019 at 4:59 PM Brian Masney wrote: > > Hi Amit, > > On Fri, Jul 26, 2019 at 04:40:16PM +0530, Amit Kucheria wrote: > > > The device tree nodes appear in sysfs: > > > > > > / # ls -1 /sys/class/thermal/ > > > cooling_device0 > > > cooling_device1 > > > thermal_zone0 > > > thermal_zone1 > > > thermal_zone2 > > > thermal_zone3 > > > thermal_zone4 > > > thermal_zone5 > > > thermal_zone6 > > > thermal_zone7 > > > thermal_zone8 > > > thermal_zone9 > > > > Looks good. What are the contents of the files inside the two > > cooling_device directories? The output of the following command would > > be nice: > > > > $ grep "" cooling_device?/* > > /sys/class/thermal # grep "" cooling_device?/* > cooling_device0/cur_state:100000 > cooling_device0/max_state:2500000 > cooling_device0/type:smbb-usbin > cooling_device1/cur_state:500000 > cooling_device1/max_state:2500000 > cooling_device1/type:smbb-dcin > > > > The various temperatures were in the upper 40s and I threw some work at > > > all four CPU cores to warm up the phone and watched the various > > > temperatures rise: > > > > > > / # for i in $(seq 0 9) ; do > > > > TYPE=$(cat /sys/class/thermal/thermal_zone$i/type) > > > > TEMP=$(cat /sys/class/thermal/thermal_zone$i/temp) > > > > echo "$TYPE = $TEMP" > > > > done > > > cpu-thermal0 = 66000 > > > cpu-thermal1 = 66000 > > > cpu-thermal2 = 66000 > > > cpu-thermal3 = 66000 > > > q6-dsp-thermal = 60000 > > > modemtx-thermal = 57000 > > > video-thermal = 61000 > > > wlan-thermal = 65000 > > > gpu-thermal-top = 61000 > > > gpu-thermal-bottom = 59000 > > > > > > To test the interrupt support, I lowered all of the temperature trips to > > > 51C but I'm not sure where to read that notification. I assume one of > > > the cooling devices or a governor should be started? Sorry but I haven't > > > done any work in the thermal subsystem yet and I'm short on time this > > > morning to investigate right now. > > > > For now, just checking if the tsens interrupt in /proc/interrupts > > fires should be fine. I have another patch to add some information to > > debugs that I'll send at some point. > > An interrupt fires as each thermal zone exceeds the trip temperature and > an interrupt fires again when it goes below that temperature. > Here's my new test script: > > for i in $(seq 0 9) ; do > TYPE=$(cat /sys/class/thermal/thermal_zone$i/type) > TEMP=$(cat /sys/class/thermal/thermal_zone$i/temp) > TRIP=$(cat /sys/class/thermal/thermal_zone$i/trip_point_0_temp) > echo "$TYPE = $TEMP. trip = $TRIP" > done > > # Warm the phone up > > /sys/class/thermal # /temp.sh > cpu-thermal0 = 57000. trip = 51000 > cpu-thermal1 = 56000. trip = 51000 > cpu-thermal2 = 57000. trip = 51000 > cpu-thermal3 = 56000. trip = 51000 > q6-dsp-thermal = 51000. trip = 51000 > modemtx-thermal = 49000. trip = 51000 > video-thermal = 53000. trip = 51000 > wlan-thermal = 55000. trip = 51000 > gpu-thermal-top = 53000. trip = 51000 > gpu-thermal-bottom = 52000. trip = 51000 > > /sys/class/thermal # grep tsens /proc/interrupts > 27: 8 0 0 0 GIC-0 216 Level tsens > > # Let the phone cool off > > /sys/class/thermal # /temp.sh > cpu-thermal0 = 48000. trip = 51000 > cpu-thermal1 = 48000. trip = 51000 > cpu-thermal2 = 49000. trip = 51000 > cpu-thermal3 = 48000. trip = 51000 > q6-dsp-thermal = 47000. trip = 51000 > modemtx-thermal = 45000. trip = 51000 > video-thermal = 48000. trip = 51000 > wlan-thermal = 48000. trip = 51000 > gpu-thermal-top = 48000. trip = 51000 > gpu-thermal-bottom = 47000. trip = 51000 > > /sys/class/thermal # grep tsens /proc/interrupts > 27: 19 0 0 0 GIC-0 216 Level tsens OK, seems reasonable. I'll finish up a debugfs patch that'll dump more state transition information to give more insight. > > How well does cpufreq work on 8974? I haven't looked at it yet but > > we'll need it for thermal throttling. > > I'm not sure how to tell if the frequency is dynamically changed during > runtime on arm. x86-64 shows this information in /proc/cpuinfo. Here's > the /proc/cpuinfo on the Nexus 5: Nah. /proc/cpuinfo won't show what we need. Try the following: $ grep "" /sys/devices/system/cpu/cpufreq/policy?/* More specifically, the following files have the information you need. Run watch -n1 on them. $ grep "" /sys/devices/system/cpu/cpufreq/policy?/scaling_*_freq Thanks for your help. Regards, Amit