Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

S2io: Fixed synchronization between scheduling of napi with card reset and close

- Fixed synchronization between scheduling of napi with card reset and close
by moving the enabling and disabling of napi to card up and card down
functions respectively instead of open and close.

Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Sreenivasa Honnur and committed by
Jeff Garzik
5f490c96 2a49128f

+12 -5
+12 -5
drivers/net/s2io.c
··· 84 84 #include "s2io.h" 85 85 #include "s2io-regs.h" 86 86 87 - #define DRV_VERSION "2.0.26.10" 87 + #define DRV_VERSION "2.0.26.17" 88 88 89 89 /* S2io Driver name & version. */ 90 90 static char s2io_driver_name[] = "Neterion"; ··· 3848 3848 netif_carrier_off(dev); 3849 3849 sp->last_link_state = 0; 3850 3850 3851 - napi_enable(&sp->napi); 3852 - 3853 3851 if (sp->config.intr_type == MSI_X) { 3854 3852 int ret = s2io_enable_msi_x(sp); 3855 3853 ··· 3890 3892 return 0; 3891 3893 3892 3894 hw_init_failed: 3893 - napi_disable(&sp->napi); 3894 3895 if (sp->config.intr_type == MSI_X) { 3895 3896 if (sp->entries) { 3896 3897 kfree(sp->entries); ··· 3929 3932 return 0; 3930 3933 3931 3934 netif_stop_queue(dev); 3932 - napi_disable(&sp->napi); 3933 3935 /* Reset card, kill tasklet and free Tx and Rx buffers. */ 3934 3936 s2io_card_down(sp); 3935 3937 ··· 6792 6796 struct XENA_dev_config __iomem *bar0 = sp->bar0; 6793 6797 unsigned long flags; 6794 6798 register u64 val64 = 0; 6799 + struct config_param *config; 6800 + config = &sp->config; 6795 6801 6796 6802 if (!is_s2io_card_up(sp)) 6797 6803 return; ··· 6804 6806 msleep(50); 6805 6807 } 6806 6808 clear_bit(__S2IO_STATE_CARD_UP, &sp->state); 6809 + 6810 + /* Disable napi */ 6811 + if (config->napi) 6812 + napi_disable(&sp->napi); 6807 6813 6808 6814 /* disable Tx and Rx traffic on the NIC */ 6809 6815 if (do_io) ··· 6902 6900 DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i, 6903 6901 atomic_read(&sp->rx_bufs_left[i])); 6904 6902 } 6903 + 6904 + /* Initialise napi */ 6905 + if (config->napi) 6906 + napi_enable(&sp->napi); 6907 + 6905 6908 /* Maintain the state prior to the open */ 6906 6909 if (sp->promisc_flg) 6907 6910 sp->promisc_flg = 0;