Message ID | 20230328-soc-mailbox-v1-5-3953814532fd@marcan.st |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2217287vqo; Tue, 28 Mar 2023 06:29:24 -0700 (PDT) X-Google-Smtp-Source: AKy350ZX5BpLVIHMB7mF8sEUGcE8UN5D7iKApooPkzT/atNHd5FBDlOXHHSCHiHtMgvhBeH6kxCg X-Received: by 2002:a17:906:48cb:b0:932:c50e:d6b4 with SMTP id d11-20020a17090648cb00b00932c50ed6b4mr16206020ejt.9.1680010163888; Tue, 28 Mar 2023 06:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680010163; cv=none; d=google.com; s=arc-20160816; b=EpHoRO2pvV6WM2XmEMtiZbngmK3SAl3r1IYIfHeUx1udp8RaR8pTKyQ5ceKDaCGYKt 7l1Y4zBGvbMqTbpDrkskEG9G102D/e0B9xnv5Zd2945ISFgIcnh4b1a9ZFPW1nzl3Zye w5m3gy6QDIgUm0TkOPSzEaxIyk6WJouqc+qDxNy5MRGfDqNBywx42SbG0RX0lRmjHDZP zMes+2YBnoBNQXluwohazobhdQsJyP3BeYgIz1cCyd66HP4Bxxc0g4Og5Yh7DR8I8CoG P0oZfXAdI3Neo3iXiPhEL6HCwd7QxL6RPvSB5maMxtCOJgOXeN803mujtShlH1VvR5hU S0zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=57jZavm7QI0YqL+NWFffR7ygOGg9dMYua/VCVpGdqZI=; b=YVvECxz72BvFXdNSoU+GhdoaCONQLM7hOE9s6XCttTYxxd2PX+z5zwhHOSJI+PWcmq I6Webe4Z63W+k0qgWAl1a0DsS7u65X+TQIP6i0LMyNu8R9z++CQW+j/JbCp9IGDP59Yk pvvrXfXSwRiVmkDeoPvn2i1rxZEMHWM3fu+T8dKftWpxaqzlBvlCj9hGgMYsC/kxuClj YDqCNAKzG+tEiQo/6yCcoCTs9g+Cvfq+hFIZPvEiVXrqQcczdEe4Shk8kyaXT3PbuQ9Y gYi20o1q2j6/uIUHsAJS3ruEHoDNT8FNz5MUpZT0lkhPt4En02t/7rNXBvRBTq/WN5fX k1NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=hXjfxzmy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he7-20020a1709073d8700b00932af15caa7si31078504ejc.731.2023.03.28.06.28.59; Tue, 28 Mar 2023 06:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=hXjfxzmy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232846AbjC1NPb (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Tue, 28 Mar 2023 09:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbjC1NPA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Mar 2023 09:15:00 -0400 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE88FB74B for <linux-kernel@vger.kernel.org>; Tue, 28 Mar 2023 06:14:53 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 8717B4249A; Tue, 28 Mar 2023 13:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1680009292; bh=WRbEluBIEV7jHnCWK701TbH9lXJAyLcM/aZGlX67/Kg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=hXjfxzmy+bjJP1Fpfh00OxQbjMxbWQlrxsqL63NpIge5jgXFjTRR5wNPyCSeQBcSk wkCjGkpT/0FFpnN9lbfu8Je2zpxtZ0Cdqo4P2ABY/gj3R41LFUJVPELVLWUF6pgzYJ QqKCycYHxvU+wk4BP7mZDWUeZFmSfZlw6IQgqqPpWkYLWc/+w4k1HBP1JcdtkYD1cU Fd8NZmGT4dnuSf2Djb5LPI+vLPAuFaq/QKfmWifiLSkveMz24pmrIzMqxwleDr6tUF jpiUPKv4HZTLGUWsB8SrB9RJfrrwb5Mpe6c980+SSR7rQIerk8ZWshPhil9vABVU4B iK3Rp26CRo4Rw== From: Hector Martin <marcan@marcan.st> Date: Tue, 28 Mar 2023 22:14:18 +0900 Subject: [PATCH 5/5] soc: apple: mailbox: Rename config symbol to APPLE_MAILBOX MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230328-soc-mailbox-v1-5-3953814532fd@marcan.st> References: <20230328-soc-mailbox-v1-0-3953814532fd@marcan.st> In-Reply-To: <20230328-soc-mailbox-v1-0-3953814532fd@marcan.st> To: Sven Peter <sven@svenpeter.dev>, Alyssa Rosenzweig <alyssa@rosenzweig.io>, Jassi Brar <jassisinghbrar@gmail.com>, Janne Grunau <j@jannau.net> Cc: linux-kernel@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Hector Martin <marcan@marcan.st> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1768; i=marcan@marcan.st; h=from:subject:message-id; bh=WRbEluBIEV7jHnCWK701TbH9lXJAyLcM/aZGlX67/Kg=; b=owGbwMvMwCEm+yP4NEe/cRLjabUkhhSlFzb2Ledid97V2H582/tdDi4XleJzH76YsEH+hFKuc HugRn5ERykLgxgHg6yYIkvjid5T3Z7Tz6mrpkyHmcPKBDKEgYtTACZy2YThn73sX8ktsz/XCmyL WLRiB2/gbKXa6rBd2ucu9+iUh5VG6TMyfJUXW3JaM3k523sF5f0FttfTaqM3fpMyzqpVT/4WtmA jPwA= X-Developer-Key: i=marcan@marcan.st; a=openpgp; fpr=FC18F00317968B7BE86201CBE22A629A4C515DD5 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761618337609369249?= X-GMAIL-MSGID: =?utf-8?q?1761618337609369249?= |
Series |
mailbox: apple: Move driver into soc/apple and stop using the subsystem
|
|
Commit Message
Hector Martin
March 28, 2023, 1:14 p.m. UTC
With the original owner of APPLE_MAILBOX removed, let's rename the new
APPLE_MBOX to the old name. This avoids .config churn for downstream
users, and leaves us with an identical config symbol and module name as
before.
Signed-off-by: Hector Martin <marcan@marcan.st>
---
drivers/soc/apple/Kconfig | 5 ++---
drivers/soc/apple/Makefile | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
Comments
On Tue, 28 Mar 2023 at 14:21, Hector Martin <marcan@marcan.st> wrote: > > With the original owner of APPLE_MAILBOX removed, let's rename the new > APPLE_MBOX to the old name. This avoids .config churn for downstream > users, and leaves us with an identical config symbol and module name as > before. > > Signed-off-by: Hector Martin <marcan@marcan.st> Watched the stream Acked-by: Eric Curtin <ecurtin@redhat.com> Is mise le meas/Regards, Eric Curtin > --- > drivers/soc/apple/Kconfig | 5 ++--- > drivers/soc/apple/Makefile | 2 +- > 2 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/soc/apple/Kconfig b/drivers/soc/apple/Kconfig > index d0e29bbd8c6f..c5203c388bf4 100644 > --- a/drivers/soc/apple/Kconfig > +++ b/drivers/soc/apple/Kconfig > @@ -17,11 +17,10 @@ config APPLE_PMGR_PWRSTATE > controls for SoC devices. This driver manages them through the > generic power domain framework, and also provides reset support. > > -config APPLE_MBOX > +config APPLE_MAILBOX > tristate "Apple SoC mailboxes" > depends on PM > depends on ARCH_APPLE || (64BIT && COMPILE_TEST) > - depends on !APPLE_MAILBOX > default ARCH_APPLE > help > Apple SoCs have various co-processors required for certain > @@ -33,7 +32,7 @@ config APPLE_MBOX > > config APPLE_RTKIT > tristate "Apple RTKit co-processor IPC protocol" > - depends on APPLE_MBOX > + depends on APPLE_MAILBOX > depends on ARCH_APPLE || COMPILE_TEST > default ARCH_APPLE > help > diff --git a/drivers/soc/apple/Makefile b/drivers/soc/apple/Makefile > index e52edf6a73da..20feee6f3943 100644 > --- a/drivers/soc/apple/Makefile > +++ b/drivers/soc/apple/Makefile > @@ -1,7 +1,7 @@ > # SPDX-License-Identifier: GPL-2.0-only > obj-$(CONFIG_APPLE_PMGR_PWRSTATE) += apple-pmgr-pwrstate.o > > -obj-$(CONFIG_APPLE_MBOX) += apple-mailbox.o > +obj-$(CONFIG_APPLE_MAILBOX) += apple-mailbox.o > apple-mailbox-y = mailbox.o > > obj-$(CONFIG_APPLE_RTKIT) += apple-rtkit.o > > -- > 2.40.0 > >
Hi Hector, I love your patch! Yet something to improve: [auto build test ERROR on bdfe6de2695c5bccc663a5a7d530f81925d8bc10] url: https://github.com/intel-lab-lkp/linux/commits/Hector-Martin/soc-apple-rtkit-Get-rid-of-apple_rtkit_send_message_wait/20230328-211648 base: bdfe6de2695c5bccc663a5a7d530f81925d8bc10 patch link: https://lore.kernel.org/r/20230328-soc-mailbox-v1-5-3953814532fd%40marcan.st patch subject: [PATCH 5/5] soc: apple: mailbox: Rename config symbol to APPLE_MAILBOX config: ia64-allmodconfig (https://download.01.org/0day-ci/archive/20230329/202303291348.nYR9dkeW-lkp@intel.com/config) compiler: ia64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/d0addf95095d935cdd5940101fbf1b1594b08158 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Hector-Martin/soc-apple-rtkit-Get-rid-of-apple_rtkit_send_message_wait/20230328-211648 git checkout d0addf95095d935cdd5940101fbf1b1594b08158 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/soc/apple/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202303291348.nYR9dkeW-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/soc/apple/mailbox.c: In function 'apple_mbox_send': >> drivers/soc/apple/mailbox.c:151:24: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration] 151 | writeq_relaxed(FIELD_PREP(APPLE_MBOX_MSG1_MSG, msg.msg1), | ^~~~~~~~~~ drivers/soc/apple/mailbox.c: In function 'apple_mbox_poll_locked': >> drivers/soc/apple/mailbox.c:188:28: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration] 188 | msg.msg1 = FIELD_GET( | ^~~~~~~~~ cc1: some warnings being treated as errors vim +/FIELD_PREP +151 drivers/soc/apple/mailbox.c 8b654b5034baba0 Hector Martin 2023-03-28 95 8b654b5034baba0 Hector Martin 2023-03-28 96 int apple_mbox_send(struct apple_mbox *mbox, const struct apple_mbox_msg msg, 8b654b5034baba0 Hector Martin 2023-03-28 97 bool atomic) 8b654b5034baba0 Hector Martin 2023-03-28 98 { 8b654b5034baba0 Hector Martin 2023-03-28 99 unsigned long flags; 8b654b5034baba0 Hector Martin 2023-03-28 100 int ret; 8b654b5034baba0 Hector Martin 2023-03-28 101 u32 mbox_ctrl; 8b654b5034baba0 Hector Martin 2023-03-28 102 long t; 8b654b5034baba0 Hector Martin 2023-03-28 103 8b654b5034baba0 Hector Martin 2023-03-28 104 spin_lock_irqsave(&mbox->tx_lock, flags); 8b654b5034baba0 Hector Martin 2023-03-28 105 mbox_ctrl = readl_relaxed(mbox->regs + mbox->hw->a2i_control); 8b654b5034baba0 Hector Martin 2023-03-28 106 8b654b5034baba0 Hector Martin 2023-03-28 107 while (mbox_ctrl & mbox->hw->control_full) { 8b654b5034baba0 Hector Martin 2023-03-28 108 if (atomic) { 8b654b5034baba0 Hector Martin 2023-03-28 109 ret = readl_poll_timeout_atomic( 8b654b5034baba0 Hector Martin 2023-03-28 110 mbox->regs + mbox->hw->a2i_control, mbox_ctrl, 8b654b5034baba0 Hector Martin 2023-03-28 111 !(mbox_ctrl & mbox->hw->control_full), 100, 8b654b5034baba0 Hector Martin 2023-03-28 112 APPLE_MBOX_TX_TIMEOUT * 1000); 8b654b5034baba0 Hector Martin 2023-03-28 113 8b654b5034baba0 Hector Martin 2023-03-28 114 if (ret) { 8b654b5034baba0 Hector Martin 2023-03-28 115 spin_unlock_irqrestore(&mbox->tx_lock, flags); 8b654b5034baba0 Hector Martin 2023-03-28 116 return ret; 8b654b5034baba0 Hector Martin 2023-03-28 117 } 8b654b5034baba0 Hector Martin 2023-03-28 118 8b654b5034baba0 Hector Martin 2023-03-28 119 break; 8b654b5034baba0 Hector Martin 2023-03-28 120 } 8b654b5034baba0 Hector Martin 2023-03-28 121 /* 8b654b5034baba0 Hector Martin 2023-03-28 122 * The interrupt is level triggered and will keep firing as long as the 8b654b5034baba0 Hector Martin 2023-03-28 123 * FIFO is empty. It will also keep firing if the FIFO was empty 8b654b5034baba0 Hector Martin 2023-03-28 124 * at any point in the past until it has been acknowledged at the 8b654b5034baba0 Hector Martin 2023-03-28 125 * mailbox level. By acknowledging it here we can ensure that we will 8b654b5034baba0 Hector Martin 2023-03-28 126 * only get the interrupt once the FIFO has been cleared again. 8b654b5034baba0 Hector Martin 2023-03-28 127 * If the FIFO is already empty before the ack it will fire again 8b654b5034baba0 Hector Martin 2023-03-28 128 * immediately after the ack. 8b654b5034baba0 Hector Martin 2023-03-28 129 */ 8b654b5034baba0 Hector Martin 2023-03-28 130 if (mbox->hw->has_irq_controls) { 8b654b5034baba0 Hector Martin 2023-03-28 131 writel_relaxed(mbox->hw->irq_bit_send_empty, 8b654b5034baba0 Hector Martin 2023-03-28 132 mbox->regs + mbox->hw->irq_ack); 8b654b5034baba0 Hector Martin 2023-03-28 133 } 8b654b5034baba0 Hector Martin 2023-03-28 134 enable_irq(mbox->irq_send_empty); 8b654b5034baba0 Hector Martin 2023-03-28 135 reinit_completion(&mbox->tx_empty); 8b654b5034baba0 Hector Martin 2023-03-28 136 spin_unlock_irqrestore(&mbox->tx_lock, flags); 8b654b5034baba0 Hector Martin 2023-03-28 137 8b654b5034baba0 Hector Martin 2023-03-28 138 t = wait_for_completion_interruptible_timeout( 8b654b5034baba0 Hector Martin 2023-03-28 139 &mbox->tx_empty, 8b654b5034baba0 Hector Martin 2023-03-28 140 msecs_to_jiffies(APPLE_MBOX_TX_TIMEOUT)); 8b654b5034baba0 Hector Martin 2023-03-28 141 if (t < 0) 8b654b5034baba0 Hector Martin 2023-03-28 142 return t; 8b654b5034baba0 Hector Martin 2023-03-28 143 else if (t == 0) 8b654b5034baba0 Hector Martin 2023-03-28 144 return -ETIMEDOUT; 8b654b5034baba0 Hector Martin 2023-03-28 145 8b654b5034baba0 Hector Martin 2023-03-28 146 spin_lock_irqsave(&mbox->tx_lock, flags); 8b654b5034baba0 Hector Martin 2023-03-28 147 mbox_ctrl = readl_relaxed(mbox->regs + mbox->hw->a2i_control); 8b654b5034baba0 Hector Martin 2023-03-28 148 } 8b654b5034baba0 Hector Martin 2023-03-28 149 8b654b5034baba0 Hector Martin 2023-03-28 150 writeq_relaxed(msg.msg0, mbox->regs + mbox->hw->a2i_send0); 8b654b5034baba0 Hector Martin 2023-03-28 @151 writeq_relaxed(FIELD_PREP(APPLE_MBOX_MSG1_MSG, msg.msg1), 8b654b5034baba0 Hector Martin 2023-03-28 152 mbox->regs + mbox->hw->a2i_send1); 8b654b5034baba0 Hector Martin 2023-03-28 153 8b654b5034baba0 Hector Martin 2023-03-28 154 spin_unlock_irqrestore(&mbox->tx_lock, flags); 8b654b5034baba0 Hector Martin 2023-03-28 155 8b654b5034baba0 Hector Martin 2023-03-28 156 return 0; 8b654b5034baba0 Hector Martin 2023-03-28 157 } 8b654b5034baba0 Hector Martin 2023-03-28 158 EXPORT_SYMBOL(apple_mbox_send); 8b654b5034baba0 Hector Martin 2023-03-28 159 8b654b5034baba0 Hector Martin 2023-03-28 160 static irqreturn_t apple_mbox_send_empty_irq(int irq, void *data) 8b654b5034baba0 Hector Martin 2023-03-28 161 { 8b654b5034baba0 Hector Martin 2023-03-28 162 struct apple_mbox *mbox = data; 8b654b5034baba0 Hector Martin 2023-03-28 163 8b654b5034baba0 Hector Martin 2023-03-28 164 /* 8b654b5034baba0 Hector Martin 2023-03-28 165 * We don't need to acknowledge the interrupt at the mailbox level 8b654b5034baba0 Hector Martin 2023-03-28 166 * here even if supported by the hardware. It will keep firing but that 8b654b5034baba0 Hector Martin 2023-03-28 167 * doesn't matter since it's disabled at the main interrupt controller. 8b654b5034baba0 Hector Martin 2023-03-28 168 * apple_mbox_send will acknowledge it before enabling 8b654b5034baba0 Hector Martin 2023-03-28 169 * it at the main controller again. 8b654b5034baba0 Hector Martin 2023-03-28 170 */ 8b654b5034baba0 Hector Martin 2023-03-28 171 spin_lock(&mbox->tx_lock); 8b654b5034baba0 Hector Martin 2023-03-28 172 disable_irq_nosync(mbox->irq_send_empty); 8b654b5034baba0 Hector Martin 2023-03-28 173 complete(&mbox->tx_empty); 8b654b5034baba0 Hector Martin 2023-03-28 174 spin_unlock(&mbox->tx_lock); 8b654b5034baba0 Hector Martin 2023-03-28 175 8b654b5034baba0 Hector Martin 2023-03-28 176 return IRQ_HANDLED; 8b654b5034baba0 Hector Martin 2023-03-28 177 } 8b654b5034baba0 Hector Martin 2023-03-28 178 8b654b5034baba0 Hector Martin 2023-03-28 179 static int apple_mbox_poll_locked(struct apple_mbox *mbox) 8b654b5034baba0 Hector Martin 2023-03-28 180 { 8b654b5034baba0 Hector Martin 2023-03-28 181 struct apple_mbox_msg msg; 8b654b5034baba0 Hector Martin 2023-03-28 182 int ret = 0; 8b654b5034baba0 Hector Martin 2023-03-28 183 8b654b5034baba0 Hector Martin 2023-03-28 184 u32 mbox_ctrl = readl_relaxed(mbox->regs + mbox->hw->i2a_control); 8b654b5034baba0 Hector Martin 2023-03-28 185 8b654b5034baba0 Hector Martin 2023-03-28 186 while (!(mbox_ctrl & mbox->hw->control_empty)) { 8b654b5034baba0 Hector Martin 2023-03-28 187 msg.msg0 = readq_relaxed(mbox->regs + mbox->hw->i2a_recv0); 8b654b5034baba0 Hector Martin 2023-03-28 @188 msg.msg1 = FIELD_GET( 8b654b5034baba0 Hector Martin 2023-03-28 189 APPLE_MBOX_MSG1_MSG, 8b654b5034baba0 Hector Martin 2023-03-28 190 readq_relaxed(mbox->regs + mbox->hw->i2a_recv1)); 8b654b5034baba0 Hector Martin 2023-03-28 191 8b654b5034baba0 Hector Martin 2023-03-28 192 mbox->rx(mbox, msg, mbox->cookie); 8b654b5034baba0 Hector Martin 2023-03-28 193 ret++; 8b654b5034baba0 Hector Martin 2023-03-28 194 mbox_ctrl = readl_relaxed(mbox->regs + mbox->hw->i2a_control); 8b654b5034baba0 Hector Martin 2023-03-28 195 } 8b654b5034baba0 Hector Martin 2023-03-28 196 8b654b5034baba0 Hector Martin 2023-03-28 197 /* 8b654b5034baba0 Hector Martin 2023-03-28 198 * The interrupt will keep firing even if there are no more messages 8b654b5034baba0 Hector Martin 2023-03-28 199 * unless we also acknowledge it at the mailbox level here. 8b654b5034baba0 Hector Martin 2023-03-28 200 * There's no race if a message comes in between the check in the while 8b654b5034baba0 Hector Martin 2023-03-28 201 * loop above and the ack below: If a new messages arrives inbetween 8b654b5034baba0 Hector Martin 2023-03-28 202 * those two the interrupt will just fire again immediately after the 8b654b5034baba0 Hector Martin 2023-03-28 203 * ack since it's level triggered. 8b654b5034baba0 Hector Martin 2023-03-28 204 */ 8b654b5034baba0 Hector Martin 2023-03-28 205 if (mbox->hw->has_irq_controls) { 8b654b5034baba0 Hector Martin 2023-03-28 206 writel_relaxed(mbox->hw->irq_bit_recv_not_empty, 8b654b5034baba0 Hector Martin 2023-03-28 207 mbox->regs + mbox->hw->irq_ack); 8b654b5034baba0 Hector Martin 2023-03-28 208 } 8b654b5034baba0 Hector Martin 2023-03-28 209 8b654b5034baba0 Hector Martin 2023-03-28 210 return ret; 8b654b5034baba0 Hector Martin 2023-03-28 211 } 8b654b5034baba0 Hector Martin 2023-03-28 212
diff --git a/drivers/soc/apple/Kconfig b/drivers/soc/apple/Kconfig index d0e29bbd8c6f..c5203c388bf4 100644 --- a/drivers/soc/apple/Kconfig +++ b/drivers/soc/apple/Kconfig @@ -17,11 +17,10 @@ config APPLE_PMGR_PWRSTATE controls for SoC devices. This driver manages them through the generic power domain framework, and also provides reset support. -config APPLE_MBOX +config APPLE_MAILBOX tristate "Apple SoC mailboxes" depends on PM depends on ARCH_APPLE || (64BIT && COMPILE_TEST) - depends on !APPLE_MAILBOX default ARCH_APPLE help Apple SoCs have various co-processors required for certain @@ -33,7 +32,7 @@ config APPLE_MBOX config APPLE_RTKIT tristate "Apple RTKit co-processor IPC protocol" - depends on APPLE_MBOX + depends on APPLE_MAILBOX depends on ARCH_APPLE || COMPILE_TEST default ARCH_APPLE help diff --git a/drivers/soc/apple/Makefile b/drivers/soc/apple/Makefile index e52edf6a73da..20feee6f3943 100644 --- a/drivers/soc/apple/Makefile +++ b/drivers/soc/apple/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_APPLE_PMGR_PWRSTATE) += apple-pmgr-pwrstate.o -obj-$(CONFIG_APPLE_MBOX) += apple-mailbox.o +obj-$(CONFIG_APPLE_MAILBOX) += apple-mailbox.o apple-mailbox-y = mailbox.o obj-$(CONFIG_APPLE_RTKIT) += apple-rtkit.o