From patchwork Tue Nov 29 18:53:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asutosh Das X-Patchwork-Id: 27411 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp515263wrr; Tue, 29 Nov 2022 11:02:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf5NKBTCM6MweGj+tsgW+cR85gj7MDSvnsisK1275oK3DimULuuI0OheeBAXWCBfe0jJBwzk X-Received: by 2002:a05:6402:207b:b0:46a:dd61:b927 with SMTP id bd27-20020a056402207b00b0046add61b927mr17840105edb.218.1669748573234; Tue, 29 Nov 2022 11:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669748573; cv=none; d=google.com; s=arc-20160816; b=q8BYt5sk6LLlVqveKRO4mnkMDeizjsAMqj3xVAAVF6VzBSHADnn8laRtrC3bXjcsHY iPV0k5F3YQgMg3Em8YWlyHKEGAP1urG0uiCBNTifwuILhjvWOy2oS8ugMYXJq7E3uAIx buait99p3/ZF8vnvwPFEifTq3k2Pd7u/2JFBxJwFNCoP6ojnge5Xd8a5y+XTON31ywRM C4RTdVyk9eryPlWGrER55Qi1gdh8GTXHoKlyg1w1Y1mC5qFTWR5B1QF9r87oKa9yY/Bj nPYPzA6ejYSix7uYmHP5yN6/ZV+osxoUi1H/2lI9B/oWpOte9c06ruVNo/TbCooFYaV/ q5Pw== 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=nwslO5sZdjU7JhJNsU8Ycg71Qekb7VHOdEqd+wbszUd4ZTo0v17Jf3kH5kyLCNm1MQ DDFutg5QCjCeu4vyDArn+6+gYrw0rZc63RsAAbZxTom6TY/ovNsCnK/kWgmNpvEItxSI CtVTlrot5VjekFJ1z8y3lRkUcHjVWUSa7kIZM/ijeUKkcCTj3ytqHUg6o2h7BOTi2KCe QQvx30BuibX4JAEfiRRnaGCh2PiXDP9vEAjWamXWauCIKxStnR7wXn4cM95LhymcqPgY CyKCkcTRrk6ikk9Wn5QDFlqJYf6Mo8Eiaa7u0jktyqakVVf1zv8M4p7FT8WLT5ojKjLe Oazg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ByqpJyK0; 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 dt20-20020a170907729400b007ae814af68dsi14498294ejc.355.2022.11.29.11.02.29; Tue, 29 Nov 2022 11:02:53 -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=ByqpJyK0; 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 S236580AbiK2S71 (ORCPT + 99 others); Tue, 29 Nov 2022 13:59:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236502AbiK2S6z (ORCPT ); Tue, 29 Nov 2022 13:58:55 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 730D76D97D; Tue, 29 Nov 2022 10:57:16 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ATGhuwg022591; Tue, 29 Nov 2022 18:57:02 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=ByqpJyK0MzsxqmNirVOrHOP0fyUpRS78w4q3rrIUdYkkO6b1Eu+ag0JzooRHRSvx3D+r EkteljUNueT1dfFbABG6j0n3fgiF2LsF/VLld8XqcGSzrqHrb47MA0Z1E+nKntoKQb7q MDBBerp7qpWoLHE9vx/Anh0qYWVwyZtDQ5La3+CXXfbYMPAV7EFZVr1gvldGC+Q71pd1 9SPWyAb5Rq/f7Pl1PKjNGqYKq00nM0UEVRH9gjnZFtOKGQQWmpTOqn1XkEsApmQWrAZZ r4sssi+w4cjc9UKiZsZQnRYps+rRn8C+Fu3FE43A/LcBirxgKp+5WFWyxu7YPGzvMrg4 Aw== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m5fjx1ddg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 18:57:01 +0000 Received: from nasanex01a.na.qualcomm.com (corens_vlan604_snip.qualcomm.com [10.53.140.1]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2ATIv0R7020830 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 18:57:00 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; Tue, 29 Nov 2022 10:57:00 -0800 From: Asutosh Das To: , , CC: , , , , , , , , , Asutosh Das , , Alim Akhtar , "James E.J. Bottomley" , Jinyoung Choi , open list Subject: [PATCH v7 16/16] ufs: core: mcq: Enable Multi Circular Queue Date: Tue, 29 Nov 2022 10:53:22 -0800 Message-ID: <8aff808cab2db90ca6c701496ddf370af87d33eb.1669747235.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-ORIG-GUID: VWeUQFi8ts7GDWQ4KBBNvgNDdOJR1cgo X-Proofpoint-GUID: VWeUQFi8ts7GDWQ4KBBNvgNDdOJR1cgo 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-29_11,2022-11-29_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 impostorscore=0 priorityscore=1501 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211290108 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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?1750858280237161675?= X-GMAIL-MSGID: =?utf-8?q?1750858280237161675?= 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],