public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Drew Fustini <fustini@kernel.org>
Cc: Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Michal Wilczynski <m.wilczynski@samsung.com>,
	Alexandre Ghiti <alex@ghiti.fr>,
	devicetree@vger.kernel.org, Han Gao <gaohan@iscas.ac.cn>,
	Han Gao <rabenda.cn@gmail.com>,
	linux-kernel@vger.kernel.org, Guo Ren <guoren@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	linux-riscv@lists.infradead.org, Fu Wei <wefu@redhat.com>
Subject: Re: [PATCH v2 2/5] dt-bindings: reset: thead,th1520-reset: Add controllers for more subsys
Date: Tue, 14 Oct 2025 09:49:07 +0000	[thread overview]
Message-ID: <aO4ck0IhO20T78eN@pie> (raw)
In-Reply-To: <aOGckdJcY44hD4Hn@x1>

On Sat, Oct 04, 2025 at 03:15:45PM -0700, Drew Fustini wrote:
> On Sat, Oct 04, 2025 at 02:21:43AM +0000, Yao Zi wrote:
> > On Fri, Oct 03, 2025 at 03:46:17PM -0700, Drew Fustini wrote:
> > > On Mon, Sep 15, 2025 at 09:53:28AM +0000, Yao Zi wrote:
> > > > TH1520 SoC is divided into several subsystems, most of them have
> > > > distinct reset controllers. Let's document reset controllers other than
> > > > the one for VO subsystem and IDs for their reset signals.
> > > > 
> > > > Signed-off-by: Yao Zi <ziyao@disroot.org>
> > > 
> > > Thanks for sending these patches.
> > > 
> > > > ---
> > > >  .../bindings/reset/thead,th1520-reset.yaml    |   8 +-
> > > >  .../dt-bindings/reset/thead,th1520-reset.h    | 216 ++++++++++++++++++
> > > >  2 files changed, 223 insertions(+), 1 deletion(-)
> > > > 
> > > [snip]
> > > > diff --git a/include/dt-bindings/reset/thead,th1520-reset.h b/include/dt-bindings/reset/thead,th1520-reset.h
> > > > index e51d6314d131..68ac52ed69de 100644
> > > > --- a/include/dt-bindings/reset/thead,th1520-reset.h
> > > > +++ b/include/dt-bindings/reset/thead,th1520-reset.h
> > > > @@ -7,6 +7,200 @@
> > > >  #ifndef _DT_BINDINGS_TH1520_RESET_H
> > > >  #define _DT_BINDINGS_TH1520_RESET_H
> > > [snip]
> > > > +/* DSP Subsystem */
> > > > +#define TH1520_RESET_ID_X2X_DSP1	0
> > > > +#define TH1520_RESET_ID_X2X_DSP0	1
> > > > +#define TH1520_RESET_ID_X2X_SLAVE_DSP1	2
> > > > +#define TH1520_RESET_ID_X2X_SLAVE_DSP0	3
> > > > +#define TH1520_RESET_ID_DSP0_CORE	4
> > > > +#define TH1520_RESET_ID_DSP0_DEBUG	5
> > > > +#define TH1520_RESET_ID_DSP0_APB	6
> > > > +#define TH1520_RESET_ID_DSP1_CORE	4
> > > > +#define TH1520_RESET_ID_DSP1_DEBUG	5
> > > > +#define TH1520_RESET_ID_DSP1_APB	6
> > > > +#define TH1520_RESET_ID_DSPSYS_APB	7
> > > > +#define TH1520_RESET_ID_AXI4_DSPSYS_SLV	8
> > > > +#define TH1520_RESET_ID_AXI4_DSPSYS	9
> > > > +#define TH1520_RESET_ID_AXI4_DSP_RS	10
> > > 
> > > This doesn't seem right. The numbers for each subsystem should not
> > > repeat. Here the DSP0 and DSP1 items have the same numbers: 4, 5, 6.
> > > 
> > > This causes both clang and sparse to complain. I think you can just
> > > change this so that TH1520_RESET_ID_DSP1_CORE is 7 and so on. The
> > > indexes don't really have any concrete meaning other than how they are
> > > used as unique keys.
> > 
> > You're correct, it's a copy-paste error, just like the one spotted in v1
> > of the series...
> > 
> > I'm not sure why either my GCC or sparse yielded no warning about them.
> > Will figure it out and send v3 with this fixed. Much sorry for these
> > stupid mistakes.
> > 
> > Best regards,
> > Yao Zi
> 
> Have you tried using W=1?
> 
> I do see the warning in gcc with that:
> 
> pdp7@thelio:~/linux$ rm drivers/reset/reset-th1520.o
> pdp7@thelio:~/linux$ make W=1 CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv C=1 -j16
>   CALL    scripts/checksyscalls.sh
> Documentation/.renames.txt: warning: ignored by one of the .gitignore files
>   CC      drivers/reset/reset-th1520.o
> drivers/reset/reset-th1520.c:655:39: warning: initialized field overwritten [-Woverride-init]
>   655 |         [TH1520_RESET_ID_DSP1_CORE] = {
>       |                                       ^
> drivers/reset/reset-th1520.c:655:39: note: (near initialization for ‘th1520_dsp_resets[4]’)
> drivers/reset/reset-th1520.c:659:40: warning: initialized field overwritten [-Woverride-init]
>   659 |         [TH1520_RESET_ID_DSP1_DEBUG] = {
>       |                                        ^
> drivers/reset/reset-th1520.c:659:40: note: (near initialization for ‘th1520_dsp_resets[5]’)
> drivers/reset/reset-th1520.c:663:38: warning: initialized field overwritten [-Woverride-init]
>   663 |         [TH1520_RESET_ID_DSP1_APB] = {
>       |                                      ^
> drivers/reset/reset-th1520.c:663:38: note: (near initialization for ‘th1520_dsp_resets[6]’)
>   CHECK   drivers/reset/reset-th1520.c
> drivers/reset/reset-th1520.c:643:10: warning: Initializer entry defined twice
> drivers/reset/reset-th1520.c:655:10:   also defined here

Thanks, building with W=1 does spot the issue. Somehow my local setup of
sparse cannot find the duplicated IDs for either v1 or v2 of this
series, but GCC with W=1 could.

Will send v3 of the series with these duplicated IDs fixed. Really
thanks for finding the issue.

Best regards
Yao Zi

  reply	other threads:[~2025-10-14  9:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15  9:53 [PATCH v2 0/5] Add reset controllers for other TH1520 subsystems Yao Zi
2025-09-15  9:53 ` [PATCH v2 1/5] dt-bindings: reset: thead,th1520-reset: Remove non-VO-subsystem resets Yao Zi
2025-09-22 16:04   ` Rob Herring (Arm)
2025-09-15  9:53 ` [PATCH v2 2/5] dt-bindings: reset: thead,th1520-reset: Add controllers for more subsys Yao Zi
2025-09-22 16:05   ` Rob Herring (Arm)
2025-10-03 22:46   ` Drew Fustini
2025-10-04  2:21     ` Yao Zi
2025-10-04 22:15       ` Drew Fustini
2025-10-14  9:49         ` Yao Zi [this message]
2025-09-15  9:53 ` [PATCH v2 3/5] reset: th1520: Prepare for supporting multiple controllers Yao Zi
2025-09-15  9:53 ` [PATCH v2 4/5] reset: th1520: Support reset controllers in more subsystems Yao Zi
2025-09-15  9:57 ` [PATCH v2 5/5] riscv: dts: thead: Add reset controllers of more subsystems for TH1520 Yao Zi

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=aO4ck0IhO20T78eN@pie \
    --to=ziyao@disroot.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fustini@kernel.org \
    --cc=gaohan@iscas.ac.cn \
    --cc=guoren@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=m.wilczynski@samsung.com \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rabenda.cn@gmail.com \
    --cc=robh@kernel.org \
    --cc=wefu@redhat.com \
    /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