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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 3F880C43214 for ; Wed, 28 Jul 2021 10:40:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2795C60F9B for ; Wed, 28 Jul 2021 10:40:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236079AbhG1Kkb (ORCPT ); Wed, 28 Jul 2021 06:40:31 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59440 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235961AbhG1KkU (ORCPT ); Wed, 28 Jul 2021 06:40:20 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1627468818; 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: in-reply-to:in-reply-to:references:references; bh=QBLeATcwfqfAwWH6WlqEnrh3DtrFeH7LmMiAWPWZmCM=; b=LFAHo3tV8SwgQqBtpNGPxPYN7viHLKmKxVFgLXSQy2Eb8RB+D3MEEoTpgSUxfhE/2fUhIq sovrG4qU/PL6cdA1DFNS72fDZ6J+v3NAtUdPsoVBQf4puYtbrVp33WbosKxokJYvGRQfMM qmIipeRgJaSQ0QYwWKX7RHE7aE2rrnCHSCE1Dp7QQkSZxIVKadfAvmc1Q4RD8fVQ476Pz3 frjiEfg2iqf/kRE/pR6jnWhZHG+3vVai8Pgev9yoi2LIerVNrEZrNQxu9dR+KCI/VVXkJQ 0352TmcK+2VyC4+ggBCfFhoh84x9SPjpGTq4ONrxtTGIjWdIinq/D3Q1s7wREw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1627468818; 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: in-reply-to:in-reply-to:references:references; bh=QBLeATcwfqfAwWH6WlqEnrh3DtrFeH7LmMiAWPWZmCM=; b=S4XYjdut749SYDj3weoZDeeCZhriPTKyQFEaZHyx6jwTbquNIHtOUlJPYnQRHtPgJ6Db1x q4Oy+4MybuBUHVAQ== To: Marc Zyngier Cc: LKML , Alex Williamson , "Raj\, Ashok" , Ingo Molnar , "David S. Miller" , Bjorn Helgaas , linux-pci@vger.kernel.org, Kevin Tian , x86@kernel.org Subject: Re: [patch 6/8] genirq: Provide IRQCHIP_AFFINITY_PRE_STARTUP In-Reply-To: <871r7q2xik.wl-maz@kernel.org> References: <20210721191126.274946280@linutronix.de> <20210721192650.687529735@linutronix.de> <871r7q2xik.wl-maz@kernel.org> Date: Wed, 28 Jul 2021 12:40:18 +0200 Message-ID: <87bl6m3enh.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 22 2021 at 16:12, Marc Zyngier wrote: > On Wed, 21 Jul 2021 20:11:32 +0100, > Thomas Gleixner wrote: >> #include >> --- a/kernel/irq/chip.c >> +++ b/kernel/irq/chip.c >> @@ -265,8 +265,11 @@ int irq_startup(struct irq_desc *desc, b >> } else { >> switch (__irq_startup_managed(desc, aff, force)) { >> case IRQ_STARTUP_NORMAL: >> + if (d->chip->flags & IRQCHIP_AFFINITY_PRE_STARTUP) >> + irq_setup_affinity(desc); > > How about moving this to activate instead? We already special-case the > activation of MSIs for PCI (MSI_FLAG_ACTIVATE_EARLY), and this > wouldn't look completely out of place. The startup mode could be an > issue though... Yes, I thought about that, but the ordering here is: setup() early_activate() early activation just needs to program a valid message. Now later we have request_irq() invoking: activate() startup() So, yes. We could do that in activate, but then we still have the post startup variant in irq_startup() which makes the code hard to follow. There is another practical issue. Assume the irq is requested with IRQF_NOAUTOEN, then irq_startup() will be invoked when the driver calls enable_irq(), which might be way later and then the affinity setting might be completely different already. So I rather keep it there. Thanks, tglx