drm/msm/mdss: reset all block resets described in DT
Subsystems (6)
v4 cover drm/msm/mdss: reset all block resets described in DT
*** AI-assistance disclosure ***
This cover letter and the three patches were prepared with the help of an LLM coding assistant. The author reviewed every line, checked every statement against the tree and his own logs, and takes full responsibility for the content.
This is v4 of the MDSS block-reset series. It supersedes v3 (<[email protected]>) and changes only the last commit message, in response to Dmitry's three questions on v3 2/3 (<awb7bslhrhemsgvu7ubaejvurk6fecotgvqlwtvsoe2benqdgq@tvh2sfjbuzyu>).
What changed in v4
==================
v3 3/3 claimed that command-mode panel initialisation "fails with command DMA timeouts and the display comes up as backlight only" because INT2 was left out of reset. That is a causal statement the data does not support:
the failure is intermittent (~50%) and we never isolated INT2 as a single variable. v4 drops the claim. The commit now says only what holds: MDSS is an interrupt controller in DT and the DPU takes its IRQ from it, the display clock controller provides both block resets, and firmware can hand over with the block running, so DT describes both of them.
The two Reviewed-by tags received on v3 3/3 are carried over; the diff of all three patches is byte-identical to v3 except for that commit message.
Answers to the three questions, for the record:
- it is an interrupt controller: sm8750.dtsi's mdss node has "interrupt-controller;" and "#interrupt-cells = <1>", and the DPU child uses "interrupts-extended = <&mdss 0>"; dispcc-sm8750 exposes INT2 as MDSS_INT2_GDSC plus DISP_CC_MDSS_CORE_INT2_BCR (0xa000);
- side effect: msm_mdss_reset() runs in msm_mdss_probe() (msm_mdss.c:372) before the irq domain is created (:417) and before of_platform_populate() (:537), the group is held for the existing 20 ms and released, and dispcc PLLs/clocks are untouched;
- testing: the reset at this position, with core+INT2+RSCC as one bulk group, ran 5/5 cold POR and 2/2 warm resets without a bad boot, against 5 STORM in 9 cold boots when only the core was reset. The exact v4 shape (array API, two resets) has not been booted, and there is no per-reset A/B.
2/3 exists only so the driver honours a DT listing more than one MDSS reset. If you would rather take 3/3 alone, we can drop it; say so and v5 will be 3/3 by itself.
Gates for v4
============
- git am of the three patches onto pristine v7.3-rc7 (24a19b953e) applies cleanly, no fuzz.
- checkpatch --strict on the rewritten 0003: 0 errors, 0 warnings, 0 checks.
- dt_binding_check and the W=1 build are unchanged from v3 (no code or DT diff in v4).
Qianhui Xu (3):
dt-bindings: display: msm: mdss-common: describe additional block
resets
drm/msm/mdss: reset all block resets described in DT
arm64: dts: qcom: sm8750: describe all MDSS block resets
.../devicetree/bindings/display/msm/mdss-common.yaml | 4 +++- .../devicetree/bindings/display/msm/qcom,sm8750-mdss.yaml | 3 ++- arch/arm64/boot/dts/qcom/sm8750.dtsi | 3 ++- drivers/gpu/drm/msm/msm_mdss.c | 5 ++--- 4 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.53.0
PATCH v4 1/3 dt-bindings: display: msm: mdss-common: describe additional block resets
Some platforms provide more than one reset for the MDSS hardware block:
beside the MDSS core reset, the SM8750 display clock controller also exposes a block reset for the MDSS core INT2 interrupt controller.
Allow the resets property to list one or two resets, keeping the MDSS core reset as the first entry so that existing device trees describing a single reset remain valid.
--- .../devicetree/bindings/display/msm/mdss-common.yaml | 4 +++- .../devicetree/bindings/display/msm/qcom,sm8750-mdss.yaml | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/display/msm/mdss-common.yaml +3 -1
@@ -84,8 +84,10 @@ properties: - const: cpu-cfg resets: + minItems: 1 items: - - description: MDSS_CORE reset + - description: MDSS core reset + - description: MDSS core INT2 interrupt controller reset memory-region: maxItems: 1
Documentation/devicetree/bindings/display/msm/qcom,sm8750-mdss.yaml +2 -1
@@ -101,7 +101,8 @@ examples: interconnect-names = "mdp0-mem", "cpu-cfg"; - resets = <&disp_cc_mdss_core_bcr>; + resets = <&disp_cc_mdss_core_bcr>, + <&disp_cc_mdss_core_int2_bcr>; power-domains = <&mdss_gdsc>;
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v4 1/3] dt-bindings: display: msm: mdss-common: describe additional block resets
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: display: msm: misdescribed MDSS_CORE_INT2 reset in mdss-common --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: display: msm: misdescribed MDSS_CORE_INT2 reset in mdss-common
--
commit a487330ddb2e36a5355178c8c4bcbb0f50bae826
Author: Qianhui Xu <[email protected]>
dt-bindings: display: msm: mdss-common: describe additional block resets
This commit allows the MDSS resets property in mdss-common.yaml to accept one or two reset entries and updates the SM8750 MDSS binding example accordingly.
Documentation/devicetree/bindings/display/msm/mdss-common.yaml properties: · line 90
Quoted 13 lines
Documentation/devicetree/bindings/display/msm/mdss-common.yaml +3
-1@@ -84,8 +84,10 @@ properties: - const: cpu-cfg resets: + minItems: 1 items: - - description: MDSS_CORE reset + - description: MDSS core reset + - description: MDSS core INT2 interrupt controller reset
[Severity: Low]
Is the second reset entry an interrupt controller reset?
In drivers/clk/qcom/dispcc-sm8750.c (and earlier dispcc drivers such as dispcc-sm8450.c and dispcc-sm8550.c), DISP_CC_MDSS_CORE_INT2_BCR at 0xa000 and its paired MDSS_INT2_GDSC at 0xb000 control the secondary internal MDSS core clock and power domain (disp_cc_mdss_mdp1_clk, disp_cc_mdss_mdp_lut1_clk, disp_cc_mdss_vsync1_clk, and disp_cc_mdss_ahb1_clk), while the MDSS interrupt controller registers (HW_INTR_STATUS at offset 0x00010) are part of the primary MDSS core block. Should this description and the commit message refer to the secondary internal MDSS core block reset instead?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v4 2/3 drm/msm/mdss: reset all block resets described in DT
In reply to Qianhui Xumsm_mdss_reset() acquires only the first reset listed in the MDSS device node. Platforms can describe more than one MDSS block reset: the SM8750 display clock controller also provides a reset for the MDSS core INT2 interrupt controller, which is left out of reset when the bootloader hands over with the display block still running.
Switch to the reset control array API so that every reset listed in the device node is asserted and released as one group. Devices without a reset in DT are unaffected, and for devices describing a single reset the assert/deassert sequence is unchanged.
--- drivers/gpu/drm/msm/msm_mdss.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/msm/msm_mdss.c +2 -3
@@ -310,7 +310,8 @@ static int msm_mdss_reset(struct device *dev) {struct reset_control *reset; - reset =reset_control_get_optional_exclusive (dev,NULL ); + reset =devm_reset_control_array_get (dev, +RESET_CONTROL_OPTIONAL_EXCLUSIVE );if (!reset) {/* Optional reset not specified */ return 0 ;
@@ -327,8 +328,6 @@ static int msm_mdss_reset(struct device *dev)msleep (20 );reset_control_deassert (reset); -reset_control_put (reset); -return 0 ; }
Signature · 1 line
2.53.0
PATCH v4 3/3 arm64: dts: qcom: sm8750: describe all MDSS block resets
In reply to Qianhui XuThe SM8750 display clock controller provides, beside the MDSS core reset, a block reset for the MDSS core INT2 interrupt controller. The MDSS node is an interrupt controller in DT and the DPU takes its IRQ from it, so INT2 is part of the same block, not a separate device.
Bootloaders hand over with the display block still running, so describe both block resets and let the MDSS reset return the whole group to a known state before any display hardware is programmed.
--- arch/arm64/boot/dts/qcom/sm8750.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8750.dtsi +2 -1
@@ -3071,7 +3071,8 @@ mdss: display-subsystem@ae00000 { <&gcc GCC_DISP_HF_AXI_CLK>, <&dispcc DISP_CC_MDSS_MDP_CLK>; - resets = <&dispcc DISP_CC_MDSS_CORE_BCR>; + resets = <&dispcc DISP_CC_MDSS_CORE_BCR>, + <&dispcc DISP_CC_MDSS_CORE_INT2_BCR>; interconnects = <&mmss_noc MASTER_MDP QCOM_ICC_TAG_ALWAYS &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
Signature · 1 line
2.53.0
Re: [PATCH v4 3/3] arm64: dts: qcom: sm8750: describe all MDSS block resets
Quoted 5 lines · Qianhui Xu
The SM8750 display clock controller provides, beside the MDSS core reset, a block reset for the MDSS core INT2 interrupt controller. The MDSS node is an interrupt controller in DT and the DPU takes its IRQ from it, so INT2 is part of the same block, not a separate device.
Quoted 8 lines
Bootloaders hand over with the display block still running, so describe both block resets and let the MDSS reset return the whole group to a known state before any display hardware is programmed.
Reviewed-by Abel Vesa <[email protected]>Reviewed-by Dmitry Baryshkov <[email protected]>Signed-off-by Qianhui Xu <[email protected]>---
Konrad
[email protected]
AI reviewRe: [PATCH v4 3/3] arm64: dts: qcom: sm8750: describe all MDSS block resets
In reply to Qianhui XuThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] arm64: dts: qcom: sm8750: wrong DISP_CC_MDSS_CORE_INT2_BCR reset on mdss --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] arm64: dts: qcom: sm8750: wrong DISP_CC_MDSS_CORE_INT2_BCR reset on mdss
--
commit 40e1c76742905572ea3b661e7e1c52df77536978
Author: Qianhui Xu <[email protected]>
arm64: dts: qcom: sm8750: describe all MDSS block resets
This commit adds a second display clock controller reset to the mdss node in the sm8750 device tree.
arch/arm64/boot/dts/qcom/sm8750.dtsi mdss: display-subsystem@ae00000 { · line 3363
Quoted 11 lines
arch/arm64/boot/dts/qcom/sm8750.dtsi +2
-1@@ -3359,7 +3359,8 @@ mdss: display-subsystem@ae00000 { <&gcc GCC_DISP_HF_AXI_CLK>, <&dispcc DISP_CC_MDSS_MDP_CLK>; - resets = <&dispcc DISP_CC_MDSS_CORE_BCR>; + resets = <&dispcc DISP_CC_MDSS_CORE_BCR>, + <&dispcc DISP_CC_MDSS_CORE_INT2_BCR>;
[Severity: Medium]
Is the second reset entry actually for an interrupt controller rather than a separate secondary display core domain?
In drivers/clk/qcom/dispcc-sm8750.c, the 0x8000..0x9000 register block holds the primary display core reset, primary clocks (disp_cc_mdss_mdp_clk, disp_cc_mdss_ahb_clk) and mdss_gdsc, whereas 0xa000..0xb000 is a secondary domain with its own clocks (disp_cc_mdss_mdp1_clk, disp_cc_mdss_ahb1_clk, etc.) and dedicated power domain (mdss_int2_gdsc at 0xb000):
drivers/clk/qcom/dispcc-sm8750.c:
static const struct qcom_reset_map disp_cc_sm8750_resets[] = {
[DISP_CC_MDSS_CORE_BCR] = { 0x8000 },
[DISP_CC_MDSS_CORE_INT2_BCR] = { 0xa000 },
[DISP_CC_MDSS_RSCC_BCR] = { 0xc000 },
};static struct gdsc *disp_cc_sm8750_gdscs[] = {
[MDSS_GDSC] = &mdss_gdsc,
[MDSS_INT2_GDSC] = &mdss_int2_gdsc,
};The mdss interrupt controller in drivers/gpu/drm/msm/msm_mdss.c lives at offset 0x10 in the primary mdss register space, which is powered by mdss_gdsc and reset by the primary core reset. Wiring the second reset here causes msm_mdss_reset() to assert and deassert the block reset of a separate clock and power domain whose gdsc and clocks are not attached to the mdss device.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Re: [PATCH v4 3/3] arm64: dts: qcom: sm8750: describe all MDSS block resets
In reply to Qianhui XuHi Konrad,
thanks for the Reviewed-by.
Replying to the sashiko finding as well, because it raises a point I should answer properly rather than wave away: is 0xa000 a secondary display core domain rather than the interrupt block?
Partly yes, and my commit message overstated it. Let me separate what is established from what is not.
What the DT and the driver currently describe:
- mdss is an interrupt controller: "interrupt-controller;" plus "#interrupt-cells = <1>", and its children take IRQs through it -- DPU "interrupts-extended = <&mdss 0>", DSI0 "<&mdss 4>", DSI1 "<&mdss 5>".
- The mdss irqchip itself only reads one status register and demultiplexes (msm_mdss.c, offset 0x10). It has no per-line enable/ack registers; the mask is a software bitmap. The block that does have clear/en/status is MDP TOP's INTR/INTR2 group, driven by the DPU driver.
- dispcc-sm8750 does describe 0xa000 as its own domain: its own GDSC (mdss_int2_gdsc at 0xb000) and its own clock family (disp_cc_mdss_mdp1_clk, disp_cc_mdss_ahb1_clk, ...).
- The mdss node does not attach that domain: power-domains is MDSS_GDSC only, and the clocks list has AHB_CLK/MDP_CLK/GCC_DISP_HF_AXI_CLK, no mdp1 family.
So the reviewer is right that 0xa000 is not "the mdss interrupt controller" and that asserting its BCR reaches into a domain the mdss device has not attached. That is a fair reading of the code.
What the measurement says, and its limit:
On this board, resetting only DISP_CC_MDSS_CORE_BCR leaves the display intermittently broken at cold boot: 5 of 9 cold PORs fail with
msm_dsi ae94000.dsi: command DMA timeout: status=0x2200200
panel-novatek-nt36536: Failed to initialize panel: -5
whereas the same kernel asserting the group gave 15/15 clean boots.
Two limits on that number, both of which I should state rather than let the "15/15" look stronger than it is:
- That arm asserted three resets (0x8000 + 0xa000 + 0xc000), because it was the shape before you asked for RSCC to be dropped. The two-reset shape in this v4 has not been booted; the driver-side change is the same, so I expect it to behave the same, but that is an expectation and not a measurement.
- I have not isolated 0xa000 as a single variable either. The correlation is with the group, not with any one member, so I am not claiming 0xa000 is the sole cause -- the honest statement is that asserting the group is what tracks with a working display.
What I do not have: a datasheet-level statement that the INTR2 group and the 0xa000 domain are the same hardware block. My evidence for that is naming (dispcc calls the reset ..._CORE_INT2_BCR, the GDSC MDSS_INT2_GDSC, MDP TOP calls its second group INTR2) plus structure (same MDSS core, separate BCR/GDSC within it). That is why v4 no longer claims INT2 "was left out of reset and caused the DMA timeouts"; the message only states what dispcc provides and that firmware hands over with the display block running.
Given all of that, two honest options, and I would take whichever you and Dmitry prefer:
a) keep the series as is, with the commit message narrowed to what is observable (group reset correlates with clean cold boots; no causal claim about INT2), and
b) split 3/3 out and drop it, keeping only 2/3 (the array API change, which is uncontroversial), and revisit the SM8750 second reset once someone can confirm the block boundary from documentation.
My preference is (a) because the failing boot is reproducible on this hardware and the group is what fixes it, but (b) is cleaner if you consider the un-attached-domain concern disqualifying. I can send a v5 either way, including a reworded 3/3 that drops the "interrupt controller" framing and describes only "a second block reset provided by dispcc for the MDSS core".
Unless you would rather have (b), I will go with (a) and send a v5 whose only change is the 3/3 commit message below -- the diff stays byte-identical to v4, and your Reviewed-by is carried over. If you would prefer (b) instead, say so and I will drop 3/3 from the series.
--- >8 ---
arm64: dts: qcom: sm8750: describe the second MDSS block reset
The SM8750 display clock controller provides two block resets for the MDSS core area: DISP_CC_MDSS_CORE_BCR and DISP_CC_MDSS_CORE_INT2_BCR, at 0x8000 and 0xa000. The second one belongs to a domain that dispcc describes with its own GDSC (mdss_int2_gdsc) and its own clock family (disp_cc_mdss_mdp1_clk, disp_cc_mdss_ahb1_clk, ...).
Bootloaders hand over with the display hardware still running, so the MDSS reset should return the whole group to a known state before any display hardware is programmed. Describe both resets so that the array-API change in the previous patch asserts and releases the group together.
On this board, resetting only DISP_CC_MDSS_CORE_BCR leaves the display intermittently broken at cold boot (command DMA timeouts followed by a panel init failure, 5 of 9 cold PORs), while asserting the group gave 15 clean boots out of 15. That measurement used the three-reset shape that also included RSCC; it has not been repeated for this two-reset shape, and the second reset has not been isolated as a single variable. What is observable is that resetting the group correlates with a working display at cold boot.
--- 8< ---
One more thing worth stating explicitly: this series was written with AI assistance. I reviewed and edited every line, the measurements above are mine, and I am responsible for the content.
Thanks,
Qianhui