From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 951F5D12D4B for ; Wed, 3 Dec 2025 11:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RdhHEJCiIhu3lRrlkmucOASnmWZN0uzlIT83Aub4Rj0=; b=09R045JQYar3Wjv97ZIUoCZW7+ TKmQWYOsoOJ7oLpqRKjypvl+4/hT4ZVYqBB1ln23Io7Lk12ih3pbA/MibiEak0ZhyWoFPRdXysU5T uDjusapRYMzLtfj9r1d1menQofD90PVVxKCjrdVFJy9Qqb/NVO6rcN2O9gIXYkPYKYFTW2KzNtKaR Fpg/o+V/SCzJNfQz0dRDRznBiVVixD07E8p2f1k2yZZ2lxVQFhdOx2XKyF6CTlgp3usPgy88WKrq2 IqWIffpmP/SF6LIPw6vVWUsLVovHxp6i54Ss/M4k2yQRjH0hzyLfBMT+oypx6+jo/AOAZClFAH4Jz cuUySQuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vQlFB-00000006Vhg-1Qrd; Wed, 03 Dec 2025 11:42:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vQlF9-00000006VhH-0Rtw for linux-arm-kernel@lists.infradead.org; Wed, 03 Dec 2025 11:42:00 +0000 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 1150E339; Wed, 3 Dec 2025 03:41:49 -0800 (PST) Received: from bogus (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 82F203F59E; Wed, 3 Dec 2025 03:41:54 -0800 (PST) Date: Wed, 3 Dec 2025 11:41:51 +0000 From: Sudeep Holla To: Marek Vasut Cc: Cristian Marussi , arm-scmi@vger.kernel.org, Conor Dooley , Sudeep Holla , Florian Fainelli , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH 1/2] dt-bindings: firmware: arm,scmi: Document arm,poll-transport property Message-ID: <20251203-thick-didactic-cockatoo-deaa1d@sudeepholla> References: <20251023123644.8730-1-marek.vasut+renesas@mailbox.org> <70554674-7020-4582-a4e7-dbee34907096@mailbox.org> <5ae0a793-d3e7-45d1-bf5c-3c46593d1824@mailbox.org> <20251202-evasive-neon-rhino-d2745e@sudeepholla> <66257fcf-9024-454f-b776-4ba584963ebe@mailbox.org> <8d773671-5e2e-4e21-ade6-2bf9a3b75066@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8d773671-5e2e-4e21-ade6-2bf9a3b75066@mailbox.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251203_034159_243383_7B4FC953 X-CRM114-Status: GOOD ( 47.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 02, 2025 at 08:25:11PM +0100, Marek Vasut wrote: > On 12/2/25 7:55 PM, Sudeep Holla wrote: > > Hello Sudeep, > > > > How do you imagine this -- a transport shared with other components, one > > > which does generate IRQs and one which does not -- would look like ? Can you > > > think of an example ? > > > > > > > Consider a system where a mailbox controller is present and one channel is > > used for SCMI communication, while another channel is used for an unrelated > > purpose. If both channels share the same interrupt line, and the other use > > case enables interrupt mode on its channel, what would be the impact on the > > SCMI-specific channel? > > None, SCMI kernel driver and SCMI server side would still do polling on > their respective SHMEM areas, while whatever kernel driver needs to receive > the interrupt notifications would subscribe to them using request_irq(), > right ? > Fair enough. I was thinking if the controller manages to not call mbox_chan_received_data() in that case. Also IIUC, the irq request happens as part of channel startup and there are no explicit APIs for the mbox client driver to control that. SCMI is mbox client in this case. > > I am aware of systems that implement such sharing, which is why I prefer to be > > explicit that this type of design is challenging to support within this > > binding. The intent is to support only minimal, constrained cases - essentially > > systems that are already somewhat broken. I do not see value in broadening the > > binding to cover every conceivable scenario. > > > > > > Clearly defining these constraints would be helpful. It may also be useful to > > > > note that this is primarily intended for mailbox transports, if that’s > > > > accurate. Alternatively, we could keep the DT binding definition broader but > > > > emit warnings when a transport other than mailbox is used. That approach might > > > > make it easier to move forward. > > > > > > DEN0056F refers to this polling mode in Shared memory based transports, that > > > can be other than mailbox transports, it includes e.g. SMC or OPTEE > > > transports. > > > > > > > However, polling does not make sense in the context of SMC. Once control > > returns from an SMC call, the command has completed. What form of polling in > > an SMC workflow do you have in mind? > > I think the polling happens on the SHMEM and the SMC transport is capable of > that too, see : > > drivers/firmware/arm_scmi/transports/smc.c > > 175 /* > 176 * If there is an interrupt named "a2p", then the service and > 177 * completion of a message is signaled by an interrupt rather > than by > 178 * the return of the SMC call. > 179 */ > 180 scmi_info->irq = of_irq_get_byname(cdev->of_node, "a2p"); > Ah this one, is actually implemented to avoid sort of implicit polling mode we get with any SMC/HVC. I don't know how the platform deals with it but SMC/HVC is synchronous and doesn't need this polling. The irq introduced here is again a sort of workaround to get some sort of async/non-polling mode with SMC/HVC. So, to repeat polling mode make absolutely no sense whatsoever for SMC/OPTEE(based on pure SMC) transports. > > I believe the same applies to OP-TEE. > > While OP-TEE now provides a notification mechanism that could, in theory, > > allow synchronous commands to be treated in a quasi-asynchronous manner, I > > strongly doubt that the current SCMI-over-OP-TEE implementation behaves this > > way, given that it ultimately reaches the secure side via an SMC call. > > > > > I don't think a warning is justified, if the behavior follows the > > > specification. But I do agree the behavior is ... suboptimal. > > > > > > > The specification does not address SMC or OP-TEE transports, placing them > > outside its scope and likewise these DT bindings. > > I believe the shmem transport includes the SMC and OPTEE ones, right ? > Yes, but the expectation when the SMC completes is to have the shmem to be owned by the OS(except that irq workaround case). Again the OPTEE/SMC is completely out of spec, but I agree the SHMEM behaviour must conform to the specification. > > Consequently, what we > > decide here in this discussion effectively defines the expected behavior in > > this context, in my view. So I would like to start with minimal possible > > coverage, why do you think that is not a good idea here ? > > I would argue the current implementation covers pretty much every transport > which could ever need to do polling on shmem, so the implementation is > generic and inline with the specification. Also, the current implementation > is some 20 lines, so I think it is minimalistic? > > What would you propose we do here ? > Yes it can be minimalistic but not restrictive. As I already clearly mentioned I don't see it makes any sense to enable this for SMC/OPTEE. Lets start with just mailbox to start with and extend to other transports if and when needed. It would be good to impose that restriction in the binding as well but that is not a must IMO. I am fine if the bindings for whatever reasons(though I don't see the need) to apply for any transport. -- Regards, Sudeep