Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (29 commits)
cxgb3: Fix crash caused by stashing wrong netdev_queue
ixgbe: Fix coexistence of FCoE and Flow Director in 82599
memory barrier: adding smp_mb__after_lock
net: adding memory barrier to the poll and receive callbacks
netpoll: Fix carrier detection for drivers that are using phylib
includecheck fix: include/linux, rfkill.h
p54: tx refused but queue active
Atheros Kconfig needs to be dependent on WLAN_80211
mac80211: fix docbook
mac80211_hwsim: avoid NULL access
ssb: Add support for 4318E
b43: Add support for 4318E
zd1211rw: adding SONY IFU-WLM2 (054c:0257) as a zd1211b device
zd1211rw: 07b8:6001 is a ZD1211B
r6040: bump driver version to 0.24 and date to 08 July 2009
r6040: restore MIER register correctly when IRQ line is shared
ipv4: Fix fib_trie rebalancing, part 4 (root thresholds)
davinci_emac: fix kernel oops when changing MAC address while interface is down
igb: set lan id prior to configuring phy
mac80211: minstrel: avoid accessing negative indices in rix_to_ndx()
...

+192 -60
-2
Documentation/DocBook/mac80211.tmpl
··· 184 184 !Finclude/net/mac80211.h ieee80211_ctstoself_get 185 185 !Finclude/net/mac80211.h ieee80211_ctstoself_duration 186 186 !Finclude/net/mac80211.h ieee80211_generic_frame_duration 187 - !Finclude/net/mac80211.h ieee80211_get_hdrlen_from_skb 188 - !Finclude/net/mac80211.h ieee80211_hdrlen 189 187 !Finclude/net/mac80211.h ieee80211_wake_queue 190 188 !Finclude/net/mac80211.h ieee80211_stop_queue 191 189 !Finclude/net/mac80211.h ieee80211_wake_queues
+4
arch/x86/include/asm/spinlock.h
··· 302 302 #define _raw_read_relax(lock) cpu_relax() 303 303 #define _raw_write_relax(lock) cpu_relax() 304 304 305 + /* The {read|write|spin}_lock() on x86 are full memory barriers. */ 306 + static inline void smp_mb__after_lock(void) { } 307 + #define ARCH_HAS_SMP_MB_AFTER_LOCK 308 + 305 309 #endif /* _ASM_X86_SPINLOCK_H */
+1 -2
drivers/net/cxgb3/cxgb3_main.c
··· 642 642 struct port_info *pi = netdev_priv(dev); 643 643 644 644 pi->qs = &adap->sge.qs[pi->first_qset]; 645 - for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; 646 - ++j, ++qset_idx) { 645 + for (j = 0; j < pi->nqsets; ++j, ++qset_idx) { 647 646 set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); 648 647 err = t3_sge_alloc_qset(adap, qset_idx, 1, 649 648 (adap->flags & USING_MSIX) ? qset_idx + 1 :
+10 -2
drivers/net/davinci_emac.c
··· 1820 1820 struct device *emac_dev = &priv->ndev->dev; 1821 1821 struct sockaddr *sa = addr; 1822 1822 1823 + if (!is_valid_ether_addr(sa->sa_data)) 1824 + return -EINVAL; 1825 + 1823 1826 /* Store mac addr in priv and rx channel and set it in EMAC hw */ 1824 1827 memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len); 1825 - memcpy(rxch->mac_addr, sa->sa_data, ndev->addr_len); 1826 1828 memcpy(ndev->dev_addr, sa->sa_data, ndev->addr_len); 1827 - emac_setmac(priv, EMAC_DEF_RX_CH, rxch->mac_addr); 1829 + 1830 + /* If the interface is down - rxch is NULL. */ 1831 + /* MAC address is configured only after the interface is enabled. */ 1832 + if (netif_running(ndev)) { 1833 + memcpy(rxch->mac_addr, sa->sa_data, ndev->addr_len); 1834 + emac_setmac(priv, EMAC_DEF_RX_CH, rxch->mac_addr); 1835 + } 1828 1836 1829 1837 if (netif_msg_drv(priv)) 1830 1838 dev_notice(emac_dev, "DaVinci EMAC: emac_dev_setmac_addr %pM\n",
+6 -6
drivers/net/fec.h
··· 46 46 47 47 #else 48 48 49 - #define FEC_ECNTRL; 0x000 /* Ethernet control reg */ 50 - #define FEC_IEVENT; 0x004 /* Interrupt even reg */ 51 - #define FEC_IMASK; 0x008 /* Interrupt mask reg */ 52 - #define FEC_IVEC; 0x00c /* Interrupt vec status reg */ 53 - #define FEC_R_DES_ACTIVE; 0x010 /* Receive descriptor reg */ 54 - #define FEC_X_DES_ACTIVE; 0x01c /* Transmit descriptor reg */ 49 + #define FEC_ECNTRL 0x000 /* Ethernet control reg */ 50 + #define FEC_IEVENT 0x004 /* Interrupt even reg */ 51 + #define FEC_IMASK 0x008 /* Interrupt mask reg */ 52 + #define FEC_IVEC 0x00c /* Interrupt vec status reg */ 53 + #define FEC_R_DES_ACTIVE 0x010 /* Receive descriptor reg */ 54 + #define FEC_X_DES_ACTIVE 0x014 /* Transmit descriptor reg */ 55 55 #define FEC_MII_DATA 0x040 /* MII manage frame reg */ 56 56 #define FEC_MII_SPEED 0x044 /* MII speed control reg */ 57 57 #define FEC_R_BOUND 0x08c /* FIFO receive bound reg */
+4
drivers/net/igb/e1000_82575.c
··· 190 190 phy->ops.write_reg = igb_write_phy_reg_igp; 191 191 } 192 192 193 + /* set lan id */ 194 + hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> 195 + E1000_STATUS_FUNC_SHIFT; 196 + 193 197 /* Set phy->phy_addr and phy->id. */ 194 198 ret_val = igb_get_phy_id_82575(hw); 195 199 if (ret_val)
+6
drivers/net/ixgbe/ixgbe_dcb_nl.c
··· 138 138 adapter->hw.fc.requested_mode = ixgbe_fc_none; 139 139 } 140 140 adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; 141 + if (adapter->hw.mac.type == ixgbe_mac_82599EB) { 142 + adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; 143 + adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; 144 + } 141 145 adapter->flags |= IXGBE_FLAG_DCB_ENABLED; 142 146 ixgbe_init_interrupt_scheme(adapter); 143 147 if (netif_running(netdev)) ··· 158 154 adapter->dcb_cfg.pfc_mode_enable = false; 159 155 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; 160 156 adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 157 + if (adapter->hw.mac.type == ixgbe_mac_82599EB) 158 + adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 161 159 ixgbe_init_interrupt_scheme(adapter); 162 160 if (netif_running(netdev)) 163 161 netdev->netdev_ops->ndo_open(netdev);
+11 -8
drivers/net/ixgbe/ixgbe_main.c
··· 3130 3130 #endif 3131 3131 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { 3132 3132 DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); 3133 - ixgbe_set_rss_queues(adapter); 3133 + if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || 3134 + (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) 3135 + ixgbe_set_fdir_queues(adapter); 3136 + else 3137 + ixgbe_set_rss_queues(adapter); 3134 3138 } 3135 3139 /* adding FCoE rx rings to the end */ 3136 3140 f->mask = adapter->num_rx_queues; ··· 3392 3388 } 3393 3389 #endif /* CONFIG_IXGBE_DCB */ 3394 3390 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { 3395 - ixgbe_cache_ring_rss(adapter); 3391 + if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || 3392 + (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) 3393 + ixgbe_cache_ring_fdir(adapter); 3394 + else 3395 + ixgbe_cache_ring_rss(adapter); 3396 + 3396 3397 fcoe_i = f->mask; 3397 3398 } 3398 3399 for (i = 0; i < f->indices; i++, fcoe_i++) ··· 5587 5578 netdev->features |= NETIF_F_FCOE_CRC; 5588 5579 netdev->features |= NETIF_F_FSO; 5589 5580 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; 5590 - DPRINTK(DRV, INFO, "FCoE enabled, " 5591 - "disabling Flow Director\n"); 5592 - adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; 5593 - adapter->flags &= 5594 - ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; 5595 - adapter->atr_sample_rate = 0; 5596 5581 } else { 5597 5582 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; 5598 5583 }
+6 -3
drivers/net/r6040.c
··· 49 49 #include <asm/processor.h> 50 50 51 51 #define DRV_NAME "r6040" 52 - #define DRV_VERSION "0.23" 53 - #define DRV_RELDATE "05May2009" 52 + #define DRV_VERSION "0.24" 53 + #define DRV_RELDATE "08Jul2009" 54 54 55 55 /* PHY CHIP Address */ 56 56 #define PHY1_ADDR 1 /* For MAC1 */ ··· 704 704 /* Read MISR status and clear */ 705 705 status = ioread16(ioaddr + MISR); 706 706 707 - if (status == 0x0000 || status == 0xffff) 707 + if (status == 0x0000 || status == 0xffff) { 708 + /* Restore RDC MAC interrupt */ 709 + iowrite16(misr, ioaddr + MIER); 708 710 return IRQ_NONE; 711 + } 709 712 710 713 /* RX interrupt request */ 711 714 if (status & RX_INTS) {
+1
drivers/net/wireless/ath/Kconfig
··· 1 1 config ATH_COMMON 2 2 tristate "Atheros Wireless Cards" 3 + depends on WLAN_80211 3 4 depends on ATH5K || ATH9K || AR9170_USB 4 5 5 6 source "drivers/net/wireless/ath/ath5k/Kconfig"
+8 -1
drivers/net/wireless/ath/ath9k/xmit.c
··· 355 355 } 356 356 357 357 if (bf_next == NULL) { 358 - INIT_LIST_HEAD(&bf_head); 358 + /* 359 + * Make sure the last desc is reclaimed if it 360 + * not a holding desc. 361 + */ 362 + if (!bf_last->bf_stale) 363 + list_move_tail(&bf->list, &bf_head); 364 + else 365 + INIT_LIST_HEAD(&bf_head); 359 366 } else { 360 367 ASSERT(!list_empty(bf_q)); 361 368 list_move_tail(&bf->list, &bf_head);
+1
drivers/net/wireless/b43/b43.h
··· 648 648 u8 nr_devs; 649 649 650 650 bool radiotap_enabled; 651 + bool radio_enabled; 651 652 652 653 /* The beacon we are currently using (AP or IBSS mode). 653 654 * This beacon stuff is protected by the irq_lock. */
+5 -2
drivers/net/wireless/b43/main.c
··· 3497 3497 if (phy->ops->set_rx_antenna) 3498 3498 phy->ops->set_rx_antenna(dev, antenna); 3499 3499 3500 - if (!!conf->radio_enabled != phy->radio_on) { 3501 - if (conf->radio_enabled) { 3500 + if (wl->radio_enabled != phy->radio_on) { 3501 + if (wl->radio_enabled) { 3502 3502 b43_software_rfkill(dev, false); 3503 3503 b43info(dev->wl, "Radio turned on by software\n"); 3504 3504 if (!dev->radio_hw_enable) { ··· 4339 4339 wl->beacon0_uploaded = 0; 4340 4340 wl->beacon1_uploaded = 0; 4341 4341 wl->beacon_templates_virgin = 1; 4342 + wl->radio_enabled = 1; 4342 4343 4343 4344 mutex_lock(&wl->mutex); 4344 4345 ··· 4379 4378 if (b43_status(dev) >= B43_STAT_STARTED) 4380 4379 b43_wireless_core_stop(dev); 4381 4380 b43_wireless_core_exit(dev); 4381 + wl->radio_enabled = 0; 4382 4382 mutex_unlock(&wl->mutex); 4383 4383 4384 4384 cancel_work_sync(&(wl->txpower_adjust_work)); ··· 4562 4560 B43_WARN_ON(1); 4563 4561 4564 4562 dev->phy.gmode = have_2ghz_phy; 4563 + dev->phy.radio_on = 1; 4565 4564 tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0; 4566 4565 b43_wireless_core_reset(dev, tmp); 4567 4566
+1
drivers/net/wireless/b43/pcmcia.c
··· 35 35 36 36 static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = { 37 37 PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448), 38 + PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x476), 38 39 PCMCIA_DEVICE_NULL, 39 40 }; 40 41
+1
drivers/net/wireless/b43legacy/b43legacy.h
··· 607 607 u8 nr_devs; 608 608 609 609 bool radiotap_enabled; 610 + bool radio_enabled; 610 611 611 612 /* The beacon we are currently using (AP or IBSS mode). 612 613 * This beacon stuff is protected by the irq_lock. */
+5 -2
drivers/net/wireless/b43legacy/main.c
··· 2689 2689 /* Antennas for RX and management frame TX. */ 2690 2690 b43legacy_mgmtframe_txantenna(dev, antenna_tx); 2691 2691 2692 - if (!!conf->radio_enabled != phy->radio_on) { 2693 - if (conf->radio_enabled) { 2692 + if (wl->radio_enabled != phy->radio_on) { 2693 + if (wl->radio_enabled) { 2694 2694 b43legacy_radio_turn_on(dev); 2695 2695 b43legacyinfo(dev->wl, "Radio turned on by software\n"); 2696 2696 if (!dev->radio_hw_enable) ··· 3441 3441 wl->beacon0_uploaded = 0; 3442 3442 wl->beacon1_uploaded = 0; 3443 3443 wl->beacon_templates_virgin = 1; 3444 + wl->radio_enabled = 1; 3444 3445 3445 3446 mutex_lock(&wl->mutex); 3446 3447 ··· 3480 3479 if (b43legacy_status(dev) >= B43legacy_STAT_STARTED) 3481 3480 b43legacy_wireless_core_stop(dev); 3482 3481 b43legacy_wireless_core_exit(dev); 3482 + wl->radio_enabled = 0; 3483 3483 mutex_unlock(&wl->mutex); 3484 3484 } 3485 3485 ··· 3622 3620 have_bphy = 1; 3623 3621 3624 3622 dev->phy.gmode = (have_gphy || have_bphy); 3623 + dev->phy.radio_on = 1; 3625 3624 tmp = dev->phy.gmode ? B43legacy_TMSLOW_GMODE : 0; 3626 3625 b43legacy_wireless_core_reset(dev, tmp); 3627 3626
+9
drivers/net/wireless/iwmc3200wifi/Kconfig
··· 4 4 depends on CFG80211 5 5 select WIRELESS_EXT 6 6 select FW_LOADER 7 + help 8 + The Intel Wireless Multicomm 3200 hardware is a combo 9 + card with GPS, Bluetooth, WiMax and 802.11 radios. It 10 + runs over SDIO and is typically found on Moorestown 11 + based platform. This driver takes care of the 802.11 12 + part, which is a fullmac one. 13 + 14 + If you choose to build it as a module, it'll be called 15 + iwmc3200wifi.ko. 7 16 8 17 config IWM_DEBUG 9 18 bool "Enable full debugging output in iwmc3200wifi"
+1
drivers/net/wireless/mac80211_hwsim.c
··· 418 418 continue; 419 419 420 420 if (!data2->started || !hwsim_ps_rx_ok(data2, skb) || 421 + !data->channel || !data2->channel || 421 422 data->channel->center_freq != data2->channel->center_freq || 422 423 !(data->group & data2->group)) 423 424 continue;
+3 -2
drivers/net/wireless/p54/p54common.c
··· 912 912 } 913 913 914 914 __skb_unlink(entry, &priv->tx_queue); 915 - spin_unlock_irqrestore(&priv->tx_queue.lock, flags); 916 915 917 916 frame_len = entry->len; 918 917 entry_hdr = (struct p54_hdr *) entry->data; 919 918 entry_data = (struct p54_tx_data *) entry_hdr->data; 920 - priv->tx_stats[entry_data->hw_queue].len--; 919 + if (priv->tx_stats[entry_data->hw_queue].len) 920 + priv->tx_stats[entry_data->hw_queue].len--; 921 921 priv->stats.dot11ACKFailureCount += payload->tries - 1; 922 + spin_unlock_irqrestore(&priv->tx_queue.lock, flags); 922 923 923 924 /* 924 925 * Frames in P54_QUEUE_FWSCAN and P54_QUEUE_BEACON are
+2 -1
drivers/net/wireless/zd1211rw/zd_usb.c
··· 38 38 /* ZD1211 */ 39 39 { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 }, 40 40 { USB_DEVICE(0x0ace, 0xa211), .driver_info = DEVICE_ZD1211 }, 41 - { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211 }, 42 41 { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 }, 43 42 { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, 44 43 { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 }, ··· 60 61 { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 }, 61 62 { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, 62 63 /* ZD1211B */ 64 + { USB_DEVICE(0x054c, 0x0257), .driver_info = DEVICE_ZD1211B }, 63 65 { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, 64 66 { USB_DEVICE(0x0ace, 0xb215), .driver_info = DEVICE_ZD1211B }, 65 67 { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, ··· 87 87 { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, 88 88 { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, 89 89 { USB_DEVICE(0x0df6, 0x0036), .driver_info = DEVICE_ZD1211B }, 90 + { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211B }, 90 91 /* "Driverless" devices that need ejecting */ 91 92 { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, 92 93 { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER },
+1 -1
drivers/platform/x86/hp-wmi.c
··· 171 171 static int hp_wmi_set_block(void *data, bool blocked) 172 172 { 173 173 unsigned long b = (unsigned long) data; 174 - int query = BIT(b + 8) | ((!!blocked) << b); 174 + int query = BIT(b + 8) | ((!blocked) << b); 175 175 176 176 return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, query); 177 177 }
+4 -2
drivers/ssb/pcmcia.c
··· 678 678 sprom->board_rev = tuple.TupleData[1]; 679 679 break; 680 680 case SSB_PCMCIA_CIS_PA: 681 - GOTO_ERROR_ON(tuple.TupleDataLen != 9, 681 + GOTO_ERROR_ON((tuple.TupleDataLen != 9) && 682 + (tuple.TupleDataLen != 10), 682 683 "pa tpl size"); 683 684 sprom->pa0b0 = tuple.TupleData[1] | 684 685 ((u16)tuple.TupleData[2] << 8); ··· 719 718 sprom->antenna_gain.ghz5.a3 = tuple.TupleData[1]; 720 719 break; 721 720 case SSB_PCMCIA_CIS_BFLAGS: 722 - GOTO_ERROR_ON(tuple.TupleDataLen != 3, 721 + GOTO_ERROR_ON((tuple.TupleDataLen != 3) && 722 + (tuple.TupleDataLen != 5), 723 723 "bfl tpl size"); 724 724 sprom->boardflags_lo = tuple.TupleData[1] | 725 725 ((u16)tuple.TupleData[2] << 8);
-1
include/linux/rfkill.h
··· 99 99 #undef RFKILL_STATE_UNBLOCKED 100 100 #undef RFKILL_STATE_HARD_BLOCKED 101 101 102 - #include <linux/types.h> 103 102 #include <linux/kernel.h> 104 103 #include <linux/list.h> 105 104 #include <linux/mutex.h>
+5
include/linux/spinlock.h
··· 132 132 #endif /*__raw_spin_is_contended*/ 133 133 #endif 134 134 135 + /* The lock does not imply full memory barrier. */ 136 + #ifndef ARCH_HAS_SMP_MB_AFTER_LOCK 137 + static inline void smp_mb__after_lock(void) { smp_mb(); } 138 + #endif 139 + 135 140 /** 136 141 * spin_unlock_wait - wait until the spinlock gets unlocked 137 142 * @lock: the spinlock in question.
+69
include/net/sock.h
··· 54 54 55 55 #include <linux/filter.h> 56 56 #include <linux/rculist_nulls.h> 57 + #include <linux/poll.h> 57 58 58 59 #include <asm/atomic.h> 59 60 #include <net/dst.h> ··· 1240 1239 static inline int sk_has_allocations(const struct sock *sk) 1241 1240 { 1242 1241 return sk_wmem_alloc_get(sk) || sk_rmem_alloc_get(sk); 1242 + } 1243 + 1244 + /** 1245 + * sk_has_sleeper - check if there are any waiting processes 1246 + * @sk: socket 1247 + * 1248 + * Returns true if socket has waiting processes 1249 + * 1250 + * The purpose of the sk_has_sleeper and sock_poll_wait is to wrap the memory 1251 + * barrier call. They were added due to the race found within the tcp code. 1252 + * 1253 + * Consider following tcp code paths: 1254 + * 1255 + * CPU1 CPU2 1256 + * 1257 + * sys_select receive packet 1258 + * ... ... 1259 + * __add_wait_queue update tp->rcv_nxt 1260 + * ... ... 1261 + * tp->rcv_nxt check sock_def_readable 1262 + * ... { 1263 + * schedule ... 1264 + * if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1265 + * wake_up_interruptible(sk->sk_sleep) 1266 + * ... 1267 + * } 1268 + * 1269 + * The race for tcp fires when the __add_wait_queue changes done by CPU1 stay 1270 + * in its cache, and so does the tp->rcv_nxt update on CPU2 side. The CPU1 1271 + * could then endup calling schedule and sleep forever if there are no more 1272 + * data on the socket. 1273 + * 1274 + * The sk_has_sleeper is always called right after a call to read_lock, so we 1275 + * can use smp_mb__after_lock barrier. 1276 + */ 1277 + static inline int sk_has_sleeper(struct sock *sk) 1278 + { 1279 + /* 1280 + * We need to be sure we are in sync with the 1281 + * add_wait_queue modifications to the wait queue. 1282 + * 1283 + * This memory barrier is paired in the sock_poll_wait. 1284 + */ 1285 + smp_mb__after_lock(); 1286 + return sk->sk_sleep && waitqueue_active(sk->sk_sleep); 1287 + } 1288 + 1289 + /** 1290 + * sock_poll_wait - place memory barrier behind the poll_wait call. 1291 + * @filp: file 1292 + * @wait_address: socket wait queue 1293 + * @p: poll_table 1294 + * 1295 + * See the comments in the sk_has_sleeper function. 1296 + */ 1297 + static inline void sock_poll_wait(struct file *filp, 1298 + wait_queue_head_t *wait_address, poll_table *p) 1299 + { 1300 + if (p && wait_address) { 1301 + poll_wait(filp, wait_address, p); 1302 + /* 1303 + * We need to be sure we are in sync with the 1304 + * socket flags modification. 1305 + * 1306 + * This memory barrier is paired in the sk_has_sleeper. 1307 + */ 1308 + smp_mb(); 1309 + } 1243 1310 } 1244 1311 1245 1312 /*
+3 -3
net/atm/common.c
··· 92 92 static void vcc_def_wakeup(struct sock *sk) 93 93 { 94 94 read_lock(&sk->sk_callback_lock); 95 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 95 + if (sk_has_sleeper(sk)) 96 96 wake_up(sk->sk_sleep); 97 97 read_unlock(&sk->sk_callback_lock); 98 98 } ··· 110 110 read_lock(&sk->sk_callback_lock); 111 111 112 112 if (vcc_writable(sk)) { 113 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 113 + if (sk_has_sleeper(sk)) 114 114 wake_up_interruptible(sk->sk_sleep); 115 115 116 116 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); ··· 594 594 struct atm_vcc *vcc; 595 595 unsigned int mask; 596 596 597 - poll_wait(file, sk->sk_sleep, wait); 597 + sock_poll_wait(file, sk->sk_sleep, wait); 598 598 mask = 0; 599 599 600 600 vcc = ATM_SD(sock);
+1 -1
net/core/datagram.c
··· 712 712 struct sock *sk = sock->sk; 713 713 unsigned int mask; 714 714 715 - poll_wait(file, sk->sk_sleep, wait); 715 + sock_poll_wait(file, sk->sk_sleep, wait); 716 716 mask = 0; 717 717 718 718 /* exceptional events? */
+1 -1
net/core/netpoll.c
··· 740 740 np->name); 741 741 break; 742 742 } 743 - cond_resched(); 743 + msleep(1); 744 744 } 745 745 746 746 /* If carrier appears to come up instantly, we don't
+4 -4
net/core/sock.c
··· 1715 1715 static void sock_def_wakeup(struct sock *sk) 1716 1716 { 1717 1717 read_lock(&sk->sk_callback_lock); 1718 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1718 + if (sk_has_sleeper(sk)) 1719 1719 wake_up_interruptible_all(sk->sk_sleep); 1720 1720 read_unlock(&sk->sk_callback_lock); 1721 1721 } ··· 1723 1723 static void sock_def_error_report(struct sock *sk) 1724 1724 { 1725 1725 read_lock(&sk->sk_callback_lock); 1726 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1726 + if (sk_has_sleeper(sk)) 1727 1727 wake_up_interruptible_poll(sk->sk_sleep, POLLERR); 1728 1728 sk_wake_async(sk, SOCK_WAKE_IO, POLL_ERR); 1729 1729 read_unlock(&sk->sk_callback_lock); ··· 1732 1732 static void sock_def_readable(struct sock *sk, int len) 1733 1733 { 1734 1734 read_lock(&sk->sk_callback_lock); 1735 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1735 + if (sk_has_sleeper(sk)) 1736 1736 wake_up_interruptible_sync_poll(sk->sk_sleep, POLLIN | 1737 1737 POLLRDNORM | POLLRDBAND); 1738 1738 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); ··· 1747 1747 * progress. --DaveM 1748 1748 */ 1749 1749 if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) { 1750 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1750 + if (sk_has_sleeper(sk)) 1751 1751 wake_up_interruptible_sync_poll(sk->sk_sleep, POLLOUT | 1752 1752 POLLWRNORM | POLLWRBAND); 1753 1753
+1 -1
net/dccp/output.c
··· 196 196 { 197 197 read_lock(&sk->sk_callback_lock); 198 198 199 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 199 + if (sk_has_sleeper(sk)) 200 200 wake_up_interruptible(sk->sk_sleep); 201 201 /* Should agree with poll, otherwise some programs break */ 202 202 if (sock_writeable(sk))
+1 -1
net/dccp/proto.c
··· 311 311 unsigned int mask; 312 312 struct sock *sk = sock->sk; 313 313 314 - poll_wait(file, sk->sk_sleep, wait); 314 + sock_poll_wait(file, sk->sk_sleep, wait); 315 315 if (sk->sk_state == DCCP_LISTEN) 316 316 return inet_csk_listen_poll(sk); 317 317
+2 -2
net/ipv4/fib_trie.c
··· 316 316 317 317 static const int halve_threshold = 25; 318 318 static const int inflate_threshold = 50; 319 - static const int halve_threshold_root = 8; 320 - static const int inflate_threshold_root = 15; 319 + static const int halve_threshold_root = 15; 320 + static const int inflate_threshold_root = 25; 321 321 322 322 323 323 static void __alias_free_mem(struct rcu_head *head)
+1 -1
net/ipv4/tcp.c
··· 339 339 struct sock *sk = sock->sk; 340 340 struct tcp_sock *tp = tcp_sk(sk); 341 341 342 - poll_wait(file, sk->sk_sleep, wait); 342 + sock_poll_wait(file, sk->sk_sleep, wait); 343 343 if (sk->sk_state == TCP_LISTEN) 344 344 return inet_csk_listen_poll(sk); 345 345
+2 -2
net/iucv/af_iucv.c
··· 306 306 static void iucv_sock_wake_msglim(struct sock *sk) 307 307 { 308 308 read_lock(&sk->sk_callback_lock); 309 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 309 + if (sk_has_sleeper(sk)) 310 310 wake_up_interruptible_all(sk->sk_sleep); 311 311 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 312 312 read_unlock(&sk->sk_callback_lock); ··· 1256 1256 struct sock *sk = sock->sk; 1257 1257 unsigned int mask = 0; 1258 1258 1259 - poll_wait(file, sk->sk_sleep, wait); 1259 + sock_poll_wait(file, sk->sk_sleep, wait); 1260 1260 1261 1261 if (sk->sk_state == IUCV_LISTEN) 1262 1262 return iucv_accept_poll(sk);
+1 -1
net/mac80211/mesh_hwmp.c
··· 637 637 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 638 638 struct mesh_preq_queue *preq_node; 639 639 640 - preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_KERNEL); 640 + preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC); 641 641 if (!preq_node) { 642 642 printk(KERN_DEBUG "Mesh HWMP: could not allocate PREQ node\n"); 643 643 return;
+4 -1
net/mac80211/rc80211_minstrel.c
··· 66 66 for (i = rix; i >= 0; i--) 67 67 if (mi->r[i].rix == rix) 68 68 break; 69 - WARN_ON(mi->r[i].rix != rix); 69 + WARN_ON(i < 0); 70 70 return i; 71 71 } 72 72 ··· 181 181 break; 182 182 183 183 ndx = rix_to_ndx(mi, ar[i].idx); 184 + if (ndx < 0) 185 + continue; 186 + 184 187 mi->r[ndx].attempts += ar[i].count; 185 188 186 189 if ((i != IEEE80211_TX_MAX_RATES - 1) && (ar[i + 1].idx < 0))
+2 -2
net/rxrpc/af_rxrpc.c
··· 63 63 _enter("%p", sk); 64 64 read_lock(&sk->sk_callback_lock); 65 65 if (rxrpc_writable(sk)) { 66 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 66 + if (sk_has_sleeper(sk)) 67 67 wake_up_interruptible(sk->sk_sleep); 68 68 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 69 69 } ··· 588 588 unsigned int mask; 589 589 struct sock *sk = sock->sk; 590 590 591 - poll_wait(file, sk->sk_sleep, wait); 591 + sock_poll_wait(file, sk->sk_sleep, wait); 592 592 mask = 0; 593 593 594 594 /* the socket is readable if there are any messages waiting on the Rx
+4 -4
net/unix/af_unix.c
··· 315 315 { 316 316 read_lock(&sk->sk_callback_lock); 317 317 if (unix_writable(sk)) { 318 - if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 318 + if (sk_has_sleeper(sk)) 319 319 wake_up_interruptible_sync(sk->sk_sleep); 320 320 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 321 321 } ··· 1985 1985 struct sock *sk = sock->sk; 1986 1986 unsigned int mask; 1987 1987 1988 - poll_wait(file, sk->sk_sleep, wait); 1988 + sock_poll_wait(file, sk->sk_sleep, wait); 1989 1989 mask = 0; 1990 1990 1991 1991 /* exceptional events? */ ··· 2022 2022 struct sock *sk = sock->sk, *other; 2023 2023 unsigned int mask, writable; 2024 2024 2025 - poll_wait(file, sk->sk_sleep, wait); 2025 + sock_poll_wait(file, sk->sk_sleep, wait); 2026 2026 mask = 0; 2027 2027 2028 2028 /* exceptional events? */ ··· 2053 2053 other = unix_peer_get(sk); 2054 2054 if (other) { 2055 2055 if (unix_peer(other) != sk) { 2056 - poll_wait(file, &unix_sk(other)->peer_wait, 2056 + sock_poll_wait(file, &unix_sk(other)->peer_wait, 2057 2057 wait); 2058 2058 if (unix_recvq_full(other)) 2059 2059 writable = 0;
+1
net/wireless/nl80211.c
··· 447 447 448 448 rdev = __cfg80211_drv_from_info(info); 449 449 if (IS_ERR(rdev)) { 450 + mutex_unlock(&cfg80211_mutex); 450 451 result = PTR_ERR(rdev); 451 452 goto unlock; 452 453 }
-1
net/wireless/scan.c
··· 366 366 found = rb_find_bss(dev, res); 367 367 368 368 if (found) { 369 - kref_get(&found->ref); 370 369 found->pub.beacon_interval = res->pub.beacon_interval; 371 370 found->pub.tsf = res->pub.tsf; 372 371 found->pub.signal = res->pub.signal;