Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp766357rwr; Thu, 4 May 2023 09:17:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BnKkIZOMYhNBJfrgjBYVEdYfd2DxffZIr0mHom6pzWaqcVxx5MVfQkJBPlg+N7/A9Ba7r X-Received: by 2002:aa7:888d:0:b0:63b:859f:f094 with SMTP id z13-20020aa7888d000000b0063b859ff094mr3474981pfe.20.1683217027363; Thu, 04 May 2023 09:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683217027; cv=none; d=google.com; s=arc-20160816; b=ZfOF3xlgm0wNzUXD7HCnT42LynlGOZ6iM+2nDhTcA4KQOg+j2xspQ5Z8D8VkIVFeXI sEui1F9VRmJstB2smDw165pKNN87UhLYdZ7h5OF7bIY1lP5QkkPL00CsnwVRvdu7CWSH /ffKHqPZSN1EaeOr6qSSvIcMpDDGtXzsj+9M+hpyMMnlL+d6aQiIRiVtri4n7akq/fcy rGnS7B+QwH2+q43M6mFvoKzCU1hFyBBI6/sEilUuzus6pdbwRYfciLi8bfoCXpgsTxDD LZVa2KWlkz1xf78ilkw0wE7QtfWMrz1WRxLWveYOkAmHgAQ6B6OIZ5Gpg3CfcLGpaPHy +MNw== 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=fCCYVQIm++niPG/vrbbHZSGBakVFX+gZX6yE2kYy1wA=; b=s2qgOHY7M9e9JFv2ngu2DQoyhQaN+BHj+JN9WgUBnulRPCLERo7mPfiHL4eXqnZN0e +uAh4TCvN46QuyK6WUpYNQiw4fgu9uhvTZUBiRwgxERfuOIPQoKw6NYhAphOGO+MADUQ USed4BlQbZeRKZR4AstWsTuJ/b9kPjZBgaajmY5HFEfiC6C1QYSXwT6Pj13wEtOZSVrP DsM/HjZAImsRZpPs/4D/+5HBmwj+RHTHANw89mCRPJdYa8MgOeyOU5EZpSiqN0WgL4x5 T/yMKIvceOffJuYJgGQrIAWicgw9hxdY2hN0Yq13UFFunGqpOa6cLOgDMhj5rcWsiARg kU5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="g/1N5ymW"; 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 q28-20020aa7961c000000b006439b3de4a2si156347pfg.101.2023.05.04.09.16.53; Thu, 04 May 2023 09:17:07 -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="g/1N5ymW"; 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 S231519AbjEDPpr (ORCPT + 99 others); Thu, 4 May 2023 11:45:47 -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 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no 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 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 = 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