From nobody Sat Jun 13 18:10:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A14419995E for ; Wed, 6 May 2026 05:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043682; cv=none; b=KuFT5ZB/so5+JCQfajSDUdQvE/HASoBKNROlpIepWlLxEyn9zjmIYLDd8zdFkL2asnfFsmEwBz2NY5EK8HpuDa1YOv227iGbKN4wx8FSJmT9DhPh3dGckjbRSajJQSvzFHRmjcm5CnTQaU6zXTf+cM0+YSN5eBmBvlt1Kb+GQus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043682; c=relaxed/simple; bh=MC+gTHyuzbCFQ7MGbEHykQYQIXSqCBAEcgMZu5NOVWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SHCxROpa3XshSTS78/V+nDYx3AOwFWr6DK+KGGAcxhtuUAsukzGyI532J09tQOTs12DvNqegqQU0EN4KUNJEagYjl4RwYValDLIMNaaU10eyTFScRPUuz4E4KVsq6FdGv3JTyc0N/jNj9vElKTMBc6MxrU9SKG3dm6oXm62gEWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=SBcbtNRn; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hj+1DnfD; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="SBcbtNRn"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hj+1DnfD" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 645LYYjQ3475707 for ; Wed, 6 May 2026 05:01:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Xr0E73EkLGnOR6HR/oF+giSeEqh4Ur6LX6Iy0QgKyu4=; b=SBcbtNRnPvK7GScL vwnhQKLWJLHoK2ZUrF/4CEYomTfXSXl4S0HnXW+gMsSraHTFOXZPb0WosEFDfTG1 CglesOSI6i4veFk9NILLzyy0HbUgK3NsxY3KqlKjN1JX+6cLGrfQlewDGVkgISl3 vnFCIa+wsGshdhrHWojNR7YUqkn/xw3UBCatNb7dvkzDsxG6iRqUuEpQhP2LR1LA 7mY+wru+5YsYZA3w4Ph0Ge+v92aF4zBMz6XmFwWB3qvDdbIFoGWTHEOE2s3K9U3w zS6FfsG51pi2kaW774lb6qotng5vLxVcHdkL5sNRbiCxzM1CNnSyt+XNQPQUlb1L guo10A== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dyhsgu50h-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 06 May 2026 05:01:19 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-8353b042152so3496131b3a.3 for ; Tue, 05 May 2026 22:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778043678; x=1778648478; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xr0E73EkLGnOR6HR/oF+giSeEqh4Ur6LX6Iy0QgKyu4=; b=hj+1DnfDsTzWohsfK41Y9qmizYhbC5lDOn0ijead/79OuymG9SCSty8kqWIhOE1fvr mitFV96BwFAYg6UV2nKM3REBNNDpKchQqCqP4+LMZGEJ1nsUPUDdHEp7I6EBJ3Kinepa ZcloJKysILLFeYIScKbIrBmH7jF0gNyGgH33T02xJAgiOuNNu9ZMnr7e/WbyBrM27MTS gxCWgrR0+go/ZfjzqCM+mZzDYyIbu2MT2yEEDXGTCq+CgdW6EtFTkzXfL35IPWu0uEqy 1+3v6EwmHyYTcvhxNA8LWx8kCZGJMOOaPC6hrET+8njHxsIIUSRq5rDRhOcFYJo1ysI6 4RtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778043678; x=1778648478; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Xr0E73EkLGnOR6HR/oF+giSeEqh4Ur6LX6Iy0QgKyu4=; b=jvvmF5lmx57QOt6R0AF7FbMdbTNyW83UGKH4Dk/qTq/86B6gyhNWKeVZApx/KQ+HQK O9Hb+SB82mGnqu4ZnXZlFq+f18P+9ynVDlQetg2kizS0LM4fztKfFggW55DEVZjs9tBQ RCw5HZL7NBAEy+N+J+hoS8aOQRJhQzxxyLpReXV+2JrP+Rk/qfqog3u96asWTtmKBTzJ tTiaT19u+8NsJdYDr+ssW188sdnWraY73Lx4Kt2mCxIBKMCn3lhpIlsNVHDag02NJX+f bvcJ3qxtFlhBUEnrIPCwY5k6p+SrQ9lm6utfn+xDppUOptKgCtbjfiTWEN9S/EwhuUgY +/TQ== X-Gm-Message-State: AOJu0YyNgAg3wG+B3ZFOL/V0hMlcSBEdD7VijPEVG03SvhEkRdh8SMbz 1zLMSHRNLTJ/B5+t0MpMO/2cIS2lK6Fp87xvp/CEKTuKA+NLhwu+iLystQgVsybXX+Y990EJrDE 4FiMCu4dCXTeJOsuEatOiJNno9LvHkTRBEByV9QDvN+OlEgG3G+VdbtZO4lCJqw14BMAeh4PTKY s= X-Gm-Gg: AeBDiesLyeIy3b46iLYrTlY4cT819HCVrr3OSTBnmqaP/s1zTZAXC1exXiWLXJGhspR 2TrJt/sqZJocnCNlwhqhmf1MBTYz9FvB+4Pjd5X+f+sbMKllNhiC2RwASSxdqqt0wIL8IgFR2zD Qek7agTBUHOk9zNdmj0w8EJsA2a/T0JrPV1ElkstHv2PuF94aUCLTP9eLSjmHuQoi4+sL7V87SP Q7Gh7m7RHio/0nP0PX8M2yK4R3/qyxlsFCDsTvCyoCxxaGxCOoYvOO4KoXe1E1U7w7dErxrMyAr yVtcmyuHt8PrX8T3j+T30we0KP1is9z2S/S1+VC21FpKpfq1XKShc++66ViibB7+6pFuYHb57d1 oD7oF5GjhQqFxHudsy+K6kQSs2ySplGlxcNuV46whaVMqODeIWv85eRB/0jA= X-Received: by 2002:a05:6a00:1991:b0:82f:7b98:e499 with SMTP id d2e1a72fcca58-83a5d873ec9mr1647245b3a.31.1778043677979; Tue, 05 May 2026 22:01:17 -0700 (PDT) X-Received: by 2002:a05:6a00:1991:b0:82f:7b98:e499 with SMTP id d2e1a72fcca58-83a5d873ec9mr1647187b3a.31.1778043677074; Tue, 05 May 2026 22:01:17 -0700 (PDT) Received: from hu-mojha-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83967dbcfc0sm4891620b3a.42.2026.05.05.22.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 22:01:16 -0700 (PDT) From: Mukesh Ojha To: Bjorn Andersson , Konrad Dybcio , Mathieu Poirier Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, Mukesh Ojha Subject: [PATCH 1/5] remoteproc: Move resource table data structure to its own header Date: Wed, 6 May 2026 10:31:03 +0530 Message-ID: <20260506050107.1985033-2-mukesh.ojha@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> References: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: mPqUnFmRRXu-zZ_0Sw4OLuDjoOaw_hMP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA2MDA0NiBTYWx0ZWRfXxHNz8JZx6fd0 PeLVlhEIAlMavCU4C08jGaTyMCSbQoOkAUWBwglT40pqstVrMZ1BpSb+eQx2UgFZLgbiFzOCD6J Bn7dJYBSIriJH9Qw4zfSJs4xjT+5AWie2TaAgev42l++LdGoheM/C3sWOt22Yxj+TcxREwbMt1c HIoUgwrSFiSMDrGe7ma50LxITOuZHeC3IU6WdHjeT97Pt3UKyjYQ1AuMq/2pkmL3c0PWxM1fBI+ 0Ec3uP+yJY+CtY6VSzUCyc0YIKcIbLrkUmkRyEdXP2p3RlB6jMzqLzIJzFJyaUonLg9DTe+vxul lShNzdG7WlLvJ6ysXFxVAPQMsC8vCbb2rrD7CfLdJJxQe2COuV82NyfOzoUU25RPa+OC2Kl2mdt EKDg5BMAlf+pXSqMFrVQAS0YqUiaVbsRoF2OaJBAwfzHzCKISnyy0xXwfRb3yqOtkixN/5/p42g C3rPtresEwxjgY/CLSw== X-Authority-Analysis: v=2.4 cv=EPU2FVZC c=1 sm=1 tr=0 ts=69facb1f cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=hqicfOp3TDPPg1m-M2YA:9 a=Y6HKh-LrsuiIPCo2:21 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-GUID: mPqUnFmRRXu-zZ_0Sw4OLuDjoOaw_hMP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-05_02,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 impostorscore=0 clxscore=1015 bulkscore=0 phishscore=0 suspectscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605060046 The resource table data structure has traditionally been associated with the remoteproc framework, where the resource table is included as a section within the remote processor firmware binary. However, it is also possible to obtain the resource table through other means=E2=80=94such as f= rom a reserved memory region populated by the boot firmware, statically maintained driver data, or via a secure SMC call=E2=80=94when it is not emb= edded in the firmware. There are multiple Qualcomm remote processors (e.g., Venus, Iris, GPU, etc.) in the upstream kernel that do not use the remoteproc framework to manage their lifecycle for various reasons. When Linux is running at EL2, similar to the Qualcomm PAS driver (qcom_q6v5_pas.c), client drivers for subsystems like video and GPU may also want to use the resource table SMC call to retrieve and map resources before they are used by the remote processor. In such cases, the resource table data structure is no longer tightly coupled with the remoteproc headers. Client drivers that do not use the remoteproc framework should still be able to parse the resource table obtained through alternative means. Therefore, there is a need to decouple the resource table definitions from the remoteproc headers. Signed-off-by: Mukesh Ojha Reviewed-by: Mathieu Poirier --- include/linux/remoteproc.h | 269 +------------------------------- include/linux/rsc_table.h | 306 +++++++++++++++++++++++++++++++++++++ 2 files changed, 307 insertions(+), 268 deletions(-) create mode 100644 include/linux/rsc_table.h diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index b4795698d8c2..7c1546d48008 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -42,274 +42,7 @@ #include #include #include - -/** - * struct resource_table - firmware resource table header - * @ver: version number - * @num: number of resource entries - * @reserved: reserved (must be zero) - * @offset: array of offsets pointing at the various resource entries - * - * A resource table is essentially a list of system resources required - * by the remote processor. It may also include configuration entries. - * If needed, the remote processor firmware should contain this table - * as a dedicated ".resource_table" ELF section. - * - * Some resources entries are mere announcements, where the host is inform= ed - * of specific remoteproc configuration. Other entries require the host to - * do something (e.g. allocate a system resource). Sometimes a negotiation - * is expected, where the firmware requests a resource, and once allocated, - * the host should provide back its details (e.g. address of an allocated - * memory region). - * - * The header of the resource table, as expressed by this structure, - * contains a version number (should we need to change this format in the - * future), the number of available resource entries, and their offsets - * in the table. - * - * Immediately following this header are the resource entries themselves, - * each of which begins with a resource entry header (as described below). - */ -struct resource_table { - u32 ver; - u32 num; - u32 reserved[2]; - u32 offset[]; -} __packed; - -/** - * struct fw_rsc_hdr - firmware resource entry header - * @type: resource type - * @data: resource data - * - * Every resource entry begins with a 'struct fw_rsc_hdr' header providing - * its @type. The content of the entry itself will immediately follow - * this header, and it should be parsed according to the resource type. - */ -struct fw_rsc_hdr { - u32 type; - u8 data[]; -} __packed; - -/** - * enum fw_resource_type - types of resource entries - * - * @RSC_CARVEOUT: request for allocation of a physically contiguous - * memory region. - * @RSC_DEVMEM: request to iommu_map a memory-based peripheral. - * @RSC_TRACE: announces the availability of a trace buffer into which - * the remote processor will be writing logs. - * @RSC_VDEV: declare support for a virtio device, and serve as its - * virtio header. - * @RSC_LAST: just keep this one at the end of standard resources - * @RSC_VENDOR_START: start of the vendor specific resource types range - * @RSC_VENDOR_END: end of the vendor specific resource types range - * - * For more details regarding a specific resource type, please see its - * dedicated structure below. - * - * Please note that these values are used as indices to the rproc_handle_r= sc - * lookup table, so please keep them sane. Moreover, @RSC_LAST is used to - * check the validity of an index before the lookup table is accessed, so - * please update it as needed. - */ -enum fw_resource_type { - RSC_CARVEOUT =3D 0, - RSC_DEVMEM =3D 1, - RSC_TRACE =3D 2, - RSC_VDEV =3D 3, - RSC_LAST =3D 4, - RSC_VENDOR_START =3D 128, - RSC_VENDOR_END =3D 512, -}; - -#define FW_RSC_ADDR_ANY (-1) - -/** - * struct fw_rsc_carveout - physically contiguous memory request - * @da: device address - * @pa: physical address - * @len: length (in bytes) - * @flags: iommu protection flags - * @reserved: reserved (must be zero) - * @name: human-readable name of the requested memory region - * - * This resource entry requests the host to allocate a physically contiguo= us - * memory region. - * - * These request entries should precede other firmware resource entries, - * as other entries might request placing other data objects inside - * these memory regions (e.g. data/code segments, trace resource entries, = ...). - * - * Allocating memory this way helps utilizing the reserved physical memory - * (e.g. CMA) more efficiently, and also minimizes the number of TLB entri= es - * needed to map it (in case @rproc is using an IOMMU). Reducing the TLB - * pressure is important; it may have a substantial impact on performance. - * - * If the firmware is compiled with static addresses, then @da should spec= ify - * the expected device address of this memory region. If @da is set to - * FW_RSC_ADDR_ANY, then the host will dynamically allocate it, and then - * overwrite @da with the dynamically allocated address. - * - * We will always use @da to negotiate the device addresses, even if it - * isn't using an iommu. In that case, though, it will obviously contain - * physical addresses. - * - * Some remote processors needs to know the allocated physical address - * even if they do use an iommu. This is needed, e.g., if they control - * hardware accelerators which access the physical memory directly (this - * is the case with OMAP4 for instance). In that case, the host will - * overwrite @pa with the dynamically allocated physical address. - * Generally we don't want to expose physical addresses if we don't have to - * (remote processors are generally _not_ trusted), so we might want to - * change this to happen _only_ when explicitly required by the hardware. - * - * @flags is used to provide IOMMU protection flags, and @name should - * (optionally) contain a human readable name of this carveout region - * (mainly for debugging purposes). - */ -struct fw_rsc_carveout { - u32 da; - u32 pa; - u32 len; - u32 flags; - u32 reserved; - u8 name[32]; -} __packed; - -/** - * struct fw_rsc_devmem - iommu mapping request - * @da: device address - * @pa: physical address - * @len: length (in bytes) - * @flags: iommu protection flags - * @reserved: reserved (must be zero) - * @name: human-readable name of the requested region to be mapped - * - * This resource entry requests the host to iommu map a physically contigu= ous - * memory region. This is needed in case the remote processor requires - * access to certain memory-based peripherals; _never_ use it to access - * regular memory. - * - * This is obviously only needed if the remote processor is accessing memo= ry - * via an iommu. - * - * @da should specify the required device address, @pa should specify - * the physical address we want to map, @len should specify the size of - * the mapping and @flags is the IOMMU protection flags. As always, @name = may - * (optionally) contain a human readable name of this mapping (mainly for - * debugging purposes). - * - * Note: at this point we just "trust" those devmem entries to contain val= id - * physical addresses, but this isn't safe and will be changed: eventually= we - * want remoteproc implementations to provide us ranges of physical addres= ses - * the firmware is allowed to request, and not allow firmwares to request - * access to physical addresses that are outside those ranges. - */ -struct fw_rsc_devmem { - u32 da; - u32 pa; - u32 len; - u32 flags; - u32 reserved; - u8 name[32]; -} __packed; - -/** - * struct fw_rsc_trace - trace buffer declaration - * @da: device address - * @len: length (in bytes) - * @reserved: reserved (must be zero) - * @name: human-readable name of the trace buffer - * - * This resource entry provides the host information about a trace buffer - * into which the remote processor will write log messages. - * - * @da specifies the device address of the buffer, @len specifies - * its size, and @name may contain a human readable name of the trace buff= er. - * - * After booting the remote processor, the trace buffers are exposed to the - * user via debugfs entries (called trace0, trace1, etc..). - */ -struct fw_rsc_trace { - u32 da; - u32 len; - u32 reserved; - u8 name[32]; -} __packed; - -/** - * struct fw_rsc_vdev_vring - vring descriptor entry - * @da: device address - * @align: the alignment between the consumer and producer parts of the vr= ing - * @num: num of buffers supported by this vring (must be power of two) - * @notifyid: a unique rproc-wide notify index for this vring. This notify - * index is used when kicking a remote processor, to let it know that this - * vring is triggered. - * @pa: physical address - * - * This descriptor is not a resource entry by itself; it is part of the - * vdev resource type (see below). - * - * Note that @da should either contain the device address where - * the remote processor is expecting the vring, or indicate that - * dynamically allocation of the vring's device address is supported. - */ -struct fw_rsc_vdev_vring { - u32 da; - u32 align; - u32 num; - u32 notifyid; - u32 pa; -} __packed; - -/** - * struct fw_rsc_vdev - virtio device header - * @id: virtio device id (as in virtio_ids.h) - * @notifyid: a unique rproc-wide notify index for this vdev. This notify - * index is used when kicking a remote processor, to let it know that the - * status/features of this vdev have changes. - * @dfeatures: specifies the virtio device features supported by the firmw= are - * @gfeatures: a place holder used by the host to write back the - * negotiated features that are supported by both sides. - * @config_len: the size of the virtio config space of this vdev. The conf= ig - * space lies in the resource table immediate after this vdev header. - * @status: a place holder where the host will indicate its virtio progres= s. - * @num_of_vrings: indicates how many vrings are described in this vdev he= ader - * @reserved: reserved (must be zero) - * @vring: an array of @num_of_vrings entries of 'struct fw_rsc_vdev_vring= '. - * - * This resource is a virtio device header: it provides information about - * the vdev, and is then used by the host and its peer remote processors - * to negotiate and share certain virtio properties. - * - * By providing this resource entry, the firmware essentially asks remotep= roc - * to statically allocate a vdev upon registration of the rproc (dynamic v= dev - * allocation is not yet supported). - * - * Note: - * 1. unlike virtualization systems, the term 'host' here means - * the Linux side which is running remoteproc to control the remote - * processors. We use the name 'gfeatures' to comply with virtio's term= s, - * though there isn't really any virtualized guest OS here: it's the ho= st - * which is responsible for negotiating the final features. - * Yeah, it's a bit confusing. - * - * 2. immediately following this structure is the virtio config space for - * this vdev (which is specific to the vdev; for more info, read the vi= rtio - * spec). The size of the config space is specified by @config_len. - */ -struct fw_rsc_vdev { - u32 id; - u32 notifyid; - u32 dfeatures; - u32 gfeatures; - u32 config_len; - u8 status; - u8 num_of_vrings; - u8 reserved[2]; - struct fw_rsc_vdev_vring vring[]; -} __packed; +#include =20 struct rproc; =20 diff --git a/include/linux/rsc_table.h b/include/linux/rsc_table.h new file mode 100644 index 000000000000..c32c8b6cd2a7 --- /dev/null +++ b/include/linux/rsc_table.h @@ -0,0 +1,306 @@ +/* + * Resource table and its types data structure + * + * Copyright(c) 2011 Texas Instruments, Inc. + * Copyright(c) 2011 Google, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Texas Instruments nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RSC_TABLE_H +#define RSC_TABLE_H + +/** + * struct resource_table - firmware resource table header + * @ver: version number + * @num: number of resource entries + * @reserved: reserved (must be zero) + * @offset: array of offsets pointing at the various resource entries + * + * A resource table is essentially a list of system resources required + * by the remote processor. It may also include configuration entries. + * If needed, the remote processor firmware should contain this table + * as a dedicated ".resource_table" ELF section. + * + * Some resources entries are mere announcements, where the host is inform= ed + * of specific remoteproc configuration. Other entries require the host to + * do something (e.g. allocate a system resource). Sometimes a negotiation + * is expected, where the firmware requests a resource, and once allocated, + * the host should provide back its details (e.g. address of an allocated + * memory region). + * + * The header of the resource table, as expressed by this structure, + * contains a version number (should we need to change this format in the + * future), the number of available resource entries, and their offsets + * in the table. + * + * Immediately following this header are the resource entries themselves, + * each of which begins with a resource entry header (as described below). + */ +struct resource_table { + u32 ver; + u32 num; + u32 reserved[2]; + u32 offset[]; +} __packed; + +/** + * struct fw_rsc_hdr - firmware resource entry header + * @type: resource type + * @data: resource data + * + * Every resource entry begins with a 'struct fw_rsc_hdr' header providing + * its @type. The content of the entry itself will immediately follow + * this header, and it should be parsed according to the resource type. + */ +struct fw_rsc_hdr { + u32 type; + u8 data[]; +} __packed; + +/** + * enum fw_resource_type - types of resource entries + * + * @RSC_CARVEOUT: request for allocation of a physically contiguous + * memory region. + * @RSC_DEVMEM: request to iommu_map a memory-based peripheral. + * @RSC_TRACE: announces the availability of a trace buffer into which + * the remote processor will be writing logs. + * @RSC_VDEV: declare support for a virtio device, and serve as its + * virtio header. + * @RSC_LAST: just keep this one at the end of standard resources + * @RSC_VENDOR_START: start of the vendor specific resource types range + * @RSC_VENDOR_END: end of the vendor specific resource types range + * + * For more details regarding a specific resource type, please see its + * dedicated structure below. + * + * Please note that these values are used as indices to the rproc_handle_r= sc + * lookup table, so please keep them sane. Moreover, @RSC_LAST is used to + * check the validity of an index before the lookup table is accessed, so + * please update it as needed. + */ +enum fw_resource_type { + RSC_CARVEOUT =3D 0, + RSC_DEVMEM =3D 1, + RSC_TRACE =3D 2, + RSC_VDEV =3D 3, + RSC_LAST =3D 4, + RSC_VENDOR_START =3D 128, + RSC_VENDOR_END =3D 512, +}; + +#define FW_RSC_ADDR_ANY (-1) + +/** + * struct fw_rsc_carveout - physically contiguous memory request + * @da: device address + * @pa: physical address + * @len: length (in bytes) + * @flags: iommu protection flags + * @reserved: reserved (must be zero) + * @name: human-readable name of the requested memory region + * + * This resource entry requests the host to allocate a physically contiguo= us + * memory region. + * + * These request entries should precede other firmware resource entries, + * as other entries might request placing other data objects inside + * these memory regions (e.g. data/code segments, trace resource entries, = ...). + * + * Allocating memory this way helps utilizing the reserved physical memory + * (e.g. CMA) more efficiently, and also minimizes the number of TLB entri= es + * needed to map it (in case @rproc is using an IOMMU). Reducing the TLB + * pressure is important; it may have a substantial impact on performance. + * + * If the firmware is compiled with static addresses, then @da should spec= ify + * the expected device address of this memory region. If @da is set to + * FW_RSC_ADDR_ANY, then the host will dynamically allocate it, and then + * overwrite @da with the dynamically allocated address. + * + * We will always use @da to negotiate the device addresses, even if it + * isn't using an iommu. In that case, though, it will obviously contain + * physical addresses. + * + * Some remote processors needs to know the allocated physical address + * even if they do use an iommu. This is needed, e.g., if they control + * hardware accelerators which access the physical memory directly (this + * is the case with OMAP4 for instance). In that case, the host will + * overwrite @pa with the dynamically allocated physical address. + * Generally we don't want to expose physical addresses if we don't have to + * (remote processors are generally _not_ trusted), so we might want to + * change this to happen _only_ when explicitly required by the hardware. + * + * @flags is used to provide IOMMU protection flags, and @name should + * (optionally) contain a human readable name of this carveout region + * (mainly for debugging purposes). + */ +struct fw_rsc_carveout { + u32 da; + u32 pa; + u32 len; + u32 flags; + u32 reserved; + u8 name[32]; +} __packed; + +/** + * struct fw_rsc_devmem - iommu mapping request + * @da: device address + * @pa: physical address + * @len: length (in bytes) + * @flags: iommu protection flags + * @reserved: reserved (must be zero) + * @name: human-readable name of the requested region to be mapped + * + * This resource entry requests the host to iommu map a physically contigu= ous + * memory region. This is needed in case the remote processor requires + * access to certain memory-based peripherals; _never_ use it to access + * regular memory. + * + * This is obviously only needed if the remote processor is accessing memo= ry + * via an iommu. + * + * @da should specify the required device address, @pa should specify + * the physical address we want to map, @len should specify the size of + * the mapping and @flags is the IOMMU protection flags. As always, @name = may + * (optionally) contain a human readable name of this mapping (mainly for + * debugging purposes). + * + * Note: at this point we just "trust" those devmem entries to contain val= id + * physical addresses, but this isn't safe and will be changed: eventually= we + * want remoteproc implementations to provide us ranges of physical addres= ses + * the firmware is allowed to request, and not allow firmwares to request + * access to physical addresses that are outside those ranges. + */ +struct fw_rsc_devmem { + u32 da; + u32 pa; + u32 len; + u32 flags; + u32 reserved; + u8 name[32]; +} __packed; + +/** + * struct fw_rsc_trace - trace buffer declaration + * @da: device address + * @len: length (in bytes) + * @reserved: reserved (must be zero) + * @name: human-readable name of the trace buffer + * + * This resource entry provides the host information about a trace buffer + * into which the remote processor will write log messages. + * + * @da specifies the device address of the buffer, @len specifies + * its size, and @name may contain a human readable name of the trace buff= er. + * + * After booting the remote processor, the trace buffers are exposed to the + * user via debugfs entries (called trace0, trace1, etc..). + */ +struct fw_rsc_trace { + u32 da; + u32 len; + u32 reserved; + u8 name[32]; +} __packed; + +/** + * struct fw_rsc_vdev_vring - vring descriptor entry + * @da: device address + * @align: the alignment between the consumer and producer parts of the vr= ing + * @num: num of buffers supported by this vring (must be power of two) + * @notifyid: a unique rproc-wide notify index for this vring. This notify + * index is used when kicking a remote processor, to let it know that this + * vring is triggered. + * @pa: physical address + * + * This descriptor is not a resource entry by itself; it is part of the + * vdev resource type (see below). + * + * Note that @da should either contain the device address where + * the remote processor is expecting the vring, or indicate that + * dynamically allocation of the vring's device address is supported. + */ +struct fw_rsc_vdev_vring { + u32 da; + u32 align; + u32 num; + u32 notifyid; + u32 pa; +} __packed; + +/** + * struct fw_rsc_vdev - virtio device header + * @id: virtio device id (as in virtio_ids.h) + * @notifyid: a unique rproc-wide notify index for this vdev. This notify + * index is used when kicking a remote processor, to let it know that the + * status/features of this vdev have changes. + * @dfeatures: specifies the virtio device features supported by the firmw= are + * @gfeatures: a place holder used by the host to write back the + * negotiated features that are supported by both sides. + * @config_len: the size of the virtio config space of this vdev. The conf= ig + * space lies in the resource table immediate after this vdev header. + * @status: a place holder where the host will indicate its virtio progres= s. + * @num_of_vrings: indicates how many vrings are described in this vdev he= ader + * @reserved: reserved (must be zero) + * @vring: an array of @num_of_vrings entries of 'struct fw_rsc_vdev_vring= '. + * + * This resource is a virtio device header: it provides information about + * the vdev, and is then used by the host and its peer remote processors + * to negotiate and share certain virtio properties. + * + * By providing this resource entry, the firmware essentially asks remotep= roc + * to statically allocate a vdev upon registration of the rproc (dynamic v= dev + * allocation is not yet supported). + * + * Note: + * 1. unlike virtualization systems, the term 'host' here means + * the Linux side which is running remoteproc to control the remote + * processors. We use the name 'gfeatures' to comply with virtio's term= s, + * though there isn't really any virtualized guest OS here: it's the ho= st + * which is responsible for negotiating the final features. + * Yeah, it's a bit confusing. + * + * 2. immediately following this structure is the virtio config space for + * this vdev (which is specific to the vdev; for more info, read the vi= rtio + * spec). The size of the config space is specified by @config_len. + */ +struct fw_rsc_vdev { + u32 id; + u32 notifyid; + u32 dfeatures; + u32 gfeatures; + u32 config_len; + u8 status; + u8 num_of_vrings; + u8 reserved[2]; + struct fw_rsc_vdev_vring vring[]; +} __packed; + +#endif /* RSC_TABLE_H */ --=20 2.53.0 From nobody Sat Jun 13 18:10:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44C4A285050 for ; Wed, 6 May 2026 05:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043683; cv=none; b=bLj29gfxRcLKCBjgkwiuQOb2E4AzfM/Hucp6fukq003xWM+I1Wv8nENR/tfZiVBuZqBoDCs0nqhMLSqZP1uOKjdMqeBAduKE2uWXRJ4PlZew3EuLqcvLfP6sMtPAzi9DslaZbKezLmroFd4g0ppkzvBT5mrlh56xyHiNQsMjC4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043683; c=relaxed/simple; bh=WHvjyHgD1TItrJGH0FkNazHavYPr4xyCEpQSkCRX/Xc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NM1GAkdFsbj7qlUO4gZtKtmR2uH4+Jo5OINk6+Zvjn7tPg+rwi7qmGRwbU3asMurNdqmV6l4/+jutD8VpqxbqZ9rDMNzWYFZG2IWmEHShIq3f28elWDXLbevEuEIqdUJlqgFvYKMOV0lX3SqNR3uBRKjMOUieDfFK+iFxfZPpwY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GsFyOblt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gSc2K4fz; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GsFyOblt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gSc2K4fz" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6463RJ602187468 for ; Wed, 6 May 2026 05:01:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=PiXhBeYotSE 4gHZOix5lHX+AUX2pHHBVag0+f6bRxcY=; b=GsFyObltNzTdzSvqk7fK4LUOjE6 G/OF8YhcbjY1YShm8FKH/dir5FZET4cED4DhIa25xGyFUi3rnRQTX2CHKuAVhLZ0 fuKZEvD3qCRXPUsa1pGeOgFWTKkAN7JnIccHmshXIt7mdsi0k/VrxBmW/33va9nl VB2xw7bXuBe4AiNTBadCAK+Ewgkq1xiIHB/gYCsIOP/X5cPlAWVsxwwIY5OLKtmu r/xYSEmM+kjWBxW6nJ8oCVARuBib1LqkYjuywlmGd4Zc1eCp5mx6OXxizVCZALb8 Qx3R6qOPKzDN9bd56f+kYaW0rkIY+fAQCZZ8xHs8oNE9RP30lGEkVPlxaqw== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dygce3gaq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 06 May 2026 05:01:21 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-c8247b55775so65292a12.3 for ; Tue, 05 May 2026 22:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778043681; x=1778648481; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PiXhBeYotSE4gHZOix5lHX+AUX2pHHBVag0+f6bRxcY=; b=gSc2K4fz9ehKaYs3HVq9M0oeoeSxrgV2vxKrldNoH3/SWG0Hg6pP8NOggQmGu9bXkH 1aExhVZv4MBch9/r/a3BdmqB2ZW+4+EWxCcVYQYwG8R+wIPDAFF5DURTcYSTVPmC9K2d 9r7ENCxgw9uKwC1A74uo0xhNFH1fFfF8nrYFHR1eEsi4GdpCwhoWlxf1g1RRvWJ3DUTP VkZUrZRx+grUIKZX9hlam/Y9fFodzmmvGfDwhexE6FNYh9LiVSxnswH+c9lozq68NT/n tKRLu/oN5/4p90r4KDQ/e6CWSP61zw81H/46CIeMZY1fyGwc8POTdQJm7lKK8dzPHxW5 ajUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778043681; x=1778648481; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PiXhBeYotSE4gHZOix5lHX+AUX2pHHBVag0+f6bRxcY=; b=Okzx0xsXyVv484BJuh2/N7RDiHZZvDt1tkIPprT/9zcIdIO0fIbz+n1thGEsFvHx7A lH9BI+M1yvxEpzzSGpuG08lCF0yhyrNt0YTxp/kHjWSzfPYRux3bvoMMF574SGJCn9/V L5ZkmtGwvvCKH6Agk/kY4YTFvyygVRrlyH6iv/72mLjqSx3fWCzponzY5cd+ToNSBdxg N7ww51wtwozT1y6Ucvs3dfgkNqsE5sJU/Ca5fowC2R4yOdcqiCmWQxX+KYOTmBAq7okC xeDhsqtyfIZAyfUcm/NzxOJKb8fukDz+86rzlZqqRLsRQHWGtaBR8K6HWx7bcaPoZ44t gM1Q== X-Gm-Message-State: AOJu0Yzwplg8jKSIFE2J4lJ09dgxQoTpE7jL8e43ZUVgAiNN9QWNnIg9 DeyKMg/kwKsNF/D/EgAPGxVsZziYpSU+O0QV9qENU1D2CbJ2iHdLMfy/J1yjegprNg+xQ2Sck2n XFgI1SKG4484glxjr8QqViZMGaNum7UZjKtDVgX3TRUoiNYvMZcckl0I4oDg5whTBt/L3/6HYJ9 E= X-Gm-Gg: AeBDieuaVk206YGgP2JFNkmQxySBQpobgKC9hI/L7+M949Zx3xBu7/O83VjZBCAgaCj Xk3gjYw49ocdasiBforwNwzbX0ORmPa9btju4snzKO1aOZDlAsGTVJ4abVnOidarmLdEG5Yahhx jkzp4nN+u9VZ64Gs5BjwZkeX2t3AHjRQke7WmWW61Nf49AUzN88X+6htA+YcBYuuFeYUKriHmN6 frS+KrYyT60IqQz9yKDMhNaKSusGo02VcVAGAqzovMl9VG6QkyQpMbQnG2r2v2JrH/lFNnosixg jWJek2skNVBOsPxdlox2KKTNrw1KpUhH+bqMj1Wga3fDOVMX1vEmd/ViVYfITqWLbohVYBYoAQc L2kr5BGQOkicZhShNuJY+JEBGy4jcRBiCnAjV1C49FbBqH3kyva2Itm7wguc= X-Received: by 2002:a05:6a00:a02:b0:82f:5051:f024 with SMTP id d2e1a72fcca58-83a5df484a2mr1768441b3a.27.1778043680484; Tue, 05 May 2026 22:01:20 -0700 (PDT) X-Received: by 2002:a05:6a00:a02:b0:82f:5051:f024 with SMTP id d2e1a72fcca58-83a5df484a2mr1768404b3a.27.1778043679849; Tue, 05 May 2026 22:01:19 -0700 (PDT) Received: from hu-mojha-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83967dbcfc0sm4891620b3a.42.2026.05.05.22.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 22:01:19 -0700 (PDT) From: Mukesh Ojha To: Bjorn Andersson , Konrad Dybcio , Mathieu Poirier Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, Mukesh Ojha Subject: [PATCH 2/5] remoteproc: use rsc_table_for_each_entry() in rproc_handle_resources() Date: Wed, 6 May 2026 10:31:04 +0530 Message-ID: <20260506050107.1985033-3-mukesh.ojha@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> References: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA2MDA0NiBTYWx0ZWRfX1WD3Kio/q2Zi GCQkfzvgx23tqsC7I0N3505vw7zzxofaDdnVocnedYnEn4Gpl2E6rZPsXap7w4heWSFsC9r2x3b pxoG1JdktoVJtqgB0oeZLE1d1nvbMRb17Wsc6oBAP9GrBvrF2ZX9HvmdcvjNqnmqya/3pyxa9d5 eqCKCH5mgjO6MECMknj+RM4aoyJ6NrPiFkPb5587eiM50iMApRHL8C8nlHU+MpSDjUFc7L/OnRO EgbMIOkvFf91jC8/vR7xkbSeu6GIZMEsdjk/gV7m9wZkKNRb6fwxmuQgnJoarvPlYYUVjSXUUpC /R7j+/bAdPsm2dY/0xRw1H1vXhNLnBWT6olT0yc10ht2kh456PqgeHZgOvjKF0EfRDx/tmPnfOK x7L74nbr10wycgL0n1hLFDO7WkKPAQAbIB0O52AxOGzhQtum3ecVixOjR5sg4Si3RdCu5N+FAlf EfYZosIz2aMqn2IlMGQ== X-Proofpoint-GUID: altZhB6Mja6yR1nYUU183MX5KKQ6T4Dc X-Proofpoint-ORIG-GUID: altZhB6Mja6yR1nYUU183MX5KKQ6T4Dc X-Authority-Analysis: v=2.4 cv=b6KCJNGx c=1 sm=1 tr=0 ts=69facb21 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=xRbkGY9h9Oi8AtJRHVsA:9 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-05_02,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605060046 Content-Type: text/plain; charset="utf-8" Replace the open-coded resource table iteration loop in rproc_handle_resources() with the rsc_table_for_each_entry() helper. The remoteproc-specific dispatch logic (vendor resource handling via rproc_handle_rsc(), RSC_LAST bounds check, handler table lookup) is moved into a local callback rproc_handle_rsc_entry(), keeping the iteration mechanics in one canonical place. The callback receives the payload offset within the table so that handlers which write back into the resource table (e.g. rproc_handle_carveout() recording a dynamically allocated address via rsc_offset) continue to work correctly. No functional change. Signed-off-by: Mukesh Ojha Reviewed-by: Mathieu Poirier --- drivers/remoteproc/remoteproc_core.c | 81 +++++++++++++--------------- include/linux/rsc_table.h | 53 ++++++++++++++++++ 2 files changed, 91 insertions(+), 43 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remo= teproc_core.c index b087ed21858a..f003be006b1b 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1011,60 +1011,55 @@ static rproc_handle_resource_t rproc_loading_handle= rs[RSC_LAST] =3D { [RSC_VDEV] =3D rproc_handle_vdev, }; =20 -/* handle firmware resource entries before booting the remote processor */ -static int rproc_handle_resources(struct rproc *rproc, - rproc_handle_resource_t handlers[RSC_LAST]) +struct rproc_rsc_cb_data { + struct rproc *rproc; + rproc_handle_resource_t *handlers; +}; + +static int rproc_handle_rsc_entry(u32 type, void *rsc, int offset, + int avail, void *data) { + struct rproc_rsc_cb_data *d =3D data; + struct rproc *rproc =3D d->rproc; struct device *dev =3D &rproc->dev; rproc_handle_resource_t handler; - int ret =3D 0, i; - - if (!rproc->table_ptr) - return 0; + int ret; =20 - for (i =3D 0; i < rproc->table_ptr->num; i++) { - int offset =3D rproc->table_ptr->offset[i]; - struct fw_rsc_hdr *hdr =3D (void *)rproc->table_ptr + offset; - int avail =3D rproc->table_sz - offset - sizeof(*hdr); - void *rsc =3D (void *)hdr + sizeof(*hdr); + dev_dbg(dev, "rsc: type %d\n", type); =20 - /* make sure table isn't truncated */ - if (avail < 0) { - dev_err(dev, "rsc table is truncated\n"); - return -EINVAL; - } - - dev_dbg(dev, "rsc: type %d\n", hdr->type); + if (type >=3D RSC_VENDOR_START && type <=3D RSC_VENDOR_END) { + ret =3D rproc_handle_rsc(rproc, type, rsc, offset, avail); + if (ret =3D=3D RSC_HANDLED) + return 0; + if (ret < 0) + return ret; + dev_warn(dev, "unsupported vendor resource %d\n", type); + return 0; + } =20 - if (hdr->type >=3D RSC_VENDOR_START && - hdr->type <=3D RSC_VENDOR_END) { - ret =3D rproc_handle_rsc(rproc, hdr->type, rsc, - offset + sizeof(*hdr), avail); - if (ret =3D=3D RSC_HANDLED) - continue; - else if (ret < 0) - break; + if (type >=3D RSC_LAST) { + dev_warn(dev, "unsupported resource %d\n", type); + return 0; + } =20 - dev_warn(dev, "unsupported vendor resource %d\n", - hdr->type); - continue; - } + handler =3D d->handlers[type]; + if (!handler) + return 0; =20 - if (hdr->type >=3D RSC_LAST) { - dev_warn(dev, "unsupported resource %d\n", hdr->type); - continue; - } + return handler(rproc, rsc, offset, avail); +} =20 - handler =3D handlers[hdr->type]; - if (!handler) - continue; +/* handle firmware resource entries before booting the remote processor */ +static int rproc_handle_resources(struct rproc *rproc, + rproc_handle_resource_t handlers[RSC_LAST]) +{ + struct rproc_rsc_cb_data d =3D { .rproc =3D rproc, .handlers =3D handlers= }; =20 - ret =3D handler(rproc, rsc, offset + sizeof(*hdr), avail); - if (ret) - break; - } + if (!rproc->table_ptr) + return 0; =20 - return ret; + return rsc_table_for_each_entry(rproc->table_ptr, rproc->table_sz, + &rproc->dev, rproc_handle_rsc_entry, &d); } =20 static int rproc_prepare_subdevices(struct rproc *rproc) diff --git a/include/linux/rsc_table.h b/include/linux/rsc_table.h index c32c8b6cd2a7..c6d6d553d8f1 100644 --- a/include/linux/rsc_table.h +++ b/include/linux/rsc_table.h @@ -303,4 +303,57 @@ struct fw_rsc_vdev { struct fw_rsc_vdev_vring vring[]; } __packed; =20 +/** + * rsc_table_for_each_entry() - iterate over all entries in a resource tab= le + * @table: pointer to the resource table + * @table_sz: total size of the table buffer in bytes + * @dev: device used for error logging + * @cb: callback invoked for each entry: + * @type - value from enum fw_resource_type + * @rsc - pointer to the entry payload (past struct fw_rsc= _hdr) + * @offset - byte offset of the payload within the table; cal= lers + * that write back into the table (e.g. to record a + * dynamically allocated address) use this to locat= e the + * entry for later update + * @avail - bytes available in the payload + * @data - caller-supplied private pointer + * Return 0 to continue iteration, non-zero to stop. + * @data: private pointer forwarded to @cb on every call + * + * Iterates over every resource entry in @table, performing the standard + * truncation check, and invokes @cb for each one. Iteration stops on the + * first non-zero return from @cb or on a malformed table. + * + * Returns 0 after a complete iteration, -EINVAL if the table is truncated, + * or the first non-zero value returned by @cb. + */ +static inline int rsc_table_for_each_entry(struct resource_table *table, + size_t table_sz, + struct device *dev, + int (*cb)(u32 type, void *rsc, + int offset, int avail, + void *data), + void *data) { + int i, ret; + + for (i =3D 0; i < table->num; i++) { + int offset =3D table->offset[i]; + struct fw_rsc_hdr *hdr =3D (void *)table + offset; + int avail =3D table_sz - offset - sizeof(*hdr); + int rsc_offset =3D offset + sizeof(*hdr); + void *rsc =3D (void *)hdr + sizeof(*hdr); + + if (avail < 0) { + dev_err(dev, "rsc table is truncated\n"); + return -EINVAL; + } + + ret =3D cb(hdr->type, rsc, rsc_offset, avail, data); + if (ret) + return ret; + } + + return 0; +} + #endif /* RSC_TABLE_H */ --=20 2.53.0 From nobody Sat Jun 13 18:10:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 082ED2F1FC9 for ; Wed, 6 May 2026 05:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043686; cv=none; b=t6vsJGlGRkKYv/CIW6ZZpL2pZCuQvCKx1rjI1oKSdJuw/0dEiH3zcMNcJXWlnh5ew35JgPkFplG1RIEdu4IZoFsutV45ZxXRfUkTY4Q4hm0l+bCvoV9GNlZ9aSe5ObbuoA1yTqdLdznGiDtIb6Alg71eOyNHLa3dtMwavWLNvo0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043686; c=relaxed/simple; bh=5zpQdSqV6VmTxNYAMSNsJhL31D8kbXtfkRuD/nTWxHw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hEBr0xZXiFC8IjwFaSapiBIZIUa0HnXWAFE0eWZTyClJuZEqvP/pIeS6iNcS3OzxcL0Xf9NoXuksAgEX/AfCF8/wT9qGcrjxnxar8tNELJP0E2VM/rPMD0VJ4HO/Ve/3YGd8EAjM4R9piL1ejYH7kzfaR15R1w+/lJr84Ye7hkc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=biMxOZ/v; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YsO+ZSvq; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="biMxOZ/v"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YsO+ZSvq" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6463fDQJ2186945 for ; Wed, 6 May 2026 05:01:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=LKwytmYNAHb suFxFyJ0lrz9c5UpNtf6ZMxghB57imjM=; b=biMxOZ/vCko+giNiOW9Y1dhfePb 3nxs7atEexqNgozB0WdXo1LNZMDv0q6Uc5nL98KEQ0XAp759O7AM7ZC+6F2Mryij Pn2sdbfQCwmxCRaC00pl1Tmr+0WB7vJmArDcBcVZI+Ue7Pfa812iwC4Sh6jOh+4H IC05yumKH8RJHWg6j7jGhNrq+n8WbNu6hLJnVxJjbnejw9WnEpSnbzZ71L8BDgBW 90D+nRAh03rJaDzbzt9zN2zDmlEBhn9DSctCpQ40f7yJst9ceu8RIgDxBPWveMGr z/dVW/HiY7QTgGdg/nNAvMMMebdUku/8hiqzctBZUQ+9yDPWwYGttr5SltQ== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dygce3gaw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 06 May 2026 05:01:24 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-82f85179263so6832002b3a.3 for ; Tue, 05 May 2026 22:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778043684; x=1778648484; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LKwytmYNAHbsuFxFyJ0lrz9c5UpNtf6ZMxghB57imjM=; b=YsO+ZSvqW45LDkFWAUZ6RbY+228mgFJKgd5KA5VAJPyhqPrl4imclCCZqbukFQSRmh vYpe9Se1ZVV/LRqm9WbGG/F5fEO8wKAPPcCvHdWvhyKq1bmFALmutIjmO9x77WuFGDmy a00U72jPfgJrjruH5HpdhFc6/Bc2Rib5kYlzogrXtJI+4duYBbHtwG8KXLZdYKa64/o5 gNuW9cZwuRTzW9zQkCONSipOhMXSVsqmOrTzl6TFVev5zR3eK+EQM7y15M3z9ho4QvXq FpjkROT0N9uJdZ06R79l2jYD8Nijmu89Ppely9MGOdArtCq26CKYsqegG4JZqf/1x2Ab DZTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778043684; x=1778648484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LKwytmYNAHbsuFxFyJ0lrz9c5UpNtf6ZMxghB57imjM=; b=f93dgCDk3jgbSEB1BYoVnmXVzDGb/SivQjzcjGIphDDGQCKQhnZFeGe4NXvcGPutOg PYo3ldIvOwd8M+89p+K7Azb08XH/e3zS5VLMfgj4pTSkXHxOtDUBdS07E8PRTcTpT8xh KwEVJYF+/ViCgKH+xxXn1BfITkCA2fxUe8POeBBcBmxwTAW6mZRS0jNMEQBA534quGZ0 h6/94pdWNThCg1SaTiEy0M/HqERkOfVEPFzQwj/RjtTq9LNAQlAoR9l/Rnh6vN89Ntrj YFoLb7yhG88lDJTL7b0dQDj9lHzSlF5ZmjOmUGvE07o0CrXbt2Rzype9DBoQqRh8jWns 9a3g== X-Gm-Message-State: AOJu0Yy7ibGyU70Mptf+QuqVfc5GLklpy+S9QNR2Z9MIUJ6XZEn4JeLg X6vz86oKQ6F3W2puOhXuMz2TiinAJWe8G1Exei7hTYDFNlK7dIThneNj1LrqiIuBK3oOZz0xH/S JWFtlIlYdIYYJzc3a5jn66e0DHBE1+B7+XvX6SPi+IEg5ohKxGcVEd7GRyEl5hzZzCtI= X-Gm-Gg: AeBDieuha+gsQUNV/O/dp5sv7WmDAidSmlyNd/fyeRwODJ7JClmmlKlGCsBTc+8+wcf iW1CYxYdQz1iDyEFuZwuKiaHjBwLoEKBRsxUOqPPBdkcI8rVU43ID0WarqQT7bhLnGKnUoVsqaC fdUbrywIlbR5PooBK9GIeDLgg4kvAl9sPqGvZZoM+LOwwsCiFip9dI2qrALn7lvVvOp5PggVo59 ZZN5H8DkIQsMGJNxyptpsBBizdEnedLNzyM2MkXe3VFHjpYF3xH9HqyTj7YfPH/IDg9Ji9/gE4s dLaubkKUAKIXURI9uWnvH6GtHWArpNkLS8P4//HmI6s9ZeLy1n9mjvG42VkDFz+XbasbQWTLiHG MZ6UmMSmFt0C94znwxrZOlf8gjMFDq+TwW9y0GaMm7fSMornQWBNLjEirbCIRjmLlsrjBGg== X-Received: by 2002:a05:6a00:198c:b0:82c:b808:4c59 with SMTP id d2e1a72fcca58-83a5ea3fe9bmr1729943b3a.46.1778043683417; Tue, 05 May 2026 22:01:23 -0700 (PDT) X-Received: by 2002:a05:6a00:198c:b0:82c:b808:4c59 with SMTP id d2e1a72fcca58-83a5ea3fe9bmr1729889b3a.46.1778043682694; Tue, 05 May 2026 22:01:22 -0700 (PDT) Received: from hu-mojha-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83967dbcfc0sm4891620b3a.42.2026.05.05.22.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 22:01:22 -0700 (PDT) From: Mukesh Ojha To: Bjorn Andersson , Konrad Dybcio , Mathieu Poirier Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, Mukesh Ojha Subject: [PATCH 3/5] soc: qcom: mdt_loader: add qcom_mdt_pas_map/unmap_devmem_rscs() Date: Wed, 6 May 2026 10:31:05 +0530 Message-ID: <20260506050107.1985033-4-mukesh.ojha@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> References: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA2MDA0NiBTYWx0ZWRfXwf8RE9X5h8iT /eQ6pkhVjejG4SM9ioTeIgUB6OSvvXGQCzCWGAh7NzkhgVwiOgH+SfBtkqM4CWIaXEe8ZdUb5qD LXnU2Gt7IAoQPiAAPsC8hGLZAXmvd4iPOgdxKH152A79b1MggNHnWdBlp5DumT9y9JsyJRnR3KB bew4URPGM52EC8nAP5kU/JK9m4pAcoxJwtwkL7tYSfZA8P6B02HegRuZcU3IvxPDeqAdAJFuU/0 KC9iH96YqvBjxP7acZvWx3W4u/xTBXfAK4EyaWW3JRSoIj4ys27DX3w+O+i67yAvAn8lWflGLIO JG4yMZqIc9wm/6nB3wyNaMHOmqS3mQYLwlAnGDF8AdZOlvU1KAySL8YzgG5L4BLf4w4i0zKb0Ta ptIKHd1r7oOcUdb6ncYnhTn3+WlTQdPbgekNr/pas0O1/oLalABc+323zm1uPkCavHRn+rZKBTG Syr6dsklHrtbx/IPIDw== X-Proofpoint-GUID: jNCRwogIJ7dIUj0DLpx1Nm3aVHD8DDHd X-Proofpoint-ORIG-GUID: jNCRwogIJ7dIUj0DLpx1Nm3aVHD8DDHd X-Authority-Analysis: v=2.4 cv=b6KCJNGx c=1 sm=1 tr=0 ts=69facb24 cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=N53UB9TyAAAA:8 a=kQh6dVwvXRLgiowIQNEA:9 a=IoOABgeZipijB_acs4fv:22 a=DoZGhvB21A6Bz61VoUpf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-05_02,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605060046 Content-Type: text/plain; charset="utf-8" Add qcom_mdt_pas_map_devmem_rscs() and qcom_mdt_pas_unmap_devmem_rscs() to IOMMU map/unmap RSC_DEVMEM resource table entries on SoCs where Linux runs as hypervisor at EL2 and owns the IOMMU mappings for remote processors. The map function fetches the resource table via qcom_scm_pas_get_rsc_table() and iterates over RSC_DEVMEM entries using rsc_table_for_each_entry(), calling iommu_map() for each. Mapped entries are tracked in a per-PAS linked list stored in a hash table keyed by pas_id for later lookup by the unmap function. Signed-off-by: Mukesh Ojha --- drivers/soc/qcom/mdt_loader.c | 189 ++++++++++++++++++++++++++++ include/linux/soc/qcom/mdt_loader.h | 22 ++++ 2 files changed, 211 insertions(+) diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index ed882dd43587..dd84d0eba152 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -11,14 +11,34 @@ #include #include #include +#include #include +#include #include +#include #include #include +#include #include #include #include =20 +#define RSC_TABLE_HASH_BITS 5 /* 32 buckets */ + +static DEFINE_HASHTABLE(qcom_pas_rsc_table_map, RSC_TABLE_HASH_BITS); + +struct qcom_pas_devmem_rsc { + struct fw_rsc_devmem *devmem; + struct list_head node; +}; + +struct qcom_pas_rsc_table_info { + struct resource_table *rsc_table; + struct list_head devmem_list; + struct hlist_node hnode; + int pas_id; +}; + static bool mdt_header_valid(const struct firmware *fw) { const struct elf32_hdr *ehdr; @@ -507,5 +527,174 @@ int qcom_mdt_pas_load(struct qcom_scm_pas_context *ct= x, const struct firmware *f } EXPORT_SYMBOL_GPL(qcom_mdt_pas_load); =20 +static void __qcom_mdt_unmap_devmem_rscs(struct qcom_pas_rsc_table_info *i= nfo, + struct iommu_domain *domain) +{ + struct qcom_pas_devmem_rsc *entry, *tmp; + + list_for_each_entry_safe(entry, tmp, &info->devmem_list, node) { + iommu_unmap(domain, entry->devmem->da, entry->devmem->len); + list_del(&entry->node); + kfree(entry); + } +} + +/** + * qcom_mdt_pas_unmap_devmem_rscs() - IOMMU unmap device memory resources + * for a given Peripheral + * @ctx: pas context data structure + * @domain: IOMMU domain + * + * Looks up the resource table info previously stored by + * qcom_mdt_pas_map_devmem_rscs(), unmaps all RSC_DEVMEM entries from the + * IOMMU domain, and releases the associated memory. + */ +void qcom_mdt_pas_unmap_devmem_rscs(struct qcom_scm_pas_context *ctx, + struct iommu_domain *domain) +{ + struct qcom_pas_rsc_table_info *info; + struct hlist_node *tmp; + + if (!ctx || !domain) + return; + + hash_for_each_possible_safe(qcom_pas_rsc_table_map, info, tmp, hnode, ctx= ->pas_id) { + if (info->pas_id !=3D ctx->pas_id) + continue; + + __qcom_mdt_unmap_devmem_rscs(info, domain); + hash_del(&info->hnode); + kfree(info->rsc_table); + kfree(info); + break; + } +} +EXPORT_SYMBOL_GPL(qcom_mdt_pas_unmap_devmem_rscs); + +static int __qcom_mdt_map_devmem_rscs(struct device *dev, void *ptr, int a= vail, + struct iommu_domain *domain, + struct qcom_pas_rsc_table_info *info) +{ + struct qcom_pas_devmem_rsc *devmem_info; + struct fw_rsc_devmem *rsc =3D ptr; + int ret; + + if (sizeof(*rsc) > avail) { + dev_err(dev, "devmem rsc is truncated\n"); + return -EINVAL; + } + + if (rsc->reserved) { + dev_err(dev, "devmem rsc has non zero reserved bytes\n"); + return -EINVAL; + } + + devmem_info =3D kzalloc(sizeof(*devmem_info), GFP_KERNEL); + if (!devmem_info) + return -ENOMEM; + + ret =3D iommu_map(domain, rsc->da, rsc->pa, rsc->len, rsc->flags, GFP_KER= NEL); + if (ret) { + dev_err(dev, "failed to map devmem: %d\n", ret); + kfree(devmem_info); + return ret; + } + + devmem_info->devmem =3D rsc; + list_add_tail(&devmem_info->node, &info->devmem_list); + + dev_dbg(dev, "mapped devmem pa 0x%x, da 0x%x, len 0x%x\n", + rsc->pa, rsc->da, rsc->len); + + return 0; +} + +struct qcom_mdt_map_cb_data { + struct device *dev; + struct iommu_domain *domain; + struct qcom_pas_rsc_table_info *info; +}; + +static int qcom_mdt_map_devmem_cb(u32 type, void *rsc, int offset, + int avail, void *data) +{ + struct qcom_mdt_map_cb_data *d =3D data; + + if (type !=3D RSC_DEVMEM) + return 0; + + return __qcom_mdt_map_devmem_rscs(d->dev, rsc, avail, d->domain, + d->info); +} + +/** + * qcom_mdt_pas_map_devmem_rscs() - IOMMU map device memory resources for + * a given Peripheral + * + * This routine should be called when it is known that the SoC is running + * with Linux as hypervisor at EL2 where it is in control of the IOMMU map + * of the resources for the remote processors. + * + * @ctx: pas context data structure + * @domain: IOMMU domain + * @input_rt: input resource table buffer when resource table is part = of + * firmware binary; pass NULL if not available + * @input_rt_size: size of @input_rt; pass zero if @input_rt is NULL + * + * Returns 0 on success, negative errno otherwise. + */ +int qcom_mdt_pas_map_devmem_rscs(struct qcom_scm_pas_context *ctx, + struct iommu_domain *domain, + void *input_rt, size_t input_rt_size) +{ + struct qcom_mdt_map_cb_data map_data; + size_t output_rt_size =3D QCOM_MDT_MAX_RSCTABLE_SIZE; + struct qcom_pas_rsc_table_info *info; + struct resource_table *rsc_table; + int ret; + + if (!ctx || !domain) + return -EINVAL; + + rsc_table =3D qcom_scm_pas_get_rsc_table(ctx, input_rt, input_rt_size, + &output_rt_size); + if (IS_ERR(rsc_table)) { + ret =3D PTR_ERR(rsc_table); + dev_err(ctx->dev, "error %d getting resource_table\n", ret); + return ret; + } + + info =3D kzalloc(sizeof(*info), GFP_KERNEL); + if (!info) { + ret =3D -ENOMEM; + goto free_rsc_table; + } + + map_data.dev =3D ctx->dev; + map_data.domain =3D domain; + map_data.info =3D info; + info->pas_id =3D ctx->pas_id; + info->rsc_table =3D rsc_table; + INIT_LIST_HEAD(&info->devmem_list); + + ret =3D rsc_table_for_each_entry(rsc_table, output_rt_size, ctx->dev, + qcom_mdt_map_devmem_cb, &map_data); + if (ret) + goto undo_mapping; + + hash_add(qcom_pas_rsc_table_map, &info->hnode, ctx->pas_id); + + return 0; + +undo_mapping: + __qcom_mdt_unmap_devmem_rscs(info, domain); + kfree(info); +free_rsc_table: + kfree(rsc_table); + + return ret; +} +EXPORT_SYMBOL_GPL(qcom_mdt_pas_map_devmem_rscs); + MODULE_DESCRIPTION("Firmware parser for Qualcomm MDT format"); MODULE_LICENSE("GPL v2"); diff --git a/include/linux/soc/qcom/mdt_loader.h b/include/linux/soc/qcom/m= dt_loader.h index 7c551b98e182..304aebb2b9cd 100644 --- a/include/linux/soc/qcom/mdt_loader.h +++ b/include/linux/soc/qcom/mdt_loader.h @@ -8,8 +8,11 @@ #define QCOM_MDT_TYPE_HASH (2 << 24) #define QCOM_MDT_RELOCATABLE BIT(27) =20 +#define QCOM_MDT_MAX_RSCTABLE_SIZE SZ_16K + struct device; struct firmware; +struct iommu_domain; struct qcom_scm_pas_context; =20 #if IS_ENABLED(CONFIG_QCOM_MDT_LOADER) @@ -23,6 +26,12 @@ int qcom_mdt_load(struct device *dev, const struct firmw= are *fw, int qcom_mdt_pas_load(struct qcom_scm_pas_context *ctx, const struct firmw= are *fw, const char *firmware, phys_addr_t *reloc_base); =20 +int qcom_mdt_pas_map_devmem_rscs(struct qcom_scm_pas_context *ctx, + struct iommu_domain *domain, + void *input_rt, size_t input_rt_size); +void qcom_mdt_pas_unmap_devmem_rscs(struct qcom_scm_pas_context *ctx, + struct iommu_domain *domain); + int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw, const char *fw_name, void *mem_region, phys_addr_t mem_phys, size_t mem_size, @@ -52,6 +61,19 @@ static inline int qcom_mdt_pas_load(struct qcom_scm_pas_= context *ctx, return -ENODEV; } =20 +static inline int qcom_mdt_pas_map_devmem_rscs(struct qcom_scm_pas_context= *ctx, + struct iommu_domain *domain, + void *input_rt, + size_t input_rt_size) +{ + return -ENODEV; +} + +static inline void qcom_mdt_pas_unmap_devmem_rscs(struct qcom_scm_pas_cont= ext *ctx, + struct iommu_domain *domain) +{ +} + static inline int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw, const char *fw_name, void *mem_region, --=20 2.53.0 From nobody Sat Jun 13 18:10:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9B7630170F for ; Wed, 6 May 2026 05:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043689; cv=none; b=gFAkF/STEoyNLPA0zcQEm8G3J6fljebajfD33bnDJ8cSH9NESk4SuwJTQvKdVwiDm7zC6vEsfU9QVWDgGWPz84Fom0MAjvgo2c0j9GmsCEGoUy+sKIYJ1LW105uMyzfoZAcFZ8aMOrGq0Mk9H2zCp5b4UFkn0X750UppLWr7POM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043689; c=relaxed/simple; bh=x3imywJXb9KQ30J+Y0NGkFn/oGofziH/knbByycGVA4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tHjT9QU8wWZ9YRdESYGwI8Olmh2UxMemZWa9XepFNKO8H1x8wmRUMaeRys5ehdgGr72oAWsDGCCMBPmbQtqxywJrAOvR8IIZkgpn7iXb8lLqEr1jsQoF7x5uL0rMPb3NKyFONPvP+01CCdNprPcQfrwmCLoy1NgRccNCeMi6Rfo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GzHL6fEm; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OZ4E1s6C; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GzHL6fEm"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OZ4E1s6C" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 645M0iVT912015 for ; Wed, 6 May 2026 05:01:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=qpfp4SaaU6j oBqSmIz9YG6OU2Zed5b0PfIlvN0JCuFg=; b=GzHL6fEmtJVoLeEfBOk7Mrj3KR3 d/Kmdr/gygGdrpg46QfAMvIOIxyJTdWGjNpAEPNXxP5D4nfkyTz2o/QilMwJ1GBA o4+tcElfx8AtArqE1TqSdzqlsqVoIHHIVNXYu12cGt3EbBxtf7S8c4Z/yE+iFss3 ETFDZCt678DV7vh65T5YjF3wysYLaH6XGEfSWMlpfzVIWjBuezAPusRq6dDnK45u AyGeASNCk3S8E6hhDkG3ux1y/v95EoqMFjUwvltVH/HIFmFWkJpvPMCi41sEAJcP kKWWsFaan9hxhRdNUyZnrZ5BFQdzZNFU/ZJBXsb5Mn/7i4Jq05BAUYysbqQ== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dyj7jjxkj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 06 May 2026 05:01:27 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-82fa860e71eso2986931b3a.0 for ; Tue, 05 May 2026 22:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778043686; x=1778648486; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qpfp4SaaU6joBqSmIz9YG6OU2Zed5b0PfIlvN0JCuFg=; b=OZ4E1s6CHKeYKJPS/BamgC/BpsljGKgafO3e8cePsM3ZfLtSbA5rjrO4i4yTE1yJEM dV0VkJH6DU+YXZZNDiLVTScoV5NVs2ldwpGOV+Yzz1lzi14MSdQvnSMNjJZg9jN1Pm11 ffvXzENCLsvct1z7fExuYl16DM3xGNuDxpuXhuc7krntMsh6lZ6zN1i/f8cblnz8WW0j 8qT2gOLeeJvj2LI8HB9QuUl3RPC9f0cy5hnq5Kktdv0ED2+L7Hk5MEjeK9cp1x150r8L xoUnF45grm0wXFoD4klbC9u4MPNl8CTrN3UkzecE3fghrjoKHwZNnTnoyCurbFGP1hNT QqsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778043686; x=1778648486; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qpfp4SaaU6joBqSmIz9YG6OU2Zed5b0PfIlvN0JCuFg=; b=rwceIQHxKAlwrH84Uf2Bx5APkDPpW3kv/cHw7xzuePO4QOzpavxsU+tzW+j9jA2qDm coAHmSDWXsWPR7eeh5YYbIojnrHngvSUJsqySyNpUFqQgt+RDW6WI2kdCfnb+wqLGiB7 ZZ+B4iSuUKuRtlt0AxvihIFdqzA41VLj77x8xXoGZMWQiBzzH09stZ9qK+RSquWPSjXi RghHg40uvDPpf0jIgSFcX6eB5hDbmDV/ccSIuNCrYoz4bRYEnPB8VoIEz+Z5O+6j/S2g HjRrG111d/KcjEXtoqhd1bJ4TN3e04jQoNepWP9ZnAlqzwww+VAllc4DzEj1/l8vHFgw t3hA== X-Gm-Message-State: AOJu0YylpWHyKAcfMoro+EHhB5wW7SU85Uq5hfqvIJKorzFMYhfugxim OCXpUTcwTcUGm/lp7QeT+JK8IRqKyww/3FBbK0/B0siqt5SKUmvaRAhRZQQqZa5EXu8MT+dE6gs P0ju0uUMeFXrvGqE9HPIvCecs4CTR9SKgyp3LPCYQbSOFEqzDfLz1sxTPG/Rt+5yMx5o= X-Gm-Gg: AeBDies4enj3IfDgZ3xT5VpnFNZvF2VbJ5x+xW0IWFao0+Ic+f0HjZAkjoNIkSVW2K+ YK5tGF97sbzK7bSvw8IpajaZtR8ljCAXrKxNEWIirFMpWbALDtTAT5CVA4scKcSl9JaMQlX8FYX 5Z458jaUEkQPxjwq6Iy27xdtONgw0xHURlzh3puiLaqn+4Cma/iDvq2AeVVA5Q8jPUz8Yxf7rpl 292IcrRRdUytk0TRDZtdy3ckqNLGe7gBtVxURraP0HmEn0VjYKfiJw+qtvhTVJ64qKO1KmyHanY XMhUsiUy5boxRj76h/mzthsBW/ycJOykooIy0+iACSE14B6s2/EiB/nzVPG7wZ4jxjFmjiODq++ k9Ej9v/2cjMudSWz0IlFRtn4YDunNjvvgkkFy8i8MjCBa72LxE1qJVYykw9c= X-Received: by 2002:a05:6a00:2d96:b0:837:acd7:a78 with SMTP id d2e1a72fcca58-83a5b9d8131mr1640497b3a.16.1778043686119; Tue, 05 May 2026 22:01:26 -0700 (PDT) X-Received: by 2002:a05:6a00:2d96:b0:837:acd7:a78 with SMTP id d2e1a72fcca58-83a5b9d8131mr1640455b3a.16.1778043685478; Tue, 05 May 2026 22:01:25 -0700 (PDT) Received: from hu-mojha-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83967dbcfc0sm4891620b3a.42.2026.05.05.22.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 22:01:25 -0700 (PDT) From: Mukesh Ojha To: Bjorn Andersson , Konrad Dybcio , Mathieu Poirier Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, Mukesh Ojha Subject: [PATCH 4/5] firmware: qcom: scm: replace with Date: Wed, 6 May 2026 10:31:06 +0530 Message-ID: <20260506050107.1985033-5-mukesh.ojha@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> References: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA2MDA0NiBTYWx0ZWRfX4qANA0Qw4t6Q BLW9rM4fWLbs3ZCaQHRzZ8Ip4pYMx9KsCrWwPqQMAn7YDZkInXvtlBQdjVBAPG5f5lDjRyAXcJU o6TU2IZbXaPiF+Wac+1hIn5/3XUdijcOBPqN4Gv0yUWuzEgArOtqKQIqeChq2eRfg+bD8pxVvbQ BKqzOq0fHI3zzhlDzWx+x54T4+Uy9d0ZMppNLunezngtU/1YPuSWJX8DU6reKdEy39EYW4BPkhP 5Qwj/3m+TtVKsQhWcX8ieho6KJRZTNcJTwxaA2d6ltcQbcJCDpciZjKmHbCbdszzc1jb4cSBcwi mxiPPY7Hx2T495FBqLvXq4IDcvLTEmIPDo+eHX069pFl+txyC7BQkG20x/KcTB/72iKcYUeuOJU vNo1jw8pOiBPYI/SkAT75cNHatwnDtZ8PsdGDZAZLv4VMgCspJ/aPIhP90T2bqweq00LW9Xw52T 2GMV6fm8D3NbLeXq4/Q== X-Proofpoint-GUID: ohruqcGRzXX-CFJ58elfXNzv9U3V6WLF X-Authority-Analysis: v=2.4 cv=FpA1OWrq c=1 sm=1 tr=0 ts=69facb27 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=FwMnjOFOIPbINuAMt2AA:9 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-ORIG-GUID: ohruqcGRzXX-CFJ58elfXNzv9U3V6WLF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-05_02,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605060046 Content-Type: text/plain; charset="utf-8" qcom_scm.c only uses struct resource_table, which was moved to by "remoteproc: Move resource table data structure to its own header". Drop the heavyweight dependency and include only the header that provides what is actually needed. Signed-off-by: Mukesh Ojha --- drivers/firmware/qcom/qcom_scm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_= scm.c index 2cae35e7c583..d9ee180388aa 100644 --- a/drivers/firmware/qcom/qcom_scm.c +++ b/drivers/firmware/qcom/qcom_scm.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include =20 @@ -871,7 +871,7 @@ static void *__qcom_scm_pas_get_rsc_table(u32 pas_id, v= oid *input_rt_tzm, * as zero respectively. * * More about documentation on resource table data structures can be found= in - * include/linux/remoteproc.h + * include/linux/rsc_table.h * * @ctx: PAS context * @pas_id: peripheral authentication service id --=20 2.53.0 From nobody Sat Jun 13 18:10:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 881B030148C for ; Wed, 6 May 2026 05:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043695; cv=none; b=RmWJj7q72upKg34z2egHjQ7KM65t0tFivrdu0w/4Kp2CAExnFxzYid2p1hWJbaLm+4kPTIzSvn+8Ls+NtX/kSKIktw4J491lpZk+piczMRduahbc1tmRsqpP6CoBqnVEXYX6IFI8VMGausDlheRjuT5AyFYsd7uYZv38mfm3F+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778043695; c=relaxed/simple; bh=M5rRC01HPhlQM6fuxNgD03mFH22vVcDQpyAjh2XtkPM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dDcC6E3Mpd6HybgI62A4oX0XeDaLoXhn5m1SfdUw8cBc8yXaP0EFeAFkn8+OBbuAK00gcPdLde8ueAMXMsCzqRbTkngnxyUwgDo1uRzEIuOrz06oBFkHz6ZRIq2WzWE4Jt8e5HtSAkHyxVSMRRsAqRPgJqhJun3fNhHFdX21GNw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=OddCglJ/; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Y0qDy72p; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="OddCglJ/"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Y0qDy72p" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6463GPfP3091762 for ; Wed, 6 May 2026 05:01:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=/UkEw7Yq3iZ ri2eJcOzLGwWjXD8rv0IhaRuy5ZE9IUs=; b=OddCglJ/bbcCSJv+p8v9qfHWT21 swToN4ZwwNGjRo9RjGSUTFJmSES+uIKQCRtGYfZVKEw+6XHk4/DQL/Xhc023CAtU eiBo5HTd1rjS/rfkVj6nEAbUN3UAXEU4tlnp65w5QkYGphwTMc8H5wYXAf14tBSJ xy9n1dUL1CJBJAI5DpeGvUVtQv1A7e05qo93bu5eIVNL2RFRLcvWPK23zhRNu+8y ihlTCceyalzWFyPHdKc3M4xnFZsEgoUCP7IjZiw65vJAQ77wz5+WWNODjFT92Zul Xkvygb9Cm6YJgDGK24AAak0nTS/iuolX6/jVg7pp46JKeEiYRRPHFrFh1mA== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dyfct3na2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 06 May 2026 05:01:29 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-836d0184333so2863460b3a.0 for ; Tue, 05 May 2026 22:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778043689; x=1778648489; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/UkEw7Yq3iZri2eJcOzLGwWjXD8rv0IhaRuy5ZE9IUs=; b=Y0qDy72pifYOXSSokXjDu5shbESIlWOOR/Ci0PCTyNu/rXTwNfduMzmfmyXd9w2psb gXMgGGH/Eh3CygzIHgVcTUK0sN78EBhQpnNUJWvJ5ibe9Sb88oHc553lUWiWl/NXHmiK zPAErIpOhsvkZ0MH5UVHYP1KzD8dVSy8i+la5vRurvoi1PU2Vx3y0RANmRQ0u8Ne6zja W/OFUhYr1Wd2SYlgpsuBzHnj5laFcQOti+tktdcm1anw1HNWiUoPaeBi9G7/2EWH+hsQ 6THustwtrRiAvB65Tzww3V0lAZtBVJ5speNnDkAnYqBQWXoXNXQUrPDl+rfSuTIDK2uD SFnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778043689; x=1778648489; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/UkEw7Yq3iZri2eJcOzLGwWjXD8rv0IhaRuy5ZE9IUs=; b=IOI87e+Ib5cMn0wOG1RWbm+OHCKCiXY8pBzGfno1Tj3qifrbOIsdKN/ALAB31rxwmE my4WweOImvG9RELeB7yDB+OqT8sdpdjn0pEmO7rSjp+jI4RBbMSt8f2wLg4bajG6An0u lA0macLcAPa6vnjC35+0tzxEaqhwg8+ohbF4BaDe+uezh2bin6Ztq1NOeYOyZ7hCLVdu yiltDrCdE4uQtvOU5rf56E/qOHE6UzNtAN57KFY7oyj5iuIVgONhpVI4bJbKoVo0T+mR 7/NICPRaVZnEPu15zAVE4Gf0oQJ/URA04tYcfH5gb8ijLmk1T61c5ZfqOWiRXGvO4AAs 5Z5A== X-Gm-Message-State: AOJu0YzOlozBF0zSfwnsvCNtRPKlkSET/PYUCtW7L382UkbhULfH5UW7 SNMdjXorNKUIGCHb8A72V4PtQ0i0tNiVmniqVW09/RFg5iQKZJZA1sqkr5x6q3PtDl8W8T+0JSS 2mwlGxjfrb+O5DXaOCd2H3FwwwUKp+HxTEwAlX8mvrNmye7Gtvm1yVV1BjKYcyq3riVvzMv1Qap E= X-Gm-Gg: AeBDieu3qlaRrsTKEegdq+I/xjfZYSZIZ4t8Qq0Z3P9BEqSsbin/IwQhi3elsXL1snT D6lWZ46JtSxCsDkkHQ0qQMWXOB+s2EpeJ1/tKDiP07QaQiY/9w8ZqU9wOuEPQA6hKq8JCLMOnsy bf7bj9Q6NU7vI+KWmoU4SnbOLhc2MW7Pv95LVvsywQgofdCndHqra/J9xXI38FTcxa5lmfVzylk tdCaYP7NSYDDAsBk5rzmPRZdYzOsAbefZHlEqBin1dhNYvcWM7swlzW1Jt/kBFWRFra63tvW6bZ VuCefFIvPK2LXQCXH041HTzmddtRRaD+iwcahS1SIX0tNJ/rSO4gJSjKfQv0rbtB/C0nhiCAk3b qRupos5h1ip0DuwPBet4LSoX244eHL57pBFoxaLl23x7IYlQ5U1mPTii/8Lw= X-Received: by 2002:a05:6a00:4293:b0:833:22e9:2cd6 with SMTP id d2e1a72fcca58-83a5bfc4ae9mr1704099b3a.16.1778043688856; Tue, 05 May 2026 22:01:28 -0700 (PDT) X-Received: by 2002:a05:6a00:4293:b0:833:22e9:2cd6 with SMTP id d2e1a72fcca58-83a5bfc4ae9mr1704057b3a.16.1778043688264; Tue, 05 May 2026 22:01:28 -0700 (PDT) Received: from hu-mojha-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83967dbcfc0sm4891620b3a.42.2026.05.05.22.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 22:01:28 -0700 (PDT) From: Mukesh Ojha To: Bjorn Andersson , Konrad Dybcio , Mathieu Poirier Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, Mukesh Ojha Subject: [PATCH 5/5] MAINTAINERS: add rsc_table.h to remoteproc entry Date: Wed, 6 May 2026 10:31:07 +0530 Message-ID: <20260506050107.1985033-6-mukesh.ojha@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> References: <20260506050107.1985033-1-mukesh.ojha@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: WFpWLCcgfdWhZmNS8xQ1NA-A8caCbK5l X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA2MDA0NiBTYWx0ZWRfX/XfmNPK5xywd phaFga2uIG/qAWLW5aZzSVWHqWFnN0EsO/AHaagaNPRP1+CGiBR7fB7VHXM2RcmRe516nX8B5ez RiFMtUYy1NbfEPuLFSMIOi0Y66zoBhUjdzBvTl0d73+sJUR/YVnYp8bu/N/8irwrFNwnwjdQP0x cDaixeGPv9IMTMw1gR9cF7M659xSGcw6n2MPIbHDNzytALpZRzVaWnGdvx7aamJoLVuUTTH/RpN egZJHUAVcJFCKmTGBc2Ex1D6Vnu2kCa8CrPAr/+Es92U6STdhHKmV1kPek0y0zwA1qs+hGcl+CS 9mVSlIqYoven92bCnuF/fgm/AcWRtVI7hQKAaBsuvttzVu281ZlqM/21adspXCl/jhszp48cWZ7 prCjEZTIOt5aCDEXmYyP54qx7btQHHUn0M/uvBcu/AvuKFaFkPut7p1D65m8dftiqDXRhfFw+xT CsUm6KJljlJsyui422Q== X-Proofpoint-ORIG-GUID: WFpWLCcgfdWhZmNS8xQ1NA-A8caCbK5l X-Authority-Analysis: v=2.4 cv=NtXhtcdJ c=1 sm=1 tr=0 ts=69facb29 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=ob-EK7KtVxQGSle2nTEA:9 a=ZXulRonScM0A:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-05_02,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 bulkscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 priorityscore=1501 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605060046 Content-Type: text/plain; charset="utf-8" include/linux/rsc_table.h was split out from include/linux/remoteproc.h to hold the resource table wire-format definitions. Add it to the REMOTEPROC entry so it is covered by the same maintainers. Signed-off-by: Mukesh Ojha --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index c871acf2179c..b2a6d108c662 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22507,6 +22507,7 @@ F: Documentation/devicetree/bindings/remoteproc/ F: Documentation/staging/remoteproc.rst F: drivers/remoteproc/ F: include/linux/remoteproc.h +F: include/linux/rsc_table.h F: include/linux/remoteproc/ =20 REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM --=20 2.53.0