Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1116624ybd; Wed, 26 Jun 2019 11:28:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRIHQA5meAQs8agpJag503n6J8+7cBOhwidYVwmVA46Tn8M7+q4C3XwsgylFpbPJSB1uBy X-Received: by 2002:a17:902:403:: with SMTP id 3mr6941867ple.66.1561573734079; Wed, 26 Jun 2019 11:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561573734; cv=none; d=google.com; s=arc-20160816; b=dk+y9CnoOUKBgJi9202xKmVCaBnTJv+FtIfUkidKcqlIZWqeql4bmlvEe1mv+zowi1 fOLK64X8aMa8Juv7PTdQRyBJieDHVNxwH8A97D7AO+wZSo8LgOWMHKIQLOIFLXvcAacZ VoIttFhahMBh/+2MV6JTBMVWFGfKl4DdJU7uNqJ6jFrDGWToLcUQRccUdyvQYIgNamhB AsHDpeJ1lBXjav9ZCRsxB8cdIEl+WJxqZTw+1WxRej+NlnA6D1M/RzVovkDdscU5iKe+ oPo0yamh+JL0r0FckqeeKUGarEQsz8uCffexBF+S/aS4UqcVqesau1LxfU2WfVDkm/Ag zXpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=sZfM3WNDDF9GuJKzE5mdCdSAtOo3TH52oJkX/nrxJjM=; b=gF1WKQMf7I/v3I5RX+6k0Nnh5EYWtN0xIOme4xj/pf2w3/o0Z6VIfNlxAhjXABIZBH K58uPpCkRLM88UFBrgiXN2rfruummY9rcFD2/ymx4mIbjUa/gm+qDfOiYMsD2+F1sn7X YjUIQYp3vfYm3LphnAPQu9O3P00ZIm8NA6hnPcv+Kz2Rd8ndJnWeKbAWqfFy0M7FARgP ax4r3y++4uEoga69wjlVfGNvztJKj5pFDoEySdOjktHdi2A1tRmHeh3yT1iyaA2Qr3Yp N1JcGr3vCwT0B/D2GSgYj9IVE6Red6bfQL7bjemilZalmjV1y6vSiaYt1WiJi2P5tNDe W6sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G0Y7nsmQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si16897699pgv.225.2019.06.26.11.28.37; Wed, 26 Jun 2019 11:28:54 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G0Y7nsmQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbfFZS1x (ORCPT + 99 others); Wed, 26 Jun 2019 14:27:53 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:40131 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbfFZS1x (ORCPT ); Wed, 26 Jun 2019 14:27:53 -0400 Received: by mail-io1-f67.google.com with SMTP id n5so3838877ioc.7; Wed, 26 Jun 2019 11:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sZfM3WNDDF9GuJKzE5mdCdSAtOo3TH52oJkX/nrxJjM=; b=G0Y7nsmQdmW7klneIUIoJ3Pb5aD5br9jJpfpTuL41AlhhjSMaEA7NKcN4FNTP9Czmp iIi1g/Nlh0hIndZaxk6sMXCEURxf+fu+VVScYvY5NPC8vsmxpwPvO2Icji+7q3XU2HZv LHYILL5lIS3+YS3tWTQV1cP2q3uq89/TCwggdyXJZRuvnDEz5aDusH47p58E38okLekG lcRHbFfvQUxi4rLpaLJKmzu8CJNO+n1BA8YBadPMmgD7HY17iB0qwEiwRt4QRzVKfYMl nkPAvI0uw1BYCNrxP1mqMjTe850DG5MSSw0ncRFAmHr3/uLI/jfBgxZhYLjTENWtjirM dvkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sZfM3WNDDF9GuJKzE5mdCdSAtOo3TH52oJkX/nrxJjM=; b=jdrPNlJ5tGb1EyfQ9xnWq5TJGGn0/g8Parc9TEWwEGwCz6JqWy/NJ62acDK69cvqXR rm01TE/l+11iOTTACaytRZ/sJN1w7uP3D1SioVU1iDcEGziCLxF0ZWsp/XEhTAr9ZUIh CLVuuB5V449G1bMXRctqhW9kl3wMzAEPL4htMAWU7MgIRgoIK+yWPZfj04qIDnVYHzz4 zaN8rbAyWGwQABUA/6RC/RtQ3qkpanYHlh2ccw4ypfHtZd7GFhOlUVLymhk7JIIh7J6O 4Qmw7VqaKYnrpANIBxLtG2xNPLTdhZpfGoiPhw3GM3Z4NfTsmboQEcFHrrjUXfBYw8EH JNQA== X-Gm-Message-State: APjAAAUywvu1jNYQhdDbv0lzb4+LDs4QSORQQbkhGjw9tNnV7N3TrerB jPO5aA1ZPN7LJJRzW8QoK06jx4ZbdLKYs4mSYMs= X-Received: by 2002:a02:c492:: with SMTP id t18mr6474836jam.67.1561573672517; Wed, 26 Jun 2019 11:27:52 -0700 (PDT) MIME-Version: 1.0 References: <20190603083005.4304-1-peng.fan@nxp.com> <20190603083005.4304-3-peng.fan@nxp.com> In-Reply-To: From: Jassi Brar Date: Wed, 26 Jun 2019 13:27:41 -0500 Message-ID: Subject: Re: [PATCH V2 2/2] mailbox: introduce ARM SMC based mailbox To: Florian Fainelli Cc: Peng Fan , Rob Herring , Mark Rutland , Sudeep Holla , ", 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" Content-Type: text/plain; charset="UTF-8" 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 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.