Message ID | 20231018-nia-sm8350-for-upstream-v2-4-7b243126cb77@igalia.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | support oneplus-lemonade(p) devices | expand |
On 10/18/23 16:25, Nia Espera wrote: > In a similar vein to > https://lore.kernel.org/lkml/20220530080842.37024-3-manivannan.sadhasivam@linaro.org/, > the remote processors on sm8350 fail to initialize with the 'correct' > (i.e., specified in downstream) IRQ type. Change this to EDGE_RISING. > > Signed-off-by: Nia Espera <nespera@igalia.com> > --- Hm, apparently 8250 and 7180 have the same thing. Mani, could you elaborate on this? Konrad
On Mittwoch, 18. Oktober 2023 22:17:15 CEST Konrad Dybcio wrote: > On 10/18/23 16:25, Nia Espera wrote: > > In a similar vein to > > https://lore.kernel.org/lkml/20220530080842.37024-3-manivannan.sadhasivam@ > > linaro.org/, the remote processors on sm8350 fail to initialize with the > > 'correct' (i.e., specified in downstream) IRQ type. Change this to > > EDGE_RISING. > > > > Signed-off-by: Nia Espera <nespera@igalia.com> > > --- > > Hm, apparently 8250 and 7180 have the same thing. > > Mani, could you elaborate on this? > > Konrad I'm also carrying something like this for my sm6350 and sc7280 trees. I tried getting some clarification in the lkml thread linked above about what should be done but never got a response. Regards Luca
On Wed, Oct 18, 2023 at 10:17:15PM +0200, Konrad Dybcio wrote: > > > On 10/18/23 16:25, Nia Espera wrote: > > In a similar vein to > > https://lore.kernel.org/lkml/20220530080842.37024-3-manivannan.sadhasivam@linaro.org/, > > the remote processors on sm8350 fail to initialize with the 'correct' > > (i.e., specified in downstream) IRQ type. Change this to EDGE_RISING. > > > > Signed-off-by: Nia Espera <nespera@igalia.com> > > --- > Hm, apparently 8250 and 7180 have the same thing. > > Mani, could you elaborate on this? > So the remoteproc driver expects the wdog interrupts to be edge triggered as the rest of the interrupts, but DT specifies them as level triggered. This won't cause any issue during the first instance of the probe as the driver requested trigger will be given precedence. But if the probe defers for some reason and during the next try, request_irq() will fail with error similar to below: irq: type mismatch, failed to map hwirq-x for interrupt-controller@xxxxxx! This error is often confusing and I tried to fix it. But Maz didn't agree with me, so I just ended up fixing the DTs for some platform I have access to. So ideally, DTs of all platforms should be fixed to pass correct trigger type. - Mani > Konrad
On 10/19/23 06:06, Manivannan Sadhasivam wrote: > On Wed, Oct 18, 2023 at 10:17:15PM +0200, Konrad Dybcio wrote: >> >> >> On 10/18/23 16:25, Nia Espera wrote: >>> In a similar vein to >>> https://lore.kernel.org/lkml/20220530080842.37024-3-manivannan.sadhasivam@linaro.org/, >>> the remote processors on sm8350 fail to initialize with the 'correct' >>> (i.e., specified in downstream) IRQ type. Change this to EDGE_RISING. >>> >>> Signed-off-by: Nia Espera <nespera@igalia.com> >>> --- >> Hm, apparently 8250 and 7180 have the same thing. >> >> Mani, could you elaborate on this? >> > > So the remoteproc driver expects the wdog interrupts to be edge triggered as the > rest of the interrupts, but DT specifies them as level triggered. This won't > cause any issue during the first instance of the probe as the driver requested > trigger will be given precedence. But if the probe defers for some reason and > during the next try, request_irq() will fail with error similar to below: > > irq: type mismatch, failed to map hwirq-x for interrupt-controller@xxxxxx! > > This error is often confusing and I tried to fix it. But Maz didn't agree with > me, so I just ended up fixing the DTs for some platform I have access to. > > So ideally, DTs of all platforms should be fixed to pass correct trigger type. So, this should be edge for all platforms, correct? Konrad
On Samstag, 21. Oktober 2023 19:44:20 CEST Konrad Dybcio wrote: > On 10/19/23 06:06, Manivannan Sadhasivam wrote: > > On Wed, Oct 18, 2023 at 10:17:15PM +0200, Konrad Dybcio wrote: > >> On 10/18/23 16:25, Nia Espera wrote: > >>> In a similar vein to > >>> https://lore.kernel.org/lkml/20220530080842.37024-3-manivannan.sadhasiva > >>> m@linaro.org/, the remote processors on sm8350 fail to initialize with > >>> the 'correct' (i.e., specified in downstream) IRQ type. Change this to > >>> EDGE_RISING. > >>> > >>> Signed-off-by: Nia Espera <nespera@igalia.com> > >>> --- > >> > >> Hm, apparently 8250 and 7180 have the same thing. > >> > >> Mani, could you elaborate on this? > > > > So the remoteproc driver expects the wdog interrupts to be edge triggered > > as the rest of the interrupts, but DT specifies them as level triggered. > > This won't cause any issue during the first instance of the probe as the > > driver requested trigger will be given precedence. But if the probe > > defers for some reason and during the next try, request_irq() will fail > > with error similar to below: > > > > irq: type mismatch, failed to map hwirq-x for interrupt-controller@xxxxxx! > > > > This error is often confusing and I tried to fix it. But Maz didn't agree > > with me, so I just ended up fixing the DTs for some platform I have > > access to. > > > > So ideally, DTs of all platforms should be fixed to pass correct trigger > > type. > So, this should be edge for all platforms, correct? I'd believe so, iirc when I looked at the driver it always requests that interrupt type. For reference, these are my patches: sm6350: https://github.com/z3ntu/linux/commit/0522b7a1b981d80884a785c7e654bb5094ea1bc2 sc7280: https://github.com/z3ntu/linux/commit/ead1d7b8f5648535b857cfa9250aac2480f00ed3 > > Konrad
On 21.10.2023 21:34, Luca Weiss wrote: > On Samstag, 21. Oktober 2023 19:44:20 CEST Konrad Dybcio wrote: >> On 10/19/23 06:06, Manivannan Sadhasivam wrote: >>> On Wed, Oct 18, 2023 at 10:17:15PM +0200, Konrad Dybcio wrote: >>>> On 10/18/23 16:25, Nia Espera wrote: >>>>> In a similar vein to >>>>> https://lore.kernel.org/lkml/20220530080842.37024-3-manivannan.sadhasiva >>>>> m@linaro.org/, the remote processors on sm8350 fail to initialize with >>>>> the 'correct' (i.e., specified in downstream) IRQ type. Change this to >>>>> EDGE_RISING. >>>>> >>>>> Signed-off-by: Nia Espera <nespera@igalia.com> >>>>> --- >>>> >>>> Hm, apparently 8250 and 7180 have the same thing. >>>> >>>> Mani, could you elaborate on this? >>> >>> So the remoteproc driver expects the wdog interrupts to be edge triggered >>> as the rest of the interrupts, but DT specifies them as level triggered. >>> This won't cause any issue during the first instance of the probe as the >>> driver requested trigger will be given precedence. But if the probe >>> defers for some reason and during the next try, request_irq() will fail >>> with error similar to below: >>> >>> irq: type mismatch, failed to map hwirq-x for interrupt-controller@xxxxxx! >>> >>> This error is often confusing and I tried to fix it. But Maz didn't agree >>> with me, so I just ended up fixing the DTs for some platform I have >>> access to. >>> >>> So ideally, DTs of all platforms should be fixed to pass correct trigger >>> type. >> So, this should be edge for all platforms, correct? > > I'd believe so, iirc when I looked at the driver it always requests that > interrupt type. > > For reference, these are my patches: > > sm6350: > https://github.com/z3ntu/linux/commit/0522b7a1b981d80884a785c7e654bb5094ea1bc2 > > sc7280: > https://github.com/z3ntu/linux/commit/ead1d7b8f5648535b857cfa9250aac2480f00ed3 Can you send those, as well as fix up other outliers? Probably won't get in for this cycle, but still very much worth to get them upstream.. Konrad
diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi index 6d12066389fa..7d5ea338a870 100644 --- a/arch/arm64/boot/dts/qcom/sm8350.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi @@ -2020,7 +2020,7 @@ mpss: remoteproc@4080000 { compatible = "qcom,sm8350-mpss-pas"; reg = <0x0 0x04080000 0x0 0x4040>; - interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_EDGE_RISING>, <&smp2p_modem_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_modem_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_modem_in 2 IRQ_TYPE_EDGE_RISING>, @@ -2062,7 +2062,7 @@ slpi: remoteproc@5c00000 { compatible = "qcom,sm8350-slpi-pas"; reg = <0 0x05c00000 0 0x4000>; - interrupts-extended = <&pdc 9 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&pdc 9 IRQ_TYPE_EDGE_RISING>, <&smp2p_slpi_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_slpi_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_slpi_in 2 IRQ_TYPE_EDGE_RISING>, @@ -3206,7 +3206,7 @@ adsp: remoteproc@17300000 { compatible = "qcom,sm8350-adsp-pas"; reg = <0 0x17300000 0 0x100>; - interrupts-extended = <&pdc 6 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&pdc 6 IRQ_TYPE_EDGE_RISING>, <&smp2p_adsp_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_adsp_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_adsp_in 2 IRQ_TYPE_EDGE_RISING>, @@ -3511,7 +3511,7 @@ cdsp: remoteproc@98900000 { compatible = "qcom,sm8350-cdsp-pas"; reg = <0 0x98900000 0 0x1400000>; - interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>, <&smp2p_cdsp_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_cdsp_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_cdsp_in 2 IRQ_TYPE_EDGE_RISING>,
In a similar vein to https://lore.kernel.org/lkml/20220530080842.37024-3-manivannan.sadhasivam@linaro.org/, the remote processors on sm8350 fail to initialize with the 'correct' (i.e., specified in downstream) IRQ type. Change this to EDGE_RISING. Signed-off-by: Nia Espera <nespera@igalia.com> --- arch/arm64/boot/dts/qcom/sm8350.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)