mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "ivan.khoronzhuk" <ivan.khoronzhuk@linaro.org>,
	<mugunthanvnm@ti.com>, <netdev@vger.kernel.org>
Cc: <linux-omap@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: ethernet: ti: davinci_cpdma: fix fixed prio cpdma ctlr configuration
Date: Thu, 10 Nov 2016 16:58:41 -0600	[thread overview]
Message-ID: <2ccb346e-e5d7-0b13-1956-099f69868696@ti.com> (raw)
In-Reply-To: <1501d6bd-ef97-cfb4-f02b-2b03b97ae636@globallogic.com>



On 11/10/2016 01:52 PM, ivan.khoronzhuk wrote:
>
>
> On 10.11.16 18:37, Grygorii Strashko wrote:
>>
>>
>> On 11/09/2016 05:56 PM, Ivan Khoronzhuk wrote:
>>>
>>>
>>> On 09.11.16 23:09, Grygorii Strashko wrote:
>>>>
>>>>
>>>> On 11/08/2016 07:10 AM, Ivan Khoronzhuk wrote:
>>>>> The dma ctlr is reseted to 0 while cpdma start, thus cpdma ctlr
>>>>
>>>> I assume this is because cpdma_ctlr_start() does soft reset. Is it
>>>> correct?
>>> Probably not. I've seen this register doesn't hold any previous settings
>>> (just trash)
>>
>> What register CPDMA_DMACONTROL or CPSW_DMACTRL?
>>
>>> after cpdma_ctlr_stop(), actually after last channel is stopped (inside
>>> of cpdma_ctlr_stop()).
>>
>> So, You are stating that Registers context is changed after stop?
>>
>>> Then cpdma_ctlr_start() just reset it to 0.
>>
>> "just trash" or "0".
>>
>> Sry, I do not see how cpdma_ctlr_stop() can affect on registers state :(
>> and I'd very appreciated if can provide more detailed information.
>>
> I've checked again, it was my mistake. It simply reset to 0 while soft
> reset.
>
>>>
>>>>
>>>>> cannot be configured after cpdma is stopped. So, restore content
>>>>> of cpdma ctlr while off/on procedure.
>>>>>
>>>>> Based on net-next/master
>>>>
>>>> ^ remove it
>>> sure
>>>
>>>>
>>>>>
>>>>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>>>>> ---
>>>>>  drivers/net/ethernet/ti/cpsw.c          |   6 +-
>>>>>  drivers/net/ethernet/ti/davinci_cpdma.c | 103
>>>>> +++++++++++++++++---------------
>>>>>  drivers/net/ethernet/ti/davinci_cpdma.h |   2 +
>>>>>  3 files changed, 58 insertions(+), 53 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/ethernet/ti/cpsw.c
>>>>> b/drivers/net/ethernet/ti/cpsw.c
>>>>> index b1ddf89..4d04b8e 100644
>>>>> --- a/drivers/net/ethernet/ti/cpsw.c
>>>>> +++ b/drivers/net/ethernet/ti/cpsw.c
>>>>> @@ -1376,10 +1376,6 @@ static int cpsw_ndo_open(struct net_device
>>>>> *ndev)
>>>>>                    ALE_ALL_PORTS, ALE_ALL_PORTS, 0, 0);
>>>>>
>>>>>      if (!cpsw_common_res_usage_state(cpsw)) {
>>>>> -        /* setup tx dma to fixed prio and zero offset */
>>>>> -        cpdma_control_set(cpsw->dma, CPDMA_TX_PRIO_FIXED, 1);
>>>>> -        cpdma_control_set(cpsw->dma, CPDMA_RX_BUFFER_OFFSET, 0);
>>>>> -
>>>>>          /* disable priority elevation */
>>>>>          __raw_writel(0, &cpsw->regs->ptype);
>>>>>
>>>>> @@ -2710,6 +2706,8 @@ static int cpsw_probe(struct platform_device
>>>>> *pdev)
>>>>>      dma_params.desc_align        = 16;
>>>>>      dma_params.has_ext_regs        = true;
>>>>>      dma_params.desc_hw_addr         = dma_params.desc_mem_phys;
>>>>> +    dma_params.rxbuf_offset        = 0;
>>>>> +    dma_params.fixed_prio        = 1;
>>>>
>>>> Do we really need this new parameters? Do you have plans to use other
>>>> values?
>>> I'm ok if this is static (equally as a bunch of rest in dma_params), no
>>> see reason to use other values,
>>
>> That's what i wanted to know :) - go static, pls.
>>
>>> it at least now. But the issue is not only in these two parameters and
>>> not only in cpsw_ndo_open().
>>> It touches cpsw_set_channels() also, where ctlr stop/start is present.
>>> In order to not copy cpdma_control_set(cpsw->dma, CPDMA_TX_PRIO_FIXED,
>>> 1)...
>>> in all such kind places in eth drivers, better to allow the cpdma to
>>> control it's parameters...
>>>
>>> The cpdma ctlr register holds a little more parameters (but only two of
>>> them are set in cpsw)
>>> Maybe there is reason to save them also. Actually I'd seen this problem
>>> when playing with
>>> on/off channel shapers, unfortunately the cpdma ctlr holds this info
>>> also, and it was lost
>>> while on/off (but I'm going to restore it in chan_start()).
>>>
>>
>> I understand you change, but I'm note sure about real root cause :(
> so, are you Ok with current version?

No. pls, use constant values and do not introduce additional parameters.
Also, pls update commit message with new information.

-- 
regards,
-grygorii

      reply	other threads:[~2016-11-11  0:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 13:10 Ivan Khoronzhuk
2016-11-09 21:09 ` Grygorii Strashko
2016-11-09 23:56   ` Ivan Khoronzhuk
2016-11-10 16:37     ` Grygorii Strashko
2016-11-10 19:52       ` ivan.khoronzhuk
2016-11-10 22:58         ` Grygorii Strashko [this message]

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=2ccb346e-e5d7-0b13-1956-099f69868696@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=ivan.khoronzhuk@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.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 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®