lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFv23QmH4ooXJzX9A0CBObrETZgb9sT4dfh03NZA--fKfZnHDA@mail.gmail.com>
Date:   Tue, 19 Jul 2022 13:55:21 +0800
From:   AceLan Kao <acelan.kao@...onical.com>
To:     Marc Zyngier <maz@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Jason Cooper <jason@...edaemon.net>
Cc:     "Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
        Kai-Heng Feng <kai.heng.feng@...onical.com>
Subject: There are not enough CPU0 APIC IRQs while doing IRQ migration during S3

HI all,

I encountered an issue while doing S3, it shows below message and then
failed to enter S3
[  106.731140] CPU 31 has 116 vectors, 85 available. Cannot disable CPU
[  106.731551] ACPI: \_PR_.C01F: Found 2 idle states
[  106.732610] Error taking CPU31 down: -28
[  106.732612] Non-boot CPUs are not disabled

CPU: AMD Ryzen Threadripper PRO 3955WX 16-Cores
Kernel: v5.19-rc7
There are 5 PCI to 4 type-c ports USB cards on the machine, and It
wouldn't lead to the issue if only 4 cards are plugged. So, it looks
like it can't handle 5 cards, and failed on the IRQ migration.

The workaround provided by kaiheng is to release the irq while
suspending and request irq while resuming.
I'm wondering do we have a better solution for this kind of issue?
Thanks.

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index edc6881c8a1b..91c79b21cb57 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -17,6 +17,7 @@
#include <linux/slab.h>
#include <linux/dmi.h>
#include <linux/dma-mapping.h>
+#include <linux/suspend.h>

#include "xhci.h"
#include "xhci-trace.h"
@@ -1079,6 +1080,9 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
                               __func__);
       }

+       if (pm_suspend_via_firmware())
+               xhci_cleanup_msix(xhci);
+
       /* step 5: remove core well power */
       /* synchronize irq when using MSI-X */
       xhci_msix_sync_irqs(xhci);
@@ -1114,6 +1118,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
           time_before(jiffies, xhci->usb3_rhub.bus_state.next_statechange))
               msleep(100);

+       if (pm_resume_via_firmware())
+               xhci_setup_msix(xhci);
+
       set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
       set_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);


$ lspci -vt
-+-[0000:60]-+-00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Root Complex
|           +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
|           +-01.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-01.1-[61-66]----00.0-[62-66]--+-08.0-[63]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-09.0-[64]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-10.0-[65]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               \-11.0-[66]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           +-02.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-03.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-03.1-[67-6a]----00.0-[68-6a]--+-08.0-[69]--+-00.0
Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
|           |                               |            +-00.1
Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
|           |                               |            \-00.3
Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
|           |                               \-0a.0-[6a]----00.0
Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
|           +-03.2-[6b]----00.0  ASMedia Technology Inc. ASM3242 USB
3.2 Host Controller
|           +-03.3-[6c]----00.0  Intel Corporation I210 Gigabit
Network Connection
|           +-03.4-[6d-6e]----00.0-[6e]----00.0  ASPEED Technology,
Inc. ASPEED Graphics Family
|           +-03.5-[6f]----00.0  Aquantia Corp. Device 14c0
|           +-04.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-05.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-07.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-07.1-[70]----00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Function
|           +-08.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           \-08.1-[71]----00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Reserved SPP
+-[0000:40]-+-00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Root Complex
|           +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
|           +-01.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-01.1-[41-42]--+-00.0  Advanced Micro Devices, Inc.
[AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series]
|           |               \-00.1  Advanced Micro Devices, Inc.
[AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series]
|           +-02.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-03.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-03.1-[43-48]----00.0-[44-48]--+-08.0-[45]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-09.0-[46]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-10.0-[47]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               \-11.0-[48]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           +-04.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-05.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-07.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-07.1-[49]----00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Function
|           +-08.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           \-08.1-[4a]----00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Reserved SPP
+-[0000:20]-+-00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Root Complex
|           +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
|           +-01.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-01.1-[21-26]----00.0-[22-26]--+-08.0-[23]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-09.0-[24]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-10.0-[25]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               \-11.0-[26]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           +-02.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-03.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-03.1-[27-2c]----00.0-[28-2c]--+-08.0-[29]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-09.0-[2a]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               +-10.0-[2b]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           |                               \-11.0-[2c]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
|           +-04.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-05.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-07.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           +-07.1-[2d]----00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Function
|           +-08.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
|           \-08.1-[2e]--+-00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Reserved SPP
|                        +-00.1  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Cryptographic Coprocessor PSPCPP
|                        +-00.3  Advanced Micro Devices, Inc. [AMD]
Starship USB 3.0 Host Controller
|                        \-00.4  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse HD Audio Controller
\-[0000:00]-+-00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Root Complex
            +-00.2  Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
            +-01.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
            +-01.1-[01-06]----00.0-[02-06]--+-08.0-[03]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
            |                               +-09.0-[04]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
            |                               +-10.0-[05]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
            |                               \-11.0-[06]----00.0
ASMedia Technology Inc. ASM3242 USB 3.2 Host Controller
            +-02.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
            +-03.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
            +-03.4-[07]----00.0  Sandisk Corp WD PC SN810 / Black SN850 NVMe SSD
            +-04.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
            +-05.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
            +-07.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
            +-07.1-[08]----00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Function
            +-08.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse PCIe Dummy Host Bridge
            +-08.1-[09]--+-00.0  Advanced Micro Devices, Inc. [AMD]
Starship/Matisse Reserved SPP
            |            \-00.3  Advanced Micro Devices, Inc. [AMD]
Starship USB 3.0 Host Controller
            +-14.0  Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller
            +-14.3  Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge
            +-18.0  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 0
            +-18.1  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 1
            +-18.2  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 2
            +-18.3  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 3
            +-18.4  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 4
            +-18.5  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 5
            +-18.6  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 6
            \-18.7  Advanced Micro Devices, Inc. [AMD] Starship Device
24; Function 7

View attachment "dmesg_5.19-rc6.log" of type "text/x-log" (230626 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ