All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Peter Wu <peter@lekensteyn.nl>, Lukas Wunner <lukas@wunner.de>,
	linux-pci@vger.kernel.org, linux-pm@vger.kernel.org,
	Valdis Kletnieks <valdis.kletnieks@vt.edu>,
	Dave Airlie <airlied@gmail.com>
Subject: Re: [PATCH] PCI: Power on bridges before scanning new devices
Date: Mon, 30 May 2016 12:35:11 +0300	[thread overview]
Message-ID: <20160530093511.GI1789@lahna.fi.intel.com> (raw)
In-Reply-To: <9162683.GfsX7n9xoz@vostro.rjw.lan>

On Sat, May 28, 2016 at 02:21:11PM +0200, Rafael J. Wysocki wrote:
> On Thursday, May 26, 2016 11:16:43 AM Mika Westerberg wrote:
> > On Wed, May 25, 2016 at 10:45:48PM +0200, Rafael J. Wysocki wrote:
> > > On Wednesday, May 25, 2016 04:19:48 PM Mika Westerberg wrote:
> > > > On Wed, May 25, 2016 at 12:13:09AM +0300, Mika Westerberg wrote:
> > > > > On Tue, May 24, 2016 at 03:53:23PM +0300, Mika Westerberg wrote:
> > > > > > > I dropped "ACPI / hotplug / PCI: Runtime resume bridge before rescan"
> > > > > > > on the assumption that "PCI: Power on bridges before scanning new
> > > > > > > devices" is sufficient to cover both the ACPI and the generic PCi
> > > > > > > rescan cases, but I'd like some reassurance about that.
> > > > > > 
> > > > > > I agree with your reasoning that the patch should not be needed anymore.
> > > > > > However, I have the machine which needed that patch at home so I'm not
> > > > > > able to test it now. I'll do that later today when I get back home.
> > > > > 
> > > > > I tried now on my Lenovo Yoga 900 laptop and unfortunately "PCI: Power
> > > > > on bridges before scanning new devices" seems not to be enough. This
> > > > > machine has SD-card reader connected to one PCIe port and once I unload
> > > > > the sdhci-pci driver and enable runtime PM for the device, next system
> > > > > suspend/resume cycle loses the SD-card reader PCI device.
> > > > > 
> > > > > I will investigate more tomorrow -- it is getting late here.
> > > > 
> > > > I think I found reason for the issue.
> > > > 
> > > > When the laptop resumes it will send ACPI BUS_CHECK event for the two
> > > > PCIe root ports. This ends up in acpiphp_check_bridge() where it goes
> > > > through all slots in that bridge checking if the devices are still
> > > > present. This happens before we call pci_scan_bridge() for the bridge
> > > > itself.
> > > > 
> > > > Since the bridge is in D3 config space of the device behind it is not
> > > > available and we determine that the device is not there anymore.
> > > > 
> > > > It looks like we either need that ACPI hotplug patch or alternatively we
> > > > could add pm_runtime_get/put() in acpiphp_check_bridge().
> > > 
> > > Have you tried the latter?
> > 
> > Indeed I tried and it worked fine. I can make formal patch doing that
> > which then replaces the current ACPI hotplug patch, if that is the
> > preferred way.
> 
> It is somewhat cleaner, so I'd prefer it.

Okay, I'm going to submit an updated version of that patch then.

  reply	other threads:[~2016-05-30  9:35 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 17:14 Rescanning is broken with runtime PM for PCIe ports Peter Wu
2016-05-19  7:42 ` Mika Westerberg
2016-05-19 11:36   ` Mika Westerberg
2016-05-20  8:45     ` Peter Wu
2016-05-23  8:20       ` [PATCH] PCI: Power on bridges before scanning new devices Mika Westerberg
2016-05-23 20:00         ` Bjorn Helgaas
2016-05-23 21:50           ` Bjorn Helgaas
2016-05-24 12:23             ` Bjorn Helgaas
2016-05-24 12:52               ` Lukas Wunner
2016-05-24 12:53               ` Mika Westerberg
2016-05-24 14:27                 ` Peter Wu
2016-05-24 15:06                   ` Lukas Wunner
2016-05-24 16:38                   ` Bjorn Helgaas
2016-05-24 23:46                     ` Peter Wu
2016-05-24 16:28                 ` Bjorn Helgaas
2016-05-25 15:04                   ` [PATCH] PCI: Wait for 50ms after bridge is powered up Mika Westerberg
2016-05-25 20:44                     ` Rafael J. Wysocki
2016-05-26 10:10                     ` Lukas Wunner
2016-05-26 10:25                       ` Mika Westerberg
2016-05-26 10:45                         ` Lukas Wunner
2016-05-26 11:03                           ` Mika Westerberg
2016-05-28 12:29                             ` Rafael J. Wysocki
2016-05-30  9:33                               ` Mika Westerberg
2016-05-30 14:44                                 ` Mika Westerberg
2016-05-30 15:19                                   ` Andreas Noever
2016-05-31  8:33                                     ` Mika Westerberg
2016-05-31  8:58                                       ` Mika Westerberg
2016-05-31 10:40                                         ` Lukas Wunner
2016-05-31 10:47                                           ` Mika Westerberg
2016-05-31 11:07                                             ` Lukas Wunner
2016-06-01  9:11                                               ` Mika Westerberg
2016-06-01 11:42                                                 ` Lukas Wunner
2016-05-24 21:13                 ` [PATCH] PCI: Power on bridges before scanning new devices Mika Westerberg
2016-05-25  0:03                   ` Rafael J. Wysocki
2016-05-25 13:19                   ` Mika Westerberg
2016-05-25 20:45                     ` Rafael J. Wysocki
2016-05-26  8:16                       ` Mika Westerberg
2016-05-28 12:21                         ` Rafael J. Wysocki
2016-05-30  9:35                           ` Mika Westerberg [this message]
2016-05-25 12:16                 ` Lukas Wunner
2016-05-25 13:25                   ` Mika Westerberg

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=20160530093511.GI1789@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=peter@lekensteyn.nl \
    --cc=rjw@rjwysocki.net \
    --cc=valdis.kletnieks@vt.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.