Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5058336imw; Tue, 19 Jul 2022 20:06:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcP4Rohugi8WL53CXFs1lK0DJ546AJsKgsgLltSdSOMXqUzGx626Z2jFFpjlcldkUqdBPs X-Received: by 2002:a17:90b:1d8a:b0:1f0:419f:66b1 with SMTP id pf10-20020a17090b1d8a00b001f0419f66b1mr2934885pjb.119.1658286400637; Tue, 19 Jul 2022 20:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658286400; cv=none; d=google.com; s=arc-20160816; b=p+cGVzoB/X1lvBno2xm17ETVSN19iWB4DUedQUKVGelV280hiEq85XrY/Qcl+ij21P QZnL4GCt1vULOhIGji/y/YTjnNUjVNMY5DxmOZsBNCceLrL98h0u1X2uKKLcW8RUmCzl GtfH+XmTDdxIX79p0E8OCtm9AmJT+qI8rKLTATdCPlMji6M3uhWH+kGqPTpNYinrwcQU WRIleueyvvwO3qQvwbwUD87HPY5YZmOLJTzLAJwtvN976i0OhV+6AhapPr+gGEFstD9G cB8VLVyF6kFv8bW4XPulRHJpjlVq70ufvOj0HQsQRGATnVbFaYFkeZOXMQ0svOgDOihu wcLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gob9NxQ6ggYl9WM0KIFG2awSk2lOWPYON8bIG1P4U8I=; b=nskhhcoI9AFzbxUie5YGEKk2XDw0Y2/piaVaoAFLTl27gNOWrJRMbojaRy+gma+4mz Shg/E2ewSCdQZAr+44VCYwlFG1oy/YTrT9arwrAMoaSki5Otr8OhXT1ERwYBNnvhsKSK Tb5+E+aLs9E0ukiFZ7BMTg1ZfIp0X2ksuD/tbfjjy2dc11FCFwbKRK3c3dQQPkHICOHg cxm5IEvj4Mys0uksZP5xrCvmepHXl4TnbRyWA2P3ZJzjZlR33YmoFmeqWB7UqPB7Umaa /nb1jm6jgx68ylaTgQcxP0nJrWsEBFDgw4bsIgZeBnEkEGt5C1daD2VLE/nGCiv4Z+e4 pUTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=FmJXW4h4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a170902e88b00b0016a4a80a4a1si24930352plg.363.2022.07.19.20.06.21; Tue, 19 Jul 2022 20:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=FmJXW4h4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240067AbiGTCxz (ORCPT + 99 others); Tue, 19 Jul 2022 22:53:55 -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-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 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.