[Intel-wired-lan] [PATCH iwl-next 1/7] ice: implement and use rd32_poll_timeout for ice_sq_done timeout
Pucha, HimasekharX Reddy
himasekharx.reddy.pucha at intel.com
Sun Aug 11 03:38:50 UTC 2024
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of Jacob Keller
> Sent: Wednesday, August 7, 2024 2:16 AM
> To: Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Intel Wired LAN <intel-wired-lan at lists.osuosl.org>; "netdev netdev"@vger.kernel.org
> Cc: Temerkhanov, Sergey <sergey.temerkhanov at intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel at intel.com>; Kolacinski, Karol <karol.kolacinski at intel.com>; Wierzbicki, Jacek <jacek.wierzbicki at intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next 1/7] ice: implement and use rd32_poll_timeout for ice_sq_done timeout
>
> The ice_sq_done function is used to check the control queue head register and determine whether or not the control queue processing is done. This function is called in a loop checking against jiffies for a specified timeout.
>
> The pattern of reading a register in a loop until a condition is true or a timeout is reached is a relatively common pattern. In fact, the kernel provides a read_poll_timeout function implementing this behavior in <linux/iopoll.h>
>
> Use of read_poll_timeout is preferred over directly coding these loops.
> However, using it in the ice driver is a bit more difficult because of the
> rd32 wrapper. Implement a rd32_poll_timeout wrapper based on read_poll_timeout.
>
> Refactor ice_sq_done to use rd32_poll_timeout, replacing the loop calling ice_sq_done in ice_sq_send_cmd. This simplifies the logic down to a single
> ice_sq_done() call.
>
> The implementation of rd32_poll_timeout uses microseconds for its timeout value, so update the CQ timeout macros used to be specified in microseconds units as well instead of using HZ for jiffies.
>
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel at intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_controlq.h | 2 +-
> drivers/net/ethernet/intel/ice/ice_osdep.h | 4 +++
> drivers/net/ethernet/intel/ice/ice_controlq.c | 38 +++++++++++++--------------
> 3 files changed, 23 insertions(+), 21 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha at intel.com> (A Contingent worker at Intel)
More information about the Intel-wired-lan
mailing list