Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15162044rwb; Mon, 28 Nov 2022 08:33:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7bUryshKNuNTsVd/t7IL8bryiH8+ruhaEKVxGL/us8V1T+8bbw9AeyhtN8APAvFpDS5ER+ X-Received: by 2002:aa7:cf82:0:b0:46b:34b:5804 with SMTP id z2-20020aa7cf82000000b0046b034b5804mr8278136edx.240.1669653235207; Mon, 28 Nov 2022 08:33:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669653235; cv=none; d=google.com; s=arc-20160816; b=oKDkKKGAGx3cp8aPyzHbZC0hySHxUdzDWd0iH9YLLAznq22MQl4p59T+QLKeRbLIFG wfeD6kaiOe4Ze1VKfZMub6jWIUUf5pdL7EMXL4T9jY8rlkDGQdjzR4vBgx5DYpFlLfzj Kw8Ggdn8jcDgp3kJ0J6Z/eOgK65kFzq/WNZoBH3W7BwDIB736uvH203cXeya1CKpllC/ oUPq9EM6ywuTpx81b/QvXuF3c3oX8ACr9IE6hYf1KeEANEDkXgUK0O5OcXEeWbjGXjqt uxgwnOS1OXX19VBQs4XIS22OW2CGoev7v82p5yNWrGRzTrZut9ZsJZoyCER/rLMFIBjG NYKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=moXETMBPu4qgDWZEaWNz0maFmsYRZ1gY1aAezxuVCIA=; b=Pq7jemIZKEaBOAz8RUQlxixzrkT/FJeGgWG0M/u5foEMEt0Wj7k6o7+FCOGsFp51NY gpw1MtFCuRoDU+6EskczK4MOqTp9kAU2WwvqnPsWTErYdFPnb/cDRwmi588cvcO96M2o VkcZHXDocowrXqBmSNdJ7lvUMQjNlCp1ZgEOrozgXVhhpQX6ZMscWagpyLSTuySAPObS 3p23rcEofQ4kSgCYfPfLq2BOIWuWgIcFQFb7orVFtjlOHo8OUwHWYqDkwc47TKG/tVbK aXD1/ZRkxqwW1YxMm0nruSRI0T2rHMabs6+S3De2bGyAwKQa8dTPUY3PIQPXTsz1JNlv DgVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNCs2Mep; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a170906684d00b00781df71dbc1si7960207ejs.174.2022.11.28.08.33.32; Mon, 28 Nov 2022 08:33:55 -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=@kernel.org header.s=k20201202 header.b=bNCs2Mep; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232441AbiK1QIZ (ORCPT + 85 others); Mon, 28 Nov 2022 11:08:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231219AbiK1QIY (ORCPT ); Mon, 28 Nov 2022 11:08:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D7AAD2E1; Mon, 28 Nov 2022 08:08:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D7D326109A; Mon, 28 Nov 2022 16:08:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8E42C433C1; Mon, 28 Nov 2022 16:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669651702; bh=e/d2HLSoJ+Cdl/Iiy7G2SbF+wQYwslyvQLPYZpiYBoQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bNCs2MeppHulQTgTmrer17mO4DnNbVeJH54HpOBXpdrHvH+BE+pXfzXZSK8vGho61 WV9JNSazBdG7yo/a9EPW4Mmgy8ewrm+U0sjmy/WSyI058oE4caZj6K52DbpMlaG/vu 0xd+XzUadbBoygbYIT545X58jDoNS9kSD81FIUYbrE3zK5S9+MdsVOb+4vjNF73D6N t3FrQEje71Hqw/YU+9xi9bG7ukipKbZYabREB7nXkqh8WYw4Ju6CATb/abd1k2/Rir q6cM3YJ5raMyLsRVZclch0QVJKBmMObeTNHPrc8ZTy5icREumgCyrKCMgncXSaiHYj wBPnSHIoQy4dg== Date: Mon, 28 Nov 2022 21:38:07 +0530 From: Manivannan Sadhasivam To: Asutosh Das Cc: quic_cang@quicinc.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, quic_nguyenb@quicinc.com, quic_xiaosenh@quicinc.com, stanley.chu@mediatek.com, eddie.huang@mediatek.com, daejun7.park@samsung.com, bvanassche@acm.org, avri.altman@wdc.com, beanhuo@micron.com, linux-arm-msm@vger.kernel.org, Alim Akhtar , "James E.J. Bottomley" , Jinyoung Choi , Krzysztof Kozlowski , Arthur Simchaev , open list Subject: Re: [PATCH v5 12/16] ufs: core: mcq: Find hardware queue to queue request Message-ID: <20221128160807.GK62721@thinkpad> References: <479ce0c60d1be1c182f55efa9b53dd4850bb8f12.1669176158.git.quic_asutoshd@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <479ce0c60d1be1c182f55efa9b53dd4850bb8f12.1669176158.git.quic_asutoshd@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Tue, Nov 22, 2022 at 08:10:25PM -0800, Asutosh Das wrote: > Adds support to find the hardware queue on which the request > would be queued. > Since the very first queue is to serve device commands, an offset > of 1 is added to the index of the hardware queue. > > Co-developed-by: Can Guo > Signed-off-by: Can Guo > Signed-off-by: Asutosh Das One small nitpick below... Reviewed-by: Manivannan Sadhasivam > Reviewed-by: Bart Van Assche > --- > drivers/ufs/core/ufs-mcq.c | 20 ++++++++++++++++++++ > drivers/ufs/core/ufshcd-priv.h | 3 +++ > drivers/ufs/core/ufshcd.c | 3 +++ > 3 files changed, 26 insertions(+) > > diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c > index 7179f86..10a0d0d7 100644 > --- a/drivers/ufs/core/ufs-mcq.c > +++ b/drivers/ufs/core/ufs-mcq.c > @@ -94,6 +94,26 @@ static const struct ufshcd_res_info ufs_res_info[RES_MAX] = { > }; > > /** > + * ufshcd_mcq_req_to_hwq - find the hardware queue on which the > + * request would be issued. > + * @hba - per adapter instance > + * @req - pointer to the request to be issued > + * > + * Returns the hardware queue instance on which the request would > + * be queued. > + */ > +struct ufs_hw_queue *ufshcd_mcq_req_to_hwq(struct ufs_hba *hba, > + struct request *req) > +{ > + u32 utag = blk_mq_unique_tag(req); > + u32 hwq = blk_mq_unique_tag_to_hwq(utag); > + > + /* uhq[0] is used to serve device commands */ > + return &hba->uhq[hwq + UFSHCD_MCQ_IO_QUEUE_OFFSET]; > +} > + Remove extra newline. Thanks, Mani > + > +/** > * ufshcd_mcq_decide_queue_depth - decide the queue depth > * @hba - per adapter instance > * > diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h > index 5616047..14df7ce 100644 > --- a/drivers/ufs/core/ufshcd-priv.h > +++ b/drivers/ufs/core/ufshcd-priv.h > @@ -67,7 +67,10 @@ int ufshcd_mcq_memory_alloc(struct ufs_hba *hba); > void ufshcd_mcq_make_queues_operational(struct ufs_hba *hba); > void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 max_active_cmds); > void ufshcd_mcq_select_mcq_mode(struct ufs_hba *hba); > +struct ufs_hw_queue *ufshcd_mcq_req_to_hwq(struct ufs_hba *hba, > + struct request *req); > > +#define UFSHCD_MCQ_IO_QUEUE_OFFSET 1 > #define SD_ASCII_STD true > #define SD_RAW false > int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index, > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index 93a9e38..52c0386 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -2921,6 +2921,9 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) > goto out; > } > > + if (is_mcq_enabled(hba)) > + hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd)); > + > ufshcd_send_command(hba, tag, hwq); > > out: > -- > 2.7.4 > -- மணிவண்ணன் சதாசிவம்