From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/ast: dp501: Fix open-coded register access Date: Wed, 25 Mar 2026 07:46:42 +1000 Message-ID: In-Reply-To: <20260323160407.245773-15-tzimmermann@suse.de> References: <20260323160407.245773-1-tzimmermann@suse.de> <20260323160407.245773-15-tzimmermann@suse.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review Good cleanup of `ast_init_dvo()` and `ast_init_analog()`. The conversion from `ast_read32`/`ast_write32` (which use raw P2A-mapped offsets) to `ast_mindwm`/`ast_moutdwm` (which handle segment selection) is correct. **Important behavioral change in `ast_init_analog()`**: The old code wrote the SCU protection key 3 times: ```c ast_write32(ast, 0x12000, 0x1688a8a8); ast_write32(ast, 0x12000, 0x1688a8a8); ast_write32(ast, 0x12000, 0x1688a8a8); ``` The new code uses `ast_moutdwm_poll`: ```c ast_moutdwm_poll(ast, AST_REG_SCU000, AST_REG_SCU000_PROTECTION_KEY, 0x01); ``` This writes the key once and polls until the register reads 0x01 (unlocked). This is semantically different - the old code retried the write 3 times (perhaps as a reliability measure), while the new code writes once and polls. Since `ast_moutdwm_poll` is write-then-poll, if the hardware needs multiple writes, this could be a regression. However, since this was smoke-tested on hardware and the protection key mechanism typically just needs a single correct write, this should be fine. Also in `ast_init_dvo()`: The old code had a P2A bridge setup sequence (`ast_write32(ast, 0xf004, AST_REG_MCR00)` etc.) that is removed because `ast_moutdwm` handles segment selection internally. But the old code wrote `0x1e6e0000` (MCR base) to the P2A window and then wrote `0x1688a8a8` to offset `0x12000` - which is SCU000 (0x1e6e2000) since 0x12000 = 0x10000 + 0x2000. Wait - that doesn't match: with P2A set to MCR (0x1e6e0000), the window at 0x10000 maps to 0x1e6e0000, so 0x12000 = 0x10000 + 0x2000 would be 0x1e6e2000 = SCU000. That's correct. The new code uses `ast_moutdwm(ast, AST_REG_SCU000, ...)` which will re-select the segment to SCU. Correct. --- Generated by Claude Code Patch Reviewer