From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 633C62BE7AC for ; Fri, 25 Jul 2025 08:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753432412; cv=none; b=rn96Bo55ZZdaadA9NL8PoGL83O2Iv4tSUk27u/5mKmr7VTVMgJBhiy6oIfdQxT+7zLmogDUXB6Wmcb1lg56aq4hQJJDugaivnk/uEIdk+ublMPIwrHVsRGztuQinlNudvusXlo8ObJblXwaXM47Lf8dk6FIkAlBxoDaLcPR6A04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753432412; c=relaxed/simple; bh=iAj/HA7WjS9k1PkGV+APIrGnyZCllylzuaEm7LCr5JA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tFnNr/JmFIkt8Vys+JgrqpBHeAVrMCdlay84dYjz6d/yHpJ5f69Yt9jf0LKy+1WuS7PcQap6qhI0453ZQKfVfwfyCUvTJpu/ZS8DP/+vYMh+7tLY8Lkqz1oMl8KkCLTsACFdrDdYuRuHHHsfMFTpmLI/N861/0O/kODXnGPTbDI= 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=N53jtd+A; arc=none smtp.client-ip=205.220.180.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="N53jtd+A" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56OLmbwf009406 for ; Fri, 25 Jul 2025 08:33:30 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= 6ICDsXa1i4umW3fubthp861yBxgmGCWIxplYWJoaFxA=; b=N53jtd+AjsC96xmd idbHzzLPyFEZlXIl7CjAM3sZylXpbE7E3fU8GkbacRJiu/zkFTvQ2TEVDpII95Pf 3Mb/hRPBuhsk89riNvZSXD99qpvvJlVDnnSOPV/HPmzS8Zt17wNModzMuhwr+KZK 1D65IUzJu6OLjQcUAQp4pknEpQTny04Ca/JXOZgKUDWwaMtWyK87uRxgSVrApE1o f/lDrzLl1y7Pf/RwWAbjm78wCAO8yyuBx56bH7Txg92FAAcwdDEBAkwOj4Ncfvx2 V6+z4YQF0eLTHb1AKM2CygG14Dc8/3MzzIaGtDudT7t0+qvRL0LBLh/7WBoxOu0X hlIb6Q== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 483w2t1cw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 25 Jul 2025 08:33:30 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2349fe994a9so15779265ad.1 for ; Fri, 25 Jul 2025 01:33:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753432409; x=1754037209; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6ICDsXa1i4umW3fubthp861yBxgmGCWIxplYWJoaFxA=; b=BofLRhJeUozM8VmDwWe8//VTIgmSqWSG+aWShAlbs0o3ukSbJfUvbf/f+NOzQkG7lU nUsDLfwl5NkKRG+OFaVE1od9dS/TLLXINnzxN6g21znp0ZTAb7nabyhEtl1OhXoaeehh MfzXQfMCxmrwIZi7T1LQdJJMO9RY+zvWqAl7W+38jwHZl0eUE01AQwj9z/ReEwVFaOj/ 4V5L4Q7NgBWr7ORsBaxTClSOb4PN8by4tUNYFrNsRxl17nARkrPX5rO26HKHFf7+fJJn XkudQPFnQ6HQ9LXJjvIo/p6A2V/x1NPHxcX513SrqRgk3t8QND+EpDKU4riCSpnTeJzP WCZA== X-Forwarded-Encrypted: i=1; AJvYcCV0pljgN85wiRFjirOsOMBrkfz2r40Ik71jPcODmY0NcsfVaDiDdOlpZcK+XjVrGziJqqczhSWJc0g5ke0=@vger.kernel.org X-Gm-Message-State: AOJu0YxS/L6bz0LPhFGi+MSCWirvdond4sXWLypj0Q46i7VAfzwo/TRi MvW5ssFm6ph88jucjB4cA832HC8fF6WhrXp7HcpOjUzWaXzxh4MEYusCDxEX6lY5wZGL2Z2zxxj ri0U59DDjRFKUEcllEgrEbtuToTA6oq0prMItlRajr/jiSD2zCJ426qq41yEPM7pd1hM= X-Gm-Gg: ASbGncuoQAPe0e5fIApyHes+BGmuLStIKSMcMl6noFGhgWk+FprkYVUdCboJYpkVhPf ZzwH0GZDYjMNyBoS0zKVmUF/ncG1rJegSuTuHOaCZeosOUd4gZXJejKBpZrOp70Pof4mynWgW3n z3XqY2YuBC3WKQ7qscOaGri2efve0b3t2ISuX9K1Wd1sefHRIAEMhLB4wuCBz0+7c9qyqECHoEh 22rqgHxWTVCZ5IiWdhDJf4zFj4sV9h+ldFDr5GicUjrc03h8WGhzGGSS7mbgh91fLwNNidF0rYR YKuWOOA+OZeb9/dSuoMB/Qk/X6uG1BTfNi+rO51tCm+nYyWcpUJqrA6xWQbKTB4E8xccLeIDp4/ yDAHymDfV86xuIuemTFtCk7LrniA= X-Received: by 2002:a17:903:1446:b0:234:d7b2:2ab9 with SMTP id d9443c01a7336-23fb306bcbfmr20011675ad.12.1753432408844; Fri, 25 Jul 2025 01:33:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6QKgVlPsDnhyH4/3bWd30JezGiz7hl/u2XgQDaPgHXQ2Rv+qt9nGM1FqaF52FEEqfpxQ3kA== X-Received: by 2002:a17:903:1446:b0:234:d7b2:2ab9 with SMTP id d9443c01a7336-23fb306bcbfmr20011505ad.12.1753432408399; Fri, 25 Jul 2025 01:33:28 -0700 (PDT) Received: from [10.133.33.78] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fa475f35asm31914825ad.28.2025.07.25.01.33.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Jul 2025 01:33:28 -0700 (PDT) Message-ID: Date: Fri, 25 Jul 2025 16:33:24 +0800 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 v2 1/8] power: supply: core: Add resistance power supply property To: Sebastian Reichel Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heikki Krogerus , Greg Kroah-Hartman , Subbaraman Narayanamurthy , David Collins , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@oss.qualcomm.com, devicetree@vger.kernel.org, linux-usb@vger.kernel.org References: <20250530-qcom_battmgr_update-v2-0-9e377193a656@oss.qualcomm.com> <20250530-qcom_battmgr_update-v2-1-9e377193a656@oss.qualcomm.com> Content-Language: en-US From: Fenglin Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=BMKzrEQG c=1 sm=1 tr=0 ts=6883415a cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=cfvObpv82JsDPSYmetEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: i4Wt8knffdUwcjMr2oFdY8bra6eAR6FF X-Proofpoint-GUID: i4Wt8knffdUwcjMr2oFdY8bra6eAR6FF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI1MDA3MiBTYWx0ZWRfX7/4/C8fcW6p9 jd99d1zcGr4IVY9vp4nGnbNPLJlBA9nhgJqxmNNYG62eOiz1dcffgMarFfl1QSZyEh7oF5YJY8v t1IgPW3mv92Fl64Sz1KdOvi4wJf9W9zMVlzCGGcHqGQPR4NjTtl/8MrhS7W2HlxyZ6wGILGhZSF /Vv+VkmSZx0wZTPpZL/ycudk7StTJrZnUNRe2jBc7duWQkGoVpWgLisH2nVakiDAFWgk6Z6mPXi 77pROtOyBk9QNLaZXtQgBojNWkyM7V+CTWhHpYdz1txL9M6MeWZ4Pc7ArsYCESsWgrYnymu9klF bl9xy3eNA2PmHzqz8KziKT7zDPAJkr4P4zaCpzEKpsDV+gao5GikN/0+LB9HvcQGiRomgHofDzm QjCd4QC+vxFEseV52vSQ67itUChxPKOw+omwx+/OTovqaSQt3tgOG+IoEZokdTsmy7Ue82RY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-25_02,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 spamscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507250072 On 7/7/2025 8:15 AM, Sebastian Reichel wrote: > Hi, > > On Mon, Jun 30, 2025 at 04:28:14PM +0800, Fenglin Wu wrote: >> On 6/22/2025 9:26 AM, Sebastian Reichel wrote: >>> On Fri, May 30, 2025 at 03:35:06PM +0800, Fenglin Wu via B4 Relay wrote: >>>> From: Fenglin Wu >>>> >>>> Some battery drivers provide the ability to export resistance as a >>>> parameter. Add resistance power supply property for that purpose. >>> This is missing some information and the naming is bad. >>> >>> Which resistance (I suppose battery internal resistance)? >>> >>> That is heavily dependent on the battery temperature. So this needs >>> to document if this is for the current temperature or for some >>> specific one. >>> >>> -- Sebastian >> This is battery internal resistance calculated by battery management system, >> using the real-time temperature measured by the thermistor inside the >> battery pack. >> >> I can update the name to something like "rt_internal_resistance" and update >> the description accordingly. > Your message is kind of mixed signal to me. > > If the BMS needs the thermistor to calculate the internal > resistance, it means the data is either not real-time, but > just adopting some fixed value to the current temperature, > or the internal resistance is adopted from the current > temperature to some fixed temperature. > > My expectation would be, that the BMS instead actually measures the > internal resistance via ohm's and law and Kirchhoff's voltage law. > So please make sure to understand what data is actually provided by > the BMS for a proper ABI description. > > Depending on the description I think 'internal_resistance' is a good > name. > > Greetings, > > -- Sebastian Hi Sebastian, Sorry for causing the confusion. I will try to clear it by explaining how the battery resistance is calculated in Qcom BMS. In Qcom BMS, it uses the Equivalent Series Resistance (ESR) parameter to represent the battery’s real-time internal resistance. ESR changes dynamically depending on factors like the battery’s state of charge (SoC), temperature, charging or discharging status. To estimate ESR accurately under different conditions, the BMS uses data obtained from characterizing representative battery samples, mapping ESR values across various temperatures and SoC levels under charging or discharging status. The characterization process with those battery samples on test bench would use ohm's law to calculate the battery resistance I think. These data points serve as a reference for real-time resistance estimation. During operation, the BMS software refers to this data and adjusts ESR values according to real-time inputs, especially temperature, which is typically measured by a thermistor inside the battery pack. I can use 'internal_resistance' if you think this is good to represent this ESR parameter. Thanks Fenglin