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 4BE6E3A1B6; Mon, 14 Oct 2024 19:30:35 +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=1728934237; cv=none; b=afUo1EaqaaaPYiMuj/wC2xWVuGcOASHnqxfdY+M/Ace2j0AfERysyBMYSDcAr/CV8FJgRtKEAiSTBx3DXD/YpYutHi8ABLaw0t/1bOaUPiw0oXT4hywEmtMGG7yGarRxC19SW2ES8bN3PHA4bNiv4eWY7lOMGFjCwiinky9GLIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728934237; c=relaxed/simple; bh=oPffc+QgnS5EvZtETiVwcxTiQKsbv0uLQFJTJ24MjWo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=XiTVC/l0wVup+kl9smrPxRVNELvvFcMnHiMmAL91FaEGdPbb1ZwIKl7NeEpFpZ69BPI4j1FTX0P1nScgCn8fWW2vdkxOxrzGRugE13oj0NiNirpRfnBvTT4S0vn1SgRuqCkEjRpKKa1A6Buk4kmcSjX/4c76zizJhHwtQ8g2z9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=JfkgsnYZ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="JfkgsnYZ" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49EAYi5w030609; Mon, 14 Oct 2024 19:30:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= hhvTNL0MfexPhPQef4F60tN58ojWvhBWUNkCxE18s+E=; b=JfkgsnYZBvJcL4n3 0ghC6o2S65/YacJqp50ftUgMfGFjI0bXJ5acbh56m2JqgJGk43CBUxfKadGR8n56 U/fe93MWZUUVi2PlAhNgL/Voeig2BATB2g4wBgpK/QK/aPQYaFW7SFkRRAJa0ZUJ bnoI82hwBzgZEYzBhoz4ckS4NxnNfBZc/OotLltOYwQgIeA2wb+fUzdyzL67tzlu A90a7Ok5ViZrbtSdU10MlNKruIMrmgyGJm9HjO+cn07tFMJJjGAegnKCDmjTKs7s CpohnBEPCy72ijZth81kg/O9WoSlVuXpgTT3ITaBV57xHEptkf0XQ6+66j6jEYRN 2pmqrQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 427hvfw9eb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Oct 2024 19:30:24 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49EJUNMZ021236 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Oct 2024 19:30:23 GMT Received: from [10.110.109.95] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 14 Oct 2024 12:30:22 -0700 Message-ID: Date: Mon, 14 Oct 2024 12:30:21 -0700 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 2/2] drm/msm/dsi: fix 32-bit signed integer extension in pclk_rate calculation To: Jonathan Marek , CC: Rob Clark , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Simona Vetter" , Jessica Zhang , "Konrad Dybcio" , Sibi Sankar , "open list:DRM DRIVER for Qualcomm display hardware" , "open list:DRM DRIVER for Qualcomm display hardware" , open list References: <20241007050157.26855-1-jonathan@marek.ca> <20241007050157.26855-2-jonathan@marek.ca> Content-Language: en-US From: Abhinav Kumar In-Reply-To: <20241007050157.26855-2-jonathan@marek.ca> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: cCA7OfkVxO5YBf3E17MiOh4pAEBJNSh5 X-Proofpoint-ORIG-GUID: cCA7OfkVxO5YBf3E17MiOh4pAEBJNSh5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 bulkscore=0 mlxlogscore=940 malwarescore=0 mlxscore=0 clxscore=1011 adultscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410140138 On 10/6/2024 10:01 PM, Jonathan Marek wrote: > When (mode->clock * 1000) is larger than (1<<31), int to unsigned long > conversion will sign extend the int to 64 bits and the pclk_rate value > will be incorrect. > > Fix this by making the result of the multiplication unsigned. > > Note that above (1<<32) would still be broken and require more changes, but > its unlikely anyone will need that anytime soon. > > Fixes: c4d8cfe516dc ("drm/msm/dsi: add implementation for helper functions") > Signed-off-by: Jonathan Marek > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Abhinav Kumar