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 9DB95FBE1 for ; Thu, 11 Jun 2026 14:15:14 +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=1781187315; cv=none; b=rWVoCn5rYlFh7quLvyE2hoihiUXMErqHAkLOZftqXP186Ki/jZZSeYqP6kC4m8CVKUKZUe+6Rau9KNDUeXrVISeguGblsrbYmOwZl/oFzaSLL35zHaR3pG56ShDQwKHRXdD3kvrGA5/PQcgisQzJgUZ4HLP/y1HrPtAbKJyokq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781187315; c=relaxed/simple; bh=v8/2NAdTh3grkGL1fYKcTRoCCCKZ021jFd0nHDLmyH8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N+iyCwimGJwIpd6BiljJcATRwjaXi1TkLacAR8PKSvIMgVgZnvmAzcFhVUkm1CdHXfhPrwlj5g8Ppj/yE+PyJzyy1volKMk2HBCe1o7EFGwIeasn3p0laT7Ech4eep9MGviYVryK/3+cseR83zuq2fuPEVuEkqDCOKIHbqDKM/I= 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=cMpQxwQD; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=i4RvFyN2; 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="cMpQxwQD"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="i4RvFyN2" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65BCSpeE546411 for ; Thu, 11 Jun 2026 14:15:13 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= u39HCuL04RPljzA7VhkpK4vvo4WxMV7hzM5njFq5G/M=; b=cMpQxwQD3f/DWVzU +2CGynB6NttbqMrCZjmlZnrgq3Znr50wNSLACx4RHSres+tRevHX1igJuMDUBZ5p rihJ2NpZm888jY3+k/OPSGyO2j0dJ7hf437UAOL9RTB1+2h+Kd0M57113P+eYrZL tjS62ObanoabRPfPPeH4v7HSxMtcf1rdxewCBxoLdgr+k1w+REz4BdEkjc5W/sQW nTD43zVJVf2n3Juffwb7jMhFtghVKajzIRcMR10mHrF8IRVGlAcYKEXDcYvXAUYs fKBQ4iNeWdByCZv9ZnNxUlZiAvosAXEE16O+6UHcSW41rl2D0JFwa4BkhiO7tUUh JiKKRA== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eqe6skwc9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 11 Jun 2026 14:15:13 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-842cb4c62f9so927299b3a.0 for ; Thu, 11 Jun 2026 07:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781187312; x=1781792112; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=u39HCuL04RPljzA7VhkpK4vvo4WxMV7hzM5njFq5G/M=; b=i4RvFyN28lMzUfAXd4GLxnauQqT4ZbCc7CIT+ABiU+I6IQ56ZZAFm+nWNAiErcUfxW 2VzhyYuTnuWyNbcCxKmjMB4ypqZRpEG5QVBFAEh9B5lFQl007JK7cAJ0GR+9O/OYvwHr F/PMZLHVAy7Oh3Kv6oyh+iwJ8804ua+JjlGvCT8XD7NWuutN9GrnegSBBYJEvVKJ6nDS tWISWXU4cegeyM75FRkunnroWtzD5lczD2WGjjVPnlqrJXFXEWR6cJPvR4PvWcCdhgVh fArklowOKAktRh6ne6FD+HlUdXoj/guemvfWCYog01X/eNfIaDt9VEHhFuZt5u4Fymiu ECkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781187312; x=1781792112; h=content-transfer-encoding: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; bh=u39HCuL04RPljzA7VhkpK4vvo4WxMV7hzM5njFq5G/M=; b=F9P47U7knVJGZIVFTRE7QO3KQPtBnhTMgqVb57AbhANbsM5OdEiJZE0YMqZMsBz10t 9tK95CZcI1u7S/gDu+HEepeXDWUnqmx7eKghjNCYLBblwL8grUP+x8jlaNVEHTXct3mw k7n9xNGGYgtcSLp49z3MJ/2XAekh8ODheDoJghU77K7J4++/1+b7iGa2tRilSclLkxDx MSn4s8SEHdweayyrRv+lSiO1xJ+UR1psMn/amIhMftVn8Ra4aRhGbgaToGPBiNZmdFJB CCUyuHM8KrUI4jkm7e5j8Sv9YvDrbalkRAKWlhJjyaW2jr8fC2P/x21Xb32WI1Umc0xn aYmg== X-Forwarded-Encrypted: i=1; AFNElJ9aWe7q0aiNsmADUWiIy/79v4bGiED4MlIEk0qN/xAln3CoND7iurLE3vITlFNdmOaWlRki8ccXVRChhMc=@vger.kernel.org X-Gm-Message-State: AOJu0Yzh2BWYGuGtAkDnb9NIL4EQMRVrX9Z94sVoBty0GBcONu+xf5ks mHetOLYPFkJWGCFMWvEz4M1WhXKVY44hy5OhcxBZzfvnfOMISvZxiOMw4uIKWwj0nHiolNHdDyq J10UPX5tywsRFVGRCLnPFhmYOdYeKsFkA8RKDNa3m1vGeuvOvsUQpxf5S8vOKdJyNiik= X-Gm-Gg: Acq92OEF1GaJn4Xr5Dc3HV0EsOfqhQQHCKFoj3Yhv/gQR4trf1AzMgkVgspjLMlLeWu rGXRJyw08hl17Czj8p1C4KGe0ue9sObqanTmgMZyGGTWMz6QyDwQ8SVDtrz9Li+tWAEa9WQMx2C mVDr/vHPUoYiy73dhM5pzyCMJY5nUd+qeGJCyKtIiaUsWFrKRekJHvWtE5RHwL9FmRnpNIi7Xsx 9C7KfaqWhlUzZxjEEIxPpBq3fzi5i+iLjtNtd5Ts5NfuYJDv7RtManpYZMGWjMrz1vSYiKyQcCK T3QL6d9U9sCMtX4v0BzcL1uZOf5HKLZTd1LGZxDIJC81j/olu9IwLyJP8YF06LzzJIxk+JIi6bp fbVeeXp1AnMpphnkk07CZoIjJNwc01fYDcQr0MNba7dFV1YtUdmHb0MI4gYjeOYOIO13cnj0O6Y LQbsPMeq8hPQlFrAlY23YfrA== X-Received: by 2002:a05:6a00:300b:b0:842:3d8d:babb with SMTP id d2e1a72fcca58-84335ca5886mr2719584b3a.2.1781187310175; Thu, 11 Jun 2026 07:15:10 -0700 (PDT) X-Received: by 2002:a05:6a00:300b:b0:842:3d8d:babb with SMTP id d2e1a72fcca58-84335ca5886mr2719532b3a.2.1781187309567; Thu, 11 Jun 2026 07:15:09 -0700 (PDT) Received: from [10.133.33.231] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-843380c96a5sm2351132b3a.38.2026.06.11.07.15.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jun 2026 07:15:09 -0700 (PDT) Message-ID: <8f4aa04a-08fc-41a8-94be-2443dc845fd7@oss.qualcomm.com> Date: Thu, 11 Jun 2026 22:15:05 +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 v7 2/2] scsi: ufs: core: Add support for static TX Equalization settings To: =?UTF-8?B?UGV0ZXIgV2FuZyAo546L5L+h5Y+LKQ==?= , "beanhuo@micron.com" , "mani@kernel.org" , "bvanassche@acm.org" , "krzk@kernel.org" , "martin.petersen@oracle.com" Cc: "linux-scsi@vger.kernel.org" , "quic_nitirawa@quicinc.com" , "linux-kernel@vger.kernel.org" , "alim.akhtar@samsung.com" , "avri.altman@wdc.com" , "quic_rdwivedi@quicinc.com" , "James.Bottomley@HansenPartnership.com" References: <20260610071516.3763916-1-can.guo@oss.qualcomm.com> <20260610071516.3763916-3-can.guo@oss.qualcomm.com> <5a1e01dda55af091204c430ff383c97c8dd69ed6.camel@mediatek.com> Content-Language: en-US From: Can Guo In-Reply-To: <5a1e01dda55af091204c430ff383c97c8dd69ed6.camel@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=GbMnWwXL c=1 sm=1 tr=0 ts=6a2ac2f1 cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=XlE0QtBvFGsAfR79B8cA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-ORIG-GUID: xj1V5-TVYZlQ6Lb7tqyJjcE6QWYM8cKO X-Proofpoint-GUID: xj1V5-TVYZlQ6Lb7tqyJjcE6QWYM8cKO X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjExMDE0MyBTYWx0ZWRfX5rogJIQNr9gu GCjz9eggZPSrf6j3MZlXb5ohlXQe6JDPwG4QMVg9L4exNQDEPnEFvCl/R1t4NyCQyqIwjAPf0fh 7PMBnUVgB89TP+Y+fQKo71eVkU2Wom3E1OZTwlUurdjsL4OvHGPYRw/HRGj+ijoUvDPy3EiXKky IEueRWlN8rYQdMxgI7jtxIBCLdtGVHH1imDM69bDgdhuNYKaa/7FRsWgF2j3CpLo+nw2Xx2okMw DbmnOV58CVnoPjsM5jfJAFk1a2RfOiUgAuvDbI08a0/3DttIXEHftzZ+7ddtgT+LwXSLTl+RUHp 9IyGNPiKa+w7YjFpyc9+j0XVe8577b6KrYUtevhYZoQASItVEvvX3ELlReft5wDlsQJ7Z66kupx 9AGUJ24Ge8NqnsV02FghH/fKXRXrEaWr/anG/0YC71iPVsJAZBgWlnh5BbMnpZi0GrtV049MLlS L/jFooLKgHpojXf3UTw== X-Proofpoint-Spam-Info: AW1haW4tMjYwNjExMDE0MyBTYWx0ZWRfX0WnIeY5GpwgB LQVLCoiHbe76Xy/UOTbdNPt0lb8lzqis7Di4BiqSAZb39ggx0BQSIB03LNEnK9I4CxLxWl4zixH 17hr0C1T7kQon/TLd7h/GoA0D//CsWw= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-11_02,2026-06-11_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 adultscore=0 spamscore=0 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606110143 On 6/11/2026 6:11 PM, Peter Wang (王信友) wrote: > > On Wed, 2026-06-10 at 00:15 -0700, Can Guo wrote: > > +static int ufshcd_parse_tx_eq_value_array(struct ufs_hba *hba, > > +                                         const char *prop_name, > > +                                         const u32 max_value, > > +                                         u32 values[UFS_MAX_LANES * > > 2]) > > +{ > > +       u32 num_elems = 2 * hba->lanes_per_direction; > > +       struct device *dev = hba->dev; > > +       int count, err, i; > > + > > +       count = of_property_count_u32_elems(dev->of_node, prop_name); > > +       if (count <= 0) > > +               return count ? count : -ENOENT; > > > > Hi Can, > > Returning -ENOENT when count == 0 is not correct. > count == 0 means "empty property," whereas -ENOENT means "property > not present." > I suggest only checking for < 0 as follows: > if (count < 0) > return count; > > and letting the count == 0 case be handled below: > if (count != num_elems) { > ... > return -EINVAL; > } Thanks for your review and suggestions, I will update accordingly in next version. Best Regards, Can Guo. > > Thanks. > Peter > > > > + > > +       if (count != num_elems) { > > +               dev_err(dev, "Property %s has invalid count (%d), > > expecting %u\n", > > +                       prop_name, count, num_elems); > > +               return -EINVAL; > > +       } > > > ************* MEDIATEK Confidentiality Notice > ******************** > The information contained in this e-mail message (including any > attachments) may be confidential, proprietary, privileged, or otherwise > exempt from disclosure under applicable laws. It is intended to be > conveyed only to the designated recipient(s). Any use, dissemination, > distribution, printing, retaining or copying of this e-mail (including its > attachments) by unintended recipient(s) is strictly prohibited and may > be unlawful. If you are not an intended recipient of this e-mail, or believe > > that you have received this e-mail in error, please notify the sender > immediately (by replying to this e-mail), delete any and all copies of > this e-mail (including any attachments) from your system, and do not > disclose the content of this e-mail to any other person. Thank you!