mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
To: Lee Jones <lee@kernel.org>, sashiko-reviews@lists.linux.dev
Cc: neil.armstrong@linaro.org, linux-amlogic@lists.infradead.org,
	devicetree@vger.kernel.org, mfd@lists.linux.dev, robh@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v11 1/6] mfd: khadas-mcu: Add per-variant configuration infrastructure and VIM4 support
Date: Wed, 16 Sep 2026 14:55:41 +0200	[thread overview]
Message-ID: <28052bf6-1a8a-42e9-86c7-cfb89d663a06@aliel.fr> (raw)
In-Reply-To: <20260910141629.GE1051768@google.com>

On 9/10/26 4:16 PM, Lee Jones wrote:
> On Wed, 02 Sep 2026, sashiko-bot@kernel.org wrote:
> 
>> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>> - [Low] Parent MFD driver introduces child-specific private resources (fan configuration) via a platform data struct in a global MFD header, violating MFD separation and coupling principles.
>> --
>>
>> commit 85d716a1f91fa9e8e2f48479df8c7b07e0cf0279
>> Author: Ronald Claveau <linux-kernel-dev@aliel.fr>
>>
>> mfd: khadas-mcu: Add per-variant configuration infrastructure and VIM4 support
>>
>> This commit introduces per-variant configuration structures for the KHADAS MCU
>> driver, adding support for VIM4 specific registers. It also introduces an enum
>> for variant matching and a fan platform data struct to pass fan configuration
>> to a sub-driver.
>>
>>> diff --git a/include/linux/mfd/khadas-mcu.h b/include/linux/mfd/khadas-mcu.h
>>> index a99ba2ed0e4e0..7a9980ea63e7e 100644
>>> --- a/include/linux/mfd/khadas-mcu.h
>>> +++ b/include/linux/mfd/khadas-mcu.h
>>
>> [ ... ]
>>
>>> @@ -88,4 +95,21 @@ struct khadas_mcu {
>>>  	struct regmap *regmap;
>>>  };
>>>  
>>> +/**
>>> + * struct khadas_mcu_fan_pdata - fan sub-driver configuration
>>> + * @fan_reg: register address to write the fan level
>>> + * @levels: table mapping logical cooling-device states to raw fan levels
>>> + * @nlevels: number of entries in @levels
>>> + */
>>> +struct khadas_mcu_fan_pdata {
>>> +	unsigned int fan_reg;
>>> +	const unsigned int *levels;
>>> +	unsigned int nlevels;
>>> +};
>>
>> [Severity: Low]
>> Does this struct introduce child-specific private configuration into the core
>> MFD driver?
>>
>> By defining khadas_mcu_fan_pdata to pass thermal cooling state levels, it
>> appears the parent MFD driver will be forced to handle configurations specific
>> to a single sub-driver. The MFD subsystem principles indicate that the core
>> driver should only handle shared core resources, while child drivers should
>> manage their own private configurations.
>>
>> Could this approach create tight coupling where any new fan variant requires
>> changes to the core MFD driver, rather than keeping those details contained
>> within the thermal driver?
> 
> Agreed.  Why can this not live in the fan driver?
> 

Thank you for the feedback, I will send a new proposal without this.

-- 
Best regards,
Ronald

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-09-16 12:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 12:51 [PATCH v11 0/6] Add VIM4 MCU/FAN support Ronald Claveau via B4 Relay
2026-09-02 12:51 ` [PATCH v11 1/6] mfd: khadas-mcu: Add per-variant configuration infrastructure and VIM4 support Ronald Claveau via B4 Relay
2026-09-02 13:02   ` sashiko-bot
2026-09-10 14:16     ` Lee Jones
2026-09-16 12:55       ` Ronald Claveau [this message]
2026-09-02 12:51 ` [PATCH v11 2/6] mfd: khadas-mcu: Use MFD_CELL_* macros for cell declarations Ronald Claveau via B4 Relay
2026-09-02 12:58   ` sashiko-bot
2026-09-02 12:51 ` [PATCH v11 3/6] mfd: khadas-mcu: Add support for VIM4 MCU variant Ronald Claveau via B4 Relay
2026-09-02 13:04   ` sashiko-bot
2026-09-10 14:21   ` Lee Jones
2026-09-16 13:01     ` linux-kernel-dev
2026-09-02 12:51 ` [PATCH v11 4/6] thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support Ronald Claveau via B4 Relay
2026-09-02 13:13   ` sashiko-bot
2026-09-02 12:51 ` [PATCH v11 5/6] arm64: dts: amlogic: t7: Add i2c controller node Ronald Claveau via B4 Relay
2026-09-02 13:05   ` sashiko-bot
2026-09-02 12:51 ` [PATCH v11 6/6] arm64: dts: amlogic: t7: khadas-vim4: Add i2c MCU fan node Ronald Claveau via B4 Relay
2026-09-02 13:06   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28052bf6-1a8a-42e9-86c7-cfb89d663a06@aliel.fr \
    --to=linux-kernel-dev@aliel.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=mfd@lists.linux.dev \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®