remoteproc fixes for v7.3

Fix unbalanced handover IRQ for attached and the overwriting of the
 shutdown return value in the Qualcomm PAS remoteproc driver.
 
 Correct the conditions in the Qualcomm modem remoteproc driver for which
 secure services to require after the move to "PAS service".
 
 Ensure that the correct addresses are passed to iommu_unmap() in as
 Qualcomm ADSP carveout are torn down.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCgAsFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmqx46IOHGJqb3JuQGty
 eW8uc2UACgkQCx85Pw2ZrcUCDRAAhm0J2Y3ol3qrFK7XrhbFvn6TewDHRD7LGntt
 VVhplPj3/QSUWduXEtyNyMV/Illx3LV8DxlmDw85doRJtcMqCeBpRkh/u71YPxYw
 PIrEmXcCjBP3iYDB+7lsX4PkgmQOgnyK+pDK+T5K0ZgE0L3vHT4k1TuyspBLHREt
 d2goRCB61qDOtqcvFuaG9MbZw69cyaeF60drUBTxaaGIcAz12X+6lBjl4xv9sjrE
 fwG/TLrGqRkoioInxuxL8OAks1ylaJtouu6bGnKK65/bvJ3ApE1/yj15Nn2kBv9J
 KjAhAPfY1MXARXa7YR9+HJOZAUMTCyx7RfYbKEsVlNUqazL6PHYWMnTgJZA5IoM0
 j8vfgvDLlZvDjl628DzhKVz4dV7P0QMBKbB1gTWzQaGNxNpgyVznyqpFl8rX7wuC
 Jp5SLR33ujMqK6iWhgexvHC4dbWux03MYovbysvz97Q3kr9U+07pIU2zIb97RS8s
 HAErFKlQLvg7MGk1RkmsXMGnxsHFYpbqvJfngnaUe2bxFuf4NwQ3li2XOrWK/UxP
 61AXNVBBI/aFOlT3VbFLC7YRpmOykGlbv3q/OKKb0s3M7ofLaSQ+F4S/j02g524o
 nZAKejx2rJO9h8ty6bsJodLorGJ5c/sjknQQyFIme3h0jmd1yNmyPpe07GHT44hH
 nbUxZzo=
 =bkNw
 -----END PGP SIGNATURE-----

Merge tag 'rproc-v7.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux

Pull remoteproc fixes from Bjorn Andersson:
 "Fix unbalanced handover IRQ on attach and the overwriting of the
  shutdown return value in the Qualcomm PAS remoteproc driver.

  Correct the conditions in the Qualcomm modem remoteproc driver for
  which secure services to require after the move to 'PAS service'.

  Ensure that the correct addresses are passed to iommu_unmap() as
  Qualcomm ADSP carveout are torn down"

* tag 'rproc-v7.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux:
  remoteproc: qcom_q6v5_pas: Fix error masking in qcom_pas_stop()
  remoteproc: qcom_q6v5_adsp: Fix iommu_unmap() usage
  remoteproc: qcom_q6v5_mss: Don't require PAS for memory protection
  remoteproc: qcom: q6v5_pas: Don't enable handover IRQ on attach
This commit is contained in:
Linus Torvalds 2026-09-22 10:12:54 -07:00
commit 34e34736ea
3 changed files with 21 additions and 10 deletions

View File

@ -104,6 +104,7 @@ struct qcom_adsp {
struct completion stop_done;
phys_addr_t mem_phys;
unsigned long iova;
phys_addr_t mem_reloc;
void __iomem *mem_region;
size_t mem_size;
@ -333,7 +334,7 @@ static void adsp_unmap_carveout(struct rproc *rproc)
struct qcom_adsp *adsp = rproc->priv;
if (adsp->has_iommu)
iommu_unmap(rproc->domain, adsp->mem_phys, adsp->mem_size);
iommu_unmap(rproc->domain, adsp->iova, adsp->mem_size);
}
static int adsp_map_carveout(struct rproc *rproc)
@ -341,7 +342,6 @@ static int adsp_map_carveout(struct rproc *rproc)
struct qcom_adsp *adsp = rproc->priv;
struct of_phandle_args args;
long long sid;
unsigned long iova;
int ret;
if (!adsp->has_iommu)
@ -358,9 +358,9 @@ static int adsp_map_carveout(struct rproc *rproc)
of_node_put(args.np);
/* Add SID configuration for ADSP Firmware to SMMU */
iova = adsp->mem_phys | (sid << 32);
adsp->iova = adsp->mem_phys | (sid << 32);
ret = iommu_map(rproc->domain, iova, adsp->mem_phys,
ret = iommu_map(rproc->domain, adsp->iova, adsp->mem_phys,
adsp->mem_size, IOMMU_READ | IOMMU_WRITE,
GFP_KERNEL);
if (ret) {

View File

@ -2079,7 +2079,16 @@ static int q6v5_probe(struct platform_device *pdev)
if (!desc)
return -EINVAL;
if (desc->need_mem_protection && !qcom_pas_is_available())
/*
* Memory protection is done through qcom_scm_assign_mem(), which needs
* SCM but not PAS. Only the memory setup path issues PAS calls, so
* requiring PAS for every need_mem_protection platform prevents the
* modem from probing at all on TZ firmware that offers no PAS.
*/
if (desc->need_mem_protection && !qcom_scm_is_available())
return -EPROBE_DEFER;
if (desc->need_pas_mem_setup && !qcom_pas_is_available())
return -EPROBE_DEFER;
mba_image = desc->hexagon_mba_image;

View File

@ -405,6 +405,7 @@ static int qcom_pas_stop(struct rproc *rproc)
{
struct qcom_pas *pas = rproc->priv;
int handover;
int dtb_ret;
int ret;
ret = qcom_q6v5_request_stop(&pas->q6v5, pas->sysmon);
@ -419,9 +420,12 @@ static int qcom_pas_stop(struct rproc *rproc)
dev_err(pas->dev, "failed to shutdown: %d\n", ret);
if (pas->dtb_pas_id) {
ret = qcom_pas_shutdown(pas->dtb_pas_id);
if (ret)
dev_err(pas->dev, "failed to shutdown dtb: %d\n", ret);
dtb_ret = qcom_pas_shutdown(pas->dtb_pas_id);
if (dtb_ret)
dev_err(pas->dev, "failed to shutdown dtb: %d\n", dtb_ret);
if (!ret && dtb_ret)
ret = dtb_ret;
qcom_pas_unmap_carveout(rproc, pas->dtb_mem_phys, pas->dtb_mem_size);
}
@ -524,7 +528,6 @@ static int qcom_pas_attach(struct rproc *rproc)
int ret;
pas->q6v5.handover_issued = true;
enable_irq(pas->q6v5.handover_irq);
pas->q6v5.running = true;
ret = irq_get_irqchip_state(pas->q6v5.fatal_irq,
@ -570,7 +573,6 @@ static int qcom_pas_attach(struct rproc *rproc)
pas->rproc->state = RPROC_OFFLINE;
ret = -EINVAL;
disable_running:
disable_irq(pas->q6v5.handover_irq);
pas->q6v5.running = false;
return ret;