mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] soc: ti: k3-ringacc: Correct ring API kernel-doc
@ 2026-09-19 16:37 Karl Mehltretter
  2026-09-19 16:37 ` [PATCH 2/2] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc Karl Mehltretter
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Mehltretter @ 2026-09-19 16:37 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar
  Cc: Karl Mehltretter, Grygorii Strashko, Peter Ujfalusi,
	linux-arm-kernel, linux-kernel

The ring accelerator header labels k3_ring_cfg as an enum, uses
propname instead of property, and gives the DMA reset helper the
ordinary reset helper's name. The DMA reset comment also omits occ,
including the convention that zero requests a hardware occupancy read.

The proxy flag is parsed as a separate parameter, and the pop helpers
describe pushing elements. Proxy access is supported in Message mode;
the listed Credentials and Queue modes are not implemented. The phandle
lookup returns encoded error pointers rather than integer error values.

Match the declarations and document these argument and operation roles.

Fixes: 3277e8aa2504 ("soc: ti: k3: add navss ringacc driver")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 include/linux/soc/ti/k3-ringacc.h | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/include/linux/soc/ti/k3-ringacc.h b/include/linux/soc/ti/k3-ringacc.h
index 39b022b92598..2de6031b9424 100644
--- a/include/linux/soc/ti/k3-ringacc.h
+++ b/include/linux/soc/ti/k3-ringacc.h
@@ -57,13 +57,13 @@ struct k3_ringacc;
 struct k3_ring;
 
 /**
- * enum k3_ring_cfg - RA ring configuration structure
+ * struct k3_ring_cfg - RA ring configuration structure
  *
  * @size: Ring size, number of elements
  * @elm_size: Ring element size
  * @mode: Ring operational mode
  * @flags: Ring configuration flags. Possible values:
- *	 @K3_RINGACC_RING_SHARED: when set allows to request the same ring
+ *	 %K3_RINGACC_RING_SHARED: when set allows to request the same ring
  *	 few times. It's usable when the same ring is used as Free Host PD ring
  *	 for different flows, for example.
  *	 Note: Locking should be done by consumer if required
@@ -88,11 +88,10 @@ struct k3_ring_cfg {
 /**
  * of_k3_ringacc_get_by_phandle - find a RA by phandle property
  * @np: device node
- * @propname: property name containing phandle on RA node
+ * @property: property name containing phandle on RA node
  *
- * Returns pointer on the RA - struct k3_ringacc
- * or -ENODEV if not found,
- * or -EPROBE_DEFER if not yet registered
+ * Return: Pointer to the RA, or ERR_PTR(-ENODEV) if the phandle cannot
+ * be resolved, or ERR_PTR(-EPROBE_DEFER) if the RA is not yet registered.
  */
 struct k3_ringacc *of_k3_ringacc_get_by_phandle(struct device_node *np,
 						const char *property);
@@ -103,10 +102,8 @@ struct k3_ringacc *of_k3_ringacc_get_by_phandle(struct device_node *np,
  * k3_ringacc_request_ring - request ring from ringacc
  * @ringacc: pointer on ringacc
  * @id: ring id or K3_RINGACC_RING_ID_ANY for any general purpose ring
- * @flags:
- *	@K3_RINGACC_RING_USE_PROXY: if set - proxy will be allocated and
- *		used to access ring memory. Sopported only for rings in
- *		Message/Credentials/Queue mode.
+ * @flags: Set %K3_RINGACC_RING_USE_PROXY to allocate a proxy for
+ *	accessing ring memory in Message mode.
  *
  * Returns pointer on the Ring - struct k3_ring
  * or NULL in case of failure.
@@ -126,8 +123,9 @@ int k3_ringacc_request_rings_pair(struct k3_ringacc *ringacc,
  */
 void k3_ringacc_ring_reset(struct k3_ring *ring);
 /**
- * k3_ringacc_ring_reset - ring reset for DMA rings
+ * k3_ringacc_ring_reset_dma - ring reset for DMA rings
  * @ring: pointer on Ring
+ * @occ: occupancy used by the DMA reset quirk, or zero to read it from hardware
  *
  * Resets ring internal state ((hw)occ, (hw)idx). Should be used for rings
  * which are read by K3 UDMA, like TX or Free Host PD rings.
@@ -217,8 +215,8 @@ int k3_ringacc_ring_push(struct k3_ring *ring, void *elem);
  * @ring: pointer on ring
  * @elem: pointer on ring element buffer
  *
- * Push one ring element from the ring head. Size of the ring element is
- * determined by ring configuration &struct k3_ring_cfg elm_size..
+ * Pop one ring element from the ring head. Size of the ring element is
+ * determined by ring configuration &struct k3_ring_cfg elm_size.
  *
  * Returns 0 on success, errno otherwise.
  */
@@ -242,7 +240,7 @@ int k3_ringacc_ring_push_head(struct k3_ring *ring, void *elem);
  * @ring: pointer on ring
  * @elem: pointer on ring element buffer
  *
- * Push one ring element from the ring tail. Size of the ring element is
+ * Pop one ring element from the ring tail. Size of the ring element is
  * determined by ring configuration &struct k3_ring_cfg elm_size.
  *
  * Returns 0 on success, errno otherwise.

base-commit: 50d05c7c76c96b90462f24debacca971d2e86713
-- 
2.39.5 (Apple Git-154)



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

* [PATCH 2/2] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc
  2026-09-19 16:37 [PATCH 1/2] soc: ti: k3-ringacc: Correct ring API kernel-doc Karl Mehltretter
@ 2026-09-19 16:37 ` Karl Mehltretter
  2026-09-22 16:04   ` Kumar, Udit
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Mehltretter @ 2026-09-19 16:37 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar
  Cc: Karl Mehltretter, Grygorii Strashko, Peter Ujfalusi,
	linux-arm-kernel, linux-kernel

The heading for k3_ringacc_init_data repeats struct, so kernel-doc
cannot match it to the declaration. Its three fields are also missing
descriptions.

Use the structure name and describe the firmware handle, device ID,
and number of ring pairs used during DMA ring initialization.

Fixes: d782298c6f6b ("soc: ti: k3-ringacc: add AM64 DMA rings support.")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 include/linux/soc/ti/k3-ringacc.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/soc/ti/k3-ringacc.h b/include/linux/soc/ti/k3-ringacc.h
index 2de6031b9424..37a333f9a10b 100644
--- a/include/linux/soc/ti/k3-ringacc.h
+++ b/include/linux/soc/ti/k3-ringacc.h
@@ -254,7 +254,10 @@ u32 k3_ringacc_get_tisci_dev_id(struct k3_ring *ring);
 struct ti_sci_handle;
 
 /**
- * struct struct k3_ringacc_init_data - Initialization data for DMA rings
+ * struct k3_ringacc_init_data - Initialization data for DMA rings
+ * @tisci: TI SCI firmware handle
+ * @tisci_dev_id: TI SCI device ID of the DMA controller
+ * @num_rings: Number of forward/completion ring pairs
  */
 struct k3_ringacc_init_data {
 	const struct ti_sci_handle *tisci;
-- 
2.39.5 (Apple Git-154)


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

* Re: [PATCH 2/2] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc
  2026-09-19 16:37 ` [PATCH 2/2] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc Karl Mehltretter
@ 2026-09-22 16:04   ` Kumar, Udit
  2026-09-22 19:17     ` Karl Mehltretter
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar, Udit @ 2026-09-22 16:04 UTC (permalink / raw)
  To: Karl Mehltretter, Nishanth Menon, Santosh Shilimkar
  Cc: Grygorii Strashko, Peter Ujfalusi, linux-arm-kernel,
	linux-kernel, u-kumar1



On 9/19/2026 10:07 PM, Karl Mehltretter wrote:
> The heading for k3_ringacc_init_data repeats struct, so kernel-doc
> cannot match it to the declaration. Its three fields are also missing
> descriptions.
> 
> Use the structure name and describe the firmware handle, device ID,
> and number of ring pairs used during DMA ring initialization.
> 
> Fixes: d782298c6f6b ("soc: ti: k3-ringacc: add AM64 DMA rings support.")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
> ---
>  include/linux/soc/ti/k3-ringacc.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/soc/ti/k3-ringacc.h b/include/linux/soc/ti/k3-ringacc.h
> index 2de6031b9424..37a333f9a10b 100644
> --- a/include/linux/soc/ti/k3-ringacc.h
> +++ b/include/linux/soc/ti/k3-ringacc.h
> @@ -254,7 +254,10 @@ u32 k3_ringacc_get_tisci_dev_id(struct k3_ring *ring);
>  struct ti_sci_handle;
>  
>  /**
> - * struct struct k3_ringacc_init_data - Initialization data for DMA rings
> + * struct k3_ringacc_init_data - Initialization data for DMA rings
> + * @tisci: TI SCI firmware handle
> + * @tisci_dev_id: TI SCI device ID of the DMA controller
> + * @num_rings: Number of forward/completion ring pairs

Sorry from where you got above definition of num_rings

>   */
>  struct k3_ringacc_init_data {
>  	const struct ti_sci_handle *tisci;


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

* Re: [PATCH 2/2] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc
  2026-09-22 16:04   ` Kumar, Udit
@ 2026-09-22 19:17     ` Karl Mehltretter
  2026-09-23  3:37       ` Kumar, Udit
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Mehltretter @ 2026-09-22 19:17 UTC (permalink / raw)
  To: Kumar, Udit
  Cc: Nishanth Menon, Santosh Shilimkar, Grygorii Strashko,
	Peter Ujfalusi, linux-arm-kernel, linux-kernel

On Tue, Sep 22, 2026 at 09:34:49PM +0100, Kumar, Udit wrote:
> > + * @num_rings: Number of forward/completion ring pairs
> 
> Sorry from where you got above definition of num_rings

Hi Udit,

It was inferred from the code. Is the description
inaccurate? What wording would you suggest?

Thanks,
Karl

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

* Re: [PATCH 2/2] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc
  2026-09-22 19:17     ` Karl Mehltretter
@ 2026-09-23  3:37       ` Kumar, Udit
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar, Udit @ 2026-09-23  3:37 UTC (permalink / raw)
  To: Karl Mehltretter
  Cc: Nishanth Menon, Santosh Shilimkar, Grygorii Strashko,
	Peter Ujfalusi, linux-arm-kernel, linux-kernel, u-kumar1

Hi Kari,

On 9/23/2026 12:47 AM, Karl Mehltretter wrote:
> On Tue, Sep 22, 2026 at 09:34:49PM +0100, Kumar, Udit wrote:
>>> + * @num_rings: Number of forward/completion ring pairs
>>
>> Sorry from where you got above definition of num_rings
> 
> Hi Udit,
> 
> It was inferred from the code. Is the description
> inaccurate? What wording would you suggest?
> 

This is just total number of available rings

you can refer
https://elixir.bootlin.com/linux/v7.2.6/source/drivers/dma/ti/k3-udma.c#L5492


https://elixir.bootlin.com/linux/v7.2.6/source/drivers/soc/ti/k3-ringacc.c#L1478

https://elixir.bootlin.com/linux/v7.2.6/source/drivers/soc/ti/k3-ringacc.c#L212


> Thanks,
> Karl


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

end of thread, other threads:[~2026-09-23  3:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-19 16:37 [PATCH 1/2] soc: ti: k3-ringacc: Correct ring API kernel-doc Karl Mehltretter
2026-09-19 16:37 ` [PATCH 2/2] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc Karl Mehltretter
2026-09-22 16:04   ` Kumar, Udit
2026-09-22 19:17     ` Karl Mehltretter
2026-09-23  3:37       ` Kumar, Udit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®