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 7D3022D8DC2 for ; Fri, 27 Feb 2026 05:11:15 +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=1772169076; cv=none; b=cwrmu62x+tlFB5bIJLHG+mRFolpijXYPyYgpEipgiSNWu6zLz8l4mw9I38oarBmpDm+Wn3uEZ0IIXLDBVeIAK89A3uBP6z4LYSYoyV81eTz3jGk+xMZrcGI66OLtFEhDT8B3aVaB8gcv65pnPUBlVUi60RBu8Bbx65i19nyZ8aw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772169076; c=relaxed/simple; bh=3F/EcwHaFt0a76T9HICVws+HVQa/bhzawNxJ+UmegzE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bMEO1feP32A9NpG7vxEqeByzXups/0n6dY6HyL6cYAtnQlbee/T9z0DfNQ2kaniyK8VIFO/jg2PipfRWBPDpqPDp4KXfyvKoEiOdIBRz9wvNuI1Tt9t8yNvjiLMrlaarJOoBiv+AtKQ70TJKci6JeAPfhaz4yKYDtuyBlyZ2Ozs= 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=Ddw3AbA0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Xy/34eVe; 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="Ddw3AbA0"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Xy/34eVe" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61R2Jtkq3185190 for ; Fri, 27 Feb 2026 05:11:14 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= NjJTpWloqr/bJjbh8x8C9pw0cFKgkVI0nle3ydeuQNQ=; b=Ddw3AbA0MFg7QDtd UlT+ED2OxGmgfzI1qdepdtkxliMt9j8zZCrKQJMq7wRZH2nw1YAR5+rohGxSSYUy a/aba6MszooTw9ZTn5C3yiZkGumADYw4Nxe/q/dF3y6SuMDs1dHUMzPMFu0LQXx4 IDYk5w3yEIm8brIqy2KhPZMgh+AZJXudT7wvgva6l2xQhLhQJGOn/cEjralXG+Z6 yD2S7y/JZUQbff3ejNR1fmOgzThREyJ/ROdZTnLuww+NoVTE+UWhpia1W6bfk4Bb AyawRnHefyFrW14DTIjzUBMrzooB0JZZKlD/dgU2gGL5/kuqW9YI2DIIGJEyONX0 VozvmQ== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cjmp63c95-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 27 Feb 2026 05:11:14 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-824a2ca6eefso719240b3a.0 for ; Thu, 26 Feb 2026 21:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772169073; x=1772773873; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=NjJTpWloqr/bJjbh8x8C9pw0cFKgkVI0nle3ydeuQNQ=; b=Xy/34eVemByUIArGIkKXsOzyFjXQw4kRXHgMJuVoKroGxnQkK0kgRM8MRSrP3qnZqb CNx0ueS6cm0nRN0Rlj4NHSFaOyu7PBlTVGDMgcjSBK7b1uRXb7TiLfQq58fVvxylpcK7 /crr9hFYo1dY70bAiURO3VMLLXAC4rUtn5CgYT8ZGYS5pmkko6n6FsyfotSC1NgcApGC 1w3ZkKn7twyAIRttyHLIigg87qNkiZJkWaRkqUM6XKojqNwoVnbNaXGTWnArVuqVxxq+ 7TizWHTPB8vHdq59tz+607JDgB+1P2OLSAi76Dv/UW/nj+CYRVruc3N1vLBGTcxoyp0H x0rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772169073; x=1772773873; h=content-transfer-encoding:in-reply-to:from: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; bh=NjJTpWloqr/bJjbh8x8C9pw0cFKgkVI0nle3ydeuQNQ=; b=UMbnKjouKXdfFt28fT+9FtXoTgG8sCh9yqkHBIB+0xJ2csF4MajrWemJP0ms5H9pHt aY/b/pUk+g8D2F2sBFnXORNcISisvcNtj7VdYXRBM9frclDgsW/pQcH/qK20cOnxPGLT PSfjSOkmNX+zh9a76bc/ercSkqREWb7lIVUhk4WwhAh21WIXWeigSGA2A9R20xe3ZPIg I//dfm9MP8cqVDEKUvOS056jGNsfhdX7PrpMEIj4qKS+q/Kou5jjYG669iyxCdiAa/EL MS9LxZqM3o3iYeUWN8vvSHL2Nm+7BUonCsaRh2dbJa5EgF4IGJcpoEkeTYuAf4y9LE2T Wgww== X-Forwarded-Encrypted: i=1; AJvYcCVwf1+dtVC+zhVB5qlYhmpHZMKoali1M4Nr5bvdgE+ZMURNhXp92taNfhMZegiOEZufi/XvPBkUmQ8b65I=@vger.kernel.org X-Gm-Message-State: AOJu0YzfOpak86JiDVnFALGOxgjOXn2H0gHiPvWuhUkaQGDho+nb52NP nn1gomshqxdu/ZvGczbbRSVwsYyv47JUzgggsSQLVOA1lidB17Y31V40niyngNTpURwsXA0zBvl +BRTAUbzIvbkCHOr6GhATiv5hD9Jq+LMUfZSTcTxy4FQXNhhoKIpzp42AKFKbGEHgAX8= X-Gm-Gg: ATEYQzzaPhoY+1/C7AxYYny8VuiJf1+RlrPQx7hWthghCSm2yKxN4Id2PtAzO6HHtLk BYMglPTVCOZgEvFiv9m5H+EzRBpVnVIwEGuF1HMoSmYPmaYSsdZaobda4eVXcPsPlKNnij2cWwt gBN1oxL//T9ePMSD8X7J7d2iTteJcvzH2wAiMhhwhsPJ/LW0fTkRE45c5w5LGASxmvFT8nnf2JE 4bZyKDBhFrLXalh1H7t0uQ2EFOeK6jXTOnxwNv4nFfyVT9VmYJz97SHfZdmpizFT6eungE/PjLl 44V9xDE9iYh5TSuG1tbWFuIaIBluNPlWSigkS6h4l3F8Vjm4KVxmyfM9mvgl0ccM7PACw7i+I37 xOEuLfxzJ6ecVkYZMdlp5s5OHSfo7QAVF+hun7GMxCYoQwld0/01oiVjJlFtqki/ijvJ/vwhWOH DA0KT7AwfGS+z81iY= X-Received: by 2002:a05:6a20:729c:b0:366:21f0:cbd0 with SMTP id adf61e73a8af0-395c3af1ae9mr1209505637.3.1772169073303; Thu, 26 Feb 2026 21:11:13 -0800 (PST) X-Received: by 2002:a05:6a20:729c:b0:366:21f0:cbd0 with SMTP id adf61e73a8af0-395c3af1ae9mr1209491637.3.1772169072873; Thu, 26 Feb 2026 21:11:12 -0800 (PST) Received: from [10.133.33.97] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c70fa82dd09sm3542913a12.28.2026.02.26.21.11.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Feb 2026 21:11:12 -0800 (PST) Message-ID: <45f8be25-2ca1-4ad3-a549-23b1ce057413@oss.qualcomm.com> Date: Fri, 27 Feb 2026 13:11:08 +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: [bug report] phy: qcom: qmp-usbc: Add QCS615 USB/DP PHY config and DP mode support To: Konrad Dybcio , Dan Carpenter Cc: Neil Armstrong , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel , Dmitry Baryshkov , li.liu@oss.qualcomm.com References: From: Xiangxu Yin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: 3H-jVVTWNC9vbk_U3UE8-0UOw-G42c7G X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI3MDAzOCBTYWx0ZWRfX5gUPD6fHg4XQ UfklmgJEDFHrxYrTrS517IHZ4HJZQPjLdblxdttG0JIJgzK2ppEWD535EioJ8RdKeTHB8k3OaEq zEp/hSPJYXLkFxmgZlUPmFspIPc1fBOHd2qL/F9xCrCIF7pqcCMoLIRmWMT0QZCb0A25uDxIVOd n8c7WF8d18wsiJuW6EhUtuQV0YlcDE7VX/xMhiwJo6xBSEAem6tbhNNIF/fBQur3UYTTFZkHh3D kWgHexJTnamjqI0+YSN9YOF+McpGJ8fjfFmKKIWjq9KKPuqEnrbGqJJqekhT1GX18sHsXlLNezg BkyNofrqGXEREreqOKP5aGqYFYF3ox9tpdZ5FgoluBYk3vm9UCK6OXJaR8OIaJ7LnJ9+WCUuq95 ZAixIK39BJ402t6TTT/xCgp5ts+oOfXWcL/jQMAweBeyOevQVMEaTeRX1MIGHUY/vSzspcWb5sb IaCtppigYLGuDf47rZg== X-Authority-Analysis: v=2.4 cv=daaNHHXe c=1 sm=1 tr=0 ts=69a12772 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=VwQbUJbxAAAA:8 a=JassTcn4au4-2yrw79MA:9 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-ORIG-GUID: 3H-jVVTWNC9vbk_U3UE8-0UOw-G42c7G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-27_01,2026-02-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 spamscore=0 clxscore=1015 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602270038 On 2/17/2026 11:27 PM, Konrad Dybcio wrote: > On 2/6/26 2:39 PM, Dan Carpenter wrote: >> [ Smatch checking is paused while we raise funding. #SadFace >> https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ] >> >> Hello Xiangxu Yin, >> >> Commit 81791c45c8e0 ("phy: qcom: qmp-usbc: Add QCS615 USB/DP PHY >> config and DP mode support") from Dec 15, 2025 (linux-next), leads to >> the following Smatch static checker warning: >> >> drivers/phy/qualcomm/phy-qcom-qmp-usbc.c:803 qmp_v2_configure_dp_swing() >> index hardmax out of bounds '(*cfg->swing_tbl)[v_level]' size=4 max='4' rl='0-4' >> >> drivers/phy/qualcomm/phy-qcom-qmp-usbc.c >> 777 static int qmp_v2_configure_dp_swing(struct qmp_usbc *qmp) >> 778 { >> 779 const struct qmp_phy_cfg *cfg = qmp->cfg; >> 780 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; >> 781 void __iomem *tx = qmp->dp_tx; >> 782 void __iomem *tx2 = qmp->dp_tx2; >> 783 unsigned int v_level = 0, p_level = 0; >> 784 u8 voltage_swing_cfg, pre_emphasis_cfg; >> 785 int i; >> 786 >> 787 if (dp_opts->lanes > 4) { >> 788 dev_err(qmp->dev, "Invalid lane_num(%d)\n", dp_opts->lanes); >> 789 return -EINVAL; >> 790 } >> 791 >> 792 for (i = 0; i < dp_opts->lanes; i++) { >> 793 v_level = max(v_level, dp_opts->voltage[i]); >> 794 p_level = max(p_level, dp_opts->pre[i]); >> 795 } >> 796 >> 797 if (v_level > 4 || p_level > 4) { >> >> These should be >= 4 instead of >. >> >> 798 dev_err(qmp->dev, "Invalid v(%d) | p(%d) level)\n", >> 799 v_level, p_level); >> 800 return -EINVAL; >> 801 } >> 802 >> --> 803 voltage_swing_cfg = (*cfg->swing_tbl)[v_level][p_level]; >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> This is a 4x4 array. > Thanks Dan for the report > > Xiangxu, are you planning to send a patch to address that? > > Konrad Thanks for the notice, Dan & Konrad. I just got back from a long leave and will submit the relevant patches as soon as possible.