[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DFM8F4B9RK3A.1RG65AV3UCWC6@linux.spacemit.com>
Date: Mon, 12 Jan 2026 09:49:59 +0800
From: "Troy Mitchell" <troy.mitchell@...ux.spacemit.com>
To: "Alex Elder" <elder@...cstar.com>, "Alexandre Belloni"
<alexandre.belloni@...tlin.com>
Cc: "Troy Mitchell" <troy.mitchell@...ux.spacemit.com>, "Lee Jones"
<lee@...nel.org>, "Yixun Lan" <dlan@...too.org>, "Andi Shyti"
<andi.shyti@...nel.org>, "Liam Girdwood" <lgirdwood@...il.com>, "Mark
Brown" <broonie@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-riscv@...ts.infradead.org>, <spacemit@...ts.linux.dev>,
<linux-i2c@...r.kernel.org>, <linux-rtc@...r.kernel.org>
Subject: Re: [PATCH v4 3/3] rtc: spacemit: default module when
MFD_SPACEMIT_P1 is enabled
On Mon Jan 12, 2026 at 3:55 AM CST, Alex Elder wrote:
> On 1/9/26 4:36 PM, Alexandre Belloni wrote:
>>> The purpose is to make the driver a module (not built-in)
>>> when "defconfig" is used (without the need for any Kconfig
>>> fragments to unselect things).
>>>
>>>
>>> In arch/riscv/configs/defconfig, we have this:
>>> CONFIG_ARCH_SPACEMIT=y
>>>
>>> In drivers/mfd/Kconfig b/drivers/mfd/Kconfig, we have this
>>> (added by patch 2 in this series):
>>> config MFD_SPACEMIT_P1
>>> default m if ARCH_SPACEMIT
>>>
>>> So when using defconfig (alone), MFD_SPACEMIT_P1 is set to m,
>>> to benefit non-SpacemiT RISC-V platforms.
>>>
>>> This patch is trying to do the same thing for the RTC,
>>> i.e. having RTC_DRV_SPACEMIT_P1 be defined as a module
>>> by default.
>>>
>>> I think you understand.
>> I'm sorry, I must be dumb but I don't understand. The current behaviour
>
> I think I'm the dumb one. I think I finally understand your
> point.
>
>> is that when MFD_SPACEMIT_P1 is m, then the default value for
>> RTC_DRV_SPACEMIT_P1 will be m. Since patch 2 makes it exactly that way
>> (MFD_SPACEMIT_P set to m), I don't get why it is necessary to mess with
>> the default of RTC_DRV_SPACEMIT_P1.
>
> Your point is that patch has no real effect, at least not
> on the scenario I was talking about.
>
> I.e., I was saying this mattered for using defconfig alone.
> But, as you point out, using defconfig alone gives us:
>
> ARCH_SPACMIT=y (in defconfig)
> MFD_SPACEMIT_P1=m (from patch 2)
>
> And then, *without* this patch:
> RTC_DRV_SPACEMIT_P1=MFD_SPACEMIT_P1
> meaning
> RTC_DRV_SPACEMIT_P1=m
>
> And therefore there's no need for this patch to set the
> default to m rather than MFD_SPACEMIT_P1.
>
Thanks Alex and Alexandre for the clarification. You're absolutely right -
the patch is indeed redundant since RTC_DRV_SPACEMIT_P1 already inherits
the correct default value (m) through its dependency on MFD_SPACEMIT_P1.
I'll drop this patch in the next version and review the rest of the series
for similar unnecessary default overrides.
- Troy
>
>
>> The current default behaviour of RTC_DRV_SPACEMIT_P1 seems to be the
>> correct one and the proper fix is then patch 2.
>
> Yes, now I understand. I'm sorry about my confusion.
>
> -Alex
Powered by blists - more mailing lists