Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1494720pxb; Mon, 22 Feb 2021 03:32:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzheWpzqd1u6ntHn5dAbZJQiN2p+LL0Bf9xgxpRa7xrprJmHYM3jNKTzB0bS2DjeANnbLee X-Received: by 2002:a17:906:7d87:: with SMTP id v7mr17178313ejo.214.1613993547556; Mon, 22 Feb 2021 03:32:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613993547; cv=none; d=google.com; s=arc-20160816; b=DHF4G5TEynnlsoVGxdBCELgNMv4E93/5fSpqLKh3wte1zTGGbKYLewTGHd4bBcliWL v+33JypF0VN9KUztyfE4vnb4R9NJXQdO2cmHFFdz/QadfhtD2BbTh3/cofxhFZXi2Gtv khKqtrSJAGXQgKT3K10M9J7dxoaebQHHkOSemMFiZVBOntezZsA5Vft/Up+xX3mZw6Lj cOWQjo3ojnK0Yv99TzKN7rJCl5vNL1qfzXOUyZI9FEohfgr9RfWXUrK5cQerIFUEy0Ft tvtOyCzWkn07uj3nr7js3OQ2E/9nFLYaWvTbYO/TLB/vdn0jYyl5tG+VMnxjUKrGMz1b gLng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=6COkYhOaop0ryhoHQ9nA5Vjy7wn6uD7pVX1v4wNIyc0=; b=DwHVQVdQVol6U1DdOXpl/4HSZAKVw4XrJqg4KBPeq4d6jRgeBXQS3VS8jTjLcPr/yx dRtLBX5UeOQZ/mg81Ds/3RG4jYW77IRfOzhRG33Ej9IR6NyVmbT+vAwU7s9isphLOYZG Wj0fR/sUl/eX8nFCcgzcg7RdATcSPbgYqIbcTB3Qm62u4pvUP/TOjXv8IKmCM7ZgLVKS 8Dn+F933xhT/yTFLRnLdzzEHH9YyqC4pCurE6So83WlSbTDoRVLlJ4311PrYkmyJLTgV 1BkWIMtgJKALoHSw1Lt9rJkDwYZRy2DK81hpsEL8lm8wRX063Xu0NYYgtABhUjJEBXWL aASQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si1885182ejz.89.2021.02.22.03.32.04; Mon, 22 Feb 2021 03:32:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230125AbhBVL22 (ORCPT + 99 others); Mon, 22 Feb 2021 06:28:28 -0500 Received: from foss.arm.com ([217.140.110.172]:42194 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbhBVL0g (ORCPT ); Mon, 22 Feb 2021 06:26:36 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 614EB1FB; Mon, 22 Feb 2021 03:25:49 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.51.127]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B01183F73B; Mon, 22 Feb 2021 03:25:47 -0800 (PST) Date: Mon, 22 Feb 2021 11:25:44 +0000 From: Mark Rutland To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, james.morse@arm.com, marcan@marcan.st, tglx@linutronix.de, will@kernel.org Subject: Re: [PATCH 5/8] arm64: irq: add a default handle_irq panic function Message-ID: <20210222112544.GB70951@C02TD0UTHF1T.local> References: <20210219113904.41736-1-mark.rutland@arm.com> <20210219113904.41736-6-mark.rutland@arm.com> <20210222095913.GA70951@C02TD0UTHF1T.local> <1d2c27d72b9b2cbdb83d25165a20559a@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1d2c27d72b9b2cbdb83d25165a20559a@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22, 2021 at 10:48:11AM +0000, Marc Zyngier wrote: > On 2021-02-22 09:59, Mark Rutland wrote: > > On Fri, Feb 19, 2021 at 11:39:01AM +0000, Mark Rutland wrote: > > > +void (*handle_arch_irq)(struct pt_regs *) __ro_after_init = > > > default_handle_irq; > > > > > > int __init set_handle_irq(void (*handle_irq)(struct pt_regs *)) > > > { > > > - if (handle_arch_irq) > > > + if (handle_arch_irq != default_handle_irq) > > > return -EBUSY; > > > > > > handle_arch_irq = handle_irq; > > > @@ -87,7 +92,7 @@ void __init init_IRQ(void) > > > init_irq_stacks(); > > > init_irq_scs(); > > > irqchip_init(); > > > - if (!handle_arch_irq) > > > + if (handle_arch_irq == default_handle_irq) > > > panic("No interrupt controller found."); > > It also seems odd to have both default_handle_irq() that panics, > and init_IRQ that panics as well. Not a big deal, but maybe > we should just drop this altogether and get the firework on the > first interrupt. My gut feeling was that both were useful, and served slightly different cases: * The panic in default_handle_irq() helps if we unexpectedly unmask IRQ too early. This is mostly a nicety over the current behaviour of branching to NULL in this case. * The panic in init_IRQ() gives us a consistent point at which we can note the absence of a root IRQ controller even if all IRQs are quiescent. This is a bit nicer to debug than seeing a load of driver probes fail their request_irq() or whatever. ... so I'd err on the side of keeping both, but if you think otherwise I'm happy to change this. Thanks, Mark.