remoteproc updates for v5.4

This exposes the remoteproc's name in sysfs, allows stm32 to enter
 platform standby and provides bug fixes for stm32 and Qualcomm's modem
 remoteproc drivers. Finally it updates MAINTAINERS to reflect the move
 to kernel.org.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAl2GUe4bHGJqb3JuLmFu
 ZGVyc3NvbkBsaW5hcm8ub3JnAAoJEAsfOT8Nma3Ff4EP/jxQNa8tPTdtmLA5Itdh
 w5nL7XiEmIRlsPBWbmJgu9Ai6ZgQZDMesvzaqraOTXRaaSSeW/H1uKOiE45dZ2eo
 FS2z43knk/zTuWmO6hsto0uFeL2VwIzg/nYqtC//F+S4kRKGn8TLNj6RPCW9XwE1
 UYteRkKth8qapQSL3Y6mF7sLpxsegK7XVurrvguRGIZSZST9zQHsF/Eb8EbdHTZA
 9AibwhDJKQpKnbTPumybV5X3PzHLPMiV+y2RSS7vg/G7fyJuvbvTNQrTvfhfqstQ
 vkTtc1xA0oqPfyU4ii4Dc3Wo15V4TdgcHraScgnBlU+e0D/Pane7F1lDFraQ7FAU
 NMnpjG4oYPzpWNePM+13sFBEvqieAoydQp+oQ9UB9S0CT91VShwhJ8ehxYcg3umC
 ZVVsdRslNtj90iHINKjR1oCbGuetlQCKHpwtTT4ghdehqZeihJRup4P6SX6J9xY0
 nnYQV0JkOnbyaVpbYE53hqcpn+baU6qWoQg1XWnQ+EQbcvuSyDbD5FKSTply1Idj
 G1iREkjIlfUwSRKUiriX1SG+VcEa4BoE9pJL4+VvWgxi0U+kVOoUJSCj9b/U8LXT
 5F3NgUBgjB373RdVLGPhhGcs1DGyNDfOrRSu89BD48NrorwnDAgelED0ALWUDqlS
 k4NvkGoIZdIhTdfVsY2VK/vu
 =T/PI
 -----END PGP SIGNATURE-----

Merge tag 'rproc-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc

Pull remoteproc updates from Bjorn Andersson:
 "This exposes the remoteproc's name in sysfs, allows stm32 to enter
  platform standby and provides bug fixes for stm32 and Qualcomm's modem
  remoteproc drivers. Finally it updates MAINTAINERS to reflect the move
  to kernel.org"

* tag 'rproc-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc:
  MAINTAINERS: remoteproc: update git tree location
  remoteproc: Remove dev_err() usage after platform_get_irq()
  remoteproc: stm32: manage the get_irq probe defer case
  remoteproc: stm32: clear MCU PDDS at firmware start
  remoteproc: qcom: q6v5-mss: fixup q6v5_pds_enable error handling
  remoteproc: Add a sysfs interface for name
  remoteproc: qcom: Move glink_ssr notification after stop
This commit is contained in:
Linus Torvalds 2019-09-22 10:55:08 -07:00
commit 28de978ba3
9 changed files with 46 additions and 42 deletions

View File

@ -48,3 +48,13 @@ Description: Remote processor state
Writing "stop" will attempt to halt the remote processor and
return it to the "offline" state.
What: /sys/class/remoteproc/.../name
Date: August 2019
KernelVersion: 5.4
Contact: Suman Anna <s-anna@ti.com>
Description: Remote processor name
Reports the name of the remote processor. This can be used by
userspace in exactly identifying a remote processor and ease
up the usage in modifying the 'firmware' or 'state' files.

View File

@ -13748,7 +13748,7 @@ REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM
M: Ohad Ben-Cohen <ohad@wizery.com>
M: Bjorn Andersson <bjorn.andersson@linaro.org>
L: linux-remoteproc@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rproc-next
S: Maintained
F: Documentation/devicetree/bindings/remoteproc/
F: Documentation/ABI/testing/sysfs-class-remoteproc

View File

@ -249,10 +249,8 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
int ret;
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(dev, "platform_get_irq(pdev, 0) error: %d\n", irq);
if (irq < 0)
return irq;
}
irq_data = irq_get_irq_data(irq);
if (!irq_data) {

View File

@ -424,16 +424,12 @@ static int keystone_rproc_probe(struct platform_device *pdev)
ksproc->irq_ring = platform_get_irq_byname(pdev, "vring");
if (ksproc->irq_ring < 0) {
ret = ksproc->irq_ring;
dev_err(dev, "failed to get vring interrupt, status = %d\n",
ret);
goto disable_clk;
}
ksproc->irq_fault = platform_get_irq_byname(pdev, "exception");
if (ksproc->irq_fault < 0) {
ret = ksproc->irq_fault;
dev_err(dev, "failed to get exception interrupt, status = %d\n",
ret);
goto disable_clk;
}

View File

@ -200,7 +200,7 @@ void qcom_unregister_ssr_notifier(struct notifier_block *nb)
}
EXPORT_SYMBOL_GPL(qcom_unregister_ssr_notifier);
static void ssr_notify_stop(struct rproc_subdev *subdev, bool crashed)
static void ssr_notify_unprepare(struct rproc_subdev *subdev)
{
struct qcom_rproc_ssr *ssr = to_ssr_subdev(subdev);
@ -220,7 +220,7 @@ void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
const char *ssr_name)
{
ssr->name = ssr_name;
ssr->subdev.stop = ssr_notify_stop;
ssr->subdev.unprepare = ssr_notify_unprepare;
rproc_add_subdev(rproc, &ssr->subdev);
}

View File

@ -187,13 +187,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
init_completion(&q6v5->stop_done);
q6v5->wdog_irq = platform_get_irq_byname(pdev, "wdog");
if (q6v5->wdog_irq < 0) {
if (q6v5->wdog_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve wdog IRQ: %d\n",
q6v5->wdog_irq);
if (q6v5->wdog_irq < 0)
return q6v5->wdog_irq;
}
ret = devm_request_threaded_irq(&pdev->dev, q6v5->wdog_irq,
NULL, q6v5_wdog_interrupt,
@ -205,13 +200,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
}
q6v5->fatal_irq = platform_get_irq_byname(pdev, "fatal");
if (q6v5->fatal_irq < 0) {
if (q6v5->fatal_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve fatal IRQ: %d\n",
q6v5->fatal_irq);
if (q6v5->fatal_irq < 0)
return q6v5->fatal_irq;
}
ret = devm_request_threaded_irq(&pdev->dev, q6v5->fatal_irq,
NULL, q6v5_fatal_interrupt,
@ -223,13 +213,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
}
q6v5->ready_irq = platform_get_irq_byname(pdev, "ready");
if (q6v5->ready_irq < 0) {
if (q6v5->ready_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve ready IRQ: %d\n",
q6v5->ready_irq);
if (q6v5->ready_irq < 0)
return q6v5->ready_irq;
}
ret = devm_request_threaded_irq(&pdev->dev, q6v5->ready_irq,
NULL, q6v5_ready_interrupt,
@ -241,13 +226,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
}
q6v5->handover_irq = platform_get_irq_byname(pdev, "handover");
if (q6v5->handover_irq < 0) {
if (q6v5->handover_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve handover IRQ: %d\n",
q6v5->handover_irq);
if (q6v5->handover_irq < 0)
return q6v5->handover_irq;
}
ret = devm_request_threaded_irq(&pdev->dev, q6v5->handover_irq,
NULL, q6v5_handover_interrupt,
@ -260,13 +240,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
disable_irq(q6v5->handover_irq);
q6v5->stop_irq = platform_get_irq_byname(pdev, "stop-ack");
if (q6v5->stop_irq < 0) {
if (q6v5->stop_irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to retrieve stop-ack IRQ: %d\n",
q6v5->stop_irq);
if (q6v5->stop_irq < 0)
return q6v5->stop_irq;
}
ret = devm_request_threaded_irq(&pdev->dev, q6v5->stop_irq,
NULL, q6v5_stop_interrupt,

View File

@ -1282,8 +1282,8 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
for (i = 0; i < num_pds; i++) {
devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
if (IS_ERR(devs[i])) {
ret = PTR_ERR(devs[i]);
if (IS_ERR_OR_NULL(devs[i])) {
ret = PTR_ERR(devs[i]) ? : -ENODATA;
goto unroll_attach;
}
}

View File

@ -113,9 +113,20 @@ static ssize_t state_store(struct device *dev,
}
static DEVICE_ATTR_RW(state);
/* Expose the name of the remote processor via sysfs */
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct rproc *rproc = to_rproc(dev);
return sprintf(buf, "%s\n", rproc->name);
}
static DEVICE_ATTR_RO(name);
static struct attribute *rproc_attrs[] = {
&dev_attr_firmware.attr,
&dev_attr_state.attr,
&dev_attr_name.attr,
NULL
};

View File

@ -383,10 +383,21 @@ static void stm32_rproc_add_coredump_trace(struct rproc *rproc)
static int stm32_rproc_start(struct rproc *rproc)
{
struct stm32_rproc *ddata = rproc->priv;
int err;
stm32_rproc_add_coredump_trace(rproc);
/* clear remote proc Deep Sleep */
if (ddata->pdds.map) {
err = regmap_update_bits(ddata->pdds.map, ddata->pdds.reg,
ddata->pdds.mask, 0);
if (err) {
dev_err(&rproc->dev, "failed to clear pdds\n");
return err;
}
}
err = stm32_rproc_set_hold_boot(rproc, false);
if (err)
return err;
@ -506,6 +517,9 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev)
int err, irq;
irq = platform_get_irq(pdev, 0);
if (irq == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (irq > 0) {
err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
dev_name(dev), rproc);