Commit d9775fb6 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'amd-xgbe-fixes-to-handle-corner-cases'

Raju Rangoju says:

====================
amd-xgbe: fixes to handle corner-cases

This series include bug fixes to amd-xgbe driver.
====================

Link: https://lore.kernel.org/r/20231121191435.4049995-1-Raju.Rangoju@amd.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 818ad9cc 7a2323ac
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -682,10 +682,24 @@ static void xgbe_service(struct work_struct *work)
static void xgbe_service_timer(struct timer_list *t)
{
	struct xgbe_prv_data *pdata = from_timer(pdata, t, service_timer);
	struct xgbe_channel *channel;
	unsigned int i;

	queue_work(pdata->dev_workqueue, &pdata->service_work);

	mod_timer(&pdata->service_timer, jiffies + HZ);

	if (!pdata->tx_usecs)
		return;

	for (i = 0; i < pdata->channel_count; i++) {
		channel = pdata->channel[i];
		if (!channel->tx_ring || channel->tx_timer_active)
			break;
		channel->tx_timer_active = 1;
		mod_timer(&channel->tx_timer,
			  jiffies + usecs_to_jiffies(pdata->tx_usecs));
	}
}

static void xgbe_init_timers(struct xgbe_prv_data *pdata)
+8 −3
Original line number Diff line number Diff line
@@ -314,10 +314,15 @@ static int xgbe_get_link_ksettings(struct net_device *netdev,

	cmd->base.phy_address = pdata->phy.address;

	cmd->base.autoneg = pdata->phy.autoneg;
	if (netif_carrier_ok(netdev)) {
		cmd->base.speed = pdata->phy.speed;
		cmd->base.duplex = pdata->phy.duplex;
	} else {
		cmd->base.speed = SPEED_UNKNOWN;
		cmd->base.duplex = DUPLEX_UNKNOWN;
	}

	cmd->base.autoneg = pdata->phy.autoneg;
	cmd->base.port = PORT_NONE;

	XGBE_LM_COPY(cmd, supported, lks, supported);
+13 −1
Original line number Diff line number Diff line
@@ -1193,6 +1193,18 @@ static int xgbe_phy_config_fixed(struct xgbe_prv_data *pdata)
	if (pdata->phy.duplex != DUPLEX_FULL)
		return -EINVAL;

	/* Force the mode change for SFI in Fixed PHY config.
	 * Fixed PHY configs needs PLL to be enabled while doing mode set.
	 * When the SFP module isn't connected during boot, driver assumes
	 * AN is ON and attempts autonegotiation. However, if the connected
	 * SFP comes up in Fixed PHY config, the link will not come up as
	 * PLL isn't enabled while the initial mode set command is issued.
	 * So, force the mode change for SFI in Fixed PHY configuration to
	 * fix link issues.
	 */
	if (mode == XGBE_MODE_SFI)
		xgbe_change_mode(pdata, mode);
	else
		xgbe_set_mode(pdata, mode);

	return 0;