From: Avri Altman <Avri.Altman@wdc.com>
To: Bart Van Assche <bvanassche@acm.org>,
"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-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v4 3/3] scsi: ufs: sysfs: Make max_number_of_rtt read-write
Date: Thu, 16 May 2024 15:31:01 +0000 [thread overview]
Message-ID: <DM6PR04MB6575E8AF1B1B0ECAF6F169F6FCED2@DM6PR04MB6575.namprd04.prod.outlook.com> (raw)
In-Reply-To: <054739a5-f38c-4756-b248-94dfb6bad916@acm.org>
> On 5/15/24 23:51, Avri Altman wrote:
> > +static ssize_t max_number_of_rtt_store(struct device *dev,
> > + struct device_attribute *attr,
> > + const char *buf, size_t count)
> > +{
> > + struct ufs_hba *hba = dev_get_drvdata(dev);
> > + unsigned int rtt;
> > + int ret;
> > +
> > + if (kstrtouint(buf, 0, &rtt))
> > + return -EINVAL;
> > +
> > + down(&hba->host_sem);
> > + if (!ufshcd_is_user_access_allowed(hba)) {
> > + ret = -EBUSY;
> > + goto out;
> > + }
> > +
> > + ufshcd_rpm_get_sync(hba);
> > + ret = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
> > + QUERY_ATTR_IDN_MAX_NUM_OF_RTT, 0, 0, &rtt);
> > + ufshcd_rpm_put_sync(hba);
> > +
> > +out:
> > + up(&hba->host_sem);
> > + return ret < 0 ? ret : count;
> > +}
>
> Since modifying RTT is only allowed while no commands are in progress,
> shouldn't max_number_of_rtt_store() freeze and unfreeze all request
> queues of all logical units?
Done.
Thanks,
Avri
>
> Thanks,
>
> Bart.
prev parent reply other threads:[~2024-05-16 15:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 5:51 [PATCH v4 0/3] scsi: ufs: Allow RTT negotiation Avri Altman
2024-05-16 5:51 ` [PATCH v4 1/3] " Avri Altman
2024-05-16 14:28 ` Bart Van Assche
2024-05-16 15:21 ` Avri Altman
2024-05-16 16:04 ` Bart Van Assche
2024-05-16 23:56 ` Avri Altman
2024-05-16 5:51 ` [PATCH v4 2/3] scsi: ufs: Allow platform vendors to set rtt Avri Altman
2024-05-16 14:12 ` Bart Van Assche
2024-05-16 15:23 ` Avri Altman
2024-05-16 5:51 ` [PATCH v4 3/3] scsi: ufs: sysfs: Make max_number_of_rtt read-write Avri Altman
2024-05-16 14:17 ` Bart Van Assche
2024-05-16 15:31 ` Avri Altman [this message]
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=DM6PR04MB6575E8AF1B1B0ECAF6F169F6FCED2@DM6PR04MB6575.namprd04.prod.outlook.com \
--to=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--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®