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 9BC7D3672A8 for ; Fri, 14 Aug 2026 20:04:50 +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=1786737893; cv=none; b=K3gVWE6FaaOzuHPH9iIOdKCEE1jZ5PGkiZtSJ4dAYmseYruCi+4Z9WlsUQ/2xTvAP+mlcqwiP2y78H9dgooDOsL9iHGXq1LmWKCfEhwVWaeRZwZ9Yue1DFVli/hW3B2cvFjpNXj56mcpucIv+q6FW4Y9wKF0gcvphK8SLX13ChU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786737893; c=relaxed/simple; bh=PqxbGeU3AlFbbuLO4Qx6KTlR3cHdsKgstwuszsbi9Lk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sdSJE+tgT5Qzlm4EYzv/70F5l2U8ZFID1Gaz41tBT/viekpbrisiopFaj5gy0xI9E+tjv0Kmy7GfIPIBUXiE/azhLwXQlwgtPyGIvqwplGVlhheQcQ0hcyx5yTYUK82AEt91w37yBnMN68ei7ss6mWiL2NNkNEg6Y5Kwtft3nsk= 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=fxs8rgvD; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OuaFt0mI; 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="fxs8rgvD"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OuaFt0mI" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67EJglAM3187632 for ; Fri, 14 Aug 2026 20:04:50 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= 0Fpve06qOwXKVqrVK9hpQZq9j0jlXptVgQg8F0HgyqI=; b=fxs8rgvD+8Kcn6uY XzVeo66PlA7orGXZMh99e3n+QdW3etGUNe/PEN2w6kv6HmBf4XMj/Km5lvXyzE/t Bj5k1aH9uJAMn2sRVHKYjIjofflTxSOcCpy5nUyHyQzgAZRoEXPSVxct+lcxO5Fc JJDsEz+pF8poeKM8/vD2WnWcB9gC6kRMo3wCG4udnFFMvSmkxKFcfO/ZfzN9ScHh 527FKd6HwiO/97fEMhkNkIoEHA7Y2UOU4FnmtiUvw6ncFeZxf/sK8T6kzxdGyy6Y v8SKdBsjWsYvVrhmpyaql9jveu7T+bnYAPX3g4oqYO/P7hBZ7YGuK0irb8QeZUUY 7FxAQg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g28sk07g2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 14 Aug 2026 20:04:49 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38f5ac7354dso1651876a91.1 for ; Fri, 14 Aug 2026 13:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786737889; x=1787342689; 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=0Fpve06qOwXKVqrVK9hpQZq9j0jlXptVgQg8F0HgyqI=; b=OuaFt0mIEeOV7fwy0ZvKN8uSPHHLPMDFU18f1rRBmyGcqZ8hiGKgJJRwqx9OSUO1ez syOfIazZhJEmScOee27qJX09+NyaVUctt2ffJGCuiFxRwZrBftSTa4ZwcRLdbYKuTvgr 5qplflkbBpd8/lIRDM2z+P7OQXrqDrxU/YLVBf+1wmDR0pvq0NkgZF7nKMc4LA1rFslO qBRqUV62xpZsIlYsqljKQ16ByOrnL+q6EK2VNhYFGBihaDN1x28MWi/yMmFdHSf8HNlm ZLOBUKy+SQJhZKkWa1FeZFai6j/EXbPuS/HZnlo/zH619hbEPDfQXjrJU4Mk4rPDSAdF qj/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786737889; x=1787342689; 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=0Fpve06qOwXKVqrVK9hpQZq9j0jlXptVgQg8F0HgyqI=; b=LCNcl8arjFKIhgHE9P6t0U6t3wq47G3P7Pbtk790Lmmud2UcnYkoGVrFJeYLxCQjZL ncNQlOWyAD491OuPOh10F7K2pV5uU3j7q7iKNqQx1kMXyHHwf3VAwssEUS0VDiC7USJc CnWnjGdJcLLM3dXEygEZuCoH1POGwC0+DrPJNtlobU1QFfMhKTzfgdbSAstY4FR+xsoJ wx1zFQsNGtJOx7Y8eEKq3tsRZ2XMj77esQK0k6icc77meUWTyqhXCFer13fuHGArKcwu Joq9kbBA2Ej1/5NTx+0ZQrpN0Qt7QaCqfjVUXV/qFTUcc1ymWvwg3DJK3nFTqYTEoDLQ owSg== X-Forwarded-Encrypted: i=1; AHgh+RqYq49mGrhtXHNs+R9HCEkl51xXJIlf5pTZY2XjaBCXAFS1BWKa3K9M1aN7zSHMN6Kj+asRkwZPkbSoVn0=@vger.kernel.org X-Gm-Message-State: AOJu0YzJDVo1jGdCBSf+AUDyDp3kTWV15CbeoSRkmdRcwleL3M3QV7Se ZHkJzAbwVL9fBKAzwitANNZ0Vm01NkkfsAekW1+G3UXZAMjfJUW4a3t44z4x2w1Q1d+tPcYak/z wrtqIsAnJs6Q54dJqxRE/OOxjYDmC23+Ly6jt13ECEkTYv2n8RD9AgMd1bHKUhFynW4g= X-Gm-Gg: AR+sD13czUnEqdPUWQ3DkfGJ9UHN9WzXHGgXxd0edu3TPDZ1zSew9ITkh6dhH/p6t1E quaPMcSUSdrpjrQxqLOVmkmx4KrBHun8TUTFKvT13hwxGgYwKDnkCbcKedJPw47c5kgg6Wll4sa ttZyUsU1uwZ4j/BQY1BAJt0hQNXdf5D5o9Z92KAIUFJBQEUXsnvi12mL35Y+v0HS9RKpotKHOjd mK8wfCMlywxmqLzUYUo1KsTDXEGh/jduUgUsZNbbG1W9ctJIF9AVBiLwA5HWxhzp5NzCVvDJ14W Q66zS0rh4L4ElqeB9nOGq/nVCRr0GO5MITC3H6u1i1Wp/9Wek0sR5KUCxHmgZk1/0VDjGNV+yRc wSs5PjowMAwB29hjHDE+fzmcisIqjsTQ1H0qinIa99Q9DuG7A6uvd4w== X-Received: by 2002:a17:90b:3147:b0:38d:f5bb:e0f4 with SMTP id 98e67ed59e1d1-3933b6f1c52mr8883188a91.1.1786737889204; Fri, 14 Aug 2026 13:04:49 -0700 (PDT) X-Received: by 2002:a17:90b:3147:b0:38d:f5bb:e0f4 with SMTP id 98e67ed59e1d1-3933b6f1c52mr8883117a91.1.1786737888649; Fri, 14 Aug 2026 13:04:48 -0700 (PDT) Received: from [10.226.59.182] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-320d5bda546sm8071670eec.6.2026.08.14.13.04.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Aug 2026 13:04:48 -0700 (PDT) Message-ID: <369f1fa7-1849-4164-8b72-c27b00329b06@oss.qualcomm.com> Date: Fri, 14 Aug 2026 14:04:46 -0600 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] bus: mhi: host: pci_generic: Fix runtime PM imbalance for no_m3 devices To: Alexandra Lu , Manivannan Sadhasivam Cc: Vivek Pernamitta , mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260807143353.1932381-1-alexandra.lu@nokia.com> Content-Language: en-US From: Jeff Hugo In-Reply-To: <20260807143353.1932381-1-alexandra.lu@nokia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=LKxWhpW9 c=1 sm=1 tr=0 ts=6a7f74e1 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=9qxNCY_qAAAA:8 a=EUspDBNiAAAA:8 a=y6RN0brJjB4wVIL3e4AA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-GUID: 7NbwiE0CNYI_EEFNK9aGUIZ98W42Q9hc X-Proofpoint-Spam-Info: AW1haW4tMjYwODE0MDE1NCBTYWx0ZWRfX1kNXqPDUa9Hz MEtHoMuQiufWfHrll5WLCxTPSvTNiVV4mDnPpMMQEjK5HRJnNi6zT0UR312hJgmo/ALcILbtd5n c0gFdRfJS9qFfB1tV4JgTjlMtDeAXws= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE0MDE1NCBTYWx0ZWRfX+fO1tWshj+pD DO5EfPHqaWfTrpFpGCg7e6cKSAtwuBMN0XjMkw3XLw7zXe5HgPGg+wy9X2rrBhk5o0pmAkAmlSH Ugjd2d3IOQdLZMGISli+J2tU0xyEdPffmnEVcPmi8tUsHe2nnMpDxKHDCQksp6mZbwO7AlH1/Ne q2SA1xAqrZp0zibur4h8e3h8uUa4E/Ia1+RBD09+773frqQLzkSVr+esEOoKxuj/iIy58K6Gfvo 5J2XQ25Aa3nu/aqCXVNTNIlHISOdOYC3NupOnddKR+O7S0mOdsI8lCgNtxg/+TndRj0H+rTrvSM x4LUMwqGL8k7fLNrhVKD9RsApIZBRe02Aj8+e4B6ncds6UwowsMc4wyvTfjb61+uIqyRHgyN/zv AcQl4N3sEzNm7zhsbSuAELvGtpSwjtLS/YlPBDoRZOPrb5PVQEeu1zDaLi3YhoMjb/oHD1y+9K2 6riqJcaEwfQmXXbBaLA== X-Proofpoint-ORIG-GUID: 7NbwiE0CNYI_EEFNK9aGUIZ98W42Q9hc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-14_07,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608140154 On 8/7/2026 8:33 AM, Alexandra Lu wrote: > mhi_pci_probe() drops the runtime PM reference taken by local_pci_probe() > only when the device supports both PME from D3hot and M3, but > mhi_pci_remove() re-takes it based on PME capability alone, without > checking no_m3. > > For a device that is PME capable and has no_m3 set, probe therefore never > drops the reference while remove takes an extra one, leaving the runtime > PM usage count one higher after every bind/unbind cycle. That is benign > for the device being removed, since the PCI core resumes it to D0 on > unbind regardless, but the struct device outlives the binding, so the > count accumulates across repeated cycles and can end up preventing > runtime suspend altogether. > > Cache no_m3 in the driver's private data, as is already done for > reset_on_remove, and gate the removal side on it as well. Unlike > reset_on_remove it is cached for virtual functions too, because the probe > side gate tests info->no_m3 for physical and virtual functions alike. > > QDU100 is currently the only device that sets no_m3. > > Fixes: 0494cf9793b7 ("bus: mhi: host: pci_generic: Disable runtime PM for QDU100") > Assisted-by: Cursor:claude-opus-5 > Signed-off-by: Alexandra Lu Seems sane to me. Reviewed-by: Jeff Hugo