From: Alyssa Rosenzweig <alyssa@rosenzweig.io>
To: Sven Peter <sven@svenpeter.dev>
Cc: Jassi Brar <jassisinghbrar@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Kettenis <mark.kettenis@xs4all.nl>,
Hector Martin <marcan@marcan.st>,
Mohamed Mediouni <mohamed.mediouni@caramail.com>,
Stan Skowronek <stan@corellium.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] mailbox: apple: Add driver for Apple mailboxes
Date: Sun, 17 Oct 2021 08:02:39 -0400 [thread overview]
Message-ID: <YWwQ36hoNPrUJifS@sunset> (raw)
In-Reply-To: <20211017114054.67737-3-sven@svenpeter.dev>
> Apple SoCs such as the M1 come with various co-processors. Mailboxes
> are used to communicate with those. This driver adds support for
> two variants of those mailboxes.
>
> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
In the future, Reviewed-by tags should be dropped after making major
changes to a patch.
> + writel_relaxed(apple_mbox->hw->irq_bit_recv_not_empty |
> + apple_mbox->hw->irq_bit_send_empty,
> + apple_mbox->regs + apple_mbox->hw->irq_enable);
Nit: weird wrapping, much easier to read as:
+ writel_relaxed(apple_mbox->hw->irq_bit_recv_not_empty |
+ apple_mbox->hw->irq_bit_send_empty,
+ apple_mbox->regs + apple_mbox->hw->irq_enable);
> +static const struct apple_mbox_hw apple_mbox_asc_hw = {
> + .control_full = APPLE_ASC_MBOX_CONTROL_FULL,
> + .control_empty = APPLE_ASC_MBOX_CONTROL_EMPTY,
> +
> + .a2i_control = APPLE_ASC_MBOX_A2I_CONTROL,
> + .a2i_send0 = APPLE_ASC_MBOX_A2I_SEND0,
> + .a2i_send1 = APPLE_ASC_MBOX_A2I_SEND1,
> +
> + .i2a_control = APPLE_ASC_MBOX_I2A_CONTROL,
> + .i2a_recv0 = APPLE_ASC_MBOX_I2A_RECV0,
> + .i2a_recv1 = APPLE_ASC_MBOX_I2A_RECV1,
> +
> + .has_irq_controls = false,
> +};
Nit: consider dropping the `has_irq_controls = false` assignment.
Clearly there are none, or you'd have to fill out the irq_* fields too.
> +static const struct of_device_id apple_mbox_of_match[] = {
> + { .compatible = "apple,t8103-asc-mailbox", .data = &apple_mbox_asc_hw },
> + { .compatible = "apple,t8103-m3-mailbox", .data = &apple_mbox_m3_hw },
> + {}
> +};
No generic compatibles? I assume this driver hasn't changed much in
recent iPhones, and hopefully it won't change much in M1X...
> +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
> +/*
> + * Apple mailbox message format
> + *
> + * Copyright (C) 2021 The Asahi Linux Contributors
> + */
> +
> +#ifndef _LINUX_APPLE_MAILBOX_H_
> +#define _LINUX_APPLE_MAILBOX_H_
> +
> +#include <linux/types.h>
> +
> +struct apple_mbox_msg {
> + u64 msg0;
> + u32 msg1;
> +};
> +
> +#endif
Given this file lacks the context of the driver, and the questions
raised in v2 review, it might be beneficial to add a quick comment to
apple_mbox_msg explaiing that no, really, this is a 96-bit message.
next prev parent reply other threads:[~2021-10-17 12:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-17 11:40 [PATCH v3 0/2] Apple Mailbox Controller support Sven Peter
2021-10-17 11:40 ` [PATCH v3 1/2] dt-bindings: mailbox: Add Apple mailbox bindings Sven Peter
2021-10-17 15:29 ` Rob Herring
2021-10-17 15:42 ` Sven Peter
2021-10-17 11:40 ` [PATCH v3 2/2] mailbox: apple: Add driver for Apple mailboxes Sven Peter
2021-10-17 12:02 ` Alyssa Rosenzweig [this message]
2021-10-17 12:11 ` Sven Peter
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=YWwQ36hoNPrUJifS@sunset \
--to=alyssa@rosenzweig.io \
--cc=devicetree@vger.kernel.org \
--cc=jassisinghbrar@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcan@marcan.st \
--cc=mark.kettenis@xs4all.nl \
--cc=mohamed.mediouni@caramail.com \
--cc=robh+dt@kernel.org \
--cc=stan@corellium.com \
--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).