Skip to content

Commit 508471c

Browse files
committed
Merge tag 'ti-driver-soc-for-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/drivers
TI SoC driver updates for v6.4 * Minor fixups for of_property, using devm_platform_ioremap * Fixups for refcount leaks in pm33xx * Fixups for k3-ringacc for dmaring_request * SoCinfo detection for J784S4 SoC. * tag 'ti-driver-soc-for-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: soc: ti: Use devm_platform_ioremap_resource() soc: ti: k3-socinfo: Add entry for J784S4 SOC soc: ti: Use of_property_read_bool() for boolean properties soc: ti: Use of_property_present() for testing DT property presence soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe soc: ti: k3-ringacc: Add try_module_get() to k3_dmaring_request_dual_ring() Link: https://lore.kernel.org/r/20230410140506.ucvkwq7vz2h47vyj@stipulate Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 9f8f0d0 + a33bfaf commit 508471c

File tree

8 files changed

+19
-12
lines changed

8 files changed

+19
-12
lines changed

drivers/soc/ti/k3-ringacc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,
406406

407407
mutex_lock(&ringacc->req_lock);
408408

409+
if (!try_module_get(ringacc->dev->driver->owner)) {
410+
ret = -EINVAL;
411+
goto err_module_get;
412+
}
413+
409414
if (test_bit(fwd_id, ringacc->rings_inuse)) {
410415
ret = -EBUSY;
411416
goto error;
@@ -421,6 +426,8 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,
421426
return 0;
422427

423428
error:
429+
module_put(ringacc->dev->driver->owner);
430+
err_module_get:
424431
mutex_unlock(&ringacc->req_lock);
425432
return ret;
426433
}

drivers/soc/ti/k3-socinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static const struct k3_soc_id {
4343
{ 0xBB38, "AM64X" },
4444
{ 0xBB75, "J721S2"},
4545
{ 0xBB7E, "AM62X" },
46+
{ 0xBB80, "J784S4" },
4647
{ 0xBB8D, "AM62AX" },
4748
};
4849

drivers/soc/ti/knav_dma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ static int dma_init(struct device_node *cloud, struct device_node *dma_node)
666666
dma->rx_priority = DMA_PRIO_DEFAULT;
667667
dma->tx_priority = DMA_PRIO_DEFAULT;
668668

669-
dma->enable_all = (of_get_property(node, "ti,enable-all", NULL) != NULL);
670-
dma->loopback = (of_get_property(node, "ti,loop-back", NULL) != NULL);
669+
dma->enable_all = of_property_read_bool(node, "ti,enable-all");
670+
dma->loopback = of_property_read_bool(node, "ti,loop-back");
671671

672672
ret = of_property_read_u32(node, "ti,rx-retry-timeout", &timeout);
673673
if (ret < 0) {

drivers/soc/ti/knav_qmss_acc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ int knav_init_acc_range(struct knav_device *kdev,
521521

522522
info->pdsp = pdsp;
523523
channels = range->num_queues;
524-
if (of_get_property(node, "multi-queue", NULL)) {
524+
if (of_property_read_bool(node, "multi-queue")) {
525525
range->flags |= RANGE_MULTI_QUEUE;
526526
channels = 1;
527527
if (range->queue_base & (32 - 1)) {

drivers/soc/ti/knav_qmss_queue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,10 +1264,10 @@ static int knav_setup_queue_range(struct knav_device *kdev,
12641264
if (range->num_irqs)
12651265
range->flags |= RANGE_HAS_IRQ;
12661266

1267-
if (of_get_property(node, "qalloc-by-id", NULL))
1267+
if (of_property_read_bool(node, "qalloc-by-id"))
12681268
range->flags |= RANGE_RESERVED;
12691269

1270-
if (of_get_property(node, "accumulator", NULL)) {
1270+
if (of_property_present(node, "accumulator")) {
12711271
ret = knav_init_acc_range(kdev, node, range);
12721272
if (ret < 0) {
12731273
devm_kfree(dev, range);

drivers/soc/ti/omap_prm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm)
684684
const char *name;
685685
int error;
686686

687-
if (!of_find_property(dev->of_node, "#power-domain-cells", NULL))
687+
if (!of_property_present(dev->of_node, "#power-domain-cells"))
688688
return 0;
689689

690690
of_node_put(dev->of_node);

drivers/soc/ti/pm33xx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)
527527

528528
ret = am33xx_pm_alloc_sram();
529529
if (ret)
530-
return ret;
530+
goto err_wkup_m3_ipc_put;
531531

532532
ret = am33xx_pm_rtc_setup();
533533
if (ret)
@@ -572,13 +572,14 @@ static int am33xx_pm_probe(struct platform_device *pdev)
572572
pm_runtime_put_sync(dev);
573573
err_pm_runtime_disable:
574574
pm_runtime_disable(dev);
575-
wkup_m3_ipc_put(m3_ipc);
576575
err_unsetup_rtc:
577576
iounmap(rtc_base_virt);
578577
clk_put(rtc_fck);
579578
err_free_sram:
580579
am33xx_pm_free_sram();
581580
pm33xx_dev = NULL;
581+
err_wkup_m3_ipc_put:
582+
wkup_m3_ipc_put(m3_ipc);
582583
return ret;
583584
}
584585

drivers/soc/ti/wkup_m3_ipc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
615615
int irq, ret, temp;
616616
phandle rproc_phandle;
617617
struct rproc *m3_rproc;
618-
struct resource *res;
619618
struct task_struct *task;
620619
struct wkup_m3_ipc *m3_ipc;
621620
struct device_node *np = dev->of_node;
@@ -624,8 +623,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
624623
if (!m3_ipc)
625624
return -ENOMEM;
626625

627-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
628-
m3_ipc->ipc_mem_base = devm_ioremap_resource(dev, res);
626+
m3_ipc->ipc_mem_base = devm_platform_ioremap_resource(pdev, 0);
629627
if (IS_ERR(m3_ipc->ipc_mem_base))
630628
return PTR_ERR(m3_ipc->ipc_mem_base);
631629

@@ -681,7 +679,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
681679
dev_warn(dev, "Invalid VTT GPIO(%d) pin\n", temp);
682680
}
683681

684-
if (of_find_property(np, "ti,set-io-isolation", NULL))
682+
if (of_property_read_bool(np, "ti,set-io-isolation"))
685683
wkup_m3_set_io_isolation(m3_ipc);
686684

687685
ret = of_property_read_string(np, "firmware-name",

0 commit comments

Comments
 (0)