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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70837C43603 for ; Tue, 10 Dec 2019 18:46:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 455F5206D5 for ; Tue, 10 Dec 2019 18:46:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="suovYqM4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 455F5206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=wembLbJ8+D33IXDRy6Ipg9GYf/KxyAkwxBnxs7v11Rg=; b=suovYqM4FVnHJx KBV9UNWyld7j8NxJeY0wiogRtz/fzhXkwZc45esibIAFIV4cMLPQTHmqfZmG98m2hM/ZNlSTV0YHP BmIn1WW5lFExAHrL4WgavUTRH1QuuQhi+zAj0VRAtnI+XiAVDRLQz//9monIDJDlGI/orH5VVsulG nbmAvwLqRW6Q85PGuh+2ibIG1lbCPPzV8wiTdtSKBK7vky4xBWHRenEEqZ5GbaBfiKjFbypNLf2Uw d5QSchDgfoV1sSsZEwxku0dseJgU+hinb4i//TDHRapQ3baVkCuNzOptUJqEd9VkDWNGzLipBXwGC 3DuN40LweQo5KdUqLRFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iekWu-0006j6-9x; Tue, 10 Dec 2019 18:46:40 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iekWr-0006iK-MF for linux-arm-kernel@lists.infradead.org; Tue, 10 Dec 2019 18:46:39 +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 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 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-Disposition: inline In-Reply-To: <20191210053448.ugjzbp2puzvnm37f@vireshk-i7> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_104637_769778_35C85276 X-CRM114-Status: GOOD ( 15.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Jassi Brar , linux-kernel@vger.kernel.org, Cristian Marussi , Sudeep Holla , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel