mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-28 20:20:17 -04:00
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 <arnd@arndb.de>
This commit is contained in:
@@ -406,6 +406,11 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,
|
||||
|
||||
mutex_lock(&ringacc->req_lock);
|
||||
|
||||
if (!try_module_get(ringacc->dev->driver->owner)) {
|
||||
ret = -EINVAL;
|
||||
goto err_module_get;
|
||||
}
|
||||
|
||||
if (test_bit(fwd_id, ringacc->rings_inuse)) {
|
||||
ret = -EBUSY;
|
||||
goto error;
|
||||
@@ -421,6 +426,8 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
module_put(ringacc->dev->driver->owner);
|
||||
err_module_get:
|
||||
mutex_unlock(&ringacc->req_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ static const struct k3_soc_id {
|
||||
{ 0xBB38, "AM64X" },
|
||||
{ 0xBB75, "J721S2"},
|
||||
{ 0xBB7E, "AM62X" },
|
||||
{ 0xBB80, "J784S4" },
|
||||
{ 0xBB8D, "AM62AX" },
|
||||
};
|
||||
|
||||
|
||||
@@ -666,8 +666,8 @@ static int dma_init(struct device_node *cloud, struct device_node *dma_node)
|
||||
dma->rx_priority = DMA_PRIO_DEFAULT;
|
||||
dma->tx_priority = DMA_PRIO_DEFAULT;
|
||||
|
||||
dma->enable_all = (of_get_property(node, "ti,enable-all", NULL) != NULL);
|
||||
dma->loopback = (of_get_property(node, "ti,loop-back", NULL) != NULL);
|
||||
dma->enable_all = of_property_read_bool(node, "ti,enable-all");
|
||||
dma->loopback = of_property_read_bool(node, "ti,loop-back");
|
||||
|
||||
ret = of_property_read_u32(node, "ti,rx-retry-timeout", &timeout);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -521,7 +521,7 @@ int knav_init_acc_range(struct knav_device *kdev,
|
||||
|
||||
info->pdsp = pdsp;
|
||||
channels = range->num_queues;
|
||||
if (of_get_property(node, "multi-queue", NULL)) {
|
||||
if (of_property_read_bool(node, "multi-queue")) {
|
||||
range->flags |= RANGE_MULTI_QUEUE;
|
||||
channels = 1;
|
||||
if (range->queue_base & (32 - 1)) {
|
||||
|
||||
@@ -1264,10 +1264,10 @@ static int knav_setup_queue_range(struct knav_device *kdev,
|
||||
if (range->num_irqs)
|
||||
range->flags |= RANGE_HAS_IRQ;
|
||||
|
||||
if (of_get_property(node, "qalloc-by-id", NULL))
|
||||
if (of_property_read_bool(node, "qalloc-by-id"))
|
||||
range->flags |= RANGE_RESERVED;
|
||||
|
||||
if (of_get_property(node, "accumulator", NULL)) {
|
||||
if (of_property_present(node, "accumulator")) {
|
||||
ret = knav_init_acc_range(kdev, node, range);
|
||||
if (ret < 0) {
|
||||
devm_kfree(dev, range);
|
||||
|
||||
@@ -684,7 +684,7 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm)
|
||||
const char *name;
|
||||
int error;
|
||||
|
||||
if (!of_find_property(dev->of_node, "#power-domain-cells", NULL))
|
||||
if (!of_property_present(dev->of_node, "#power-domain-cells"))
|
||||
return 0;
|
||||
|
||||
of_node_put(dev->of_node);
|
||||
|
||||
@@ -527,7 +527,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)
|
||||
|
||||
ret = am33xx_pm_alloc_sram();
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_wkup_m3_ipc_put;
|
||||
|
||||
ret = am33xx_pm_rtc_setup();
|
||||
if (ret)
|
||||
@@ -572,13 +572,14 @@ static int am33xx_pm_probe(struct platform_device *pdev)
|
||||
pm_runtime_put_sync(dev);
|
||||
err_pm_runtime_disable:
|
||||
pm_runtime_disable(dev);
|
||||
wkup_m3_ipc_put(m3_ipc);
|
||||
err_unsetup_rtc:
|
||||
iounmap(rtc_base_virt);
|
||||
clk_put(rtc_fck);
|
||||
err_free_sram:
|
||||
am33xx_pm_free_sram();
|
||||
pm33xx_dev = NULL;
|
||||
err_wkup_m3_ipc_put:
|
||||
wkup_m3_ipc_put(m3_ipc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -615,7 +615,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
|
||||
int irq, ret, temp;
|
||||
phandle rproc_phandle;
|
||||
struct rproc *m3_rproc;
|
||||
struct resource *res;
|
||||
struct task_struct *task;
|
||||
struct wkup_m3_ipc *m3_ipc;
|
||||
struct device_node *np = dev->of_node;
|
||||
@@ -624,8 +623,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
|
||||
if (!m3_ipc)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
m3_ipc->ipc_mem_base = devm_ioremap_resource(dev, res);
|
||||
m3_ipc->ipc_mem_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(m3_ipc->ipc_mem_base))
|
||||
return PTR_ERR(m3_ipc->ipc_mem_base);
|
||||
|
||||
@@ -681,7 +679,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
|
||||
dev_warn(dev, "Invalid VTT GPIO(%d) pin\n", temp);
|
||||
}
|
||||
|
||||
if (of_find_property(np, "ti,set-io-isolation", NULL))
|
||||
if (of_property_read_bool(np, "ti,set-io-isolation"))
|
||||
wkup_m3_set_io_isolation(m3_ipc);
|
||||
|
||||
ret = of_property_read_string(np, "firmware-name",
|
||||
|
||||
Reference in New Issue
Block a user