Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2620711pxb; Sun, 17 Oct 2021 20:44:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4QLLZzWizQt2VReYY9nl3t3wsM+jnR/wkcB06qjekgb7LzAVbdzDMkIgpqKKcoMJEm8cd X-Received: by 2002:a62:641:0:b0:44b:74bb:294c with SMTP id 62-20020a620641000000b0044b74bb294cmr26747938pfg.12.1634528675868; Sun, 17 Oct 2021 20:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634528675; cv=none; d=google.com; s=arc-20160816; b=TRMCymWcih2B53Naf+UJJuSg+GaHMomnHTsDwtihWYX54+/9Sa0DJLZKz8TYRiRWlG FoDIHESak6s8qgSszWpJinyOkbe7MeXpFxbW/tHQ50/aB/0cdiir6ROAXeI6X7oUIrjT kXMubZSMTd9gWcCsAJOpyWFnx3sJmjP5ueaU0mghdadCWaF88wlinWB5Kx5wK5BCu83R deelfz0p/L8S/xirP+uGZUg+tbLW6IfIF5wI14fU63zXq5WSQiERdCM8xdQ+joZU19BT xydDqjHOKMGkwMCpBntEocleaUctTDAeaAzFxOUNpBsdlTj6poJQzk7bSkp47EGtSRJw E9Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=CJz4qs3xu5AAtGZYF8sdElzU+YxBbResFgdSPhM12fo=; b=unVx/Wg5d/1cP+CGz2PypMFRpV/G3dEfInqURr+7fy8LBzzqjibnMxBfTyLAtC/hTR 6tS2mD8vyoI08Dd2hHeMC6hPUMy6ReIfpeODaybs0tEodlvrmZVzhXgGsnCeVvvFHu/J swcPJZGlIGKHciMFPKvwxf6GDVDPMgzTCUX80YwunQei1m75syhf8fR0mMzS+u5ND30n WVRfCQDfFv30Odrjlai0xIrQBtu5px+wzaKgNVQ0Ge2hZv2VqljGikSzcYVzTI1dWR6V ApnLR4f5VXOPHglSWKm7HPiOjMYLRu0DweoEmtFvYdLNVzVVonEY3CdUD8MmPM3hHhWt mSJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si25921225plg.159.2021.10.17.20.44.23; Sun, 17 Oct 2021 20:44:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245580AbhJQMEz (ORCPT + 98 others); Sun, 17 Oct 2021 08:04:55 -0400 Received: from rosenzweig.io ([138.197.143.207]:47190 "EHLO rosenzweig.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236197AbhJQMEz (ORCPT ); Sun, 17 Oct 2021 08:04:55 -0400 Date: Sun, 17 Oct 2021 08:02:39 -0400 From: Alyssa Rosenzweig To: Sven Peter Cc: Jassi Brar , Rob Herring , Mark Kettenis , Hector Martin , Mohamed Mediouni , Stan Skowronek , 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 Message-ID: References: <20211017114054.67737-1-sven@svenpeter.dev> <20211017114054.67737-3-sven@svenpeter.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211017114054.67737-3-sven@svenpeter.dev> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 > Signed-off-by: Sven Peter 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 > + > +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.