1 |
Author: mpagano |
2 |
Date: 2008-06-16 23:36:55 +0000 (Mon, 16 Jun 2008) |
3 |
New Revision: 1321 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/2.6.25/1006_linux-2.6.25.7.patch |
7 |
Modified: |
8 |
genpatches-2.6/trunk/2.6.25/0000_README |
9 |
Log: |
10 |
Linux 2.6.25.7 |
11 |
|
12 |
Modified: genpatches-2.6/trunk/2.6.25/0000_README |
13 |
=================================================================== |
14 |
--- genpatches-2.6/trunk/2.6.25/0000_README 2008-06-12 23:04:59 UTC (rev 1320) |
15 |
+++ genpatches-2.6/trunk/2.6.25/0000_README 2008-06-16 23:36:55 UTC (rev 1321) |
16 |
@@ -63,6 +63,10 @@ |
17 |
From: http://www.kernel.org |
18 |
Desc: Linux 2.6.25.6 |
19 |
|
20 |
+Patch: 1006_linux-2.6.25.7.patch |
21 |
+From: http://www.kernel.org |
22 |
+Desc: Linux 2.6.25.7 |
23 |
+ |
24 |
Patch: 2705_alsa-hda-fujitsu.patch |
25 |
From: Tony Vroon <chainsaw@g.o> |
26 |
Desc: Fix docking station headphone port and PC speaker for Fujitsu ALC262 |
27 |
|
28 |
Added: genpatches-2.6/trunk/2.6.25/1006_linux-2.6.25.7.patch |
29 |
=================================================================== |
30 |
--- genpatches-2.6/trunk/2.6.25/1006_linux-2.6.25.7.patch (rev 0) |
31 |
+++ genpatches-2.6/trunk/2.6.25/1006_linux-2.6.25.7.patch 2008-06-16 23:36:55 UTC (rev 1321) |
32 |
@@ -0,0 +1,1669 @@ |
33 |
+diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt |
34 |
+index e65736c..63e59b8 100644 |
35 |
+--- a/Documentation/cciss.txt |
36 |
++++ b/Documentation/cciss.txt |
37 |
+@@ -21,6 +21,11 @@ This driver is known to work with the following cards: |
38 |
+ * SA E200 |
39 |
+ * SA E200i |
40 |
+ * SA E500 |
41 |
++ * SA P212 |
42 |
++ * SA P410 |
43 |
++ * SA P410i |
44 |
++ * SA P411 |
45 |
++ * SA P812 |
46 |
+ |
47 |
+ Detecting drive failures: |
48 |
+ ------------------------- |
49 |
+diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig |
50 |
+index 99a4ed3..6342a07 100644 |
51 |
+--- a/arch/x86/Kconfig |
52 |
++++ b/arch/x86/Kconfig |
53 |
+@@ -24,17 +24,10 @@ config X86 |
54 |
+ select HAVE_KRETPROBES |
55 |
+ select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) |
56 |
+ |
57 |
+-config DEFCONFIG_LIST |
58 |
++config ARCH_DEFCONFIG |
59 |
+ string |
60 |
+- depends on X86_32 |
61 |
+- option defconfig_list |
62 |
+- default "arch/x86/configs/i386_defconfig" |
63 |
+- |
64 |
+-config DEFCONFIG_LIST |
65 |
+- string |
66 |
+- depends on X86_64 |
67 |
+- option defconfig_list |
68 |
+- default "arch/x86/configs/x86_64_defconfig" |
69 |
++ default "arch/x86/configs/i386_defconfig" if X86_32 |
70 |
++ default "arch/x86/configs/x86_64_defconfig" if X86_64 |
71 |
+ |
72 |
+ |
73 |
+ config GENERIC_LOCKBREAK |
74 |
+@@ -253,8 +246,7 @@ config X86_ELAN |
75 |
+ |
76 |
+ config X86_VOYAGER |
77 |
+ bool "Voyager (NCR)" |
78 |
+- depends on X86_32 |
79 |
+- select SMP if !BROKEN |
80 |
++ depends on X86_32 && (SMP || BROKEN) |
81 |
+ help |
82 |
+ Voyager is an MCA-based 32-way capable SMP architecture proprietary |
83 |
+ to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based. |
84 |
+@@ -266,9 +258,8 @@ config X86_VOYAGER |
85 |
+ |
86 |
+ config X86_NUMAQ |
87 |
+ bool "NUMAQ (IBM/Sequent)" |
88 |
+- select SMP |
89 |
++ depends on SMP && X86_32 |
90 |
+ select NUMA |
91 |
+- depends on X86_32 |
92 |
+ help |
93 |
+ This option is used for getting Linux to run on a (IBM/Sequent) NUMA |
94 |
+ multiquad box. This changes the way that processors are bootstrapped, |
95 |
+@@ -339,7 +330,7 @@ config X86_RDC321X |
96 |
+ |
97 |
+ config X86_VSMP |
98 |
+ bool "Support for ScaleMP vSMP" |
99 |
+- depends on X86_64 && PCI |
100 |
++ depends on X86_64 |
101 |
+ help |
102 |
+ Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is |
103 |
+ supposed to run on these EM64T-based machines. Only choose this option |
104 |
+@@ -1391,7 +1382,7 @@ endmenu |
105 |
+ menu "Bus options (PCI etc.)" |
106 |
+ |
107 |
+ config PCI |
108 |
+- bool "PCI support" if !X86_VISWS |
109 |
++ bool "PCI support" if !X86_VISWS && !X86_VSMP |
110 |
+ depends on !X86_VOYAGER |
111 |
+ default y |
112 |
+ select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC) |
113 |
+diff --git a/drivers/block/brd.c b/drivers/block/brd.c |
114 |
+index 8536480..37560a0 100644 |
115 |
+--- a/drivers/block/brd.c |
116 |
++++ b/drivers/block/brd.c |
117 |
+@@ -392,6 +392,7 @@ module_param(rd_size, int, 0); |
118 |
+ MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes."); |
119 |
+ MODULE_LICENSE("GPL"); |
120 |
+ MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR); |
121 |
++MODULE_ALIAS("rd"); |
122 |
+ |
123 |
+ #ifndef MODULE |
124 |
+ /* Legacy boot options - nonmodular */ |
125 |
+diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c |
126 |
+index 9c9627e..41636b8 100644 |
127 |
+--- a/drivers/block/cciss.c |
128 |
++++ b/drivers/block/cciss.c |
129 |
+@@ -53,15 +53,16 @@ |
130 |
+ #include <linux/scatterlist.h> |
131 |
+ |
132 |
+ #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin)) |
133 |
+-#define DRIVER_NAME "HP CISS Driver (v 3.6.14)" |
134 |
+-#define DRIVER_VERSION CCISS_DRIVER_VERSION(3,6,14) |
135 |
++#define DRIVER_NAME "HP CISS Driver (v 3.6.20)" |
136 |
++#define DRIVER_VERSION CCISS_DRIVER_VERSION(3, 6, 20) |
137 |
+ |
138 |
+ /* Embedded module documentation macros - see modules.h */ |
139 |
+ MODULE_AUTHOR("Hewlett-Packard Company"); |
140 |
+-MODULE_DESCRIPTION("Driver for HP Controller SA5xxx SA6xxx version 3.6.14"); |
141 |
++MODULE_DESCRIPTION("Driver for HP Smart Array Controllers"); |
142 |
+ MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400" |
143 |
+- " SA6i P600 P800 P400 P400i E200 E200i E500"); |
144 |
+-MODULE_VERSION("3.6.14"); |
145 |
++ " SA6i P600 P800 P400 P400i E200 E200i E500 P700m" |
146 |
++ " Smart Array G2 Series SAS/SATA Controllers"); |
147 |
++MODULE_VERSION("3.6.20"); |
148 |
+ MODULE_LICENSE("GPL"); |
149 |
+ |
150 |
+ #include "cciss_cmd.h" |
151 |
+@@ -90,6 +91,11 @@ static const struct pci_device_id cciss_pci_device_id[] = { |
152 |
+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSD, 0x103C, 0x3215}, |
153 |
+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSC, 0x103C, 0x3237}, |
154 |
+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSC, 0x103C, 0x323D}, |
155 |
++ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3241}, |
156 |
++ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3243}, |
157 |
++ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3245}, |
158 |
++ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3247}, |
159 |
++ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3249}, |
160 |
+ {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
161 |
+ PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, |
162 |
+ {0,} |
163 |
+@@ -123,6 +129,11 @@ static struct board_type products[] = { |
164 |
+ {0x3215103C, "Smart Array E200i", &SA5_access, 120}, |
165 |
+ {0x3237103C, "Smart Array E500", &SA5_access, 512}, |
166 |
+ {0x323D103C, "Smart Array P700m", &SA5_access, 512}, |
167 |
++ {0x3241103C, "Smart Array P212", &SA5_access, 384}, |
168 |
++ {0x3243103C, "Smart Array P410", &SA5_access, 384}, |
169 |
++ {0x3245103C, "Smart Array P410i", &SA5_access, 384}, |
170 |
++ {0x3247103C, "Smart Array P411", &SA5_access, 384}, |
171 |
++ {0x3249103C, "Smart Array P812", &SA5_access, 384}, |
172 |
+ {0xFFFF103C, "Unknown Smart Array", &SA5_access, 120}, |
173 |
+ }; |
174 |
+ |
175 |
+diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c |
176 |
+index 1f978ff..d353866 100644 |
177 |
+--- a/drivers/char/pcmcia/ipwireless/hardware.c |
178 |
++++ b/drivers/char/pcmcia/ipwireless/hardware.c |
179 |
+@@ -251,10 +251,11 @@ struct ipw_hardware { |
180 |
+ int init_loops; |
181 |
+ struct timer_list setup_timer; |
182 |
+ |
183 |
++ /* Flag if hw is ready to send next packet */ |
184 |
+ int tx_ready; |
185 |
+- struct list_head tx_queue[NL_NUM_OF_PRIORITIES]; |
186 |
+- /* True if any packets are queued for transmission */ |
187 |
++ /* Count of pending packets to be sent */ |
188 |
+ int tx_queued; |
189 |
++ struct list_head tx_queue[NL_NUM_OF_PRIORITIES]; |
190 |
+ |
191 |
+ int rx_bytes_queued; |
192 |
+ struct list_head rx_queue; |
193 |
+@@ -430,6 +431,8 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data, |
194 |
+ |
195 |
+ spin_lock_irqsave(&hw->spinlock, flags); |
196 |
+ |
197 |
++ hw->tx_ready = 0; |
198 |
++ |
199 |
+ if (hw->hw_version == HW_VERSION_1) { |
200 |
+ outw((unsigned short) length, hw->base_port + IODWR); |
201 |
+ |
202 |
+@@ -518,6 +521,7 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet) |
203 |
+ |
204 |
+ spin_lock_irqsave(&hw->spinlock, flags); |
205 |
+ list_add(&packet->queue, &hw->tx_queue[0]); |
206 |
++ hw->tx_queued++; |
207 |
+ spin_unlock_irqrestore(&hw->spinlock, flags); |
208 |
+ } else { |
209 |
+ if (packet->packet_callback) |
210 |
+@@ -975,12 +979,10 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) |
211 |
+ unsigned long flags; |
212 |
+ |
213 |
+ spin_lock_irqsave(&hw->spinlock, flags); |
214 |
+- if (hw->tx_queued && hw->tx_ready != 0) { |
215 |
++ if (hw->tx_queued && hw->tx_ready) { |
216 |
+ int priority; |
217 |
+ struct ipw_tx_packet *packet = NULL; |
218 |
+ |
219 |
+- hw->tx_ready--; |
220 |
+- |
221 |
+ /* Pick a packet */ |
222 |
+ for (priority = 0; priority < priority_limit; priority++) { |
223 |
+ if (!list_empty(&hw->tx_queue[priority])) { |
224 |
+@@ -989,6 +991,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) |
225 |
+ struct ipw_tx_packet, |
226 |
+ queue); |
227 |
+ |
228 |
++ hw->tx_queued--; |
229 |
+ list_del(&packet->queue); |
230 |
+ |
231 |
+ break; |
232 |
+@@ -999,6 +1002,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) |
233 |
+ spin_unlock_irqrestore(&hw->spinlock, flags); |
234 |
+ return 0; |
235 |
+ } |
236 |
++ |
237 |
+ spin_unlock_irqrestore(&hw->spinlock, flags); |
238 |
+ |
239 |
+ /* Send */ |
240 |
+@@ -1089,7 +1093,7 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq, |
241 |
+ if (irqn & IR_TXINTR) { |
242 |
+ ack |= IR_TXINTR; |
243 |
+ spin_lock_irqsave(&hw->spinlock, flags); |
244 |
+- hw->tx_ready++; |
245 |
++ hw->tx_ready = 1; |
246 |
+ spin_unlock_irqrestore(&hw->spinlock, flags); |
247 |
+ } |
248 |
+ /* Received data */ |
249 |
+@@ -1196,7 +1200,7 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, |
250 |
+ if (memrxdone & MEMRX_RX_DONE) { |
251 |
+ writew(0, &hw->memory_info_regs->memreg_rx_done); |
252 |
+ spin_lock_irqsave(&hw->spinlock, flags); |
253 |
+- hw->tx_ready++; |
254 |
++ hw->tx_ready = 1; |
255 |
+ spin_unlock_irqrestore(&hw->spinlock, flags); |
256 |
+ tx = 1; |
257 |
+ } |
258 |
+@@ -1260,7 +1264,7 @@ static void send_packet(struct ipw_hardware *hw, int priority, |
259 |
+ |
260 |
+ spin_lock_irqsave(&hw->spinlock, flags); |
261 |
+ list_add_tail(&packet->queue, &hw->tx_queue[priority]); |
262 |
+- hw->tx_queued = 1; |
263 |
++ hw->tx_queued++; |
264 |
+ spin_unlock_irqrestore(&hw->spinlock, flags); |
265 |
+ |
266 |
+ flush_packets_to_hw(hw); |
267 |
+diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c |
268 |
+index 99aa5f5..ebd68c1 100644 |
269 |
+--- a/drivers/cpufreq/cpufreq.c |
270 |
++++ b/drivers/cpufreq/cpufreq.c |
271 |
+@@ -410,7 +410,7 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy, |
272 |
+ int ret; |
273 |
+ |
274 |
+ mutex_unlock(&cpufreq_governor_mutex); |
275 |
+- ret = request_module(name); |
276 |
++ ret = request_module("%s", name); |
277 |
+ mutex_lock(&cpufreq_governor_mutex); |
278 |
+ |
279 |
+ if (ret == 0) |
280 |
+diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c |
281 |
+index 4e3128f..9d5b86c 100644 |
282 |
+--- a/drivers/infiniband/core/umem.c |
283 |
++++ b/drivers/infiniband/core/umem.c |
284 |
+@@ -144,7 +144,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, |
285 |
+ ret = 0; |
286 |
+ while (npages) { |
287 |
+ ret = get_user_pages(current, current->mm, cur_base, |
288 |
+- min_t(int, npages, |
289 |
++ min_t(unsigned long, npages, |
290 |
+ PAGE_SIZE / sizeof (struct page *)), |
291 |
+ 1, !umem->writable, page_list, vma_list); |
292 |
+ |
293 |
+diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c |
294 |
+index fcf8f2d..594522a 100644 |
295 |
+--- a/drivers/media/video/bt8xx/bttv-driver.c |
296 |
++++ b/drivers/media/video/bt8xx/bttv-driver.c |
297 |
+@@ -2613,7 +2613,7 @@ static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf) |
298 |
+ struct bttv_fh *fh = priv; |
299 |
+ |
300 |
+ mutex_lock(&fh->cap.vb_lock); |
301 |
+- retval = videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize, |
302 |
++ retval = __videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize, |
303 |
+ V4L2_MEMORY_MMAP); |
304 |
+ if (retval < 0) { |
305 |
+ mutex_unlock(&fh->cap.vb_lock); |
306 |
+diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c |
307 |
+index eab79ff..57a9de4 100644 |
308 |
+--- a/drivers/media/video/videobuf-core.c |
309 |
++++ b/drivers/media/video/videobuf-core.c |
310 |
+@@ -335,7 +335,7 @@ int videobuf_mmap_free(struct videobuf_queue *q) |
311 |
+ } |
312 |
+ |
313 |
+ /* Locking: Caller holds q->vb_lock */ |
314 |
+-static int __videobuf_mmap_setup(struct videobuf_queue *q, |
315 |
++int __videobuf_mmap_setup(struct videobuf_queue *q, |
316 |
+ unsigned int bcount, unsigned int bsize, |
317 |
+ enum v4l2_memory memory) |
318 |
+ { |
319 |
+@@ -1093,6 +1093,7 @@ EXPORT_SYMBOL_GPL(videobuf_read_stream); |
320 |
+ EXPORT_SYMBOL_GPL(videobuf_read_one); |
321 |
+ EXPORT_SYMBOL_GPL(videobuf_poll_stream); |
322 |
+ |
323 |
++EXPORT_SYMBOL_GPL(__videobuf_mmap_setup); |
324 |
+ EXPORT_SYMBOL_GPL(videobuf_mmap_setup); |
325 |
+ EXPORT_SYMBOL_GPL(videobuf_mmap_free); |
326 |
+ EXPORT_SYMBOL_GPL(videobuf_mmap_mapper); |
327 |
+diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c |
328 |
+index be624a0..c303e7f 100644 |
329 |
+--- a/drivers/mmc/host/wbsd.c |
330 |
++++ b/drivers/mmc/host/wbsd.c |
331 |
+@@ -1457,17 +1457,7 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq) |
332 |
+ int ret; |
333 |
+ |
334 |
+ /* |
335 |
+- * Allocate interrupt. |
336 |
+- */ |
337 |
+- |
338 |
+- ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host); |
339 |
+- if (ret) |
340 |
+- return ret; |
341 |
+- |
342 |
+- host->irq = irq; |
343 |
+- |
344 |
+- /* |
345 |
+- * Set up tasklets. |
346 |
++ * Set up tasklets. Must be done before requesting interrupt. |
347 |
+ */ |
348 |
+ tasklet_init(&host->card_tasklet, wbsd_tasklet_card, |
349 |
+ (unsigned long)host); |
350 |
+@@ -1480,6 +1470,15 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq) |
351 |
+ tasklet_init(&host->finish_tasklet, wbsd_tasklet_finish, |
352 |
+ (unsigned long)host); |
353 |
+ |
354 |
++ /* |
355 |
++ * Allocate interrupt. |
356 |
++ */ |
357 |
++ ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host); |
358 |
++ if (ret) |
359 |
++ return ret; |
360 |
++ |
361 |
++ host->irq = irq; |
362 |
++ |
363 |
+ return 0; |
364 |
+ } |
365 |
+ |
366 |
+diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c |
367 |
+index 14299f8..863d7f3 100644 |
368 |
+--- a/drivers/net/cassini.c |
369 |
++++ b/drivers/net/cassini.c |
370 |
+@@ -142,8 +142,8 @@ |
371 |
+ |
372 |
+ #define DRV_MODULE_NAME "cassini" |
373 |
+ #define PFX DRV_MODULE_NAME ": " |
374 |
+-#define DRV_MODULE_VERSION "1.5" |
375 |
+-#define DRV_MODULE_RELDATE "4 Jan 2008" |
376 |
++#define DRV_MODULE_VERSION "1.6" |
377 |
++#define DRV_MODULE_RELDATE "21 May 2008" |
378 |
+ |
379 |
+ #define CAS_DEF_MSG_ENABLE \ |
380 |
+ (NETIF_MSG_DRV | \ |
381 |
+@@ -2140,9 +2140,12 @@ end_copy_pkt: |
382 |
+ if (addr) |
383 |
+ cas_page_unmap(addr); |
384 |
+ } |
385 |
+- skb->csum = csum_unfold(~csum); |
386 |
+- skb->ip_summed = CHECKSUM_COMPLETE; |
387 |
+ skb->protocol = eth_type_trans(skb, cp->dev); |
388 |
++ if (skb->protocol == htons(ETH_P_IP)) { |
389 |
++ skb->csum = csum_unfold(~csum); |
390 |
++ skb->ip_summed = CHECKSUM_COMPLETE; |
391 |
++ } else |
392 |
++ skb->ip_summed = CHECKSUM_NONE; |
393 |
+ return len; |
394 |
+ } |
395 |
+ |
396 |
+diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c |
397 |
+index 9f088a4..8e877e7 100644 |
398 |
+--- a/drivers/net/forcedeth.c |
399 |
++++ b/drivers/net/forcedeth.c |
400 |
+@@ -3111,6 +3111,20 @@ static void nv_link_irq(struct net_device *dev) |
401 |
+ dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name); |
402 |
+ } |
403 |
+ |
404 |
++static void nv_msi_workaround(struct fe_priv *np) |
405 |
++{ |
406 |
++ |
407 |
++ /* Need to toggle the msi irq mask within the ethernet device, |
408 |
++ * otherwise, future interrupts will not be detected. |
409 |
++ */ |
410 |
++ if (np->msi_flags & NV_MSI_ENABLED) { |
411 |
++ u8 __iomem *base = np->base; |
412 |
++ |
413 |
++ writel(0, base + NvRegMSIIrqMask); |
414 |
++ writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask); |
415 |
++ } |
416 |
++} |
417 |
++ |
418 |
+ static irqreturn_t nv_nic_irq(int foo, void *data) |
419 |
+ { |
420 |
+ struct net_device *dev = (struct net_device *) data; |
421 |
+@@ -3133,6 +3147,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data) |
422 |
+ if (!(events & np->irqmask)) |
423 |
+ break; |
424 |
+ |
425 |
++ nv_msi_workaround(np); |
426 |
++ |
427 |
+ spin_lock(&np->lock); |
428 |
+ nv_tx_done(dev); |
429 |
+ spin_unlock(&np->lock); |
430 |
+@@ -3248,6 +3264,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data) |
431 |
+ if (!(events & np->irqmask)) |
432 |
+ break; |
433 |
+ |
434 |
++ nv_msi_workaround(np); |
435 |
++ |
436 |
+ spin_lock(&np->lock); |
437 |
+ nv_tx_done_optimized(dev, TX_WORK_PER_LOOP); |
438 |
+ spin_unlock(&np->lock); |
439 |
+@@ -3588,6 +3606,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data) |
440 |
+ if (!(events & NVREG_IRQ_TIMER)) |
441 |
+ return IRQ_RETVAL(0); |
442 |
+ |
443 |
++ nv_msi_workaround(np); |
444 |
++ |
445 |
+ spin_lock(&np->lock); |
446 |
+ np->intr_test = 1; |
447 |
+ spin_unlock(&np->lock); |
448 |
+diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c |
449 |
+index 3d10ca0..a629355 100644 |
450 |
+--- a/drivers/net/pppol2tp.c |
451 |
++++ b/drivers/net/pppol2tp.c |
452 |
+@@ -240,12 +240,15 @@ static inline struct pppol2tp_session *pppol2tp_sock_to_session(struct sock *sk) |
453 |
+ if (sk == NULL) |
454 |
+ return NULL; |
455 |
+ |
456 |
++ sock_hold(sk); |
457 |
+ session = (struct pppol2tp_session *)(sk->sk_user_data); |
458 |
+- if (session == NULL) |
459 |
+- return NULL; |
460 |
++ if (session == NULL) { |
461 |
++ sock_put(sk); |
462 |
++ goto out; |
463 |
++ } |
464 |
+ |
465 |
+ BUG_ON(session->magic != L2TP_SESSION_MAGIC); |
466 |
+- |
467 |
++out: |
468 |
+ return session; |
469 |
+ } |
470 |
+ |
471 |
+@@ -256,12 +259,15 @@ static inline struct pppol2tp_tunnel *pppol2tp_sock_to_tunnel(struct sock *sk) |
472 |
+ if (sk == NULL) |
473 |
+ return NULL; |
474 |
+ |
475 |
++ sock_hold(sk); |
476 |
+ tunnel = (struct pppol2tp_tunnel *)(sk->sk_user_data); |
477 |
+- if (tunnel == NULL) |
478 |
+- return NULL; |
479 |
++ if (tunnel == NULL) { |
480 |
++ sock_put(sk); |
481 |
++ goto out; |
482 |
++ } |
483 |
+ |
484 |
+ BUG_ON(tunnel->magic != L2TP_TUNNEL_MAGIC); |
485 |
+- |
486 |
++out: |
487 |
+ return tunnel; |
488 |
+ } |
489 |
+ |
490 |
+@@ -716,12 +722,14 @@ discard: |
491 |
+ session->stats.rx_errors++; |
492 |
+ kfree_skb(skb); |
493 |
+ sock_put(session->sock); |
494 |
++ sock_put(sock); |
495 |
+ |
496 |
+ return 0; |
497 |
+ |
498 |
+ error: |
499 |
+ /* Put UDP header back */ |
500 |
+ __skb_push(skb, sizeof(struct udphdr)); |
501 |
++ sock_put(sock); |
502 |
+ |
503 |
+ no_tunnel: |
504 |
+ return 1; |
505 |
+@@ -745,10 +753,13 @@ static int pppol2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb) |
506 |
+ "%s: received %d bytes\n", tunnel->name, skb->len); |
507 |
+ |
508 |
+ if (pppol2tp_recv_core(sk, skb)) |
509 |
+- goto pass_up; |
510 |
++ goto pass_up_put; |
511 |
+ |
512 |
++ sock_put(sk); |
513 |
+ return 0; |
514 |
+ |
515 |
++pass_up_put: |
516 |
++ sock_put(sk); |
517 |
+ pass_up: |
518 |
+ return 1; |
519 |
+ } |
520 |
+@@ -858,7 +869,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh |
521 |
+ |
522 |
+ tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock); |
523 |
+ if (tunnel == NULL) |
524 |
+- goto error; |
525 |
++ goto error_put_sess; |
526 |
+ |
527 |
+ /* What header length is configured for this session? */ |
528 |
+ hdr_len = pppol2tp_l2tp_header_len(session); |
529 |
+@@ -870,7 +881,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh |
530 |
+ sizeof(ppph) + total_len, |
531 |
+ 0, GFP_KERNEL); |
532 |
+ if (!skb) |
533 |
+- goto error; |
534 |
++ goto error_put_sess_tun; |
535 |
+ |
536 |
+ /* Reserve space for headers. */ |
537 |
+ skb_reserve(skb, NET_SKB_PAD); |
538 |
+@@ -900,7 +911,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh |
539 |
+ error = memcpy_fromiovec(skb->data, m->msg_iov, total_len); |
540 |
+ if (error < 0) { |
541 |
+ kfree_skb(skb); |
542 |
+- goto error; |
543 |
++ goto error_put_sess_tun; |
544 |
+ } |
545 |
+ skb_put(skb, total_len); |
546 |
+ |
547 |
+@@ -947,10 +958,33 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh |
548 |
+ session->stats.tx_errors++; |
549 |
+ } |
550 |
+ |
551 |
++ return error; |
552 |
++ |
553 |
++error_put_sess_tun: |
554 |
++ sock_put(session->tunnel_sock); |
555 |
++error_put_sess: |
556 |
++ sock_put(sk); |
557 |
+ error: |
558 |
+ return error; |
559 |
+ } |
560 |
+ |
561 |
++/* Automatically called when the skb is freed. |
562 |
++ */ |
563 |
++static void pppol2tp_sock_wfree(struct sk_buff *skb) |
564 |
++{ |
565 |
++ sock_put(skb->sk); |
566 |
++} |
567 |
++ |
568 |
++/* For data skbs that we transmit, we associate with the tunnel socket |
569 |
++ * but don't do accounting. |
570 |
++ */ |
571 |
++static inline void pppol2tp_skb_set_owner_w(struct sk_buff *skb, struct sock *sk) |
572 |
++{ |
573 |
++ sock_hold(sk); |
574 |
++ skb->sk = sk; |
575 |
++ skb->destructor = pppol2tp_sock_wfree; |
576 |
++} |
577 |
++ |
578 |
+ /* Transmit function called by generic PPP driver. Sends PPP frame |
579 |
+ * over PPPoL2TP socket. |
580 |
+ * |
581 |
+@@ -980,6 +1014,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) |
582 |
+ __wsum csum = 0; |
583 |
+ struct udphdr *uh; |
584 |
+ unsigned int len; |
585 |
++ int old_headroom; |
586 |
++ int new_headroom; |
587 |
+ |
588 |
+ if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) |
589 |
+ goto abort; |
590 |
+@@ -991,25 +1027,27 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) |
591 |
+ |
592 |
+ sk_tun = session->tunnel_sock; |
593 |
+ if (sk_tun == NULL) |
594 |
+- goto abort; |
595 |
++ goto abort_put_sess; |
596 |
+ tunnel = pppol2tp_sock_to_tunnel(sk_tun); |
597 |
+ if (tunnel == NULL) |
598 |
+- goto abort; |
599 |
++ goto abort_put_sess; |
600 |
+ |
601 |
+ /* What header length is configured for this session? */ |
602 |
+ hdr_len = pppol2tp_l2tp_header_len(session); |
603 |
+ |
604 |
+ /* Check that there's enough headroom in the skb to insert IP, |
605 |
+ * UDP and L2TP and PPP headers. If not enough, expand it to |
606 |
+- * make room. Note that a new skb (or a clone) is |
607 |
+- * allocated. If we return an error from this point on, make |
608 |
+- * sure we free the new skb but do not free the original skb |
609 |
+- * since that is done by the caller for the error case. |
610 |
++ * make room. Adjust truesize. |
611 |
+ */ |
612 |
+ headroom = NET_SKB_PAD + sizeof(struct iphdr) + |
613 |
+ sizeof(struct udphdr) + hdr_len + sizeof(ppph); |
614 |
++ old_headroom = skb_headroom(skb); |
615 |
+ if (skb_cow_head(skb, headroom)) |
616 |
+- goto abort; |
617 |
++ goto abort_put_sess_tun; |
618 |
++ |
619 |
++ new_headroom = skb_headroom(skb); |
620 |
++ skb_orphan(skb); |
621 |
++ skb->truesize += new_headroom - old_headroom; |
622 |
+ |
623 |
+ /* Setup PPP header */ |
624 |
+ __skb_push(skb, sizeof(ppph)); |
625 |
+@@ -1065,8 +1103,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) |
626 |
+ /* Get routing info from the tunnel socket */ |
627 |
+ dst_release(skb->dst); |
628 |
+ skb->dst = dst_clone(__sk_dst_get(sk_tun)); |
629 |
+- skb_orphan(skb); |
630 |
+- skb->sk = sk_tun; |
631 |
++ pppol2tp_skb_set_owner_w(skb, sk_tun); |
632 |
+ |
633 |
+ /* Queue the packet to IP for output */ |
634 |
+ len = skb->len; |
635 |
+@@ -1083,8 +1120,14 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) |
636 |
+ session->stats.tx_errors++; |
637 |
+ } |
638 |
+ |
639 |
++ sock_put(sk_tun); |
640 |
++ sock_put(sk); |
641 |
+ return 1; |
642 |
+ |
643 |
++abort_put_sess_tun: |
644 |
++ sock_put(sk_tun); |
645 |
++abort_put_sess: |
646 |
++ sock_put(sk); |
647 |
+ abort: |
648 |
+ /* Free the original skb */ |
649 |
+ kfree_skb(skb); |
650 |
+@@ -1188,7 +1231,7 @@ static void pppol2tp_tunnel_destruct(struct sock *sk) |
651 |
+ { |
652 |
+ struct pppol2tp_tunnel *tunnel; |
653 |
+ |
654 |
+- tunnel = pppol2tp_sock_to_tunnel(sk); |
655 |
++ tunnel = sk->sk_user_data; |
656 |
+ if (tunnel == NULL) |
657 |
+ goto end; |
658 |
+ |
659 |
+@@ -1227,10 +1270,12 @@ static void pppol2tp_session_destruct(struct sock *sk) |
660 |
+ if (sk->sk_user_data != NULL) { |
661 |
+ struct pppol2tp_tunnel *tunnel; |
662 |
+ |
663 |
+- session = pppol2tp_sock_to_session(sk); |
664 |
++ session = sk->sk_user_data; |
665 |
+ if (session == NULL) |
666 |
+ goto out; |
667 |
+ |
668 |
++ BUG_ON(session->magic != L2TP_SESSION_MAGIC); |
669 |
++ |
670 |
+ /* Don't use pppol2tp_sock_to_tunnel() here to |
671 |
+ * get the tunnel context because the tunnel |
672 |
+ * socket might have already been closed (its |
673 |
+@@ -1276,6 +1321,7 @@ out: |
674 |
+ static int pppol2tp_release(struct socket *sock) |
675 |
+ { |
676 |
+ struct sock *sk = sock->sk; |
677 |
++ struct pppol2tp_session *session; |
678 |
+ int error; |
679 |
+ |
680 |
+ if (!sk) |
681 |
+@@ -1293,9 +1339,18 @@ static int pppol2tp_release(struct socket *sock) |
682 |
+ sock_orphan(sk); |
683 |
+ sock->sk = NULL; |
684 |
+ |
685 |
++ session = pppol2tp_sock_to_session(sk); |
686 |
++ |
687 |
+ /* Purge any queued data */ |
688 |
+ skb_queue_purge(&sk->sk_receive_queue); |
689 |
+ skb_queue_purge(&sk->sk_write_queue); |
690 |
++ if (session != NULL) { |
691 |
++ struct sk_buff *skb; |
692 |
++ while ((skb = skb_dequeue(&session->reorder_q))) { |
693 |
++ kfree_skb(skb); |
694 |
++ sock_put(sk); |
695 |
++ } |
696 |
++ } |
697 |
+ |
698 |
+ release_sock(sk); |
699 |
+ |
700 |
+@@ -1598,7 +1653,7 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr, |
701 |
+ |
702 |
+ error = ppp_register_channel(&po->chan); |
703 |
+ if (error) |
704 |
+- goto end; |
705 |
++ goto end_put_tun; |
706 |
+ |
707 |
+ /* This is how we get the session context from the socket. */ |
708 |
+ sk->sk_user_data = session; |
709 |
+@@ -1618,6 +1673,8 @@ out_no_ppp: |
710 |
+ PRINTK(session->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO, |
711 |
+ "%s: created\n", session->name); |
712 |
+ |
713 |
++end_put_tun: |
714 |
++ sock_put(tunnel_sock); |
715 |
+ end: |
716 |
+ release_sock(sk); |
717 |
+ |
718 |
+@@ -1658,6 +1715,7 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr, |
719 |
+ *usockaddr_len = len; |
720 |
+ |
721 |
+ error = 0; |
722 |
++ sock_put(sock->sk); |
723 |
+ |
724 |
+ end: |
725 |
+ return error; |
726 |
+@@ -1896,14 +1954,17 @@ static int pppol2tp_ioctl(struct socket *sock, unsigned int cmd, |
727 |
+ err = -EBADF; |
728 |
+ tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock); |
729 |
+ if (tunnel == NULL) |
730 |
+- goto end; |
731 |
++ goto end_put_sess; |
732 |
+ |
733 |
+ err = pppol2tp_tunnel_ioctl(tunnel, cmd, arg); |
734 |
+- goto end; |
735 |
++ sock_put(session->tunnel_sock); |
736 |
++ goto end_put_sess; |
737 |
+ } |
738 |
+ |
739 |
+ err = pppol2tp_session_ioctl(session, cmd, arg); |
740 |
+ |
741 |
++end_put_sess: |
742 |
++ sock_put(sk); |
743 |
+ end: |
744 |
+ return err; |
745 |
+ } |
746 |
+@@ -2049,14 +2110,17 @@ static int pppol2tp_setsockopt(struct socket *sock, int level, int optname, |
747 |
+ err = -EBADF; |
748 |
+ tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock); |
749 |
+ if (tunnel == NULL) |
750 |
+- goto end; |
751 |
++ goto end_put_sess; |
752 |
+ |
753 |
+ err = pppol2tp_tunnel_setsockopt(sk, tunnel, optname, val); |
754 |
++ sock_put(session->tunnel_sock); |
755 |
+ } else |
756 |
+ err = pppol2tp_session_setsockopt(sk, session, optname, val); |
757 |
+ |
758 |
+ err = 0; |
759 |
+ |
760 |
++end_put_sess: |
761 |
++ sock_put(sk); |
762 |
+ end: |
763 |
+ return err; |
764 |
+ } |
765 |
+@@ -2171,20 +2235,24 @@ static int pppol2tp_getsockopt(struct socket *sock, int level, |
766 |
+ err = -EBADF; |
767 |
+ tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock); |
768 |
+ if (tunnel == NULL) |
769 |
+- goto end; |
770 |
++ goto end_put_sess; |
771 |
+ |
772 |
+ err = pppol2tp_tunnel_getsockopt(sk, tunnel, optname, &val); |
773 |
++ sock_put(session->tunnel_sock); |
774 |
+ } else |
775 |
+ err = pppol2tp_session_getsockopt(sk, session, optname, &val); |
776 |
+ |
777 |
+ err = -EFAULT; |
778 |
+ if (put_user(len, (int __user *) optlen)) |
779 |
+- goto end; |
780 |
++ goto end_put_sess; |
781 |
+ |
782 |
+ if (copy_to_user((void __user *) optval, &val, len)) |
783 |
+- goto end; |
784 |
++ goto end_put_sess; |
785 |
+ |
786 |
+ err = 0; |
787 |
++ |
788 |
++end_put_sess: |
789 |
++ sock_put(sk); |
790 |
+ end: |
791 |
+ return err; |
792 |
+ } |
793 |
+diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c |
794 |
+index e0055d0..6966eec 100644 |
795 |
+--- a/drivers/net/wireless/b43/main.c |
796 |
++++ b/drivers/net/wireless/b43/main.c |
797 |
+@@ -3818,7 +3818,9 @@ static void b43_chip_reset(struct work_struct *work) |
798 |
+ goto out; |
799 |
+ } |
800 |
+ } |
801 |
+- out: |
802 |
++out: |
803 |
++ if (err) |
804 |
++ wl->current_dev = NULL; /* Failed to init the dev. */ |
805 |
+ mutex_unlock(&wl->mutex); |
806 |
+ if (err) |
807 |
+ b43err(wl, "Controller restart FAILED\n"); |
808 |
+@@ -3967,9 +3969,11 @@ static void b43_one_core_detach(struct ssb_device *dev) |
809 |
+ struct b43_wldev *wldev; |
810 |
+ struct b43_wl *wl; |
811 |
+ |
812 |
++ /* Do not cancel ieee80211-workqueue based work here. |
813 |
++ * See comment in b43_remove(). */ |
814 |
++ |
815 |
+ wldev = ssb_get_drvdata(dev); |
816 |
+ wl = wldev->wl; |
817 |
+- cancel_work_sync(&wldev->restart_work); |
818 |
+ b43_debugfs_remove_device(wldev); |
819 |
+ b43_wireless_core_detach(wldev); |
820 |
+ list_del(&wldev->list); |
821 |
+@@ -4152,6 +4156,10 @@ static void b43_remove(struct ssb_device *dev) |
822 |
+ struct b43_wl *wl = ssb_get_devtypedata(dev); |
823 |
+ struct b43_wldev *wldev = ssb_get_drvdata(dev); |
824 |
+ |
825 |
++ /* We must cancel any work here before unregistering from ieee80211, |
826 |
++ * as the ieee80211 unreg will destroy the workqueue. */ |
827 |
++ cancel_work_sync(&wldev->restart_work); |
828 |
++ |
829 |
+ B43_WARN_ON(!wl); |
830 |
+ if (wl->current_dev == wldev) |
831 |
+ ieee80211_unregister_hw(wl->hw); |
832 |
+diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c |
833 |
+index 3bf9294..db9920e 100644 |
834 |
+--- a/drivers/serial/serial_core.c |
835 |
++++ b/drivers/serial/serial_core.c |
836 |
+@@ -2022,6 +2022,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) |
837 |
+ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) |
838 |
+ { |
839 |
+ struct uart_state *state = drv->state + port->line; |
840 |
++ struct device *tty_dev; |
841 |
++ struct uart_match match = {port, drv}; |
842 |
+ |
843 |
+ mutex_lock(&state->mutex); |
844 |
+ |
845 |
+@@ -2031,7 +2033,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) |
846 |
+ return 0; |
847 |
+ } |
848 |
+ |
849 |
+- if (!port->suspended) { |
850 |
++ tty_dev = device_find_child(port->dev, &match, serial_match_port); |
851 |
++ if (!port->suspended && device_may_wakeup(tty_dev)) { |
852 |
+ disable_irq_wake(port->irq); |
853 |
+ mutex_unlock(&state->mutex); |
854 |
+ return 0; |
855 |
+diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c |
856 |
+index 145c028..2847336 100644 |
857 |
+--- a/drivers/serial/sunhv.c |
858 |
++++ b/drivers/serial/sunhv.c |
859 |
+@@ -499,7 +499,6 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig |
860 |
+ } else |
861 |
+ spin_lock(&port->lock); |
862 |
+ |
863 |
+- spin_lock_irqsave(&port->lock, flags); |
864 |
+ for (i = 0; i < n; i++) { |
865 |
+ if (*s == '\n') |
866 |
+ sunhv_console_putchar(port, '\r'); |
867 |
+diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c |
868 |
+index 5d777f2..3c8239a 100644 |
869 |
+--- a/drivers/ssb/driver_pcicore.c |
870 |
++++ b/drivers/ssb/driver_pcicore.c |
871 |
+@@ -519,12 +519,12 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc, |
872 |
+ int err = 0; |
873 |
+ u32 tmp; |
874 |
+ |
875 |
+- might_sleep(); |
876 |
+- |
877 |
+ if (!pdev) |
878 |
+ goto out; |
879 |
+ bus = pdev->bus; |
880 |
+ |
881 |
++ might_sleep_if(pdev->id.coreid != SSB_DEV_PCI); |
882 |
++ |
883 |
+ /* Enable interrupts for this device. */ |
884 |
+ if (bus->host_pci && |
885 |
+ ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE))) { |
886 |
+diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c |
887 |
+index fb9e672..c18880d 100644 |
888 |
+--- a/drivers/video/hgafb.c |
889 |
++++ b/drivers/video/hgafb.c |
890 |
+@@ -279,7 +279,7 @@ static void hga_blank(int blank_mode) |
891 |
+ |
892 |
+ static int __init hga_card_detect(void) |
893 |
+ { |
894 |
+- int count=0; |
895 |
++ int count = 0; |
896 |
+ void __iomem *p, *q; |
897 |
+ unsigned short p_save, q_save; |
898 |
+ |
899 |
+@@ -303,20 +303,18 @@ static int __init hga_card_detect(void) |
900 |
+ writew(0x55aa, p); if (readw(p) == 0x55aa) count++; |
901 |
+ writew(p_save, p); |
902 |
+ |
903 |
+- if (count != 2) { |
904 |
+- return 0; |
905 |
+- } |
906 |
++ if (count != 2) |
907 |
++ goto error; |
908 |
+ |
909 |
+ /* Ok, there is definitely a card registering at the correct |
910 |
+ * memory location, so now we do an I/O port test. |
911 |
+ */ |
912 |
+ |
913 |
+- if (!test_hga_b(0x66, 0x0f)) { /* cursor low register */ |
914 |
+- return 0; |
915 |
+- } |
916 |
+- if (!test_hga_b(0x99, 0x0f)) { /* cursor low register */ |
917 |
+- return 0; |
918 |
+- } |
919 |
++ if (!test_hga_b(0x66, 0x0f)) /* cursor low register */ |
920 |
++ goto error; |
921 |
++ |
922 |
++ if (!test_hga_b(0x99, 0x0f)) /* cursor low register */ |
923 |
++ goto error; |
924 |
+ |
925 |
+ /* See if the card is a Hercules, by checking whether the vsync |
926 |
+ * bit of the status register is changing. This test lasts for |
927 |
+@@ -331,7 +329,7 @@ static int __init hga_card_detect(void) |
928 |
+ } |
929 |
+ |
930 |
+ if (p_save == q_save) |
931 |
+- return 0; |
932 |
++ goto error; |
933 |
+ |
934 |
+ switch (inb_p(HGA_STATUS_PORT) & 0x70) { |
935 |
+ case 0x10: |
936 |
+@@ -348,6 +346,12 @@ static int __init hga_card_detect(void) |
937 |
+ break; |
938 |
+ } |
939 |
+ return 1; |
940 |
++error: |
941 |
++ if (release_io_ports) |
942 |
++ release_region(0x3b0, 12); |
943 |
++ if (release_io_port) |
944 |
++ release_region(0x3bf, 1); |
945 |
++ return 0; |
946 |
+ } |
947 |
+ |
948 |
+ /** |
949 |
+diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c |
950 |
+index 08d0725..971b338 100644 |
951 |
+--- a/drivers/video/modedb.c |
952 |
++++ b/drivers/video/modedb.c |
953 |
+@@ -28,6 +28,7 @@ |
954 |
+ #endif |
955 |
+ |
956 |
+ const char *fb_mode_option; |
957 |
++EXPORT_SYMBOL_GPL(fb_mode_option); |
958 |
+ |
959 |
+ /* |
960 |
+ * Standard video mode definitions (taken from XFree86) |
961 |
+diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c |
962 |
+index a04b17e..b94fb5c 100644 |
963 |
+--- a/fs/cifs/cifsfs.c |
964 |
++++ b/fs/cifs/cifsfs.c |
965 |
+@@ -97,9 +97,6 @@ cifs_read_super(struct super_block *sb, void *data, |
966 |
+ { |
967 |
+ struct inode *inode; |
968 |
+ struct cifs_sb_info *cifs_sb; |
969 |
+-#ifdef CONFIG_CIFS_DFS_UPCALL |
970 |
+- int len; |
971 |
+-#endif |
972 |
+ int rc = 0; |
973 |
+ |
974 |
+ /* BB should we make this contingent on mount parm? */ |
975 |
+@@ -117,15 +114,17 @@ cifs_read_super(struct super_block *sb, void *data, |
976 |
+ * complex operation (mount), and in case of fail |
977 |
+ * just exit instead of doing mount and attempting |
978 |
+ * undo it if this copy fails?*/ |
979 |
+- len = strlen(data); |
980 |
+- cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL); |
981 |
+- if (cifs_sb->mountdata == NULL) { |
982 |
+- kfree(sb->s_fs_info); |
983 |
+- sb->s_fs_info = NULL; |
984 |
+- return -ENOMEM; |
985 |
++ if (data) { |
986 |
++ int len = strlen(data); |
987 |
++ cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL); |
988 |
++ if (cifs_sb->mountdata == NULL) { |
989 |
++ kfree(sb->s_fs_info); |
990 |
++ sb->s_fs_info = NULL; |
991 |
++ return -ENOMEM; |
992 |
++ } |
993 |
++ strncpy(cifs_sb->mountdata, data, len + 1); |
994 |
++ cifs_sb->mountdata[len] = '\0'; |
995 |
+ } |
996 |
+- strncpy(cifs_sb->mountdata, data, len + 1); |
997 |
+- cifs_sb->mountdata[len] = '\0'; |
998 |
+ #endif |
999 |
+ |
1000 |
+ rc = cifs_mount(sb, cifs_sb, data, devname); |
1001 |
+diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c |
1002 |
+index a066e10..086b312 100644 |
1003 |
+--- a/fs/ecryptfs/crypto.c |
1004 |
++++ b/fs/ecryptfs/crypto.c |
1005 |
+@@ -1907,9 +1907,9 @@ int ecryptfs_get_tfm_and_mutex_for_cipher_name(struct crypto_blkcipher **tfm, |
1006 |
+ goto out; |
1007 |
+ } |
1008 |
+ } |
1009 |
+- mutex_unlock(&key_tfm_list_mutex); |
1010 |
+ (*tfm) = key_tfm->key_tfm; |
1011 |
+ (*tfm_mutex) = &key_tfm->key_tfm_mutex; |
1012 |
+ out: |
1013 |
++ mutex_unlock(&key_tfm_list_mutex); |
1014 |
+ return rc; |
1015 |
+ } |
1016 |
+diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c |
1017 |
+index 2b8f5ed..2258b8f 100644 |
1018 |
+--- a/fs/ecryptfs/file.c |
1019 |
++++ b/fs/ecryptfs/file.c |
1020 |
+@@ -195,7 +195,9 @@ static int ecryptfs_open(struct inode *inode, struct file *file) |
1021 |
+ file, ecryptfs_inode_to_private(inode)->lower_file); |
1022 |
+ if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) { |
1023 |
+ ecryptfs_printk(KERN_DEBUG, "This is a directory\n"); |
1024 |
++ mutex_lock(&crypt_stat->cs_mutex); |
1025 |
+ crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED); |
1026 |
++ mutex_unlock(&crypt_stat->cs_mutex); |
1027 |
+ rc = 0; |
1028 |
+ goto out; |
1029 |
+ } |
1030 |
+diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c |
1031 |
+index e238611..a2174c2 100644 |
1032 |
+--- a/fs/ecryptfs/inode.c |
1033 |
++++ b/fs/ecryptfs/inode.c |
1034 |
+@@ -37,17 +37,11 @@ static struct dentry *lock_parent(struct dentry *dentry) |
1035 |
+ { |
1036 |
+ struct dentry *dir; |
1037 |
+ |
1038 |
+- dir = dget(dentry->d_parent); |
1039 |
++ dir = dget_parent(dentry); |
1040 |
+ mutex_lock_nested(&(dir->d_inode->i_mutex), I_MUTEX_PARENT); |
1041 |
+ return dir; |
1042 |
+ } |
1043 |
+ |
1044 |
+-static void unlock_parent(struct dentry *dentry) |
1045 |
+-{ |
1046 |
+- mutex_unlock(&(dentry->d_parent->d_inode->i_mutex)); |
1047 |
+- dput(dentry->d_parent); |
1048 |
+-} |
1049 |
+- |
1050 |
+ static void unlock_dir(struct dentry *dir) |
1051 |
+ { |
1052 |
+ mutex_unlock(&dir->d_inode->i_mutex); |
1053 |
+@@ -426,8 +420,9 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) |
1054 |
+ int rc = 0; |
1055 |
+ struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); |
1056 |
+ struct inode *lower_dir_inode = ecryptfs_inode_to_lower(dir); |
1057 |
++ struct dentry *lower_dir_dentry; |
1058 |
+ |
1059 |
+- lock_parent(lower_dentry); |
1060 |
++ lower_dir_dentry = lock_parent(lower_dentry); |
1061 |
+ rc = vfs_unlink(lower_dir_inode, lower_dentry); |
1062 |
+ if (rc) { |
1063 |
+ printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc); |
1064 |
+@@ -439,7 +434,7 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) |
1065 |
+ dentry->d_inode->i_ctime = dir->i_ctime; |
1066 |
+ d_drop(dentry); |
1067 |
+ out_unlock: |
1068 |
+- unlock_parent(lower_dentry); |
1069 |
++ unlock_dir(lower_dir_dentry); |
1070 |
+ return rc; |
1071 |
+ } |
1072 |
+ |
1073 |
+@@ -908,7 +903,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) |
1074 |
+ if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) |
1075 |
+ ia->ia_valid &= ~ATTR_MODE; |
1076 |
+ |
1077 |
++ mutex_lock(&lower_dentry->d_inode->i_mutex); |
1078 |
+ rc = notify_change(lower_dentry, ia); |
1079 |
++ mutex_unlock(&lower_dentry->d_inode->i_mutex); |
1080 |
+ out: |
1081 |
+ fsstack_copy_attr_all(inode, lower_inode, NULL); |
1082 |
+ return rc; |
1083 |
+diff --git a/fs/pipe.c b/fs/pipe.c |
1084 |
+index 8be381b..f73492b 100644 |
1085 |
+--- a/fs/pipe.c |
1086 |
++++ b/fs/pipe.c |
1087 |
+@@ -988,7 +988,10 @@ struct file *create_write_pipe(void) |
1088 |
+ return f; |
1089 |
+ |
1090 |
+ err_dentry: |
1091 |
++ free_pipe_info(inode); |
1092 |
+ dput(dentry); |
1093 |
++ return ERR_PTR(err); |
1094 |
++ |
1095 |
+ err_inode: |
1096 |
+ free_pipe_info(inode); |
1097 |
+ iput(inode); |
1098 |
+diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h |
1099 |
+index 83d1f28..fbb7f06 100644 |
1100 |
+--- a/include/asm-m68k/bitops.h |
1101 |
++++ b/include/asm-m68k/bitops.h |
1102 |
+@@ -410,8 +410,50 @@ static inline int ext2_find_next_zero_bit(const void *vaddr, unsigned size, |
1103 |
+ res = ext2_find_first_zero_bit (p, size - 32 * (p - addr)); |
1104 |
+ return (p - addr) * 32 + res; |
1105 |
+ } |
1106 |
+-#define ext2_find_next_bit(addr, size, off) \ |
1107 |
+- generic_find_next_le_bit((unsigned long *)(addr), (size), (off)) |
1108 |
++ |
1109 |
++static inline int ext2_find_first_bit(const void *vaddr, unsigned size) |
1110 |
++{ |
1111 |
++ const unsigned long *p = vaddr, *addr = vaddr; |
1112 |
++ int res; |
1113 |
++ |
1114 |
++ if (!size) |
1115 |
++ return 0; |
1116 |
++ |
1117 |
++ size = (size >> 5) + ((size & 31) > 0); |
1118 |
++ while (*p++ == 0UL) |
1119 |
++ { |
1120 |
++ if (--size == 0) |
1121 |
++ return (p - addr) << 5; |
1122 |
++ } |
1123 |
++ |
1124 |
++ --p; |
1125 |
++ for (res = 0; res < 32; res++) |
1126 |
++ if (ext2_test_bit(res, p)) |
1127 |
++ break; |
1128 |
++ return (p - addr) * 32 + res; |
1129 |
++} |
1130 |
++ |
1131 |
++static inline int ext2_find_next_bit(const void *vaddr, unsigned size, |
1132 |
++ unsigned offset) |
1133 |
++{ |
1134 |
++ const unsigned long *addr = vaddr; |
1135 |
++ const unsigned long *p = addr + (offset >> 5); |
1136 |
++ int bit = offset & 31UL, res; |
1137 |
++ |
1138 |
++ if (offset >= size) |
1139 |
++ return size; |
1140 |
++ |
1141 |
++ if (bit) { |
1142 |
++ /* Look for one in first longword */ |
1143 |
++ for (res = bit; res < 32; res++) |
1144 |
++ if (ext2_test_bit(res, p)) |
1145 |
++ return (p - addr) * 32 + res; |
1146 |
++ p++; |
1147 |
++ } |
1148 |
++ /* No set bit yet, search remaining full bytes for a set bit */ |
1149 |
++ res = ext2_find_first_bit(p, size - 32 * (p - addr)); |
1150 |
++ return (p - addr) * 32 + res; |
1151 |
++} |
1152 |
+ |
1153 |
+ #endif /* __KERNEL__ */ |
1154 |
+ |
1155 |
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h |
1156 |
+index 70eb3c8..f624e7c 100644 |
1157 |
+--- a/include/linux/pci_ids.h |
1158 |
++++ b/include/linux/pci_ids.h |
1159 |
+@@ -716,6 +716,7 @@ |
1160 |
+ #define PCI_DEVICE_ID_HP_CISSA 0x3220 |
1161 |
+ #define PCI_DEVICE_ID_HP_CISSC 0x3230 |
1162 |
+ #define PCI_DEVICE_ID_HP_CISSD 0x3238 |
1163 |
++#define PCI_DEVICE_ID_HP_CISSE 0x323a |
1164 |
+ #define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 |
1165 |
+ |
1166 |
+ #define PCI_VENDOR_ID_PCTECH 0x1042 |
1167 |
+diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h |
1168 |
+index 9903394..7552731 100644 |
1169 |
+--- a/include/media/videobuf-core.h |
1170 |
++++ b/include/media/videobuf-core.h |
1171 |
+@@ -227,6 +227,9 @@ unsigned int videobuf_poll_stream(struct file *file, |
1172 |
+ int videobuf_mmap_setup(struct videobuf_queue *q, |
1173 |
+ unsigned int bcount, unsigned int bsize, |
1174 |
+ enum v4l2_memory memory); |
1175 |
++int __videobuf_mmap_setup(struct videobuf_queue *q, |
1176 |
++ unsigned int bcount, unsigned int bsize, |
1177 |
++ enum v4l2_memory memory); |
1178 |
+ int videobuf_mmap_free(struct videobuf_queue *q); |
1179 |
+ int videobuf_mmap_mapper(struct videobuf_queue *q, |
1180 |
+ struct vm_area_struct *vma); |
1181 |
+diff --git a/include/net/netlink.h b/include/net/netlink.h |
1182 |
+index a5506c4..112dcdf 100644 |
1183 |
+--- a/include/net/netlink.h |
1184 |
++++ b/include/net/netlink.h |
1185 |
+@@ -772,12 +772,13 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype, |
1186 |
+ const struct nla_policy *policy, |
1187 |
+ int len) |
1188 |
+ { |
1189 |
+- if (nla_len(nla) < len) |
1190 |
++ int nested_len = nla_len(nla) - NLA_ALIGN(len); |
1191 |
++ |
1192 |
++ if (nested_len < 0) |
1193 |
+ return -1; |
1194 |
+- if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr)) |
1195 |
+- return nla_parse_nested(tb, maxtype, |
1196 |
+- nla_data(nla) + NLA_ALIGN(len), |
1197 |
+- policy); |
1198 |
++ if (nested_len >= nla_attr_size(0)) |
1199 |
++ return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len), |
1200 |
++ nested_len, policy); |
1201 |
+ memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); |
1202 |
+ return 0; |
1203 |
+ } |
1204 |
+diff --git a/init/Kconfig b/init/Kconfig |
1205 |
+index a97924b..021476f 100644 |
1206 |
+--- a/init/Kconfig |
1207 |
++++ b/init/Kconfig |
1208 |
+@@ -13,6 +13,7 @@ config DEFCONFIG_LIST |
1209 |
+ default "/lib/modules/$UNAME_RELEASE/.config" |
1210 |
+ default "/etc/kernel-config" |
1211 |
+ default "/boot/config-$UNAME_RELEASE" |
1212 |
++ default "$ARCH_DEFCONFIG" |
1213 |
+ default "arch/$ARCH/defconfig" |
1214 |
+ |
1215 |
+ menu "General setup" |
1216 |
+diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c |
1217 |
+index b33410a..c0bac6d 100644 |
1218 |
+--- a/net/8021q/vlan.c |
1219 |
++++ b/net/8021q/vlan.c |
1220 |
+@@ -397,10 +397,8 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, |
1221 |
+ if (dev->nd_net != &init_net) |
1222 |
+ return NOTIFY_DONE; |
1223 |
+ |
1224 |
+- if (is_vlan_dev(dev)) { |
1225 |
++ if (is_vlan_dev(dev)) |
1226 |
+ __vlan_device_event(dev, event); |
1227 |
+- goto out; |
1228 |
+- } |
1229 |
+ |
1230 |
+ grp = __vlan_find_group(dev->ifindex); |
1231 |
+ if (!grp) |
1232 |
+diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c |
1233 |
+index d8f2157..034aa10 100644 |
1234 |
+--- a/net/ax25/ax25_subr.c |
1235 |
++++ b/net/ax25/ax25_subr.c |
1236 |
+@@ -64,20 +64,15 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr) |
1237 |
+ |
1238 |
+ void ax25_requeue_frames(ax25_cb *ax25) |
1239 |
+ { |
1240 |
+- struct sk_buff *skb, *skb_prev = NULL; |
1241 |
++ struct sk_buff *skb; |
1242 |
+ |
1243 |
+ /* |
1244 |
+ * Requeue all the un-ack-ed frames on the output queue to be picked |
1245 |
+ * up by ax25_kick called from the timer. This arrangement handles the |
1246 |
+ * possibility of an empty output queue. |
1247 |
+ */ |
1248 |
+- while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) { |
1249 |
+- if (skb_prev == NULL) |
1250 |
+- skb_queue_head(&ax25->write_queue, skb); |
1251 |
+- else |
1252 |
+- skb_append(skb_prev, skb, &ax25->write_queue); |
1253 |
+- skb_prev = skb; |
1254 |
+- } |
1255 |
++ while ((skb = skb_dequeue_tail(&ax25->ack_queue)) != NULL) |
1256 |
++ skb_queue_head(&ax25->write_queue, skb); |
1257 |
+ } |
1258 |
+ |
1259 |
+ /* |
1260 |
+diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c |
1261 |
+index eb62558..0c2c937 100644 |
1262 |
+--- a/net/bluetooth/rfcomm/core.c |
1263 |
++++ b/net/bluetooth/rfcomm/core.c |
1264 |
+@@ -423,8 +423,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err) |
1265 |
+ |
1266 |
+ rfcomm_dlc_lock(d); |
1267 |
+ d->state = BT_CLOSED; |
1268 |
+- rfcomm_dlc_unlock(d); |
1269 |
+ d->state_change(d, err); |
1270 |
++ rfcomm_dlc_unlock(d); |
1271 |
+ |
1272 |
+ skb_queue_purge(&d->tx_queue); |
1273 |
+ rfcomm_dlc_unlink(d); |
1274 |
+diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c |
1275 |
+index c3f749a..c919187 100644 |
1276 |
+--- a/net/bluetooth/rfcomm/tty.c |
1277 |
++++ b/net/bluetooth/rfcomm/tty.c |
1278 |
+@@ -566,11 +566,22 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) |
1279 |
+ if (dlc->state == BT_CLOSED) { |
1280 |
+ if (!dev->tty) { |
1281 |
+ if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) { |
1282 |
+- if (rfcomm_dev_get(dev->id) == NULL) |
1283 |
++ /* Drop DLC lock here to avoid deadlock |
1284 |
++ * 1. rfcomm_dev_get will take rfcomm_dev_lock |
1285 |
++ * but in rfcomm_dev_add there's lock order: |
1286 |
++ * rfcomm_dev_lock -> dlc lock |
1287 |
++ * 2. rfcomm_dev_put will deadlock if it's |
1288 |
++ * the last reference |
1289 |
++ */ |
1290 |
++ rfcomm_dlc_unlock(dlc); |
1291 |
++ if (rfcomm_dev_get(dev->id) == NULL) { |
1292 |
++ rfcomm_dlc_lock(dlc); |
1293 |
+ return; |
1294 |
++ } |
1295 |
+ |
1296 |
+ rfcomm_dev_del(dev); |
1297 |
+ rfcomm_dev_put(dev); |
1298 |
++ rfcomm_dlc_lock(dlc); |
1299 |
+ } |
1300 |
+ } else |
1301 |
+ tty_hangup(dev->tty); |
1302 |
+diff --git a/net/can/raw.c b/net/can/raw.c |
1303 |
+index c92cb8e..da26bbb 100644 |
1304 |
+--- a/net/can/raw.c |
1305 |
++++ b/net/can/raw.c |
1306 |
+@@ -435,15 +435,13 @@ static int raw_setsockopt(struct socket *sock, int level, int optname, |
1307 |
+ if (!filter) |
1308 |
+ return -ENOMEM; |
1309 |
+ |
1310 |
+- err = copy_from_user(filter, optval, optlen); |
1311 |
+- if (err) { |
1312 |
++ if (copy_from_user(filter, optval, optlen)) { |
1313 |
+ kfree(filter); |
1314 |
+- return err; |
1315 |
++ return -EFAULT; |
1316 |
+ } |
1317 |
+ } else if (count == 1) { |
1318 |
+- err = copy_from_user(&sfilter, optval, optlen); |
1319 |
+- if (err) |
1320 |
+- return err; |
1321 |
++ if (copy_from_user(&sfilter, optval, optlen)) |
1322 |
++ return -EFAULT; |
1323 |
+ } |
1324 |
+ |
1325 |
+ lock_sock(sk); |
1326 |
+@@ -493,9 +491,8 @@ static int raw_setsockopt(struct socket *sock, int level, int optname, |
1327 |
+ if (optlen != sizeof(err_mask)) |
1328 |
+ return -EINVAL; |
1329 |
+ |
1330 |
+- err = copy_from_user(&err_mask, optval, optlen); |
1331 |
+- if (err) |
1332 |
+- return err; |
1333 |
++ if (copy_from_user(&err_mask, optval, optlen)) |
1334 |
++ return -EFAULT; |
1335 |
+ |
1336 |
+ err_mask &= CAN_ERR_MASK; |
1337 |
+ |
1338 |
+@@ -531,7 +528,8 @@ static int raw_setsockopt(struct socket *sock, int level, int optname, |
1339 |
+ if (optlen != sizeof(ro->loopback)) |
1340 |
+ return -EINVAL; |
1341 |
+ |
1342 |
+- err = copy_from_user(&ro->loopback, optval, optlen); |
1343 |
++ if (copy_from_user(&ro->loopback, optval, optlen)) |
1344 |
++ return -EFAULT; |
1345 |
+ |
1346 |
+ break; |
1347 |
+ |
1348 |
+@@ -539,7 +537,8 @@ static int raw_setsockopt(struct socket *sock, int level, int optname, |
1349 |
+ if (optlen != sizeof(ro->recv_own_msgs)) |
1350 |
+ return -EINVAL; |
1351 |
+ |
1352 |
+- err = copy_from_user(&ro->recv_own_msgs, optval, optlen); |
1353 |
++ if (copy_from_user(&ro->recv_own_msgs, optval, optlen)) |
1354 |
++ return -EFAULT; |
1355 |
+ |
1356 |
+ break; |
1357 |
+ |
1358 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
1359 |
+index 460e7f9..37ffd7a 100644 |
1360 |
+--- a/net/core/dev.c |
1361 |
++++ b/net/core/dev.c |
1362 |
+@@ -3132,7 +3132,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags) |
1363 |
+ * Load in the correct multicast list now the flags have changed. |
1364 |
+ */ |
1365 |
+ |
1366 |
+- if (dev->change_rx_flags && (dev->flags ^ flags) & IFF_MULTICAST) |
1367 |
++ if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST) |
1368 |
+ dev->change_rx_flags(dev, IFF_MULTICAST); |
1369 |
+ |
1370 |
+ dev_set_rx_mode(dev); |
1371 |
+diff --git a/net/ipv4/route.c b/net/ipv4/route.c |
1372 |
+index 7b5e8e1..d39cf9f 100644 |
1373 |
+--- a/net/ipv4/route.c |
1374 |
++++ b/net/ipv4/route.c |
1375 |
+@@ -162,7 +162,7 @@ static struct dst_ops ipv4_dst_ops = { |
1376 |
+ .negative_advice = ipv4_negative_advice, |
1377 |
+ .link_failure = ipv4_link_failure, |
1378 |
+ .update_pmtu = ip_rt_update_pmtu, |
1379 |
+- .local_out = ip_local_out, |
1380 |
++ .local_out = __ip_local_out, |
1381 |
+ .entry_size = sizeof(struct rtable), |
1382 |
+ .entries = ATOMIC_INIT(0), |
1383 |
+ }; |
1384 |
+diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c |
1385 |
+index 3a6be23..fde7146 100644 |
1386 |
+--- a/net/ipv4/tcp_cong.c |
1387 |
++++ b/net/ipv4/tcp_cong.c |
1388 |
+@@ -285,14 +285,12 @@ int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight) |
1389 |
+ if (in_flight >= tp->snd_cwnd) |
1390 |
+ return 1; |
1391 |
+ |
1392 |
+- if (!sk_can_gso(sk)) |
1393 |
+- return 0; |
1394 |
+- |
1395 |
+ left = tp->snd_cwnd - in_flight; |
1396 |
+- if (sysctl_tcp_tso_win_divisor) |
1397 |
+- return left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd; |
1398 |
+- else |
1399 |
+- return left <= tcp_max_burst(tp); |
1400 |
++ if (sk_can_gso(sk) && |
1401 |
++ left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd && |
1402 |
++ left * tp->mss_cache < 65536) |
1403 |
++ return 1; |
1404 |
++ return left <= tcp_max_burst(tp); |
1405 |
+ } |
1406 |
+ EXPORT_SYMBOL_GPL(tcp_is_cwnd_limited); |
1407 |
+ |
1408 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
1409 |
+index bbb7d88..3180963 100644 |
1410 |
+--- a/net/ipv4/tcp_input.c |
1411 |
++++ b/net/ipv4/tcp_input.c |
1412 |
+@@ -113,8 +113,6 @@ int sysctl_tcp_abc __read_mostly; |
1413 |
+ #define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED) |
1414 |
+ #define FLAG_ANY_PROGRESS (FLAG_FORWARD_PROGRESS|FLAG_SND_UNA_ADVANCED) |
1415 |
+ |
1416 |
+-#define IsSackFrto() (sysctl_tcp_frto == 0x2) |
1417 |
+- |
1418 |
+ #define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH) |
1419 |
+ #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH)) |
1420 |
+ |
1421 |
+@@ -1393,9 +1391,9 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct sk_buff *skb, |
1422 |
+ |
1423 |
+ if (before(next_dup->start_seq, skip_to_seq)) { |
1424 |
+ skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq, fack_count); |
1425 |
+- tcp_sacktag_walk(skb, sk, NULL, |
1426 |
+- next_dup->start_seq, next_dup->end_seq, |
1427 |
+- 1, fack_count, reord, flag); |
1428 |
++ skb = tcp_sacktag_walk(skb, sk, NULL, |
1429 |
++ next_dup->start_seq, next_dup->end_seq, |
1430 |
++ 1, fack_count, reord, flag); |
1431 |
+ } |
1432 |
+ |
1433 |
+ return skb; |
1434 |
+@@ -1685,6 +1683,11 @@ static inline void tcp_reset_reno_sack(struct tcp_sock *tp) |
1435 |
+ tp->sacked_out = 0; |
1436 |
+ } |
1437 |
+ |
1438 |
++static int tcp_is_sackfrto(const struct tcp_sock *tp) |
1439 |
++{ |
1440 |
++ return (sysctl_tcp_frto == 0x2) && !tcp_is_reno(tp); |
1441 |
++} |
1442 |
++ |
1443 |
+ /* F-RTO can only be used if TCP has never retransmitted anything other than |
1444 |
+ * head (SACK enhanced variant from Appendix B of RFC4138 is more robust here) |
1445 |
+ */ |
1446 |
+@@ -1701,7 +1704,7 @@ int tcp_use_frto(struct sock *sk) |
1447 |
+ if (icsk->icsk_mtup.probe_size) |
1448 |
+ return 0; |
1449 |
+ |
1450 |
+- if (IsSackFrto()) |
1451 |
++ if (tcp_is_sackfrto(tp)) |
1452 |
+ return 1; |
1453 |
+ |
1454 |
+ /* Avoid expensive walking of rexmit queue if possible */ |
1455 |
+@@ -1791,7 +1794,7 @@ void tcp_enter_frto(struct sock *sk) |
1456 |
+ /* Earlier loss recovery underway (see RFC4138; Appendix B). |
1457 |
+ * The last condition is necessary at least in tp->frto_counter case. |
1458 |
+ */ |
1459 |
+- if (IsSackFrto() && (tp->frto_counter || |
1460 |
++ if (tcp_is_sackfrto(tp) && (tp->frto_counter || |
1461 |
+ ((1 << icsk->icsk_ca_state) & (TCPF_CA_Recovery|TCPF_CA_Loss))) && |
1462 |
+ after(tp->high_seq, tp->snd_una)) { |
1463 |
+ tp->frto_highmark = tp->high_seq; |
1464 |
+@@ -1838,9 +1841,16 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag) |
1465 |
+ TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS; |
1466 |
+ } |
1467 |
+ |
1468 |
+- /* Don't lost mark skbs that were fwd transmitted after RTO */ |
1469 |
+- if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED) && |
1470 |
+- !after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark)) { |
1471 |
++ /* Marking forward transmissions that were made after RTO lost |
1472 |
++ * can cause unnecessary retransmissions in some scenarios, |
1473 |
++ * SACK blocks will mitigate that in some but not in all cases. |
1474 |
++ * We used to not mark them but it was causing break-ups with |
1475 |
++ * receivers that do only in-order receival. |
1476 |
++ * |
1477 |
++ * TODO: we could detect presence of such receiver and select |
1478 |
++ * different behavior per flow. |
1479 |
++ */ |
1480 |
++ if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) { |
1481 |
+ TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; |
1482 |
+ tp->lost_out += tcp_skb_pcount(skb); |
1483 |
+ } |
1484 |
+@@ -1856,7 +1866,7 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag) |
1485 |
+ tp->reordering = min_t(unsigned int, tp->reordering, |
1486 |
+ sysctl_tcp_reordering); |
1487 |
+ tcp_set_ca_state(sk, TCP_CA_Loss); |
1488 |
+- tp->high_seq = tp->frto_highmark; |
1489 |
++ tp->high_seq = tp->snd_nxt; |
1490 |
+ TCP_ECN_queue_cwr(tp); |
1491 |
+ |
1492 |
+ tcp_clear_retrans_hints_partial(tp); |
1493 |
+@@ -2459,28 +2469,34 @@ static inline void tcp_complete_cwr(struct sock *sk) |
1494 |
+ tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR); |
1495 |
+ } |
1496 |
+ |
1497 |
++static void tcp_try_keep_open(struct sock *sk) |
1498 |
++{ |
1499 |
++ struct tcp_sock *tp = tcp_sk(sk); |
1500 |
++ int state = TCP_CA_Open; |
1501 |
++ |
1502 |
++ if (tcp_left_out(tp) || tp->retrans_out || tp->undo_marker) |
1503 |
++ state = TCP_CA_Disorder; |
1504 |
++ |
1505 |
++ if (inet_csk(sk)->icsk_ca_state != state) { |
1506 |
++ tcp_set_ca_state(sk, state); |
1507 |
++ tp->high_seq = tp->snd_nxt; |
1508 |
++ } |
1509 |
++} |
1510 |
++ |
1511 |
+ static void tcp_try_to_open(struct sock *sk, int flag) |
1512 |
+ { |
1513 |
+ struct tcp_sock *tp = tcp_sk(sk); |
1514 |
+ |
1515 |
+ tcp_verify_left_out(tp); |
1516 |
+ |
1517 |
+- if (tp->retrans_out == 0) |
1518 |
++ if (!tp->frto_counter && tp->retrans_out == 0) |
1519 |
+ tp->retrans_stamp = 0; |
1520 |
+ |
1521 |
+ if (flag & FLAG_ECE) |
1522 |
+ tcp_enter_cwr(sk, 1); |
1523 |
+ |
1524 |
+ if (inet_csk(sk)->icsk_ca_state != TCP_CA_CWR) { |
1525 |
+- int state = TCP_CA_Open; |
1526 |
+- |
1527 |
+- if (tcp_left_out(tp) || tp->retrans_out || tp->undo_marker) |
1528 |
+- state = TCP_CA_Disorder; |
1529 |
+- |
1530 |
+- if (inet_csk(sk)->icsk_ca_state != state) { |
1531 |
+- tcp_set_ca_state(sk, state); |
1532 |
+- tp->high_seq = tp->snd_nxt; |
1533 |
+- } |
1534 |
++ tcp_try_keep_open(sk); |
1535 |
+ tcp_moderate_cwnd(tp); |
1536 |
+ } else { |
1537 |
+ tcp_cwnd_down(sk, flag); |
1538 |
+@@ -3110,7 +3126,7 @@ static int tcp_process_frto(struct sock *sk, int flag) |
1539 |
+ return 1; |
1540 |
+ } |
1541 |
+ |
1542 |
+- if (!IsSackFrto() || tcp_is_reno(tp)) { |
1543 |
++ if (!tcp_is_sackfrto(tp)) { |
1544 |
+ /* RFC4138 shortcoming in step 2; should also have case c): |
1545 |
+ * ACK isn't duplicate nor advances window, e.g., opposite dir |
1546 |
+ * data, winupdate |
1547 |
+@@ -3286,8 +3302,11 @@ no_queue: |
1548 |
+ return 1; |
1549 |
+ |
1550 |
+ old_ack: |
1551 |
+- if (TCP_SKB_CB(skb)->sacked) |
1552 |
++ if (TCP_SKB_CB(skb)->sacked) { |
1553 |
+ tcp_sacktag_write_queue(sk, skb, prior_snd_una); |
1554 |
++ if (icsk->icsk_ca_state == TCP_CA_Open) |
1555 |
++ tcp_try_keep_open(sk); |
1556 |
++ } |
1557 |
+ |
1558 |
+ uninteresting_ack: |
1559 |
+ SOCK_DEBUG(sk, "Ack %u out of %u:%u\n", ack, tp->snd_una, tp->snd_nxt); |
1560 |
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c |
1561 |
+index d29ef79..6c3d8a1 100644 |
1562 |
+--- a/net/ipv4/tcp_output.c |
1563 |
++++ b/net/ipv4/tcp_output.c |
1564 |
+@@ -1836,7 +1836,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) |
1565 |
+ { |
1566 |
+ struct tcp_sock *tp = tcp_sk(sk); |
1567 |
+ struct inet_connection_sock *icsk = inet_csk(sk); |
1568 |
+- unsigned int cur_mss = tcp_current_mss(sk, 0); |
1569 |
++ unsigned int cur_mss; |
1570 |
+ int err; |
1571 |
+ |
1572 |
+ /* Inconslusive MTU probe */ |
1573 |
+@@ -1858,6 +1858,11 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) |
1574 |
+ return -ENOMEM; |
1575 |
+ } |
1576 |
+ |
1577 |
++ if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) |
1578 |
++ return -EHOSTUNREACH; /* Routing failure or similar. */ |
1579 |
++ |
1580 |
++ cur_mss = tcp_current_mss(sk, 0); |
1581 |
++ |
1582 |
+ /* If receiver has shrunk his window, and skb is out of |
1583 |
+ * new window, do not retransmit it. The exception is the |
1584 |
+ * case, when window is shrunk to zero. In this case |
1585 |
+@@ -1884,9 +1889,6 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) |
1586 |
+ (sysctl_tcp_retrans_collapse != 0)) |
1587 |
+ tcp_retrans_try_collapse(sk, skb, cur_mss); |
1588 |
+ |
1589 |
+- if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) |
1590 |
+- return -EHOSTUNREACH; /* Routing failure or similar. */ |
1591 |
+- |
1592 |
+ /* Some Solaris stacks overoptimize and ignore the FIN on a |
1593 |
+ * retransmit when old data is attached. So strip it off |
1594 |
+ * since it is cheap to do so and saves bytes on the network. |
1595 |
+diff --git a/net/ipv6/route.c b/net/ipv6/route.c |
1596 |
+index e8b241c..f95745f 100644 |
1597 |
+--- a/net/ipv6/route.c |
1598 |
++++ b/net/ipv6/route.c |
1599 |
+@@ -105,7 +105,7 @@ static struct dst_ops ip6_dst_ops = { |
1600 |
+ .negative_advice = ip6_negative_advice, |
1601 |
+ .link_failure = ip6_link_failure, |
1602 |
+ .update_pmtu = ip6_rt_update_pmtu, |
1603 |
+- .local_out = ip6_local_out, |
1604 |
++ .local_out = __ip6_local_out, |
1605 |
+ .entry_size = sizeof(struct rt6_info), |
1606 |
+ .entries = ATOMIC_INIT(0), |
1607 |
+ }; |
1608 |
+diff --git a/net/key/af_key.c b/net/key/af_key.c |
1609 |
+index 5ceab25..11c42e3 100644 |
1610 |
+--- a/net/key/af_key.c |
1611 |
++++ b/net/key/af_key.c |
1612 |
+@@ -1219,7 +1219,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr, |
1613 |
+ x->sel.prefixlen_s = addr->sadb_address_prefixlen; |
1614 |
+ } |
1615 |
+ |
1616 |
+- if (x->props.mode == XFRM_MODE_TRANSPORT) |
1617 |
++ if (!x->sel.family) |
1618 |
+ x->sel.family = x->props.family; |
1619 |
+ |
1620 |
+ if (ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1]) { |
1621 |
+diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c |
1622 |
+index c170685..7d5c263 100644 |
1623 |
+--- a/net/mac80211/ieee80211_sta.c |
1624 |
++++ b/net/mac80211/ieee80211_sta.c |
1625 |
+@@ -2723,6 +2723,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, |
1626 |
+ struct rate_selection ratesel; |
1627 |
+ u8 *pos; |
1628 |
+ struct ieee80211_sub_if_data *sdata; |
1629 |
++ union iwreq_data wrqu; |
1630 |
+ |
1631 |
+ /* Remove possible STA entries from other IBSS networks. */ |
1632 |
+ sta_info_flush(local, NULL); |
1633 |
+@@ -2863,6 +2864,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, |
1634 |
+ |
1635 |
+ ieee80211_rx_bss_put(dev, bss); |
1636 |
+ |
1637 |
++ memset(&wrqu, 0, sizeof(wrqu)); |
1638 |
++ memcpy(wrqu.ap_addr.sa_data, bss->bssid, ETH_ALEN); |
1639 |
++ wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL); |
1640 |
++ |
1641 |
+ return res; |
1642 |
+ } |
1643 |
+ |
1644 |
+diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c |
1645 |
+index 0fbedca..855c33c 100644 |
1646 |
+--- a/net/sched/cls_api.c |
1647 |
++++ b/net/sched/cls_api.c |
1648 |
+@@ -220,7 +220,7 @@ replay: |
1649 |
+ tp = kzalloc(sizeof(*tp), GFP_KERNEL); |
1650 |
+ if (tp == NULL) |
1651 |
+ goto errout; |
1652 |
+- err = -EINVAL; |
1653 |
++ err = -ENOENT; |
1654 |
+ tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND]); |
1655 |
+ if (tp_ops == NULL) { |
1656 |
+ #ifdef CONFIG_KMOD |
1657 |
+diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c |
1658 |
+index 9a9b977..d0330d8 100644 |
1659 |
+--- a/sound/pci/emu10k1/emu10k1_main.c |
1660 |
++++ b/sound/pci/emu10k1/emu10k1_main.c |
1661 |
+@@ -1817,13 +1817,6 @@ int __devinit snd_emu10k1_create(struct snd_card *card, |
1662 |
+ } |
1663 |
+ emu->port = pci_resource_start(pci, 0); |
1664 |
+ |
1665 |
+- if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED, |
1666 |
+- "EMU10K1", emu)) { |
1667 |
+- err = -EBUSY; |
1668 |
+- goto error; |
1669 |
+- } |
1670 |
+- emu->irq = pci->irq; |
1671 |
+- |
1672 |
+ emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT; |
1673 |
+ if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), |
1674 |
+ 32 * 1024, &emu->ptb_pages) < 0) { |
1675 |
+@@ -1886,6 +1879,14 @@ int __devinit snd_emu10k1_create(struct snd_card *card, |
1676 |
+ emu->fx8010.etram_pages.area = NULL; |
1677 |
+ emu->fx8010.etram_pages.bytes = 0; |
1678 |
+ |
1679 |
++ /* irq handler must be registered after I/O ports are activated */ |
1680 |
++ if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED, |
1681 |
++ "EMU10K1", emu)) { |
1682 |
++ err = -EBUSY; |
1683 |
++ goto error; |
1684 |
++ } |
1685 |
++ emu->irq = pci->irq; |
1686 |
++ |
1687 |
+ /* |
1688 |
+ * Init to 0x02109204 : |
1689 |
+ * Clock accuracy = 0 (1000ppm) |
1690 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
1691 |
+index 33282f9..52a7f0f 100644 |
1692 |
+--- a/sound/pci/hda/patch_realtek.c |
1693 |
++++ b/sound/pci/hda/patch_realtek.c |
1694 |
+@@ -940,7 +940,6 @@ do_sku: |
1695 |
+ AC_VERB_SET_UNSOLICITED_ENABLE, |
1696 |
+ AC_USRSP_EN | ALC880_HP_EVENT); |
1697 |
+ spec->unsol_event = alc_sku_unsol_event; |
1698 |
+- spec->init_hook = alc_sku_automute; |
1699 |
+ } |
1700 |
+ |
1701 |
+ /* |
1702 |
|
1703 |
-- |
1704 |
gentoo-commits@l.g.o mailing list |