From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: Alexey Klimov <alexey.klimov@linaro.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Sam Protsenko <semen.protsenko@linaro.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jassi Brar <jassisinghbrar@gmail.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Peter Griffin <peter.griffin@linaro.org>,
linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] mailbox: exynos: Add support for Exynos850 mailbox
Date: Wed, 29 Apr 2026 12:07:28 +0300 [thread overview]
Message-ID: <6dcb5348-e973-494d-adf1-7fa2dc5655f2@linaro.org> (raw)
In-Reply-To: <DI52JP9JH6AH.3I5OKWOZ56MIU@linaro.org>
On 4/28/26 11:26 PM, Alexey Klimov wrote:
> On Wed Apr 8, 2026 at 2:08 PM BST, Alexey Klimov wrote:
>
> [...]
>
>> On Thu Apr 2, 2026 at 9:42 AM BST, Tudor Ambarus wrote:
>>>> static int exynos_mbox_send_data(struct mbox_chan *chan, void *data)
>>>> @@ -57,7 +104,8 @@ static int exynos_mbox_send_data(struct mbox_chan *chan, void *data)
>>>> return -EINVAL;
>>>> }
>>>>
>>>> - writel(BIT(msg->chan_id), exynos_mbox->regs + EXYNOS_MBOX_INTGR1);
>>>> + writel(BIT(msg->chan_id) << exynos_mbox->data->irq_doorbell_shift,
>>>> + exynos_mbox->regs + exynos_mbox->data->irq_doorbell_offset);
>>>
>>> Use FIELD_PREP from <linux/bitfield.h> please. You will use a mask instead of
>>> a shift.
>>>
>>> I would rename irq_doorbell_offset to intgr. It aligns with the register name
>>> from the datasheet. You won't need to prepend _offset to the name, we already
>>> see it's an offset when doing the writel().
>>
>> Sure. Thanks. Let's use FIELD_PREP.
>
> + /* Ring the doorbell */
> + writel(BIT(msg->chan_id) << exynos_mbox->data->intgr_shift,
> + exynos_mbox->regs + exynos_mbox->data->intgr);
>
> FIELD_PREP() wants a mask as a compile-time constant. Unless you want me to
Indeed, I forgot, sorry.
> add switch/case for different SoCs or I misunderstood something I don't see
> how this is gonna fly.
other option is to have a .ring_doorbell callback defined in the SoC data,
and then you can use FIELD_PREP. But it increases boilerplate code just to
ring a doorbell. I wouldn't go via switch/case. I think we'll have to live
with the mask and shift.
Cheers,
ta
next prev parent reply other threads:[~2026-04-29 9:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 2:20 [PATCH v2 0/3] Exynos850 APM-to-AP mailbox support Alexey Klimov
2026-04-02 2:20 ` [PATCH v2 1/3] dt-bindings: mailbox: google,gs101-mbox: Add samsung,exynos850-mbox Alexey Klimov
2026-04-02 8:11 ` Krzysztof Kozlowski
2026-04-02 8:46 ` Tudor Ambarus
2026-04-02 2:20 ` [PATCH v2 2/3] mailbox: exynos: Add support for Exynos850 mailbox Alexey Klimov
2026-04-02 8:11 ` Krzysztof Kozlowski
2026-04-02 8:42 ` Tudor Ambarus
2026-04-08 13:08 ` Alexey Klimov
2026-04-09 12:04 ` Tudor Ambarus
2026-04-28 20:26 ` Alexey Klimov
2026-04-29 9:07 ` Tudor Ambarus [this message]
2026-04-02 2:20 ` [PATCH v2 3/3] arm64: dts: exynos850: Add ap2apm mailbox Alexey Klimov
2026-04-02 8:01 ` Krzysztof Kozlowski
2026-04-02 13:30 ` Alexey Klimov
2026-04-02 13:32 ` Krzysztof Kozlowski
2026-04-02 8:48 ` Tudor Ambarus
2026-04-02 8:45 ` [PATCH v2 0/3] Exynos850 APM-to-AP mailbox support Tudor Ambarus
2026-04-08 14:05 ` Alexey Klimov
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=6dcb5348-e973-494d-adf1-7fa2dc5655f2@linaro.org \
--to=tudor.ambarus@linaro.org \
--cc=alexey.klimov@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=conor+dt@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=jassisinghbrar@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
--cc=s.nawrocki@samsung.com \
--cc=sboyd@kernel.org \
--cc=semen.protsenko@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.