From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Sergey Shtylyov <s.shtylyov@omp.ru>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, claudiu.beznea.uj@bp.renesas.com,
yoshihiro.shimoda.uh@renesas.com,
wsa+renesas@sang-engineering.com,
niklas.soderlund+renesas@ragnatech.se,
biju.das.jz@bp.renesas.com,
prabhakar.mahadev-lad.rj@bp.renesas.com,
mitsuhiro.kimura.kc@renesas.com, geert+renesas@glider.be
Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/2] net: ravb: Wait for operation mode to be applied
Date: Wed, 20 Dec 2023 13:27:43 +0200 [thread overview]
Message-ID: <a617f464-e61e-44a7-8483-8890d4b2142f@tuxon.dev> (raw)
In-Reply-To: <2e70a095-8079-84f1-f842-eb90059610ed@omp.ru>
On 19.12.2023 18:49, Sergey Shtylyov wrote:
> On 12/15/23 1:04 PM, claudiu beznea wrote:
> [...]
>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>>
>>>> CSR.OPS bits specify the current operating mode and (according to
>>>> documentation) they are updated when the operating mode change request
>>>> is processed. Thus, check CSR.OPS before proceeding.
>>>
>>> The manuals I have indeed say we need to check CSR.OPS... But we only
>>> need to wait iff we transfer from the operation mode to the config mode...
>>
>> RZ/G3S manual say about CSR.OPS "These bits are updated when an operating
>
> I was unable to find the RZ/G3 manuals on ther Renesas' website... :-(
>
>> mode changes is processed". From this I get we need to check it for any mode.
>
> I don't argue with the (safety) checking of CSR.OPS, I was just pointing
> out that the R-Car gen3 manual says that only transfer from operation to
> the config mode happens after a considerable amount of time, other transfers
> do happen immediately after updating CCC.OPC.
>
>> Also, on configuration procedure (of RZ/G3S) it say CSR.OPS need to be
>> checked when switching from reset -> config.
>
> Just checked or waited on?
Manual say to check that the read value of CSR.OPS=2
> The R-car does have a specific algorithm for transferring from the operation
> to the reset mode (you need to set CC.DTSR first and then wait for CSR.DTS to
> clear before updating CCC.OPC)...
In the stop procedure chapter of RZ/G3S manual, as the setup of DMAC.CCC=0
is the last operation that needs to be done, it doesn't specify either that
CSR needs to be checked.
>
> [...]
>
>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>> ---
>>>> drivers/net/ethernet/renesas/ravb_main.c | 47 ++++++++++++++++++++----
>>>> 1 file changed, 39 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>>>> index 9178f6d60e74..ce95eb5af354 100644
>>>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>>>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> [...]
>>>> @@ -1744,6 +1747,18 @@ static inline int ravb_hook_irq(unsigned int irq, irq_handler_t handler,
>>>> return error;
>>>> }
>>>>
>>>> +static int ravb_set_reset_mode(struct net_device *ndev)
>>>> +{
>>>> + int error;
>>>> +
>>>> + ravb_write(ndev, CCC_OPC_RESET, CCC);
>>>> + error = ravb_wait(ndev, CSR, CSR_OPS, CSR_OPS_RESET);
>>>> + if (error)
>>>> + netdev_err(ndev, "failed to switch device to reset mode\n");
>>>> +
>>>> + return error;
>>>> +}
>>>> +
>>>
>>> Again, ravb_wait() call doesn't seem necessary here...
>>
>> Ok. I followed the guideline from the description of CSR.OPS. Let me know
>> if you want to keep it or not. I think I haven't saw any issues w/o this.
>
> Yes, please remove the waiting.
>
> [...]
>
> MBR, Sergey
next prev parent reply other threads:[~2023-12-20 11:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 11:31 [PATCH net 0/2] net: ravb: fixes for the ravb driver Claudiu
2023-12-14 11:31 ` [PATCH net 1/2] net: ravb: Wait for operation mode to be applied Claudiu
2023-12-14 12:11 ` Niklas Söderlund
2023-12-14 12:25 ` claudiu beznea
2023-12-14 12:39 ` Niklas Söderlund
2023-12-14 12:57 ` claudiu beznea
2023-12-14 19:41 ` Sergey Shtylyov
2023-12-15 10:04 ` claudiu beznea
2023-12-19 16:49 ` Sergey Shtylyov
2023-12-20 11:27 ` claudiu beznea [this message]
2023-12-14 11:31 ` [PATCH net 2/2] net: ravb: Check that GTI loading request is done Claudiu
2023-12-14 12:33 ` Niklas Söderlund
2023-12-14 13:02 ` claudiu beznea
2023-12-14 20:22 ` Sergey Shtylyov
2023-12-15 10:13 ` claudiu beznea
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=a617f464-e61e-44a7-8483-8890d4b2142f@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=biju.das.jz@bp.renesas.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mitsuhiro.kimura.kc@renesas.com \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=pabeni@redhat.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=s.shtylyov@omp.ru \
--cc=wsa+renesas@sang-engineering.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/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®