1 |
Author: mpagano |
2 |
Date: 2013-01-29 00:51:38 +0000 (Tue, 29 Jan 2013) |
3 |
New Revision: 2267 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/3.0/1057_linux-3.0.58.patch |
7 |
genpatches-2.6/trunk/3.0/1058_linux-3.0.59.patch |
8 |
genpatches-2.6/trunk/3.0/1059_linux-3.0.60.patch |
9 |
genpatches-2.6/trunk/3.0/1060_linux-3.0.61.patch |
10 |
Modified: |
11 |
genpatches-2.6/trunk/3.0/0000_README |
12 |
Log: |
13 |
Linux patches 3.0.58, 3.0.59, 3.0.60 and 3.0.61 |
14 |
|
15 |
Modified: genpatches-2.6/trunk/3.0/0000_README |
16 |
=================================================================== |
17 |
--- genpatches-2.6/trunk/3.0/0000_README 2013-01-29 00:04:55 UTC (rev 2266) |
18 |
+++ genpatches-2.6/trunk/3.0/0000_README 2013-01-29 00:51:38 UTC (rev 2267) |
19 |
@@ -263,6 +263,22 @@ |
20 |
From: http://www.kernel.org |
21 |
Desc: Linux 3.0.57 |
22 |
|
23 |
+Patch: 1057_linux-3.0.58.patch |
24 |
+From: http://www.kernel.org |
25 |
+Desc: Linux 3.0.58 |
26 |
+ |
27 |
+Patch: 1058_linux-3.0.59.patch |
28 |
+From: http://www.kernel.org |
29 |
+Desc: Linux 3.0.59 |
30 |
+ |
31 |
+Patch: 1059_linux-3.0.60.patch |
32 |
+From: http://www.kernel.org |
33 |
+Desc: Linux 3.0.60 |
34 |
+ |
35 |
+Patch: 1060_linux-3.0.61.patch |
36 |
+From: http://www.kernel.org |
37 |
+Desc: Linux 3.0.61 |
38 |
+ |
39 |
Patch: 1800_fix-zcache-build.patch |
40 |
From: http://bugs.gentoo.org/show_bug.cgi?id=376325 |
41 |
Desc: Fix zcache build error |
42 |
|
43 |
Added: genpatches-2.6/trunk/3.0/1057_linux-3.0.58.patch |
44 |
=================================================================== |
45 |
--- genpatches-2.6/trunk/3.0/1057_linux-3.0.58.patch (rev 0) |
46 |
+++ genpatches-2.6/trunk/3.0/1057_linux-3.0.58.patch 2013-01-29 00:51:38 UTC (rev 2267) |
47 |
@@ -0,0 +1,1666 @@ |
48 |
+diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt |
49 |
+index 7d4ecaa..890fce9 100644 |
50 |
+--- a/Documentation/networking/ip-sysctl.txt |
51 |
++++ b/Documentation/networking/ip-sysctl.txt |
52 |
+@@ -534,6 +534,11 @@ tcp_thin_dupack - BOOLEAN |
53 |
+ Documentation/networking/tcp-thin.txt |
54 |
+ Default: 0 |
55 |
+ |
56 |
++tcp_challenge_ack_limit - INTEGER |
57 |
++ Limits number of Challenge ACK sent per second, as recommended |
58 |
++ in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks) |
59 |
++ Default: 100 |
60 |
++ |
61 |
+ UDP variables: |
62 |
+ |
63 |
+ udp_mem - vector of 3 INTEGERs: min, pressure, max |
64 |
+diff --git a/Makefile b/Makefile |
65 |
+index cc6805f..9564edf 100644 |
66 |
+--- a/Makefile |
67 |
++++ b/Makefile |
68 |
+@@ -1,6 +1,6 @@ |
69 |
+ VERSION = 3 |
70 |
+ PATCHLEVEL = 0 |
71 |
+-SUBLEVEL = 57 |
72 |
++SUBLEVEL = 58 |
73 |
+ EXTRAVERSION = |
74 |
+ NAME = Sneaky Weasel |
75 |
+ |
76 |
+diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c |
77 |
+index 40ee7e5..0951a32 100644 |
78 |
+--- a/arch/arm/kernel/swp_emulate.c |
79 |
++++ b/arch/arm/kernel/swp_emulate.c |
80 |
+@@ -108,10 +108,12 @@ static void set_segfault(struct pt_regs *regs, unsigned long addr) |
81 |
+ { |
82 |
+ siginfo_t info; |
83 |
+ |
84 |
++ down_read(¤t->mm->mmap_sem); |
85 |
+ if (find_vma(current->mm, addr) == NULL) |
86 |
+ info.si_code = SEGV_MAPERR; |
87 |
+ else |
88 |
+ info.si_code = SEGV_ACCERR; |
89 |
++ up_read(¤t->mm->mmap_sem); |
90 |
+ |
91 |
+ info.si_signo = SIGSEGV; |
92 |
+ info.si_errno = 0; |
93 |
+diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c |
94 |
+index 594d677..19d9369 100644 |
95 |
+--- a/arch/arm/mm/mmu.c |
96 |
++++ b/arch/arm/mm/mmu.c |
97 |
+@@ -467,7 +467,7 @@ static void __init build_mem_type_table(void) |
98 |
+ } |
99 |
+ |
100 |
+ for (i = 0; i < 16; i++) { |
101 |
+- unsigned long v = pgprot_val(protection_map[i]); |
102 |
++ pteval_t v = pgprot_val(protection_map[i]); |
103 |
+ protection_map[i] = __pgprot(v | user_pgprot); |
104 |
+ } |
105 |
+ |
106 |
+diff --git a/arch/cris/include/asm/io.h b/arch/cris/include/asm/io.h |
107 |
+index 32567bc..ac12ae2 100644 |
108 |
+--- a/arch/cris/include/asm/io.h |
109 |
++++ b/arch/cris/include/asm/io.h |
110 |
+@@ -133,12 +133,39 @@ static inline void writel(unsigned int b, volatile void __iomem *addr) |
111 |
+ #define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0) |
112 |
+ #define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0) |
113 |
+ #define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0) |
114 |
+-#define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1) |
115 |
+-#define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1) |
116 |
+-#define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1) |
117 |
+-#define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count) |
118 |
+-#define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count) |
119 |
+-#define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count) |
120 |
++static inline void outb(unsigned char data, unsigned int port) |
121 |
++{ |
122 |
++ if (cris_iops) |
123 |
++ cris_iops->write_io(port, (void *) &data, 1, 1); |
124 |
++} |
125 |
++static inline void outw(unsigned short data, unsigned int port) |
126 |
++{ |
127 |
++ if (cris_iops) |
128 |
++ cris_iops->write_io(port, (void *) &data, 2, 1); |
129 |
++} |
130 |
++static inline void outl(unsigned int data, unsigned int port) |
131 |
++{ |
132 |
++ if (cris_iops) |
133 |
++ cris_iops->write_io(port, (void *) &data, 4, 1); |
134 |
++} |
135 |
++static inline void outsb(unsigned int port, const void *addr, |
136 |
++ unsigned long count) |
137 |
++{ |
138 |
++ if (cris_iops) |
139 |
++ cris_iops->write_io(port, (void *)addr, 1, count); |
140 |
++} |
141 |
++static inline void outsw(unsigned int port, const void *addr, |
142 |
++ unsigned long count) |
143 |
++{ |
144 |
++ if (cris_iops) |
145 |
++ cris_iops->write_io(port, (void *)addr, 2, count); |
146 |
++} |
147 |
++static inline void outsl(unsigned int port, const void *addr, |
148 |
++ unsigned long count) |
149 |
++{ |
150 |
++ if (cris_iops) |
151 |
++ cris_iops->write_io(port, (void *)addr, 4, count); |
152 |
++} |
153 |
+ |
154 |
+ /* |
155 |
+ * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
156 |
+diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h |
157 |
+index 1770610..f368cef 100644 |
158 |
+--- a/arch/sparc/include/asm/hugetlb.h |
159 |
++++ b/arch/sparc/include/asm/hugetlb.h |
160 |
+@@ -58,14 +58,20 @@ static inline pte_t huge_pte_wrprotect(pte_t pte) |
161 |
+ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, |
162 |
+ unsigned long addr, pte_t *ptep) |
163 |
+ { |
164 |
+- ptep_set_wrprotect(mm, addr, ptep); |
165 |
++ pte_t old_pte = *ptep; |
166 |
++ set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); |
167 |
+ } |
168 |
+ |
169 |
+ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, |
170 |
+ unsigned long addr, pte_t *ptep, |
171 |
+ pte_t pte, int dirty) |
172 |
+ { |
173 |
+- return ptep_set_access_flags(vma, addr, ptep, pte, dirty); |
174 |
++ int changed = !pte_same(*ptep, pte); |
175 |
++ if (changed) { |
176 |
++ set_huge_pte_at(vma->vm_mm, addr, ptep, pte); |
177 |
++ flush_tlb_page(vma, addr); |
178 |
++ } |
179 |
++ return changed; |
180 |
+ } |
181 |
+ |
182 |
+ static inline pte_t huge_ptep_get(pte_t *ptep) |
183 |
+diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c |
184 |
+index 8115040..3f4b6da 100644 |
185 |
+--- a/arch/x86/kernel/cpu/amd.c |
186 |
++++ b/arch/x86/kernel/cpu/amd.c |
187 |
+@@ -554,6 +554,20 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) |
188 |
+ } |
189 |
+ } |
190 |
+ |
191 |
++ /* |
192 |
++ * The way access filter has a performance penalty on some workloads. |
193 |
++ * Disable it on the affected CPUs. |
194 |
++ */ |
195 |
++ if ((c->x86 == 0x15) && |
196 |
++ (c->x86_model >= 0x02) && (c->x86_model < 0x20)) { |
197 |
++ u64 val; |
198 |
++ |
199 |
++ if (!rdmsrl_safe(0xc0011021, &val) && !(val & 0x1E)) { |
200 |
++ val |= 0x1E; |
201 |
++ checking_wrmsrl(0xc0011021, val); |
202 |
++ } |
203 |
++ } |
204 |
++ |
205 |
+ cpu_detect_cache_sizes(c); |
206 |
+ |
207 |
+ /* Multi core CPU? */ |
208 |
+diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c |
209 |
+index 449c556..8cb9742 100644 |
210 |
+--- a/drivers/acpi/scan.c |
211 |
++++ b/drivers/acpi/scan.c |
212 |
+@@ -1153,7 +1153,7 @@ static void acpi_device_set_id(struct acpi_device *device) |
213 |
+ acpi_add_id(device, ACPI_DOCK_HID); |
214 |
+ else if (!acpi_ibm_smbus_match(device)) |
215 |
+ acpi_add_id(device, ACPI_SMBUS_IBM_HID); |
216 |
+- else if (!acpi_device_hid(device) && |
217 |
++ else if (list_empty(&device->pnp.ids) && |
218 |
+ ACPI_IS_ROOT_DEVICE(device->parent)) { |
219 |
+ acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */ |
220 |
+ strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME); |
221 |
+diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c |
222 |
+index d452592..adfce9f 100644 |
223 |
+--- a/drivers/atm/solos-pci.c |
224 |
++++ b/drivers/atm/solos-pci.c |
225 |
+@@ -967,10 +967,11 @@ static uint32_t fpga_tx(struct solos_card *card) |
226 |
+ for (port = 0; tx_pending; tx_pending >>= 1, port++) { |
227 |
+ if (tx_pending & 1) { |
228 |
+ struct sk_buff *oldskb = card->tx_skb[port]; |
229 |
+- if (oldskb) |
230 |
++ if (oldskb) { |
231 |
+ pci_unmap_single(card->dev, SKB_CB(oldskb)->dma_addr, |
232 |
+ oldskb->len, PCI_DMA_TODEVICE); |
233 |
+- |
234 |
++ card->tx_skb[port] = NULL; |
235 |
++ } |
236 |
+ spin_lock(&card->tx_queue_lock); |
237 |
+ skb = skb_dequeue(&card->tx_queue[port]); |
238 |
+ if (!skb) |
239 |
+diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c |
240 |
+index 305e752..85e1ad6 100644 |
241 |
+--- a/drivers/bluetooth/ath3k.c |
242 |
++++ b/drivers/bluetooth/ath3k.c |
243 |
+@@ -65,6 +65,7 @@ static struct usb_device_id ath3k_table[] = { |
244 |
+ { USB_DEVICE(0x13d3, 0x3304) }, |
245 |
+ { USB_DEVICE(0x0930, 0x0215) }, |
246 |
+ { USB_DEVICE(0x0489, 0xE03D) }, |
247 |
++ { USB_DEVICE(0x0489, 0xE027) }, |
248 |
+ |
249 |
+ /* Atheros AR9285 Malbec with sflash firmware */ |
250 |
+ { USB_DEVICE(0x03F0, 0x311D) }, |
251 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
252 |
+index 71346fe..4b764f8 100644 |
253 |
+--- a/drivers/bluetooth/btusb.c |
254 |
++++ b/drivers/bluetooth/btusb.c |
255 |
+@@ -130,6 +130,7 @@ static struct usb_device_id blacklist_table[] = { |
256 |
+ { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, |
257 |
+ { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, |
258 |
+ { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE }, |
259 |
++ { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE }, |
260 |
+ |
261 |
+ /* Atheros AR9285 Malbec with sflash firmware */ |
262 |
+ { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, |
263 |
+diff --git a/drivers/input/joystick/walkera0701.c b/drivers/input/joystick/walkera0701.c |
264 |
+index 4dfa1ee..f8f892b 100644 |
265 |
+--- a/drivers/input/joystick/walkera0701.c |
266 |
++++ b/drivers/input/joystick/walkera0701.c |
267 |
+@@ -196,6 +196,7 @@ static void walkera0701_close(struct input_dev *dev) |
268 |
+ struct walkera_dev *w = input_get_drvdata(dev); |
269 |
+ |
270 |
+ parport_disable_irq(w->parport); |
271 |
++ hrtimer_cancel(&w->timer); |
272 |
+ } |
273 |
+ |
274 |
+ static int walkera0701_connect(struct walkera_dev *w, int parport) |
275 |
+@@ -224,6 +225,9 @@ static int walkera0701_connect(struct walkera_dev *w, int parport) |
276 |
+ if (parport_claim(w->pardevice)) |
277 |
+ goto init_err1; |
278 |
+ |
279 |
++ hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); |
280 |
++ w->timer.function = timer_handler; |
281 |
++ |
282 |
+ w->input_dev = input_allocate_device(); |
283 |
+ if (!w->input_dev) |
284 |
+ goto init_err2; |
285 |
+@@ -254,8 +258,6 @@ static int walkera0701_connect(struct walkera_dev *w, int parport) |
286 |
+ if (err) |
287 |
+ goto init_err3; |
288 |
+ |
289 |
+- hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); |
290 |
+- w->timer.function = timer_handler; |
291 |
+ return 0; |
292 |
+ |
293 |
+ init_err3: |
294 |
+@@ -271,7 +273,6 @@ static int walkera0701_connect(struct walkera_dev *w, int parport) |
295 |
+ |
296 |
+ static void walkera0701_disconnect(struct walkera_dev *w) |
297 |
+ { |
298 |
+- hrtimer_cancel(&w->timer); |
299 |
+ input_unregister_device(w->input_dev); |
300 |
+ parport_release(w->pardevice); |
301 |
+ parport_unregister_device(w->pardevice); |
302 |
+diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h |
303 |
+index e01fd4c..20153fe 100644 |
304 |
+--- a/drivers/input/serio/i8042-x86ia64io.h |
305 |
++++ b/drivers/input/serio/i8042-x86ia64io.h |
306 |
+@@ -900,6 +900,7 @@ static int __init i8042_platform_init(void) |
307 |
+ int retval; |
308 |
+ |
309 |
+ #ifdef CONFIG_X86 |
310 |
++ u8 a20_on = 0xdf; |
311 |
+ /* Just return if pre-detection shows no i8042 controller exist */ |
312 |
+ if (!x86_platform.i8042_detect()) |
313 |
+ return -ENODEV; |
314 |
+@@ -939,6 +940,14 @@ static int __init i8042_platform_init(void) |
315 |
+ |
316 |
+ if (dmi_check_system(i8042_dmi_dritek_table)) |
317 |
+ i8042_dritek = true; |
318 |
++ |
319 |
++ /* |
320 |
++ * A20 was already enabled during early kernel init. But some buggy |
321 |
++ * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to |
322 |
++ * resume from S3. So we do it here and hope that nothing breaks. |
323 |
++ */ |
324 |
++ i8042_command(&a20_on, 0x10d1); |
325 |
++ i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */ |
326 |
+ #endif /* CONFIG_X86 */ |
327 |
+ |
328 |
+ return retval; |
329 |
+diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c |
330 |
+index 504e201..6f8b268 100644 |
331 |
+--- a/drivers/net/bonding/bond_main.c |
332 |
++++ b/drivers/net/bonding/bond_main.c |
333 |
+@@ -1439,6 +1439,8 @@ static void bond_compute_features(struct bonding *bond) |
334 |
+ struct net_device *bond_dev = bond->dev; |
335 |
+ u32 vlan_features = BOND_VLAN_FEATURES; |
336 |
+ unsigned short max_hard_header_len = ETH_HLEN; |
337 |
++ unsigned int gso_max_size = GSO_MAX_SIZE; |
338 |
++ u16 gso_max_segs = GSO_MAX_SEGS; |
339 |
+ int i; |
340 |
+ |
341 |
+ read_lock(&bond->lock); |
342 |
+@@ -1452,11 +1454,16 @@ static void bond_compute_features(struct bonding *bond) |
343 |
+ |
344 |
+ if (slave->dev->hard_header_len > max_hard_header_len) |
345 |
+ max_hard_header_len = slave->dev->hard_header_len; |
346 |
++ |
347 |
++ gso_max_size = min(gso_max_size, slave->dev->gso_max_size); |
348 |
++ gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs); |
349 |
+ } |
350 |
+ |
351 |
+ done: |
352 |
+ bond_dev->vlan_features = vlan_features; |
353 |
+ bond_dev->hard_header_len = max_hard_header_len; |
354 |
++ bond_dev->gso_max_segs = gso_max_segs; |
355 |
++ netif_set_gso_max_size(bond_dev, gso_max_size); |
356 |
+ |
357 |
+ read_unlock(&bond->lock); |
358 |
+ |
359 |
+diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c |
360 |
+index 0624610..8a96735 100644 |
361 |
+--- a/drivers/net/bonding/bond_sysfs.c |
362 |
++++ b/drivers/net/bonding/bond_sysfs.c |
363 |
+@@ -1524,6 +1524,7 @@ static ssize_t bonding_store_slaves_active(struct device *d, |
364 |
+ goto out; |
365 |
+ } |
366 |
+ |
367 |
++ read_lock(&bond->lock); |
368 |
+ bond_for_each_slave(bond, slave, i) { |
369 |
+ if (!bond_is_active_slave(slave)) { |
370 |
+ if (new_value) |
371 |
+@@ -1532,6 +1533,7 @@ static ssize_t bonding_store_slaves_active(struct device *d, |
372 |
+ slave->inactive = 1; |
373 |
+ } |
374 |
+ } |
375 |
++ read_unlock(&bond->lock); |
376 |
+ out: |
377 |
+ return ret; |
378 |
+ } |
379 |
+diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c |
380 |
+index d0f8c7e..cc3ea0d 100644 |
381 |
+--- a/drivers/net/can/dev.c |
382 |
++++ b/drivers/net/can/dev.c |
383 |
+@@ -557,8 +557,7 @@ void close_candev(struct net_device *dev) |
384 |
+ { |
385 |
+ struct can_priv *priv = netdev_priv(dev); |
386 |
+ |
387 |
+- if (del_timer_sync(&priv->restart_timer)) |
388 |
+- dev_put(dev); |
389 |
++ del_timer_sync(&priv->restart_timer); |
390 |
+ can_flush_echo_skb(dev); |
391 |
+ } |
392 |
+ EXPORT_SYMBOL_GPL(close_candev); |
393 |
+diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c |
394 |
+index efe05bb..ddec154 100644 |
395 |
+--- a/drivers/net/irda/sir_dev.c |
396 |
++++ b/drivers/net/irda/sir_dev.c |
397 |
+@@ -221,7 +221,7 @@ static void sirdev_config_fsm(struct work_struct *work) |
398 |
+ break; |
399 |
+ |
400 |
+ case SIRDEV_STATE_DONGLE_SPEED: |
401 |
+- if (dev->dongle_drv->reset) { |
402 |
++ if (dev->dongle_drv->set_speed) { |
403 |
+ ret = dev->dongle_drv->set_speed(dev, fsm->param); |
404 |
+ if (ret < 0) { |
405 |
+ fsm->result = ret; |
406 |
+diff --git a/drivers/net/ne.c b/drivers/net/ne.c |
407 |
+index 1063093..e8ee2bc 100644 |
408 |
+--- a/drivers/net/ne.c |
409 |
++++ b/drivers/net/ne.c |
410 |
+@@ -814,6 +814,7 @@ static int __init ne_drv_probe(struct platform_device *pdev) |
411 |
+ dev->irq = irq[this_dev]; |
412 |
+ dev->mem_end = bad[this_dev]; |
413 |
+ } |
414 |
++ SET_NETDEV_DEV(dev, &pdev->dev); |
415 |
+ err = do_ne_probe(dev); |
416 |
+ if (err) { |
417 |
+ free_netdev(dev); |
418 |
+diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c |
419 |
+index db9b212..ab43674 100644 |
420 |
+--- a/drivers/net/usb/ipheth.c |
421 |
++++ b/drivers/net/usb/ipheth.c |
422 |
+@@ -62,6 +62,7 @@ |
423 |
+ #define USB_PRODUCT_IPAD 0x129a |
424 |
+ #define USB_PRODUCT_IPHONE_4_VZW 0x129c |
425 |
+ #define USB_PRODUCT_IPHONE_4S 0x12a0 |
426 |
++#define USB_PRODUCT_IPHONE_5 0x12a8 |
427 |
+ |
428 |
+ #define IPHETH_USBINTF_CLASS 255 |
429 |
+ #define IPHETH_USBINTF_SUBCLASS 253 |
430 |
+@@ -113,6 +114,10 @@ static struct usb_device_id ipheth_table[] = { |
431 |
+ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S, |
432 |
+ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, |
433 |
+ IPHETH_USBINTF_PROTO) }, |
434 |
++ { USB_DEVICE_AND_INTERFACE_INFO( |
435 |
++ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_5, |
436 |
++ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, |
437 |
++ IPHETH_USBINTF_PROTO) }, |
438 |
+ { } |
439 |
+ }; |
440 |
+ MODULE_DEVICE_TABLE(usb, ipheth_table); |
441 |
+diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c |
442 |
+index f44f2f3..f1fa763 100644 |
443 |
+--- a/drivers/net/wireless/p54/p54usb.c |
444 |
++++ b/drivers/net/wireless/p54/p54usb.c |
445 |
+@@ -46,6 +46,7 @@ static struct usb_device_id p54u_table[] = { |
446 |
+ {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ |
447 |
+ {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ |
448 |
+ {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ |
449 |
++ {USB_DEVICE(0x0675, 0x0530)}, /* DrayTek Vigor 530 */ |
450 |
+ {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ |
451 |
+ {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ |
452 |
+ {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */ |
453 |
+@@ -81,6 +82,8 @@ static struct usb_device_id p54u_table[] = { |
454 |
+ {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ |
455 |
+ {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ |
456 |
+ {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ |
457 |
++ {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ |
458 |
++ {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */ |
459 |
+ {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ |
460 |
+ {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */ |
461 |
+ {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */ |
462 |
+@@ -100,6 +103,7 @@ static struct usb_device_id p54u_table[] = { |
463 |
+ {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ |
464 |
+ {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ |
465 |
+ {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ |
466 |
++ /* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */ |
467 |
+ {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ |
468 |
+ {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */ |
469 |
+ {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ |
470 |
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c |
471 |
+index a6b07dd..a9b1249 100644 |
472 |
+--- a/drivers/pci/quirks.c |
473 |
++++ b/drivers/pci/quirks.c |
474 |
+@@ -2746,7 +2746,7 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev) |
475 |
+ if (PCI_FUNC(dev->devfn)) |
476 |
+ return; |
477 |
+ /* |
478 |
+- * RICOH 0xe823 SD/MMC card reader fails to recognize |
479 |
++ * RICOH 0xe822 and 0xe823 SD/MMC card readers fail to recognize |
480 |
+ * certain types of SD/MMC cards. Lowering the SD base |
481 |
+ * clock frequency from 200Mhz to 50Mhz fixes this issue. |
482 |
+ * |
483 |
+@@ -2757,7 +2757,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev) |
484 |
+ * 0xf9 - Key register for 0x150 |
485 |
+ * 0xfc - key register for 0xe1 |
486 |
+ */ |
487 |
+- if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) { |
488 |
++ if (dev->device == PCI_DEVICE_ID_RICOH_R5CE822 || |
489 |
++ dev->device == PCI_DEVICE_ID_RICOH_R5CE823) { |
490 |
+ pci_write_config_byte(dev, 0xf9, 0xfc); |
491 |
+ pci_write_config_byte(dev, 0x150, 0x10); |
492 |
+ pci_write_config_byte(dev, 0xf9, 0x00); |
493 |
+@@ -2784,6 +2785,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev) |
494 |
+ } |
495 |
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); |
496 |
+ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); |
497 |
++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832); |
498 |
++DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832); |
499 |
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832); |
500 |
+ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832); |
501 |
+ #endif /*CONFIG_MMC_RICOH_MMC*/ |
502 |
+diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c |
503 |
+index 3f84f84..8ac530a 100644 |
504 |
+--- a/drivers/pnp/pnpacpi/core.c |
505 |
++++ b/drivers/pnp/pnpacpi/core.c |
506 |
+@@ -57,7 +57,7 @@ static inline int __init is_exclusive_device(struct acpi_device *dev) |
507 |
+ if (!(('0' <= (c) && (c) <= '9') || ('A' <= (c) && (c) <= 'F'))) \ |
508 |
+ return 0 |
509 |
+ #define TEST_ALPHA(c) \ |
510 |
+- if (!('@' <= (c) || (c) <= 'Z')) \ |
511 |
++ if (!('A' <= (c) && (c) <= 'Z')) \ |
512 |
+ return 0 |
513 |
+ static int __init ispnpidacpi(const char *id) |
514 |
+ { |
515 |
+diff --git a/drivers/rtc/rtc-vt8500.c b/drivers/rtc/rtc-vt8500.c |
516 |
+index efd6066..8a16f2c 100644 |
517 |
+--- a/drivers/rtc/rtc-vt8500.c |
518 |
++++ b/drivers/rtc/rtc-vt8500.c |
519 |
+@@ -69,7 +69,7 @@ |
520 |
+ | ALARM_SEC_BIT) |
521 |
+ |
522 |
+ #define VT8500_RTC_CR_ENABLE (1 << 0) /* Enable RTC */ |
523 |
+-#define VT8500_RTC_CR_24H (1 << 1) /* 24h time format */ |
524 |
++#define VT8500_RTC_CR_12H (1 << 1) /* 12h time format */ |
525 |
+ #define VT8500_RTC_CR_SM_ENABLE (1 << 2) /* Enable periodic irqs */ |
526 |
+ #define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */ |
527 |
+ #define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */ |
528 |
+@@ -116,7 +116,7 @@ static int vt8500_rtc_read_time(struct device *dev, struct rtc_time *tm) |
529 |
+ tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S); |
530 |
+ tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S); |
531 |
+ tm->tm_mday = bcd2bin(date & DATE_DAY_MASK); |
532 |
+- tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S); |
533 |
++ tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S) - 1; |
534 |
+ tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S) |
535 |
+ + ((date >> DATE_CENTURY_S) & 1 ? 200 : 100); |
536 |
+ tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S; |
537 |
+@@ -135,8 +135,9 @@ static int vt8500_rtc_set_time(struct device *dev, struct rtc_time *tm) |
538 |
+ } |
539 |
+ |
540 |
+ writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S) |
541 |
+- | (bin2bcd(tm->tm_mon) << DATE_MONTH_S) |
542 |
+- | (bin2bcd(tm->tm_mday)), |
543 |
++ | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S) |
544 |
++ | (bin2bcd(tm->tm_mday)) |
545 |
++ | ((tm->tm_year >= 200) << DATE_CENTURY_S), |
546 |
+ vt8500_rtc->regbase + VT8500_RTC_DS); |
547 |
+ writel((bin2bcd(tm->tm_wday) << TIME_DOW_S) |
548 |
+ | (bin2bcd(tm->tm_hour) << TIME_HOUR_S) |
549 |
+@@ -246,7 +247,7 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev) |
550 |
+ } |
551 |
+ |
552 |
+ /* Enable RTC and set it to 24-hour mode */ |
553 |
+- writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H, |
554 |
++ writel(VT8500_RTC_CR_ENABLE, |
555 |
+ vt8500_rtc->regbase + VT8500_RTC_CR); |
556 |
+ |
557 |
+ vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev, |
558 |
+diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c |
559 |
+index 5e14950..459dbde 100644 |
560 |
+--- a/drivers/usb/gadget/f_phonet.c |
561 |
++++ b/drivers/usb/gadget/f_phonet.c |
562 |
+@@ -541,7 +541,7 @@ int pn_bind(struct usb_configuration *c, struct usb_function *f) |
563 |
+ |
564 |
+ req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL); |
565 |
+ if (!req) |
566 |
+- goto err; |
567 |
++ goto err_req; |
568 |
+ |
569 |
+ req->complete = pn_rx_complete; |
570 |
+ fp->out_reqv[i] = req; |
571 |
+@@ -550,14 +550,18 @@ int pn_bind(struct usb_configuration *c, struct usb_function *f) |
572 |
+ /* Outgoing USB requests */ |
573 |
+ fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL); |
574 |
+ if (!fp->in_req) |
575 |
+- goto err; |
576 |
++ goto err_req; |
577 |
+ |
578 |
+ INFO(cdev, "USB CDC Phonet function\n"); |
579 |
+ INFO(cdev, "using %s, OUT %s, IN %s\n", cdev->gadget->name, |
580 |
+ fp->out_ep->name, fp->in_ep->name); |
581 |
+ return 0; |
582 |
+ |
583 |
++err_req: |
584 |
++ for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++) |
585 |
++ usb_ep_free_request(fp->out_ep, fp->out_reqv[i]); |
586 |
+ err: |
587 |
++ |
588 |
+ if (fp->out_ep) |
589 |
+ fp->out_ep->driver_data = NULL; |
590 |
+ if (fp->in_ep) |
591 |
+diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c |
592 |
+index f768314..175c574 100644 |
593 |
+--- a/drivers/usb/host/ehci-pci.c |
594 |
++++ b/drivers/usb/host/ehci-pci.c |
595 |
+@@ -359,7 +359,8 @@ static bool usb_is_intel_switchable_ehci(struct pci_dev *pdev) |
596 |
+ pdev->vendor == PCI_VENDOR_ID_INTEL && |
597 |
+ (pdev->device == 0x1E26 || |
598 |
+ pdev->device == 0x8C2D || |
599 |
+- pdev->device == 0x8C26); |
600 |
++ pdev->device == 0x8C26 || |
601 |
++ pdev->device == 0x9C26); |
602 |
+ } |
603 |
+ |
604 |
+ static void ehci_enable_xhci_companion(void) |
605 |
+diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c |
606 |
+index 3f623fb..0f097d3 100644 |
607 |
+--- a/drivers/usb/host/pci-quirks.c |
608 |
++++ b/drivers/usb/host/pci-quirks.c |
609 |
+@@ -721,6 +721,7 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, |
610 |
+ } |
611 |
+ |
612 |
+ #define PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI 0x8C31 |
613 |
++#define PCI_DEVICE_ID_INTEL_LYNX_POINT_LP_XHCI 0x9C31 |
614 |
+ |
615 |
+ bool usb_is_intel_ppt_switchable_xhci(struct pci_dev *pdev) |
616 |
+ { |
617 |
+@@ -734,7 +735,8 @@ bool usb_is_intel_lpt_switchable_xhci(struct pci_dev *pdev) |
618 |
+ { |
619 |
+ return pdev->class == PCI_CLASS_SERIAL_USB_XHCI && |
620 |
+ pdev->vendor == PCI_VENDOR_ID_INTEL && |
621 |
+- pdev->device == PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI; |
622 |
++ (pdev->device == PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI || |
623 |
++ pdev->device == PCI_DEVICE_ID_INTEL_LYNX_POINT_LP_XHCI); |
624 |
+ } |
625 |
+ |
626 |
+ bool usb_is_intel_switchable_xhci(struct pci_dev *pdev) |
627 |
+diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c |
628 |
+index 68b9136..92bd773 100644 |
629 |
+--- a/drivers/virtio/virtio_ring.c |
630 |
++++ b/drivers/virtio/virtio_ring.c |
631 |
+@@ -120,6 +120,13 @@ static int vring_add_indirect(struct vring_virtqueue *vq, |
632 |
+ unsigned head; |
633 |
+ int i; |
634 |
+ |
635 |
++ /* |
636 |
++ * We require lowmem mappings for the descriptors because |
637 |
++ * otherwise virt_to_phys will give us bogus addresses in the |
638 |
++ * virtqueue. |
639 |
++ */ |
640 |
++ gfp &= ~(__GFP_HIGHMEM | __GFP_HIGH); |
641 |
++ |
642 |
+ desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp); |
643 |
+ if (!desc) |
644 |
+ return -ENOMEM; |
645 |
+diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c |
646 |
+index 1befe2e..5463952 100644 |
647 |
+--- a/fs/binfmt_misc.c |
648 |
++++ b/fs/binfmt_misc.c |
649 |
+@@ -176,7 +176,10 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) |
650 |
+ goto _error; |
651 |
+ bprm->argc ++; |
652 |
+ |
653 |
+- bprm->interp = iname; /* for binfmt_script */ |
654 |
++ /* Update interp in case binfmt_script needs it. */ |
655 |
++ retval = bprm_change_interp(iname, bprm); |
656 |
++ if (retval < 0) |
657 |
++ goto _error; |
658 |
+ |
659 |
+ interp_file = open_exec (iname); |
660 |
+ retval = PTR_ERR (interp_file); |
661 |
+diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c |
662 |
+index 396a988..e39c18a 100644 |
663 |
+--- a/fs/binfmt_script.c |
664 |
++++ b/fs/binfmt_script.c |
665 |
+@@ -82,7 +82,9 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) |
666 |
+ retval = copy_strings_kernel(1, &i_name, bprm); |
667 |
+ if (retval) return retval; |
668 |
+ bprm->argc++; |
669 |
+- bprm->interp = interp; |
670 |
++ retval = bprm_change_interp(interp, bprm); |
671 |
++ if (retval < 0) |
672 |
++ return retval; |
673 |
+ |
674 |
+ /* |
675 |
+ * OK, now restart the process with the interpreter's dentry. |
676 |
+diff --git a/fs/exec.c b/fs/exec.c |
677 |
+index 044c13f..08f3e4e 100644 |
678 |
+--- a/fs/exec.c |
679 |
++++ b/fs/exec.c |
680 |
+@@ -1192,9 +1192,24 @@ void free_bprm(struct linux_binprm *bprm) |
681 |
+ mutex_unlock(¤t->signal->cred_guard_mutex); |
682 |
+ abort_creds(bprm->cred); |
683 |
+ } |
684 |
++ /* If a binfmt changed the interp, free it. */ |
685 |
++ if (bprm->interp != bprm->filename) |
686 |
++ kfree(bprm->interp); |
687 |
+ kfree(bprm); |
688 |
+ } |
689 |
+ |
690 |
++int bprm_change_interp(char *interp, struct linux_binprm *bprm) |
691 |
++{ |
692 |
++ /* If a binfmt changed the interp, free it first. */ |
693 |
++ if (bprm->interp != bprm->filename) |
694 |
++ kfree(bprm->interp); |
695 |
++ bprm->interp = kstrdup(interp, GFP_KERNEL); |
696 |
++ if (!bprm->interp) |
697 |
++ return -ENOMEM; |
698 |
++ return 0; |
699 |
++} |
700 |
++EXPORT_SYMBOL(bprm_change_interp); |
701 |
++ |
702 |
+ /* |
703 |
+ * install the new credentials for this executable |
704 |
+ */ |
705 |
+diff --git a/fs/nfs/client.c b/fs/nfs/client.c |
706 |
+index b3dc2b8..0cb731f 100644 |
707 |
+--- a/fs/nfs/client.c |
708 |
++++ b/fs/nfs/client.c |
709 |
+@@ -673,8 +673,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp, |
710 |
+ */ |
711 |
+ static void nfs_destroy_server(struct nfs_server *server) |
712 |
+ { |
713 |
+- if (!(server->flags & NFS_MOUNT_LOCAL_FLOCK) || |
714 |
+- !(server->flags & NFS_MOUNT_LOCAL_FCNTL)) |
715 |
++ if (server->nlm_host) |
716 |
+ nlmclnt_done(server->nlm_host); |
717 |
+ } |
718 |
+ |
719 |
+diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c |
720 |
+index 9515bc5..4033264 100644 |
721 |
+--- a/fs/nfs/dir.c |
722 |
++++ b/fs/nfs/dir.c |
723 |
+@@ -1216,11 +1216,14 @@ static int nfs_dentry_delete(const struct dentry *dentry) |
724 |
+ |
725 |
+ } |
726 |
+ |
727 |
++/* Ensure that we revalidate inode->i_nlink */ |
728 |
+ static void nfs_drop_nlink(struct inode *inode) |
729 |
+ { |
730 |
+ spin_lock(&inode->i_lock); |
731 |
+- if (inode->i_nlink > 0) |
732 |
+- drop_nlink(inode); |
733 |
++ /* drop the inode if we're reasonably sure this is the last link */ |
734 |
++ if (inode->i_nlink == 1) |
735 |
++ clear_nlink(inode); |
736 |
++ NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR; |
737 |
+ spin_unlock(&inode->i_lock); |
738 |
+ } |
739 |
+ |
740 |
+@@ -1235,8 +1238,8 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode) |
741 |
+ NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA; |
742 |
+ |
743 |
+ if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { |
744 |
+- drop_nlink(inode); |
745 |
+ nfs_complete_unlink(dentry, inode); |
746 |
++ nfs_drop_nlink(inode); |
747 |
+ } |
748 |
+ iput(inode); |
749 |
+ } |
750 |
+@@ -1788,10 +1791,8 @@ static int nfs_safe_remove(struct dentry *dentry) |
751 |
+ if (inode != NULL) { |
752 |
+ nfs_inode_return_delegation(inode); |
753 |
+ error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); |
754 |
+- /* The VFS may want to delete this inode */ |
755 |
+ if (error == 0) |
756 |
+ nfs_drop_nlink(inode); |
757 |
+- nfs_mark_for_revalidate(inode); |
758 |
+ } else |
759 |
+ error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); |
760 |
+ if (error == -ENOENT) |
761 |
+diff --git a/fs/nfs/super.c b/fs/nfs/super.c |
762 |
+index 23f0223..a5b2419 100644 |
763 |
+--- a/fs/nfs/super.c |
764 |
++++ b/fs/nfs/super.c |
765 |
+@@ -1052,7 +1052,7 @@ static int nfs_get_option_str(substring_t args[], char **option) |
766 |
+ { |
767 |
+ kfree(*option); |
768 |
+ *option = match_strdup(args); |
769 |
+- return !option; |
770 |
++ return !*option; |
771 |
+ } |
772 |
+ |
773 |
+ static int nfs_get_option_ul(substring_t args[], unsigned long *option) |
774 |
+diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c |
775 |
+index f91d589..ecdd18a 100644 |
776 |
+--- a/fs/nfsd/nfs4xdr.c |
777 |
++++ b/fs/nfsd/nfs4xdr.c |
778 |
+@@ -2682,11 +2682,16 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, |
779 |
+ len = maxcount; |
780 |
+ v = 0; |
781 |
+ while (len > 0) { |
782 |
+- pn = resp->rqstp->rq_resused++; |
783 |
++ pn = resp->rqstp->rq_resused; |
784 |
++ if (!resp->rqstp->rq_respages[pn]) { /* ran out of pages */ |
785 |
++ maxcount -= len; |
786 |
++ break; |
787 |
++ } |
788 |
+ resp->rqstp->rq_vec[v].iov_base = |
789 |
+ page_address(resp->rqstp->rq_respages[pn]); |
790 |
+ resp->rqstp->rq_vec[v].iov_len = |
791 |
+ len < PAGE_SIZE ? len : PAGE_SIZE; |
792 |
++ resp->rqstp->rq_resused++; |
793 |
+ v++; |
794 |
+ len -= PAGE_SIZE; |
795 |
+ } |
796 |
+@@ -2734,6 +2739,8 @@ nfsd4_encode_readlink(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd |
797 |
+ return nfserr; |
798 |
+ if (resp->xbuf->page_len) |
799 |
+ return nfserr_resource; |
800 |
++ if (!resp->rqstp->rq_respages[resp->rqstp->rq_resused]) |
801 |
++ return nfserr_resource; |
802 |
+ |
803 |
+ page = page_address(resp->rqstp->rq_respages[resp->rqstp->rq_resused++]); |
804 |
+ |
805 |
+@@ -2783,6 +2790,8 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4 |
806 |
+ return nfserr; |
807 |
+ if (resp->xbuf->page_len) |
808 |
+ return nfserr_resource; |
809 |
++ if (!resp->rqstp->rq_respages[resp->rqstp->rq_resused]) |
810 |
++ return nfserr_resource; |
811 |
+ |
812 |
+ RESERVE_SPACE(8); /* verifier */ |
813 |
+ savep = p; |
814 |
+diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h |
815 |
+index e58fa77..34e0274 100644 |
816 |
+--- a/include/asm-generic/tlb.h |
817 |
++++ b/include/asm-generic/tlb.h |
818 |
+@@ -78,6 +78,14 @@ struct mmu_gather_batch { |
819 |
+ #define MAX_GATHER_BATCH \ |
820 |
+ ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *)) |
821 |
+ |
822 |
++/* |
823 |
++ * Limit the maximum number of mmu_gather batches to reduce a risk of soft |
824 |
++ * lockups for non-preemptible kernels on huge machines when a lot of memory |
825 |
++ * is zapped during unmapping. |
826 |
++ * 10K pages freed at once should be safe even without a preemption point. |
827 |
++ */ |
828 |
++#define MAX_GATHER_BATCH_COUNT (10000UL/MAX_GATHER_BATCH) |
829 |
++ |
830 |
+ /* struct mmu_gather is an opaque type used by the mm code for passing around |
831 |
+ * any data needed by arch specific code for tlb_remove_page. |
832 |
+ */ |
833 |
+@@ -94,6 +102,7 @@ struct mmu_gather { |
834 |
+ struct mmu_gather_batch *active; |
835 |
+ struct mmu_gather_batch local; |
836 |
+ struct page *__pages[MMU_GATHER_BUNDLE]; |
837 |
++ unsigned int batch_count; |
838 |
+ }; |
839 |
+ |
840 |
+ #define HAVE_GENERIC_MMU_GATHER |
841 |
+diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h |
842 |
+index 8845613..384e37f 100644 |
843 |
+--- a/include/linux/binfmts.h |
844 |
++++ b/include/linux/binfmts.h |
845 |
+@@ -126,6 +126,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm, |
846 |
+ unsigned long stack_top, |
847 |
+ int executable_stack); |
848 |
+ extern int bprm_mm_init(struct linux_binprm *bprm); |
849 |
++extern int bprm_change_interp(char *interp, struct linux_binprm *bprm); |
850 |
+ extern int copy_strings_kernel(int argc, const char *const *argv, |
851 |
+ struct linux_binprm *bprm); |
852 |
+ extern int prepare_bprm_creds(struct linux_binprm *bprm); |
853 |
+diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h |
854 |
+index 59e4028..3fd17c2 100644 |
855 |
+--- a/include/linux/compiler-gcc.h |
856 |
++++ b/include/linux/compiler-gcc.h |
857 |
+@@ -50,6 +50,11 @@ |
858 |
+ # define inline inline __attribute__((always_inline)) |
859 |
+ # define __inline__ __inline__ __attribute__((always_inline)) |
860 |
+ # define __inline __inline __attribute__((always_inline)) |
861 |
++#else |
862 |
++/* A lot of inline functions can cause havoc with function tracing */ |
863 |
++# define inline inline notrace |
864 |
++# define __inline__ __inline__ notrace |
865 |
++# define __inline __inline notrace |
866 |
+ #endif |
867 |
+ |
868 |
+ #define __deprecated __attribute__((deprecated)) |
869 |
+diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h |
870 |
+index 6081493..cfd7702 100644 |
871 |
+--- a/include/linux/page-flags.h |
872 |
++++ b/include/linux/page-flags.h |
873 |
+@@ -365,7 +365,7 @@ static inline void ClearPageCompound(struct page *page) |
874 |
+ * pages on the LRU and/or pagecache. |
875 |
+ */ |
876 |
+ TESTPAGEFLAG(Compound, compound) |
877 |
+-__PAGEFLAG(Head, compound) |
878 |
++__SETPAGEFLAG(Head, compound) __CLEARPAGEFLAG(Head, compound) |
879 |
+ |
880 |
+ /* |
881 |
+ * PG_reclaim is used in combination with PG_compound to mark the |
882 |
+@@ -377,8 +377,14 @@ __PAGEFLAG(Head, compound) |
883 |
+ * PG_compound & PG_reclaim => Tail page |
884 |
+ * PG_compound & ~PG_reclaim => Head page |
885 |
+ */ |
886 |
++#define PG_head_mask ((1L << PG_compound)) |
887 |
+ #define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim)) |
888 |
+ |
889 |
++static inline int PageHead(struct page *page) |
890 |
++{ |
891 |
++ return ((page->flags & PG_head_tail_mask) == PG_head_mask); |
892 |
++} |
893 |
++ |
894 |
+ static inline int PageTail(struct page *page) |
895 |
+ { |
896 |
+ return ((page->flags & PG_head_tail_mask) == PG_head_tail_mask); |
897 |
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h |
898 |
+index 864daf3..f269c03 100644 |
899 |
+--- a/include/linux/pci_ids.h |
900 |
++++ b/include/linux/pci_ids.h |
901 |
+@@ -1537,6 +1537,7 @@ |
902 |
+ #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 |
903 |
+ #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 |
904 |
+ #define PCI_DEVICE_ID_RICOH_R5C822 0x0822 |
905 |
++#define PCI_DEVICE_ID_RICOH_R5CE822 0xe822 |
906 |
+ #define PCI_DEVICE_ID_RICOH_R5CE823 0xe823 |
907 |
+ #define PCI_DEVICE_ID_RICOH_R5C832 0x0832 |
908 |
+ #define PCI_DEVICE_ID_RICOH_R5C843 0x0843 |
909 |
+diff --git a/include/linux/snmp.h b/include/linux/snmp.h |
910 |
+index 12b2b18..10360c7 100644 |
911 |
+--- a/include/linux/snmp.h |
912 |
++++ b/include/linux/snmp.h |
913 |
+@@ -209,7 +209,6 @@ enum |
914 |
+ LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */ |
915 |
+ LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */ |
916 |
+ LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */ |
917 |
+- LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */ |
918 |
+ LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */ |
919 |
+ LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */ |
920 |
+ LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */ |
921 |
+@@ -231,6 +230,8 @@ enum |
922 |
+ LINUX_MIB_TCPDEFERACCEPTDROP, |
923 |
+ LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ |
924 |
+ LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ |
925 |
++ LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */ |
926 |
++ LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */ |
927 |
+ __LINUX_MIB_MAX |
928 |
+ }; |
929 |
+ |
930 |
+diff --git a/include/net/tcp.h b/include/net/tcp.h |
931 |
+index cda30ea..b28a49f 100644 |
932 |
+--- a/include/net/tcp.h |
933 |
++++ b/include/net/tcp.h |
934 |
+@@ -246,6 +246,7 @@ extern int sysctl_tcp_max_ssthresh; |
935 |
+ extern int sysctl_tcp_cookie_size; |
936 |
+ extern int sysctl_tcp_thin_linear_timeouts; |
937 |
+ extern int sysctl_tcp_thin_dupack; |
938 |
++extern int sysctl_tcp_challenge_ack_limit; |
939 |
+ |
940 |
+ extern atomic_long_t tcp_memory_allocated; |
941 |
+ extern struct percpu_counter tcp_sockets_allocated; |
942 |
+diff --git a/kernel/cgroup.c b/kernel/cgroup.c |
943 |
+index 69158d5..1749dcd 100644 |
944 |
+--- a/kernel/cgroup.c |
945 |
++++ b/kernel/cgroup.c |
946 |
+@@ -2630,9 +2630,7 @@ static int cgroup_create_dir(struct cgroup *cgrp, struct dentry *dentry, |
947 |
+ dentry->d_fsdata = cgrp; |
948 |
+ inc_nlink(parent->d_inode); |
949 |
+ rcu_assign_pointer(cgrp->dentry, dentry); |
950 |
+- dget(dentry); |
951 |
+ } |
952 |
+- dput(dentry); |
953 |
+ |
954 |
+ return error; |
955 |
+ } |
956 |
+diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c |
957 |
+index fa4a70e..3e1bdf9 100644 |
958 |
+--- a/kernel/irq/manage.c |
959 |
++++ b/kernel/irq/manage.c |
960 |
+@@ -698,6 +698,7 @@ static void |
961 |
+ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) |
962 |
+ { |
963 |
+ cpumask_var_t mask; |
964 |
++ bool valid = true; |
965 |
+ |
966 |
+ if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags)) |
967 |
+ return; |
968 |
+@@ -712,10 +713,18 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) |
969 |
+ } |
970 |
+ |
971 |
+ raw_spin_lock_irq(&desc->lock); |
972 |
+- cpumask_copy(mask, desc->irq_data.affinity); |
973 |
++ /* |
974 |
++ * This code is triggered unconditionally. Check the affinity |
975 |
++ * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out. |
976 |
++ */ |
977 |
++ if (desc->irq_data.affinity) |
978 |
++ cpumask_copy(mask, desc->irq_data.affinity); |
979 |
++ else |
980 |
++ valid = false; |
981 |
+ raw_spin_unlock_irq(&desc->lock); |
982 |
+ |
983 |
+- set_cpus_allowed_ptr(current, mask); |
984 |
++ if (valid) |
985 |
++ set_cpus_allowed_ptr(current, mask); |
986 |
+ free_cpumask_var(mask); |
987 |
+ } |
988 |
+ #else |
989 |
+@@ -925,6 +934,16 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) |
990 |
+ */ |
991 |
+ get_task_struct(t); |
992 |
+ new->thread = t; |
993 |
++ /* |
994 |
++ * Tell the thread to set its affinity. This is |
995 |
++ * important for shared interrupt handlers as we do |
996 |
++ * not invoke setup_affinity() for the secondary |
997 |
++ * handlers as everything is already set up. Even for |
998 |
++ * interrupts marked with IRQF_NO_BALANCE this is |
999 |
++ * correct as we want the thread to move to the cpu(s) |
1000 |
++ * on which the requesting code placed the interrupt. |
1001 |
++ */ |
1002 |
++ set_bit(IRQTF_AFFINITY, &new->thread_flags); |
1003 |
+ } |
1004 |
+ |
1005 |
+ if (!alloc_cpumask_var(&mask, GFP_KERNEL)) { |
1006 |
+diff --git a/mm/memory.c b/mm/memory.c |
1007 |
+index d49b58a..7292acb 100644 |
1008 |
+--- a/mm/memory.c |
1009 |
++++ b/mm/memory.c |
1010 |
+@@ -205,10 +205,14 @@ static int tlb_next_batch(struct mmu_gather *tlb) |
1011 |
+ return 1; |
1012 |
+ } |
1013 |
+ |
1014 |
++ if (tlb->batch_count == MAX_GATHER_BATCH_COUNT) |
1015 |
++ return 0; |
1016 |
++ |
1017 |
+ batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); |
1018 |
+ if (!batch) |
1019 |
+ return 0; |
1020 |
+ |
1021 |
++ tlb->batch_count++; |
1022 |
+ batch->next = NULL; |
1023 |
+ batch->nr = 0; |
1024 |
+ batch->max = MAX_GATHER_BATCH; |
1025 |
+@@ -235,6 +239,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm) |
1026 |
+ tlb->local.nr = 0; |
1027 |
+ tlb->local.max = ARRAY_SIZE(tlb->__pages); |
1028 |
+ tlb->active = &tlb->local; |
1029 |
++ tlb->batch_count = 0; |
1030 |
+ |
1031 |
+ #ifdef CONFIG_HAVE_RCU_TABLE_FREE |
1032 |
+ tlb->batch = NULL; |
1033 |
+diff --git a/mm/mempolicy.c b/mm/mempolicy.c |
1034 |
+index 04282ba..0367beb 100644 |
1035 |
+--- a/mm/mempolicy.c |
1036 |
++++ b/mm/mempolicy.c |
1037 |
+@@ -2308,8 +2308,7 @@ void numa_default_policy(void) |
1038 |
+ */ |
1039 |
+ |
1040 |
+ /* |
1041 |
+- * "local" is pseudo-policy: MPOL_PREFERRED with MPOL_F_LOCAL flag |
1042 |
+- * Used only for mpol_parse_str() and mpol_to_str() |
1043 |
++ * "local" is implemented internally by MPOL_PREFERRED with MPOL_F_LOCAL flag. |
1044 |
+ */ |
1045 |
+ #define MPOL_LOCAL MPOL_MAX |
1046 |
+ static const char * const policy_modes[] = |
1047 |
+@@ -2324,28 +2323,21 @@ static const char * const policy_modes[] = |
1048 |
+ |
1049 |
+ #ifdef CONFIG_TMPFS |
1050 |
+ /** |
1051 |
+- * mpol_parse_str - parse string to mempolicy |
1052 |
++ * mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option. |
1053 |
+ * @str: string containing mempolicy to parse |
1054 |
+ * @mpol: pointer to struct mempolicy pointer, returned on success. |
1055 |
+- * @no_context: flag whether to "contextualize" the mempolicy |
1056 |
++ * @unused: redundant argument, to be removed later. |
1057 |
+ * |
1058 |
+ * Format of input: |
1059 |
+ * <mode>[=<flags>][:<nodelist>] |
1060 |
+ * |
1061 |
+- * if @no_context is true, save the input nodemask in w.user_nodemask in |
1062 |
+- * the returned mempolicy. This will be used to "clone" the mempolicy in |
1063 |
+- * a specific context [cpuset] at a later time. Used to parse tmpfs mpol |
1064 |
+- * mount option. Note that if 'static' or 'relative' mode flags were |
1065 |
+- * specified, the input nodemask will already have been saved. Saving |
1066 |
+- * it again is redundant, but safe. |
1067 |
+- * |
1068 |
+ * On success, returns 0, else 1 |
1069 |
+ */ |
1070 |
+-int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) |
1071 |
++int mpol_parse_str(char *str, struct mempolicy **mpol, int unused) |
1072 |
+ { |
1073 |
+ struct mempolicy *new = NULL; |
1074 |
+ unsigned short mode; |
1075 |
+- unsigned short uninitialized_var(mode_flags); |
1076 |
++ unsigned short mode_flags; |
1077 |
+ nodemask_t nodes; |
1078 |
+ char *nodelist = strchr(str, ':'); |
1079 |
+ char *flags = strchr(str, '='); |
1080 |
+@@ -2433,24 +2425,23 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) |
1081 |
+ if (IS_ERR(new)) |
1082 |
+ goto out; |
1083 |
+ |
1084 |
+- if (no_context) { |
1085 |
+- /* save for contextualization */ |
1086 |
+- new->w.user_nodemask = nodes; |
1087 |
+- } else { |
1088 |
+- int ret; |
1089 |
+- NODEMASK_SCRATCH(scratch); |
1090 |
+- if (scratch) { |
1091 |
+- task_lock(current); |
1092 |
+- ret = mpol_set_nodemask(new, &nodes, scratch); |
1093 |
+- task_unlock(current); |
1094 |
+- } else |
1095 |
+- ret = -ENOMEM; |
1096 |
+- NODEMASK_SCRATCH_FREE(scratch); |
1097 |
+- if (ret) { |
1098 |
+- mpol_put(new); |
1099 |
+- goto out; |
1100 |
+- } |
1101 |
+- } |
1102 |
++ /* |
1103 |
++ * Save nodes for mpol_to_str() to show the tmpfs mount options |
1104 |
++ * for /proc/mounts, /proc/pid/mounts and /proc/pid/mountinfo. |
1105 |
++ */ |
1106 |
++ if (mode != MPOL_PREFERRED) |
1107 |
++ new->v.nodes = nodes; |
1108 |
++ else if (nodelist) |
1109 |
++ new->v.preferred_node = first_node(nodes); |
1110 |
++ else |
1111 |
++ new->flags |= MPOL_F_LOCAL; |
1112 |
++ |
1113 |
++ /* |
1114 |
++ * Save nodes for contextualization: this will be used to "clone" |
1115 |
++ * the mempolicy in a specific context [cpuset] at a later time. |
1116 |
++ */ |
1117 |
++ new->w.user_nodemask = nodes; |
1118 |
++ |
1119 |
+ err = 0; |
1120 |
+ |
1121 |
+ out: |
1122 |
+@@ -2470,13 +2461,13 @@ out: |
1123 |
+ * @buffer: to contain formatted mempolicy string |
1124 |
+ * @maxlen: length of @buffer |
1125 |
+ * @pol: pointer to mempolicy to be formatted |
1126 |
+- * @no_context: "context free" mempolicy - use nodemask in w.user_nodemask |
1127 |
++ * @unused: redundant argument, to be removed later. |
1128 |
+ * |
1129 |
+ * Convert a mempolicy into a string. |
1130 |
+ * Returns the number of characters in buffer (if positive) |
1131 |
+ * or an error (negative) |
1132 |
+ */ |
1133 |
+-int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context) |
1134 |
++int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int unused) |
1135 |
+ { |
1136 |
+ char *p = buffer; |
1137 |
+ int l; |
1138 |
+@@ -2502,7 +2493,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context) |
1139 |
+ case MPOL_PREFERRED: |
1140 |
+ nodes_clear(nodes); |
1141 |
+ if (flags & MPOL_F_LOCAL) |
1142 |
+- mode = MPOL_LOCAL; /* pseudo-policy */ |
1143 |
++ mode = MPOL_LOCAL; |
1144 |
+ else |
1145 |
+ node_set(pol->v.preferred_node, nodes); |
1146 |
+ break; |
1147 |
+@@ -2510,10 +2501,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context) |
1148 |
+ case MPOL_BIND: |
1149 |
+ /* Fall through */ |
1150 |
+ case MPOL_INTERLEAVE: |
1151 |
+- if (no_context) |
1152 |
+- nodes = pol->w.user_nodemask; |
1153 |
+- else |
1154 |
+- nodes = pol->v.nodes; |
1155 |
++ nodes = pol->v.nodes; |
1156 |
+ break; |
1157 |
+ |
1158 |
+ default: |
1159 |
+diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c |
1160 |
+index cb9cb48..7cd0072 100644 |
1161 |
+--- a/net/bluetooth/hci_core.c |
1162 |
++++ b/net/bluetooth/hci_core.c |
1163 |
+@@ -1333,6 +1333,8 @@ int hci_unregister_dev(struct hci_dev *hdev) |
1164 |
+ for (i = 0; i < NUM_REASSEMBLY; i++) |
1165 |
+ kfree_skb(hdev->reassembly[i]); |
1166 |
+ |
1167 |
++ cancel_work_sync(&hdev->power_on); |
1168 |
++ |
1169 |
+ if (!test_bit(HCI_INIT, &hdev->flags) && |
1170 |
+ !test_bit(HCI_SETUP, &hdev->flags)) |
1171 |
+ mgmt_index_removed(hdev->id); |
1172 |
+diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c |
1173 |
+index b14ec7d..df0f815 100644 |
1174 |
+--- a/net/ipv4/proc.c |
1175 |
++++ b/net/ipv4/proc.c |
1176 |
+@@ -232,7 +232,6 @@ static const struct snmp_mib snmp4_net_list[] = { |
1177 |
+ SNMP_MIB_ITEM("TCPDSACKOfoSent", LINUX_MIB_TCPDSACKOFOSENT), |
1178 |
+ SNMP_MIB_ITEM("TCPDSACKRecv", LINUX_MIB_TCPDSACKRECV), |
1179 |
+ SNMP_MIB_ITEM("TCPDSACKOfoRecv", LINUX_MIB_TCPDSACKOFORECV), |
1180 |
+- SNMP_MIB_ITEM("TCPAbortOnSyn", LINUX_MIB_TCPABORTONSYN), |
1181 |
+ SNMP_MIB_ITEM("TCPAbortOnData", LINUX_MIB_TCPABORTONDATA), |
1182 |
+ SNMP_MIB_ITEM("TCPAbortOnClose", LINUX_MIB_TCPABORTONCLOSE), |
1183 |
+ SNMP_MIB_ITEM("TCPAbortOnMemory", LINUX_MIB_TCPABORTONMEMORY), |
1184 |
+@@ -254,6 +253,8 @@ static const struct snmp_mib snmp4_net_list[] = { |
1185 |
+ SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP), |
1186 |
+ SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER), |
1187 |
+ SNMP_MIB_ITEM("TCPTimeWaitOverflow", LINUX_MIB_TCPTIMEWAITOVERFLOW), |
1188 |
++ SNMP_MIB_ITEM("TCPChallengeACK", LINUX_MIB_TCPCHALLENGEACK), |
1189 |
++ SNMP_MIB_ITEM("TCPSYNChallenge", LINUX_MIB_TCPSYNCHALLENGE), |
1190 |
+ SNMP_MIB_SENTINEL |
1191 |
+ }; |
1192 |
+ |
1193 |
+diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c |
1194 |
+index 57d0752..46b5950 100644 |
1195 |
+--- a/net/ipv4/sysctl_net_ipv4.c |
1196 |
++++ b/net/ipv4/sysctl_net_ipv4.c |
1197 |
+@@ -566,6 +566,13 @@ static struct ctl_table ipv4_table[] = { |
1198 |
+ .mode = 0644, |
1199 |
+ .proc_handler = proc_dointvec |
1200 |
+ }, |
1201 |
++ { |
1202 |
++ .procname = "tcp_challenge_ack_limit", |
1203 |
++ .data = &sysctl_tcp_challenge_ack_limit, |
1204 |
++ .maxlen = sizeof(int), |
1205 |
++ .mode = 0644, |
1206 |
++ .proc_handler = proc_dointvec |
1207 |
++ }, |
1208 |
+ #ifdef CONFIG_NET_DMA |
1209 |
+ { |
1210 |
+ .procname = "tcp_dma_copybreak", |
1211 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
1212 |
+index b76aa2d..56545b9 100644 |
1213 |
+--- a/net/ipv4/tcp_input.c |
1214 |
++++ b/net/ipv4/tcp_input.c |
1215 |
+@@ -86,6 +86,9 @@ int sysctl_tcp_app_win __read_mostly = 31; |
1216 |
+ int sysctl_tcp_adv_win_scale __read_mostly = 1; |
1217 |
+ EXPORT_SYMBOL(sysctl_tcp_adv_win_scale); |
1218 |
+ |
1219 |
++/* rfc5961 challenge ack rate limiting */ |
1220 |
++int sysctl_tcp_challenge_ack_limit = 100; |
1221 |
++ |
1222 |
+ int sysctl_tcp_stdurg __read_mostly; |
1223 |
+ int sysctl_tcp_rfc1337 __read_mostly; |
1224 |
+ int sysctl_tcp_max_orphans __read_mostly = NR_FILE; |
1225 |
+@@ -3633,6 +3636,24 @@ static int tcp_process_frto(struct sock *sk, int flag) |
1226 |
+ return 0; |
1227 |
+ } |
1228 |
+ |
1229 |
++/* RFC 5961 7 [ACK Throttling] */ |
1230 |
++static void tcp_send_challenge_ack(struct sock *sk) |
1231 |
++{ |
1232 |
++ /* unprotected vars, we dont care of overwrites */ |
1233 |
++ static u32 challenge_timestamp; |
1234 |
++ static unsigned int challenge_count; |
1235 |
++ u32 now = jiffies / HZ; |
1236 |
++ |
1237 |
++ if (now != challenge_timestamp) { |
1238 |
++ challenge_timestamp = now; |
1239 |
++ challenge_count = 0; |
1240 |
++ } |
1241 |
++ if (++challenge_count <= sysctl_tcp_challenge_ack_limit) { |
1242 |
++ NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPCHALLENGEACK); |
1243 |
++ tcp_send_ack(sk); |
1244 |
++ } |
1245 |
++} |
1246 |
++ |
1247 |
+ /* This routine deals with incoming acks, but not outgoing ones. */ |
1248 |
+ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) |
1249 |
+ { |
1250 |
+@@ -3649,8 +3670,14 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) |
1251 |
+ /* If the ack is older than previous acks |
1252 |
+ * then we can probably ignore it. |
1253 |
+ */ |
1254 |
+- if (before(ack, prior_snd_una)) |
1255 |
++ if (before(ack, prior_snd_una)) { |
1256 |
++ /* RFC 5961 5.2 [Blind Data Injection Attack].[Mitigation] */ |
1257 |
++ if (before(ack, prior_snd_una - tp->max_window)) { |
1258 |
++ tcp_send_challenge_ack(sk); |
1259 |
++ return -1; |
1260 |
++ } |
1261 |
+ goto old_ack; |
1262 |
++ } |
1263 |
+ |
1264 |
+ /* If the ack includes data we haven't sent yet, discard |
1265 |
+ * this segment (RFC793 Section 3.9). |
1266 |
+@@ -5168,8 +5195,8 @@ out: |
1267 |
+ /* Does PAWS and seqno based validation of an incoming segment, flags will |
1268 |
+ * play significant role here. |
1269 |
+ */ |
1270 |
+-static int tcp_validate_incoming(struct sock *sk, struct sk_buff *skb, |
1271 |
+- struct tcphdr *th, int syn_inerr) |
1272 |
++static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb, |
1273 |
++ struct tcphdr *th, int syn_inerr) |
1274 |
+ { |
1275 |
+ u8 *hash_location; |
1276 |
+ struct tcp_sock *tp = tcp_sk(sk); |
1277 |
+@@ -5194,38 +5221,48 @@ static int tcp_validate_incoming(struct sock *sk, struct sk_buff *skb, |
1278 |
+ * an acknowledgment should be sent in reply (unless the RST |
1279 |
+ * bit is set, if so drop the segment and return)". |
1280 |
+ */ |
1281 |
+- if (!th->rst) |
1282 |
++ if (!th->rst) { |
1283 |
++ if (th->syn) |
1284 |
++ goto syn_challenge; |
1285 |
+ tcp_send_dupack(sk, skb); |
1286 |
++ } |
1287 |
+ goto discard; |
1288 |
+ } |
1289 |
+ |
1290 |
+ /* Step 2: check RST bit */ |
1291 |
+ if (th->rst) { |
1292 |
+- tcp_reset(sk); |
1293 |
++ /* RFC 5961 3.2 : |
1294 |
++ * If sequence number exactly matches RCV.NXT, then |
1295 |
++ * RESET the connection |
1296 |
++ * else |
1297 |
++ * Send a challenge ACK |
1298 |
++ */ |
1299 |
++ if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt) |
1300 |
++ tcp_reset(sk); |
1301 |
++ else |
1302 |
++ tcp_send_challenge_ack(sk); |
1303 |
+ goto discard; |
1304 |
+ } |
1305 |
+ |
1306 |
+- /* ts_recent update must be made after we are sure that the packet |
1307 |
+- * is in window. |
1308 |
+- */ |
1309 |
+- tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); |
1310 |
+- |
1311 |
+ /* step 3: check security and precedence [ignored] */ |
1312 |
+ |
1313 |
+- /* step 4: Check for a SYN in window. */ |
1314 |
+- if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { |
1315 |
++ /* step 4: Check for a SYN |
1316 |
++ * RFC 5691 4.2 : Send a challenge ack |
1317 |
++ */ |
1318 |
++ if (th->syn) { |
1319 |
++syn_challenge: |
1320 |
+ if (syn_inerr) |
1321 |
+ TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS); |
1322 |
+- NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONSYN); |
1323 |
+- tcp_reset(sk); |
1324 |
+- return -1; |
1325 |
++ NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNCHALLENGE); |
1326 |
++ tcp_send_challenge_ack(sk); |
1327 |
++ goto discard; |
1328 |
+ } |
1329 |
+ |
1330 |
+- return 1; |
1331 |
++ return true; |
1332 |
+ |
1333 |
+ discard: |
1334 |
+ __kfree_skb(skb); |
1335 |
+- return 0; |
1336 |
++ return false; |
1337 |
+ } |
1338 |
+ |
1339 |
+ /* |
1340 |
+@@ -5255,7 +5292,6 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
1341 |
+ struct tcphdr *th, unsigned len) |
1342 |
+ { |
1343 |
+ struct tcp_sock *tp = tcp_sk(sk); |
1344 |
+- int res; |
1345 |
+ |
1346 |
+ /* |
1347 |
+ * Header prediction. |
1348 |
+@@ -5435,14 +5471,18 @@ slow_path: |
1349 |
+ * Standard slow path. |
1350 |
+ */ |
1351 |
+ |
1352 |
+- res = tcp_validate_incoming(sk, skb, th, 1); |
1353 |
+- if (res <= 0) |
1354 |
+- return -res; |
1355 |
++ if (!tcp_validate_incoming(sk, skb, th, 1)) |
1356 |
++ return 0; |
1357 |
+ |
1358 |
+ step5: |
1359 |
+ if (th->ack && tcp_ack(sk, skb, FLAG_SLOWPATH) < 0) |
1360 |
+ goto discard; |
1361 |
+ |
1362 |
++ /* ts_recent update must be made after we are sure that the packet |
1363 |
++ * is in window. |
1364 |
++ */ |
1365 |
++ tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); |
1366 |
++ |
1367 |
+ tcp_rcv_rtt_measure_ts(sk, skb); |
1368 |
+ |
1369 |
+ /* Process urgent data. */ |
1370 |
+@@ -5747,7 +5787,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
1371 |
+ struct tcp_sock *tp = tcp_sk(sk); |
1372 |
+ struct inet_connection_sock *icsk = inet_csk(sk); |
1373 |
+ int queued = 0; |
1374 |
+- int res; |
1375 |
+ |
1376 |
+ tp->rx_opt.saw_tstamp = 0; |
1377 |
+ |
1378 |
+@@ -5802,9 +5841,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
1379 |
+ return 0; |
1380 |
+ } |
1381 |
+ |
1382 |
+- res = tcp_validate_incoming(sk, skb, th, 0); |
1383 |
+- if (res <= 0) |
1384 |
+- return -res; |
1385 |
++ if (!tcp_validate_incoming(sk, skb, th, 0)) |
1386 |
++ return 0; |
1387 |
+ |
1388 |
+ /* step 5: check the ACK field */ |
1389 |
+ if (th->ack) { |
1390 |
+@@ -5921,6 +5959,11 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
1391 |
+ } else |
1392 |
+ goto discard; |
1393 |
+ |
1394 |
++ /* ts_recent update must be made after we are sure that the packet |
1395 |
++ * is in window. |
1396 |
++ */ |
1397 |
++ tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); |
1398 |
++ |
1399 |
+ /* step 6: check the URG bit */ |
1400 |
+ tcp_urg(sk, skb, th); |
1401 |
+ |
1402 |
+diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c |
1403 |
+index 29b942c..f08b9166 100644 |
1404 |
+--- a/net/sched/sch_htb.c |
1405 |
++++ b/net/sched/sch_htb.c |
1406 |
+@@ -876,7 +876,7 @@ ok: |
1407 |
+ q->now = psched_get_time(); |
1408 |
+ start_at = jiffies; |
1409 |
+ |
1410 |
+- next_event = q->now + 5 * PSCHED_TICKS_PER_SEC; |
1411 |
++ next_event = q->now + 5LLU * PSCHED_TICKS_PER_SEC; |
1412 |
+ |
1413 |
+ for (level = 0; level < TC_HTB_MAXDEPTH; level++) { |
1414 |
+ /* common case optimization - skip event handler quickly */ |
1415 |
+diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c |
1416 |
+index 6c85564..0018b65 100644 |
1417 |
+--- a/net/sctp/chunk.c |
1418 |
++++ b/net/sctp/chunk.c |
1419 |
+@@ -183,7 +183,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, |
1420 |
+ |
1421 |
+ msg = sctp_datamsg_new(GFP_KERNEL); |
1422 |
+ if (!msg) |
1423 |
+- return NULL; |
1424 |
++ return ERR_PTR(-ENOMEM); |
1425 |
+ |
1426 |
+ /* Note: Calculate this outside of the loop, so that all fragments |
1427 |
+ * have the same expiration. |
1428 |
+@@ -280,11 +280,14 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, |
1429 |
+ |
1430 |
+ chunk = sctp_make_datafrag_empty(asoc, sinfo, len, frag, 0); |
1431 |
+ |
1432 |
+- if (!chunk) |
1433 |
++ if (!chunk) { |
1434 |
++ err = -ENOMEM; |
1435 |
+ goto errout; |
1436 |
++ } |
1437 |
++ |
1438 |
+ err = sctp_user_addto_chunk(chunk, offset, len, msgh->msg_iov); |
1439 |
+ if (err < 0) |
1440 |
+- goto errout; |
1441 |
++ goto errout_chunk_free; |
1442 |
+ |
1443 |
+ offset += len; |
1444 |
+ |
1445 |
+@@ -315,8 +318,10 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, |
1446 |
+ |
1447 |
+ chunk = sctp_make_datafrag_empty(asoc, sinfo, over, frag, 0); |
1448 |
+ |
1449 |
+- if (!chunk) |
1450 |
++ if (!chunk) { |
1451 |
++ err = -ENOMEM; |
1452 |
+ goto errout; |
1453 |
++ } |
1454 |
+ |
1455 |
+ err = sctp_user_addto_chunk(chunk, offset, over,msgh->msg_iov); |
1456 |
+ |
1457 |
+@@ -324,7 +329,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, |
1458 |
+ __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr |
1459 |
+ - (__u8 *)chunk->skb->data); |
1460 |
+ if (err < 0) |
1461 |
+- goto errout; |
1462 |
++ goto errout_chunk_free; |
1463 |
+ |
1464 |
+ sctp_datamsg_assign(msg, chunk); |
1465 |
+ list_add_tail(&chunk->frag_list, &msg->chunks); |
1466 |
+@@ -332,6 +337,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, |
1467 |
+ |
1468 |
+ return msg; |
1469 |
+ |
1470 |
++errout_chunk_free: |
1471 |
++ sctp_chunk_free(chunk); |
1472 |
++ |
1473 |
+ errout: |
1474 |
+ list_for_each_safe(pos, temp, &msg->chunks) { |
1475 |
+ list_del_init(pos); |
1476 |
+@@ -339,7 +347,7 @@ errout: |
1477 |
+ sctp_chunk_free(chunk); |
1478 |
+ } |
1479 |
+ sctp_datamsg_put(msg); |
1480 |
+- return NULL; |
1481 |
++ return ERR_PTR(err); |
1482 |
+ } |
1483 |
+ |
1484 |
+ /* Check whether this message has expired. */ |
1485 |
+diff --git a/net/sctp/socket.c b/net/sctp/socket.c |
1486 |
+index b70a3ee..8ac6d0b 100644 |
1487 |
+--- a/net/sctp/socket.c |
1488 |
++++ b/net/sctp/socket.c |
1489 |
+@@ -1837,8 +1837,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, |
1490 |
+ |
1491 |
+ /* Break the message into multiple chunks of maximum size. */ |
1492 |
+ datamsg = sctp_datamsg_from_user(asoc, sinfo, msg, msg_len); |
1493 |
+- if (!datamsg) { |
1494 |
+- err = -ENOMEM; |
1495 |
++ if (IS_ERR(datamsg)) { |
1496 |
++ err = PTR_ERR(datamsg); |
1497 |
+ goto out_free; |
1498 |
+ } |
1499 |
+ |
1500 |
+diff --git a/sound/usb/midi.c b/sound/usb/midi.c |
1501 |
+index a0fe5dd..4376215 100644 |
1502 |
+--- a/sound/usb/midi.c |
1503 |
++++ b/sound/usb/midi.c |
1504 |
+@@ -115,6 +115,7 @@ struct snd_usb_midi { |
1505 |
+ struct list_head list; |
1506 |
+ struct timer_list error_timer; |
1507 |
+ spinlock_t disc_lock; |
1508 |
++ struct rw_semaphore disc_rwsem; |
1509 |
+ struct mutex mutex; |
1510 |
+ u32 usb_id; |
1511 |
+ int next_midi_device; |
1512 |
+@@ -124,8 +125,10 @@ struct snd_usb_midi { |
1513 |
+ struct snd_usb_midi_in_endpoint *in; |
1514 |
+ } endpoints[MIDI_MAX_ENDPOINTS]; |
1515 |
+ unsigned long input_triggered; |
1516 |
+- unsigned int opened; |
1517 |
++ bool autopm_reference; |
1518 |
++ unsigned int opened[2]; |
1519 |
+ unsigned char disconnected; |
1520 |
++ unsigned char input_running; |
1521 |
+ |
1522 |
+ struct snd_kcontrol *roland_load_ctl; |
1523 |
+ }; |
1524 |
+@@ -147,7 +150,6 @@ struct snd_usb_midi_out_endpoint { |
1525 |
+ struct snd_usb_midi_out_endpoint* ep; |
1526 |
+ struct snd_rawmidi_substream *substream; |
1527 |
+ int active; |
1528 |
+- bool autopm_reference; |
1529 |
+ uint8_t cable; /* cable number << 4 */ |
1530 |
+ uint8_t state; |
1531 |
+ #define STATE_UNKNOWN 0 |
1532 |
+@@ -1016,29 +1018,58 @@ static void update_roland_altsetting(struct snd_usb_midi* umidi) |
1533 |
+ snd_usbmidi_input_start(&umidi->list); |
1534 |
+ } |
1535 |
+ |
1536 |
+-static void substream_open(struct snd_rawmidi_substream *substream, int open) |
1537 |
++static int substream_open(struct snd_rawmidi_substream *substream, int dir, |
1538 |
++ int open) |
1539 |
+ { |
1540 |
+ struct snd_usb_midi* umidi = substream->rmidi->private_data; |
1541 |
+ struct snd_kcontrol *ctl; |
1542 |
++ int err; |
1543 |
++ |
1544 |
++ down_read(&umidi->disc_rwsem); |
1545 |
++ if (umidi->disconnected) { |
1546 |
++ up_read(&umidi->disc_rwsem); |
1547 |
++ return open ? -ENODEV : 0; |
1548 |
++ } |
1549 |
+ |
1550 |
+ mutex_lock(&umidi->mutex); |
1551 |
+ if (open) { |
1552 |
+- if (umidi->opened++ == 0 && umidi->roland_load_ctl) { |
1553 |
+- ctl = umidi->roland_load_ctl; |
1554 |
+- ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; |
1555 |
+- snd_ctl_notify(umidi->card, |
1556 |
++ if (!umidi->opened[0] && !umidi->opened[1]) { |
1557 |
++ err = usb_autopm_get_interface(umidi->iface); |
1558 |
++ umidi->autopm_reference = err >= 0; |
1559 |
++ if (err < 0 && err != -EACCES) { |
1560 |
++ mutex_unlock(&umidi->mutex); |
1561 |
++ up_read(&umidi->disc_rwsem); |
1562 |
++ return -EIO; |
1563 |
++ } |
1564 |
++ if (umidi->roland_load_ctl) { |
1565 |
++ ctl = umidi->roland_load_ctl; |
1566 |
++ ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE; |
1567 |
++ snd_ctl_notify(umidi->card, |
1568 |
+ SNDRV_CTL_EVENT_MASK_INFO, &ctl->id); |
1569 |
+- update_roland_altsetting(umidi); |
1570 |
++ update_roland_altsetting(umidi); |
1571 |
++ } |
1572 |
+ } |
1573 |
++ umidi->opened[dir]++; |
1574 |
++ if (umidi->opened[1]) |
1575 |
++ snd_usbmidi_input_start(&umidi->list); |
1576 |
+ } else { |
1577 |
+- if (--umidi->opened == 0 && umidi->roland_load_ctl) { |
1578 |
+- ctl = umidi->roland_load_ctl; |
1579 |
+- ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; |
1580 |
+- snd_ctl_notify(umidi->card, |
1581 |
++ umidi->opened[dir]--; |
1582 |
++ if (!umidi->opened[1]) |
1583 |
++ snd_usbmidi_input_stop(&umidi->list); |
1584 |
++ if (!umidi->opened[0] && !umidi->opened[1]) { |
1585 |
++ if (umidi->roland_load_ctl) { |
1586 |
++ ctl = umidi->roland_load_ctl; |
1587 |
++ ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; |
1588 |
++ snd_ctl_notify(umidi->card, |
1589 |
+ SNDRV_CTL_EVENT_MASK_INFO, &ctl->id); |
1590 |
++ } |
1591 |
++ if (umidi->autopm_reference) |
1592 |
++ usb_autopm_put_interface(umidi->iface); |
1593 |
+ } |
1594 |
+ } |
1595 |
+ mutex_unlock(&umidi->mutex); |
1596 |
++ up_read(&umidi->disc_rwsem); |
1597 |
++ return 0; |
1598 |
+ } |
1599 |
+ |
1600 |
+ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) |
1601 |
+@@ -1046,7 +1077,6 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) |
1602 |
+ struct snd_usb_midi* umidi = substream->rmidi->private_data; |
1603 |
+ struct usbmidi_out_port* port = NULL; |
1604 |
+ int i, j; |
1605 |
+- int err; |
1606 |
+ |
1607 |
+ for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) |
1608 |
+ if (umidi->endpoints[i].out) |
1609 |
+@@ -1059,25 +1089,15 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) |
1610 |
+ snd_BUG(); |
1611 |
+ return -ENXIO; |
1612 |
+ } |
1613 |
+- err = usb_autopm_get_interface(umidi->iface); |
1614 |
+- port->autopm_reference = err >= 0; |
1615 |
+- if (err < 0 && err != -EACCES) |
1616 |
+- return -EIO; |
1617 |
++ |
1618 |
+ substream->runtime->private_data = port; |
1619 |
+ port->state = STATE_UNKNOWN; |
1620 |
+- substream_open(substream, 1); |
1621 |
+- return 0; |
1622 |
++ return substream_open(substream, 0, 1); |
1623 |
+ } |
1624 |
+ |
1625 |
+ static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) |
1626 |
+ { |
1627 |
+- struct snd_usb_midi* umidi = substream->rmidi->private_data; |
1628 |
+- struct usbmidi_out_port *port = substream->runtime->private_data; |
1629 |
+- |
1630 |
+- substream_open(substream, 0); |
1631 |
+- if (port->autopm_reference) |
1632 |
+- usb_autopm_put_interface(umidi->iface); |
1633 |
+- return 0; |
1634 |
++ return substream_open(substream, 0, 0); |
1635 |
+ } |
1636 |
+ |
1637 |
+ static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream, int up) |
1638 |
+@@ -1130,14 +1150,12 @@ static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream) |
1639 |
+ |
1640 |
+ static int snd_usbmidi_input_open(struct snd_rawmidi_substream *substream) |
1641 |
+ { |
1642 |
+- substream_open(substream, 1); |
1643 |
+- return 0; |
1644 |
++ return substream_open(substream, 1, 1); |
1645 |
+ } |
1646 |
+ |
1647 |
+ static int snd_usbmidi_input_close(struct snd_rawmidi_substream *substream) |
1648 |
+ { |
1649 |
+- substream_open(substream, 0); |
1650 |
+- return 0; |
1651 |
++ return substream_open(substream, 1, 0); |
1652 |
+ } |
1653 |
+ |
1654 |
+ static void snd_usbmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) |
1655 |
+@@ -1386,9 +1404,12 @@ void snd_usbmidi_disconnect(struct list_head* p) |
1656 |
+ * a timer may submit an URB. To reliably break the cycle |
1657 |
+ * a flag under lock must be used |
1658 |
+ */ |
1659 |
++ down_write(&umidi->disc_rwsem); |
1660 |
+ spin_lock_irq(&umidi->disc_lock); |
1661 |
+ umidi->disconnected = 1; |
1662 |
+ spin_unlock_irq(&umidi->disc_lock); |
1663 |
++ up_write(&umidi->disc_rwsem); |
1664 |
++ |
1665 |
+ for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { |
1666 |
+ struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i]; |
1667 |
+ if (ep->out) |
1668 |
+@@ -2043,12 +2064,15 @@ void snd_usbmidi_input_stop(struct list_head* p) |
1669 |
+ unsigned int i, j; |
1670 |
+ |
1671 |
+ umidi = list_entry(p, struct snd_usb_midi, list); |
1672 |
++ if (!umidi->input_running) |
1673 |
++ return; |
1674 |
+ for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { |
1675 |
+ struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i]; |
1676 |
+ if (ep->in) |
1677 |
+ for (j = 0; j < INPUT_URBS; ++j) |
1678 |
+ usb_kill_urb(ep->in->urbs[j]); |
1679 |
+ } |
1680 |
++ umidi->input_running = 0; |
1681 |
+ } |
1682 |
+ |
1683 |
+ static void snd_usbmidi_input_start_ep(struct snd_usb_midi_in_endpoint* ep) |
1684 |
+@@ -2073,8 +2097,11 @@ void snd_usbmidi_input_start(struct list_head* p) |
1685 |
+ int i; |
1686 |
+ |
1687 |
+ umidi = list_entry(p, struct snd_usb_midi, list); |
1688 |
++ if (umidi->input_running || !umidi->opened[1]) |
1689 |
++ return; |
1690 |
+ for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) |
1691 |
+ snd_usbmidi_input_start_ep(umidi->endpoints[i].in); |
1692 |
++ umidi->input_running = 1; |
1693 |
+ } |
1694 |
+ |
1695 |
+ /* |
1696 |
+@@ -2100,6 +2127,7 @@ int snd_usbmidi_create(struct snd_card *card, |
1697 |
+ umidi->usb_protocol_ops = &snd_usbmidi_standard_ops; |
1698 |
+ init_timer(&umidi->error_timer); |
1699 |
+ spin_lock_init(&umidi->disc_lock); |
1700 |
++ init_rwsem(&umidi->disc_rwsem); |
1701 |
+ mutex_init(&umidi->mutex); |
1702 |
+ umidi->usb_id = USB_ID(le16_to_cpu(umidi->dev->descriptor.idVendor), |
1703 |
+ le16_to_cpu(umidi->dev->descriptor.idProduct)); |
1704 |
+@@ -2201,9 +2229,6 @@ int snd_usbmidi_create(struct snd_card *card, |
1705 |
+ } |
1706 |
+ |
1707 |
+ list_add_tail(&umidi->list, midi_list); |
1708 |
+- |
1709 |
+- for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) |
1710 |
+- snd_usbmidi_input_start_ep(umidi->endpoints[i].in); |
1711 |
+ return 0; |
1712 |
+ } |
1713 |
+ |
1714 |
|
1715 |
Added: genpatches-2.6/trunk/3.0/1058_linux-3.0.59.patch |
1716 |
=================================================================== |
1717 |
--- genpatches-2.6/trunk/3.0/1058_linux-3.0.59.patch (rev 0) |
1718 |
+++ genpatches-2.6/trunk/3.0/1058_linux-3.0.59.patch 2013-01-29 00:51:38 UTC (rev 2267) |
1719 |
@@ -0,0 +1,3124 @@ |
1720 |
+diff --git a/Makefile b/Makefile |
1721 |
+index 9564edf..d1b37fc 100644 |
1722 |
+--- a/Makefile |
1723 |
++++ b/Makefile |
1724 |
+@@ -1,6 +1,6 @@ |
1725 |
+ VERSION = 3 |
1726 |
+ PATCHLEVEL = 0 |
1727 |
+-SUBLEVEL = 58 |
1728 |
++SUBLEVEL = 59 |
1729 |
+ EXTRAVERSION = |
1730 |
+ NAME = Sneaky Weasel |
1731 |
+ |
1732 |
+diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S |
1733 |
+index ba50409..e8befef 100644 |
1734 |
+--- a/arch/powerpc/kernel/head_64.S |
1735 |
++++ b/arch/powerpc/kernel/head_64.S |
1736 |
+@@ -425,7 +425,7 @@ _STATIC(__after_prom_start) |
1737 |
+ tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */ |
1738 |
+ #endif |
1739 |
+ |
1740 |
+-#ifdef CONFIG_CRASH_DUMP |
1741 |
++#ifdef CONFIG_RELOCATABLE |
1742 |
+ /* |
1743 |
+ * Check if the kernel has to be running as relocatable kernel based on the |
1744 |
+ * variable __run_at_load, if it is set the kernel is treated as relocatable |
1745 |
+diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c |
1746 |
+index 1becd7b..818d809 100644 |
1747 |
+--- a/arch/powerpc/kernel/time.c |
1748 |
++++ b/arch/powerpc/kernel/time.c |
1749 |
+@@ -859,13 +859,8 @@ void update_vsyscall(struct timespec *wall_time, struct timespec *wtm, |
1750 |
+ |
1751 |
+ void update_vsyscall_tz(void) |
1752 |
+ { |
1753 |
+- /* Make userspace gettimeofday spin until we're done. */ |
1754 |
+- ++vdso_data->tb_update_count; |
1755 |
+- smp_mb(); |
1756 |
+ vdso_data->tz_minuteswest = sys_tz.tz_minuteswest; |
1757 |
+ vdso_data->tz_dsttime = sys_tz.tz_dsttime; |
1758 |
+- smp_mb(); |
1759 |
+- ++vdso_data->tb_update_count; |
1760 |
+ } |
1761 |
+ |
1762 |
+ static void __init clocksource_init(void) |
1763 |
+diff --git a/arch/powerpc/kvm/44x_emulate.c b/arch/powerpc/kvm/44x_emulate.c |
1764 |
+index 549bb2c..ded8a1a 100644 |
1765 |
+--- a/arch/powerpc/kvm/44x_emulate.c |
1766 |
++++ b/arch/powerpc/kvm/44x_emulate.c |
1767 |
+@@ -79,6 +79,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, |
1768 |
+ run->dcr.dcrn = dcrn; |
1769 |
+ run->dcr.data = 0; |
1770 |
+ run->dcr.is_write = 0; |
1771 |
++ vcpu->arch.dcr_is_write = 0; |
1772 |
+ vcpu->arch.io_gpr = rt; |
1773 |
+ vcpu->arch.dcr_needed = 1; |
1774 |
+ kvmppc_account_exit(vcpu, DCR_EXITS); |
1775 |
+@@ -100,6 +101,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, |
1776 |
+ run->dcr.dcrn = dcrn; |
1777 |
+ run->dcr.data = kvmppc_get_gpr(vcpu, rs); |
1778 |
+ run->dcr.is_write = 1; |
1779 |
++ vcpu->arch.dcr_is_write = 1; |
1780 |
+ vcpu->arch.dcr_needed = 1; |
1781 |
+ kvmppc_account_exit(vcpu, DCR_EXITS); |
1782 |
+ emulated = EMULATE_DO_DCR; |
1783 |
+diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c |
1784 |
+index 3f4b6da..a93741d 100644 |
1785 |
+--- a/arch/x86/kernel/cpu/amd.c |
1786 |
++++ b/arch/x86/kernel/cpu/amd.c |
1787 |
+@@ -568,6 +568,20 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) |
1788 |
+ } |
1789 |
+ } |
1790 |
+ |
1791 |
++ /* |
1792 |
++ * The way access filter has a performance penalty on some workloads. |
1793 |
++ * Disable it on the affected CPUs. |
1794 |
++ */ |
1795 |
++ if ((c->x86 == 0x15) && |
1796 |
++ (c->x86_model >= 0x02) && (c->x86_model < 0x20)) { |
1797 |
++ u64 val; |
1798 |
++ |
1799 |
++ if (!rdmsrl_safe(0xc0011021, &val) && !(val & 0x1E)) { |
1800 |
++ val |= 0x1E; |
1801 |
++ checking_wrmsrl(0xc0011021, val); |
1802 |
++ } |
1803 |
++ } |
1804 |
++ |
1805 |
+ cpu_detect_cache_sizes(c); |
1806 |
+ |
1807 |
+ /* Multi core CPU? */ |
1808 |
+diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c |
1809 |
+index 8cb9742..ea1fe0a 100644 |
1810 |
+--- a/drivers/acpi/scan.c |
1811 |
++++ b/drivers/acpi/scan.c |
1812 |
+@@ -789,8 +789,8 @@ acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, |
1813 |
+ static void acpi_bus_set_run_wake_flags(struct acpi_device *device) |
1814 |
+ { |
1815 |
+ struct acpi_device_id button_device_ids[] = { |
1816 |
+- {"PNP0C0D", 0}, |
1817 |
+ {"PNP0C0C", 0}, |
1818 |
++ {"PNP0C0D", 0}, |
1819 |
+ {"PNP0C0E", 0}, |
1820 |
+ {"", 0}, |
1821 |
+ }; |
1822 |
+@@ -802,6 +802,11 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device) |
1823 |
+ /* Power button, Lid switch always enable wakeup */ |
1824 |
+ if (!acpi_match_device_ids(device, button_device_ids)) { |
1825 |
+ device->wakeup.flags.run_wake = 1; |
1826 |
++ if (!acpi_match_device_ids(device, &button_device_ids[1])) { |
1827 |
++ /* Do not use Lid/sleep button for S5 wakeup */ |
1828 |
++ if (device->wakeup.sleep_state == ACPI_STATE_S5) |
1829 |
++ device->wakeup.sleep_state = ACPI_STATE_S4; |
1830 |
++ } |
1831 |
+ device_set_wakeup_capable(&device->dev, true); |
1832 |
+ return; |
1833 |
+ } |
1834 |
+diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c |
1835 |
+index 600ede0..5a72e36 100644 |
1836 |
+--- a/drivers/ata/libata-core.c |
1837 |
++++ b/drivers/ata/libata-core.c |
1838 |
+@@ -2543,6 +2543,7 @@ int ata_bus_probe(struct ata_port *ap) |
1839 |
+ * bus as we may be talking too fast. |
1840 |
+ */ |
1841 |
+ dev->pio_mode = XFER_PIO_0; |
1842 |
++ dev->dma_mode = 0xff; |
1843 |
+ |
1844 |
+ /* If the controller has a pio mode setup function |
1845 |
+ * then use it to set the chipset to rights. Don't |
1846 |
+diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c |
1847 |
+index 311c92d..1cbb004 100644 |
1848 |
+--- a/drivers/ata/libata-eh.c |
1849 |
++++ b/drivers/ata/libata-eh.c |
1850 |
+@@ -2602,6 +2602,7 @@ int ata_eh_reset(struct ata_link *link, int classify, |
1851 |
+ * bus as we may be talking too fast. |
1852 |
+ */ |
1853 |
+ dev->pio_mode = XFER_PIO_0; |
1854 |
++ dev->dma_mode = 0xff; |
1855 |
+ |
1856 |
+ /* If the controller has a pio mode setup function |
1857 |
+ * then use it to set the chipset to rights. Don't |
1858 |
+diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c |
1859 |
+index 927f968..3b42a5d 100644 |
1860 |
+--- a/drivers/ata/libata-scsi.c |
1861 |
++++ b/drivers/ata/libata-scsi.c |
1862 |
+@@ -308,7 +308,8 @@ ata_scsi_activity_show(struct device *dev, struct device_attribute *attr, |
1863 |
+ struct ata_port *ap = ata_shost_to_port(sdev->host); |
1864 |
+ struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); |
1865 |
+ |
1866 |
+- if (ap->ops->sw_activity_show && (ap->flags & ATA_FLAG_SW_ACTIVITY)) |
1867 |
++ if (atadev && ap->ops->sw_activity_show && |
1868 |
++ (ap->flags & ATA_FLAG_SW_ACTIVITY)) |
1869 |
+ return ap->ops->sw_activity_show(atadev, buf); |
1870 |
+ return -EINVAL; |
1871 |
+ } |
1872 |
+@@ -323,7 +324,8 @@ ata_scsi_activity_store(struct device *dev, struct device_attribute *attr, |
1873 |
+ enum sw_activity val; |
1874 |
+ int rc; |
1875 |
+ |
1876 |
+- if (ap->ops->sw_activity_store && (ap->flags & ATA_FLAG_SW_ACTIVITY)) { |
1877 |
++ if (atadev && ap->ops->sw_activity_store && |
1878 |
++ (ap->flags & ATA_FLAG_SW_ACTIVITY)) { |
1879 |
+ val = simple_strtoul(buf, NULL, 0); |
1880 |
+ switch (val) { |
1881 |
+ case OFF: case BLINK_ON: case BLINK_OFF: |
1882 |
+diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c |
1883 |
+index a004b1e..ca4646a 100644 |
1884 |
+--- a/drivers/ata/sata_promise.c |
1885 |
++++ b/drivers/ata/sata_promise.c |
1886 |
+@@ -147,6 +147,10 @@ struct pdc_port_priv { |
1887 |
+ dma_addr_t pkt_dma; |
1888 |
+ }; |
1889 |
+ |
1890 |
++struct pdc_host_priv { |
1891 |
++ spinlock_t hard_reset_lock; |
1892 |
++}; |
1893 |
++ |
1894 |
+ static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); |
1895 |
+ static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); |
1896 |
+ static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
1897 |
+@@ -801,9 +805,10 @@ static void pdc_hard_reset_port(struct ata_port *ap) |
1898 |
+ void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR]; |
1899 |
+ void __iomem *pcictl_b1_mmio = host_mmio + PDC_PCI_CTL + 1; |
1900 |
+ unsigned int ata_no = pdc_ata_port_to_ata_no(ap); |
1901 |
++ struct pdc_host_priv *hpriv = ap->host->private_data; |
1902 |
+ u8 tmp; |
1903 |
+ |
1904 |
+- spin_lock(&ap->host->lock); |
1905 |
++ spin_lock(&hpriv->hard_reset_lock); |
1906 |
+ |
1907 |
+ tmp = readb(pcictl_b1_mmio); |
1908 |
+ tmp &= ~(0x10 << ata_no); |
1909 |
+@@ -814,7 +819,7 @@ static void pdc_hard_reset_port(struct ata_port *ap) |
1910 |
+ writeb(tmp, pcictl_b1_mmio); |
1911 |
+ readb(pcictl_b1_mmio); /* flush */ |
1912 |
+ |
1913 |
+- spin_unlock(&ap->host->lock); |
1914 |
++ spin_unlock(&hpriv->hard_reset_lock); |
1915 |
+ } |
1916 |
+ |
1917 |
+ static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class, |
1918 |
+@@ -1183,6 +1188,7 @@ static int pdc_ata_init_one(struct pci_dev *pdev, |
1919 |
+ const struct ata_port_info *pi = &pdc_port_info[ent->driver_data]; |
1920 |
+ const struct ata_port_info *ppi[PDC_MAX_PORTS]; |
1921 |
+ struct ata_host *host; |
1922 |
++ struct pdc_host_priv *hpriv; |
1923 |
+ void __iomem *host_mmio; |
1924 |
+ int n_ports, i, rc; |
1925 |
+ int is_sataii_tx4; |
1926 |
+@@ -1220,6 +1226,11 @@ static int pdc_ata_init_one(struct pci_dev *pdev, |
1927 |
+ dev_printk(KERN_ERR, &pdev->dev, "failed to allocate host\n"); |
1928 |
+ return -ENOMEM; |
1929 |
+ } |
1930 |
++ hpriv = devm_kzalloc(&pdev->dev, sizeof *hpriv, GFP_KERNEL); |
1931 |
++ if (!hpriv) |
1932 |
++ return -ENOMEM; |
1933 |
++ spin_lock_init(&hpriv->hard_reset_lock); |
1934 |
++ host->private_data = hpriv; |
1935 |
+ host->iomap = pcim_iomap_table(pdev); |
1936 |
+ |
1937 |
+ is_sataii_tx4 = pdc_is_sataii_tx4(pi->flags); |
1938 |
+diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h |
1939 |
+index db195ab..e49ddd0 100644 |
1940 |
+--- a/drivers/block/aoe/aoe.h |
1941 |
++++ b/drivers/block/aoe/aoe.h |
1942 |
+@@ -1,5 +1,5 @@ |
1943 |
+ /* Copyright (c) 2007 Coraid, Inc. See COPYING for GPL terms. */ |
1944 |
+-#define VERSION "47" |
1945 |
++#define VERSION "47q" |
1946 |
+ #define AOE_MAJOR 152 |
1947 |
+ #define DEVICE_NAME "aoe" |
1948 |
+ |
1949 |
+diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c |
1950 |
+index 528f631..2a0fdae 100644 |
1951 |
+--- a/drivers/block/aoe/aoeblk.c |
1952 |
++++ b/drivers/block/aoe/aoeblk.c |
1953 |
+@@ -277,8 +277,6 @@ aoeblk_gdalloc(void *vp) |
1954 |
+ goto err_mempool; |
1955 |
+ blk_queue_make_request(d->blkq, aoeblk_make_request); |
1956 |
+ d->blkq->backing_dev_info.name = "aoe"; |
1957 |
+- if (bdi_init(&d->blkq->backing_dev_info)) |
1958 |
+- goto err_blkq; |
1959 |
+ spin_lock_irqsave(&d->lock, flags); |
1960 |
+ gd->major = AOE_MAJOR; |
1961 |
+ gd->first_minor = d->sysminor * AOE_PARTITIONS; |
1962 |
+@@ -299,9 +297,6 @@ aoeblk_gdalloc(void *vp) |
1963 |
+ aoedisk_add_sysfs(d); |
1964 |
+ return; |
1965 |
+ |
1966 |
+-err_blkq: |
1967 |
+- blk_cleanup_queue(d->blkq); |
1968 |
+- d->blkq = NULL; |
1969 |
+ err_mempool: |
1970 |
+ mempool_destroy(d->bufpool); |
1971 |
+ err_disk: |
1972 |
+diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c |
1973 |
+index b9762d0..e74750b 100644 |
1974 |
+--- a/drivers/firewire/net.c |
1975 |
++++ b/drivers/firewire/net.c |
1976 |
+@@ -863,8 +863,8 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context, |
1977 |
+ if (specifier_id == IANA_SPECIFIER_ID && ver == RFC2734_SW_VERSION) { |
1978 |
+ buf_ptr += 2; |
1979 |
+ length -= IEEE1394_GASP_HDR_SIZE; |
1980 |
+- fwnet_incoming_packet(dev, buf_ptr, length, |
1981 |
+- source_node_id, -1, true); |
1982 |
++ fwnet_incoming_packet(dev, buf_ptr, length, source_node_id, |
1983 |
++ context->card->generation, true); |
1984 |
+ } |
1985 |
+ |
1986 |
+ packet.payload_length = dev->rcv_buffer_size; |
1987 |
+@@ -959,7 +959,12 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) |
1988 |
+ break; |
1989 |
+ } |
1990 |
+ |
1991 |
+- skb_pull(skb, ptask->max_payload); |
1992 |
++ if (ptask->dest_node == IEEE1394_ALL_NODES) { |
1993 |
++ skb_pull(skb, |
1994 |
++ ptask->max_payload + IEEE1394_GASP_HDR_SIZE); |
1995 |
++ } else { |
1996 |
++ skb_pull(skb, ptask->max_payload); |
1997 |
++ } |
1998 |
+ if (ptask->outstanding_pkts > 1) { |
1999 |
+ fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG, |
2000 |
+ dg_size, fg_off, datagram_label); |
2001 |
+@@ -1062,7 +1067,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask) |
2002 |
+ smp_rmb(); |
2003 |
+ node_id = dev->card->node_id; |
2004 |
+ |
2005 |
+- p = skb_push(ptask->skb, 8); |
2006 |
++ p = skb_push(ptask->skb, IEEE1394_GASP_HDR_SIZE); |
2007 |
+ put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p); |
2008 |
+ put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24 |
2009 |
+ | RFC2734_SW_VERSION, &p[4]); |
2010 |
+diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h |
2011 |
+index 557e007..8fa4f7b 100644 |
2012 |
+--- a/drivers/gpu/drm/i915/i915_reg.h |
2013 |
++++ b/drivers/gpu/drm/i915/i915_reg.h |
2014 |
+@@ -2754,6 +2754,8 @@ |
2015 |
+ #define _PFA_CTL_1 0x68080 |
2016 |
+ #define _PFB_CTL_1 0x68880 |
2017 |
+ #define PF_ENABLE (1<<31) |
2018 |
++#define PF_PIPE_SEL_MASK_IVB (3<<29) |
2019 |
++#define PF_PIPE_SEL_IVB(pipe) ((pipe)<<29) |
2020 |
+ #define PF_FILTER_MASK (3<<23) |
2021 |
+ #define PF_FILTER_PROGRAMMED (0<<23) |
2022 |
+ #define PF_FILTER_MED_3x3 (1<<23) |
2023 |
+diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c |
2024 |
+index 36d76989..d1dca92 100644 |
2025 |
+--- a/drivers/gpu/drm/i915/intel_display.c |
2026 |
++++ b/drivers/gpu/drm/i915/intel_display.c |
2027 |
+@@ -2696,7 +2696,11 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) |
2028 |
+ * as some pre-programmed values are broken, |
2029 |
+ * e.g. x201. |
2030 |
+ */ |
2031 |
+- I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3); |
2032 |
++ if (IS_IVYBRIDGE(dev)) |
2033 |
++ I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3 | |
2034 |
++ PF_PIPE_SEL_IVB(pipe)); |
2035 |
++ else |
2036 |
++ I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3); |
2037 |
+ I915_WRITE(PF_WIN_POS(pipe), dev_priv->pch_pf_pos); |
2038 |
+ I915_WRITE(PF_WIN_SZ(pipe), dev_priv->pch_pf_size); |
2039 |
+ } |
2040 |
+diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c |
2041 |
+index 645f8aa..eebf002 100644 |
2042 |
+--- a/drivers/gpu/drm/i915/intel_lvds.c |
2043 |
++++ b/drivers/gpu/drm/i915/intel_lvds.c |
2044 |
+@@ -753,14 +753,6 @@ static const struct dmi_system_id intel_no_lvds[] = { |
2045 |
+ }, |
2046 |
+ { |
2047 |
+ .callback = intel_no_lvds_dmi_callback, |
2048 |
+- .ident = "ZOTAC ZBOXSD-ID12/ID13", |
2049 |
+- .matches = { |
2050 |
+- DMI_MATCH(DMI_BOARD_VENDOR, "ZOTAC"), |
2051 |
+- DMI_MATCH(DMI_BOARD_NAME, "ZBOXSD-ID12/ID13"), |
2052 |
+- }, |
2053 |
+- }, |
2054 |
+- { |
2055 |
+- .callback = intel_no_lvds_dmi_callback, |
2056 |
+ .ident = "Gigabyte GA-D525TUD", |
2057 |
+ .matches = { |
2058 |
+ DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."), |
2059 |
+diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c |
2060 |
+index 8165953..a906803 100644 |
2061 |
+--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c |
2062 |
++++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c |
2063 |
+@@ -617,6 +617,14 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc |
2064 |
+ enum drm_connector_status found = connector_status_disconnected; |
2065 |
+ bool color = true; |
2066 |
+ |
2067 |
++ /* just don't bother on RN50 those chip are often connected to remoting |
2068 |
++ * console hw and often we get failure to load detect those. So to make |
2069 |
++ * everyone happy report the encoder as always connected. |
2070 |
++ */ |
2071 |
++ if (ASIC_IS_RN50(rdev)) { |
2072 |
++ return connector_status_connected; |
2073 |
++ } |
2074 |
++ |
2075 |
+ /* save the regs we need */ |
2076 |
+ vclk_ecp_cntl = RREG32_PLL(RADEON_VCLK_ECP_CNTL); |
2077 |
+ crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL); |
2078 |
+diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c |
2079 |
+index 4a5abaf..9227f4a 100644 |
2080 |
+--- a/drivers/infiniband/core/netlink.c |
2081 |
++++ b/drivers/infiniband/core/netlink.c |
2082 |
+@@ -148,7 +148,7 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
2083 |
+ return -EINVAL; |
2084 |
+ return netlink_dump_start(nls, skb, nlh, |
2085 |
+ client->cb_table[op].dump, |
2086 |
+- NULL); |
2087 |
++ NULL, 0); |
2088 |
+ } |
2089 |
+ } |
2090 |
+ |
2091 |
+diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h |
2092 |
+index 6fe7987..6e30273 100644 |
2093 |
+--- a/drivers/infiniband/hw/nes/nes.h |
2094 |
++++ b/drivers/infiniband/hw/nes/nes.h |
2095 |
+@@ -511,6 +511,7 @@ void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *); |
2096 |
+ int nes_destroy_cqp(struct nes_device *); |
2097 |
+ int nes_nic_cm_xmit(struct sk_buff *, struct net_device *); |
2098 |
+ void nes_recheck_link_status(struct work_struct *work); |
2099 |
++void nes_terminate_timeout(unsigned long context); |
2100 |
+ |
2101 |
+ /* nes_nic.c */ |
2102 |
+ struct net_device *nes_netdev_init(struct nes_device *, void __iomem *); |
2103 |
+diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c |
2104 |
+index 96fa9a4..ba4814a 100644 |
2105 |
+--- a/drivers/infiniband/hw/nes/nes_hw.c |
2106 |
++++ b/drivers/infiniband/hw/nes/nes_hw.c |
2107 |
+@@ -75,7 +75,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, |
2108 |
+ static void process_critical_error(struct nes_device *nesdev); |
2109 |
+ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number); |
2110 |
+ static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode); |
2111 |
+-static void nes_terminate_timeout(unsigned long context); |
2112 |
+ static void nes_terminate_start_timer(struct nes_qp *nesqp); |
2113 |
+ |
2114 |
+ #ifdef CONFIG_INFINIBAND_NES_DEBUG |
2115 |
+@@ -3496,7 +3495,7 @@ static void nes_terminate_received(struct nes_device *nesdev, |
2116 |
+ } |
2117 |
+ |
2118 |
+ /* Timeout routine in case terminate fails to complete */ |
2119 |
+-static void nes_terminate_timeout(unsigned long context) |
2120 |
++void nes_terminate_timeout(unsigned long context) |
2121 |
+ { |
2122 |
+ struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context; |
2123 |
+ |
2124 |
+@@ -3506,11 +3505,7 @@ static void nes_terminate_timeout(unsigned long context) |
2125 |
+ /* Set a timer in case hw cannot complete the terminate sequence */ |
2126 |
+ static void nes_terminate_start_timer(struct nes_qp *nesqp) |
2127 |
+ { |
2128 |
+- init_timer(&nesqp->terminate_timer); |
2129 |
+- nesqp->terminate_timer.function = nes_terminate_timeout; |
2130 |
+- nesqp->terminate_timer.expires = jiffies + HZ; |
2131 |
+- nesqp->terminate_timer.data = (unsigned long)nesqp; |
2132 |
+- add_timer(&nesqp->terminate_timer); |
2133 |
++ mod_timer(&nesqp->terminate_timer, (jiffies + HZ)); |
2134 |
+ } |
2135 |
+ |
2136 |
+ /** |
2137 |
+diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c |
2138 |
+index 95ca93c..59db49f 100644 |
2139 |
+--- a/drivers/infiniband/hw/nes/nes_verbs.c |
2140 |
++++ b/drivers/infiniband/hw/nes/nes_verbs.c |
2141 |
+@@ -1414,6 +1414,9 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, |
2142 |
+ } |
2143 |
+ |
2144 |
+ nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR); |
2145 |
++ init_timer(&nesqp->terminate_timer); |
2146 |
++ nesqp->terminate_timer.function = nes_terminate_timeout; |
2147 |
++ nesqp->terminate_timer.data = (unsigned long)nesqp; |
2148 |
+ |
2149 |
+ /* update the QP table */ |
2150 |
+ nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp; |
2151 |
+@@ -1423,7 +1426,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, |
2152 |
+ return &nesqp->ibqp; |
2153 |
+ } |
2154 |
+ |
2155 |
+- |
2156 |
+ /** |
2157 |
+ * nes_clean_cq |
2158 |
+ */ |
2159 |
+@@ -2568,6 +2570,11 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, |
2160 |
+ return ibmr; |
2161 |
+ case IWNES_MEMREG_TYPE_QP: |
2162 |
+ case IWNES_MEMREG_TYPE_CQ: |
2163 |
++ if (!region->length) { |
2164 |
++ nes_debug(NES_DBG_MR, "Unable to register zero length region for CQ\n"); |
2165 |
++ ib_umem_release(region); |
2166 |
++ return ERR_PTR(-EINVAL); |
2167 |
++ } |
2168 |
+ nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL); |
2169 |
+ if (!nespbl) { |
2170 |
+ nes_debug(NES_DBG_MR, "Unable to allocate PBL\n"); |
2171 |
+diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c |
2172 |
+index 4cacdad..bd3b294 100644 |
2173 |
+--- a/drivers/md/dm-ioctl.c |
2174 |
++++ b/drivers/md/dm-ioctl.c |
2175 |
+@@ -1524,6 +1524,14 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl **param) |
2176 |
+ if (copy_from_user(dmi, user, tmp.data_size)) |
2177 |
+ goto bad; |
2178 |
+ |
2179 |
++ /* |
2180 |
++ * Abort if something changed the ioctl data while it was being copied. |
2181 |
++ */ |
2182 |
++ if (dmi->data_size != tmp.data_size) { |
2183 |
++ DMERR("rejecting ioctl: data size modified while processing parameters"); |
2184 |
++ goto bad; |
2185 |
++ } |
2186 |
++ |
2187 |
+ /* Wipe the user buffer so we do not return it to userspace */ |
2188 |
+ if (secure_data && clear_user(user, tmp.data_size)) |
2189 |
+ goto bad; |
2190 |
+diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c |
2191 |
+index acf9dad..b36aadb 100644 |
2192 |
+--- a/drivers/mfd/mfd-core.c |
2193 |
++++ b/drivers/mfd/mfd-core.c |
2194 |
+@@ -18,6 +18,10 @@ |
2195 |
+ #include <linux/pm_runtime.h> |
2196 |
+ #include <linux/slab.h> |
2197 |
+ |
2198 |
++static struct device_type mfd_dev_type = { |
2199 |
++ .name = "mfd_device", |
2200 |
++}; |
2201 |
++ |
2202 |
+ int mfd_cell_enable(struct platform_device *pdev) |
2203 |
+ { |
2204 |
+ const struct mfd_cell *cell = mfd_get_cell(pdev); |
2205 |
+@@ -87,6 +91,7 @@ static int mfd_add_device(struct device *parent, int id, |
2206 |
+ goto fail_device; |
2207 |
+ |
2208 |
+ pdev->dev.parent = parent; |
2209 |
++ pdev->dev.type = &mfd_dev_type; |
2210 |
+ |
2211 |
+ if (cell->pdata_size) { |
2212 |
+ ret = platform_device_add_data(pdev, |
2213 |
+@@ -182,10 +187,16 @@ EXPORT_SYMBOL(mfd_add_devices); |
2214 |
+ |
2215 |
+ static int mfd_remove_devices_fn(struct device *dev, void *c) |
2216 |
+ { |
2217 |
+- struct platform_device *pdev = to_platform_device(dev); |
2218 |
+- const struct mfd_cell *cell = mfd_get_cell(pdev); |
2219 |
++ struct platform_device *pdev; |
2220 |
++ const struct mfd_cell *cell; |
2221 |
+ atomic_t **usage_count = c; |
2222 |
+ |
2223 |
++ if (dev->type != &mfd_dev_type) |
2224 |
++ return 0; |
2225 |
++ |
2226 |
++ pdev = to_platform_device(dev); |
2227 |
++ cell = mfd_get_cell(pdev); |
2228 |
++ |
2229 |
+ /* find the base address of usage_count pointers (for freeing) */ |
2230 |
+ if (!*usage_count || (cell->usage_count < *usage_count)) |
2231 |
+ *usage_count = cell->usage_count; |
2232 |
+diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h |
2233 |
+index 6650fde..9f1e947 100644 |
2234 |
+--- a/drivers/net/wimax/i2400m/i2400m-usb.h |
2235 |
++++ b/drivers/net/wimax/i2400m/i2400m-usb.h |
2236 |
+@@ -152,6 +152,9 @@ enum { |
2237 |
+ /* Device IDs */ |
2238 |
+ USB_DEVICE_ID_I6050 = 0x0186, |
2239 |
+ USB_DEVICE_ID_I6050_2 = 0x0188, |
2240 |
++ USB_DEVICE_ID_I6150 = 0x07d6, |
2241 |
++ USB_DEVICE_ID_I6150_2 = 0x07d7, |
2242 |
++ USB_DEVICE_ID_I6150_3 = 0x07d9, |
2243 |
+ USB_DEVICE_ID_I6250 = 0x0187, |
2244 |
+ }; |
2245 |
+ |
2246 |
+diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c |
2247 |
+index 298f2b0..0ddc8db 100644 |
2248 |
+--- a/drivers/net/wimax/i2400m/usb.c |
2249 |
++++ b/drivers/net/wimax/i2400m/usb.c |
2250 |
+@@ -491,6 +491,9 @@ int i2400mu_probe(struct usb_interface *iface, |
2251 |
+ switch (id->idProduct) { |
2252 |
+ case USB_DEVICE_ID_I6050: |
2253 |
+ case USB_DEVICE_ID_I6050_2: |
2254 |
++ case USB_DEVICE_ID_I6150: |
2255 |
++ case USB_DEVICE_ID_I6150_2: |
2256 |
++ case USB_DEVICE_ID_I6150_3: |
2257 |
+ case USB_DEVICE_ID_I6250: |
2258 |
+ i2400mu->i6050 = 1; |
2259 |
+ break; |
2260 |
+@@ -740,6 +743,9 @@ static |
2261 |
+ struct usb_device_id i2400mu_id_table[] = { |
2262 |
+ { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, |
2263 |
+ { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, |
2264 |
++ { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150) }, |
2265 |
++ { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_2) }, |
2266 |
++ { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_3) }, |
2267 |
+ { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) }, |
2268 |
+ { USB_DEVICE(0x8086, 0x0181) }, |
2269 |
+ { USB_DEVICE(0x8086, 0x1403) }, |
2270 |
+diff --git a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |
2271 |
+index 029773c..c84c493 100644 |
2272 |
+--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |
2273 |
++++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |
2274 |
+@@ -34,98 +34,98 @@ static const u32 ar9300_2p2_radio_postamble[][5] = { |
2275 |
+ |
2276 |
+ static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p2[][5] = { |
2277 |
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ |
2278 |
+- {0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, |
2279 |
+- {0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, |
2280 |
+- {0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, |
2281 |
++ {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, |
2282 |
++ {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, |
2283 |
++ {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, |
2284 |
+ {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, |
2285 |
+- {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, |
2286 |
+- {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
2287 |
+- {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, |
2288 |
+- {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, |
2289 |
+- {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, |
2290 |
+- {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, |
2291 |
+- {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, |
2292 |
+- {0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402}, |
2293 |
+- {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404}, |
2294 |
+- {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, |
2295 |
+- {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, |
2296 |
+- {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, |
2297 |
+- {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, |
2298 |
+- {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, |
2299 |
+- {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, |
2300 |
+- {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, |
2301 |
+- {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, |
2302 |
+- {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, |
2303 |
+- {0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861}, |
2304 |
+- {0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81}, |
2305 |
+- {0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83}, |
2306 |
+- {0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84}, |
2307 |
+- {0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3}, |
2308 |
+- {0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5}, |
2309 |
+- {0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9}, |
2310 |
+- {0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb}, |
2311 |
+- {0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
2312 |
+- {0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
2313 |
+- {0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
2314 |
+- {0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
2315 |
+- {0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
2316 |
+- {0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
2317 |
+- {0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec}, |
2318 |
+- {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, |
2319 |
+- {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002}, |
2320 |
+- {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004}, |
2321 |
+- {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200}, |
2322 |
+- {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202}, |
2323 |
+- {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400}, |
2324 |
+- {0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402}, |
2325 |
+- {0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404}, |
2326 |
+- {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603}, |
2327 |
+- {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02}, |
2328 |
+- {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04}, |
2329 |
+- {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20}, |
2330 |
+- {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20}, |
2331 |
+- {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22}, |
2332 |
+- {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24}, |
2333 |
+- {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640}, |
2334 |
+- {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660}, |
2335 |
+- {0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861}, |
2336 |
+- {0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81}, |
2337 |
+- {0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83}, |
2338 |
+- {0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84}, |
2339 |
+- {0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3}, |
2340 |
+- {0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5}, |
2341 |
+- {0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9}, |
2342 |
+- {0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb}, |
2343 |
+- {0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
2344 |
+- {0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
2345 |
+- {0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
2346 |
+- {0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
2347 |
+- {0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
2348 |
+- {0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
2349 |
+- {0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec}, |
2350 |
++ {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9}, |
2351 |
++ {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, |
2352 |
++ {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002}, |
2353 |
++ {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004}, |
2354 |
++ {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200}, |
2355 |
++ {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202}, |
2356 |
++ {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400}, |
2357 |
++ {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402}, |
2358 |
++ {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404}, |
2359 |
++ {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603}, |
2360 |
++ {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02}, |
2361 |
++ {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04}, |
2362 |
++ {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20}, |
2363 |
++ {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20}, |
2364 |
++ {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22}, |
2365 |
++ {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24}, |
2366 |
++ {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640}, |
2367 |
++ {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660}, |
2368 |
++ {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861}, |
2369 |
++ {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81}, |
2370 |
++ {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83}, |
2371 |
++ {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84}, |
2372 |
++ {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3}, |
2373 |
++ {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5}, |
2374 |
++ {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9}, |
2375 |
++ {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb}, |
2376 |
++ {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, |
2377 |
++ {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, |
2378 |
++ {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, |
2379 |
++ {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, |
2380 |
++ {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, |
2381 |
++ {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, |
2382 |
++ {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec}, |
2383 |
++ {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000}, |
2384 |
++ {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002}, |
2385 |
++ {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004}, |
2386 |
++ {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200}, |
2387 |
++ {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202}, |
2388 |
++ {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400}, |
2389 |
++ {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402}, |
2390 |
++ {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404}, |
2391 |
++ {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603}, |
2392 |
++ {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02}, |
2393 |
++ {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04}, |
2394 |
++ {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20}, |
2395 |
++ {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20}, |
2396 |
++ {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22}, |
2397 |
++ {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24}, |
2398 |
++ {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640}, |
2399 |
++ {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660}, |
2400 |
++ {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861}, |
2401 |
++ {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81}, |
2402 |
++ {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83}, |
2403 |
++ {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84}, |
2404 |
++ {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3}, |
2405 |
++ {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5}, |
2406 |
++ {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9}, |
2407 |
++ {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb}, |
2408 |
++ {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, |
2409 |
++ {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, |
2410 |
++ {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, |
2411 |
++ {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, |
2412 |
++ {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, |
2413 |
++ {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, |
2414 |
++ {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec}, |
2415 |
+ {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
2416 |
+ {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
2417 |
+ {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
2418 |
+ {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
2419 |
+- {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
2420 |
+- {0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000}, |
2421 |
+- {0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501}, |
2422 |
+- {0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501}, |
2423 |
+- {0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03}, |
2424 |
+- {0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04}, |
2425 |
+- {0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04}, |
2426 |
+- {0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
2427 |
+- {0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
2428 |
+- {0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
2429 |
+- {0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
2430 |
+- {0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005}, |
2431 |
+- {0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, |
2432 |
+- {0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, |
2433 |
+- {0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, |
2434 |
++ {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000}, |
2435 |
++ {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000}, |
2436 |
++ {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501}, |
2437 |
++ {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501}, |
2438 |
++ {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03}, |
2439 |
++ {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04}, |
2440 |
++ {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04}, |
2441 |
++ {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, |
2442 |
++ {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, |
2443 |
++ {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, |
2444 |
++ {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, |
2445 |
++ {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005}, |
2446 |
++ {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, |
2447 |
++ {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, |
2448 |
++ {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, |
2449 |
+ {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, |
2450 |
+- {0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352}, |
2451 |
+- {0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584}, |
2452 |
+- {0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800}, |
2453 |
++ {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352}, |
2454 |
++ {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584}, |
2455 |
++ {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800}, |
2456 |
+ {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000}, |
2457 |
+ {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, |
2458 |
+ {0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001}, |
2459 |
+diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h |
2460 |
+index ab21a49..7f7bc94 100644 |
2461 |
+--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h |
2462 |
++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h |
2463 |
+@@ -69,13 +69,13 @@ |
2464 |
+ #define AR9300_BASE_ADDR 0x3ff |
2465 |
+ #define AR9300_BASE_ADDR_512 0x1ff |
2466 |
+ |
2467 |
+-#define AR9300_OTP_BASE 0x14000 |
2468 |
+-#define AR9300_OTP_STATUS 0x15f18 |
2469 |
++#define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000) |
2470 |
++#define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18) |
2471 |
+ #define AR9300_OTP_STATUS_TYPE 0x7 |
2472 |
+ #define AR9300_OTP_STATUS_VALID 0x4 |
2473 |
+ #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 |
2474 |
+ #define AR9300_OTP_STATUS_SM_BUSY 0x1 |
2475 |
+-#define AR9300_OTP_READ_DATA 0x15f1c |
2476 |
++#define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c) |
2477 |
+ |
2478 |
+ enum targetPowerHTRates { |
2479 |
+ HT_TARGET_RATE_0_8_16, |
2480 |
+diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c |
2481 |
+index 0b4dbcd..3f9a891 100644 |
2482 |
+--- a/drivers/pci/intel-iommu.c |
2483 |
++++ b/drivers/pci/intel-iommu.c |
2484 |
+@@ -1793,10 +1793,17 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, |
2485 |
+ if (!pte) |
2486 |
+ return -ENOMEM; |
2487 |
+ /* It is large page*/ |
2488 |
+- if (largepage_lvl > 1) |
2489 |
++ if (largepage_lvl > 1) { |
2490 |
+ pteval |= DMA_PTE_LARGE_PAGE; |
2491 |
+- else |
2492 |
++ /* Ensure that old small page tables are removed to make room |
2493 |
++ for superpage, if they exist. */ |
2494 |
++ dma_pte_clear_range(domain, iov_pfn, |
2495 |
++ iov_pfn + lvl_to_nr_pages(largepage_lvl) - 1); |
2496 |
++ dma_pte_free_pagetable(domain, iov_pfn, |
2497 |
++ iov_pfn + lvl_to_nr_pages(largepage_lvl) - 1); |
2498 |
++ } else { |
2499 |
+ pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE; |
2500 |
++ } |
2501 |
+ |
2502 |
+ } |
2503 |
+ /* We don't need lock here, nobody else |
2504 |
+diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c |
2505 |
+index 07a4fd2..daa6b90 100644 |
2506 |
+--- a/drivers/s390/cio/device_pgid.c |
2507 |
++++ b/drivers/s390/cio/device_pgid.c |
2508 |
+@@ -234,7 +234,7 @@ static int pgid_cmp(struct pgid *p1, struct pgid *p2) |
2509 |
+ * Determine pathgroup state from PGID data. |
2510 |
+ */ |
2511 |
+ static void pgid_analyze(struct ccw_device *cdev, struct pgid **p, |
2512 |
+- int *mismatch, int *reserved, u8 *reset) |
2513 |
++ int *mismatch, u8 *reserved, u8 *reset) |
2514 |
+ { |
2515 |
+ struct pgid *pgid = &cdev->private->pgid[0]; |
2516 |
+ struct pgid *first = NULL; |
2517 |
+@@ -248,7 +248,7 @@ static void pgid_analyze(struct ccw_device *cdev, struct pgid **p, |
2518 |
+ if ((cdev->private->pgid_valid_mask & lpm) == 0) |
2519 |
+ continue; |
2520 |
+ if (pgid->inf.ps.state2 == SNID_STATE2_RESVD_ELSE) |
2521 |
+- *reserved = 1; |
2522 |
++ *reserved |= lpm; |
2523 |
+ if (pgid_is_reset(pgid)) { |
2524 |
+ *reset |= lpm; |
2525 |
+ continue; |
2526 |
+@@ -316,14 +316,14 @@ static void snid_done(struct ccw_device *cdev, int rc) |
2527 |
+ struct subchannel *sch = to_subchannel(cdev->dev.parent); |
2528 |
+ struct pgid *pgid; |
2529 |
+ int mismatch = 0; |
2530 |
+- int reserved = 0; |
2531 |
++ u8 reserved = 0; |
2532 |
+ u8 reset = 0; |
2533 |
+ u8 donepm; |
2534 |
+ |
2535 |
+ if (rc) |
2536 |
+ goto out; |
2537 |
+ pgid_analyze(cdev, &pgid, &mismatch, &reserved, &reset); |
2538 |
+- if (reserved) |
2539 |
++ if (reserved == cdev->private->pgid_valid_mask) |
2540 |
+ rc = -EUSERS; |
2541 |
+ else if (mismatch) |
2542 |
+ rc = -EOPNOTSUPP; |
2543 |
+@@ -336,7 +336,7 @@ static void snid_done(struct ccw_device *cdev, int rc) |
2544 |
+ } |
2545 |
+ out: |
2546 |
+ CIO_MSG_EVENT(2, "snid: device 0.%x.%04x: rc=%d pvm=%02x vpm=%02x " |
2547 |
+- "todo=%02x mism=%d rsvd=%d reset=%02x\n", id->ssid, |
2548 |
++ "todo=%02x mism=%d rsvd=%02x reset=%02x\n", id->ssid, |
2549 |
+ id->devno, rc, cdev->private->pgid_valid_mask, sch->vpm, |
2550 |
+ cdev->private->pgid_todo_mask, mismatch, reserved, reset); |
2551 |
+ switch (rc) { |
2552 |
+diff --git a/drivers/scsi/mvsas/mv_94xx.h b/drivers/scsi/mvsas/mv_94xx.h |
2553 |
+index 8835bef..d72aa61 100644 |
2554 |
+--- a/drivers/scsi/mvsas/mv_94xx.h |
2555 |
++++ b/drivers/scsi/mvsas/mv_94xx.h |
2556 |
+@@ -193,21 +193,11 @@ struct mvs_prd { |
2557 |
+ #define SPI_ADDR_VLD_94XX (1U << 1) |
2558 |
+ #define SPI_CTRL_SpiStart_94XX (1U << 0) |
2559 |
+ |
2560 |
+-#define mv_ffc(x) ffz(x) |
2561 |
+- |
2562 |
+ static inline int |
2563 |
+ mv_ffc64(u64 v) |
2564 |
+ { |
2565 |
+- int i; |
2566 |
+- i = mv_ffc((u32)v); |
2567 |
+- if (i >= 0) |
2568 |
+- return i; |
2569 |
+- i = mv_ffc((u32)(v>>32)); |
2570 |
+- |
2571 |
+- if (i != 0) |
2572 |
+- return 32 + i; |
2573 |
+- |
2574 |
+- return -1; |
2575 |
++ u64 x = ~v; |
2576 |
++ return x ? __ffs64(x) : -1; |
2577 |
+ } |
2578 |
+ |
2579 |
+ #define r_reg_set_enable(i) \ |
2580 |
+diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h |
2581 |
+index 1367d8b..efc6965 100644 |
2582 |
+--- a/drivers/scsi/mvsas/mv_sas.h |
2583 |
++++ b/drivers/scsi/mvsas/mv_sas.h |
2584 |
+@@ -73,7 +73,7 @@ extern struct kmem_cache *mvs_task_list_cache; |
2585 |
+ #define DEV_IS_EXPANDER(type) \ |
2586 |
+ ((type == EDGE_DEV) || (type == FANOUT_DEV)) |
2587 |
+ |
2588 |
+-#define bit(n) ((u32)1 << n) |
2589 |
++#define bit(n) ((u64)1 << n) |
2590 |
+ |
2591 |
+ #define for_each_phy(__lseq_mask, __mc, __lseq) \ |
2592 |
+ for ((__mc) = (__lseq_mask), (__lseq) = 0; \ |
2593 |
+diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c |
2594 |
+index a2a1a83..7e78020 100644 |
2595 |
+--- a/drivers/scsi/qla2xxx/qla_os.c |
2596 |
++++ b/drivers/scsi/qla2xxx/qla_os.c |
2597 |
+@@ -3406,9 +3406,9 @@ qla2x00_do_dpc(void *data) |
2598 |
+ base_vha->host_no)); |
2599 |
+ } |
2600 |
+ |
2601 |
+- if (test_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags)) { |
2602 |
++ if (test_and_clear_bit(FCPORT_UPDATE_NEEDED, |
2603 |
++ &base_vha->dpc_flags)) { |
2604 |
+ qla2x00_update_fcports(base_vha); |
2605 |
+- clear_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags); |
2606 |
+ } |
2607 |
+ |
2608 |
+ if (test_bit(ISP_QUIESCE_NEEDED, &base_vha->dpc_flags)) { |
2609 |
+diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig |
2610 |
+index 20008a4..727b207d 100644 |
2611 |
+--- a/drivers/staging/comedi/Kconfig |
2612 |
++++ b/drivers/staging/comedi/Kconfig |
2613 |
+@@ -424,6 +424,7 @@ config COMEDI_ADQ12B |
2614 |
+ |
2615 |
+ config COMEDI_NI_AT_A2150 |
2616 |
+ tristate "NI AT-A2150 ISA card support" |
2617 |
++ select COMEDI_FC |
2618 |
+ depends on COMEDI_NI_COMMON |
2619 |
+ depends on VIRT_TO_BUS |
2620 |
+ default N |
2621 |
+diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c |
2622 |
+index d80b90f..39be673 100644 |
2623 |
+--- a/drivers/staging/comedi/comedi_fops.c |
2624 |
++++ b/drivers/staging/comedi/comedi_fops.c |
2625 |
+@@ -138,6 +138,9 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd, |
2626 |
+ if (cmd == COMEDI_DEVCONFIG) { |
2627 |
+ rc = do_devconfig_ioctl(dev, |
2628 |
+ (struct comedi_devconfig __user *)arg); |
2629 |
++ if (rc == 0) |
2630 |
++ /* Evade comedi_auto_unconfig(). */ |
2631 |
++ dev_file_info->hardware_device = NULL; |
2632 |
+ goto done; |
2633 |
+ } |
2634 |
+ |
2635 |
+@@ -2207,6 +2210,7 @@ int comedi_alloc_board_minor(struct device *hardware_device) |
2636 |
+ kfree(info); |
2637 |
+ return -ENOMEM; |
2638 |
+ } |
2639 |
++ info->hardware_device = hardware_device; |
2640 |
+ comedi_device_init(info->device); |
2641 |
+ spin_lock_irqsave(&comedi_file_info_table_lock, flags); |
2642 |
+ for (i = 0; i < COMEDI_NUM_BOARD_MINORS; ++i) { |
2643 |
+@@ -2296,6 +2300,23 @@ void comedi_free_board_minor(unsigned minor) |
2644 |
+ } |
2645 |
+ } |
2646 |
+ |
2647 |
++int comedi_find_board_minor(struct device *hardware_device) |
2648 |
++{ |
2649 |
++ int minor; |
2650 |
++ struct comedi_device_file_info *info; |
2651 |
++ |
2652 |
++ for (minor = 0; minor < COMEDI_NUM_BOARD_MINORS; minor++) { |
2653 |
++ spin_lock(&comedi_file_info_table_lock); |
2654 |
++ info = comedi_file_info_table[minor]; |
2655 |
++ if (info && info->hardware_device == hardware_device) { |
2656 |
++ spin_unlock(&comedi_file_info_table_lock); |
2657 |
++ return minor; |
2658 |
++ } |
2659 |
++ spin_unlock(&comedi_file_info_table_lock); |
2660 |
++ } |
2661 |
++ return -ENODEV; |
2662 |
++} |
2663 |
++ |
2664 |
+ int comedi_alloc_subdevice_minor(struct comedi_device *dev, |
2665 |
+ struct comedi_subdevice *s) |
2666 |
+ { |
2667 |
+diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h |
2668 |
+index 68aa917..5f2745e 100644 |
2669 |
+--- a/drivers/staging/comedi/comedidev.h |
2670 |
++++ b/drivers/staging/comedi/comedidev.h |
2671 |
+@@ -237,6 +237,7 @@ struct comedi_device_file_info { |
2672 |
+ struct comedi_device *device; |
2673 |
+ struct comedi_subdevice *read_subdevice; |
2674 |
+ struct comedi_subdevice *write_subdevice; |
2675 |
++ struct device *hardware_device; |
2676 |
+ }; |
2677 |
+ |
2678 |
+ #ifdef CONFIG_COMEDI_DEBUG |
2679 |
+diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c |
2680 |
+index 6d60e91..f9b0286 100644 |
2681 |
+--- a/drivers/staging/comedi/drivers.c |
2682 |
++++ b/drivers/staging/comedi/drivers.c |
2683 |
+@@ -819,25 +819,14 @@ static int comedi_auto_config(struct device *hardware_device, |
2684 |
+ int minor; |
2685 |
+ struct comedi_device_file_info *dev_file_info; |
2686 |
+ int retval; |
2687 |
+- unsigned *private_data = NULL; |
2688 |
+ |
2689 |
+- if (!comedi_autoconfig) { |
2690 |
+- dev_set_drvdata(hardware_device, NULL); |
2691 |
++ if (!comedi_autoconfig) |
2692 |
+ return 0; |
2693 |
+- } |
2694 |
+ |
2695 |
+ minor = comedi_alloc_board_minor(hardware_device); |
2696 |
+ if (minor < 0) |
2697 |
+ return minor; |
2698 |
+ |
2699 |
+- private_data = kmalloc(sizeof(unsigned), GFP_KERNEL); |
2700 |
+- if (private_data == NULL) { |
2701 |
+- retval = -ENOMEM; |
2702 |
+- goto cleanup; |
2703 |
+- } |
2704 |
+- *private_data = minor; |
2705 |
+- dev_set_drvdata(hardware_device, private_data); |
2706 |
+- |
2707 |
+ dev_file_info = comedi_get_device_file_info(minor); |
2708 |
+ |
2709 |
+ memset(&it, 0, sizeof(it)); |
2710 |
+@@ -850,25 +839,22 @@ static int comedi_auto_config(struct device *hardware_device, |
2711 |
+ retval = comedi_device_attach(dev_file_info->device, &it); |
2712 |
+ mutex_unlock(&dev_file_info->device->mutex); |
2713 |
+ |
2714 |
+-cleanup: |
2715 |
+- if (retval < 0) { |
2716 |
+- kfree(private_data); |
2717 |
++ if (retval < 0) |
2718 |
+ comedi_free_board_minor(minor); |
2719 |
+- } |
2720 |
+ return retval; |
2721 |
+ } |
2722 |
+ |
2723 |
+ static void comedi_auto_unconfig(struct device *hardware_device) |
2724 |
+ { |
2725 |
+- unsigned *minor = (unsigned *)dev_get_drvdata(hardware_device); |
2726 |
+- if (minor == NULL) |
2727 |
+- return; |
2728 |
+- |
2729 |
+- BUG_ON(*minor >= COMEDI_NUM_BOARD_MINORS); |
2730 |
++ int minor; |
2731 |
+ |
2732 |
+- comedi_free_board_minor(*minor); |
2733 |
+- dev_set_drvdata(hardware_device, NULL); |
2734 |
+- kfree(minor); |
2735 |
++ if (hardware_device == NULL) |
2736 |
++ return; |
2737 |
++ minor = comedi_find_board_minor(hardware_device); |
2738 |
++ if (minor < 0) |
2739 |
++ return; |
2740 |
++ BUG_ON(minor >= COMEDI_NUM_BOARD_MINORS); |
2741 |
++ comedi_free_board_minor(minor); |
2742 |
+ } |
2743 |
+ |
2744 |
+ int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name) |
2745 |
+diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c |
2746 |
+index a804742..2567f9a 100644 |
2747 |
+--- a/drivers/staging/comedi/drivers/comedi_test.c |
2748 |
++++ b/drivers/staging/comedi/drivers/comedi_test.c |
2749 |
+@@ -461,7 +461,7 @@ static int waveform_ai_cancel(struct comedi_device *dev, |
2750 |
+ struct comedi_subdevice *s) |
2751 |
+ { |
2752 |
+ devpriv->timer_running = 0; |
2753 |
+- del_timer(&devpriv->timer); |
2754 |
++ del_timer_sync(&devpriv->timer); |
2755 |
+ return 0; |
2756 |
+ } |
2757 |
+ |
2758 |
+diff --git a/drivers/staging/comedi/internal.h b/drivers/staging/comedi/internal.h |
2759 |
+index 434ce34..4208fb4 100644 |
2760 |
+--- a/drivers/staging/comedi/internal.h |
2761 |
++++ b/drivers/staging/comedi/internal.h |
2762 |
+@@ -7,6 +7,7 @@ int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s, |
2763 |
+ struct comedi_insn *insn, unsigned int *data); |
2764 |
+ int comedi_alloc_board_minor(struct device *hardware_device); |
2765 |
+ void comedi_free_board_minor(unsigned minor); |
2766 |
++int comedi_find_board_minor(struct device *hardware_device); |
2767 |
+ void comedi_reset_async_buf(struct comedi_async *async); |
2768 |
+ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, |
2769 |
+ unsigned long new_size); |
2770 |
+diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c |
2771 |
+index 6d88d1a..af28a62 100644 |
2772 |
+--- a/drivers/staging/rtl8712/usb_intf.c |
2773 |
++++ b/drivers/staging/rtl8712/usb_intf.c |
2774 |
+@@ -62,6 +62,8 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = { |
2775 |
+ {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */ |
2776 |
+ /* Belkin */ |
2777 |
+ {USB_DEVICE(0x050D, 0x945A)}, |
2778 |
++ /* ISY IWL - Belkin clone */ |
2779 |
++ {USB_DEVICE(0x050D, 0x11F1)}, |
2780 |
+ /* Corega */ |
2781 |
+ {USB_DEVICE(0x07AA, 0x0047)}, |
2782 |
+ /* D-Link */ |
2783 |
+diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c |
2784 |
+index c241074..7843111 100644 |
2785 |
+--- a/drivers/staging/speakup/synth.c |
2786 |
++++ b/drivers/staging/speakup/synth.c |
2787 |
+@@ -342,7 +342,7 @@ int synth_init(char *synth_name) |
2788 |
+ |
2789 |
+ mutex_lock(&spk_mutex); |
2790 |
+ /* First, check if we already have it loaded. */ |
2791 |
+- for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++) |
2792 |
++ for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++) |
2793 |
+ if (strcmp(synths[i]->name, synth_name) == 0) |
2794 |
+ synth = synths[i]; |
2795 |
+ |
2796 |
+@@ -423,7 +423,7 @@ int synth_add(struct spk_synth *in_synth) |
2797 |
+ int i; |
2798 |
+ int status = 0; |
2799 |
+ mutex_lock(&spk_mutex); |
2800 |
+- for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++) |
2801 |
++ for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++) |
2802 |
+ /* synth_remove() is responsible for rotating the array down */ |
2803 |
+ if (in_synth == synths[i]) { |
2804 |
+ mutex_unlock(&spk_mutex); |
2805 |
+diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c |
2806 |
+index 921dae5..5918ef7 100644 |
2807 |
+--- a/drivers/staging/vt6656/dpc.c |
2808 |
++++ b/drivers/staging/vt6656/dpc.c |
2809 |
+@@ -1256,7 +1256,7 @@ static BOOL s_bHandleRxEncryption ( |
2810 |
+ |
2811 |
+ PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc |
2812 |
+ *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4)); |
2813 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16); |
2814 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16); |
2815 |
+ if (byDecMode == KEY_CTL_TKIP) { |
2816 |
+ *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV)); |
2817 |
+ } else { |
2818 |
+@@ -1367,7 +1367,7 @@ static BOOL s_bHostWepRxEncryption ( |
2819 |
+ |
2820 |
+ PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc |
2821 |
+ *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4)); |
2822 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16); |
2823 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16); |
2824 |
+ |
2825 |
+ if (byDecMode == KEY_CTL_TKIP) { |
2826 |
+ *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV)); |
2827 |
+diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c |
2828 |
+index 27bb523..fd93e83 100644 |
2829 |
+--- a/drivers/staging/vt6656/key.c |
2830 |
++++ b/drivers/staging/vt6656/key.c |
2831 |
+@@ -223,7 +223,7 @@ BOOL KeybSetKey( |
2832 |
+ PSKeyManagement pTable, |
2833 |
+ PBYTE pbyBSSID, |
2834 |
+ DWORD dwKeyIndex, |
2835 |
+- unsigned long uKeyLength, |
2836 |
++ u32 uKeyLength, |
2837 |
+ PQWORD pKeyRSC, |
2838 |
+ PBYTE pbyKey, |
2839 |
+ BYTE byKeyDecMode |
2840 |
+@@ -235,7 +235,8 @@ BOOL KeybSetKey( |
2841 |
+ PSKeyItem pKey; |
2842 |
+ unsigned int uKeyIdx; |
2843 |
+ |
2844 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetKey: %lX\n", dwKeyIndex); |
2845 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO |
2846 |
++ "Enter KeybSetKey: %X\n", dwKeyIndex); |
2847 |
+ |
2848 |
+ j = (MAX_KEY_TABLE-1); |
2849 |
+ for (i=0;i<(MAX_KEY_TABLE-1);i++) { |
2850 |
+@@ -261,7 +262,9 @@ BOOL KeybSetKey( |
2851 |
+ if ((dwKeyIndex & TRANSMIT_KEY) != 0) { |
2852 |
+ // Group transmit key |
2853 |
+ pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex; |
2854 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i); |
2855 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO |
2856 |
++ "Group transmit key(R)[%X]: %d\n", |
2857 |
++ pTable->KeyTable[i].dwGTKeyIndex, i); |
2858 |
+ } |
2859 |
+ pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed |
2860 |
+ pTable->KeyTable[i].wKeyCtl |= (byKeyDecMode << 4); |
2861 |
+@@ -302,9 +305,12 @@ BOOL KeybSetKey( |
2862 |
+ } |
2863 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); |
2864 |
+ |
2865 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); |
2866 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); |
2867 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); |
2868 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n ", |
2869 |
++ pKey->dwTSC47_16); |
2870 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", |
2871 |
++ pKey->wTSC15_0); |
2872 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n ", |
2873 |
++ pKey->dwKeyIndex); |
2874 |
+ |
2875 |
+ return (TRUE); |
2876 |
+ } |
2877 |
+@@ -326,7 +332,9 @@ BOOL KeybSetKey( |
2878 |
+ if ((dwKeyIndex & TRANSMIT_KEY) != 0) { |
2879 |
+ // Group transmit key |
2880 |
+ pTable->KeyTable[j].dwGTKeyIndex = dwKeyIndex; |
2881 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(N)[%lX]: %d\n", pTable->KeyTable[j].dwGTKeyIndex, j); |
2882 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO |
2883 |
++ "Group transmit key(N)[%X]: %d\n", |
2884 |
++ pTable->KeyTable[j].dwGTKeyIndex, j); |
2885 |
+ } |
2886 |
+ pTable->KeyTable[j].wKeyCtl &= 0xFF0F; // clear group key control filed |
2887 |
+ pTable->KeyTable[j].wKeyCtl |= (byKeyDecMode << 4); |
2888 |
+@@ -367,9 +375,11 @@ BOOL KeybSetKey( |
2889 |
+ } |
2890 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); |
2891 |
+ |
2892 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16); |
2893 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n ", |
2894 |
++ pKey->dwTSC47_16); |
2895 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); |
2896 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); |
2897 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n ", |
2898 |
++ pKey->dwKeyIndex); |
2899 |
+ |
2900 |
+ return (TRUE); |
2901 |
+ } |
2902 |
+@@ -597,7 +607,8 @@ BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType, |
2903 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%x ", pTable->KeyTable[i].abyBSSID[ii]); |
2904 |
+ } |
2905 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); |
2906 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex); |
2907 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %X\n", |
2908 |
++ pTable->KeyTable[i].dwGTKeyIndex); |
2909 |
+ |
2910 |
+ return (TRUE); |
2911 |
+ } |
2912 |
+@@ -664,7 +675,7 @@ BOOL KeybSetDefaultKey( |
2913 |
+ void *pDeviceHandler, |
2914 |
+ PSKeyManagement pTable, |
2915 |
+ DWORD dwKeyIndex, |
2916 |
+- unsigned long uKeyLength, |
2917 |
++ u32 uKeyLength, |
2918 |
+ PQWORD pKeyRSC, |
2919 |
+ PBYTE pbyKey, |
2920 |
+ BYTE byKeyDecMode |
2921 |
+@@ -693,7 +704,10 @@ BOOL KeybSetDefaultKey( |
2922 |
+ if ((dwKeyIndex & TRANSMIT_KEY) != 0) { |
2923 |
+ // Group transmit key |
2924 |
+ pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex = dwKeyIndex; |
2925 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, MAX_KEY_TABLE-1); |
2926 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO |
2927 |
++ "Group transmit key(R)[%X]: %d\n", |
2928 |
++ pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, |
2929 |
++ MAX_KEY_TABLE-1); |
2930 |
+ |
2931 |
+ } |
2932 |
+ pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl &= 0x7F00; // clear all key control filed |
2933 |
+@@ -744,9 +758,11 @@ BOOL KeybSetDefaultKey( |
2934 |
+ } |
2935 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); |
2936 |
+ |
2937 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16); |
2938 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n", |
2939 |
++ pKey->dwTSC47_16); |
2940 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n", pKey->wTSC15_0); |
2941 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex); |
2942 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n", |
2943 |
++ pKey->dwKeyIndex); |
2944 |
+ |
2945 |
+ return (TRUE); |
2946 |
+ } |
2947 |
+@@ -772,7 +788,7 @@ BOOL KeybSetAllGroupKey( |
2948 |
+ void *pDeviceHandler, |
2949 |
+ PSKeyManagement pTable, |
2950 |
+ DWORD dwKeyIndex, |
2951 |
+- unsigned long uKeyLength, |
2952 |
++ u32 uKeyLength, |
2953 |
+ PQWORD pKeyRSC, |
2954 |
+ PBYTE pbyKey, |
2955 |
+ BYTE byKeyDecMode |
2956 |
+@@ -784,7 +800,8 @@ BOOL KeybSetAllGroupKey( |
2957 |
+ PSKeyItem pKey; |
2958 |
+ unsigned int uKeyIdx; |
2959 |
+ |
2960 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex); |
2961 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %X\n", |
2962 |
++ dwKeyIndex); |
2963 |
+ |
2964 |
+ |
2965 |
+ if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key |
2966 |
+@@ -801,7 +818,9 @@ BOOL KeybSetAllGroupKey( |
2967 |
+ if ((dwKeyIndex & TRANSMIT_KEY) != 0) { |
2968 |
+ // Group transmit key |
2969 |
+ pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex; |
2970 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i); |
2971 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO |
2972 |
++ "Group transmit key(R)[%X]: %d\n", |
2973 |
++ pTable->KeyTable[i].dwGTKeyIndex, i); |
2974 |
+ |
2975 |
+ } |
2976 |
+ pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed |
2977 |
+diff --git a/drivers/staging/vt6656/key.h b/drivers/staging/vt6656/key.h |
2978 |
+index f749c7a..bd35d39 100644 |
2979 |
+--- a/drivers/staging/vt6656/key.h |
2980 |
++++ b/drivers/staging/vt6656/key.h |
2981 |
+@@ -58,7 +58,7 @@ |
2982 |
+ typedef struct tagSKeyItem |
2983 |
+ { |
2984 |
+ BOOL bKeyValid; |
2985 |
+- unsigned long uKeyLength; |
2986 |
++ u32 uKeyLength; |
2987 |
+ BYTE abyKey[MAX_KEY_LEN]; |
2988 |
+ QWORD KeyRSC; |
2989 |
+ DWORD dwTSC47_16; |
2990 |
+@@ -107,7 +107,7 @@ BOOL KeybSetKey( |
2991 |
+ PSKeyManagement pTable, |
2992 |
+ PBYTE pbyBSSID, |
2993 |
+ DWORD dwKeyIndex, |
2994 |
+- unsigned long uKeyLength, |
2995 |
++ u32 uKeyLength, |
2996 |
+ PQWORD pKeyRSC, |
2997 |
+ PBYTE pbyKey, |
2998 |
+ BYTE byKeyDecMode |
2999 |
+@@ -146,7 +146,7 @@ BOOL KeybSetDefaultKey( |
3000 |
+ void *pDeviceHandler, |
3001 |
+ PSKeyManagement pTable, |
3002 |
+ DWORD dwKeyIndex, |
3003 |
+- unsigned long uKeyLength, |
3004 |
++ u32 uKeyLength, |
3005 |
+ PQWORD pKeyRSC, |
3006 |
+ PBYTE pbyKey, |
3007 |
+ BYTE byKeyDecMode |
3008 |
+@@ -156,7 +156,7 @@ BOOL KeybSetAllGroupKey( |
3009 |
+ void *pDeviceHandler, |
3010 |
+ PSKeyManagement pTable, |
3011 |
+ DWORD dwKeyIndex, |
3012 |
+- unsigned long uKeyLength, |
3013 |
++ u32 uKeyLength, |
3014 |
+ PQWORD pKeyRSC, |
3015 |
+ PBYTE pbyKey, |
3016 |
+ BYTE byKeyDecMode |
3017 |
+diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c |
3018 |
+index 26c19d1..0636d82 100644 |
3019 |
+--- a/drivers/staging/vt6656/mac.c |
3020 |
++++ b/drivers/staging/vt6656/mac.c |
3021 |
+@@ -262,7 +262,8 @@ BYTE pbyData[24]; |
3022 |
+ dwData1 <<= 16; |
3023 |
+ dwData1 |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5)); |
3024 |
+ |
3025 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %lX, KeyCtl:%X\n", wOffset, dwData1, wKeyCtl); |
3026 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %X,"\ |
3027 |
++ " KeyCtl:%X\n", wOffset, dwData1, wKeyCtl); |
3028 |
+ |
3029 |
+ //VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset); |
3030 |
+ //VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); |
3031 |
+@@ -279,7 +280,8 @@ BYTE pbyData[24]; |
3032 |
+ dwData2 <<= 8; |
3033 |
+ dwData2 |= *(pbyAddr+0); |
3034 |
+ |
3035 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %lX\n", wOffset, dwData2); |
3036 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %X\n", |
3037 |
++ wOffset, dwData2); |
3038 |
+ |
3039 |
+ //VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset); |
3040 |
+ //VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); |
3041 |
+diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c |
3042 |
+index 3fd0478..8cf0881 100644 |
3043 |
+--- a/drivers/staging/vt6656/rf.c |
3044 |
++++ b/drivers/staging/vt6656/rf.c |
3045 |
+@@ -769,6 +769,9 @@ BYTE byPwr = pDevice->byCCKPwr; |
3046 |
+ return TRUE; |
3047 |
+ } |
3048 |
+ |
3049 |
++ if (uCH == 0) |
3050 |
++ return -EINVAL; |
3051 |
++ |
3052 |
+ switch (uRATE) { |
3053 |
+ case RATE_1M: |
3054 |
+ case RATE_2M: |
3055 |
+diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c |
3056 |
+index fe21868..3beb126 100644 |
3057 |
+--- a/drivers/staging/vt6656/rxtx.c |
3058 |
++++ b/drivers/staging/vt6656/rxtx.c |
3059 |
+@@ -377,7 +377,8 @@ s_vFillTxKey ( |
3060 |
+ *(pbyIVHead+3) = (BYTE)(((pDevice->byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV |
3061 |
+ // Append IV&ExtIV after Mac Header |
3062 |
+ *pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16); |
3063 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFillTxKey()---- pdwExtIV: %lx\n", *pdwExtIV); |
3064 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFillTxKey()---- pdwExtIV: %x\n", |
3065 |
++ *pdwExtIV); |
3066 |
+ |
3067 |
+ } else if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) { |
3068 |
+ pTransmitKey->wTSC15_0++; |
3069 |
+@@ -1753,7 +1754,8 @@ s_bPacketToWirelessUsb( |
3070 |
+ MIC_vAppend((PBYTE)&(psEthHeader->abyDstAddr[0]), 12); |
3071 |
+ dwMIC_Priority = 0; |
3072 |
+ MIC_vAppend((PBYTE)&dwMIC_Priority, 4); |
3073 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1); |
3074 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %X, %X\n", |
3075 |
++ dwMICKey0, dwMICKey1); |
3076 |
+ |
3077 |
+ /////////////////////////////////////////////////////////////////// |
3078 |
+ |
3079 |
+@@ -2635,7 +2637,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb) { |
3080 |
+ MIC_vAppend((PBYTE)&(sEthHeader.abyDstAddr[0]), 12); |
3081 |
+ dwMIC_Priority = 0; |
3082 |
+ MIC_vAppend((PBYTE)&dwMIC_Priority, 4); |
3083 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1); |
3084 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY:"\ |
3085 |
++ " %X, %X\n", dwMICKey0, dwMICKey1); |
3086 |
+ |
3087 |
+ uLength = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen; |
3088 |
+ |
3089 |
+@@ -2655,7 +2658,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb) { |
3090 |
+ |
3091 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"uLength: %d, %d\n", uLength, cbFrameBodySize); |
3092 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"cbReqCount:%d, %d, %d, %d\n", cbReqCount, cbHeaderSize, uPadding, cbIVlen); |
3093 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%lx, %lx\n", *pdwMIC_L, *pdwMIC_R); |
3094 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%x, %x\n", |
3095 |
++ *pdwMIC_L, *pdwMIC_R); |
3096 |
+ |
3097 |
+ } |
3098 |
+ |
3099 |
+@@ -3029,7 +3033,8 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb) |
3100 |
+ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"error: KEY is GTK!!~~\n"); |
3101 |
+ } |
3102 |
+ else { |
3103 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex); |
3104 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%X]\n", |
3105 |
++ pTransmitKey->dwKeyIndex); |
3106 |
+ bNeedEncryption = TRUE; |
3107 |
+ } |
3108 |
+ } |
3109 |
+@@ -3043,7 +3048,8 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb) |
3110 |
+ if (pDevice->bEnableHostWEP) { |
3111 |
+ if ((uNodeIndex != 0) && |
3112 |
+ (pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex & PAIRWISE_KEY)) { |
3113 |
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex); |
3114 |
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%X]\n", |
3115 |
++ pTransmitKey->dwKeyIndex); |
3116 |
+ bNeedEncryption = TRUE; |
3117 |
+ } |
3118 |
+ } |
3119 |
+diff --git a/drivers/staging/vt6656/ttype.h b/drivers/staging/vt6656/ttype.h |
3120 |
+index 8e9450e..dfbf747 100644 |
3121 |
+--- a/drivers/staging/vt6656/ttype.h |
3122 |
++++ b/drivers/staging/vt6656/ttype.h |
3123 |
+@@ -29,6 +29,8 @@ |
3124 |
+ #ifndef __TTYPE_H__ |
3125 |
+ #define __TTYPE_H__ |
3126 |
+ |
3127 |
++#include <linux/types.h> |
3128 |
++ |
3129 |
+ /******* Common definitions and typedefs ***********************************/ |
3130 |
+ |
3131 |
+ typedef int BOOL; |
3132 |
+@@ -42,17 +44,17 @@ typedef int BOOL; |
3133 |
+ |
3134 |
+ /****** Simple typedefs ***************************************************/ |
3135 |
+ |
3136 |
+-typedef unsigned char BYTE; // 8-bit |
3137 |
+-typedef unsigned short WORD; // 16-bit |
3138 |
+-typedef unsigned long DWORD; // 32-bit |
3139 |
++typedef u8 BYTE; |
3140 |
++typedef u16 WORD; |
3141 |
++typedef u32 DWORD; |
3142 |
+ |
3143 |
+ // QWORD is for those situation that we want |
3144 |
+ // an 8-byte-aligned 8 byte long structure |
3145 |
+ // which is NOT really a floating point number. |
3146 |
+ typedef union tagUQuadWord { |
3147 |
+ struct { |
3148 |
+- DWORD dwLowDword; |
3149 |
+- DWORD dwHighDword; |
3150 |
++ u32 dwLowDword; |
3151 |
++ u32 dwHighDword; |
3152 |
+ } u; |
3153 |
+ double DoNotUseThisField; |
3154 |
+ } UQuadWord; |
3155 |
+@@ -60,8 +62,8 @@ typedef UQuadWord QWORD; // 64-bit |
3156 |
+ |
3157 |
+ /****** Common pointer types ***********************************************/ |
3158 |
+ |
3159 |
+-typedef unsigned long ULONG_PTR; // 32-bit |
3160 |
+-typedef unsigned long DWORD_PTR; // 32-bit |
3161 |
++typedef u32 ULONG_PTR; |
3162 |
++typedef u32 DWORD_PTR; |
3163 |
+ |
3164 |
+ // boolean pointer |
3165 |
+ |
3166 |
+diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c |
3167 |
+index 78ea121..31fb96a 100644 |
3168 |
+--- a/drivers/staging/vt6656/wcmd.c |
3169 |
++++ b/drivers/staging/vt6656/wcmd.c |
3170 |
+@@ -316,17 +316,19 @@ s_MgrMakeProbeRequest( |
3171 |
+ return pTxPacket; |
3172 |
+ } |
3173 |
+ |
3174 |
+-void vCommandTimerWait(void *hDeviceContext, unsigned int MSecond) |
3175 |
++void vCommandTimerWait(void *hDeviceContext, unsigned long MSecond) |
3176 |
+ { |
3177 |
+- PSDevice pDevice = (PSDevice)hDeviceContext; |
3178 |
++ PSDevice pDevice = (PSDevice)hDeviceContext; |
3179 |
+ |
3180 |
+- init_timer(&pDevice->sTimerCommand); |
3181 |
+- pDevice->sTimerCommand.data = (unsigned long)pDevice; |
3182 |
+- pDevice->sTimerCommand.function = (TimerFunction)vRunCommand; |
3183 |
+- // RUN_AT :1 msec ~= (HZ/1024) |
3184 |
+- pDevice->sTimerCommand.expires = (unsigned int)RUN_AT((MSecond * HZ) >> 10); |
3185 |
+- add_timer(&pDevice->sTimerCommand); |
3186 |
+- return; |
3187 |
++ init_timer(&pDevice->sTimerCommand); |
3188 |
++ |
3189 |
++ pDevice->sTimerCommand.data = (unsigned long)pDevice; |
3190 |
++ pDevice->sTimerCommand.function = (TimerFunction)vRunCommand; |
3191 |
++ pDevice->sTimerCommand.expires = RUN_AT((MSecond * HZ) / 1000); |
3192 |
++ |
3193 |
++ add_timer(&pDevice->sTimerCommand); |
3194 |
++ |
3195 |
++ return; |
3196 |
+ } |
3197 |
+ |
3198 |
+ void vRunCommand(void *hDeviceContext) |
3199 |
+diff --git a/drivers/staging/vt6656/wpa2.h b/drivers/staging/vt6656/wpa2.h |
3200 |
+index 46c2959..c359252 100644 |
3201 |
+--- a/drivers/staging/vt6656/wpa2.h |
3202 |
++++ b/drivers/staging/vt6656/wpa2.h |
3203 |
+@@ -45,8 +45,8 @@ typedef struct tagsPMKIDInfo { |
3204 |
+ } PMKIDInfo, *PPMKIDInfo; |
3205 |
+ |
3206 |
+ typedef struct tagSPMKIDCache { |
3207 |
+- unsigned long BSSIDInfoCount; |
3208 |
+- PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE]; |
3209 |
++ u32 BSSIDInfoCount; |
3210 |
++ PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE]; |
3211 |
+ } SPMKIDCache, *PSPMKIDCache; |
3212 |
+ |
3213 |
+ |
3214 |
+diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c |
3215 |
+index a40541c..087af19 100644 |
3216 |
+--- a/drivers/target/tcm_fc/tfc_sess.c |
3217 |
++++ b/drivers/target/tcm_fc/tfc_sess.c |
3218 |
+@@ -468,7 +468,6 @@ static void ft_sess_rcu_free(struct rcu_head *rcu) |
3219 |
+ { |
3220 |
+ struct ft_sess *sess = container_of(rcu, struct ft_sess, rcu); |
3221 |
+ |
3222 |
+- transport_deregister_session(sess->se_sess); |
3223 |
+ kfree(sess); |
3224 |
+ } |
3225 |
+ |
3226 |
+@@ -476,6 +475,7 @@ static void ft_sess_free(struct kref *kref) |
3227 |
+ { |
3228 |
+ struct ft_sess *sess = container_of(kref, struct ft_sess, kref); |
3229 |
+ |
3230 |
++ transport_deregister_session(sess->se_sess); |
3231 |
+ call_rcu(&sess->rcu, ft_sess_rcu_free); |
3232 |
+ } |
3233 |
+ |
3234 |
+diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c |
3235 |
+index b107339..84e69ea 100644 |
3236 |
+--- a/drivers/usb/class/cdc-acm.c |
3237 |
++++ b/drivers/usb/class/cdc-acm.c |
3238 |
+@@ -1509,6 +1509,9 @@ static const struct usb_device_id acm_ids[] = { |
3239 |
+ { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */ |
3240 |
+ .driver_info = NO_UNION_NORMAL, |
3241 |
+ }, |
3242 |
++ { USB_DEVICE(0x05f9, 0x4002), /* PSC Scanning, Magellan 800i */ |
3243 |
++ .driver_info = NO_UNION_NORMAL, |
3244 |
++ }, |
3245 |
+ { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ |
3246 |
+ .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ |
3247 |
+ }, |
3248 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
3249 |
+index b4688fa..be9cac6 100644 |
3250 |
+--- a/drivers/usb/core/hub.c |
3251 |
++++ b/drivers/usb/core/hub.c |
3252 |
+@@ -2050,7 +2050,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub) |
3253 |
+ #define HUB_ROOT_RESET_TIME 50 /* times are in msec */ |
3254 |
+ #define HUB_SHORT_RESET_TIME 10 |
3255 |
+ #define HUB_LONG_RESET_TIME 200 |
3256 |
+-#define HUB_RESET_TIMEOUT 500 |
3257 |
++#define HUB_RESET_TIMEOUT 800 |
3258 |
+ |
3259 |
+ static int hub_port_wait_reset(struct usb_hub *hub, int port1, |
3260 |
+ struct usb_device *udev, unsigned int delay) |
3261 |
+@@ -2413,7 +2413,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) |
3262 |
+ static int finish_port_resume(struct usb_device *udev) |
3263 |
+ { |
3264 |
+ int status = 0; |
3265 |
+- u16 devstatus; |
3266 |
++ u16 devstatus = 0; |
3267 |
+ |
3268 |
+ /* caller owns the udev device lock */ |
3269 |
+ dev_dbg(&udev->dev, "%s\n", |
3270 |
+@@ -2458,7 +2458,13 @@ static int finish_port_resume(struct usb_device *udev) |
3271 |
+ if (status) { |
3272 |
+ dev_dbg(&udev->dev, "gone after usb resume? status %d\n", |
3273 |
+ status); |
3274 |
+- } else if (udev->actconfig) { |
3275 |
++ /* |
3276 |
++ * There are a few quirky devices which violate the standard |
3277 |
++ * by claiming to have remote wakeup enabled after a reset, |
3278 |
++ * which crash if the feature is cleared, hence check for |
3279 |
++ * udev->reset_resume |
3280 |
++ */ |
3281 |
++ } else if (udev->actconfig && !udev->reset_resume) { |
3282 |
+ le16_to_cpus(&devstatus); |
3283 |
+ if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) { |
3284 |
+ status = usb_control_msg(udev, |
3285 |
+diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c |
3286 |
+index d3dcabc..90977fc 100644 |
3287 |
+--- a/drivers/usb/gadget/dummy_hcd.c |
3288 |
++++ b/drivers/usb/gadget/dummy_hcd.c |
3289 |
+@@ -122,10 +122,7 @@ static const char ep0name [] = "ep0"; |
3290 |
+ static const char *const ep_name [] = { |
3291 |
+ ep0name, /* everyone has ep0 */ |
3292 |
+ |
3293 |
+- /* act like a net2280: high speed, six configurable endpoints */ |
3294 |
+- "ep-a", "ep-b", "ep-c", "ep-d", "ep-e", "ep-f", |
3295 |
+- |
3296 |
+- /* or like pxa250: fifteen fixed function endpoints */ |
3297 |
++ /* act like a pxa250: fifteen fixed function endpoints */ |
3298 |
+ "ep1in-bulk", "ep2out-bulk", "ep3in-iso", "ep4out-iso", "ep5in-int", |
3299 |
+ "ep6in-bulk", "ep7out-bulk", "ep8in-iso", "ep9out-iso", "ep10in-int", |
3300 |
+ "ep11in-bulk", "ep12out-bulk", "ep13in-iso", "ep14out-iso", |
3301 |
+@@ -133,6 +130,10 @@ static const char *const ep_name [] = { |
3302 |
+ |
3303 |
+ /* or like sa1100: two fixed function endpoints */ |
3304 |
+ "ep1out-bulk", "ep2in-bulk", |
3305 |
++ |
3306 |
++ /* and now some generic EPs so we have enough in multi config */ |
3307 |
++ "ep3out", "ep4in", "ep5out", "ep6out", "ep7in", "ep8out", "ep9in", |
3308 |
++ "ep10out", "ep11out", "ep12in", "ep13out", "ep14in", "ep15out", |
3309 |
+ }; |
3310 |
+ #define DUMMY_ENDPOINTS ARRAY_SIZE(ep_name) |
3311 |
+ |
3312 |
+diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c |
3313 |
+index a44f2d4..a2b20fe 100644 |
3314 |
+--- a/drivers/usb/host/xhci-mem.c |
3315 |
++++ b/drivers/usb/host/xhci-mem.c |
3316 |
+@@ -1026,6 +1026,8 @@ static unsigned int xhci_microframes_to_exponent(struct usb_device *udev, |
3317 |
+ static unsigned int xhci_parse_microframe_interval(struct usb_device *udev, |
3318 |
+ struct usb_host_endpoint *ep) |
3319 |
+ { |
3320 |
++ if (ep->desc.bInterval == 0) |
3321 |
++ return 0; |
3322 |
+ return xhci_microframes_to_exponent(udev, ep, |
3323 |
+ ep->desc.bInterval, 0, 15); |
3324 |
+ } |
3325 |
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c |
3326 |
+index c3770e5..c855a4a 100644 |
3327 |
+--- a/drivers/usb/serial/ftdi_sio.c |
3328 |
++++ b/drivers/usb/serial/ftdi_sio.c |
3329 |
+@@ -879,6 +879,8 @@ static struct usb_device_id id_table_combined [] = { |
3330 |
+ { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), |
3331 |
+ .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
3332 |
+ { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, |
3333 |
++ /* Crucible Devices */ |
3334 |
++ { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, |
3335 |
+ { }, /* Optional parameter entry */ |
3336 |
+ { } /* Terminating entry */ |
3337 |
+ }; |
3338 |
+diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h |
3339 |
+index aedf65f..dd6edf8 100644 |
3340 |
+--- a/drivers/usb/serial/ftdi_sio_ids.h |
3341 |
++++ b/drivers/usb/serial/ftdi_sio_ids.h |
3342 |
+@@ -1259,3 +1259,9 @@ |
3343 |
+ * ATI command output: Cinterion MC55i |
3344 |
+ */ |
3345 |
+ #define FTDI_CINTERION_MC55I_PID 0xA951 |
3346 |
++ |
3347 |
++/* |
3348 |
++ * Product: Comet Caller ID decoder |
3349 |
++ * Manufacturer: Crucible Technologies |
3350 |
++ */ |
3351 |
++#define FTDI_CT_COMET_PID 0x8e08 |
3352 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
3353 |
+index 872807b..f233bbb 100644 |
3354 |
+--- a/drivers/usb/serial/option.c |
3355 |
++++ b/drivers/usb/serial/option.c |
3356 |
+@@ -288,6 +288,7 @@ static void option_instat_callback(struct urb *urb); |
3357 |
+ #define ALCATEL_VENDOR_ID 0x1bbb |
3358 |
+ #define ALCATEL_PRODUCT_X060S_X200 0x0000 |
3359 |
+ #define ALCATEL_PRODUCT_X220_X500D 0x0017 |
3360 |
++#define ALCATEL_PRODUCT_L100V 0x011e |
3361 |
+ |
3362 |
+ #define PIRELLI_VENDOR_ID 0x1266 |
3363 |
+ #define PIRELLI_PRODUCT_C100_1 0x1002 |
3364 |
+@@ -429,9 +430,12 @@ static void option_instat_callback(struct urb *urb); |
3365 |
+ #define MEDIATEK_VENDOR_ID 0x0e8d |
3366 |
+ #define MEDIATEK_PRODUCT_DC_1COM 0x00a0 |
3367 |
+ #define MEDIATEK_PRODUCT_DC_4COM 0x00a5 |
3368 |
++#define MEDIATEK_PRODUCT_DC_4COM2 0x00a7 |
3369 |
+ #define MEDIATEK_PRODUCT_DC_5COM 0x00a4 |
3370 |
+ #define MEDIATEK_PRODUCT_7208_1COM 0x7101 |
3371 |
+ #define MEDIATEK_PRODUCT_7208_2COM 0x7102 |
3372 |
++#define MEDIATEK_PRODUCT_7103_2COM 0x7103 |
3373 |
++#define MEDIATEK_PRODUCT_7106_2COM 0x7106 |
3374 |
+ #define MEDIATEK_PRODUCT_FP_1COM 0x0003 |
3375 |
+ #define MEDIATEK_PRODUCT_FP_2COM 0x0023 |
3376 |
+ #define MEDIATEK_PRODUCT_FPDC_1COM 0x0043 |
3377 |
+@@ -441,6 +445,10 @@ static void option_instat_callback(struct urb *urb); |
3378 |
+ #define CELLIENT_VENDOR_ID 0x2692 |
3379 |
+ #define CELLIENT_PRODUCT_MEN200 0x9005 |
3380 |
+ |
3381 |
++/* Hyundai Petatel Inc. products */ |
3382 |
++#define PETATEL_VENDOR_ID 0x1ff4 |
3383 |
++#define PETATEL_PRODUCT_NP10T 0x600e |
3384 |
++ |
3385 |
+ /* some devices interfaces need special handling due to a number of reasons */ |
3386 |
+ enum option_blacklist_reason { |
3387 |
+ OPTION_BLACKLIST_NONE = 0, |
3388 |
+@@ -923,7 +931,8 @@ static const struct usb_device_id option_ids[] = { |
3389 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */ |
3390 |
+ .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, |
3391 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) }, |
3392 |
+- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) }, |
3393 |
++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */ |
3394 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
3395 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) }, |
3396 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff), |
3397 |
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
3398 |
+@@ -1190,6 +1199,8 @@ static const struct usb_device_id option_ids[] = { |
3399 |
+ .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist |
3400 |
+ }, |
3401 |
+ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) }, |
3402 |
++ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V), |
3403 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
3404 |
+ { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
3405 |
+ { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, |
3406 |
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
3407 |
+@@ -1294,7 +1305,12 @@ static const struct usb_device_id option_ids[] = { |
3408 |
+ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) }, |
3409 |
+ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) }, |
3410 |
+ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) }, |
3411 |
++ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7103_2COM, 0xff, 0x00, 0x00) }, |
3412 |
++ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7106_2COM, 0x02, 0x02, 0x01) }, |
3413 |
++ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) }, |
3414 |
++ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, |
3415 |
+ { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, |
3416 |
++ { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, |
3417 |
+ { } /* Terminating entry */ |
3418 |
+ }; |
3419 |
+ MODULE_DEVICE_TABLE(usb, option_ids); |
3420 |
+diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c |
3421 |
+index 0b2f2dd..2f90290 100644 |
3422 |
+--- a/drivers/video/mxsfb.c |
3423 |
++++ b/drivers/video/mxsfb.c |
3424 |
+@@ -365,7 +365,8 @@ static void mxsfb_disable_controller(struct fb_info *fb_info) |
3425 |
+ loop--; |
3426 |
+ } |
3427 |
+ |
3428 |
+- writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR); |
3429 |
++ reg = readl(host->base + LCDC_VDCTRL4); |
3430 |
++ writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4); |
3431 |
+ |
3432 |
+ clk_disable(host->clk); |
3433 |
+ |
3434 |
+diff --git a/fs/eventpoll.c b/fs/eventpoll.c |
3435 |
+index 35a852a..35a1a61 100644 |
3436 |
+--- a/fs/eventpoll.c |
3437 |
++++ b/fs/eventpoll.c |
3438 |
+@@ -1197,10 +1197,30 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even |
3439 |
+ * otherwise we might miss an event that happens between the |
3440 |
+ * f_op->poll() call and the new event set registering. |
3441 |
+ */ |
3442 |
+- epi->event.events = event->events; |
3443 |
++ epi->event.events = event->events; /* need barrier below */ |
3444 |
+ epi->event.data = event->data; /* protected by mtx */ |
3445 |
+ |
3446 |
+ /* |
3447 |
++ * The following barrier has two effects: |
3448 |
++ * |
3449 |
++ * 1) Flush epi changes above to other CPUs. This ensures |
3450 |
++ * we do not miss events from ep_poll_callback if an |
3451 |
++ * event occurs immediately after we call f_op->poll(). |
3452 |
++ * We need this because we did not take ep->lock while |
3453 |
++ * changing epi above (but ep_poll_callback does take |
3454 |
++ * ep->lock). |
3455 |
++ * |
3456 |
++ * 2) We also need to ensure we do not miss _past_ events |
3457 |
++ * when calling f_op->poll(). This barrier also |
3458 |
++ * pairs with the barrier in wq_has_sleeper (see |
3459 |
++ * comments for wq_has_sleeper). |
3460 |
++ * |
3461 |
++ * This barrier will now guarantee ep_poll_callback or f_op->poll |
3462 |
++ * (or both) will notice the readiness of an item. |
3463 |
++ */ |
3464 |
++ smp_mb(); |
3465 |
++ |
3466 |
++ /* |
3467 |
+ * Get current event bits. We can safely use the file* here because |
3468 |
+ * its usage count has been increased by the caller of this function. |
3469 |
+ */ |
3470 |
+diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c |
3471 |
+index 21eacd7..4922087 100644 |
3472 |
+--- a/fs/ext4/acl.c |
3473 |
++++ b/fs/ext4/acl.c |
3474 |
+@@ -450,8 +450,10 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, |
3475 |
+ |
3476 |
+ retry: |
3477 |
+ handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb)); |
3478 |
+- if (IS_ERR(handle)) |
3479 |
+- return PTR_ERR(handle); |
3480 |
++ if (IS_ERR(handle)) { |
3481 |
++ error = PTR_ERR(handle); |
3482 |
++ goto release_and_out; |
3483 |
++ } |
3484 |
+ error = ext4_set_acl(handle, inode, type, acl); |
3485 |
+ ext4_journal_stop(handle); |
3486 |
+ if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) |
3487 |
+diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c |
3488 |
+index 611647b..680df5d 100644 |
3489 |
+--- a/fs/ext4/extents.c |
3490 |
++++ b/fs/ext4/extents.c |
3491 |
+@@ -2140,13 +2140,14 @@ ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block, |
3492 |
+ * last index in the block only. |
3493 |
+ */ |
3494 |
+ static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode, |
3495 |
+- struct ext4_ext_path *path) |
3496 |
++ struct ext4_ext_path *path, int depth) |
3497 |
+ { |
3498 |
+ int err; |
3499 |
+ ext4_fsblk_t leaf; |
3500 |
+ |
3501 |
+ /* free index block */ |
3502 |
+- path--; |
3503 |
++ depth--; |
3504 |
++ path = path + depth; |
3505 |
+ leaf = ext4_idx_pblock(path->p_idx); |
3506 |
+ if (unlikely(path->p_hdr->eh_entries == 0)) { |
3507 |
+ EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0"); |
3508 |
+@@ -2162,6 +2163,19 @@ static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode, |
3509 |
+ ext_debug("index is empty, remove it, free block %llu\n", leaf); |
3510 |
+ ext4_free_blocks(handle, inode, NULL, leaf, 1, |
3511 |
+ EXT4_FREE_BLOCKS_METADATA | EXT4_FREE_BLOCKS_FORGET); |
3512 |
++ |
3513 |
++ while (--depth >= 0) { |
3514 |
++ if (path->p_idx != EXT_FIRST_INDEX(path->p_hdr)) |
3515 |
++ break; |
3516 |
++ path--; |
3517 |
++ err = ext4_ext_get_access(handle, inode, path); |
3518 |
++ if (err) |
3519 |
++ break; |
3520 |
++ path->p_idx->ei_block = (path+1)->p_idx->ei_block; |
3521 |
++ err = ext4_ext_dirty(handle, inode, path); |
3522 |
++ if (err) |
3523 |
++ break; |
3524 |
++ } |
3525 |
+ return err; |
3526 |
+ } |
3527 |
+ |
3528 |
+@@ -2509,7 +2523,7 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, |
3529 |
+ /* if this leaf is free, then we should |
3530 |
+ * remove it from index block above */ |
3531 |
+ if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL) |
3532 |
+- err = ext4_ext_rm_idx(handle, inode, path + depth); |
3533 |
++ err = ext4_ext_rm_idx(handle, inode, path, depth); |
3534 |
+ |
3535 |
+ out: |
3536 |
+ return err; |
3537 |
+@@ -2639,7 +2653,7 @@ again: |
3538 |
+ /* index is empty, remove it; |
3539 |
+ * handle must be already prepared by the |
3540 |
+ * truncatei_leaf() */ |
3541 |
+- err = ext4_ext_rm_idx(handle, inode, path + i); |
3542 |
++ err = ext4_ext_rm_idx(handle, inode, path, i); |
3543 |
+ } |
3544 |
+ /* root level has p_bh == NULL, brelse() eats this */ |
3545 |
+ brelse(path[i].p_bh); |
3546 |
+diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
3547 |
+index 489d406..f1aa1a2 100644 |
3548 |
+--- a/fs/ext4/super.c |
3549 |
++++ b/fs/ext4/super.c |
3550 |
+@@ -2204,7 +2204,9 @@ static void ext4_orphan_cleanup(struct super_block *sb, |
3551 |
+ __func__, inode->i_ino, inode->i_size); |
3552 |
+ jbd_debug(2, "truncating inode %lu to %lld bytes\n", |
3553 |
+ inode->i_ino, inode->i_size); |
3554 |
++ mutex_lock(&inode->i_mutex); |
3555 |
+ ext4_truncate(inode); |
3556 |
++ mutex_unlock(&inode->i_mutex); |
3557 |
+ nr_truncates++; |
3558 |
+ } else { |
3559 |
+ ext4_msg(sb, KERN_DEBUG, |
3560 |
+@@ -4438,7 +4440,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) |
3561 |
+ } |
3562 |
+ |
3563 |
+ ext4_setup_system_zone(sb); |
3564 |
+- if (sbi->s_journal == NULL) |
3565 |
++ if (sbi->s_journal == NULL && !(old_sb_flags & MS_RDONLY)) |
3566 |
+ ext4_commit_super(sb, 1); |
3567 |
+ |
3568 |
+ #ifdef CONFIG_QUOTA |
3569 |
+diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c |
3570 |
+index 05bbb12..c133253 100644 |
3571 |
+--- a/fs/gfs2/lops.c |
3572 |
++++ b/fs/gfs2/lops.c |
3573 |
+@@ -139,16 +139,14 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) |
3574 |
+ struct gfs2_meta_header *mh; |
3575 |
+ struct gfs2_trans *tr; |
3576 |
+ |
3577 |
+- lock_buffer(bd->bd_bh); |
3578 |
+- gfs2_log_lock(sdp); |
3579 |
+ if (!list_empty(&bd->bd_list_tr)) |
3580 |
+- goto out; |
3581 |
++ return; |
3582 |
+ tr = current->journal_info; |
3583 |
+ tr->tr_touched = 1; |
3584 |
+ tr->tr_num_buf++; |
3585 |
+ list_add(&bd->bd_list_tr, &tr->tr_list_buf); |
3586 |
+ if (!list_empty(&le->le_list)) |
3587 |
+- goto out; |
3588 |
++ return; |
3589 |
+ set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); |
3590 |
+ set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); |
3591 |
+ gfs2_meta_check(sdp, bd->bd_bh); |
3592 |
+@@ -159,9 +157,6 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) |
3593 |
+ sdp->sd_log_num_buf++; |
3594 |
+ list_add(&le->le_list, &sdp->sd_log_le_buf); |
3595 |
+ tr->tr_num_buf_new++; |
3596 |
+-out: |
3597 |
+- gfs2_log_unlock(sdp); |
3598 |
+- unlock_buffer(bd->bd_bh); |
3599 |
+ } |
3600 |
+ |
3601 |
+ static void buf_lo_before_commit(struct gfs2_sbd *sdp) |
3602 |
+@@ -528,11 +523,9 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) |
3603 |
+ struct address_space *mapping = bd->bd_bh->b_page->mapping; |
3604 |
+ struct gfs2_inode *ip = GFS2_I(mapping->host); |
3605 |
+ |
3606 |
+- lock_buffer(bd->bd_bh); |
3607 |
+- gfs2_log_lock(sdp); |
3608 |
+ if (tr) { |
3609 |
+ if (!list_empty(&bd->bd_list_tr)) |
3610 |
+- goto out; |
3611 |
++ return; |
3612 |
+ tr->tr_touched = 1; |
3613 |
+ if (gfs2_is_jdata(ip)) { |
3614 |
+ tr->tr_num_buf++; |
3615 |
+@@ -540,7 +533,7 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) |
3616 |
+ } |
3617 |
+ } |
3618 |
+ if (!list_empty(&le->le_list)) |
3619 |
+- goto out; |
3620 |
++ return; |
3621 |
+ |
3622 |
+ set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); |
3623 |
+ set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); |
3624 |
+@@ -552,9 +545,6 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) |
3625 |
+ } else { |
3626 |
+ list_add_tail(&le->le_list, &sdp->sd_log_le_ordered); |
3627 |
+ } |
3628 |
+-out: |
3629 |
+- gfs2_log_unlock(sdp); |
3630 |
+- unlock_buffer(bd->bd_bh); |
3631 |
+ } |
3632 |
+ |
3633 |
+ static void gfs2_check_magic(struct buffer_head *bh) |
3634 |
+diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c |
3635 |
+index 9ec73a8..e6453c3 100644 |
3636 |
+--- a/fs/gfs2/trans.c |
3637 |
++++ b/fs/gfs2/trans.c |
3638 |
+@@ -145,14 +145,22 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) |
3639 |
+ struct gfs2_sbd *sdp = gl->gl_sbd; |
3640 |
+ struct gfs2_bufdata *bd; |
3641 |
+ |
3642 |
++ lock_buffer(bh); |
3643 |
++ gfs2_log_lock(sdp); |
3644 |
+ bd = bh->b_private; |
3645 |
+ if (bd) |
3646 |
+ gfs2_assert(sdp, bd->bd_gl == gl); |
3647 |
+ else { |
3648 |
++ gfs2_log_unlock(sdp); |
3649 |
++ unlock_buffer(bh); |
3650 |
+ gfs2_attach_bufdata(gl, bh, meta); |
3651 |
+ bd = bh->b_private; |
3652 |
++ lock_buffer(bh); |
3653 |
++ gfs2_log_lock(sdp); |
3654 |
+ } |
3655 |
+ lops_add(sdp, &bd->bd_le); |
3656 |
++ gfs2_log_unlock(sdp); |
3657 |
++ unlock_buffer(bh); |
3658 |
+ } |
3659 |
+ |
3660 |
+ void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |
3661 |
+diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c |
3662 |
+index 9baa39e..4ef2aae 100644 |
3663 |
+--- a/fs/jbd2/transaction.c |
3664 |
++++ b/fs/jbd2/transaction.c |
3665 |
+@@ -178,7 +178,8 @@ repeat: |
3666 |
+ if (!new_transaction) |
3667 |
+ goto alloc_transaction; |
3668 |
+ write_lock(&journal->j_state_lock); |
3669 |
+- if (!journal->j_running_transaction) { |
3670 |
++ if (!journal->j_running_transaction && |
3671 |
++ !journal->j_barrier_count) { |
3672 |
+ jbd2_get_transaction(journal, new_transaction); |
3673 |
+ new_transaction = NULL; |
3674 |
+ } |
3675 |
+diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c |
3676 |
+index 694aa5b..e304795 100644 |
3677 |
+--- a/fs/jffs2/nodemgmt.c |
3678 |
++++ b/fs/jffs2/nodemgmt.c |
3679 |
+@@ -355,14 +355,16 @@ static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, |
3680 |
+ spin_unlock(&c->erase_completion_lock); |
3681 |
+ |
3682 |
+ ret = jffs2_prealloc_raw_node_refs(c, jeb, 1); |
3683 |
+- if (ret) |
3684 |
+- return ret; |
3685 |
++ |
3686 |
+ /* Just lock it again and continue. Nothing much can change because |
3687 |
+ we hold c->alloc_sem anyway. In fact, it's not entirely clear why |
3688 |
+ we hold c->erase_completion_lock in the majority of this function... |
3689 |
+ but that's a question for another (more caffeine-rich) day. */ |
3690 |
+ spin_lock(&c->erase_completion_lock); |
3691 |
+ |
3692 |
++ if (ret) |
3693 |
++ return ret; |
3694 |
++ |
3695 |
+ waste = jeb->free_size; |
3696 |
+ jffs2_link_node_ref(c, jeb, |
3697 |
+ (jeb->offset + c->sector_size - waste) | REF_OBSOLETE, |
3698 |
+diff --git a/fs/udf/inode.c b/fs/udf/inode.c |
3699 |
+index 262050f..957c974 100644 |
3700 |
+--- a/fs/udf/inode.c |
3701 |
++++ b/fs/udf/inode.c |
3702 |
+@@ -575,6 +575,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block, |
3703 |
+ struct udf_inode_info *iinfo = UDF_I(inode); |
3704 |
+ int goal = 0, pgoal = iinfo->i_location.logicalBlockNum; |
3705 |
+ int lastblock = 0; |
3706 |
++ bool isBeyondEOF; |
3707 |
+ |
3708 |
+ prev_epos.offset = udf_file_entry_alloc_offset(inode); |
3709 |
+ prev_epos.block = iinfo->i_location; |
3710 |
+@@ -653,7 +654,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block, |
3711 |
+ /* Are we beyond EOF? */ |
3712 |
+ if (etype == -1) { |
3713 |
+ int ret; |
3714 |
+- |
3715 |
++ isBeyondEOF = 1; |
3716 |
+ if (count) { |
3717 |
+ if (c) |
3718 |
+ laarr[0] = laarr[1]; |
3719 |
+@@ -696,6 +697,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block, |
3720 |
+ endnum = c + 1; |
3721 |
+ lastblock = 1; |
3722 |
+ } else { |
3723 |
++ isBeyondEOF = 0; |
3724 |
+ endnum = startnum = ((count > 2) ? 2 : count); |
3725 |
+ |
3726 |
+ /* if the current extent is in position 0, |
3727 |
+@@ -738,10 +740,13 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block, |
3728 |
+ goal, err); |
3729 |
+ if (!newblocknum) { |
3730 |
+ brelse(prev_epos.bh); |
3731 |
++ brelse(cur_epos.bh); |
3732 |
++ brelse(next_epos.bh); |
3733 |
+ *err = -ENOSPC; |
3734 |
+ return NULL; |
3735 |
+ } |
3736 |
+- iinfo->i_lenExtents += inode->i_sb->s_blocksize; |
3737 |
++ if (isBeyondEOF) |
3738 |
++ iinfo->i_lenExtents += inode->i_sb->s_blocksize; |
3739 |
+ } |
3740 |
+ |
3741 |
+ /* if the extent the requsted block is located in contains multiple |
3742 |
+@@ -768,6 +773,8 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block, |
3743 |
+ udf_update_extents(inode, laarr, startnum, endnum, &prev_epos); |
3744 |
+ |
3745 |
+ brelse(prev_epos.bh); |
3746 |
++ brelse(cur_epos.bh); |
3747 |
++ brelse(next_epos.bh); |
3748 |
+ |
3749 |
+ newblock = udf_get_pblock(inode->i_sb, newblocknum, |
3750 |
+ iinfo->i_location.partitionReferenceNum, 0); |
3751 |
+diff --git a/include/linux/if_link.h b/include/linux/if_link.h |
3752 |
+index 0ee969a..61a48b5 100644 |
3753 |
+--- a/include/linux/if_link.h |
3754 |
++++ b/include/linux/if_link.h |
3755 |
+@@ -137,6 +137,7 @@ enum { |
3756 |
+ IFLA_AF_SPEC, |
3757 |
+ IFLA_GROUP, /* Group the device belongs to */ |
3758 |
+ IFLA_NET_NS_FD, |
3759 |
++ IFLA_EXT_MASK, /* Extended info mask, VFs, etc */ |
3760 |
+ __IFLA_MAX |
3761 |
+ }; |
3762 |
+ |
3763 |
+diff --git a/include/linux/netlink.h b/include/linux/netlink.h |
3764 |
+index a9dd895..fdd0188 100644 |
3765 |
+--- a/include/linux/netlink.h |
3766 |
++++ b/include/linux/netlink.h |
3767 |
+@@ -221,7 +221,8 @@ struct netlink_callback { |
3768 |
+ int (*dump)(struct sk_buff * skb, |
3769 |
+ struct netlink_callback *cb); |
3770 |
+ int (*done)(struct netlink_callback *cb); |
3771 |
+- int family; |
3772 |
++ u16 family; |
3773 |
++ u16 min_dump_alloc; |
3774 |
+ long args[6]; |
3775 |
+ }; |
3776 |
+ |
3777 |
+@@ -259,7 +260,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) |
3778 |
+ extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
3779 |
+ const struct nlmsghdr *nlh, |
3780 |
+ int (*dump)(struct sk_buff *skb, struct netlink_callback*), |
3781 |
+- int (*done)(struct netlink_callback*)); |
3782 |
++ int (*done)(struct netlink_callback*), |
3783 |
++ u16 min_dump_alloc); |
3784 |
+ |
3785 |
+ |
3786 |
+ #define NL_NONROOT_RECV 0x1 |
3787 |
+diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h |
3788 |
+index bbad657..5415dfb 100644 |
3789 |
+--- a/include/linux/rtnetlink.h |
3790 |
++++ b/include/linux/rtnetlink.h |
3791 |
+@@ -600,6 +600,9 @@ struct tcamsg { |
3792 |
+ #define TCA_ACT_TAB 1 /* attr type must be >=1 */ |
3793 |
+ #define TCAA_MAX 1 |
3794 |
+ |
3795 |
++/* New extended info filters for IFLA_EXT_MASK */ |
3796 |
++#define RTEXT_FILTER_VF (1 << 0) |
3797 |
++ |
3798 |
+ /* End of information exported to user level */ |
3799 |
+ |
3800 |
+ #ifdef __KERNEL__ |
3801 |
+diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h |
3802 |
+index 4093ca7..3702939 100644 |
3803 |
+--- a/include/net/rtnetlink.h |
3804 |
++++ b/include/net/rtnetlink.h |
3805 |
+@@ -6,11 +6,14 @@ |
3806 |
+ |
3807 |
+ typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *); |
3808 |
+ typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); |
3809 |
++typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *); |
3810 |
+ |
3811 |
+ extern int __rtnl_register(int protocol, int msgtype, |
3812 |
+- rtnl_doit_func, rtnl_dumpit_func); |
3813 |
++ rtnl_doit_func, rtnl_dumpit_func, |
3814 |
++ rtnl_calcit_func); |
3815 |
+ extern void rtnl_register(int protocol, int msgtype, |
3816 |
+- rtnl_doit_func, rtnl_dumpit_func); |
3817 |
++ rtnl_doit_func, rtnl_dumpit_func, |
3818 |
++ rtnl_calcit_func); |
3819 |
+ extern int rtnl_unregister(int protocol, int msgtype); |
3820 |
+ extern void rtnl_unregister_all(int protocol); |
3821 |
+ |
3822 |
+diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c |
3823 |
+index b0c7aa4..20dff64 100644 |
3824 |
+--- a/kernel/trace/ring_buffer.c |
3825 |
++++ b/kernel/trace/ring_buffer.c |
3826 |
+@@ -2926,6 +2926,8 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) |
3827 |
+ * Splice the empty reader page into the list around the head. |
3828 |
+ */ |
3829 |
+ reader = rb_set_head_page(cpu_buffer); |
3830 |
++ if (!reader) |
3831 |
++ goto out; |
3832 |
+ cpu_buffer->reader_page->list.next = rb_list_head(reader->list.next); |
3833 |
+ cpu_buffer->reader_page->list.prev = reader->list.prev; |
3834 |
+ |
3835 |
+diff --git a/mm/compaction.c b/mm/compaction.c |
3836 |
+index 8ea7308..b4689f81 100644 |
3837 |
+--- a/mm/compaction.c |
3838 |
++++ b/mm/compaction.c |
3839 |
+@@ -714,14 +714,12 @@ static int compact_node(int nid) |
3840 |
+ } |
3841 |
+ |
3842 |
+ /* Compact all nodes in the system */ |
3843 |
+-static int compact_nodes(void) |
3844 |
++static void compact_nodes(void) |
3845 |
+ { |
3846 |
+ int nid; |
3847 |
+ |
3848 |
+ for_each_online_node(nid) |
3849 |
+ compact_node(nid); |
3850 |
+- |
3851 |
+- return COMPACT_COMPLETE; |
3852 |
+ } |
3853 |
+ |
3854 |
+ /* The written value is actually unused, all memory is compacted */ |
3855 |
+@@ -732,7 +730,7 @@ int sysctl_compaction_handler(struct ctl_table *table, int write, |
3856 |
+ void __user *buffer, size_t *length, loff_t *ppos) |
3857 |
+ { |
3858 |
+ if (write) |
3859 |
+- return compact_nodes(); |
3860 |
++ compact_nodes(); |
3861 |
+ |
3862 |
+ return 0; |
3863 |
+ } |
3864 |
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c |
3865 |
+index 8cc11dd..a9ab45e 100644 |
3866 |
+--- a/mm/huge_memory.c |
3867 |
++++ b/mm/huge_memory.c |
3868 |
+@@ -920,6 +920,8 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, |
3869 |
+ count_vm_event(THP_FAULT_FALLBACK); |
3870 |
+ ret = do_huge_pmd_wp_page_fallback(mm, vma, address, |
3871 |
+ pmd, orig_pmd, page, haddr); |
3872 |
++ if (ret & VM_FAULT_OOM) |
3873 |
++ split_huge_page(page); |
3874 |
+ put_page(page); |
3875 |
+ goto out; |
3876 |
+ } |
3877 |
+@@ -927,6 +929,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, |
3878 |
+ |
3879 |
+ if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) { |
3880 |
+ put_page(new_page); |
3881 |
++ split_huge_page(page); |
3882 |
+ put_page(page); |
3883 |
+ ret |= VM_FAULT_OOM; |
3884 |
+ goto out; |
3885 |
+diff --git a/mm/memory.c b/mm/memory.c |
3886 |
+index 7292acb..4da0f8a 100644 |
3887 |
+--- a/mm/memory.c |
3888 |
++++ b/mm/memory.c |
3889 |
+@@ -3470,6 +3470,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
3890 |
+ if (unlikely(is_vm_hugetlb_page(vma))) |
3891 |
+ return hugetlb_fault(mm, vma, address, flags); |
3892 |
+ |
3893 |
++retry: |
3894 |
+ pgd = pgd_offset(mm, address); |
3895 |
+ pud = pud_alloc(mm, pgd, address); |
3896 |
+ if (!pud) |
3897 |
+@@ -3483,13 +3484,24 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
3898 |
+ pmd, flags); |
3899 |
+ } else { |
3900 |
+ pmd_t orig_pmd = *pmd; |
3901 |
++ int ret; |
3902 |
++ |
3903 |
+ barrier(); |
3904 |
+ if (pmd_trans_huge(orig_pmd)) { |
3905 |
+ if (flags & FAULT_FLAG_WRITE && |
3906 |
+ !pmd_write(orig_pmd) && |
3907 |
+- !pmd_trans_splitting(orig_pmd)) |
3908 |
+- return do_huge_pmd_wp_page(mm, vma, address, |
3909 |
+- pmd, orig_pmd); |
3910 |
++ !pmd_trans_splitting(orig_pmd)) { |
3911 |
++ ret = do_huge_pmd_wp_page(mm, vma, address, pmd, |
3912 |
++ orig_pmd); |
3913 |
++ /* |
3914 |
++ * If COW results in an oom, the huge pmd will |
3915 |
++ * have been split, so retry the fault on the |
3916 |
++ * pte for a smaller charge. |
3917 |
++ */ |
3918 |
++ if (unlikely(ret & VM_FAULT_OOM)) |
3919 |
++ goto retry; |
3920 |
++ return ret; |
3921 |
++ } |
3922 |
+ return 0; |
3923 |
+ } |
3924 |
+ } |
3925 |
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c |
3926 |
+index eb6b3fd..0ec869e 100644 |
3927 |
+--- a/mm/page_alloc.c |
3928 |
++++ b/mm/page_alloc.c |
3929 |
+@@ -5492,7 +5492,7 @@ static inline int pfn_to_bitidx(struct zone *zone, unsigned long pfn) |
3930 |
+ pfn &= (PAGES_PER_SECTION-1); |
3931 |
+ return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS; |
3932 |
+ #else |
3933 |
+- pfn = pfn - zone->zone_start_pfn; |
3934 |
++ pfn = pfn - round_down(zone->zone_start_pfn, pageblock_nr_pages); |
3935 |
+ return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS; |
3936 |
+ #endif /* CONFIG_SPARSEMEM */ |
3937 |
+ } |
3938 |
+diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c |
3939 |
+index 71861a9..d372df2 100644 |
3940 |
+--- a/net/bridge/br_netlink.c |
3941 |
++++ b/net/bridge/br_netlink.c |
3942 |
+@@ -219,19 +219,24 @@ int __init br_netlink_init(void) |
3943 |
+ if (err < 0) |
3944 |
+ goto err1; |
3945 |
+ |
3946 |
+- err = __rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, br_dump_ifinfo); |
3947 |
++ err = __rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, |
3948 |
++ br_dump_ifinfo, NULL); |
3949 |
+ if (err) |
3950 |
+ goto err2; |
3951 |
+- err = __rtnl_register(PF_BRIDGE, RTM_SETLINK, br_rtm_setlink, NULL); |
3952 |
++ err = __rtnl_register(PF_BRIDGE, RTM_SETLINK, |
3953 |
++ br_rtm_setlink, NULL, NULL); |
3954 |
+ if (err) |
3955 |
+ goto err3; |
3956 |
+- err = __rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, br_fdb_add, NULL); |
3957 |
++ err = __rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, |
3958 |
++ br_fdb_add, NULL, NULL); |
3959 |
+ if (err) |
3960 |
+ goto err3; |
3961 |
+- err = __rtnl_register(PF_BRIDGE, RTM_DELNEIGH, br_fdb_delete, NULL); |
3962 |
++ err = __rtnl_register(PF_BRIDGE, RTM_DELNEIGH, |
3963 |
++ br_fdb_delete, NULL, NULL); |
3964 |
+ if (err) |
3965 |
+ goto err3; |
3966 |
+- err = __rtnl_register(PF_BRIDGE, RTM_GETNEIGH, NULL, br_fdb_dump); |
3967 |
++ err = __rtnl_register(PF_BRIDGE, RTM_GETNEIGH, |
3968 |
++ NULL, br_fdb_dump, NULL); |
3969 |
+ if (err) |
3970 |
+ goto err3; |
3971 |
+ |
3972 |
+diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c |
3973 |
+index f39ef5c..3231b46 100644 |
3974 |
+--- a/net/core/fib_rules.c |
3975 |
++++ b/net/core/fib_rules.c |
3976 |
+@@ -740,9 +740,9 @@ static struct pernet_operations fib_rules_net_ops = { |
3977 |
+ static int __init fib_rules_init(void) |
3978 |
+ { |
3979 |
+ int err; |
3980 |
+- rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL); |
3981 |
+- rtnl_register(PF_UNSPEC, RTM_DELRULE, fib_nl_delrule, NULL); |
3982 |
+- rtnl_register(PF_UNSPEC, RTM_GETRULE, NULL, fib_nl_dumprule); |
3983 |
++ rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL, NULL); |
3984 |
++ rtnl_register(PF_UNSPEC, RTM_DELRULE, fib_nl_delrule, NULL, NULL); |
3985 |
++ rtnl_register(PF_UNSPEC, RTM_GETRULE, NULL, fib_nl_dumprule, NULL); |
3986 |
+ |
3987 |
+ err = register_pernet_subsys(&fib_rules_net_ops); |
3988 |
+ if (err < 0) |
3989 |
+diff --git a/net/core/neighbour.c b/net/core/neighbour.c |
3990 |
+index eb8857a..34032f2 100644 |
3991 |
+--- a/net/core/neighbour.c |
3992 |
++++ b/net/core/neighbour.c |
3993 |
+@@ -2918,12 +2918,13 @@ EXPORT_SYMBOL(neigh_sysctl_unregister); |
3994 |
+ |
3995 |
+ static int __init neigh_init(void) |
3996 |
+ { |
3997 |
+- rtnl_register(PF_UNSPEC, RTM_NEWNEIGH, neigh_add, NULL); |
3998 |
+- rtnl_register(PF_UNSPEC, RTM_DELNEIGH, neigh_delete, NULL); |
3999 |
+- rtnl_register(PF_UNSPEC, RTM_GETNEIGH, NULL, neigh_dump_info); |
4000 |
++ rtnl_register(PF_UNSPEC, RTM_NEWNEIGH, neigh_add, NULL, NULL); |
4001 |
++ rtnl_register(PF_UNSPEC, RTM_DELNEIGH, neigh_delete, NULL, NULL); |
4002 |
++ rtnl_register(PF_UNSPEC, RTM_GETNEIGH, NULL, neigh_dump_info, NULL); |
4003 |
+ |
4004 |
+- rtnl_register(PF_UNSPEC, RTM_GETNEIGHTBL, NULL, neightbl_dump_info); |
4005 |
+- rtnl_register(PF_UNSPEC, RTM_SETNEIGHTBL, neightbl_set, NULL); |
4006 |
++ rtnl_register(PF_UNSPEC, RTM_GETNEIGHTBL, NULL, neightbl_dump_info, |
4007 |
++ NULL); |
4008 |
++ rtnl_register(PF_UNSPEC, RTM_SETNEIGHTBL, neightbl_set, NULL, NULL); |
4009 |
+ |
4010 |
+ return 0; |
4011 |
+ } |
4012 |
+diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c |
4013 |
+index ac49ad5..49f281e 100644 |
4014 |
+--- a/net/core/rtnetlink.c |
4015 |
++++ b/net/core/rtnetlink.c |
4016 |
+@@ -56,6 +56,7 @@ |
4017 |
+ struct rtnl_link { |
4018 |
+ rtnl_doit_func doit; |
4019 |
+ rtnl_dumpit_func dumpit; |
4020 |
++ rtnl_calcit_func calcit; |
4021 |
+ }; |
4022 |
+ |
4023 |
+ static DEFINE_MUTEX(rtnl_mutex); |
4024 |
+@@ -144,12 +145,28 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex) |
4025 |
+ return tab ? tab[msgindex].dumpit : NULL; |
4026 |
+ } |
4027 |
+ |
4028 |
++static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex) |
4029 |
++{ |
4030 |
++ struct rtnl_link *tab; |
4031 |
++ |
4032 |
++ if (protocol <= RTNL_FAMILY_MAX) |
4033 |
++ tab = rtnl_msg_handlers[protocol]; |
4034 |
++ else |
4035 |
++ tab = NULL; |
4036 |
++ |
4037 |
++ if (tab == NULL || tab[msgindex].calcit == NULL) |
4038 |
++ tab = rtnl_msg_handlers[PF_UNSPEC]; |
4039 |
++ |
4040 |
++ return tab ? tab[msgindex].calcit : NULL; |
4041 |
++} |
4042 |
++ |
4043 |
+ /** |
4044 |
+ * __rtnl_register - Register a rtnetlink message type |
4045 |
+ * @protocol: Protocol family or PF_UNSPEC |
4046 |
+ * @msgtype: rtnetlink message type |
4047 |
+ * @doit: Function pointer called for each request message |
4048 |
+ * @dumpit: Function pointer called for each dump request (NLM_F_DUMP) message |
4049 |
++ * @calcit: Function pointer to calc size of dump message |
4050 |
+ * |
4051 |
+ * Registers the specified function pointers (at least one of them has |
4052 |
+ * to be non-NULL) to be called whenever a request message for the |
4053 |
+@@ -162,7 +179,8 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex) |
4054 |
+ * Returns 0 on success or a negative error code. |
4055 |
+ */ |
4056 |
+ int __rtnl_register(int protocol, int msgtype, |
4057 |
+- rtnl_doit_func doit, rtnl_dumpit_func dumpit) |
4058 |
++ rtnl_doit_func doit, rtnl_dumpit_func dumpit, |
4059 |
++ rtnl_calcit_func calcit) |
4060 |
+ { |
4061 |
+ struct rtnl_link *tab; |
4062 |
+ int msgindex; |
4063 |
+@@ -185,6 +203,9 @@ int __rtnl_register(int protocol, int msgtype, |
4064 |
+ if (dumpit) |
4065 |
+ tab[msgindex].dumpit = dumpit; |
4066 |
+ |
4067 |
++ if (calcit) |
4068 |
++ tab[msgindex].calcit = calcit; |
4069 |
++ |
4070 |
+ return 0; |
4071 |
+ } |
4072 |
+ EXPORT_SYMBOL_GPL(__rtnl_register); |
4073 |
+@@ -199,9 +220,10 @@ EXPORT_SYMBOL_GPL(__rtnl_register); |
4074 |
+ * of memory implies no sense in continuing. |
4075 |
+ */ |
4076 |
+ void rtnl_register(int protocol, int msgtype, |
4077 |
+- rtnl_doit_func doit, rtnl_dumpit_func dumpit) |
4078 |
++ rtnl_doit_func doit, rtnl_dumpit_func dumpit, |
4079 |
++ rtnl_calcit_func calcit) |
4080 |
+ { |
4081 |
+- if (__rtnl_register(protocol, msgtype, doit, dumpit) < 0) |
4082 |
++ if (__rtnl_register(protocol, msgtype, doit, dumpit, calcit) < 0) |
4083 |
+ panic("Unable to register rtnetlink message handler, " |
4084 |
+ "protocol = %d, message type = %d\n", |
4085 |
+ protocol, msgtype); |
4086 |
+@@ -704,10 +726,11 @@ static void copy_rtnl_link_stats64(void *v, const struct rtnl_link_stats64 *b) |
4087 |
+ } |
4088 |
+ |
4089 |
+ /* All VF info */ |
4090 |
+-static inline int rtnl_vfinfo_size(const struct net_device *dev) |
4091 |
++static inline int rtnl_vfinfo_size(const struct net_device *dev, |
4092 |
++ u32 ext_filter_mask) |
4093 |
+ { |
4094 |
+- if (dev->dev.parent && dev_is_pci(dev->dev.parent)) { |
4095 |
+- |
4096 |
++ if (dev->dev.parent && dev_is_pci(dev->dev.parent) && |
4097 |
++ (ext_filter_mask & RTEXT_FILTER_VF)) { |
4098 |
+ int num_vfs = dev_num_vf(dev->dev.parent); |
4099 |
+ size_t size = nla_total_size(sizeof(struct nlattr)); |
4100 |
+ size += nla_total_size(num_vfs * sizeof(struct nlattr)); |
4101 |
+@@ -745,7 +768,8 @@ static size_t rtnl_port_size(const struct net_device *dev) |
4102 |
+ return port_self_size; |
4103 |
+ } |
4104 |
+ |
4105 |
+-static noinline size_t if_nlmsg_size(const struct net_device *dev) |
4106 |
++static noinline size_t if_nlmsg_size(const struct net_device *dev, |
4107 |
++ u32 ext_filter_mask) |
4108 |
+ { |
4109 |
+ return NLMSG_ALIGN(sizeof(struct ifinfomsg)) |
4110 |
+ + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ |
4111 |
+@@ -763,8 +787,9 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev) |
4112 |
+ + nla_total_size(4) /* IFLA_MASTER */ |
4113 |
+ + nla_total_size(1) /* IFLA_OPERSTATE */ |
4114 |
+ + nla_total_size(1) /* IFLA_LINKMODE */ |
4115 |
+- + nla_total_size(4) /* IFLA_NUM_VF */ |
4116 |
+- + rtnl_vfinfo_size(dev) /* IFLA_VFINFO_LIST */ |
4117 |
++ + nla_total_size(ext_filter_mask |
4118 |
++ & RTEXT_FILTER_VF ? 4 : 0) /* IFLA_NUM_VF */ |
4119 |
++ + rtnl_vfinfo_size(dev, ext_filter_mask) /* IFLA_VFINFO_LIST */ |
4120 |
+ + rtnl_port_size(dev) /* IFLA_VF_PORTS + IFLA_PORT_SELF */ |
4121 |
+ + rtnl_link_get_size(dev) /* IFLA_LINKINFO */ |
4122 |
+ + rtnl_link_get_af_size(dev); /* IFLA_AF_SPEC */ |
4123 |
+@@ -847,7 +872,7 @@ static int rtnl_port_fill(struct sk_buff *skb, struct net_device *dev) |
4124 |
+ |
4125 |
+ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, |
4126 |
+ int type, u32 pid, u32 seq, u32 change, |
4127 |
+- unsigned int flags) |
4128 |
++ unsigned int flags, u32 ext_filter_mask) |
4129 |
+ { |
4130 |
+ struct ifinfomsg *ifm; |
4131 |
+ struct nlmsghdr *nlh; |
4132 |
+@@ -920,10 +945,11 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, |
4133 |
+ goto nla_put_failure; |
4134 |
+ copy_rtnl_link_stats64(nla_data(attr), stats); |
4135 |
+ |
4136 |
+- if (dev->dev.parent) |
4137 |
++ if (dev->dev.parent && (ext_filter_mask & RTEXT_FILTER_VF)) |
4138 |
+ NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent)); |
4139 |
+ |
4140 |
+- if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) { |
4141 |
++ if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent |
4142 |
++ && (ext_filter_mask & RTEXT_FILTER_VF)) { |
4143 |
+ int i; |
4144 |
+ |
4145 |
+ struct nlattr *vfinfo, *vf; |
4146 |
+@@ -1010,11 +1036,21 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) |
4147 |
+ struct net_device *dev; |
4148 |
+ struct hlist_head *head; |
4149 |
+ struct hlist_node *node; |
4150 |
++ struct nlattr *tb[IFLA_MAX+1]; |
4151 |
++ u32 ext_filter_mask = 0; |
4152 |
+ |
4153 |
+ s_h = cb->args[0]; |
4154 |
+ s_idx = cb->args[1]; |
4155 |
+ |
4156 |
+ rcu_read_lock(); |
4157 |
++ |
4158 |
++ if (nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, |
4159 |
++ ifla_policy) >= 0) { |
4160 |
++ |
4161 |
++ if (tb[IFLA_EXT_MASK]) |
4162 |
++ ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); |
4163 |
++ } |
4164 |
++ |
4165 |
+ for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) { |
4166 |
+ idx = 0; |
4167 |
+ head = &net->dev_index_head[h]; |
4168 |
+@@ -1024,7 +1060,8 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) |
4169 |
+ if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK, |
4170 |
+ NETLINK_CB(cb->skb).pid, |
4171 |
+ cb->nlh->nlmsg_seq, 0, |
4172 |
+- NLM_F_MULTI) <= 0) |
4173 |
++ NLM_F_MULTI, |
4174 |
++ ext_filter_mask) <= 0) |
4175 |
+ goto out; |
4176 |
+ cont: |
4177 |
+ idx++; |
4178 |
+@@ -1058,6 +1095,7 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = { |
4179 |
+ [IFLA_VF_PORTS] = { .type = NLA_NESTED }, |
4180 |
+ [IFLA_PORT_SELF] = { .type = NLA_NESTED }, |
4181 |
+ [IFLA_AF_SPEC] = { .type = NLA_NESTED }, |
4182 |
++ [IFLA_EXT_MASK] = { .type = NLA_U32 }, |
4183 |
+ }; |
4184 |
+ EXPORT_SYMBOL(ifla_policy); |
4185 |
+ |
4186 |
+@@ -1790,6 +1828,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
4187 |
+ struct net_device *dev = NULL; |
4188 |
+ struct sk_buff *nskb; |
4189 |
+ int err; |
4190 |
++ u32 ext_filter_mask = 0; |
4191 |
+ |
4192 |
+ err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); |
4193 |
+ if (err < 0) |
4194 |
+@@ -1798,6 +1837,9 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
4195 |
+ if (tb[IFLA_IFNAME]) |
4196 |
+ nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ); |
4197 |
+ |
4198 |
++ if (tb[IFLA_EXT_MASK]) |
4199 |
++ ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); |
4200 |
++ |
4201 |
+ ifm = nlmsg_data(nlh); |
4202 |
+ if (ifm->ifi_index > 0) |
4203 |
+ dev = __dev_get_by_index(net, ifm->ifi_index); |
4204 |
+@@ -1809,12 +1851,12 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
4205 |
+ if (dev == NULL) |
4206 |
+ return -ENODEV; |
4207 |
+ |
4208 |
+- nskb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL); |
4209 |
++ nskb = nlmsg_new(if_nlmsg_size(dev, ext_filter_mask), GFP_KERNEL); |
4210 |
+ if (nskb == NULL) |
4211 |
+ return -ENOBUFS; |
4212 |
+ |
4213 |
+ err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid, |
4214 |
+- nlh->nlmsg_seq, 0, 0); |
4215 |
++ nlh->nlmsg_seq, 0, 0, ext_filter_mask); |
4216 |
+ if (err < 0) { |
4217 |
+ /* -EMSGSIZE implies BUG in if_nlmsg_size */ |
4218 |
+ WARN_ON(err == -EMSGSIZE); |
4219 |
+@@ -1825,6 +1867,35 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
4220 |
+ return err; |
4221 |
+ } |
4222 |
+ |
4223 |
++static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh) |
4224 |
++{ |
4225 |
++ struct net *net = sock_net(skb->sk); |
4226 |
++ struct net_device *dev; |
4227 |
++ struct nlattr *tb[IFLA_MAX+1]; |
4228 |
++ u32 ext_filter_mask = 0; |
4229 |
++ u16 min_ifinfo_dump_size = 0; |
4230 |
++ |
4231 |
++ if (nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX, |
4232 |
++ ifla_policy) >= 0) { |
4233 |
++ if (tb[IFLA_EXT_MASK]) |
4234 |
++ ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); |
4235 |
++ } |
4236 |
++ |
4237 |
++ if (!ext_filter_mask) |
4238 |
++ return NLMSG_GOODSIZE; |
4239 |
++ /* |
4240 |
++ * traverse the list of net devices and compute the minimum |
4241 |
++ * buffer size based upon the filter mask. |
4242 |
++ */ |
4243 |
++ list_for_each_entry(dev, &net->dev_base_head, dev_list) { |
4244 |
++ min_ifinfo_dump_size = max_t(u16, min_ifinfo_dump_size, |
4245 |
++ if_nlmsg_size(dev, |
4246 |
++ ext_filter_mask)); |
4247 |
++ } |
4248 |
++ |
4249 |
++ return min_ifinfo_dump_size; |
4250 |
++} |
4251 |
++ |
4252 |
+ static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb) |
4253 |
+ { |
4254 |
+ int idx; |
4255 |
+@@ -1854,12 +1925,13 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) |
4256 |
+ struct net *net = dev_net(dev); |
4257 |
+ struct sk_buff *skb; |
4258 |
+ int err = -ENOBUFS; |
4259 |
++ size_t if_info_size; |
4260 |
+ |
4261 |
+- skb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL); |
4262 |
++ skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), GFP_KERNEL); |
4263 |
+ if (skb == NULL) |
4264 |
+ goto errout; |
4265 |
+ |
4266 |
+- err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0); |
4267 |
++ err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0, 0); |
4268 |
+ if (err < 0) { |
4269 |
+ /* -EMSGSIZE implies BUG in if_nlmsg_size() */ |
4270 |
+ WARN_ON(err == -EMSGSIZE); |
4271 |
+@@ -1909,14 +1981,20 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
4272 |
+ if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) { |
4273 |
+ struct sock *rtnl; |
4274 |
+ rtnl_dumpit_func dumpit; |
4275 |
++ rtnl_calcit_func calcit; |
4276 |
++ u16 min_dump_alloc = 0; |
4277 |
+ |
4278 |
+ dumpit = rtnl_get_dumpit(family, type); |
4279 |
+ if (dumpit == NULL) |
4280 |
+ return -EOPNOTSUPP; |
4281 |
++ calcit = rtnl_get_calcit(family, type); |
4282 |
++ if (calcit) |
4283 |
++ min_dump_alloc = calcit(skb, nlh); |
4284 |
+ |
4285 |
+ __rtnl_unlock(); |
4286 |
+ rtnl = net->rtnl; |
4287 |
+- err = netlink_dump_start(rtnl, skb, nlh, dumpit, NULL); |
4288 |
++ err = netlink_dump_start(rtnl, skb, nlh, dumpit, |
4289 |
++ NULL, min_dump_alloc); |
4290 |
+ rtnl_lock(); |
4291 |
+ return err; |
4292 |
+ } |
4293 |
+@@ -2026,12 +2104,13 @@ void __init rtnetlink_init(void) |
4294 |
+ netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV); |
4295 |
+ register_netdevice_notifier(&rtnetlink_dev_notifier); |
4296 |
+ |
4297 |
+- rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink, rtnl_dump_ifinfo); |
4298 |
+- rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL); |
4299 |
+- rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL); |
4300 |
+- rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL); |
4301 |
++ rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink, |
4302 |
++ rtnl_dump_ifinfo, rtnl_calcit); |
4303 |
++ rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL, NULL); |
4304 |
++ rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL, NULL); |
4305 |
++ rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL, NULL); |
4306 |
+ |
4307 |
+- rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all); |
4308 |
+- rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all); |
4309 |
++ rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all, NULL); |
4310 |
++ rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all, NULL); |
4311 |
+ } |
4312 |
+ |
4313 |
+diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c |
4314 |
+index 3609eac..ed1bb8c 100644 |
4315 |
+--- a/net/dcb/dcbnl.c |
4316 |
++++ b/net/dcb/dcbnl.c |
4317 |
+@@ -1819,8 +1819,8 @@ static int __init dcbnl_init(void) |
4318 |
+ { |
4319 |
+ INIT_LIST_HEAD(&dcb_app_list); |
4320 |
+ |
4321 |
+- rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL); |
4322 |
+- rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL); |
4323 |
++ rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, NULL); |
4324 |
++ rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, NULL); |
4325 |
+ |
4326 |
+ return 0; |
4327 |
+ } |
4328 |
+diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c |
4329 |
+index cf26ac7..3780fd6 100644 |
4330 |
+--- a/net/decnet/dn_dev.c |
4331 |
++++ b/net/decnet/dn_dev.c |
4332 |
+@@ -1414,9 +1414,9 @@ void __init dn_dev_init(void) |
4333 |
+ |
4334 |
+ dn_dev_devices_on(); |
4335 |
+ |
4336 |
+- rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL); |
4337 |
+- rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL); |
4338 |
+- rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr); |
4339 |
++ rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL, NULL); |
4340 |
++ rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL, NULL); |
4341 |
++ rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr, NULL); |
4342 |
+ |
4343 |
+ proc_net_fops_create(&init_net, "decnet_dev", S_IRUGO, &dn_dev_seq_fops); |
4344 |
+ |
4345 |
+diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c |
4346 |
+index 1c74ed3..104324d 100644 |
4347 |
+--- a/net/decnet/dn_fib.c |
4348 |
++++ b/net/decnet/dn_fib.c |
4349 |
+@@ -763,8 +763,8 @@ void __init dn_fib_init(void) |
4350 |
+ |
4351 |
+ register_dnaddr_notifier(&dn_fib_dnaddr_notifier); |
4352 |
+ |
4353 |
+- rtnl_register(PF_DECnet, RTM_NEWROUTE, dn_fib_rtm_newroute, NULL); |
4354 |
+- rtnl_register(PF_DECnet, RTM_DELROUTE, dn_fib_rtm_delroute, NULL); |
4355 |
++ rtnl_register(PF_DECnet, RTM_NEWROUTE, dn_fib_rtm_newroute, NULL, NULL); |
4356 |
++ rtnl_register(PF_DECnet, RTM_DELROUTE, dn_fib_rtm_delroute, NULL, NULL); |
4357 |
+ } |
4358 |
+ |
4359 |
+ |
4360 |
+diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c |
4361 |
+index b91b603..82d6250 100644 |
4362 |
+--- a/net/decnet/dn_route.c |
4363 |
++++ b/net/decnet/dn_route.c |
4364 |
+@@ -1843,10 +1843,11 @@ void __init dn_route_init(void) |
4365 |
+ proc_net_fops_create(&init_net, "decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops); |
4366 |
+ |
4367 |
+ #ifdef CONFIG_DECNET_ROUTER |
4368 |
+- rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, dn_fib_dump); |
4369 |
++ rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, |
4370 |
++ dn_fib_dump, NULL); |
4371 |
+ #else |
4372 |
+ rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, |
4373 |
+- dn_cache_dump); |
4374 |
++ dn_cache_dump, NULL); |
4375 |
+ #endif |
4376 |
+ } |
4377 |
+ |
4378 |
+diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c |
4379 |
+index 7d7fb20..070f214 100644 |
4380 |
+--- a/net/ipv4/devinet.c |
4381 |
++++ b/net/ipv4/devinet.c |
4382 |
+@@ -1838,8 +1838,8 @@ void __init devinet_init(void) |
4383 |
+ |
4384 |
+ rtnl_af_register(&inet_af_ops); |
4385 |
+ |
4386 |
+- rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL); |
4387 |
+- rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL); |
4388 |
+- rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr); |
4389 |
++ rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL, NULL); |
4390 |
++ rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL, NULL); |
4391 |
++ rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr, NULL); |
4392 |
+ } |
4393 |
+ |
4394 |
+diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c |
4395 |
+index 2252471..92fc5f6 100644 |
4396 |
+--- a/net/ipv4/fib_frontend.c |
4397 |
++++ b/net/ipv4/fib_frontend.c |
4398 |
+@@ -1124,9 +1124,9 @@ static struct pernet_operations fib_net_ops = { |
4399 |
+ |
4400 |
+ void __init ip_fib_init(void) |
4401 |
+ { |
4402 |
+- rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL); |
4403 |
+- rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL); |
4404 |
+- rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib); |
4405 |
++ rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL, NULL); |
4406 |
++ rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL, NULL); |
4407 |
++ rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib, NULL); |
4408 |
+ |
4409 |
+ register_pernet_subsys(&fib_net_ops); |
4410 |
+ register_netdevice_notifier(&fib_netdev_notifier); |
4411 |
+diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c |
4412 |
+index 3267d38..389a2e6 100644 |
4413 |
+--- a/net/ipv4/inet_diag.c |
4414 |
++++ b/net/ipv4/inet_diag.c |
4415 |
+@@ -869,7 +869,7 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
4416 |
+ } |
4417 |
+ |
4418 |
+ return netlink_dump_start(idiagnl, skb, nlh, |
4419 |
+- inet_diag_dump, NULL); |
4420 |
++ inet_diag_dump, NULL, 0); |
4421 |
+ } |
4422 |
+ |
4423 |
+ return inet_diag_get_exact(skb, nlh); |
4424 |
+diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c |
4425 |
+index ec7d8e7..dc89714 100644 |
4426 |
+--- a/net/ipv4/ipmr.c |
4427 |
++++ b/net/ipv4/ipmr.c |
4428 |
+@@ -2554,7 +2554,8 @@ int __init ip_mr_init(void) |
4429 |
+ goto add_proto_fail; |
4430 |
+ } |
4431 |
+ #endif |
4432 |
+- rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE, NULL, ipmr_rtm_dumproute); |
4433 |
++ rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE, |
4434 |
++ NULL, ipmr_rtm_dumproute, NULL); |
4435 |
+ return 0; |
4436 |
+ |
4437 |
+ #ifdef CONFIG_IP_PIMSM_V2 |
4438 |
+diff --git a/net/ipv4/route.c b/net/ipv4/route.c |
4439 |
+index 5ff2614..0428b64 100644 |
4440 |
+--- a/net/ipv4/route.c |
4441 |
++++ b/net/ipv4/route.c |
4442 |
+@@ -3454,7 +3454,7 @@ int __init ip_rt_init(void) |
4443 |
+ xfrm_init(); |
4444 |
+ xfrm4_init(ip_rt_max_size); |
4445 |
+ #endif |
4446 |
+- rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL); |
4447 |
++ rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL, NULL); |
4448 |
+ |
4449 |
+ #ifdef CONFIG_SYSCTL |
4450 |
+ register_pernet_subsys(&sysctl_route_ops); |
4451 |
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c |
4452 |
+index 70d6a7f..e845c0c 100644 |
4453 |
+--- a/net/ipv6/addrconf.c |
4454 |
++++ b/net/ipv6/addrconf.c |
4455 |
+@@ -4694,16 +4694,20 @@ int __init addrconf_init(void) |
4456 |
+ if (err < 0) |
4457 |
+ goto errout_af; |
4458 |
+ |
4459 |
+- err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo); |
4460 |
++ err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo, |
4461 |
++ NULL); |
4462 |
+ if (err < 0) |
4463 |
+ goto errout; |
4464 |
+ |
4465 |
+ /* Only the first call to __rtnl_register can fail */ |
4466 |
+- __rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL); |
4467 |
+- __rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL); |
4468 |
+- __rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr, inet6_dump_ifaddr); |
4469 |
+- __rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL, inet6_dump_ifmcaddr); |
4470 |
+- __rtnl_register(PF_INET6, RTM_GETANYCAST, NULL, inet6_dump_ifacaddr); |
4471 |
++ __rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL, NULL); |
4472 |
++ __rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL, NULL); |
4473 |
++ __rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr, |
4474 |
++ inet6_dump_ifaddr, NULL); |
4475 |
++ __rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL, |
4476 |
++ inet6_dump_ifmcaddr, NULL); |
4477 |
++ __rtnl_register(PF_INET6, RTM_GETANYCAST, NULL, |
4478 |
++ inet6_dump_ifacaddr, NULL); |
4479 |
+ |
4480 |
+ ipv6_addr_label_rtnl_register(); |
4481 |
+ |
4482 |
+diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c |
4483 |
+index c8993e5..2d8ddba 100644 |
4484 |
+--- a/net/ipv6/addrlabel.c |
4485 |
++++ b/net/ipv6/addrlabel.c |
4486 |
+@@ -592,8 +592,11 @@ out: |
4487 |
+ |
4488 |
+ void __init ipv6_addr_label_rtnl_register(void) |
4489 |
+ { |
4490 |
+- __rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel, NULL); |
4491 |
+- __rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel, NULL); |
4492 |
+- __rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get, ip6addrlbl_dump); |
4493 |
++ __rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel, |
4494 |
++ NULL, NULL); |
4495 |
++ __rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel, |
4496 |
++ NULL, NULL); |
4497 |
++ __rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get, |
4498 |
++ ip6addrlbl_dump, NULL); |
4499 |
+ } |
4500 |
+ |
4501 |
+diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c |
4502 |
+index 0f9b37a..320d91d 100644 |
4503 |
+--- a/net/ipv6/ip6_fib.c |
4504 |
++++ b/net/ipv6/ip6_fib.c |
4505 |
+@@ -1586,7 +1586,8 @@ int __init fib6_init(void) |
4506 |
+ if (ret) |
4507 |
+ goto out_kmem_cache_create; |
4508 |
+ |
4509 |
+- ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib); |
4510 |
++ ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib, |
4511 |
++ NULL); |
4512 |
+ if (ret) |
4513 |
+ goto out_unregister_subsys; |
4514 |
+ out: |
4515 |
+diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c |
4516 |
+index 86e3cc1..def0538 100644 |
4517 |
+--- a/net/ipv6/ip6mr.c |
4518 |
++++ b/net/ipv6/ip6mr.c |
4519 |
+@@ -1356,7 +1356,8 @@ int __init ip6_mr_init(void) |
4520 |
+ goto add_proto_fail; |
4521 |
+ } |
4522 |
+ #endif |
4523 |
+- rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL, ip6mr_rtm_dumproute); |
4524 |
++ rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL, |
4525 |
++ ip6mr_rtm_dumproute, NULL); |
4526 |
+ return 0; |
4527 |
+ #ifdef CONFIG_IPV6_PIMSM_V2 |
4528 |
+ add_proto_fail: |
4529 |
+diff --git a/net/ipv6/route.c b/net/ipv6/route.c |
4530 |
+index da056c8..550fec3 100644 |
4531 |
+--- a/net/ipv6/route.c |
4532 |
++++ b/net/ipv6/route.c |
4533 |
+@@ -2956,9 +2956,9 @@ int __init ip6_route_init(void) |
4534 |
+ goto fib6_rules_init; |
4535 |
+ |
4536 |
+ ret = -ENOBUFS; |
4537 |
+- if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) || |
4538 |
+- __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) || |
4539 |
+- __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL)) |
4540 |
++ if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || |
4541 |
++ __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || |
4542 |
++ __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) |
4543 |
+ goto out_register_late_subsys; |
4544 |
+ |
4545 |
+ ret = register_netdevice_notifier(&ip6_route_dev_notifier); |
4546 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
4547 |
+index ca7bf10..4b40a3b 100644 |
4548 |
+--- a/net/mac80211/sta_info.c |
4549 |
++++ b/net/mac80211/sta_info.c |
4550 |
+@@ -793,7 +793,7 @@ void sta_info_init(struct ieee80211_local *local) |
4551 |
+ |
4552 |
+ void sta_info_stop(struct ieee80211_local *local) |
4553 |
+ { |
4554 |
+- del_timer(&local->sta_cleanup); |
4555 |
++ del_timer_sync(&local->sta_cleanup); |
4556 |
+ sta_info_flush(local, NULL); |
4557 |
+ } |
4558 |
+ |
4559 |
+diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c |
4560 |
+index 42aa64b..ee37ae5 100644 |
4561 |
+--- a/net/netfilter/ipset/ip_set_core.c |
4562 |
++++ b/net/netfilter/ipset/ip_set_core.c |
4563 |
+@@ -1120,7 +1120,7 @@ ip_set_dump(struct sock *ctnl, struct sk_buff *skb, |
4564 |
+ |
4565 |
+ return netlink_dump_start(ctnl, skb, nlh, |
4566 |
+ ip_set_dump_start, |
4567 |
+- ip_set_dump_done); |
4568 |
++ ip_set_dump_done, 0); |
4569 |
+ } |
4570 |
+ |
4571 |
+ /* Add, del and test */ |
4572 |
+diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c |
4573 |
+index 482e90c..7dec88a 100644 |
4574 |
+--- a/net/netfilter/nf_conntrack_netlink.c |
4575 |
++++ b/net/netfilter/nf_conntrack_netlink.c |
4576 |
+@@ -970,7 +970,7 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, |
4577 |
+ |
4578 |
+ if (nlh->nlmsg_flags & NLM_F_DUMP) |
4579 |
+ return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table, |
4580 |
+- ctnetlink_done); |
4581 |
++ ctnetlink_done, 0); |
4582 |
+ |
4583 |
+ err = ctnetlink_parse_zone(cda[CTA_ZONE], &zone); |
4584 |
+ if (err < 0) |
4585 |
+@@ -1840,7 +1840,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, |
4586 |
+ if (nlh->nlmsg_flags & NLM_F_DUMP) { |
4587 |
+ return netlink_dump_start(ctnl, skb, nlh, |
4588 |
+ ctnetlink_exp_dump_table, |
4589 |
+- ctnetlink_exp_done); |
4590 |
++ ctnetlink_exp_done, 0); |
4591 |
+ } |
4592 |
+ |
4593 |
+ err = ctnetlink_parse_zone(cda[CTA_EXPECT_ZONE], &zone); |
4594 |
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c |
4595 |
+index d29c222..10851ee 100644 |
4596 |
+--- a/net/netlink/af_netlink.c |
4597 |
++++ b/net/netlink/af_netlink.c |
4598 |
+@@ -1677,13 +1677,10 @@ static int netlink_dump(struct sock *sk) |
4599 |
+ { |
4600 |
+ struct netlink_sock *nlk = nlk_sk(sk); |
4601 |
+ struct netlink_callback *cb; |
4602 |
+- struct sk_buff *skb; |
4603 |
++ struct sk_buff *skb = NULL; |
4604 |
+ struct nlmsghdr *nlh; |
4605 |
+ int len, err = -ENOBUFS; |
4606 |
+- |
4607 |
+- skb = sock_rmalloc(sk, NLMSG_GOODSIZE, 0, GFP_KERNEL); |
4608 |
+- if (!skb) |
4609 |
+- goto errout; |
4610 |
++ int alloc_size; |
4611 |
+ |
4612 |
+ mutex_lock(nlk->cb_mutex); |
4613 |
+ |
4614 |
+@@ -1693,6 +1690,12 @@ static int netlink_dump(struct sock *sk) |
4615 |
+ goto errout_skb; |
4616 |
+ } |
4617 |
+ |
4618 |
++ alloc_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE); |
4619 |
++ |
4620 |
++ skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL); |
4621 |
++ if (!skb) |
4622 |
++ goto errout; |
4623 |
++ |
4624 |
+ len = cb->dump(skb, cb); |
4625 |
+ |
4626 |
+ if (len > 0) { |
4627 |
+@@ -1735,7 +1738,8 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
4628 |
+ const struct nlmsghdr *nlh, |
4629 |
+ int (*dump)(struct sk_buff *skb, |
4630 |
+ struct netlink_callback *), |
4631 |
+- int (*done)(struct netlink_callback *)) |
4632 |
++ int (*done)(struct netlink_callback *), |
4633 |
++ u16 min_dump_alloc) |
4634 |
+ { |
4635 |
+ struct netlink_callback *cb; |
4636 |
+ struct sock *sk; |
4637 |
+@@ -1749,6 +1753,7 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
4638 |
+ cb->dump = dump; |
4639 |
+ cb->done = done; |
4640 |
+ cb->nlh = nlh; |
4641 |
++ cb->min_dump_alloc = min_dump_alloc; |
4642 |
+ atomic_inc(&skb->users); |
4643 |
+ cb->skb = skb; |
4644 |
+ |
4645 |
+diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c |
4646 |
+index 1781d99..482fa57 100644 |
4647 |
+--- a/net/netlink/genetlink.c |
4648 |
++++ b/net/netlink/genetlink.c |
4649 |
+@@ -525,7 +525,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
4650 |
+ |
4651 |
+ genl_unlock(); |
4652 |
+ err = netlink_dump_start(net->genl_sock, skb, nlh, |
4653 |
+- ops->dumpit, ops->done); |
4654 |
++ ops->dumpit, ops->done, 0); |
4655 |
+ genl_lock(); |
4656 |
+ return err; |
4657 |
+ } |
4658 |
+diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c |
4659 |
+index 438accb..d61f676 100644 |
4660 |
+--- a/net/phonet/pn_netlink.c |
4661 |
++++ b/net/phonet/pn_netlink.c |
4662 |
+@@ -289,15 +289,16 @@ out: |
4663 |
+ |
4664 |
+ int __init phonet_netlink_register(void) |
4665 |
+ { |
4666 |
+- int err = __rtnl_register(PF_PHONET, RTM_NEWADDR, addr_doit, NULL); |
4667 |
++ int err = __rtnl_register(PF_PHONET, RTM_NEWADDR, addr_doit, |
4668 |
++ NULL, NULL); |
4669 |
+ if (err) |
4670 |
+ return err; |
4671 |
+ |
4672 |
+ /* Further __rtnl_register() cannot fail */ |
4673 |
+- __rtnl_register(PF_PHONET, RTM_DELADDR, addr_doit, NULL); |
4674 |
+- __rtnl_register(PF_PHONET, RTM_GETADDR, NULL, getaddr_dumpit); |
4675 |
+- __rtnl_register(PF_PHONET, RTM_NEWROUTE, route_doit, NULL); |
4676 |
+- __rtnl_register(PF_PHONET, RTM_DELROUTE, route_doit, NULL); |
4677 |
+- __rtnl_register(PF_PHONET, RTM_GETROUTE, NULL, route_dumpit); |
4678 |
++ __rtnl_register(PF_PHONET, RTM_DELADDR, addr_doit, NULL, NULL); |
4679 |
++ __rtnl_register(PF_PHONET, RTM_GETADDR, NULL, getaddr_dumpit, NULL); |
4680 |
++ __rtnl_register(PF_PHONET, RTM_NEWROUTE, route_doit, NULL, NULL); |
4681 |
++ __rtnl_register(PF_PHONET, RTM_DELROUTE, route_doit, NULL, NULL); |
4682 |
++ __rtnl_register(PF_PHONET, RTM_GETROUTE, NULL, route_dumpit, NULL); |
4683 |
+ return 0; |
4684 |
+ } |
4685 |
+diff --git a/net/sched/act_api.c b/net/sched/act_api.c |
4686 |
+index a606025..2f64262 100644 |
4687 |
+--- a/net/sched/act_api.c |
4688 |
++++ b/net/sched/act_api.c |
4689 |
+@@ -1115,9 +1115,10 @@ nlmsg_failure: |
4690 |
+ |
4691 |
+ static int __init tc_action_init(void) |
4692 |
+ { |
4693 |
+- rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL); |
4694 |
+- rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL); |
4695 |
+- rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action); |
4696 |
++ rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, NULL); |
4697 |
++ rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, NULL); |
4698 |
++ rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action, |
4699 |
++ NULL); |
4700 |
+ |
4701 |
+ return 0; |
4702 |
+ } |
4703 |
+diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c |
4704 |
+index bb2c523..9563887 100644 |
4705 |
+--- a/net/sched/cls_api.c |
4706 |
++++ b/net/sched/cls_api.c |
4707 |
+@@ -610,10 +610,10 @@ EXPORT_SYMBOL(tcf_exts_dump_stats); |
4708 |
+ |
4709 |
+ static int __init tc_filter_init(void) |
4710 |
+ { |
4711 |
+- rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL); |
4712 |
+- rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL); |
4713 |
++ rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL, NULL); |
4714 |
++ rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL, NULL); |
4715 |
+ rtnl_register(PF_UNSPEC, RTM_GETTFILTER, tc_ctl_tfilter, |
4716 |
+- tc_dump_tfilter); |
4717 |
++ tc_dump_tfilter, NULL); |
4718 |
+ |
4719 |
+ return 0; |
4720 |
+ } |
4721 |
+diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c |
4722 |
+index 6b86276..8182aef 100644 |
4723 |
+--- a/net/sched/sch_api.c |
4724 |
++++ b/net/sched/sch_api.c |
4725 |
+@@ -1792,12 +1792,12 @@ static int __init pktsched_init(void) |
4726 |
+ register_qdisc(&pfifo_head_drop_qdisc_ops); |
4727 |
+ register_qdisc(&mq_qdisc_ops); |
4728 |
+ |
4729 |
+- rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL); |
4730 |
+- rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL); |
4731 |
+- rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc); |
4732 |
+- rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL); |
4733 |
+- rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL); |
4734 |
+- rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass); |
4735 |
++ rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL, NULL); |
4736 |
++ rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL, NULL); |
4737 |
++ rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc, NULL); |
4738 |
++ rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL, NULL); |
4739 |
++ rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL, NULL); |
4740 |
++ rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass, NULL); |
4741 |
+ |
4742 |
+ return 0; |
4743 |
+ } |
4744 |
+diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c |
4745 |
+index c57f97f..d7824ec 100644 |
4746 |
+--- a/net/sunrpc/sched.c |
4747 |
++++ b/net/sunrpc/sched.c |
4748 |
+@@ -844,16 +844,35 @@ struct rpc_task *rpc_new_task(const struct rpc_task_setup *setup_data) |
4749 |
+ return task; |
4750 |
+ } |
4751 |
+ |
4752 |
++/* |
4753 |
++ * rpc_free_task - release rpc task and perform cleanups |
4754 |
++ * |
4755 |
++ * Note that we free up the rpc_task _after_ rpc_release_calldata() |
4756 |
++ * in order to work around a workqueue dependency issue. |
4757 |
++ * |
4758 |
++ * Tejun Heo states: |
4759 |
++ * "Workqueue currently considers two work items to be the same if they're |
4760 |
++ * on the same address and won't execute them concurrently - ie. it |
4761 |
++ * makes a work item which is queued again while being executed wait |
4762 |
++ * for the previous execution to complete. |
4763 |
++ * |
4764 |
++ * If a work function frees the work item, and then waits for an event |
4765 |
++ * which should be performed by another work item and *that* work item |
4766 |
++ * recycles the freed work item, it can create a false dependency loop. |
4767 |
++ * There really is no reliable way to detect this short of verifying |
4768 |
++ * every memory free." |
4769 |
++ * |
4770 |
++ */ |
4771 |
+ static void rpc_free_task(struct rpc_task *task) |
4772 |
+ { |
4773 |
+- const struct rpc_call_ops *tk_ops = task->tk_ops; |
4774 |
+- void *calldata = task->tk_calldata; |
4775 |
++ unsigned short tk_flags = task->tk_flags; |
4776 |
++ |
4777 |
++ rpc_release_calldata(task->tk_ops, task->tk_calldata); |
4778 |
+ |
4779 |
+- if (task->tk_flags & RPC_TASK_DYNAMIC) { |
4780 |
++ if (tk_flags & RPC_TASK_DYNAMIC) { |
4781 |
+ dprintk("RPC: %5u freeing task\n", task->tk_pid); |
4782 |
+ mempool_free(task, rpc_task_mempool); |
4783 |
+ } |
4784 |
+- rpc_release_calldata(tk_ops, calldata); |
4785 |
+ } |
4786 |
+ |
4787 |
+ static void rpc_async_release(struct work_struct *work) |
4788 |
+diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c |
4789 |
+index 05f82e6..9bbe858 100644 |
4790 |
+--- a/net/xfrm/xfrm_user.c |
4791 |
++++ b/net/xfrm/xfrm_user.c |
4792 |
+@@ -2326,7 +2326,8 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
4793 |
+ if (link->dump == NULL) |
4794 |
+ return -EINVAL; |
4795 |
+ |
4796 |
+- return netlink_dump_start(net->xfrm.nlsk, skb, nlh, link->dump, link->done); |
4797 |
++ return netlink_dump_start(net->xfrm.nlsk, skb, nlh, |
4798 |
++ link->dump, link->done, 0); |
4799 |
+ } |
4800 |
+ |
4801 |
+ err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, XFRMA_MAX, |
4802 |
+diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c |
4803 |
+index 88eec38..05bdcb2 100644 |
4804 |
+--- a/sound/arm/pxa2xx-ac97-lib.c |
4805 |
++++ b/sound/arm/pxa2xx-ac97-lib.c |
4806 |
+@@ -146,6 +146,8 @@ static inline void pxa_ac97_warm_pxa27x(void) |
4807 |
+ |
4808 |
+ static inline void pxa_ac97_cold_pxa27x(void) |
4809 |
+ { |
4810 |
++ unsigned int timeout; |
4811 |
++ |
4812 |
+ GCR &= GCR_COLD_RST; /* clear everything but nCRST */ |
4813 |
+ GCR &= ~GCR_COLD_RST; /* then assert nCRST */ |
4814 |
+ |
4815 |
+@@ -155,8 +157,10 @@ static inline void pxa_ac97_cold_pxa27x(void) |
4816 |
+ clk_enable(ac97conf_clk); |
4817 |
+ udelay(5); |
4818 |
+ clk_disable(ac97conf_clk); |
4819 |
+- GCR = GCR_COLD_RST; |
4820 |
+- udelay(50); |
4821 |
++ GCR = GCR_COLD_RST | GCR_WARM_RST; |
4822 |
++ timeout = 100; /* wait for the codec-ready bit to be set */ |
4823 |
++ while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--) |
4824 |
++ mdelay(1); |
4825 |
+ } |
4826 |
+ #endif |
4827 |
+ |
4828 |
+diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c |
4829 |
+index a3b9cbb..ba03dc2 100644 |
4830 |
+--- a/sound/soc/codecs/wm2000.c |
4831 |
++++ b/sound/soc/codecs/wm2000.c |
4832 |
+@@ -224,9 +224,9 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue) |
4833 |
+ |
4834 |
+ ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY); |
4835 |
+ if (wm2000->speech_clarity) |
4836 |
+- ret &= ~WM2000_SPEECH_CLARITY; |
4837 |
+- else |
4838 |
+ ret |= WM2000_SPEECH_CLARITY; |
4839 |
++ else |
4840 |
++ ret &= ~WM2000_SPEECH_CLARITY; |
4841 |
+ wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret); |
4842 |
+ |
4843 |
+ wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33); |
4844 |
|
4845 |
Added: genpatches-2.6/trunk/3.0/1059_linux-3.0.60.patch |
4846 |
=================================================================== |
4847 |
--- genpatches-2.6/trunk/3.0/1059_linux-3.0.60.patch (rev 0) |
4848 |
+++ genpatches-2.6/trunk/3.0/1059_linux-3.0.60.patch 2013-01-29 00:51:38 UTC (rev 2267) |
4849 |
@@ -0,0 +1,691 @@ |
4850 |
+diff --git a/Makefile b/Makefile |
4851 |
+index d1b37fc..3359fcf 100644 |
4852 |
+--- a/Makefile |
4853 |
++++ b/Makefile |
4854 |
+@@ -1,6 +1,6 @@ |
4855 |
+ VERSION = 3 |
4856 |
+ PATCHLEVEL = 0 |
4857 |
+-SUBLEVEL = 59 |
4858 |
++SUBLEVEL = 60 |
4859 |
+ EXTRAVERSION = |
4860 |
+ NAME = Sneaky Weasel |
4861 |
+ |
4862 |
+diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c |
4863 |
+index 1b5dc1a..daf793b 100644 |
4864 |
+--- a/arch/powerpc/platforms/embedded6xx/wii.c |
4865 |
++++ b/arch/powerpc/platforms/embedded6xx/wii.c |
4866 |
+@@ -85,9 +85,11 @@ void __init wii_memory_fixups(void) |
4867 |
+ wii_hole_start = p[0].base + p[0].size; |
4868 |
+ wii_hole_size = p[1].base - wii_hole_start; |
4869 |
+ |
4870 |
+- pr_info("MEM1: <%08llx %08llx>\n", p[0].base, p[0].size); |
4871 |
++ pr_info("MEM1: <%08llx %08llx>\n", |
4872 |
++ (unsigned long long) p[0].base, (unsigned long long) p[0].size); |
4873 |
+ pr_info("HOLE: <%08lx %08lx>\n", wii_hole_start, wii_hole_size); |
4874 |
+- pr_info("MEM2: <%08llx %08llx>\n", p[1].base, p[1].size); |
4875 |
++ pr_info("MEM2: <%08llx %08llx>\n", |
4876 |
++ (unsigned long long) p[1].base, (unsigned long long) p[1].size); |
4877 |
+ |
4878 |
+ p[0].size += wii_hole_size + p[1].size; |
4879 |
+ |
4880 |
+diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h |
4881 |
+index 88829a4..a4b8f60 100644 |
4882 |
+--- a/arch/s390/include/asm/timex.h |
4883 |
++++ b/arch/s390/include/asm/timex.h |
4884 |
+@@ -126,4 +126,32 @@ static inline unsigned long long get_clock_monotonic(void) |
4885 |
+ return get_clock_xt() - sched_clock_base_cc; |
4886 |
+ } |
4887 |
+ |
4888 |
++/** |
4889 |
++ * tod_to_ns - convert a TOD format value to nanoseconds |
4890 |
++ * @todval: to be converted TOD format value |
4891 |
++ * Returns: number of nanoseconds that correspond to the TOD format value |
4892 |
++ * |
4893 |
++ * Converting a 64 Bit TOD format value to nanoseconds means that the value |
4894 |
++ * must be divided by 4.096. In order to achieve that we multiply with 125 |
4895 |
++ * and divide by 512: |
4896 |
++ * |
4897 |
++ * ns = (todval * 125) >> 9; |
4898 |
++ * |
4899 |
++ * In order to avoid an overflow with the multiplication we can rewrite this. |
4900 |
++ * With a split todval == 2^32 * th + tl (th upper 32 bits, tl lower 32 bits) |
4901 |
++ * we end up with |
4902 |
++ * |
4903 |
++ * ns = ((2^32 * th + tl) * 125 ) >> 9; |
4904 |
++ * -> ns = (2^23 * th * 125) + ((tl * 125) >> 9); |
4905 |
++ * |
4906 |
++ */ |
4907 |
++static inline unsigned long long tod_to_ns(unsigned long long todval) |
4908 |
++{ |
4909 |
++ unsigned long long ns; |
4910 |
++ |
4911 |
++ ns = ((todval >> 32) << 23) * 125; |
4912 |
++ ns += ((todval & 0xffffffff) * 125) >> 9; |
4913 |
++ return ns; |
4914 |
++} |
4915 |
++ |
4916 |
+ #endif |
4917 |
+diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c |
4918 |
+index dff9330..943ea0e 100644 |
4919 |
+--- a/arch/s390/kernel/time.c |
4920 |
++++ b/arch/s390/kernel/time.c |
4921 |
+@@ -63,7 +63,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators); |
4922 |
+ */ |
4923 |
+ unsigned long long notrace __kprobes sched_clock(void) |
4924 |
+ { |
4925 |
+- return (get_clock_monotonic() * 125) >> 9; |
4926 |
++ return tod_to_ns(get_clock_monotonic()); |
4927 |
+ } |
4928 |
+ |
4929 |
+ /* |
4930 |
+diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c |
4931 |
+index 35c21bf..a3db4c8 100644 |
4932 |
+--- a/arch/s390/kvm/interrupt.c |
4933 |
++++ b/arch/s390/kvm/interrupt.c |
4934 |
+@@ -358,7 +358,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) |
4935 |
+ return 0; |
4936 |
+ } |
4937 |
+ |
4938 |
+- sltime = ((vcpu->arch.sie_block->ckc - now)*125)>>9; |
4939 |
++ sltime = tod_to_ns(vcpu->arch.sie_block->ckc - now); |
4940 |
+ |
4941 |
+ hrtimer_start(&vcpu->arch.ckc_timer, ktime_set (0, sltime) , HRTIMER_MODE_REL); |
4942 |
+ VCPU_EVENT(vcpu, 5, "enabled wait via clock comparator: %llx ns", sltime); |
4943 |
+diff --git a/arch/sh/include/asm/elf.h b/arch/sh/include/asm/elf.h |
4944 |
+index f38112b..978b7fd 100644 |
4945 |
+--- a/arch/sh/include/asm/elf.h |
4946 |
++++ b/arch/sh/include/asm/elf.h |
4947 |
+@@ -202,9 +202,9 @@ extern void __kernel_vsyscall; |
4948 |
+ if (vdso_enabled) \ |
4949 |
+ NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \ |
4950 |
+ else \ |
4951 |
+- NEW_AUX_ENT(AT_IGNORE, 0); |
4952 |
++ NEW_AUX_ENT(AT_IGNORE, 0) |
4953 |
+ #else |
4954 |
+-#define VSYSCALL_AUX_ENT |
4955 |
++#define VSYSCALL_AUX_ENT NEW_AUX_ENT(AT_IGNORE, 0) |
4956 |
+ #endif /* CONFIG_VSYSCALL */ |
4957 |
+ |
4958 |
+ #ifdef CONFIG_SH_FPU |
4959 |
+diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S |
4960 |
+index 268b40d..2df1252 100644 |
4961 |
+--- a/arch/x86/kernel/entry_32.S |
4962 |
++++ b/arch/x86/kernel/entry_32.S |
4963 |
+@@ -1078,7 +1078,6 @@ ENTRY(xen_failsafe_callback) |
4964 |
+ lea 16(%esp),%esp |
4965 |
+ CFI_ADJUST_CFA_OFFSET -16 |
4966 |
+ jz 5f |
4967 |
+- addl $16,%esp |
4968 |
+ jmp iret_exc |
4969 |
+ 5: pushl_cfi $-1 /* orig_ax = -1 => not a system call */ |
4970 |
+ SAVE_ALL |
4971 |
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c |
4972 |
+index af19a61..eb9eb8b 100644 |
4973 |
+--- a/arch/x86/kernel/setup.c |
4974 |
++++ b/arch/x86/kernel/setup.c |
4975 |
+@@ -631,6 +631,81 @@ static __init void reserve_ibft_region(void) |
4976 |
+ |
4977 |
+ static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10; |
4978 |
+ |
4979 |
++static bool __init snb_gfx_workaround_needed(void) |
4980 |
++{ |
4981 |
++ int i; |
4982 |
++ u16 vendor, devid; |
4983 |
++ static const u16 snb_ids[] = { |
4984 |
++ 0x0102, |
4985 |
++ 0x0112, |
4986 |
++ 0x0122, |
4987 |
++ 0x0106, |
4988 |
++ 0x0116, |
4989 |
++ 0x0126, |
4990 |
++ 0x010a, |
4991 |
++ }; |
4992 |
++ |
4993 |
++ /* Assume no if something weird is going on with PCI */ |
4994 |
++ if (!early_pci_allowed()) |
4995 |
++ return false; |
4996 |
++ |
4997 |
++ vendor = read_pci_config_16(0, 2, 0, PCI_VENDOR_ID); |
4998 |
++ if (vendor != 0x8086) |
4999 |
++ return false; |
5000 |
++ |
5001 |
++ devid = read_pci_config_16(0, 2, 0, PCI_DEVICE_ID); |
5002 |
++ for (i = 0; i < ARRAY_SIZE(snb_ids); i++) |
5003 |
++ if (devid == snb_ids[i]) |
5004 |
++ return true; |
5005 |
++ |
5006 |
++ return false; |
5007 |
++} |
5008 |
++ |
5009 |
++/* |
5010 |
++ * Sandy Bridge graphics has trouble with certain ranges, exclude |
5011 |
++ * them from allocation. |
5012 |
++ */ |
5013 |
++static void __init trim_snb_memory(void) |
5014 |
++{ |
5015 |
++ static const unsigned long bad_pages[] = { |
5016 |
++ 0x20050000, |
5017 |
++ 0x20110000, |
5018 |
++ 0x20130000, |
5019 |
++ 0x20138000, |
5020 |
++ 0x40004000, |
5021 |
++ }; |
5022 |
++ int i; |
5023 |
++ |
5024 |
++ if (!snb_gfx_workaround_needed()) |
5025 |
++ return; |
5026 |
++ |
5027 |
++ printk(KERN_DEBUG "reserving inaccessible SNB gfx pages\n"); |
5028 |
++ |
5029 |
++ /* |
5030 |
++ * Reserve all memory below the 1 MB mark that has not |
5031 |
++ * already been reserved. |
5032 |
++ */ |
5033 |
++ memblock_reserve(0, 1<<20); |
5034 |
++ |
5035 |
++ for (i = 0; i < ARRAY_SIZE(bad_pages); i++) { |
5036 |
++ if (memblock_reserve(bad_pages[i], PAGE_SIZE)) |
5037 |
++ printk(KERN_WARNING "failed to reserve 0x%08lx\n", |
5038 |
++ bad_pages[i]); |
5039 |
++ } |
5040 |
++} |
5041 |
++ |
5042 |
++/* |
5043 |
++ * Here we put platform-specific memory range workarounds, i.e. |
5044 |
++ * memory known to be corrupt or otherwise in need to be reserved on |
5045 |
++ * specific platforms. |
5046 |
++ * |
5047 |
++ * If this gets used more widely it could use a real dispatch mechanism. |
5048 |
++ */ |
5049 |
++static void __init trim_platform_memory_ranges(void) |
5050 |
++{ |
5051 |
++ trim_snb_memory(); |
5052 |
++} |
5053 |
++ |
5054 |
+ static void __init trim_bios_range(void) |
5055 |
+ { |
5056 |
+ /* |
5057 |
+@@ -651,6 +726,7 @@ static void __init trim_bios_range(void) |
5058 |
+ * take them out. |
5059 |
+ */ |
5060 |
+ e820_remove_range(BIOS_BEGIN, BIOS_END - BIOS_BEGIN, E820_RAM, 1); |
5061 |
++ |
5062 |
+ sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); |
5063 |
+ } |
5064 |
+ |
5065 |
+@@ -929,6 +1005,8 @@ void __init setup_arch(char **cmdline_p) |
5066 |
+ |
5067 |
+ setup_trampolines(); |
5068 |
+ |
5069 |
++ trim_platform_memory_ranges(); |
5070 |
++ |
5071 |
+ init_gbpages(); |
5072 |
+ |
5073 |
+ /* max_pfn_mapped is updated here */ |
5074 |
+diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c |
5075 |
+index 3424d67..e59f536 100644 |
5076 |
+--- a/drivers/block/drbd/drbd_req.c |
5077 |
++++ b/drivers/block/drbd/drbd_req.c |
5078 |
+@@ -37,6 +37,7 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req |
5079 |
+ const int rw = bio_data_dir(bio); |
5080 |
+ int cpu; |
5081 |
+ cpu = part_stat_lock(); |
5082 |
++ part_round_stats(cpu, &mdev->vdisk->part0); |
5083 |
+ part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]); |
5084 |
+ part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio)); |
5085 |
+ part_inc_in_flight(&mdev->vdisk->part0, rw); |
5086 |
+diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c |
5087 |
+index 3f9a891..ae762ec 100644 |
5088 |
+--- a/drivers/pci/intel-iommu.c |
5089 |
++++ b/drivers/pci/intel-iommu.c |
5090 |
+@@ -2289,8 +2289,39 @@ static int domain_add_dev_info(struct dmar_domain *domain, |
5091 |
+ return 0; |
5092 |
+ } |
5093 |
+ |
5094 |
++static bool device_has_rmrr(struct pci_dev *dev) |
5095 |
++{ |
5096 |
++ struct dmar_rmrr_unit *rmrr; |
5097 |
++ int i; |
5098 |
++ |
5099 |
++ for_each_rmrr_units(rmrr) { |
5100 |
++ for (i = 0; i < rmrr->devices_cnt; i++) { |
5101 |
++ /* |
5102 |
++ * Return TRUE if this RMRR contains the device that |
5103 |
++ * is passed in. |
5104 |
++ */ |
5105 |
++ if (rmrr->devices[i] == dev) |
5106 |
++ return true; |
5107 |
++ } |
5108 |
++ } |
5109 |
++ return false; |
5110 |
++} |
5111 |
++ |
5112 |
+ static int iommu_should_identity_map(struct pci_dev *pdev, int startup) |
5113 |
+ { |
5114 |
++ |
5115 |
++ /* |
5116 |
++ * We want to prevent any device associated with an RMRR from |
5117 |
++ * getting placed into the SI Domain. This is done because |
5118 |
++ * problems exist when devices are moved in and out of domains |
5119 |
++ * and their respective RMRR info is lost. We exempt USB devices |
5120 |
++ * from this process due to their usage of RMRRs that are known |
5121 |
++ * to not be needed after BIOS hand-off to OS. |
5122 |
++ */ |
5123 |
++ if (device_has_rmrr(pdev) && |
5124 |
++ (pdev->class >> 8) != PCI_CLASS_SERIAL_USB) |
5125 |
++ return 0; |
5126 |
++ |
5127 |
+ if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) |
5128 |
+ return 1; |
5129 |
+ |
5130 |
+diff --git a/drivers/staging/vt6656/bssdb.h b/drivers/staging/vt6656/bssdb.h |
5131 |
+index a8f97eb..991ce3e 100644 |
5132 |
+--- a/drivers/staging/vt6656/bssdb.h |
5133 |
++++ b/drivers/staging/vt6656/bssdb.h |
5134 |
+@@ -92,7 +92,6 @@ typedef struct tagSRSNCapObject { |
5135 |
+ } SRSNCapObject, *PSRSNCapObject; |
5136 |
+ |
5137 |
+ // BSS info(AP) |
5138 |
+-#pragma pack(1) |
5139 |
+ typedef struct tagKnownBSS { |
5140 |
+ // BSS info |
5141 |
+ BOOL bActive; |
5142 |
+diff --git a/drivers/staging/vt6656/int.h b/drivers/staging/vt6656/int.h |
5143 |
+index 3176c8d..c731b12 100644 |
5144 |
+--- a/drivers/staging/vt6656/int.h |
5145 |
++++ b/drivers/staging/vt6656/int.h |
5146 |
+@@ -34,7 +34,6 @@ |
5147 |
+ #include "device.h" |
5148 |
+ |
5149 |
+ /*--------------------- Export Definitions -------------------------*/ |
5150 |
+-#pragma pack(1) |
5151 |
+ typedef struct tagSINTData { |
5152 |
+ BYTE byTSR0; |
5153 |
+ BYTE byPkt0; |
5154 |
+diff --git a/drivers/staging/vt6656/iocmd.h b/drivers/staging/vt6656/iocmd.h |
5155 |
+index 22710ce..ae6e2d2 100644 |
5156 |
+--- a/drivers/staging/vt6656/iocmd.h |
5157 |
++++ b/drivers/staging/vt6656/iocmd.h |
5158 |
+@@ -95,13 +95,12 @@ typedef enum tagWZONETYPE { |
5159 |
+ // Ioctl interface structure |
5160 |
+ // Command structure |
5161 |
+ // |
5162 |
+-#pragma pack(1) |
5163 |
+ typedef struct tagSCmdRequest { |
5164 |
+ u8 name[16]; |
5165 |
+ void *data; |
5166 |
+ u16 wResult; |
5167 |
+ u16 wCmdCode; |
5168 |
+-} SCmdRequest, *PSCmdRequest; |
5169 |
++} __packed SCmdRequest, *PSCmdRequest; |
5170 |
+ |
5171 |
+ // |
5172 |
+ // Scan |
5173 |
+@@ -111,7 +110,7 @@ typedef struct tagSCmdScan { |
5174 |
+ |
5175 |
+ u8 ssid[SSID_MAXLEN + 2]; |
5176 |
+ |
5177 |
+-} SCmdScan, *PSCmdScan; |
5178 |
++} __packed SCmdScan, *PSCmdScan; |
5179 |
+ |
5180 |
+ // |
5181 |
+ // BSS Join |
5182 |
+@@ -126,7 +125,7 @@ typedef struct tagSCmdBSSJoin { |
5183 |
+ BOOL bPSEnable; |
5184 |
+ BOOL bShareKeyAuth; |
5185 |
+ |
5186 |
+-} SCmdBSSJoin, *PSCmdBSSJoin; |
5187 |
++} __packed SCmdBSSJoin, *PSCmdBSSJoin; |
5188 |
+ |
5189 |
+ // |
5190 |
+ // Zonetype Setting |
5191 |
+@@ -137,7 +136,7 @@ typedef struct tagSCmdZoneTypeSet { |
5192 |
+ BOOL bWrite; |
5193 |
+ WZONETYPE ZoneType; |
5194 |
+ |
5195 |
+-} SCmdZoneTypeSet, *PSCmdZoneTypeSet; |
5196 |
++} __packed SCmdZoneTypeSet, *PSCmdZoneTypeSet; |
5197 |
+ |
5198 |
+ typedef struct tagSWPAResult { |
5199 |
+ char ifname[100]; |
5200 |
+@@ -145,7 +144,7 @@ typedef struct tagSWPAResult { |
5201 |
+ u8 key_mgmt; |
5202 |
+ u8 eap_type; |
5203 |
+ BOOL authenticated; |
5204 |
+-} SWPAResult, *PSWPAResult; |
5205 |
++} __packed SWPAResult, *PSWPAResult; |
5206 |
+ |
5207 |
+ typedef struct tagSCmdStartAP { |
5208 |
+ |
5209 |
+@@ -157,7 +156,7 @@ typedef struct tagSCmdStartAP { |
5210 |
+ BOOL bShareKeyAuth; |
5211 |
+ u8 byBasicRate; |
5212 |
+ |
5213 |
+-} SCmdStartAP, *PSCmdStartAP; |
5214 |
++} __packed SCmdStartAP, *PSCmdStartAP; |
5215 |
+ |
5216 |
+ typedef struct tagSCmdSetWEP { |
5217 |
+ |
5218 |
+@@ -167,7 +166,7 @@ typedef struct tagSCmdSetWEP { |
5219 |
+ BOOL bWepKeyAvailable[WEP_NKEYS]; |
5220 |
+ u32 auWepKeyLength[WEP_NKEYS]; |
5221 |
+ |
5222 |
+-} SCmdSetWEP, *PSCmdSetWEP; |
5223 |
++} __packed SCmdSetWEP, *PSCmdSetWEP; |
5224 |
+ |
5225 |
+ typedef struct tagSBSSIDItem { |
5226 |
+ |
5227 |
+@@ -180,14 +179,14 @@ typedef struct tagSBSSIDItem { |
5228 |
+ BOOL bWEPOn; |
5229 |
+ u32 uRSSI; |
5230 |
+ |
5231 |
+-} SBSSIDItem; |
5232 |
++} __packed SBSSIDItem; |
5233 |
+ |
5234 |
+ |
5235 |
+ typedef struct tagSBSSIDList { |
5236 |
+ |
5237 |
+ u32 uItem; |
5238 |
+ SBSSIDItem sBSSIDList[0]; |
5239 |
+-} SBSSIDList, *PSBSSIDList; |
5240 |
++} __packed SBSSIDList, *PSBSSIDList; |
5241 |
+ |
5242 |
+ |
5243 |
+ typedef struct tagSNodeItem { |
5244 |
+@@ -208,7 +207,7 @@ typedef struct tagSNodeItem { |
5245 |
+ u32 uTxAttempts; |
5246 |
+ u16 wFailureRatio; |
5247 |
+ |
5248 |
+-} SNodeItem; |
5249 |
++} __packed SNodeItem; |
5250 |
+ |
5251 |
+ |
5252 |
+ typedef struct tagSNodeList { |
5253 |
+@@ -216,7 +215,7 @@ typedef struct tagSNodeList { |
5254 |
+ u32 uItem; |
5255 |
+ SNodeItem sNodeList[0]; |
5256 |
+ |
5257 |
+-} SNodeList, *PSNodeList; |
5258 |
++} __packed SNodeList, *PSNodeList; |
5259 |
+ |
5260 |
+ |
5261 |
+ typedef struct tagSCmdLinkStatus { |
5262 |
+@@ -229,7 +228,7 @@ typedef struct tagSCmdLinkStatus { |
5263 |
+ u32 uChannel; |
5264 |
+ u32 uLinkRate; |
5265 |
+ |
5266 |
+-} SCmdLinkStatus, *PSCmdLinkStatus; |
5267 |
++} __packed SCmdLinkStatus, *PSCmdLinkStatus; |
5268 |
+ |
5269 |
+ // |
5270 |
+ // 802.11 counter |
5271 |
+@@ -247,7 +246,7 @@ typedef struct tagSDot11MIBCount { |
5272 |
+ u32 ReceivedFragmentCount; |
5273 |
+ u32 MulticastReceivedFrameCount; |
5274 |
+ u32 FCSErrorCount; |
5275 |
+-} SDot11MIBCount, *PSDot11MIBCount; |
5276 |
++} __packed SDot11MIBCount, *PSDot11MIBCount; |
5277 |
+ |
5278 |
+ |
5279 |
+ |
5280 |
+@@ -355,13 +354,13 @@ typedef struct tagSStatMIBCount { |
5281 |
+ u32 ullTxBroadcastBytes[2]; |
5282 |
+ u32 ullTxMulticastBytes[2]; |
5283 |
+ u32 ullTxDirectedBytes[2]; |
5284 |
+-} SStatMIBCount, *PSStatMIBCount; |
5285 |
++} __packed SStatMIBCount, *PSStatMIBCount; |
5286 |
+ |
5287 |
+ typedef struct tagSCmdValue { |
5288 |
+ |
5289 |
+ u32 dwValue; |
5290 |
+ |
5291 |
+-} SCmdValue, *PSCmdValue; |
5292 |
++} __packed SCmdValue, *PSCmdValue; |
5293 |
+ |
5294 |
+ // |
5295 |
+ // hostapd & viawget ioctl related |
5296 |
+@@ -431,7 +430,7 @@ struct viawget_hostapd_param { |
5297 |
+ u8 ssid[32]; |
5298 |
+ } scan_req; |
5299 |
+ } u; |
5300 |
+-}; |
5301 |
++} __packed; |
5302 |
+ |
5303 |
+ /*--------------------- Export Classes ----------------------------*/ |
5304 |
+ |
5305 |
+diff --git a/drivers/staging/vt6656/iowpa.h b/drivers/staging/vt6656/iowpa.h |
5306 |
+index 959c886..2522dde 100644 |
5307 |
+--- a/drivers/staging/vt6656/iowpa.h |
5308 |
++++ b/drivers/staging/vt6656/iowpa.h |
5309 |
+@@ -67,12 +67,11 @@ enum { |
5310 |
+ |
5311 |
+ |
5312 |
+ |
5313 |
+-#pragma pack(1) |
5314 |
+ typedef struct viawget_wpa_header { |
5315 |
+ u8 type; |
5316 |
+ u16 req_ie_len; |
5317 |
+ u16 resp_ie_len; |
5318 |
+-} viawget_wpa_header; |
5319 |
++} __packed viawget_wpa_header; |
5320 |
+ |
5321 |
+ struct viawget_wpa_param { |
5322 |
+ u32 cmd; |
5323 |
+@@ -113,9 +112,8 @@ struct viawget_wpa_param { |
5324 |
+ u8 *buf; |
5325 |
+ } scan_results; |
5326 |
+ } u; |
5327 |
+-}; |
5328 |
++} __packed; |
5329 |
+ |
5330 |
+-#pragma pack(1) |
5331 |
+ struct viawget_scan_result { |
5332 |
+ u8 bssid[6]; |
5333 |
+ u8 ssid[32]; |
5334 |
+@@ -130,7 +128,7 @@ struct viawget_scan_result { |
5335 |
+ int noise; |
5336 |
+ int level; |
5337 |
+ int maxrate; |
5338 |
+-}; |
5339 |
++} __packed; |
5340 |
+ |
5341 |
+ /*--------------------- Export Classes ----------------------------*/ |
5342 |
+ |
5343 |
+diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c |
5344 |
+index 087af19..9a084b8 100644 |
5345 |
+--- a/drivers/target/tcm_fc/tfc_sess.c |
5346 |
++++ b/drivers/target/tcm_fc/tfc_sess.c |
5347 |
+@@ -393,11 +393,11 @@ static int ft_prli_locked(struct fc_rport_priv *rdata, u32 spp_len, |
5348 |
+ |
5349 |
+ tport = ft_tport_create(rdata->local_port); |
5350 |
+ if (!tport) |
5351 |
+- return 0; /* not a target for this local port */ |
5352 |
++ goto not_target; /* not a target for this local port */ |
5353 |
+ |
5354 |
+ acl = ft_acl_get(tport->tpg, rdata); |
5355 |
+ if (!acl) |
5356 |
+- return 0; |
5357 |
++ goto not_target; /* no target for this remote */ |
5358 |
+ |
5359 |
+ if (!rspp) |
5360 |
+ goto fill; |
5361 |
+@@ -434,12 +434,18 @@ static int ft_prli_locked(struct fc_rport_priv *rdata, u32 spp_len, |
5362 |
+ |
5363 |
+ /* |
5364 |
+ * OR in our service parameters with other provider (initiator), if any. |
5365 |
+- * TBD XXX - indicate RETRY capability? |
5366 |
+ */ |
5367 |
+ fill: |
5368 |
+ fcp_parm = ntohl(spp->spp_params); |
5369 |
++ fcp_parm &= ~FCP_SPPF_RETRY; |
5370 |
+ spp->spp_params = htonl(fcp_parm | FCP_SPPF_TARG_FCN); |
5371 |
+ return FC_SPP_RESP_ACK; |
5372 |
++ |
5373 |
++not_target: |
5374 |
++ fcp_parm = ntohl(spp->spp_params); |
5375 |
++ fcp_parm &= ~FCP_SPPF_TARG_FCN; |
5376 |
++ spp->spp_params = htonl(fcp_parm); |
5377 |
++ return 0; |
5378 |
+ } |
5379 |
+ |
5380 |
+ /** |
5381 |
+diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c |
5382 |
+index 5315525..5d0d4f6 100644 |
5383 |
+--- a/drivers/tty/serial/ifx6x60.c |
5384 |
++++ b/drivers/tty/serial/ifx6x60.c |
5385 |
+@@ -551,6 +551,7 @@ static void ifx_port_shutdown(struct tty_port *port) |
5386 |
+ container_of(port, struct ifx_spi_device, tty_port); |
5387 |
+ |
5388 |
+ mrdy_set_low(ifx_dev); |
5389 |
++ del_timer(&ifx_dev->spi_timer); |
5390 |
+ clear_bit(IFX_SPI_STATE_TIMER_PENDING, &ifx_dev->flags); |
5391 |
+ tasklet_kill(&ifx_dev->io_work_tasklet); |
5392 |
+ } |
5393 |
+diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c |
5394 |
+index 806060c..3c84a03 100644 |
5395 |
+--- a/drivers/usb/core/message.c |
5396 |
++++ b/drivers/usb/core/message.c |
5397 |
+@@ -1770,28 +1770,8 @@ free_interfaces: |
5398 |
+ goto free_interfaces; |
5399 |
+ } |
5400 |
+ |
5401 |
+- ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), |
5402 |
+- USB_REQ_SET_CONFIGURATION, 0, configuration, 0, |
5403 |
+- NULL, 0, USB_CTRL_SET_TIMEOUT); |
5404 |
+- if (ret < 0) { |
5405 |
+- /* All the old state is gone, so what else can we do? |
5406 |
+- * The device is probably useless now anyway. |
5407 |
+- */ |
5408 |
+- cp = NULL; |
5409 |
+- } |
5410 |
+- |
5411 |
+- dev->actconfig = cp; |
5412 |
+- if (!cp) { |
5413 |
+- usb_set_device_state(dev, USB_STATE_ADDRESS); |
5414 |
+- usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
5415 |
+- mutex_unlock(hcd->bandwidth_mutex); |
5416 |
+- usb_autosuspend_device(dev); |
5417 |
+- goto free_interfaces; |
5418 |
+- } |
5419 |
+- mutex_unlock(hcd->bandwidth_mutex); |
5420 |
+- usb_set_device_state(dev, USB_STATE_CONFIGURED); |
5421 |
+- |
5422 |
+- /* Initialize the new interface structures and the |
5423 |
++ /* |
5424 |
++ * Initialize the new interface structures and the |
5425 |
+ * hc/hcd/usbcore interface/endpoint state. |
5426 |
+ */ |
5427 |
+ for (i = 0; i < nintf; ++i) { |
5428 |
+@@ -1835,6 +1815,35 @@ free_interfaces: |
5429 |
+ } |
5430 |
+ kfree(new_interfaces); |
5431 |
+ |
5432 |
++ ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), |
5433 |
++ USB_REQ_SET_CONFIGURATION, 0, configuration, 0, |
5434 |
++ NULL, 0, USB_CTRL_SET_TIMEOUT); |
5435 |
++ if (ret < 0 && cp) { |
5436 |
++ /* |
5437 |
++ * All the old state is gone, so what else can we do? |
5438 |
++ * The device is probably useless now anyway. |
5439 |
++ */ |
5440 |
++ usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
5441 |
++ for (i = 0; i < nintf; ++i) { |
5442 |
++ usb_disable_interface(dev, cp->interface[i], true); |
5443 |
++ put_device(&cp->interface[i]->dev); |
5444 |
++ cp->interface[i] = NULL; |
5445 |
++ } |
5446 |
++ cp = NULL; |
5447 |
++ } |
5448 |
++ |
5449 |
++ dev->actconfig = cp; |
5450 |
++ mutex_unlock(hcd->bandwidth_mutex); |
5451 |
++ |
5452 |
++ if (!cp) { |
5453 |
++ usb_set_device_state(dev, USB_STATE_ADDRESS); |
5454 |
++ |
5455 |
++ /* Leave LPM disabled while the device is unconfigured. */ |
5456 |
++ usb_autosuspend_device(dev); |
5457 |
++ return ret; |
5458 |
++ } |
5459 |
++ usb_set_device_state(dev, USB_STATE_CONFIGURED); |
5460 |
++ |
5461 |
+ if (cp->string == NULL && |
5462 |
+ !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) |
5463 |
+ cp->string = usb_cache_string(dev, cp->desc.iConfiguration); |
5464 |
+diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c |
5465 |
+index a2b20fe..af65322 100644 |
5466 |
+--- a/drivers/usb/host/xhci-mem.c |
5467 |
++++ b/drivers/usb/host/xhci-mem.c |
5468 |
+@@ -180,8 +180,15 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, |
5469 |
+ struct xhci_segment *next; |
5470 |
+ |
5471 |
+ next = xhci_segment_alloc(xhci, flags); |
5472 |
+- if (!next) |
5473 |
++ if (!next) { |
5474 |
++ prev = ring->first_seg; |
5475 |
++ while (prev) { |
5476 |
++ next = prev->next; |
5477 |
++ xhci_segment_free(xhci, prev); |
5478 |
++ prev = next; |
5479 |
++ } |
5480 |
+ goto fail; |
5481 |
++ } |
5482 |
+ xhci_link_segments(xhci, prev, next, link_trbs, isoc); |
5483 |
+ |
5484 |
+ prev = next; |
5485 |
+@@ -201,7 +208,7 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, |
5486 |
+ return ring; |
5487 |
+ |
5488 |
+ fail: |
5489 |
+- xhci_ring_free(xhci, ring); |
5490 |
++ kfree(ring); |
5491 |
+ return NULL; |
5492 |
+ } |
5493 |
+ |
5494 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
5495 |
+index f233bbb..9db3e23 100644 |
5496 |
+--- a/drivers/usb/serial/option.c |
5497 |
++++ b/drivers/usb/serial/option.c |
5498 |
+@@ -449,6 +449,10 @@ static void option_instat_callback(struct urb *urb); |
5499 |
+ #define PETATEL_VENDOR_ID 0x1ff4 |
5500 |
+ #define PETATEL_PRODUCT_NP10T 0x600e |
5501 |
+ |
5502 |
++/* TP-LINK Incorporated products */ |
5503 |
++#define TPLINK_VENDOR_ID 0x2357 |
5504 |
++#define TPLINK_PRODUCT_MA180 0x0201 |
5505 |
++ |
5506 |
+ /* some devices interfaces need special handling due to a number of reasons */ |
5507 |
+ enum option_blacklist_reason { |
5508 |
+ OPTION_BLACKLIST_NONE = 0, |
5509 |
+@@ -930,7 +934,8 @@ static const struct usb_device_id option_ids[] = { |
5510 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0254, 0xff, 0xff, 0xff) }, |
5511 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */ |
5512 |
+ .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, |
5513 |
+- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) }, |
5514 |
++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff), /* ONDA MT8205 */ |
5515 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
5516 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */ |
5517 |
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
5518 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) }, |
5519 |
+@@ -1311,6 +1316,8 @@ static const struct usb_device_id option_ids[] = { |
5520 |
+ { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, |
5521 |
+ { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, |
5522 |
+ { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, |
5523 |
++ { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), |
5524 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
5525 |
+ { } /* Terminating entry */ |
5526 |
+ }; |
5527 |
+ MODULE_DEVICE_TABLE(usb, option_ids); |
5528 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
5529 |
+index 1dbf758..7e56946 100644 |
5530 |
+--- a/fs/ext4/inode.c |
5531 |
++++ b/fs/ext4/inode.c |
5532 |
+@@ -2199,6 +2199,8 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd) |
5533 |
+ |
5534 |
+ index = mpd->first_page; |
5535 |
+ end = mpd->next_page - 1; |
5536 |
++ |
5537 |
++ pagevec_init(&pvec, 0); |
5538 |
+ while (index <= end) { |
5539 |
+ nr_pages = pagevec_lookup(&pvec, mapping, index, PAGEVEC_SIZE); |
5540 |
+ if (nr_pages == 0) |
5541 |
|
5542 |
Added: genpatches-2.6/trunk/3.0/1060_linux-3.0.61.patch |
5543 |
=================================================================== |
5544 |
--- genpatches-2.6/trunk/3.0/1060_linux-3.0.61.patch (rev 0) |
5545 |
+++ genpatches-2.6/trunk/3.0/1060_linux-3.0.61.patch 2013-01-29 00:51:38 UTC (rev 2267) |
5546 |
@@ -0,0 +1,615 @@ |
5547 |
+diff --git a/Makefile b/Makefile |
5548 |
+index 3359fcf..2d64957 100644 |
5549 |
+--- a/Makefile |
5550 |
++++ b/Makefile |
5551 |
+@@ -1,6 +1,6 @@ |
5552 |
+ VERSION = 3 |
5553 |
+ PATCHLEVEL = 0 |
5554 |
+-SUBLEVEL = 60 |
5555 |
++SUBLEVEL = 61 |
5556 |
+ EXTRAVERSION = |
5557 |
+ NAME = Sneaky Weasel |
5558 |
+ |
5559 |
+diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h |
5560 |
+index 0310da6..1d44903 100644 |
5561 |
+--- a/arch/x86/include/asm/traps.h |
5562 |
++++ b/arch/x86/include/asm/traps.h |
5563 |
+@@ -1,6 +1,7 @@ |
5564 |
+ #ifndef _ASM_X86_TRAPS_H |
5565 |
+ #define _ASM_X86_TRAPS_H |
5566 |
+ |
5567 |
++#include <linux/kprobes.h> |
5568 |
+ #include <asm/debugreg.h> |
5569 |
+ #include <asm/siginfo.h> /* TRAP_TRACE, ... */ |
5570 |
+ |
5571 |
+@@ -87,4 +88,29 @@ asmlinkage void smp_thermal_interrupt(void); |
5572 |
+ asmlinkage void mce_threshold_interrupt(void); |
5573 |
+ #endif |
5574 |
+ |
5575 |
++/* Interrupts/Exceptions */ |
5576 |
++enum { |
5577 |
++ X86_TRAP_DE = 0, /* 0, Divide-by-zero */ |
5578 |
++ X86_TRAP_DB, /* 1, Debug */ |
5579 |
++ X86_TRAP_NMI, /* 2, Non-maskable Interrupt */ |
5580 |
++ X86_TRAP_BP, /* 3, Breakpoint */ |
5581 |
++ X86_TRAP_OF, /* 4, Overflow */ |
5582 |
++ X86_TRAP_BR, /* 5, Bound Range Exceeded */ |
5583 |
++ X86_TRAP_UD, /* 6, Invalid Opcode */ |
5584 |
++ X86_TRAP_NM, /* 7, Device Not Available */ |
5585 |
++ X86_TRAP_DF, /* 8, Double Fault */ |
5586 |
++ X86_TRAP_OLD_MF, /* 9, Coprocessor Segment Overrun */ |
5587 |
++ X86_TRAP_TS, /* 10, Invalid TSS */ |
5588 |
++ X86_TRAP_NP, /* 11, Segment Not Present */ |
5589 |
++ X86_TRAP_SS, /* 12, Stack Segment Fault */ |
5590 |
++ X86_TRAP_GP, /* 13, General Protection Fault */ |
5591 |
++ X86_TRAP_PF, /* 14, Page Fault */ |
5592 |
++ X86_TRAP_SPURIOUS, /* 15, Spurious Interrupt */ |
5593 |
++ X86_TRAP_MF, /* 16, x87 Floating-Point Exception */ |
5594 |
++ X86_TRAP_AC, /* 17, Alignment Check */ |
5595 |
++ X86_TRAP_MC, /* 18, Machine Check */ |
5596 |
++ X86_TRAP_XF, /* 19, SIMD Floating-Point Exception */ |
5597 |
++ X86_TRAP_IRET = 32, /* 32, IRET Exception */ |
5598 |
++}; |
5599 |
++ |
5600 |
+ #endif /* _ASM_X86_TRAPS_H */ |
5601 |
+diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c |
5602 |
+index 431ab11..65976cb 100644 |
5603 |
+--- a/drivers/acpi/processor_idle.c |
5604 |
++++ b/drivers/acpi/processor_idle.c |
5605 |
+@@ -991,6 +991,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) |
5606 |
+ return -EINVAL; |
5607 |
+ } |
5608 |
+ |
5609 |
++ if (!dev) |
5610 |
++ return -EINVAL; |
5611 |
++ |
5612 |
+ dev->cpu = pr->id; |
5613 |
+ for (i = 0; i < CPUIDLE_STATE_MAX; i++) { |
5614 |
+ dev->states[i].name[0] = '\0'; |
5615 |
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c |
5616 |
+index 8300250..75a8d0f 100644 |
5617 |
+--- a/drivers/ata/ahci.c |
5618 |
++++ b/drivers/ata/ahci.c |
5619 |
+@@ -402,6 +402,12 @@ static const struct pci_device_id ahci_pci_tbl[] = { |
5620 |
+ /* Promise */ |
5621 |
+ { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ |
5622 |
+ |
5623 |
++ /* Asmedia */ |
5624 |
++ { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ |
5625 |
++ { PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci }, /* ASM1060 */ |
5626 |
++ { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ |
5627 |
++ { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ |
5628 |
++ |
5629 |
+ /* Generic, PCI class code for AHCI */ |
5630 |
+ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
5631 |
+ PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci }, |
5632 |
+diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c |
5633 |
+index d845dc4..6e33926 100644 |
5634 |
+--- a/drivers/dma/ioat/dma_v3.c |
5635 |
++++ b/drivers/dma/ioat/dma_v3.c |
5636 |
+@@ -949,7 +949,7 @@ static int __devinit ioat_xor_val_self_test(struct ioatdma_device *device) |
5637 |
+ goto free_resources; |
5638 |
+ } |
5639 |
+ } |
5640 |
+- dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_TO_DEVICE); |
5641 |
++ dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_FROM_DEVICE); |
5642 |
+ |
5643 |
+ /* skip validate if the capability is not present */ |
5644 |
+ if (!dma_has_cap(DMA_XOR_VAL, dma_chan->device->cap_mask)) |
5645 |
+diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c |
5646 |
+index 02a52d1..66b6315 100644 |
5647 |
+--- a/drivers/firmware/dmi_scan.c |
5648 |
++++ b/drivers/firmware/dmi_scan.c |
5649 |
+@@ -16,6 +16,7 @@ |
5650 |
+ */ |
5651 |
+ static char dmi_empty_string[] = " "; |
5652 |
+ |
5653 |
++static u16 __initdata dmi_ver; |
5654 |
+ /* |
5655 |
+ * Catch too early calls to dmi_check_system(): |
5656 |
+ */ |
5657 |
+@@ -118,12 +119,12 @@ static int __init dmi_walk_early(void (*decode)(const struct dmi_header *, |
5658 |
+ return 0; |
5659 |
+ } |
5660 |
+ |
5661 |
+-static int __init dmi_checksum(const u8 *buf) |
5662 |
++static int __init dmi_checksum(const u8 *buf, u8 len) |
5663 |
+ { |
5664 |
+ u8 sum = 0; |
5665 |
+ int a; |
5666 |
+ |
5667 |
+- for (a = 0; a < 15; a++) |
5668 |
++ for (a = 0; a < len; a++) |
5669 |
+ sum += buf[a]; |
5670 |
+ |
5671 |
+ return sum == 0; |
5672 |
+@@ -161,8 +162,10 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde |
5673 |
+ return; |
5674 |
+ |
5675 |
+ for (i = 0; i < 16 && (is_ff || is_00); i++) { |
5676 |
+- if(d[i] != 0x00) is_ff = 0; |
5677 |
+- if(d[i] != 0xFF) is_00 = 0; |
5678 |
++ if (d[i] != 0x00) |
5679 |
++ is_00 = 0; |
5680 |
++ if (d[i] != 0xFF) |
5681 |
++ is_ff = 0; |
5682 |
+ } |
5683 |
+ |
5684 |
+ if (is_ff || is_00) |
5685 |
+@@ -172,7 +175,15 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde |
5686 |
+ if (!s) |
5687 |
+ return; |
5688 |
+ |
5689 |
+- sprintf(s, "%pUB", d); |
5690 |
++ /* |
5691 |
++ * As of version 2.6 of the SMBIOS specification, the first 3 fields of |
5692 |
++ * the UUID are supposed to be little-endian encoded. The specification |
5693 |
++ * says that this is the defacto standard. |
5694 |
++ */ |
5695 |
++ if (dmi_ver >= 0x0206) |
5696 |
++ sprintf(s, "%pUL", d); |
5697 |
++ else |
5698 |
++ sprintf(s, "%pUB", d); |
5699 |
+ |
5700 |
+ dmi_ident[slot] = s; |
5701 |
+ } |
5702 |
+@@ -404,29 +415,57 @@ static int __init dmi_present(const char __iomem *p) |
5703 |
+ u8 buf[15]; |
5704 |
+ |
5705 |
+ memcpy_fromio(buf, p, 15); |
5706 |
+- if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) { |
5707 |
++ if (dmi_checksum(buf, 15)) { |
5708 |
+ dmi_num = (buf[13] << 8) | buf[12]; |
5709 |
+ dmi_len = (buf[7] << 8) | buf[6]; |
5710 |
+ dmi_base = (buf[11] << 24) | (buf[10] << 16) | |
5711 |
+ (buf[9] << 8) | buf[8]; |
5712 |
+ |
5713 |
+- /* |
5714 |
+- * DMI version 0.0 means that the real version is taken from |
5715 |
+- * the SMBIOS version, which we don't know at this point. |
5716 |
+- */ |
5717 |
+- if (buf[14] != 0) |
5718 |
+- printk(KERN_INFO "DMI %d.%d present.\n", |
5719 |
+- buf[14] >> 4, buf[14] & 0xF); |
5720 |
+- else |
5721 |
+- printk(KERN_INFO "DMI present.\n"); |
5722 |
+ if (dmi_walk_early(dmi_decode) == 0) { |
5723 |
++ if (dmi_ver) |
5724 |
++ pr_info("SMBIOS %d.%d present.\n", |
5725 |
++ dmi_ver >> 8, dmi_ver & 0xFF); |
5726 |
++ else { |
5727 |
++ dmi_ver = (buf[14] & 0xF0) << 4 | |
5728 |
++ (buf[14] & 0x0F); |
5729 |
++ pr_info("Legacy DMI %d.%d present.\n", |
5730 |
++ dmi_ver >> 8, dmi_ver & 0xFF); |
5731 |
++ } |
5732 |
+ dmi_dump_ids(); |
5733 |
+ return 0; |
5734 |
+ } |
5735 |
+ } |
5736 |
++ dmi_ver = 0; |
5737 |
+ return 1; |
5738 |
+ } |
5739 |
+ |
5740 |
++static int __init smbios_present(const char __iomem *p) |
5741 |
++{ |
5742 |
++ u8 buf[32]; |
5743 |
++ int offset = 0; |
5744 |
++ |
5745 |
++ memcpy_fromio(buf, p, 32); |
5746 |
++ if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) { |
5747 |
++ dmi_ver = (buf[6] << 8) + buf[7]; |
5748 |
++ |
5749 |
++ /* Some BIOS report weird SMBIOS version, fix that up */ |
5750 |
++ switch (dmi_ver) { |
5751 |
++ case 0x021F: |
5752 |
++ case 0x0221: |
5753 |
++ pr_debug("SMBIOS version fixup(2.%d->2.%d)\n", |
5754 |
++ dmi_ver & 0xFF, 3); |
5755 |
++ dmi_ver = 0x0203; |
5756 |
++ break; |
5757 |
++ case 0x0233: |
5758 |
++ pr_debug("SMBIOS version fixup(2.%d->2.%d)\n", 51, 6); |
5759 |
++ dmi_ver = 0x0206; |
5760 |
++ break; |
5761 |
++ } |
5762 |
++ offset = 16; |
5763 |
++ } |
5764 |
++ return dmi_present(buf + offset); |
5765 |
++} |
5766 |
++ |
5767 |
+ void __init dmi_scan_machine(void) |
5768 |
+ { |
5769 |
+ char __iomem *p, *q; |
5770 |
+@@ -444,7 +483,7 @@ void __init dmi_scan_machine(void) |
5771 |
+ if (p == NULL) |
5772 |
+ goto error; |
5773 |
+ |
5774 |
+- rc = dmi_present(p + 0x10); /* offset of _DMI_ string */ |
5775 |
++ rc = smbios_present(p); |
5776 |
+ dmi_iounmap(p, 32); |
5777 |
+ if (!rc) { |
5778 |
+ dmi_available = 1; |
5779 |
+@@ -462,7 +501,12 @@ void __init dmi_scan_machine(void) |
5780 |
+ goto error; |
5781 |
+ |
5782 |
+ for (q = p; q < p + 0x10000; q += 16) { |
5783 |
+- rc = dmi_present(q); |
5784 |
++ if (memcmp(q, "_SM_", 4) == 0 && q - p <= 0xFFE0) |
5785 |
++ rc = smbios_present(q); |
5786 |
++ else if (memcmp(q, "_DMI_", 5) == 0) |
5787 |
++ rc = dmi_present(q); |
5788 |
++ else |
5789 |
++ continue; |
5790 |
+ if (!rc) { |
5791 |
+ dmi_available = 1; |
5792 |
+ dmi_iounmap(p, 0x10000); |
5793 |
+diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c |
5794 |
+index bc927ae..490ab6b 100644 |
5795 |
+--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c |
5796 |
++++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c |
5797 |
+@@ -655,6 +655,8 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, |
5798 |
+ total = 0; |
5799 |
+ for (i = 0; i < count; i++) { |
5800 |
+ struct drm_i915_gem_relocation_entry __user *user_relocs; |
5801 |
++ u64 invalid_offset = (u64)-1; |
5802 |
++ int j; |
5803 |
+ |
5804 |
+ user_relocs = (void __user *)(uintptr_t)exec[i].relocs_ptr; |
5805 |
+ |
5806 |
+@@ -665,6 +667,25 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, |
5807 |
+ goto err; |
5808 |
+ } |
5809 |
+ |
5810 |
++ /* As we do not update the known relocation offsets after |
5811 |
++ * relocating (due to the complexities in lock handling), |
5812 |
++ * we need to mark them as invalid now so that we force the |
5813 |
++ * relocation processing next time. Just in case the target |
5814 |
++ * object is evicted and then rebound into its old |
5815 |
++ * presumed_offset before the next execbuffer - if that |
5816 |
++ * happened we would make the mistake of assuming that the |
5817 |
++ * relocations were valid. |
5818 |
++ */ |
5819 |
++ for (j = 0; j < exec[i].relocation_count; j++) { |
5820 |
++ if (copy_to_user(&user_relocs[j].presumed_offset, |
5821 |
++ &invalid_offset, |
5822 |
++ sizeof(invalid_offset))) { |
5823 |
++ ret = -EFAULT; |
5824 |
++ mutex_lock(&dev->struct_mutex); |
5825 |
++ goto err; |
5826 |
++ } |
5827 |
++ } |
5828 |
++ |
5829 |
+ reloc_offset[i] = total; |
5830 |
+ total += exec[i].relocation_count; |
5831 |
+ } |
5832 |
+diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h |
5833 |
+index 8fa4f7b..5dc3b6d 100644 |
5834 |
+--- a/drivers/gpu/drm/i915/i915_reg.h |
5835 |
++++ b/drivers/gpu/drm/i915/i915_reg.h |
5836 |
+@@ -27,6 +27,8 @@ |
5837 |
+ |
5838 |
+ #define _PIPE(pipe, a, b) ((a) + (pipe)*((b)-(a))) |
5839 |
+ |
5840 |
++#define _MASKED_BIT_ENABLE(a) (((a) << 16) | (a)) |
5841 |
++ |
5842 |
+ /* |
5843 |
+ * The Bridge device's PCI config space has information about the |
5844 |
+ * fb aperture size and the amount of pre-reserved memory. |
5845 |
+@@ -354,6 +356,7 @@ |
5846 |
+ * the enables for writing to the corresponding low bit. |
5847 |
+ */ |
5848 |
+ #define _3D_CHICKEN 0x02084 |
5849 |
++#define _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB (1 << 10) |
5850 |
+ #define _3D_CHICKEN2 0x0208c |
5851 |
+ /* Disables pipelining of read flushes past the SF-WIZ interface. |
5852 |
+ * Required on all Ironlake steppings according to the B-Spec, but the |
5853 |
+diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c |
5854 |
+index d1dca92..b4f4d12 100644 |
5855 |
+--- a/drivers/gpu/drm/i915/intel_display.c |
5856 |
++++ b/drivers/gpu/drm/i915/intel_display.c |
5857 |
+@@ -7412,6 +7412,10 @@ static void gen6_init_clock_gating(struct drm_device *dev) |
5858 |
+ I915_READ(ILK_DISPLAY_CHICKEN2) | |
5859 |
+ ILK_ELPIN_409_SELECT); |
5860 |
+ |
5861 |
++ /* WaDisableHiZPlanesWhenMSAAEnabled */ |
5862 |
++ I915_WRITE(_3D_CHICKEN, |
5863 |
++ _MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB)); |
5864 |
++ |
5865 |
+ I915_WRITE(WM3_LP_ILK, 0); |
5866 |
+ I915_WRITE(WM2_LP_ILK, 0); |
5867 |
+ I915_WRITE(WM1_LP_ILK, 0); |
5868 |
+diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c |
5869 |
+index 8d082b4..d971817 100644 |
5870 |
+--- a/drivers/misc/sgi-xp/xpc_main.c |
5871 |
++++ b/drivers/misc/sgi-xp/xpc_main.c |
5872 |
+@@ -53,6 +53,10 @@ |
5873 |
+ #include <linux/kthread.h> |
5874 |
+ #include "xpc.h" |
5875 |
+ |
5876 |
++#ifdef CONFIG_X86_64 |
5877 |
++#include <asm/traps.h> |
5878 |
++#endif |
5879 |
++ |
5880 |
+ /* define two XPC debug device structures to be used with dev_dbg() et al */ |
5881 |
+ |
5882 |
+ struct device_driver xpc_dbg_name = { |
5883 |
+@@ -1079,6 +1083,9 @@ xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused) |
5884 |
+ return NOTIFY_DONE; |
5885 |
+ } |
5886 |
+ |
5887 |
++/* Used to only allow one cpu to complete disconnect */ |
5888 |
++static unsigned int xpc_die_disconnecting; |
5889 |
++ |
5890 |
+ /* |
5891 |
+ * Notify other partitions to deactivate from us by first disengaging from all |
5892 |
+ * references to our memory. |
5893 |
+@@ -1092,6 +1099,9 @@ xpc_die_deactivate(void) |
5894 |
+ long keep_waiting; |
5895 |
+ long wait_to_print; |
5896 |
+ |
5897 |
++ if (cmpxchg(&xpc_die_disconnecting, 0, 1)) |
5898 |
++ return; |
5899 |
++ |
5900 |
+ /* keep xpc_hb_checker thread from doing anything (just in case) */ |
5901 |
+ xpc_exiting = 1; |
5902 |
+ |
5903 |
+@@ -1159,7 +1169,7 @@ xpc_die_deactivate(void) |
5904 |
+ * about the lack of a heartbeat. |
5905 |
+ */ |
5906 |
+ static int |
5907 |
+-xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused) |
5908 |
++xpc_system_die(struct notifier_block *nb, unsigned long event, void *_die_args) |
5909 |
+ { |
5910 |
+ #ifdef CONFIG_IA64 /* !!! temporary kludge */ |
5911 |
+ switch (event) { |
5912 |
+@@ -1191,7 +1201,27 @@ xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused) |
5913 |
+ break; |
5914 |
+ } |
5915 |
+ #else |
5916 |
+- xpc_die_deactivate(); |
5917 |
++ struct die_args *die_args = _die_args; |
5918 |
++ |
5919 |
++ switch (event) { |
5920 |
++ case DIE_TRAP: |
5921 |
++ if (die_args->trapnr == X86_TRAP_DF) |
5922 |
++ xpc_die_deactivate(); |
5923 |
++ |
5924 |
++ if (((die_args->trapnr == X86_TRAP_MF) || |
5925 |
++ (die_args->trapnr == X86_TRAP_XF)) && |
5926 |
++ !user_mode_vm(die_args->regs)) |
5927 |
++ xpc_die_deactivate(); |
5928 |
++ |
5929 |
++ break; |
5930 |
++ case DIE_INT3: |
5931 |
++ case DIE_DEBUG: |
5932 |
++ break; |
5933 |
++ case DIE_OOPS: |
5934 |
++ case DIE_GPF: |
5935 |
++ default: |
5936 |
++ xpc_die_deactivate(); |
5937 |
++ } |
5938 |
+ #endif |
5939 |
+ |
5940 |
+ return NOTIFY_DONE; |
5941 |
+diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c |
5942 |
+index 0ff0182..9b9305a 100644 |
5943 |
+--- a/drivers/pci/pcie/aspm.c |
5944 |
++++ b/drivers/pci/pcie/aspm.c |
5945 |
+@@ -790,6 +790,9 @@ void pcie_clear_aspm(struct pci_bus *bus) |
5946 |
+ { |
5947 |
+ struct pci_dev *child; |
5948 |
+ |
5949 |
++ if (aspm_force) |
5950 |
++ return; |
5951 |
++ |
5952 |
+ /* |
5953 |
+ * Clear any ASPM setup that the firmware has carried out on this bus |
5954 |
+ */ |
5955 |
+diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c |
5956 |
+index 7d8b5d8..515ec6d 100644 |
5957 |
+--- a/drivers/scsi/sd.c |
5958 |
++++ b/drivers/scsi/sd.c |
5959 |
+@@ -2826,10 +2826,6 @@ static int __init init_sd(void) |
5960 |
+ if (err) |
5961 |
+ goto err_out; |
5962 |
+ |
5963 |
+- err = scsi_register_driver(&sd_template.gendrv); |
5964 |
+- if (err) |
5965 |
+- goto err_out_class; |
5966 |
+- |
5967 |
+ sd_cdb_cache = kmem_cache_create("sd_ext_cdb", SD_EXT_CDB_SIZE, |
5968 |
+ 0, 0, NULL); |
5969 |
+ if (!sd_cdb_cache) { |
5970 |
+@@ -2843,8 +2839,15 @@ static int __init init_sd(void) |
5971 |
+ goto err_out_cache; |
5972 |
+ } |
5973 |
+ |
5974 |
++ err = scsi_register_driver(&sd_template.gendrv); |
5975 |
++ if (err) |
5976 |
++ goto err_out_driver; |
5977 |
++ |
5978 |
+ return 0; |
5979 |
+ |
5980 |
++err_out_driver: |
5981 |
++ mempool_destroy(sd_cdb_pool); |
5982 |
++ |
5983 |
+ err_out_cache: |
5984 |
+ kmem_cache_destroy(sd_cdb_cache); |
5985 |
+ |
5986 |
+@@ -2867,10 +2870,10 @@ static void __exit exit_sd(void) |
5987 |
+ |
5988 |
+ SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n")); |
5989 |
+ |
5990 |
++ scsi_unregister_driver(&sd_template.gendrv); |
5991 |
+ mempool_destroy(sd_cdb_pool); |
5992 |
+ kmem_cache_destroy(sd_cdb_cache); |
5993 |
+ |
5994 |
+- scsi_unregister_driver(&sd_template.gendrv); |
5995 |
+ class_unregister(&sd_disk_class); |
5996 |
+ |
5997 |
+ for (i = 0; i < SD_MAJORS; i++) |
5998 |
+diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c |
5999 |
+index 433a3b6..1547cf2 100644 |
6000 |
+--- a/drivers/staging/usbip/usbip_common.c |
6001 |
++++ b/drivers/staging/usbip/usbip_common.c |
6002 |
+@@ -761,26 +761,25 @@ EXPORT_SYMBOL_GPL(usbip_recv_iso); |
6003 |
+ * buffer and iso packets need to be stored and be in propeper endian in urb |
6004 |
+ * before calling this function |
6005 |
+ */ |
6006 |
+-int usbip_pad_iso(struct usbip_device *ud, struct urb *urb) |
6007 |
++void usbip_pad_iso(struct usbip_device *ud, struct urb *urb) |
6008 |
+ { |
6009 |
+ int np = urb->number_of_packets; |
6010 |
+ int i; |
6011 |
+- int ret; |
6012 |
+ int actualoffset = urb->actual_length; |
6013 |
+ |
6014 |
+ if (!usb_pipeisoc(urb->pipe)) |
6015 |
+- return 0; |
6016 |
++ return; |
6017 |
+ |
6018 |
+ /* if no packets or length of data is 0, then nothing to unpack */ |
6019 |
+ if (np == 0 || urb->actual_length == 0) |
6020 |
+- return 0; |
6021 |
++ return; |
6022 |
+ |
6023 |
+ /* |
6024 |
+ * if actual_length is transfer_buffer_length then no padding is |
6025 |
+ * present. |
6026 |
+ */ |
6027 |
+ if (urb->actual_length == urb->transfer_buffer_length) |
6028 |
+- return 0; |
6029 |
++ return; |
6030 |
+ |
6031 |
+ /* |
6032 |
+ * loop over all packets from last to first (to prevent overwritting |
6033 |
+@@ -792,8 +791,6 @@ int usbip_pad_iso(struct usbip_device *ud, struct urb *urb) |
6034 |
+ urb->transfer_buffer + actualoffset, |
6035 |
+ urb->iso_frame_desc[i].actual_length); |
6036 |
+ } |
6037 |
+- |
6038 |
+- return ret; |
6039 |
+ } |
6040 |
+ EXPORT_SYMBOL_GPL(usbip_pad_iso); |
6041 |
+ |
6042 |
+diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h |
6043 |
+index 4a641c5..072743e 100644 |
6044 |
+--- a/drivers/staging/usbip/usbip_common.h |
6045 |
++++ b/drivers/staging/usbip/usbip_common.h |
6046 |
+@@ -327,7 +327,7 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb); |
6047 |
+ /* some members of urb must be substituted before. */ |
6048 |
+ int usbip_recv_iso(struct usbip_device *ud, struct urb *urb); |
6049 |
+ /* some members of urb must be substituted before. */ |
6050 |
+-int usbip_pad_iso(struct usbip_device *ud, struct urb *urb); |
6051 |
++void usbip_pad_iso(struct usbip_device *ud, struct urb *urb); |
6052 |
+ void *usbip_alloc_iso_desc_pdu(struct urb *urb, ssize_t *bufflen); |
6053 |
+ |
6054 |
+ /* usbip_event.c */ |
6055 |
+diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c |
6056 |
+index 5c4b5d9..c851433 100644 |
6057 |
+--- a/drivers/staging/usbip/vhci_rx.c |
6058 |
++++ b/drivers/staging/usbip/vhci_rx.c |
6059 |
+@@ -94,8 +94,7 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, |
6060 |
+ return; |
6061 |
+ |
6062 |
+ /* restore the padding in iso packets */ |
6063 |
+- if (usbip_pad_iso(ud, urb) < 0) |
6064 |
+- return; |
6065 |
++ usbip_pad_iso(ud, urb); |
6066 |
+ |
6067 |
+ if (usbip_dbg_flag_vhci_rx) |
6068 |
+ usbip_dump_urb(urb); |
6069 |
+diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c |
6070 |
+index 762ce72..7f50999 100644 |
6071 |
+--- a/drivers/tty/serial/8250.c |
6072 |
++++ b/drivers/tty/serial/8250.c |
6073 |
+@@ -81,7 +81,7 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */ |
6074 |
+ #define DEBUG_INTR(fmt...) do { } while (0) |
6075 |
+ #endif |
6076 |
+ |
6077 |
+-#define PASS_LIMIT 256 |
6078 |
++#define PASS_LIMIT 512 |
6079 |
+ |
6080 |
+ #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) |
6081 |
+ |
6082 |
+diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c |
6083 |
+index fba99b1..18cd76b 100644 |
6084 |
+--- a/drivers/usb/host/uhci-hcd.c |
6085 |
++++ b/drivers/usb/host/uhci-hcd.c |
6086 |
+@@ -446,6 +446,10 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd) |
6087 |
+ return IRQ_NONE; |
6088 |
+ uhci_writew(uhci, status, USBSTS); /* Clear it */ |
6089 |
+ |
6090 |
++ spin_lock(&uhci->lock); |
6091 |
++ if (unlikely(!uhci->is_initialized)) /* not yet configured */ |
6092 |
++ goto done; |
6093 |
++ |
6094 |
+ if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) { |
6095 |
+ if (status & USBSTS_HSE) |
6096 |
+ dev_err(uhci_dev(uhci), "host system error, " |
6097 |
+@@ -454,7 +458,6 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd) |
6098 |
+ dev_err(uhci_dev(uhci), "host controller process " |
6099 |
+ "error, something bad happened!\n"); |
6100 |
+ if (status & USBSTS_HCH) { |
6101 |
+- spin_lock(&uhci->lock); |
6102 |
+ if (uhci->rh_state >= UHCI_RH_RUNNING) { |
6103 |
+ dev_err(uhci_dev(uhci), |
6104 |
+ "host controller halted, " |
6105 |
+@@ -472,15 +475,15 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd) |
6106 |
+ * pending unlinks */ |
6107 |
+ mod_timer(&hcd->rh_timer, jiffies); |
6108 |
+ } |
6109 |
+- spin_unlock(&uhci->lock); |
6110 |
+ } |
6111 |
+ } |
6112 |
+ |
6113 |
+- if (status & USBSTS_RD) |
6114 |
++ if (status & USBSTS_RD) { |
6115 |
++ spin_unlock(&uhci->lock); |
6116 |
+ usb_hcd_poll_rh_status(hcd); |
6117 |
+- else { |
6118 |
+- spin_lock(&uhci->lock); |
6119 |
++ } else { |
6120 |
+ uhci_scan_schedule(uhci); |
6121 |
++ done: |
6122 |
+ spin_unlock(&uhci->lock); |
6123 |
+ } |
6124 |
+ |
6125 |
+@@ -658,9 +661,9 @@ static int uhci_start(struct usb_hcd *hcd) |
6126 |
+ */ |
6127 |
+ mb(); |
6128 |
+ |
6129 |
++ spin_lock_irq(&uhci->lock); |
6130 |
+ configure_hc(uhci); |
6131 |
+ uhci->is_initialized = 1; |
6132 |
+- spin_lock_irq(&uhci->lock); |
6133 |
+ start_rh(uhci); |
6134 |
+ spin_unlock_irq(&uhci->lock); |
6135 |
+ return 0; |
6136 |
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h |
6137 |
+index f269c03..4c1a75f 100644 |
6138 |
+--- a/include/linux/pci_ids.h |
6139 |
++++ b/include/linux/pci_ids.h |
6140 |
+@@ -2390,6 +2390,8 @@ |
6141 |
+ |
6142 |
+ #define PCI_VENDOR_ID_AZWAVE 0x1a3b |
6143 |
+ |
6144 |
++#define PCI_VENDOR_ID_ASMEDIA 0x1b21 |
6145 |
++ |
6146 |
+ #define PCI_VENDOR_ID_TEKRAM 0x1de1 |
6147 |
+ #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 |
6148 |
+ |
6149 |
+diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c |
6150 |
+index f88ea18..e96eee3 100644 |
6151 |
+--- a/kernel/trace/ftrace.c |
6152 |
++++ b/kernel/trace/ftrace.c |
6153 |
+@@ -3460,7 +3460,7 @@ static int ftrace_module_notify(struct notifier_block *self, |
6154 |
+ |
6155 |
+ struct notifier_block ftrace_module_nb = { |
6156 |
+ .notifier_call = ftrace_module_notify, |
6157 |
+- .priority = 0, |
6158 |
++ .priority = INT_MAX, /* Run before anything that can use kprobes */ |
6159 |
+ }; |
6160 |
+ |
6161 |
+ extern unsigned long __start_mcount_loc[]; |