From: Avri Altman <Avri.Altman@wdc.com>
To: Bart Van Assche <bvanassche@acm.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/2] scsi: ufs: Add HCI capabilities sysfs group
Date: Thu, 1 Aug 2024 07:01:07 +0000 [thread overview]
Message-ID: <DM6PR04MB6575DFBBB1B020FDA23FAC78FCB22@DM6PR04MB6575.namprd04.prod.outlook.com> (raw)
In-Reply-To: <0b3c0120-a680-455a-abfd-b3b6b0ddbed4@acm.org>
> On 7/31/24 5:20 AM, Avri Altman wrote:
> > +static ssize_t capabilities_show(struct device *dev,
> > + struct device_attribute *attr, char *buf) {
> > + struct ufs_hba *hba = dev_get_drvdata(dev);
> > +
> > + return sysfs_emit(buf, "0x%x\n", hba->capabilities); }
>
> For every new sysfs entry that is added, documentation must be added in
> Documentation/ABI/testing/sysfs-driver-ufs.
Done.
>
> > +static ssize_t ext_capabilities_show(struct device *dev,
> > + struct device_attribute *attr, char *buf) {
> > + int ret;
> > + u32 val;
> > + struct ufs_hba *hba = dev_get_drvdata(dev);
> > +
> > + if (hba->ufs_version < ufshci_version(4, 0))
> > + return -EOPNOTSUPP;
> > +
> > + ret = ufshcd_read_hci_reg(hba, &val,
> REG_EXT_CONTROLLER_CAPABILITIES);
> > + if (ret)
> > + return ret;
> > +
> > + return sysfs_emit(buf, "0x%x\n", val); }
>
> Host controller register reads must be protected by
> ufshcd_rpm_get_sync(hba) / ufshcd_rpm_put_sync(hba).
Done.
I guess that those need to be added to auto_hibern8_show as well.
Thanks,
Avri
>
> Thanks,
>
> Bart.
prev parent reply other threads:[~2024-08-01 7:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 12:20 [PATCH 0/2] scsi: ufs: Add host " Avri Altman
2024-07-31 12:20 ` [PATCH 1/2] scsi: ufs: Prepare to add HCI capabilities sysfs Avri Altman
2024-07-31 12:20 ` [PATCH 2/2] scsi: ufs: Add HCI capabilities sysfs group Avri Altman
2024-07-31 21:13 ` Bart Van Assche
2024-08-01 7:01 ` 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=DM6PR04MB6575DFBBB1B020FDA23FAC78FCB22@DM6PR04MB6575.namprd04.prod.outlook.com \
--to=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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®