All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: huang ying <huang.ying.caritas@gmail.com>
Cc: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Sarah Sharp <sarah.a.sharp@linux.intel.com>
Subject: Re: [PATCH] PCI / ACPI: Always resume devices on ACPI wakeup notifications
Date: Wed, 3 Apr 2013 11:29:54 -0600	[thread overview]
Message-ID: <CAErSpo7+4ciaApG=Mk8FYnv_bEz0jap3oeBxW4fJL37a_=pqPA@mail.gmail.com> (raw)
In-Reply-To: <CAC=cRTP+VHZrzELDgJTZw6hykPD4FR9xzB2BR2TwCUcPGCmGsg@mail.gmail.com>

On Tue, Apr 2, 2013 at 8:04 PM, huang ying <huang.ying.caritas@gmail.com> wrote:
> On Wed, Apr 3, 2013 at 12:30 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:

>> 2) acpiphp currently uses the presence of _ADR/_EJ0/_RMV to detect
>> hotplug slots.  I don't think this is sufficient (see
>> https://bugzilla.kernel.org/show_bug.cgi?id=54981 for details).
>> Therefore, I don't think pci_bus_has_hotplug_slots() in port_dbg.patch
>> can be accurate.  I think it returns "false" for some buses where it
>> should return "true," such as the ExpressCard slot on Chris Clayton's
>> system (see bug 54981).
>
> Yes. pci_bus_has_hotplug_slots() is not accurate.  But I still think
> it can be used in port runtime PM.  Because if there is no hotplug
> slots registered, the hotplug itself can not work properly, with or
> without port runtime PM enabled.

I'm not sure this is true.  For concreteness, let's talk about Chris
Clayton's machine.  He has a root port 00:1c.3, that leads to an
ExpressCard slot.  We request to use PCIe native hotplug, but BIOS
declines, so we have to use acpiphp.  The SCI that signals a hotplug
event is generated by the 00:1c.3 root port.  Therefore, 00:1c.3 must
remain powered up even when the slot is empty.

So the question really is, "Can we tell that there's a hotplug slot
below 00:1c.3?"  acpiphp currently does not detect this slot because
00:1c.3 does have an _ADR method, but there's no _EJ0 or _RMV method.

If you are suggesting that "acpiphp hotplug doesn't work correctly for
this slot even with  00:1c.3 powered up, so we might as well turn
00:1c.3 off," I completely disagree.  That would mean that even after
we fix acpiphp so it re-enumerates when we receive a Bus Check,
hotplug would still be broken because the powered-off port will not
generate the SCI that triggers the Bus Check.

>  And we should add necessary
> pm_runtime_get_sync/put_sync into pci_scan_bus to deal with "rescan".
> What do you think about that?
>
> pci_dev->is_hotplug_bridge is not accurate too.  It reports a internal
> port of my X220 as a hotplug-able port.  But it appears that it will
> report more instead of less.  It can report correctly for port in bug
> 54981.  Do you think that is a good choice for port runtime PM
> filtering?

pci_dev->is_hotplug_bridge is currently set in these cases:

  1) A quirk for a PLX bridge
  2) The PCIe Slot Capability "Hot-Plug Capable" bit is set
  3) The acpiphp driver thinks there's an ejectable slot below the device

This doesn't look reliable to me at all.  I don't think think it's
even possible for acpiphp to deduce from AML whether there are
ejectable slots.  If we're using acpiphp, I feel queasy about looking
at the PCIe Capability to figure out whether slots are present.  I
don't think it's a good idea to mix the PCIe and ACPI worlds that way.
 And ACPI hotplug could be used for other hotplug schemes besides
PCIe, so we can't even count on the PCIe capability existing.

So I disagree that pci_dev->is_hotplug_bridge is set for every device
that may have a hotplug slot below it.

I think it's mainly the acpiphp case where it's hard to tell when
runtime PM is safe; it might be possible to do runtime PM on a port
where we are using pciehp.

Bjorn

  reply	other threads:[~2013-04-03 17:30 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 14:33 [PATCH] PCI / ACPI: Always resume devices on ACPI wakeup notifications Rafael J. Wysocki
2013-03-23 16:22 ` Matthew Garrett
2013-03-25 16:45 ` Sarah Sharp
2013-03-25 22:34   ` Rafael J. Wysocki
2013-03-28 12:57 ` Rafael J. Wysocki
2013-03-28 16:21   ` Bjorn Helgaas
2013-03-28 16:41     ` Rafael J. Wysocki
2013-03-28 16:46       ` Bjorn Helgaas
2013-03-28 16:59         ` Rafael J. Wysocki
2013-03-28 17:26           ` Martin Mokrejs
2013-03-28 17:49             ` Bjorn Helgaas
2013-03-28 18:23               ` Sarah Sharp
2013-03-28 19:12                 ` Bjorn Helgaas
2013-03-28 19:42                   ` Martin Mokrejs
2013-03-28 18:31               ` Martin Mokrejs
2013-03-28 21:27                 ` Rafael J. Wysocki
2013-03-29  7:41                   ` huang ying
2013-03-31  2:29                     ` Martin Mokrejs
2013-03-30  2:03                   ` Martin Mokrejs
2013-04-02  5:25                     ` huang ying
2013-04-02 15:02                       ` Martin Mokrejs
2013-04-02 16:08                         ` huang ying
2013-04-02 16:53                           ` Martin Mokrejs
2013-04-02 16:30                         ` Bjorn Helgaas
     [not found]                           ` <515B17D9.6030805@fold.natur.cuni.cz>
2013-04-02 20:55                             ` Martin Mokrejs
2013-04-02 22:16                               ` Sarah Sharp
2013-04-03 10:35                                 ` Martin Mokrejs
2013-04-03  2:34                               ` huang ying
2013-04-03 10:39                                 ` Martin Mokrejs
2013-04-03 12:16                               ` Martin Mokrejs
2013-04-04 11:30                                 ` Huang Ying
2013-04-04 19:19                                   ` Sarah Sharp
2013-04-05 12:30                                     ` Martin Mokrejs
2013-04-05 12:40                                   ` Martin Mokrejs
2013-04-19 23:49                                     ` Martin Mokrejs
2013-04-30 20:47                                       ` Martin Mokrejs
2013-04-02 22:49                           ` Rafael J. Wysocki
2013-04-02 23:58                             ` Bjorn Helgaas
2013-04-03 11:00                               ` Rafael J. Wysocki
2013-04-03  2:04                           ` huang ying
2013-04-03 17:29                             ` Bjorn Helgaas [this message]
2013-03-30 22:38                   ` [Update][PATCH] PCI / PM: Disable runtime PM of PCIe ports Rafael J. Wysocki
2013-04-01 17:34                     ` Bjorn Helgaas
2013-04-01 20:51                       ` Rafael J. Wysocki
2013-04-01 20:53                         ` Bjorn Helgaas
2013-04-01 21:24                           ` Rafael J. Wysocki
2013-04-01 23:20                             ` Rafael J. Wysocki
2013-04-01 21:48                           ` Martin Mokrejs
2013-04-02  5:34                           ` huang ying
2013-04-02  5:28                         ` huang ying
2013-04-02  5:31                           ` huang ying
2013-04-03 22:34                     ` Bjorn Helgaas
2013-03-28 17:10 ` [Resend][PATCH] PCI / ACPI: Always resume devices on ACPI wakeup notifications Rafael J. Wysocki
2013-03-28 21:07   ` [Update][PATCH] " Rafael J. Wysocki
2013-03-29 15:05     ` Martin Mokrejs
2013-03-29 16:05       ` Sarah Sharp
2013-03-29 17:11         ` Martin Mokrejs
2013-03-29 18:16           ` Martin Mokrejs
2013-03-29 21:37         ` Rafael J. Wysocki
2013-03-29 21:34       ` Rafael J. Wysocki
2013-04-03 22:38     ` 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='CAErSpo7+4ciaApG=Mk8FYnv_bEz0jap3oeBxW4fJL37a_=pqPA@mail.gmail.com' \
    --to=bhelgaas@google.com \
    --cc=huang.ying.caritas@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=mmokrejs@fold.natur.cuni.cz \
    --cc=rjw@sisk.pl \
    --cc=sarah.a.sharp@linux.intel.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 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.