From: Alex Elder <elder@riscstar.com>
To: Yixun Lan <dlan@gentoo.org>
Cc: Stephen Boyd <sboyd@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Guodong Xu <guodong@riscstar.com>,
Inochi Amaoto <inochiama@gmail.com>,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
linux-riscv@lists.infradead.org, spacemit@lists.linux.dev
Subject: Re: [PATCH v2 3/3] reset: spacemit: fix auxiliary device id
Date: Fri, 2 Jan 2026 09:42:28 -0600 [thread overview]
Message-ID: <8241a2a0-62e6-4708-8cf6-58d0a59476ff@riscstar.com> (raw)
In-Reply-To: <20251231020951-GYA2019108@gentoo.org>
On 12/30/25 8:09 PM, Yixun Lan wrote:
> Hi Alex,
>
> On 18:50 Mon 29 Dec , Alex Elder wrote:
>> On 12/26/25 12:55 AM, Yixun Lan wrote:
>>> Due to the auxiliary register procedure moved to ccu common module,
>>> the auxiliary device id need to be adjusted, otherwise reset driver
>>> will fail to probe.
>>>
>>> Signed-off-by: Yixun Lan <dlan@gentoo.org>
>>> ---
>>> drivers/reset/reset-spacemit.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/reset/reset-spacemit.c b/drivers/reset/reset-spacemit.c
>>> index e1272aff28f7..8922e14fa836 100644
>>> --- a/drivers/reset/reset-spacemit.c
>>> +++ b/drivers/reset/reset-spacemit.c
>>> @@ -278,7 +278,7 @@ static int spacemit_reset_probe(struct auxiliary_device *adev,
>>>
>>> #define K1_AUX_DEV_ID(_unit) \
>>> { \
>>> - .name = "spacemit_ccu_k1." #_unit "-reset", \
>>> + .name = "spacemit_ccu." _K_RST(_unit), \
>>> .driver_data = (kernel_ulong_t)&k1_ ## _unit ## _reset_data, \
>>> }
>>
>> The above macro is named K1_AUX_DEV_ID(). Why don't you
>> define K3_AUX_DEV_ID(), which could use "k3" in its name?
>>
> that should also works, the idea of using same macro '_K_RST()' here
> is trying to explictly tell users the clock and reset shares same name
You mean like "spacemit,k1-syscon-mpmu" is used, and you'd rather
name the reset "spacemit.k1-mpmu-reset" because it sort of matches
a little better than "spacemit_ccu_k1.mpmu-reset"?
Anyway, when K1_AUX_DEV_ID() was defined, it was named that way
to suggest a pattern that would mean K3_AUX_DEV_ID() would also
be defined.
I don't really care where the "k1"/"k3" goes, before or after the
period. But I think the "k1" could be encoded explicitly here
rather than doing it with _K_RST() (i.e., don't even use a macro).
-Alex
>
>> Anyway, if you go this route I suggest you drop "K1_" from the
>> name of this macro.
>>
> or could further refactor the code, to make K1/K3 drivers share same macro
>
> anyway I don't want to change this patch, my goal here is tring to fix
> reset driver after clock common driver refactored plus the modularization
> introduced, it's more proper to leave those refactor work up to Guodong,
> since he did a lot adjustment to add reset support for K3 SoC
>
prev parent reply other threads:[~2026-01-02 15:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-26 6:55 [PATCH v2 0/3] clk: spacemit: refactor common ccu driver Yixun Lan
2025-12-26 6:55 ` [PATCH v2 1/3] clk: spacemit: prepare common ccu header Yixun Lan
2025-12-30 0:50 ` Alex Elder
2026-01-01 14:38 ` Yixun Lan
2026-01-02 15:42 ` Alex Elder
2026-01-03 1:58 ` Yixun Lan
2025-12-26 6:55 ` [PATCH v2 2/3] clk: spacemit: extract common ccu functions Yixun Lan
2025-12-30 0:50 ` Alex Elder
2025-12-30 4:00 ` Yao Zi
2025-12-31 2:12 ` Yixun Lan
2025-12-26 6:55 ` [PATCH v2 3/3] reset: spacemit: fix auxiliary device id Yixun Lan
2025-12-30 0:50 ` Alex Elder
2025-12-31 2:09 ` Yixun Lan
2026-01-02 15:42 ` Alex Elder [this message]
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=8241a2a0-62e6-4708-8cf6-58d0a59476ff@riscstar.com \
--to=elder@riscstar.com \
--cc=dlan@gentoo.org \
--cc=guodong@riscstar.com \
--cc=inochiama@gmail.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=spacemit@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®