netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10
@ 2022-05-10 21:06 Tony Nguyen
  2022-05-10 21:06 ` [PATCH net-next 1/3] igc: Remove igc_set_spd_dplx method Tony Nguyen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tony Nguyen @ 2022-05-10 21:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet; +Cc: Tony Nguyen, netdev, sasha.neftin

This series contains updates to igc driver only.

Sasha cleans up the code by removing an unused function and removing an
enum for PHY type as there is only one PHY. The return type for
igc_check_downshift() is changed to void as it always returns success.

The following are changes since commit ecd17a87eb78b5bd5ca6d1aa20c39f2bc3591337:
  x25: remove redundant pointer dev
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 1GbE

Sasha Neftin (3):
  igc: Remove igc_set_spd_dplx method
  igc: Remove unused phy_type enum
  igc: Change type of the 'igc_check_downshift' method

 drivers/net/ethernet/intel/igc/igc.h      |  1 -
 drivers/net/ethernet/intel/igc/igc_base.c |  2 -
 drivers/net/ethernet/intel/igc/igc_hw.h   |  7 ----
 drivers/net/ethernet/intel/igc/igc_main.c | 50 -----------------------
 drivers/net/ethernet/intel/igc/igc_phy.c  | 16 ++------
 drivers/net/ethernet/intel/igc/igc_phy.h  |  2 +-
 6 files changed, 4 insertions(+), 74 deletions(-)

-- 
2.35.1


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

* [PATCH net-next 1/3] igc: Remove igc_set_spd_dplx method
  2022-05-10 21:06 [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 Tony Nguyen
@ 2022-05-10 21:06 ` Tony Nguyen
  2022-05-10 21:06 ` [PATCH net-next 2/3] igc: Remove unused phy_type enum Tony Nguyen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2022-05-10 21:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Sasha Neftin, netdev, anthony.l.nguyen,
	Muhammad Husaini Zulkifli, Naama Meir

From: Sasha Neftin <sasha.neftin@intel.com>

igc_set_spd_dplx method is not used. This patch comes to tidy up
the driver code.

Reported-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h      |  1 -
 drivers/net/ethernet/intel/igc/igc_main.c | 50 -----------------------
 2 files changed, 51 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 3e386c38d016..1e7e7071f64d 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -264,7 +264,6 @@ int igc_reinit_queues(struct igc_adapter *adapter);
 void igc_write_rss_indir_tbl(struct igc_adapter *adapter);
 bool igc_has_link(struct igc_adapter *adapter);
 void igc_reset(struct igc_adapter *adapter);
-int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx);
 void igc_update_stats(struct igc_adapter *adapter);
 void igc_disable_rx_ring(struct igc_ring *ring);
 void igc_enable_rx_ring(struct igc_ring *ring);
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 74b2c590ed5d..ae17af44fe02 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6187,56 +6187,6 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)
 	return value;
 }
 
-int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx)
-{
-	struct igc_mac_info *mac = &adapter->hw.mac;
-
-	mac->autoneg = false;
-
-	/* Make sure dplx is at most 1 bit and lsb of speed is not set
-	 * for the switch() below to work
-	 */
-	if ((spd & 1) || (dplx & ~1))
-		goto err_inval;
-
-	switch (spd + dplx) {
-	case SPEED_10 + DUPLEX_HALF:
-		mac->forced_speed_duplex = ADVERTISE_10_HALF;
-		break;
-	case SPEED_10 + DUPLEX_FULL:
-		mac->forced_speed_duplex = ADVERTISE_10_FULL;
-		break;
-	case SPEED_100 + DUPLEX_HALF:
-		mac->forced_speed_duplex = ADVERTISE_100_HALF;
-		break;
-	case SPEED_100 + DUPLEX_FULL:
-		mac->forced_speed_duplex = ADVERTISE_100_FULL;
-		break;
-	case SPEED_1000 + DUPLEX_FULL:
-		mac->autoneg = true;
-		adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
-		break;
-	case SPEED_1000 + DUPLEX_HALF: /* not supported */
-		goto err_inval;
-	case SPEED_2500 + DUPLEX_FULL:
-		mac->autoneg = true;
-		adapter->hw.phy.autoneg_advertised = ADVERTISE_2500_FULL;
-		break;
-	case SPEED_2500 + DUPLEX_HALF: /* not supported */
-	default:
-		goto err_inval;
-	}
-
-	/* clear MDI, MDI(-X) override is only allowed when autoneg enabled */
-	adapter->hw.phy.mdix = AUTO_ALL_MODES;
-
-	return 0;
-
-err_inval:
-	netdev_err(adapter->netdev, "Unsupported Speed/Duplex configuration\n");
-	return -EINVAL;
-}
-
 /**
  * igc_probe - Device Initialization Routine
  * @pdev: PCI device information struct
-- 
2.35.1


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

* [PATCH net-next 2/3] igc: Remove unused phy_type enum
  2022-05-10 21:06 [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 Tony Nguyen
  2022-05-10 21:06 ` [PATCH net-next 1/3] igc: Remove igc_set_spd_dplx method Tony Nguyen
@ 2022-05-10 21:06 ` Tony Nguyen
  2022-05-10 21:06 ` [PATCH net-next 3/3] igc: Change type of the 'igc_check_downshift' method Tony Nguyen
  2022-05-11 22:30 ` [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2022-05-10 21:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Sasha Neftin, netdev, anthony.l.nguyen, Naama Meir

From: Sasha Neftin <sasha.neftin@intel.com>

Complete to commit 8e153faf5827 ("igc: Remove unused phy type")
i225 parts have only one PHY. There is no point to use phy_type enum.
Clean up the code accordingly, and get rid of the unused enum lines.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_base.c |  2 --
 drivers/net/ethernet/intel/igc/igc_hw.h   |  7 -------
 drivers/net/ethernet/intel/igc/igc_phy.c  | 12 +++---------
 3 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_base.c b/drivers/net/ethernet/intel/igc/igc_base.c
index f068b66b8025..a15927e77272 100644
--- a/drivers/net/ethernet/intel/igc/igc_base.c
+++ b/drivers/net/ethernet/intel/igc/igc_base.c
@@ -182,8 +182,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
 
 	igc_check_for_copper_link(hw);
 
-	phy->type = igc_phy_i225;
-
 out:
 	return ret_val;
 }
diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index b1e72ec5f131..360644f33d5f 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -53,11 +53,6 @@ enum igc_mac_type {
 	igc_num_macs  /* List is 1-based, so subtract 1 for true count. */
 };
 
-enum igc_phy_type {
-	igc_phy_unknown = 0,
-	igc_phy_i225,
-};
-
 enum igc_media_type {
 	igc_media_type_unknown = 0,
 	igc_media_type_copper = 1,
@@ -138,8 +133,6 @@ struct igc_nvm_info {
 struct igc_phy_info {
 	struct igc_phy_operations ops;
 
-	enum igc_phy_type type;
-
 	u32 addr;
 	u32 id;
 	u32 reset_delay_us; /* in usec */
diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index 6961f65d36b9..2140ad1e8443 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -148,17 +148,11 @@ void igc_power_down_phy_copper(struct igc_hw *hw)
 s32 igc_check_downshift(struct igc_hw *hw)
 {
 	struct igc_phy_info *phy = &hw->phy;
-	s32 ret_val;
 
-	switch (phy->type) {
-	case igc_phy_i225:
-	default:
-		/* speed downshift not supported */
-		phy->speed_downgraded = false;
-		ret_val = 0;
-	}
+	/* speed downshift not supported */
+	phy->speed_downgraded = false;
 
-	return ret_val;
+	return 0;
 }
 
 /**
-- 
2.35.1


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

* [PATCH net-next 3/3] igc: Change type of the 'igc_check_downshift' method
  2022-05-10 21:06 [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 Tony Nguyen
  2022-05-10 21:06 ` [PATCH net-next 1/3] igc: Remove igc_set_spd_dplx method Tony Nguyen
  2022-05-10 21:06 ` [PATCH net-next 2/3] igc: Remove unused phy_type enum Tony Nguyen
@ 2022-05-10 21:06 ` Tony Nguyen
  2022-05-11 22:30 ` [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Tony Nguyen @ 2022-05-10 21:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet
  Cc: Sasha Neftin, netdev, anthony.l.nguyen, Naama Meir

From: Sasha Neftin <sasha.neftin@intel.com>

The 'igc_check_downshift' method always returns 0; there is no need
for a return value so change the type of this method to void.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_phy.c | 6 +-----
 drivers/net/ethernet/intel/igc/igc_phy.h | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index 2140ad1e8443..53b77c969c85 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -141,18 +141,14 @@ void igc_power_down_phy_copper(struct igc_hw *hw)
  * igc_check_downshift - Checks whether a downshift in speed occurred
  * @hw: pointer to the HW structure
  *
- * Success returns 0, Failure returns 1
- *
  * A downshift is detected by querying the PHY link health.
  */
-s32 igc_check_downshift(struct igc_hw *hw)
+void igc_check_downshift(struct igc_hw *hw)
 {
 	struct igc_phy_info *phy = &hw->phy;
 
 	/* speed downshift not supported */
 	phy->speed_downgraded = false;
-
-	return 0;
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/igc/igc_phy.h b/drivers/net/ethernet/intel/igc/igc_phy.h
index 1b031372d206..832a7e359f18 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.h
+++ b/drivers/net/ethernet/intel/igc/igc_phy.h
@@ -11,7 +11,7 @@ s32 igc_phy_hw_reset(struct igc_hw *hw);
 s32 igc_get_phy_id(struct igc_hw *hw);
 s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations,
 		     u32 usec_interval, bool *success);
-s32 igc_check_downshift(struct igc_hw *hw);
+void igc_check_downshift(struct igc_hw *hw);
 s32 igc_setup_copper_link(struct igc_hw *hw);
 void igc_power_up_phy_copper(struct igc_hw *hw);
 void igc_power_down_phy_copper(struct igc_hw *hw);
-- 
2.35.1


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

* Re: [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10
  2022-05-10 21:06 [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 Tony Nguyen
                   ` (2 preceding siblings ...)
  2022-05-10 21:06 ` [PATCH net-next 3/3] igc: Change type of the 'igc_check_downshift' method Tony Nguyen
@ 2022-05-11 22:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-11 22:30 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, netdev, sasha.neftin

Hello:

This series was applied to netdev/net-next.git (master)
by Tony Nguyen <anthony.l.nguyen@intel.com>:

On Tue, 10 May 2022 14:06:53 -0700 you wrote:
> This series contains updates to igc driver only.
> 
> Sasha cleans up the code by removing an unused function and removing an
> enum for PHY type as there is only one PHY. The return type for
> igc_check_downshift() is changed to void as it always returns success.
> 
> The following are changes since commit ecd17a87eb78b5bd5ca6d1aa20c39f2bc3591337:
>   x25: remove redundant pointer dev
> and are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 1GbE
> 
> [...]

Here is the summary with links:
  - [net-next,1/3] igc: Remove igc_set_spd_dplx method
    https://git.kernel.org/netdev/net-next/c/d098538ed4e8
  - [net-next,2/3] igc: Remove unused phy_type enum
    https://git.kernel.org/netdev/net-next/c/7241069f7a07
  - [net-next,3/3] igc: Change type of the 'igc_check_downshift' method
    https://git.kernel.org/netdev/net-next/c/95073d08154a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-05-11 22:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 21:06 [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 Tony Nguyen
2022-05-10 21:06 ` [PATCH net-next 1/3] igc: Remove igc_set_spd_dplx method Tony Nguyen
2022-05-10 21:06 ` [PATCH net-next 2/3] igc: Remove unused phy_type enum Tony Nguyen
2022-05-10 21:06 ` [PATCH net-next 3/3] igc: Change type of the 'igc_check_downshift' method Tony Nguyen
2022-05-11 22:30 ` [PATCH net-next 0/3][pull request] 1GbE Intel Wired LAN Driver Updates 2022-05-10 patchwork-bot+netdevbpf

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