linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Frederick Lawler <fred@fredlawl.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH RFC v3 3/3] PCI/ASPM: add sysfs attribute for controlling ASPM
Date: Mon, 20 May 2019 21:16:16 +0200	[thread overview]
Message-ID: <5f00fc62-063d-4dd5-d808-4047eab70709@gmail.com> (raw)
In-Reply-To: <9bc7c84f-5508-46b1-9f61-7ea8023e65ee@fredlawl.com>

On 17.05.2019 02:12, Frederick Lawler wrote:
> Heiner,
> 
> Heiner Kallweit wrote on 5/12/19 8:54 AM:> [snip]
>> +static ssize_t aspm_link_states_show(struct device *dev,
>> +                     struct device_attribute *attr, char *buf)
>> +{
>> +    struct pci_dev *pdev = to_pci_dev(dev);
>> +    struct pcie_link_state *link;
>> +    int len = 0, i;
>> +
>> +    link = aspm_get_parent_link(pdev);
>> +    if (!link)
>> +        return -EOPNOTSUPP;
>> +
>> +    mutex_lock(&aspm_lock);
>> +
>> +    for (i = 0; i < ARRAY_SIZE(aspm_sysfs_states); i++) {
>> +        const struct aspm_sysfs_state *st = aspm_sysfs_states + i;
>> +
>> +        if (link->aspm_enabled & st->mask)
>> +            len += scnprintf(buf + len, PAGE_SIZE - len, "[%s] ",
>> +                     st->name);
>> +        else
>> +            len += scnprintf(buf + len, PAGE_SIZE - len, "%s ",
>> +                     st->name);
>> +    }
> 
>   # echo "-L1" > aspm_link_states
>   # cat aspm_link_states
>   L0S L1 L1.1 L1.2 [CLKPM]
> 
>   # echo "+L1" > aspm_link_states
>   # cat aspm_link_states
>   L0S [L1] L1.1 L1.2 [CLKPM]
> 
> In v1 & v2 [STATE] was used to show that a state was disabled, now [STATE] is used to show enabled. Is that intended?
> 
Yes, based on a review comment from you from May 12th:
"If we avoid the double negative, the documentation about to be written will be more clear and use of the sysfs file will be more intuitive."

>> +
>> +    if (link->clkpm_enabled)
>> +        len += scnprintf(buf + len, PAGE_SIZE - len, "[CLKPM] ");
>> +    else
>> +        len += scnprintf(buf + len, PAGE_SIZE - len, "CLKPM ");
>> +
> 
> Same as above...
> 
>> +    mutex_unlock(&aspm_lock);
>> +
>> +    len += scnprintf(buf + len, PAGE_SIZE - len, "\n");
>> +
>> +    return len;
>> +}
> 
> Other than the above, v3 works as expected on my machine. Good work :)
> 
Great, thanks for the feedback!

OK, then let's see what still needs to be done to finish the patch series:
The new sysfs attribute needs to be documented. Anything else?

> Frederick Lawler
> 
> 
Heiner

      reply	other threads:[~2019-05-20 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-12 13:52 [PATCH RFC v3 0/3] PCI/ASPM: add sysfs attribute for controlling ASPM Heiner Kallweit
2019-05-12 13:53 ` [PATCH RFC v3 1/3] PCI/ASPM: add L1 sub-state support to pci_disable_link_state Heiner Kallweit
2019-05-12 13:54 ` [PATCH RFC v3 2/3] PCI/ASPM: allow to re-enable Clock PM Heiner Kallweit
2019-05-12 13:54 ` [PATCH RFC v3 3/3] PCI/ASPM: add sysfs attribute for controlling ASPM Heiner Kallweit
2019-05-17  0:12   ` Frederick Lawler
2019-05-20 19:16     ` Heiner Kallweit [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=5f00fc62-063d-4dd5-d808-4047eab70709@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=fred@fredlawl.com \
    --cc=linux-pci@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).