From: Igor Russkikh <Igor.Russkikh@aquantia.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2 net 2/4] net: aquantia: when cleaning hw cache it should be toggled
Date: Wed, 16 Oct 2019 13:19:30 +0000 [thread overview]
Message-ID: <e39ae93c-60eb-7991-3b15-70a05aca3377@aquantia.com> (raw)
In-Reply-To: <20191015113317.6413f912@cakuba.netronome.com>
Hello Jakub,
>> workaround when stopping the device), register bit should actually
>> be toggled.
>
> Does the bit get set by the driver or HW?
>
> If it gets set by HW there is still a tiny race from reading to
> writing.. Perhaps doing two writes -> to 0 and to 1 would be a better
> option?
No, set is done by the driver, not HW. HW just tracks for the toggle.
>> It was previosly always just set. Due to the way driver stops HW this
>> never actually caused any issues, but it still may, so cleaning this up.
>
> Hm. So is it a cleanup of fix? Does the way code is written guarantee
> it will never cause issues?
Yes, thats a cleanup. We just had other products where this cache reset had to
be done multiple times. Obviously doing that second time was just no-op for
hardware ;)
On linux this always gets called on deinit only once - thus it was safe.
We just aligning here the linux driver with actual HW specification.
>> + if (err)
>> + goto err_exit;
>> +
>> + readx_poll_timeout_atomic(hw_atl_rdm_rx_dma_desc_cache_init_done_get,
>> + self, val, val == 1, 1000U, 10000U);
>
> It's a little strange to toggle, yet wait for it to be of a specific
> value..
Notice thats a different value - 'cache_init_done' bit.
This is used by HW to indicate completion of cache reset operation.
>> +err_exit:
>> + return err;
>
> Just return err instead of doing this pointless goto. It make the code
> harder to follow.
Sure
>> +#define RDM_RX_DMA_DESC_CACHE_INIT_DONE_DEFAULT 0x0
>> +
>> +
>
> two empty lines here?
Will fix.
Regards,
Igor
next prev parent reply other threads:[~2019-10-16 13:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 13:45 [PATCH v2 net 0/4] Aquantia/Marvell AQtion atlantic driver fixes 10/2019 Igor Russkikh
2019-10-11 13:45 ` [PATCH v2 net 1/4] net: aquantia: temperature retrieval fix Igor Russkikh
2019-10-11 13:45 ` [PATCH v2 net 2/4] net: aquantia: when cleaning hw cache it should be toggled Igor Russkikh
2019-10-15 18:33 ` Jakub Kicinski
2019-10-16 13:19 ` Igor Russkikh [this message]
2019-10-16 19:59 ` Jakub Kicinski
2019-10-11 13:45 ` [PATCH v2 net 3/4] net: aquantia: do not pass lro session with invalid tcp checksum Igor Russkikh
2019-10-11 13:45 ` [PATCH v2 net 4/4] net: aquantia: correctly handle macvlan and multicast coexistence Igor Russkikh
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=e39ae93c-60eb-7991-3b15-70a05aca3377@aquantia.com \
--to=igor.russkikh@aquantia.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.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;
as well as URLs for NNTP newsgroup(s).