Message ID | 20240220095637.2900067-1-rohitner@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-72759-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp305102dyc; Tue, 20 Feb 2024 02:22:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVxiQEBSLApd8IgOntqNCE2vjtevO2To04ueLJViGKpF9yzPx9YlQwqfVJnD3Qd6kqxg3xQ35E7va5yMFWq8ZIHxpewww== X-Google-Smtp-Source: AGHT+IFC5jLpC9hAjRfij7NBt/SOrnAqnzqlzASSKHf5t47ArURZCz4tzVTTS/uTrsNpeVUe1uDw X-Received: by 2002:a17:902:d50e:b0:1db:ea2b:d2c4 with SMTP id b14-20020a170902d50e00b001dbea2bd2c4mr9002503plg.15.1708424576855; Tue, 20 Feb 2024 02:22:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708424576; cv=pass; d=google.com; s=arc-20160816; b=u8zHpYX0Mqg1LVmbrF63voOy6F1RfTpM43VWVzHprAQ1MxRdZ64wPXdXFfzNMSEkcU 8kk/sPz2kyI8rgFOyKxYGxAKEERCTpeDJYakoBi0x6m63kRv5ekPM4EBrwXdVz7+K3EL QI8imCfO3SUFeBnFM3nru3TLas+6BSHWTs0bSyxnQAiwzXLhWw+nOWoPO+3jhKu165fx z1NajVRTRxHA6sBEyjtxxmGV/rI+Wjt3abSMUB9eX1TSLDkdGRjE8qBtzGGWO1tpy6A1 N6y4byAtVzox8+gdOouHwTn5QNdb/wPCQTQCnrWjr9Aa+iAjd1K8ybF2dfolNps33oZb yb9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=tsP9YAs3ATUDlmKMnOUj5SyinmDzqfFQjHSuoj373s0=; fh=OE2hyhCF4Qviq4WNb7IlJn3bhHQ6Y7ny4Odb527EROk=; b=fIN/at1lbChCm5W7LsOCHn8gEBYrQf3Lvj77WWjstRVy7sIYL56+U6z4jPaUDiRQhz 2mnzXfRZM4ou79+/gNU3hUuYR9QGX7ocAoYAL8sf/cCD06QgY/xLDzIeGekrz8zWra2W F6dpUY76Zo+L138SUN2lzSNuesGwah4PeZG9e6TmFKUSxgYMxqNEPP+97wYvJ2pEc28j errdBCGuK7/buHLzVG03wC/38z88FRQwdMQ5cKI3zpT/UoEMZEC7Gm/oBztJwQegUJco 48sPHrxXxDhxTOodAORcMRnznOM7M43L6jLSS+Zm/Xc8TkbZLRSoQ+OFN8C1j6fI+L/j yV/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EFDKxKR7; arc=pass (i=1 spf=pass spfdomain=flex--rohitner.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-72759-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72759-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e11-20020a170902744b00b001db45912e65si5843360plt.501.2024.02.20.02.22.56 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 02:22:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72759-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EFDKxKR7; arc=pass (i=1 spf=pass spfdomain=flex--rohitner.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-72759-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72759-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5397CB26088 for <ouuuleilei@gmail.com>; Tue, 20 Feb 2024 09:58:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF70E63117; Tue, 20 Feb 2024 09:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EFDKxKR7" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A68D360EC5 for <linux-kernel@vger.kernel.org>; Tue, 20 Feb 2024 09:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708423030; cv=none; b=EL8lcmVrESqKWL17A4+XEH6uw9+617ThU/veFIwe497vRJZYoFoVhiTkFBQOrNvv6hi7Mo1RIQE7i8cCbB6NG/LLqZToE1aN4flTEqo7yj7Znv5Bz98n3yvuLwRtyZYQu/7NCUOCNlK5nCeiBXVHr3ClXz6joDpokW+44ueQ7O0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708423030; c=relaxed/simple; bh=5i6IUnS3HBED35I/Esul/eXWCBL7mQMHTbaMIBPY3/I=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=XRed4CWGUWLLO0S7WNfT5X/Q18HtRIP+4uRO/jae7ET6dvovJQT5wA6+B0cC0dv8hrKNPhIpvHERkHeDjXZd0wi+PD4aUbsQwNphRqU87ENgwDH/atTtgMDV3EDgYFVvpparFjpke3wC6tB/K+rp3TCgtIucwtW33w7lrSDnFO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--rohitner.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EFDKxKR7; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--rohitner.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dcc0bcf9256so5074440276.3 for <linux-kernel@vger.kernel.org>; Tue, 20 Feb 2024 01:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708423027; x=1709027827; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=tsP9YAs3ATUDlmKMnOUj5SyinmDzqfFQjHSuoj373s0=; b=EFDKxKR7D4dtUIB7j/QVOZychSCpZUP0V7KNJiVwvDdJwi/Hoxx0TVnJUQ+ECoU//n Z8mcScSdvHPqqFOSpibOh5l3v2iKE8Xesop9jIL77tM95Z2Rl9LfqQwXfSH2ySdagqYI EM581J0scyOA8wR7Mc0BX25P0SvqChLAzad5fzS7rE02aobncF6RfwF81Lzvj0Zkq4V2 N+eZIRDyv3HVCmEjKXraVE1k9B01CfAscK9Sveli8AjeLTiNARH+WJicvBjA4Rbqdeod 0d7yEFWe5YZBntyv0naRPIIGPw6up2LmJztkDdRISfBPhvSGErxWLennWPHHpPS8ootu SugA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708423027; x=1709027827; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tsP9YAs3ATUDlmKMnOUj5SyinmDzqfFQjHSuoj373s0=; b=Yn63LryKnkRb0fxMftlVKvb0jmt8ikluGpLLbc4e1szSCHXlrYNxiOpAgsRpbieQlG JV0YxYq3aioSsEnCZ0QuUsPCrK7ZtLo/zqNxE0V1zKjkIl316PSTzVrHqqcDjxsSHEb8 19oqi/zYVVG0+ALbjiEDKDO9PHdn0bfzKXSrwS7rZf+ILgbW1WZPg3nLLDgvRJsW+u2/ TuYyaheYPj45ddVLk+A8hb5Agi6IZMz4Fcc4INPktq1aMF02q0Uhpte+SOUA5xSuHNKK hZ3OTMJuZz++V8v/RqDH3zSmmDSklx/ewgrjL+/C1Mh9cIpxf362OllFsjQvWmXxSFky QoDg== X-Forwarded-Encrypted: i=1; AJvYcCWCjhcJk+cetaGFf4kqhaRgh6LOgM/OkcF7aVkGdmXBHFkrVpbLSUu5gAZLD+RYn2gSBCIfZpObXZ+ucQmJcQ8FY44mcF4In36RmLvF X-Gm-Message-State: AOJu0YyOQSsfWY+9ZUwVzA2XdMEHilOKC//DEc2P//I6Tqg9zBHmp3o7 gulEbxaIVkDjpno7cbhoOMpzR0ETkmNIOF8L6oq6WA1to6QwAtXEFTiNab3fU9G+jkqhMVzQ1dC /TIomBpIyGw== X-Received: from rohitner.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:413]) (user=rohitner job=sendgmr) by 2002:a05:6902:1547:b0:dc7:3189:4e75 with SMTP id r7-20020a056902154700b00dc731894e75mr552327ybu.3.1708423027641; Tue, 20 Feb 2024 01:57:07 -0800 (PST) Date: Tue, 20 Feb 2024 01:56:37 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240220095637.2900067-1-rohitner@google.com> Subject: [PATCH] scsi: ufs: core: Fix mcq mac configuration From: Rohit Ner <rohitner@google.com> To: Can Guo <quic_cang@quicinc.com>, Bean Huo <beanhuo@micron.com>, Bart Van Assche <bvanassche@acm.org>, "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Avri Altman <avri.altman@wdc.com>, "Bao D. Nguyen" <quic_nguyenb@quicinc.com>, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Rohit Ner <rohitner@google.com> Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791413009225704426 X-GMAIL-MSGID: 1791413009225704426 |
Series |
scsi: ufs: core: Fix mcq mac configuration
|
|
Commit Message
Rohit Ner
Feb. 20, 2024, 9:56 a.m. UTC
As per JEDEC Standard No. 223E Section 5.9.2,
the max # active commands value programmed by the host sw
in MCQConfig.MAC should be one less than the actual value.
Signed-off-by: Rohit Ner <rohitner@google.com>
---
drivers/ufs/core/ufs-mcq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 2/20/24 01:56, Rohit Ner wrote: > As per JEDEC Standard No. 223E Section 5.9.2, > the max # active commands value programmed by the host sw > in MCQConfig.MAC should be one less than the actual value. > > Signed-off-by: Rohit Ner <rohitner@google.com> > --- > drivers/ufs/core/ufs-mcq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c > index 0787456c2b89..c873fd823942 100644 > --- a/drivers/ufs/core/ufs-mcq.c > +++ b/drivers/ufs/core/ufs-mcq.c > @@ -94,7 +94,7 @@ void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 max_active_cmds) > > val = ufshcd_readl(hba, REG_UFS_MCQ_CFG); > val &= ~MCQ_CFG_MAC_MASK; > - val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds); > + val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds - 1); > ufshcd_writel(hba, val, REG_UFS_MCQ_CFG); > } > EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac); I'd like to hear the feedback from the UFS controller vendors about this patch since the UFSHCI specification of the MaxActiveCommand controller field is ambiguous. While the example shows that 32 should be configured as 1Fh, this is not documented in any other way. Thanks, Bart.
On Tue, 2024-02-20 at 01:56 -0800, Rohit Ner wrote: > As per JEDEC Standard No. 223E Section 5.9.2, > the max # active commands value programmed by the host sw > in MCQConfig.MAC should be one less than the actual value. > > Signed-off-by: Rohit Ner <rohitner@google.com> > --- > drivers/ufs/core/ufs-mcq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c > index 0787456c2b89..c873fd823942 100644 > --- a/drivers/ufs/core/ufs-mcq.c > +++ b/drivers/ufs/core/ufs-mcq.c > @@ -94,7 +94,7 @@ void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 > max_active_cmds) > > val = ufshcd_readl(hba, REG_UFS_MCQ_CFG); > val &= ~MCQ_CFG_MAC_MASK; > - val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds); > + val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds - 1); > ufshcd_writel(hba, val, REG_UFS_MCQ_CFG); > } > EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac); Meidatek host controller MAC_SUPP_MAC setting is 64, which should config to 0x3F. Reviewed-by: Peter Wang <peter.wang@mediatek.com>
On 2/20/2024 5:56 PM, Rohit Ner wrote: > As per JEDEC Standard No. 223E Section 5.9.2, > the max # active commands value programmed by the host sw > in MCQConfig.MAC should be one less than the actual value. > > Signed-off-by: Rohit Ner <rohitner@google.com> > --- > drivers/ufs/core/ufs-mcq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c > index 0787456c2b89..c873fd823942 100644 > --- a/drivers/ufs/core/ufs-mcq.c > +++ b/drivers/ufs/core/ufs-mcq.c > @@ -94,7 +94,7 @@ void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 max_active_cmds) > > val = ufshcd_readl(hba, REG_UFS_MCQ_CFG); > val &= ~MCQ_CFG_MAC_MASK; > - val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds); > + val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds - 1); > ufshcd_writel(hba, val, REG_UFS_MCQ_CFG); > } > EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac); Reviewed-by: Can Guo <quic_cang@quicinc.com>
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 0787456c2b89..c873fd823942 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -94,7 +94,7 @@ void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 max_active_cmds) val = ufshcd_readl(hba, REG_UFS_MCQ_CFG); val &= ~MCQ_CFG_MAC_MASK; - val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds); + val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds - 1); ufshcd_writel(hba, val, REG_UFS_MCQ_CFG); } EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac);