Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1189098rdd; Wed, 10 Jan 2024 11:17:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYzQt7b79z5Jgh6q1vNyres+RHA+2P4ud9oimd9vYOG5D4izGI+vNQCA5ejHDFzlsiIHHS X-Received: by 2002:a05:620a:1490:b0:783:346e:f38e with SMTP id w16-20020a05620a149000b00783346ef38emr91224qkj.149.1704914230524; Wed, 10 Jan 2024 11:17:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704914230; cv=none; d=google.com; s=arc-20160816; b=NLleqF2pYMjcK+Y9Z40ARfTgteJyQdD1Ne9p9R9ObwOUEnuLxJljFGDQbgCotqIGkw CC6un36fn5QaFwMX6E8M0Bqo5AeTZeMOaJ4gvte01RHBj9VSBHg1XLuQ3VymoFonhcGL VFt0BvQitFrX5YuFKv4+8fkyFChqiLxSbl8U4/trwdzISygRk5t1I513tTpcJoiWE/By h8WPJkk99yrcrXc50YjXlV89i1PVZeNCk+LqWrUI4o9i2qNbcSsocpXKhUgrm1mz9bOq n3H0loSKLuZiXohexxeVbty6EGsQ8dKlJd58wr/uyhBVYEsz0G8/kBfXkVehv89/dJTw XG+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=oH8dVFR7fs+Y3NekJ157RJ+BhC7asfmcFl5TuYO3WQY=; fh=oP2uEdKfFOHrDuXza3t55DqAuxK3A1EpCf5r/YArUCI=; b=QaWL/SW0582o8tpcrqa1n0eLeoE7NmpvDViYcawwIZ9wYfl0jxn7Pt6EcKyEntA0bQ YgxOU8qhAaJYcezBvrA4ZNZf2Ksn5sz5bRyv8D0Wgxgw08Gq+kScf4SZ8E8LCAUwN9cB MT6lELF/HW5oP6umb9OvV9333ipm9wt785s5GQA/Bzm4By2ZV1N+PEdlV16+3HUR8lWh Nt18m2d4Z9YCIeRqO2sjt8Ip3xmEamZZ5i1mW5DQMYlbAZb7qHvAbhQesAsb6NsTfBGS yfL28a2bBneZtn5ad4UoyNHVjG4IFkdvx4JODwtkmjmKXEMDsbPeO2iHzZq9iQ0NhA9C uy+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wadM01b8; spf=pass (google.com: domain of linux-kernel+bounces-22649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u5-20020a05620a0c4500b007832079c366si4833499qki.761.2024.01.10.11.17.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:17:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wadM01b8; spf=pass (google.com: domain of linux-kernel+bounces-22649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3B3F91C22B0B for ; Wed, 10 Jan 2024 19:17:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 431344E1C3; Wed, 10 Jan 2024 19:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wadM01b8" Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D013A4E1BE for ; Wed, 10 Jan 2024 19:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2cc9fa5e8e1so52360301fa.3 for ; Wed, 10 Jan 2024 11:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704914221; x=1705519021; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oH8dVFR7fs+Y3NekJ157RJ+BhC7asfmcFl5TuYO3WQY=; b=wadM01b8VWH3Lqyl1M1BHRofLLQiTpjUclDg7QWXnu/6iNL3t0R1hgSZLdQ/2YNn8G C1DbJot8m9o30wjpAuZ+GOflvLSOBmdUhdUcWtWmVzL+xUiBXr9nRGKU9TfGMWco8c33 JF+y55lWeCXPdmUEFFosepNze6BqNjQV1zbqJ/w/2i+sWCqIDV00wBHV7sB/lRs6YVWY sO+gkzzTLnnluvgwYcbIV36hUh/XLMeH/HkMEh/g6YcYyDIkW+ezQZtHdJAL9li7O7/H K2xAQbi4cnSjcjn+k7Jw+dgf2KlAG/wj0gTTUruuTtIRiOEJCL7CWaPHqs1c16jPdQ/2 slBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704914221; x=1705519021; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oH8dVFR7fs+Y3NekJ157RJ+BhC7asfmcFl5TuYO3WQY=; b=puI4nvCMdmeYrKocKo7uElQ6XFweXwsZyaB8T1I1EWNHXQXB3FCuVuxNy5ZxTkzmiW nNfH5rGpBFJ5/cNQ8OfZAZotWy9sYY9gMcxABgf3divMjtp6UR8V0IcC8sWPGsK9wuCs Upaku3ypEcAq1YhhYoS6L98UnyujqMz+8EqAEvyi1Ox8RYwa2mhipnyOm0kI0HpX4AfJ TxUoZ439+WDSgeqveg835pmx68sbJwtms4zlrmUGZJN8FARS2PS7nOH2nx+Xv140hKu7 vmD4qgqhQVNpGZjo/RDj+PoyWhcIP19A33wLKdR6ycTgjfOfyYxC0wPvLW180DyS+M+w hobQ== X-Gm-Message-State: AOJu0YyouUPj+yyLgnSF9Ql8dniN1NssepTlt/PMMCOZGqddp0jjlnqX 8Dcdvx7YEqokSUiVXkFK1u2ZDtTMOd1a+Q== X-Received: by 2002:a2e:9890:0:b0:2cd:4b4a:5c23 with SMTP id b16-20020a2e9890000000b002cd4b4a5c23mr21500ljj.69.1704914220918; Wed, 10 Jan 2024 11:17:00 -0800 (PST) Received: from [172.30.205.123] (UNUSED.212-182-62-129.lubman.net.pl. [212.182.62.129]) by smtp.gmail.com with ESMTPSA id t21-20020a2e9555000000b002ccc6f06e2dsm844470ljh.128.2024.01.10.11.16.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 11:17:00 -0800 (PST) Message-ID: Date: Wed, 10 Jan 2024 20:16:57 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] arm64: dts: qcom: sm7225-fairphone-fp4: Add PM6150L thermals Content-Language: en-US To: Luca Weiss , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno References: <20240105-fp4-thermals-v1-0-f95875a536b7@fairphone.com> <20240105-fp4-thermals-v1-2-f95875a536b7@fairphone.com> <18dc5f88-6590-4e2d-948f-fd77f4713f8b@linaro.org> From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/9/24 12:24, Luca Weiss wrote: > On Tue Jan 9, 2024 at 11:09 AM CET, Konrad Dybcio wrote: >> >> >> On 1/5/24 15:54, Luca Weiss wrote: >>> Configure the thermals for the PA_THERM1, MSM_THERM, PA_THERM0, >>> RFC_CAM_THERM, CAM_FLASH_THERM and QUIET_THERM thermistors connected to >>> PM6150L. >>> >>> Due to hardware constraints we can only register 4 zones with >>> pm6150l_adc_tm, the other 2 we can register via generic-adc-thermal. >> >> Ugh.. so the ADC can support more inputs than the ADC_TM that was >> designed to ship alongside it can? >> >> And that's why the "generic-adc-thermal"-provided zones need to >> be polled? > > This part of the code from qcom-spmi-adc-tm5.c was trigerring if I > define more than 4 channels, and looking at downstream I can also see > that only 4 zones are registered properly with adc_tm, the rest is > registered with "qcom,adc-tm5-iio" which skips from what I could tell > basically all the HW bits and only registering the thermal zone. > > > ret = adc_tm5_read(chip, ADC_TM5_NUM_BTM, > &channels_available, sizeof(channels_available)); > if (ret) { > dev_err(chip->dev, "read failed for BTM channels\n"); > return ret; > } > > for (i = 0; i < chip->nchannels; i++) { > if (chip->channels[i].channel >= channels_available) { > dev_err(chip->dev, "Invalid channel %d\n", chip->channels[i].channel); > return -EINVAL; > } > } > > >> >>> >>> The trip points can really only be considered as placeholders, more >>> configuration with cooling etc. can be added later. >>> >>> Signed-off-by: Luca Weiss >>> --- >> [...] >> >> I've read the sentence above, but.. >>> + sdm-skin-thermal { >>> + polling-delay-passive = <1000>; >>> + polling-delay = <5000>; >>> + thermal-sensors = <&msm_therm_sensor>; >>> + >>> + trips { >>> + active-config0 { >>> + temperature = <125000>; >>> + hysteresis = <1000>; >>> + type = "passive"; >> >> I don't fancy burnt fingers for dinner! > > With passive trip point it wouldn't even do anything now, but at what > temp do you think it should do what? I'd definitely need more time to > understand more of how the thermal setup works in downstream Android, > and then replicate a sane configuration for mainline with proper > temperatures, cooling, etc. If "skin therm" means "the temperature of some part of the phone's body that can be felt with a human hand", then definitely some throttling should happen at 40ish with heavy throttling at 50 and crit at 55 or so.. We should probably make this a broader topic and keep a single policy for all supported phones. + CC AGdR, may be interested in where this leads Konrad