From: Krzysztof Kozlowski <krzk@kernel.org>
To: Sven Peter <sven@svenpeter.dev>
Cc: Hector Martin <marcan@marcan.st>,
Alyssa Rosenzweig <alyssa@rosenzweig.io>,
Rob Herring <robh+dt@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Keith Busch <kbusch@kernel.org>, "axboe@fb.com" <axboe@fb.com>,
"hch@lst.de" <hch@lst.de>, "sagi@grimberg.me" <sagi@grimberg.me>,
Marc Zyngier <maz@kernel.org>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH 5/9] soc: apple: Add RTKit IPC library
Date: Sat, 2 Apr 2022 18:08:37 +0200 [thread overview]
Message-ID: <bc91bff4-0ba6-8f9d-e3b2-5e8caf16bd98@kernel.org> (raw)
In-Reply-To: <35f5fdbf-faac-457b-a225-35d7141f6b2e@www.fastmail.com>
On 02/04/2022 15:51, Sven Peter wrote:
> On Wed, Mar 23, 2022, at 12:19, Krzysztof Kozlowski wrote:
>> On 21/03/2022 17:50, Sven Peter wrote:
>>> Apple SoCs such as the M1 come with multiple embedded co-processors
>>> running proprietary firmware. Communication with those is established
>>> over a simple mailbox using the RTKit IPC protocol.
>>>
>>> Signed-off-by: Sven Peter <sven@svenpeter.dev>
>>> ---
>>> drivers/soc/apple/Kconfig | 13 +
>>> drivers/soc/apple/Makefile | 3 +
>>> drivers/soc/apple/rtkit-crashlog.c | 147 +++++
>>> drivers/soc/apple/rtkit-internal.h | 76 +++
>>> drivers/soc/apple/rtkit.c | 842 +++++++++++++++++++++++++++++
>>> include/linux/soc/apple/rtkit.h | 203 +++++++
>>> 6 files changed, 1284 insertions(+)
>>
>> Isn't this some implementation of a mailbox? If so, it should be in
>> drivers/mailbox. Please don't put all stuff in soc/apple, that's not how
>> Linux is organized. To drivers/soc usually we put drivers which do not
>> fit regular subsystems.
>>
>
> I put this into soc/apple because I don't think it fits within the mailbox
> framework very well.
> (It actually uses the mailbox framework for the actual communication
> with the hardware with a driver that's already upstream.)
>
> Essentially, the mailbox subsystem provides a common API to send and
> receive messages over indepedent hardware channels and devicetree bindings
> to describe the relationship between those channels and other drivers.
>
> One of the features that doesn't really fit is that we need to be able
> to start, shutdown and re-start these co-processors. The NVMe driver
> actually doesn't need to send/receive any messages except those required
> to setup the common syslog/crashlog/etc. interfaces.
> The mailbox framework would have to be extended to support these specific
> use cases.
>
> Another thing that doesn't fit is the memory management: These co-processors
> sometimes need shared memory buffers to e.g. send syslog messages.
> They always request these buffers with an IPC message but then there are
> different possibilities:
>
> - For some processor the DMA API can just be used and an IOVA must be
> sent back. For NVMe these buffers must additionally be allowed in this
> SART address filter.
> - At least one other processor (SMC) does not request such buffers but
> instead just sends a pointer into MMIO space and the buffer must be
> accessed using readl/writel. This MMIO memory region is used for
> both the common buffers (syslog etc.) and for the actual shared buffers
> used for communication, such that the resource would have to be shared
> across drivers.
> - And yet another coprocessor (for the display controller) requests some
> buffers with an already existing IOVA that than need to be mapped
> specifically inside the IOMMU.
>
> Each of these co-processors also provides a single function and most
> of them don't even have different endpoints. And even those that do (DCP) will
> just become a single driver since all those endpoints are very much related.
>
> While it's not impossible to do all that by extending and forcing this into the
> mailbox framework at lest I think that it doesn't fit very well and would just
> create unneccesarry impedance.
Thanks for explanation. I don't know the mailbox framework well enough
to advise you, so I don't mind keeping it in current location (drivers/soc).
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-04-02 16:08 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 16:50 [PATCH 0/9] Apple M1 (Pro/Max) NVMe driver Sven Peter
2022-03-21 16:50 ` [PATCH 1/9] dt-bindings: soc: apple: Add Apple SART Sven Peter
2022-03-31 21:23 ` Rob Herring
2022-04-02 12:58 ` Sven Peter
2022-03-21 16:50 ` [PATCH 2/9] dt-bindings: soc: apple: Add ANS NVMe Sven Peter
2022-03-23 11:14 ` Krzysztof Kozlowski
2022-04-02 13:05 ` Sven Peter
2022-04-02 16:06 ` Krzysztof Kozlowski
2022-03-21 16:50 ` [PATCH 3/9] soc: apple: Always include Makefile Sven Peter
2022-03-21 16:50 ` [PATCH 4/9] soc: apple: Add SART driver Sven Peter
2022-03-21 17:07 ` Arnd Bergmann
2022-04-02 12:38 ` Sven Peter
2022-04-02 19:07 ` Arnd Bergmann
2022-04-04 14:58 ` Rob Herring
2022-04-04 15:01 ` Hector Martin
2022-04-05 15:37 ` Sven Peter
2022-03-21 17:17 ` Alyssa Rosenzweig
2022-04-02 12:40 ` Sven Peter
2022-03-21 16:50 ` [PATCH 5/9] soc: apple: Add RTKit IPC library Sven Peter
2022-03-22 13:13 ` Arnd Bergmann
2022-03-22 17:41 ` Robin Murphy
2022-04-02 12:56 ` Sven Peter
2022-04-02 18:30 ` Arnd Bergmann
2022-04-03 10:45 ` Sven Peter
2022-03-22 17:23 ` Alyssa Rosenzweig
2022-04-02 12:50 ` Sven Peter
2022-03-23 11:19 ` Krzysztof Kozlowski
2022-04-02 13:51 ` Sven Peter
2022-04-02 16:08 ` Krzysztof Kozlowski [this message]
2022-04-04 15:02 ` Rob Herring
2022-04-04 15:47 ` Hector Martin
2022-03-21 16:50 ` [PATCH 6/9] nvme-apple: Add initial Apple SoC NVMe driver Sven Peter
2022-03-21 17:01 ` Keith Busch
2022-04-02 13:10 ` Sven Peter
2022-03-22 13:38 ` Arnd Bergmann
2022-04-02 13:34 ` Sven Peter
2022-04-02 13:58 ` Janne Grunau
2022-04-02 14:02 ` Sven Peter
2022-04-02 21:26 ` Arnd Bergmann
2022-03-24 6:16 ` Christoph Hellwig
2022-04-02 12:47 ` Sven Peter
2022-04-04 15:57 ` Hector Martin
2022-04-04 15:59 ` Christoph Hellwig
2022-04-04 16:03 ` Sven Peter
2022-04-04 16:05 ` hch
2022-04-04 16:05 ` Hector Martin
2022-04-04 18:29 ` Jens Axboe
2022-04-05 6:24 ` Christoph Hellwig
2022-03-21 16:50 ` [PATCH 7/9] nvme-apple: Serialize command issue Sven Peter
2022-03-24 6:16 ` Christoph Hellwig
2022-04-02 12:42 ` Sven Peter
2022-03-21 16:50 ` [PATCH 8/9] nvme-apple: Add support for multiple power domains Sven Peter
2022-03-21 16:50 ` [PATCH 9/9] nvme-apple: Add support for suspend/resume Sven Peter
2022-03-24 6:17 ` Christoph Hellwig
2022-03-22 17:26 ` [PATCH 0/9] Apple M1 (Pro/Max) NVMe driver Alyssa Rosenzweig
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=bc91bff4-0ba6-8f9d-e3b2-5e8caf16bd98@kernel.org \
--to=krzk@kernel.org \
--cc=alyssa@rosenzweig.io \
--cc=arnd@arndb.de \
--cc=axboe@fb.com \
--cc=devicetree@vger.kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=marcan@marcan.st \
--cc=maz@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sagi@grimberg.me \
--cc=sven@svenpeter.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;
as well as URLs for NNTP newsgroup(s).