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: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
result = request_irq(netdev->irq, et131x_isr, IRQF_SHARED,
netdev->name, netdev);
if (result) {
result = request_irq(netdev->irq, et131x_isr, IRQF_SHARED,
netdev->name, netdev);
if (result) {
- dev_err(&adapter->pdev->dev, "c ould not register IRQ %d\n",
+ dev_err(&adapter->pdev->dev, "could not register IRQ %d\n",
netdev->irq);
return result;
}
netdev->irq);
return result;
}
{
struct et131x_adapter *adapter = netdev_priv(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);
/* First thing is to stop the queue */
netif_stop_queue(netdev);
struct tcb *tcb;
unsigned long flags;
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
*/
/* Any nonrecoverable hardware error?
* Checks adapter->flags for any failure in phy reading
*/
- /* Setup the function registration table (and other data) for a
+ /*
+ * Setup the function registration table (and other data) for a
netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
- netdev->netdev_ops = &et131x_netdev_ops;
+ netdev->netdev_ops = &et131x_netdev_ops;
/* netdev->ethtool_ops = &et131x_ethtool_ops; */
/* netdev->ethtool_ops = &et131x_ethtool_ops; */