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 A853218C011; Fri, 15 Nov 2024 09:16:00 +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=1731662160; cv=none; b=Lubn+F1bX1EvSE4hJ+jyOq60xP6E13Yf2fmmb8h1EBkl/LVP9D0f2qVLsL7LkunFWanExOOlLLdeRA4gpSoIPzwShAj62+oo5wUYgREmjtc+N6fxTw/wa0LONpmmsy2x5nXZJBryME3BWyy72yFQgkvJFa4fB1LOctSUK53MZKs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731662160; c=relaxed/simple; bh=/wAqRwzJ+gv35k0isr+a2LT/cYabO4xEJpS4EceCYik=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=umLFtLzTdkWu8Jf/PTW0VD7fEYSUlfffB2E+3Tcnk1iCx0UT9RWhZBfnsL+R7waXpuwOgybucP9mU8aSppIO9DPQwPTnuvTYad82nzlA3OjdzrlXbPqkkv2s6ju9iETpePb54uDeTlGr6ehcnOHxLPbLmC0elhkpWDV9h4PjF4I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=i7L36Pgk; 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="i7L36Pgk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16CB4C4CECF; Fri, 15 Nov 2024 09:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731662160; bh=/wAqRwzJ+gv35k0isr+a2LT/cYabO4xEJpS4EceCYik=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=i7L36PgkF1fbntBgrghe3PYoDCf89mtGA9mf9KrcHGdbcFSdRQ4cR+aaNyXoKb5cI 2+yJWadKhVBiE5UIcEQmDZtoeMwKjiFZMllQZRqBDiyRuGO3uRsEqfJCPzRnNwfGNd 39FLChbdK1nQVL048tPYxnNtDPQ2x1uJ9Q9+VfcD8QQLlFp4uKH9fYqHwB9x4V7N1u O/vgM22mYu262k+xJnn3kCJiLWyGMuq7XzE+qFl2boZ5bSL7vq/NMlO5o7C6ZE6WAo 8dNWclhBHPdC0zVlBENfv5HY3PmUFfJhPvIpZRH4NyREhoX6TzdnXSXjFkJycDzHgL fkmv3Vhytg72A== 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 1tBsQn-00D5CM-Qy; Fri, 15 Nov 2024 09:15:57 +0000 Date: Fri, 15 Nov 2024 09:15:57 +0000 Message-ID: <861pzcx3g2.wl-maz@kernel.org> From: Marc Zyngier To: Saravana Kannan Cc: Samuel Holland , Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] of: property: fw_devlink: Do not use interrupt-parent directly In-Reply-To: References: <20241114195652.3068725-1-samuel.holland@sifive.com> 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.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@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: saravanak@google.com, samuel.holland@sifive.com, robh@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Thu, 14 Nov 2024 20:24:34 +0000, Saravana Kannan wrote: >=20 > On Thu, Nov 14, 2024 at 11:56=E2=80=AFAM Samuel Holland > wrote: > > > > commit 7f00be96f125 ("of: property: Add device link support for > > interrupt-parent, dmas and -gpio(s)") started adding device links for > > the interrupt-parent property. Later, commit f265f06af194 ("of: > > property: Fix fw_devlink handling of interrupts/interrupts-extended") > > added full support for parsing the interrupts and interrupts-extended > > properties, which includes looking up the node of the parent domain. > > This made the handler for the interrupt-parent property redundant. > > > > In fact, creating device links based solely on interrupt-parent is > > problematic, because it can create spurious cycles. A node may have > > this property without itself being an interrupt controller or consumer. > > For example, this property is often present in the root node or a /soc > > bus node to set the default interrupt parent for child nodes. However, > > it is incorrect for the bus to depend on the interrupt controller, as > > some of the bus's childre may not be interrupt consumers at all or may > > have a different interrupt parent. > > > > Resolving these spurious dependency cycles can cause an incorrect probe > > order for interrupt controller drivers. This was observed on a RISC-V > > system with both an APLIC and IMSIC under /soc, where interrupt-parent > > in /soc points to the APLIC, and the APLIC msi-parent points to the > > IMSIC. fw_devlink found three dependency cycles and attempted to probe > > the APLIC before the IMSIC. After applying this patch, there were no > > dependency cycles and the probe order was correct. >=20 > Rob/Marc, >=20 > If the claim about the interrupt parent interpretation is correct > across the board, I'm ok with this patch. I agree with Samuel's analysis that "interrupt-parent" is not always relevant to unsuspecting devices, given that it is often inherited from a bus-wide or system-wide parent node. Collectively, "interrupts" (which implicitly uses "interrupt-parent"), "interrupt-extended" and "interrupt-map" should provide enough information to ensure correct dependency tracking. This is a notable departure from "msi-parent", which itself doesn't require any extra specifier, and cannot be ignored here (I note the absence of "msi-map" tracking though). > I remember the RISC-V DT for interrupts being a mess. So, want to make I'm afraid other architectures are not any better. RISC-V only has the dubious advantage of coming up with backward designs, which doesn't help. > sure you agree with these claims before I Ack it. This needs testing, but looks sane from my PoV (though it is early and I need single coffee)... FWIW: Acked-by: Marc Zyngier M. --=20 Without deviation from the norm, progress is not possible.