diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-24 15:25:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-24 15:25:03 -0400 |
commit | 1cac6ec9b7f9c48a26309380656f399a0587b860 (patch) | |
tree | dac346c856ce2a41641152c0bf9c13935bd65175 /net | |
parent | ce0cfd4ca817dbfd5f8267e7a6a235ed2041bf4a (diff) | |
parent | 8ff499e43c537648399fca8ba39d24c0768b3fab (diff) |
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:
smc91x: let smc91x work well under netpoll
pxaficp-ir: remove incorrect net_device_ops
NET: llc, zero sockaddr_llc struct
drivers/net: fixed drivers that support netpoll use ndo_start_xmit()
netpoll: warning for ndo_start_xmit returns with interrupts enabled
net: Fix Micrel KSZ8842 Kconfig description
netfilter: xt_quota: fix wrong return value (error case)
ipv6: Fix commit 63d9950b08184e6531adceb65f64b429909cc101 (ipv6: Make v4-mapped bindings consistent with IPv4)
E100: fix interaction with swiotlb on X86.
pkt_sched: Convert CBQ to tasklet_hrtimer.
pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B
ibm_newemac: emac_close() needs to call netif_carrier_off()
net: fix ks8851 build errors
net: Rename MAC platform driver for w90p910 platform
yellowfin: Fix buffer underrun after dev_alloc_skb() failure
orinoco: correct key bounds check in orinoco_hw_get_tkip_iv
mac80211: fix todo lock
Diffstat (limited to 'net')
-rw-r--r-- | net/core/netpoll.c | 5 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 4 | ||||
-rw-r--r-- | net/llc/af_llc.c | 1 | ||||
-rw-r--r-- | net/mac80211/key.c | 28 | ||||
-rw-r--r-- | net/netfilter/xt_quota.c | 2 | ||||
-rw-r--r-- | net/sched/sch_api.c | 8 | ||||
-rw-r--r-- | net/sched/sch_cbq.c | 23 |
7 files changed, 42 insertions, 29 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index df30feb2fc72..1b76eb11deb4 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -319,6 +319,11 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
319 | 319 | ||
320 | udelay(USEC_PER_POLL); | 320 | udelay(USEC_PER_POLL); |
321 | } | 321 | } |
322 | |||
323 | WARN_ONCE(!irqs_disabled(), | ||
324 | "netpoll_send_skb(): %s enabled interrupts in poll (%pF)\n", | ||
325 | dev->name, ops->ndo_start_xmit); | ||
326 | |||
322 | local_irq_restore(flags); | 327 | local_irq_restore(flags); |
323 | } | 328 | } |
324 | 329 | ||
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index caa0278d30a9..45f9a2a42d56 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -306,8 +306,10 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
306 | v4addr != htonl(INADDR_ANY) && | 306 | v4addr != htonl(INADDR_ANY) && |
307 | chk_addr_ret != RTN_LOCAL && | 307 | chk_addr_ret != RTN_LOCAL && |
308 | chk_addr_ret != RTN_MULTICAST && | 308 | chk_addr_ret != RTN_MULTICAST && |
309 | chk_addr_ret != RTN_BROADCAST) | 309 | chk_addr_ret != RTN_BROADCAST) { |
310 | err = -EADDRNOTAVAIL; | ||
310 | goto out; | 311 | goto out; |
312 | } | ||
311 | } else { | 313 | } else { |
312 | if (addr_type != IPV6_ADDR_ANY) { | 314 | if (addr_type != IPV6_ADDR_ANY) { |
313 | struct net_device *dev = NULL; | 315 | struct net_device *dev = NULL; |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 9208cf5f2bd5..c45eee1c0e8d 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -914,6 +914,7 @@ static int llc_ui_getname(struct socket *sock, struct sockaddr *uaddr, | |||
914 | struct llc_sock *llc = llc_sk(sk); | 914 | struct llc_sock *llc = llc_sk(sk); |
915 | int rc = 0; | 915 | int rc = 0; |
916 | 916 | ||
917 | memset(&sllc, 0, sizeof(sllc)); | ||
917 | lock_sock(sk); | 918 | lock_sock(sk); |
918 | if (sock_flag(sk, SOCK_ZAPPED)) | 919 | if (sock_flag(sk, SOCK_ZAPPED)) |
919 | goto out; | 920 | goto out; |
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index ce267565e180..659a42d529e3 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -67,6 +67,8 @@ static DECLARE_WORK(todo_work, key_todo); | |||
67 | * | 67 | * |
68 | * @key: key to add to do item for | 68 | * @key: key to add to do item for |
69 | * @flag: todo flag(s) | 69 | * @flag: todo flag(s) |
70 | * | ||
71 | * Must be called with IRQs or softirqs disabled. | ||
70 | */ | 72 | */ |
71 | static void add_todo(struct ieee80211_key *key, u32 flag) | 73 | static void add_todo(struct ieee80211_key *key, u32 flag) |
72 | { | 74 | { |
@@ -140,9 +142,9 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key) | |||
140 | ret = drv_set_key(key->local, SET_KEY, &sdata->vif, sta, &key->conf); | 142 | ret = drv_set_key(key->local, SET_KEY, &sdata->vif, sta, &key->conf); |
141 | 143 | ||
142 | if (!ret) { | 144 | if (!ret) { |
143 | spin_lock(&todo_lock); | 145 | spin_lock_bh(&todo_lock); |
144 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; | 146 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; |
145 | spin_unlock(&todo_lock); | 147 | spin_unlock_bh(&todo_lock); |
146 | } | 148 | } |
147 | 149 | ||
148 | if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP) | 150 | if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP) |
@@ -164,12 +166,12 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) | |||
164 | if (!key || !key->local->ops->set_key) | 166 | if (!key || !key->local->ops->set_key) |
165 | return; | 167 | return; |
166 | 168 | ||
167 | spin_lock(&todo_lock); | 169 | spin_lock_bh(&todo_lock); |
168 | if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { | 170 | if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { |
169 | spin_unlock(&todo_lock); | 171 | spin_unlock_bh(&todo_lock); |
170 | return; | 172 | return; |
171 | } | 173 | } |
172 | spin_unlock(&todo_lock); | 174 | spin_unlock_bh(&todo_lock); |
173 | 175 | ||
174 | sta = get_sta_for_key(key); | 176 | sta = get_sta_for_key(key); |
175 | sdata = key->sdata; | 177 | sdata = key->sdata; |
@@ -188,9 +190,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) | |||
188 | wiphy_name(key->local->hw.wiphy), | 190 | wiphy_name(key->local->hw.wiphy), |
189 | key->conf.keyidx, sta ? sta->addr : bcast_addr, ret); | 191 | key->conf.keyidx, sta ? sta->addr : bcast_addr, ret); |
190 | 192 | ||
191 | spin_lock(&todo_lock); | 193 | spin_lock_bh(&todo_lock); |
192 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; | 194 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; |
193 | spin_unlock(&todo_lock); | 195 | spin_unlock_bh(&todo_lock); |
194 | } | 196 | } |
195 | 197 | ||
196 | static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, | 198 | static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, |
@@ -437,14 +439,14 @@ void ieee80211_key_link(struct ieee80211_key *key, | |||
437 | 439 | ||
438 | __ieee80211_key_replace(sdata, sta, old_key, key); | 440 | __ieee80211_key_replace(sdata, sta, old_key, key); |
439 | 441 | ||
440 | spin_unlock_irqrestore(&sdata->local->key_lock, flags); | ||
441 | |||
442 | /* free old key later */ | 442 | /* free old key later */ |
443 | add_todo(old_key, KEY_FLAG_TODO_DELETE); | 443 | add_todo(old_key, KEY_FLAG_TODO_DELETE); |
444 | 444 | ||
445 | add_todo(key, KEY_FLAG_TODO_ADD_DEBUGFS); | 445 | add_todo(key, KEY_FLAG_TODO_ADD_DEBUGFS); |
446 | if (netif_running(sdata->dev)) | 446 | if (netif_running(sdata->dev)) |
447 | add_todo(key, KEY_FLAG_TODO_HWACCEL_ADD); | 447 | add_todo(key, KEY_FLAG_TODO_HWACCEL_ADD); |
448 | |||
449 | spin_unlock_irqrestore(&sdata->local->key_lock, flags); | ||
448 | } | 450 | } |
449 | 451 | ||
450 | static void __ieee80211_key_free(struct ieee80211_key *key) | 452 | static void __ieee80211_key_free(struct ieee80211_key *key) |
@@ -547,7 +549,7 @@ static void __ieee80211_key_todo(void) | |||
547 | */ | 549 | */ |
548 | synchronize_rcu(); | 550 | synchronize_rcu(); |
549 | 551 | ||
550 | spin_lock(&todo_lock); | 552 | spin_lock_bh(&todo_lock); |
551 | while (!list_empty(&todo_list)) { | 553 | while (!list_empty(&todo_list)) { |
552 | key = list_first_entry(&todo_list, struct ieee80211_key, todo); | 554 | key = list_first_entry(&todo_list, struct ieee80211_key, todo); |
553 | list_del_init(&key->todo); | 555 | list_del_init(&key->todo); |
@@ -558,7 +560,7 @@ static void __ieee80211_key_todo(void) | |||
558 | KEY_FLAG_TODO_HWACCEL_REMOVE | | 560 | KEY_FLAG_TODO_HWACCEL_REMOVE | |
559 | KEY_FLAG_TODO_DELETE); | 561 | KEY_FLAG_TODO_DELETE); |
560 | key->flags &= ~todoflags; | 562 | key->flags &= ~todoflags; |
561 | spin_unlock(&todo_lock); | 563 | spin_unlock_bh(&todo_lock); |
562 | 564 | ||
563 | work_done = false; | 565 | work_done = false; |
564 | 566 | ||
@@ -591,9 +593,9 @@ static void __ieee80211_key_todo(void) | |||
591 | 593 | ||
592 | WARN_ON(!work_done); | 594 | WARN_ON(!work_done); |
593 | 595 | ||
594 | spin_lock(&todo_lock); | 596 | spin_lock_bh(&todo_lock); |
595 | } | 597 | } |
596 | spin_unlock(&todo_lock); | 598 | spin_unlock_bh(&todo_lock); |
597 | } | 599 | } |
598 | 600 | ||
599 | void ieee80211_key_todo(void) | 601 | void ieee80211_key_todo(void) |
diff --git a/net/netfilter/xt_quota.c b/net/netfilter/xt_quota.c index 98fc190e8f0e..390b7d09fe51 100644 --- a/net/netfilter/xt_quota.c +++ b/net/netfilter/xt_quota.c | |||
@@ -52,7 +52,7 @@ static bool quota_mt_check(const struct xt_mtchk_param *par) | |||
52 | 52 | ||
53 | q->master = kmalloc(sizeof(*q->master), GFP_KERNEL); | 53 | q->master = kmalloc(sizeof(*q->master), GFP_KERNEL); |
54 | if (q->master == NULL) | 54 | if (q->master == NULL) |
55 | return -ENOMEM; | 55 | return false; |
56 | 56 | ||
57 | q->master->quota = q->quota; | 57 | q->master->quota = q->quota; |
58 | return true; | 58 | return true; |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 24d17ce9c294..e1c2bf7e9ba4 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -468,8 +468,8 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer) | |||
468 | 468 | ||
469 | void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc) | 469 | void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc) |
470 | { | 470 | { |
471 | hrtimer_init(&wd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); | 471 | tasklet_hrtimer_init(&wd->timer, qdisc_watchdog, |
472 | wd->timer.function = qdisc_watchdog; | 472 | CLOCK_MONOTONIC, HRTIMER_MODE_ABS); |
473 | wd->qdisc = qdisc; | 473 | wd->qdisc = qdisc; |
474 | } | 474 | } |
475 | EXPORT_SYMBOL(qdisc_watchdog_init); | 475 | EXPORT_SYMBOL(qdisc_watchdog_init); |
@@ -485,13 +485,13 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires) | |||
485 | wd->qdisc->flags |= TCQ_F_THROTTLED; | 485 | wd->qdisc->flags |= TCQ_F_THROTTLED; |
486 | time = ktime_set(0, 0); | 486 | time = ktime_set(0, 0); |
487 | time = ktime_add_ns(time, PSCHED_TICKS2NS(expires)); | 487 | time = ktime_add_ns(time, PSCHED_TICKS2NS(expires)); |
488 | hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); | 488 | tasklet_hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); |
489 | } | 489 | } |
490 | EXPORT_SYMBOL(qdisc_watchdog_schedule); | 490 | EXPORT_SYMBOL(qdisc_watchdog_schedule); |
491 | 491 | ||
492 | void qdisc_watchdog_cancel(struct qdisc_watchdog *wd) | 492 | void qdisc_watchdog_cancel(struct qdisc_watchdog *wd) |
493 | { | 493 | { |
494 | hrtimer_cancel(&wd->timer); | 494 | tasklet_hrtimer_cancel(&wd->timer); |
495 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; | 495 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; |
496 | } | 496 | } |
497 | EXPORT_SYMBOL(qdisc_watchdog_cancel); | 497 | EXPORT_SYMBOL(qdisc_watchdog_cancel); |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index d5798e17a832..81652d6ccd36 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -163,7 +163,7 @@ struct cbq_sched_data | |||
163 | psched_time_t now_rt; /* Cached real time */ | 163 | psched_time_t now_rt; /* Cached real time */ |
164 | unsigned pmask; | 164 | unsigned pmask; |
165 | 165 | ||
166 | struct hrtimer delay_timer; | 166 | struct tasklet_hrtimer delay_timer; |
167 | struct qdisc_watchdog watchdog; /* Watchdog timer, | 167 | struct qdisc_watchdog watchdog; /* Watchdog timer, |
168 | started when CBQ has | 168 | started when CBQ has |
169 | backlog, but cannot | 169 | backlog, but cannot |
@@ -503,6 +503,8 @@ static void cbq_ovl_delay(struct cbq_class *cl) | |||
503 | cl->undertime = q->now + delay; | 503 | cl->undertime = q->now + delay; |
504 | 504 | ||
505 | if (delay > 0) { | 505 | if (delay > 0) { |
506 | struct hrtimer *ht; | ||
507 | |||
506 | sched += delay + cl->penalty; | 508 | sched += delay + cl->penalty; |
507 | cl->penalized = sched; | 509 | cl->penalized = sched; |
508 | cl->cpriority = TC_CBQ_MAXPRIO; | 510 | cl->cpriority = TC_CBQ_MAXPRIO; |
@@ -510,12 +512,12 @@ static void cbq_ovl_delay(struct cbq_class *cl) | |||
510 | 512 | ||
511 | expires = ktime_set(0, 0); | 513 | expires = ktime_set(0, 0); |
512 | expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched)); | 514 | expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched)); |
513 | if (hrtimer_try_to_cancel(&q->delay_timer) && | 515 | ht = &q->delay_timer.timer; |
514 | ktime_to_ns(ktime_sub( | 516 | if (hrtimer_try_to_cancel(ht) && |
515 | hrtimer_get_expires(&q->delay_timer), | 517 | ktime_to_ns(ktime_sub(hrtimer_get_expires(ht), |
516 | expires)) > 0) | 518 | expires)) > 0) |
517 | hrtimer_set_expires(&q->delay_timer, expires); | 519 | hrtimer_set_expires(ht, expires); |
518 | hrtimer_restart(&q->delay_timer); | 520 | hrtimer_restart(ht); |
519 | cl->delayed = 1; | 521 | cl->delayed = 1; |
520 | cl->xstats.overactions++; | 522 | cl->xstats.overactions++; |
521 | return; | 523 | return; |
@@ -621,7 +623,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) | |||
621 | 623 | ||
622 | time = ktime_set(0, 0); | 624 | time = ktime_set(0, 0); |
623 | time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); | 625 | time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay)); |
624 | hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); | 626 | tasklet_hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); |
625 | } | 627 | } |
626 | 628 | ||
627 | sch->flags &= ~TCQ_F_THROTTLED; | 629 | sch->flags &= ~TCQ_F_THROTTLED; |
@@ -1214,7 +1216,7 @@ cbq_reset(struct Qdisc* sch) | |||
1214 | q->tx_class = NULL; | 1216 | q->tx_class = NULL; |
1215 | q->tx_borrowed = NULL; | 1217 | q->tx_borrowed = NULL; |
1216 | qdisc_watchdog_cancel(&q->watchdog); | 1218 | qdisc_watchdog_cancel(&q->watchdog); |
1217 | hrtimer_cancel(&q->delay_timer); | 1219 | tasklet_hrtimer_cancel(&q->delay_timer); |
1218 | q->toplevel = TC_CBQ_MAXLEVEL; | 1220 | q->toplevel = TC_CBQ_MAXLEVEL; |
1219 | q->now = psched_get_time(); | 1221 | q->now = psched_get_time(); |
1220 | q->now_rt = q->now; | 1222 | q->now_rt = q->now; |
@@ -1397,7 +1399,8 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt) | |||
1397 | q->link.minidle = -0x7FFFFFFF; | 1399 | q->link.minidle = -0x7FFFFFFF; |
1398 | 1400 | ||
1399 | qdisc_watchdog_init(&q->watchdog, sch); | 1401 | qdisc_watchdog_init(&q->watchdog, sch); |
1400 | hrtimer_init(&q->delay_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); | 1402 | tasklet_hrtimer_init(&q->delay_timer, cbq_undelay, |
1403 | CLOCK_MONOTONIC, HRTIMER_MODE_ABS); | ||
1401 | q->delay_timer.function = cbq_undelay; | 1404 | q->delay_timer.function = cbq_undelay; |
1402 | q->toplevel = TC_CBQ_MAXLEVEL; | 1405 | q->toplevel = TC_CBQ_MAXLEVEL; |
1403 | q->now = psched_get_time(); | 1406 | q->now = psched_get_time(); |