Re: [PATCH v2 2/3] misc: fastrpc: Add support for new DSP IOVA formatting
From: Arnd Bergmann
Date: Wed Oct 15 2025 - 03:10:18 EST
On Wed, Oct 15, 2025, at 06:57, Kumari Pallavi wrote:
> @@ -2291,6 +2319,22 @@ static int fastrpc_rpmsg_probe(struct
> rpmsg_device *rpdev)
> const char *domain;
> bool secure_dsp;
> unsigned int vmids[FASTRPC_MAX_VMIDS];
> + struct device_node *root;
> + const struct of_device_id *match;
> + const struct fastrpc_soc_data *soc_data = NULL;
> +
> + root = of_find_node_by_path("/");
> + if (!root)
> + return -ENODEV;
> +
> + match = of_match_node(qcom_soc_match_table, root);
> + of_node_put(root);
> + if (!match || !match->data) {
> + soc_data = &default_soc_data;
> + dev_dbg(rdev, "no compatible SoC found at root node\n");
> + } else {
> + soc_data = match->data;
> + }
>
Matching on the type of the root node is not great, as this
is both a layering violation and does not scale if you need
to do the same thing for future chip generations.
Normally this should be matched on the device compatible
string itself, or possibly based on one of its properties.
If this fails because there are already dtb files in the
open that have to keep getting supported and there is no
identifier in the fastrpc device itself, you can use
soc_device_match() as a last resort to match on the the
soc.
Arnd