Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac657d58 authored by Mark Einon's avatar Mark Einon Committed by Greg Kroah-Hartman
Browse files

staging: et131x: Update tx trans_start on device close to prevent tx_timeout



Updating the tx trans_start before closing the device prevents a possible tx_timeout occuring during the closing process.
Tested on an ET1310 device.

Signed-off-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c8b7de7f
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -182,6 +182,9 @@ int et131x_close(struct net_device *netdev)
{
	struct et131x_adapter *adapter = netdev_priv(netdev);

	/* Save the timestamp for the TX watchdog, prevent a timeout */
	netdev->trans_start = jiffies;

	/* First thing is to stop the queue */
	netif_stop_queue(netdev);

@@ -449,6 +452,10 @@ void et131x_tx_timeout(struct net_device *netdev)
	struct tcb *tcb;
	unsigned long flags;

	/* If the device is closed, ignore the timeout */
	if (~(adapter->flags & fMP_ADAPTER_INTERRUPT_IN_USE));
		return;

	/* Any nonrecoverable hardware error?
	 * Checks adapter->flags for any failure in phy reading
	 */
@@ -685,10 +692,10 @@ struct net_device *et131x_device_alloc(void)
		return NULL;
	}

	/* Setup the function registration table (and other data) for a
	/*
	 * Setup the function registration table (and other data) for a
	 * net_device
	 */

	netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
	netdev->netdev_ops     = &et131x_netdev_ops;