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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DC12C636CA for ; Wed, 21 Jul 2021 19:28:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7916F610F7 for ; Wed, 21 Jul 2021 19:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240226AbhGUSsF (ORCPT ); Wed, 21 Jul 2021 14:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240243AbhGUSrw (ORCPT ); Wed, 21 Jul 2021 14:47:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD50AC061575; Wed, 21 Jul 2021 12:28:27 -0700 (PDT) Message-Id: <20210721192650.777524186@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1626895706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=gXoT1JSDwLz5tF/LvOMibPfjcEw9m9vkS4YxgZeoadQ=; b=zT2j3XDPQ7OQ3Ff1b+MxpcdAVEh21bOQzCOKp9f6OCSsIer62PPtI/Y0cXiIOAzDL8CZxn 2KM3IBoJBPRNfPiuWvV1P450sDS77rPyuKMriDqa1mLh/ktIHdMCIlq/qfpwePYWKXtIza PwJ9QHNK3HWYIkBV3VX2/3t6ohMrJUygxlmQhZFcukOZGgxNkQkzaF1pIjRQdTUJxEf8lE 7HX6Slbn4Q5b7YJ0/ueGIPWj0BiUH97Cl/NLFykI9D5xQr5FE5Zxp7DeNzeihtoIGA/vNB z2worL6t50w5Mk0eQVSPHUsMNygvkbBN8kzxtLDrHn+31/aBWxRPbifKBH4ipQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1626895706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=gXoT1JSDwLz5tF/LvOMibPfjcEw9m9vkS4YxgZeoadQ=; b=t0pnar278lCEc4snxylSco8P4VsV1sqDNsa71drDsuc/ejPNItIOQTz39KCFFtpLql5rYu STlgOyH8sOs1IYBQ== Date: Wed, 21 Jul 2021 21:11:33 +0200 From: Thomas Gleixner To: LKML Cc: Alex Williamson , "Raj, Ashok" , x86@kernel.org, "David S. Miller" , Bjorn Helgaas , linux-pci@vger.kernel.org, Kevin Tian , Marc Zyngier , Ingo Molnar Subject: [patch 7/8] x86/ioapic: Force affinity setup before startup References: <20210721191126.274946280@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The IO/APIC cannot handle interrupt affinity changes safely after startup other than from an interrupt handler. The startup sequence in the generic interrupt code violates that assumption. Mark the irq chip with the new IRQCHIP_AFFINITY_PRE_STARTUP flag so that the default interrupt setting happens before the interrupt is started up for the first time. Fixes: 18404756765c ("genirq: Expose default irq affinity mask (take 3)") Signed-off-by: Thomas Gleixner Cc: x86@kernel.org --- arch/x86/kernel/apic/io_apic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -1986,7 +1986,8 @@ static struct irq_chip ioapic_chip __rea .irq_set_affinity = ioapic_set_affinity, .irq_retrigger = irq_chip_retrigger_hierarchy, .irq_get_irqchip_state = ioapic_irq_get_chip_state, - .flags = IRQCHIP_SKIP_SET_WAKE, + .flags = IRQCHIP_SKIP_SET_WAKE | + IRQCHIP_AFFINITY_PRE_STARTUP, }; static struct irq_chip ioapic_ir_chip __read_mostly = { @@ -1999,7 +2000,8 @@ static struct irq_chip ioapic_ir_chip __ .irq_set_affinity = ioapic_set_affinity, .irq_retrigger = irq_chip_retrigger_hierarchy, .irq_get_irqchip_state = ioapic_irq_get_chip_state, - .flags = IRQCHIP_SKIP_SET_WAKE, + .flags = IRQCHIP_SKIP_SET_WAKE | + IRQCHIP_AFFINITY_PRE_STARTUP, }; static inline void init_IO_APIC_traps(void)