Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2308382ybd; Thu, 27 Jun 2019 10:09:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrX/VQ9OABXUyrVEhdrOtu2/5TPp9RvDKtMspYC3PcTrSEuNxLvwVZPAZMhlnjjjPPffzP X-Received: by 2002:a17:90a:360c:: with SMTP id s12mr7422705pjb.30.1561655366282; Thu, 27 Jun 2019 10:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561655366; cv=none; d=google.com; s=arc-20160816; b=FeDx3aty+M0q8uDOjzlnv/drTQ/LRu5qhe13LmUXULFYh6PyhNC87xbGwcqvFfMezT bMHgAQsrIazpta3swOGsfZhGbIDaY+GUhFSrCx2uvZLierOUhN0RvqGrliG/9uMRliCJ oVvBVe6HQBbga8cEdqt/Mbl+z5VdVT7oNFIkkiigRwuINK+MQiZz++hh2mBa9GQYhkKM iMx9C2QhsNA01bA0/Djwh9q85ENevlENJaT6DxxZw1GBciu1EP4wa75yOTafvOL0wAMY fcOwTxnp+pSo9JrmkoIwa1w6dOZp/ThxEgWa13woQRWn0hd+3budEbXvXi0r2CiCJpVB 9ECg== 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=8NEDY9v2/jdKlAoKiy9QS/xAFs6+VQMcaN8eLEyvavQ=; b=rWzmdsX3b7mQVoBj18lO4DGqVENInn9KCMjfCx26zNEItxFyFEEp4gwmNXcoHbC+za GEfx+QmMAy/5F9KZX98pZ2iDdxFtV/2i4k+MvGw56CupFMiULhHBmi6dL2koI/nqMT+H rIRLP5XLujpdPzoyJt66eNPxApCCDAVwcG/qyqt3w4PpTjvk4/+6G8vj4Ul1ybTXpRmy ogmpQLh3ayiGptPDf6F9D3Wv39ZzwlpyP0QCqdBo9G2nulEEjGDSUFDaezHeKI6f3p/F 0cIZJxfxNwYItdlLrr0yEOb7+M7ClxJpvHdlZBtiQYTRGDiiKRFr5dg5aFumMarE5Swr QoAw== 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 5si1601704pgc.385.2019.06.27.10.09.10; Thu, 27 Jun 2019 10:09:26 -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 S1726647AbfF0RHo (ORCPT + 99 others); Thu, 27 Jun 2019 13:07:44 -0400 Received: from foss.arm.com ([217.140.110.172]:59058 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726425AbfF0RHo (ORCPT ); Thu, 27 Jun 2019 13:07:44 -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 69900360; Thu, 27 Jun 2019 10:07:43 -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 815AA3F718; Thu, 27 Jun 2019 10:07:41 -0700 (PDT) Date: Thu, 27 Jun 2019 18:07:35 +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: <20190627170735.GA27591@e107155-lin> References: <20190603083005.4304-1-peng.fan@nxp.com> <20190603083005.4304-3-peng.fan@nxp.com> <20190627090903.GD13572@e107155-lin> 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 Thu, Jun 27, 2019 at 10:32:27AM -0500, Jassi Brar wrote: > On Thu, Jun 27, 2019 at 4:09 AM Sudeep Holla wrote: > > > > 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 ? > > > There is a flag IRQF_SHARED for such situations. Indeed, we can use it. > (good to see you considering multiple clients per channel as a legit scenario) > Not single channel, but single IRQ shared by multiple channels. We can have multiple SMC based mailbox but one shared IRQ. > > And I assume you are referring to case like this where IRQ is not tied > > to the mailbox IP. > > > Yes, and that is the reason the irq should not be manageid by the mailbox driver. Thanks for confirmation. -- Regards, Sudeep