From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbdJDLc3 (ORCPT ); Wed, 4 Oct 2017 07:32:29 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60224 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992AbdJDLc1 (ORCPT ); Wed, 4 Oct 2017 07:32:27 -0400 Cc: Sudeep Holla , ALKML , LKML , DTML , Roy Franz , Harb Abdulhamid , Nishanth Menon , Loc Ho , Alexey Klimov , Ryan Harkin , Jassi Brar Subject: Re: [PATCH v3 15/22] firmware: arm_scmi: abstract mailbox interface To: Arnd Bergmann References: <1506604306-20739-1-git-send-email-sudeep.holla@arm.com> <1506604306-20739-16-git-send-email-sudeep.holla@arm.com> From: Sudeep Holla Organization: ARM Message-ID: Date: Wed, 4 Oct 2017 12:32:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/17 12:24, Arnd Bergmann wrote: > On Thu, Sep 28, 2017 at 3:11 PM, Sudeep Holla wrote: >> Some of the mailbox controller expects controller specific data in order >> to implement simple doorbell mechanism as expected by SCMI specification. >> >> This patch creates a shim layer to abstract the mailbox interface so >> that it can support any mailbox controller. It also provides default >> implementation which maps to standard mailbox client APIs, so that >> controllers implementing doorbell mechanism need not require any >> additional layer. >> >> Cc: Arnd Bergmann >> Signed-off-by: Sudeep Holla > > Another level? Now we have three levels of stacked mailboxes, with > the highest level being the combined mailbox/memory, then the shim, > and below it the hardware mailbox. > > Can you try to come up with a way to do this with fewer abstractions? > I completely agree with you. I was against this but Jassi recommended this. I just wanted this SCMI to work with mailbox controllers that support simple doorbell mechanism as specified in the specification but Jassi disagrees with that. > Maybe you could assume that the mailbox itself can take variable-length > data packets, and then use the shim here for those that require > something else? > As per SCMI specification, we pass all the data in shared memory and it just expects to use a simple doorbell feature from hardware mailbox controllers. It's done that way intentionally to avoid dependency on h/w and we for sure will have variety of it and that defeats the purpose of this standard specification. Also, I have added shim only for specific controllers that need them. E.g. ARM MHU as Jassi disagreed to add doorbell mechanism to that. mbox_if provides default implementation that just calls direct mailbox APIs. -- Regards, Sudeep