Skip to content

Commit 28de978

Browse files
committed
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
2 parents 8d7ead5 + 150997f commit 28de978

File tree

9 files changed

+46
-42
lines changed

9 files changed

+46
-42
lines changed

Documentation/ABI/testing/sysfs-class-remoteproc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,13 @@ Description: Remote processor state
4848

4949
Writing "stop" will attempt to halt the remote processor and
5050
return it to the "offline" state.
51+
52+
What: /sys/class/remoteproc/.../name
53+
Date: August 2019
54+
KernelVersion: 5.4
55+
Contact: Suman Anna <[email protected]>
56+
Description: Remote processor name
57+
58+
Reports the name of the remote processor. This can be used by
59+
userspace in exactly identifying a remote processor and ease
60+
up the usage in modifying the 'firmware' or 'state' files.

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13748,7 +13748,7 @@ REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM
1374813748
M: Ohad Ben-Cohen <[email protected]>
1374913749
M: Bjorn Andersson <[email protected]>
1375013750
13751-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git
13751+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rproc-next
1375213752
S: Maintained
1375313753
F: Documentation/devicetree/bindings/remoteproc/
1375413754
F: Documentation/ABI/testing/sysfs-class-remoteproc

drivers/remoteproc/da8xx_remoteproc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,8 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
249249
int ret;
250250

251251
irq = platform_get_irq(pdev, 0);
252-
if (irq < 0) {
253-
dev_err(dev, "platform_get_irq(pdev, 0) error: %d\n", irq);
252+
if (irq < 0)
254253
return irq;
255-
}
256254

257255
irq_data = irq_get_irq_data(irq);
258256
if (!irq_data) {

drivers/remoteproc/keystone_remoteproc.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,16 +424,12 @@ static int keystone_rproc_probe(struct platform_device *pdev)
424424
ksproc->irq_ring = platform_get_irq_byname(pdev, "vring");
425425
if (ksproc->irq_ring < 0) {
426426
ret = ksproc->irq_ring;
427-
dev_err(dev, "failed to get vring interrupt, status = %d\n",
428-
ret);
429427
goto disable_clk;
430428
}
431429

432430
ksproc->irq_fault = platform_get_irq_byname(pdev, "exception");
433431
if (ksproc->irq_fault < 0) {
434432
ret = ksproc->irq_fault;
435-
dev_err(dev, "failed to get exception interrupt, status = %d\n",
436-
ret);
437433
goto disable_clk;
438434
}
439435

drivers/remoteproc/qcom_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void qcom_unregister_ssr_notifier(struct notifier_block *nb)
200200
}
201201
EXPORT_SYMBOL_GPL(qcom_unregister_ssr_notifier);
202202

203-
static void ssr_notify_stop(struct rproc_subdev *subdev, bool crashed)
203+
static void ssr_notify_unprepare(struct rproc_subdev *subdev)
204204
{
205205
struct qcom_rproc_ssr *ssr = to_ssr_subdev(subdev);
206206

@@ -220,7 +220,7 @@ void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
220220
const char *ssr_name)
221221
{
222222
ssr->name = ssr_name;
223-
ssr->subdev.stop = ssr_notify_stop;
223+
ssr->subdev.unprepare = ssr_notify_unprepare;
224224

225225
rproc_add_subdev(rproc, &ssr->subdev);
226226
}

drivers/remoteproc/qcom_q6v5.c

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
187187
init_completion(&q6v5->stop_done);
188188

189189
q6v5->wdog_irq = platform_get_irq_byname(pdev, "wdog");
190-
if (q6v5->wdog_irq < 0) {
191-
if (q6v5->wdog_irq != -EPROBE_DEFER)
192-
dev_err(&pdev->dev,
193-
"failed to retrieve wdog IRQ: %d\n",
194-
q6v5->wdog_irq);
190+
if (q6v5->wdog_irq < 0)
195191
return q6v5->wdog_irq;
196-
}
197192

198193
ret = devm_request_threaded_irq(&pdev->dev, q6v5->wdog_irq,
199194
NULL, q6v5_wdog_interrupt,
@@ -205,13 +200,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
205200
}
206201

207202
q6v5->fatal_irq = platform_get_irq_byname(pdev, "fatal");
208-
if (q6v5->fatal_irq < 0) {
209-
if (q6v5->fatal_irq != -EPROBE_DEFER)
210-
dev_err(&pdev->dev,
211-
"failed to retrieve fatal IRQ: %d\n",
212-
q6v5->fatal_irq);
203+
if (q6v5->fatal_irq < 0)
213204
return q6v5->fatal_irq;
214-
}
215205

216206
ret = devm_request_threaded_irq(&pdev->dev, q6v5->fatal_irq,
217207
NULL, q6v5_fatal_interrupt,
@@ -223,13 +213,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
223213
}
224214

225215
q6v5->ready_irq = platform_get_irq_byname(pdev, "ready");
226-
if (q6v5->ready_irq < 0) {
227-
if (q6v5->ready_irq != -EPROBE_DEFER)
228-
dev_err(&pdev->dev,
229-
"failed to retrieve ready IRQ: %d\n",
230-
q6v5->ready_irq);
216+
if (q6v5->ready_irq < 0)
231217
return q6v5->ready_irq;
232-
}
233218

234219
ret = devm_request_threaded_irq(&pdev->dev, q6v5->ready_irq,
235220
NULL, q6v5_ready_interrupt,
@@ -241,13 +226,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
241226
}
242227

243228
q6v5->handover_irq = platform_get_irq_byname(pdev, "handover");
244-
if (q6v5->handover_irq < 0) {
245-
if (q6v5->handover_irq != -EPROBE_DEFER)
246-
dev_err(&pdev->dev,
247-
"failed to retrieve handover IRQ: %d\n",
248-
q6v5->handover_irq);
229+
if (q6v5->handover_irq < 0)
249230
return q6v5->handover_irq;
250-
}
251231

252232
ret = devm_request_threaded_irq(&pdev->dev, q6v5->handover_irq,
253233
NULL, q6v5_handover_interrupt,
@@ -260,13 +240,8 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
260240
disable_irq(q6v5->handover_irq);
261241

262242
q6v5->stop_irq = platform_get_irq_byname(pdev, "stop-ack");
263-
if (q6v5->stop_irq < 0) {
264-
if (q6v5->stop_irq != -EPROBE_DEFER)
265-
dev_err(&pdev->dev,
266-
"failed to retrieve stop-ack IRQ: %d\n",
267-
q6v5->stop_irq);
243+
if (q6v5->stop_irq < 0)
268244
return q6v5->stop_irq;
269-
}
270245

271246
ret = devm_request_threaded_irq(&pdev->dev, q6v5->stop_irq,
272247
NULL, q6v5_stop_interrupt,

drivers/remoteproc/qcom_q6v5_mss.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,8 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs,
12821282

12831283
for (i = 0; i < num_pds; i++) {
12841284
devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
1285-
if (IS_ERR(devs[i])) {
1286-
ret = PTR_ERR(devs[i]);
1285+
if (IS_ERR_OR_NULL(devs[i])) {
1286+
ret = PTR_ERR(devs[i]) ? : -ENODATA;
12871287
goto unroll_attach;
12881288
}
12891289
}

drivers/remoteproc/remoteproc_sysfs.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,20 @@ static ssize_t state_store(struct device *dev,
113113
}
114114
static DEVICE_ATTR_RW(state);
115115

116+
/* Expose the name of the remote processor via sysfs */
117+
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
118+
char *buf)
119+
{
120+
struct rproc *rproc = to_rproc(dev);
121+
122+
return sprintf(buf, "%s\n", rproc->name);
123+
}
124+
static DEVICE_ATTR_RO(name);
125+
116126
static struct attribute *rproc_attrs[] = {
117127
&dev_attr_firmware.attr,
118128
&dev_attr_state.attr,
129+
&dev_attr_name.attr,
119130
NULL
120131
};
121132

drivers/remoteproc/stm32_rproc.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,21 @@ static void stm32_rproc_add_coredump_trace(struct rproc *rproc)
383383

384384
static int stm32_rproc_start(struct rproc *rproc)
385385
{
386+
struct stm32_rproc *ddata = rproc->priv;
386387
int err;
387388

388389
stm32_rproc_add_coredump_trace(rproc);
389390

391+
/* clear remote proc Deep Sleep */
392+
if (ddata->pdds.map) {
393+
err = regmap_update_bits(ddata->pdds.map, ddata->pdds.reg,
394+
ddata->pdds.mask, 0);
395+
if (err) {
396+
dev_err(&rproc->dev, "failed to clear pdds\n");
397+
return err;
398+
}
399+
}
400+
390401
err = stm32_rproc_set_hold_boot(rproc, false);
391402
if (err)
392403
return err;
@@ -506,6 +517,9 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev)
506517
int err, irq;
507518

508519
irq = platform_get_irq(pdev, 0);
520+
if (irq == -EPROBE_DEFER)
521+
return -EPROBE_DEFER;
522+
509523
if (irq > 0) {
510524
err = devm_request_irq(dev, irq, stm32_rproc_wdg, 0,
511525
dev_name(dev), rproc);

0 commit comments

Comments
 (0)