Skip to content

Commit

Permalink
e1000: disable polling before registering netdevice
Browse files Browse the repository at this point in the history
To assure the symmetry of poll enable/disable in up/down, we should
initialize the netdevice to be poll_disabled at load time. Doing
this after register_netdevice leaves us open to another race, so
lets move all the netif_* calls above register_netdevice so the
stack starts out how we expect it to be.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Doug Chapman <doug.chapman@hp.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Auke Kok authored and Jeff Garzik committed Jun 3, 2007
1 parent 25805dc commit 416b5d1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,13 +1142,16 @@ e1000_probe(struct pci_dev *pdev,
!e1000_check_mng_mode(&adapter->hw))
e1000_get_hw_control(adapter);

strcpy(netdev->name, "eth%d");
if ((err = register_netdev(netdev)))
goto err_register;

/* tell the stack to leave us alone until e1000_open() is called */
netif_carrier_off(netdev);
netif_stop_queue(netdev);
#ifdef CONFIG_E1000_NAPI
netif_poll_disable(netdev);
#endif

strcpy(netdev->name, "eth%d");
if ((err = register_netdev(netdev)))
goto err_register;

DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n");

Expand Down

0 comments on commit 416b5d1

Please sign in to comment.