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 A4F02330B0E for ; Mon, 17 Nov 2025 12:45:44 +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=1763383546; cv=none; b=Wyicym4ecW41+EDYO0WI3yms5xTM0TcuqRQYGtj5BW7PNF8qYSNHg3gbK/22nxZPO8/xqsqaql3qYJTHYrzkgPaxXKh1ldBMobvR5lmvbf0sTO0wv+rvrVSGtvzNvAmtR0zVZuD8XEOlsK6VN/bhSLleCBIUo8ckoiEzGsiebl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763383546; c=relaxed/simple; bh=zAaBRN8aUVkBoo2Ai+HPbmL2d7bftI05RskM7Mnrp0c=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=Z9lFm/yYhiVdBvQFB2C5RHqzSOHuFkQY0vJiGluMDlq6Mq+uQyCuBkNI4k6hX4CZ/92XpyT7xVQcxKojM5Kn+EQv1p2lhSkL+7idYbHnZqCVSUS/tkES6cAktFqxiYt3718sLRZhlMiIRFZVjnFd2l/vrSLuw9br02LcSb1PJAk= 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=L3B36CcR; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=e3gXn1TT; 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="L3B36CcR"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="e3gXn1TT" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AHBhmHR2584318 for ; Mon, 17 Nov 2025 12:45:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= MuLTRWfP/NWeif4W5Wukk0z+JStEEIR4r6n4oQu+nMA=; b=L3B36CcRF/f/R6CT LMAM/9iI3xTMjhFkBBC6EmFEixqBQ3DsXTeo1M4xZFkow6RPcaroP7cHXzvUPAde y+fOW4P6RBWLnoVFxlj+JgVmydKgcmB3eLKHJ+dcnDbWuSeG3CxUTTPFWGyDdFbv 6f+BTdLbDbtIArinalfHoJntQ6k5ZyTy9omO3uN5G5oDtiD2B5zOOqWCi2Aw13YO VCPaJ8wFZK1irkPqDCVoBkBdL2NuRwAmo0THt4mJQWsjNp8R4bpckQ4/hD39Q5p/ w3PgpSqrmDR8wePJb6QYGW7FmK4h/kzymenCyl/k2f0GWQ3CfIRit0zIUOqFiVSj bSUEFQ== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4afssf9sqg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 17 Nov 2025 12:45:43 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4ee07f794fcso6222481cf.2 for ; Mon, 17 Nov 2025 04:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763383543; x=1763988343; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=MuLTRWfP/NWeif4W5Wukk0z+JStEEIR4r6n4oQu+nMA=; b=e3gXn1TTT35IyX3f8CchP5Qd9EKERKLYkqs2clFr1DqzNZPs1xSQuD6CSMHUo0ZXv5 o2lnjUSXt3Mfk3Pxxi+Wnd4k/vnE5AgCwt14CCUzt/0FuQH3/EsUoGiA4HuFUaRP9IZv tG3CTWDn87EIc2ng+MHl3lPG5O5OyCEuMsLV+T0igEnKnKrO5dhlx8YFt4vEs30u9XDg 192HRGvMRteDvHUSngtyiXKC4oHkyI4tsfIiHGbEeCFuqdBZu8af3Iz5egxX7aJNviCP thUfH2hNTxpES5u2n+8hSL6GlHnIT7DcVXlHg5sxSRsC9Xbkl98+Oha7xIfB9EjmscAv lxmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763383543; x=1763988343; h=content-transfer-encoding:in-reply-to:from:content-language :references: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; bh=MuLTRWfP/NWeif4W5Wukk0z+JStEEIR4r6n4oQu+nMA=; b=pG31PPzPklNDx68UkFW/8ehTgiw+XQzAsWp4umgf1MCBu20zPrJRPfbOSGGmT0hzME ucvNvVbAkW14yoN3gXiQRwIfM6CKtZpjhDJb2jcb4+3M7gjlWQ4dXT+xi6fR3rxR9AEV 9fA1g6Xg3/LTvTIaRguuyj+8LgFrXdTTK5jCwq0o8feIv9hZFsvdIr+lx38blM+DI/FF 9TFPs4OWify3WLfqOylJK0Ls/uGyXdKjMflW3OleAh7w2Nc8EPRFkvjiepvCODEPFd1A CFTMKJ96ENH+Mp9BKPP37BbXrn0HOdGungFIHTbzKPyFsNsOrh65ZV4uSlZmk9i2Bcih R9nQ== X-Forwarded-Encrypted: i=1; AJvYcCUEKYJdgOSYSIAXShNGKcT8P2BQSgFRVyDfHz+o8vbuN7g4MqM6/wh6yyRHK08U3xb4Eq0OL2n2i5MAEwI=@vger.kernel.org X-Gm-Message-State: AOJu0YwKko/tYfWEYDltwOd7W5kzNcsmZ60U2h8Nksagv7+40R9nS/ND uPakOeXq6G7PAkfUWe+Cn7W8SJqFZr/+Ms/+tP+KFNAxyM9rwhQ3jifwBsR2Sw+9JJHjASXy6CY Y1R5ygLKOuVJS/0GfdESug0s9S5SdSc+ud7S83m/mTiq9Uz7DMjQod7VIcegYdRBjxsM= X-Gm-Gg: ASbGncvAwM2PU+GhVgrwHX7IYQ58bSoMzO9+lD+LX7BiE1suXUe9quei9xXhb39l5lg kjUM8tbjbb3UCT0E/yz8gQBorlPYhJS0syUt7u+5HiD/jnU5YXcESXEwyXIFwe12k8LmO8nLFC4 7hHYqMHzb5xPrrFZOqsAZUCQHa0WaD23YelDbkiwc2Xv8hAXacjnZ+HIhUeaOlpdc1rwIXyx1DT JGvTcnHQCNt5AyaZep6CaghThue++joQNktICUfW5jDrOe+j5tyb/1r+kcrRn9F0ZoiR/1M04Jy qOJpCishQ0Po1bmbOxDKKdHjb5BLOn2rODFdMJIKNjZ+/bL/GjheLUPyctZIh3jYXtxeTxHrGB/ zkDm0D8hTMdwEZA9SaCie2gW8jlRa1Q3yHOP4eb1Db6GAVU8ap2KoNfPq X-Received: by 2002:ac8:7c45:0:b0:4ee:2638:ea2 with SMTP id d75a77b69052e-4ee26383190mr13677351cf.9.1763383542862; Mon, 17 Nov 2025 04:45:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1/SdgjmXEVX8GzC7p9XqxdwXaxPInFwyfN61ifnpwgnj8DKGAGgVzQsWm7YyJ+/G2u7dJRA== X-Received: by 2002:ac8:7c45:0:b0:4ee:2638:ea2 with SMTP id d75a77b69052e-4ee26383190mr13676931cf.9.1763383542098; Mon, 17 Nov 2025 04:45:42 -0800 (PST) Received: from [192.168.119.202] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b734fd809absm1076620566b.44.2025.11.17.04.45.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Nov 2025 04:45:41 -0800 (PST) Message-ID: <02db51aa-6e19-411f-875f-718b8215c373@oss.qualcomm.com> Date: Mon, 17 Nov 2025 13:45:40 +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 0/2] power: supply: qcom_battmgr: improve charge control threshold handling To: Fenglin Wu , Val Packett , Sebastian Reichel , Neil Armstrong , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20251012233333.19144-2-val@packett.cool> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: fa3BWUr7Hr-v5nnzSqgoWBxHejCce74E X-Proofpoint-GUID: fa3BWUr7Hr-v5nnzSqgoWBxHejCce74E X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE3MDEwNyBTYWx0ZWRfX009KNN0UWZZq C3XeOj8dVB0D/jm5Susu0gtq2kAsvHo6QIde3WjRfWhJ6u8pjmt/4WP25H64+1ay7pVmPLuoSHn PDaznl1njm0CZjn2DnxvoIXfwRAVavrxi/FCwrhvrN/Sn0AHBfUsJ1QlgPhW1hg4BZXEGlLxvmc J5Gopcg0rLknw7+kS/jnZTBRx2EJ2bpF37DhmYM0ySmQmO39TXF5E9M0uToprYDHpoyImnRUpA4 lLKIeE9R6dl0b3e1FUWnMhqoFDs3GgUolRKQi2cE9E7KDQJBUOwNV7nha22pawGKoqpEH6Ctr0K IDF31Yn1vuEGjPu/h1y/dbQORK4X3DXRCT7jHDQ29CsUnlJ+r7yE+OKU2PYQZKs3NNKEPh0PqAD iyUGPRvpyyPQSEY/CBTe+ps335rdpw== X-Authority-Analysis: v=2.4 cv=IrkTsb/g c=1 sm=1 tr=0 ts=691b18f7 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Yb_LYS4cgvVAXpmhZQEA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-17_03,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511170107 On 11/17/25 6:12 AM, Fenglin Wu wrote: > > On 10/13/2025 7:32 AM, Val Packett wrote: >> Currently, upowerd is unable to turn off the battery preservation mode[1] >> on Qualcomm laptops, because it does that by setting the start threshold to >> zero and the driver returns an error: >> >> pmic_glink.power-supply.0: charge control start threshold exceed range: [50 - 95] >> >> Kernel documentation says the end threshold must be clamped[2] but does >> not say anything about the start threshold. >> >> In this proposal I've special-cased start==0 to actually disable the >> functionality via the enable bit, and otherwise made both start and >> end thresholds be clamped to the acceptable range. Hopefully that's >> fine? > It is fine to clamping the threshold to the acceptable range. Thank you for making the changes. >> Or should the [1 - 49] range for start actually be rejected? > The minimum charging start threshold was set to 50 to improve user experience. If the threshold is too low and the system keeps drawing power from the battery frequently due to a large system load and a weak charger, the laptop will only begin charging when the battery level falls below that threshold. If the user disconnects the charger at that time, then the device would be only having a battery below 50%. Setting the threshold at 50 ensures the battery always stays above 50%. So can we set it lower? Such decisions are best deferred to userspace and/or the user, which can limit what the kernel exposes as necessary/deemed useful Konrad