mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Avri Altman <avri.altman@wdc.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Bean Huo <beanhuo@micron.com>,
	Peter Wang <peter.wang@mediatek.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/3] scsi: ufs: Maximum RTT supported by the host driver
Date: Wed, 29 May 2024 13:12:39 -0700	[thread overview]
Message-ID: <0555169e-2552-41d8-a515-8c394118cec7@acm.org> (raw)
In-Reply-To: <20240526081636.2064-3-avri.altman@wdc.com>

On 5/26/24 01:16, Avri Altman wrote:
> -	rtt = min_t(int, dev_info->rtt_cap, hba->nortt);
> +	if (hba->vops && hba->vops->max_num_rtt)
> +		rtt = hba->vops->max_num_rtt;
> +	else
> +		rtt = min_t(int, dev_info->rtt_cap, hba->nortt);
> +

Shouldn't what the controller supports be compared with what the device supports,
e.g. as follows?

min_t(int, dev_info->rtt_cap, hba->vops->max_num_rtt ? : hba->nortt);

>   struct ufs_hba_variant_ops {
>   	const char *name;
> +	int	max_num_rtt;

Hmm ... why 'int' instead of an unsigned type? If the type would be changed
into 'u8' (the type of rtt_cap) then the above min_t() can be changed into
min().

Thanks,

Bart.


  parent reply	other threads:[~2024-05-29 20:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26  8:16 [PATCH v6 0/3] scsi: ufs: Allow RTT negotiation Avri Altman
2024-05-26  8:16 ` [PATCH v6 1/3] " Avri Altman
2024-05-29 20:03   ` Bart Van Assche
2024-05-29 21:15     ` Avri Altman
2024-05-26  8:16 ` [PATCH v6 2/3] scsi: ufs: Maximum RTT supported by the host driver Avri Altman
2024-05-28 10:02   ` Peter Wang (王信友)
2024-05-29 20:12   ` Bart Van Assche [this message]
2024-05-29 21:07     ` Avri Altman
2024-05-26  8:16 ` [PATCH v6 3/3] scsi: ufs: sysfs: Make max_number_of_rtt read-write Avri Altman
2024-05-29 20:02   ` Bart Van Assche
2024-05-29 21:12     ` Avri Altman

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=0555169e-2552-41d8-a515-8c394118cec7@acm.org \
    --to=bvanassche@acm.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®