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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 B71EAC433DB for ; Fri, 26 Mar 2021 11:06:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 6068761A1E for ; Fri, 26 Mar 2021 11:06:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6068761A1E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To: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=BLPPLTO/PvbAIWfGTEUixCLTejdyMfAH7RgsnB2c7LM=; b=pxg0oOkz+Sm3vQAYWHNjwf0U3 6yDVSnizoloAx9GqpfomCK8bxq9/DhkQJYYrkhLERRNcSAG2VJ7kfehLoXpIBEF+hYNNBsccbaaGM lK/m9DCR9uQGpHm1TBma0GLbOP06NUk+ZofLw3w/JWmV1mTG4NhtdlKqeCJeHWINx9yD/6fnZH3gD Qs1h+ENK+HdKlXxV3A81hogMXrQfyFADFK3IAZbnJYbrXe/jDCRH+dmFrwgP8GrZ1eYZQOJD9lt3H MZDRL9+DFFHoLJqv4YtpY9YRsYv5CcRTS3tMIxTOhg3UkLmcyzU0RnZdOCFMPwjvsZkRv9h0Eg5O5 GuulAU2fw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPkH5-003NiX-GB; Fri, 26 Mar 2021 11:05:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPkGz-003Ngt-AM for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 11:05:03 +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 0B68B143D; Fri, 26 Mar 2021 04:05:00 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 378403F7D7; Fri, 26 Mar 2021 04:04:58 -0700 (PDT) Date: Fri, 26 Mar 2021 11:04:51 +0000 From: Cristian Marussi To: Florian Fainelli Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, lukasz.luba@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, etienne.carriere@linaro.org, thara.gopinath@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [PATCH v7 00/38] SCMI vendor protocols and modularization Message-ID: <20210326110451.GC43717@e120937-lin> References: <20210316124903.35011-1-cristian.marussi@arm.com> <6bf4921a-12ad-a3b5-3dcc-d5463dd36729@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6bf4921a-12ad-a3b5-3dcc-d5463dd36729@gmail.com> 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-20210326_110502_163724_512B3195 X-CRM114-Status: GOOD ( 36.52 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 25, 2021 at 09:09:52PM -0700, Florian Fainelli wrote: > > > On 3/16/2021 5:48 AM, Cristian Marussi wrote: > > Hi all, > > > > The current SCMI implementation does not provide an interface to easily > > develop and include a custom vendor protocol implementation as prescribed > > by the SCMI standard, also because, there is not currently any custom > > protocol in the upstream to justify the development of a custom interface > > and its maintenance. > > > > Moreover the current interface exposes protocol operations to the SCMI > > driver users attaching per-protocol operations directly to the handle > > structure, which, in this way, tends to grow indefinitely for each new > > protocol addition. > > > > Beside this, protocols private data are also exposed via handle *_priv > > pointers, making such private data accessible also to the SCMI drivers > > even if neither really needed nor advisable. > > > > This series wants to address this by simplifying the SCMI protocols > > interface and reducing it, roughly, to these common generic operations: > > > > - handle->devm_protocol_get() > > - handle->devm_protocol_put() > > - handle->notify_ops->* > > > > All protocols' private data pointers are removed from handle too and made > > accessible only to the protocols code through dedicated internal helpers. > > > > The concept of protocol handle is also introduced in the SCMI protocol code > > to represent a protocol instance initialized against a specific SCMI > > instance (handle), so that all the new protocol code uses such protocol > > handles wherever previously SCMI handle was used: this enable tighter > > control of what is exposed to the protocol code vs the SCMI drivers. > > > > Moreover protocol initialization is moved away from device probe and now > > happens on demand when the first user shows up (first .protocol_get), while > > de-initialization is performed once the last user of the protocol, even in > > terms of registered notifications callback, is gone, with the SCMI core > > taking care to perform all the needed underlying resource accounting. > > > > This way any new future standard or custom protocol implementation will > > expose a common unified interface which does not need to be extended > > endlessly: no need to maintain a custom interface only for vendor protos. > > SCMI drivers written on top of standard or custom protocols will use this > > same common interface to access any protocol operations. > > > > All existent upstream SCMI drivers are converted to this new interface. > > > > In order to make this migration painless and to avoid the need of a big > > un-mergeable jumbo patch touching all over the protocols and drivers (like > > it was in v2), since v3 the migration process has been heavily split with a > > bit of transient code added along the way (to preserve bisectability) and > > finally removed towards the ends of the series. > > Protocols and SCMI drivers migration to the new interface happens along > > patches 10->30. > > > > Leveraging this new centralized and common initialization flow we took > > care also to refactor and simplify protocol-events registration and remove > > *notify_priv from the handle interface making it accessible only to the > > notification core. > > > > Patch 37 builds on top of this new interface and introduces a mechanism to > > define an SCMI protocol as a full blown module (possibly loadable) while > > leaving the core dealing with proper resource accounting. > > Standard protocols are still kept as builtins in this series, though. > > > > Finally, patch 38 introduces dynamic SCMI devices creation to avoid having > > to update the static module device table in the core each time a new driver > > is added. > > > > The whole SCMI stack can still be built alternatively as a module, with all > > the standard protocols included in scmi-module.ko in such a case. > > > > On top of this series an example SCMI Custom protocol 0x99 and related > > SCMI Custom Dummy driver has been built and it is available at [1] as a > > series of DEBUG patches on top this same series. > > > > The series is currently based on sudeep/for-next/scmi [2] on top of: > > > > commit 908a4f778dc7 ("Merge branch 'ib-iio-scmi-5.12-rc2-take3' of > > git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into > > for-next/scmi") > > > > Any feedback welcome. > > You copied me on each round and thanks for doing that, I did not have > time to go look at each change, but sensors, clocks and cpufreq still > worked on ARCH_BRCMSTB with both 32-bit and 64-bit kernels, so: > > Tested-by: Florian Fainelli > Great, thanks for taking time to test this ! And btw, thanks for your initial feedback anyway, it spawned a lot of needed rework across this series. Thanks Cristian > Thanks! > -- > Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel