Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp931937ybl; Fri, 24 Jan 2020 12:11:29 -0800 (PST) X-Google-Smtp-Source: APXvYqykIj8KYVY7LXPNMLH/+qBcesM8xrNFxSUAvs43LglcssNBqT4vUFtrMdhqKQwgUSHXovz7 X-Received: by 2002:aca:e146:: with SMTP id y67mr365247oig.93.1579896689506; Fri, 24 Jan 2020 12:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579896689; cv=none; d=google.com; s=arc-20160816; b=u7Fq/R5hBE8ZqAkdgvPjZIM9q2lEJvDgzmY2DXwcrrtuUeY6066KmIAq8YZX2Crhbh 51ZTg39ozxdbE0+P/amvbBJUU5RlD0YJ9u3/LhzrOkqCRZrzNKAS1npK7OTAX3gZTx5A CvnAZSK4pFAFySUOCqNzl3TIPT6KyGMMAhHW0iEFGedQdTr26Oxn2+BoQFLV0t+Tw0LH pb+1bMyF6hIjpbx7klInw/62CfwsNmTBaVRM6o+5o07HbBOJK8d/gEpAeqRB7SiRHPUR dXRJN46HDyyp4KYgt+rimcDkrhSbUpbOBgfAV1Mfh8E8muS31BkcvYDW6acdvPw8wGEU zJEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:to:cc:references:subject:from; bh=hSakAwqRn5sv8gT4n18bqnV7GBX6FnJhgkI4CAsDV/8=; b=TWfx0UuMCmlYancilrmLRS84WZogaJpyB4zLRiGStN+TcUZpu2CLEeHecZosL/7Ret MDWzaalpBb5pDtgzf54bmGEroQ3WBpqgSC9mwOWqqeF3aIPpeWE21YglpDA/pTubcO5M C7wzEg2ixaCb6ktYDTi2y3/IGp3yfvH/l/ue94WZvJaXfCWcbTHVYbJ9qwLO4i3o6TSw Wtb0xM43ZH8GNNno43DMMtNgTL2xUmeY0Bdt/cfMS0tiLYpPqcRWif3IhwGHKiAcyq9e HRBrlN4rQixhsOZg6Hep2BUx280V0LtSdtaMGGUd9IFTWn7y2GyQmWWlG9y9dox1dV/B 2Rng== 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 m24si3394817otn.67.2020.01.24.12.11.17; Fri, 24 Jan 2020 12:11:29 -0800 (PST) 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 S1732448AbgAXMXO convert rfc822-to-8bit (ORCPT + 99 others); Fri, 24 Jan 2020 07:23:14 -0500 Received: from plasma32.jpberlin.de ([80.241.57.8]:15921 "EHLO plasma32.jpberlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730673AbgAXMXO (ORCPT ); Fri, 24 Jan 2020 07:23:14 -0500 X-Greylist: delayed 458 seconds by postgrey-1.27 at vger.kernel.org; Fri, 24 Jan 2020 07:23:11 EST Received: from spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) by plasma.jpberlin.de (Postfix) with ESMTP id E797D100425; Fri, 24 Jan 2020 13:15:29 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from plasma.jpberlin.de ([80.241.56.76]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id bJ9KJ2wKcDLt; Fri, 24 Jan 2020 13:15:25 +0100 (CET) Received: from webmail.opensynergy.com (unknown [217.66.60.5]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "webmail.opensynergy.com", Issuer "GeoTrust EV RSA CA 2018" (not verified)) (Authenticated sender: opensynergy@jpberlin.de) by plasma.jpberlin.de (Postfix) with ESMTPSA id 453A010058D; Fri, 24 Jan 2020 13:15:25 +0100 (CET) Received: from [10.25.40.95] (10.25.255.1) by MXS02.open-synergy.com (10.25.10.18) with Microsoft SMTP Server (TLS) id 14.3.468.0; Fri, 24 Jan 2020 13:15:24 +0100 From: Peter Hilber Subject: Re: [PATCH V4] firmware: arm_scmi: Make scmi core independent of the transport type References: <20200121183818.GA11522@bogus> CC: Jassi Brar , Cristian Marussi , , "linux-kernel@vger.kernel.org" , ALKML To: Arnd Bergmann , Sudeep Holla , "Viresh Kumar" Autocrypt: addr=peter.hilber@opensynergy.com; prefer-encrypt=mutual; keydata= mQGNBFuyHTIBDAClsxKaykR7WINWbw2hd8SjAU5Ft7Vx2qOyRR3guringPRMDvc5sAQeDPP4 lgFIZS5Ow3Z+0XMb/MtbJt0vQHg4Zi6WQtEysvctmAN4JG08XrO8Kf1Ly86Z0sJOrYTzd9oA JoNqk7/JufMre4NppAMUcJnB1zIDyhKkkGgM1znDvcW/pVkAIKZQ4Be3A9297tl7YjhVLkph kuw3yL8eyj7fk+3vruuEbMafYytozKCSBn5pM0wabiNUlPK39iQzcZd8VMIkh1BszRouInlc 7hjiWjBjGDQ2eAbMww09ETAP1u38PpDolrO8IlTFb7Yy7OlD4lzr8AV+a2CTJhbKrCJznDQS +GPGwLtOqTP5S5OJ0DCqVHdQyKoZMe1sLaZSPLMLx1WYAGN5R8ftCZSBjilVpwJ3lFsqO5cj t5w1/JfNeVBWa4cENt5Z0B2gTuZ4F8j0QAc506uGxWO0wxH1rWNv2LuInSxj8d1yIUu76MqY p92TS3D4t/myerODX3xGnjkAEQEAAbQ7cGV0ZXIuaGlsYmVyQG9wZW5zeW5lcmd5LmNvbSA8 cGV0ZXIuaGlsYmVyQG9w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Qmuh15iXYCxgltrvy9TjUIHj9SbKiaXW1O45tjlDohZJofA0AZ1gU0X8ZVXwqn3vEmrML DBiko3gdBy7mx2vl+Z1LJyqYKBBvw+pi7wARAQABiQG2BBgBCAAgAhsMFiEE4+UwmTdY2H45 eYsEIj0/YkOOjDcFAl13fD0ACgkQIj0/YkOOjDfFhwv9F6qVRBlMFPmb3dWIs+QcbdgUW9Vi GOHNyjCnr+UBE5jc0ERP3IOzcgqavcL5YpuWadfPn4/LyMDhVcl5SQGIdk5oZlRWQRiSpqS+ IIU8idu+Ogl/Hdsp4n9S8GiINNwNh5KzWoCNN0PpcrjuMTacJnZur9/ym9tjr+mMvW7Z0k52 lnS9L+CRHLKHpVJSnccpTpShQHa335c5YvRC8NN+Ygj1uZL/98+1GmP1WMZ6nc1LSFDUxR60 cxnlbgH7cwBuy8y5DBeCCYiPHKBglVIp5nUFZdLG/HmufQT3f4/GVoDEo2Q7H0lq3KULX1xE wHFeXHw4NXR7mYeX/eftz/9GFMVU29c72NTw8UihOy9qJgNo19wroRYKHLz1eWtMVcqS3hbX m0/QcrG9+C9qCPXVxpC/L0YLAtmdvEIyaFtXWRyW7UQ3us6klHh4XUvSpsQhOgzLHFJ1Lpfc upeBYECJQdxgIYyhgFAwRHeLGIPxjlvUmk22C0ualbekkuPTQs/m Message-ID: <82e1181a-b1ff-eccc-d61d-2da0e7afec25@opensynergy.com> Date: Fri, 24 Jan 2020 13:15:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.25.255.1] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.01.20 03:36, Viresh Kumar wrote: > The SCMI specification is fairly independent of the transport protocol, > which can be a simple mailbox (already implemented) or anything else. > The current Linux implementation however is very much dependent on the > mailbox transport layer. > > This patch makes the SCMI core code (driver.c) independent of the > mailbox transport layer and moves all mailbox related code to a new > file: mailbox.c. > > We can now implement more transport protocols to transport SCMI > messages. > > The transport protocols just need to provide struct scmi_transport_ops, > with its version of the callbacks to enable exchange of SCMI messages. Sorry for being a bit late with my feedback. Accessing struct scmi_shared_mem members from driver.c forces any transport to also use the struct scmi_shared_mem layout (or at least pretend to do so). IMHO this does not work very well for transports which are not using a fixed memory region to transmit and receive. But I think the current approach will still work out. virtio transfers each message in a separate buffer, and always uses different parts of the buffer for transmit data and receive data, which is contrary to the assumptions of the struct scmi_shared_mem. The virtio transport will probably have no use for the struct scmi_shared_mem.channel_status and .flags. The check for SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE in scmi_tx_prepare() is not required for the virtio transport. I would have preferred (to have an option) to use as data passing interface to the transport just the struct scmi_xfer. A transport using this option would not implement ops (read|write)32 and memcpy_(from|to). The transport would also not call scmi_tx_prepare(), but instead take data from struct scmi_xfer directly. The transport would use a modified scmi_rx_callback() to notify that it updated the struct scmi_xfer. A helper to derive the struct scmi_xfer * from the message header would be extracted from scmi_rx_callback(). The scmi_xfer_poll_done() would become an (optional) transport op. Other remarks: If staying with this approach, it would be more elegant to add an abstraction through which the transport can set the SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE bit in the struct scmi_shared_mem. The SCMI spec allows both interrupt-based and polling-based completion notification. The transport should be able to indicate which notification methods it supports. The virtio transport would not want to support polling. > -static void scmi_rx_callback(struct mbox_client *cl, void *m) > +void scmi_rx_callback(struct scmi_chan_info *cinfo, struct scmi_xfer *t) scmi_rx_callback() doesn't need the struct scmi_xfer * parameter any more ATM (and the transport might also not know about it). Best regards, Peter Please mind our privacy notice pursuant to Art. 13 GDPR. // Unsere Hinweise zum Datenschutz gem. Art. 13 DSGVO finden Sie hier. [tech_days_munchen] OpenSynergy TechDay München am 11. Februar 2020, ab 12:00Uhr, im Studio Balan, Moosacherstr. 86. Anmeldung bitte hier