From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 702C3C433EF for ; Wed, 20 Jul 2022 02:53:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240284AbiGTCx4 (ORCPT ); Tue, 19 Jul 2022 22:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234446AbiGTCxy (ORCPT ); Tue, 19 Jul 2022 22:53:54 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFCBF52E42 for ; Tue, 19 Jul 2022 19:53:51 -0700 (PDT) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D2D743F127 for ; Wed, 20 Jul 2022 02:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1658285628; bh=gob9NxQ6ggYl9WM0KIFG2awSk2lOWPYON8bIG1P4U8I=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=FmJXW4h4kZEBb5nhQLIhinrCEeoIVTjj6syZbPRGfBEoi1UwbLP8kilKmUS1+kuhP Oaegb8chcWMlcizHY+q0UX0P7qxZJJ7ind6BKJIidzGuoZzdSXDXxNMHbvlJ5Hcqgr cjP3BIqsEHn4oly7afUltd8WF2P0eU1AEq1Hf8g3+PIuMtunHOPiSKCdCoyAQCOoPQ /1AhQKCCpZVw8LvoOnQCR8jaRJEvCXXKCKS6EoGZrvJnysC5ISJdIwfY6hC/Bt9WqP QauzIqRoxBOQ4lFRYo2BkrdiuB9CGTWklmXLc9ZaH8Az2GpRr3vv3Zm0DSz33Gcj9c HXgqB//FdNIYw== Received: by mail-ed1-f72.google.com with SMTP id y21-20020a056402359500b0043adf65d1a0so11123037edc.10 for ; Tue, 19 Jul 2022 19:53:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gob9NxQ6ggYl9WM0KIFG2awSk2lOWPYON8bIG1P4U8I=; b=NS7OovTeQVWs2/n39Twkc1Q7+hBVZbG4HuEEul3m4jXyuA3j86Ol5BrzlCLUO86fRW 3EfiHt+UUPMBbGOqxPInC5lh3nwNhUmaGLZdok6rdNglyYqmfpL4HWt0Et1tcec2bAlk q82lw75s7a4H4wrqYPiPm+tYMZabJmQy9dS0smCcHXD2Vh7TxSLBHeA79+JSoI5n7L0v CH+gv3TIXREgq76je3IyhtW4dEJ4HWhOJTqG7uPc159XSM46PUfNO12GoP94ATzP8QfB wgKMPDVE4FyUZR0/NYuSX6gYygvnE0gfGXbAPXHhAIHohyaB5qj9gh3WmDCUwrvhZ1Vf Kjbg== X-Gm-Message-State: AJIora99i+otAuGjU7W3wv3hz6JtvxzTJVZ1G8GH8mGt/JyKdre7/n5M N5hP4hxztyLG1i9P1oA08dl9OPu0NxgFXzLYhf2hsd7BauTMYAm/28WaxeYIMgBAhyw23DJYlc+ DdYOegu7vPbqpN0c5/JkBBWKhZvtDWzFf84X6z/Kw9aacg9vN8w0+7CRzGQ== X-Received: by 2002:a05:6402:1d53:b0:43a:9ba7:315b with SMTP id dz19-20020a0564021d5300b0043a9ba7315bmr48379664edb.350.1658285628300; Tue, 19 Jul 2022 19:53:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tyHGAiksDLj4Jve2f/VZJY2zE+GVloIptw1qEFSJKteG3aPVFvdmyP0dc1jDV1HF2wr7JCLGAVhHDHrgBgaW4= X-Received: by 2002:a05:6402:1d53:b0:43a:9ba7:315b with SMTP id dz19-20020a0564021d5300b0043a9ba7315bmr48379653edb.350.1658285628077; Tue, 19 Jul 2022 19:53:48 -0700 (PDT) MIME-Version: 1.0 References: <87fsixz8cb.wl-maz@kernel.org> In-Reply-To: <87fsixz8cb.wl-maz@kernel.org> From: AceLan Kao Date: Wed, 20 Jul 2022 10:53:37 +0800 Message-ID: Subject: Re: There are not enough CPU0 APIC IRQs while doing IRQ migration during S3 To: Marc Zyngier Cc: Thomas Gleixner , "Linux-Kernel@Vger. Kernel. Org" , Kai-Heng Feng Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Marc Zyngier =E6=96=BC 2022=E5=B9=B47=E6=9C=8819=E6=97=A5 = =E9=80=B1=E4=BA=8C =E4=B8=8B=E5=8D=886:48=E5=AF=AB=E9=81=93=EF=BC=9A > > [- Jason] > > On Tue, 19 Jul 2022 06:55:21 +0100, > AceLan Kao wrote: > > > > 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 > > #include > > #include > > +#include > > > > #include "xhci.h" > > #include "xhci-trace.h" > > @@ -1079,6 +1080,9 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_w= akeup) > > __func__); > > } > > > > + if (pm_suspend_via_firmware()) > > + xhci_cleanup_msix(xhci); > > I'm a bit clueless when it comes to the combination of x86 and xhci, > but doesn't this prevent resuming on a xhci interrupt? The PCI cards provide 4 type-c USB ports, and in the beginning we found that removing one PCI card fixed the issue, so we were trying to fix the issue in xhci driver. The USB ports on the PCI cards can't resume the system from S3 even without the workaround, but the USB ports on the rear panel of the motherboard still work with the workaround.