From: Rafael J. Wysocki <[email protected]>
After commit 415e12b2379239973feab91850b0dce985c6058a
(PCI/ACPI: Request _OSC control once for each root bridge (v3)) we
require MSI to be supported so that we use _OSC to request control
of PCIe native features (hotplug, AER, PME), but that appears to
be overkill and causes problems to happen on some systems. For
this reason, request control of PCIe native features via _OSC
even if MSI support is not enabled.
Reported-by: Sarah Sharp <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
Hi,
Sarah, please test this patch on your machine causing PCIe hotplug
problems on top of the patch from https://patchwork.kernel.org/patch/612171/
and on top of 2.6.38-rc6 or later.
Thanks,
Rafael
---
drivers/acpi/pci_root.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: linux-2.6/drivers/acpi/pci_root.c
===================================================================
--- linux-2.6.orig/drivers/acpi/pci_root.c
+++ linux-2.6/drivers/acpi/pci_root.c
@@ -50,8 +50,7 @@ static int acpi_pci_root_start(struct ac
#define ACPI_PCIE_REQ_SUPPORT (OSC_EXT_PCI_CONFIG_SUPPORT \
| OSC_ACTIVE_STATE_PWR_SUPPORT \
- | OSC_CLOCK_PWR_CAPABILITY_SUPPORT \
- | OSC_MSI_SUPPORT)
+ | OSC_CLOCK_PWR_CAPABILITY_SUPPORT)
static const struct acpi_device_id root_device_ids[] = {
{"PNP0A03", 0},
Hi Rafael,
I applied this patch, on top of this patch:
PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
Unfortunately, the Express Card still doesn't show up. The trace looks
slightly different, but the irq still gets disabled. dmesg is attached.
Sarah Sharp
On Sat, Mar 05, 2011 at 10:54:48PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <[email protected]>
>
> After commit 415e12b2379239973feab91850b0dce985c6058a
> (PCI/ACPI: Request _OSC control once for each root bridge (v3)) we
> require MSI to be supported so that we use _OSC to request control
> of PCIe native features (hotplug, AER, PME), but that appears to
> be overkill and causes problems to happen on some systems. For
> this reason, request control of PCIe native features via _OSC
> even if MSI support is not enabled.
>
> Reported-by: Sarah Sharp <[email protected]>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
> ---
>
> Hi,
>
> Sarah, please test this patch on your machine causing PCIe hotplug
> problems on top of the patch from https://patchwork.kernel.org/patch/612171/
> and on top of 2.6.38-rc6 or later.
>
> Thanks,
> Rafael
>
> ---
> drivers/acpi/pci_root.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> Index: linux-2.6/drivers/acpi/pci_root.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/pci_root.c
> +++ linux-2.6/drivers/acpi/pci_root.c
> @@ -50,8 +50,7 @@ static int acpi_pci_root_start(struct ac
>
> #define ACPI_PCIE_REQ_SUPPORT (OSC_EXT_PCI_CONFIG_SUPPORT \
> | OSC_ACTIVE_STATE_PWR_SUPPORT \
> - | OSC_CLOCK_PWR_CAPABILITY_SUPPORT \
> - | OSC_MSI_SUPPORT)
> + | OSC_CLOCK_PWR_CAPABILITY_SUPPORT)
>
> static const struct acpi_device_id root_device_ids[] = {
> {"PNP0A03", 0},
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
On Monday, March 14, 2011, Sarah Sharp wrote:
> Hi Rafael,
>
> I applied this patch, on top of this patch:
> PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
>
> Unfortunately, the Express Card still doesn't show up. The trace looks
> slightly different, but the irq still gets disabled. dmesg is attached.
Hmm. It looks like, for some reason, the check against
pcie_aspm_support_enabled() returns false on your system. Do you have
ASPM enabled in .config?
Rafael
On Mon, Mar 14, 2011 at 09:02:11PM +0100, Rafael J. Wysocki wrote:
> On Monday, March 14, 2011, Sarah Sharp wrote:
> > Hi Rafael,
> >
> > I applied this patch, on top of this patch:
> > PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
> >
> > Unfortunately, the Express Card still doesn't show up. The trace looks
> > slightly different, but the irq still gets disabled. dmesg is attached.
>
> Hmm. It looks like, for some reason, the check against
> pcie_aspm_support_enabled() returns false on your system. Do you have
> ASPM enabled in .config?
My .config is attached. Looks like CONFIG_PCIEASPM=y.
Sarah Sharp
On Monday, March 14, 2011, Sarah Sharp wrote:
> On Mon, Mar 14, 2011 at 09:02:11PM +0100, Rafael J. Wysocki wrote:
> > On Monday, March 14, 2011, Sarah Sharp wrote:
> > > Hi Rafael,
> > >
> > > I applied this patch, on top of this patch:
> > > PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
> > >
> > > Unfortunately, the Express Card still doesn't show up. The trace looks
> > > slightly different, but the irq still gets disabled. dmesg is attached.
> >
> > Hmm. It looks like, for some reason, the check against
> > pcie_aspm_support_enabled() returns false on your system. Do you have
> > ASPM enabled in .config?
>
> My .config is attached. Looks like CONFIG_PCIEASPM=y.
Does it help if you replace "pcie_aspm_support_enabled()" with "true" in
drivers/acpi/pci_root.c:acpi_pci_root_add() ?
Rafael
On Mon, Mar 14, 2011 at 09:37:41PM +0100, Rafael J. Wysocki wrote:
> On Monday, March 14, 2011, Sarah Sharp wrote:
> > On Mon, Mar 14, 2011 at 09:02:11PM +0100, Rafael J. Wysocki wrote:
> > > On Monday, March 14, 2011, Sarah Sharp wrote:
> > > > Hi Rafael,
> > > >
> > > > I applied this patch, on top of this patch:
> > > > PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
> > > >
> > > > Unfortunately, the Express Card still doesn't show up. The trace looks
> > > > slightly different, but the irq still gets disabled. dmesg is attached.
> > >
> > > Hmm. It looks like, for some reason, the check against
> > > pcie_aspm_support_enabled() returns false on your system. Do you have
> > > ASPM enabled in .config?
> >
> > My .config is attached. Looks like CONFIG_PCIEASPM=y.
>
> Does it help if you replace "pcie_aspm_support_enabled()" with "true" in
> drivers/acpi/pci_root.c:acpi_pci_root_add() ?
No, it doesn't. dmesg is attached.
Sarah Sharp
On Tuesday, March 15, 2011, Sarah Sharp wrote:
> On Mon, Mar 14, 2011 at 09:37:41PM +0100, Rafael J. Wysocki wrote:
> > On Monday, March 14, 2011, Sarah Sharp wrote:
> > > On Mon, Mar 14, 2011 at 09:02:11PM +0100, Rafael J. Wysocki wrote:
> > > > On Monday, March 14, 2011, Sarah Sharp wrote:
> > > > > Hi Rafael,
> > > > >
> > > > > I applied this patch, on top of this patch:
> > > > > PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
> > > > >
> > > > > Unfortunately, the Express Card still doesn't show up. The trace looks
> > > > > slightly different, but the irq still gets disabled. dmesg is attached.
> > > >
> > > > Hmm. It looks like, for some reason, the check against
> > > > pcie_aspm_support_enabled() returns false on your system. Do you have
> > > > ASPM enabled in .config?
> > >
> > > My .config is attached. Looks like CONFIG_PCIEASPM=y.
> >
> > Does it help if you replace "pcie_aspm_support_enabled()" with "true" in
> > drivers/acpi/pci_root.c:acpi_pci_root_add() ?
>
> No, it doesn't. dmesg is attached.
Well, I must admit I have no idea what the problem is. OK, in addition to the
above changes, please replace the "pci_ext_cfg_avail(root->bus->self)" in the
same file with "true" and see if _that_ helps.
If it doesn't, please send me your drivers/acpi/pci_root.c after all of the
above changes.
Rafael
On Tue, Mar 15, 2011 at 01:00:17AM +0100, Rafael J. Wysocki wrote:
> Well, I must admit I have no idea what the problem is. OK, in addition to the
> above changes, please replace the "pci_ext_cfg_avail(root->bus->self)" in the
> same file with "true" and see if _that_ helps.
Yay, that worked! dmesg is attached.
Sarah Sharp
On Tuesday, March 15, 2011, Sarah Sharp wrote:
> On Tue, Mar 15, 2011 at 01:00:17AM +0100, Rafael J. Wysocki wrote:
> > Well, I must admit I have no idea what the problem is. OK, in addition to the
> > above changes, please replace the "pci_ext_cfg_avail(root->bus->self)" in the
> > same file with "true" and see if _that_ helps.
>
> Yay, that worked! dmesg is attached.
Good, at least we know what the problem is, now we only have to find the root
cause. ;-)
So, pci_ext_cfg_avail(root->bus->self) returns 0 on your machine, which is kind
of unexpected (to put it lightly), so very likely we have uncovered a bug
in the init code.
Unfortunately, I may not be able to take care of this issue for the next few
days, I'll let you know when I get back to it.
Thanks,
Rafael
2011/3/16 Rafael J. Wysocki <[email protected]>:
> On Tuesday, March 15, 2011, Sarah Sharp wrote:
>> On Tue, Mar 15, 2011 at 01:00:17AM +0100, Rafael J. Wysocki wrote:
>> > Well, I must admit I have no idea what the problem is. ?OK, in addition to the
>> > above changes, please replace the "pci_ext_cfg_avail(root->bus->self)" in the
>> > same file with "true" and see if _that_ helps.
>>
>> Yay, that worked! ?dmesg is attached.
>
> Good, at least we know what the problem is, now we only have to find the root
> cause. ;-)
>
> So, pci_ext_cfg_avail(root->bus->self) returns 0 on your machine, which is kind
> of unexpected (to put it lightly), so very likely we have uncovered a bug
> in the init code.
>
> Unfortunately, I may not be able to take care of this issue for the next few
> days, I'll let you know when I get back to it.
her .config does not define PCI_MMCONFIG
#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
# CONFIG_PCI_MMCONFIG is not set
Yinghai
On Thursday, March 17, 2011, Yinghai Lu wrote:
> 2011/3/16 Rafael J. Wysocki <[email protected]>:
> > On Tuesday, March 15, 2011, Sarah Sharp wrote:
> >> On Tue, Mar 15, 2011 at 01:00:17AM +0100, Rafael J. Wysocki wrote:
> >> > Well, I must admit I have no idea what the problem is. OK, in addition to the
> >> > above changes, please replace the "pci_ext_cfg_avail(root->bus->self)" in the
> >> > same file with "true" and see if _that_ helps.
> >>
> >> Yay, that worked! dmesg is attached.
> >
> > Good, at least we know what the problem is, now we only have to find the root
> > cause. ;-)
> >
> > So, pci_ext_cfg_avail(root->bus->self) returns 0 on your machine, which is kind
> > of unexpected (to put it lightly), so very likely we have uncovered a bug
> > in the init code.
> >
> > Unfortunately, I may not be able to take care of this issue for the next few
> > days, I'll let you know when I get back to it.
>
> her .config does not define PCI_MMCONFIG
>
> #
> # Bus options (PCI etc.)
> #
> CONFIG_PCI=y
> CONFIG_PCI_DIRECT=y
> # CONFIG_PCI_MMCONFIG is not set
Ah, good catch, thanks!
@Sarah: you need to set that for PCI Express to work in general.
Thanks,
Rafael
On Thu, Mar 17, 2011 at 10:22:33PM +0100, Rafael J. Wysocki wrote:
> On Thursday, March 17, 2011, Yinghai Lu wrote:
> > 2011/3/16 Rafael J. Wysocki <[email protected]>:
> > > On Tuesday, March 15, 2011, Sarah Sharp wrote:
> > >> On Tue, Mar 15, 2011 at 01:00:17AM +0100, Rafael J. Wysocki wrote:
> > >> > Well, I must admit I have no idea what the problem is. OK, in addition to the
> > >> > above changes, please replace the "pci_ext_cfg_avail(root->bus->self)" in the
> > >> > same file with "true" and see if _that_ helps.
> > >>
> > >> Yay, that worked! dmesg is attached.
> > >
> > > Good, at least we know what the problem is, now we only have to find the root
> > > cause. ;-)
> > >
> > > So, pci_ext_cfg_avail(root->bus->self) returns 0 on your machine, which is kind
> > > of unexpected (to put it lightly), so very likely we have uncovered a bug
> > > in the init code.
> > >
> > > Unfortunately, I may not be able to take care of this issue for the next few
> > > days, I'll let you know when I get back to it.
> >
> > her .config does not define PCI_MMCONFIG
> >
> > #
> > # Bus options (PCI etc.)
> > #
> > CONFIG_PCI=y
> > CONFIG_PCI_DIRECT=y
> > # CONFIG_PCI_MMCONFIG is not set
>
> Ah, good catch, thanks!
>
> @Sarah: you need to set that for PCI Express to work in general.
Oh, man, sorry to cause so much work to figure that out. :) I'll
compile with that set and see if it helps. Not sure why that config
worked on 2.6.37, but not 2.6.38. I usually just run `make -j4` with
the old .config and basically pick the defaults, except for turning on
the occasional new USB device driver.
Sarah Sharp
> On Thu, Mar 17, 2011 at 10:22:33PM +0100, Rafael J. Wysocki wrote:
> > On Thursday, March 17, 2011, Yinghai Lu wrote:
> > > her .config does not define PCI_MMCONFIG
> > >
> > > #
> > > # Bus options (PCI etc.)
> > > #
> > > CONFIG_PCI=y
> > > CONFIG_PCI_DIRECT=y
> > > # CONFIG_PCI_MMCONFIG is not set
> >
> > Ah, good catch, thanks!
> >
> > @Sarah: you need to set that for PCI Express to work in general.
I compiled 2.6.38 with CONFIG_PCI_MMCONFIG=y, and I'm no longer getting
"irq nobody cared" messages. However, PCI express hot plug seems to
just not work for the xHCI PCI device. Nothing appears in dmesg when I
plug in the Express Card, and the device doesn't appear in lspci.
However, I can get the card to show up if I run
echo 1 > /sys/bus/pci/rescan
PCI hot-remove doesn't seem to work either. The xHCI driver notices the
device got removed when the debugging polling loop runs, but the
driver's PCI remove functions are never called. A rescan of the bus
doesn't help, and the device still shows up in lspci (although all the
registers are read as 0xffff). dmesg and lspci after the device has been
removed is attached.
I've tried turning on all the PCI config options that look relavant; my
.config is attached. I've turned on PCI debug too. The only thing that
looks PCI related that I don't have turned on is ACPI_PCI_SLOT. Do I
need that?
I'm not sure how to debug this hot plug issue further.
Sarah Sharp
Try setting CONFIG_HOTPLUG_PCI_ACPI to y as well, just to rule that out?
--
Matthew Garrett | [email protected]
On Monday, March 21, 2011, Sarah Sharp wrote:
> > On Thu, Mar 17, 2011 at 10:22:33PM +0100, Rafael J. Wysocki wrote:
> > > On Thursday, March 17, 2011, Yinghai Lu wrote:
> > > > her .config does not define PCI_MMCONFIG
> > > >
> > > > #
> > > > # Bus options (PCI etc.)
> > > > #
> > > > CONFIG_PCI=y
> > > > CONFIG_PCI_DIRECT=y
> > > > # CONFIG_PCI_MMCONFIG is not set
> > >
> > > Ah, good catch, thanks!
> > >
> > > @Sarah: you need to set that for PCI Express to work in general.
>
> I compiled 2.6.38 with CONFIG_PCI_MMCONFIG=y, and I'm no longer getting
> "irq nobody cared" messages. However, PCI express hot plug seems to
> just not work for the xHCI PCI device. Nothing appears in dmesg when I
> plug in the Express Card, and the device doesn't appear in lspci.
> However, I can get the card to show up if I run
>
> echo 1 > /sys/bus/pci/rescan
>
> PCI hot-remove doesn't seem to work either. The xHCI driver notices the
> device got removed when the debugging polling loop runs, but the
> driver's PCI remove functions are never called. A rescan of the bus
> doesn't help, and the device still shows up in lspci (although all the
> registers are read as 0xffff). dmesg and lspci after the device has been
> removed is attached.
>
> I've tried turning on all the PCI config options that look relavant; my
> .config is attached. I've turned on PCI debug too. The only thing that
> looks PCI related that I don't have turned on is ACPI_PCI_SLOT. Do I
> need that?
>
> I'm not sure how to debug this hot plug issue further.
Well, we still don't seem to call the _OSC on this machine. At least your
dmesg output doesn't indicate so.
Do you have the patch from:
https://patchwork.kernel.org/patch/604371/
applied?
Rafael
On Mon, Mar 21, 2011 at 10:34:08PM +0000, Matthew Garrett wrote:
> Try setting CONFIG_HOTPLUG_PCI_ACPI to y as well, just to rule that out?
It's set to build as a module, do you want me to compile it in?
Sarah Sharp
On Tuesday, March 22, 2011, Sarah Sharp wrote:
> On Mon, Mar 21, 2011 at 10:34:08PM +0000, Matthew Garrett wrote:
> > Try setting CONFIG_HOTPLUG_PCI_ACPI to y as well, just to rule that out?
>
> It's set to build as a module, do you want me to compile it in?
Yes, if poss. But as I said before, please make sure you have the ASPM patch
applied.
Rafael
On Mon, Mar 21, 2011 at 11:51:12PM +0100, Rafael J. Wysocki wrote:
> On Monday, March 21, 2011, Sarah Sharp wrote:
> > I compiled 2.6.38 with CONFIG_PCI_MMCONFIG=y, and I'm no longer getting
> > "irq nobody cared" messages. However, PCI express hot plug seems to
> > just not work for the xHCI PCI device. Nothing appears in dmesg when I
> > plug in the Express Card, and the device doesn't appear in lspci.
> > However, I can get the card to show up if I run
> >
> > echo 1 > /sys/bus/pci/rescan
> >
> > PCI hot-remove doesn't seem to work either. The xHCI driver notices the
> > device got removed when the debugging polling loop runs, but the
> > driver's PCI remove functions are never called. A rescan of the bus
> > doesn't help, and the device still shows up in lspci (although all the
> > registers are read as 0xffff). dmesg and lspci after the device has been
> > removed is attached.
> >
> > I've tried turning on all the PCI config options that look relavant; my
> > .config is attached. I've turned on PCI debug too. The only thing that
> > looks PCI related that I don't have turned on is ACPI_PCI_SLOT. Do I
> > need that?
> >
> > I'm not sure how to debug this hot plug issue further.
>
> Well, we still don't seem to call the _OSC on this machine. At least your
> dmesg output doesn't indicate so.
>
> Do you have the patch from:
>
> https://patchwork.kernel.org/patch/604371/
>
> applied?
No, it was just 2.6.38. When I applied that patch, PCI hot plug worked!
dmesg is attached. Can the patch get queued for 2.6.38 stable, or is it
just a hack?
Sarah Sharp
On Tuesday, March 22, 2011, Sarah Sharp wrote:
> On Mon, Mar 21, 2011 at 11:51:12PM +0100, Rafael J. Wysocki wrote:
> > On Monday, March 21, 2011, Sarah Sharp wrote:
> > > I compiled 2.6.38 with CONFIG_PCI_MMCONFIG=y, and I'm no longer getting
> > > "irq nobody cared" messages. However, PCI express hot plug seems to
> > > just not work for the xHCI PCI device. Nothing appears in dmesg when I
> > > plug in the Express Card, and the device doesn't appear in lspci.
> > > However, I can get the card to show up if I run
> > >
> > > echo 1 > /sys/bus/pci/rescan
> > >
> > > PCI hot-remove doesn't seem to work either. The xHCI driver notices the
> > > device got removed when the debugging polling loop runs, but the
> > > driver's PCI remove functions are never called. A rescan of the bus
> > > doesn't help, and the device still shows up in lspci (although all the
> > > registers are read as 0xffff). dmesg and lspci after the device has been
> > > removed is attached.
> > >
> > > I've tried turning on all the PCI config options that look relavant; my
> > > .config is attached. I've turned on PCI debug too. The only thing that
> > > looks PCI related that I don't have turned on is ACPI_PCI_SLOT. Do I
> > > need that?
> > >
> > > I'm not sure how to debug this hot plug issue further.
> >
> > Well, we still don't seem to call the _OSC on this machine. At least your
> > dmesg output doesn't indicate so.
> >
> > Do you have the patch from:
> >
> > https://patchwork.kernel.org/patch/604371/
> >
> > applied?
>
> No, it was just 2.6.38. When I applied that patch, PCI hot plug worked!
Cool. :-)
> dmesg is attached. Can the patch get queued for 2.6.38 stable, or is it
> just a hack?
It's not a hack and it's goint to -stable, but it hasn't been merged by
Linus yet (AFAICS).
Thanks,
Rafael