mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jarod Wilson <jarod@redhat.com>,
	linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [Update][PATCH] PCIe / hotplug: Drop pointless ACPI-based "slot detection" check
Date: Fri, 22 May 2015 03:21:51 +0200	[thread overview]
Message-ID: <3372859.5Hat5UqSL7@vostro.rjw.lan> (raw)
In-Reply-To: <20150521161146.GE32152@google.com>

On Thursday, May 21, 2015 11:11:46 AM Bjorn Helgaas wrote:
> On Tue, May 19, 2015 at 03:27:58PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > Jarod Wilson reports that the expresscard hotplug setup doesn't work
> > on HP ZBook G2.  The problem turns out to be the ACPI-based "slot
> > detection" code called from pciehp_probe() which tries to use some
> > questionable heuristics based on what ACPI objects are present for
> > the PCIe port device at hand to figure out whether or not to register
> > a hotplug slot for that port.
> > 
> > That code is used if there is at least one PCIe port having an ACPI
> > device configuration object related to hotplug (such as _EJ0 or _RMV)
> > and the Thunderbolt port on the affected machine has _RMV.  Of course,
> > Thunderbolt and PCIe native hotplug need not be mutually exclusive
> > (as they aren't on the machine in question), so that rule is simply
> > incorrect.
> > 
> > Moreover, the ACPI-based "slot detection" check does not add any
> > value if pciehp_probe() is called at all and the service type of the
> > device object it has been called for is PCIE_PORT_SERVICE_HP, because
> > PCIe hotplug services are only registered if the _OSC handshake in
> > acpi_pci_root_add() allows the kernel to control the PCIe native
> > hotplug feature.  No more checks need to be carried out to decide
> > whether or not to register a native PCIe hotlug slot in that case.
> > 
> > For the above reasons, make pciehp_probe() check if it has been
> > called for the right service type and drop the pointless ACPI-based
> > "slot detection" check from it.  Also remove the entire code whose
> > only user is that check (the entire pciehp_acpi.c file goes away
> > as a result) and drop function headers related to it from the
> > internal PCIeHP header file.
> > 
> > Link: http://marc.info/?t=143163219300002&r=1&w=2
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=98581
> > Reported-by: Jarod Wilson <jarod@redhat.com>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> This is awesome!  Applied to pci/hotplug for v4.2, with Jarod's
> reviewed/tested-by.

Thanks!

> I suspect a lot of this stuff dates back to when acpiphp and pciehp could
> be modules, and one driver really couldn't know whether the other was up
> to.  In any event, I think it will be much more predictable and
> maintainable now.

Yes, this code has been outdated since we changed ACPIPHP to look at the
host bridge _OSC bits when deciding whether or not to register a hotplug
port.

Rafael


  reply	other threads:[~2015-05-22  0:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 19:33 [PATCH] pci/hotplug: work-around for missing _RMV on HP ZBook G2 Jarod Wilson
2015-05-16 14:37 ` Bjorn Helgaas
2015-05-16 14:41   ` Bjorn Helgaas
2015-05-18  0:26     ` Rafael J. Wysocki
2015-05-18 14:33       ` Jarod Wilson
2015-05-18 16:17         ` Jarod Wilson
2015-05-18 20:45           ` Jarod Wilson
2015-05-18 23:06             ` Rafael J. Wysocki
2015-05-19  3:06               ` Jarod Wilson
2015-05-19 11:36                 ` Rafael J. Wysocki
2015-05-19 11:43                   ` [PATCH] PCIe / hotplug: Drop pointless ACPI-based "slot detection" check Rafael J. Wysocki
2015-05-19 12:42                     ` Jarod Wilson
2015-05-19 13:29                       ` Rafael J. Wysocki
2015-05-19 13:27                     ` [Update][PATCH] " Rafael J. Wysocki
2015-05-19 14:40                       ` Jarod Wilson
2015-05-21 16:11                       ` Bjorn Helgaas
2015-05-22  1:21                         ` Rafael J. Wysocki [this message]
2015-06-11 17:05                           ` Jarod Wilson
2015-06-11 20:38                             ` Jarod Wilson
2015-06-11 21:16                               ` Rafael J. Wysocki
2015-06-11 21:49                                 ` Jarod Wilson
2015-05-18 21:57         ` [PATCH] pci/hotplug: work-around for missing _RMV on HP ZBook G2 Rafael J. Wysocki
2015-05-18 14:30     ` Jarod Wilson

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=3372859.5Hat5UqSL7@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=bhelgaas@google.com \
    --cc=jarod@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®