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

From: Guenter Roeck
Date: Fri Apr 11 2025 - 10:17:40 EST


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 ?

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.

Thanks,
Guenter