From: Jassi Brar <jassisinghbrar@gmail.com>
To: Guomin chen <guomin.chen@cixtech.com>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de,
Peter Chen <peter.chen@cixtech.com>,
linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
cix-kernel-upstream@cixtech.com, maz@kernel.org,
sudeep.holla@arm.com, kajetan.puchalski@arm.com,
eballetb@redhat.com, Gary Yang <gary.yang@cixtech.com>,
Lihua Liu <Lihua.Liu@cixtech.com>
Subject: Re: [PATCH v9 5/9] mailbox: add CIX mailbox driver
Date: Sun, 13 Jul 2025 12:00:06 -0500 [thread overview]
Message-ID: <CABb+yY2BmqiQ18hU+7C234UnY8n-8PH5VEoS7nH5Xq5O1krGhQ@mail.gmail.com> (raw)
In-Reply-To: <aG0i75h32dWg/L2G@gchen>
On Tue, Jul 8, 2025 at 8:54 AM Guomin chen <guomin.chen@cixtech.com> wrote:
....
> > > +/* [0~7] Fast channel
> > > + * [8] doorbell base channel
> > > + * [9]fifo base channel
> > > + * [10] register base channel
> > > + */
> > > +#define MBOX_FAST_IDX 7
> > > +#define MBOX_DB_IDX 8
> > > +#define MBOX_FIFO_IDX 9
> > > +#define MBOX_REG_IDX 10
> > > +#define CIX_MBOX_CHANS 11
> > > +
> > if it is not really a single controller owning different channels,
> > maybe implement only what you currently use.
> >
> As mentioned in the previous email, a single controller can support
> multiple different channels.
>
OK. I am not too worried about having all variants in one driver esp
when it is manageable and share the code.
Unless I am overlooking something. Arnd?
> > > +static u32 cix_mbox_read(struct cix_mbox_priv *priv, u32 offset)
> > > +{
> > > + if (priv->use_shmem)
> > > + return ioread32(priv->base + offset - SHMEM_OFFSET);
> > > + else
> > > + return ioread32(priv->base + offset);
> > > +}
> > > +
> > use_shmem is set for only CIX_MBOX_TYPE_DB, but it affects every read/write.
> > Maybe instead adjust the base for TYPE_DB?
> >
> The reason we introduced use_shmem here is that we had to adjust the base
> address of TYPE_DB to resolve the reg conflict in the DTS.
> This change has virtually no impact on performance.
>
Yes, I can see it should have no impact on performance and I think
adjusting the base once
during init is cleaner than checking the flag every read/write.
But wait... use_shmem is a controller wide flag, and isn't
priv->use_shmem always set to true in cix_mbox_init() ?
Is the driver even tested?
....
> > > +static int cix_mbox_startup(struct mbox_chan *chan)
> > > +{
> > > + struct cix_mbox_priv *priv = to_cix_mbox_priv(chan->mbox);
> > > + struct cix_mbox_con_priv *cp = chan->con_priv;
> > > + int index = cp->index, ret;
> > > + u32 val_32;
> > > +
> > > + ret = request_irq(priv->irq, cix_mbox_isr, 0,
> > > + dev_name(priv->dev), chan);
> > The same irq is requested for each channel. How do you expect it to
> > work? Maybe request it just once in probe and pass the 'priv' instead
> > of 'chan' , and in the cix_mbox_isr handle according to INT_STATUS
> >
> For the same mailbox controller, there won't be multiple channels
> simultaneously requesting the same IRQ, so there won't be an issue
> here. As you mentioned, if we need to handle multiple channels working
> concurrently in the future, we would need to modify cix_mbox_isr.
> However, that is not required at the moment.
>
Is it too hard to do it right already?
....
> > > +MODULE_AUTHOR("Cix Technology Group Co., Ltd.");
> > > +MODULE_DESCRIPTION("CIX mailbox driver");
> > > +MODULE_LICENSE("GPL");
> >
> > GPL v2 ? according to the SPDX-License-Identifier
> >
> > And please make sure you run scripts/checkpatch.pl
>
> Yes, I'm also confused here. I was previously using GPL v2,
> but when I ran checkpatch.pl, it triggered a warning due to
> commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE 'GPL'
> vs. 'GPL v2' bogosity"). So I changed it to GPL.
>
Sorry, I was wrong. It should simply be GPL
Thanks.
next prev parent reply other threads:[~2025-07-13 17:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 3:16 [PATCH v9 0/9] arm64: Introduce CIX P1 (SKY1) SoC Peter Chen
2025-06-09 3:16 ` [PATCH v9 1/9] dt-bindings: vendor-prefixes: Add CIX Technology Group Co., Ltd Peter Chen
2025-06-09 3:16 ` [PATCH v9 2/9] dt-bindings: arm: add CIX P1 (SKY1) SoC Peter Chen
2025-06-09 3:16 ` [PATCH v9 3/9] arm64: Kconfig: add ARCH_CIX for cix silicons Peter Chen
2025-06-09 3:16 ` [PATCH v9 4/9] dt-bindings: mailbox: add cix,sky1-mbox Peter Chen
2025-06-09 3:16 ` [PATCH v9 5/9] mailbox: add CIX mailbox driver Peter Chen
2025-07-02 1:08 ` Peter Chen
2025-07-04 16:04 ` Arnd Bergmann
2025-07-04 18:35 ` Jassi Brar
2025-07-08 9:51 ` Guomin chen
2025-07-06 19:30 ` Jassi Brar
2025-07-08 13:53 ` Guomin chen
2025-07-13 17:00 ` Jassi Brar [this message]
2025-07-14 12:43 ` Guomin chen
2025-07-14 15:39 ` Arnd Bergmann
2025-07-15 22:11 ` Jassi Brar
2025-07-16 2:28 ` Guomin chen
2025-07-16 7:19 ` Arnd Bergmann
2025-07-16 17:15 ` Jassi Brar
2025-06-09 3:16 ` [PATCH v9 6/9] arm64: defconfig: Enable CIX SoC Peter Chen
2025-06-09 3:16 ` [PATCH v9 7/9] dt-bindings: clock: cix: Add CIX sky1 scmi clock id Peter Chen
2025-06-09 3:16 ` [PATCH v9 8/9] arm64: dts: cix: Add sky1 base dts initial support Peter Chen
2025-07-05 8:20 ` Krzysztof Kozlowski
2025-07-07 2:50 ` Peter Chen
2025-06-09 3:16 ` [PATCH v9 9/9] MAINTAINERS: Add CIX SoC maintainer entry Peter Chen
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=CABb+yY2BmqiQ18hU+7C234UnY8n-8PH5VEoS7nH5Xq5O1krGhQ@mail.gmail.com \
--to=jassisinghbrar@gmail.com \
--cc=Lihua.Liu@cixtech.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=cix-kernel-upstream@cixtech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eballetb@redhat.com \
--cc=gary.yang@cixtech.com \
--cc=guomin.chen@cixtech.com \
--cc=kajetan.puchalski@arm.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=peter.chen@cixtech.com \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).