From: Jakub Kicinski <kuba@kernel.org>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>, <davem@davemloft.net>,
<pabeni@redhat.com>, <edumazet@google.com>,
<andrew+netdev@lunn.ch>, <netdev@vger.kernel.org>,
<anton.nadezhdin@intel.com>, <przemyslaw.kitszel@intel.com>,
<milena.olech@intel.com>, <arkadiusz.kubalewski@intel.com>,
<richardcochran@gmail.com>,
Karol Kolacinski <karol.kolacinski@intel.com>,
Rinitha S <sx.rinitha@intel.com>
Subject: Re: [PATCH net-next 08/13] ice: use rd32_poll_timeout_atomic in ice_read_phy_tstamp_ll_e810
Date: Fri, 10 Jan 2025 17:25:36 -0800 [thread overview]
Message-ID: <20250110172536.7165c528@kernel.org> (raw)
In-Reply-To: <55655440-71b4-49e0-9fc8-d8b1b4f77ab4@intel.com>
On Fri, 10 Jan 2025 16:50:44 -0800 Jacob Keller wrote:
> On 1/9/2025 6:21 PM, Jakub Kicinski wrote:
> > On Wed, 8 Jan 2025 14:17:45 -0800 Tony Nguyen wrote:
> >> --- a/drivers/net/ethernet/intel/ice/ice_osdep.h
> >> +++ b/drivers/net/ethernet/intel/ice/ice_osdep.h
> >> @@ -26,6 +26,9 @@
> >>
> >> #define rd32_poll_timeout(a, addr, val, cond, delay_us, timeout_us) \
> >> read_poll_timeout(rd32, val, cond, delay_us, timeout_us, false, a, addr)
> >> +#define rd32_poll_timeout_atomic(a, addr, val, cond, delay_us, timeout_us) \
> >> + read_poll_timeout_atomic(rd32, val, cond, delay_us, timeout_us, false, \
> >> + a, addr)
> >
> > Could you deprecate the use of the osdep header? At the very least don't
> > add new stuff here. Back in the day "no OS abstraction layers" was
> > a pretty hard and fast rule. I don't hear it as much these days, but
> > I think it's still valid since this just obfuscates the code for all
> > readers outside your team.
>
> I assume you are referring to the abstractions in general (rd32,
> rd32_poll_timeout, etc) and not simply the name of the header (osdep.h)?
I presume the two are causally interlinked.
> I do agree that the layering with the intent to create an OS abstraction
> is not preferred and that its been pushed back against for years. We
> have been working to move away from OS abstractions, including several
> refactors to the ice driver. Use of "rd32_poll_timeout" is in fact one
> of these refactors: there's no reason to re-implement read polling when
> its provided by the kernel.
>
> However, I also think there is some value in shorthands for commonly
> used idioms like "readl(hw->hw_addr + reg_offset)" which make the intent
> more legible at least to me.
>
> These rd32_* implementations are built in line with the readl* variants
> in <linux/iopoll.h>
>
> I suppose it is more frustrating for someone on the opposite side who
> must content with each drivers variation of a register access macro. We
> could rip the rd32-etc out entirely and replace them with readl and
> friends directly... But that again feels like a lot of churn.
Right, too late for that.
> My goal with these macros was to make it easier for ice developers to
> use the read_poll_timeout bits within the existing framework, with an
> attempt to minimize the thrash to existing code.
>
> Glancing through driver/net/ethernet, it appears many drivers to use a
> straight readl, while others use a rapper like sbus_readl, gem_readl,
> Intel's rd32, etc.
Ack, and short hands make sense. But both rd32_poll_timeout_atomic and
the exiting rd32_poll_timeout have a single user.
next prev parent reply other threads:[~2025-01-11 1:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 22:17 [PATCH net-next 00/13][pull request] Intel Wired LAN Driver Updates 2025-01-08 (ice) Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 01/13] ice: c827: move wait for FW to ice_init_hw() Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 02/13] ice: split ice_init_hw() out from ice_init_dev() Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 03/13] ice: minor: rename goto labels from err to unroll Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 04/13] ice: ice_probe: init ice_adapter after HW init Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 05/13] ice: add recipe priority check in search Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 06/13] ice: add fw and port health reporters Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 07/13] ice: use string choice helpers Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 08/13] ice: use rd32_poll_timeout_atomic in ice_read_phy_tstamp_ll_e810 Tony Nguyen
2025-01-10 2:21 ` Jakub Kicinski
2025-01-11 0:50 ` Jacob Keller
2025-01-11 1:25 ` Jakub Kicinski [this message]
2025-01-13 18:18 ` Jacob Keller
2025-01-13 18:33 ` Jakub Kicinski
2025-01-08 22:17 ` [PATCH net-next 09/13] ice: rename TS_LL_READ* macros to REG_LL_PROXY_H_* Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 10/13] ice: add lock to protect low latency interface Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 11/13] ice: check low latency PHY timer update firmware capability Tony Nguyen
2025-01-08 22:17 ` [PATCH net-next 12/13] ice: implement low latency PHY timer updates Tony Nguyen
2025-01-10 2:18 ` Jakub Kicinski
2025-01-13 18:50 ` Jacob Keller
2025-01-13 20:46 ` Michal Schmidt
2025-01-13 21:17 ` Jacob Keller
2025-01-13 21:40 ` Jacob Keller
2025-01-08 22:17 ` [PATCH net-next 13/13] ice: Add in/out PTP pin delays Tony Nguyen
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=20250110172536.7165c528@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=anton.nadezhdin@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=karol.kolacinski@intel.com \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.com \
--cc=sx.rinitha@intel.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;
as well as URLs for NNTP newsgroup(s).