From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755813AbdGXRjX (ORCPT ); Mon, 24 Jul 2017 13:39:23 -0400 Received: from foss.arm.com ([217.140.101.70]:35902 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753877AbdGXRi2 (ORCPT ); Mon, 24 Jul 2017 13:38:28 -0400 Cc: Sudeep Holla , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , linux-sunxi@googlegroups.com, Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Rob Herring , Mark Rutland , Devicetree List Subject: Re: [PATCH 1/8] mailbox: introduce ARM SMC based mailbox To: Jassi Brar , =?UTF-8?Q?Andr=c3=a9_Przywara?= References: <20170630095608.24943-1-andre.przywara@arm.com> <20170630095608.24943-2-andre.przywara@arm.com> <22d23c1d-ea8d-9829-4624-6305cd83ad4a@arm.com> From: Sudeep Holla Organization: ARM Message-ID: <0aaba7fb-2183-2d4d-ba04-64b30cd0ae10@arm.com> Date: Mon, 24 Jul 2017 18:38:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/07/17 18:20, Jassi Brar wrote: > On Mon, Jul 24, 2017 at 4:50 AM, André Przywara wrote: >> On 02/07/17 06:55, Jassi Brar wrote: >> >>>> + mbox_chan_received_data(link, (void *)res.a0); >>>> + >>> Or you can update the 'data' with value from 'a0' ? >> >> Mmh, I am a bit puzzled by this. Why would this be needed or useful? >> > I meant instead of calling mbox_chan_received_data(), simply update > the value at 'data' with res.a0 > > Technically the firmware does not "send" us a message. It only updates > the structure we share with it. So maybe we could reflect that by > updating the data pointer the client driver asked to send. > Also it is optional for clients to provide the rx_callback(). By > calling mbox_chan_received_data() you mandate clients provide that > callback. > > Nothing serious, just that looking closely, updating 'data' seems a > better option. > >> I see that the SCPI firmware driver (as the user of the mailbox API) is >> expecting the return value from a0 as returned above, translating the >> firmware error codes into Linux' ones. >> > I am afraid, SCPI driver is not the golden example for client drivers > to follow. It is supposed to work only with MHU, and then, it is > likely to break if some other protocol is running parallel to it. > Not sure why do you say it works only with ARM MHU ? AmLogic uses it with their mailbox driver. However they followed an interim version of the SCPI spec which is termed "legacy" in the driver. -- Regards, Sudeep