Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4302660pxy; Tue, 27 Apr 2021 01:31:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzktxJlNhDFuJXkk1V2D8W+MUbLs7DXCfH1bAl/3sor4AJFA9PtYrEejitKvrBMRYcEMxtX X-Received: by 2002:a17:906:3111:: with SMTP id 17mr21912484ejx.403.1619512301995; Tue, 27 Apr 2021 01:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619512301; cv=none; d=google.com; s=arc-20160816; b=LNFYbkIMIzbmOqNn0Y5wV9neW09+tx8FAiEPr978XEBDiucoYN5naaX7joBI+EU+qV 1GBRywT3xuEFtXhDIVTJc350W70AovLin3Es55IvxX373fl8RPlmkpN7JfmYbis8RfPd 6+CcTAnA/gwmnwVOGkCOMPvWvk613H1flTC2T7hKFQ5tuRuCUusNyB3SCU79v+PGwpM+ /xyLnUg7vnTzc74okWn1pquMhKVjSqqz6UThWKtubobiSPle90s025K5jv6HImxSBHpq 5eTsyvP2nZXmADChcqqCwc4D9Pvr2b2yvodc/z68FTwCsH4LAC8yphTPc+89yIkDGPIa a0zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date; bh=9oPLSL43gUA0LmjsnBvJeNQ6i25HNg7Jpje9D8b8Kuw=; b=YDJ+EDTJ4nIu0bXtGSCsUi3aSYIEJ+NiD/y/mpIAEqzrY3XC5s8Hrjy6OEhEm3oNTL usGfbjGFY25mv0RxO/t3JsdsYgmKat4+7dK25AiB2FfajXoR3aM09In42iVKI4/Ni8Hu vVtMGU3otLecnremhgbUH6upCFHi30PIhR9QRJyXNVYq04lw1Dmi5wHkfH6c9pQ6sEtV mJtXDdf1m+NUgygHY+sdPAUffRs+zTcuwUc0vnsq7j3JJxAcw4OLqP094rVfqEAbdJzC R8fGxjdlPw0hcNK44rJM+2+HYVrdcw63N5p7ud+InFycVKw3WQSo9u3LWVgHj0FysF3g rxFA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n9si310089ejb.201.2021.04.27.01.31.17; Tue, 27 Apr 2021 01:31:41 -0700 (PDT) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235033AbhD0IbA convert rfc822-to-8bit (ORCPT + 99 others); Tue, 27 Apr 2021 04:31:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:32954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233847AbhD0Iaz (ORCPT ); Tue, 27 Apr 2021 04:30:55 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E6C36100B; Tue, 27 Apr 2021 08:30:12 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lbJ6g-009dR1-1U; Tue, 27 Apr 2021 09:30:10 +0100 Date: Tue, 27 Apr 2021 09:30:09 +0100 Message-ID: <87o8e0nn8u.wl-maz@kernel.org> From: Marc Zyngier To: Guenter Roeck Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, Daniel Mack , Robert Jarzmik , Haojian Zhuang , Yoshinori Sato , Rich Felker , Thomas Bogendoerfer , Michael Ellerman , Thomas Gleixner Subject: Re: [PATCH 2/9] ARM: PXA: Kill use of irq_create_strict_mappings() In-Reply-To: <20210426223942.GA213931@roeck-us.net> References: <20210406093557.1073423-1-maz@kernel.org> <20210406093557.1073423-3-maz@kernel.org> <20210426223942.GA213931@roeck-us.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux@roeck-us.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, daniel@zonque.org, robert.jarzmik@free.fr, haojian.zhuang@gmail.com, ysato@users.sourceforge.jp, dalias@libc.org, tsbogend@alpha.franken.de, mpe@ellerman.id.au, tglx@linutronix.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, Thanks for the heads up. On Mon, 26 Apr 2021 23:39:42 +0100, Guenter Roeck wrote: > > On Tue, Apr 06, 2021 at 10:35:50AM +0100, Marc Zyngier wrote: > > irq_create_strict_mappings() is a poor way to allow the use of > > a linear IRQ domain as a legacy one. Let's be upfront about > > it and use a legacy domain when appropriate. > > > > Signed-off-by: Marc Zyngier > > --- > > When running the "mainstone" qemu emulation, this patch results > in many (32, actually) runtime warnings such as the following. > > [ 0.528272] ------------[ cut here ]------------ > [ 0.528285] WARNING: CPU: 0 PID: 1 at kernel/irq/irqdomain.c:550 irq_domain_associate+0x194/0x1f0 > [ 0.528315] error: virq335 is not allocated [...] This looks like a case of CONFIG_SPARSE_IRQ, combined with a lack of brain engagement. I've come up with the following patch, which lets the kernel boot in QEMU without screaming (other than the lack of a rootfs...). Please let me know if this helps. Thanks, M. From 4d7f6ddbbfdff1c9f029bafca79020d3294dc32c Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Tue, 27 Apr 2021 09:00:28 +0100 Subject: [PATCH] ARM: PXA: Fix cplds irqdesc allocation when using legacy mode The Mainstone PXA platform uses CONFIG_SPARSE_IRQ, and thus we cannot rely on the irq descriptors to be readilly allocated before creating the irqdomain in legacy mode. The kernel then complains loudly about not being able to associate the interrupt in the domain -- can't blame it. Fix it by allocating the irqdescs upfront in the legacy case. Fixes: b68761da0111 ("ARM: PXA: Kill use of irq_create_strict_mappings()") Reported-by: Guenter Roeck Signed-off-by: Marc Zyngier --- arch/arm/mach-pxa/pxa_cplds_irqs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c index ec0d9b094744..bddfc7cd5d40 100644 --- a/arch/arm/mach-pxa/pxa_cplds_irqs.c +++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c @@ -121,8 +121,13 @@ static int cplds_probe(struct platform_device *pdev) return fpga->irq; base_irq = platform_get_irq(pdev, 1); - if (base_irq < 0) + if (base_irq < 0) { base_irq = 0; + } else { + ret = devm_irq_alloc_descs(&pdev->dev, base_irq, base_irq, CPLDS_NB_IRQ, 0); + if (ret < 0) + return ret; + } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); fpga->base = devm_ioremap_resource(&pdev->dev, res); -- 2.30.2 -- Without deviation from the norm, progress is not possible.