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/panthor: Replace cross-component register accesses with helpers Date: Mon, 13 Apr 2026 19:05:52 +1000 Message-ID: In-Reply-To: <20260412142951.2309135-4-karunika.choo@arm.com> References: <20260412142951.2309135-1-karunika.choo@arm.com> <20260412142951.2309135-4-karunika.choo@arm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Status: Good. Well-motivated.** This patch eliminates cases where one component directly reads another component's registers. Key changes: 1. Moves `panthor_gpu_coherency_init()` from `panthor_device.c` to `panthor_gpu.c`: ```c +void panthor_gpu_coherency_init(struct panthor_device *ptdev) +{ + gpu_write(ptdev->iomem, GPU_COHERENCY_PROTOCOL, + ptdev->coherent ? GPU_COHERENCY_ACE : GPU_COHERENCY_NONE); +} ``` 2. Adds timestamp/cycle-count accessor helpers to avoid scheduler code reaching into GPU registers: ```c +u64 panthor_gpu_get_timestamp(struct panthor_device *ptdev) +{ + return gpu_read64(ptdev->iomem, GPU_TIMESTAMP_LO); +} ``` 3. Adds a firmware doorbell helper: ```c +void panthor_fw_ring_doorbell(struct panthor_device *ptdev, u32 doorbell) +{ + gpu_write(ptdev->iomem, MCU_DOORBELL(doorbell), 1); +} ``` I verified the initialization ordering in `panthor_device.c`: `panthor_gpu_init()` is called at line 286 before `panthor_gpu_coherency_init()` at line 290, so `ptdev->gpu` (and its `iomem` field, added in patch 5) will be valid. Safe. --- --- Generated by Claude Code Patch Reviewer