From nobody Sun Nov 10 21:46:02 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6673C7EE23 for ; Thu, 4 May 2023 15:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231523AbjEDPpt (ORCPT ); Thu, 4 May 2023 11:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231455AbjEDPpm (ORCPT ); Thu, 4 May 2023 11:45:42 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 994274EE1; Thu, 4 May 2023 08:45:14 -0700 (PDT) X-UUID: a0b36908ea9211edb20a276fd37b9834-20230504 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=fCCYVQIm++niPG/vrbbHZSGBakVFX+gZX6yE2kYy1wA=; b=g/1N5ymWdiluqZVNbiU8RNpYXlZbRb/i6G0pqJzh/BGAF/PNYzl3re8TrcZpBbz1tYueBVnOhESyLkpRD3FBUkfWO/WhIgTlpUkQDLyed/xVlU9M9uIznCIJ6Z9a5Q65qCTFHHZfgx/hxvx18kBH+KA1JYOCQ/b3PZg0xw91/C4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.23,REQID:7f67875f-4567-4b30-9c6b-1f2f5b54f39a,IP:0,U RL:0,TC:0,Content:0,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:25 X-CID-META: VersionHash:697ab71,CLOUDID:8c83c130-6935-4eab-a959-f84f8da15543,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:5,IP:nil,UR L:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: a0b36908ea9211edb20a276fd37b9834-20230504 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 470376234; Thu, 04 May 2023 23:45:00 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 4 May 2023 23:44:59 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 4 May 2023 23:44:59 +0800 From: Po-Wen Kao To: , , , , Alim Akhtar , Avri Altman , Bart Van Assche , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , , , , Subject: [PATCH v6 3/3] scsi: ufs: core: Fix mcq nr_hw_queues Date: Thu, 4 May 2023 23:44:51 +0800 Message-ID: <20230504154454.26654-4-powen.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230504154454.26654-1-powen.kao@mediatek.com> References: <20230504154454.26654-1-powen.kao@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since MAXQ is 0 based value, add one to obtain number of hardware queue. Signed-off-by: Po-Wen Kao Reviewed-by: Bean Huo Reviewed-by: Manivannan Sadhasivam Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu --- drivers/ufs/core/ufs-mcq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 937933d3f77c..51b3c6ae781d 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -150,7 +150,8 @@ static int ufshcd_mcq_config_nr_queues(struct ufs_hba *= hba) u32 hba_maxq, rem, tot_queues; struct Scsi_Host *host =3D hba->host; =20 - hba_maxq =3D FIELD_GET(MAX_QUEUE_SUP, hba->mcq_capabilities); + /* maxq is 0 based value */ + hba_maxq =3D FIELD_GET(MAX_QUEUE_SUP, hba->mcq_capabilities) + 1; =20 tot_queues =3D UFS_MCQ_NUM_DEV_CMD_QUEUES + read_queues + poll_queues + rw_queues; --=20 2.18.0