From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF31D45DF57 for ; Wed, 29 Jul 2026 10:59:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785322784; cv=none; b=UIQcu+Sm8FPrtyCK+nR/9PEIm/xrTUNIMkP4mRdjciIi4fnyhNkoIKcEQGtRPvXUgEV3tK1PbbAzLoloHQvSzye5fU4wh/7/akldfJ+IW0jbf1TPpAggUNrBouhsJOdpIM59YVk0Xibma+gmjX+QdQwvX/xOY2IyBrURZnDDn0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785322784; c=relaxed/simple; bh=7RTJQWnL5hx+W9CM10/WlCRexSIlFybuQu3riz/+oNY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WJPSbb/PnoeVf8CsbWvmoKyRW8Eix0rdF70JRZrferGjB3bWGpknv3JHt1wryj/2ray85AyYGAP+CjIvQwZspduEe7aK5fB3Aqya3bcSQQFy09acv/nMe/vNtes/Y2g6mVk+kB2N8m+9JHuWGmlMNxgqP3qXOCDxB3duXzyeOic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=UV3jKmR4; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Y32G40m5; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="UV3jKmR4"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Y32G40m5" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66T7eq6f2326413 for ; Wed, 29 Jul 2026 10:59:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= z+HScNtSm/fsTc1nP6tPXuEJN/xN6GzE8XU6z4AKsg4=; b=UV3jKmR4XDL+hMwp dfLUHAwwp4UXdOyNHTIiktHXU33Y0hh3pEygrOnp9N/FMObTo58VwRD7p4aRcZcT NXUXMNGtF7p8+2Wxe/FRWD+Tqff71Jo3GARRjvU2Yvs/87/hVXqfaqZ85vxRaXl9 B+qP0dwDkSKJ+jUWLmlXzT+4aB/eymzaBO3gTM4NTYqNa5+o2096C4nFj8njz60Q 9bA9tY+W5PI4W0D9ofb1cHALlirLW7OSU6j0pmrqWVykGmXQ+ZrgDJcmhjjUme/w iSe+Ra6kaglwJN+JuhDi8gKYToMN9ZzTwKeAMoTWay1a4/XIPP5liAZz0aNA9JvQ qBCbLQ== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fqbm1hb60-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Jul 2026 10:59:41 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-93102454272so20081685a.1 for ; Wed, 29 Jul 2026 03:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785322781; x=1785927581; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=z+HScNtSm/fsTc1nP6tPXuEJN/xN6GzE8XU6z4AKsg4=; b=Y32G40m5MOj6JZZL/Cs1WG0nrDDbMad7eT24e0UPmlni9EDTgyQGrIkV6KTO+c1Ls8 H5DDFMJOobGx7GG2zh48xPpoUCxdSWuEvuKYX8mQv2LC4oT5s1TdTORxIpb9sS3CfEUK GdMvjA+SG/6DBqFdaYqyKThjmaQxUBh57zCov4bUZ1n4nO0db/9daOnYIEXmVnUTQl6j DnrEPEwJN+q0l8+e/J11K1Z5IE5fr/qMV0JHkd9qGsABf8SloRgtl+uliX8SjaZPCp8G uVHl5ourbKQloG0M1NkyvwOdbZXLx7RhkR1ngGL7gn7DEKcYckGfoZCiRSBlHOX/zEtX 9a3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785322781; x=1785927581; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=z+HScNtSm/fsTc1nP6tPXuEJN/xN6GzE8XU6z4AKsg4=; b=mTgwJ8krms3GzbWu6mvClgF8iv6ErWP4Z9OTCz+9bqWht3fIt20ETvB4IPN5L7gzLZ 54idgcd0dYA25OFQshOG26tWhVLOCi3DYkxKP3HOQD7lmCMAlsAKyVHmpxYrfQ5nmxqy ylamPs/c7afSpL/iH8ZGP3cWu9ocRl3CIX701ugtIc4Ln9JKRZeE/7lIPxooulf/G2bi xA04p6gZzLr3HtYi5bGEyDZZwlOmtjPhJRpEMhSb8GCYhwFUxaTm2FA+B5aFItbO49KE k9ibHPJkEljcywi0MTYZiS6sG7AHByecLU+4JNAxklTkzy7kzUQypFIEtmybUI+f9HJz dIYw== X-Forwarded-Encrypted: i=1; AHgh+RojxaaV+UuXT0osx7CBc/hqUqhmWe7FVVxI2VOcnp+ChipCjskRkLFaMVtrBBVL7cNkSFnVSWUg2Pnn4W0=@vger.kernel.org X-Gm-Message-State: AOJu0YyScCymkHEM2ssCMIRUStyQ97vpgCl6DbeCW/lFW2vb7vVcUxCj /5QZFw7yyPwmIGui409t01cGiuatJJbM0mOVKDJg3TlmFbP3rME9C89Du0tTS669y3TtX7TBoMV NE2qPfKdh9D7QLbxvCROT+ZS1C/3FxBcwrGPO4XCDitOcpGSuJ4wxNp8BELqLzpXefSI= X-Gm-Gg: AR+sD13TPlXN3KX1v38SGQynN0klFlxebzD0jgFYjDQ9g8TQ985FCGC2jSU6g5s18AW ZBNXX981hc+e071bwmtq9BzdFtj1S/59jwqAZXNrZwWsymKC1O0SvZ+aYc+ReJOSpdBJVUpiYER nmCX7jAeuUpg8oG6x+siVpSv0euWCOaOhFS2ub4iLG9MASG+YrNXgr9swjT43SBZW6XufhW09yr ItxQ7vvcktsnyHGi/XbkpygJpmLofZE8UgBQ/cNlO8Cyhy4xCzagEcWN8s9CMk787Le9rB+6d06 P05eGxTQqey4Ja7OlzoNsj0uxRPyXxxWkr7ylvf/Ys0q0yNVHxyosdre/owP/Ecc2sfoeHZ4eNT W1LB0YxvjgzYUGt/dXxJKQX7t X-Received: by 2002:a05:622a:14d0:b0:517:5d21:9899 with SMTP id d75a77b69052e-529df876c1bmr60463421cf.5.1785322780791; Wed, 29 Jul 2026 03:59:40 -0700 (PDT) X-Received: by 2002:a05:622a:14d0:b0:517:5d21:9899 with SMTP id d75a77b69052e-529df876c1bmr60463221cf.5.1785322780392; Wed, 29 Jul 2026 03:59:40 -0700 (PDT) Received: from [192.168.120.193] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a050be9607sm737824a12.12.2026.07.29.03.59.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jul 2026 03:59:38 -0700 (PDT) Message-ID: <94081897-2e6a-4c8f-bd95-1961ca843478@oss.qualcomm.com> Date: Wed, 29 Jul 2026 12:59:35 +0200 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/8] platform: arm64: qcom-hamoa-ec: Add SoC junction temperature reporting To: Anvesh Jain P , Sibi Sankar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org References: <20260728-ec_add_more_commands-v1-0-771abd65ee1a@oss.qualcomm.com> <20260728-ec_add_more_commands-v1-2-771abd65ee1a@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260728-ec_add_more_commands-v1-2-771abd65ee1a@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDA5MCBTYWx0ZWRfX00QxBYNY8SlC z5k+ZzKKLGlFsBWeEaC0q0aUtIF47yKLuNjpjWaUYM3uCsX/5tdBbHuZ2or51JaVAGY+994JKT8 QK5QBjOH0J1DyxpID/kd37P5twfovsXpPb5MiM44DVLUL/2HEFlKxHVZ8OnlHreUbhpvVlPvLtH U0SpGOJvPcrk6mEILnBCP4TppxtD/pEetoS2JVvPt299jZ4r1sk4dtJys39NPRVORxJK/lCHDCq 3PaPzNY3iD2/HKbJd91SM5zdEw9eSWubFHFQWCVGv/AKUrw7hBSoOpKjuLokRtSXL9wl77nmfix 5gqnpDcA0BwL5XWlNjCaqApMqbEqXdue9QyNg0LIxvUGJvOqFsDpy2KgrNpvtQpys4Ys8GxAAg7 aPIfxqUblyBud+b7bEs3pjhONUrCe8hzYO1Rj9XjzrfQszug7NnO7FXJeUS0afXiiVhIs3/URfu KR5UFRo1YFUbcPdlNcA== X-Proofpoint-GUID: p9pxjlyWCJWjDfrJyqy3LcwTfRe7ODTj X-Authority-Analysis: v=2.4 cv=R7Az39RX c=1 sm=1 tr=0 ts=6a69dd1d cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=0UkU7q0zyOI0kmPNHrEA:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-ORIG-GUID: p9pxjlyWCJWjDfrJyqy3LcwTfRe7ODTj X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDA5MCBTYWx0ZWRfXw9lnA0ZPVCea HhLkERZltMF4y13RwymkKojUhQgYRrOJPAVtl8oPJ0gvnn9JQw0sR5gkioPV2M+k6uU5uy+EkgH vm1FxY9jwN5cM/Tx6SW420ZohmnQXwY= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-29_03,2026-07-28_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 phishscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290090 On 7/28/26 7:44 PM, Anvesh Jain P wrote: > Add the EC command definitions and handler function for reporting the > SoC junction temperature (Tj) to the EC. > > Discover the platform's thermal sensor to zone mapping via the > qcom,tsens device tree property, average the junction temperatures > across the mapped zones, and periodically report the result to the EC > over SMBus using a delayed work item. Serialize this and the existing > EC command sequences (firmware version read, thermal capability read, > SCI event control, and the SCI IRQ handler) under a new io_lock mutex, > since the delayed work item now runs concurrently with those paths. > > Re-arm the periodic report on resume and cancel it on suspend to avoid > racing with the modern standby transition. > --- Missing sign-off, have you run b4 prep --check? [...] > + mutex_lock(&ec->io_lock); > ret = qcom_ec_read(ec, EC_FW_VERSION_CMD, EC_FW_VERSION_RESP_LEN, resp); > + mutex_unlock(&ec->io_lock); Does it make more sense to simply stick a guard(mutex)(&ec->io_lock) at the beginning of qcom_ec_read()? [...] > +static struct thermal_zone_device * > +qcom_ec_sensor_to_zone(struct device_node *sensor_np, u32 sensor_id) > +{ > + struct device_node *tz_np __free(device_node) = > + of_find_node_by_name(NULL, "thermal-zones"); > + > + if (!tz_np) > + return ERR_PTR(-ENODEV); > + > + for_each_available_child_of_node_scoped(tz_np, child) { > + struct of_phandle_args args; > + > + if (of_parse_phandle_with_args(child, "thermal-sensors", > + "#thermal-sensor-cells", 0, &args)) > + continue; > + > + of_node_put(args.np); > + > + if (args.np == sensor_np && > + sensor_id == (args.args_count ? args.args[0] : 0)) > + return thermal_zone_get_zone_by_name(child->name); > + } I'm not sure that's the intended use of the API, but this is NHI of_thermal_zone_find() [...] > +static void qcom_ec_sci_evt_disable(void *data) > +{ > + struct device *dev = data; > + int ret; > + > + ret = qcom_ec_sci_evt_control(dev, false); > + if (ret < 0) > + dev_err(dev, "Failed to disable SCI events: %d\n", ret); > } This should be a separate fix. FWIW suspending and resuming on linux-next/master currently gives me: [ 43.754787] geni_i2c a84000.i2c: error turning SE resources:-13 [ 43.754811] qcom-hamoa-ec 3-0076: Failed to read EC SCI Event: -13 Konrad