From: Bjorn Helgaas <bhelgaas@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linus Torvalds <torvalds@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux PCI <linux-pci@vger.kernel.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: [BUG] WARN_ON(!context) in drivers/pci/hotplug/acpiphp_glue.c
Date: Fri, 11 Oct 2013 09:08:40 -0600 [thread overview]
Message-ID: <CAErSpo7MWaJpY3pw1Db0J6vLZd22LcxReRxs3i2CUZb6qMexXw@mail.gmail.com> (raw)
In-Reply-To: <20131011090153.7760db6b@gandalf.local.home>
On Fri, Oct 11, 2013 at 7:01 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Fri, 11 Oct 2013 13:13:47 +0200
> "Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:
>>
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> Subject: ACPI / hotplug / PCI: Accept coexistence with native PCIe hotplug
>>
>> Allow ACPIPHP (ACPI-based PCI hotplug) to handle event signaling for
>> devices that have already been claimed by the native PCIe hotplug
>> (pciehp).
>>
>> The ACPI hotplug events are essentially re-scan, remove and eject
>> requests. Re-scan and remove should work regardless, because they
>> may be triggered by user space via sysfs and the ACPI eject (_EJ0)
>> should work if the BIOS wants us to use it. There may be an issue
>> if the BIOS signals ACPI eject and wants us to use the native eject,
>> but that doesn't work without this change anyway.
>>
>> This change prevents the WARN_ON() in acpiphp_enumerate_slots() from
>> triggering unnecessarily for bridges whose parents are managed by
>> pciehp.
>>
>
> Reported-by: Steven Rostedt <rostedt@goodmis.org>
> Tested-by: Steven Rostedt <rostedt@goodmis.org>
I opened https://bugzilla.kernel.org/show_bug.cgi?id=62831 for this
issue because I don't think this question of how to coordinate acpiphp
and pciehp is completely resolved, and I think it might be interesting
to have the complete dmesg, acpidump, and "lspci -vv" output attached
there for future reference.
Steve, I tried to attach the dmesg you mentioned yesterday in IRC, but
the link didn't work for me. Would you mind attaching this info?
Rafael, I assume you'll probably merge this through your tree. Would
you mind adding a reference to this bugzilla in the changelog? I do
have a "convert to dynamic debug" acpiphp patch in my "next" branch
(bd950799), but I suspect you have several more interesting ones in
your tree.
Bjorn
>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> ---
>> drivers/pci/hotplug/acpiphp_glue.c | 32 ++++++++++++++++++++++++++------
>> 1 file changed, 26 insertions(+), 6 deletions(-)
>>
>> Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c
>> ===================================================================
>> --- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c
>> +++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -259,6 +259,31 @@ static void acpiphp_dock_release(void *d
>> put_bridge(context->func.parent);
>> }
>>
>> +/**
>> + * slot_should_be_exposed - Check whether or not to expose a slot to userland.
>> + * @bridge: ACPIPHP bridge the slot belongs to.
>> + * @handle: ACPI handle of a device in the slot.
>> + */
>> +static inline bool slot_should_be_exposed(struct acpiphp_bridge *bridge,
>> + acpi_handle handle)
>> +{
>> + struct pci_bus *pbus = bridge->pci_bus;
>> + struct pci_dev *pdev = bridge->pci_dev;
>> +
>> + /*
>> + * Do not expose slots whose bridges are managed by pciehp, because they
>> + * will be exposed to user space by the pciehp driver.
>> + */
>> + if (pdev && device_is_managed_by_native_pciehp(pdev))
>> + return false;
>> +
>> + /*
>> + * Expose slots for devices with either _EJ0 or _RMV and for devices
>> + * on docking stations.
>> + */
>> + return acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle);
>> +}
>> +
>> /* callback routine to register each ACPI PCI slot object */
>> static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
>> void **rv)
>> @@ -271,12 +296,8 @@ static acpi_status register_slot(acpi_ha
>> unsigned long long adr;
>> int device, function;
>> struct pci_bus *pbus = bridge->pci_bus;
>> - struct pci_dev *pdev = bridge->pci_dev;
>> u32 val;
>>
>> - if (pdev && device_is_managed_by_native_pciehp(pdev))
>> - return AE_OK;
>> -
>> status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
>> if (ACPI_FAILURE(status)) {
>> acpi_handle_warn(handle, "can't evaluate _ADR (%#x)\n", status);
>> @@ -325,8 +346,7 @@ static acpi_status register_slot(acpi_ha
>>
>> list_add_tail(&slot->node, &bridge->slots);
>>
>> - /* Register slots for ejectable funtions only. */
>> - if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) {
>> + if (slot_should_be_exposed(bridge, handle)) {
>> unsigned long long sun;
>> int retval;
>>
>
next prev parent reply other threads:[~2013-10-11 15:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20131010165905.7815defa@gandalf.local.home>
2013-10-10 21:17 ` Linus Torvalds
2013-10-10 21:35 ` Rafael J. Wysocki
2013-10-10 21:37 ` Linus Torvalds
2013-10-10 22:31 ` Claws (was [BUG] WARN_ON(!context) in drivers/pci/hotplug/acpiphp_glue.c) Jonathan Corbet
2013-10-10 23:09 ` [BUG] WARN_ON(!context) in drivers/pci/hotplug/acpiphp_glue.c Rafael J. Wysocki
2013-10-11 1:45 ` Rafael J. Wysocki
2013-10-11 1:42 ` Linus Torvalds
2013-10-11 11:13 ` Rafael J. Wysocki
2013-10-11 13:01 ` Steven Rostedt
2013-10-11 15:08 ` Bjorn Helgaas [this message]
2013-10-11 17:21 ` Linus Torvalds
2013-10-11 21:58 ` Rafael J. Wysocki
2013-10-11 23:56 ` Rafael J. Wysocki
2013-10-11 0:19 ` Steven Rostedt
2013-10-11 1:00 ` Linus Torvalds
2013-10-11 1:06 ` Joe Perches
2013-10-11 1:07 ` Linus Torvalds
2013-10-11 14:08 ` Jonathan Corbet
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=CAErSpo7MWaJpY3pw1Db0J6vLZd22LcxReRxs3i2CUZb6qMexXw@mail.gmail.com \
--to=bhelgaas@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.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®