All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH] pci/hotplug: work-around for missing _RMV on HP ZBook G2
Date: Mon, 18 May 2015 10:30:06 -0400	[thread overview]
Message-ID: <5559F76E.5040203@redhat.com> (raw)
In-Reply-To: <20150516144155.GH31666@google.com>

On 5/16/2015 10:41 AM, Bjorn Helgaas wrote:
> [fix Rafael's email address]
>
> On Sat, May 16, 2015 at 09:37:50AM -0500, Bjorn Helgaas wrote:
>> Hi Jarod,
>>
>> On Thu, May 14, 2015 at 03:33:58PM -0400, Jarod Wilson wrote:
>>> The HP ZBook 15 and 17 Mobile Workstations, generation 2, up to and
>>> including at least BIOS revision 01.07, do not have an ACPI _RMV object
>>> associated with their expresscard slots, so acpi-based hotplug-capable
>>> slot detection fails. If we fall back to pcie-based detection, the systems
>>> work just fine, so this uses dmi matching to do that. With luck, a future
>>> BIOS will remedy this (I've let someone at HP know about the problem),
>>> but for now, just use this for all existing versions.
>>>
>>> Note: they *do* have a proper _RMV object for what I believe is their
>>> thunderbolt ports.
>>>
>>> Tested successfully on an HP ZBook 17 G2 and HP ZBook 15 G2.
>>>
>>> CC: Len Brown <lenb@kernel.org>
>>> CC: "Rafael J. Wysocki" <rjw@sisk.pl>
>>> CC: Bjorn Helgaas <bhelgaas@google.com>
>>> CC: linux-acpi@vger.kernel.org
>>> CC: linux-pci@vger.kernel.org
>>> Signed-off-by: Jarod Wilson <jarod@redhat.com>
>>> ---
>>>   drivers/pci/hotplug/pciehp_acpi.c | 33 +++++++++++++++++++++++++++++++++
>>>   1 file changed, 33 insertions(+)
>>>
>>> diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c
>>> index 93cc926..db38fb5 100644
>>> --- a/drivers/pci/hotplug/pciehp_acpi.c
>>> +++ b/drivers/pci/hotplug/pciehp_acpi.c
>>> @@ -28,6 +28,7 @@
>>>   #include <linux/pci_hotplug.h>
>>>   #include <linux/slab.h>
>>>   #include <linux/module.h>
>>> +#include <linux/dmi.h>
>>>   #include "pciehp.h"
>>>
>>>   #define PCIEHP_DETECT_PCIE	(0)
>>> @@ -109,10 +110,40 @@ static struct pcie_port_service_driver __initdata dummy_driver = {
>>>   	.probe		= dummy_probe,
>>>   };
>>>
>>> +static int __init set_slot_detection_mode_pcie(const struct dmi_system_id *d)
>>> +{
>>> +	info("%s lacks ACPI _RMV object for expresscard\n", d->ident);
>>> +	return 1;
>>> +}
>>> +
>>> +static struct dmi_system_id __initdata missing_acpi_rmv[] = {
>>> +	/* ZBook 17 through at least bios v01.07 */
>>> +	{
>>> +	 .callback = set_slot_detection_mode_pcie,
>>> +	 .ident = "HP ZBook 17 G2 Mobile Workstation",
>>> +	 .matches = {
>>> +		DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
>>> +		DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 17 G2"),
>>> +		},
>>> +	},
>>> +	/* ZBook 15 through at least bios v01.07 */
>>> +	{
>>> +	 .callback = set_slot_detection_mode_pcie,
>>> +	 .ident = "HP ZBook 15 G2 Mobile Workstation",
>>> +	 .matches = {
>>> +		DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
>>> +		DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 15 G2"),
>>> +		},
>>> +	},
>>> +	{ .ident = NULL }
>>> +};
>>> +
>>>   static int __init select_detection_mode(void)
>>>   {
>>>   	struct dummy_slot *slot, *tmp;
>>>
>>> +	if (dmi_check_system(missing_acpi_rmv))
>>> +		return PCIEHP_DETECT_PCIE;
>>
>> Oh, my goodness.  I forgot how terrible this path is.  Can anyone write a
>> simple explanation of how we choose to use acpiphp or pciehp?  Module
>> parameters?  A dummy driver that looks for duplicate slot numbers?  Looking
>> for _ADR, _EJ0, _RMV?  This is just nuts.
>>
>> I can't really believe that we're doing this correctly.
>>
>> If I understand correctly, the ZBooks don't have _RMV, but we try to use
>> acpiphp anyway, and acpiphp doesn't work?

They do have an _RMV entry for another device, whatever is on 
0000:00:1c.0, which appears to be the thunderbolt port, but I have yet 
to verify that (no thunderbolt devices to play with yet). The 
expresscard slot is 0000:3c:02.0.

>> That sounds more like a problem
>> with our acpiphp/pciehp selection "algorithm" than a BIOS bug.
>>
>> Jarod, can you open a report at http://bugzilla.kernel.org and attach a
>> complete dmesg log, "lspci -vv" output, and an acpidump?  I'm particularly
>> interested in whether the BIOS granted us control over PCIe native hotplug.
>> If it did, I wonder why we would even attempt to use acpiphp.

Done:

https://bugzilla.kernel.org/show_bug.cgi?id=98581

-- 
Jarod Wilson
jarod@redhat.com

      parent reply	other threads:[~2015-05-18 14:30 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
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 [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=5559F76E.5040203@redhat.com \
    --to=jarod@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --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 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.