Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5651611rwr; Mon, 24 Apr 2023 07:13:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bVHv1+DJapaBge0kb4v4/ZRZvhRpaW7g1/XVF3rqYhDBKTLsLzDNSv0etEGA5MHt4hqLnD X-Received: by 2002:a05:6a00:1a86:b0:637:3234:4e22 with SMTP id e6-20020a056a001a8600b0063732344e22mr19632804pfv.23.1682345627217; Mon, 24 Apr 2023 07:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682345627; cv=none; d=google.com; s=arc-20160816; b=RFJm0eSzgEckq8i83bWs+KAmdGkUewhX3GktzRnfb4MbEW8faJMF6zpiAFZ0exoGFe ffLd/ecx1+Jart2oejmJy7esu/ZS69mswl1ecHVtlU20454AosnU/nPrAwEHIWpdsCoL N6EaLnXD/6E+mZse08GpIeswSTTU8czObLOP6kgcrB08bQLHhsrOhYMSIubclF/G+TYy b4juRSzVoGGJsTj8NG+LnCkl4lapZKy/s2rcpDDjOhcmALr5alTXsb72SOTAxpgvMsnR kZ9BRYUw42kYWD2DhQX0kAW00nEXGt8y5Sdki3eLEeqkT45lTkks0lQubaV9XT5XnlB2 v6dg== 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=i6cFcjRTqTP1rP0UUIrGj0xGHyoSuykx2nxuSnLW+Uo=; b=BZn1No/vogcWodDZbhcgS33fkkD0m0R5/yfuUuOxYF7fkP2vKElic7XfHmnm178Ob8 ewwrus1zZJCi7Jz/OxF6rp3hTH4BXglTzDphtME2Zml5cxY/T4csrqABOE/madgmUzD8 r8ih0J2bEOif5uG/BNz/t+3x1s/9vW+SHAWFDnBCeaBhec6PBHfJ8xgvpC7r1o8+Ub0t Ho7KkfU500x7lRtF2yspOkaBOOq0hfEy86Xr2C4n+xg8UOp7EG+oZqxrEKEdN9mvZxYG d2u9RjziSx8UQpIK9kfc86AXolwTQCDQaShygKiSANq6AFJWlxAkvp9zWmc4HcQbJ+9a sb2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=GsXKEPpB; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a621b05000000b0063d3867ecf1si11181354pfb.89.2023.04.24.07.13.27; Mon, 24 Apr 2023 07:13:47 -0700 (PDT) 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=@mediatek.com header.s=dk header.b=GsXKEPpB; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231974AbjDXOJP (ORCPT + 99 others); Mon, 24 Apr 2023 10:09:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231803AbjDXOJD (ORCPT ); Mon, 24 Apr 2023 10:09:03 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EF2C83DC; Mon, 24 Apr 2023 07:09:00 -0700 (PDT) X-UUID: 8a9e0a42e2a911edb6b9f13eb10bd0fe-20230424 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=i6cFcjRTqTP1rP0UUIrGj0xGHyoSuykx2nxuSnLW+Uo=; b=GsXKEPpBLxSei9sYHLAgp9dOddZBmvRyivyhJtKJZkIp4WK7fMAZgpaqGkoy6FMMGA0BL15nS/5d9yORpHYk5/SMGqD01qo7C6fiR4vFLoh3MZNuQ6X3y1x8cTSGEYCAyHuky+uR1zERmIWRQn890HVHLeZ6wCft9rcgrgbXduE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:0b58c187-4e8e-450b-8624-6a7f0b6ba65c,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:024d57a2-8fcb-430b-954a-ba3f00fa94a5,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL: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: 8a9e0a42e2a911edb6b9f13eb10bd0fe-20230424 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 894255420; Mon, 24 Apr 2023 22:08:52 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Mon, 24 Apr 2023 22:08:51 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Mon, 24 Apr 2023 22:08:51 +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 v5 3/3] scsi: ufs: core: Fix mcq nr_hw_queues Date: Mon, 24 Apr 2023 22:08:35 +0800 Message-ID: <20230424140839.22358-4-powen.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230424140839.22358-1-powen.kao@mediatek.com> References: <20230424140839.22358-1-powen.kao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N 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_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 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 a39746b2a8be..c7b807f58dca 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 = hba->host; - hba_maxq = FIELD_GET(MAX_QUEUE_SUP, hba->mcq_capabilities); + /* maxq is 0 based value */ + hba_maxq = FIELD_GET(MAX_QUEUE_SUP, hba->mcq_capabilities) + 1; tot_queues = UFS_MCQ_NUM_DEV_CMD_QUEUES + read_queues + poll_queues + rw_queues; -- 2.18.0