linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Frederick Lawler <fred@fredlawl.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	Rajat Jain <rajatja@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH v7 4/5] PCI/ASPM: Add sysfs attributes for controlling ASPM link states
Date: Mon, 7 Oct 2019 20:53:39 -0500	[thread overview]
Message-ID: <20191008015339.GA93531@google.com> (raw)
In-Reply-To: <b1c83f8a-9bf6-eac5-82d0-cf5b90128fbf@gmail.com>

On Sat, Oct 05, 2019 at 02:07:56PM +0200, Heiner Kallweit wrote:
> Background of this extension is a problem with the r8169 network driver.
> Several combinations of board chipsets and network chip versions have
> problems if ASPM is enabled, therefore we have to disable ASPM per default.
> However especially on notebooks ASPM can provide significant power-saving,
> therefore we want to give users the option to enable ASPM. With the new
> sysfs attributes users can control which ASPM link-states are
> enabled/disabled.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

> +static ssize_t aspm_attr_show_common(struct device *dev,
> +				     struct device_attribute *attr,
> +				     char *buf, u8 state)
> +{
> +	struct pci_dev *pdev = to_pci_dev(dev);
> +	struct pcie_link_state *link;
> +	bool enabled;
> +
> +	link = pcie_aspm_get_link(pdev);
> +
> +	mutex_lock(&aspm_lock);
> +	enabled = link->aspm_enabled & state;
> +	mutex_unlock(&aspm_lock);

Not sure the mutex is needed; do you have a reason, or is it just
copied from existing code?  If the latter, we can just wait to see
what Rafael says.

> +	return sprintf(buf, "%d\n", enabled ? 1 : 0);
> +}

  reply	other threads:[~2019-10-08  1:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-05 12:02 [PATCH v7 0/5] PCI/ASPM: Add sysfs attributes for controlling ASPM Heiner Kallweit
2019-10-05 12:03 ` [PATCH v7 2/5] PCI/ASPM: Allow to re-enable Clock PM Heiner Kallweit
2019-10-05 12:04 ` [PATCH v7 1/5] PCI/ASPM: Add L1 sub-state support to pci_disable_link_state Heiner Kallweit
2019-10-05 12:07 ` [PATCH v7 3/5] PCI/ASPM: Add and use helper pcie_aspm_get_link Heiner Kallweit
2019-10-08  1:51   ` Bjorn Helgaas
2019-10-05 12:07 ` [PATCH v7 4/5] PCI/ASPM: Add sysfs attributes for controlling ASPM link states Heiner Kallweit
2019-10-08  1:53   ` Bjorn Helgaas [this message]
2019-11-21 20:49   ` Bjorn Helgaas
2019-11-21 21:03     ` Rajat Jain
2019-11-21 21:10       ` Greg KH
2019-11-21 23:04         ` Bjorn Helgaas
2019-11-24 17:02           ` Greg KH
2019-10-05 12:08 ` [PATCH v7 5/5] PCI/ASPM: Remove Kconfig option PCIEASPM_DEBUG and related code Heiner Kallweit
2019-10-08 22:10 ` [PATCH v7 0/5] PCI/ASPM: Add sysfs attributes for controlling ASPM Bjorn Helgaas
2019-10-10 13:22   ` Bjorn Helgaas
2019-10-10 20:45     ` Heiner Kallweit
2019-10-15 20:30       ` Bjorn Helgaas

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=20191008015339.GA93531@google.com \
    --to=helgaas@kernel.org \
    --cc=fred@fredlawl.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hkallweit1@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=rajatja@google.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;
as well as URLs for NNTP newsgroup(s).