aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/lguest/Makefile4
-rw-r--r--drivers/lguest/core.c5
-rw-r--r--drivers/lguest/interrupts_and_traps.c9
-rw-r--r--drivers/lguest/lguest.c9
-rw-r--r--drivers/lguest/segments.c62
-rw-r--r--drivers/lguest/switcher.S15
-rw-r--r--drivers/net/atl1/atl1_main.c4
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c44
-rw-r--r--drivers/net/ibmveth.c27
-rw-r--r--drivers/net/ibmveth.h3
-rw-r--r--drivers/net/phy/phy.c4
-rw-r--r--drivers/net/r8169.c24
-rw-r--r--drivers/net/sis190.c3
-rw-r--r--drivers/net/smc91x.h4
-rw-r--r--drivers/net/ucc_geth_ethtool.c1
-rw-r--r--drivers/net/ucc_geth_mii.c3
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_phy.c2
-rw-r--r--drivers/net/wireless/rtl8187_dev.c2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c2
-rw-r--r--fs/compat_ioctl.c3
-rw-r--r--kernel/auditsc.c22
-rw-r--r--kernel/irq/resend.c9
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c11
24 files changed, 114 insertions, 160 deletions
diff --git a/Documentation/lguest/Makefile b/Documentation/lguest/Makefile
index 31e794ef5f98..c0b7a4556390 100644
--- a/Documentation/lguest/Makefile
+++ b/Documentation/lguest/Makefile
@@ -13,7 +13,9 @@ LGUEST_GUEST_TOP := ($(CONFIG_PAGE_OFFSET) - 0x08000000)
13 13
14CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -Wl,-T,lguest.lds 14CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -Wl,-T,lguest.lds
15LDLIBS:=-lz 15LDLIBS:=-lz
16 16# Removing this works for some versions of ld.so (eg. Ubuntu Feisty) and
17# not others (eg. FC7).
18LDFLAGS+=-static
17all: lguest.lds lguest 19all: lguest.lds lguest
18 20
19# The linker script on x86 is so complex the only way of creating one 21# The linker script on x86 is so complex the only way of creating one
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index 0a46e8837d9a..4a315f08a567 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -453,6 +453,11 @@ static void run_guest_once(struct lguest *lg, struct lguest_pages *pages)
453 * lguest_pages". */ 453 * lguest_pages". */
454 copy_in_guest_info(lg, pages); 454 copy_in_guest_info(lg, pages);
455 455
456 /* Set the trap number to 256 (impossible value). If we fault while
457 * switching to the Guest (bad segment registers or bug), this will
458 * cause us to abort the Guest. */
459 lg->regs->trapnum = 256;
460
456 /* Now: we push the "eflags" register on the stack, then do an "lcall". 461 /* Now: we push the "eflags" register on the stack, then do an "lcall".
457 * This is how we change from using the kernel code segment to using 462 * This is how we change from using the kernel code segment to using
458 * the dedicated lguest code segment, as well as jumping into the 463 * the dedicated lguest code segment, as well as jumping into the
diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index 49787e964a0d..49aa55577d0d 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -195,13 +195,16 @@ static int has_err(unsigned int trap)
195/* deliver_trap() returns true if it could deliver the trap. */ 195/* deliver_trap() returns true if it could deliver the trap. */
196int deliver_trap(struct lguest *lg, unsigned int num) 196int deliver_trap(struct lguest *lg, unsigned int num)
197{ 197{
198 u32 lo = lg->idt[num].a, hi = lg->idt[num].b; 198 /* Trap numbers are always 8 bit, but we set an impossible trap number
199 * for traps inside the Switcher, so check that here. */
200 if (num >= ARRAY_SIZE(lg->idt))
201 return 0;
199 202
200 /* Early on the Guest hasn't set the IDT entries (or maybe it put a 203 /* Early on the Guest hasn't set the IDT entries (or maybe it put a
201 * bogus one in): if we fail here, the Guest will be killed. */ 204 * bogus one in): if we fail here, the Guest will be killed. */
202 if (!idt_present(lo, hi)) 205 if (!idt_present(lg->idt[num].a, lg->idt[num].b))
203 return 0; 206 return 0;
204 set_guest_interrupt(lg, lo, hi, has_err(num)); 207 set_guest_interrupt(lg, lg->idt[num].a, lg->idt[num].b, has_err(num));
205 return 1; 208 return 1;
206} 209}
207 210
diff --git a/drivers/lguest/lguest.c b/drivers/lguest/lguest.c
index 1bc1546c7fd0..524beea7fb19 100644
--- a/drivers/lguest/lguest.c
+++ b/drivers/lguest/lguest.c
@@ -323,9 +323,12 @@ static void lguest_write_gdt_entry(struct desc_struct *dt,
323 * __thread variables). So we have a hypercall specifically for this case. */ 323 * __thread variables). So we have a hypercall specifically for this case. */
324static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) 324static void lguest_load_tls(struct thread_struct *t, unsigned int cpu)
325{ 325{
326 /* There's one problem which normal hardware doesn't have: the Host
327 * can't handle us removing entries we're currently using. So we clear
328 * the GS register here: if it's needed it'll be reloaded anyway. */
329 loadsegment(gs, 0);
326 lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0); 330 lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0);
327} 331}
328/*:*/
329 332
330/*G:038 That's enough excitement for now, back to ploughing through each of 333/*G:038 That's enough excitement for now, back to ploughing through each of
331 * the paravirt_ops (we're about 1/3 of the way through). 334 * the paravirt_ops (we're about 1/3 of the way through).
@@ -687,7 +690,8 @@ static struct clocksource lguest_clock = {
687 .rating = 400, 690 .rating = 400,
688 .read = lguest_clock_read, 691 .read = lguest_clock_read,
689 .mask = CLOCKSOURCE_MASK(64), 692 .mask = CLOCKSOURCE_MASK(64),
690 .mult = 1, 693 .mult = 1 << 22,
694 .shift = 22,
691}; 695};
692 696
693/* The "scheduler clock" is just our real clock, adjusted to start at zero */ 697/* The "scheduler clock" is just our real clock, adjusted to start at zero */
@@ -770,7 +774,6 @@ static void lguest_time_init(void)
770 * way, the "rating" is initialized so high that it's always chosen 774 * way, the "rating" is initialized so high that it's always chosen
771 * over any other clocksource. */ 775 * over any other clocksource. */
772 if (lguest_data.tsc_khz) { 776 if (lguest_data.tsc_khz) {
773 lguest_clock.shift = 22;
774 lguest_clock.mult = clocksource_khz2mult(lguest_data.tsc_khz, 777 lguest_clock.mult = clocksource_khz2mult(lguest_data.tsc_khz,
775 lguest_clock.shift); 778 lguest_clock.shift);
776 lguest_clock.flags = CLOCK_SOURCE_IS_CONTINUOUS; 779 lguest_clock.flags = CLOCK_SOURCE_IS_CONTINUOUS;
diff --git a/drivers/lguest/segments.c b/drivers/lguest/segments.c
index f675a41a80da..9b81119f46e9 100644
--- a/drivers/lguest/segments.c
+++ b/drivers/lguest/segments.c
@@ -43,22 +43,6 @@
43 * begin. 43 * begin.
44 */ 44 */
45 45
46/* Is the descriptor the Guest wants us to put in OK?
47 *
48 * The flag which Intel says must be zero: must be zero. The descriptor must
49 * be present, (this is actually checked earlier but is here for thorougness),
50 * and the descriptor type must be 1 (a memory segment). */
51static int desc_ok(const struct desc_struct *gdt)
52{
53 return ((gdt->b & 0x00209000) == 0x00009000);
54}
55
56/* Is the segment present? (Otherwise it can't be used by the Guest). */
57static int segment_present(const struct desc_struct *gdt)
58{
59 return gdt->b & 0x8000;
60}
61
62/* There are several entries we don't let the Guest set. The TSS entry is the 46/* There are several entries we don't let the Guest set. The TSS entry is the
63 * "Task State Segment" which controls all kinds of delicate things. The 47 * "Task State Segment" which controls all kinds of delicate things. The
64 * LGUEST_CS and LGUEST_DS entries are reserved for the Switcher, and the 48 * LGUEST_CS and LGUEST_DS entries are reserved for the Switcher, and the
@@ -71,37 +55,11 @@ static int ignored_gdt(unsigned int num)
71 || num == GDT_ENTRY_DOUBLEFAULT_TSS); 55 || num == GDT_ENTRY_DOUBLEFAULT_TSS);
72} 56}
73 57
74/* If the Guest asks us to remove an entry from the GDT, we have to be careful. 58/*H:610 Once the GDT has been changed, we fix the new entries up a little. We
75 * If one of the segment registers is pointing at that entry the Switcher will 59 * don't care if they're invalid: the worst that can happen is a General
76 * crash when it tries to reload the segment registers for the Guest. 60 * Protection Fault in the Switcher when it restores a Guest segment register
77 * 61 * which tries to use that entry. Then we kill the Guest for causing such a
78 * It doesn't make much sense for the Guest to try to remove its own code, data 62 * mess: the message will be "unhandled trap 256". */
79 * or stack segments while they're in use: assume that's a Guest bug. If it's
80 * one of the lesser segment registers using the removed entry, we simply set
81 * that register to 0 (unusable). */
82static void check_segment_use(struct lguest *lg, unsigned int desc)
83{
84 /* GDT entries are 8 bytes long, so we divide to get the index and
85 * ignore the bottom bits. */
86 if (lg->regs->gs / 8 == desc)
87 lg->regs->gs = 0;
88 if (lg->regs->fs / 8 == desc)
89 lg->regs->fs = 0;
90 if (lg->regs->es / 8 == desc)
91 lg->regs->es = 0;
92 if (lg->regs->ds / 8 == desc
93 || lg->regs->cs / 8 == desc
94 || lg->regs->ss / 8 == desc)
95 kill_guest(lg, "Removed live GDT entry %u", desc);
96}
97/*:*/
98/*M:009 We wouldn't need to check for removal of in-use segments if we handled
99 * faults in the Switcher. However, it's probably not a worthwhile
100 * optimization. :*/
101
102/*H:610 Once the GDT has been changed, we look through the changed entries and
103 * see if they're OK. If not, we'll call kill_guest() and the Guest will never
104 * get to use the invalid entries. */
105static void fixup_gdt_table(struct lguest *lg, unsigned start, unsigned end) 63static void fixup_gdt_table(struct lguest *lg, unsigned start, unsigned end)
106{ 64{
107 unsigned int i; 65 unsigned int i;
@@ -112,16 +70,6 @@ static void fixup_gdt_table(struct lguest *lg, unsigned start, unsigned end)
112 if (ignored_gdt(i)) 70 if (ignored_gdt(i))
113 continue; 71 continue;
114 72
115 /* We could fault in switch_to_guest if they are using
116 * a removed segment. */
117 if (!segment_present(&lg->gdt[i])) {
118 check_segment_use(lg, i);
119 continue;
120 }
121
122 if (!desc_ok(&lg->gdt[i]))
123 kill_guest(lg, "Bad GDT descriptor %i", i);
124
125 /* Segment descriptors contain a privilege level: the Guest is 73 /* Segment descriptors contain a privilege level: the Guest is
126 * sometimes careless and leaves this as 0, even though it's 74 * sometimes careless and leaves this as 0, even though it's
127 * running at privilege level 1. If so, we fix it here. */ 75 * running at privilege level 1. If so, we fix it here. */
diff --git a/drivers/lguest/switcher.S b/drivers/lguest/switcher.S
index d418179ea6b5..7c9c230cc845 100644
--- a/drivers/lguest/switcher.S
+++ b/drivers/lguest/switcher.S
@@ -47,6 +47,7 @@
47// Down here in the depths of assembler code. 47// Down here in the depths of assembler code.
48#include <linux/linkage.h> 48#include <linux/linkage.h>
49#include <asm/asm-offsets.h> 49#include <asm/asm-offsets.h>
50#include <asm/page.h>
50#include "lg.h" 51#include "lg.h"
51 52
52// We mark the start of the code to copy 53// We mark the start of the code to copy
@@ -182,13 +183,15 @@ ENTRY(switch_to_guest)
182 movl $(LGUEST_DS), %eax; \ 183 movl $(LGUEST_DS), %eax; \
183 movl %eax, %ds; \ 184 movl %eax, %ds; \
184 /* So where are we? Which CPU, which struct? \ 185 /* So where are we? Which CPU, which struct? \
185 * The stack is our clue: our TSS sets \ 186 * The stack is our clue: our TSS starts \
186 * It at the end of "struct lguest_pages" \ 187 * It at the end of "struct lguest_pages". \
187 * And we then pushed and pushed and pushed Guest regs: \ 188 * Or we may have stumbled while restoring \
188 * Now stack points atop the "struct lguest_regs". \ 189 * Our Guest segment regs while in switch_to_guest, \
189 * Subtract that offset, and we find our struct. */ \ 190 * The fault pushed atop that part-unwound stack. \
191 * If we round the stack down to the page start \
192 * We're at the start of "struct lguest_pages". */ \
190 movl %esp, %eax; \ 193 movl %esp, %eax; \
191 subl $LGUEST_PAGES_regs, %eax; \ 194 andl $(~(1 << PAGE_SHIFT - 1)), %eax; \
192 /* Save our trap number: the switch will obscure it \ 195 /* Save our trap number: the switch will obscure it \
193 * (The Guest regs are not mapped here in the Host) \ 196 * (The Guest regs are not mapped here in the Host) \
194 * %ebx holds it safe for deliver_to_host */ \ 197 * %ebx holds it safe for deliver_to_host */ \
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 56f6389a300e..3c1984ecf36c 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1704 } 1704 }
1705 } 1705 }
1706 1706
1707 local_irq_save(flags); 1707 if (!spin_trylock_irqsave(&adapter->lock, flags)) {
1708 if (!spin_trylock(&adapter->lock)) {
1709 /* Can't get lock - tell upper layer to requeue */ 1708 /* Can't get lock - tell upper layer to requeue */
1710 local_irq_restore(flags);
1711 dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n"); 1709 dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
1712 return NETDEV_TX_LOCKED; 1710 return NETDEV_TX_LOCKED;
1713 } 1711 }
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 8ee2c2c86b42..d67f97bfa3a4 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0072" 42#define DRV_VERSION "EHEA_0073"
43 43
44/* eHEA capability flags */ 44/* eHEA capability flags */
45#define DLPAR_PORT_ADD_REM 1 45#define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 58702f54c3fb..9756211e83ce 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1326,7 +1326,6 @@ static void write_swqe2_TSO(struct sk_buff *skb,
1326 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0]; 1326 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
1327 int skb_data_size = skb->len - skb->data_len; 1327 int skb_data_size = skb->len - skb->data_len;
1328 int headersize; 1328 int headersize;
1329 u64 tmp_addr;
1330 1329
1331 /* Packet is TCP with TSO enabled */ 1330 /* Packet is TCP with TSO enabled */
1332 swqe->tx_control |= EHEA_SWQE_TSO; 1331 swqe->tx_control |= EHEA_SWQE_TSO;
@@ -1347,9 +1346,8 @@ static void write_swqe2_TSO(struct sk_buff *skb,
1347 /* set sg1entry data */ 1346 /* set sg1entry data */
1348 sg1entry->l_key = lkey; 1347 sg1entry->l_key = lkey;
1349 sg1entry->len = skb_data_size - headersize; 1348 sg1entry->len = skb_data_size - headersize;
1350 1349 sg1entry->vaddr =
1351 tmp_addr = (u64)(skb->data + headersize); 1350 ehea_map_vaddr(skb->data + headersize);
1352 sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
1353 swqe->descriptors++; 1351 swqe->descriptors++;
1354 } 1352 }
1355 } else 1353 } else
@@ -1362,7 +1360,6 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
1362 int skb_data_size = skb->len - skb->data_len; 1360 int skb_data_size = skb->len - skb->data_len;
1363 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0]; 1361 u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
1364 struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry; 1362 struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
1365 u64 tmp_addr;
1366 1363
1367 /* Packet is any nonTSO type 1364 /* Packet is any nonTSO type
1368 * 1365 *
@@ -1379,8 +1376,8 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
1379 /* copy sg1entry data */ 1376 /* copy sg1entry data */
1380 sg1entry->l_key = lkey; 1377 sg1entry->l_key = lkey;
1381 sg1entry->len = skb_data_size - SWQE2_MAX_IMM; 1378 sg1entry->len = skb_data_size - SWQE2_MAX_IMM;
1382 tmp_addr = (u64)(skb->data + SWQE2_MAX_IMM); 1379 sg1entry->vaddr =
1383 sg1entry->vaddr = ehea_map_vaddr(tmp_addr); 1380 ehea_map_vaddr(skb->data + SWQE2_MAX_IMM);
1384 swqe->descriptors++; 1381 swqe->descriptors++;
1385 } 1382 }
1386 } else { 1383 } else {
@@ -1395,7 +1392,6 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1395 struct ehea_vsgentry *sg_list, *sg1entry, *sgentry; 1392 struct ehea_vsgentry *sg_list, *sg1entry, *sgentry;
1396 skb_frag_t *frag; 1393 skb_frag_t *frag;
1397 int nfrags, sg1entry_contains_frag_data, i; 1394 int nfrags, sg1entry_contains_frag_data, i;
1398 u64 tmp_addr;
1399 1395
1400 nfrags = skb_shinfo(skb)->nr_frags; 1396 nfrags = skb_shinfo(skb)->nr_frags;
1401 sg1entry = &swqe->u.immdata_desc.sg_entry; 1397 sg1entry = &swqe->u.immdata_desc.sg_entry;
@@ -1417,9 +1413,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1417 /* copy sg1entry data */ 1413 /* copy sg1entry data */
1418 sg1entry->l_key = lkey; 1414 sg1entry->l_key = lkey;
1419 sg1entry->len = frag->size; 1415 sg1entry->len = frag->size;
1420 tmp_addr = (u64)(page_address(frag->page) 1416 sg1entry->vaddr =
1421 + frag->page_offset); 1417 ehea_map_vaddr(page_address(frag->page)
1422 sg1entry->vaddr = ehea_map_vaddr(tmp_addr); 1418 + frag->page_offset);
1423 swqe->descriptors++; 1419 swqe->descriptors++;
1424 sg1entry_contains_frag_data = 1; 1420 sg1entry_contains_frag_data = 1;
1425 } 1421 }
@@ -1431,10 +1427,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
1431 1427
1432 sgentry->l_key = lkey; 1428 sgentry->l_key = lkey;
1433 sgentry->len = frag->size; 1429 sgentry->len = frag->size;
1434 1430 sgentry->vaddr =
1435 tmp_addr = (u64)(page_address(frag->page) 1431 ehea_map_vaddr(page_address(frag->page)
1436 + frag->page_offset); 1432 + frag->page_offset);
1437 sgentry->vaddr = ehea_map_vaddr(tmp_addr);
1438 swqe->descriptors++; 1433 swqe->descriptors++;
1439 } 1434 }
1440 } 1435 }
@@ -2165,24 +2160,18 @@ static int ehea_clean_all_portres(struct ehea_port *port)
2165 return ret; 2160 return ret;
2166} 2161}
2167 2162
2168static void ehea_remove_adapter_mr (struct ehea_adapter *adapter) 2163static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
2169{ 2164{
2170 int i; 2165 if (adapter->active_ports)
2171 2166 return;
2172 for (i=0; i < EHEA_MAX_PORTS; i++)
2173 if (adapter->port[i])
2174 return;
2175 2167
2176 ehea_rem_mr(&adapter->mr); 2168 ehea_rem_mr(&adapter->mr);
2177} 2169}
2178 2170
2179static int ehea_add_adapter_mr (struct ehea_adapter *adapter) 2171static int ehea_add_adapter_mr(struct ehea_adapter *adapter)
2180{ 2172{
2181 int i; 2173 if (adapter->active_ports)
2182 2174 return 0;
2183 for (i=0; i < EHEA_MAX_PORTS; i++)
2184 if (adapter->port[i])
2185 return 0;
2186 2175
2187 return ehea_reg_kernel_mr(adapter, &adapter->mr); 2176 return ehea_reg_kernel_mr(adapter, &adapter->mr);
2188} 2177}
@@ -3099,6 +3088,7 @@ out:
3099 3088
3100static void __exit ehea_module_exit(void) 3089static void __exit ehea_module_exit(void)
3101{ 3090{
3091 destroy_workqueue(ehea_driver_wq);
3102 driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities); 3092 driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
3103 ibmebus_unregister_driver(&ehea_driver); 3093 ibmebus_unregister_driver(&ehea_driver);
3104 ehea_destroy_busmap(); 3094 ehea_destroy_busmap();
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index d96eb7229548..acba90f1638e 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -963,7 +963,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
963{ 963{
964 int rc, i; 964 int rc, i;
965 struct net_device *netdev; 965 struct net_device *netdev;
966 struct ibmveth_adapter *adapter = NULL; 966 struct ibmveth_adapter *adapter;
967 967
968 unsigned char *mac_addr_p; 968 unsigned char *mac_addr_p;
969 unsigned int *mcastFilterSize_p; 969 unsigned int *mcastFilterSize_p;
@@ -997,7 +997,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
997 SET_MODULE_OWNER(netdev); 997 SET_MODULE_OWNER(netdev);
998 998
999 adapter = netdev->priv; 999 adapter = netdev->priv;
1000 memset(adapter, 0, sizeof(adapter));
1001 dev->dev.driver_data = netdev; 1000 dev->dev.driver_data = netdev;
1002 1001
1003 adapter->vdev = dev; 1002 adapter->vdev = dev;
@@ -1280,24 +1279,28 @@ const char * buf, size_t count)
1280 int i; 1279 int i;
1281 /* Make sure there is a buffer pool with buffers that 1280 /* Make sure there is a buffer pool with buffers that
1282 can hold a packet of the size of the MTU */ 1281 can hold a packet of the size of the MTU */
1283 for(i = 0; i<IbmVethNumBufferPools; i++) { 1282 for (i = 0; i < IbmVethNumBufferPools; i++) {
1284 if (pool == &adapter->rx_buff_pool[i]) 1283 if (pool == &adapter->rx_buff_pool[i])
1285 continue; 1284 continue;
1286 if (!adapter->rx_buff_pool[i].active) 1285 if (!adapter->rx_buff_pool[i].active)
1287 continue; 1286 continue;
1288 if (mtu < adapter->rx_buff_pool[i].buff_size) { 1287 if (mtu <= adapter->rx_buff_pool[i].buff_size)
1289 pool->active = 0; 1288 break;
1290 h_free_logical_lan_buffer(adapter->
1291 vdev->
1292 unit_address,
1293 pool->
1294 buff_size);
1295 }
1296 } 1289 }
1297 if (pool->active) { 1290
1291 if (i == IbmVethNumBufferPools) {
1298 ibmveth_error_printk("no active pool >= MTU\n"); 1292 ibmveth_error_printk("no active pool >= MTU\n");
1299 return -EPERM; 1293 return -EPERM;
1300 } 1294 }
1295
1296 pool->active = 0;
1297 if (netif_running(netdev)) {
1298 adapter->pool_config = 1;
1299 ibmveth_close(netdev);
1300 adapter->pool_config = 0;
1301 if ((rc = ibmveth_open(netdev)))
1302 return rc;
1303 }
1301 } 1304 }
1302 } else if (attr == &veth_num_attr) { 1305 } else if (attr == &veth_num_attr) {
1303 if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT) 1306 if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT)
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index bb69ccae8ace..72cc15a6cab7 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -73,9 +73,6 @@ static inline long h_send_logical_lan(unsigned long unit_address,
73#define h_change_logical_lan_mac(ua, mac) \ 73#define h_change_logical_lan_mac(ua, mac) \
74 plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac) 74 plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac)
75 75
76#define h_free_logical_lan_buffer(ua, bufsize) \
77 plpar_hcall_norets(H_FREE_LOGICAL_LAN_BUFFER, ua, bufsize)
78
79#define IbmVethNumBufferPools 5 76#define IbmVethNumBufferPools 5
80#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */ 77#define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */
81#define IBMVETH_MAX_MTU 68 78#define IBMVETH_MAX_MTU 68
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f71dab347667..e323efd4ed18 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_device *phydev)
261 261
262 /* Sanitize settings based on PHY capabilities */ 262 /* Sanitize settings based on PHY capabilities */
263 if ((features & SUPPORTED_Autoneg) == 0) 263 if ((features & SUPPORTED_Autoneg) == 0)
264 phydev->autoneg = 0; 264 phydev->autoneg = AUTONEG_DISABLE;
265 265
266 idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex), 266 idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
267 features); 267 features);
@@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
374 if (mii_data->phy_id == phydev->addr) { 374 if (mii_data->phy_id == phydev->addr) {
375 switch(mii_data->reg_num) { 375 switch(mii_data->reg_num) {
376 case MII_BMCR: 376 case MII_BMCR:
377 if (val & (BMCR_RESET|BMCR_ANENABLE)) 377 if ((val & (BMCR_RESET|BMCR_ANENABLE)) == 0)
378 phydev->autoneg = AUTONEG_DISABLE; 378 phydev->autoneg = AUTONEG_DISABLE;
379 else 379 else
380 phydev->autoneg = AUTONEG_ENABLE; 380 phydev->autoneg = AUTONEG_ENABLE;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c9333b9dd51a..b85ab4a8f2a3 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -725,6 +725,12 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
725 725
726 auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; 726 auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
727 727
728 if (tp->mac_version == RTL_GIGA_MAC_VER_12) {
729 /* Vendor specific (0x1f) and reserved (0x0e) MII registers. */
730 mdio_write(ioaddr, 0x1f, 0x0000);
731 mdio_write(ioaddr, 0x0e, 0x0000);
732 }
733
728 tp->phy_auto_nego_reg = auto_nego; 734 tp->phy_auto_nego_reg = auto_nego;
729 tp->phy_1000_ctrl_reg = giga_ctrl; 735 tp->phy_1000_ctrl_reg = giga_ctrl;
730 736
@@ -2760,14 +2766,16 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
2760 rtl8169_check_link_status(dev, tp, ioaddr); 2766 rtl8169_check_link_status(dev, tp, ioaddr);
2761 2767
2762#ifdef CONFIG_R8169_NAPI 2768#ifdef CONFIG_R8169_NAPI
2763 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event); 2769 if (status & tp->napi_event) {
2764 tp->intr_mask = ~tp->napi_event; 2770 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
2765 2771 tp->intr_mask = ~tp->napi_event;
2766 if (likely(netif_rx_schedule_prep(dev))) 2772
2767 __netif_rx_schedule(dev); 2773 if (likely(netif_rx_schedule_prep(dev)))
2768 else if (netif_msg_intr(tp)) { 2774 __netif_rx_schedule(dev);
2769 printk(KERN_INFO "%s: interrupt %04x taken in poll\n", 2775 else if (netif_msg_intr(tp)) {
2770 dev->name, status); 2776 printk(KERN_INFO "%s: interrupt %04x in poll\n",
2777 dev->name, status);
2778 }
2771 } 2779 }
2772 break; 2780 break;
2773#else 2781#else
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index ec2ad9f0efa2..d470b19c0810 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1593,6 +1593,9 @@ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
1593 pci_name(pdev)); 1593 pci_name(pdev));
1594 1594
1595 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL); 1595 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
1596 if (!isa_bridge)
1597 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
1598
1596 if (!isa_bridge) { 1599 if (!isa_bridge) {
1597 net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n", 1600 net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
1598 pci_name(pdev)); 1601 pci_name(pdev));
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index f8429449dc1e..6ff3a1627af8 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -299,7 +299,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
299 299
300#define SMC_CAN_USE_8BIT 1 300#define SMC_CAN_USE_8BIT 1
301#define SMC_CAN_USE_16BIT 1 301#define SMC_CAN_USE_16BIT 1
302#define SMC_CAN_USE_32BIT 1 302#define SMC_CAN_USE_32BIT 0
303 303
304#define SMC_inb(a, r) inb((a) + (r)) 304#define SMC_inb(a, r) inb((a) + (r))
305#define SMC_inw(a, r) inw((a) + (r)) 305#define SMC_inw(a, r) inw((a) + (r))
@@ -310,8 +310,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
310 310
311#endif /* BOARDS */ 311#endif /* BOARDS */
312 312
313#define set_irq_type(irq, type) do {} while (0)
314
315#elif defined(CONFIG_M32R) 313#elif defined(CONFIG_M32R)
316 314
317#define SMC_CAN_USE_8BIT 0 315#define SMC_CAN_USE_8BIT 0
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index a8994c7b8583..64bef7c12365 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -379,7 +379,6 @@ static const struct ethtool_ops uec_ethtool_ops = {
379 .get_stats_count = uec_get_stats_count, 379 .get_stats_count = uec_get_stats_count,
380 .get_strings = uec_get_strings, 380 .get_strings = uec_get_strings,
381 .get_ethtool_stats = uec_get_ethtool_stats, 381 .get_ethtool_stats = uec_get_ethtool_stats,
382 .get_perm_addr = ethtool_op_get_perm_addr,
383}; 382};
384 383
385void uec_set_ethtool_ops(struct net_device *netdev) 384void uec_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 5f8c2d30a328..6c257b88ce51 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -272,7 +272,8 @@ int __init uec_mdio_init(void)
272 return of_register_platform_driver(&uec_mdio_driver); 272 return of_register_platform_driver(&uec_mdio_driver);
273} 273}
274 274
275void __exit uec_mdio_exit(void) 275/* called from __init ucc_geth_init, therefore can not be __exit */
276void uec_mdio_exit(void)
276{ 277{
277 of_unregister_platform_driver(&uec_mdio_driver); 278 of_unregister_platform_driver(&uec_mdio_driver);
278} 279}
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index d779199c30d0..b37f1e348700 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -1638,7 +1638,7 @@ void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
1638 return; 1638 return;
1639 } 1639 }
1640 1640
1641 if (phy->analog == 1) { 1641 if (phy->analog > 1) {
1642 value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C; 1642 value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C;
1643 value |= (baseband_attenuation << 2) & 0x003C; 1643 value |= (baseband_attenuation << 2) & 0x003C;
1644 } else { 1644 } else {
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index cea85894b7f2..e61c6d5ba1a9 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -466,7 +466,7 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
466 return -EOPNOTSUPP; 466 return -EOPNOTSUPP;
467 } 467 }
468 468
469 priv->hwaddr = conf->mac_addr; 469 priv->hwaddr = conf->mac_addr ? conf->mac_addr : dev->wiphy->perm_addr;
470 470
471 return 0; 471 return 0;
472} 472}
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index f6c487aa8246..26869d107e52 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -822,7 +822,7 @@ static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
822 cs->control |= ZD_CS_MULTICAST; 822 cs->control |= ZD_CS_MULTICAST;
823 823
824 /* PS-POLL */ 824 /* PS-POLL */
825 if (stype == IEEE80211_STYPE_PSPOLL) 825 if (ftype == IEEE80211_FTYPE_CTL && stype == IEEE80211_STYPE_PSPOLL)
826 cs->control |= ZD_CS_PS_POLL_FRAME; 826 cs->control |= ZD_CS_PS_POLL_FRAME;
827 827
828 /* Unicast data frames over the threshold should have RTS */ 828 /* Unicast data frames over the threshold should have RTS */
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 2bc1428d621c..a6c9078af124 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -3161,12 +3161,9 @@ COMPATIBLE_IOCTL(SIOCSIWSENS)
3161COMPATIBLE_IOCTL(SIOCGIWSENS) 3161COMPATIBLE_IOCTL(SIOCGIWSENS)
3162COMPATIBLE_IOCTL(SIOCSIWRANGE) 3162COMPATIBLE_IOCTL(SIOCSIWRANGE)
3163COMPATIBLE_IOCTL(SIOCSIWPRIV) 3163COMPATIBLE_IOCTL(SIOCSIWPRIV)
3164COMPATIBLE_IOCTL(SIOCGIWPRIV)
3165COMPATIBLE_IOCTL(SIOCSIWSTATS) 3164COMPATIBLE_IOCTL(SIOCSIWSTATS)
3166COMPATIBLE_IOCTL(SIOCGIWSTATS)
3167COMPATIBLE_IOCTL(SIOCSIWAP) 3165COMPATIBLE_IOCTL(SIOCSIWAP)
3168COMPATIBLE_IOCTL(SIOCGIWAP) 3166COMPATIBLE_IOCTL(SIOCGIWAP)
3169COMPATIBLE_IOCTL(SIOCSIWSCAN)
3170COMPATIBLE_IOCTL(SIOCSIWRATE) 3167COMPATIBLE_IOCTL(SIOCSIWRATE)
3171COMPATIBLE_IOCTL(SIOCGIWRATE) 3168COMPATIBLE_IOCTL(SIOCGIWRATE)
3172COMPATIBLE_IOCTL(SIOCSIWRTS) 3169COMPATIBLE_IOCTL(SIOCSIWRTS)
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index a777d3761416..3401293359e8 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1992,19 +1992,19 @@ int __audit_signal_info(int sig, struct task_struct *t)
1992 extern uid_t audit_sig_uid; 1992 extern uid_t audit_sig_uid;
1993 extern u32 audit_sig_sid; 1993 extern u32 audit_sig_sid;
1994 1994
1995 if (audit_pid && t->tgid == audit_pid && 1995 if (audit_pid && t->tgid == audit_pid) {
1996 (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1)) { 1996 if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1) {
1997 audit_sig_pid = tsk->pid; 1997 audit_sig_pid = tsk->pid;
1998 if (ctx) 1998 if (ctx)
1999 audit_sig_uid = ctx->loginuid; 1999 audit_sig_uid = ctx->loginuid;
2000 else 2000 else
2001 audit_sig_uid = tsk->uid; 2001 audit_sig_uid = tsk->uid;
2002 selinux_get_task_sid(tsk, &audit_sig_sid); 2002 selinux_get_task_sid(tsk, &audit_sig_sid);
2003 }
2004 if (!audit_signals || audit_dummy_context())
2005 return 0;
2003 } 2006 }
2004 2007
2005 if (!audit_signals) /* audit_context checked in wrapper */
2006 return 0;
2007
2008 /* optimize the common case by putting first signal recipient directly 2008 /* optimize the common case by putting first signal recipient directly
2009 * in audit_context */ 2009 * in audit_context */
2010 if (!ctx->target_pid) { 2010 if (!ctx->target_pid) {
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
index c38272746887..5bfeaed7e487 100644
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -62,15 +62,6 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq)
62 */ 62 */
63 desc->chip->enable(irq); 63 desc->chip->enable(irq);
64 64
65 /*
66 * Temporary hack to figure out more about the problem, which
67 * is causing the ancient network cards to die.
68 */
69 if (desc->handle_irq != handle_edge_irq) {
70 WARN_ON_ONCE(1);
71 return;
72 }
73
74 if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { 65 if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
75 desc->status = (status & ~IRQ_PENDING) | IRQ_REPLAY; 66 desc->status = (status & ~IRQ_PENDING) | IRQ_REPLAY;
76 67
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index f13937bf9e8c..d054e9224b3e 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -74,8 +74,8 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
74 struct ieee80211softmac_auth_queue_item *authptr; 74 struct ieee80211softmac_auth_queue_item *authptr;
75 int length = 0; 75 int length = 0;
76 76
77check_assoc_again:
77 mutex_lock(&sm->associnfo.mutex); 78 mutex_lock(&sm->associnfo.mutex);
78
79 /* Check if we're already associating to this or another network 79 /* Check if we're already associating to this or another network
80 * If it's another network, cancel and start over with our new network 80 * If it's another network, cancel and start over with our new network
81 * If it's our network, ignore the change, we're already doing it! 81 * If it's our network, ignore the change, we're already doing it!
@@ -98,13 +98,18 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
98 cancel_delayed_work(&authptr->work); 98 cancel_delayed_work(&authptr->work);
99 sm->associnfo.bssvalid = 0; 99 sm->associnfo.bssvalid = 0;
100 sm->associnfo.bssfixed = 0; 100 sm->associnfo.bssfixed = 0;
101 flush_scheduled_work();
102 sm->associnfo.associating = 0; 101 sm->associnfo.associating = 0;
103 sm->associnfo.associated = 0; 102 sm->associnfo.associated = 0;
103 /* We must unlock to avoid deadlocks with the assoc workqueue
104 * on the associnfo.mutex */
105 mutex_unlock(&sm->associnfo.mutex);
106 flush_scheduled_work();
107 /* Avoid race! Check assoc status again. Maybe someone started an
108 * association while we flushed. */
109 goto check_assoc_again;
104 } 110 }
105 } 111 }
106 112
107
108 sm->associnfo.static_essid = 0; 113 sm->associnfo.static_essid = 0;
109 sm->associnfo.assoc_wait = 0; 114 sm->associnfo.assoc_wait = 0;
110 115