Message ID | 20220220193346.23789-8-kabel@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
Series | PCI: aardvark controller changes BATCH 5 | expand |
On Sun, Feb 20, 2022 at 08:33:35PM +0100, Marek Behún wrote: > The No Command Completed Support bit in the Slot Capabilities register > indicates whether Command Completed Interrupt Enable is unsupported. > > Enable this interrupt only in the case it is supported. [...] > --- a/drivers/pci/hotplug/pciehp_hpc.c > +++ b/drivers/pci/hotplug/pciehp_hpc.c > @@ -817,7 +817,9 @@ static void pcie_enable_notification(struct controller *ctrl) > else > cmd |= PCI_EXP_SLTCTL_PDCE; > if (!pciehp_poll_mode) > - cmd |= PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE; > + cmd |= PCI_EXP_SLTCTL_HPIE; > + if (!pciehp_poll_mode && !NO_CMD_CMPL(ctrl)) > + cmd |= PCI_EXP_SLTCTL_CCIE; Looks okay to me in principle, I'm just wondering why this change is necessary, i.e. what issue are you seeing without it? Thanks, Lukas
On Monday 09 May 2022 06:01:39 Lukas Wunner wrote: > On Sun, Feb 20, 2022 at 08:33:35PM +0100, Marek Behún wrote: > > The No Command Completed Support bit in the Slot Capabilities register > > indicates whether Command Completed Interrupt Enable is unsupported. > > > > Enable this interrupt only in the case it is supported. > [...] > > --- a/drivers/pci/hotplug/pciehp_hpc.c > > +++ b/drivers/pci/hotplug/pciehp_hpc.c > > @@ -817,7 +817,9 @@ static void pcie_enable_notification(struct controller *ctrl) > > else > > cmd |= PCI_EXP_SLTCTL_PDCE; > > if (!pciehp_poll_mode) > > - cmd |= PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE; > > + cmd |= PCI_EXP_SLTCTL_HPIE; > > + if (!pciehp_poll_mode && !NO_CMD_CMPL(ctrl)) > > + cmd |= PCI_EXP_SLTCTL_CCIE; > > Looks okay to me in principle, I'm just wondering why this change is > necessary, i.e. what issue are you seeing without it? > > Thanks, > > Lukas This is that case which I described in previous email. Kernel was waiting for completion, but if (emulated) Root Port does not support completion event then there were timeouts.
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 373bb396fe22..838eb6cc3ec7 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -817,7 +817,9 @@ static void pcie_enable_notification(struct controller *ctrl) else cmd |= PCI_EXP_SLTCTL_PDCE; if (!pciehp_poll_mode) - cmd |= PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE; + cmd |= PCI_EXP_SLTCTL_HPIE; + if (!pciehp_poll_mode && !NO_CMD_CMPL(ctrl)) + cmd |= PCI_EXP_SLTCTL_CCIE; mask = (PCI_EXP_SLTCTL_PDCE | PCI_EXP_SLTCTL_ABPE | PCI_EXP_SLTCTL_PFDE |