All of lore.kernel.org
 help / color / mirror / Atom feed
* [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document
@ 2015-10-12 19:54 ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2015-10-12 19:54 UTC (permalink / raw)
  To: corbet, ssantosh, linux-doc, linux-kernel, linux-arm-kernel,
	robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, linux,
	devicetree, arnd

Currently the DT bindings have details about the driver as well. This
patch moves this to a separate document for knav qmss driver so that
driver detail update can be done as needed without polluting the DT
bindings description.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 Documentation/arm/keystone/knav-qmss.txt           | 24 ++++++++++++++++++++++
 .../bindings/soc/ti/keystone-navigator-qmss.txt    | 20 ++++--------------
 2 files changed, 28 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/arm/keystone/knav-qmss.txt

diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
new file mode 100644
index 0000000..79946d1
--- /dev/null
+++ b/Documentation/arm/keystone/knav-qmss.txt
@@ -0,0 +1,24 @@
+* Texas Instruments Keystone Navigator Queue Management SubSystem driver
+
+Driver source code path
+  drivers/soc/ti/knav_qmss.c
+  drivers/soc/ti/knav_qmss_acc.c
+
+The QMSS (Queue Manager Sub System) found on Keystone SOCs is one of
+the main hardware sub system which forms the backbone of the Keystone
+multi-core Navigator. QMSS consist of queue managers, packed-data structure
+processors(PDSP), linking RAM, descriptor pools and infrastructure
+Packet DMA.
+The Queue Manager is a hardware module that is responsible for accelerating
+management of the packet queues. Packets are queued/de-queued by writing or
+reading descriptor address to a particular memory mapped location. The PDSPs
+perform QMSS related functions like accumulation, QoS, or event management.
+Linking RAM registers are used to link the descriptors which are stored in
+descriptor RAM. Descriptor RAM is configurable as internal or external memory.
+The QMSS driver manages the PDSP setups, linking RAM regions,
+queue pool management (allocation, push, pop and notify) and descriptor
+pool management.
+
+knav qmss driver provides a set of APIs to drivers to open/close qmss queues,
+allocate descriptor pools, map the descriptors, push/pop to queues etc. For
+details of the available APIs, please refers to include/linux/soc/ti/knav_qmss.h
diff --git a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
index d8e8cdb..2cecea1 100644
--- a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
+++ b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
@@ -1,20 +1,8 @@
-* Texas Instruments Keystone Navigator Queue Management SubSystem driver
-
-The QMSS (Queue Manager Sub System) found on Keystone SOCs is one of
-the main hardware sub system which forms the backbone of the Keystone
-multi-core Navigator. QMSS consist of queue managers, packed-data structure
-processors(PDSP), linking RAM, descriptor pools and infrastructure
-Packet DMA.
-The Queue Manager is a hardware module that is responsible for accelerating
-management of the packet queues. Packets are queued/de-queued by writing or
-reading descriptor address to a particular memory mapped location. The PDSPs
-perform QMSS related functions like accumulation, QoS, or event management.
-Linking RAM registers are used to link the descriptors which are stored in
-descriptor RAM. Descriptor RAM is configurable as internal or external memory.
-The QMSS driver manages the PDSP setups, linking RAM regions,
-queue pool management (allocation, push, pop and notify) and descriptor
-pool management.
+* Texas Instruments Keystone Navigator (knav) Queue Management SubSystem driver
+  DT bindings
 
+For details of the driver, please refer to
+Documentation/arm/keystone/knav-qmss.txt
 
 Required properties:
 - compatible	: Must be "ti,keystone-navigator-qmss";
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document
@ 2015-10-12 19:54 ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2015-10-12 19:54 UTC (permalink / raw)
  To: corbet, ssantosh, linux-doc, linux-kernel, linux-arm-kernel,
	robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, linux,
	devicetree, arnd

Currently the DT bindings have details about the driver as well. This
patch moves this to a separate document for knav qmss driver so that
driver detail update can be done as needed without polluting the DT
bindings description.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 Documentation/arm/keystone/knav-qmss.txt           | 24 ++++++++++++++++++++++
 .../bindings/soc/ti/keystone-navigator-qmss.txt    | 20 ++++--------------
 2 files changed, 28 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/arm/keystone/knav-qmss.txt

diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
new file mode 100644
index 0000000..79946d1
--- /dev/null
+++ b/Documentation/arm/keystone/knav-qmss.txt
@@ -0,0 +1,24 @@
+* Texas Instruments Keystone Navigator Queue Management SubSystem driver
+
+Driver source code path
+  drivers/soc/ti/knav_qmss.c
+  drivers/soc/ti/knav_qmss_acc.c
+
+The QMSS (Queue Manager Sub System) found on Keystone SOCs is one of
+the main hardware sub system which forms the backbone of the Keystone
+multi-core Navigator. QMSS consist of queue managers, packed-data structure
+processors(PDSP), linking RAM, descriptor pools and infrastructure
+Packet DMA.
+The Queue Manager is a hardware module that is responsible for accelerating
+management of the packet queues. Packets are queued/de-queued by writing or
+reading descriptor address to a particular memory mapped location. The PDSPs
+perform QMSS related functions like accumulation, QoS, or event management.
+Linking RAM registers are used to link the descriptors which are stored in
+descriptor RAM. Descriptor RAM is configurable as internal or external memory.
+The QMSS driver manages the PDSP setups, linking RAM regions,
+queue pool management (allocation, push, pop and notify) and descriptor
+pool management.
+
+knav qmss driver provides a set of APIs to drivers to open/close qmss queues,
+allocate descriptor pools, map the descriptors, push/pop to queues etc. For
+details of the available APIs, please refers to include/linux/soc/ti/knav_qmss.h
diff --git a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
index d8e8cdb..2cecea1 100644
--- a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
+++ b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
@@ -1,20 +1,8 @@
-* Texas Instruments Keystone Navigator Queue Management SubSystem driver
-
-The QMSS (Queue Manager Sub System) found on Keystone SOCs is one of
-the main hardware sub system which forms the backbone of the Keystone
-multi-core Navigator. QMSS consist of queue managers, packed-data structure
-processors(PDSP), linking RAM, descriptor pools and infrastructure
-Packet DMA.
-The Queue Manager is a hardware module that is responsible for accelerating
-management of the packet queues. Packets are queued/de-queued by writing or
-reading descriptor address to a particular memory mapped location. The PDSPs
-perform QMSS related functions like accumulation, QoS, or event management.
-Linking RAM registers are used to link the descriptors which are stored in
-descriptor RAM. Descriptor RAM is configurable as internal or external memory.
-The QMSS driver manages the PDSP setups, linking RAM regions,
-queue pool management (allocation, push, pop and notify) and descriptor
-pool management.
+* Texas Instruments Keystone Navigator (knav) Queue Management SubSystem driver
+  DT bindings
 
+For details of the driver, please refer to
+Documentation/arm/keystone/knav-qmss.txt
 
 Required properties:
 - compatible	: Must be "ti,keystone-navigator-qmss";
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document
@ 2015-10-12 19:54 ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2015-10-12 19:54 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the DT bindings have details about the driver as well. This
patch moves this to a separate document for knav qmss driver so that
driver detail update can be done as needed without polluting the DT
bindings description.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 Documentation/arm/keystone/knav-qmss.txt           | 24 ++++++++++++++++++++++
 .../bindings/soc/ti/keystone-navigator-qmss.txt    | 20 ++++--------------
 2 files changed, 28 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/arm/keystone/knav-qmss.txt

diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
new file mode 100644
index 0000000..79946d1
--- /dev/null
+++ b/Documentation/arm/keystone/knav-qmss.txt
@@ -0,0 +1,24 @@
+* Texas Instruments Keystone Navigator Queue Management SubSystem driver
+
+Driver source code path
+  drivers/soc/ti/knav_qmss.c
+  drivers/soc/ti/knav_qmss_acc.c
+
+The QMSS (Queue Manager Sub System) found on Keystone SOCs is one of
+the main hardware sub system which forms the backbone of the Keystone
+multi-core Navigator. QMSS consist of queue managers, packed-data structure
+processors(PDSP), linking RAM, descriptor pools and infrastructure
+Packet DMA.
+The Queue Manager is a hardware module that is responsible for accelerating
+management of the packet queues. Packets are queued/de-queued by writing or
+reading descriptor address to a particular memory mapped location. The PDSPs
+perform QMSS related functions like accumulation, QoS, or event management.
+Linking RAM registers are used to link the descriptors which are stored in
+descriptor RAM. Descriptor RAM is configurable as internal or external memory.
+The QMSS driver manages the PDSP setups, linking RAM regions,
+queue pool management (allocation, push, pop and notify) and descriptor
+pool management.
+
+knav qmss driver provides a set of APIs to drivers to open/close qmss queues,
+allocate descriptor pools, map the descriptors, push/pop to queues etc. For
+details of the available APIs, please refers to include/linux/soc/ti/knav_qmss.h
diff --git a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
index d8e8cdb..2cecea1 100644
--- a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
+++ b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
@@ -1,20 +1,8 @@
-* Texas Instruments Keystone Navigator Queue Management SubSystem driver
-
-The QMSS (Queue Manager Sub System) found on Keystone SOCs is one of
-the main hardware sub system which forms the backbone of the Keystone
-multi-core Navigator. QMSS consist of queue managers, packed-data structure
-processors(PDSP), linking RAM, descriptor pools and infrastructure
-Packet DMA.
-The Queue Manager is a hardware module that is responsible for accelerating
-management of the packet queues. Packets are queued/de-queued by writing or
-reading descriptor address to a particular memory mapped location. The PDSPs
-perform QMSS related functions like accumulation, QoS, or event management.
-Linking RAM registers are used to link the descriptors which are stored in
-descriptor RAM. Descriptor RAM is configurable as internal or external memory.
-The QMSS driver manages the PDSP setups, linking RAM regions,
-queue pool management (allocation, push, pop and notify) and descriptor
-pool management.
+* Texas Instruments Keystone Navigator (knav) Queue Management SubSystem driver
+  DT bindings
 
+For details of the driver, please refer to
+Documentation/arm/keystone/knav-qmss.txt
 
 Required properties:
 - compatible	: Must be "ti,keystone-navigator-qmss";
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Resend: PATCH v2 4/4] soc: ti: qmss: make acc queue support optional in the driver
@ 2015-10-12 19:55   ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2015-10-12 19:55 UTC (permalink / raw)
  To: corbet, ssantosh, linux-doc, linux-kernel, linux-arm-kernel,
	robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, linux,
	devicetree, arnd

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>
---
 - v2 : new patch added
 Documentation/arm/keystone/knav-qmss.txt |  6 ++++++
 drivers/soc/ti/knav_qmss.h               |  2 ++
 drivers/soc/ti/knav_qmss_acc.c           | 10 ++++++++--
 drivers/soc/ti/knav_qmss_queue.c         | 20 +++++++++++++++-----
 4 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
index da34a5b..fcdb9fd 100644
--- a/Documentation/arm/keystone/knav-qmss.txt
+++ b/Documentation/arm/keystone/knav-qmss.txt
@@ -48,3 +48,9 @@ in the file system and boot up the kernel. User would see
  "firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP"
 
 in the boot up log if loading of firmware to PDSP is successful.
+
+Use of accumulated queues requires the firmware image to be present in the
+file system. The driver doesn't acc queues to the supported queue range if
+PDSP is not running in the SoC. The API call fails if there is a queue open
+request to an acc queue and PDSP is not running. So make sure to copy firmware
+to file system before using these queue types.
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index c31b8d8..6ff936c 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -137,6 +137,8 @@ struct knav_pdsp_info {
 	u32 __iomem					*iram;
 	u32						id;
 	struct list_head				list;
+	bool						loaded;
+	bool						started;
 };
 
 struct knav_qmgr_info {
diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c
index b98fe56..d2d48f2 100644
--- a/drivers/soc/ti/knav_qmss_acc.c
+++ b/drivers/soc/ti/knav_qmss_acc.c
@@ -486,8 +486,8 @@ struct knav_range_ops knav_acc_range_ops = {
  * Return 0 on success or error
  */
 int knav_init_acc_range(struct knav_device *kdev,
-				struct device_node *node,
-				struct knav_range_info *range)
+			struct device_node *node,
+			struct knav_range_info *range)
 {
 	struct knav_acc_channel *acc;
 	struct knav_pdsp_info *pdsp;
@@ -530,6 +530,12 @@ int knav_init_acc_range(struct knav_device *kdev,
 		return -EINVAL;
 	}
 
+	if (!pdsp->started) {
+		dev_err(kdev->dev, "pdsp id %d not started for range %s\n",
+			info->pdsp_id, range->name);
+		return -ENODEV;
+	}
+
 	info->pdsp = pdsp;
 	channels = range->num_queues;
 	if (of_get_property(node, "multi-queue", NULL)) {
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 06d9de8..f3a0b6a 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1504,6 +1504,8 @@ static int knav_queue_stop_pdsp(struct knav_device *kdev,
 		dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name);
 		return ret;
 	}
+	pdsp->loaded = false;
+	pdsp->started = false;
 	return 0;
 }
 
@@ -1592,16 +1594,24 @@ static int knav_queue_start_pdsps(struct knav_device *kdev)
 	int ret;
 
 	knav_queue_stop_pdsps(kdev);
-	/* now load them all */
+	/* now load them all. We return success even if pdsp
+	 * is not loaded as acc channels are optional on having
+	 * firmware availability in the system. We set the loaded
+	 * and stated flag and when initialize the acc range, check
+	 * it and init the range only if pdsp is started.
+	 */
 	for_each_pdsp(kdev, pdsp) {
 		ret = knav_queue_load_pdsp(kdev, pdsp);
-		if (ret < 0)
-			return ret;
+		if (!ret)
+			pdsp->loaded = true;
 	}
 
 	for_each_pdsp(kdev, pdsp) {
-		ret = knav_queue_start_pdsp(kdev, pdsp);
-		WARN_ON(ret);
+		if (pdsp->loaded) {
+			ret = knav_queue_start_pdsp(kdev, pdsp);
+			if (!ret)
+				pdsp->started = true;
+		}
 	}
 	return 0;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Resend: PATCH v2 4/4] soc: ti: qmss: make acc queue support optional in the driver
@ 2015-10-12 19:55   ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2015-10-12 19:55 UTC (permalink / raw)
  To: corbet-T1hC0tSOHrs, ssantosh-DgEjT+Ai2ygdnm+yROfE0A,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4

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-l0cyMroinI0@public.gmane.org>
---
 - v2 : new patch added
 Documentation/arm/keystone/knav-qmss.txt |  6 ++++++
 drivers/soc/ti/knav_qmss.h               |  2 ++
 drivers/soc/ti/knav_qmss_acc.c           | 10 ++++++++--
 drivers/soc/ti/knav_qmss_queue.c         | 20 +++++++++++++++-----
 4 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
index da34a5b..fcdb9fd 100644
--- a/Documentation/arm/keystone/knav-qmss.txt
+++ b/Documentation/arm/keystone/knav-qmss.txt
@@ -48,3 +48,9 @@ in the file system and boot up the kernel. User would see
  "firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP"
 
 in the boot up log if loading of firmware to PDSP is successful.
+
+Use of accumulated queues requires the firmware image to be present in the
+file system. The driver doesn't acc queues to the supported queue range if
+PDSP is not running in the SoC. The API call fails if there is a queue open
+request to an acc queue and PDSP is not running. So make sure to copy firmware
+to file system before using these queue types.
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index c31b8d8..6ff936c 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -137,6 +137,8 @@ struct knav_pdsp_info {
 	u32 __iomem					*iram;
 	u32						id;
 	struct list_head				list;
+	bool						loaded;
+	bool						started;
 };
 
 struct knav_qmgr_info {
diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c
index b98fe56..d2d48f2 100644
--- a/drivers/soc/ti/knav_qmss_acc.c
+++ b/drivers/soc/ti/knav_qmss_acc.c
@@ -486,8 +486,8 @@ struct knav_range_ops knav_acc_range_ops = {
  * Return 0 on success or error
  */
 int knav_init_acc_range(struct knav_device *kdev,
-				struct device_node *node,
-				struct knav_range_info *range)
+			struct device_node *node,
+			struct knav_range_info *range)
 {
 	struct knav_acc_channel *acc;
 	struct knav_pdsp_info *pdsp;
@@ -530,6 +530,12 @@ int knav_init_acc_range(struct knav_device *kdev,
 		return -EINVAL;
 	}
 
+	if (!pdsp->started) {
+		dev_err(kdev->dev, "pdsp id %d not started for range %s\n",
+			info->pdsp_id, range->name);
+		return -ENODEV;
+	}
+
 	info->pdsp = pdsp;
 	channels = range->num_queues;
 	if (of_get_property(node, "multi-queue", NULL)) {
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 06d9de8..f3a0b6a 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1504,6 +1504,8 @@ static int knav_queue_stop_pdsp(struct knav_device *kdev,
 		dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name);
 		return ret;
 	}
+	pdsp->loaded = false;
+	pdsp->started = false;
 	return 0;
 }
 
@@ -1592,16 +1594,24 @@ static int knav_queue_start_pdsps(struct knav_device *kdev)
 	int ret;
 
 	knav_queue_stop_pdsps(kdev);
-	/* now load them all */
+	/* now load them all. We return success even if pdsp
+	 * is not loaded as acc channels are optional on having
+	 * firmware availability in the system. We set the loaded
+	 * and stated flag and when initialize the acc range, check
+	 * it and init the range only if pdsp is started.
+	 */
 	for_each_pdsp(kdev, pdsp) {
 		ret = knav_queue_load_pdsp(kdev, pdsp);
-		if (ret < 0)
-			return ret;
+		if (!ret)
+			pdsp->loaded = true;
 	}
 
 	for_each_pdsp(kdev, pdsp) {
-		ret = knav_queue_start_pdsp(kdev, pdsp);
-		WARN_ON(ret);
+		if (pdsp->loaded) {
+			ret = knav_queue_start_pdsp(kdev, pdsp);
+			if (!ret)
+				pdsp->started = true;
+		}
 	}
 	return 0;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Resend: PATCH v2 4/4] soc: ti: qmss: make acc queue support optional in the driver
@ 2015-10-12 19:55   ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2015-10-12 19:55 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 - v2 : new patch added
 Documentation/arm/keystone/knav-qmss.txt |  6 ++++++
 drivers/soc/ti/knav_qmss.h               |  2 ++
 drivers/soc/ti/knav_qmss_acc.c           | 10 ++++++++--
 drivers/soc/ti/knav_qmss_queue.c         | 20 +++++++++++++++-----
 4 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
index da34a5b..fcdb9fd 100644
--- a/Documentation/arm/keystone/knav-qmss.txt
+++ b/Documentation/arm/keystone/knav-qmss.txt
@@ -48,3 +48,9 @@ in the file system and boot up the kernel. User would see
  "firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP"
 
 in the boot up log if loading of firmware to PDSP is successful.
+
+Use of accumulated queues requires the firmware image to be present in the
+file system. The driver doesn't acc queues to the supported queue range if
+PDSP is not running in the SoC. The API call fails if there is a queue open
+request to an acc queue and PDSP is not running. So make sure to copy firmware
+to file system before using these queue types.
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index c31b8d8..6ff936c 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -137,6 +137,8 @@ struct knav_pdsp_info {
 	u32 __iomem					*iram;
 	u32						id;
 	struct list_head				list;
+	bool						loaded;
+	bool						started;
 };
 
 struct knav_qmgr_info {
diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c
index b98fe56..d2d48f2 100644
--- a/drivers/soc/ti/knav_qmss_acc.c
+++ b/drivers/soc/ti/knav_qmss_acc.c
@@ -486,8 +486,8 @@ struct knav_range_ops knav_acc_range_ops = {
  * Return 0 on success or error
  */
 int knav_init_acc_range(struct knav_device *kdev,
-				struct device_node *node,
-				struct knav_range_info *range)
+			struct device_node *node,
+			struct knav_range_info *range)
 {
 	struct knav_acc_channel *acc;
 	struct knav_pdsp_info *pdsp;
@@ -530,6 +530,12 @@ int knav_init_acc_range(struct knav_device *kdev,
 		return -EINVAL;
 	}
 
+	if (!pdsp->started) {
+		dev_err(kdev->dev, "pdsp id %d not started for range %s\n",
+			info->pdsp_id, range->name);
+		return -ENODEV;
+	}
+
 	info->pdsp = pdsp;
 	channels = range->num_queues;
 	if (of_get_property(node, "multi-queue", NULL)) {
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 06d9de8..f3a0b6a 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1504,6 +1504,8 @@ static int knav_queue_stop_pdsp(struct knav_device *kdev,
 		dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name);
 		return ret;
 	}
+	pdsp->loaded = false;
+	pdsp->started = false;
 	return 0;
 }
 
@@ -1592,16 +1594,24 @@ static int knav_queue_start_pdsps(struct knav_device *kdev)
 	int ret;
 
 	knav_queue_stop_pdsps(kdev);
-	/* now load them all */
+	/* now load them all. We return success even if pdsp
+	 * is not loaded as acc channels are optional on having
+	 * firmware availability in the system. We set the loaded
+	 * and stated flag and when initialize the acc range, check
+	 * it and init the range only if pdsp is started.
+	 */
 	for_each_pdsp(kdev, pdsp) {
 		ret = knav_queue_load_pdsp(kdev, pdsp);
-		if (ret < 0)
-			return ret;
+		if (!ret)
+			pdsp->loaded = true;
 	}
 
 	for_each_pdsp(kdev, pdsp) {
-		ret = knav_queue_start_pdsp(kdev, pdsp);
-		WARN_ON(ret);
+		if (pdsp->loaded) {
+			ret = knav_queue_start_pdsp(kdev, pdsp);
+			if (!ret)
+				pdsp->started = true;
+		}
 	}
 	return 0;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document
@ 2015-10-13 14:31   ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2015-10-13 14:31 UTC (permalink / raw)
  To: Murali Karicheri
  Cc: corbet, ssantosh, linux-doc, linux-kernel, linux-arm-kernel,
	robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, linux,
	devicetree

On Monday 12 October 2015 15:54:59 Murali Karicheri wrote:
> Currently the DT bindings have details about the driver as well. This
> patch moves this to a separate document for knav qmss driver so that
> driver detail update can be done as needed without polluting the DT
> bindings description.
> 
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> ---
>  Documentation/arm/keystone/knav-qmss.txt           | 24 ++++++++++++++++++++++
>  .../bindings/soc/ti/keystone-navigator-qmss.txt    | 20 ++++--------------
>  2 files changed, 28 insertions(+), 16 deletions(-)
>  create mode 100644 Documentation/arm/keystone/knav-qmss.txt
> 
> diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
> new file mode 100644
> index 0000000..79946d1
> --- /dev/null
> +++ b/Documentation/arm/keystone/knav-qmss.txt
>  
> +For details of the driver, please refer to
> +Documentation/arm/keystone/knav-qmss.txt
>  
>  Required properties:
>  - compatible   : Must be "ti,keystone-navigator-qmss";
> 

I'd actually not even put this sentence in: the binding is supposed
to describe the hardware, not the Linux implementation as you correctly
describe above, but I'd also try to not reference files that only
exist in the Linux kernel tree.

	Arnd

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document
@ 2015-10-13 14:31   ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2015-10-13 14:31 UTC (permalink / raw)
  To: Murali Karicheri
  Cc: corbet-T1hC0tSOHrs, ssantosh-DgEjT+Ai2ygdnm+yROfE0A,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Monday 12 October 2015 15:54:59 Murali Karicheri wrote:
> Currently the DT bindings have details about the driver as well. This
> patch moves this to a separate document for knav qmss driver so that
> driver detail update can be done as needed without polluting the DT
> bindings description.
> 
> Signed-off-by: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
> ---
>  Documentation/arm/keystone/knav-qmss.txt           | 24 ++++++++++++++++++++++
>  .../bindings/soc/ti/keystone-navigator-qmss.txt    | 20 ++++--------------
>  2 files changed, 28 insertions(+), 16 deletions(-)
>  create mode 100644 Documentation/arm/keystone/knav-qmss.txt
> 
> diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
> new file mode 100644
> index 0000000..79946d1
> --- /dev/null
> +++ b/Documentation/arm/keystone/knav-qmss.txt
>  
> +For details of the driver, please refer to
> +Documentation/arm/keystone/knav-qmss.txt
>  
>  Required properties:
>  - compatible   : Must be "ti,keystone-navigator-qmss";
> 

I'd actually not even put this sentence in: the binding is supposed
to describe the hardware, not the Linux implementation as you correctly
describe above, but I'd also try to not reference files that only
exist in the Linux kernel tree.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document
@ 2015-10-13 14:31   ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2015-10-13 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 12 October 2015 15:54:59 Murali Karicheri wrote:
> Currently the DT bindings have details about the driver as well. This
> patch moves this to a separate document for knav qmss driver so that
> driver detail update can be done as needed without polluting the DT
> bindings description.
> 
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> ---
>  Documentation/arm/keystone/knav-qmss.txt           | 24 ++++++++++++++++++++++
>  .../bindings/soc/ti/keystone-navigator-qmss.txt    | 20 ++++--------------
>  2 files changed, 28 insertions(+), 16 deletions(-)
>  create mode 100644 Documentation/arm/keystone/knav-qmss.txt
> 
> diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
> new file mode 100644
> index 0000000..79946d1
> --- /dev/null
> +++ b/Documentation/arm/keystone/knav-qmss.txt
>  
> +For details of the driver, please refer to
> +Documentation/arm/keystone/knav-qmss.txt
>  
>  Required properties:
>  - compatible   : Must be "ti,keystone-navigator-qmss";
> 

I'd actually not even put this sentence in: the binding is supposed
to describe the hardware, not the Linux implementation as you correctly
describe above, but I'd also try to not reference files that only
exist in the Linux kernel tree.

	Arnd

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-13 14:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 19:54 [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document Murali Karicheri
2015-10-12 19:54 ` Murali Karicheri
2015-10-12 19:54 ` Murali Karicheri
2015-10-12 19:55 ` [Resend: PATCH v2 4/4] soc: ti: qmss: make acc queue support optional in the driver Murali Karicheri
2015-10-12 19:55   ` Murali Karicheri
2015-10-12 19:55   ` Murali Karicheri
2015-10-13 14:31 ` [Resend: PATCH v2 1/4] Documentation: dt: soc: move driver description to a separate document Arnd Bergmann
2015-10-13 14:31   ` Arnd Bergmann
2015-10-13 14:31   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.