netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] e1000e: Fix error handling in e1000_set_d0_lplu_state_82571
@ 2021-02-28  9:44 Dinghao Liu
  2021-03-08  5:43 ` [Intel-wired-lan] " Neftin, Sasha
  2021-03-09  7:02 ` Dvora Fuxbrumer
  0 siblings, 2 replies; 3+ messages in thread
From: Dinghao Liu @ 2021-02-28  9:44 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Jesse Brandeburg, Tony Nguyen, David S. Miller, Jakub Kicinski,
	intel-wired-lan, netdev, linux-kernel

There is one e1e_wphy() call in e1000_set_d0_lplu_state_82571
that we have caught its return value but lack further handling.
Check and terminate the execution flow just like other e1e_wphy()
in this function.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/net/ethernet/intel/e1000e/82571.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 88faf05e23ba..0b1e890dd583 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -899,6 +899,8 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
 	} else {
 		data &= ~IGP02E1000_PM_D0_LPLU;
 		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
+		if (ret_val)
+			return ret_val;
 		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
 		 * during Dx states where the power conservation is most
 		 * important.  During driver activity we should enable
-- 
2.17.1


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

* Re: [Intel-wired-lan] [PATCH] e1000e: Fix error handling in e1000_set_d0_lplu_state_82571
  2021-02-28  9:44 [PATCH] e1000e: Fix error handling in e1000_set_d0_lplu_state_82571 Dinghao Liu
@ 2021-03-08  5:43 ` Neftin, Sasha
  2021-03-09  7:02 ` Dvora Fuxbrumer
  1 sibling, 0 replies; 3+ messages in thread
From: Neftin, Sasha @ 2021-03-08  5:43 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: netdev, linux-kernel, intel-wired-lan, Jakub Kicinski, David S. Miller

On 2/28/2021 11:44, Dinghao Liu wrote:
> There is one e1e_wphy() call in e1000_set_d0_lplu_state_82571
> that we have caught its return value but lack further handling.
> Check and terminate the execution flow just like other e1e_wphy()
> in this function.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>   drivers/net/ethernet/intel/e1000e/82571.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
> index 88faf05e23ba..0b1e890dd583 100644
> --- a/drivers/net/ethernet/intel/e1000e/82571.c
> +++ b/drivers/net/ethernet/intel/e1000e/82571.c
> @@ -899,6 +899,8 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
>   	} else {
>   		data &= ~IGP02E1000_PM_D0_LPLU;
>   		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
> +		if (ret_val)
> +			return ret_val;
>   		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
>   		 * during Dx states where the power conservation is most
>   		 * important.  During driver activity we should enable
> 
Good for me.
Acked-by: Sasha Neftin <sasha.neftin@intel.com>

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

* Re: [Intel-wired-lan] [PATCH] e1000e: Fix error handling in e1000_set_d0_lplu_state_82571
  2021-02-28  9:44 [PATCH] e1000e: Fix error handling in e1000_set_d0_lplu_state_82571 Dinghao Liu
  2021-03-08  5:43 ` [Intel-wired-lan] " Neftin, Sasha
@ 2021-03-09  7:02 ` Dvora Fuxbrumer
  1 sibling, 0 replies; 3+ messages in thread
From: Dvora Fuxbrumer @ 2021-03-09  7:02 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: netdev, linux-kernel, intel-wired-lan, Jakub Kicinski, David S. Miller

On 28/02/2021 11:44, Dinghao Liu wrote:
> There is one e1e_wphy() call in e1000_set_d0_lplu_state_82571
> that we have caught its return value but lack further handling.
> Check and terminate the execution flow just like other e1e_wphy()
> in this function.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>   drivers/net/ethernet/intel/e1000e/82571.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
> index 88faf05e23ba..0b1e890dd583 100644
> --- a/drivers/net/ethernet/intel/e1000e/82571.c
> +++ b/drivers/net/ethernet/intel/e1000e/82571.c
> @@ -899,6 +899,8 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
>   	} else {
>   		data &= ~IGP02E1000_PM_D0_LPLU;
>   		ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
> +		if (ret_val)
> +			return ret_val;
>   		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
>   		 * during Dx states where the power conservation is most
>   		 * important.  During driver activity we should enable
> 
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>

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

end of thread, other threads:[~2021-03-09  7:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28  9:44 [PATCH] e1000e: Fix error handling in e1000_set_d0_lplu_state_82571 Dinghao Liu
2021-03-08  5:43 ` [Intel-wired-lan] " Neftin, Sasha
2021-03-09  7:02 ` Dvora Fuxbrumer

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