All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Peter Wu <peter@lekensteyn.nl>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	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: Wed, 25 May 2016 16:25:30 +0300	[thread overview]
Message-ID: <20160525132530.GM1789@lahna.fi.intel.com> (raw)
In-Reply-To: <20160525121626.GA6339@wunner.de>

On Wed, May 25, 2016 at 02:16:26PM +0200, Lukas Wunner wrote:
> Hi Mika,
> 
> On Tue, May 24, 2016 at 03:53:23PM +0300, Mika Westerberg wrote:
> > One thing I noticed, though. When a bridge is transitioned to D0 we only
> > wait for 10ms which is requirement for PCI functions. However, PCI PM
> > specification 1.2 (chapter 4.2) requires that for buses to transition
> > from B2 to B0 we need to wait minimum of 50ms before accessing a
> > function on that bus.
> > 
> > We even have PCI_PM_BUS_WAIT defined in include/linux/pci.h but it is
> > not used anywhere. Maybe it was not needed originally because we never
> > powered down bridges anyway but now when we do, I think it is good idea
> > to do what the spec requires.
> 
> The macro was introduced with
> 
>     commit aa8c6c93747f7b55fa11e1624fec8ca33763a805
>     Author: Rafael J. Wysocki <rjw@sisk.pl>
>     Date:   Fri Jan 16 21:54:43 2009 +0100
>     PCI PM: Restore standard config registers of all devices early
> 
> but the only usage of it was removed with
> 
>     commit 476e7faefc43f106a90b5c96166c59b75de19d30
>     Author: Rafael J. Wysocki <rjw@sisk.pl>
>     Date:   Thu Jan 22 23:39:57 2009 +0100
>     PCI PM: Do not wait for buses in B2 or B3 during resume
> 

Thanks for looking that up.

If I understand correctly it was removed because we do not expect BIOS
to put buses to B2/B3 so we do not need to wait the extra 50ms before
accessing the device.

However, now that we do that in the OS (and also during runtime), I
think we need to take that into account again.

      reply	other threads:[~2016-05-25 13:26 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
2016-05-25 12:16                 ` Lukas Wunner
2016-05-25 13:25                   ` Mika Westerberg [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=20160525132530.GM1789@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=bhelgaas@google.com \
    --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.