From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91AE11CD5DA; Tue, 2 Jul 2024 21:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719956574; cv=none; b=ouAtr/TfdMsHzxU+TnsRhJAbMcYQa1FO4UQ9rKdu+Gpq2ZocGqIazf99nhpMypqwQMVck0FldR8+C8fJkgx11nnpgw2dOdFKhd32sZN8Xw6DXrD71S4YNnu+txL7AZKmUMr9wIg+4RoEC4K2tFEGaLkG7EaTal6Tyq7OF5yIA6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719956574; c=relaxed/simple; bh=qWpwYRKarmxNUV5FgK+x6rE0BLQ+21EhDryzhkXDnio=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=dAxFV2Ymngc692GIytlzZLSXyZqQ5iMluiznreBn2L2IOgr4j6IIRroR4vagMgmVac79M6kpUCKw8A2w3eVIchnyRqa/PMdFLRGIEnsMfwtOSMwrYZTsKPCZaarjExjWxZ55a4JIOVEZk2OOExGqxxe470rfOxaId2bRDhopYEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K+WkekOh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K+WkekOh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03128C116B1; Tue, 2 Jul 2024 21:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719956574; bh=qWpwYRKarmxNUV5FgK+x6rE0BLQ+21EhDryzhkXDnio=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=K+WkekOh4QUXz/VxkD6A1iPtFRR3oP+m7KWELEv/HhPkvAbowVPLe2lhZpN7Ggf4Q dmnnYWw8TQupMGHoHMaetjQm6lA+AXoztc1Zuux1hahrNU1beP88VeRXy0g7ztCVUW AZRJbs/8rIq0WfH1LKdgLa4pQCqebjAUT/WepIzcJZjodxnoHS0eL3ChhEFaVibZbG i1KDeYCap3iBhzmkoQKdyt37U+mpbPXd/Ia6O/mUtQrS45vUhFP3AUNeF9u208DmUZ wa/ox1mXvTW/i4Roiu0FoRh8qVDu6hzwvr241rwIxSNB2rRD4P0CR1Dt/GpWEmxO7O 55GVNelD7yvgw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sOlH1-009ENh-9r; Tue, 02 Jul 2024 22:42:51 +0100 Date: Tue, 02 Jul 2024 22:42:46 +0100 Message-ID: <86ed8ba2sp.wl-maz@kernel.org> From: Marc Zyngier To: Rob Herring Cc: Christian Zigotzky , apatel@ventanamicro.com, DTML , Linux Kernel Mailing List , linuxppc-dev , mad skateman , "R.T.Dickinson" , Matthew Leaman , Darren Stevens , Christian Zigotzky Subject: Re: [PowerPC] [PASEMI] Issue with the identification of ATA drives after the of/irq updates 2024-05-29 In-Reply-To: References: <3ab66fab-c3f2-4bed-a04d-a10c57dcdd9b@xenosoft.de> <86zfqzhgys.wl-maz@kernel.org> 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/29.3 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: robh@kernel.org, chzigotzky@xenosoft.de, apatel@ventanamicro.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, madskateman@gmail.com, rtd2@xtra.co.nz, matthew@a-eon.biz, darren@stevens-zone.net, info@xenosoft.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 02 Jul 2024 21:48:23 +0100, Rob Herring wrote: >=20 > On Tue, Jul 2, 2024 at 10:54=E2=80=AFAM Marc Zyngier wro= te: > > > > On Sun, 30 Jun 2024 11:21:55 +0100, > > Christian Zigotzky wrote: > > > > > > Hello, > > > > > > There is an issue with the identification of ATA drives with our > > > P.A. Semi Nemo boards [1] after the > > > commit "of/irq: Factor out parsing of interrupt-map parent > > > phandle+args from of_irq_parse_raw()" [2]. > > > > [snip] > > > > My earlier request for valuable debug information still stands. But > > while you're at it, can you please give the following hack a go? > > > > M. > > > > --- a/drivers/of/irq.c > > +++ b/drivers/of/irq.c > > @@ -282,8 +282,10 @@ int of_irq_parse_raw(const __be32 *addr, struct of= _phandle_args *out_irq) > > > > oldimap =3D imap; > > imap =3D of_irq_parse_imap_parent(oldimap, imap= len, out_irq); > > - if (!imap) > > - goto fail; > > + if (!imap) { > > + match =3D 0; > > + break; > > + } >=20 > AFAICT reading the DT, I don't think this would fix it. imap should > only be null if malformed. This case to me looks like interrupt-map > has the correct cell sizes, but just never matches to do the mapping. > So maybe imaplen is off and that causes us to end up here, but if > there's an error I don't see it. A boot with DEBUG enabled in > drivers/of/irq.c would help. >=20 > > > > match &=3D of_device_is_available(out_irq->np); > > if (match) > > > > This may not be the final workaround even if it solves your boot > > problem, but will at least give us a hint at what is going wrong. > > > > I have the fuzzy feeling that we may be able to lob this broken system > > as part of the of_irq_imap_abusers[] array, which would solve things > > pretty "neatly". >=20 > I think this would work and would consolidate the work-arounds. It > would need either "pasemi,rootbus" or "pa-pxp" added to the list. I'd be all for this. M. diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 462375b293e47..c94203ce65bb3 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -81,7 +81,8 @@ EXPORT_SYMBOL_GPL(of_irq_find_parent); /* * These interrupt controllers abuse interrupt-map for unspeakable * reasons and rely on the core code to *ignore* it (the drivers do - * their own parsing of the property). + * their own parsing of the property). The PAsemi entry covers a + * non-sensical interrupt-map that is better left ignored. * * If you think of adding to the list for something *new*, think * again. There is a high chance that you will be sent back to the @@ -95,6 +96,7 @@ static const char * const of_irq_imap_abusers[] =3D { "fsl,ls1043a-extirq", "fsl,ls1088a-extirq", "renesas,rza1-irqc", + "pasemi,rootbus", NULL, }; =20 @@ -293,20 +295,8 @@ int of_irq_parse_raw(const __be32 *addr, struct of_pha= ndle_args *out_irq) imaplen -=3D imap - oldimap; pr_debug(" -> imaplen=3D%d\n", imaplen); } - if (!match) { - if (intc) { - /* - * The PASEMI Nemo is a known offender, so - * let's only warn for anyone else. - */ - WARN(!IS_ENABLED(CONFIG_PPC_PASEMI), - "%pOF interrupt-map failed, using interrupt-controller\n", - ipar); - return 0; - } - + if (!match) goto fail; - } =20 /* * Successfully parsed an interrupt-map translation; copy new --=20 Without deviation from the norm, progress is not possible.