All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>,
	Rob Herring <robh+dt@kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Santosh Shilimkar <ssantosh@kernel.org>
Cc: Sekhar Nori <nsekhar@ti.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	<dmaengine@vger.kernel.org>
Subject: Re: [PATCH next 4/6] soc: ti: k3-ringacc: add request pair of rings api.
Date: Wed, 1 Jul 2020 15:33:34 +0300	[thread overview]
Message-ID: <45e136da-12c4-044e-dab5-4e9f9d406be9@ti.com> (raw)
In-Reply-To: <e3936c3c-eb60-35a5-6413-ceba273cdf1c@ti.com>



On 01/07/2020 15.12, Grygorii Strashko wrote:
> 
> 
> On 01/07/2020 14:54, Peter Ujfalusi wrote:
>> Hi Grygorii,
>>
>> On 01/07/2020 13.30, Grygorii Strashko wrote:
>>> Add new API k3_ringacc_request_rings_pair() to request pair of rings at
>>> once, as in the most cases Rings are used with DMA channels, which
>>> need to
>>> request pair of rings - one to feed DMA with descriptors (TX/RX FDQ) and
>>> one to receive completions (RX/TX CQ). This will allow to simplify
>>> Ringacc
>>> API users.
>>>
>>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>>> ---
>>>   drivers/soc/ti/k3-ringacc.c       | 24 ++++++++++++++++++++++++
>>>   include/linux/soc/ti/k3-ringacc.h |  4 ++++
>>>   2 files changed, 28 insertions(+)
>>>
>>> diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c
>>> index 8a8f31d59e24..4cf1150de88e 100644
>>> --- a/drivers/soc/ti/k3-ringacc.c
>>> +++ b/drivers/soc/ti/k3-ringacc.c
>>> @@ -322,6 +322,30 @@ struct k3_ring *k3_ringacc_request_ring(struct
>>> k3_ringacc *ringacc,
>>>   }
>>>   EXPORT_SYMBOL_GPL(k3_ringacc_request_ring);
>>>   +int k3_ringacc_request_rings_pair(struct k3_ringacc *ringacc,
>>> +                  int fwd_id, int compl_id,
>>> +                  struct k3_ring **fwd_ring,
>>> +                  struct k3_ring **compl_ring)
>>
>> Would you consider re-arranging the parameter list to:
>> int k3_ringacc_request_rings_pair(struct k3_ringacc *ringacc,
>>                   struct k3_ring **fwd_ring, int fwd_id,
>>                   struct k3_ring **compl_ring, int compl_id)
>>
> 
> i think it's more common to have input parameters first.

That's true. I just like parameters grouped.
(ringacc, fwd_id, fwd_ring, compl_id, compl_ring)

having said that, I don't have objection to leave things as they are.

> 
>>> +{
>>> +    int ret = 0;
>>> +
>>> +    if (!fwd_ring || !compl_ring)
>>> +        return -EINVAL;
>>> +
>>> +    *fwd_ring = k3_ringacc_request_ring(ringacc, fwd_id, 0);
>>> +    if (!(*fwd_ring))
>>> +        return -ENODEV;
>>> +
>>> +    *compl_ring = k3_ringacc_request_ring(ringacc, compl_id, 0);
>>> +    if (!(*compl_ring)) {
>>> +        k3_ringacc_ring_free(*fwd_ring);
>>> +        ret = -ENODEV;
>>> +    }
>>> +
>>> +    return ret;
>>> +}
>>> +EXPORT_SYMBOL_GPL(k3_ringacc_request_rings_pair);
>>> +
> 
> 
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


WARNING: multiple messages have this Message-ID (diff)
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>,
	Rob Herring <robh+dt@kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Santosh Shilimkar <ssantosh@kernel.org>
Cc: dmaengine@vger.kernel.org, Sekhar Nori <nsekhar@ti.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH next 4/6] soc: ti: k3-ringacc: add request pair of rings api.
Date: Wed, 1 Jul 2020 15:33:34 +0300	[thread overview]
Message-ID: <45e136da-12c4-044e-dab5-4e9f9d406be9@ti.com> (raw)
In-Reply-To: <e3936c3c-eb60-35a5-6413-ceba273cdf1c@ti.com>



On 01/07/2020 15.12, Grygorii Strashko wrote:
> 
> 
> On 01/07/2020 14:54, Peter Ujfalusi wrote:
>> Hi Grygorii,
>>
>> On 01/07/2020 13.30, Grygorii Strashko wrote:
>>> Add new API k3_ringacc_request_rings_pair() to request pair of rings at
>>> once, as in the most cases Rings are used with DMA channels, which
>>> need to
>>> request pair of rings - one to feed DMA with descriptors (TX/RX FDQ) and
>>> one to receive completions (RX/TX CQ). This will allow to simplify
>>> Ringacc
>>> API users.
>>>
>>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>>> ---
>>>   drivers/soc/ti/k3-ringacc.c       | 24 ++++++++++++++++++++++++
>>>   include/linux/soc/ti/k3-ringacc.h |  4 ++++
>>>   2 files changed, 28 insertions(+)
>>>
>>> diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c
>>> index 8a8f31d59e24..4cf1150de88e 100644
>>> --- a/drivers/soc/ti/k3-ringacc.c
>>> +++ b/drivers/soc/ti/k3-ringacc.c
>>> @@ -322,6 +322,30 @@ struct k3_ring *k3_ringacc_request_ring(struct
>>> k3_ringacc *ringacc,
>>>   }
>>>   EXPORT_SYMBOL_GPL(k3_ringacc_request_ring);
>>>   +int k3_ringacc_request_rings_pair(struct k3_ringacc *ringacc,
>>> +                  int fwd_id, int compl_id,
>>> +                  struct k3_ring **fwd_ring,
>>> +                  struct k3_ring **compl_ring)
>>
>> Would you consider re-arranging the parameter list to:
>> int k3_ringacc_request_rings_pair(struct k3_ringacc *ringacc,
>>                   struct k3_ring **fwd_ring, int fwd_id,
>>                   struct k3_ring **compl_ring, int compl_id)
>>
> 
> i think it's more common to have input parameters first.

That's true. I just like parameters grouped.
(ringacc, fwd_id, fwd_ring, compl_id, compl_ring)

having said that, I don't have objection to leave things as they are.

> 
>>> +{
>>> +    int ret = 0;
>>> +
>>> +    if (!fwd_ring || !compl_ring)
>>> +        return -EINVAL;
>>> +
>>> +    *fwd_ring = k3_ringacc_request_ring(ringacc, fwd_id, 0);
>>> +    if (!(*fwd_ring))
>>> +        return -ENODEV;
>>> +
>>> +    *compl_ring = k3_ringacc_request_ring(ringacc, compl_id, 0);
>>> +    if (!(*compl_ring)) {
>>> +        k3_ringacc_ring_free(*fwd_ring);
>>> +        ret = -ENODEV;
>>> +    }
>>> +
>>> +    return ret;
>>> +}
>>> +EXPORT_SYMBOL_GPL(k3_ringacc_request_rings_pair);
>>> +
> 
> 
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-01 12:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 10:30 [PATCH next 0/6] soc: ti: k3-ringacc: updates Grygorii Strashko
2020-07-01 10:30 ` Grygorii Strashko
2020-07-01 10:30 ` [PATCH next 1/6] dt-bindings: soc: ti: k3-ringacc: convert bindings to json-schema Grygorii Strashko
2020-07-01 10:30   ` Grygorii Strashko
2020-07-15  9:40   ` Grygorii Strashko
2020-07-15  9:40     ` Grygorii Strashko
2020-07-01 10:30 ` [PATCH next 2/6] soc: ti: k3-ringacc: Move state tracking variables under a struct Grygorii Strashko
2020-07-01 10:30   ` Grygorii Strashko
2020-07-01 10:30 ` [PATCH next 3/6] soc: ti: k3-ringacc: add ring's flags to dump Grygorii Strashko
2020-07-01 10:30   ` Grygorii Strashko
2020-07-01 10:30 ` [PATCH next 4/6] soc: ti: k3-ringacc: add request pair of rings api Grygorii Strashko
2020-07-01 10:30   ` Grygorii Strashko
2020-07-01 11:54   ` Peter Ujfalusi
2020-07-01 11:54     ` Peter Ujfalusi
2020-07-01 12:12     ` Grygorii Strashko
2020-07-01 12:12       ` Grygorii Strashko
2020-07-01 12:33       ` Peter Ujfalusi [this message]
2020-07-01 12:33         ` Peter Ujfalusi
2020-07-01 10:30 ` [PATCH next 5/6] soc: ti: k3-ringacc: separate soc specific initialization Grygorii Strashko
2020-07-01 10:30   ` Grygorii Strashko
2020-07-01 10:30 ` [PATCH next 6/6] dmaengine: ti: k3-udma: Switch to k3_ringacc_request_rings_pair Grygorii Strashko
2020-07-01 10:30   ` Grygorii Strashko
2020-07-02 12:57   ` Vinod Koul
2020-07-02 12:57     ` Vinod Koul
2020-07-17 12:41     ` Grygorii Strashko
2020-07-17 12:41       ` Grygorii Strashko
2020-07-08  8:33 ` [PATCH next 0/6] soc: ti: k3-ringacc: updates Peter Ujfalusi
2020-07-08  8:33   ` Peter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45e136da-12c4-044e-dab5-4e9f9d406be9@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=vigneshr@ti.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.