All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Asutosh Das <quic_asutoshd@quicinc.com>
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,
	adrian.hunter@intel.com, bvanassche@acm.org, avri.altman@wdc.com,
	mani@kernel.org, beanhuo@micron.com,
	linux-arm-msm@vger.kernel.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/1] ufs: mcq: fix incorrectly set queue depth
Date: Thu, 16 Feb 2023 23:39:22 +0530	[thread overview]
Message-ID: <20230216180922.GA7015@thinkpad> (raw)
In-Reply-To: <8840cea4a57b46dabce18acc39afc50ab826330f.1676567593.git.quic_asutoshd@quicinc.com>

On Thu, Feb 16, 2023 at 09:13:46AM -0800, Asutosh Das wrote:
> ufshcd_config_mcq() may change the can_queue value.
> The current code invokes scsi_add_host() before ufshcd_config_mcq().
> So the tags are limited to the old can_queue value.
> 
> Fix this by invoking scsi_add_host() after ufshcd_config_mcq().
> 
> Fixes: 2468da61ea09 ("scsi: ufs: core: mcq: Configure operation and runtime interface")
> Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

Thanks,
Mani

> 
> ----
> v1 -> v2:
>   - Added Fixes tag
>   - Reworked to handle success case first
> ---
>  drivers/ufs/core/ufshcd.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 3b3cf78d3b10..3891183897f0 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -8530,7 +8530,9 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
>  			return ret;
>  		if (is_mcq_supported(hba) && !hba->scsi_host_added) {
>  			ret = ufshcd_alloc_mcq(hba);
> -			if (ret) {
> +			if (!ret) {
> +				ufshcd_config_mcq(hba);
> +			} else {
>  				/* Continue with SDB mode */
>  				use_mcq_mode = false;
>  				dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
> @@ -8542,10 +8544,10 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
>  				return ret;
>  			}
>  			hba->scsi_host_added = true;
> -		}
> -		/* MCQ may be disabled if ufshcd_alloc_mcq() fails */
> -		if (is_mcq_supported(hba) && use_mcq_mode)
> +		} else if (is_mcq_supported(hba)) {
> +			/* UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH is set */
>  			ufshcd_config_mcq(hba);
> +		}
>  	}
>  
>  	ufshcd_tune_unipro_params(hba);
> -- 
> 2.7.4
> 

-- 
மணிவண்ணன் சதாசிவம்

  parent reply	other threads:[~2023-02-16 18:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 17:13 [PATCH v2 1/1] ufs: mcq: fix incorrectly set queue depth Asutosh Das
2023-02-16 17:46 ` Bart Van Assche
2023-02-16 18:09 ` Manivannan Sadhasivam [this message]
2023-02-21 23:21 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230216180922.GA7015@thinkpad \
    --to=mani@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=quic_xiaosenh@quicinc.com \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.