From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B0AAC8303D for ; Fri, 4 Jul 2025 16:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Subject:References:In-Reply-To:Message-Id:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ye0B8joJLkUfI2iBIiVNnb3bZDrTy3icljur47MpVLc=; b=RXujYCtT6jOKxz/Rt2ZRkZPFPD vuYO+M8dlfs81U9/2nXwW61mxVWsC21XfhpGEtotvN3lsuhoy/bWziLLtCoKD0KsV+n4usatKv4j5 Yml0JqEVP9KYzyBjHOYqEBT0kF1EA2jxVesTIi0YJ9e3a+wHLwdOYBDyTDcFMykiYJy+NTkdCyxpR fIbiI5eW/ARrL3Q5h4p8n9tQBSQAsYb/qJQM4A2+2FoI70Nur9ADFO8f8618D1kfxGPlI2gSiaB8D Ki4kWk1O1Sqgi0d10RKErUW6UuUFsi6k6oO/MCGNTt9AJnkjnS5RPT/m3kSiYO1+YFBRTiZ5q5LZM Hq6COQ5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uXjFM-0000000ExFT-25vA; Fri, 04 Jul 2025 16:26:44 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uXiut-0000000EuHH-1dtU for linux-arm-kernel@lists.infradead.org; Fri, 04 Jul 2025 16:05:36 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 299C914002E6; Fri, 4 Jul 2025 12:05:32 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-05.internal (MEProxy); Fri, 04 Jul 2025 12:05:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1751645132; x=1751731532; bh=ye0B8joJLkUfI2iBIiVNnb3bZDrTy3icljur47MpVLc=; b= R2pFAGxWHB+CVPV9OZJnmRWsqG3nhKdEqOGTcKNRMkKnMoM036fON8GXn6uabcjy TBN/MHWftq9wyoMQxtXm+D7z8iS6tZJp7OAePZz65cKX3Dmwc7/Mci/JBTOHfDef re97vnNU8ifHfXqUppw5tlCxvlHTb3fFFqAnCKSpHMdxqLxpLRB26ISesWLhfqQ0 VASKIisRksE+n4mJrs5bLSqkKHhD2UHI9UZFcgqNWJh+vvQ7BcnSzRjak1WdLIaZ 4KO4fcOsaLhawjtOVPusUnnDNC916t8F3Z9Ft7COf25LGBStqJD7KjB3P3X2S+UF CjARKznyocSs+6uc87Gbcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1751645132; x= 1751731532; bh=ye0B8joJLkUfI2iBIiVNnb3bZDrTy3icljur47MpVLc=; b=W UGIH107UBjHOU4Bu0nQtmZ66iPfAwEoxdM+u52FoQopmi4D4DFvMvNK24G3evbaX R05WrXzLJtac4Yn/lDKzztEhZOZWWqNH8sVfmnoph6Xvuz3ul9jEt5dglUjXCykc N2ko18DEobA9rTfc9drWVA61ue8eVdRlkzsPAsclPvq4fbS/xREc5an8lIHn5Gmp C/wPnZwl7F9G5/7IL+q+SzE+O2AlgmE72MV8+FEBV/aM8hwcCoRKrJKXFxXw5lH0 eDaVlCx5tag2iq1CvGshFjmbfe1kOzCi17BsQHLFFC7ux3zbm8tE0RNDGYyOL8MS CMZACfjnN4er0bux3Qaew== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddvfeehlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthejredtredttdenucfhrhhomhepfdetrhhnugcu uegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtthgvrh hnpefhtdfhvddtfeehudekteeggffghfejgeegteefgffgvedugeduveelvdekhfdvieen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnug esrghrnhgusgdruggvpdhnsggprhgtphhtthhopedukedpmhhouggvpehsmhhtphhouhht pdhrtghpthhtoheptggrthgrlhhinhdrmhgrrhhinhgrshesrghrmhdrtghomhdprhgtph htthhopehkrghjvghtrghnrdhpuhgthhgrlhhskhhisegrrhhmrdgtohhmpdhrtghpthht ohepshhuuggvvghprdhhohhllhgrsegrrhhmrdgtohhmpdhrtghpthhtohepghhuohhmih hnrdgthhgvnhestghigihtvggthhdrtghomhdprhgtphhtthhopehlihhhuhgrrdhlihhu segtihigthgvtghhrdgtohhmpdhrtghpthhtoheptghigidqkhgvrhhnvghlqdhuphhsth hrvggrmhestghigihtvggthhdrtghomhdprhgtphhtthhopehgrghrhidrhigrnhhgsegt ihigthgvtghhrdgtohhmpdhrtghpthhtohepphgvthgvrhdrtghhvghnsegtihigthgvtg hhrdgtohhmpdhrtghpthhtohepjhgrshhsihhsihhnghhhsghrrghrsehgmhgrihhlrdgt ohhm X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 359A3700068; Fri, 4 Jul 2025 12:05:31 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: T7a47ae1d7bea40f2 Date: Fri, 04 Jul 2025 18:04:59 +0200 From: "Arnd Bergmann" To: "Peter Chen" , "Rob Herring" , krzk+dt@kernel.org, "Conor Dooley" , "Catalin Marinas" , "Will Deacon" , "Jassi Brar" Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, cix-kernel-upstream@cixtech.com, "Marc Zyngier" , "Sudeep Holla" , "Kajetan Puchalski" , "Enric Balletbo" , "Guomin Chen" , "Gary Yang" , "Lihua Liu" Message-Id: <64f39e94-7e88-49d0-8455-cd77d61d4fe2@app.fastmail.com> In-Reply-To: <20250609031627.1605851-6-peter.chen@cixtech.com> References: <20250609031627.1605851-1-peter.chen@cixtech.com> <20250609031627.1605851-6-peter.chen@cixtech.com> Subject: Re: [PATCH v9 5/9] mailbox: add CIX mailbox driver Content-Type: text/plain Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250704_090535_665939_AC9A6F60 X-CRM114-Status: GOOD ( 20.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 9, 2025, at 05:16, Peter Chen wrote: > From: Guomin Chen > > The CIX mailbox controller, used in the Cix SoCs, like sky1. > facilitates message transmission between multiple processors > within the SoC, such as the AP, PM, audio DSP, SensorHub MCU, > and others. > > Reviewed-by: Peter Chen > Signed-off-by: Guomin Chen > Signed-off-by: Gary Yang > Signed-off-by: Lihua Liu > Signed-off-by: Peter Chen This is the only driver holding up the merge of the CIX platform, so I had a closer look myself. The driver looks well written overall, and I see a lot of details that have come up in previous versions are addressed. The one thing that stuck out to me is the design of having multiple types of mailbox in one driver, which feels out of scope for a simple mailbox. > +static int cix_mbox_send_data_reg(struct mbox_chan *chan, void *data) > +{ > + struct cix_mbox_priv *priv = to_cix_mbox_priv(chan->mbox); > + union cix_mbox_msg_reg_fifo *msg = data; > + u32 len, i; > + > + if (!data) > + return -EINVAL; > + > + len = mbox_get_msg_size(data); > + for (i = 0; i < len; i++) > + cix_mbox_write(priv, msg->buf[i], REG_MSG(i)); In particular, this bit seems to do more than just what I think of as a simple mailbox that should have fixed-length messages, it feels more like a generic message passing interface between device drivers and firmware or some microcontroller. What is the purpose here? > +static int cix_mbox_send_data(struct mbox_chan *chan, void *data) > +{ ... > + switch (cp->type) { > + case CIX_MBOX_TYPE_DB: > + cix_mbox_send_data_db(chan, data); > + break; > + case CIX_MBOX_TYPE_REG: > + cix_mbox_send_data_reg(chan, data); > + break; > + case CIX_MBOX_TYPE_FIFO: > + cix_mbox_send_data_fifo(chan, data); > + break; > + case CIX_MBOX_TYPE_FAST: > + cix_mbox_send_data_fast(chan, data); > + break; Similarly, this also exceeds the complexity I would expect in a simple controller, it feels like there should either be four separate drivers that implement one type of interface, or a much higher-level abstraction. Is there a document that details how the messages are structured and what the users are? How does a user of the mailbox know the size of a message to pass down? Arnd