netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net v2] ice: Fix incorrect timeout ice_release_res()
@ 2025-12-06 13:46 Ding Hui
  2025-12-08 22:17 ` Jacob Keller
  2025-12-08 22:33 ` [Intel-wired-lan] " Paul Menzel
  0 siblings, 2 replies; 3+ messages in thread
From: Ding Hui @ 2025-12-06 13:46 UTC (permalink / raw)
  To: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem,
	edumazet, kuba, pabeni, jacob.e.keller, intel-wired-lan
  Cc: netdev, linux-kernel, Ding Hui

The commit 5f6df173f92e ("ice: implement and use rd32_poll_timeout for
ice_sq_done timeout") converted ICE_CTL_Q_SQ_CMD_TIMEOUT from jiffies
to microseconds.

But the ice_release_res() function was missed, and its logic still
treats ICE_CTL_Q_SQ_CMD_TIMEOUT as a jiffies value.

So correct the issue by usecs_to_jiffies().

Found by inspection of the DDP downloading process.
Compile and modprobe tested only.

Fixes: 5f6df173f92e ("ice: implement and use rd32_poll_timeout for ice_sq_done timeout")
Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---
v1->v2: rebase to net branch and add commit log.

diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index 046bc9c65c51..785bf5cc1b25 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -2251,7 +2251,7 @@ void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res)
 	/* there are some rare cases when trying to release the resource
 	 * results in an admin queue timeout, so handle them correctly
 	 */
-	timeout = jiffies + 10 * ICE_CTL_Q_SQ_CMD_TIMEOUT;
+	timeout = jiffies + 10 * usecs_to_jiffies(ICE_CTL_Q_SQ_CMD_TIMEOUT);
 	do {
 		status = ice_aq_release_res(hw, res, 0, NULL);
 		if (status != -EIO)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch net v2] ice: Fix incorrect timeout ice_release_res()
  2025-12-06 13:46 [Patch net v2] ice: Fix incorrect timeout ice_release_res() Ding Hui
@ 2025-12-08 22:17 ` Jacob Keller
  2025-12-08 22:33 ` [Intel-wired-lan] " Paul Menzel
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2025-12-08 22:17 UTC (permalink / raw)
  To: Ding Hui, anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev,
	davem, edumazet, kuba, pabeni, intel-wired-lan
  Cc: netdev, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1729 bytes --]



On 12/6/2025 5:46 AM, Ding Hui wrote:
> The commit 5f6df173f92e ("ice: implement and use rd32_poll_timeout for
> ice_sq_done timeout") converted ICE_CTL_Q_SQ_CMD_TIMEOUT from jiffies
> to microseconds.
> 
> But the ice_release_res() function was missed, and its logic still
> treats ICE_CTL_Q_SQ_CMD_TIMEOUT as a jiffies value.
> 
> So correct the issue by usecs_to_jiffies().
> 
> Found by inspection of the DDP downloading process.
> Compile and modprobe tested only.
> 
> Fixes: 5f6df173f92e ("ice: implement and use rd32_poll_timeout for ice_sq_done timeout")
> Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
> Reviewed-by: Simon Horman <horms@kernel.org>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---

Thanks for catching this!

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> ---
> v1->v2: rebase to net branch and add commit log.
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
> index 046bc9c65c51..785bf5cc1b25 100644
> --- a/drivers/net/ethernet/intel/ice/ice_common.c
> +++ b/drivers/net/ethernet/intel/ice/ice_common.c
> @@ -2251,7 +2251,7 @@ void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res)
>  	/* there are some rare cases when trying to release the resource
>  	 * results in an admin queue timeout, so handle them correctly
>  	 */
> -	timeout = jiffies + 10 * ICE_CTL_Q_SQ_CMD_TIMEOUT;
> +	timeout = jiffies + 10 * usecs_to_jiffies(ICE_CTL_Q_SQ_CMD_TIMEOUT);
>  	do {
>  		status = ice_aq_release_res(hw, res, 0, NULL);
>  		if (status != -EIO)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Intel-wired-lan] [Patch net v2] ice: Fix incorrect timeout ice_release_res()
  2025-12-06 13:46 [Patch net v2] ice: Fix incorrect timeout ice_release_res() Ding Hui
  2025-12-08 22:17 ` Jacob Keller
@ 2025-12-08 22:33 ` Paul Menzel
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Menzel @ 2025-12-08 22:33 UTC (permalink / raw)
  To: Ding Hui
  Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem,
	edumazet, kuba, pabeni, jacob.e.keller, intel-wired-lan, netdev,
	linux-kernel

Dear Hui,


Thank you for your patch. One minor comments, should you resend.

Am 06.12.25 um 14:46 schrieb Ding Hui:
> The commit 5f6df173f92e ("ice: implement and use rd32_poll_timeout for

Without article: Commit 5f6df173f92e ("…") …

> ice_sq_done timeout") converted ICE_CTL_Q_SQ_CMD_TIMEOUT from jiffies
> to microseconds.
> 
> But the ice_release_res() function was missed, and its logic still
> treats ICE_CTL_Q_SQ_CMD_TIMEOUT as a jiffies value.
> 
> So correct the issue by usecs_to_jiffies().
> 
> Found by inspection of the DDP downloading process.
> Compile and modprobe tested only.
> 
> Fixes: 5f6df173f92e ("ice: implement and use rd32_poll_timeout for ice_sq_done timeout")
> Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
> Reviewed-by: Simon Horman <horms@kernel.org>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>   drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> ---
> v1->v2: rebase to net branch and add commit log.
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
> index 046bc9c65c51..785bf5cc1b25 100644
> --- a/drivers/net/ethernet/intel/ice/ice_common.c
> +++ b/drivers/net/ethernet/intel/ice/ice_common.c
> @@ -2251,7 +2251,7 @@ void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res)
>   	/* there are some rare cases when trying to release the resource
>   	 * results in an admin queue timeout, so handle them correctly
>   	 */
> -	timeout = jiffies + 10 * ICE_CTL_Q_SQ_CMD_TIMEOUT;
> +	timeout = jiffies + 10 * usecs_to_jiffies(ICE_CTL_Q_SQ_CMD_TIMEOUT);
>   	do {
>   		status = ice_aq_release_res(hw, res, 0, NULL);
>   		if (status != -EIO)

With or without amending the commit message, feel free to add:

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-08 22:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-06 13:46 [Patch net v2] ice: Fix incorrect timeout ice_release_res() Ding Hui
2025-12-08 22:17 ` Jacob Keller
2025-12-08 22:33 ` [Intel-wired-lan] " Paul Menzel

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).