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 7ED7C3793A3 for ; Mon, 4 May 2026 12:55:53 +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=1777899354; cv=none; b=bQ3AVIRYj6hppvGVeQPWPFF/PLsry+fds472/JnXyu6JDW9rgncFLzKRsnjCjiWBgCkZHeCvT4dhAXLSJ9c75kqD6V7S6yW+o5QHduzjkFf2L2Q0onPFQwt531BtepZdmnt3QyKve3/3knmx/UHKCGePeP8A1XrGMLCwTS9gkMk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777899354; c=relaxed/simple; bh=jdMfO+wVnXO8QtbdIYQW9kPgqzpCibK0jcuCZrC9udA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nVIQ+bBi1OQBY8gnalSn62Xa3Bahu6bGiRQikbyiMV8+yLaQgQY+vmTxi5ZYFQln6Me4kTppCVXlX9kin2sh/MSAn2WIGZoPSCuAkEL1HVSY+Sa1Sz4WHpYpbrDQmUBq/pRDtThF5Kaw2Y3orXXOi3/IaIStPGQI6XRSSc0j7iY= 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=Hesuz5Jh; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BG4y+C5z; 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="Hesuz5Jh"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BG4y+C5z" 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 644B48p54128658 for ; Mon, 4 May 2026 12:55:52 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= puGm2x20jalWEH3pSnTKZBC2VvUqLgjVbRrcGWaj4m4=; b=Hesuz5Jhgvh16Eib fe6XMFBOmmAL58ZYoKgC//G9Z7eKM+cBm8WKX+4ki8G8oOAis1GoEVnAzjy47H9T XHvE+UzJFoFynW6lZQGsX6fvN67Z0wBaa3OV71KjkkuBzxGxjsuCxRqlvFnHYTvR +MjMci0gdE3UXr2iyGlJLMoTaiwmacyWEjO7Mm1IRg1bZIvi3J80z5EdEEoaYYlQ 41HjqG/uPe0hi7B4Lv0BmaZ30TTCCM4ZnOcvdj9gJ0cjUKkoTrJgr8801u+a9lIg 57oEA5Y2ebaEkfjkzEskzXdtu2jHbsH1XmdVm9IG8tjUzwC9Mzr1j4f/Vt8cDwkX G76xkQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dxsdw0eut-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 04 May 2026 12:55:52 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2b24cd2e2b3so40299555ad.0 for ; Mon, 04 May 2026 05:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777899351; x=1778504151; 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=puGm2x20jalWEH3pSnTKZBC2VvUqLgjVbRrcGWaj4m4=; b=BG4y+C5z7tr+OqJS0jOXwmFJRNXeHXwG7ju9hmGDr6g6OKn2SLObli4XwgTYg2z1dp V6ntYBe7TlHNz9La4gWKPASf3F2+hSVIEZNIri+Qt8ItkglX2TaO8vYPjro2PkGiIMeA el5rQFI/uTACgCOFgD4aZGRWc38b59Qniv5eWtcFjwzx+8ItvArFj49IPbTYgCK1dEpu RddYdZoXr9nfn4V4wToOu9QCT89bRVA71wrylWZTAv4sU409Oiwm1h8Knp34pNmVH1Fv +ZcrLEMezSK2K93oaolCnLIpwuVvNRLvPIBRkY3TMjBjVhl6x4vBzgK8uk+QB4DNJ11T Zh4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777899351; x=1778504151; 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=puGm2x20jalWEH3pSnTKZBC2VvUqLgjVbRrcGWaj4m4=; b=KIFMsLXalbPjyTscFfMy5B/NDVTwJlLWzBq9vXUxoXl9KCWRqesI9xGtAkD82yGQvy 1XILTipMMS6PgHTVwsjdnANHs+PjAK1Soy5V9Yg2nUEgu4XAA3tZnZ+26hT355VRO9QL QYY3VW8uT4Rogn3+uI04ZjQXvtcvd7dsKCZSbUkc9DVCPi5zq1Gx0CVe/exmotYfoE/c 3ktyZ+h+tkp3cwffKxMb3kmvbfeqVuLEueQziLKklQ6DdoX9P2HOtYns12AUVQi5HMtM 1a4BX0ELnsjPUmTuQvTANxS7VjjmCNRZ6lvxi3Yh60I0+I0HHCL8xy+MdhMvztYXO/i0 IRQw== X-Forwarded-Encrypted: i=1; AFNElJ9GBYqD8xhrrLldpnewz3ktCC8vXIAtSHh1od5ElVCdNLs23W3EKpUx63Wzlarq+ippdqgdCNKBPy9K4ks=@vger.kernel.org X-Gm-Message-State: AOJu0YwunWHsLIomMlSeP60JTpDWUIB69zgjad1Jq22gMtZR6JY7xfe2 7NafpzwluEipqkMGS4YJhe8oBfHD68f0BXPVKn2EULAMiHYdV8Umk7xIj0y324/hT8DikON764A HaSJP0dnpdGPDOGNufLfrGLX0rvVKgLcRDt99I2DStIRBcvIaCmsUWyLRiGLmsRFRwBw= X-Gm-Gg: AeBDietAY0RL9By3EN/PKuQglJt7twdCKZQ3MrZsg6xMdStIcyQ4mxST+CtGa/Yz20x 4wcDax4n5XeJEiOyEDfqjVTt+QfSoZ5fWm1B290KsFbEVIUGwSKpmysJYrvSdsYXqVONwtLTlkm LJ7RaamiRTUMh4UKR/gs0IbSYy6eCOkYZQAEd0VAt4XzsEb2HbesyIkpzcOEQcg+BlMUlW9VjH4 phEaZ7M9CmV7pnLeCEtK73215b1CxLbqzWpnTYLiClpuEafiApM0Q/qOZLZGNxEDdf4nJIAopuq /8Y7oTArl9iw7d70Yq15QgFWW8HwZ/VAKCuckNVJjARFM1Eb21M0Pw//7o4iMQUkPRFA4yOEqt1 9LsHh1IKaWO4hAsz8k4IDycKrkYN63EO4XShaFfoGOrVBDcByL3x3/Cdypm3zUD7lUWbNMiLcYB M7itmh4FIDsE8HJXk5izWvBw== X-Received: by 2002:a17:903:1b4f:b0:2b4:5986:cd80 with SMTP id d9443c01a7336-2b9f2812383mr95668745ad.26.1777899351438; Mon, 04 May 2026 05:55:51 -0700 (PDT) X-Received: by 2002:a17:903:1b4f:b0:2b4:5986:cd80 with SMTP id d9443c01a7336-2b9f2812383mr95668525ad.26.1777899350893; Mon, 04 May 2026 05:55:50 -0700 (PDT) Received: from [10.133.33.164] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b9caa7e855sm99778495ad.10.2026.05.04.05.55.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2026 05:55:50 -0700 (PDT) Message-ID: <8a1cf09d-7293-464e-b581-5337f4087593@oss.qualcomm.com> Date: Mon, 4 May 2026 20:55:25 +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 1/2] scsi: ufs: core: Add a quirk for extended TX EQTR Adapt L0L1L2L3 length To: =?UTF-8?B?UGV0ZXIgV2FuZyAo546L5L+h5Y+LKQ==?= , "beanhuo@micron.com" , "mani@kernel.org" , "avri.altman@wdc.com" , "bvanassche@acm.org" , "martin.petersen@oracle.com" Cc: "linux-scsi@vger.kernel.org" , "alim.akhtar@samsung.com" , "James.Bottomley@HansenPartnership.com" , "linux-kernel@vger.kernel.org" References: <20260501131641.826258-1-can.guo@oss.qualcomm.com> <20260501131641.826258-2-can.guo@oss.qualcomm.com> Content-Language: en-US From: Can Guo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=a7AAM0SF c=1 sm=1 tr=0 ts=69f89758 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=kDnxYmXqCbPNdaTBimYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-GUID: 5eiAOl9xygIW1mseeSANmEv98oKOWSd7 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA0MDEzNyBTYWx0ZWRfXxjMQ1zNaxq3D E3G0/53q05wsPWEQNSLS/ZfmqlSALdtx6H592o9snoSaKN7+Zwn802BTCXQT2o6H/SxolhoBwEk 8wMko319k0tHuhC3gxTYWuygMmc57eQfBIktMHtbIk6/3igs3K1p/b2CCDqr4cf6//ahitlfoQI 3az3A03mJ0KlDINu88AERVhxpp3eTKsYTsNmpndk9GCFLKHx7qS7TZ8gAT4v0w8r4MvDxWQtYWP ph9Nb/XRP9PAJeABRv6ZZllwU5+HpJFtxDXzBGaoYjFBeW/ipLajdCkyrWMsLR7ImipshTdNdNW vkBThm4LLsD0T+z4tNIt2kl/geCzQy5KdXWwdbgl6h9rUIAnE9JsX13fVBDwWCwqHMF7ZP+BBj9 9L+NNARibq3i1ZsALBj3it6pp1MUtUHRi3/oZ8m3jKwJqRhEBQaW+NcljYsw3MUagH4Vjq1NKl5 AAjLHtwyXvRlIV/Mxig== X-Proofpoint-ORIG-GUID: 5eiAOl9xygIW1mseeSANmEv98oKOWSd7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-04_04,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 spamscore=0 adultscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605040137 On 5/4/2026 5:19 PM, Peter Wang (王信友) wrote: > > On Fri, 2026-05-01 at 06:16 -0700, Can Guo wrote: > > > > diff --git a/drivers/ufs/core/ufs-txeq.c b/drivers/ufs/core/ufs- > > txeq.c > > index b2dc89124353..fe647450a7a1 100644 > > --- a/drivers/ufs/core/ufs-txeq.c > > +++ b/drivers/ufs/core/ufs-txeq.c > > @@ -740,7 +740,9 @@ static int > > ufshcd_setup_tx_eqtr_adapt_length(struct ufs_hba *hba, > >                 if (adapt_l0l1l2l3_cap_local > > > ADAPT_L0L1L2L3_LENGTH_MAX) { > >                         dev_err(hba->dev, "local > > RX_HS_G%u_ADAPT_INITIAL_L0L1L2L3_CAP (0x%x) exceeds MAX\n", > >                                 gear, adapt_l0l1l2l3_cap_local); > > -                       return -EINVAL; > > + > > +                       if (!(hba->quirks & > > UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3)) > > +                               return -EINVAL; > >                 } > > > >                 ret = ufshcd_dme_get(hba, > > UIC_ARG_MIB(PA_PEERRXHSG6ADAPTINITIALL0L1L2L3), > > @@ -751,7 +753,9 @@ static int > > ufshcd_setup_tx_eqtr_adapt_length(struct ufs_hba *hba, > >                 if (adapt_l0l1l2l3_cap_peer > > > ADAPT_L0L1L2L3_LENGTH_MAX) { > >                         dev_err(hba->dev, "peer > > RX_HS_G%u_ADAPT_INITIAL_L0L1L2L3_CAP (0x%x) exceeds MAX\n", > >                                 gear, adapt_l0l1l2l3_cap_peer); > > -                       return -EINVAL; > > + > > +                       if (!(hba->quirks & > > UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3)) > > +                               return -EINVAL; > > > > Hi Can, > > The quirk UFSHCD_QUIRK_EXTENDED_TX_EQTR_ADAPT_LENGTH_L0L1L2L3 > is defined as a host quirk, but it appears to be used for the > device (peer) in this context. Is this usage wrong or intended? Hi Peter, Thanks for raising this; it is a good question. And I had spent quite some time on this one trying to make it as simple as possible... Firstly, it is intended. In TX EQTR flow, the host software programs a Adapt Length value to PA_TXADAPTLENGTH_EQTR and initiates TX EQTR procedure. With this quirk enabled, the host software is allowed (by Host HW) to continue TX EQTR even with a value which is above the spec max, so the Host software can attempt an extended (out-of-spec) value. Then the outcome is naturally determined by the peer device: 1. If the device tolerates the extended value, TX EQTR succeeds. 2. If the device does not, TX EQTR fails as part of normal EQTR behavior. So the quirk is intentionally host-only. A separate device quirk could be added, but for this path it would be redundant and would increase maintenance burden (for tracking a list of such devices) without changing the outcome. I hope I have answered your question and you can understand my considerations. Thanks, Can Guo. > > Thanks > Peter > > > ************* 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!