From patchwork Wed Nov 30 23:50:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asutosh Das X-Patchwork-Id: 28110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1224820wrr; Wed, 30 Nov 2022 16:21:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4gVXMUZWfB/B4Xm3b1r6F4N/fpg3BIHxyCUJKf5Joqt96WGrcbNUTB9Zn/sO6ByMmgVsxV X-Received: by 2002:a17:906:79d3:b0:78d:b6f7:53c0 with SMTP id m19-20020a17090679d300b0078db6f753c0mr40153359ejo.527.1669854089051; Wed, 30 Nov 2022 16:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669854089; cv=none; d=google.com; s=arc-20160816; b=H/z0jrYfTC8uyDLj9/D7YjYO7ReBI/igjLGUHx9uvR9VTSFu74WIUYuNp3Xs5a6y6g OtH0T3rbGZy8o0jHQiVfsAwJ7QbEmX0b9RrKS9OlE2wqtRxoGGv9qmYLCRysNu0FnEo0 h+zozvfYJIl4+wKX6J0IGxGgkjGhSCQJd7v0NYE3xZdPi3wCXnpKEsZXgpcKFMYH40zg 0Peg0ZRABWx7zLVepSM4YHfl7mOuazbjUlezBJEBam0gpwvDdyLXxEGCRwNIiUUV1haA g6RY4KtCB8pcZq+hoZR8BxIAm7jPI46J8Plw2/z0INZ1piMmWpXolVDf38pMthoyb3vF y8gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bUx2F1njbYad5/Bph/yve0YlzZuGc9YGQi5bG0PZGWI=; b=Nbt6CPFsfyUWtSUZvJyQUDRGals0z7k2THJOFJdx5mytOIjX9M2zmjvnycQkhkACqV fWvhakJkHCX1h1RuCbMiTbXuoEvBOvp8xfo61p9k965xBBHttgkOTkbTw6C7yQgel24f 2M4647Mdd8wngJHDCm7ILn1vzzkFbXHlc9jDrf4RGJfTw5w7Ta/zw9Uq1rdo0WNFvwwS g9L6d7qj+qYC93k3r9uxCQgBwn6KliQx68owNEM6RyXNkqcyKYJW0WKvfJVWLQUWF4Vd TgC8N9UWFhyj3rOdnJWiqKu+8K8D7ZTDuwZn5j7XsznjcSbrMY2DKpTr1chInkywYvm9 8xrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KvlfSOmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho18-20020a1709070e9200b0078e063fc78csi2762623ejc.576.2022.11.30.16.21.05; Wed, 30 Nov 2022 16:21:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KvlfSOmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230159AbiLAALw (ORCPT + 99 others); Wed, 30 Nov 2022 19:11:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbiLAAKi (ORCPT ); Wed, 30 Nov 2022 19:10:38 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8EA8FD66; Wed, 30 Nov 2022 16:03:19 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AUNnOXr030770; Thu, 1 Dec 2022 00:03:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=bUx2F1njbYad5/Bph/yve0YlzZuGc9YGQi5bG0PZGWI=; b=KvlfSOmoZ4MTZakSFkqUKniSFcDOwssjhsh/t3ETHIkGAJlmZ2Fw2VYr56X+/qapciCL snCnvC/fYDNIWjdTLG7qKZHEN1S2F3Nmei4IODAmOJ3fkmnAA9K3x90O1SwDDmxGw1sZ 9D21afwqFEoeKxaMyrbsvkMQVPNXee2AtxWBlhxbUSzpC6yko6uz3OMED6M67BGTtcEh Y6s7SexXGj3MZjun+fu6xwjypUHeCuP2NnPtvyWVV0x8DSTk8eIjnP7GLdpA6/17dPJS AQetKknvDrgDLmBOT0k/kPjkBc9wsqrQAblFuxVG/5Kos1v2KXEShYNJDklf7F7rX+xW BQ== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m5yhu3xgs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 00:03:08 +0000 Received: from nasanex01a.na.qualcomm.com ([10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B1037rg026250 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Dec 2022 00:03:07 GMT Received: from asutoshd-linux1.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 30 Nov 2022 16:03:07 -0800 From: Asutosh Das To: , , CC: , , , , , , , , , Asutosh Das , , Alim Akhtar , "James E.J. Bottomley" , Jinyoung Choi , open list Subject: [PATCH v9 16/16] ufs: core: mcq: Enable Multi Circular Queue Date: Wed, 30 Nov 2022 15:50:48 -0800 Message-ID: <9fa85d2d02e275ced5c92736587a42ef20bcbe21.1669850856.git.quic_asutoshd@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: QOJ83OYS6cAxgCQBXFCYcWstku73a6Hs X-Proofpoint-ORIG-GUID: QOJ83OYS6cAxgCQBXFCYcWstku73a6Hs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-30_04,2022-11-30_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211300171 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750968921257420804?= X-GMAIL-MSGID: =?utf-8?q?1750968921257420804?= Enable MCQ in the Host Controller. Signed-off-by: Asutosh Das Reviewed-by: Bart Van Assche Reviewed-by: Manivannan Sadhasivam --- drivers/ufs/core/ufshcd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index adf3597..e9d6891 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8381,6 +8381,12 @@ static void ufshcd_config_mcq(struct ufs_hba *hba) hba->host->can_queue = hba->nutrs - UFSHCD_NUM_RESERVED; hba->reserved_slot = hba->nutrs - UFSHCD_NUM_RESERVED; + + /* Select MCQ mode */ + ufshcd_writel(hba, ufshcd_readl(hba, REG_UFS_MEM_CFG) | 0x1, + REG_UFS_MEM_CFG); + hba->mcq_enabled = true; + dev_info(hba->dev, "MCQ configured, nr_queues=%d, io_queues=%d, read_queue=%d, poll_queues=%d, queue_depth=%d\n", hba->nr_hw_queues, hba->nr_queues[HCTX_TYPE_DEFAULT], hba->nr_queues[HCTX_TYPE_READ], hba->nr_queues[HCTX_TYPE_POLL],