Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp522367ybl; Thu, 23 Jan 2020 03:09:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxrqrgg8H8DZxrJyhUKhJpf5/XPaOrEhoQnKt+WTEWQdNFmJv/XPIvXHsvNSmSLbjRwYeh1 X-Received: by 2002:a9d:6d81:: with SMTP id x1mr11499381otp.9.1579777750157; Thu, 23 Jan 2020 03:09:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579777750; cv=none; d=google.com; s=arc-20160816; b=uuOgfrzqLitv49M+l457RuHapVDJ9aGm7mhE/OJFwKf+iKCqfiogLr3WAytjfWxfdV /WpuioNaiG/XxFoaewRC3oOKUxY8da8O41ZdUfp78rl+zQnb2S2DCfsEtnvI2uqmzNvu dxxSE6zQff2bu/7FfFZ/xixJpLX7te0UHkfp9LVb6ngSX0foOoucRG7vouTNwpygEeau 8twqwZzYr6ZrZzEjj9EW2f7wfMvR86WQKQ6MI0EGj9NbiwKlSColkvJvMcuBWERCFXhm 59LUPIcwR1dh3Na+QGFkiywJP3ICg5mcEx7j9Z4/Xk3r5oiW0VC4mA3DNfjTRGBeBY56 LqmA== 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:from:references:cc:to:subject; bh=0NS8qqnZ9V2rM4bWGVcPbWE3DjiUO/HEW7fmWf2mJjo=; b=lvTgWH5p8s6BGpuSteOoTtlm+wTOAqccIug+utRuU+xNmTia6ut8fV8OP5rc7oycOu /H3257SV3uVMO4SlHXHDYdhBBHW7oFo3tXmDq+UNT53Icxej2QC80Ydtcd//zrSO25n2 EYbUk1AY1DlsQ0mOdOx14zHZBEYDlLLmG4lC8+3x3o9W2FnNV/Dpzd0DfthcbYbjsL7w FTxxFHAfcFvqEeyU4cJwkJm28e9zfKxLyNnbTi5LZlNLvqAO0zJNV6Hgt49lj8ozlbtu J9Z7pd86+qDOKVhzxfaCiI3vW8G8EvGxBUraMh1Qa3ZpqA2lxaXQ6bJk7yAg2IYUbTxd BMcw== 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 x3si753061oie.146.2020.01.23.03.08.56; Thu, 23 Jan 2020 03:09:10 -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 S1726703AbgAWLGl (ORCPT + 99 others); Thu, 23 Jan 2020 06:06:41 -0500 Received: from foss.arm.com ([217.140.110.172]:37812 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbgAWLGl (ORCPT ); Thu, 23 Jan 2020 06:06:41 -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 50A1531B; Thu, 23 Jan 2020 03:06:40 -0800 (PST) Received: from [10.1.197.50] (e120937-lin.cambridge.arm.com [10.1.197.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4E7AB3F6C4; Thu, 23 Jan 2020 03:06:39 -0800 (PST) Subject: Re: [PATCH V3] firmware: arm_scmi: Make scmi core independent of the transport type To: Viresh Kumar Cc: arnd@arndb.de, Sudeep Holla , jassisinghbrar@gmail.com, peng.fan@nxp.com, peter.hilber@opensynergy.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <4b74f1b6c1f9653241a1b5754525e230b3d76a3f.1579595093.git.viresh.kumar@linaro.org> <3a8836dd-99d3-faff-af05-2032d609f594@arm.com> <20200123023924.roqc2iyx4wmukk4p@vireshk-i7> From: Cristian Marussi Message-ID: Date: Thu, 23 Jan 2020 11:06:38 +0000 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: <20200123023924.roqc2iyx4wmukk4p@vireshk-i7> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/01/2020 02:39, Viresh Kumar wrote: > On 22-01-20, 12:44, Cristian Marussi wrote: >> On 21/01/2020 08:27, Viresh Kumar wrote: >> commment is obsolete > > Right, they need to be checked everywhere again. Sorry for missing > that earlier. > >>> +struct scmi_chan_info { >>> + struct scmi_info *info; >>> + struct device *dev; >>> + struct scmi_handle *handle; >>> + void *transport_info; >>> +}; >>> + >>> +/** >>> + * struct scmi_transport_ops - Structure representing a SCMI transport ops >>> + * >>> + * @send_message: Callback to send a message >>> + * @mark_txdone: Callback to mark tx as done >>> + * @chan_setup: Callback to allocate and setup a channel >>> + * @chan_free: Callback to free a channel >>> + */ >> commment is obsolete but I would also ask: are all of these operations supposed to be mandatory supported >> on any possible foreseeable transport ? (beside the obviously needed like send_message) >> >> I'm asking because they are all called straight away from the driver core without any NULL check >> so that if a new transport should not need one of them it will be forced to anyway implement a dummy one >> to comply, which it will be needlessly invoked every time. > > They are kept as mandatory for now as we don't really know how it > will look for other transport types. Lets make them optional only when > someone don't need to define them. It would be a simple change anyway. Ok, fine. > >>> /* Each compatible listed below must have descriptor associated with it */ >>> static const struct of_device_id scmi_of_match[] = { >>> - { .compatible = "arm,scmi", .data = &scmi_generic_desc }, >>> + { .compatible = "arm,scmi", .data = &scmi_mailbox_desc }, >>> { /* Sentinel */ }, >>> }; >> >> minor thing: shouldn't the chosen transport being configurable at compile time with some >> option like CONFIG_SCMI_TRANSPORT_MBOX ? or via DT ? > > It is configurable via DT. The compatible should look different in > that case, something like: "arm,scmi-". > Ah ok, we're assuming mailbox transport as the default, being the only one existing as of now. Fine for me, thanks for the explanation. Reviewed-by: Cristian Marussi Regards Cristian