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 AEF0020B7EF; Thu, 23 Jan 2025 07:40:55 +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=1737618057; cv=none; b=JY8EH1kLk1+plgStBrd/oA4LDX2jN3pDUC1mAlH3QhzHGrQDHMzoVD7ruqpFxX2UZRp59Sd9tm6QbbXdbxxpnOmMux8GWoYTdfRGPui66u/PJWQvWYX/Fr76tI5yeHLu/vSqoNR7JUYdnCWFxCRrxc10Lv65zTjBKTbCFtmR/eA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737618057; c=relaxed/simple; bh=PVlS6lpQHIWqWw8CLSCLLPNoZCR2oxufSSD/Vjrbh2E=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=hzbJZJuBFTKEXmxVb1Ln+ST/mqo6mGFcw+GTN53EMmCAHhZFS6SPd2yj0vF6GmEPFGn7Ng3ptQh2Vka3F8sUFvpFgBI/mAcpbZaU1xhQ6d1WM3Zp+wm6RwuNau8hQvBI4Q4PnztYTFJzW0OUZ1yrZbdFcu3+xfMMy1cpcGyk+1k= 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=HGKeK+7U; 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="HGKeK+7U" 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 50N6VoZZ008981; Thu, 23 Jan 2025 07:40:41 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= zxotyukJrUUbcEXkl+hJ4/F3vjRxLVqJH3XsYaKQ5S8=; b=HGKeK+7ULGUuAJre dOzmYtowz+7vrMlSeI9btG2cGsAzGgjtQLB2k6BxlA4HmlFe8NMmm+qscWBJf2CJ wr6zaqkGOZGvv9GhDwK/qORILF37P7Y7k2gcQqu/c+3YxT5taXnF+B7lGj5flnkg baLP0NB3XDlC52x5JCnO2/tIZWuctoPl5R2m6T3Dv0dwPldYh1wuea7G8GSrJ52p uNmLk6z+pjr2YD51oCBpJoODj/LUdMV4tuOB10Dt37rUCSHWeF6BstRpK9HtXNHS F1KIqZQdx13zYhhW3lLvMkC8G0TOzLVRUx9Ao/ti+b2gxbOz8VkeUSZdj/Yg5ak8 mBDoGA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44bgk1g4jb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jan 2025 07:40:41 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 50N7eeoX008672 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jan 2025 07:40:40 GMT Received: from [10.239.155.136] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 22 Jan 2025 23:40:36 -0800 Message-ID: Date: Thu, 23 Jan 2025 15:40:33 +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 3/8] scsi: ufs: core: Add a vops to map clock frequency to gear speed To: Bart Van Assche , , , , , , , , , CC: , , Alim Akhtar , "James E.J. Bottomley" , Peter Wang , Manivannan Sadhasivam , Eric Biggers , Minwoo Im , open list References: <20250122100214.489749-1-quic_ziqichen@quicinc.com> <20250122100214.489749-4-quic_ziqichen@quicinc.com> Content-Language: en-US From: Ziqi Chen In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: u1hnh0irVUipXBCcwpviaNOah9bFWAAU X-Proofpoint-ORIG-GUID: u1hnh0irVUipXBCcwpviaNOah9bFWAAU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-23_03,2025-01-22_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 phishscore=0 spamscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501230057 On 1/23/2025 2:30 AM, Bart Van Assche wrote: > On 1/22/25 2:02 AM, Ziqi Chen wrote: >> +static inline int ufshcd_vops_freq_to_gear_speed(struct ufs_hba *hba, >> +                         unsigned long freq, >> +                         u32 *gear) >> +{ >> +    if (hba->vops && hba->vops->freq_to_gear_speed) >> +        return hba->vops->freq_to_gear_speed(hba, freq, gear); >> + >> +    return -EOPNOTSUPP; >> +} > > Please remove "vops_" from the function name. I don't think this part of > the function name is useful. Additionally, please return the gear value > as the function result and remove the "u32 *gear" argument. > > Thanks, > > Bart. Hi Bart, Thanks for your review~ In ufshcd-priv.h , the function name of all vop wrapping APIs have the same prefix "ufshcd_vops", I need to use the same format as them. As for return the gear value as the function result. In our original design, we also return gear result for this function, but finally we want to use return value to indicate the status , e.g,, if vendor doesn't implement this vop, we return -EOPNOTSUPP , if there is no matched gear to the freq , we return -EINVAL. Although we didn't check the return value in this series, we still want to preserve this extensibility in case this function be used to other where in the future. -Ziqi