Re: [PATCH v9 6/7] drm/panthor: Make MMU cache maintenance use FLUSH_CACHES command
From: Liviu Dudau
Date: Thu Aug 14 2025 - 18:58:57 EST
On Fri, Aug 08, 2025 at 11:50:27AM +0100, Daniel Stone wrote:
> Hi Karunika,
>
>
> On Thu, 7 Aug 2025 at 17:27, Karunika Choo <karunika.choo@xxxxxxx> wrote:
> > @@ -585,6 +615,9 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
> > if (op != AS_COMMAND_UNLOCK)
> > lock_region(ptdev, as_nr, iova, size);
> >
> > + if (op == AS_COMMAND_FLUSH_MEM || op == AS_COMMAND_FLUSH_PT)
> > + return mmu_hw_do_flush_on_gpu_ctrl(ptdev, as_nr, op);
>
> Given that FLUSH_MEM and FLUSH_PT are the only ops which are ever
> used, the below becomes dead code. Could you please just inline these,
> so it's more clear what's actually going on? The (op !=
> AS_COMMAND_UNLOCK) branch can also become unconditional, perhaps with
> a WARN_ON() around unknown ops.
Hmm, the commit message says that FLUSH_MEM and FLUSH_PT are going to be
deprecated and replaced with FLUSH_CACHES so the first are clearly not the
only ones ever used (at least not in the future). I'm not sure why you
think this code is not correct.
Best regards,
Liviu
>
> Cheers,
> Daniel
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯