Skip to content

Commit 3cda779

Browse files
committed
Merge tag 'rproc-v5.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc
Pull remoteproc fixes from Bjorn Andersson: "This fixes a regression in the probe error path of the Qualcomm modem remoteproc driver and a mix up of phy_addr_t and dma_addr_t in the Mediatek SCP control driver" * tag 'rproc-v5.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: remoteproc: mtk_scp: use dma_addr_t for DMA API remoteproc: qcom_q6v5_mss: fix q6v5_probe() error paths remoteproc: qcom_q6v5_mss: fix a bug in q6v5_probe()
2 parents 6a40006 + c2781e4 commit 3cda779

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

drivers/remoteproc/mtk_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct mtk_scp {
6868
wait_queue_head_t ack_wq;
6969

7070
void __iomem *cpu_addr;
71-
phys_addr_t phys_addr;
71+
dma_addr_t dma_addr;
7272
size_t dram_size;
7373

7474
struct rproc_subdev *rpmsg_subdev;

drivers/remoteproc/mtk_scp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len)
330330
if (offset >= 0 && (offset + len) < scp->sram_size)
331331
return (void __force *)scp->sram_base + offset;
332332
} else {
333-
offset = da - scp->phys_addr;
333+
offset = da - scp->dma_addr;
334334
if (offset >= 0 && (offset + len) < scp->dram_size)
335335
return (void __force *)scp->cpu_addr + offset;
336336
}
@@ -451,7 +451,7 @@ static int scp_map_memory_region(struct mtk_scp *scp)
451451
/* Reserved SCP code size */
452452
scp->dram_size = MAX_CODE_SIZE;
453453
scp->cpu_addr = dma_alloc_coherent(scp->dev, scp->dram_size,
454-
&scp->phys_addr, GFP_KERNEL);
454+
&scp->dma_addr, GFP_KERNEL);
455455
if (!scp->cpu_addr)
456456
return -ENOMEM;
457457

@@ -461,7 +461,7 @@ static int scp_map_memory_region(struct mtk_scp *scp)
461461
static void scp_unmap_memory_region(struct mtk_scp *scp)
462462
{
463463
dma_free_coherent(scp->dev, scp->dram_size, scp->cpu_addr,
464-
scp->phys_addr);
464+
scp->dma_addr);
465465
of_reserved_mem_device_release(scp->dev);
466466
}
467467

drivers/remoteproc/qcom_q6v5_mss.c

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int q6v5_pds_enable(struct q6v5 *qproc, struct device **pds,
367367
}
368368

369369
return ret;
370-
};
370+
}
371371

372372
static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds,
373373
size_t pd_count)
@@ -1527,7 +1527,7 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
15271527
dev_pm_domain_detach(devs[i], false);
15281528

15291529
return ret;
1530-
};
1530+
}
15311531

15321532
static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
15331533
size_t pd_count)
@@ -1675,7 +1675,7 @@ static int q6v5_probe(struct platform_device *pdev)
16751675
ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
16761676
1, &qproc->hexagon_mdt_image);
16771677
if (ret < 0 && ret != -EINVAL)
1678-
return ret;
1678+
goto free_rproc;
16791679

16801680
platform_set_drvdata(pdev, qproc);
16811681

@@ -1766,17 +1766,23 @@ static int q6v5_probe(struct platform_device *pdev)
17661766
qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
17671767
if (IS_ERR(qproc->sysmon)) {
17681768
ret = PTR_ERR(qproc->sysmon);
1769-
goto detach_proxy_pds;
1769+
goto remove_subdevs;
17701770
}
17711771

17721772
ret = rproc_add(rproc);
17731773
if (ret)
1774-
goto detach_proxy_pds;
1774+
goto remove_sysmon_subdev;
17751775

17761776
return 0;
17771777

1778-
detach_proxy_pds:
1778+
remove_sysmon_subdev:
1779+
qcom_remove_sysmon_subdev(qproc->sysmon);
1780+
remove_subdevs:
17791781
qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
1782+
qcom_remove_ssr_subdev(rproc, &qproc->ssr_subdev);
1783+
qcom_remove_smd_subdev(rproc, &qproc->smd_subdev);
1784+
qcom_remove_glink_subdev(rproc, &qproc->glink_subdev);
1785+
detach_proxy_pds:
17801786
q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
17811787
detach_active_pds:
17821788
q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
@@ -1789,19 +1795,20 @@ static int q6v5_probe(struct platform_device *pdev)
17891795
static int q6v5_remove(struct platform_device *pdev)
17901796
{
17911797
struct q6v5 *qproc = platform_get_drvdata(pdev);
1798+
struct rproc *rproc = qproc->rproc;
17921799

1793-
rproc_del(qproc->rproc);
1800+
rproc_del(rproc);
17941801

17951802
qcom_remove_sysmon_subdev(qproc->sysmon);
1796-
qcom_remove_ipa_notify_subdev(qproc->rproc, &qproc->ipa_notify_subdev);
1797-
qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
1798-
qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
1799-
qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
1803+
qcom_remove_ipa_notify_subdev(rproc, &qproc->ipa_notify_subdev);
1804+
qcom_remove_ssr_subdev(rproc, &qproc->ssr_subdev);
1805+
qcom_remove_smd_subdev(rproc, &qproc->smd_subdev);
1806+
qcom_remove_glink_subdev(rproc, &qproc->glink_subdev);
18001807

1801-
q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
18021808
q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
1809+
q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
18031810

1804-
rproc_free(qproc->rproc);
1811+
rproc_free(rproc);
18051812

18061813
return 0;
18071814
}

0 commit comments

Comments
 (0)