Skip to content

Commit 0450169

Browse files
Murali KaricheriSantoshShilimkar
authored andcommitted
soc: ti: qmss: make acc queue support optional in the driver
acc channels are available only if accumulator PDSP is loaded and running in the SoC. As this requires firmware and user may not have firmware in the file system, make the accumulator queue support available in qmss driver optional. To use accumulator queus user needs to add firmware to the file system and boot up kernel. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
1 parent 96ee19b commit 0450169

4 files changed

Lines changed: 31 additions & 7 deletions

File tree

‎Documentation/arm/keystone/knav-qmss.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@ in the file system and boot up the kernel. User would see
4848
"firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP"
4949

5050
in the boot up log if loading of firmware to PDSP is successful.
51+
52+
Use of accumulated queues requires the firmware image to be present in the
53+
file system. The driver doesn't acc queues to the supported queue range if
54+
PDSP is not running in the SoC. The API call fails if there is a queue open
55+
request to an acc queue and PDSP is not running. So make sure to copy firmware
56+
to file system before using these queue types.

‎drivers/soc/ti/knav_qmss.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ struct knav_pdsp_info {
137137
u32 __iomem *iram;
138138
u32 id;
139139
struct list_head list;
140+
bool loaded;
141+
bool started;
140142
};
141143

142144
struct knav_qmgr_info {

‎drivers/soc/ti/knav_qmss_acc.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ struct knav_range_ops knav_acc_range_ops = {
482482
* Return 0 on success or error
483483
*/
484484
int knav_init_acc_range(struct knav_device *kdev,
485-
struct device_node *node,
486-
struct knav_range_info *range)
485+
struct device_node *node,
486+
struct knav_range_info *range)
487487
{
488488
struct knav_acc_channel *acc;
489489
struct knav_pdsp_info *pdsp;
@@ -526,6 +526,12 @@ int knav_init_acc_range(struct knav_device *kdev,
526526
return -EINVAL;
527527
}
528528

529+
if (!pdsp->started) {
530+
dev_err(kdev->dev, "pdsp id %d not started for range %s\n",
531+
info->pdsp_id, range->name);
532+
return -ENODEV;
533+
}
534+
529535
info->pdsp = pdsp;
530536
channels = range->num_queues;
531537
if (of_get_property(node, "multi-queue", NULL)) {

‎drivers/soc/ti/knav_qmss_queue.c‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,8 @@ static int knav_queue_stop_pdsp(struct knav_device *kdev,
15041504
dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name);
15051505
return ret;
15061506
}
1507+
pdsp->loaded = false;
1508+
pdsp->started = false;
15071509
return 0;
15081510
}
15091511

@@ -1592,16 +1594,24 @@ static int knav_queue_start_pdsps(struct knav_device *kdev)
15921594
int ret;
15931595

15941596
knav_queue_stop_pdsps(kdev);
1595-
/* now load them all */
1597+
/* now load them all. We return success even if pdsp
1598+
* is not loaded as acc channels are optional on having
1599+
* firmware availability in the system. We set the loaded
1600+
* and stated flag and when initialize the acc range, check
1601+
* it and init the range only if pdsp is started.
1602+
*/
15961603
for_each_pdsp(kdev, pdsp) {
15971604
ret = knav_queue_load_pdsp(kdev, pdsp);
1598-
if (ret < 0)
1599-
return ret;
1605+
if (!ret)
1606+
pdsp->loaded = true;
16001607
}
16011608

16021609
for_each_pdsp(kdev, pdsp) {
1603-
ret = knav_queue_start_pdsp(kdev, pdsp);
1604-
WARN_ON(ret);
1610+
if (pdsp->loaded) {
1611+
ret = knav_queue_start_pdsp(kdev, pdsp);
1612+
if (!ret)
1613+
pdsp->started = true;
1614+
}
16051615
}
16061616
return 0;
16071617
}

0 commit comments

Comments
 (0)