From a043fc6d2ea792b9c4e14343c0fc310017e93bb3 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:30 +0800 Subject: [PATCH 01/15] FROMLIST: dt-bindings: remoteproc: qcom,nord-pas: Add ADSP1/2 compatibles Nord's HPASS audio subsystem has three QDSP6 instances, ADSP0/1/2, each with its own independent QDSP6SS block and its own Peripheral Authentication Service image. Add the compatible strings for the two that are not yet described. The instances are not interchangeable: the shared HPASS resources (CRM_COMMON clock/reset and the AG_NOC bridge) are owned by ADSP0, which initializes them before ADSP1/ADSP2 can boot. That asymmetry is inherent to each instance rather than to the board, so it is expressed by the compatible alone and needs no additional property. Link: https://lore.kernel.org/r/20261201070137.360878-2-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit 89249521c783d7ab15b44f057cd2ff9765b4b03c) --- .../devicetree/bindings/remoteproc/qcom,nord-pas.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml index e90d2953ba692..ca473e68a3ab9 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml +++ b/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml @@ -17,6 +17,8 @@ properties: compatible: enum: - qcom,nord-adsp-pas + - qcom,nord-adsp1-pas + - qcom,nord-adsp2-pas - qcom,nord-cdsp0-pas - qcom,nord-cdsp1-pas - qcom,nord-cdsp2-pas @@ -101,6 +103,8 @@ allOf: compatible: enum: - qcom,nord-adsp-pas + - qcom,nord-adsp1-pas + - qcom,nord-adsp2-pas then: properties: power-domains: From c8b65ce26ca8042ca8ba5885f0e15b2b6dfd1a1d Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:31 +0800 Subject: [PATCH 02/15] FROMLIST: remoteproc: Add cluster field to struct rproc Some Qualcomm SoCs group multiple remote processors into a cluster (e.g. Nord's ADSP0/1/2, which share HPASS-domain PLLs, AG_NOC, RSCp and other resources owned by ADSP0). Firmware on these clusters cannot tolerate the peer-shutdown notifications that qcom_sysmon and qcom_glink_ssr send between independently started/stopped remote processors. Add an opaque cluster identifier to struct rproc so that those notification paths, which live in different subsystems (remoteproc and rpmsg), can recognize siblings in the same cluster and suppress notifications between them, without introducing a module dependency between the two subsystems. Link: https://lore.kernel.org/r/20261201070137.360878-3-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit 56f3bd9d8f00c3d6630ca040f3ca2d7a68816231) --- include/linux/remoteproc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index a44368737b39a..53e56d53641e4 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -254,6 +254,8 @@ enum rproc_features { * @cdev: character device of the rproc * @cdev_put_on_release: flag to indicate if remoteproc should be shutdown on @char_dev release * @features: indicate remoteproc features + * @cluster: opaque identifier shared by remoteprocs whose SSR notifications + * should be coalesced (set by the owning rproc driver), or NULL */ struct rproc { struct list_head node; @@ -299,6 +301,7 @@ struct rproc { struct cdev cdev; bool cdev_put_on_release; DECLARE_BITMAP(features, RPROC_MAX_FEATURES); + void *cluster; }; /** From 0b72f3d199e97abc02ac79685f77355c852736cc Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:32 +0800 Subject: [PATCH 03/15] FROMLIST: remoteproc: qcom: sysmon: Suppress notify between cluster siblings Firmware on clustered remote processors (e.g. Nord's HPASS ADSP0/1/2) cannot handle the SSCTL peer-shutdown notification sysmon sends whenever a sibling in the same cluster starts or stops, and the QMI request instead times out. Skip sysmon_notify() when the notifying and the notified instance share the cluster identifier their owning rproc driver put in rproc->cluster. The suppression is done on the receiving side, so that a cluster member keeps notifying, and being notified by, remote processors outside its cluster. Instances whose rproc has no cluster set are completely unaffected. sysmon_start() also bypasses the notifier chain: once an instance is up, it walks sysmon_list and sends the newly started remote processor the state of every other instance that is already running. Apply the same check there, so that a member started after its siblings, as dependent members always are, isn't told about them either. Link: https://lore.kernel.org/r/20261201070137.360878-4-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit de7d4a27817a1dd5c9b13b737160c7ec72d7dc65) --- drivers/remoteproc/qcom_sysmon.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c index 61e1038328e83..fb6e741fe47c4 100644 --- a/drivers/remoteproc/qcom_sysmon.c +++ b/drivers/remoteproc/qcom_sysmon.c @@ -67,6 +67,7 @@ static const char * const sysmon_state_string[] = { struct sysmon_event { const char *subsys_name; u32 ssr_event; + void *cluster; }; static DEFINE_MUTEX(sysmon_lock); @@ -473,7 +474,8 @@ static int sysmon_prepare(struct rproc_subdev *subdev) subdev); struct sysmon_event event = { .subsys_name = sysmon->name, - .ssr_event = SSCTL_SSR_EVENT_BEFORE_POWERUP + .ssr_event = SSCTL_SSR_EVENT_BEFORE_POWERUP, + .cluster = sysmon->rproc->cluster, }; mutex_lock(&sysmon->state_lock); @@ -500,7 +502,8 @@ static int sysmon_start(struct rproc_subdev *subdev) struct qcom_sysmon *target; struct sysmon_event event = { .subsys_name = sysmon->name, - .ssr_event = SSCTL_SSR_EVENT_AFTER_POWERUP + .ssr_event = SSCTL_SSR_EVENT_AFTER_POWERUP, + .cluster = sysmon->rproc->cluster, }; reinit_completion(&sysmon->ssctl_comp); @@ -511,6 +514,11 @@ static int sysmon_start(struct rproc_subdev *subdev) mutex_lock(&sysmon_lock); list_for_each_entry(target, &sysmon_list, node) { + /* As in sysmon_notify(), don't tell cluster siblings about each other */ + if (sysmon->rproc->cluster && + sysmon->rproc->cluster == target->rproc->cluster) + continue; + mutex_lock(&target->state_lock); if (target == sysmon || target->state != SSCTL_SSR_EVENT_AFTER_POWERUP) { mutex_unlock(&target->state_lock); @@ -536,7 +544,8 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed) struct qcom_sysmon *sysmon = container_of(subdev, struct qcom_sysmon, subdev); struct sysmon_event event = { .subsys_name = sysmon->name, - .ssr_event = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN + .ssr_event = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN, + .cluster = sysmon->rproc->cluster, }; sysmon->shutdown_acked = false; @@ -567,7 +576,8 @@ static void sysmon_unprepare(struct rproc_subdev *subdev) subdev); struct sysmon_event event = { .subsys_name = sysmon->name, - .ssr_event = SSCTL_SSR_EVENT_AFTER_SHUTDOWN + .ssr_event = SSCTL_SSR_EVENT_AFTER_SHUTDOWN, + .cluster = sysmon->rproc->cluster, }; mutex_lock(&sysmon->state_lock); @@ -588,6 +598,11 @@ static int sysmon_notify(struct notifier_block *nb, unsigned long event, struct qcom_sysmon *sysmon = container_of(nb, struct qcom_sysmon, nb); struct sysmon_event *sysmon_event = data; + /* Cluster siblings' firmware can't handle peer SSR notify; skip it */ + if (sysmon->rproc->cluster && + sysmon->rproc->cluster == sysmon_event->cluster) + return NOTIFY_DONE; + /* Skip non-running rprocs and the originating instance */ if (sysmon->state != SSCTL_SSR_EVENT_AFTER_POWERUP || !strcmp(sysmon_event->subsys_name, sysmon->name)) { From 6b68f56f696dcd6bf8a912a4e11bf58bbeb56114 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:33 +0800 Subject: [PATCH 04/15] FROMLIST: rpmsg: qcom_glink_ssr: Suppress cleanup notify between cluster siblings Like qcom_sysmon's SSCTL notify, clustered remote processors (e.g. Nord's HPASS ADSP0/1/2) cannot handle the glink_ssr DO_CLEANUP broadcast sent to siblings whenever one of them starts or stops, leaving qcom_glink_ssr_notifier_call() to time out waiting for CLEANUP_DONE. Pass the stopping remoteproc's cluster identifier through qcom_glink_ssr_notify(), and plumb each edge's own cluster identifier down from the remoteproc that registers it, so that qcom_glink_ssr_notifier_call() can skip the DO_CLEANUP send when the sender and the receiving edge share a cluster. As in qcom_sysmon, the suppression is done on the receiving side, so that a cluster member keeps sending DO_CLEANUP to, and receiving it from, remote processors outside its cluster. Edges with no cluster set are unaffected. The receiving edge's identifier is carried in struct qcom_glink rather than looked up from the rproc that owns it, so that glink_ssr does not have to reach into struct remoteproc: RPMSG_QCOM_GLINK does not depend on REMOTEPROC, and the identifier is deliberately opaque to keep the two subsystems independent of each other. Link: https://lore.kernel.org/r/20261201070137.360878-5-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit 373cbd0b98938fa0602f5bdf7b9767acfeb4686f) --- drivers/remoteproc/qcom_common.c | 7 +++--- drivers/remoteproc/qcom_common.h | 2 +- drivers/rpmsg/qcom_glink_native.c | 26 +++++++++++++++++++++- drivers/rpmsg/qcom_glink_native.h | 5 ++++- drivers/rpmsg/qcom_glink_rpm.c | 2 +- drivers/rpmsg/qcom_glink_smem.c | 5 +++-- drivers/rpmsg/qcom_glink_ssr.c | 36 ++++++++++++++++++++++++++----- include/linux/rpmsg/qcom_glink.h | 10 +++++---- 8 files changed, 75 insertions(+), 18 deletions(-) diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index 5294e327f1587..13458bda6b246 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -217,7 +217,8 @@ static int glink_subdev_start(struct rproc_subdev *subdev) { struct qcom_rproc_glink *glink = to_glink_subdev(subdev); - glink->edge = qcom_glink_smem_register(glink->dev, glink->node); + glink->edge = qcom_glink_smem_register(&glink->rproc->dev, glink->node, + glink->rproc->cluster); return PTR_ERR_OR_ZERO(glink->edge); } @@ -234,7 +235,7 @@ static void glink_subdev_unprepare(struct rproc_subdev *subdev) { struct qcom_rproc_glink *glink = to_glink_subdev(subdev); - qcom_glink_ssr_notify(glink->ssr_name); + qcom_glink_ssr_notify(glink->ssr_name, glink->rproc->cluster); } /** @@ -258,7 +259,7 @@ void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink, return; } - glink->dev = dev; + glink->rproc = rproc; glink->subdev.start = glink_subdev_start; glink->subdev.stop = glink_subdev_stop; glink->subdev.unprepare = glink_subdev_unprepare; diff --git a/drivers/remoteproc/qcom_common.h b/drivers/remoteproc/qcom_common.h index b0e7e336d363e..7136494cbfbaa 100644 --- a/drivers/remoteproc/qcom_common.h +++ b/drivers/remoteproc/qcom_common.h @@ -14,7 +14,7 @@ struct qcom_rproc_glink { const char *ssr_name; - struct device *dev; + struct rproc *rproc; struct device_node *node; struct qcom_glink_smem *edge; }; diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 55793fc18293b..12237da58cd6c 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -122,6 +122,8 @@ struct qcom_glink { unsigned long features; bool intentless; + /* Cluster identifier of the remote processor behind this edge, or NULL */ + void *cluster; wait_queue_head_t tx_avail_notify; bool sent_read_notify; @@ -1889,7 +1891,8 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, unsigned long features, struct qcom_glink_pipe *rx, struct qcom_glink_pipe *tx, - bool intentless) + bool intentless, + void *cluster) { int ret; struct qcom_glink *glink; @@ -1904,6 +1907,7 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, glink->features = features; glink->intentless = intentless; + glink->cluster = cluster; spin_lock_init(&glink->tx_lock); spin_lock_init(&glink->rx_lock); @@ -1937,6 +1941,26 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, } EXPORT_SYMBOL_GPL(qcom_glink_native_probe); +/** + * qcom_glink_ept_cluster() - cluster identifier of an endpoint's edge + * @ept: endpoint to query + * + * Return: the opaque cluster identifier of the remote processor @ept talks to, + * or NULL if it is not part of a cluster or @ept is not a GLINK endpoint. + */ +void *qcom_glink_ept_cluster(struct rpmsg_endpoint *ept) +{ + struct glink_channel *channel; + + /* The glink_ssr driver may also bind to a channel on another rpmsg bus */ + if (ept->ops != &glink_endpoint_ops) + return NULL; + + channel = to_glink_channel(ept); + + return channel->glink->cluster; +} + static int qcom_glink_remove_device(struct device *dev, void *data) { device_unregister(dev); diff --git a/drivers/rpmsg/qcom_glink_native.h b/drivers/rpmsg/qcom_glink_native.h index 8dbec24de23e0..8544f4f5c5450 100644 --- a/drivers/rpmsg/qcom_glink_native.h +++ b/drivers/rpmsg/qcom_glink_native.h @@ -29,12 +29,15 @@ struct qcom_glink_pipe { struct device; struct qcom_glink; +struct rpmsg_endpoint; struct qcom_glink *qcom_glink_native_probe(struct device *dev, unsigned long features, struct qcom_glink_pipe *rx, struct qcom_glink_pipe *tx, - bool intentless); + bool intentless, + void *cluster); +void *qcom_glink_ept_cluster(struct rpmsg_endpoint *ept); void qcom_glink_native_remove(struct qcom_glink *glink); void qcom_glink_native_rx(struct qcom_glink *glink); diff --git a/drivers/rpmsg/qcom_glink_rpm.c b/drivers/rpmsg/qcom_glink_rpm.c index e3ba2c63a5fce..9c1ff05d4a10c 100644 --- a/drivers/rpmsg/qcom_glink_rpm.c +++ b/drivers/rpmsg/qcom_glink_rpm.c @@ -346,7 +346,7 @@ static int glink_rpm_probe(struct platform_device *pdev) 0, &rpm->rx_pipe.native, &rpm->tx_pipe.native, - true); + true, NULL); if (IS_ERR(glink)) { mbox_free_channel(rpm->mbox_chan); return PTR_ERR(glink); diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_smem.c index 35bb03e67ae8a..938f9575784e7 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -225,7 +225,8 @@ static void qcom_glink_smem_release(struct device *dev) } struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent, - struct device_node *node) + struct device_node *node, + void *cluster) { struct glink_smem_pipe *rx_pipe; struct glink_smem_pipe *tx_pipe; @@ -345,7 +346,7 @@ struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent, glink = qcom_glink_native_probe(dev, GLINK_FEATURE_INTENT_REUSE, &rx_pipe->native, &tx_pipe->native, - false); + false, cluster); if (IS_ERR(glink)) { ret = PTR_ERR(glink); goto err_free_mbox; diff --git a/drivers/rpmsg/qcom_glink_ssr.c b/drivers/rpmsg/qcom_glink_ssr.c index e71d3716c55c5..74c671a19af03 100644 --- a/drivers/rpmsg/qcom_glink_ssr.c +++ b/drivers/rpmsg/qcom_glink_ssr.c @@ -11,6 +11,8 @@ #include #include +#include "qcom_glink_native.h" + /** * struct do_cleanup_msg - The data structure for an SSR do_cleanup message * @version: The G-Link SSR protocol version @@ -55,16 +57,34 @@ struct glink_ssr { struct completion completion; }; +/** + * struct glink_ssr_notify_data - payload of an SSR notification + * @ssr_name: name of the remoteproc that has been stopped + * @cluster: cluster identifier of the remoteproc that has been stopped, + * or NULL if it is not part of a cluster + */ +struct glink_ssr_notify_data { + const char *ssr_name; + void *cluster; +}; + /* Notifier list for all registered glink_ssr instances */ static BLOCKING_NOTIFIER_HEAD(ssr_notifiers); /** * qcom_glink_ssr_notify() - notify GLINK SSR about stopped remoteproc * @ssr_name: name of the remoteproc that has been stopped + * @cluster: cluster identifier of the remoteproc that has been stopped, + * or NULL if it is not part of a cluster */ -void qcom_glink_ssr_notify(const char *ssr_name) +void qcom_glink_ssr_notify(const char *ssr_name, void *cluster) { - blocking_notifier_call_chain(&ssr_notifiers, 0, (void *)ssr_name); + struct glink_ssr_notify_data data = { + .ssr_name = ssr_name, + .cluster = cluster, + }; + + blocking_notifier_call_chain(&ssr_notifiers, 0, &data); } EXPORT_SYMBOL_GPL(qcom_glink_ssr_notify); @@ -100,18 +120,24 @@ static int qcom_glink_ssr_notifier_call(struct notifier_block *nb, void *data) { struct glink_ssr *ssr = container_of(nb, struct glink_ssr, nb); + struct glink_ssr_notify_data *notify_data = data; struct do_cleanup_msg msg; - char *ssr_name = data; + void *cluster; int ret; + /* Cluster siblings' firmware can't handle peer SSR notify; skip it */ + cluster = qcom_glink_ept_cluster(ssr->ept); + if (cluster && cluster == notify_data->cluster) + return NOTIFY_DONE; + ssr->seq_num++; reinit_completion(&ssr->completion); memset(&msg, 0, sizeof(msg)); msg.command = cpu_to_le32(GLINK_SSR_DO_CLEANUP); msg.seq_num = cpu_to_le32(ssr->seq_num); - msg.name_len = cpu_to_le32(strlen(ssr_name)); - strscpy(msg.name, ssr_name, sizeof(msg.name)); + msg.name_len = cpu_to_le32(strlen(notify_data->ssr_name)); + strscpy(msg.name, notify_data->ssr_name, sizeof(msg.name)); ret = rpmsg_send(ssr->ept, &msg, sizeof(msg)); if (ret < 0) diff --git a/include/linux/rpmsg/qcom_glink.h b/include/linux/rpmsg/qcom_glink.h index bfbd48f435fa5..6591d016e8cbb 100644 --- a/include/linux/rpmsg/qcom_glink.h +++ b/include/linux/rpmsg/qcom_glink.h @@ -8,22 +8,24 @@ struct qcom_glink_smem; #if IS_ENABLED(CONFIG_RPMSG_QCOM_GLINK) -void qcom_glink_ssr_notify(const char *ssr_name); +void qcom_glink_ssr_notify(const char *ssr_name, void *cluster); #else -static inline void qcom_glink_ssr_notify(const char *ssr_name) {} +static inline void qcom_glink_ssr_notify(const char *ssr_name, void *cluster) {} #endif #if IS_ENABLED(CONFIG_RPMSG_QCOM_GLINK_SMEM) struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent, - struct device_node *node); + struct device_node *node, + void *cluster); void qcom_glink_smem_unregister(struct qcom_glink_smem *glink); #else static inline struct qcom_glink_smem * qcom_glink_smem_register(struct device *parent, - struct device_node *node) + struct device_node *node, + void *cluster) { return NULL; } From f9b88e11f909831cb27b701ab6e192e07fc607fa Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:34 +0800 Subject: [PATCH 05/15] FROMLIST: remoteproc: qcom: pas: Track HPASS ADSP cluster membership On Nord, ADSP0/1/2 share HPASS-domain resources (PLLs, AG_NOC, RSCp, CESTA, THROTTLE, QTMR) owned by ADSP0, and their firmware cannot tolerate one member being started or stopped independently of the others. Modeling that requires each PAS instance to know which other instances it is grouped with. None of the shared resources are visible to the OS: they are programmed by TZ on the owning DSP's behalf as part of authenticating and booting its image, and the AP has no clock, reset or interconnect handle on any of them. So the grouping cannot be expressed by having each member reference the shared providers and letting the clk, reset and ICC frameworks refcount them, as it would be for resources Linux drives itself. It also is not a board property, being fixed by the SoC's HPASS design, so it comes from the compatible. Add a small registry of clusters, keyed by a static per-cluster descriptor referenced from the qcom_pas_data of every member, and join it at probe. Which instance owns the shared resources is likewise inherent to the instance, and comes from the same descriptor. Publish the cluster in rproc->cluster, which is all sysmon and glink_ssr need to stop notifying siblings of each other's SSR events. The cluster is left only after rproc_del() has stopped this member, so that the suppression is still in effect for that stop, and is unwound on every probe error path, since a member freed while still linked into the cluster would be walked by its siblings. Instances whose descriptor names no cluster are completely unaffected: qcom_pas.cluster stays NULL for them. Link: https://lore.kernel.org/r/20261201070137.360878-6-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit aa50958d3decf915ab27310d32d052c7b6c6e8bb) --- drivers/remoteproc/qcom_q6v5_pas.c | 146 +++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 24de8e9b9d75a..eb69f5d3b42b7 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -9,12 +9,14 @@ */ #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -52,6 +54,18 @@ struct tmd_name { int id; }; +/** + * struct qcom_pas_cluster_desc - static description of a cluster of PAS instances + * @name: human-readable cluster name, used in log messages + * + * One instance of this exists per cluster in a given SoC, and is referenced by + * the qcom_pas_data of every member. The pointer itself identifies the cluster, + * so members are exactly those instances whose descriptor points here. + */ +struct qcom_pas_cluster_desc { + const char *name; +}; + struct qcom_pas_data { int crash_reason_smem; const char *firmware_name; @@ -90,8 +104,13 @@ struct qcom_pas_data { * the SMMU in privilege mode. */ bool iommu_priv; + + const struct qcom_pas_cluster_desc *cluster; + bool cluster_root; }; +struct qcom_pas_cluster; + struct qcom_pas { struct device *dev; struct rproc *rproc; @@ -153,8 +172,125 @@ struct qcom_pas { struct qcom_pas_context *dtb_pas_ctx; struct qmi_tmd_client *tmd_inst; + + struct qcom_pas_cluster *cluster; + struct list_head cluster_node; + bool is_cluster_root; +}; + +/** + * struct qcom_pas_cluster - state shared by clustered PAS instances + * @desc: static description of this cluster, the key into the global list + * @list: linkage in qcom_pas_cluster_list + * @lock: protects @members and @root + * @members: list of struct qcom_pas, linked via cluster_node + * @root: the member owning the resources shared across the cluster + * @refcount: number of members currently attached to this cluster + * + * PAS instances whose descriptors reference the same qcom_pas_cluster_desc + * share one of these. + */ +struct qcom_pas_cluster { + const struct qcom_pas_cluster_desc *desc; + struct list_head list; + + struct mutex lock; + struct list_head members; + struct qcom_pas *root; + + int refcount; }; +static LIST_HEAD(qcom_pas_cluster_list); +static DEFINE_MUTEX(qcom_pas_cluster_list_lock); + +static struct qcom_pas_cluster * +qcom_pas_cluster_get(const struct qcom_pas_cluster_desc *desc) +{ + struct qcom_pas_cluster *cluster; + + guard(mutex)(&qcom_pas_cluster_list_lock); + + list_for_each_entry(cluster, &qcom_pas_cluster_list, list) { + if (cluster->desc == desc) { + cluster->refcount++; + return cluster; + } + } + + cluster = kzalloc(sizeof(*cluster), GFP_KERNEL); + if (!cluster) + return NULL; + + cluster->desc = desc; + mutex_init(&cluster->lock); + INIT_LIST_HEAD(&cluster->members); + cluster->refcount = 1; + list_add_tail(&cluster->list, &qcom_pas_cluster_list); + + return cluster; +} + +static void qcom_pas_cluster_put(struct qcom_pas_cluster *cluster) +{ + guard(mutex)(&qcom_pas_cluster_list_lock); + + if (--cluster->refcount == 0) { + list_del(&cluster->list); + kfree(cluster); + } +} + +/** + * qcom_pas_cluster_init() - join the cluster described by @desc, if any + * @pas: PAS instance being probed + * @desc: @pas's static description + * + * Cluster membership and root-ness are properties of the DSP instance itself, + * not of the board, so both come from the compatible via @desc. Instances + * whose descriptor names no cluster are not part of one; @pas->cluster is left + * NULL and this is a no-op (e.g. cdsp0-3). + * + * Return: 0 on success, negative errno on failure. + */ +static int qcom_pas_cluster_init(struct qcom_pas *pas, + const struct qcom_pas_data *desc) +{ + if (!desc->cluster) + return 0; + + pas->cluster = qcom_pas_cluster_get(desc->cluster); + if (!pas->cluster) + return -ENOMEM; + + pas->is_cluster_root = desc->cluster_root; + + scoped_guard(mutex, &pas->cluster->lock) { + list_add_tail(&pas->cluster_node, &pas->cluster->members); + if (pas->is_cluster_root) + pas->cluster->root = pas; + } + + return 0; +} + +static void qcom_pas_cluster_exit(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster = pas->cluster; + + if (!cluster) + return; + + scoped_guard(mutex, &cluster->lock) { + list_del(&pas->cluster_node); + if (cluster->root == pas) + cluster->root = NULL; + } + + qcom_pas_cluster_put(cluster); + pas->cluster = NULL; +} + static void qcom_pas_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, void *dest, size_t offset, size_t size) @@ -984,6 +1120,12 @@ static int qcom_pas_probe(struct platform_device *pdev) pas = rproc->priv; pas->dev = &pdev->dev; pas->rproc = rproc; + + ret = qcom_pas_cluster_init(pas, desc); + if (ret) + return ret; + rproc->cluster = pas->cluster; + pas->minidump_id = desc->minidump_id; pas->pas_id = desc->pas_id; pas->lite_pas_id = desc->lite_pas_id; @@ -1092,6 +1234,7 @@ static int qcom_pas_probe(struct platform_device *pdev) qcom_pas_unassign_memory_region(pas); free_rproc: device_init_wakeup(pas->dev, false); + qcom_pas_cluster_exit(pas); return ret; } @@ -1108,6 +1251,9 @@ static void qcom_pas_remove(struct platform_device *pdev) if (pas->tmd_inst) qmi_tmd_exit(pas->tmd_inst); + pas->rproc->cluster = NULL; + qcom_pas_cluster_exit(pas); + qcom_q6v5_deinit(&pas->q6v5); qcom_pas_unassign_memory_region(pas); qcom_remove_glink_subdev(pas->rproc, &pas->glink_subdev); From 6b9a3f50c5af4d7bd6868749c4077af0d33b04a1 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:35 +0800 Subject: [PATCH 06/15] FROMLIST: remoteproc: qcom: pas: Sequence HPASS ADSP cluster boot root-first The cluster root owns the HPASS resources shared with its siblings and initializes them as part of its own boot, so ADSP1/ADSP2 can only cold boot once ADSP0 is up. Booting a dependent member first leaves it without the clocks, resets and NoC configuration it needs. Gate a dependent member's qcom_pas_start() on the root having started. The root being enabled in DT does not imply it has already bound, as probe order between the two is not guaranteed, so fail the boot if the root has not bound rather than dereferencing it. If the root has bound but is not running yet, wait briefly on a completion the root signals from its own qcom_pas_start(), so that a member racing the root through a restart does not fail outright. The completion is signaled by the root's successful start or attach, and only cleared again once the root's own qcom_pas_stop() runs. It starts out cleared, so that a dependent member cold booted alongside the root, e.g. with both auto-booting, still waits for it. A root that has crashed but whose recovery has not stopped it yet leaves the completion signaled, so a dependent member observing it fails on the root's RPROC_CRASHED state instead. The state check cannot be RPROC_RUNNING, as the root signals the completion from its ops->start, before the remoteproc core marks it running. The wait is bounded at 10 s, enough for a whole root boot, which may spend up to 5 s in qcom_q6v5_wait_for_start() alone. Link: https://lore.kernel.org/r/20261201070137.360878-7-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit 64fae3fc079ad71b29273887cd386bc8de026331) --- drivers/remoteproc/qcom_q6v5_pas.c | 87 ++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index eb69f5d3b42b7..daba38199a602 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -185,6 +185,7 @@ struct qcom_pas { * @lock: protects @members and @root * @members: list of struct qcom_pas, linked via cluster_node * @root: the member owning the resources shared across the cluster + * @root_booted: signaled once @root has started, cleared when it goes down * @refcount: number of members currently attached to this cluster * * PAS instances whose descriptors reference the same qcom_pas_cluster_desc @@ -197,10 +198,22 @@ struct qcom_pas_cluster { struct mutex lock; struct list_head members; struct qcom_pas *root; + struct completion root_booted; int refcount; }; +/* + * How long a dependent member waits for its root to finish booting before + * giving up. This has to outlast a whole root boot, which may spend up to 5 s + * in qcom_q6v5_wait_for_start() alone, whether the two are cold booting + * together or the root is being restarted after a crash. A dependent that + * gives up early from crash recovery stays offline, as rproc_boot_recovery() + * does not release its rproc power reference on failure, making any later + * rproc_boot() a no-op. + */ +#define QCOM_PAS_CLUSTER_ROOT_BOOT_TIMEOUT (10 * HZ) + static LIST_HEAD(qcom_pas_cluster_list); static DEFINE_MUTEX(qcom_pas_cluster_list_lock); @@ -225,6 +238,7 @@ qcom_pas_cluster_get(const struct qcom_pas_cluster_desc *desc) cluster->desc = desc; mutex_init(&cluster->lock); INIT_LIST_HEAD(&cluster->members); + init_completion(&cluster->root_booted); cluster->refcount = 1; list_add_tail(&cluster->list, &qcom_pas_cluster_list); @@ -291,6 +305,62 @@ static void qcom_pas_cluster_exit(struct qcom_pas *pas) pas->cluster = NULL; } +/** + * qcom_pas_cluster_wait_for_root() - gate a dependent member's boot on its root + * @pas: the non-root cluster member being started + * + * The cluster root owns the resources its siblings need, and initializes them + * as part of its own boot, so a dependent member can only be started once the + * root is up. + * + * Return: 0 if the root is up, negative errno otherwise. + */ +static int qcom_pas_cluster_wait_for_root(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster = pas->cluster; + struct rproc *root; + + /* + * The root's PAS instance has not necessarily bound yet, and may have + * unbound again. Without it there is nothing to sequence this member's + * boot against, so fail rather than boot into a DSP whose shared + * resources were never initialized. + * + * Note that nothing refcounts members across unbind, so a root freed + * under a concurrent sibling boot remains unhandled. + */ + scoped_guard(mutex, &cluster->lock) + root = cluster->root ? cluster->root->rproc : NULL; + + if (!root) { + dev_err(pas->dev, "cluster root not bound\n"); + return -ENODEV; + } + + if (root->state == RPROC_RUNNING || root->state == RPROC_ATTACHED) + return 0; + + if (!wait_for_completion_timeout(&cluster->root_booted, + QCOM_PAS_CLUSTER_ROOT_BOOT_TIMEOUT)) { + dev_err(pas->dev, "cluster root not started\n"); + return -ENODEV; + } + + /* + * The completion is only re-armed once the root's own qcom_pas_stop() + * runs, so a root that has crashed but not been stopped yet still + * leaves it signaled. Don't trust it then. Any other state is fine: + * the root signals this from inside ops->start, before the core moves + * it to RPROC_RUNNING. + */ + if (root->state == RPROC_CRASHED) { + dev_err(pas->dev, "cluster root crashed\n"); + return -ENODEV; + } + + return 0; +} + static void qcom_pas_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, void *dest, size_t offset, size_t size) @@ -470,6 +540,12 @@ static int qcom_pas_start(struct rproc *rproc) struct qcom_pas *pas = rproc->priv; int ret; + if (pas->cluster && !pas->is_cluster_root) { + ret = qcom_pas_cluster_wait_for_root(pas); + if (ret) + return ret; + } + ret = qcom_q6v5_prepare(&pas->q6v5); if (ret) return ret; @@ -540,6 +616,9 @@ static int qcom_pas_start(struct rproc *rproc) if (pas->dtb_pas_id) qcom_pas_metadata_release(pas->dtb_pas_ctx); + if (pas->cluster && pas->is_cluster_root) + complete_all(&pas->cluster->root_booted); + /* firmware is used to pass reference from qcom_pas_start(), drop it now */ pas->firmware = NULL; @@ -596,6 +675,11 @@ static int qcom_pas_stop(struct rproc *rproc) int dtb_ret; int ret; + if (pas->cluster && pas->is_cluster_root) { + scoped_guard(mutex, &pas->cluster->lock) + reinit_completion(&pas->cluster->root_booted); + } + ret = qcom_q6v5_request_stop(&pas->q6v5, pas->sysmon); if (ret == -ETIMEDOUT) dev_err(pas->dev, "timed out on wait\n"); @@ -731,6 +815,9 @@ static int qcom_pas_attach(struct rproc *rproc) qcom_q6v5_report_fatal(&pas->q6v5); } + if (pas->cluster && pas->is_cluster_root) + complete_all(&pas->cluster->root_booted); + return 0; disable_running: From 71f76d1af0c054901ce2d6e640d9a5d7942c0a2a Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:36 +0800 Subject: [PATCH 07/15] FROMLIST: remoteproc: qcom: pas: Enforce coupled stop/crash for HPASS ADSP clusters The firmware of a Nord HPASS ADSP cluster cannot tolerate one member being stopped or restarted independently of the others: doing so leaves sysmon/glink_ssr notify requests to siblings timing out, and the whole cluster unable to recover without manually stopping all three and restarting them in dependency order. Coordinate an explicit stop or crash of any member across the whole cluster in two phases, since hardware testing showed that whichever member's PAS/TZ hardware power-off happens chronologically last always fails its own graceful shutdown ack (both the sysmon SSCTL QMI ack and the SMEM-bit/IRQ ack), regardless of whether that member is the cluster root. Phase 1 fans the stop out to every participant concurrently via a per-member work item and waits, at a barrier, for every participant to finish requesting and awaiting its own graceful ack while the whole cluster is still fully powered. Only once every participant has cleared the barrier does phase 2 let each of them proceed to its actual PAS/TZ hardware power-off, so no member is ever asking firmware to ack a shutdown after a sibling's hardware is already gone. The fan-out has to be deferred to a work item rather than calling rproc_shutdown() inline, because qcom_pas_stop() runs with the remoteproc core holding the stopping member's own rproc->lock, and reaching for a sibling's rproc->lock from inside that critical section would risk an ABBA deadlock against a concurrent operation on that sibling. Membership in a round is decided once, by qcom_pas_cluster_member_stops(), and recorded per member, so that the participant count and the two counters it seeds can never diverge. The crashed member that triggered the round is a participant even though its rproc->state is still RPROC_CRASHED -- the core only sets RPROC_OFFLINE after ops->stop() returns. So is a sibling that crashed concurrently: its own recovery drives it through qcom_pas_stop() and thus the barrier, and leaving it out would let it power off unsynchronized and start again while the root is still being torn down. Such a sibling is neither stopped by a work item, which would drop the power reference its recovery holds, nor restarted by the cascade, which would boot it twice. A participant whose work item does not get it into qcom_pas_stop() after all, because rproc_shutdown() only dropped one of several power references, or because the member is being removed and the work item was cancelled, is withdrawn from the round, so that the rest of the cluster is not left waiting for it. On a crash, cascade the stop the same way but also auto-restart the whole cluster root-first once every participant has fully powered off, reusing the root_booted completion to keep non-root members' qcom_pas_start() from racing ahead of the root's boot. The members to restart are marked when the round starts, and the cascade picks them one at a time under the cluster lock, as membership may change while it runs. An explicit stop leaves the ordered restart to users or higher-level policy. Instances whose descriptor names no cluster are completely unaffected, since qcom_pas.cluster stays NULL for them. Link: https://lore.kernel.org/r/20261201070137.360878-8-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit bea47eec1903247319bd408fd5cbd05e9b1a21bc) --- drivers/remoteproc/qcom_q6v5_pas.c | 357 +++++++++++++++++++++++++++++ 1 file changed, 357 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index daba38199a602..8f201e990c8ef 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -175,7 +176,11 @@ struct qcom_pas { struct qcom_pas_cluster *cluster; struct list_head cluster_node; + struct work_struct stop_work; bool is_cluster_root; + bool in_cluster_stop; + bool self_recovering; + bool cascade_boot; }; /** @@ -186,6 +191,12 @@ struct qcom_pas { * @members: list of struct qcom_pas, linked via cluster_node * @root: the member owning the resources shared across the cluster * @root_booted: signaled once @root has started, cleared when it goes down + * @cascade_work: deferred work that restarts the cluster after a crash + * @cascade_crashed: true if the current round was triggered by a crash + * @stop_in_progress: re-entrancy guard: a coordinated stop is in flight + * @stop_pending: participants still owing a phase-1 graceful-ack attempt + * @stop_barrier: released once @stop_pending reaches 0 + * @stop_done_pending: participants still owing a phase-2 hardware power-off * @refcount: number of members currently attached to this cluster * * PAS instances whose descriptors reference the same qcom_pas_cluster_desc @@ -200,6 +211,14 @@ struct qcom_pas_cluster { struct qcom_pas *root; struct completion root_booted; + struct work_struct cascade_work; + bool cascade_crashed; + bool stop_in_progress; + + int stop_pending; + struct completion stop_barrier; + int stop_done_pending; + int refcount; }; @@ -214,9 +233,106 @@ struct qcom_pas_cluster { */ #define QCOM_PAS_CLUSTER_ROOT_BOOT_TIMEOUT (10 * HZ) +/* + * How long a member waits at the phase-1 barrier for the rest of the cluster, + * in case a participant never reaches it at all (e.g. rproc_stop() bails out + * before calling ops->stop). + */ +#define QCOM_PAS_CLUSTER_STOP_TIMEOUT (20 * HZ) + static LIST_HEAD(qcom_pas_cluster_list); static DEFINE_MUTEX(qcom_pas_cluster_list_lock); +static void qcom_pas_cluster_withdraw(struct qcom_pas *pas); + +static void qcom_pas_stop_work_fn(struct work_struct *work) +{ + struct qcom_pas *pas = container_of(work, struct qcom_pas, stop_work); + + rproc_shutdown(pas->rproc); + + /* + * rproc_shutdown() only gets to qcom_pas_stop() once the last rproc + * power reference is dropped, and not at all if the member went down + * in the meantime. Either way the member then never reaches the + * barrier, so take it out of the round rather than leave the rest of + * the cluster waiting on it. A no-op if it did take part. + */ + qcom_pas_cluster_withdraw(pas); +} + +/* + * Pick the next member the cascade has to boot, root first, see + * qcom_pas_cluster_cascade_work(). + */ +static struct qcom_pas *qcom_pas_cluster_next_boot(struct qcom_pas_cluster *cluster) +{ + struct qcom_pas *pas; + + guard(mutex)(&cluster->lock); + + if (cluster->root && cluster->root->cascade_boot) { + cluster->root->cascade_boot = false; + return cluster->root; + } + + list_for_each_entry(pas, &cluster->members, cluster_node) { + if (pas->cascade_boot) { + pas->cascade_boot = false; + return pas; + } + } + + return NULL; +} + +/** + * qcom_pas_cluster_cascade_work() - restart a crashed cluster, root first + * @work: the cluster's cascade_work + * + * Only ever scheduled from qcom_pas_cluster_stop_complete(), i.e. only after + * every participant has finished its own phase-2 hardware power-off, and only + * when the round that just finished was a crash; explicit stops never + * auto-restart. + */ +static void qcom_pas_cluster_cascade_work(struct work_struct *work) +{ + struct qcom_pas_cluster *cluster = container_of(work, struct qcom_pas_cluster, + cascade_work); + struct qcom_pas *pas; + int ret; + + /* + * Only the participants qcom_pas_cluster_trigger_stop() marked with + * cascade_boot are booted from here. Members driven by their own + * crash-recovery thread are not marked: the origin, and any sibling + * that crashed concurrently with it. Calling rproc_boot() on those + * would either be a silent no-op or leak a power reference, since + * rproc_boot_recovery() keeps the one it was entered with. Members + * that joined or left since the round started are not marked either, + * and each one is picked under cluster->lock, so that membership may + * change while rproc_boot() runs. + * + * The root, when marked, has to be booted before any other member: + * a dependent member's qcom_pas_start() blocks on cluster->root_booted, + * and booting it first from this single-threaded work item would make + * it wait out its timeout on a root boot this same thread has not + * issued yet. A dependent booted while the root is still being + * restarted by its own recovery blocks there until it is up. + */ + while ((pas = qcom_pas_cluster_next_boot(cluster))) { + ret = rproc_boot(pas->rproc); + if (!ret) + continue; + + dev_err(pas->dev, "failed to restart cluster member: %d\n", ret); + + /* Without the root none of its dependents can boot either */ + if (pas->is_cluster_root) + break; + } +} + static struct qcom_pas_cluster * qcom_pas_cluster_get(const struct qcom_pas_cluster_desc *desc) { @@ -239,6 +355,8 @@ qcom_pas_cluster_get(const struct qcom_pas_cluster_desc *desc) mutex_init(&cluster->lock); INIT_LIST_HEAD(&cluster->members); init_completion(&cluster->root_booted); + init_completion(&cluster->stop_barrier); + INIT_WORK(&cluster->cascade_work, qcom_pas_cluster_cascade_work); cluster->refcount = 1; list_add_tail(&cluster->list, &qcom_pas_cluster_list); @@ -278,6 +396,7 @@ static int qcom_pas_cluster_init(struct qcom_pas *pas, return -ENOMEM; pas->is_cluster_root = desc->cluster_root; + INIT_WORK(&pas->stop_work, qcom_pas_stop_work_fn); scoped_guard(mutex, &pas->cluster->lock) { list_add_tail(&pas->cluster_node, &pas->cluster->members); @@ -295,12 +414,23 @@ static void qcom_pas_cluster_exit(struct qcom_pas *pas) if (!cluster) return; + /* Leave the cluster first, so that no new round can schedule stop_work */ scoped_guard(mutex, &cluster->lock) { list_del(&pas->cluster_node); if (cluster->root == pas) cluster->root = NULL; } + /* + * A stop_work cancelled before it ran leaves this member owing the + * current round its stop, so withdraw it from the round, which may + * end it. Let a cascade started by that, or by any earlier round, + * finish restarting the remaining members, rather than cancelling it. + */ + cancel_work_sync(&pas->stop_work); + qcom_pas_cluster_withdraw(pas); + flush_work(&cluster->cascade_work); + qcom_pas_cluster_put(cluster); pas->cluster = NULL; } @@ -361,6 +491,222 @@ static int qcom_pas_cluster_wait_for_root(struct qcom_pas *pas) return 0; } +/* + * A sibling that crashed concurrently with @origin is driven by its own + * recovery: that recovery calls into qcom_pas_stop(), so the sibling does reach + * this round's barrier, and it restarts the sibling afterwards, so the cascade + * must not restart it a second time. + * + * With recovery disabled nothing will drive its stop, so it cannot be enrolled. + */ +static bool qcom_pas_cluster_member_self_recovers(struct qcom_pas *member, + struct qcom_pas *origin) +{ + return member != origin && + member->rproc->state == RPROC_CRASHED && + !member->rproc->recovery_disabled; +} + +/* + * A member takes part in a coordinated stop if its hardware is still powered: + * either it is running or attached, or it crashed -- the origin, whose + * rproc->state is RPROC_CRASHED and only becomes RPROC_OFFLINE once its + * ops->stop() has returned, or a sibling that crashed concurrently and is being + * torn down by its own recovery. + * + * Leaving a concurrently crashed sibling out of the round would let it race + * ahead of the round it is nonetheless part of: it would power its hardware off + * without waiting for the rest of the cluster to be acked, and then start again + * while the root is still being torn down. + */ +static bool qcom_pas_cluster_member_stops(struct qcom_pas *member, + struct qcom_pas *origin) +{ + if (member == origin) + return true; + + if (qcom_pas_cluster_member_self_recovers(member, origin)) + return true; + + return member->rproc->state == RPROC_RUNNING || + member->rproc->state == RPROC_ATTACHED; +} + +/** + * qcom_pas_cluster_trigger_stop() - begin a coordinated cluster stop + * @pas: the member that is being stopped or has crashed + * @crashed: true if @pas crashed, rather than being stopped explicitly + * + * Marks every member whose hardware is still powered as a participant of this + * round and fires off each *other* participant's own full stop concurrently + * via its stop_work, instead of one after another. This lets every + * participant's phase-1 graceful-ack attempt (see qcom_pas_stop()) run while + * all of them are still fully powered, so nobody is asking firmware to ack a + * shutdown after a sibling's hardware is already gone. + * + * A no-op if a coordinated stop is already in flight, e.g. when @pas is a + * sibling whose own stop was itself triggered by this same round: @pas is + * already marked as a participant and just goes on to take part in it. + * + * Must not call rproc_shutdown()/rproc_boot() directly from here: this runs + * from inside qcom_pas_stop(), which the remoteproc core calls with @pas's own + * rproc->lock held, and taking a sibling's rproc->lock synchronously from + * within that critical section would risk an ABBA deadlock against a + * concurrent operation on the sibling. + */ +static void qcom_pas_cluster_trigger_stop(struct qcom_pas *pas, bool crashed) +{ + struct qcom_pas_cluster *cluster = pas->cluster; + struct qcom_pas *member; + int active = 0; + + guard(mutex)(&cluster->lock); + + if (cluster->stop_in_progress) + return; + + cluster->stop_in_progress = true; + cluster->cascade_crashed = crashed; + + list_for_each_entry(member, &cluster->members, cluster_node) { + member->self_recovering = qcom_pas_cluster_member_self_recovers(member, pas); + member->in_cluster_stop = qcom_pas_cluster_member_stops(member, pas); + member->cascade_boot = member->in_cluster_stop && member != pas && + !member->self_recovering; + if (member->in_cluster_stop) + active++; + } + + cluster->stop_pending = active; + cluster->stop_done_pending = active; + reinit_completion(&cluster->stop_barrier); + + /* + * Fan out while still holding the lock, so that membership cannot + * change between counting the participants and scheduling them, and so + * that a stop_work running immediately blocks in + * qcom_pas_cluster_stop_barrier() until the counters above are in + * place. schedule_work() does not sleep, so it is safe from here. + * + * A self-recovering participant is left alone: its own recovery already + * drives it through qcom_pas_stop(), and calling rproc_shutdown() on it + * from here would drop the rproc power reference that recovery holds. + */ + list_for_each_entry(member, &cluster->members, cluster_node) { + if (member == pas || !member->in_cluster_stop || + member->self_recovering) + continue; + + schedule_work(&member->stop_work); + } +} + +/** + * qcom_pas_cluster_stop_barrier() - wait for the whole cluster's phase-1 ack + * @pas: the member calling this from inside its own qcom_pas_stop() + * + * Blocks this member's own hardware power-off until every other participant + * has also finished its phase-1 graceful-ack attempt (see qcom_pas_stop()). + * Bounded by QCOM_PAS_CLUSTER_STOP_TIMEOUT, proceeding to phase 2 anyway + * rather than hanging forever. + * + * A member that is not a participant of the current round, having already been + * powered off before it started, has no ack to contribute and must not touch + * the counters. + */ +static void qcom_pas_cluster_stop_barrier(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster = pas->cluster; + + scoped_guard(mutex, &cluster->lock) { + if (!pas->in_cluster_stop) + return; + if (--cluster->stop_pending == 0) + complete_all(&cluster->stop_barrier); + } + + if (!wait_for_completion_timeout(&cluster->stop_barrier, + QCOM_PAS_CLUSTER_STOP_TIMEOUT)) + dev_warn(pas->dev, "timed out waiting for cluster stop barrier\n"); +} + +/* + * Drop @pas from the current round, which ends with the last participant. + * Returns true if that was the last one, and the round was triggered by a + * crash, i.e. the caller has to schedule the root-first restart cascade. + */ +static bool qcom_pas_cluster_leave_round(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster = pas->cluster; + + lockdep_assert_held(&cluster->lock); + + pas->in_cluster_stop = false; + + if (--cluster->stop_done_pending != 0) + return false; + + cluster->stop_in_progress = false; + + return cluster->cascade_crashed; +} + +/** + * qcom_pas_cluster_stop_complete() - record this member's phase-2 completion + * @pas: the member calling this from inside its own qcom_pas_stop() + * + * The last participant to call this, i.e. the last to finish powering off its + * own hardware, ends the round and, if it was triggered by a crash, schedules + * the root-first restart cascade. + */ +static void qcom_pas_cluster_stop_complete(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster = pas->cluster; + bool crashed; + + scoped_guard(mutex, &cluster->lock) { + if (!pas->in_cluster_stop) + return; + + crashed = qcom_pas_cluster_leave_round(pas); + } + + if (crashed) + schedule_work(&cluster->cascade_work); +} + +/** + * qcom_pas_cluster_withdraw() - take a participant out of the current round + * @pas: a participant that will not go through qcom_pas_stop() after all + * + * For a participant whose stop_work did not get it to qcom_pas_stop(), either + * because rproc_shutdown() returned without stopping it or because the work + * was cancelled before it ran. It never reached the barrier, so account for + * both its phase-1 and phase-2 share, letting the round end without it. It is + * not restarted by the cascade either, as it was never stopped. + */ +static void qcom_pas_cluster_withdraw(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster = pas->cluster; + bool crashed; + + scoped_guard(mutex, &cluster->lock) { + if (!pas->in_cluster_stop) + return; + + dev_warn(pas->dev, "not stopped along with the cluster\n"); + + pas->cascade_boot = false; + if (--cluster->stop_pending == 0) + complete_all(&cluster->stop_barrier); + + crashed = qcom_pas_cluster_leave_round(pas); + } + + if (crashed) + schedule_work(&cluster->cascade_work); +} + static void qcom_pas_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, void *dest, size_t offset, size_t size) @@ -680,10 +1026,18 @@ static int qcom_pas_stop(struct rproc *rproc) reinit_completion(&pas->cluster->root_booted); } + if (pas->cluster) + qcom_pas_cluster_trigger_stop(pas, rproc->state == RPROC_CRASHED); + + /* Phase 1: request and await this member's own graceful ack */ ret = qcom_q6v5_request_stop(&pas->q6v5, pas->sysmon); if (ret == -ETIMEDOUT) dev_err(pas->dev, "timed out on wait\n"); + if (pas->cluster) + qcom_pas_cluster_stop_barrier(pas); + + /* Phase 2: the whole cluster has acked, power the hardware off */ ret = qcom_pas_shutdown(pas->pas_id); if (ret && pas->decrypt_shutdown) ret = qcom_pas_shutdown_poll_decrypt(pas); @@ -711,6 +1065,9 @@ static int qcom_pas_stop(struct rproc *rproc) if (pas->smem_host_id) ret = qcom_smem_bust_hwspin_lock_by_host(pas->smem_host_id); + if (pas->cluster) + qcom_pas_cluster_stop_complete(pas); + return ret; } From f6804b12bd306ca74c08e8804a2cc4169b6e2844 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 15:01:37 +0800 Subject: [PATCH 08/15] FROMLIST: remoteproc: qcom: pas: Add Nord ADSP1/2 support Add support for the additional Hexagon ADSP cores on Nord, adsp1 and adsp2, which sit alongside the existing adsp0 in HPASS. The three form a cluster: TZ programs the resources they share while booting adsp0's image, so adsp0 has to boot first and none of the three can be stopped while another still runs. Point all three descriptors at a common cluster descriptor, marking adsp0 as the owner, which is what the cluster sequencing and coupled-stop code keys off. Link: https://lore.kernel.org/r/20261201070137.360878-9-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit bf5c88ed4d0ccf49f57ac066cb6d794a649de1ed) --- drivers/remoteproc/qcom_q6v5_pas.c | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 8f201e990c8ef..3b3fe8b42eb40 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -2197,6 +2197,16 @@ static const struct qcom_pas_data milos_cdsp_resource = { .smem_host_id = 5, }; +/* + * Nord's HPASS hosts three QDSP6 instances, ADSP0/1/2, sharing resources that + * TZ programs on ADSP0's behalf while booting its image. ADSP0 therefore has + * to be booted before its siblings, and none of the three can be stopped while + * another is still running. + */ +static const struct qcom_pas_cluster_desc nord_hpass_cluster = { + .name = "nord-hpass-adsp", +}; + static const struct qcom_pas_data nord_adsp_resource = { .crash_reason_smem = 423, .firmware_name = "adsp.mbn", @@ -2215,6 +2225,52 @@ static const struct qcom_pas_data nord_adsp_resource = { .sysmon_name = "adsp", .ssctl_id = 0x14, .smem_host_id = 2, + .cluster = &nord_hpass_cluster, + .cluster_root = true, +}; + +static const struct qcom_pas_data nord_adsp1_resource = { + .crash_reason_smem = 663, + .firmware_name = "adsp1.mbn", + .dtb_firmware_name = "adsp1_dtb.mbn", + .pas_id = 53, + .dtb_pas_id = 55, + .minidump_id = 21, + .auto_boot = true, + .early_boot = true, + .proxy_pd_names = (char*[]){ + "cx", + "mx", + NULL + }, + .load_state = "adsp1", + .ssr_name = "lpass1", + .sysmon_name = "adsp1", + .ssctl_id = 0x1d, + .smem_host_id = 66, + .cluster = &nord_hpass_cluster, +}; + +static const struct qcom_pas_data nord_adsp2_resource = { + .crash_reason_smem = 664, + .firmware_name = "adsp2.mbn", + .dtb_firmware_name = "adsp2_dtb.mbn", + .pas_id = 54, + .dtb_pas_id = 56, + .minidump_id = 22, + .auto_boot = true, + .early_boot = true, + .proxy_pd_names = (char*[]){ + "cx", + "mx", + NULL + }, + .load_state = "adsp2", + .ssr_name = "lpass2", + .sysmon_name = "adsp2", + .ssctl_id = 0x1e, + .smem_host_id = 130, + .cluster = &nord_hpass_cluster, }; static const struct qcom_pas_data nord_cdsp0_resource = { @@ -2645,6 +2701,8 @@ static const struct of_device_id qcom_pas_of_match[] = { { .compatible = "qcom,msm8998-adsp-pas", .data = &msm8996_adsp_resource }, { .compatible = "qcom,msm8998-slpi-pas", .data = &msm8996_slpi_resource_init }, { .compatible = "qcom,nord-adsp-pas", .data = &nord_adsp_resource }, + { .compatible = "qcom,nord-adsp1-pas", .data = &nord_adsp1_resource }, + { .compatible = "qcom,nord-adsp2-pas", .data = &nord_adsp2_resource }, { .compatible = "qcom,nord-cdsp0-pas", .data = &nord_cdsp0_resource }, { .compatible = "qcom,nord-cdsp1-pas", .data = &nord_cdsp1_resource }, { .compatible = "qcom,nord-cdsp2-pas", .data = &nord_cdsp2_resource }, From d9f298052de3efde547d775e498d3d15e16a38cf Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 17:02:19 +0800 Subject: [PATCH 09/15] FROMLIST: dt-bindings: misc: qcom,fastrpc: Add adsp1 and adsp2 labels Nord has three ADSP instances. Add labels for adsp1 and adsp2. Link: https://lore.kernel.org/r/20261201090219.414376-1-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit c26b598a79bed0057cec01da226d73d304c0fd2d) --- Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml index 49d2a5e8ba39f..eb3a09929b431 100644 --- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml +++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml @@ -33,6 +33,8 @@ properties: label: enum: - adsp + - adsp1 + - adsp2 - mdsp - sdsp - cdsp From 7b118c240a03ce9139c309dc860d6a66ce4ff31c Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 17:17:25 +0800 Subject: [PATCH 10/15] FROMLIST: arm64: dts: qcom: nord: Add remoteproc for ADSP1/2 Add device tree nodes to support ADSP1/2 which share HPASS clock/reset/NoC resources with ADSP0 and must boot after it. The cluster relationship and ADSP0's ownership of the shared resources are implied by the per-instance compatibles, so no additional property is needed. Link: https://lore.kernel.org/r/20261201091727.415871-2-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit ebbec70898520fb9e8313b762d5837b5bb8e0cd4) --- arch/arm64/boot/dts/qcom/nord-embedded.dtsi | 22 ++ arch/arm64/boot/dts/qcom/nord.dtsi | 220 ++++++++++++++++++++ 2 files changed, 242 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi index 4f36a45002d87..149166d3b7a58 100644 --- a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi +++ b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi @@ -1831,6 +1831,28 @@ "mx"; }; +&remoteproc_adsp1 { + clocks = <&rpmhcc RPMH_CXO_CLK>; + clock-names = "xo"; + interconnects = <&hpass_ag_noc MASTER_HPASS_PROC_1 QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + power-domains = <&rpmhpd RPMHPD_CX>, + <&rpmhpd RPMHPD_MX>; + power-domain-names = "cx", + "mx"; +}; + +&remoteproc_adsp2 { + clocks = <&rpmhcc RPMH_CXO_CLK>; + clock-names = "xo"; + interconnects = <&hpass_ag_noc MASTER_HPASS_PROC_2 QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + power-domains = <&rpmhpd RPMHPD_CX>, + <&rpmhpd RPMHPD_MX>; + power-domain-names = "cx", + "mx"; +}; + &remoteproc_cdsp0 { clocks = <&rpmhcc RPMH_CXO_CLK>; clock-names = "xo"; diff --git a/arch/arm64/boot/dts/qcom/nord.dtsi b/arch/arm64/boot/dts/qcom/nord.dtsi index 7267f2cddf4ae..73b07ed90a60d 100644 --- a/arch/arm64/boot/dts/qcom/nord.dtsi +++ b/arch/arm64/boot/dts/qcom/nord.dtsi @@ -975,6 +975,52 @@ }; }; + smp2p-adsp1 { + compatible = "qcom,smp2p"; + interrupts-extended = <&ipcc0 IPCC_MPROC_ADSP1 + IPCC_MPROC_SIGNAL_SMP2P + IRQ_TYPE_EDGE_RISING>; + mboxes = <&ipcc0 IPCC_MPROC_ADSP1 + IPCC_MPROC_SIGNAL_SMP2P>; + qcom,smem = <617>, <616>; + qcom,local-pid = <0>; + qcom,remote-pid = <66>; + + smp2p_adsp1_out: master-kernel { + qcom,entry-name = "master-kernel"; + #qcom,smem-state-cells = <1>; + }; + + smp2p_adsp1_in: slave-kernel { + qcom,entry-name = "slave-kernel"; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + + smp2p-adsp2 { + compatible = "qcom,smp2p"; + interrupts-extended = <&ipcc0 IPCC_MPROC_ADSP2 + IPCC_MPROC_SIGNAL_SMP2P + IRQ_TYPE_EDGE_RISING>; + mboxes = <&ipcc0 IPCC_MPROC_ADSP2 + IPCC_MPROC_SIGNAL_SMP2P>; + qcom,smem = <617>, <616>; + qcom,local-pid = <0>; + qcom,remote-pid = <130>; + + smp2p_adsp2_out: master-kernel { + qcom,entry-name = "master-kernel"; + #qcom,smem-state-cells = <1>; + }; + + smp2p_adsp2_in: slave-kernel { + qcom,entry-name = "slave-kernel"; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + smp2p-cdsp0 { compatible = "qcom,smp2p"; interrupts-extended = <&ipcc0 IPCC_MPROC_NSP0 @@ -2891,6 +2937,180 @@ }; }; + remoteproc_adsp1: remoteproc@6000000 { + compatible = "qcom,nord-adsp1-pas"; + reg = <0x0 0x06000000 0x0 0x10000>; + + interrupts-extended = <&intc GIC_SPI 155 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp1_in 0 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp1_in 1 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp1_in 2 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp1_in 3 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp1_in 7 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "wdog", + "fatal", + "ready", + "handover", + "stop-ack", + "shutdown-ack"; + + memory-region = <&hpass_dsp1_mem>, + <&hpass_dsp1_dtb_mem>; + + qcom,qmp = <&aoss_qmp>; + + qcom,smem-states = <&smp2p_adsp1_out 0>; + qcom,smem-state-names = "stop"; + + status = "disabled"; + + glink-edge { + interrupts-extended = <&ipcc0 IPCC_MPROC_ADSP1 + IPCC_MPROC_SIGNAL_GLINK_QMP + IRQ_TYPE_EDGE_RISING>; + mboxes = <&ipcc0 IPCC_MPROC_ADSP1 + IPCC_MPROC_SIGNAL_GLINK_QMP>; + qcom,remote-pid = <66>; + label = "adsp1"; + + fastrpc { + compatible = "qcom,nord-fastrpc", + "qcom,kaanapali-fastrpc"; + qcom,glink-channels = "fastrpcglink-apps-dsp"; + label = "adsp1"; + #address-cells = <1>; + #size-cells = <0>; + + compute-cb@11 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <11>; + iommus = <&apps_smmu_0 0x0a0b 0x0040>, + <&apps_smmu_0 0x0a4b 0x0040>, + <&apps_smmu_0 0x0a6b 0x0000>, + <&apps_smmu_0 0x0a8b 0x0000>; + dma-coherent; + }; + + compute-cb@12 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <12>; + iommus = <&apps_smmu_0 0x0a0c 0x0080>, + <&apps_smmu_0 0x0a4c 0x0020>, + <&apps_smmu_0 0x0a6c 0x0020>, + <&apps_smmu_0 0x0a8c 0x0080>; + dma-coherent; + }; + + compute-cb@13 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <13>; + iommus = <&apps_smmu_0 0x0a0d 0x0080>, + <&apps_smmu_0 0x0a4d 0x0020>, + <&apps_smmu_0 0x0a6d 0x0020>, + <&apps_smmu_0 0x0a8d 0x0080>; + dma-coherent; + }; + + compute-cb@14 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <14>; + iommus = <&apps_smmu_0 0x0a0e 0x0080>, + <&apps_smmu_0 0x0a4e 0x0020>, + <&apps_smmu_0 0x0a6e 0x0020>, + <&apps_smmu_0 0x0a8e 0x0080>; + dma-coherent; + }; + }; + }; + }; + + remoteproc_adsp2: remoteproc@6100000 { + compatible = "qcom,nord-adsp2-pas"; + reg = <0x0 0x06100000 0x0 0x10000>; + + interrupts-extended = <&intc GIC_SPI 178 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp2_in 0 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp2_in 1 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp2_in 2 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp2_in 3 IRQ_TYPE_EDGE_RISING>, + <&smp2p_adsp2_in 7 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "wdog", + "fatal", + "ready", + "handover", + "stop-ack", + "shutdown-ack"; + + memory-region = <&hpass_dsp2_mem>, + <&hpass_dsp2_dtb_mem>; + + qcom,qmp = <&aoss_qmp>; + + qcom,smem-states = <&smp2p_adsp2_out 0>; + qcom,smem-state-names = "stop"; + + status = "disabled"; + + glink-edge { + interrupts-extended = <&ipcc0 IPCC_MPROC_ADSP2 + IPCC_MPROC_SIGNAL_GLINK_QMP + IRQ_TYPE_EDGE_RISING>; + mboxes = <&ipcc0 IPCC_MPROC_ADSP2 + IPCC_MPROC_SIGNAL_GLINK_QMP>; + qcom,remote-pid = <130>; + label = "adsp2"; + + fastrpc { + compatible = "qcom,nord-fastrpc", + "qcom,kaanapali-fastrpc"; + qcom,glink-channels = "fastrpcglink-apps-dsp"; + label = "adsp2"; + #address-cells = <1>; + #size-cells = <0>; + + compute-cb@3 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <3>; + iommus = <&apps_smmu_0 0x0a33 0x0040>, + <&apps_smmu_0 0x0a53 0x0000>, + <&apps_smmu_0 0x0a73 0x0040>, + <&apps_smmu_0 0x0a93 0x0000>; + dma-coherent; + }; + + compute-cb@4 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <4>; + iommus = <&apps_smmu_0 0x0a34 0x0040>, + <&apps_smmu_0 0x0a54 0x0000>, + <&apps_smmu_0 0x0a74 0x0040>, + <&apps_smmu_0 0x0a94 0x0000>; + dma-coherent; + }; + + compute-cb@5 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <5>; + iommus = <&apps_smmu_0 0x0a35 0x0000>, + <&apps_smmu_0 0x0a55 0x0020>, + <&apps_smmu_0 0x0a75 0x0020>, + <&apps_smmu_0 0x0a95 0x0000>; + dma-coherent; + }; + + compute-cb@6 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <6>; + iommus = <&apps_smmu_0 0x0a36 0x0000>, + <&apps_smmu_0 0x0a56 0x0020>, + <&apps_smmu_0 0x0a76 0x0020>, + <&apps_smmu_0 0x0a96 0x0000>; + dma-coherent; + }; + }; + }; + }; + ipcc0: mailbox@9007000 { compatible = "qcom,nord-ipcc", "qcom,ipcc"; From 338b6c40defa90f36070a3b72594d3f884074088 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 17:17:26 +0800 Subject: [PATCH 11/15] FROMLIST: arm64: dts: qcom: nord-rrd: Enable ADSP1/2 remoteproc Enable ADSP1 and ADSP2 remoteproc on the Nord RRD board. Link: https://lore.kernel.org/r/20261201091727.415871-3-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit babb1f09ab14792d712ebe2810cd05dc509ed47d) --- arch/arm64/boot/dts/qcom/nord-rrd.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/nord-rrd.dts b/arch/arm64/boot/dts/qcom/nord-rrd.dts index 50ea85bd100b8..cbc638694ab57 100644 --- a/arch/arm64/boot/dts/qcom/nord-rrd.dts +++ b/arch/arm64/boot/dts/qcom/nord-rrd.dts @@ -937,6 +937,20 @@ status = "okay"; }; +&remoteproc_adsp1 { + firmware-name = "qcom/nord/adsp1.mbn", + "qcom/nord/adsp1_dtb.mbn"; + + status = "okay"; +}; + +&remoteproc_adsp2 { + firmware-name = "qcom/nord/adsp2.mbn", + "qcom/nord/adsp2_dtb.mbn"; + + status = "okay"; +}; + &remoteproc_cdsp0 { firmware-name = "qcom/nord/cdsp.mbn", "qcom/nord/cdsp_dtb.mbn"; From 6c09bf52c667ac186d08aecc143b3302488e2f95 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 1 Dec 2026 17:17:27 +0800 Subject: [PATCH 12/15] FROMLIST: arm64: dts: qcom: nord-ride-embedded: Enable ADSP1/2 remoteproc Enable ADSP1 and ADSP2 remoteproc on the Nord Ride Embedded board. Link: https://lore.kernel.org/r/20261201091727.415871-4-shengchao.guo@oss.qualcomm.com Signed-off-by: Shawn Guo (cherry picked from commit d9f9a21cae22ac8d05e499098d763f9eaae4c1b2) --- arch/arm64/boot/dts/qcom/nord-ride-embedded.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/nord-ride-embedded.dts b/arch/arm64/boot/dts/qcom/nord-ride-embedded.dts index 4271e125a4b87..9621383eb27fc 100644 --- a/arch/arm64/boot/dts/qcom/nord-ride-embedded.dts +++ b/arch/arm64/boot/dts/qcom/nord-ride-embedded.dts @@ -984,6 +984,20 @@ status = "okay"; }; +&remoteproc_adsp1 { + firmware-name = "qcom/nord/adsp1.mbn", + "qcom/nord/adsp1_dtb.mbn"; + + status = "okay"; +}; + +&remoteproc_adsp2 { + firmware-name = "qcom/nord/adsp2.mbn", + "qcom/nord/adsp2_dtb.mbn"; + + status = "okay"; +}; + &remoteproc_cdsp0 { firmware-name = "qcom/nord/cdsp.mbn", "qcom/nord/cdsp_dtb.mbn"; From 53e8abdba50fc1dd153cf2522c60d7cc4a610d67 Mon Sep 17 00:00:00 2001 From: Anurag Pateriya Date: Thu, 3 Dec 2026 20:23:25 +0530 Subject: [PATCH 13/15] FROMLIST: arm64: dts: qcom: nord: Add ADSP1/2 SMMU mappings to EL2 overlay ADSP1 and ADSP2 remoteproc nodes are now enabled on Nord boards. When Linux boots at EL2 without the hypervisor, it owns the SMMU and has to describe the firmware streams of these remote processors as well, just like the ADSP, CDSPs and SoCCP already covered by the overlay. Add the iommus for ADSP1 (SID 0x0a08) and ADSP2 (SID 0x0a30) on apps_smmu_0. Link: https://lore.kernel.org/r/20261203-nord_soccp_el2_dt_change-v2-2-93a7dfcae3e0@oss.qualcomm.com Signed-off-by: Anurag Pateriya --- arch/arm64/boot/dts/qcom/nord-embedded-el2.dtso | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/nord-embedded-el2.dtso b/arch/arm64/boot/dts/qcom/nord-embedded-el2.dtso index fe7988f7c4f45..ad5bd68c03240 100644 --- a/arch/arm64/boot/dts/qcom/nord-embedded-el2.dtso +++ b/arch/arm64/boot/dts/qcom/nord-embedded-el2.dtso @@ -20,6 +20,14 @@ iommus = <&apps_smmu_0 0x09e0 0x0>; }; +&remoteproc_adsp1 { + iommus = <&apps_smmu_0 0x0a08 0x0>; +}; + +&remoteproc_adsp2 { + iommus = <&apps_smmu_0 0x0a30 0x0>; +}; + &remoteproc_cdsp0 { iommus = <&apps_smmu_2 0x0360 0x0>; }; From a35675db7876c44a2372c090fb3db7c0bab05d34 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Wed, 2 Dec 2026 21:20:26 +0800 Subject: [PATCH 14/15] WORKAROUND: arm64: dts: qcom: Disable ADSP2 for RRD board The RRD v1.1 board ships chip IQ10800MD-AD which has ADSP2 opted out. Disable ADSP2 remoteproc to get it working on this board. This caps ADSP number for all RRD boards including those with a chip that has ADSP2 available. A proper solution should be on the bootloader side to pass the correct DTB to kernel. Signed-off-by: Shawn Guo (cherry picked from commit 4474d1b07d65079b021a43b46a469032e9345440) Signed-off-by: Anurag Pateriya --- arch/arm64/boot/dts/qcom/nord-rrd.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/nord-rrd.dts b/arch/arm64/boot/dts/qcom/nord-rrd.dts index cbc638694ab57..dfee28c299a1d 100644 --- a/arch/arm64/boot/dts/qcom/nord-rrd.dts +++ b/arch/arm64/boot/dts/qcom/nord-rrd.dts @@ -948,7 +948,7 @@ firmware-name = "qcom/nord/adsp2.mbn", "qcom/nord/adsp2_dtb.mbn"; - status = "okay"; + status = "disabled"; }; &remoteproc_cdsp0 { From 5e5fcc3700ac2e6eaca92a9777ee841832825b17 Mon Sep 17 00:00:00 2001 From: Anurag Pateriya Date: Thu, 3 Dec 2026 21:33:47 +0530 Subject: [PATCH 15/15] WORKAROUND: dt-bindings: remoteproc: qcom,nord-pas: Allow iommus When Linux runs at EL2 on Nord, the EL2 overlay assigns an SMMU stream ID to each Hexagon DSP through the iommus property. The binding does not document iommus and sets unevaluatedProperties: false, so dtbs_check rejects every enabled DSP node in the EL2 DTBs. Allow a single iommus entry for all Nord PAS remoteprocs. Fixes: 5b8a0dcedba9 ("dt-bindings: remoteproc: qcom,nord-pas: Document Nord PAS") Signed-off-by: Anurag Pateriya --- .../devicetree/bindings/remoteproc/qcom,nord-pas.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml index ca473e68a3ab9..b5d197d672091 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml +++ b/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml @@ -49,6 +49,9 @@ properties: items: - const: xo + iommus: + maxItems: 1 + qcom,qmp: $ref: /schemas/types.yaml#/definitions/phandle description: Reference to the AOSS side-channel message RAM.