Re: [PATCH v3 11/13] hwmon: (xgene-hwmon) Simplify PCC shared memory region handling

From: Sudeep Holla
Date: Fri Apr 11 2025 - 11:10:00 EST


On Fri, Apr 11, 2025 at 07:15:22AM -0700, Guenter Roeck wrote:
> On Thu, Mar 13, 2025 at 03:28:57PM +0000, Sudeep Holla wrote:
> > The PCC driver now handles mapping and unmapping of shared memory
> > areas as part of pcc_mbox_{request,free}_channel(). Without these before,
> > this xgene hwmon driver did handling of those mappings like several
> > other PCC mailbox client drivers.
> >
> > There were redundant operations, leading to unnecessary code. Maintaining
> > the consistency across these driver was harder due to scattered handling
> > of shmem.
> >
> > Just use the mapped shmem and remove all redundant operations from this
> > driver.
> >
> > Cc: Jean Delvare <jdelvare@xxxxxxxx>
> > Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> > Cc: linux-hwmon@xxxxxxxxxxxxxxx
> > Acked-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> > Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
>
> Not that it matters, but I keep wondering: Why don't people use auxiliary
> devices for situations like this, and keep the subsystem code where it
> belongs ?
>

Good question. I haven't used auxiliary devices but did looks at it recently
when I stumbled across some x86 telemetry code just last week. I need to go
and understand it better to see how it can be used here as I don't have much
understanding ATM other than its uses in GPU and Audio subsystems.

> I am not requesting that you do it, I just wonder why the mechanism isn't
> used. I would have thought that it would be perfect for situations like
> this, so I guess I must be missing something, and I'd like to understand
> what that something is.
>

Not sure, just that no one spent time think about it and see what is missing
if any and make it work.

--
Regards,
Sudeep