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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1329FC3DA64 for ; Thu, 1 Aug 2024 18:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NnQhhummXQw0pjwgVy3C2cdxx2zT1ep2SSYSxtgDMfA=; b=gA3NPkznH0YStWhyS+2P/N5EJQ iElkBrb0YvS+sCa74HXVc/mpwAL6jTMy3AqE7+l83TCCuYrJyhBAb2xErJEbW+qDtE2P6Rmi4DyL3 aNBW2pGIB+fnT0z0Hot7ccutQaP6+HSoBiQYZ3apE9Xeratsp1i0jEShW+eLfPn0XmZckTfHRt62N NayCX1x+GgsF46o9jHeGzRKnZFS6bK1Q/+pqHPmONacR6wW9VDi1dW6NoBN0Sg/o+zRPhwEcPd1iq bGCn1G3OXD4c+6DFt7SYccASQ1ltLJbeY1Fmx5ND4ttk0OhrvrqWU+Bhy93bMle6Ir6qIicLtH1Ku HvlpAgMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZal4-00000006Qp6-1ftB; Thu, 01 Aug 2024 18:42:38 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZaka-00000006Qjk-1Fm9 for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2024 18:42:09 +0000 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 471DaVv1004279; Thu, 1 Aug 2024 18:41:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NnQhhummXQw0pjwgVy3C2cdxx2zT1ep2SSYSxtgDMfA=; b=E1vt6ekecymYDnS/ HIy6038MQ+YEXoOFFzRhREbBP4VBXo1Kdh5ZlDjUGr9uI2Cnm86KOOCx/JB/jWM9 Ju3NuzmgURaYsMW4kNxKLS5IUs25imdxgfsBQoymuifnSqXheWhMKGhkKQt1QJ4/ 7U1BH5CxfJUn9GrcyRY1mDaZmuLU+Z/xuWX/yPs6dSQVo1wLn4cyqxgIG0v51xMg 3BirKNosJUk6DBP6pUcdCh5PhdGf9GyiUy8NZOutb1Mo9c5kZUs2loyPRmoSa1+p 1xAT8CLhKxeOVOm6altYDO3jjTtddwoh4LT8WJDy6byX77a1vh0KsxbVinbELnRP pm+RcQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40q23309x9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Aug 2024 18:41:54 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 471IfrOK031992 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Aug 2024 18:41:53 GMT Received: from [10.110.73.139] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 1 Aug 2024 11:41:53 -0700 Message-ID: <2e1e24d5-b52e-401f-b533-e64584df1d50@quicinc.com> Date: Thu, 1 Aug 2024 11:41:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/9] Make SCMI transport as standalone drivers To: Cristian Marussi , , , CC: , , , , , , , , , , References: <20240730133318.1573765-1-cristian.marussi@arm.com> Content-Language: en-US From: Nikunj Kela In-Reply-To: <20240730133318.1573765-1-cristian.marussi@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 2Yt_Noce85_qF6ZhKWIdBXp3wIKwUFPh X-Proofpoint-ORIG-GUID: 2Yt_Noce85_qF6ZhKWIdBXp3wIKwUFPh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-01_17,2024-08-01_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 spamscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 clxscore=1011 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408010123 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_114208_385074_2C7B2010 X-CRM114-Status: GOOD ( 36.88 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/30/2024 6:33 AM, Cristian Marussi wrote: > Hi all, > > Till now the SCMI transport layer was being built embedded into in the core > SCMI stack. > > Some of these transports, despite being currently part of the main SCMI > module, are indeed also registered with different subsystems like optee or > virtio, and actively probed also by those: this led to a few awkward and > convoluted tricks to properly handle such interactions at boot time in the > SCMI stack. > > Moreover some partner expressed the desire to be able to fully modularize > the transports components. > > This series aim to make all such transports as standalone drivers that can > be optionally loaded as modules. > > In order to do this, at first some new mechanism is introduced to support > this new capability while maintaining, in parallel, the old legacy embedded > transports; then each transport, one by one, is transitioned to be a > standalone driver and finally the old legacy support for embedded transport > is removed. > > Patch [1/9] is a fix around the chan_free method for OPTEE transport; it is > really unrelated to this series, but included to avoid conflicts. > > Patch [2/9] is a mostly unrelated (but much needed) clean-up from Peng, > which I included in this series to avoid conflicts at merge. > > Patch [3/9] simply collects the existing datagram manipulation helpers in a > pair of function pointers structures, in preparation for later reworks. > > Patch [4/9] adds the bulk of the new logic to the core SCMI stack and then > each existing transport is transitioned to be a standalone driver in > patches 5,6,7,8 while shuffling around the compatibles. (no DT change is > needed of curse for backward compatibility) > While doing this I kept the module authorship in line with the main > author(S) as spitted out by git-blame. > > Finally patch [9/9] removes all the legacy dead code from the core SCMI > stack. > > No new symbol EXPORT has been added. > > The new transport drivers have been tested, as built-in and LKM, as > follows: > > - mailbox on JUNO > - virtio on emulation > - optee on QEMU/optee using Linaro setup > > Exercised using the regular SCMI drivers stack and the SCMI ACS suite, > testing commands, replies, delayed responses and notification. > > Multiple virtual SCMI instances support has been tested too. > > SMC has NOT been tested/exercised at run-time, only compile-tested. > (due to lack of hardware) Hi Christian, I have validated this series on Qualcomm SA8255p(to be upstreamed) Ride platform that uses Qualcomm SMC transport for SCMI. Thanks, -Nikunj > Note that in this new setup, all the probe deferral and retries between the > SCMI core stack and the transports has been removed, since no more needed. > > Moreover the new drivers have been tested also with a fully modularized > SCMI stack, i.e.: > > scmi-core.ko + scmi-module.ko + scmi_transport_*.ko [ + vendor modules ] > > Based on v6.11-rc1 > > Any feedback, and especially testing (:D) is welcome. > > Thanks, > Cristian > > --- > v2 --> v3 > - rebased on v6.11-rc1 > - fixed spacing in Kconfig > - fixed Copyrights all over > - fixed platform_driver_register callsite in OPTEE transport > - refactored DEFINE_SCMI_TRANSPORT_DRIVER() to: > + use alloc + add_data + add platform drivers methods so as to implictly > use a standard default device_release method. > + drop .remove method in favour of devres_add_action_or_reset > + use explicit parameter passing (no more concatenation) > - renamed scmi_transport_lookup() to scmi_transport_setup() > - use IOMEM_ERR_PTR to avoid sparse issues > > v1 --> v2 > - fixed setup_shmem_iomap to address also SMC needs (QC/nikunj) > (silencing also warnings by kernel test robot ) > - using __free OF cleanup.h magic in setup_shmme_iomap > - properly handle platform_driver_register() failures (Dan) > - fixed a few commit message style > - added a few missing static in scmi_desc > (addresses warnings by kernel test robot ) > > > Cristian Marussi (8): > firmware: arm_scmi: Fix double free in OPTEE transport > firmware: arm_scmi: Introduce packet handling helpers > firmware: arm_scmi: Add support for standalone transport drivers > firmware: arm_scmi: Make MBOX transport a standalone driver > firmware: arm_scmi: Make SMC transport a standalone driver > firmware: arm_scmi: Make OPTEE transport a standalone driver > firmware: arm_scmi: Make VirtIO transport a standalone driver > firmware: arm_scmi: Remove legacy transport-layer code > > Peng Fan (1): > firmware: arm_scmi: Introduce setup_shmem_iomap > > drivers/firmware/arm_scmi/Kconfig | 20 +- > drivers/firmware/arm_scmi/Makefile | 9 +- > drivers/firmware/arm_scmi/common.h | 184 +++++++++++++----- > drivers/firmware/arm_scmi/driver.c | 142 +++++--------- > drivers/firmware/arm_scmi/msg.c | 32 ++- > .../{mailbox.c => scmi_transport_mailbox.c} | 72 +++---- > .../{optee.c => scmi_transport_optee.c} | 130 ++++++------- > .../arm_scmi/{smc.c => scmi_transport_smc.c} | 57 +++--- > .../{virtio.c => scmi_transport_virtio.c} | 102 +++++----- > drivers/firmware/arm_scmi/shmem.c | 85 ++++++-- > 10 files changed, 477 insertions(+), 356 deletions(-) > rename drivers/firmware/arm_scmi/{mailbox.c => scmi_transport_mailbox.c} (86%) > rename drivers/firmware/arm_scmi/{optee.c => scmi_transport_optee.c} (89%) > rename drivers/firmware/arm_scmi/{smc.c => scmi_transport_smc.c} (87%) > rename drivers/firmware/arm_scmi/{virtio.c => scmi_transport_virtio.c} (94%) >