Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3759305ybb; Mon, 23 Mar 2020 07:13:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsZbh6njJUS8ul2Fsn7QgrmLgfbis21JH4Dzomudu9jiEl2CuKgjVVt6vR5pk8tNvGdkv+n X-Received: by 2002:aca:3844:: with SMTP id f65mr2124472oia.176.1584972780907; Mon, 23 Mar 2020 07:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584972780; cv=none; d=google.com; s=arc-20160816; b=oEEsztG7rwsQEUIyTwQLEn178zUtbGHu/sYh4yZQfpXr3i9J2P2Aw22xzxrExmYGVm 5LU1fjjqJ1nXnrW+62qmckKAthqmmX4IaYubWW+ase02HlORXQORUGuCN2ZaTjRC/PPQ wdbvDf3uqGWsI/EKyQcM3Hday8wgAo89o0DnWvcesgX2ktlr34y0LA8et9wBYsTY82Vv zxILbWJLpg+vLcvdnYNeVtLfTHoRrvOqrHYkmXqjZeXRZd4cqVgwUcUwFQIwzNgELBf0 Eo5o3Zf2IgGOBk0qFmEeCXUbGtVg6kHlgsEVJtNw4DiLTFivrMj3i1xpBbV6g6i12PF2 1ehQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=ucEWNuzUQ4bb1CA6X0Igu0xVlvZ3aVoveR7RybT9TOE=; b=uEaHlmntpl0Gf6JY3N1aCuRhSQ0hxP2vkb9pZByQUC2WdVk4hYm1E5vvPtPm7UMKL6 7JsbtIFONXTP1RT7sWL9++yWAnXZ6VlZzWH1QAzo5XcmHITdGuu81AwDHXFTYShjtvY+ BinCiAcA4FClyqtncrC16O6BOxYaahhrTEjhivNrbYG20GC7BDDNKS/L+8u3x3mPgsWC PNgFro4LpSZ8ziaa9LsAEbKbectAvLZ+/52EhTw5HvxC8PtwZA0rZaM5jeBZEY8uQAYP 0eeaUtaUTPd77Zeqz3xy4Izdu8wY85IAGBSKMkn5p72pXip8F8cslZnY6Cs/VcWWri/N abFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si7781778otn.141.2020.03.23.07.12.41; Mon, 23 Mar 2020 07:13:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728587AbgCWOKT (ORCPT + 99 others); Mon, 23 Mar 2020 10:10:19 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:41496 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728401AbgCWOKS (ORCPT ); Mon, 23 Mar 2020 10:10:18 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jGNmD-0008KI-Na; Mon, 23 Mar 2020 15:10:02 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id B7B181040AA; Mon, 23 Mar 2020 15:10:00 +0100 (CET) From: Thomas Gleixner To: Mathias Nyman , x86@kernel.org Cc: linux-pci , LKML , Bjorn Helgaas , Evan Green , "Ghorai\, Sukumar" , "Amara\, Madhusudanarao" , "Nandamuri\, Srikanth" Subject: Re: MSI interrupt for xhci still lost on 5.6-rc6 after cpu hotplug In-Reply-To: References: <806c51fa-992b-33ac-61a9-00a606f82edb@linux.intel.com> <87d0974akk.fsf@nanos.tec.linutronix.de> Date: Mon, 23 Mar 2020 15:10:00 +0100 Message-ID: <87r1xjp3gn.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathias, Mathias Nyman writes: > Full function trace with patch is huge, can be found compressed at > > This time xhci interrupts stopped after > migration/3-24 [003] d..1 48.530271: msi_set_affinity: twostep update msi, irq 122, vector 33 -> 34, apicid: 6 -> 4 thanks for providing the data. I think I decoded the issue. Can you please test the patch below? Thanks, tglx ---- diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c index 159bd0cb8548..49aec92fa35b 100644 --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c @@ -63,12 +63,13 @@ msi_set_affinity(struct irq_data *irqd, const struct cpumask *mask, bool force) { struct irq_cfg old_cfg, *cfg = irqd_cfg(irqd); struct irq_data *parent = irqd->parent_data; - unsigned int cpu; + unsigned int cpu, old_vector; int ret; /* Save the current configuration */ cpu = cpumask_first(irq_data_get_effective_affinity_mask(irqd)); old_cfg = *cfg; + old_vector = old_cfg.vector; /* Allocate a new target vector */ ret = parent->chip->irq_set_affinity(parent, mask, force); @@ -90,10 +91,10 @@ msi_set_affinity(struct irq_data *irqd, const struct cpumask *mask, bool force) */ if (!irqd_msi_nomask_quirk(irqd) || cfg->vector == old_cfg.vector || - old_cfg.vector == MANAGED_IRQ_SHUTDOWN_VECTOR || + old_vector == MANAGED_IRQ_SHUTDOWN_VECTOR || cfg->dest_apicid == old_cfg.dest_apicid) { irq_msi_update_msg(irqd, cfg); - return ret; + goto check_old; } /* @@ -102,7 +103,7 @@ msi_set_affinity(struct irq_data *irqd, const struct cpumask *mask, bool force) */ if (WARN_ON_ONCE(cpu != smp_processor_id())) { irq_msi_update_msg(irqd, cfg); - return ret; + goto check_old; } /* @@ -163,6 +164,11 @@ msi_set_affinity(struct irq_data *irqd, const struct cpumask *mask, bool force) if (lapic_vector_set_in_irr(cfg->vector)) irq_data_get_irq_chip(irqd)->irq_retrigger(irqd); +check_old: + if (!in_irq() && old_vector != MANAGED_IRQ_SHUTDOWN_VECTOR && + irqd_msi_nomask_quirk(irqd) && lapic_vector_set_in_irr(old_vector)) + irq_data_get_irq_chip(irqd)->irq_retrigger(irqd); + return ret; }