Message ID | 20230627085306.6033-1-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8057156vqr; Tue, 27 Jun 2023 02:16:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sKEqd+il9QHebRtwrhxRR9mNeQc/nI/caXk4GDbFeAcPwfIAWNdksyK6v2YA2zu0feWrO X-Received: by 2002:a05:6a21:6da7:b0:12a:8ebc:90ba with SMTP id wl39-20020a056a216da700b0012a8ebc90bamr1530288pzb.32.1687857361423; Tue, 27 Jun 2023 02:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687857361; cv=none; d=google.com; s=arc-20160816; b=0P3IbFN78IJTvjBbegvCE6dLogMFKACAZRCJgL87sgGSzs/HpITWnrTdctm7pjlyVJ lsV44j8X8l0spPcgyByS+/5zqiOCYaTpHuIDKY7ULeJum0Y2FacvMxW84oZDN5AOxfL6 m+Mxa1DuuZpjOf/kB/JrpoF+Sf18qdnYplmMki8V163sKwXtT//Sv8YSDCs4Hw8yYpYX 4SQOKAGTjF4GaHJW1NIg4xGSLUZqrXOkI30/CP0PyFrMt7fy9eefuBMd4YmvZefJOQER BN09TjoDgfO7CWDcRalcH6+W8M4dolLDdWiL+AwH0zMMhV8h+o6SOpiMhhjwmQytfpg0 qDDA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=munt+Yhb/FitoyrVyICSY7xi+OzmklI9XfznEWs1ER0=; fh=iNOID+ife1OeK89uk6hEq0TVVkF6Rp4tgE9slaCKCHg=; b=sZ6dSTZoMr7+DHeeTREy6CbMbbpyn89MucdLkd1ZBQ/lSp3xb5Px/WB01jfqLtfHRU QzHWL6/G0DHfaToRpUwVIHO7fjXhZJ03z4oZKSIHWzWzsKI58/nBghPjD1fT+IN63OUH uWil88j9OzfHogthkLT89Hjs/qQLuUNbHEly82z4N4+U+5+GVgop2hYdnzYNBsECsq9r 0VkQw6D5DYitKZbEo5XQcxpcEHl+YGiTbnkUxa/jR0l2tiRFdQAeSKx1G48mIJq8OhNK lfGnF8iJPPpAxJ3UmOg0AtglsJvLwpbVMSmY+0FQLwvdw8bWGFr5je/5agS/O0dmOw3X +xGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ORlVk8K3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a056a00150200b006695704e631si7477813pfu.176.2023.06.27.02.15.48; Tue, 27 Jun 2023 02:16:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ORlVk8K3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231146AbjF0IzE (ORCPT <rfc822;nicolai.engesland@gmail.com> + 99 others); Tue, 27 Jun 2023 04:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjF0IzC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 27 Jun 2023 04:55:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40F2610CC; Tue, 27 Jun 2023 01:55:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA46261030; Tue, 27 Jun 2023 08:55:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34CFDC433C0; Tue, 27 Jun 2023 08:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687856100; bh=s8NUZ3ksYv5mLj2yRtarpDvRohslNYcPlf0NKQbDRhc=; h=From:To:Cc:Subject:Date:From; b=ORlVk8K3VPq2wiNzuL6lPHqGT9sbQqF8HVCXZg2LGQ6usjE2HA2NtqBmPCiebL4bo PK0m2JL/9bzi4ttrpxGNlrkW/2FlKZKknOUKn1BWEShBr7Ba0v2FxHMXoxGXSc6CjX zMG8d+cryctWrZfEPNPgGt2kFSfyLR04OnYZ1Z/t/6NmPsAGAwiEW4WKx0Wxx1W8tU d9w2XkYHYYGYU2BrKInwjs+LJoDKz8q78ulmumPN8D0bP14+mfeXPg9vJcR96zpXHH R0cdvbC+vY283pmR62xzHchZZlR0YAXJyo2J4xMVlw8qkYhV7CUVYWiDxbKOKUOPse F6Yh/ArZMVMdw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from <johan+linaro@kernel.org>) id 1qE4TQ-0001Zq-BO; Tue, 27 Jun 2023 10:54:57 +0200 From: Johan Hovold <johan+linaro@kernel.org> To: Bjorn Andersson <andersson@kernel.org> Cc: Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org>, Patrick Wildt <patrick@blueri.se> Subject: [PATCH] arm64: dts: qcom: sc8280xp-pmics: add explicit rtc interrupt parent Date: Tue, 27 Jun 2023 10:53:06 +0200 Message-Id: <20230627085306.6033-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769846720498888913?= X-GMAIL-MSGID: =?utf-8?q?1769846720498888913?= |
Series |
arm64: dts: qcom: sc8280xp-pmics: add explicit rtc interrupt parent
|
|
Commit Message
Johan Hovold
June 27, 2023, 8:53 a.m. UTC
Unless explicitly specified the interrupt-parent property is inherited
from the parent node on Linux even though this may not be in full
compliance with the devicetree specification.
Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics:
Specify interrupt parent explicitly"), add an explicit interrupt parent
also for the PMIC RTC node for the benefit of other operating systems
which may be confused by this omission.
Note that any such OS must still implement a fallback to the root
interrupt domain as most devicetrees are written under the assumption
that the interrupt parent is inherited.
Reported-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 27.06.2023 10:53, Johan Hovold wrote: > Unless explicitly specified the interrupt-parent property is inherited > from the parent node on Linux even though this may not be in full > compliance with the devicetree specification. > > Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: > Specify interrupt parent explicitly"), add an explicit interrupt parent > also for the PMIC RTC node for the benefit of other operating systems > which may be confused by this omission. > > Note that any such OS must still implement a fallback to the root > interrupt domain as most devicetrees are written under the assumption > that the interrupt parent is inherited. > > Reported-by: Patrick Wildt <patrick@blueri.se> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Maybe a warning in of core should be introduced.. Or maybe dtc could learn not to compile such DTS :P Konrad > arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi > index a0ba535bb6c9..80ee12ded4f4 100644 > --- a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi > @@ -101,7 +101,7 @@ pmk8280_rtc: rtc@6100 { > compatible = "qcom,pmk8350-rtc"; > reg = <0x6100>, <0x6200>; > reg-names = "rtc", "alarm"; > - interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>; > + interrupts-extended = <&spmi_bus 0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>; > wakeup-source; > status = "disabled"; > };
On Tue, Jun 27, 2023 at 10:53:06AM +0200, Johan Hovold wrote: > Unless explicitly specified the interrupt-parent property is inherited > from the parent node on Linux even though this may not be in full > compliance with the devicetree specification. > > Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: > Specify interrupt parent explicitly"), add an explicit interrupt parent > also for the PMIC RTC node for the benefit of other operating systems > which may be confused by this omission. > > Note that any such OS must still implement a fallback to the root > interrupt domain as most devicetrees are written under the assumption > that the interrupt parent is inherited. > > Reported-by: Patrick Wildt <patrick@blueri.se> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> It is good to encode this in the binding and fix other such instances. Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> - Mani > --- > arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi > index a0ba535bb6c9..80ee12ded4f4 100644 > --- a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi > @@ -101,7 +101,7 @@ pmk8280_rtc: rtc@6100 { > compatible = "qcom,pmk8350-rtc"; > reg = <0x6100>, <0x6200>; > reg-names = "rtc", "alarm"; > - interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>; > + interrupts-extended = <&spmi_bus 0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>; > wakeup-source; > status = "disabled"; > }; > -- > 2.39.3 >
On Tue, Jun 27, 2023 at 06:54:06PM +0530, Manivannan Sadhasivam wrote: > On Tue, Jun 27, 2023 at 10:53:06AM +0200, Johan Hovold wrote: > > Unless explicitly specified the interrupt-parent property is inherited > > from the parent node on Linux even though this may not be in full > > compliance with the devicetree specification. > > > > Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: > > Specify interrupt parent explicitly"), add an explicit interrupt parent > > also for the PMIC RTC node for the benefit of other operating systems > > which may be confused by this omission. > > > > Note that any such OS must still implement a fallback to the root > > interrupt domain as most devicetrees are written under the assumption > > that the interrupt parent is inherited. > > > > Reported-by: Patrick Wildt <patrick@blueri.se> > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > It is good to encode this in the binding and fix other such instances. Not sure about that. Perhaps the spec should be updated to match reality instead... We have many more instances like this, even for this very SoC, but apparently OpenBSD or whatever OS needs this falls back to the root domain then. Changing this for the rtc node for consistency after you changed the others is a no-brainer, but not sure about trying to do this tree-wide. We already have too many of these one-line DT cleanups... Johan
On Tue, Jun 27, 2023 at 05:27:32PM +0200, Johan Hovold wrote: > On Tue, Jun 27, 2023 at 06:54:06PM +0530, Manivannan Sadhasivam wrote: > > On Tue, Jun 27, 2023 at 10:53:06AM +0200, Johan Hovold wrote: > > > Unless explicitly specified the interrupt-parent property is inherited > > > from the parent node on Linux even though this may not be in full > > > compliance with the devicetree specification. > > > > > > Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: > > > Specify interrupt parent explicitly"), add an explicit interrupt parent > > > also for the PMIC RTC node for the benefit of other operating systems > > > which may be confused by this omission. > > > > > > Note that any such OS must still implement a fallback to the root > > > interrupt domain as most devicetrees are written under the assumption > > > that the interrupt parent is inherited. > > > > > > Reported-by: Patrick Wildt <patrick@blueri.se> > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > > > It is good to encode this in the binding and fix other such instances. > > Not sure about that. Perhaps the spec should be updated to match reality > instead... We have many more instances like this, even for this very > SoC, but apparently OpenBSD or whatever OS needs this falls back to the > root domain then. > Just because linux is doing it in a different way doesn't warrant an amendment to the spec IMO. > Changing this for the rtc node for consistency after you changed the > others is a no-brainer, but not sure about trying to do this tree-wide. > We already have too many of these one-line DT cleanups... > I agree that this is going to be a one-line cleanup but someone has to do it. (not asking you to do since I also skipped it during 2d5cab9232ba). We can put it in the back burner. - Mani > Johan
On Wed, Jun 28, 2023 at 10:55:57AM +0530, Manivannan Sadhasivam wrote: > On Tue, Jun 27, 2023 at 05:27:32PM +0200, Johan Hovold wrote: > > On Tue, Jun 27, 2023 at 06:54:06PM +0530, Manivannan Sadhasivam wrote: > > > On Tue, Jun 27, 2023 at 10:53:06AM +0200, Johan Hovold wrote: > > > > Unless explicitly specified the interrupt-parent property is inherited > > > > from the parent node on Linux even though this may not be in full > > > > compliance with the devicetree specification. > > > > > > > > Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: > > > > Specify interrupt parent explicitly"), add an explicit interrupt parent > > > > also for the PMIC RTC node for the benefit of other operating systems > > > > which may be confused by this omission. > > > > > > > > Note that any such OS must still implement a fallback to the root > > > > interrupt domain as most devicetrees are written under the assumption > > > > that the interrupt parent is inherited. > > > > > > > > Reported-by: Patrick Wildt <patrick@blueri.se> > > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > > > > > It is good to encode this in the binding and fix other such instances. > > > > Not sure about that. Perhaps the spec should be updated to match reality > > instead... We have many more instances like this, even for this very > > SoC, but apparently OpenBSD or whatever OS needs this falls back to the > > root domain then. > > > > Just because linux is doing it in a different way doesn't warrant an amendment > to the spec IMO. My point is that it's apparently not just Linux as most devicetrees work this way at least for the root domain. And then it may be time to update the spec in some way. > > Changing this for the rtc node for consistency after you changed the > > others is a no-brainer, but not sure about trying to do this tree-wide. > > We already have too many of these one-line DT cleanups... > > > > I agree that this is going to be a one-line cleanup but someone has to do it. > (not asking you to do since I also skipped it during 2d5cab9232ba). We can put > it in the back burner. So that may actually amount to a ten-thousand line diff or so... And then it's probably better to just update the spec. Johan
On Wed, Jun 28, 2023 at 08:47:00AM +0200, Johan Hovold wrote: > On Wed, Jun 28, 2023 at 10:55:57AM +0530, Manivannan Sadhasivam wrote: > > On Tue, Jun 27, 2023 at 05:27:32PM +0200, Johan Hovold wrote: > > > On Tue, Jun 27, 2023 at 06:54:06PM +0530, Manivannan Sadhasivam wrote: > > > > On Tue, Jun 27, 2023 at 10:53:06AM +0200, Johan Hovold wrote: > > > > > Unless explicitly specified the interrupt-parent property is inherited > > > > > from the parent node on Linux even though this may not be in full > > > > > compliance with the devicetree specification. > > > > > > > > > > Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: > > > > > Specify interrupt parent explicitly"), add an explicit interrupt parent > > > > > also for the PMIC RTC node for the benefit of other operating systems > > > > > which may be confused by this omission. > > > > > > > > > > Note that any such OS must still implement a fallback to the root > > > > > interrupt domain as most devicetrees are written under the assumption > > > > > that the interrupt parent is inherited. > > > > > > > > > > Reported-by: Patrick Wildt <patrick@blueri.se> > > > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > > > > > > > It is good to encode this in the binding and fix other such instances. > > > > > > Not sure about that. Perhaps the spec should be updated to match reality > > > instead... We have many more instances like this, even for this very > > > SoC, but apparently OpenBSD or whatever OS needs this falls back to the > > > root domain then. > > > > > > > Just because linux is doing it in a different way doesn't warrant an amendment > > to the spec IMO. > > My point is that it's apparently not just Linux as most devicetrees work > this way at least for the root domain. And then it may be time to update > the spec in some way. I'm not sure about the point you're trying to make. In OpenBSD's implementation, which I think complies with the spec, for non-extended interrupts we check the node's (or all its parents') interrupt-parent property. Technically the SPMI arbiter could define an interrupt-parent that points to itself, because it's using interrupts-extended anyway to point to the PDC. But that would feel a bit stupid and not really correct. Alternatively each child node could have interrupt-parent. That said, I understand the point that it might make sense to amend the spec so that if a parent node is an interrupt-controller, that's most probably interrupt parent, unless an interrupt-parent property shows up before. I would like to add that OpenBSD supports a number of SoCs for quite some years and this is the first time I've hit an issue with interrupts that were not designed in a way for the current spec to work. That said we obviously support quite fewer SoCs/boards in total compared to Linux. Cheers, Patrick
On 28.06.2023 10:31, Patrick Wildt wrote: > On Wed, Jun 28, 2023 at 08:47:00AM +0200, Johan Hovold wrote: >> On Wed, Jun 28, 2023 at 10:55:57AM +0530, Manivannan Sadhasivam wrote: >>> On Tue, Jun 27, 2023 at 05:27:32PM +0200, Johan Hovold wrote: >>>> On Tue, Jun 27, 2023 at 06:54:06PM +0530, Manivannan Sadhasivam wrote: >>>>> On Tue, Jun 27, 2023 at 10:53:06AM +0200, Johan Hovold wrote: >>>>>> Unless explicitly specified the interrupt-parent property is inherited >>>>>> from the parent node on Linux even though this may not be in full >>>>>> compliance with the devicetree specification. >>>>>> >>>>>> Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: >>>>>> Specify interrupt parent explicitly"), add an explicit interrupt parent >>>>>> also for the PMIC RTC node for the benefit of other operating systems >>>>>> which may be confused by this omission. >>>>>> >>>>>> Note that any such OS must still implement a fallback to the root >>>>>> interrupt domain as most devicetrees are written under the assumption >>>>>> that the interrupt parent is inherited. >>>>>> >>>>>> Reported-by: Patrick Wildt <patrick@blueri.se> >>>>>> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> >>>>> >>>>> It is good to encode this in the binding and fix other such instances. >>>> >>>> Not sure about that. Perhaps the spec should be updated to match reality >>>> instead... We have many more instances like this, even for this very >>>> SoC, but apparently OpenBSD or whatever OS needs this falls back to the >>>> root domain then. >>>> >>> >>> Just because linux is doing it in a different way doesn't warrant an amendment >>> to the spec IMO. >> >> My point is that it's apparently not just Linux as most devicetrees work >> this way at least for the root domain. And then it may be time to update >> the spec in some way. > > I'm not sure about the point you're trying to make. In OpenBSD's > implementation, which I think complies with the spec, for non-extended > interrupts we check the node's (or all its parents') interrupt-parent > property. > > Technically the SPMI arbiter could define an interrupt-parent that > points to itself, because it's using interrupts-extended anyway to > point to the PDC. But that would feel a bit stupid and not really > correct. Alternatively each child node could have interrupt-parent. > > That said, I understand the point that it might make sense to amend > the spec so that if a parent node is an interrupt-controller, that's > most probably interrupt parent, unless an interrupt-parent property > shows up before. > > I would like to add that OpenBSD supports a number of SoCs for quite > some years and this is the first time I've hit an issue with interrupts > that were not designed in a way for the current spec to work. That said > we obviously support quite fewer SoCs/boards in total compared to Linux. Linux does something out of spec here. We should either comply or amend the dt spec. Perhaps that's a question for Rob Herring. Konrad > > Cheers, > Patrick
On Wed, Jun 28, 2023 at 10:31:57AM +0200, Patrick Wildt wrote: > On Wed, Jun 28, 2023 at 08:47:00AM +0200, Johan Hovold wrote: > > My point is that it's apparently not just Linux as most devicetrees work > > this way at least for the root domain. And then it may be time to update > > the spec in some way. > > I'm not sure about the point you're trying to make. In OpenBSD's > implementation, which I think complies with the spec, for non-extended > interrupts we check the node's (or all its parents') interrupt-parent > property. My point is that that is not compliant with the spec either which only says that in case 'interrupt-parent' is missing in a node for an interrupt-generating device, then the interrupt parent is assumed to be the devicetree parent (which must then also be an interrupt controller or nexus). There is no provision for any recursive lookup in the spec currently. > Technically the SPMI arbiter could define an interrupt-parent that > points to itself, because it's using interrupts-extended anyway to > point to the PDC. But that would feel a bit stupid and not really > correct. Alternatively each child node could have interrupt-parent. I agree that that would not really be correct (e.g. as 'interrupt' and 'interrupt-extended' are supposed to be mutually exclusive). > That said, I understand the point that it might make sense to amend > the spec so that if a parent node is an interrupt-controller, that's > most probably interrupt parent, This bit is already in the spec. > unless an interrupt-parent property > shows up before. But this seems to suggest that you really meant to say "ancestor" in the first clause? > I would like to add that OpenBSD supports a number of SoCs for quite > some years and this is the first time I've hit an issue with interrupts > that were not designed in a way for the current spec to work. That said > we obviously support quite fewer SoCs/boards in total compared to Linux. So OpenBSD apparently implements something similar to Linux (recursive lookup of 'interrupt-parent' properties), but not the part about stopping the recursion when hitting an interrupt controller. Neither part appears to be spec compliant, but you only care about updating DTs that do not comply to the latter bit. That seems reasonable and should importantly not require adding tens of thousands of 'interrupt-parent' properties to the DTs in mainline. Johan
On Tue, 27 Jun 2023 10:53:06 +0200, Johan Hovold wrote: > Unless explicitly specified the interrupt-parent property is inherited > from the parent node on Linux even though this may not be in full > compliance with the devicetree specification. > > Following commit 2d5cab9232ba ("arm64: dts: qcom: sc8280xp-pmics: > Specify interrupt parent explicitly"), add an explicit interrupt parent > also for the PMIC RTC node for the benefit of other operating systems > which may be confused by this omission. > > [...] Applied, thanks! [1/1] arm64: dts: qcom: sc8280xp-pmics: add explicit rtc interrupt parent commit: 55c9b1bf29dad107b3871bbb250c00df80a68791 Best regards,
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi index a0ba535bb6c9..80ee12ded4f4 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi @@ -101,7 +101,7 @@ pmk8280_rtc: rtc@6100 { compatible = "qcom,pmk8350-rtc"; reg = <0x6100>, <0x6200>; reg-names = "rtc", "alarm"; - interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>; + interrupts-extended = <&spmi_bus 0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>; wakeup-source; status = "disabled"; };