Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1824402ybd; Thu, 27 Jun 2019 02:10:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQNUaq++dU0j+/z6onV4O25Mr48e4oIwIalr4bxXegb8y8ZGxvoUOcMB6YklX5GtFByA1m X-Received: by 2002:a17:90a:fa07:: with SMTP id cm7mr4775354pjb.115.1561626652800; Thu, 27 Jun 2019 02:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561626652; cv=none; d=google.com; s=arc-20160816; b=kGg7GSgYYbo+z78MOZHCsSDo6eNSh8YuxjF352EHPGyoRW3AGx/qP/sWqTCXpo9Rox pWRWGQzreeE3N61azlhIhhqSN5Ug5jU85Jw44740Mq5uUXtB6rY9YcxkhX9GxAgxWgBz G+pqKi7DHcRB3K12YWt/elH6sljWkRjjlCJ0YXXASyzmSQUcVp6n/n0g6lP5SbBAQ/0B Tlton1QZJE5vqzfOBiZenT7YZF/VAGmh8VnC81ReWmmbrvpGjiYXye2hDKLGVcsKBBX8 usdGFKkSMJP54fRVGe8ZBzU6pMVp0CWOidDF02PBbhL2qyxnUdZhcHnKXfqHIZ1SzCY5 Nu4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Qa8r7A4n7knyB2PgfbfEXJHFHYMM3x5GlPhBfVobWPo=; b=ymB4Qkcgx5bfBeckFbz5qs9UBnZn6VLvbMgeQdLIYc1GuP15cQEQ0UK5Wq632BkvYu ScNGNbghoY7zHbPQs5Lbsu+BuqR7PfH5MYT8cshLZYNEEPMrqUHdyxvAYURPkj/5bZCv BqnXMfWj7LsKXDWFeqBM0uDfq1KP0cjkSdxBCKRMBaicyT2zOMsdaH5lh/1lPtH0+yzq azlw6O0dcUMDvsYAlPLgTfSl3B/QMVDVBYqt00DbX56M9r+PL+cUcZpAG102nR2PpKbC Xoyzxurri7nyEYHRCh9OueF8TfD8OAyIn7k0kxRHcRwPcISd+XM/Xknj48B1E1ze8z8x XjNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c127si2061700pfc.191.2019.06.27.02.10.35; Thu, 27 Jun 2019 02:10:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726431AbfF0JJJ (ORCPT + 99 others); Thu, 27 Jun 2019 05:09:09 -0400 Received: from foss.arm.com ([217.140.110.172]:49694 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725385AbfF0JJI (ORCPT ); Thu, 27 Jun 2019 05:09:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E0B772B; Thu, 27 Jun 2019 02:09:07 -0700 (PDT) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 06B373F718; Thu, 27 Jun 2019 02:09:05 -0700 (PDT) Date: Thu, 27 Jun 2019 10:09:03 +0100 From: Sudeep Holla To: Jassi Brar Cc: Florian Fainelli , Peng Fan , Rob Herring , Mark Rutland , ", Sascha Hauer" , dl-linux-imx , Shawn Guo , "festevam@gmail.com" , Devicetree List , Linux Kernel Mailing List , "linux-arm-kernel@lists.infradead.org" , Andre Przywara , "van.freenix@gmail.com" , Sudeep Holla Subject: Re: [PATCH V2 2/2] mailbox: introduce ARM SMC based mailbox Message-ID: <20190627090903.GD13572@e107155-lin> References: <20190603083005.4304-1-peng.fan@nxp.com> <20190603083005.4304-3-peng.fan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 01:27:41PM -0500, Jassi Brar wrote: > On Wed, Jun 26, 2019 at 11:44 AM Florian Fainelli wrote: > > > > On 6/26/19 6:31 AM, Peng Fan wrote: > > >>> The firmware driver might not have func-id, such as SCMI/SCPI. > > >>> So add an optional func-id to let smc mailbox driver could > > >>> use smc SiP func id. > > >>> > > >> There is no end to conforming to protocols. Controller drivers should > > >> be written having no particular client in mind. > > > > > > If the func-id needs be passed from user, then the chan_id suggested > > > by Sudeep should also be passed from user, not in mailbox driver. > > > > > > Jassi, so from your point, arm_smc_send_data just send a0 - a6 > > > to firmware, right? > > > > > > Sudeep, Andre, Florian, > > > > > > What's your suggestion? SCMI not support, do you have > > > plan to add smc transport in SCMI? > > > > On the platforms that I work with, we have taken the liberty of > > implementing SCMI in our monitor firmware because the other MCU we use > > for dynamic voltage and frequency scaling did not have enough memory to > > support that and we still had the ability to make that firmware be > > trusted enough we could give it power management responsibilities. I > > would certainly feel more comfortable if the SCMI specification was > > amended to indicate that the Agent could be such a software entity, > > still residing on the same host CPU as the Platform(s), but if not, > > that's fine. > > > > This has lead us to implement a mailbox driver that uses a proprietary > > SMC call for the P2A path ("tx" channel) and the return being done via > > either that same SMC or through SGI. You can take a look at it in our > > downstream tree here actually: > > > > https://github.com/Broadcom/stblinux-4.9/blob/master/linux/drivers/mailbox/brcmstb-mailbox.c > > > > If we can get rid of our own driver and uses a standard SMC based > > mailbox driver that supports our use case that involves interrupts (we > > can always change their kind without our firmware/boot loader since FDT > > is generated from that component), that would be great. > > > static irqreturn_t brcm_isr(void) > { > mbox_chan_received_data(&chans[0], NULL); > return IRQ_HANDLED; > } > > Sorry, I fail to understand why the irq can't be moved inside the > client driver itself? There can't be more cost to it and there > definitely is no functionality lost. What if there are multiple clients ? And I assume you are referring to case like this where IRQ is not tied to the mailbox IP. -- Regards, Sudeep