From mboxrd@z Thu Jan 1 00:00:00 1970 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 BE266C43217 for ; Sat, 26 Nov 2022 01:28:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230124AbiKZB2S (ORCPT ); Fri, 25 Nov 2022 20:28:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbiKZB2R (ORCPT ); Fri, 25 Nov 2022 20:28:17 -0500 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C1731BE83; Fri, 25 Nov 2022 17:28:16 -0800 (PST) Received: by mail-pl1-f182.google.com with SMTP id w23so5313191ply.12; Fri, 25 Nov 2022 17:28:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=irS6qchuAX89kfaEICcGZqVuhwCEtkw4+cBnMIMsRE4=; b=A5vcvHFTkkwG4te5hFcS6RhuPn+kj3aMiRvdIgUQaDOYM48zSPRaP90q4nx+CrhbuW El7+PsRcldzYu4+lrr4zKTqC5YQEsLQ2gK67eu30x2fHviWOgqwJ60vE8TXn2iyvi/Jv 9Zef0HACdgoDshcuWytWSpNmR4/5u0JgbopE/CxDKpAzKxd1XPN2xNE8cZ1H4JAffE7h QecjiJ6IpJDYLcM8dfjfa5EOJUAFbnROxFq1HEtp4xEH2cgl1EwdYMDePv2sXb/wORA7 cjcnu39D3Yh0FjiHSedxYDZ+j5UJJoWpz6VoxqIuJ8fj6UQ/GFRCCHlzO59XF4b0tQ2U 6ZQw== X-Gm-Message-State: ANoB5pmmQ+PsO9n/CPWSSzyIX7/vY+EpBC+YQBqv4vF9naoFvN/FlNXk vKDpu44BMOUhZdx1hgovAKE= X-Google-Smtp-Source: AA0mqf5ZcHUqzra0Frk+ivAyRuwDAeJLBG89m+qnYjmVpULqxHOoH9i82562HZZ3OCSFSLzNExPHhg== X-Received: by 2002:a17:902:760f:b0:186:8d46:c3 with SMTP id k15-20020a170902760f00b001868d4600c3mr21402757pll.49.1669426095656; Fri, 25 Nov 2022 17:28:15 -0800 (PST) Received: from [192.168.3.219] ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id d12-20020a170902654c00b0016c0c82e85csm4052347pln.75.2022.11.25.17.28.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 17:28:15 -0800 (PST) Message-ID: Date: Fri, 25 Nov 2022 17:28:12 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v5 09/16] ufs: core: mcq: Configure operation and runtime interface Content-Language: en-US To: Asutosh Das , quic_cang@quicinc.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: quic_nguyenb@quicinc.com, quic_xiaosenh@quicinc.com, stanley.chu@mediatek.com, eddie.huang@mediatek.com, daejun7.park@samsung.com, avri.altman@wdc.com, mani@kernel.org, beanhuo@micron.com, linux-arm-msm@vger.kernel.org, Alim Akhtar , "James E.J. Bottomley" , Andy Gross , Bjorn Andersson , Konrad Dybcio , Krzysztof Kozlowski , Arthur Simchaev , Jinyoung Choi , Kiwoong Kim , open list References: <52b1525a4d680999687a1f0721ea60fd4cec9eb8.1669176158.git.quic_asutoshd@quicinc.com> From: Bart Van Assche In-Reply-To: <52b1525a4d680999687a1f0721ea60fd4cec9eb8.1669176158.git.quic_asutoshd@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org On 11/22/22 20:10, Asutosh Das wrote: > +static void ufshcd_config_mcq(struct ufs_hba *hba) > +{ > + ufshcd_enable_intr(hba, UFSHCD_ENABLE_MCQ_INTRS); > + ufshcd_mcq_make_queues_operational(hba); > + ufshcd_mcq_config_mac(hba, hba->nutrs); > + > + hba->host->can_queue = hba->nutrs - UFSHCD_NUM_RESERVED; > + hba->reserved_slot = hba->nutrs - UFSHCD_NUM_RESERVED; > + 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], > + hba->nutrs); > +} Please do not reserve a slot for device commands in MCQ mode but instead queue device management commands on the device management command queue in MCQ mode. Please also add WARN_ON_ONCE() statements in the code that uses hba->reserved_slot to make sure that that variable is not used in MCQ mode. Thanks, Bart.