[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DM6PR04MB6575E8AF1B1B0ECAF6F169F6FCED2@DM6PR04MB6575.namprd04.prod.outlook.com>
Date: Thu, 16 May 2024 15:31:01 +0000
From: Avri Altman <Avri.Altman@....com>
To: Bart Van Assche <bvanassche@....org>, "Martin K . Petersen"
<martin.petersen@...cle.com>
CC: Bean Huo <beanhuo@...ron.com>, Peter Wang <peter.wang@...iatek.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v4 3/3] scsi: ufs: sysfs: Make max_number_of_rtt
read-write
> 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.
Powered by blists - more mailing lists