Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5745678ybl; Tue, 10 Dec 2019 10:48:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzJZGAzitt6X1LqKsRf8oMA/21U3bWViBg47vG74j3wgV75HEmpAkfnxgnYj8N1TM02yLUN X-Received: by 2002:a9d:48a:: with SMTP id 10mr25090068otm.95.1576003703205; Tue, 10 Dec 2019 10:48:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576003703; cv=none; d=google.com; s=arc-20160816; b=sJ20KDr1zdZ9B2K0nmHxbYU2+o8urs6UuHGBKVhVDlMbWM/r76zIpe2eRTv4Jkkss0 tML+y36JyyStdMb1aSYW3+nKxcEevkNAzZK1xj9xaZNRdKCefCqp+pQZ+vsn4wupIuWb woy5Ztjm8GuP9yBHnHj32N8Jiul56emxDyGisQb5YlxBWZ9rR3ww6wj9yr1Ndmo4akUX tfk5OMPIvFGTT4x+ZZXyTaChmLtEuQJyFL2T9NQAPrgW1X+Oyn/XZnRGIeaGV7ZPVUuY O6s/B7bCl1VIDVLt6YRtiQ9TEHdqUcH6bkfPJPsdDgtYcIUFo0AxdsGzn8vBx70W5/iX syXQ== 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=qYOltkPQ+nY72SiGWZ04bLTw5WZ+D9pwBiGZXtprCME=; b=PWVeSiLeGwrHw5xIIA1HGvvO80nRcT9daAoNdYTXO5mg1QwWsmWlbdep3M7n0fkmJ7 Oz7kJjniAG7zYOcmhqIc27tr6Eh+djmWx8iZqHXBFxTJdcTSF79LpuyF26bEtxUWzwdB tLHSKBGxyc/eyGt3xMGaNLzMRyEbW6kgZ8V3Gl3SjOjgi1KeEPcd6zzIYcqtiSdLpLd8 6st5ejZMLrg4xZHlz1JoQdCd5T6uIYOkDBsOrzguLe2/7rH56ljHbRkBylFYxaMlvCd8 qwjI3GWpJO85ujZD7Hd528XE8PavRtZybvxUFkZQlmC+TzMDdygpwjVv7i3fmZifJeMs 4nJQ== 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 v14si2279565oto.127.2019.12.10.10.48.10; Tue, 10 Dec 2019 10:48:23 -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 S1727568AbfLJSqh (ORCPT + 99 others); Tue, 10 Dec 2019 13:46:37 -0500 Received: from foss.arm.com ([217.140.110.172]:53626 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726771AbfLJSqh (ORCPT ); Tue, 10 Dec 2019 13:46:37 -0500 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 774761FB; Tue, 10 Dec 2019 10:46:36 -0800 (PST) Received: from bogus (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A7543F6CF; Tue, 10 Dec 2019 10:46:35 -0800 (PST) Date: Tue, 10 Dec 2019 18:46:33 +0000 From: Sudeep Holla To: Viresh Kumar Cc: Cristian Marussi , Vincent Guittot , Arnd Bergmann , Jassi Brar , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sudeep Holla Subject: Re: [PATCH] firmware: arm_scmi: Make scmi core independent of transport type Message-ID: <20191210184633.GC20962@bogus> References: <5c545c2866ba075ddb44907940a1dae1d823b8a1.1575019719.git.viresh.kumar@linaro.org> <71417ba8-b844-ac96-bcad-4bf48fa8b869@arm.com> <20191210053448.ugjzbp2puzvnm37f@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191210053448.ugjzbp2puzvnm37f@vireshk-i7> 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 Tue, Dec 10, 2019 at 11:04:48AM +0530, Viresh Kumar wrote: > On 09-12-19, 18:13, Cristian Marussi wrote: > > On 29/11/2019 09:31, Viresh Kumar wrote: [...] > > > desc = of_device_get_match_data(dev); > > > if (!desc) > > > return -EINVAL; > > > > This scmi_desc struct descriptor is retrieved from of_match_table .data and points to > > the driver-provided scmi_generic_desc > > > > static const struct scmi_desc scmi_generic_desc = { > > .max_rx_timeout_ms = 30, /* We may increase this if required */ > > .max_msg = 20, /* Limited by MBOX_TX_QUEUE_LEN */ > > .max_msg_size = 128, > > }; > > > > Is not this kind of information possibly (maybe partially) related to the selected > > transport, and as such it should be also provided dynamically by the chosen transport > > layer at probe time, like the transport_ops, instead of being hard-coded in > > this driver ? > > I had my doubts about this thing and I missed checking it out. > > @Sudeep: Is this information completely mailbox specific ? Should I move it to > mailbox.c here ? > May be to some/small extent. 1. max_rx_timeout_ms is firmware dependent, maximum time it expects to complete a synchronous request or acknowledge async request(worst case value). 2. max_msg_size is maximum size of the buffer we need to allocate, mostly based on the specification and we don't have any more that 0x80. But the custom/vendor specific protocols may wary and hence I thought of keeping it configurable for platforms. 3. max_msg is the maximum number of messages the transport can support. This is currently based on the mailbox layer. For SMC/HVC we can have upto nr_cpus, something different for spci/optee. We must be able to make it transport independent if required. This is mainly used to pre-allocate number of (tx/rx) buffers. -- Regards, Sudeep