mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: krzk@kernel.org, alim.akhtar@samsung.com, mst@redhat.com,
	javierm@redhat.com, tzimmermann@suse.de,
	bartosz.golaszewski@linaro.org, luzmaximilian@gmail.com,
	sudeep.holla@arm.com, conor.dooley@microchip.com,
	bjorn@rivosinc.com, ulf.hansson@linaro.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, marcan@marcan.st,
	neal@gompa.dev, alyssa@rosenzweig.io, broonie@kernel.org,
	andre.draszik@linaro.org, willmcvicker@google.com,
	peter.griffin@linaro.org, kernel-team@android.com,
	vincent.guittot@linaro.org, daniel.lezcano@linaro.org,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 1/2] mailbox: add async request mechanism to empower controllers w/ hw queues
Date: Mon, 18 Nov 2024 15:22:01 +0000	[thread overview]
Message-ID: <603407a6-93c7-4d45-b171-7bbc871a3569@linaro.org> (raw)
In-Reply-To: <CABb+yY3W3Cv7a6wZhvJe80xn5sp1Y_A_nbY_=cj0U4Z1YC61vw@mail.gmail.com>

Hi, Jassi,

Sorry for the late reply, I was off for a while.

On 10/29/24 3:59 PM, Jassi Brar wrote:
>>> If your usecase is not currently handled, please let me know. We can
>>> discuss that.
>> It's not handled. I have a list of requirements I have to fulfill which
>> are not covered by the mailbox core:
>>
>> 1/ allow multiple TX in-flight. We need to let the controller handle its
>> hardware queue, otherwise the hardware queue has no sense at all.
>>
> As I said this one is currently handled by assuming TX-done by
> depositing in the h/w queue/fifo.

This may work indeed. I would have a TXDONE_BY_ACK controller. Its
`.send_data` would be a one liner, where I just raise the interrupt to
the firmware. TX ring would be written by `cl->tx_prepare()`.

Then in the protocol driver I would do:
ret = mbox_send_message(mbox_chan, msg);
if (ret < 0)
	return ret;

/* TX-done when depositing in the h/w queue. */
mbox_client_txdone(mbox_chan, 0);

ret = exynos_acpm_wait_for_message_response(mbox_chan, msg);
if (ret)
	return ret;

> You will have the same perf as with your attempt to have "multiple

I'm still forced to pass all the messages to the mailbox's core software
queue. I also don't need the locking from the core. For my case the mbox
core just needs to do:

if (chan->cl->tx_prepare)
	chan->cl->tx_prepare(chan->cl, data);

return chan->mbox->ops->send_data(chan, data);

Would it make sense to introduce such a method?

BTW, what are the minimum requirements for a controller to be considered
a mailbox controller? As you saw, I'm using the mailbox controller just
to raise the interrupt to the firmware, no messages are written to the
controller's buffers.

Does message size matter? On my device the ACPM protocol is using
messages of 0, 2, 16 or 32 bytes, but it also allows the possibility to
pass a pointer to an indirection command SRAM buffer, where one is able
to write up to 412 bytes.

> in-flight" while neither of these approaches handles in-flight
> failures. We can discuss this.

Do you mean that there's no retry mechanism? The crypto subsystem has
one, we may look at what's done there if we care.

> 
>> 2/ allow to tie a TX to a RX. I need to know to what TX the response
>> corresponds to.
>> 3/ allow multiple clients to the same channel. ACPM allows this. Support
>> would have come as an extra patch.
>>
> These are nothing new. A few other platforms too have shared channels
> and that is implemented above the mailbox.
> 
okay

>> 4/ allow polling and IRQ channels for the same mailbox controller (not
>> urgent).
>>
> It is very easy to populate them as separate controllers.

Do you mean to call devm_mbox_controller_register() twice for the same dev?

Thanks,
ta

  reply	other threads:[~2024-11-18 15:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:36 [PATCH v2 0/2] mailbox: add async request mechanism w/ a user Tudor Ambarus
2024-10-17 16:36 ` [PATCH v2 1/2] mailbox: add async request mechanism to empower controllers w/ hw queues Tudor Ambarus
2024-10-18  4:17   ` Jassi Brar
2024-10-18  7:49     ` Tudor Ambarus
2024-10-21  6:18       ` Tudor Ambarus
2024-10-21 16:32         ` Jassi Brar
2024-10-22 13:26           ` Tudor Ambarus
2024-10-24  1:27             ` Jassi Brar
2024-10-24 10:45               ` Tudor Ambarus
2024-10-29 15:59                 ` Jassi Brar
2024-11-18 15:22                   ` Tudor Ambarus [this message]
2024-10-17 16:36 ` [PATCH v2 2/2] firmware: add exynos acpm driver Tudor Ambarus
2024-10-21 11:52   ` Krzysztof Kozlowski
2024-10-21 14:12     ` Tudor Ambarus
2024-10-22  4:38       ` Krzysztof Kozlowski
2024-10-22  7:27         ` Vincent Guittot
2024-10-22  7:58         ` Tudor Ambarus
2024-10-23  9:00           ` Krzysztof Kozlowski
2024-10-23  9:53             ` Tudor Ambarus
2024-10-23 10:02               ` Tudor Ambarus
2024-10-24  9:36               ` Krzysztof Kozlowski
2024-10-25 10:00                 ` Tudor Ambarus
2024-10-21 14:52   ` Tudor Ambarus
2024-10-21 16:47   ` Alim Akhtar
2024-10-25  9:44     ` Tudor Ambarus

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=603407a6-93c7-4d45-b171-7bbc871a3569@linaro.org \
    --to=tudor.ambarus@linaro.org \
    --cc=alim.akhtar@samsung.com \
    --cc=alyssa@rosenzweig.io \
    --cc=andre.draszik@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bjorn@rivosinc.com \
    --cc=broonie@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=javierm@redhat.com \
    --cc=kernel-team@android.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=luzmaximilian@gmail.com \
    --cc=marcan@marcan.st \
    --cc=mst@redhat.com \
    --cc=neal@gompa.dev \
    --cc=peter.griffin@linaro.org \
    --cc=sudeep.holla@arm.com \
    --cc=tzimmermann@suse.de \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=willmcvicker@google.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

all inboxes | Powered by JetHome®