linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Mario Limonciello <mario.limonciello@dell.com>,
	Anthony Wong <anthony.wong@canonical.com>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andreas Noever <andreas.noever@gmail.com>,
	Michael Jamet <michael.jamet@intel.com>,
	Yehezkel Bernat <YehezkelShB@gmail.com>
Subject: Re: [Regression] Commit "ACPI: PM: Allow transitions to D0 to occur in special cases"
Date: Fri, 2 Aug 2019 17:36:59 -0500	[thread overview]
Message-ID: <20190802223659.GO151852@google.com> (raw)
In-Reply-To: <6494680.N7F1gMbocb@kreacher>

On Thu, Aug 01, 2019 at 12:26:51AM +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 31, 2019 11:30:01 PM CEST Bjorn Helgaas wrote:
> > [+cc Thunderbolt folks, see
> > https://lore.kernel.org/r/578BD3F1-B185-471B-A3EB-FF71BA34B822@canonical.com
> > for beginning of thread]
> > 
> > On Thu, Aug 01, 2019 at 12:04:29AM +0800, Kai-Heng Feng wrote:
> > > Hi,
> > > 
> > > After commit "ACPI: PM: Allow transitions to D0 to occur in special cases”,
> > 
> > This is f850a48a0799 ("ACPI: PM: Allow transitions to D0 to occur in
> > special cases").
> > 
> > > Thunderbolt on XPS 9380 spews the following when it runtime resumes:
> > > [   36.136554] pci_raw_set_power_state: 25 callbacks suppressed
> > > [   36.136558] pcieport 0000:03:00.0: Refused to change power state,
> > > currently in D3
> > 
> > We really should be smarter about what we print here, maybe something
> > like the patch below?
> > 
> > pci_raw_set_power_state() prints "Refused to change power state" if
> > (in this case) the value of (PCI_PM_CTRL & PCI_PM_CTRL_STATE_MASK) is
> > 0x3.  Most likely we got 0xffff from PCI_PM_CTRL because the device is
> > in D3cold.  If the device is in D3cold, pci_raw_set_power_state() has
> > no hope of doing anything because it only uses PCI PM config
> > registers, and they're inaccessible in D3cold.

> > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > index 29ed5ec1ac27..63ca963ebff9 100644
> > --- a/drivers/pci/pci.c
> > +++ b/drivers/pci/pci.c
> > @@ -851,6 +852,11 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
> >  		return -EIO;
> >  
> >  	pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
> > +	if (pmcsr == (u16) ~0) {
> 
> Is the "device not accessible" the only case in which we can get all ones from this?
> 
> If so, the change will be fine by me.

There are several RsvdP bits in that register, so it's not possible to
read all ones except in error cases.  I'll finish up a patch for it.

Bjorn

  reply	other threads:[~2019-08-02 22:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 16:04 [Regression] Commit "ACPI: PM: Allow transitions to D0 to occur in special cases" Kai-Heng Feng
2019-07-31 16:12 ` Mario.Limonciello
2019-07-31 21:30 ` Bjorn Helgaas
2019-07-31 22:26   ` Rafael J. Wysocki
2019-08-02 22:36     ` Bjorn Helgaas [this message]
2019-07-31 22:20 ` Rafael J. Wysocki

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=20190802223659.GO151852@google.com \
    --to=helgaas@kernel.org \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=anthony.wong@canonical.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@dell.com \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /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).