Skip to content

Commit 80234b5

Browse files
committed
Merge tag 'rproc-v7.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull remoteproc fixes from Bjorn Andersson: - Correct the early return from the i.MX remoteproc prepare operation, which prevented the platform-specific prepare function from being reached - Ensure that the Mediatek SCP clock is released during system suspend after the recent refactoring to avoid issues with the clock framework's prepare lock. - Correct the type of the subsys_name_len field in the sysmon event QMI message, as the recent introduction of big endian support in the QMI encoder highlighted the type mismatch and resulted in a failure to encode the message - Roll back the devm_ioremap_resource_wc() to a devm_ioremap_wc() in the Qualcomm WCNSS remoteproc driver, after reports that requesting this resource fails on some platforms * tag 'rproc-v7.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: remoteproc: imx_rproc: Fix unreachable platform prepare_ops remoteproc: mediatek: Unprepare SCP clock during system suspend remoteproc: sysmon: Correct subsys_name_len type in QMI request remoteproc: qcom_wcnss: Fix reserved region mapping failure
2 parents 2b8e3fa + 97e4567 commit 80234b5

4 files changed

Lines changed: 42 additions & 3 deletions

File tree

drivers/remoteproc/imx_rproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static int imx_rproc_prepare(struct rproc *rproc)
617617

618618
err = of_reserved_mem_region_to_resource(np, i++, &res);
619619
if (err)
620-
return 0;
620+
break;
621621

622622
/*
623623
* Ignore the first memory region which will be used vdev buffer.

drivers/remoteproc/mtk_scp.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,12 +1592,51 @@ static const struct of_device_id mtk_scp_of_match[] = {
15921592
};
15931593
MODULE_DEVICE_TABLE(of, mtk_scp_of_match);
15941594

1595+
static int __maybe_unused scp_suspend(struct device *dev)
1596+
{
1597+
struct mtk_scp *scp = dev_get_drvdata(dev);
1598+
struct rproc *rproc = scp->rproc;
1599+
1600+
/*
1601+
* Only unprepare if the SCP is running and holding the clock.
1602+
*
1603+
* Note: `scp_ops` doesn't implement .attach() callback, hence
1604+
* `rproc->state` can never be RPROC_ATTACHED. Otherwise, it
1605+
* should also be checked here.
1606+
*/
1607+
if (rproc->state == RPROC_RUNNING)
1608+
clk_unprepare(scp->clk);
1609+
return 0;
1610+
}
1611+
1612+
static int __maybe_unused scp_resume(struct device *dev)
1613+
{
1614+
struct mtk_scp *scp = dev_get_drvdata(dev);
1615+
struct rproc *rproc = scp->rproc;
1616+
1617+
/*
1618+
* Only prepare if the SCP was running and holding the clock.
1619+
*
1620+
* Note: `scp_ops` doesn't implement .attach() callback, hence
1621+
* `rproc->state` can never be RPROC_ATTACHED. Otherwise, it
1622+
* should also be checked here.
1623+
*/
1624+
if (rproc->state == RPROC_RUNNING)
1625+
return clk_prepare(scp->clk);
1626+
return 0;
1627+
}
1628+
1629+
static const struct dev_pm_ops scp_pm_ops = {
1630+
SET_SYSTEM_SLEEP_PM_OPS(scp_suspend, scp_resume)
1631+
};
1632+
15951633
static struct platform_driver mtk_scp_driver = {
15961634
.probe = scp_probe,
15971635
.remove = scp_remove,
15981636
.driver = {
15991637
.name = "mtk-scp",
16001638
.of_match_table = mtk_scp_of_match,
1639+
.pm = &scp_pm_ops,
16011640
},
16021641
};
16031642

drivers/remoteproc/qcom_sysmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static const struct qmi_elem_info ssctl_shutdown_resp_ei[] = {
203203
};
204204

205205
struct ssctl_subsys_event_req {
206-
u8 subsys_name_len;
206+
u32 subsys_name_len;
207207
char subsys_name[SSCTL_SUBSYS_NAME_LENGTH];
208208
u32 event;
209209
u8 evt_driven_valid;

drivers/remoteproc/qcom_wcnss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss)
537537

538538
wcnss->mem_phys = wcnss->mem_reloc = res.start;
539539
wcnss->mem_size = resource_size(&res);
540-
wcnss->mem_region = devm_ioremap_resource_wc(wcnss->dev, &res);
540+
wcnss->mem_region = devm_ioremap_wc(wcnss->dev, wcnss->mem_phys, wcnss->mem_size);
541541
if (IS_ERR(wcnss->mem_region)) {
542542
dev_err(wcnss->dev, "unable to map memory region: %pR\n", &res);
543543
return PTR_ERR(wcnss->mem_region);

0 commit comments

Comments
 (0)