Gentoo Archives: gentoo-commits

From: "Daniel Drake (dsd)" <dsd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1329 - genpatches-2.6/trunk/2.6.26
Date: Thu, 17 Jul 2008 02:48:11
Message-Id: E1KJJX5-0008O9-Dj@stork.gentoo.org
1 Author: dsd
2 Date: 2008-07-17 02:47:50 +0000 (Thu, 17 Jul 2008)
3 New Revision: 1329
4
5 Removed:
6 genpatches-2.6/trunk/2.6.26/1000_linux-2.6.25.1.patch
7 genpatches-2.6/trunk/2.6.26/1001_linux-2.6.25.2.patch
8 genpatches-2.6/trunk/2.6.26/1002_linux-2.6.25.3.patch
9 genpatches-2.6/trunk/2.6.26/1003_linux-2.6.25.4.patch
10 genpatches-2.6/trunk/2.6.26/1004_linux-2.6.25.5.patch
11 genpatches-2.6/trunk/2.6.26/1005_linux-2.6.25.6.patch
12 genpatches-2.6/trunk/2.6.26/1006_linux-2.6.25.7.patch
13 genpatches-2.6/trunk/2.6.26/1007_linux-2.6.25.8.patch
14 genpatches-2.6/trunk/2.6.26/1008_linux-2.6.25.9.patch
15 genpatches-2.6/trunk/2.6.26/2705_alsa-hda-fujitsu.patch
16 genpatches-2.6/trunk/2.6.26/2710_ssa7134-tuner-type-setup.patch
17 Modified:
18 genpatches-2.6/trunk/2.6.26/0000_README
19 Log:
20 remove merged patches
21
22 Modified: genpatches-2.6/trunk/2.6.26/0000_README
23 ===================================================================
24 --- genpatches-2.6/trunk/2.6.26/0000_README 2008-07-17 02:44:10 UTC (rev 1328)
25 +++ genpatches-2.6/trunk/2.6.26/0000_README 2008-07-17 02:47:50 UTC (rev 1329)
26 @@ -39,54 +39,10 @@
27 Individual Patch Descriptions:
28 --------------------------------------------------------------------------
29
30 -Patch: 1000_linux-2.6.25.1.patch
31 -From: http://www.kernel.org
32 -Desc: Linux 2.6.25.1
33 -
34 -Patch: 1001_linux-2.6.25.2.patch
35 -From: http://www.kernel.org
36 -Desc: fcntl security fix
37 -
38 -Patch: 1002_linux-2.6.25.3.patch
39 -From: http://www.kernel.org
40 -Desc: Linux 2.6.25.3
41 -
42 -Patch: 1003_linux-2.6.25.4.patch
43 -From: http://www.kernel.org
44 -Desc: Linux 2.6.25.4
45 -
46 -Patch: 1004_linux-2.6.25.5.patch
47 -From: http://www.kernel.org
48 -Desc: Linux 2.6.25.5
49 -
50 -Patch: 1005_linux-2.6.25.6.patch
51 -From: http://www.kernel.org
52 -Desc: Linux 2.6.25.6
53 -
54 -Patch: 1006_linux-2.6.25.7.patch
55 -From: http://www.kernel.org
56 -Desc: Linux 2.6.25.7
57 -
58 -Patch: 1007_linux-2.6.25.8.patch
59 -From: http://www.kernel.org
60 -Desc: Linux 2.6.25.8
61 -
62 -Patch: 1008_linux-2.6.25.9.patch
63 -From: http://www.kernel.org
64 -Desc: Linux 2.6.25.9
65 -
66 Patch: 2600_evdev-compat-ioctl-force-feedback.patch
67 From: http://bugs.gentoo.org/214700
68 Desc: Fix evdev force feedback in 32-bit compat mode
69
70 -Patch: 2705_alsa-hda-fujitsu.patch
71 -From: Tony Vroon <chainsaw@g.o>
72 -Desc: Fix docking station headphone port and PC speaker for Fujitsu ALC262
73 -
74 -Patch: 2710_ssa7134-tuner-type-setup.patch
75 -From: http://bugs.gentoo.org/show_bug.cgi?id=231451
76 -Desc: Removes tuner type setup from saa7134-i2c
77 -
78 Patch: 4105_dm-bbr.patch
79 From: EVMS 2.5.2
80 Desc: Bad block relocation support for LiveCD users
81
82 Deleted: genpatches-2.6/trunk/2.6.26/1000_linux-2.6.25.1.patch
83 ===================================================================
84 --- genpatches-2.6/trunk/2.6.26/1000_linux-2.6.25.1.patch 2008-07-17 02:44:10 UTC (rev 1328)
85 +++ genpatches-2.6/trunk/2.6.26/1000_linux-2.6.25.1.patch 2008-07-17 02:47:50 UTC (rev 1329)
86 @@ -1,1145 +0,0 @@
87 -diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
88 -index 8c71daf..9fee37e 100644
89 ---- a/arch/alpha/kernel/osf_sys.c
90 -+++ b/arch/alpha/kernel/osf_sys.c
91 -@@ -75,6 +75,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
92 - lock_kernel();
93 - mm = current->mm;
94 - mm->end_code = bss_start + bss_len;
95 -+ mm->start_brk = bss_start + bss_len;
96 - mm->brk = bss_start + bss_len;
97 - #if 0
98 - printk("set_program_attributes(%lx %lx %lx %lx)\n",
99 -diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
100 -index 4ca5486..f239b30 100644
101 ---- a/arch/x86/kernel/io_apic_32.c
102 -+++ b/arch/x86/kernel/io_apic_32.c
103 -@@ -2477,6 +2477,7 @@ void destroy_irq(unsigned int irq)
104 - dynamic_irq_cleanup(irq);
105 -
106 - spin_lock_irqsave(&vector_lock, flags);
107 -+ clear_bit(irq_vector[irq], used_vectors);
108 - irq_vector[irq] = 0;
109 - spin_unlock_irqrestore(&vector_lock, flags);
110 - }
111 -diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
112 -index a871586..579745c 100644
113 ---- a/arch/x86/pci/irq.c
114 -+++ b/arch/x86/pci/irq.c
115 -@@ -200,7 +200,7 @@ static int pirq_ali_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
116 - {
117 - static const unsigned char irqmap[16] = { 0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15 };
118 -
119 -- WARN_ON_ONCE(pirq >= 16);
120 -+ WARN_ON_ONCE(pirq > 16);
121 - return irqmap[read_config_nybble(router, 0x48, pirq-1)];
122 - }
123 -
124 -@@ -209,7 +209,7 @@ static int pirq_ali_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i
125 - static const unsigned char irqmap[16] = { 0, 8, 0, 2, 4, 5, 7, 6, 0, 1, 3, 9, 11, 0, 13, 15 };
126 - unsigned int val = irqmap[irq];
127 -
128 -- WARN_ON_ONCE(pirq >= 16);
129 -+ WARN_ON_ONCE(pirq > 16);
130 - if (val) {
131 - write_config_nybble(router, 0x48, pirq-1, val);
132 - return 1;
133 -@@ -260,7 +260,7 @@ static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq
134 - {
135 - static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 };
136 -
137 -- WARN_ON_ONCE(pirq >= 5);
138 -+ WARN_ON_ONCE(pirq > 5);
139 - return read_config_nybble(router, 0x55, pirqmap[pirq-1]);
140 - }
141 -
142 -@@ -268,7 +268,7 @@ static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq
143 - {
144 - static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 };
145 -
146 -- WARN_ON_ONCE(pirq >= 5);
147 -+ WARN_ON_ONCE(pirq > 5);
148 - write_config_nybble(router, 0x55, pirqmap[pirq-1], irq);
149 - return 1;
150 - }
151 -@@ -282,7 +282,7 @@ static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
152 - {
153 - static const unsigned char pirqmap[4] = { 1, 0, 2, 3 };
154 -
155 -- WARN_ON_ONCE(pirq >= 4);
156 -+ WARN_ON_ONCE(pirq > 4);
157 - return read_config_nybble(router,0x43, pirqmap[pirq-1]);
158 - }
159 -
160 -@@ -290,7 +290,7 @@ static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i
161 - {
162 - static const unsigned char pirqmap[4] = { 1, 0, 2, 3 };
163 -
164 -- WARN_ON_ONCE(pirq >= 4);
165 -+ WARN_ON_ONCE(pirq > 4);
166 - write_config_nybble(router, 0x43, pirqmap[pirq-1], irq);
167 - return 1;
168 - }
169 -diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
170 -index b2112f5..a3b2374 100644
171 ---- a/drivers/infiniband/hw/nes/nes.c
172 -+++ b/drivers/infiniband/hw/nes/nes.c
173 -@@ -751,13 +751,13 @@ static void __devexit nes_remove(struct pci_dev *pcidev)
174 -
175 - list_del(&nesdev->list);
176 - nes_destroy_cqp(nesdev);
177 -+
178 -+ free_irq(pcidev->irq, nesdev);
179 - tasklet_kill(&nesdev->dpc_tasklet);
180 -
181 - /* Deallocate the Adapter Structure */
182 - nes_destroy_adapter(nesdev->nesadapter);
183 -
184 -- free_irq(pcidev->irq, nesdev);
185 --
186 - if (nesdev->msi_enabled) {
187 - pci_disable_msi(pcidev);
188 - }
189 -diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
190 -index 0bef878..96b1a0e 100644
191 ---- a/drivers/infiniband/hw/nes/nes_cm.c
192 -+++ b/drivers/infiniband/hw/nes/nes_cm.c
193 -@@ -1834,8 +1834,10 @@ int mini_cm_recv_pkt(struct nes_cm_core *cm_core, struct nes_vnic *nesvnic,
194 - nfo.rem_addr = ntohl(iph->saddr);
195 - nfo.rem_port = ntohs(tcph->source);
196 -
197 -- nes_debug(NES_DBG_CM, "Received packet: dest=0x%08X:0x%04X src=0x%08X:0x%04X\n",
198 -- iph->daddr, tcph->dest, iph->saddr, tcph->source);
199 -+ nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT
200 -+ ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n",
201 -+ NIPQUAD(iph->daddr), tcph->dest,
202 -+ NIPQUAD(iph->saddr), tcph->source);
203 -
204 - /* note: this call is going to increment cm_node ref count */
205 - cm_node = find_node(cm_core,
206 -diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
207 -index 49e53e4..496655e 100644
208 ---- a/drivers/infiniband/hw/nes/nes_hw.c
209 -+++ b/drivers/infiniband/hw/nes/nes_hw.c
210 -@@ -625,6 +625,15 @@ unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode)
211 - nes_debug(NES_DBG_INIT, "Did not see full soft reset done.\n");
212 - return 0;
213 - }
214 -+
215 -+ i = 0;
216 -+ while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000)
217 -+ mdelay(1);
218 -+ if (i >= 10000) {
219 -+ printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n",
220 -+ nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS));
221 -+ return 0;
222 -+ }
223 - }
224 -
225 - /* port reset */
226 -@@ -673,17 +682,6 @@ unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode)
227 - }
228 - }
229 -
230 --
231 --
232 -- i = 0;
233 -- while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000)
234 -- mdelay(1);
235 -- if (i >= 10000) {
236 -- printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n",
237 -- nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS));
238 -- return 0;
239 -- }
240 --
241 - return port_count;
242 - }
243 -
244 -diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
245 -index 5bbce29..c7d305b 100644
246 ---- a/drivers/md/dm-exception-store.c
247 -+++ b/drivers/md/dm-exception-store.c
248 -@@ -131,7 +131,7 @@ struct pstore {
249 -
250 - static unsigned sectors_to_pages(unsigned sectors)
251 - {
252 -- return sectors / (PAGE_SIZE >> 9);
253 -+ return DIV_ROUND_UP(sectors, PAGE_SIZE >> 9);
254 - }
255 -
256 - static int alloc_area(struct pstore *ps)
257 -diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
258 -index 8c9a8ad..8bf5596 100644
259 ---- a/drivers/media/video/cx88/cx88-cards.c
260 -+++ b/drivers/media/video/cx88/cx88-cards.c
261 -@@ -1354,6 +1354,10 @@ static const struct cx88_board cx88_boards[] = {
262 - }},
263 - /* fixme: Add radio support */
264 - .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD,
265 -+ .radio = {
266 -+ .type = CX88_RADIO,
267 -+ .gpio0 = 0xe780,
268 -+ },
269 - },
270 - [CX88_BOARD_ADSTECH_PTV_390] = {
271 - .name = "ADS Tech Instant Video PCI",
272 -diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
273 -index edef2a5..1e6f36e 100644
274 ---- a/drivers/media/video/ivtv/ivtv-ioctl.c
275 -+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
276 -@@ -741,7 +741,8 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void
277 -
278 - memset(vcap, 0, sizeof(*vcap));
279 - strcpy(vcap->driver, IVTV_DRIVER_NAME); /* driver name */
280 -- strcpy(vcap->card, itv->card_name); /* card type */
281 -+ strncpy(vcap->card, itv->card_name,
282 -+ sizeof(vcap->card)-1); /* card type */
283 - strcpy(vcap->bus_info, pci_name(itv->dev)); /* bus info... */
284 - vcap->version = IVTV_DRIVER_VERSION; /* version */
285 - vcap->capabilities = itv->v4l2_cap; /* capabilities */
286 -diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c
287 -index 5326eec..de7e060 100644
288 ---- a/drivers/media/video/tea5761.c
289 -+++ b/drivers/media/video/tea5761.c
290 -@@ -249,14 +249,19 @@ int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
291 -
292 - if (16 != (rc = tuner_i2c_xfer_recv(&i2c, buffer, 16))) {
293 - printk(KERN_WARNING "it is not a TEA5761. Received %i chars.\n", rc);
294 -- return EINVAL;
295 -+ return -EINVAL;
296 - }
297 -
298 -- if (!((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061))) {
299 -- printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x. It is not a TEA5761\n",buffer[13],buffer[14],buffer[15]);
300 -- return EINVAL;
301 -+ if ((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061)) {
302 -+ printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x."
303 -+ " It is not a TEA5761\n",
304 -+ buffer[13], buffer[14], buffer[15]);
305 -+ return -EINVAL;
306 - }
307 -- printk(KERN_WARNING "TEA5761 detected.\n");
308 -+ printk(KERN_WARNING "tea5761: TEA%02x%02x detected. "
309 -+ "Manufacturer ID= 0x%02x\n",
310 -+ buffer[14], buffer[15], buffer[13]);
311 -+
312 - return 0;
313 - }
314 -
315 -diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
316 -index 78a09a2..8cdbdd0 100644
317 ---- a/drivers/media/video/tuner-core.c
318 -+++ b/drivers/media/video/tuner-core.c
319 -@@ -1112,8 +1112,8 @@ static int tuner_probe(struct i2c_client *client)
320 - if (!no_autodetect) {
321 - switch (client->addr) {
322 - case 0x10:
323 -- if (tea5761_autodetection(t->i2c->adapter, t->i2c->addr)
324 -- != EINVAL) {
325 -+ if (tea5761_autodetection(t->i2c->adapter,
326 -+ t->i2c->addr) >= 0) {
327 - t->type = TUNER_TEA5761;
328 - t->mode_mask = T_RADIO;
329 - t->mode = T_STANDBY;
330 -@@ -1125,7 +1125,7 @@ static int tuner_probe(struct i2c_client *client)
331 -
332 - goto register_client;
333 - }
334 -- break;
335 -+ return -ENODEV;
336 - case 0x42:
337 - case 0x43:
338 - case 0x4a:
339 -diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
340 -index c082cf0..de11039 100644
341 ---- a/drivers/net/s2io.c
342 -+++ b/drivers/net/s2io.c
343 -@@ -84,7 +84,7 @@
344 - #include "s2io.h"
345 - #include "s2io-regs.h"
346 -
347 --#define DRV_VERSION "2.0.26.20"
348 -+#define DRV_VERSION "2.0.26.22"
349 -
350 - /* S2io Driver name & version. */
351 - static char s2io_driver_name[] = "Neterion";
352 -@@ -2339,7 +2339,7 @@ static void free_tx_buffers(struct s2io_nic *nic)
353 - for (i = 0; i < config->tx_fifo_num; i++) {
354 - unsigned long flags;
355 - spin_lock_irqsave(&mac_control->fifos[i].tx_lock, flags);
356 -- for (j = 0; j < config->tx_cfg[i].fifo_len - 1; j++) {
357 -+ for (j = 0; j < config->tx_cfg[i].fifo_len; j++) {
358 - txdp = (struct TxD *) \
359 - mac_control->fifos[i].list_info[j].list_virt_addr;
360 - skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j);
361 -diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
362 -index 17585e5..432e837 100644
363 ---- a/drivers/net/tehuti.c
364 -+++ b/drivers/net/tehuti.c
365 -@@ -625,6 +625,12 @@ static void __init bdx_firmware_endianess(void)
366 - s_firmLoad[i] = CPU_CHIP_SWAP32(s_firmLoad[i]);
367 - }
368 -
369 -+static int bdx_range_check(struct bdx_priv *priv, u32 offset)
370 -+{
371 -+ return (offset > (u32) (BDX_REGS_SIZE / priv->nic->port_num)) ?
372 -+ -EINVAL : 0;
373 -+}
374 -+
375 - static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
376 - {
377 - struct bdx_priv *priv = ndev->priv;
378 -@@ -643,9 +649,15 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
379 - DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
380 - }
381 -
382 -+ if (!capable(CAP_SYS_RAWIO))
383 -+ return -EPERM;
384 -+
385 - switch (data[0]) {
386 -
387 - case BDX_OP_READ:
388 -+ error = bdx_range_check(priv, data[1]);
389 -+ if (error < 0)
390 -+ return error;
391 - data[2] = READ_REG(priv, data[1]);
392 - DBG("read_reg(0x%x)=0x%x (dec %d)\n", data[1], data[2],
393 - data[2]);
394 -@@ -655,6 +667,9 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
395 - break;
396 -
397 - case BDX_OP_WRITE:
398 -+ error = bdx_range_check(priv, data[1]);
399 -+ if (error < 0)
400 -+ return error;
401 - WRITE_REG(priv, data[1], data[2]);
402 - DBG("write_reg(0x%x, 0x%x)\n", data[1], data[2]);
403 - break;
404 -diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
405 -index 96043c5..bc4c62b 100644
406 ---- a/drivers/net/tg3.c
407 -+++ b/drivers/net/tg3.c
408 -@@ -64,8 +64,8 @@
409 -
410 - #define DRV_MODULE_NAME "tg3"
411 - #define PFX DRV_MODULE_NAME ": "
412 --#define DRV_MODULE_VERSION "3.90"
413 --#define DRV_MODULE_RELDATE "April 12, 2008"
414 -+#define DRV_MODULE_VERSION "3.91"
415 -+#define DRV_MODULE_RELDATE "April 18, 2008"
416 -
417 - #define TG3_DEF_MAC_MODE 0
418 - #define TG3_DEF_RX_MODE 0
419 -@@ -4135,11 +4135,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
420 - u32 last_plus_one, u32 *start,
421 - u32 base_flags, u32 mss)
422 - {
423 -- struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC);
424 -+ struct sk_buff *new_skb;
425 - dma_addr_t new_addr = 0;
426 - u32 entry = *start;
427 - int i, ret = 0;
428 -
429 -+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701)
430 -+ new_skb = skb_copy(skb, GFP_ATOMIC);
431 -+ else {
432 -+ int more_headroom = 4 - ((unsigned long)skb->data & 3);
433 -+
434 -+ new_skb = skb_copy_expand(skb,
435 -+ skb_headroom(skb) + more_headroom,
436 -+ skb_tailroom(skb), GFP_ATOMIC);
437 -+ }
438 -+
439 - if (!new_skb) {
440 - ret = -1;
441 - } else {
442 -@@ -4462,7 +4472,9 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
443 -
444 - would_hit_hwbug = 0;
445 -
446 -- if (tg3_4g_overflow_test(mapping, len))
447 -+ if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
448 -+ would_hit_hwbug = 1;
449 -+ else if (tg3_4g_overflow_test(mapping, len))
450 - would_hit_hwbug = 1;
451 -
452 - tg3_set_txd(tp, entry, mapping, len, base_flags,
453 -@@ -11339,6 +11351,38 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
454 - }
455 - }
456 -
457 -+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) {
458 -+ static struct tg3_dev_id {
459 -+ u32 vendor;
460 -+ u32 device;
461 -+ } bridge_chipsets[] = {
462 -+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0 },
463 -+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1 },
464 -+ { },
465 -+ };
466 -+ struct tg3_dev_id *pci_id = &bridge_chipsets[0];
467 -+ struct pci_dev *bridge = NULL;
468 -+
469 -+ while (pci_id->vendor != 0) {
470 -+ bridge = pci_get_device(pci_id->vendor,
471 -+ pci_id->device,
472 -+ bridge);
473 -+ if (!bridge) {
474 -+ pci_id++;
475 -+ continue;
476 -+ }
477 -+ if (bridge->subordinate &&
478 -+ (bridge->subordinate->number <=
479 -+ tp->pdev->bus->number) &&
480 -+ (bridge->subordinate->subordinate >=
481 -+ tp->pdev->bus->number)) {
482 -+ tp->tg3_flags3 |= TG3_FLG3_5701_DMA_BUG;
483 -+ pci_dev_put(bridge);
484 -+ break;
485 -+ }
486 -+ }
487 -+ }
488 -+
489 - /* The EPB bridge inside 5714, 5715, and 5780 cannot support
490 - * DMA addresses > 40-bit. This bridge may have other additional
491 - * 57xx devices behind it in some 4-port NIC designs for example.
492 -diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
493 -index c1075a7..c688c3a 100644
494 ---- a/drivers/net/tg3.h
495 -+++ b/drivers/net/tg3.h
496 -@@ -2476,6 +2476,7 @@ struct tg3 {
497 - #define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
498 - #define TG3_FLG3_ENABLE_APE 0x00000002
499 - #define TG3_FLG3_5761_5784_AX_FIXES 0x00000004
500 -+#define TG3_FLG3_5701_DMA_BUG 0x00000008
501 -
502 - struct timer_list timer;
503 - u16 timer_counter;
504 -diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
505 -index 48e9124..4ec1915 100644
506 ---- a/drivers/net/wireless/b43/dma.c
507 -+++ b/drivers/net/wireless/b43/dma.c
508 -@@ -822,6 +822,18 @@ static u64 supported_dma_mask(struct b43_wldev *dev)
509 - return DMA_30BIT_MASK;
510 - }
511 -
512 -+static enum b43_dmatype dma_mask_to_engine_type(u64 dmamask)
513 -+{
514 -+ if (dmamask == DMA_30BIT_MASK)
515 -+ return B43_DMA_30BIT;
516 -+ if (dmamask == DMA_32BIT_MASK)
517 -+ return B43_DMA_32BIT;
518 -+ if (dmamask == DMA_64BIT_MASK)
519 -+ return B43_DMA_64BIT;
520 -+ B43_WARN_ON(1);
521 -+ return B43_DMA_30BIT;
522 -+}
523 -+
524 - /* Main initialization function. */
525 - static
526 - struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
527 -@@ -982,6 +994,42 @@ void b43_dma_free(struct b43_wldev *dev)
528 - dma->tx_ring0 = NULL;
529 - }
530 -
531 -+static int b43_dma_set_mask(struct b43_wldev *dev, u64 mask)
532 -+{
533 -+ u64 orig_mask = mask;
534 -+ bool fallback = 0;
535 -+ int err;
536 -+
537 -+ /* Try to set the DMA mask. If it fails, try falling back to a
538 -+ * lower mask, as we can always also support a lower one. */
539 -+ while (1) {
540 -+ err = ssb_dma_set_mask(dev->dev, mask);
541 -+ if (!err)
542 -+ break;
543 -+ if (mask == DMA_64BIT_MASK) {
544 -+ mask = DMA_32BIT_MASK;
545 -+ fallback = 1;
546 -+ continue;
547 -+ }
548 -+ if (mask == DMA_32BIT_MASK) {
549 -+ mask = DMA_30BIT_MASK;
550 -+ fallback = 1;
551 -+ continue;
552 -+ }
553 -+ b43err(dev->wl, "The machine/kernel does not support "
554 -+ "the required %u-bit DMA mask\n",
555 -+ (unsigned int)dma_mask_to_engine_type(orig_mask));
556 -+ return -EOPNOTSUPP;
557 -+ }
558 -+ if (fallback) {
559 -+ b43info(dev->wl, "DMA mask fallback from %u-bit to %u-bit\n",
560 -+ (unsigned int)dma_mask_to_engine_type(orig_mask),
561 -+ (unsigned int)dma_mask_to_engine_type(mask));
562 -+ }
563 -+
564 -+ return 0;
565 -+}
566 -+
567 - int b43_dma_init(struct b43_wldev *dev)
568 - {
569 - struct b43_dma *dma = &dev->dma;
570 -@@ -991,27 +1039,10 @@ int b43_dma_init(struct b43_wldev *dev)
571 - enum b43_dmatype type;
572 -
573 - dmamask = supported_dma_mask(dev);
574 -- switch (dmamask) {
575 -- default:
576 -- B43_WARN_ON(1);
577 -- case DMA_30BIT_MASK:
578 -- type = B43_DMA_30BIT;
579 -- break;
580 -- case DMA_32BIT_MASK:
581 -- type = B43_DMA_32BIT;
582 -- break;
583 -- case DMA_64BIT_MASK:
584 -- type = B43_DMA_64BIT;
585 -- break;
586 -- }
587 -- err = ssb_dma_set_mask(dev->dev, dmamask);
588 -- if (err) {
589 -- b43err(dev->wl, "The machine/kernel does not support "
590 -- "the required DMA mask (0x%08X%08X)\n",
591 -- (unsigned int)((dmamask & 0xFFFFFFFF00000000ULL) >> 32),
592 -- (unsigned int)(dmamask & 0x00000000FFFFFFFFULL));
593 -- return -EOPNOTSUPP;
594 -- }
595 -+ type = dma_mask_to_engine_type(dmamask);
596 -+ err = b43_dma_set_mask(dev, dmamask);
597 -+ if (err)
598 -+ return err;
599 -
600 - err = -ENOMEM;
601 - /* setup TX DMA channels. */
602 -diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
603 -index c73a75b..f23317e 100644
604 ---- a/drivers/net/wireless/b43/main.c
605 -+++ b/drivers/net/wireless/b43/main.c
606 -@@ -78,6 +78,11 @@ static int modparam_nohwcrypt;
607 - module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
608 - MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
609 -
610 -+static int modparam_btcoex = 1;
611 -+module_param_named(btcoex, modparam_btcoex, int, 0444);
612 -+MODULE_PARM_DESC(btcoex, "Enable Bluetooth coexistance (default on)");
613 -+
614 -+
615 - static const struct ssb_device_id b43_ssb_tbl[] = {
616 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5),
617 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 6),
618 -@@ -3339,6 +3344,8 @@ static void b43_bluetooth_coext_enable(struct b43_wldev *dev)
619 - struct ssb_sprom *sprom = &dev->dev->bus->sprom;
620 - u32 hf;
621 -
622 -+ if (!modparam_btcoex)
623 -+ return;
624 - if (!(sprom->boardflags_lo & B43_BFL_BTCOEXIST))
625 - return;
626 - if (dev->phy.type != B43_PHYTYPE_B && !dev->phy.gmode)
627 -@@ -3350,11 +3357,13 @@ static void b43_bluetooth_coext_enable(struct b43_wldev *dev)
628 - else
629 - hf |= B43_HF_BTCOEX;
630 - b43_hf_write(dev, hf);
631 -- //TODO
632 - }
633 -
634 - static void b43_bluetooth_coext_disable(struct b43_wldev *dev)
635 --{ //TODO
636 -+{
637 -+ if (!modparam_btcoex)
638 -+ return;
639 -+ //TODO
640 - }
641 -
642 - static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev)
643 -@@ -4000,8 +4009,16 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
644 - return err;
645 - }
646 -
647 -+#define IS_PDEV(pdev, _vendor, _device, _subvendor, _subdevice) ( \
648 -+ (pdev->vendor == PCI_VENDOR_ID_##_vendor) && \
649 -+ (pdev->device == _device) && \
650 -+ (pdev->subsystem_vendor == PCI_VENDOR_ID_##_subvendor) && \
651 -+ (pdev->subsystem_device == _subdevice) )
652 -+
653 - static void b43_sprom_fixup(struct ssb_bus *bus)
654 - {
655 -+ struct pci_dev *pdev;
656 -+
657 - /* boardflags workarounds */
658 - if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL &&
659 - bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74)
660 -@@ -4009,6 +4026,13 @@ static void b43_sprom_fixup(struct ssb_bus *bus)
661 - if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
662 - bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40)
663 - bus->sprom.boardflags_lo |= B43_BFL_PACTRL;
664 -+ if (bus->bustype == SSB_BUSTYPE_PCI) {
665 -+ pdev = bus->host_pci;
666 -+ if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) ||
667 -+ IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) ||
668 -+ IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013))
669 -+ bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST;
670 -+ }
671 - }
672 -
673 - static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl)
674 -diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
675 -index 8b39970..3d09d8f 100644
676 ---- a/drivers/rtc/rtc-pcf8583.c
677 -+++ b/drivers/rtc/rtc-pcf8583.c
678 -@@ -15,7 +15,7 @@
679 - #include <linux/i2c.h>
680 - #include <linux/slab.h>
681 - #include <linux/string.h>
682 --#include <linux/mc146818rtc.h>
683 -+#include <linux/rtc.h>
684 - #include <linux/init.h>
685 - #include <linux/errno.h>
686 - #include <linux/bcd.h>
687 -diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
688 -index 3c1b433..0e8e092 100644
689 ---- a/drivers/scsi/qla2xxx/qla_os.c
690 -+++ b/drivers/scsi/qla2xxx/qla_os.c
691 -@@ -2357,7 +2357,7 @@ qla2x00_do_dpc(void *data)
692 - } else {
693 - fcport->login_retry = 0;
694 - }
695 -- if (fcport->login_retry == 0)
696 -+ if (fcport->login_retry == 0 && status != QLA_SUCCESS)
697 - fcport->loop_id = FC_NO_LOOP_ID;
698 - }
699 - if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
700 -diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
701 -index 116211f..0dddd68 100644
702 ---- a/drivers/serial/dz.c
703 -+++ b/drivers/serial/dz.c
704 -@@ -819,7 +819,7 @@ static void dz_console_putchar(struct uart_port *uport, int ch)
705 - dz_out(dport, DZ_TCR, mask);
706 - iob();
707 - udelay(2);
708 -- } while (loops--);
709 -+ } while (--loops);
710 -
711 - if (loops) /* Cannot send otherwise. */
712 - dz_out(dport, DZ_TDR, ch);
713 -diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
714 -index b434df7..274a448 100644
715 ---- a/drivers/ssb/pci.c
716 -+++ b/drivers/ssb/pci.c
717 -@@ -482,6 +482,11 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
718 - goto unsupported;
719 - }
720 -
721 -+ if (out->boardflags_lo == 0xFFFF)
722 -+ out->boardflags_lo = 0; /* per specs */
723 -+ if (out->boardflags_hi == 0xFFFF)
724 -+ out->boardflags_hi = 0; /* per specs */
725 -+
726 - return 0;
727 - unsupported:
728 - ssb_printk(KERN_WARNING PFX "Unsupported SPROM revision %d "
729 -diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
730 -index 68fc521..7f1bc97 100644
731 ---- a/drivers/usb/core/hub.c
732 -+++ b/drivers/usb/core/hub.c
733 -@@ -2664,6 +2664,7 @@ loop:
734 - if ((status == -ENOTCONN) || (status == -ENOTSUPP))
735 - break;
736 - }
737 -+ dev_err(hub_dev, "unable to enumerate USB device on port %d\n", port1);
738 -
739 - done:
740 - hub_port_disable(hub, port1, 1);
741 -diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
742 -index d0360f6..b0e2275 100644
743 ---- a/drivers/usb/host/ohci-pci.c
744 -+++ b/drivers/usb/host/ohci-pci.c
745 -@@ -312,11 +312,13 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
746 -
747 - static int ohci_pci_resume (struct usb_hcd *hcd)
748 - {
749 -+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
750 -+
751 - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
752 -
753 - /* FIXME: we should try to detect loss of VBUS power here */
754 - prepare_for_handover(hcd);
755 --
756 -+ ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrenable);
757 - return 0;
758 - }
759 -
760 -diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
761 -index ed67881..7b02a4a 100644
762 ---- a/drivers/usb/serial/sierra.c
763 -+++ b/drivers/usb/serial/sierra.c
764 -@@ -164,6 +164,7 @@ static struct usb_device_id id_table [] = {
765 - { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
766 - { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */
767 - { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */
768 -+ { USB_DEVICE(0x03f0, 0x1e1d) }, /* HP hs2300 a.k.a MC8775 */
769 - { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
770 - { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/
771 - { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/
772 -diff --git a/fs/aio.c b/fs/aio.c
773 -index 2283686..ae94e1d 100644
774 ---- a/fs/aio.c
775 -+++ b/fs/aio.c
776 -@@ -1166,7 +1166,10 @@ retry:
777 - break;
778 - if (min_nr <= i)
779 - break;
780 -- ret = 0;
781 -+ if (unlikely(ctx->dead)) {
782 -+ ret = -EINVAL;
783 -+ break;
784 -+ }
785 - if (to.timed_out) /* Only check after read evt */
786 - break;
787 - /* Try to only show up in io wait if there are ops
788 -@@ -1231,6 +1234,13 @@ static void io_destroy(struct kioctx *ioctx)
789 -
790 - aio_cancel_all(ioctx);
791 - wait_for_all_aios(ioctx);
792 -+
793 -+ /*
794 -+ * Wake up any waiters. The setting of ctx->dead must be seen
795 -+ * by other CPUs at this point. Right now, we rely on the
796 -+ * locking done by the above calls to ensure this consistency.
797 -+ */
798 -+ wake_up(&ioctx->wait);
799 - put_ioctx(ioctx); /* once for the lookup */
800 - }
801 -
802 -diff --git a/fs/dnotify.c b/fs/dnotify.c
803 -index 28d01ed..eaecc4c 100644
804 ---- a/fs/dnotify.c
805 -+++ b/fs/dnotify.c
806 -@@ -20,6 +20,7 @@
807 - #include <linux/init.h>
808 - #include <linux/spinlock.h>
809 - #include <linux/slab.h>
810 -+#include <linux/file.h>
811 -
812 - int dir_notify_enable __read_mostly = 1;
813 -
814 -@@ -66,6 +67,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
815 - struct dnotify_struct **prev;
816 - struct inode *inode;
817 - fl_owner_t id = current->files;
818 -+ struct file *f;
819 - int error = 0;
820 -
821 - if ((arg & ~DN_MULTISHOT) == 0) {
822 -@@ -92,6 +94,15 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
823 - prev = &odn->dn_next;
824 - }
825 -
826 -+ rcu_read_lock();
827 -+ f = fcheck(fd);
828 -+ rcu_read_unlock();
829 -+ /* we'd lost the race with close(), sod off silently */
830 -+ /* note that inode->i_lock prevents reordering problems
831 -+ * between accesses to descriptor table and ->i_dnotify */
832 -+ if (f != filp)
833 -+ goto out_free;
834 -+
835 - error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
836 - if (error)
837 - goto out_free;
838 -diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
839 -index a1db918..4c895f3 100644
840 ---- a/fs/jffs2/erase.c
841 -+++ b/fs/jffs2/erase.c
842 -@@ -419,9 +419,6 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
843 - if (jffs2_write_nand_cleanmarker(c, jeb))
844 - goto filebad;
845 - }
846 --
847 -- /* Everything else got zeroed before the erase */
848 -- jeb->free_size = c->sector_size;
849 - } else {
850 -
851 - struct kvec vecs[1];
852 -@@ -449,18 +446,19 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
853 -
854 - goto filebad;
855 - }
856 --
857 -- /* Everything else got zeroed before the erase */
858 -- jeb->free_size = c->sector_size;
859 -- /* FIXME Special case for cleanmarker in empty block */
860 -- jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL);
861 - }
862 -+ /* Everything else got zeroed before the erase */
863 -+ jeb->free_size = c->sector_size;
864 -
865 - down(&c->erase_free_sem);
866 - spin_lock(&c->erase_completion_lock);
867 -+
868 - c->erasing_size -= c->sector_size;
869 -- c->free_size += jeb->free_size;
870 -- c->used_size += jeb->used_size;
871 -+ c->free_size += c->sector_size;
872 -+
873 -+ /* Account for cleanmarker now, if it's in-band */
874 -+ if (c->cleanmarker_size && !jffs2_cleanmarker_oob(c))
875 -+ jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL);
876 -
877 - jffs2_dbg_acct_sanity_check_nolock(c,jeb);
878 - jffs2_dbg_acct_paranoia_check_nolock(c, jeb);
879 -diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
880 -index b9e1740..44c81c7 100644
881 ---- a/include/linux/rtnetlink.h
882 -+++ b/include/linux/rtnetlink.h
883 -@@ -740,13 +740,13 @@ extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
884 - extern void rtnl_lock(void);
885 - extern void rtnl_unlock(void);
886 - extern int rtnl_trylock(void);
887 -+extern int rtnl_is_locked(void);
888 -
889 - extern void rtnetlink_init(void);
890 - extern void __rtnl_unlock(void);
891 -
892 - #define ASSERT_RTNL() do { \
893 -- if (unlikely(rtnl_trylock())) { \
894 -- rtnl_unlock(); \
895 -+ if (unlikely(!rtnl_is_locked())) { \
896 - printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
897 - __FILE__, __LINE__); \
898 - dump_stack(); \
899 -diff --git a/include/net/tcp.h b/include/net/tcp.h
900 -index 4fd3eb2..d69d12e 100644
901 ---- a/include/net/tcp.h
902 -+++ b/include/net/tcp.h
903 -@@ -776,11 +776,14 @@ extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
904 - extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst);
905 -
906 - /* Slow start with delack produces 3 packets of burst, so that
907 -- * it is safe "de facto".
908 -+ * it is safe "de facto". This will be the default - same as
909 -+ * the default reordering threshold - but if reordering increases,
910 -+ * we must be able to allow cwnd to burst at least this much in order
911 -+ * to not pull it back when holes are filled.
912 - */
913 - static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp)
914 - {
915 -- return 3;
916 -+ return tp->reordering;
917 - }
918 -
919 - /* Returns end sequence number of the receiver's advertised window */
920 -diff --git a/include/net/xfrm.h b/include/net/xfrm.h
921 -index 0d255ae..97577de 100644
922 ---- a/include/net/xfrm.h
923 -+++ b/include/net/xfrm.h
924 -@@ -435,6 +435,9 @@ struct xfrm_tmpl
925 - /* May skip this transfomration if no SA is found */
926 - __u8 optional;
927 -
928 -+/* Skip aalgos/ealgos/calgos checks. */
929 -+ __u8 allalgs;
930 -+
931 - /* Bit mask of algos allowed for acquisition */
932 - __u32 aalgos;
933 - __u32 ealgos;
934 -diff --git a/kernel/cgroup.c b/kernel/cgroup.c
935 -index 2727f92..6d8de05 100644
936 ---- a/kernel/cgroup.c
937 -+++ b/kernel/cgroup.c
938 -@@ -1722,7 +1722,12 @@ void cgroup_enable_task_cg_lists(void)
939 - use_task_css_set_links = 1;
940 - do_each_thread(g, p) {
941 - task_lock(p);
942 -- if (list_empty(&p->cg_list))
943 -+ /*
944 -+ * We should check if the process is exiting, otherwise
945 -+ * it will race with cgroup_exit() in that the list
946 -+ * entry won't be deleted though the process has exited.
947 -+ */
948 -+ if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list))
949 - list_add(&p->cg_list, &p->cgroups->tasks);
950 - task_unlock(p);
951 - } while_each_thread(g, p);
952 -diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
953 -index 98bee01..c15a359 100644
954 ---- a/kernel/hrtimer.c
955 -+++ b/kernel/hrtimer.c
956 -@@ -590,7 +590,6 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
957 - list_add_tail(&timer->cb_entry,
958 - &base->cpu_base->cb_pending);
959 - timer->state = HRTIMER_STATE_PENDING;
960 -- raise_softirq(HRTIMER_SOFTIRQ);
961 - return 1;
962 - default:
963 - BUG();
964 -@@ -633,6 +632,11 @@ static int hrtimer_switch_to_hres(void)
965 - return 1;
966 - }
967 -
968 -+static inline void hrtimer_raise_softirq(void)
969 -+{
970 -+ raise_softirq(HRTIMER_SOFTIRQ);
971 -+}
972 -+
973 - #else
974 -
975 - static inline int hrtimer_hres_active(void) { return 0; }
976 -@@ -651,6 +655,7 @@ static inline int hrtimer_reprogram(struct hrtimer *timer,
977 - {
978 - return 0;
979 - }
980 -+static inline void hrtimer_raise_softirq(void) { }
981 -
982 - #endif /* CONFIG_HIGH_RES_TIMERS */
983 -
984 -@@ -850,7 +855,7 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
985 - {
986 - struct hrtimer_clock_base *base, *new_base;
987 - unsigned long flags;
988 -- int ret;
989 -+ int ret, raise;
990 -
991 - base = lock_hrtimer_base(timer, &flags);
992 -
993 -@@ -884,8 +889,18 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
994 - enqueue_hrtimer(timer, new_base,
995 - new_base->cpu_base == &__get_cpu_var(hrtimer_bases));
996 -
997 -+ /*
998 -+ * The timer may be expired and moved to the cb_pending
999 -+ * list. We can not raise the softirq with base lock held due
1000 -+ * to a possible deadlock with runqueue lock.
1001 -+ */
1002 -+ raise = timer->state == HRTIMER_STATE_PENDING;
1003 -+
1004 - unlock_hrtimer_base(timer, &flags);
1005 -
1006 -+ if (raise)
1007 -+ hrtimer_raise_softirq();
1008 -+
1009 - return ret;
1010 - }
1011 - EXPORT_SYMBOL_GPL(hrtimer_start);
1012 -@@ -1080,8 +1095,19 @@ static void run_hrtimer_pending(struct hrtimer_cpu_base *cpu_base)
1013 - * If the timer was rearmed on another CPU, reprogram
1014 - * the event device.
1015 - */
1016 -- if (timer->base->first == &timer->node)
1017 -- hrtimer_reprogram(timer, timer->base);
1018 -+ struct hrtimer_clock_base *base = timer->base;
1019 -+
1020 -+ if (base->first == &timer->node &&
1021 -+ hrtimer_reprogram(timer, base)) {
1022 -+ /*
1023 -+ * Timer is expired. Thus move it from tree to
1024 -+ * pending list again.
1025 -+ */
1026 -+ __remove_hrtimer(timer, base,
1027 -+ HRTIMER_STATE_PENDING, 0);
1028 -+ list_add_tail(&timer->cb_entry,
1029 -+ &base->cpu_base->cb_pending);
1030 -+ }
1031 - }
1032 - }
1033 - spin_unlock_irq(&cpu_base->lock);
1034 -diff --git a/mm/pagewalk.c b/mm/pagewalk.c
1035 -index 1cf1417..0afd238 100644
1036 ---- a/mm/pagewalk.c
1037 -+++ b/mm/pagewalk.c
1038 -@@ -9,11 +9,15 @@ static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
1039 - int err = 0;
1040 -
1041 - pte = pte_offset_map(pmd, addr);
1042 -- do {
1043 -+ for (;;) {
1044 - err = walk->pte_entry(pte, addr, addr + PAGE_SIZE, private);
1045 - if (err)
1046 - break;
1047 -- } while (pte++, addr += PAGE_SIZE, addr != end);
1048 -+ addr += PAGE_SIZE;
1049 -+ if (addr == end)
1050 -+ break;
1051 -+ pte++;
1052 -+ }
1053 -
1054 - pte_unmap(pte);
1055 - return err;
1056 -diff --git a/net/can/raw.c b/net/can/raw.c
1057 -index 94cd7f2..c92cb8e 100644
1058 ---- a/net/can/raw.c
1059 -+++ b/net/can/raw.c
1060 -@@ -573,7 +573,8 @@ static int raw_getsockopt(struct socket *sock, int level, int optname,
1061 - int fsize = ro->count * sizeof(struct can_filter);
1062 - if (len > fsize)
1063 - len = fsize;
1064 -- err = copy_to_user(optval, ro->filter, len);
1065 -+ if (copy_to_user(optval, ro->filter, len))
1066 -+ err = -EFAULT;
1067 - } else
1068 - len = 0;
1069 - release_sock(sk);
1070 -diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
1071 -index 2bd9c5f..0cb2772 100644
1072 ---- a/net/core/rtnetlink.c
1073 -+++ b/net/core/rtnetlink.c
1074 -@@ -82,6 +82,11 @@ int rtnl_trylock(void)
1075 - return mutex_trylock(&rtnl_mutex);
1076 - }
1077 -
1078 -+int rtnl_is_locked(void)
1079 -+{
1080 -+ return mutex_is_locked(&rtnl_mutex);
1081 -+}
1082 -+
1083 - static struct rtnl_link *rtnl_msg_handlers[NPROTO];
1084 -
1085 - static inline int rtm_msgindex(int msgtype)
1086 -@@ -1389,6 +1394,7 @@ EXPORT_SYMBOL(rtnetlink_put_metrics);
1087 - EXPORT_SYMBOL(rtnl_lock);
1088 - EXPORT_SYMBOL(rtnl_trylock);
1089 - EXPORT_SYMBOL(rtnl_unlock);
1090 -+EXPORT_SYMBOL(rtnl_is_locked);
1091 - EXPORT_SYMBOL(rtnl_unicast);
1092 - EXPORT_SYMBOL(rtnl_notify);
1093 - EXPORT_SYMBOL(rtnl_set_sk_err);
1094 -diff --git a/net/dccp/probe.c b/net/dccp/probe.c
1095 -index 7053bb8..44eddcf 100644
1096 ---- a/net/dccp/probe.c
1097 -+++ b/net/dccp/probe.c
1098 -@@ -145,7 +145,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf,
1099 - goto out_free;
1100 -
1101 - cnt = kfifo_get(dccpw.fifo, tbuf, len);
1102 -- error = copy_to_user(buf, tbuf, cnt);
1103 -+ error = copy_to_user(buf, tbuf, cnt) ? -EFAULT : 0;
1104 -
1105 - out_free:
1106 - vfree(tbuf);
1107 -diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
1108 -index 87dd5bf..a79a547 100644
1109 ---- a/net/ipv4/tcp_probe.c
1110 -+++ b/net/ipv4/tcp_probe.c
1111 -@@ -190,19 +190,18 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf,
1112 -
1113 - width = tcpprobe_sprint(tbuf, sizeof(tbuf));
1114 -
1115 -- if (width < len)
1116 -+ if (cnt + width < len)
1117 - tcp_probe.tail = (tcp_probe.tail + 1) % bufsize;
1118 -
1119 - spin_unlock_bh(&tcp_probe.lock);
1120 -
1121 - /* if record greater than space available
1122 - return partial buffer (so far) */
1123 -- if (width >= len)
1124 -+ if (cnt + width >= len)
1125 - break;
1126 -
1127 -- error = copy_to_user(buf + cnt, tbuf, width);
1128 -- if (error)
1129 -- break;
1130 -+ if (copy_to_user(buf + cnt, tbuf, width))
1131 -+ return -EFAULT;
1132 - cnt += width;
1133 - }
1134 -
1135 -diff --git a/net/key/af_key.c b/net/key/af_key.c
1136 -index e9ef9af..5ceab25 100644
1137 ---- a/net/key/af_key.c
1138 -+++ b/net/key/af_key.c
1139 -@@ -1856,7 +1856,7 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq)
1140 - t->encap_family = xp->family;
1141 -
1142 - /* No way to set this via kame pfkey */
1143 -- t->aalgos = t->ealgos = t->calgos = ~0;
1144 -+ t->allalgs = 1;
1145 - xp->xfrm_nr++;
1146 - return 0;
1147 - }
1148 -diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
1149 -index 063cbc5..f9293c7 100644
1150 ---- a/net/rose/af_rose.c
1151 -+++ b/net/rose/af_rose.c
1152 -@@ -760,8 +760,10 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
1153 -
1154 - rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause,
1155 - &diagnostic);
1156 -- if (!rose->neighbour)
1157 -- return -ENETUNREACH;
1158 -+ if (!rose->neighbour) {
1159 -+ err = -ENETUNREACH;
1160 -+ goto out_release;
1161 -+ }
1162 -
1163 - rose->lci = rose_new_lci(rose->neighbour);
1164 - if (!rose->lci) {
1165 -diff --git a/net/tipc/socket.c b/net/tipc/socket.c
1166 -index 2290903..ac04733 100644
1167 ---- a/net/tipc/socket.c
1168 -+++ b/net/tipc/socket.c
1169 -@@ -1600,8 +1600,8 @@ static int getsockopt(struct socket *sock,
1170 - else if (len < sizeof(value)) {
1171 - res = -EINVAL;
1172 - }
1173 -- else if ((res = copy_to_user(ov, &value, sizeof(value)))) {
1174 -- /* couldn't return value */
1175 -+ else if (copy_to_user(ov, &value, sizeof(value))) {
1176 -+ res = -EFAULT;
1177 - }
1178 - else {
1179 - res = put_user(sizeof(value), ol);
1180 -diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
1181 -index 9fc4c31..c44076c 100644
1182 ---- a/net/xfrm/xfrm_policy.c
1183 -+++ b/net/xfrm/xfrm_policy.c
1184 -@@ -1772,7 +1772,7 @@ xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x,
1185 - (x->id.spi == tmpl->id.spi || !tmpl->id.spi) &&
1186 - (x->props.reqid == tmpl->reqid || !tmpl->reqid) &&
1187 - x->props.mode == tmpl->mode &&
1188 -- ((tmpl->aalgos & (1<<x->props.aalgo)) ||
1189 -+ (tmpl->allalgs || (tmpl->aalgos & (1<<x->props.aalgo)) ||
1190 - !(xfrm_id_proto_match(tmpl->id.proto, IPSEC_PROTO_ANY))) &&
1191 - !(x->props.mode != XFRM_MODE_TRANSPORT &&
1192 - xfrm_state_addr_cmp(tmpl, x, family));
1193 -diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
1194 -index 019d21d..12f19be 100644
1195 ---- a/net/xfrm/xfrm_user.c
1196 -+++ b/net/xfrm/xfrm_user.c
1197 -@@ -975,6 +975,8 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut,
1198 - t->aalgos = ut->aalgos;
1199 - t->ealgos = ut->ealgos;
1200 - t->calgos = ut->calgos;
1201 -+ /* If all masks are ~0, then we allow all algorithms. */
1202 -+ t->allalgs = !~(t->aalgos & t->ealgos & t->calgos);
1203 - t->encap_family = ut->family;
1204 - }
1205 - }
1206 -diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
1207 -index d39b59c..f4fa982 100644
1208 ---- a/security/selinux/hooks.c
1209 -+++ b/security/selinux/hooks.c
1210 -@@ -756,9 +756,18 @@ static void selinux_sb_clone_mnt_opts(const struct super_block *oldsb,
1211 - int set_context = (oldsbsec->flags & CONTEXT_MNT);
1212 - int set_rootcontext = (oldsbsec->flags & ROOTCONTEXT_MNT);
1213 -
1214 -- /* we can't error, we can't save the info, this shouldn't get called
1215 -- * this early in the boot process. */
1216 -- BUG_ON(!ss_initialized);
1217 -+ /*
1218 -+ * if the parent was able to be mounted it clearly had no special lsm
1219 -+ * mount options. thus we can safely put this sb on the list and deal
1220 -+ * with it later
1221 -+ */
1222 -+ if (!ss_initialized) {
1223 -+ spin_lock(&sb_security_lock);
1224 -+ if (list_empty(&newsbsec->list))
1225 -+ list_add(&newsbsec->list, &superblock_security_head);
1226 -+ spin_unlock(&sb_security_lock);
1227 -+ return;
1228 -+ }
1229 -
1230 - /* how can we clone if the old one wasn't set up?? */
1231 - BUG_ON(!oldsbsec->initialized);
1232
1233 Deleted: genpatches-2.6/trunk/2.6.26/1001_linux-2.6.25.2.patch
1234 ===================================================================
1235 --- genpatches-2.6/trunk/2.6.26/1001_linux-2.6.25.2.patch 2008-07-17 02:44:10 UTC (rev 1328)
1236 +++ genpatches-2.6/trunk/2.6.26/1001_linux-2.6.25.2.patch 2008-07-17 02:47:50 UTC (rev 1329)
1237 @@ -1,49 +0,0 @@
1238 -diff --git a/fs/locks.c b/fs/locks.c
1239 -index 43c0af2..159e0f6 100644
1240 ---- a/fs/locks.c
1241 -+++ b/fs/locks.c
1242 -@@ -1750,6 +1750,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
1243 - struct file_lock *file_lock = locks_alloc_lock();
1244 - struct flock flock;
1245 - struct inode *inode;
1246 -+ struct file *f;
1247 - int error;
1248 -
1249 - if (file_lock == NULL)
1250 -@@ -1822,7 +1823,15 @@ again:
1251 - * Attempt to detect a close/fcntl race and recover by
1252 - * releasing the lock that was just acquired.
1253 - */
1254 -- if (!error && fcheck(fd) != filp && flock.l_type != F_UNLCK) {
1255 -+ /*
1256 -+ * we need that spin_lock here - it prevents reordering between
1257 -+ * update of inode->i_flock and check for it done in close().
1258 -+ * rcu_read_lock() wouldn't do.
1259 -+ */
1260 -+ spin_lock(&current->files->file_lock);
1261 -+ f = fcheck(fd);
1262 -+ spin_unlock(&current->files->file_lock);
1263 -+ if (!error && f != filp && flock.l_type != F_UNLCK) {
1264 - flock.l_type = F_UNLCK;
1265 - goto again;
1266 - }
1267 -@@ -1878,6 +1887,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,
1268 - struct file_lock *file_lock = locks_alloc_lock();
1269 - struct flock64 flock;
1270 - struct inode *inode;
1271 -+ struct file *f;
1272 - int error;
1273 -
1274 - if (file_lock == NULL)
1275 -@@ -1950,7 +1960,10 @@ again:
1276 - * Attempt to detect a close/fcntl race and recover by
1277 - * releasing the lock that was just acquired.
1278 - */
1279 -- if (!error && fcheck(fd) != filp && flock.l_type != F_UNLCK) {
1280 -+ spin_lock(&current->files->file_lock);
1281 -+ f = fcheck(fd);
1282 -+ spin_unlock(&current->files->file_lock);
1283 -+ if (!error && f != filp && flock.l_type != F_UNLCK) {
1284 - flock.l_type = F_UNLCK;
1285 - goto again;
1286 - }
1287
1288 Deleted: genpatches-2.6/trunk/2.6.26/1002_linux-2.6.25.3.patch
1289 ===================================================================
1290 --- genpatches-2.6/trunk/2.6.26/1002_linux-2.6.25.3.patch 2008-07-17 02:44:10 UTC (rev 1328)
1291 +++ genpatches-2.6/trunk/2.6.26/1002_linux-2.6.25.3.patch 2008-07-17 02:47:50 UTC (rev 1329)
1292 @@ -1,617 +0,0 @@
1293 -diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
1294 -index d51bc8b..b4565bb 100644
1295 ---- a/arch/arm/kernel/kprobes-decode.c
1296 -+++ b/arch/arm/kernel/kprobes-decode.c
1297 -@@ -1176,7 +1176,7 @@ space_cccc_001x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1298 - * *S (bit 20) updates condition codes
1299 - * ADC/SBC/RSC reads the C flag
1300 - */
1301 -- insn &= 0xfff00ff0; /* Rn = r0, Rd = r0 */
1302 -+ insn &= 0xfff00fff; /* Rn = r0, Rd = r0 */
1303 - asi->insn[0] = insn;
1304 - asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */
1305 - emulate_alu_imm_rwflags : emulate_alu_imm_rflags;
1306 -diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
1307 -index 13e371a..5593dd2 100644
1308 ---- a/arch/arm/kernel/kprobes.c
1309 -+++ b/arch/arm/kernel/kprobes.c
1310 -@@ -66,7 +66,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
1311 - return -ENOMEM;
1312 - for (is = 0; is < MAX_INSN_SIZE; ++is)
1313 - p->ainsn.insn[is] = tmp_insn[is];
1314 -- flush_insns(&p->ainsn.insn, MAX_INSN_SIZE);
1315 -+ flush_insns(p->ainsn.insn, MAX_INSN_SIZE);
1316 - break;
1317 -
1318 - case INSN_GOOD_NO_SLOT: /* instruction doesn't need insn slot */
1319 -diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
1320 -index 42bf09d..9f8c8e1 100644
1321 ---- a/arch/sparc/kernel/sys_sparc.c
1322 -+++ b/arch/sparc/kernel/sys_sparc.c
1323 -@@ -224,8 +224,7 @@ int sparc_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
1324 - {
1325 - if (ARCH_SUN4C_SUN4 &&
1326 - (len > 0x20000000 ||
1327 -- ((flags & MAP_FIXED) &&
1328 -- addr < 0xe0000000 && addr + len > 0x20000000)))
1329 -+ (addr < 0xe0000000 && addr + len > 0x20000000)))
1330 - return -EINVAL;
1331 -
1332 - /* See asm-sparc/uaccess.h */
1333 -diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
1334 -index f952745..cc37936 100644
1335 ---- a/arch/sparc64/kernel/sys_sparc.c
1336 -+++ b/arch/sparc64/kernel/sys_sparc.c
1337 -@@ -549,13 +549,13 @@ int sparc64_mmap_check(unsigned long addr, unsigned long len,
1338 - if (len >= STACK_TOP32)
1339 - return -EINVAL;
1340 -
1341 -- if ((flags & MAP_FIXED) && addr > STACK_TOP32 - len)
1342 -+ if (addr > STACK_TOP32 - len)
1343 - return -EINVAL;
1344 - } else {
1345 - if (len >= VA_EXCLUDE_START)
1346 - return -EINVAL;
1347 -
1348 -- if ((flags & MAP_FIXED) && invalid_64bit_range(addr, len))
1349 -+ if (invalid_64bit_range(addr, len))
1350 - return -EINVAL;
1351 - }
1352 -
1353 -diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
1354 -index 7b6e3bb..05356ce 100644
1355 ---- a/arch/x86/pci/common.c
1356 -+++ b/arch/x86/pci/common.c
1357 -@@ -372,13 +372,16 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
1358 - {}
1359 - };
1360 -
1361 -+void __init dmi_check_pciprobe(void)
1362 -+{
1363 -+ dmi_check_system(pciprobe_dmi_table);
1364 -+}
1365 -+
1366 - struct pci_bus * __devinit pcibios_scan_root(int busnum)
1367 - {
1368 - struct pci_bus *bus = NULL;
1369 - struct pci_sysdata *sd;
1370 -
1371 -- dmi_check_system(pciprobe_dmi_table);
1372 --
1373 - while ((bus = pci_find_next_bus(bus)) != NULL) {
1374 - if (bus->number == busnum) {
1375 - /* Already scanned */
1376 -diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
1377 -index 3de9f9b..f1bf4e5 100644
1378 ---- a/arch/x86/pci/init.c
1379 -+++ b/arch/x86/pci/init.c
1380 -@@ -32,6 +32,8 @@ static __init int pci_access_init(void)
1381 - printk(KERN_ERR
1382 - "PCI: Fatal: No config space access function found\n");
1383 -
1384 -+ dmi_check_pciprobe();
1385 -+
1386 - return 0;
1387 - }
1388 - arch_initcall(pci_access_init);
1389 -diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
1390 -index 3431518..95e5675 100644
1391 ---- a/arch/x86/pci/pci.h
1392 -+++ b/arch/x86/pci/pci.h
1393 -@@ -39,6 +39,8 @@ enum pci_bf_sort_state {
1394 - pci_dmi_bf,
1395 - };
1396 -
1397 -+extern void __init dmi_check_pciprobe(void);
1398 -+
1399 - /* pci-i386.c */
1400 -
1401 - extern unsigned int pcibios_max_latency;
1402 -diff --git a/crypto/authenc.c b/crypto/authenc.c
1403 -index ed8ac5a..4b22676 100644
1404 ---- a/crypto/authenc.c
1405 -+++ b/crypto/authenc.c
1406 -@@ -217,9 +217,10 @@ static void crypto_authenc_givencrypt_done(struct crypto_async_request *req,
1407 - int err)
1408 - {
1409 - if (!err) {
1410 -- struct aead_givcrypt_request *greq = req->data;
1411 -+ struct aead_request *areq = req->data;
1412 -+ struct skcipher_givcrypt_request *greq = aead_request_ctx(areq);
1413 -
1414 -- err = crypto_authenc_genicv(&greq->areq, greq->giv, 0);
1415 -+ err = crypto_authenc_genicv(areq, greq->giv, 0);
1416 - }
1417 -
1418 - aead_request_complete(req->data, err);
1419 -diff --git a/crypto/cryptd.c b/crypto/cryptd.c
1420 -index 2504252..b150de5 100644
1421 ---- a/crypto/cryptd.c
1422 -+++ b/crypto/cryptd.c
1423 -@@ -190,8 +190,10 @@ static struct crypto_instance *cryptd_alloc_instance(struct crypto_alg *alg,
1424 - int err;
1425 -
1426 - inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
1427 -- if (IS_ERR(inst))
1428 -+ if (!inst) {
1429 -+ inst = ERR_PTR(-ENOMEM);
1430 - goto out;
1431 -+ }
1432 -
1433 - err = -ENAMETOOLONG;
1434 - if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME,
1435 -diff --git a/crypto/eseqiv.c b/crypto/eseqiv.c
1436 -index b14f14e..881d309 100644
1437 ---- a/crypto/eseqiv.c
1438 -+++ b/crypto/eseqiv.c
1439 -@@ -136,7 +136,8 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
1440 - }
1441 -
1442 - ablkcipher_request_set_crypt(subreq, reqctx->src, dst,
1443 -- req->creq.nbytes, req->creq.info);
1444 -+ req->creq.nbytes + ivsize,
1445 -+ req->creq.info);
1446 -
1447 - memcpy(req->creq.info, ctx->salt, ivsize);
1448 -
1449 -diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
1450 -index 788da97..836362b 100644
1451 ---- a/drivers/acpi/processor_idle.c
1452 -+++ b/drivers/acpi/processor_idle.c
1453 -@@ -848,6 +848,7 @@ static int acpi_processor_get_power_info_default(struct acpi_processor *pr)
1454 - /* all processors need to support C1 */
1455 - pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
1456 - pr->power.states[ACPI_STATE_C1].valid = 1;
1457 -+ pr->power.states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_HALT;
1458 - }
1459 - /* the C0 state only exists as a filler in our array */
1460 - pr->power.states[ACPI_STATE_C0].valid = 1;
1461 -@@ -960,6 +961,9 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
1462 - cx.address);
1463 - }
1464 -
1465 -+ if (cx.type == ACPI_STATE_C1) {
1466 -+ cx.valid = 1;
1467 -+ }
1468 -
1469 - obj = &(element->package.elements[2]);
1470 - if (obj->type != ACPI_TYPE_INTEGER)
1471 -diff --git a/drivers/md/md.c b/drivers/md/md.c
1472 -index 61ccbd2..9f6d228 100644
1473 ---- a/drivers/md/md.c
1474 -+++ b/drivers/md/md.c
1475 -@@ -2096,7 +2096,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
1476 - rv = -EBUSY;
1477 - else
1478 - rv = entry->store(rdev, page, length);
1479 -- mddev_unlock(rdev->mddev);
1480 -+ mddev_unlock(mddev);
1481 - }
1482 - return rv;
1483 - }
1484 -diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
1485 -index f13346b..44ebdea 100644
1486 ---- a/drivers/net/wireless/b43/b43.h
1487 -+++ b/drivers/net/wireless/b43/b43.h
1488 -@@ -628,6 +628,10 @@ struct b43_wl {
1489 -
1490 - struct mutex mutex;
1491 - spinlock_t irq_lock;
1492 -+ /* R/W lock for data transmission.
1493 -+ * Transmissions on 2+ queues can run concurrently, but somebody else
1494 -+ * might sync with TX by write_lock_irqsave()'ing. */
1495 -+ rwlock_t tx_lock;
1496 - /* Lock for LEDs access. */
1497 - spinlock_t leds_lock;
1498 - /* Lock for SHM access. */
1499 -diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
1500 -index f23317e..e0055d0 100644
1501 ---- a/drivers/net/wireless/b43/main.c
1502 -+++ b/drivers/net/wireless/b43/main.c
1503 -@@ -622,6 +622,7 @@ static void b43_synchronize_irq(struct b43_wldev *dev)
1504 - */
1505 - void b43_dummy_transmission(struct b43_wldev *dev)
1506 - {
1507 -+ struct b43_wl *wl = dev->wl;
1508 - struct b43_phy *phy = &dev->phy;
1509 - unsigned int i, max_loop;
1510 - u16 value;
1511 -@@ -648,6 +649,9 @@ void b43_dummy_transmission(struct b43_wldev *dev)
1512 - return;
1513 - }
1514 -
1515 -+ spin_lock_irq(&wl->irq_lock);
1516 -+ write_lock(&wl->tx_lock);
1517 -+
1518 - for (i = 0; i < 5; i++)
1519 - b43_ram_write(dev, i * 4, buffer[i]);
1520 -
1521 -@@ -688,6 +692,9 @@ void b43_dummy_transmission(struct b43_wldev *dev)
1522 - }
1523 - if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5)
1524 - b43_radio_write16(dev, 0x0051, 0x0037);
1525 -+
1526 -+ write_unlock(&wl->tx_lock);
1527 -+ spin_unlock_irq(&wl->irq_lock);
1528 - }
1529 -
1530 - static void key_write(struct b43_wldev *dev,
1531 -@@ -2592,15 +2599,21 @@ static int b43_op_tx(struct ieee80211_hw *hw,
1532 - {
1533 - struct b43_wl *wl = hw_to_b43_wl(hw);
1534 - struct b43_wldev *dev = wl->current_dev;
1535 -- int err = -ENODEV;
1536 -+ unsigned long flags;
1537 -+ int err;
1538 -
1539 - if (unlikely(!dev))
1540 -- goto out;
1541 -- if (unlikely(b43_status(dev) < B43_STAT_STARTED))
1542 -- goto out;
1543 -- /* DMA-TX is done without a global lock. */
1544 -- err = b43_dma_tx(dev, skb, ctl);
1545 --out:
1546 -+ return NETDEV_TX_BUSY;
1547 -+
1548 -+ /* Transmissions on seperate queues can run concurrently. */
1549 -+ read_lock_irqsave(&wl->tx_lock, flags);
1550 -+
1551 -+ err = -ENODEV;
1552 -+ if (likely(b43_status(dev) >= B43_STAT_STARTED))
1553 -+ err = b43_dma_tx(dev, skb, ctl);
1554 -+
1555 -+ read_unlock_irqrestore(&wl->tx_lock, flags);
1556 -+
1557 - if (unlikely(err))
1558 - return NETDEV_TX_BUSY;
1559 - return NETDEV_TX_OK;
1560 -@@ -3109,7 +3122,9 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
1561 - spin_unlock_irqrestore(&wl->irq_lock, flags);
1562 - b43_synchronize_irq(dev);
1563 -
1564 -+ write_lock_irqsave(&wl->tx_lock, flags);
1565 - b43_set_status(dev, B43_STAT_INITIALIZED);
1566 -+ write_unlock_irqrestore(&wl->tx_lock, flags);
1567 -
1568 - mutex_unlock(&wl->mutex);
1569 - /* Must unlock as it would otherwise deadlock. No races here.
1570 -@@ -3117,8 +3132,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
1571 - cancel_delayed_work_sync(&dev->periodic_work);
1572 - mutex_lock(&wl->mutex);
1573 -
1574 -- ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy.
1575 --
1576 - b43_mac_suspend(dev);
1577 - free_irq(dev->dev->irq, dev);
1578 - b43dbg(wl, "Wireless interface stopped\n");
1579 -@@ -3912,6 +3925,14 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
1580 - err = -EOPNOTSUPP;
1581 - goto err_powerdown;
1582 - }
1583 -+ if (1 /* disable A-PHY */) {
1584 -+ /* FIXME: For now we disable the A-PHY on multi-PHY devices. */
1585 -+ if (dev->phy.type != B43_PHYTYPE_N) {
1586 -+ have_2ghz_phy = 1;
1587 -+ have_5ghz_phy = 0;
1588 -+ }
1589 -+ }
1590 -+
1591 - dev->phy.gmode = have_2ghz_phy;
1592 - tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0;
1593 - b43_wireless_core_reset(dev, tmp);
1594 -@@ -4076,6 +4097,7 @@ static int b43_wireless_init(struct ssb_device *dev)
1595 - memset(wl, 0, sizeof(*wl));
1596 - wl->hw = hw;
1597 - spin_lock_init(&wl->irq_lock);
1598 -+ rwlock_init(&wl->tx_lock);
1599 - spin_lock_init(&wl->leds_lock);
1600 - spin_lock_init(&wl->shm_lock);
1601 - mutex_init(&wl->mutex);
1602 -diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
1603 -index d93b357..7a3625f 100644
1604 ---- a/drivers/serial/mpc52xx_uart.c
1605 -+++ b/drivers/serial/mpc52xx_uart.c
1606 -@@ -1221,8 +1221,8 @@ static struct of_device_id mpc52xx_uart_of_match[] = {
1607 - #endif
1608 - #ifdef CONFIG_PPC_MPC512x
1609 - { .compatible = "fsl,mpc5121-psc-uart", .data = &mpc512x_psc_ops, },
1610 -- {},
1611 - #endif
1612 -+ {},
1613 - };
1614 -
1615 - static int __devinit
1616 -diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
1617 -index e0f0f09..9f877ab 100644
1618 ---- a/fs/reiserfs/ioctl.c
1619 -+++ b/fs/reiserfs/ioctl.c
1620 -@@ -11,8 +11,6 @@
1621 - #include <linux/smp_lock.h>
1622 - #include <linux/compat.h>
1623 -
1624 --static int reiserfs_unpack(struct inode *inode, struct file *filp);
1625 --
1626 - /*
1627 - ** reiserfs_ioctl - handler for ioctl for inode
1628 - ** supported commands:
1629 -@@ -140,7 +138,7 @@ int reiserfs_prepare_write(struct file *f, struct page *page,
1630 - ** Function try to convert tail from direct item into indirect.
1631 - ** It set up nopack attribute in the REISERFS_I(inode)->nopack
1632 - */
1633 --static int reiserfs_unpack(struct inode *inode, struct file *filp)
1634 -+int reiserfs_unpack(struct inode *inode, struct file *filp)
1635 - {
1636 - int retval = 0;
1637 - int index;
1638 -diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
1639 -index 393cc22..3302259 100644
1640 ---- a/fs/reiserfs/super.c
1641 -+++ b/fs/reiserfs/super.c
1642 -@@ -2019,6 +2019,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
1643 - {
1644 - int err;
1645 - struct nameidata nd;
1646 -+ struct inode *inode;
1647 -
1648 - if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA)))
1649 - return -EINVAL;
1650 -@@ -2030,12 +2031,18 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
1651 - path_put(&nd.path);
1652 - return -EXDEV;
1653 - }
1654 -+ inode = nd.path.dentry->d_inode;
1655 - /* We must not pack tails for quota files on reiserfs for quota IO to work */
1656 -- if (!(REISERFS_I(nd.path.dentry->d_inode)->i_flags & i_nopack_mask)) {
1657 -- reiserfs_warning(sb,
1658 -- "reiserfs: Quota file must have tail packing disabled.");
1659 -- path_put(&nd.path);
1660 -- return -EINVAL;
1661 -+ if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) {
1662 -+ err = reiserfs_unpack(inode, NULL);
1663 -+ if (err) {
1664 -+ reiserfs_warning(sb,
1665 -+ "reiserfs: Unpacking tail of quota file failed"
1666 -+ " (%d). Cannot turn on quotas.", err);
1667 -+ path_put(&nd.path);
1668 -+ return -EINVAL;
1669 -+ }
1670 -+ mark_inode_dirty(inode);
1671 - }
1672 - /* Not journalling quota? No more tests needed... */
1673 - if (!REISERFS_SB(sb)->s_qf_names[USRQUOTA] &&
1674 -diff --git a/fs/utimes.c b/fs/utimes.c
1675 -index b18da9c..80a481e 100644
1676 ---- a/fs/utimes.c
1677 -+++ b/fs/utimes.c
1678 -@@ -39,9 +39,14 @@ asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times)
1679 -
1680 - #endif
1681 -
1682 -+static bool nsec_special(long nsec)
1683 -+{
1684 -+ return nsec == UTIME_OMIT || nsec == UTIME_NOW;
1685 -+}
1686 -+
1687 - static bool nsec_valid(long nsec)
1688 - {
1689 -- if (nsec == UTIME_OMIT || nsec == UTIME_NOW)
1690 -+ if (nsec_special(nsec))
1691 - return true;
1692 -
1693 - return nsec >= 0 && nsec <= 999999999;
1694 -@@ -115,7 +120,15 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
1695 - newattrs.ia_mtime.tv_nsec = times[1].tv_nsec;
1696 - newattrs.ia_valid |= ATTR_MTIME_SET;
1697 - }
1698 -- } else {
1699 -+ }
1700 -+
1701 -+ /*
1702 -+ * If times is NULL or both times are either UTIME_OMIT or
1703 -+ * UTIME_NOW, then need to check permissions, because
1704 -+ * inode_change_ok() won't do it.
1705 -+ */
1706 -+ if (!times || (nsec_special(times[0].tv_nsec) &&
1707 -+ nsec_special(times[1].tv_nsec))) {
1708 - error = -EACCES;
1709 - if (IS_IMMUTABLE(inode))
1710 - goto dput_and_out;
1711 -diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h
1712 -index 224658b..833d208 100644
1713 ---- a/include/crypto/scatterwalk.h
1714 -+++ b/include/crypto/scatterwalk.h
1715 -@@ -57,10 +57,14 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num,
1716 - struct scatterlist *sg2)
1717 - {
1718 - sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0);
1719 -+ sg1[num - 1].page_link &= ~0x02;
1720 - }
1721 -
1722 - static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
1723 - {
1724 -+ if (sg_is_last(sg))
1725 -+ return NULL;
1726 -+
1727 - return (++sg)->length ? sg : (void *)sg_page(sg);
1728 - }
1729 -
1730 -diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
1731 -index 8e7eff2..4aacaee 100644
1732 ---- a/include/linux/reiserfs_fs.h
1733 -+++ b/include/linux/reiserfs_fs.h
1734 -@@ -2176,6 +2176,7 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp,
1735 - unsigned int cmd, unsigned long arg);
1736 - long reiserfs_compat_ioctl(struct file *filp,
1737 - unsigned int cmd, unsigned long arg);
1738 -+int reiserfs_unpack(struct inode *inode, struct file *filp);
1739 -
1740 - /* ioctl's command */
1741 - #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
1742 -diff --git a/kernel/sched.c b/kernel/sched.c
1743 -index 8dcdec6..1e4596c 100644
1744 ---- a/kernel/sched.c
1745 -+++ b/kernel/sched.c
1746 -@@ -876,6 +876,7 @@ static inline void resched_rq(struct rq *rq)
1747 - enum {
1748 - HRTICK_SET, /* re-programm hrtick_timer */
1749 - HRTICK_RESET, /* not a new slice */
1750 -+ HRTICK_BLOCK, /* stop hrtick operations */
1751 - };
1752 -
1753 - /*
1754 -@@ -887,6 +888,8 @@ static inline int hrtick_enabled(struct rq *rq)
1755 - {
1756 - if (!sched_feat(HRTICK))
1757 - return 0;
1758 -+ if (unlikely(test_bit(HRTICK_BLOCK, &rq->hrtick_flags)))
1759 -+ return 0;
1760 - return hrtimer_is_hres_active(&rq->hrtick_timer);
1761 - }
1762 -
1763 -@@ -969,7 +972,63 @@ static enum hrtimer_restart hrtick(struct hrtimer *timer)
1764 - return HRTIMER_NORESTART;
1765 - }
1766 -
1767 --static inline void init_rq_hrtick(struct rq *rq)
1768 -+static void hotplug_hrtick_disable(int cpu)
1769 -+{
1770 -+ struct rq *rq = cpu_rq(cpu);
1771 -+ unsigned long flags;
1772 -+
1773 -+ spin_lock_irqsave(&rq->lock, flags);
1774 -+ rq->hrtick_flags = 0;
1775 -+ __set_bit(HRTICK_BLOCK, &rq->hrtick_flags);
1776 -+ spin_unlock_irqrestore(&rq->lock, flags);
1777 -+
1778 -+ hrtick_clear(rq);
1779 -+}
1780 -+
1781 -+static void hotplug_hrtick_enable(int cpu)
1782 -+{
1783 -+ struct rq *rq = cpu_rq(cpu);
1784 -+ unsigned long flags;
1785 -+
1786 -+ spin_lock_irqsave(&rq->lock, flags);
1787 -+ __clear_bit(HRTICK_BLOCK, &rq->hrtick_flags);
1788 -+ spin_unlock_irqrestore(&rq->lock, flags);
1789 -+}
1790 -+
1791 -+static int
1792 -+hotplug_hrtick(struct notifier_block *nfb, unsigned long action, void *hcpu)
1793 -+{
1794 -+ int cpu = (int)(long)hcpu;
1795 -+
1796 -+ switch (action) {
1797 -+ case CPU_UP_CANCELED:
1798 -+ case CPU_UP_CANCELED_FROZEN:
1799 -+ case CPU_DOWN_PREPARE:
1800 -+ case CPU_DOWN_PREPARE_FROZEN:
1801 -+ case CPU_DEAD:
1802 -+ case CPU_DEAD_FROZEN:
1803 -+ hotplug_hrtick_disable(cpu);
1804 -+ return NOTIFY_OK;
1805 -+
1806 -+ case CPU_UP_PREPARE:
1807 -+ case CPU_UP_PREPARE_FROZEN:
1808 -+ case CPU_DOWN_FAILED:
1809 -+ case CPU_DOWN_FAILED_FROZEN:
1810 -+ case CPU_ONLINE:
1811 -+ case CPU_ONLINE_FROZEN:
1812 -+ hotplug_hrtick_enable(cpu);
1813 -+ return NOTIFY_OK;
1814 -+ }
1815 -+
1816 -+ return NOTIFY_DONE;
1817 -+}
1818 -+
1819 -+static void init_hrtick(void)
1820 -+{
1821 -+ hotcpu_notifier(hotplug_hrtick, 0);
1822 -+}
1823 -+
1824 -+static void init_rq_hrtick(struct rq *rq)
1825 - {
1826 - rq->hrtick_flags = 0;
1827 - hrtimer_init(&rq->hrtick_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
1828 -@@ -1006,6 +1065,10 @@ static inline void init_rq_hrtick(struct rq *rq)
1829 - void hrtick_resched(void)
1830 - {
1831 - }
1832 -+
1833 -+static inline void init_hrtick(void)
1834 -+{
1835 -+}
1836 - #endif
1837 -
1838 - /*
1839 -@@ -7094,6 +7157,7 @@ void __init sched_init_smp(void)
1840 - put_online_cpus();
1841 - /* XXX: Theoretical race here - CPU may be hotplugged now */
1842 - hotcpu_notifier(update_sched_domains, 0);
1843 -+ init_hrtick();
1844 -
1845 - /* Move init over to a non-isolated CPU */
1846 - if (set_cpus_allowed(current, non_isolated_cpus) < 0)
1847 -diff --git a/mm/page_alloc.c b/mm/page_alloc.c
1848 -index 402a504..55443c2 100644
1849 ---- a/mm/page_alloc.c
1850 -+++ b/mm/page_alloc.c
1851 -@@ -2518,7 +2518,9 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
1852 - struct page *page;
1853 - unsigned long end_pfn = start_pfn + size;
1854 - unsigned long pfn;
1855 -+ struct zone *z;
1856 -
1857 -+ z = &NODE_DATA(nid)->node_zones[zone];
1858 - for (pfn = start_pfn; pfn < end_pfn; pfn++) {
1859 - /*
1860 - * There can be holes in boot-time mem_map[]s
1861 -@@ -2536,7 +2538,6 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
1862 - init_page_count(page);
1863 - reset_page_mapcount(page);
1864 - SetPageReserved(page);
1865 --
1866 - /*
1867 - * Mark the block movable so that blocks are reserved for
1868 - * movable at startup. This will force kernel allocations
1869 -@@ -2545,8 +2546,15 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
1870 - * kernel allocations are made. Later some blocks near
1871 - * the start are marked MIGRATE_RESERVE by
1872 - * setup_zone_migrate_reserve()
1873 -+ *
1874 -+ * bitmap is created for zone's valid pfn range. but memmap
1875 -+ * can be created for invalid pages (for alignment)
1876 -+ * check here not to call set_pageblock_migratetype() against
1877 -+ * pfn out of zone.
1878 - */
1879 -- if ((pfn & (pageblock_nr_pages-1)))
1880 -+ if ((z->zone_start_pfn <= pfn)
1881 -+ && (pfn < z->zone_start_pfn + z->spanned_pages)
1882 -+ && !(pfn & (pageblock_nr_pages - 1)))
1883 - set_pageblock_migratetype(page, MIGRATE_MOVABLE);
1884 -
1885 - INIT_LIST_HEAD(&page->lru);
1886 -@@ -4460,6 +4468,8 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
1887 - pfn = page_to_pfn(page);
1888 - bitmap = get_pageblock_bitmap(zone, pfn);
1889 - bitidx = pfn_to_bitidx(zone, pfn);
1890 -+ VM_BUG_ON(pfn < zone->zone_start_pfn);
1891 -+ VM_BUG_ON(pfn >= zone->zone_start_pfn + zone->spanned_pages);
1892 -
1893 - for (; start_bitidx <= end_bitidx; start_bitidx++, value <<= 1)
1894 - if (flags & value)
1895 -diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
1896 -index 1656c00..4de86c4 100644
1897 ---- a/net/ipv6/sit.c
1898 -+++ b/net/ipv6/sit.c
1899 -@@ -446,9 +446,9 @@ static int ipip6_rcv(struct sk_buff *skb)
1900 - }
1901 -
1902 - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
1903 -- kfree_skb(skb);
1904 - read_unlock(&ipip6_lock);
1905 - out:
1906 -+ kfree_skb(skb);
1907 - return 0;
1908 - }
1909 -
1910
1911 Deleted: genpatches-2.6/trunk/2.6.26/1003_linux-2.6.25.4.patch
1912 ===================================================================
1913 --- genpatches-2.6/trunk/2.6.26/1003_linux-2.6.25.4.patch 2008-07-17 02:44:10 UTC (rev 1328)
1914 +++ genpatches-2.6/trunk/2.6.26/1003_linux-2.6.25.4.patch 2008-07-17 02:47:50 UTC (rev 1329)
1915 @@ -1,2909 +0,0 @@
1916 -diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
1917 -index c2eed8f..1ea92e7 100644
1918 ---- a/arch/sparc/kernel/entry.S
1919 -+++ b/arch/sparc/kernel/entry.S
1920 -@@ -1398,6 +1398,8 @@ ret_from_fork:
1921 - .align 4
1922 - .globl linux_sparc_syscall
1923 - linux_sparc_syscall:
1924 -+ sethi %hi(PSR_SYSCALL), %l4
1925 -+ or %l0, %l4, %l0
1926 - /* Direct access to user regs, must faster. */
1927 - cmp %g1, NR_SYSCALLS
1928 - bgeu linux_sparc_ni_syscall
1929 -diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
1930 -index 70c0dd2..a65aed3 100644
1931 ---- a/arch/sparc/kernel/process.c
1932 -+++ b/arch/sparc/kernel/process.c
1933 -@@ -421,14 +421,26 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
1934 - unsigned long stack_size)
1935 - {
1936 - unsigned long parent_tid_ptr, child_tid_ptr;
1937 -+ unsigned long orig_i1 = regs->u_regs[UREG_I1];
1938 -+ long ret;
1939 -
1940 - parent_tid_ptr = regs->u_regs[UREG_I2];
1941 - child_tid_ptr = regs->u_regs[UREG_I4];
1942 -
1943 -- return do_fork(clone_flags, stack_start,
1944 -- regs, stack_size,
1945 -- (int __user *) parent_tid_ptr,
1946 -- (int __user *) child_tid_ptr);
1947 -+ ret = do_fork(clone_flags, stack_start,
1948 -+ regs, stack_size,
1949 -+ (int __user *) parent_tid_ptr,
1950 -+ (int __user *) child_tid_ptr);
1951 -+
1952 -+ /* If we get an error and potentially restart the system
1953 -+ * call, we're screwed because copy_thread() clobbered
1954 -+ * the parent's %o1. So detect that case and restore it
1955 -+ * here.
1956 -+ */
1957 -+ if ((unsigned long)ret >= -ERESTART_RESTARTBLOCK)
1958 -+ regs->u_regs[UREG_I1] = orig_i1;
1959 -+
1960 -+ return ret;
1961 - }
1962 -
1963 - /* Copy a Sparc thread. The fork() return value conventions
1964 -@@ -628,11 +640,6 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
1965 - (char __user * __user *)regs->u_regs[base + UREG_I2],
1966 - regs);
1967 - putname(filename);
1968 -- if (error == 0) {
1969 -- task_lock(current);
1970 -- current->ptrace &= ~PT_DTRACE;
1971 -- task_unlock(current);
1972 -- }
1973 - out:
1974 - return error;
1975 - }
1976 -diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c
1977 -index 7f44ae6..81f3b92 100644
1978 ---- a/arch/sparc/kernel/ptrace.c
1979 -+++ b/arch/sparc/kernel/ptrace.c
1980 -@@ -170,8 +170,8 @@ static int genregs32_set(struct task_struct *target,
1981 - switch (pos) {
1982 - case 32: /* PSR */
1983 - psr = regs->psr;
1984 -- psr &= ~PSR_ICC;
1985 -- psr |= (reg & PSR_ICC);
1986 -+ psr &= ~(PSR_ICC | PSR_SYSCALL);
1987 -+ psr |= (reg & (PSR_ICC | PSR_SYSCALL));
1988 - regs->psr = psr;
1989 - break;
1990 - case 33: /* PC */
1991 -@@ -441,6 +441,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
1992 - break;
1993 -
1994 - default:
1995 -+ if (request == PTRACE_SPARC_DETACH)
1996 -+ request = PTRACE_DETACH;
1997 - ret = ptrace_request(child, request, addr, data);
1998 - break;
1999 - }
2000 -diff --git a/arch/sparc/kernel/rtrap.S b/arch/sparc/kernel/rtrap.S
2001 -index 77ca6fd..ab818cd 100644
2002 ---- a/arch/sparc/kernel/rtrap.S
2003 -+++ b/arch/sparc/kernel/rtrap.S
2004 -@@ -50,8 +50,9 @@ rtrap_7win_patch5: and %g1, 0x7f, %g1
2005 - ret_trap_entry:
2006 - ret_trap_lockless_ipi:
2007 - andcc %t_psr, PSR_PS, %g0
2008 -+ sethi %hi(PSR_SYSCALL), %g1
2009 - be 1f
2010 -- nop
2011 -+ andn %t_psr, %g1, %t_psr
2012 -
2013 - wr %t_psr, 0x0, %psr
2014 - b ret_trap_kernel
2015 -@@ -73,7 +74,6 @@ signal_p:
2016 - ld [%sp + STACKFRAME_SZ + PT_PSR], %t_psr
2017 -
2018 - mov %l5, %o1
2019 -- mov %l6, %o2
2020 - call do_signal
2021 - add %sp, STACKFRAME_SZ, %o0 ! pt_regs ptr
2022 -
2023 -@@ -81,6 +81,8 @@ signal_p:
2024 - ld [%sp + STACKFRAME_SZ + PT_PSR], %t_psr
2025 - clr %l6
2026 - ret_trap_continue:
2027 -+ sethi %hi(PSR_SYSCALL), %g1
2028 -+ andn %t_psr, %g1, %t_psr
2029 - wr %t_psr, 0x0, %psr
2030 - WRITE_PAUSE
2031 -
2032 -@@ -137,8 +139,9 @@ ret_trap_userwins_ok:
2033 - LOAD_PT_PRIV(sp, t_psr, t_pc, t_npc)
2034 - or %t_pc, %t_npc, %g2
2035 - andcc %g2, 0x3, %g0
2036 -+ sethi %hi(PSR_SYSCALL), %g2
2037 - be 1f
2038 -- nop
2039 -+ andn %t_psr, %g2, %t_psr
2040 -
2041 - b ret_trap_unaligned_pc
2042 - add %sp, STACKFRAME_SZ, %o0
2043 -@@ -201,6 +204,8 @@ rtrap_patch5: and %g1, 0xff, %g1
2044 - 1:
2045 - LOAD_PT_ALL(sp, t_psr, t_pc, t_npc, g1)
2046 - 2:
2047 -+ sethi %hi(PSR_SYSCALL), %twin_tmp1
2048 -+ andn %t_psr, %twin_tmp1, %t_psr
2049 - wr %t_psr, 0x0, %psr
2050 - WRITE_PAUSE
2051 -
2052 -diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
2053 -index 9994cac..e85023b 100644
2054 ---- a/arch/sparc/kernel/signal.c
2055 -+++ b/arch/sparc/kernel/signal.c
2056 -@@ -178,6 +178,9 @@ static inline void do_new_sigreturn (struct pt_regs *regs)
2057 - regs->psr = (up_psr & ~(PSR_ICC | PSR_EF))
2058 - | (regs->psr & (PSR_ICC | PSR_EF));
2059 -
2060 -+ /* Prevent syscall restart. */
2061 -+ pt_regs_clear_syscall(regs);
2062 -+
2063 - err |= __get_user(fpu_save, &sf->fpu_save);
2064 -
2065 - if (fpu_save)
2066 -@@ -299,6 +302,9 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
2067 -
2068 - regs->psr = (regs->psr & ~PSR_ICC) | (psr & PSR_ICC);
2069 -
2070 -+ /* Prevent syscall restart. */
2071 -+ pt_regs_clear_syscall(regs);
2072 -+
2073 - err |= __get_user(fpu_save, &sf->fpu_save);
2074 -
2075 - if (fpu_save)
2076 -@@ -345,15 +351,29 @@ static inline int invalid_frame_pointer(void __user *fp, int fplen)
2077 -
2078 - static inline void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, unsigned long framesize)
2079 - {
2080 -- unsigned long sp;
2081 -+ unsigned long sp = regs->u_regs[UREG_FP];
2082 -
2083 -- sp = regs->u_regs[UREG_FP];
2084 -+ /*
2085 -+ * If we are on the alternate signal stack and would overflow it, don't.
2086 -+ * Return an always-bogus address instead so we will die with SIGSEGV.
2087 -+ */
2088 -+ if (on_sig_stack(sp) && !likely(on_sig_stack(sp - framesize)))
2089 -+ return (void __user *) -1L;
2090 -
2091 - /* This is the X/Open sanctioned signal stack switching. */
2092 - if (sa->sa_flags & SA_ONSTACK) {
2093 -- if (!on_sig_stack(sp) && !((current->sas_ss_sp + current->sas_ss_size) & 7))
2094 -+ if (sas_ss_flags(sp) == 0)
2095 - sp = current->sas_ss_sp + current->sas_ss_size;
2096 - }
2097 -+
2098 -+ /* Always align the stack frame. This handles two cases. First,
2099 -+ * sigaltstack need not be mindful of platform specific stack
2100 -+ * alignment. Second, if we took this signal because the stack
2101 -+ * is not aligned properly, we'd like to take the signal cleanly
2102 -+ * and report that.
2103 -+ */
2104 -+ sp &= ~7UL;
2105 -+
2106 - return (void __user *)(sp - framesize);
2107 - }
2108 -
2109 -@@ -994,13 +1014,13 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
2110 - * want to handle. Thus you cannot kill init even with a SIGKILL even by
2111 - * mistake.
2112 - */
2113 --asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0, int restart_syscall)
2114 -+asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0)
2115 - {
2116 -- siginfo_t info;
2117 -- struct sparc_deliver_cookie cookie;
2118 - struct k_sigaction ka;
2119 -- int signr;
2120 -+ int restart_syscall;
2121 - sigset_t *oldset;
2122 -+ siginfo_t info;
2123 -+ int signr;
2124 -
2125 - /*
2126 - * XXX Disable svr4 signal handling until solaris emulation works.
2127 -@@ -1013,18 +1033,28 @@ asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0, int rest
2128 - int svr4_signal = current->personality == PER_SVR4;
2129 - #endif
2130 -
2131 -- cookie.restart_syscall = restart_syscall;
2132 -- cookie.orig_i0 = orig_i0;
2133 -+ if (pt_regs_is_syscall(regs) && (regs->psr & PSR_C))
2134 -+ restart_syscall = 1;
2135 -+ else
2136 -+ restart_syscall = 0;
2137 -
2138 - if (test_thread_flag(TIF_RESTORE_SIGMASK))
2139 - oldset = &current->saved_sigmask;
2140 - else
2141 - oldset = &current->blocked;
2142 -
2143 -- signr = get_signal_to_deliver(&info, &ka, regs, &cookie);
2144 -+ signr = get_signal_to_deliver(&info, &ka, regs, NULL);
2145 -+
2146 -+ /* If the debugger messes with the program counter, it clears
2147 -+ * the software "in syscall" bit, directing us to not perform
2148 -+ * a syscall restart.
2149 -+ */
2150 -+ if (restart_syscall && !pt_regs_is_syscall(regs))
2151 -+ restart_syscall = 0;
2152 -+
2153 - if (signr > 0) {
2154 -- if (cookie.restart_syscall)
2155 -- syscall_restart(cookie.orig_i0, regs, &ka.sa);
2156 -+ if (restart_syscall)
2157 -+ syscall_restart(orig_i0, regs, &ka.sa);
2158 - handle_signal(signr, &ka, &info, oldset,
2159 - regs, svr4_signal);
2160 - /* a signal was successfully delivered; the saved
2161 -@@ -1036,16 +1066,16 @@ asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0, int rest
2162 - clear_thread_flag(TIF_RESTORE_SIGMASK);
2163 - return;
2164 - }
2165 -- if (cookie.restart_syscall &&
2166 -+ if (restart_syscall &&
2167 - (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
2168 - regs->u_regs[UREG_I0] == ERESTARTSYS ||
2169 - regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
2170 - /* replay the system call when we are done */
2171 -- regs->u_regs[UREG_I0] = cookie.orig_i0;
2172 -+ regs->u_regs[UREG_I0] = orig_i0;
2173 - regs->pc -= 4;
2174 - regs->npc -= 4;
2175 - }
2176 -- if (cookie.restart_syscall &&
2177 -+ if (restart_syscall &&
2178 - regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
2179 - regs->u_regs[UREG_G1] = __NR_restart_syscall;
2180 - regs->pc -= 4;
2181 -@@ -1097,27 +1127,3 @@ do_sys_sigstack(struct sigstack __user *ssptr, struct sigstack __user *ossptr,
2182 - out:
2183 - return ret;
2184 - }
2185 --
2186 --void ptrace_signal_deliver(struct pt_regs *regs, void *cookie)
2187 --{
2188 -- struct sparc_deliver_cookie *cp = cookie;
2189 --
2190 -- if (cp->restart_syscall &&
2191 -- (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
2192 -- regs->u_regs[UREG_I0] == ERESTARTSYS ||
2193 -- regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
2194 -- /* replay the system call when we are done */
2195 -- regs->u_regs[UREG_I0] = cp->orig_i0;
2196 -- regs->pc -= 4;
2197 -- regs->npc -= 4;
2198 -- cp->restart_syscall = 0;
2199 -- }
2200 --
2201 -- if (cp->restart_syscall &&
2202 -- regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
2203 -- regs->u_regs[UREG_G1] = __NR_restart_syscall;
2204 -- regs->pc -= 4;
2205 -- regs->npc -= 4;
2206 -- cp->restart_syscall = 0;
2207 -- }
2208 --}
2209 -diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
2210 -index 9f8c8e1..3423d07 100644
2211 ---- a/arch/sparc/kernel/sys_sparc.c
2212 -+++ b/arch/sparc/kernel/sys_sparc.c
2213 -@@ -220,7 +220,7 @@ out:
2214 - return err;
2215 - }
2216 -
2217 --int sparc_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
2218 -+int sparc_mmap_check(unsigned long addr, unsigned long len)
2219 - {
2220 - if (ARCH_SUN4C_SUN4 &&
2221 - (len > 0x20000000 ||
2222 -@@ -296,52 +296,14 @@ asmlinkage unsigned long sparc_mremap(unsigned long addr,
2223 - unsigned long old_len, unsigned long new_len,
2224 - unsigned long flags, unsigned long new_addr)
2225 - {
2226 -- struct vm_area_struct *vma;
2227 - unsigned long ret = -EINVAL;
2228 -- if (ARCH_SUN4C_SUN4) {
2229 -- if (old_len > 0x20000000 || new_len > 0x20000000)
2230 -- goto out;
2231 -- if (addr < 0xe0000000 && addr + old_len > 0x20000000)
2232 -- goto out;
2233 -- }
2234 -- if (old_len > TASK_SIZE - PAGE_SIZE ||
2235 -- new_len > TASK_SIZE - PAGE_SIZE)
2236 -+
2237 -+ if (unlikely(sparc_mmap_check(addr, old_len)))
2238 -+ goto out;
2239 -+ if (unlikely(sparc_mmap_check(new_addr, new_len)))
2240 - goto out;
2241 - down_write(&current->mm->mmap_sem);
2242 -- if (flags & MREMAP_FIXED) {
2243 -- if (ARCH_SUN4C_SUN4 &&
2244 -- new_addr < 0xe0000000 &&
2245 -- new_addr + new_len > 0x20000000)
2246 -- goto out_sem;
2247 -- if (new_addr + new_len > TASK_SIZE - PAGE_SIZE)
2248 -- goto out_sem;
2249 -- } else if ((ARCH_SUN4C_SUN4 && addr < 0xe0000000 &&
2250 -- addr + new_len > 0x20000000) ||
2251 -- addr + new_len > TASK_SIZE - PAGE_SIZE) {
2252 -- unsigned long map_flags = 0;
2253 -- struct file *file = NULL;
2254 --
2255 -- ret = -ENOMEM;
2256 -- if (!(flags & MREMAP_MAYMOVE))
2257 -- goto out_sem;
2258 --
2259 -- vma = find_vma(current->mm, addr);
2260 -- if (vma) {
2261 -- if (vma->vm_flags & VM_SHARED)
2262 -- map_flags |= MAP_SHARED;
2263 -- file = vma->vm_file;
2264 -- }
2265 --
2266 -- new_addr = get_unmapped_area(file, addr, new_len,
2267 -- vma ? vma->vm_pgoff : 0,
2268 -- map_flags);
2269 -- ret = new_addr;
2270 -- if (new_addr & ~PAGE_MASK)
2271 -- goto out_sem;
2272 -- flags |= MREMAP_FIXED;
2273 -- }
2274 - ret = do_mremap(addr, old_len, new_len, flags, new_addr);
2275 --out_sem:
2276 - up_write(&current->mm->mmap_sem);
2277 - out:
2278 - return ret;
2279 -diff --git a/arch/sparc64/kernel/etrap.S b/arch/sparc64/kernel/etrap.S
2280 -index 4b2bf9e..b087e97 100644
2281 ---- a/arch/sparc64/kernel/etrap.S
2282 -+++ b/arch/sparc64/kernel/etrap.S
2283 -@@ -27,11 +27,12 @@
2284 -
2285 - .text
2286 - .align 64
2287 -- .globl etrap, etrap_irq, etraptl1
2288 -+ .globl etrap_syscall, etrap, etrap_irq, etraptl1
2289 - etrap: rdpr %pil, %g2
2290 --etrap_irq:
2291 -- TRAP_LOAD_THREAD_REG(%g6, %g1)
2292 -+etrap_irq: clr %g3
2293 -+etrap_syscall: TRAP_LOAD_THREAD_REG(%g6, %g1)
2294 - rdpr %tstate, %g1
2295 -+ or %g1, %g3, %g1
2296 - sllx %g2, 20, %g3
2297 - andcc %g1, TSTATE_PRIV, %g0
2298 - or %g1, %g3, %g1
2299 -diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
2300 -index eb88bd6..b441a26 100644
2301 ---- a/arch/sparc64/kernel/irq.c
2302 -+++ b/arch/sparc64/kernel/irq.c
2303 -@@ -1,6 +1,6 @@
2304 - /* irq.c: UltraSparc IRQ handling/init/registry.
2305 - *
2306 -- * Copyright (C) 1997, 2007 David S. Miller (davem@×××××××××.net)
2307 -+ * Copyright (C) 1997, 2007, 2008 David S. Miller (davem@×××××××××.net)
2308 - * Copyright (C) 1998 Eddie C. Dost (ecd@××××××.be)
2309 - * Copyright (C) 1998 Jakub Jelinek (jj@×××××××××××.cz)
2310 - */
2311 -@@ -308,6 +308,7 @@ static void sun4u_irq_enable(unsigned int virt_irq)
2312 - IMAP_AID_SAFARI | IMAP_NID_SAFARI);
2313 - val |= tid | IMAP_VALID;
2314 - upa_writeq(val, imap);
2315 -+ upa_writeq(ICLR_IDLE, data->iclr);
2316 - }
2317 - }
2318 -
2319 -diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
2320 -index 545356b..39f0c46 100644
2321 ---- a/arch/sparc64/kernel/pci.c
2322 -+++ b/arch/sparc64/kernel/pci.c
2323 -@@ -351,8 +351,7 @@ static void pci_parse_of_addrs(struct of_device *op,
2324 -
2325 - struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
2326 - struct device_node *node,
2327 -- struct pci_bus *bus, int devfn,
2328 -- int host_controller)
2329 -+ struct pci_bus *bus, int devfn)
2330 - {
2331 - struct dev_archdata *sd;
2332 - struct pci_dev *dev;
2333 -@@ -389,43 +388,28 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
2334 - dev->devfn = devfn;
2335 - dev->multifunction = 0; /* maybe a lie? */
2336 -
2337 -- if (host_controller) {
2338 -- if (tlb_type != hypervisor) {
2339 -- pci_read_config_word(dev, PCI_VENDOR_ID,
2340 -- &dev->vendor);
2341 -- pci_read_config_word(dev, PCI_DEVICE_ID,
2342 -- &dev->device);
2343 -- } else {
2344 -- dev->vendor = PCI_VENDOR_ID_SUN;
2345 -- dev->device = 0x80f0;
2346 -- }
2347 -- dev->cfg_size = 256;
2348 -- dev->class = PCI_CLASS_BRIDGE_HOST << 8;
2349 -- sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
2350 -- 0x00, PCI_SLOT(devfn), PCI_FUNC(devfn));
2351 -- } else {
2352 -- dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff);
2353 -- dev->device = of_getintprop_default(node, "device-id", 0xffff);
2354 -- dev->subsystem_vendor =
2355 -- of_getintprop_default(node, "subsystem-vendor-id", 0);
2356 -- dev->subsystem_device =
2357 -- of_getintprop_default(node, "subsystem-id", 0);
2358 --
2359 -- dev->cfg_size = pci_cfg_space_size(dev);
2360 --
2361 -- /* We can't actually use the firmware value, we have
2362 -- * to read what is in the register right now. One
2363 -- * reason is that in the case of IDE interfaces the
2364 -- * firmware can sample the value before the the IDE
2365 -- * interface is programmed into native mode.
2366 -- */
2367 -- pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
2368 -- dev->class = class >> 8;
2369 -- dev->revision = class & 0xff;
2370 -+ dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff);
2371 -+ dev->device = of_getintprop_default(node, "device-id", 0xffff);
2372 -+ dev->subsystem_vendor =
2373 -+ of_getintprop_default(node, "subsystem-vendor-id", 0);
2374 -+ dev->subsystem_device =
2375 -+ of_getintprop_default(node, "subsystem-id", 0);
2376 -+
2377 -+ dev->cfg_size = pci_cfg_space_size(dev);
2378 -+
2379 -+ /* We can't actually use the firmware value, we have
2380 -+ * to read what is in the register right now. One
2381 -+ * reason is that in the case of IDE interfaces the
2382 -+ * firmware can sample the value before the the IDE
2383 -+ * interface is programmed into native mode.
2384 -+ */
2385 -+ pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
2386 -+ dev->class = class >> 8;
2387 -+ dev->revision = class & 0xff;
2388 -+
2389 -+ sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
2390 -+ dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
2391 -
2392 -- sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
2393 -- dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
2394 -- }
2395 - if (ofpci_verbose)
2396 - printk(" class: 0x%x device name: %s\n",
2397 - dev->class, pci_name(dev));
2398 -@@ -440,26 +424,21 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
2399 - dev->current_state = 4; /* unknown power state */
2400 - dev->error_state = pci_channel_io_normal;
2401 -
2402 -- if (host_controller) {
2403 -+ if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
2404 -+ /* a PCI-PCI bridge */
2405 - dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
2406 - dev->rom_base_reg = PCI_ROM_ADDRESS1;
2407 -- dev->irq = PCI_IRQ_NONE;
2408 -+ } else if (!strcmp(type, "cardbus")) {
2409 -+ dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
2410 - } else {
2411 -- if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
2412 -- /* a PCI-PCI bridge */
2413 -- dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
2414 -- dev->rom_base_reg = PCI_ROM_ADDRESS1;
2415 -- } else if (!strcmp(type, "cardbus")) {
2416 -- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
2417 -- } else {
2418 -- dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
2419 -- dev->rom_base_reg = PCI_ROM_ADDRESS;
2420 -+ dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
2421 -+ dev->rom_base_reg = PCI_ROM_ADDRESS;
2422 -
2423 -- dev->irq = sd->op->irqs[0];
2424 -- if (dev->irq == 0xffffffff)
2425 -- dev->irq = PCI_IRQ_NONE;
2426 -- }
2427 -+ dev->irq = sd->op->irqs[0];
2428 -+ if (dev->irq == 0xffffffff)
2429 -+ dev->irq = PCI_IRQ_NONE;
2430 - }
2431 -+
2432 - pci_parse_of_addrs(sd->op, node, dev);
2433 -
2434 - if (ofpci_verbose)
2435 -@@ -748,7 +727,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
2436 - prev_devfn = devfn;
2437 -
2438 - /* create a new pci_dev for this device */
2439 -- dev = of_create_pci_dev(pbm, child, bus, devfn, 0);
2440 -+ dev = of_create_pci_dev(pbm, child, bus, devfn);
2441 - if (!dev)
2442 - continue;
2443 - if (ofpci_verbose)
2444 -@@ -795,48 +774,9 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus)
2445 - pci_bus_register_of_sysfs(child_bus);
2446 - }
2447 -
2448 --int pci_host_bridge_read_pci_cfg(struct pci_bus *bus_dev,
2449 -- unsigned int devfn,
2450 -- int where, int size,
2451 -- u32 *value)
2452 --{
2453 -- static u8 fake_pci_config[] = {
2454 -- 0x8e, 0x10, /* Vendor: 0x108e (Sun) */
2455 -- 0xf0, 0x80, /* Device: 0x80f0 (Fire) */
2456 -- 0x46, 0x01, /* Command: 0x0146 (SERR, PARITY, MASTER, MEM) */
2457 -- 0xa0, 0x22, /* Status: 0x02a0 (DEVSEL_MED, FB2B, 66MHZ) */
2458 -- 0x00, 0x00, 0x00, 0x06, /* Class: 0x06000000 host bridge */
2459 -- 0x00, /* Cacheline: 0x00 */
2460 -- 0x40, /* Latency: 0x40 */
2461 -- 0x00, /* Header-Type: 0x00 normal */
2462 -- };
2463 --
2464 -- *value = 0;
2465 -- if (where >= 0 && where < sizeof(fake_pci_config) &&
2466 -- (where + size) >= 0 &&
2467 -- (where + size) < sizeof(fake_pci_config) &&
2468 -- size <= sizeof(u32)) {
2469 -- while (size--) {
2470 -- *value <<= 8;
2471 -- *value |= fake_pci_config[where + size];
2472 -- }
2473 -- }
2474 --
2475 -- return PCIBIOS_SUCCESSFUL;
2476 --}
2477 --
2478 --int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev,
2479 -- unsigned int devfn,
2480 -- int where, int size,
2481 -- u32 value)
2482 --{
2483 -- return PCIBIOS_SUCCESSFUL;
2484 --}
2485 --
2486 - struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm)
2487 - {
2488 - struct device_node *node = pbm->prom_node;
2489 -- struct pci_dev *host_pdev;
2490 - struct pci_bus *bus;
2491 -
2492 - printk("PCI: Scanning PBM %s\n", node->full_name);
2493 -@@ -854,10 +794,6 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm)
2494 - bus->resource[0] = &pbm->io_space;
2495 - bus->resource[1] = &pbm->mem_space;
2496 -
2497 -- /* Create the dummy host bridge and link it in. */
2498 -- host_pdev = of_create_pci_dev(pbm, node, bus, 0x00, 1);
2499 -- bus->self = host_pdev;
2500 --
2501 - pci_of_scan_bus(pbm, node, bus);
2502 - pci_bus_add_devices(bus);
2503 - pci_bus_register_of_sysfs(bus);
2504 -diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
2505 -index 923e0bc..19fa621 100644
2506 ---- a/arch/sparc64/kernel/pci_common.c
2507 -+++ b/arch/sparc64/kernel/pci_common.c
2508 -@@ -264,9 +264,6 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
2509 - unsigned int func = PCI_FUNC(devfn);
2510 - unsigned long ret;
2511 -
2512 -- if (!bus && devfn == 0x00)
2513 -- return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
2514 -- size, value);
2515 - if (config_out_of_range(pbm, bus, devfn, where)) {
2516 - ret = ~0UL;
2517 - } else {
2518 -@@ -300,9 +297,6 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
2519 - unsigned int func = PCI_FUNC(devfn);
2520 - unsigned long ret;
2521 -
2522 -- if (!bus && devfn == 0x00)
2523 -- return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
2524 -- size, value);
2525 - if (config_out_of_range(pbm, bus, devfn, where)) {
2526 - /* Do nothing. */
2527 - } else {
2528 -diff --git a/arch/sparc64/kernel/pci_impl.h b/arch/sparc64/kernel/pci_impl.h
2529 -index 4a50da1..37b4403 100644
2530 ---- a/arch/sparc64/kernel/pci_impl.h
2531 -+++ b/arch/sparc64/kernel/pci_impl.h
2532 -@@ -167,15 +167,6 @@ extern void pci_get_pbm_props(struct pci_pbm_info *pbm);
2533 - extern struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm);
2534 - extern void pci_determine_mem_io_space(struct pci_pbm_info *pbm);
2535 -
2536 --extern int pci_host_bridge_read_pci_cfg(struct pci_bus *bus_dev,
2537 -- unsigned int devfn,
2538 -- int where, int size,
2539 -- u32 *value);
2540 --extern int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev,
2541 -- unsigned int devfn,
2542 -- int where, int size,
2543 -- u32 value);
2544 --
2545 - /* Error reporting support. */
2546 - extern void pci_scan_for_target_abort(struct pci_pbm_info *, struct pci_bus *);
2547 - extern void pci_scan_for_master_abort(struct pci_pbm_info *, struct pci_bus *);
2548 -diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
2549 -index acf8c52..334e64c 100644
2550 ---- a/arch/sparc64/kernel/process.c
2551 -+++ b/arch/sparc64/kernel/process.c
2552 -@@ -507,6 +507,8 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
2553 - unsigned long stack_size)
2554 - {
2555 - int __user *parent_tid_ptr, *child_tid_ptr;
2556 -+ unsigned long orig_i1 = regs->u_regs[UREG_I1];
2557 -+ long ret;
2558 -
2559 - #ifdef CONFIG_COMPAT
2560 - if (test_thread_flag(TIF_32BIT)) {
2561 -@@ -519,9 +521,19 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
2562 - child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
2563 - }
2564 -
2565 -- return do_fork(clone_flags, stack_start,
2566 -- regs, stack_size,
2567 -- parent_tid_ptr, child_tid_ptr);
2568 -+ ret = do_fork(clone_flags, stack_start,
2569 -+ regs, stack_size,
2570 -+ parent_tid_ptr, child_tid_ptr);
2571 -+
2572 -+ /* If we get an error and potentially restart the system
2573 -+ * call, we're screwed because copy_thread() clobbered
2574 -+ * the parent's %o1. So detect that case and restore it
2575 -+ * here.
2576 -+ */
2577 -+ if ((unsigned long)ret >= -ERESTART_RESTARTBLOCK)
2578 -+ regs->u_regs[UREG_I1] = orig_i1;
2579 -+
2580 -+ return ret;
2581 - }
2582 -
2583 - /* Copy a Sparc thread. The fork() return value conventions
2584 -diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
2585 -index e9fc0aa..f6c9fc9 100644
2586 ---- a/arch/sparc64/kernel/ptrace.c
2587 -+++ b/arch/sparc64/kernel/ptrace.c
2588 -@@ -287,11 +287,11 @@ static int genregs64_set(struct task_struct *target,
2589 - 32 * sizeof(u64),
2590 - 33 * sizeof(u64));
2591 - if (!ret) {
2592 -- /* Only the condition codes can be modified
2593 -- * in the %tstate register.
2594 -+ /* Only the condition codes and the "in syscall"
2595 -+ * state can be modified in the %tstate register.
2596 - */
2597 -- tstate &= (TSTATE_ICC | TSTATE_XCC);
2598 -- regs->tstate &= ~(TSTATE_ICC | TSTATE_XCC);
2599 -+ tstate &= (TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL);
2600 -+ regs->tstate &= ~(TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL);
2601 - regs->tstate |= tstate;
2602 - }
2603 - }
2604 -@@ -657,8 +657,10 @@ static int genregs32_set(struct task_struct *target,
2605 - switch (pos) {
2606 - case 32: /* PSR */
2607 - tstate = regs->tstate;
2608 -- tstate &= ~(TSTATE_ICC | TSTATE_XCC);
2609 -+ tstate &= ~(TSTATE_ICC | TSTATE_XCC | TSTATE_SYSCALL);
2610 - tstate |= psr_to_tstate_icc(reg);
2611 -+ if (reg & PSR_SYSCALL)
2612 -+ tstate |= TSTATE_SYSCALL;
2613 - regs->tstate = tstate;
2614 - break;
2615 - case 33: /* PC */
2616 -@@ -944,6 +946,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
2617 - break;
2618 -
2619 - default:
2620 -+ if (request == PTRACE_SPARC_DETACH)
2621 -+ request = PTRACE_DETACH;
2622 - ret = compat_ptrace_request(child, request, addr, data);
2623 - break;
2624 - }
2625 -@@ -1036,6 +1040,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
2626 - break;
2627 -
2628 - default:
2629 -+ if (request == PTRACE_SPARC_DETACH)
2630 -+ request = PTRACE_DETACH;
2631 - ret = ptrace_request(child, request, addr, data);
2632 - break;
2633 - }
2634 -diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
2635 -index 079d18a..5bfa79d 100644
2636 ---- a/arch/sparc64/kernel/rtrap.S
2637 -+++ b/arch/sparc64/kernel/rtrap.S
2638 -@@ -270,6 +270,7 @@ rt_continue: ldx [%sp + PTREGS_OFF + PT_V9_G1], %g1
2639 - wr %o3, %g0, %y
2640 - wrpr %l4, 0x0, %pil
2641 - wrpr %g0, 0x1, %tl
2642 -+ andn %l1, TSTATE_SYSCALL, %l1
2643 - wrpr %l1, %g0, %tstate
2644 - wrpr %l2, %g0, %tpc
2645 - wrpr %o2, %g0, %tnpc
2646 -diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
2647 -index 9d51956..ec016cb 100644
2648 ---- a/arch/sparc64/kernel/signal.c
2649 -+++ b/arch/sparc64/kernel/signal.c
2650 -@@ -336,6 +336,9 @@ void do_rt_sigreturn(struct pt_regs *regs)
2651 - regs->tpc = tpc;
2652 - regs->tnpc = tnpc;
2653 -
2654 -+ /* Prevent syscall restart. */
2655 -+ pt_regs_clear_syscall(regs);
2656 -+
2657 - sigdelsetmask(&set, ~_BLOCKABLE);
2658 - spin_lock_irq(&current->sighand->siglock);
2659 - current->blocked = set;
2660 -@@ -377,16 +380,29 @@ save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
2661 -
2662 - static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, unsigned long framesize)
2663 - {
2664 -- unsigned long sp;
2665 -+ unsigned long sp = regs->u_regs[UREG_FP] + STACK_BIAS;
2666 -
2667 -- sp = regs->u_regs[UREG_FP] + STACK_BIAS;
2668 -+ /*
2669 -+ * If we are on the alternate signal stack and would overflow it, don't.
2670 -+ * Return an always-bogus address instead so we will die with SIGSEGV.
2671 -+ */
2672 -+ if (on_sig_stack(sp) && !likely(on_sig_stack(sp - framesize)))
2673 -+ return (void __user *) -1L;
2674 -
2675 - /* This is the X/Open sanctioned signal stack switching. */
2676 - if (ka->sa.sa_flags & SA_ONSTACK) {
2677 -- if (!on_sig_stack(sp) &&
2678 -- !((current->sas_ss_sp + current->sas_ss_size) & 7))
2679 -+ if (sas_ss_flags(sp) == 0)
2680 - sp = current->sas_ss_sp + current->sas_ss_size;
2681 - }
2682 -+
2683 -+ /* Always align the stack frame. This handles two cases. First,
2684 -+ * sigaltstack need not be mindful of platform specific stack
2685 -+ * alignment. Second, if we took this signal because the stack
2686 -+ * is not aligned properly, we'd like to take the signal cleanly
2687 -+ * and report that.
2688 -+ */
2689 -+ sp &= ~7UL;
2690 -+
2691 - return (void __user *)(sp - framesize);
2692 - }
2693 -
2694 -@@ -487,7 +503,7 @@ static inline void handle_signal(unsigned long signr, struct k_sigaction *ka,
2695 - }
2696 -
2697 - static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
2698 -- struct sigaction *sa)
2699 -+ struct sigaction *sa)
2700 - {
2701 - switch (regs->u_regs[UREG_I0]) {
2702 - case ERESTART_RESTARTBLOCK:
2703 -@@ -511,16 +527,19 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
2704 - * want to handle. Thus you cannot kill init even with a SIGKILL even by
2705 - * mistake.
2706 - */
2707 --static void do_signal(struct pt_regs *regs, unsigned long orig_i0, int restart_syscall)
2708 -+static void do_signal(struct pt_regs *regs, unsigned long orig_i0, int __ignored)
2709 - {
2710 -- siginfo_t info;
2711 -- struct signal_deliver_cookie cookie;
2712 - struct k_sigaction ka;
2713 -- int signr;
2714 -+ int restart_syscall;
2715 - sigset_t *oldset;
2716 -+ siginfo_t info;
2717 -+ int signr;
2718 -
2719 -- cookie.restart_syscall = restart_syscall;
2720 -- cookie.orig_i0 = orig_i0;
2721 -+ if (pt_regs_is_syscall(regs) &&
2722 -+ (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) {
2723 -+ restart_syscall = 1;
2724 -+ } else
2725 -+ restart_syscall = 0;
2726 -
2727 - if (test_thread_flag(TIF_RESTORE_SIGMASK))
2728 - oldset = &current->saved_sigmask;
2729 -@@ -530,16 +549,24 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0, int restart_s
2730 - #ifdef CONFIG_SPARC32_COMPAT
2731 - if (test_thread_flag(TIF_32BIT)) {
2732 - extern void do_signal32(sigset_t *, struct pt_regs *,
2733 -- unsigned long, int);
2734 -- do_signal32(oldset, regs, orig_i0,
2735 -- cookie.restart_syscall);
2736 -+ int restart_syscall,
2737 -+ unsigned long orig_i0);
2738 -+ do_signal32(oldset, regs, restart_syscall, orig_i0);
2739 - return;
2740 - }
2741 - #endif
2742 -
2743 -- signr = get_signal_to_deliver(&info, &ka, regs, &cookie);
2744 -+ signr = get_signal_to_deliver(&info, &ka, regs, NULL);
2745 -+
2746 -+ /* If the debugger messes with the program counter, it clears
2747 -+ * the software "in syscall" bit, directing us to not perform
2748 -+ * a syscall restart.
2749 -+ */
2750 -+ if (restart_syscall && !pt_regs_is_syscall(regs))
2751 -+ restart_syscall = 0;
2752 -+
2753 - if (signr > 0) {
2754 -- if (cookie.restart_syscall)
2755 -+ if (restart_syscall)
2756 - syscall_restart(orig_i0, regs, &ka.sa);
2757 - handle_signal(signr, &ka, &info, oldset, regs);
2758 -
2759 -@@ -552,16 +579,16 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0, int restart_s
2760 - clear_thread_flag(TIF_RESTORE_SIGMASK);
2761 - return;
2762 - }
2763 -- if (cookie.restart_syscall &&
2764 -+ if (restart_syscall &&
2765 - (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
2766 - regs->u_regs[UREG_I0] == ERESTARTSYS ||
2767 - regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
2768 - /* replay the system call when we are done */
2769 -- regs->u_regs[UREG_I0] = cookie.orig_i0;
2770 -+ regs->u_regs[UREG_I0] = orig_i0;
2771 - regs->tpc -= 4;
2772 - regs->tnpc -= 4;
2773 - }
2774 -- if (cookie.restart_syscall &&
2775 -+ if (restart_syscall &&
2776 - regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
2777 - regs->u_regs[UREG_G1] = __NR_restart_syscall;
2778 - regs->tpc -= 4;
2779 -@@ -583,26 +610,3 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, int restart_s
2780 - if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
2781 - do_signal(regs, orig_i0, restart_syscall);
2782 - }
2783 --
2784 --void ptrace_signal_deliver(struct pt_regs *regs, void *cookie)
2785 --{
2786 -- struct signal_deliver_cookie *cp = cookie;
2787 --
2788 -- if (cp->restart_syscall &&
2789 -- (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
2790 -- regs->u_regs[UREG_I0] == ERESTARTSYS ||
2791 -- regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
2792 -- /* replay the system call when we are done */
2793 -- regs->u_regs[UREG_I0] = cp->orig_i0;
2794 -- regs->tpc -= 4;
2795 -- regs->tnpc -= 4;
2796 -- cp->restart_syscall = 0;
2797 -- }
2798 -- if (cp->restart_syscall &&
2799 -- regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
2800 -- regs->u_regs[UREG_G1] = __NR_restart_syscall;
2801 -- regs->tpc -= 4;
2802 -- regs->tnpc -= 4;
2803 -- cp->restart_syscall = 0;
2804 -- }
2805 --}
2806 -diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
2807 -index 8c1c121..c1b06e2 100644
2808 ---- a/arch/sparc64/kernel/signal32.c
2809 -+++ b/arch/sparc64/kernel/signal32.c
2810 -@@ -295,6 +295,9 @@ void do_new_sigreturn32(struct pt_regs *regs)
2811 - regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
2812 - regs->tstate |= psr_to_tstate_icc(psr);
2813 -
2814 -+ /* Prevent syscall restart. */
2815 -+ pt_regs_clear_syscall(regs);
2816 -+
2817 - err |= __get_user(fpu_save, &sf->fpu_save);
2818 - if (fpu_save)
2819 - err |= restore_fpu_state32(regs, &sf->fpu_state);
2820 -@@ -448,6 +451,9 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
2821 - regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
2822 - regs->tstate |= psr_to_tstate_icc(psr);
2823 -
2824 -+ /* Prevent syscall restart. */
2825 -+ pt_regs_clear_syscall(regs);
2826 -+
2827 - err |= __get_user(fpu_save, &sf->fpu_save);
2828 - if (fpu_save)
2829 - err |= restore_fpu_state32(regs, &sf->fpu_state);
2830 -@@ -497,11 +503,27 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns
2831 - regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL;
2832 - sp = regs->u_regs[UREG_FP];
2833 -
2834 -+ /*
2835 -+ * If we are on the alternate signal stack and would overflow it, don't.
2836 -+ * Return an always-bogus address instead so we will die with SIGSEGV.
2837 -+ */
2838 -+ if (on_sig_stack(sp) && !likely(on_sig_stack(sp - framesize)))
2839 -+ return (void __user *) -1L;
2840 -+
2841 - /* This is the X/Open sanctioned signal stack switching. */
2842 - if (sa->sa_flags & SA_ONSTACK) {
2843 -- if (!on_sig_stack(sp) && !((current->sas_ss_sp + current->sas_ss_size) & 7))
2844 -+ if (sas_ss_flags(sp) == 0)
2845 - sp = current->sas_ss_sp + current->sas_ss_size;
2846 - }
2847 -+
2848 -+ /* Always align the stack frame. This handles two cases. First,
2849 -+ * sigaltstack need not be mindful of platform specific stack
2850 -+ * alignment. Second, if we took this signal because the stack
2851 -+ * is not aligned properly, we'd like to take the signal cleanly
2852 -+ * and report that.
2853 -+ */
2854 -+ sp &= ~7UL;
2855 -+
2856 - return (void __user *)(sp - framesize);
2857 - }
2858 -
2859 -@@ -1264,20 +1286,24 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs
2860 - * mistake.
2861 - */
2862 - void do_signal32(sigset_t *oldset, struct pt_regs * regs,
2863 -- unsigned long orig_i0, int restart_syscall)
2864 -+ int restart_syscall, unsigned long orig_i0)
2865 - {
2866 -- siginfo_t info;
2867 -- struct signal_deliver_cookie cookie;
2868 - struct k_sigaction ka;
2869 -+ siginfo_t info;
2870 - int signr;
2871 - int svr4_signal = current->personality == PER_SVR4;
2872 -
2873 -- cookie.restart_syscall = restart_syscall;
2874 -- cookie.orig_i0 = orig_i0;
2875 -+ signr = get_signal_to_deliver(&info, &ka, regs, NULL);
2876 -+
2877 -+ /* If the debugger messes with the program counter, it clears
2878 -+ * the "in syscall" bit, directing us to not perform a syscall
2879 -+ * restart.
2880 -+ */
2881 -+ if (restart_syscall && !pt_regs_is_syscall(regs))
2882 -+ restart_syscall = 0;
2883 -
2884 -- signr = get_signal_to_deliver(&info, &ka, regs, &cookie);
2885 - if (signr > 0) {
2886 -- if (cookie.restart_syscall)
2887 -+ if (restart_syscall)
2888 - syscall_restart32(orig_i0, regs, &ka.sa);
2889 - handle_signal32(signr, &ka, &info, oldset,
2890 - regs, svr4_signal);
2891 -@@ -1291,16 +1317,16 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs,
2892 - clear_thread_flag(TIF_RESTORE_SIGMASK);
2893 - return;
2894 - }
2895 -- if (cookie.restart_syscall &&
2896 -+ if (restart_syscall &&
2897 - (regs->u_regs[UREG_I0] == ERESTARTNOHAND ||
2898 - regs->u_regs[UREG_I0] == ERESTARTSYS ||
2899 - regs->u_regs[UREG_I0] == ERESTARTNOINTR)) {
2900 - /* replay the system call when we are done */
2901 -- regs->u_regs[UREG_I0] = cookie.orig_i0;
2902 -+ regs->u_regs[UREG_I0] = orig_i0;
2903 - regs->tpc -= 4;
2904 - regs->tnpc -= 4;
2905 - }
2906 -- if (cookie.restart_syscall &&
2907 -+ if (restart_syscall &&
2908 - regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) {
2909 - regs->u_regs[UREG_G1] = __NR_restart_syscall;
2910 - regs->tpc -= 4;
2911 -diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
2912 -index cc37936..4b495fe 100644
2913 ---- a/arch/sparc64/kernel/sys_sparc.c
2914 -+++ b/arch/sparc64/kernel/sys_sparc.c
2915 -@@ -454,8 +454,8 @@ asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
2916 - err = sys_semget(first, (int)second, (int)third);
2917 - goto out;
2918 - case SEMCTL: {
2919 -- err = sys_semctl(first, third,
2920 -- (int)second | IPC_64,
2921 -+ err = sys_semctl(first, second,
2922 -+ (int)third | IPC_64,
2923 - (union semun) ptr);
2924 - goto out;
2925 - }
2926 -@@ -542,8 +542,7 @@ asmlinkage long sparc64_personality(unsigned long personality)
2927 - return ret;
2928 - }
2929 -
2930 --int sparc64_mmap_check(unsigned long addr, unsigned long len,
2931 -- unsigned long flags)
2932 -+int sparc64_mmap_check(unsigned long addr, unsigned long len)
2933 - {
2934 - if (test_thread_flag(TIF_32BIT)) {
2935 - if (len >= STACK_TOP32)
2936 -@@ -609,46 +608,19 @@ asmlinkage unsigned long sys64_mremap(unsigned long addr,
2937 - unsigned long old_len, unsigned long new_len,
2938 - unsigned long flags, unsigned long new_addr)
2939 - {
2940 -- struct vm_area_struct *vma;
2941 - unsigned long ret = -EINVAL;
2942 -
2943 - if (test_thread_flag(TIF_32BIT))
2944 - goto out;
2945 - if (unlikely(new_len >= VA_EXCLUDE_START))
2946 - goto out;
2947 -- if (unlikely(invalid_64bit_range(addr, old_len)))
2948 -+ if (unlikely(sparc64_mmap_check(addr, old_len)))
2949 -+ goto out;
2950 -+ if (unlikely(sparc64_mmap_check(new_addr, new_len)))
2951 - goto out;
2952 -
2953 - down_write(&current->mm->mmap_sem);
2954 -- if (flags & MREMAP_FIXED) {
2955 -- if (invalid_64bit_range(new_addr, new_len))
2956 -- goto out_sem;
2957 -- } else if (invalid_64bit_range(addr, new_len)) {
2958 -- unsigned long map_flags = 0;
2959 -- struct file *file = NULL;
2960 --
2961 -- ret = -ENOMEM;
2962 -- if (!(flags & MREMAP_MAYMOVE))
2963 -- goto out_sem;
2964 --
2965 -- vma = find_vma(current->mm, addr);
2966 -- if (vma) {
2967 -- if (vma->vm_flags & VM_SHARED)
2968 -- map_flags |= MAP_SHARED;
2969 -- file = vma->vm_file;
2970 -- }
2971 --
2972 -- /* MREMAP_FIXED checked above. */
2973 -- new_addr = get_unmapped_area(file, addr, new_len,
2974 -- vma ? vma->vm_pgoff : 0,
2975 -- map_flags);
2976 -- ret = new_addr;
2977 -- if (new_addr & ~PAGE_MASK)
2978 -- goto out_sem;
2979 -- flags |= MREMAP_FIXED;
2980 -- }
2981 - ret = do_mremap(addr, old_len, new_len, flags, new_addr);
2982 --out_sem:
2983 - up_write(&current->mm->mmap_sem);
2984 - out:
2985 - return ret;
2986 -diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
2987 -index 2455fa4..54df31a 100644
2988 ---- a/arch/sparc64/kernel/sys_sparc32.c
2989 -+++ b/arch/sparc64/kernel/sys_sparc32.c
2990 -@@ -906,44 +906,15 @@ asmlinkage unsigned long sys32_mremap(unsigned long addr,
2991 - unsigned long old_len, unsigned long new_len,
2992 - unsigned long flags, u32 __new_addr)
2993 - {
2994 -- struct vm_area_struct *vma;
2995 - unsigned long ret = -EINVAL;
2996 - unsigned long new_addr = __new_addr;
2997 -
2998 -- if (old_len > STACK_TOP32 || new_len > STACK_TOP32)
2999 -+ if (unlikely(sparc64_mmap_check(addr, old_len)))
3000 - goto out;
3001 -- if (addr > STACK_TOP32 - old_len)
3002 -+ if (unlikely(sparc64_mmap_check(new_addr, new_len)))
3003 - goto out;
3004 - down_write(&current->mm->mmap_sem);
3005 -- if (flags & MREMAP_FIXED) {
3006 -- if (new_addr > STACK_TOP32 - new_len)
3007 -- goto out_sem;
3008 -- } else if (addr > STACK_TOP32 - new_len) {
3009 -- unsigned long map_flags = 0;
3010 -- struct file *file = NULL;
3011 --
3012 -- ret = -ENOMEM;
3013 -- if (!(flags & MREMAP_MAYMOVE))
3014 -- goto out_sem;
3015 --
3016 -- vma = find_vma(current->mm, addr);
3017 -- if (vma) {
3018 -- if (vma->vm_flags & VM_SHARED)
3019 -- map_flags |= MAP_SHARED;
3020 -- file = vma->vm_file;
3021 -- }
3022 --
3023 -- /* MREMAP_FIXED checked above. */
3024 -- new_addr = get_unmapped_area(file, addr, new_len,
3025 -- vma ? vma->vm_pgoff : 0,
3026 -- map_flags);
3027 -- ret = new_addr;
3028 -- if (new_addr & ~PAGE_MASK)
3029 -- goto out_sem;
3030 -- flags |= MREMAP_FIXED;
3031 -- }
3032 - ret = do_mremap(addr, old_len, new_len, flags, new_addr);
3033 --out_sem:
3034 - up_write(&current->mm->mmap_sem);
3035 - out:
3036 - return ret;
3037 -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
3038 -index 6c70fed..99a4ed3 100644
3039 ---- a/arch/x86/Kconfig
3040 -+++ b/arch/x86/Kconfig
3041 -@@ -24,6 +24,18 @@ config X86
3042 - select HAVE_KRETPROBES
3043 - select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
3044 -
3045 -+config DEFCONFIG_LIST
3046 -+ string
3047 -+ depends on X86_32
3048 -+ option defconfig_list
3049 -+ default "arch/x86/configs/i386_defconfig"
3050 -+
3051 -+config DEFCONFIG_LIST
3052 -+ string
3053 -+ depends on X86_64
3054 -+ option defconfig_list
3055 -+ default "arch/x86/configs/x86_64_defconfig"
3056 -+
3057 -
3058 - config GENERIC_LOCKBREAK
3059 - def_bool n
3060 -diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
3061 -index fae8404..815b8c3 100644
3062 ---- a/drivers/ata/ata_piix.c
3063 -+++ b/drivers/ata/ata_piix.c
3064 -@@ -1531,6 +1531,8 @@ static void __devinit piix_init_sidpr(struct ata_host *host)
3065 - {
3066 - struct pci_dev *pdev = to_pci_dev(host->dev);
3067 - struct piix_host_priv *hpriv = host->private_data;
3068 -+ struct ata_device *dev0 = &host->ports[0]->link.device[0];
3069 -+ u32 scontrol;
3070 - int i;
3071 -
3072 - /* check for availability */
3073 -@@ -1549,6 +1551,29 @@ static void __devinit piix_init_sidpr(struct ata_host *host)
3074 - return;
3075 -
3076 - hpriv->sidpr = pcim_iomap_table(pdev)[PIIX_SIDPR_BAR];
3077 -+
3078 -+ /* SCR access via SIDPR doesn't work on some configurations.
3079 -+ * Give it a test drive by inhibiting power save modes which
3080 -+ * we'll do anyway.
3081 -+ */
3082 -+ scontrol = piix_sidpr_read(dev0, SCR_CONTROL);
3083 -+
3084 -+ /* if IPM is already 3, SCR access is probably working. Don't
3085 -+ * un-inhibit power save modes as BIOS might have inhibited
3086 -+ * them for a reason.
3087 -+ */
3088 -+ if ((scontrol & 0xf00) != 0x300) {
3089 -+ scontrol |= 0x300;
3090 -+ piix_sidpr_write(dev0, SCR_CONTROL, scontrol);
3091 -+ scontrol = piix_sidpr_read(dev0, SCR_CONTROL);
3092 -+
3093 -+ if ((scontrol & 0xf00) != 0x300) {
3094 -+ dev_printk(KERN_INFO, host->dev, "SCR access via "
3095 -+ "SIDPR is available but doesn't work\n");
3096 -+ return;
3097 -+ }
3098 -+ }
3099 -+
3100 - host->ports[0]->ops = &piix_sidpr_sata_ops;
3101 - host->ports[1]->ops = &piix_sidpr_sata_ops;
3102 - }
3103 -diff --git a/drivers/char/vt.c b/drivers/char/vt.c
3104 -index 9b58b89..c2e1a83 100644
3105 ---- a/drivers/char/vt.c
3106 -+++ b/drivers/char/vt.c
3107 -@@ -2723,6 +2723,10 @@ static int con_open(struct tty_struct *tty, struct file *filp)
3108 - tty->winsize.ws_row = vc_cons[currcons].d->vc_rows;
3109 - tty->winsize.ws_col = vc_cons[currcons].d->vc_cols;
3110 - }
3111 -+ if (vc->vc_utf)
3112 -+ tty->termios->c_iflag |= IUTF8;
3113 -+ else
3114 -+ tty->termios->c_iflag &= ~IUTF8;
3115 - release_console_sem();
3116 - vcs_make_sysfs(tty);
3117 - return ret;
3118 -@@ -2899,6 +2903,8 @@ int __init vty_init(void)
3119 - console_driver->minor_start = 1;
3120 - console_driver->type = TTY_DRIVER_TYPE_CONSOLE;
3121 - console_driver->init_termios = tty_std_termios;
3122 -+ if (default_utf8)
3123 -+ console_driver->init_termios.c_iflag |= IUTF8;
3124 - console_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
3125 - tty_set_operations(console_driver, &con_ops);
3126 - if (tty_register_driver(console_driver))
3127 -diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
3128 -index 9bbe96c..f0b4073 100644
3129 ---- a/drivers/i2c/busses/i2c-piix4.c
3130 -+++ b/drivers/i2c/busses/i2c-piix4.c
3131 -@@ -108,7 +108,27 @@ static unsigned short piix4_smba;
3132 - static struct pci_driver piix4_driver;
3133 - static struct i2c_adapter piix4_adapter;
3134 -
3135 --static struct dmi_system_id __devinitdata piix4_dmi_table[] = {
3136 -+static struct dmi_system_id __devinitdata piix4_dmi_blacklist[] = {
3137 -+ {
3138 -+ .ident = "Sapphire AM2RD790",
3139 -+ .matches = {
3140 -+ DMI_MATCH(DMI_BOARD_VENDOR, "SAPPHIRE Inc."),
3141 -+ DMI_MATCH(DMI_BOARD_NAME, "PC-AM2RD790"),
3142 -+ },
3143 -+ },
3144 -+ {
3145 -+ .ident = "DFI Lanparty UT 790FX",
3146 -+ .matches = {
3147 -+ DMI_MATCH(DMI_BOARD_VENDOR, "DFI Inc."),
3148 -+ DMI_MATCH(DMI_BOARD_NAME, "LP UT 790FX"),
3149 -+ },
3150 -+ },
3151 -+ { }
3152 -+};
3153 -+
3154 -+/* The IBM entry is in a separate table because we only check it
3155 -+ on Intel-based systems */
3156 -+static struct dmi_system_id __devinitdata piix4_dmi_ibm[] = {
3157 - {
3158 - .ident = "IBM",
3159 - .matches = { DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
3160 -@@ -123,8 +143,16 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
3161 -
3162 - dev_info(&PIIX4_dev->dev, "Found %s device\n", pci_name(PIIX4_dev));
3163 -
3164 -+ /* On some motherboards, it was reported that accessing the SMBus
3165 -+ caused severe hardware problems */
3166 -+ if (dmi_check_system(piix4_dmi_blacklist)) {
3167 -+ dev_err(&PIIX4_dev->dev,
3168 -+ "Accessing the SMBus on this system is unsafe!\n");
3169 -+ return -EPERM;
3170 -+ }
3171 -+
3172 - /* Don't access SMBus on IBM systems which get corrupted eeproms */
3173 -- if (dmi_check_system(piix4_dmi_table) &&
3174 -+ if (dmi_check_system(piix4_dmi_ibm) &&
3175 - PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) {
3176 - dev_err(&PIIX4_dev->dev, "IBM system detected; this module "
3177 - "may corrupt your serial eeprom! Refusing to load "
3178 -diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
3179 -index b162b83..18a1379 100644
3180 ---- a/drivers/md/raid5.c
3181 -+++ b/drivers/md/raid5.c
3182 -@@ -2354,8 +2354,8 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
3183 -
3184 - /* complete a check operation */
3185 - if (test_and_clear_bit(STRIPE_OP_CHECK, &sh->ops.complete)) {
3186 -- clear_bit(STRIPE_OP_CHECK, &sh->ops.ack);
3187 -- clear_bit(STRIPE_OP_CHECK, &sh->ops.pending);
3188 -+ clear_bit(STRIPE_OP_CHECK, &sh->ops.ack);
3189 -+ clear_bit(STRIPE_OP_CHECK, &sh->ops.pending);
3190 - if (s->failed == 0) {
3191 - if (sh->ops.zero_sum_result == 0)
3192 - /* parity is correct (on disc,
3193 -@@ -2385,16 +2385,6 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
3194 - canceled_check = 1; /* STRIPE_INSYNC is not set */
3195 - }
3196 -
3197 -- /* check if we can clear a parity disk reconstruct */
3198 -- if (test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.complete) &&
3199 -- test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) {
3200 --
3201 -- clear_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending);
3202 -- clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.complete);
3203 -- clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.ack);
3204 -- clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending);
3205 -- }
3206 --
3207 - /* start a new check operation if there are no failures, the stripe is
3208 - * not insync, and a repair is not in flight
3209 - */
3210 -@@ -2409,6 +2399,17 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
3211 - }
3212 - }
3213 -
3214 -+ /* check if we can clear a parity disk reconstruct */
3215 -+ if (test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.complete) &&
3216 -+ test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) {
3217 -+
3218 -+ clear_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending);
3219 -+ clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.complete);
3220 -+ clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.ack);
3221 -+ clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending);
3222 -+ }
3223 -+
3224 -+
3225 - /* Wait for check parity and compute block operations to complete
3226 - * before write-back. If a failure occurred while the check operation
3227 - * was in flight we need to cycle this stripe through handle_stripe
3228 -diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
3229 -index e709382..9fd8399 100644
3230 ---- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
3231 -+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
3232 -@@ -13,6 +13,7 @@
3233 - #include "dib7000p.h"
3234 - #include "mt2060.h"
3235 - #include "mt2266.h"
3236 -+#include "tuner-xc2028.h"
3237 - #include "dib0070.h"
3238 -
3239 - static int force_lna_activation;
3240 -@@ -297,6 +298,149 @@ static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
3241 - &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;;
3242 - }
3243 -
3244 -+/* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
3245 -+struct dibx000_agc_config xc3028_agc_config = {
3246 -+ BAND_VHF | BAND_UHF, /* band_caps */
3247 -+
3248 -+ /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
3249 -+ * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
3250 -+ * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
3251 -+ (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
3252 -+ (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */
3253 -+
3254 -+ 712, /* inv_gain */
3255 -+ 21, /* time_stabiliz */
3256 -+
3257 -+ 0, /* alpha_level */
3258 -+ 118, /* thlock */
3259 -+
3260 -+ 0, /* wbd_inv */
3261 -+ 2867, /* wbd_ref */
3262 -+ 0, /* wbd_sel */
3263 -+ 2, /* wbd_alpha */
3264 -+
3265 -+ 0, /* agc1_max */
3266 -+ 0, /* agc1_min */
3267 -+ 39718, /* agc2_max */
3268 -+ 9930, /* agc2_min */
3269 -+ 0, /* agc1_pt1 */
3270 -+ 0, /* agc1_pt2 */
3271 -+ 0, /* agc1_pt3 */
3272 -+ 0, /* agc1_slope1 */
3273 -+ 0, /* agc1_slope2 */
3274 -+ 0, /* agc2_pt1 */
3275 -+ 128, /* agc2_pt2 */
3276 -+ 29, /* agc2_slope1 */
3277 -+ 29, /* agc2_slope2 */
3278 -+
3279 -+ 17, /* alpha_mant */
3280 -+ 27, /* alpha_exp */
3281 -+ 23, /* beta_mant */
3282 -+ 51, /* beta_exp */
3283 -+
3284 -+ 1, /* perform_agc_softsplit */
3285 -+};
3286 -+
3287 -+/* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
3288 -+struct dibx000_bandwidth_config xc3028_bw_config = {
3289 -+ 60000, 30000, /* internal, sampling */
3290 -+ 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */
3291 -+ 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc,
3292 -+ modulo */
3293 -+ (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
3294 -+ (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
3295 -+ 20452225, /* timf */
3296 -+ 30000000, /* xtal_hz */
3297 -+};
3298 -+
3299 -+static struct dib7000p_config stk7700ph_dib7700_xc3028_config = {
3300 -+ .output_mpeg2_in_188_bytes = 1,
3301 -+ .tuner_is_baseband = 1,
3302 -+
3303 -+ .agc_config_count = 1,
3304 -+ .agc = &xc3028_agc_config,
3305 -+ .bw = &xc3028_bw_config,
3306 -+
3307 -+ .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
3308 -+ .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
3309 -+ .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
3310 -+};
3311 -+
3312 -+static int stk7700ph_xc3028_callback(void *ptr, int command, int arg)
3313 -+{
3314 -+ struct dvb_usb_adapter *adap = ptr;
3315 -+
3316 -+ switch (command) {
3317 -+ case XC2028_TUNER_RESET:
3318 -+ /* Send the tuner in then out of reset */
3319 -+ dib7000p_set_gpio(adap->fe, 8, 0, 0); msleep(10);
3320 -+ dib7000p_set_gpio(adap->fe, 8, 0, 1);
3321 -+ break;
3322 -+ case XC2028_RESET_CLK:
3323 -+ break;
3324 -+ default:
3325 -+ err("%s: unknown command %d, arg %d\n", __func__,
3326 -+ command, arg);
3327 -+ return -EINVAL;
3328 -+ }
3329 -+ return 0;
3330 -+}
3331 -+
3332 -+static struct xc2028_ctrl stk7700ph_xc3028_ctrl = {
3333 -+ .fname = XC2028_DEFAULT_FIRMWARE,
3334 -+ .max_len = 64,
3335 -+ .demod = XC3028_FE_DIBCOM52,
3336 -+};
3337 -+
3338 -+static struct xc2028_config stk7700ph_xc3028_config = {
3339 -+ .i2c_addr = 0x61,
3340 -+ .callback = stk7700ph_xc3028_callback,
3341 -+ .ctrl = &stk7700ph_xc3028_ctrl,
3342 -+};
3343 -+
3344 -+static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap)
3345 -+{
3346 -+ struct usb_device_descriptor *desc = &adap->dev->udev->descriptor;
3347 -+
3348 -+ if (desc->idVendor == USB_VID_PINNACLE &&
3349 -+ desc->idProduct == USB_PID_PINNACLE_EXPRESSCARD_320CX)
3350 -+ dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
3351 -+ else
3352 -+ dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
3353 -+ msleep(20);
3354 -+ dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
3355 -+ dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
3356 -+ dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
3357 -+ dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
3358 -+ msleep(10);
3359 -+ dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
3360 -+ msleep(20);
3361 -+ dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
3362 -+ msleep(10);
3363 -+
3364 -+ dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
3365 -+ &stk7700ph_dib7700_xc3028_config);
3366 -+
3367 -+ adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
3368 -+ &stk7700ph_dib7700_xc3028_config);
3369 -+
3370 -+ return adap->fe == NULL ? -ENODEV : 0;
3371 -+}
3372 -+
3373 -+static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap)
3374 -+{
3375 -+ struct i2c_adapter *tun_i2c;
3376 -+
3377 -+ tun_i2c = dib7000p_get_i2c_master(adap->fe,
3378 -+ DIBX000_I2C_INTERFACE_TUNER, 1);
3379 -+
3380 -+ stk7700ph_xc3028_config.i2c_adap = tun_i2c;
3381 -+ stk7700ph_xc3028_config.video_dev = adap;
3382 -+
3383 -+ return dvb_attach(xc2028_attach, adap->fe, &stk7700ph_xc3028_config)
3384 -+ == NULL ? -ENODEV : 0;
3385 -+}
3386 -+
3387 - #define DEFAULT_RC_INTERVAL 150
3388 -
3389 - static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
3390 -@@ -794,6 +938,10 @@ static struct dib7000p_config dib7070p_dib7000p_config = {
3391 - /* STK7070P */
3392 - static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
3393 - {
3394 -+ if (adap->dev->udev->descriptor.idVendor == USB_VID_PINNACLE &&
3395 -+ adap->dev->udev->descriptor.idProduct == USB_PID_PINNACLE_PCTV72E)
3396 -+ dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
3397 -+ else
3398 - dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
3399 - msleep(10);
3400 - dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
3401 -@@ -808,9 +956,11 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
3402 - msleep(10);
3403 - dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
3404 -
3405 -- dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, &dib7070p_dib7000p_config);
3406 -+ dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
3407 -+ &dib7070p_dib7000p_config);
3408 -
3409 -- adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &dib7070p_dib7000p_config);
3410 -+ adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
3411 -+ &dib7070p_dib7000p_config);
3412 - return adap->fe == NULL ? -ENODEV : 0;
3413 - }
3414 -
3415 -@@ -878,34 +1028,41 @@ static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
3416 - /* DVB-USB and USB stuff follows */
3417 - struct usb_device_id dib0700_usb_id_table[] = {
3418 - /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
3419 -- { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
3420 --
3421 -- { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
3422 -- { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
3423 -- { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
3424 -+ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
3425 -+ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
3426 -+ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
3427 -+ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
3428 - /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
3429 -- { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
3430 -- { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
3431 -- { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
3432 -- { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
3433 -+ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
3434 -+ { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
3435 -+ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
3436 -+ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
3437 - /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
3438 -- { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
3439 -- { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
3440 -- { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
3441 -- { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
3442 -+ { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
3443 -+ { USB_DEVICE(USB_VID_TERRATEC,
3444 -+ USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
3445 -+ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
3446 -+ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
3447 - /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) },
3448 -- { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
3449 -- { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
3450 -- { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
3451 -- { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
3452 -+ { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
3453 -+ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
3454 -+ { USB_DEVICE(USB_VID_PINNACLE,
3455 -+ USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
3456 -+ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
3457 - /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) },
3458 -- { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) },
3459 -- { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) },
3460 -- { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) },
3461 -- { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) },
3462 --/* 25 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) },
3463 -- { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) },
3464 -- { 0 } /* Terminating entry */
3465 -+ { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) },
3466 -+ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) },
3467 -+ { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) },
3468 -+ { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) },
3469 -+/* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) },
3470 -+ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) },
3471 -+ { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) },
3472 -+ { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) },
3473 -+ { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) },
3474 -+/* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) },
3475 -+ { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) },
3476 -+ { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) },
3477 -+ { 0 } /* Terminating entry */
3478 - };
3479 - MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
3480 -
3481 -@@ -1069,12 +1226,16 @@ struct dvb_usb_device_properties dib0700_devices[] = {
3482 - },
3483 - },
3484 -
3485 -- .num_device_descs = 1,
3486 -+ .num_device_descs = 2,
3487 - .devices = {
3488 - { "ASUS My Cinema U3000 Mini DVBT Tuner",
3489 - { &dib0700_usb_id_table[23], NULL },
3490 - { NULL },
3491 - },
3492 -+ { "Yuan EC372S",
3493 -+ { &dib0700_usb_id_table[31], NULL },
3494 -+ { NULL },
3495 -+ }
3496 - }
3497 - }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
3498 -
3499 -@@ -1090,7 +1251,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
3500 - },
3501 - },
3502 -
3503 -- .num_device_descs = 6,
3504 -+ .num_device_descs = 8,
3505 - .devices = {
3506 - { "DiBcom STK7070P reference design",
3507 - { &dib0700_usb_id_table[15], NULL },
3508 -@@ -1116,6 +1277,14 @@ struct dvb_usb_device_properties dib0700_devices[] = {
3509 - { &dib0700_usb_id_table[26], NULL },
3510 - { NULL },
3511 - },
3512 -+ { "Pinnacle PCTV 72e",
3513 -+ { &dib0700_usb_id_table[29], NULL },
3514 -+ { NULL },
3515 -+ },
3516 -+ { "Pinnacle PCTV 73e",
3517 -+ { &dib0700_usb_id_table[30], NULL },
3518 -+ { NULL },
3519 -+ },
3520 - },
3521 -
3522 - .rc_interval = DEFAULT_RC_INTERVAL,
3523 -@@ -1155,6 +1324,40 @@ struct dvb_usb_device_properties dib0700_devices[] = {
3524 - { NULL },
3525 - }
3526 - }
3527 -+ }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
3528 -+
3529 -+ .num_adapters = 1,
3530 -+ .adapter = {
3531 -+ {
3532 -+ .frontend_attach = stk7700ph_frontend_attach,
3533 -+ .tuner_attach = stk7700ph_tuner_attach,
3534 -+
3535 -+ DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3536 -+
3537 -+ .size_of_priv = sizeof(struct
3538 -+ dib0700_adapter_state),
3539 -+ },
3540 -+ },
3541 -+
3542 -+ .num_device_descs = 3,
3543 -+ .devices = {
3544 -+ { "Terratec Cinergy HT USB XE",
3545 -+ { &dib0700_usb_id_table[27], NULL },
3546 -+ { NULL },
3547 -+ },
3548 -+ { "Pinnacle Expresscard 320cx",
3549 -+ { &dib0700_usb_id_table[28], NULL },
3550 -+ { NULL },
3551 -+ },
3552 -+ { "Terratec Cinergy HT Express",
3553 -+ { &dib0700_usb_id_table[32], NULL },
3554 -+ { NULL },
3555 -+ },
3556 -+ },
3557 -+ .rc_interval = DEFAULT_RC_INTERVAL,
3558 -+ .rc_key_map = dib0700_rc_keys,
3559 -+ .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
3560 -+ .rc_query = dib0700_rc_query
3561 - },
3562 - };
3563 -
3564 -diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
3565 -index aa4844e..49a44f2 100644
3566 ---- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
3567 -+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
3568 -@@ -46,8 +46,8 @@
3569 - #define USB_VID_ULTIMA_ELECTRONIC 0x05d8
3570 - #define USB_VID_UNIWILL 0x1584
3571 - #define USB_VID_WIDEVIEW 0x14aa
3572 --/* dom : pour gigabyte u7000 */
3573 - #define USB_VID_GIGABYTE 0x1044
3574 -+#define USB_VID_YUAN 0x1164
3575 -
3576 -
3577 - /* Product IDs */
3578 -@@ -135,9 +135,14 @@
3579 - #define USB_PID_AVERMEDIA_VOLAR 0xa807
3580 - #define USB_PID_AVERMEDIA_VOLAR_2 0xb808
3581 - #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a
3582 -+#define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058
3583 -+#define USB_PID_TERRATEC_CINERGY_HT_EXPRESS 0x0060
3584 -+#define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e
3585 - #define USB_PID_PINNACLE_PCTV2000E 0x022c
3586 - #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228
3587 - #define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T 0x0229
3588 -+#define USB_PID_PINNACLE_PCTV72E 0x0236
3589 -+#define USB_PID_PINNACLE_PCTV73E 0x0237
3590 - #define USB_PID_PCTV_200E 0x020e
3591 - #define USB_PID_PCTV_400E 0x020f
3592 - #define USB_PID_PCTV_450E 0x0222
3593 -@@ -183,9 +188,9 @@
3594 - #define USB_PID_OPERA1_WARM 0x3829
3595 - #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD 0x0514
3596 - #define USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM 0x0513
3597 --/* dom pour gigabyte u7000 */
3598 - #define USB_PID_GIGABYTE_U7000 0x7001
3599 - #define USB_PID_ASUS_U3000 0x171f
3600 - #define USB_PID_ASUS_U3100 0x173f
3601 -+#define USB_PID_YUAN_EC372S 0x1edc
3602 -
3603 - #endif
3604 -diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
3605 -index f651a81..34c2b98 100644
3606 ---- a/drivers/net/macvlan.c
3607 -+++ b/drivers/net/macvlan.c
3608 -@@ -450,7 +450,7 @@ static void macvlan_dellink(struct net_device *dev)
3609 - unregister_netdevice(dev);
3610 -
3611 - if (list_empty(&port->vlans))
3612 -- macvlan_port_destroy(dev);
3613 -+ macvlan_port_destroy(port->dev);
3614 - }
3615 -
3616 - static struct rtnl_link_ops macvlan_link_ops __read_mostly = {
3617 -diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
3618 -index 3acfeea..6572425 100644
3619 ---- a/drivers/net/r8169.c
3620 -+++ b/drivers/net/r8169.c
3621 -@@ -1617,6 +1617,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3622 - SET_NETDEV_DEV(dev, &pdev->dev);
3623 - tp = netdev_priv(dev);
3624 - tp->dev = dev;
3625 -+ tp->pci_dev = pdev;
3626 - tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT);
3627 -
3628 - /* enable device (incl. PCI PM wakeup and hotplug setup) */
3629 -@@ -1705,18 +1706,18 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3630 -
3631 - rtl8169_print_mac_version(tp);
3632 -
3633 -- for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) {
3634 -+ for (i = 0; i < ARRAY_SIZE(rtl_chip_info); i++) {
3635 - if (tp->mac_version == rtl_chip_info[i].mac_version)
3636 - break;
3637 - }
3638 -- if (i < 0) {
3639 -+ if (i == ARRAY_SIZE(rtl_chip_info)) {
3640 - /* Unknown chip: assume array element #0, original RTL-8169 */
3641 - if (netif_msg_probe(tp)) {
3642 - dev_printk(KERN_DEBUG, &pdev->dev,
3643 - "unknown chip version, assuming %s\n",
3644 - rtl_chip_info[0].name);
3645 - }
3646 -- i++;
3647 -+ i = 0;
3648 - }
3649 - tp->chipset = i;
3650 -
3651 -@@ -1777,7 +1778,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3652 - #endif
3653 -
3654 - tp->intr_mask = 0xffff;
3655 -- tp->pci_dev = pdev;
3656 - tp->mmio_addr = ioaddr;
3657 - tp->align = cfg->align;
3658 - tp->hw_start = cfg->hw_start;
3659 -diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c
3660 -index ba795a4..9f996ec 100644
3661 ---- a/drivers/rtc/rtc-lib.c
3662 -+++ b/drivers/rtc/rtc-lib.c
3663 -@@ -51,7 +51,7 @@ EXPORT_SYMBOL(rtc_year_days);
3664 - */
3665 - void rtc_time_to_tm(unsigned long time, struct rtc_time *tm)
3666 - {
3667 -- register int days, month, year;
3668 -+ unsigned int days, month, year;
3669 -
3670 - days = time / 86400;
3671 - time -= days * 86400;
3672 -diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
3673 -index 6ccdc96..d9bc859 100644
3674 ---- a/drivers/scsi/aha152x.c
3675 -+++ b/drivers/scsi/aha152x.c
3676 -@@ -3835,7 +3835,7 @@ static int __init aha152x_init(void)
3677 - iounmap(p);
3678 - }
3679 - if (!ok && setup_count == 0)
3680 -- return 0;
3681 -+ return -ENODEV;
3682 -
3683 - printk(KERN_INFO "aha152x: BIOS test: passed, ");
3684 - #else
3685 -@@ -3914,14 +3914,14 @@ static int __init aha152x_init(void)
3686 - #endif
3687 - }
3688 -
3689 -- return 1;
3690 -+ return 0;
3691 - }
3692 -
3693 - static void __exit aha152x_exit(void)
3694 - {
3695 -- struct aha152x_hostdata *hd;
3696 -+ struct aha152x_hostdata *hd, *tmp;
3697 -
3698 -- list_for_each_entry(hd, &aha152x_host_list, host_list) {
3699 -+ list_for_each_entry_safe(hd, tmp, &aha152x_host_list, host_list) {
3700 - struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata);
3701 -
3702 - aha152x_release(shost);
3703 -diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
3704 -index bdd7de7..9975095 100644
3705 ---- a/drivers/scsi/libiscsi.c
3706 -+++ b/drivers/scsi/libiscsi.c
3707 -@@ -635,7 +635,9 @@ static int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
3708 - if (iscsi_recv_pdu(conn->cls_conn, hdr, data,
3709 - datalen))
3710 - rc = ISCSI_ERR_CONN_FAILED;
3711 -- }
3712 -+ } else
3713 -+ mod_timer(&conn->transport_timer,
3714 -+ jiffies + conn->recv_timeout);
3715 - iscsi_free_mgmt_task(conn, mtask);
3716 - break;
3717 - default:
3718 -@@ -1353,19 +1355,20 @@ static void iscsi_check_transport_timeouts(unsigned long data)
3719 - {
3720 - struct iscsi_conn *conn = (struct iscsi_conn *)data;
3721 - struct iscsi_session *session = conn->session;
3722 -- unsigned long timeout, next_timeout = 0, last_recv;
3723 -+ unsigned long recv_timeout, next_timeout = 0, last_recv;
3724 -
3725 - spin_lock(&session->lock);
3726 - if (session->state != ISCSI_STATE_LOGGED_IN)
3727 - goto done;
3728 -
3729 -- timeout = conn->recv_timeout;
3730 -- if (!timeout)
3731 -+ recv_timeout = conn->recv_timeout;
3732 -+ if (!recv_timeout)
3733 - goto done;
3734 -
3735 -- timeout *= HZ;
3736 -+ recv_timeout *= HZ;
3737 - last_recv = conn->last_recv;
3738 -- if (time_before_eq(last_recv + timeout + (conn->ping_timeout * HZ),
3739 -+ if (conn->ping_mtask &&
3740 -+ time_before_eq(conn->last_ping + (conn->ping_timeout * HZ),
3741 - jiffies)) {
3742 - iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs "
3743 - "expired, last rx %lu, last ping %lu, "
3744 -@@ -1376,15 +1379,13 @@ static void iscsi_check_transport_timeouts(unsigned long data)
3745 - return;
3746 - }
3747 -
3748 -- if (time_before_eq(last_recv + timeout, jiffies)) {
3749 -- if (time_before_eq(conn->last_ping, last_recv)) {
3750 -- /* send a ping to try to provoke some traffic */
3751 -- debug_scsi("Sending nopout as ping on conn %p\n", conn);
3752 -- iscsi_send_nopout(conn, NULL);
3753 -- }
3754 -- next_timeout = last_recv + timeout + (conn->ping_timeout * HZ);
3755 -+ if (time_before_eq(last_recv + recv_timeout, jiffies)) {
3756 -+ /* send a ping to try to provoke some traffic */
3757 -+ debug_scsi("Sending nopout as ping on conn %p\n", conn);
3758 -+ iscsi_send_nopout(conn, NULL);
3759 -+ next_timeout = conn->last_ping + (conn->ping_timeout * HZ);
3760 - } else
3761 -- next_timeout = last_recv + timeout;
3762 -+ next_timeout = last_recv + recv_timeout;
3763 -
3764 - debug_scsi("Setting next tmo %lu\n", next_timeout);
3765 - mod_timer(&conn->transport_timer, next_timeout);
3766 -diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
3767 -index 68c0d09..624e616 100644
3768 ---- a/drivers/scsi/qla1280.c
3769 -+++ b/drivers/scsi/qla1280.c
3770 -@@ -2012,7 +2012,7 @@ qla1280_set_defaults(struct scsi_qla_host *ha)
3771 - nv->bus[bus].config_2.req_ack_active_negation = 1;
3772 - nv->bus[bus].config_2.data_line_active_negation = 1;
3773 - nv->bus[bus].selection_timeout = 250;
3774 -- nv->bus[bus].max_queue_depth = 256;
3775 -+ nv->bus[bus].max_queue_depth = 32;
3776 -
3777 - if (IS_ISP1040(ha)) {
3778 - nv->bus[bus].bus_reset_delay = 3;
3779 -@@ -2056,7 +2056,7 @@ qla1280_config_target(struct scsi_qla_host *ha, int bus, int target)
3780 - status = qla1280_mailbox_command(ha, 0x0f, mb);
3781 -
3782 - /* Save Tag queuing enable flag. */
3783 -- flag = (BIT_0 << target) & mb[0];
3784 -+ flag = (BIT_0 << target);
3785 - if (nv->bus[bus].target[target].parameter.tag_queuing)
3786 - ha->bus_settings[bus].qtag_enables |= flag;
3787 -
3788 -diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
3789 -index 0f5a179..3bf9294 100644
3790 ---- a/drivers/serial/serial_core.c
3791 -+++ b/drivers/serial/serial_core.c
3792 -@@ -535,7 +535,7 @@ static int uart_chars_in_buffer(struct tty_struct *tty)
3793 - static void uart_flush_buffer(struct tty_struct *tty)
3794 - {
3795 - struct uart_state *state = tty->driver_data;
3796 -- struct uart_port *port = state->port;
3797 -+ struct uart_port *port;
3798 - unsigned long flags;
3799 -
3800 - /*
3801 -@@ -547,6 +547,7 @@ static void uart_flush_buffer(struct tty_struct *tty)
3802 - return;
3803 - }
3804 -
3805 -+ port = state->port;
3806 - pr_debug("uart_flush_buffer(%d) called\n", tty->index);
3807 -
3808 - spin_lock_irqsave(&port->lock, flags);
3809 -diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
3810 -index be0fe15..145c028 100644
3811 ---- a/drivers/serial/sunhv.c
3812 -+++ b/drivers/serial/sunhv.c
3813 -@@ -392,7 +392,7 @@ static struct uart_ops sunhv_pops = {
3814 -
3815 - static struct uart_driver sunhv_reg = {
3816 - .owner = THIS_MODULE,
3817 -- .driver_name = "serial",
3818 -+ .driver_name = "sunhv",
3819 - .dev_name = "ttyS",
3820 - .major = TTY_MAJOR,
3821 - };
3822 -diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
3823 -index 543f937..9ff5b38 100644
3824 ---- a/drivers/serial/sunsab.c
3825 -+++ b/drivers/serial/sunsab.c
3826 -@@ -826,7 +826,7 @@ static struct uart_ops sunsab_pops = {
3827 -
3828 - static struct uart_driver sunsab_reg = {
3829 - .owner = THIS_MODULE,
3830 -- .driver_name = "serial",
3831 -+ .driver_name = "sunsab",
3832 - .dev_name = "ttyS",
3833 - .major = TTY_MAJOR,
3834 - };
3835 -diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
3836 -index 4e2302d..03806a9 100644
3837 ---- a/drivers/serial/sunsu.c
3838 -+++ b/drivers/serial/sunsu.c
3839 -@@ -1173,7 +1173,7 @@ out:
3840 -
3841 - static struct uart_driver sunsu_reg = {
3842 - .owner = THIS_MODULE,
3843 -- .driver_name = "serial",
3844 -+ .driver_name = "sunsu",
3845 - .dev_name = "ttyS",
3846 - .major = TTY_MAJOR,
3847 - };
3848 -diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
3849 -index cb2e405..87210c0 100644
3850 ---- a/drivers/serial/sunzilog.c
3851 -+++ b/drivers/serial/sunzilog.c
3852 -@@ -1015,6 +1015,7 @@ static struct uart_ops sunzilog_pops = {
3853 - .verify_port = sunzilog_verify_port,
3854 - };
3855 -
3856 -+static int uart_chip_count;
3857 - static struct uart_sunzilog_port *sunzilog_port_table;
3858 - static struct zilog_layout __iomem **sunzilog_chip_regs;
3859 -
3860 -@@ -1022,7 +1023,7 @@ static struct uart_sunzilog_port *sunzilog_irq_chain;
3861 -
3862 - static struct uart_driver sunzilog_reg = {
3863 - .owner = THIS_MODULE,
3864 -- .driver_name = "ttyS",
3865 -+ .driver_name = "sunzilog",
3866 - .dev_name = "ttyS",
3867 - .major = TTY_MAJOR,
3868 - };
3869 -@@ -1350,16 +1351,22 @@ static int zilog_irq = -1;
3870 -
3871 - static int __devinit zs_probe(struct of_device *op, const struct of_device_id *match)
3872 - {
3873 -- static int inst;
3874 -+ static int kbm_inst, uart_inst;
3875 -+ int inst;
3876 - struct uart_sunzilog_port *up;
3877 - struct zilog_layout __iomem *rp;
3878 -- int keyboard_mouse;
3879 -+ int keyboard_mouse = 0;
3880 - int err;
3881 -
3882 -- keyboard_mouse = 0;
3883 - if (of_find_property(op->node, "keyboard", NULL))
3884 - keyboard_mouse = 1;
3885 -
3886 -+ /* uarts must come before keyboards/mice */
3887 -+ if (keyboard_mouse)
3888 -+ inst = uart_chip_count + kbm_inst;
3889 -+ else
3890 -+ inst = uart_inst;
3891 -+
3892 - sunzilog_chip_regs[inst] = of_ioremap(&op->resource[0], 0,
3893 - sizeof(struct zilog_layout),
3894 - "zs");
3895 -@@ -1427,6 +1434,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
3896 - rp, sizeof(struct zilog_layout));
3897 - return err;
3898 - }
3899 -+ uart_inst++;
3900 - } else {
3901 - printk(KERN_INFO "%s: Keyboard at MMIO 0x%llx (irq = %d) "
3902 - "is a %s\n",
3903 -@@ -1438,12 +1446,11 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
3904 - op->dev.bus_id,
3905 - (unsigned long long) up[1].port.mapbase,
3906 - op->irqs[0], sunzilog_type(&up[1].port));
3907 -+ kbm_inst++;
3908 - }
3909 -
3910 - dev_set_drvdata(&op->dev, &up[0]);
3911 -
3912 -- inst++;
3913 --
3914 - return 0;
3915 - }
3916 -
3917 -@@ -1491,28 +1498,25 @@ static struct of_platform_driver zs_driver = {
3918 - static int __init sunzilog_init(void)
3919 - {
3920 - struct device_node *dp;
3921 -- int err, uart_count;
3922 -- int num_keybms;
3923 -+ int err;
3924 -+ int num_keybms = 0;
3925 - int num_sunzilog = 0;
3926 -
3927 -- num_keybms = 0;
3928 - for_each_node_by_name(dp, "zs") {
3929 - num_sunzilog++;
3930 - if (of_find_property(dp, "keyboard", NULL))
3931 - num_keybms++;
3932 - }
3933 -
3934 -- uart_count = 0;
3935 - if (num_sunzilog) {
3936 -- int uart_count;
3937 --
3938 - err = sunzilog_alloc_tables(num_sunzilog);
3939 - if (err)
3940 - goto out;
3941 -
3942 -- uart_count = (num_sunzilog * 2) - (2 * num_keybms);
3943 -+ uart_chip_count = num_sunzilog - num_keybms;
3944 -
3945 -- err = sunserial_register_minors(&sunzilog_reg, uart_count);
3946 -+ err = sunserial_register_minors(&sunzilog_reg,
3947 -+ uart_chip_count * 2);
3948 - if (err)
3949 - goto out_free_tables;
3950 - }
3951 -diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
3952 -index d72dc07..e534f9d 100644
3953 ---- a/drivers/usb/host/ohci-at91.c
3954 -+++ b/drivers/usb/host/ohci-at91.c
3955 -@@ -348,6 +348,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
3956 - if (!clocked)
3957 - at91_start_clock();
3958 -
3959 -+ ohci_finish_controller_resume(hcd);
3960 - return 0;
3961 - }
3962 - #else
3963 -diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
3964 -index 156e93a..963ed60 100644
3965 ---- a/drivers/usb/host/ohci-ep93xx.c
3966 -+++ b/drivers/usb/host/ohci-ep93xx.c
3967 -@@ -194,8 +194,8 @@ static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)
3968 -
3969 - ep93xx_start_hc(&pdev->dev);
3970 - pdev->dev.power.power_state = PMSG_ON;
3971 -- usb_hcd_resume_root_hub(hcd);
3972 -
3973 -+ ohci_finish_controller_resume(hcd);
3974 - return 0;
3975 - }
3976 - #endif
3977 -diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
3978 -index 48e4b11..9eff2de 100644
3979 ---- a/drivers/usb/host/ohci-hub.c
3980 -+++ b/drivers/usb/host/ohci-hub.c
3981 -@@ -326,6 +326,49 @@ static int ohci_bus_resume (struct usb_hcd *hcd)
3982 - return rc;
3983 - }
3984 -
3985 -+/* Carry out the final steps of resuming the controller device */
3986 -+static void ohci_finish_controller_resume(struct usb_hcd *hcd)
3987 -+{
3988 -+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
3989 -+ int port;
3990 -+ bool need_reinit = false;
3991 -+
3992 -+ /* See if the controller is already running or has been reset */
3993 -+ ohci->hc_control = ohci_readl(ohci, &ohci->regs->control);
3994 -+ if (ohci->hc_control & (OHCI_CTRL_IR | OHCI_SCHED_ENABLES)) {
3995 -+ need_reinit = true;
3996 -+ } else {
3997 -+ switch (ohci->hc_control & OHCI_CTRL_HCFS) {
3998 -+ case OHCI_USB_OPER:
3999 -+ case OHCI_USB_RESET:
4000 -+ need_reinit = true;
4001 -+ }
4002 -+ }
4003 -+
4004 -+ /* If needed, reinitialize and suspend the root hub */
4005 -+ if (need_reinit) {
4006 -+ spin_lock_irq(&ohci->lock);
4007 -+ hcd->state = HC_STATE_RESUMING;
4008 -+ ohci_rh_resume(ohci);
4009 -+ hcd->state = HC_STATE_QUIESCING;
4010 -+ ohci_rh_suspend(ohci, 0);
4011 -+ hcd->state = HC_STATE_SUSPENDED;
4012 -+ spin_unlock_irq(&ohci->lock);
4013 -+ }
4014 -+
4015 -+ /* Normally just turn on port power and enable interrupts */
4016 -+ else {
4017 -+ ohci_dbg(ohci, "powerup ports\n");
4018 -+ for (port = 0; port < ohci->num_ports; port++)
4019 -+ ohci_writel(ohci, RH_PS_PPS,
4020 -+ &ohci->regs->roothub.portstatus[port]);
4021 -+
4022 -+ ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrenable);
4023 -+ ohci_readl(ohci, &ohci->regs->intrenable);
4024 -+ msleep(20);
4025 -+ }
4026 -+}
4027 -+
4028 - /* Carry out polling-, autostop-, and autoresume-related state changes */
4029 - static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed,
4030 - int any_connected)
4031 -diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
4032 -index 7bfca1e..611bc9f 100644
4033 ---- a/drivers/usb/host/ohci-omap.c
4034 -+++ b/drivers/usb/host/ohci-omap.c
4035 -@@ -519,7 +519,7 @@ static int ohci_omap_resume(struct platform_device *dev)
4036 -
4037 - omap_ohci_clock_power(1);
4038 - dev->dev.power.power_state = PMSG_ON;
4039 -- usb_hcd_resume_root_hub(platform_get_drvdata(dev));
4040 -+ ohci_finish_controller_resume(hcd);
4041 - return 0;
4042 - }
4043 -
4044 -diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
4045 -index b0e2275..b4886e1 100644
4046 ---- a/drivers/usb/host/ohci-pci.c
4047 -+++ b/drivers/usb/host/ohci-pci.c
4048 -@@ -238,42 +238,6 @@ static int __devinit ohci_pci_start (struct usb_hcd *hcd)
4049 - return ret;
4050 - }
4051 -
4052 --#if defined(CONFIG_USB_PERSIST) && (defined(CONFIG_USB_EHCI_HCD) || \
4053 -- defined(CONFIG_USB_EHCI_HCD_MODULE))
4054 --
4055 --/* Following a power loss, we must prepare to regain control of the ports
4056 -- * we used to own. This means turning on the port power before ehci-hcd
4057 -- * tries to switch ownership.
4058 -- *
4059 -- * This isn't a 100% perfect solution. On most systems the OHCI controllers
4060 -- * lie at lower PCI addresses than the EHCI controller, so they will be
4061 -- * discovered (and hence resumed) first. But there is no guarantee things
4062 -- * will always work this way. If the EHCI controller is resumed first and
4063 -- * the OHCI ports are unpowered, then the handover will fail.
4064 -- */
4065 --static void prepare_for_handover(struct usb_hcd *hcd)
4066 --{
4067 -- struct ohci_hcd *ohci = hcd_to_ohci(hcd);
4068 -- int port;
4069 --
4070 -- /* Here we "know" root ports should always stay powered */
4071 -- ohci_dbg(ohci, "powerup ports\n");
4072 -- for (port = 0; port < ohci->num_ports; port++)
4073 -- ohci_writel(ohci, RH_PS_PPS,
4074 -- &ohci->regs->roothub.portstatus[port]);
4075 --
4076 -- /* Flush those writes */
4077 -- ohci_readl(ohci, &ohci->regs->control);
4078 -- msleep(20);
4079 --}
4080 --
4081 --#else
4082 --
4083 --static inline void prepare_for_handover(struct usb_hcd *hcd)
4084 --{ }
4085 --
4086 --#endif /* CONFIG_USB_PERSIST etc. */
4087 --
4088 - #ifdef CONFIG_PM
4089 -
4090 - static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
4091 -@@ -312,13 +276,8 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)
4092 -
4093 - static int ohci_pci_resume (struct usb_hcd *hcd)
4094 - {
4095 -- struct ohci_hcd *ohci = hcd_to_ohci(hcd);
4096 --
4097 - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
4098 --
4099 -- /* FIXME: we should try to detect loss of VBUS power here */
4100 -- prepare_for_handover(hcd);
4101 -- ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrenable);
4102 -+ ohci_finish_controller_resume(hcd);
4103 - return 0;
4104 - }
4105 -
4106 -diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
4107 -index 8ad9b3b..3de3b00 100644
4108 ---- a/drivers/usb/host/ohci-pxa27x.c
4109 -+++ b/drivers/usb/host/ohci-pxa27x.c
4110 -@@ -358,8 +358,7 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
4111 - return status;
4112 -
4113 - pdev->dev.power.power_state = PMSG_ON;
4114 -- usb_hcd_resume_root_hub(hcd);
4115 --
4116 -+ ohci_finish_controller_resume(hcd);
4117 - return 0;
4118 - }
4119 - #endif
4120 -diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
4121 -index 4ea9276..c852f03 100644
4122 ---- a/drivers/usb/host/ohci-sm501.c
4123 -+++ b/drivers/usb/host/ohci-sm501.c
4124 -@@ -239,7 +239,7 @@ static int ohci_sm501_resume(struct platform_device *pdev)
4125 -
4126 - sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1);
4127 - dev->power.power_state = PMSG_ON;
4128 -- usb_hcd_resume_root_hub(platform_get_drvdata(pdev));
4129 -+ ohci_finish_controller_resume(hcd);
4130 - return 0;
4131 - }
4132 - #endif
4133 -diff --git a/drivers/usb/host/ohci-ssb.c b/drivers/usb/host/ohci-ssb.c
4134 -index 6e9c2d6..1c0867a 100644
4135 ---- a/drivers/usb/host/ohci-ssb.c
4136 -+++ b/drivers/usb/host/ohci-ssb.c
4137 -@@ -224,6 +224,7 @@ static int ssb_ohci_resume(struct ssb_device *dev)
4138 -
4139 - ssb_device_enable(dev, ohcidev->enable_flags);
4140 -
4141 -+ ohci_finish_controller_resume(hcd);
4142 - return 0;
4143 - }
4144 -
4145 -diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
4146 -index f156dba..a3482fc 100644
4147 ---- a/drivers/usb/serial/airprime.c
4148 -+++ b/drivers/usb/serial/airprime.c
4149 -@@ -220,7 +220,7 @@ static void airprime_close(struct usb_serial_port *port, struct file * filp)
4150 - mutex_lock(&port->serial->disc_mutex);
4151 - if (!port->serial->disconnected)
4152 - airprime_send_setup(port);
4153 -- mutex_lock(&port->serial->disc_mutex);
4154 -+ mutex_unlock(&port->serial->disc_mutex);
4155 -
4156 - for (i = 0; i < NUM_READ_URBS; ++i) {
4157 - usb_kill_urb (priv->read_urbp[i]);
4158 -diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h
4159 -index b7dc40b..632cd8a 100644
4160 ---- a/include/asm-sparc/mman.h
4161 -+++ b/include/asm-sparc/mman.h
4162 -@@ -37,9 +37,8 @@
4163 -
4164 - #ifdef __KERNEL__
4165 - #ifndef __ASSEMBLY__
4166 --#define arch_mmap_check sparc_mmap_check
4167 --int sparc_mmap_check(unsigned long addr, unsigned long len,
4168 -- unsigned long flags);
4169 -+#define arch_mmap_check(addr,len,flags) sparc_mmap_check(addr,len)
4170 -+int sparc_mmap_check(unsigned long addr, unsigned long len);
4171 - #endif
4172 - #endif
4173 -
4174 -diff --git a/include/asm-sparc/psr.h b/include/asm-sparc/psr.h
4175 -index 19c9780..2139704 100644
4176 ---- a/include/asm-sparc/psr.h
4177 -+++ b/include/asm-sparc/psr.h
4178 -@@ -25,6 +25,7 @@
4179 - #define PSR_PIL 0x00000f00 /* processor interrupt level */
4180 - #define PSR_EF 0x00001000 /* enable floating point */
4181 - #define PSR_EC 0x00002000 /* enable co-processor */
4182 -+#define PSR_SYSCALL 0x00004000 /* inside of a syscall */
4183 - #define PSR_LE 0x00008000 /* SuperSparcII little-endian */
4184 - #define PSR_ICC 0x00f00000 /* integer condition codes */
4185 - #define PSR_C 0x00100000 /* carry bit */
4186 -diff --git a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h
4187 -index 8201a7b..0afb867 100644
4188 ---- a/include/asm-sparc/ptrace.h
4189 -+++ b/include/asm-sparc/ptrace.h
4190 -@@ -10,6 +10,8 @@
4191 -
4192 - #ifndef __ASSEMBLY__
4193 -
4194 -+#include <linux/types.h>
4195 -+
4196 - struct pt_regs {
4197 - unsigned long psr;
4198 - unsigned long pc;
4199 -@@ -39,6 +41,16 @@ struct pt_regs {
4200 - #define UREG_FP UREG_I6
4201 - #define UREG_RETPC UREG_I7
4202 -
4203 -+static inline bool pt_regs_is_syscall(struct pt_regs *regs)
4204 -+{
4205 -+ return (regs->psr & PSR_SYSCALL);
4206 -+}
4207 -+
4208 -+static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
4209 -+{
4210 -+ return (regs->psr &= ~PSR_SYSCALL);
4211 -+}
4212 -+
4213 - /* A register window */
4214 - struct reg_window {
4215 - unsigned long locals[8];
4216 -@@ -149,6 +161,7 @@ extern void show_regs(struct pt_regs *);
4217 - #define SF_XXARG 0x5c
4218 -
4219 - /* Stuff for the ptrace system call */
4220 -+#define PTRACE_SPARC_DETACH 11
4221 - #define PTRACE_GETREGS 12
4222 - #define PTRACE_SETREGS 13
4223 - #define PTRACE_GETFPREGS 14
4224 -diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
4225 -index d03a21c..94071c7 100644
4226 ---- a/include/asm-sparc/signal.h
4227 -+++ b/include/asm-sparc/signal.h
4228 -@@ -199,13 +199,7 @@ typedef struct sigaltstack {
4229 - size_t ss_size;
4230 - } stack_t;
4231 -
4232 --struct sparc_deliver_cookie {
4233 -- int restart_syscall;
4234 -- unsigned long orig_i0;
4235 --};
4236 --
4237 --struct pt_regs;
4238 --extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
4239 -+#define ptrace_signal_deliver(regs, cookie) do { } while (0)
4240 -
4241 - #endif /* !(__KERNEL__) */
4242 -
4243 -diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h
4244 -index 8cc1860..e0fcfca 100644
4245 ---- a/include/asm-sparc64/mman.h
4246 -+++ b/include/asm-sparc64/mman.h
4247 -@@ -37,9 +37,8 @@
4248 -
4249 - #ifdef __KERNEL__
4250 - #ifndef __ASSEMBLY__
4251 --#define arch_mmap_check sparc64_mmap_check
4252 --int sparc64_mmap_check(unsigned long addr, unsigned long len,
4253 -- unsigned long flags);
4254 -+#define arch_mmap_check(addr,len,flags) sparc64_mmap_check(addr,len)
4255 -+int sparc64_mmap_check(unsigned long addr, unsigned long len);
4256 - #endif
4257 - #endif
4258 -
4259 -diff --git a/include/asm-sparc64/psrcompat.h b/include/asm-sparc64/psrcompat.h
4260 -index 5590ce6..3614ca0 100644
4261 ---- a/include/asm-sparc64/psrcompat.h
4262 -+++ b/include/asm-sparc64/psrcompat.h
4263 -@@ -12,6 +12,7 @@
4264 - #define PSR_PIL 0x00000f00 /* processor interrupt level */
4265 - #define PSR_EF 0x00001000 /* enable floating point */
4266 - #define PSR_EC 0x00002000 /* enable co-processor */
4267 -+#define PSR_SYSCALL 0x00004000 /* inside of a syscall */
4268 - #define PSR_LE 0x00008000 /* SuperSparcII little-endian */
4269 - #define PSR_ICC 0x00f00000 /* integer condition codes */
4270 - #define PSR_C 0x00100000 /* carry bit */
4271 -@@ -30,6 +31,7 @@ static inline unsigned int tstate_to_psr(unsigned long tstate)
4272 - PSR_S |
4273 - ((tstate & TSTATE_ICC) >> 12) |
4274 - ((tstate & TSTATE_XCC) >> 20) |
4275 -+ ((tstate & TSTATE_SYSCALL) ? PSR_SYSCALL : 0) |
4276 - PSR_V8PLUS);
4277 - }
4278 -
4279 -diff --git a/include/asm-sparc64/pstate.h b/include/asm-sparc64/pstate.h
4280 -index f3c4548..949aeba 100644
4281 ---- a/include/asm-sparc64/pstate.h
4282 -+++ b/include/asm-sparc64/pstate.h
4283 -@@ -62,6 +62,7 @@
4284 - #define TSTATE_PRIV _AC(0x0000000000000400,UL) /* Privilege. */
4285 - #define TSTATE_IE _AC(0x0000000000000200,UL) /* Interrupt Enable. */
4286 - #define TSTATE_AG _AC(0x0000000000000100,UL) /* Alternate Globals.*/
4287 -+#define TSTATE_SYSCALL _AC(0x0000000000000020,UL) /* in syscall trap */
4288 - #define TSTATE_CWP _AC(0x000000000000001f,UL) /* Curr Win-Pointer. */
4289 -
4290 - /* Floating-Point Registers State Register.
4291 -diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
4292 -index 6da1978..0093f60 100644
4293 ---- a/include/asm-sparc64/ptrace.h
4294 -+++ b/include/asm-sparc64/ptrace.h
4295 -@@ -10,6 +10,8 @@
4296 -
4297 - #ifndef __ASSEMBLY__
4298 -
4299 -+#include <linux/types.h>
4300 -+
4301 - struct pt_regs {
4302 - unsigned long u_regs[16]; /* globals and ins */
4303 - unsigned long tstate;
4304 -@@ -27,6 +29,16 @@ struct pt_regs32 {
4305 - unsigned int u_regs[16]; /* globals and ins */
4306 - };
4307 -
4308 -+static inline bool pt_regs_is_syscall(struct pt_regs *regs)
4309 -+{
4310 -+ return (regs->tstate & TSTATE_SYSCALL);
4311 -+}
4312 -+
4313 -+static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
4314 -+{
4315 -+ return (regs->tstate &= ~TSTATE_SYSCALL);
4316 -+}
4317 -+
4318 - #define UREG_G0 0
4319 - #define UREG_G1 1
4320 - #define UREG_G2 2
4321 -@@ -263,6 +275,7 @@ extern void __show_regs(struct pt_regs *);
4322 - #define SF_XXARG 0x5c
4323 -
4324 - /* Stuff for the ptrace system call */
4325 -+#define PTRACE_SPARC_DETACH 11
4326 - #define PTRACE_GETREGS 12
4327 - #define PTRACE_SETREGS 13
4328 - #define PTRACE_GETFPREGS 14
4329 -diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
4330 -index fa6f467..c49f32d 100644
4331 ---- a/include/asm-sparc64/signal.h
4332 -+++ b/include/asm-sparc64/signal.h
4333 -@@ -186,13 +186,7 @@ struct k_sigaction {
4334 - void __user *ka_restorer;
4335 - };
4336 -
4337 --struct signal_deliver_cookie {
4338 -- int restart_syscall;
4339 -- unsigned long orig_i0;
4340 --};
4341 --
4342 --struct pt_regs;
4343 --extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
4344 -+#define ptrace_signal_deliver(regs, cookie) do { } while (0)
4345 -
4346 - #endif /* !(__KERNEL__) */
4347 -
4348 -diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
4349 -index bbb9c8f..6ef3d3b 100644
4350 ---- a/include/asm-sparc64/ttable.h
4351 -+++ b/include/asm-sparc64/ttable.h
4352 -@@ -91,13 +91,14 @@
4353 - clr %l6;
4354 -
4355 - #define SYSCALL_TRAP(routine, systbl) \
4356 -+ rdpr %pil, %g2; \
4357 -+ mov TSTATE_SYSCALL, %g3; \
4358 - sethi %hi(109f), %g7; \
4359 -- ba,pt %xcc, etrap; \
4360 -+ ba,pt %xcc, etrap_syscall; \
4361 - 109: or %g7, %lo(109b), %g7; \
4362 - sethi %hi(systbl), %l7; \
4363 - ba,pt %xcc, routine; \
4364 -- or %l7, %lo(systbl), %l7; \
4365 -- nop; nop;
4366 -+ or %l7, %lo(systbl), %l7;
4367 -
4368 - #define INDIRECT_SOLARIS_SYSCALL(num) \
4369 - sethi %hi(109f), %g7; \
4370 -diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h
4371 -index 8af05a9..db684e1 100644
4372 ---- a/include/asm-x86/topology.h
4373 -+++ b/include/asm-x86/topology.h
4374 -@@ -25,6 +25,16 @@
4375 - #ifndef _ASM_X86_TOPOLOGY_H
4376 - #define _ASM_X86_TOPOLOGY_H
4377 -
4378 -+#ifdef CONFIG_X86_32
4379 -+# ifdef CONFIG_X86_HT
4380 -+# define ENABLE_TOPO_DEFINES
4381 -+# endif
4382 -+#else
4383 -+# ifdef CONFIG_SMP
4384 -+# define ENABLE_TOPO_DEFINES
4385 -+# endif
4386 -+#endif
4387 -+
4388 - #ifdef CONFIG_NUMA
4389 - #include <linux/cpumask.h>
4390 - #include <asm/mpspec.h>
4391 -@@ -112,10 +122,6 @@ extern unsigned long node_end_pfn[];
4392 - extern unsigned long node_remap_size[];
4393 - #define node_has_online_mem(nid) (node_start_pfn[nid] != node_end_pfn[nid])
4394 -
4395 --# ifdef CONFIG_X86_HT
4396 --# define ENABLE_TOPO_DEFINES
4397 --# endif
4398 --
4399 - # define SD_CACHE_NICE_TRIES 1
4400 - # define SD_IDLE_IDX 1
4401 - # define SD_NEWIDLE_IDX 2
4402 -@@ -123,10 +129,6 @@ extern unsigned long node_remap_size[];
4403 -
4404 - #else
4405 -
4406 --# ifdef CONFIG_SMP
4407 --# define ENABLE_TOPO_DEFINES
4408 --# endif
4409 --
4410 - # define SD_CACHE_NICE_TRIES 2
4411 - # define SD_IDLE_IDX 2
4412 - # define SD_NEWIDLE_IDX 0
4413 -diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
4414 -index 56f3c94..9a51eba 100644
4415 ---- a/include/net/ip_vs.h
4416 -+++ b/include/net/ip_vs.h
4417 -@@ -405,7 +405,8 @@ struct sk_buff;
4418 - struct ip_vs_protocol {
4419 - struct ip_vs_protocol *next;
4420 - char *name;
4421 -- __u16 protocol;
4422 -+ u16 protocol;
4423 -+ u16 num_states;
4424 - int dont_defrag;
4425 - atomic_t appcnt; /* counter of proto app incs */
4426 - int *timeout_table; /* protocol timeout table */
4427 -diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
4428 -index e69ab2e..d9a4f7f 100644
4429 ---- a/include/net/netfilter/nf_conntrack_tuple.h
4430 -+++ b/include/net/netfilter/nf_conntrack_tuple.h
4431 -@@ -101,16 +101,6 @@ struct nf_conntrack_tuple_mask
4432 - } src;
4433 - };
4434 -
4435 --/* This is optimized opposed to a memset of the whole structure. Everything we
4436 -- * really care about is the source/destination unions */
4437 --#define NF_CT_TUPLE_U_BLANK(tuple) \
4438 -- do { \
4439 -- (tuple)->src.u.all = 0; \
4440 -- (tuple)->dst.u.all = 0; \
4441 -- memset(&(tuple)->src.u3, 0, sizeof((tuple)->src.u3)); \
4442 -- memset(&(tuple)->dst.u3, 0, sizeof((tuple)->dst.u3)); \
4443 -- } while (0)
4444 --
4445 - #ifdef __KERNEL__
4446 -
4447 - #define NF_CT_DUMP_TUPLE(tp) \
4448 -diff --git a/net/can/af_can.c b/net/can/af_can.c
4449 -index 36b9f22..6b956f5 100644
4450 ---- a/net/can/af_can.c
4451 -+++ b/net/can/af_can.c
4452 -@@ -208,6 +208,7 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
4453 - */
4454 - int can_send(struct sk_buff *skb, int loop)
4455 - {
4456 -+ struct sk_buff *newskb = NULL;
4457 - int err;
4458 -
4459 - if (skb->dev->type != ARPHRD_CAN) {
4460 -@@ -244,8 +245,7 @@ int can_send(struct sk_buff *skb, int loop)
4461 - * If the interface is not capable to do loopback
4462 - * itself, we do it here.
4463 - */
4464 -- struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
4465 --
4466 -+ newskb = skb_clone(skb, GFP_ATOMIC);
4467 - if (!newskb) {
4468 - kfree_skb(skb);
4469 - return -ENOMEM;
4470 -@@ -254,7 +254,6 @@ int can_send(struct sk_buff *skb, int loop)
4471 - newskb->sk = skb->sk;
4472 - newskb->ip_summed = CHECKSUM_UNNECESSARY;
4473 - newskb->pkt_type = PACKET_BROADCAST;
4474 -- netif_rx(newskb);
4475 - }
4476 - } else {
4477 - /* indication for the CAN driver: no loopback required */
4478 -@@ -266,11 +265,20 @@ int can_send(struct sk_buff *skb, int loop)
4479 - if (err > 0)
4480 - err = net_xmit_errno(err);
4481 -
4482 -+ if (err) {
4483 -+ if (newskb)
4484 -+ kfree_skb(newskb);
4485 -+ return err;
4486 -+ }
4487 -+
4488 -+ if (newskb)
4489 -+ netif_rx(newskb);
4490 -+
4491 - /* update statistics */
4492 - can_stats.tx_frames++;
4493 - can_stats.tx_frames_delta++;
4494 -
4495 -- return err;
4496 -+ return 0;
4497 - }
4498 - EXPORT_SYMBOL(can_send);
4499 -
4500 -diff --git a/net/dccp/feat.c b/net/dccp/feat.c
4501 -index 4a4f6ce..933a0ec 100644
4502 ---- a/net/dccp/feat.c
4503 -+++ b/net/dccp/feat.c
4504 -@@ -32,7 +32,7 @@ int dccp_feat_change(struct dccp_minisock *dmsk, u8 type, u8 feature,
4505 -
4506 - if (len > 3) {
4507 - DCCP_WARN("invalid length %d\n", len);
4508 -- return 1;
4509 -+ return -EINVAL;
4510 - }
4511 - /* XXX add further sanity checks */
4512 -
4513 -diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
4514 -index dde28a2..4b1c16c 100644
4515 ---- a/net/ipv4/ipvs/ip_vs_proto.c
4516 -+++ b/net/ipv4/ipvs/ip_vs_proto.c
4517 -@@ -148,7 +148,7 @@ const char * ip_vs_state_name(__u16 proto, int state)
4518 - struct ip_vs_protocol *pp = ip_vs_proto_get(proto);
4519 -
4520 - if (pp == NULL || pp->state_name == NULL)
4521 -- return "ERR!";
4522 -+ return (IPPROTO_IP == proto) ? "NONE" : "ERR!";
4523 - return pp->state_name(state);
4524 - }
4525 -
4526 -diff --git a/net/ipv4/ipvs/ip_vs_proto_ah.c b/net/ipv4/ipvs/ip_vs_proto_ah.c
4527 -index a842676..4bf835e 100644
4528 ---- a/net/ipv4/ipvs/ip_vs_proto_ah.c
4529 -+++ b/net/ipv4/ipvs/ip_vs_proto_ah.c
4530 -@@ -160,6 +160,7 @@ static void ah_exit(struct ip_vs_protocol *pp)
4531 - struct ip_vs_protocol ip_vs_protocol_ah = {
4532 - .name = "AH",
4533 - .protocol = IPPROTO_AH,
4534 -+ .num_states = 1,
4535 - .dont_defrag = 1,
4536 - .init = ah_init,
4537 - .exit = ah_exit,
4538 -diff --git a/net/ipv4/ipvs/ip_vs_proto_esp.c b/net/ipv4/ipvs/ip_vs_proto_esp.c
4539 -index aef0d3e..db6a6b7 100644
4540 ---- a/net/ipv4/ipvs/ip_vs_proto_esp.c
4541 -+++ b/net/ipv4/ipvs/ip_vs_proto_esp.c
4542 -@@ -159,6 +159,7 @@ static void esp_exit(struct ip_vs_protocol *pp)
4543 - struct ip_vs_protocol ip_vs_protocol_esp = {
4544 - .name = "ESP",
4545 - .protocol = IPPROTO_ESP,
4546 -+ .num_states = 1,
4547 - .dont_defrag = 1,
4548 - .init = esp_init,
4549 - .exit = esp_exit,
4550 -diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
4551 -index 12dc0d6..480f876 100644
4552 ---- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
4553 -+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
4554 -@@ -594,6 +594,7 @@ static void ip_vs_tcp_exit(struct ip_vs_protocol *pp)
4555 - struct ip_vs_protocol ip_vs_protocol_tcp = {
4556 - .name = "TCP",
4557 - .protocol = IPPROTO_TCP,
4558 -+ .num_states = IP_VS_TCP_S_LAST,
4559 - .dont_defrag = 0,
4560 - .appcnt = ATOMIC_INIT(0),
4561 - .init = ip_vs_tcp_init,
4562 -diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
4563 -index 1fa7b33..8e3b059 100644
4564 ---- a/net/ipv4/ipvs/ip_vs_proto_udp.c
4565 -+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
4566 -@@ -409,6 +409,7 @@ static void udp_exit(struct ip_vs_protocol *pp)
4567 - struct ip_vs_protocol ip_vs_protocol_udp = {
4568 - .name = "UDP",
4569 - .protocol = IPPROTO_UDP,
4570 -+ .num_states = IP_VS_UDP_S_LAST,
4571 - .dont_defrag = 0,
4572 - .init = udp_init,
4573 - .exit = udp_exit,
4574 -diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
4575 -index 948378d..a392d6e 100644
4576 ---- a/net/ipv4/ipvs/ip_vs_sync.c
4577 -+++ b/net/ipv4/ipvs/ip_vs_sync.c
4578 -@@ -288,11 +288,16 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
4579 - char *p;
4580 - int i;
4581 -
4582 -+ if (buflen < sizeof(struct ip_vs_sync_mesg)) {
4583 -+ IP_VS_ERR_RL("sync message header too short\n");
4584 -+ return;
4585 -+ }
4586 -+
4587 - /* Convert size back to host byte order */
4588 - m->size = ntohs(m->size);
4589 -
4590 - if (buflen != m->size) {
4591 -- IP_VS_ERR("bogus message\n");
4592 -+ IP_VS_ERR_RL("bogus sync message size\n");
4593 - return;
4594 - }
4595 -
4596 -@@ -307,9 +312,48 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
4597 - for (i=0; i<m->nr_conns; i++) {
4598 - unsigned flags, state;
4599 -
4600 -- s = (struct ip_vs_sync_conn *)p;
4601 -+ if (p + SIMPLE_CONN_SIZE > buffer+buflen) {
4602 -+ IP_VS_ERR_RL("bogus conn in sync message\n");
4603 -+ return;
4604 -+ }
4605 -+ s = (struct ip_vs_sync_conn *) p;
4606 - flags = ntohs(s->flags) | IP_VS_CONN_F_SYNC;
4607 -+ flags &= ~IP_VS_CONN_F_HASHED;
4608 -+ if (flags & IP_VS_CONN_F_SEQ_MASK) {
4609 -+ opt = (struct ip_vs_sync_conn_options *)&s[1];
4610 -+ p += FULL_CONN_SIZE;
4611 -+ if (p > buffer+buflen) {
4612 -+ IP_VS_ERR_RL("bogus conn options in sync message\n");
4613 -+ return;
4614 -+ }
4615 -+ } else {
4616 -+ opt = NULL;
4617 -+ p += SIMPLE_CONN_SIZE;
4618 -+ }
4619 -+
4620 - state = ntohs(s->state);
4621 -+ if (!(flags & IP_VS_CONN_F_TEMPLATE)) {
4622 -+ pp = ip_vs_proto_get(s->protocol);
4623 -+ if (!pp) {
4624 -+ IP_VS_ERR_RL("Unsupported protocol %u in sync msg\n",
4625 -+ s->protocol);
4626 -+ continue;
4627 -+ }
4628 -+ if (state >= pp->num_states) {
4629 -+ IP_VS_DBG(2, "Invalid %s state %u in sync msg\n",
4630 -+ pp->name, state);
4631 -+ continue;
4632 -+ }
4633 -+ } else {
4634 -+ /* protocol in templates is not used for state/timeout */
4635 -+ pp = NULL;
4636 -+ if (state > 0) {
4637 -+ IP_VS_DBG(2, "Invalid template state %u in sync msg\n",
4638 -+ state);
4639 -+ state = 0;
4640 -+ }
4641 -+ }
4642 -+
4643 - if (!(flags & IP_VS_CONN_F_TEMPLATE))
4644 - cp = ip_vs_conn_in_get(s->protocol,
4645 - s->caddr, s->cport,
4646 -@@ -345,14 +389,9 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
4647 - IP_VS_ERR("ip_vs_conn_new failed\n");
4648 - return;
4649 - }
4650 -- cp->state = state;
4651 - } else if (!cp->dest) {
4652 - dest = ip_vs_try_bind_dest(cp);
4653 -- if (!dest) {
4654 -- /* it is an unbound entry created by
4655 -- * synchronization */
4656 -- cp->flags = flags | IP_VS_CONN_F_HASHED;
4657 -- } else
4658 -+ if (dest)
4659 - atomic_dec(&dest->refcnt);
4660 - } else if ((cp->dest) && (cp->protocol == IPPROTO_TCP) &&
4661 - (cp->state != state)) {
4662 -@@ -371,23 +410,22 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
4663 - }
4664 - }
4665 -
4666 -- if (flags & IP_VS_CONN_F_SEQ_MASK) {
4667 -- opt = (struct ip_vs_sync_conn_options *)&s[1];
4668 -+ if (opt)
4669 - memcpy(&cp->in_seq, opt, sizeof(*opt));
4670 -- p += FULL_CONN_SIZE;
4671 -- } else
4672 -- p += SIMPLE_CONN_SIZE;
4673 --
4674 - atomic_set(&cp->in_pkts, sysctl_ip_vs_sync_threshold[0]);
4675 - cp->state = state;
4676 -- pp = ip_vs_proto_get(s->protocol);
4677 -- cp->timeout = pp->timeout_table[cp->state];
4678 -+ cp->old_state = cp->state;
4679 -+ /*
4680 -+ * We can not recover the right timeout for templates
4681 -+ * in all cases, we can not find the right fwmark
4682 -+ * virtual service. If needed, we can do it for
4683 -+ * non-fwmark persistent services.
4684 -+ */
4685 -+ if (!(flags & IP_VS_CONN_F_TEMPLATE) && pp->timeout_table)
4686 -+ cp->timeout = pp->timeout_table[state];
4687 -+ else
4688 -+ cp->timeout = (3*60*HZ);
4689 - ip_vs_conn_put(cp);
4690 --
4691 -- if (p > buffer+buflen) {
4692 -- IP_VS_ERR("bogus message\n");
4693 -- return;
4694 -- }
4695 - }
4696 - }
4697 -
4698 -diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
4699 -index 4dc1628..e46d8fa 100644
4700 ---- a/net/ipv4/netfilter/ip_queue.c
4701 -+++ b/net/ipv4/netfilter/ip_queue.c
4702 -@@ -296,9 +296,8 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e)
4703 - if (v->data_len > 0xFFFF)
4704 - return -EINVAL;
4705 - if (diff > skb_tailroom(e->skb)) {
4706 -- nskb = skb_copy_expand(e->skb, 0,
4707 -- diff - skb_tailroom(e->skb),
4708 -- GFP_ATOMIC);
4709 -+ nskb = skb_copy_expand(e->skb, skb_headroom(e->skb),
4710 -+ diff, GFP_ATOMIC);
4711 - if (!nskb) {
4712 - printk(KERN_WARNING "ip_queue: error "
4713 - "in mangle, dropping packet\n");
4714 -diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
4715 -index a65b845..50ad6ef 100644
4716 ---- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
4717 -+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
4718 -@@ -305,7 +305,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
4719 - const struct nf_conntrack_tuple_hash *h;
4720 - struct nf_conntrack_tuple tuple;
4721 -
4722 -- NF_CT_TUPLE_U_BLANK(&tuple);
4723 -+ memset(&tuple, 0, sizeof(tuple));
4724 - tuple.src.u3.ip = inet->rcv_saddr;
4725 - tuple.src.u.tcp.port = inet->sport;
4726 - tuple.dst.u3.ip = inet->daddr;
4727 -diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
4728 -index 8d366f7..12b4dc5 100644
4729 ---- a/net/ipv6/netfilter/ip6_queue.c
4730 -+++ b/net/ipv6/netfilter/ip6_queue.c
4731 -@@ -298,9 +298,8 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct nf_queue_entry *e)
4732 - if (v->data_len > 0xFFFF)
4733 - return -EINVAL;
4734 - if (diff > skb_tailroom(e->skb)) {
4735 -- nskb = skb_copy_expand(e->skb, 0,
4736 -- diff - skb_tailroom(e->skb),
4737 -- GFP_ATOMIC);
4738 -+ nskb = skb_copy_expand(e->skb, skb_headroom(e->skb),
4739 -+ diff, GFP_ATOMIC);
4740 - if (!nskb) {
4741 - printk(KERN_WARNING "ip6_queue: OOM "
4742 - "in mangle, dropping packet\n");
4743 -diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
4744 -index b77eb56..4147de6 100644
4745 ---- a/net/netfilter/nf_conntrack_core.c
4746 -+++ b/net/netfilter/nf_conntrack_core.c
4747 -@@ -104,7 +104,7 @@ nf_ct_get_tuple(const struct sk_buff *skb,
4748 - const struct nf_conntrack_l3proto *l3proto,
4749 - const struct nf_conntrack_l4proto *l4proto)
4750 - {
4751 -- NF_CT_TUPLE_U_BLANK(tuple);
4752 -+ memset(tuple, 0, sizeof(*tuple));
4753 -
4754 - tuple->src.l3num = l3num;
4755 - if (l3proto->pkt_to_tuple(skb, nhoff, tuple) == 0)
4756 -@@ -153,7 +153,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
4757 - const struct nf_conntrack_l3proto *l3proto,
4758 - const struct nf_conntrack_l4proto *l4proto)
4759 - {
4760 -- NF_CT_TUPLE_U_BLANK(inverse);
4761 -+ memset(inverse, 0, sizeof(*inverse));
4762 -
4763 - inverse->src.l3num = orig->src.l3num;
4764 - if (l3proto->invert_tuple(inverse, orig) == 0)
4765 -diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
4766 -index 10522c0..bcaf967 100644
4767 ---- a/net/netfilter/nfnetlink_queue.c
4768 -+++ b/net/netfilter/nfnetlink_queue.c
4769 -@@ -454,9 +454,8 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e)
4770 - if (data_len > 0xFFFF)
4771 - return -EINVAL;
4772 - if (diff > skb_tailroom(e->skb)) {
4773 -- nskb = skb_copy_expand(e->skb, 0,
4774 -- diff - skb_tailroom(e->skb),
4775 -- GFP_ATOMIC);
4776 -+ nskb = skb_copy_expand(e->skb, skb_headroom(e->skb),
4777 -+ diff, GFP_ATOMIC);
4778 - if (!nskb) {
4779 - printk(KERN_WARNING "nf_queue: OOM "
4780 - "in mangle, dropping packet\n");
4781 -diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
4782 -index 66148cc..5bc1ed4 100644
4783 ---- a/net/sched/sch_htb.c
4784 -+++ b/net/sched/sch_htb.c
4785 -@@ -1197,12 +1197,16 @@ static inline int htb_parent_last_child(struct htb_class *cl)
4786 - return 1;
4787 - }
4788 -
4789 --static void htb_parent_to_leaf(struct htb_class *cl, struct Qdisc *new_q)
4790 -+static void htb_parent_to_leaf(struct htb_sched *q, struct htb_class *cl,
4791 -+ struct Qdisc *new_q)
4792 - {
4793 - struct htb_class *parent = cl->parent;
4794 -
4795 - BUG_TRAP(!cl->level && cl->un.leaf.q && !cl->prio_activity);
4796 -
4797 -+ if (parent->cmode != HTB_CAN_SEND)
4798 -+ htb_safe_rb_erase(&parent->pq_node, q->wait_pq + parent->level);
4799 -+
4800 - parent->level = 0;
4801 - memset(&parent->un.inner, 0, sizeof(parent->un.inner));
4802 - INIT_LIST_HEAD(&parent->un.leaf.drop_list);
4803 -@@ -1300,7 +1304,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
4804 - htb_deactivate(q, cl);
4805 -
4806 - if (last_child)
4807 -- htb_parent_to_leaf(cl, new_q);
4808 -+ htb_parent_to_leaf(q, cl, new_q);
4809 -
4810 - if (--cl->refcnt == 0)
4811 - htb_destroy_class(sch, cl);
4812 -diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
4813 -index 58f1f93..413885c 100644
4814 ---- a/net/xfrm/xfrm_state.c
4815 -+++ b/net/xfrm/xfrm_state.c
4816 -@@ -2093,7 +2093,7 @@ static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family,
4817 - iph6 = ipv6_hdr(skb);
4818 - audit_log_format(audit_buf,
4819 - " src=" NIP6_FMT " dst=" NIP6_FMT
4820 -- " flowlbl=0x%x%x%x",
4821 -+ " flowlbl=0x%x%02x%02x",
4822 - NIP6(iph6->saddr),
4823 - NIP6(iph6->daddr),
4824 - iph6->flow_lbl[0] & 0x0f,
4825
4826 Deleted: genpatches-2.6/trunk/2.6.26/1004_linux-2.6.25.5.patch
4827 ===================================================================
4828 --- genpatches-2.6/trunk/2.6.26/1004_linux-2.6.25.5.patch 2008-07-17 02:44:10 UTC (rev 1328)
4829 +++ genpatches-2.6/trunk/2.6.26/1004_linux-2.6.25.5.patch 2008-07-17 02:47:50 UTC (rev 1329)
4830 @@ -1,78 +0,0 @@
4831 -diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
4832 -index bcda2c6..5dbba89 100644
4833 ---- a/fs/cifs/asn1.c
4834 -+++ b/fs/cifs/asn1.c
4835 -@@ -186,6 +186,11 @@ asn1_length_decode(struct asn1_ctx *ctx, unsigned int *def, unsigned int *len)
4836 - }
4837 - }
4838 - }
4839 -+
4840 -+ /* don't trust len bigger than ctx buffer */
4841 -+ if (*len > ctx->end - ctx->pointer)
4842 -+ return 0;
4843 -+
4844 - return 1;
4845 - }
4846 -
4847 -@@ -203,6 +208,10 @@ asn1_header_decode(struct asn1_ctx *ctx,
4848 - if (!asn1_length_decode(ctx, &def, &len))
4849 - return 0;
4850 -
4851 -+ /* primitive shall be definite, indefinite shall be constructed */
4852 -+ if (*con == ASN1_PRI && !def)
4853 -+ return 0;
4854 -+
4855 - if (def)
4856 - *eoc = ctx->pointer + len;
4857 - else
4858 -@@ -389,6 +398,11 @@ asn1_oid_decode(struct asn1_ctx *ctx,
4859 - unsigned long *optr;
4860 -
4861 - size = eoc - ctx->pointer + 1;
4862 -+
4863 -+ /* first subid actually encodes first two subids */
4864 -+ if (size < 2 || size > ULONG_MAX/sizeof(unsigned long))
4865 -+ return 0;
4866 -+
4867 - *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
4868 - if (*oid == NULL)
4869 - return 0;
4870 -diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
4871 -index 540ce6a..5f35f0b 100644
4872 ---- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
4873 -+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
4874 -@@ -231,6 +231,11 @@ static unsigned char asn1_length_decode(struct asn1_ctx *ctx,
4875 - }
4876 - }
4877 - }
4878 -+
4879 -+ /* don't trust len bigger than ctx buffer */
4880 -+ if (*len > ctx->end - ctx->pointer)
4881 -+ return 0;
4882 -+
4883 - return 1;
4884 - }
4885 -
4886 -@@ -249,6 +254,10 @@ static unsigned char asn1_header_decode(struct asn1_ctx *ctx,
4887 - if (!asn1_length_decode(ctx, &def, &len))
4888 - return 0;
4889 -
4890 -+ /* primitive shall be definite, indefinite shall be constructed */
4891 -+ if (*con == ASN1_PRI && !def)
4892 -+ return 0;
4893 -+
4894 - if (def)
4895 - *eoc = ctx->pointer + len;
4896 - else
4897 -@@ -433,6 +442,11 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
4898 - unsigned long *optr;
4899 -
4900 - size = eoc - ctx->pointer + 1;
4901 -+
4902 -+ /* first subid actually encodes first two subids */
4903 -+ if (size < 2 || size > ULONG_MAX/sizeof(unsigned long))
4904 -+ return 0;
4905 -+
4906 - *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
4907 - if (*oid == NULL) {
4908 - if (net_ratelimit())
4909
4910 Deleted: genpatches-2.6/trunk/2.6.26/1005_linux-2.6.25.6.patch
4911 ===================================================================
4912 --- genpatches-2.6/trunk/2.6.26/1005_linux-2.6.25.6.patch 2008-07-17 02:44:10 UTC (rev 1328)
4913 +++ genpatches-2.6/trunk/2.6.26/1005_linux-2.6.25.6.patch 2008-07-17 02:47:50 UTC (rev 1329)
4914 @@ -1,1803 +0,0 @@
4915 -diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
4916 -index be35ffa..1457aa0 100644
4917 ---- a/arch/powerpc/kernel/smp.c
4918 -+++ b/arch/powerpc/kernel/smp.c
4919 -@@ -386,6 +386,8 @@ static void __init smp_create_idle(unsigned int cpu)
4920 - panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
4921 - #ifdef CONFIG_PPC64
4922 - paca[cpu].__current = p;
4923 -+ paca[cpu].kstack = (unsigned long) task_thread_info(p)
4924 -+ + THREAD_SIZE - STACK_FRAME_OVERHEAD;
4925 - #endif
4926 - current_set[cpu] = task_thread_info(p);
4927 - task_thread_info(p)->cpu = cpu;
4928 -diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
4929 -index 906daed..a9626d6 100644
4930 ---- a/arch/powerpc/mm/slb.c
4931 -+++ b/arch/powerpc/mm/slb.c
4932 -@@ -44,13 +44,13 @@ static void slb_allocate(unsigned long ea)
4933 - slb_allocate_realmode(ea);
4934 - }
4935 -
4936 -+#define slb_esid_mask(ssize) \
4937 -+ (((ssize) == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T)
4938 -+
4939 - static inline unsigned long mk_esid_data(unsigned long ea, int ssize,
4940 - unsigned long slot)
4941 - {
4942 -- unsigned long mask;
4943 --
4944 -- mask = (ssize == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T;
4945 -- return (ea & mask) | SLB_ESID_V | slot;
4946 -+ return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
4947 - }
4948 -
4949 - #define slb_vsid_shift(ssize) \
4950 -@@ -301,11 +301,16 @@ void slb_initialize(void)
4951 -
4952 - create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1);
4953 -
4954 -+ /* For the boot cpu, we're running on the stack in init_thread_union,
4955 -+ * which is in the first segment of the linear mapping, and also
4956 -+ * get_paca()->kstack hasn't been initialized yet.
4957 -+ * For secondary cpus, we need to bolt the kernel stack entry now.
4958 -+ */
4959 - slb_shadow_clear(2);
4960 -+ if (raw_smp_processor_id() != boot_cpuid &&
4961 -+ (get_paca()->kstack & slb_esid_mask(mmu_kernel_ssize)) > PAGE_OFFSET)
4962 -+ create_shadowed_slbe(get_paca()->kstack,
4963 -+ mmu_kernel_ssize, lflags, 2);
4964 -
4965 -- /* We don't bolt the stack for the time being - we're in boot,
4966 -- * so the stack is in the bolted segment. By the time it goes
4967 -- * elsewhere, we'll call _switch() which will bolt in the new
4968 -- * one. */
4969 - asm volatile("isync":::"memory");
4970 - }
4971 -diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
4972 -index d8d03e0..9629434 100644
4973 ---- a/arch/x86/kernel/apic_64.c
4974 -+++ b/arch/x86/kernel/apic_64.c
4975 -@@ -524,7 +524,7 @@ int setup_profiling_timer(unsigned int multiplier)
4976 - */
4977 - void clear_local_APIC(void)
4978 - {
4979 -- int maxlvt = lapic_get_maxlvt();
4980 -+ int maxlvt;
4981 - u32 v;
4982 -
4983 - /* APIC hasn't been mapped yet */
4984 -diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
4985 -index a962dcb..404ff26 100644
4986 ---- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
4987 -+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
4988 -@@ -339,6 +339,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
4989 - {
4990 - struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu);
4991 - unsigned int freq;
4992 -+ unsigned int cached_freq;
4993 -
4994 - dprintk("get_cur_freq_on_cpu (%d)\n", cpu);
4995 -
4996 -@@ -347,7 +348,16 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
4997 - return 0;
4998 - }
4999 -
5000 -+ cached_freq = data->freq_table[data->acpi_data->state].frequency;
5001 - freq = extract_freq(get_cur_val(cpumask_of_cpu(cpu)), data);
5002 -+ if (freq != cached_freq) {
5003 -+ /*
5004 -+ * The dreaded BIOS frequency change behind our back.
5005 -+ * Force set the frequency on next target call.
5006 -+ */
5007 -+ data->resume = 1;
5008 -+ }
5009 -+
5010 - dprintk("cur freq = %u\n", freq);
5011 -
5012 - return freq;
5013 -diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
5014 -index cef054b..89bb5ee 100644
5015 ---- a/arch/x86/kernel/irq_32.c
5016 -+++ b/arch/x86/kernel/irq_32.c
5017 -@@ -134,7 +134,7 @@ unsigned int do_IRQ(struct pt_regs *regs)
5018 - : "=a" (arg1), "=d" (arg2), "=b" (bx)
5019 - : "0" (irq), "1" (desc), "2" (isp),
5020 - "D" (desc->handle_irq)
5021 -- : "memory", "cc"
5022 -+ : "memory", "cc", "ecx"
5023 - );
5024 - } else
5025 - #endif
5026 -diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
5027 -index 43930e7..c8890b8 100644
5028 ---- a/arch/x86/kernel/process_32.c
5029 -+++ b/arch/x86/kernel/process_32.c
5030 -@@ -710,8 +710,11 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
5031 - /* If the task has used fpu the last 5 timeslices, just do a full
5032 - * restore of the math state immediately to avoid the trap; the
5033 - * chances of needing FPU soon are obviously high now
5034 -+ *
5035 -+ * tsk_used_math() checks prevent calling math_state_restore(),
5036 -+ * which can sleep in the case of !tsk_used_math()
5037 - */
5038 -- if (next_p->fpu_counter > 5)
5039 -+ if (tsk_used_math(next_p) && next_p->fpu_counter > 5)
5040 - math_state_restore();
5041 -
5042 - /*
5043 -diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
5044 -index 46c4c54..1316f1c 100644
5045 ---- a/arch/x86/kernel/process_64.c
5046 -+++ b/arch/x86/kernel/process_64.c
5047 -@@ -696,8 +696,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
5048 - /* If the task has used fpu the last 5 timeslices, just do a full
5049 - * restore of the math state immediately to avoid the trap; the
5050 - * chances of needing FPU soon are obviously high now
5051 -+ *
5052 -+ * tsk_used_math() checks prevent calling math_state_restore(),
5053 -+ * which can sleep in the case of !tsk_used_math()
5054 - */
5055 -- if (next_p->fpu_counter>5)
5056 -+ if (tsk_used_math(next_p) && next_p->fpu_counter > 5)
5057 - math_state_restore();
5058 - return prev_p;
5059 - }
5060 -diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
5061 -index eb92ccb..9003e0b 100644
5062 ---- a/arch/x86/kernel/ptrace.c
5063 -+++ b/arch/x86/kernel/ptrace.c
5064 -@@ -1382,6 +1382,9 @@ static const struct user_regset_view user_x86_64_view = {
5065 - #define genregs32_get genregs_get
5066 - #define genregs32_set genregs_set
5067 -
5068 -+#define user_i387_ia32_struct user_i387_struct
5069 -+#define user32_fxsr_struct user_fxsr_struct
5070 -+
5071 - #endif /* CONFIG_X86_64 */
5072 -
5073 - #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
5074 -@@ -1394,13 +1397,13 @@ static const struct user_regset x86_32_regsets[] = {
5075 - },
5076 - [REGSET_FP] = {
5077 - .core_note_type = NT_PRFPREG,
5078 -- .n = sizeof(struct user_i387_struct) / sizeof(u32),
5079 -+ .n = sizeof(struct user_i387_ia32_struct) / sizeof(u32),
5080 - .size = sizeof(u32), .align = sizeof(u32),
5081 - .active = fpregs_active, .get = fpregs_get, .set = fpregs_set
5082 - },
5083 - [REGSET_XFP] = {
5084 - .core_note_type = NT_PRXFPREG,
5085 -- .n = sizeof(struct user_i387_struct) / sizeof(u32),
5086 -+ .n = sizeof(struct user32_fxsr_struct) / sizeof(u32),
5087 - .size = sizeof(u32), .align = sizeof(u32),
5088 - .active = xfpregs_active, .get = xfpregs_get, .set = xfpregs_set
5089 - },
5090 -diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c
5091 -index c2241e0..01e4f8b 100644
5092 ---- a/arch/x86/kernel/tsc_32.c
5093 -+++ b/arch/x86/kernel/tsc_32.c
5094 -@@ -14,7 +14,7 @@
5095 -
5096 - #include "mach_timer.h"
5097 -
5098 --static int tsc_enabled;
5099 -+static int tsc_disabled;
5100 -
5101 - /*
5102 - * On some systems the TSC frequency does not
5103 -@@ -28,8 +28,8 @@ EXPORT_SYMBOL_GPL(tsc_khz);
5104 - static int __init tsc_setup(char *str)
5105 - {
5106 - printk(KERN_WARNING "notsc: Kernel compiled with CONFIG_X86_TSC, "
5107 -- "cannot disable TSC completely.\n");
5108 -- mark_tsc_unstable("user disabled TSC");
5109 -+ "cannot disable TSC completely.\n");
5110 -+ tsc_disabled = 1;
5111 - return 1;
5112 - }
5113 - #else
5114 -@@ -121,7 +121,7 @@ unsigned long long native_sched_clock(void)
5115 - * very important for it to be as fast as the platform
5116 - * can achive it. )
5117 - */
5118 -- if (unlikely(!tsc_enabled && !tsc_unstable))
5119 -+ if (unlikely(tsc_disabled))
5120 - /* No locking but a rare wrong value is not a big deal: */
5121 - return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
5122 -
5123 -@@ -310,7 +310,6 @@ void mark_tsc_unstable(char *reason)
5124 - {
5125 - if (!tsc_unstable) {
5126 - tsc_unstable = 1;
5127 -- tsc_enabled = 0;
5128 - printk("Marking TSC unstable due to: %s.\n", reason);
5129 - /* Can be called before registration */
5130 - if (clocksource_tsc.mult)
5131 -@@ -324,7 +323,7 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);
5132 - static int __init dmi_mark_tsc_unstable(const struct dmi_system_id *d)
5133 - {
5134 - printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
5135 -- d->ident);
5136 -+ d->ident);
5137 - tsc_unstable = 1;
5138 - return 0;
5139 - }
5140 -@@ -391,14 +390,24 @@ void __init tsc_init(void)
5141 - {
5142 - int cpu;
5143 -
5144 -- if (!cpu_has_tsc)
5145 -- goto out_no_tsc;
5146 -+ if (!cpu_has_tsc || tsc_disabled) {
5147 -+ /* Disable the TSC in case of !cpu_has_tsc */
5148 -+ tsc_disabled = 1;
5149 -+ return;
5150 -+ }
5151 -
5152 - cpu_khz = calculate_cpu_khz();
5153 - tsc_khz = cpu_khz;
5154 -
5155 -- if (!cpu_khz)
5156 -- goto out_no_tsc;
5157 -+ if (!cpu_khz) {
5158 -+ mark_tsc_unstable("could not calculate TSC khz");
5159 -+ /*
5160 -+ * We need to disable the TSC completely in this case
5161 -+ * to prevent sched_clock() from using it.
5162 -+ */
5163 -+ tsc_disabled = 1;
5164 -+ return;
5165 -+ }
5166 -
5167 - printk("Detected %lu.%03lu MHz processor.\n",
5168 - (unsigned long)cpu_khz / 1000,
5169 -@@ -427,13 +436,6 @@ void __init tsc_init(void)
5170 - if (check_tsc_unstable()) {
5171 - clocksource_tsc.rating = 0;
5172 - clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
5173 -- } else
5174 -- tsc_enabled = 1;
5175 --
5176 -+ }
5177 - clocksource_register(&clocksource_tsc);
5178 --
5179 -- return;
5180 --
5181 --out_no_tsc:
5182 -- setup_clear_cpu_cap(X86_FEATURE_TSC);
5183 - }
5184 -diff --git a/arch/x86/kernel/tsc_64.c b/arch/x86/kernel/tsc_64.c
5185 -index d3bebaa..5153afc 100644
5186 ---- a/arch/x86/kernel/tsc_64.c
5187 -+++ b/arch/x86/kernel/tsc_64.c
5188 -@@ -227,14 +227,14 @@ void __init tsc_calibrate(void)
5189 - /* hpet or pmtimer available ? */
5190 - if (!hpet && !pm1 && !pm2) {
5191 - printk(KERN_INFO "TSC calibrated against PIT\n");
5192 -- return;
5193 -+ goto out;
5194 - }
5195 -
5196 - /* Check, whether the sampling was disturbed by an SMI */
5197 - if (tsc1 == ULONG_MAX || tsc2 == ULONG_MAX) {
5198 - printk(KERN_WARNING "TSC calibration disturbed by SMI, "
5199 - "using PIT calibration result\n");
5200 -- return;
5201 -+ goto out;
5202 - }
5203 -
5204 - tsc2 = (tsc2 - tsc1) * 1000000L;
5205 -@@ -255,6 +255,7 @@ void __init tsc_calibrate(void)
5206 -
5207 - tsc_khz = tsc2 / tsc1;
5208 -
5209 -+out:
5210 - for_each_possible_cpu(cpu)
5211 - set_cyc2ns_scale(tsc_khz, cpu);
5212 - }
5213 -diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
5214 -index a02a14f..b2c5231 100644
5215 ---- a/arch/x86/mm/init_64.c
5216 -+++ b/arch/x86/mm/init_64.c
5217 -@@ -192,7 +192,7 @@ void __init cleanup_highmap(void)
5218 - pmd_t *last_pmd = pmd + PTRS_PER_PMD;
5219 -
5220 - for (; pmd < last_pmd; pmd++, vaddr += PMD_SIZE) {
5221 -- if (!pmd_present(*pmd))
5222 -+ if (pmd_none(*pmd))
5223 - continue;
5224 - if (vaddr < (unsigned long) _text || vaddr > end)
5225 - set_pmd(pmd, __pmd(0));
5226 -diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
5227 -index 05356ce..c7e2a44 100644
5228 ---- a/arch/x86/pci/common.c
5229 -+++ b/arch/x86/pci/common.c
5230 -@@ -130,19 +130,6 @@ static void __devinit pcibios_fixup_ghosts(struct pci_bus *b)
5231 - }
5232 - }
5233 -
5234 --static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
5235 --{
5236 -- struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE];
5237 --
5238 -- if (rom_r->parent)
5239 -- return;
5240 -- if (rom_r->start)
5241 -- /* we deal with BIOS assigned ROM later */
5242 -- return;
5243 -- if (!(pci_probe & PCI_ASSIGN_ROMS))
5244 -- rom_r->start = rom_r->end = rom_r->flags = 0;
5245 --}
5246 --
5247 - /*
5248 - * Called after each bus is probed, but before its children
5249 - * are examined.
5250 -@@ -150,12 +137,8 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
5251 -
5252 - void __devinit pcibios_fixup_bus(struct pci_bus *b)
5253 - {
5254 -- struct pci_dev *dev;
5255 --
5256 - pcibios_fixup_ghosts(b);
5257 - pci_read_bridge_bases(b);
5258 -- list_for_each_entry(dev, &b->devices, bus_list)
5259 -- pcibios_fixup_device_resources(dev);
5260 - }
5261 -
5262 - /*
5263 -diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
5264 -index be95fdb..92da864 100644
5265 ---- a/drivers/ata/libata-core.c
5266 -+++ b/drivers/ata/libata-core.c
5267 -@@ -3947,6 +3947,7 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline)
5268 - struct ata_port *ap = link->ap;
5269 - struct ata_eh_context *ehc = &link->eh_context;
5270 - const unsigned long *timing = sata_ehc_deb_timing(ehc);
5271 -+ u32 sstatus;
5272 - int rc;
5273 -
5274 - /* handle link resume */
5275 -@@ -3960,6 +3961,17 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline)
5276 - if (ap->flags & ATA_FLAG_PMP)
5277 - ehc->i.action |= ATA_EH_HARDRESET;
5278 -
5279 -+ /* if link powersave is on, force hardreset */
5280 -+ if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0) {
5281 -+ u8 ipm = sstatus >> 8;
5282 -+
5283 -+ if (ipm == 2 || ipm == 6) {
5284 -+ ata_link_printk(link, KERN_INFO, "link in powersave "
5285 -+ "mode (ipm=%d), forcing hardreset\n", ipm);
5286 -+ ehc->i.action |= ATA_EH_HARDRESET;
5287 -+ }
5288 -+ }
5289 -+
5290 - /* if we're about to do hardreset, nothing more to do */
5291 - if (ehc->i.action & ATA_EH_HARDRESET)
5292 - return 0;
5293 -diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
5294 -index 35a26a3..99aa5f5 100644
5295 ---- a/drivers/cpufreq/cpufreq.c
5296 -+++ b/drivers/cpufreq/cpufreq.c
5297 -@@ -607,7 +607,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
5298 - unsigned int freq = 0;
5299 - unsigned int ret;
5300 -
5301 -- if (!policy->governor->store_setspeed)
5302 -+ if (!policy->governor || !policy->governor->store_setspeed)
5303 - return -EINVAL;
5304 -
5305 - ret = sscanf(buf, "%u", &freq);
5306 -@@ -621,7 +621,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
5307 -
5308 - static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf)
5309 - {
5310 -- if (!policy->governor->show_setspeed)
5311 -+ if (!policy->governor || !policy->governor->show_setspeed)
5312 - return sprintf(buf, "<unsupported>\n");
5313 -
5314 - return policy->governor->show_setspeed(policy, buf);
5315 -diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
5316 -index c3eb3f1..452b94d 100644
5317 ---- a/drivers/hid/hid-input.c
5318 -+++ b/drivers/hid/hid-input.c
5319 -@@ -218,8 +218,9 @@ int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
5320 - }
5321 - }
5322 -
5323 -- if (test_bit(usage->code, hid->pb_pressed_numlock) ||
5324 -- test_bit(LED_NUML, input->led)) {
5325 -+ if (hid->quirks & HID_QUIRK_APPLE_NUMLOCK_EMULATION && (
5326 -+ test_bit(usage->code, hid->pb_pressed_numlock) ||
5327 -+ test_bit(LED_NUML, input->led))) {
5328 - trans = find_translation(powerbook_numlock_keys, usage->code);
5329 -
5330 - if (trans) {
5331 -diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
5332 -index e29a057..7fbe08c 100644
5333 ---- a/drivers/hid/usbhid/hid-quirks.c
5334 -+++ b/drivers/hid/usbhid/hid-quirks.c
5335 -@@ -613,28 +613,28 @@ static const struct hid_blacklist {
5336 -
5337 - { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
5338 -
5339 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5340 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5341 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5342 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
5343 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5344 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5345 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
5346 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5347 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5348 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
5349 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5350 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5351 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5352 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5353 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
5354 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5355 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5356 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
5357 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5358 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5359 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
5360 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5361 - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI, HID_QUIRK_APPLE_HAS_FN },
5362 - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
5363 - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, HID_QUIRK_APPLE_HAS_FN },
5364 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5365 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5366 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5367 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_HAS_FN },
5368 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
5369 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_HAS_FN },
5370 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5371 -- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5372 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5373 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5374 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5375 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
5376 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
5377 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
5378 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5379 -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
5380 -
5381 - { USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658, HID_QUIRK_RESET_LEDS },
5382 - { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KBD, HID_QUIRK_RESET_LEDS },
5383 -diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
5384 -index 3dac920..43c9f8d 100644
5385 ---- a/drivers/i2c/busses/i2c-nforce2.c
5386 -+++ b/drivers/i2c/busses/i2c-nforce2.c
5387 -@@ -50,6 +50,7 @@
5388 - #include <linux/init.h>
5389 - #include <linux/i2c.h>
5390 - #include <linux/delay.h>
5391 -+#include <linux/dmi.h>
5392 - #include <asm/io.h>
5393 -
5394 - MODULE_LICENSE("GPL");
5395 -@@ -109,6 +110,18 @@ struct nforce2_smbus {
5396 - /* Misc definitions */
5397 - #define MAX_TIMEOUT 100
5398 -
5399 -+/* We disable the second SMBus channel on these boards */
5400 -+static struct dmi_system_id __devinitdata nforce2_dmi_blacklist2[] = {
5401 -+ {
5402 -+ .ident = "DFI Lanparty NF4 Expert",
5403 -+ .matches = {
5404 -+ DMI_MATCH(DMI_BOARD_VENDOR, "DFI Corp,LTD"),
5405 -+ DMI_MATCH(DMI_BOARD_NAME, "LP UT NF4 Expert"),
5406 -+ },
5407 -+ },
5408 -+ { }
5409 -+};
5410 -+
5411 - static struct pci_driver nforce2_driver;
5412 -
5413 - static void nforce2_abort(struct i2c_adapter *adap)
5414 -@@ -367,10 +380,17 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_
5415 - smbuses[0].base = 0; /* to have a check value */
5416 - }
5417 - /* SMBus adapter 2 */
5418 -- res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1], "SMB2");
5419 -- if (res2 < 0) {
5420 -- dev_err(&dev->dev, "Error probing SMB2.\n");
5421 -- smbuses[1].base = 0; /* to have a check value */
5422 -+ if (dmi_check_system(nforce2_dmi_blacklist2)) {
5423 -+ dev_err(&dev->dev, "Disabling SMB2 for safety reasons.\n");
5424 -+ res2 = -EPERM;
5425 -+ smbuses[1].base = 0;
5426 -+ } else {
5427 -+ res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1],
5428 -+ "SMB2");
5429 -+ if (res2 < 0) {
5430 -+ dev_err(&dev->dev, "Error probing SMB2.\n");
5431 -+ smbuses[1].base = 0; /* to have a check value */
5432 -+ }
5433 - }
5434 - if ((res1 < 0) && (res2 < 0)) {
5435 - /* we did not find even one of the SMBuses, so we give up */
5436 -diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c
5437 -index fb7ea56..cf507b3 100644
5438 ---- a/drivers/i2c/chips/max6875.c
5439 -+++ b/drivers/i2c/chips/max6875.c
5440 -@@ -207,9 +207,6 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind)
5441 - fake_client->flags = 0;
5442 - strlcpy(fake_client->name, "max6875 subclient", I2C_NAME_SIZE);
5443 -
5444 -- /* Prevent 24RF08 corruption (in case of user error) */
5445 -- i2c_smbus_write_quick(real_client, 0);
5446 --
5447 - if ((err = i2c_attach_client(real_client)) != 0)
5448 - goto exit_kfree2;
5449 -
5450 -diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
5451 -index 31a53c5..ae7e6e7 100644
5452 ---- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
5453 -+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
5454 -@@ -194,7 +194,13 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
5455 - /* Set the cached Q_Key before we attach if it's the broadcast group */
5456 - if (!memcmp(mcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
5457 - sizeof (union ib_gid))) {
5458 -+ spin_lock_irq(&priv->lock);
5459 -+ if (!priv->broadcast) {
5460 -+ spin_unlock_irq(&priv->lock);
5461 -+ return -EAGAIN;
5462 -+ }
5463 - priv->qkey = be32_to_cpu(priv->broadcast->mcmember.qkey);
5464 -+ spin_unlock_irq(&priv->lock);
5465 - priv->tx_wr.wr.ud.remote_qkey = priv->qkey;
5466 - }
5467 -
5468 -diff --git a/drivers/md/md.c b/drivers/md/md.c
5469 -index 9f6d228..ba34990 100644
5470 ---- a/drivers/md/md.c
5471 -+++ b/drivers/md/md.c
5472 -@@ -274,6 +274,7 @@ static mddev_t * mddev_find(dev_t unit)
5473 - atomic_set(&new->active, 1);
5474 - spin_lock_init(&new->write_lock);
5475 - init_waitqueue_head(&new->sb_wait);
5476 -+ init_waitqueue_head(&new->recovery_wait);
5477 - new->reshape_position = MaxSector;
5478 - new->resync_max = MaxSector;
5479 -
5480 -@@ -5559,7 +5560,6 @@ void md_do_sync(mddev_t *mddev)
5481 - window/2,(unsigned long long) max_sectors/2);
5482 -
5483 - atomic_set(&mddev->recovery_active, 0);
5484 -- init_waitqueue_head(&mddev->recovery_wait);
5485 - last_check = 0;
5486 -
5487 - if (j>2) {
5488 -diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
5489 -index 18a1379..705fe47 100644
5490 ---- a/drivers/md/raid5.c
5491 -+++ b/drivers/md/raid5.c
5492 -@@ -1984,6 +1984,7 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh,
5493 - * have quiesced.
5494 - */
5495 - if ((s->uptodate == disks - 1) &&
5496 -+ (s->failed && disk_idx == s->failed_num) &&
5497 - !test_bit(STRIPE_OP_CHECK, &sh->ops.pending)) {
5498 - set_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending);
5499 - set_bit(R5_Wantcompute, &dev->flags);
5500 -@@ -2069,7 +2070,9 @@ static void handle_issuing_new_read_requests6(struct stripe_head *sh,
5501 - /* we would like to get this block, possibly
5502 - * by computing it, but we might not be able to
5503 - */
5504 -- if (s->uptodate == disks-1) {
5505 -+ if ((s->uptodate == disks - 1) &&
5506 -+ (s->failed && (i == r6s->failed_num[0] ||
5507 -+ i == r6s->failed_num[1]))) {
5508 - pr_debug("Computing stripe %llu block %d\n",
5509 - (unsigned long long)sh->sector, i);
5510 - compute_block_1(sh, i, 0);
5511 -@@ -2618,6 +2621,7 @@ static void handle_stripe5(struct stripe_head *sh)
5512 - struct stripe_head_state s;
5513 - struct r5dev *dev;
5514 - unsigned long pending = 0;
5515 -+ int prexor;
5516 -
5517 - memset(&s, 0, sizeof(s));
5518 - pr_debug("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d "
5519 -@@ -2737,9 +2741,11 @@ static void handle_stripe5(struct stripe_head *sh)
5520 - /* leave prexor set until postxor is done, allows us to distinguish
5521 - * a rmw from a rcw during biodrain
5522 - */
5523 -+ prexor = 0;
5524 - if (test_bit(STRIPE_OP_PREXOR, &sh->ops.complete) &&
5525 - test_bit(STRIPE_OP_POSTXOR, &sh->ops.complete)) {
5526 -
5527 -+ prexor = 1;
5528 - clear_bit(STRIPE_OP_PREXOR, &sh->ops.complete);
5529 - clear_bit(STRIPE_OP_PREXOR, &sh->ops.ack);
5530 - clear_bit(STRIPE_OP_PREXOR, &sh->ops.pending);
5531 -@@ -2773,6 +2779,8 @@ static void handle_stripe5(struct stripe_head *sh)
5532 - if (!test_and_set_bit(
5533 - STRIPE_OP_IO, &sh->ops.pending))
5534 - sh->ops.count++;
5535 -+ if (prexor)
5536 -+ continue;
5537 - if (!test_bit(R5_Insync, &dev->flags) ||
5538 - (i == sh->pd_idx && s.failed == 0))
5539 - set_bit(STRIPE_INSYNC, &sh->state);
5540 -diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
5541 -index 129b8b3..68be4e1 100644
5542 ---- a/drivers/net/atl1/atl1_main.c
5543 -+++ b/drivers/net/atl1/atl1_main.c
5544 -@@ -1334,6 +1334,7 @@ rrd_ok:
5545 - /* Good Receive */
5546 - pci_unmap_page(adapter->pdev, buffer_info->dma,
5547 - buffer_info->length, PCI_DMA_FROMDEVICE);
5548 -+ buffer_info->dma = 0;
5549 - skb = buffer_info->skb;
5550 - length = le16_to_cpu(rrd->xsz.xsum_sz.pkt_size);
5551 -
5552 -diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
5553 -index c16de51..42daf85 100644
5554 ---- a/drivers/net/ps3_gelic_wireless.c
5555 -+++ b/drivers/net/ps3_gelic_wireless.c
5556 -@@ -2474,6 +2474,8 @@ static void gelic_wl_free(struct gelic_wl_info *wl)
5557 -
5558 - pr_debug("%s: <-\n", __func__);
5559 -
5560 -+ free_page((unsigned long)wl->buf);
5561 -+
5562 - pr_debug("%s: destroy queues\n", __func__);
5563 - destroy_workqueue(wl->eurus_cmd_queue);
5564 - destroy_workqueue(wl->event_queue);
5565 -diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
5566 -index 0147ea3..d8160fa 100644
5567 ---- a/drivers/usb/class/cdc-acm.c
5568 -+++ b/drivers/usb/class/cdc-acm.c
5569 -@@ -1242,6 +1242,9 @@ static struct usb_device_id acm_ids[] = {
5570 - { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */
5571 - .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
5572 - },
5573 -+ { USB_DEVICE(0x0803, 0x3095), /* Zoom Telephonics Model 3095F USB MODEM */
5574 -+ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
5575 -+ },
5576 -
5577 - /* control interfaces with various AT-command sets */
5578 - { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
5579 -diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
5580 -index 611bc9f..d05375d 100644
5581 ---- a/drivers/usb/host/ohci-omap.c
5582 -+++ b/drivers/usb/host/ohci-omap.c
5583 -@@ -511,7 +511,8 @@ static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message)
5584 -
5585 - static int ohci_omap_resume(struct platform_device *dev)
5586 - {
5587 -- struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev));
5588 -+ struct usb_hcd *hcd = platform_get_drvdata(dev);
5589 -+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
5590 -
5591 - if (time_before(jiffies, ohci->next_statechange))
5592 - msleep(5);
5593 -diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
5594 -index c852f03..dd1a067 100644
5595 ---- a/drivers/usb/host/ohci-sm501.c
5596 -+++ b/drivers/usb/host/ohci-sm501.c
5597 -@@ -231,7 +231,8 @@ static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg)
5598 - static int ohci_sm501_resume(struct platform_device *pdev)
5599 - {
5600 - struct device *dev = &pdev->dev;
5601 -- struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(pdev));
5602 -+ struct usb_hcd *hcd = platform_get_drvdata(pdev);
5603 -+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
5604 -
5605 - if (time_before(jiffies, ohci->next_statechange))
5606 - msleep(5);
5607 -diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
5608 -index c730d20..7eb5f30 100644
5609 ---- a/drivers/usb/misc/ldusb.c
5610 -+++ b/drivers/usb/misc/ldusb.c
5611 -@@ -63,9 +63,6 @@
5612 - #define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004
5613 - #define USB_DEVICE_ID_VERNIER_LCSPEC 0x0006
5614 -
5615 --#define USB_VENDOR_ID_MICROCHIP 0x04d8
5616 --#define USB_DEVICE_ID_PICDEM 0x000c
5617 --
5618 - #ifdef CONFIG_USB_DYNAMIC_MINORS
5619 - #define USB_LD_MINOR_BASE 0
5620 - #else
5621 -@@ -92,7 +89,6 @@ static struct usb_device_id ld_usb_table [] = {
5622 - { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
5623 - { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
5624 - { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS) },
5625 -- { USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICDEM) },
5626 - { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LCSPEC) },
5627 - { } /* Terminating entry */
5628 - };
5629 -diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
5630 -index 3abb3c8..af2bd47 100644
5631 ---- a/drivers/usb/serial/ftdi_sio.c
5632 -+++ b/drivers/usb/serial/ftdi_sio.c
5633 -@@ -366,6 +366,7 @@ static struct usb_device_id id_table_combined [] = {
5634 - .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
5635 - { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID),
5636 - .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
5637 -+ { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
5638 - { }, /* Optional parameter entry */
5639 - { } /* Terminating entry */
5640 - };
5641 -diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
5642 -index 6da539e..0e1c569 100644
5643 ---- a/drivers/usb/serial/ftdi_sio.h
5644 -+++ b/drivers/usb/serial/ftdi_sio.h
5645 -@@ -581,6 +581,12 @@
5646 - #define FIC_NEO1973_DEBUG_PID 0x5118
5647 -
5648 - /*
5649 -+ * RATOC REX-USB60F
5650 -+ */
5651 -+#define RATOC_VENDOR_ID 0x0584
5652 -+#define RATOC_PRODUCT_ID_USB60F 0xb020
5653 -+
5654 -+/*
5655 - * BmRequestType: 1100 0000b
5656 - * bRequest: FTDI_E2_READ
5657 - * wValue: 0
5658 -diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
5659 -index d101025..4d7f357 100644
5660 ---- a/drivers/usb/serial/option.c
5661 -+++ b/drivers/usb/serial/option.c
5662 -@@ -154,8 +154,6 @@ static int option_send_setup(struct usb_serial_port *port);
5663 - #define NOVATELWIRELESS_PRODUCT_MC727 0x4100
5664 - #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400
5665 -
5666 --#define NOVATELWIRELESS_PRODUCT_U727 0x5010
5667 --
5668 - /* FUTURE NOVATEL PRODUCTS */
5669 - #define NOVATELWIRELESS_PRODUCT_EVDO_1 0x6000
5670 - #define NOVATELWIRELESS_PRODUCT_HSPA_1 0x7000
5671 -@@ -195,6 +193,9 @@ static int option_send_setup(struct usb_serial_port *port);
5672 -
5673 - #define MAXON_VENDOR_ID 0x16d8
5674 -
5675 -+#define TELIT_VENDOR_ID 0x1bc7
5676 -+#define TELIT_PRODUCT_UC864E 0x1003
5677 -+
5678 - static struct usb_device_id option_ids[] = {
5679 - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
5680 - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
5681 -@@ -269,7 +270,6 @@ static struct usb_device_id option_ids[] = {
5682 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */
5683 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */
5684 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */
5685 -- { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel U727 */
5686 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_1) }, /* Novatel EVDO product */
5687 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_1) }, /* Novatel HSPA product */
5688 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_1) }, /* Novatel Embedded product */
5689 -@@ -293,6 +293,7 @@ static struct usb_device_id option_ids[] = {
5690 - { USB_DEVICE(DELL_VENDOR_ID, 0x8133) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
5691 - { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
5692 - { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
5693 -+ { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */
5694 - { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
5695 - { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
5696 - { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
5697 -@@ -301,6 +302,8 @@ static struct usb_device_id option_ids[] = {
5698 - { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
5699 - { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
5700 - { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
5701 -+ { USB_DEVICE(0x19d2, 0x0001) }, /* Telstra NextG CDMA */
5702 -+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
5703 - { } /* Terminating entry */
5704 - };
5705 - MODULE_DEVICE_TABLE(usb, option_ids);
5706 -diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
5707 -index 2af7785..4c1a70a 100644
5708 ---- a/drivers/usb/serial/pl2303.c
5709 -+++ b/drivers/usb/serial/pl2303.c
5710 -@@ -66,7 +66,6 @@ static struct usb_device_id id_table [] = {
5711 - { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID_2080) },
5712 - { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) },
5713 - { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
5714 -- { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
5715 - { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
5716 - { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
5717 - { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
5718 -diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
5719 -index 10cf872..3bdefe0 100644
5720 ---- a/drivers/usb/serial/pl2303.h
5721 -+++ b/drivers/usb/serial/pl2303.h
5722 -@@ -36,7 +36,6 @@
5723 -
5724 - #define RATOC_VENDOR_ID 0x0584
5725 - #define RATOC_PRODUCT_ID 0xb000
5726 --#define RATOC_PRODUCT_ID_USB60F 0xb020
5727 -
5728 - #define TRIPP_VENDOR_ID 0x2478
5729 - #define TRIPP_PRODUCT_ID 0x2008
5730 -diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
5731 -index 9125207..f1d14c9 100644
5732 ---- a/drivers/usb/storage/unusual_devs.h
5733 -+++ b/drivers/usb/storage/unusual_devs.h
5734 -@@ -1285,6 +1285,16 @@ UNUSUAL_DEV( 0x0ace, 0x20ff, 0x0101, 0x0101,
5735 - US_SC_DEVICE, US_PR_DEVICE, NULL,
5736 - US_FL_IGNORE_DEVICE ),
5737 -
5738 -+/* Reported by F. Aben <f.aben@××××××.com>
5739 -+ * This device (wrongly) has a vendor-specific device descriptor.
5740 -+ * The entry is needed so usb-storage can bind to it's mass-storage
5741 -+ * interface as an interface driver */
5742 -+UNUSUAL_DEV( 0x0af0, 0x7401, 0x0000, 0x0000,
5743 -+ "Option",
5744 -+ "GI 0401 SD-Card",
5745 -+ US_SC_DEVICE, US_PR_DEVICE, NULL,
5746 -+ 0 ),
5747 -+
5748 - #ifdef CONFIG_USB_STORAGE_ISD200
5749 - UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,
5750 - "ATI",
5751 -diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
5752 -index bc673c8..e1031b9 100644
5753 ---- a/fs/cifs/inode.c
5754 -+++ b/fs/cifs/inode.c
5755 -@@ -161,12 +161,14 @@ static void cifs_unix_info_to_inode(struct inode *inode,
5756 - spin_unlock(&inode->i_lock);
5757 - }
5758 -
5759 --static const unsigned char *cifs_get_search_path(struct cifsTconInfo *pTcon,
5760 -- const char *search_path)
5761 -+static const unsigned char *cifs_get_search_path(struct cifs_sb_info *cifs_sb,
5762 -+ const char *search_path)
5763 - {
5764 - int tree_len;
5765 - int path_len;
5766 -+ int i;
5767 - char *tmp_path;
5768 -+ struct cifsTconInfo *pTcon = cifs_sb->tcon;
5769 -
5770 - if (!(pTcon->Flags & SMB_SHARE_IS_IN_DFS))
5771 - return search_path;
5772 -@@ -180,6 +182,11 @@ static const unsigned char *cifs_get_search_path(struct cifsTconInfo *pTcon,
5773 - return search_path;
5774 -
5775 - strncpy(tmp_path, pTcon->treeName, tree_len);
5776 -+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
5777 -+ for (i = 0; i < tree_len; i++) {
5778 -+ if (tmp_path[i] == '\\')
5779 -+ tmp_path[i] = '/';
5780 -+ }
5781 - strncpy(tmp_path+tree_len, search_path, path_len);
5782 - tmp_path[tree_len+path_len] = 0;
5783 - return tmp_path;
5784 -@@ -199,7 +206,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
5785 - pTcon = cifs_sb->tcon;
5786 - cFYI(1, ("Getting info on %s", search_path));
5787 -
5788 -- full_path = cifs_get_search_path(pTcon, search_path);
5789 -+ full_path = cifs_get_search_path(cifs_sb, search_path);
5790 -
5791 - try_again_CIFSSMBUnixQPathInfo:
5792 - /* could have done a find first instead but this returns more info */
5793 -@@ -402,7 +409,7 @@ int cifs_get_inode_info(struct inode **pinode,
5794 - return -ENOMEM;
5795 - pfindData = (FILE_ALL_INFO *)buf;
5796 -
5797 -- full_path = cifs_get_search_path(pTcon, search_path);
5798 -+ full_path = cifs_get_search_path(cifs_sb, search_path);
5799 -
5800 - try_again_CIFSSMBQPathInfo:
5801 - /* could do find first instead but this returns more info */
5802 -diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
5803 -index 5007f78..7c607af 100644
5804 ---- a/fs/ecryptfs/ecryptfs_kernel.h
5805 -+++ b/fs/ecryptfs/ecryptfs_kernel.h
5806 -@@ -626,8 +626,6 @@ int ecryptfs_get_tfm_and_mutex_for_cipher_name(struct crypto_blkcipher **tfm,
5807 - int ecryptfs_keyring_auth_tok_for_sig(struct key **auth_tok_key,
5808 - struct ecryptfs_auth_tok **auth_tok,
5809 - char *sig);
5810 --int ecryptfs_write_zeros(struct file *file, pgoff_t index, int start,
5811 -- int num_zeros);
5812 - int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data,
5813 - loff_t offset, size_t size);
5814 - int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode,
5815 -diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
5816 -index 0c49286..7cafdbc 100644
5817 ---- a/fs/ecryptfs/read_write.c
5818 -+++ b/fs/ecryptfs/read_write.c
5819 -@@ -157,20 +157,6 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
5820 - ecryptfs_page_idx, rc);
5821 - goto out;
5822 - }
5823 -- if (start_offset_in_page) {
5824 -- /* Read in the page from the lower
5825 -- * into the eCryptfs inode page cache,
5826 -- * decrypting */
5827 -- rc = ecryptfs_decrypt_page(ecryptfs_page);
5828 -- if (rc) {
5829 -- printk(KERN_ERR "%s: Error decrypting "
5830 -- "page; rc = [%d]\n",
5831 -- __FUNCTION__, rc);
5832 -- ClearPageUptodate(ecryptfs_page);
5833 -- page_cache_release(ecryptfs_page);
5834 -- goto out;
5835 -- }
5836 -- }
5837 - ecryptfs_page_virt = kmap_atomic(ecryptfs_page, KM_USER0);
5838 -
5839 - /*
5840 -@@ -349,14 +335,6 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
5841 - ecryptfs_page_idx, rc);
5842 - goto out;
5843 - }
5844 -- rc = ecryptfs_decrypt_page(ecryptfs_page);
5845 -- if (rc) {
5846 -- printk(KERN_ERR "%s: Error decrypting "
5847 -- "page; rc = [%d]\n", __FUNCTION__, rc);
5848 -- ClearPageUptodate(ecryptfs_page);
5849 -- page_cache_release(ecryptfs_page);
5850 -- goto out;
5851 -- }
5852 - ecryptfs_page_virt = kmap_atomic(ecryptfs_page, KM_USER0);
5853 - memcpy((data + data_offset),
5854 - ((char *)ecryptfs_page_virt + start_offset_in_page),
5855 -diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
5856 -index 4285654..84119af 100644
5857 ---- a/fs/ext3/xattr.c
5858 -+++ b/fs/ext3/xattr.c
5859 -@@ -1000,6 +1000,11 @@ ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
5860 - i.value = NULL;
5861 - error = ext3_xattr_block_set(handle, inode, &i, &bs);
5862 - } else if (error == -ENOSPC) {
5863 -+ if (EXT3_I(inode)->i_file_acl && !bs.s.base) {
5864 -+ error = ext3_xattr_block_find(inode, &i, &bs);
5865 -+ if (error)
5866 -+ goto cleanup;
5867 -+ }
5868 - error = ext3_xattr_block_set(handle, inode, &i, &bs);
5869 - if (error)
5870 - goto cleanup;
5871 -diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
5872 -index e9054c1..70d856b 100644
5873 ---- a/fs/ext4/xattr.c
5874 -+++ b/fs/ext4/xattr.c
5875 -@@ -1011,6 +1011,11 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
5876 - i.value = NULL;
5877 - error = ext4_xattr_block_set(handle, inode, &i, &bs);
5878 - } else if (error == -ENOSPC) {
5879 -+ if (EXT4_I(inode)->i_file_acl && !bs.s.base) {
5880 -+ error = ext4_xattr_block_find(inode, &i, &bs);
5881 -+ if (error)
5882 -+ goto cleanup;
5883 -+ }
5884 - error = ext4_xattr_block_set(handle, inode, &i, &bs);
5885 - if (error)
5886 - goto cleanup;
5887 -diff --git a/fs/proc/array.c b/fs/proc/array.c
5888 -index 07d6c48..6b1c67a 100644
5889 ---- a/fs/proc/array.c
5890 -+++ b/fs/proc/array.c
5891 -@@ -287,7 +287,7 @@ static void render_cap_t(struct seq_file *m, const char *header,
5892 - seq_printf(m, "%s", header);
5893 - CAP_FOR_EACH_U32(__capi) {
5894 - seq_printf(m, "%08x",
5895 -- a->cap[(_LINUX_CAPABILITY_U32S-1) - __capi]);
5896 -+ a->cap[(_KERNEL_CAPABILITY_U32S-1) - __capi]);
5897 - }
5898 - seq_printf(m, "\n");
5899 - }
5900 -diff --git a/fs/proc/base.c b/fs/proc/base.c
5901 -index 81d7d14..d6f21bd 100644
5902 ---- a/fs/proc/base.c
5903 -+++ b/fs/proc/base.c
5904 -@@ -126,6 +126,25 @@ struct pid_entry {
5905 - NULL, &proc_single_file_operations, \
5906 - { .proc_show = &proc_##OTYPE } )
5907 -
5908 -+/*
5909 -+ * Count the number of hardlinks for the pid_entry table, excluding the .
5910 -+ * and .. links.
5911 -+ */
5912 -+static unsigned int pid_entry_count_dirs(const struct pid_entry *entries,
5913 -+ unsigned int n)
5914 -+{
5915 -+ unsigned int i;
5916 -+ unsigned int count;
5917 -+
5918 -+ count = 0;
5919 -+ for (i = 0; i < n; ++i) {
5920 -+ if (S_ISDIR(entries[i].mode))
5921 -+ ++count;
5922 -+ }
5923 -+
5924 -+ return count;
5925 -+}
5926 -+
5927 - int maps_protect;
5928 - EXPORT_SYMBOL(maps_protect);
5929 -
5930 -@@ -2483,10 +2502,9 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
5931 - inode->i_op = &proc_tgid_base_inode_operations;
5932 - inode->i_fop = &proc_tgid_base_operations;
5933 - inode->i_flags|=S_IMMUTABLE;
5934 -- inode->i_nlink = 5;
5935 --#ifdef CONFIG_SECURITY
5936 -- inode->i_nlink += 1;
5937 --#endif
5938 -+
5939 -+ inode->i_nlink = 2 + pid_entry_count_dirs(tgid_base_stuff,
5940 -+ ARRAY_SIZE(tgid_base_stuff));
5941 -
5942 - dentry->d_op = &pid_dentry_operations;
5943 -
5944 -@@ -2713,10 +2731,9 @@ static struct dentry *proc_task_instantiate(struct inode *dir,
5945 - inode->i_op = &proc_tid_base_inode_operations;
5946 - inode->i_fop = &proc_tid_base_operations;
5947 - inode->i_flags|=S_IMMUTABLE;
5948 -- inode->i_nlink = 4;
5949 --#ifdef CONFIG_SECURITY
5950 -- inode->i_nlink += 1;
5951 --#endif
5952 -+
5953 -+ inode->i_nlink = 2 + pid_entry_count_dirs(tid_base_stuff,
5954 -+ ARRAY_SIZE(tid_base_stuff));
5955 -
5956 - dentry->d_op = &pid_dentry_operations;
5957 -
5958 -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
5959 -index 9dfb5ff..dca9b46 100644
5960 ---- a/fs/proc/task_mmu.c
5961 -+++ b/fs/proc/task_mmu.c
5962 -@@ -524,7 +524,7 @@ const struct file_operations proc_clear_refs_operations = {
5963 - };
5964 -
5965 - struct pagemapread {
5966 -- char __user *out, *end;
5967 -+ u64 __user *out, *end;
5968 - };
5969 -
5970 - #define PM_ENTRY_BYTES sizeof(u64)
5971 -@@ -547,21 +547,11 @@ struct pagemapread {
5972 - static int add_to_pagemap(unsigned long addr, u64 pfn,
5973 - struct pagemapread *pm)
5974 - {
5975 -- /*
5976 -- * Make sure there's room in the buffer for an
5977 -- * entire entry. Otherwise, only copy part of
5978 -- * the pfn.
5979 -- */
5980 -- if (pm->out + PM_ENTRY_BYTES >= pm->end) {
5981 -- if (copy_to_user(pm->out, &pfn, pm->end - pm->out))
5982 -- return -EFAULT;
5983 -- pm->out = pm->end;
5984 -- return PM_END_OF_BUFFER;
5985 -- }
5986 --
5987 - if (put_user(pfn, pm->out))
5988 - return -EFAULT;
5989 -- pm->out += PM_ENTRY_BYTES;
5990 -+ pm->out++;
5991 -+ if (pm->out >= pm->end)
5992 -+ return PM_END_OF_BUFFER;
5993 - return 0;
5994 - }
5995 -
5996 -@@ -662,7 +652,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
5997 -
5998 - ret = -EINVAL;
5999 - /* file position must be aligned */
6000 -- if (*ppos % PM_ENTRY_BYTES)
6001 -+ if ((*ppos % PM_ENTRY_BYTES) || (count % PM_ENTRY_BYTES))
6002 - goto out_task;
6003 -
6004 - ret = 0;
6005 -@@ -692,8 +682,8 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
6006 - goto out_pages;
6007 - }
6008 -
6009 -- pm.out = buf;
6010 -- pm.end = buf + count;
6011 -+ pm.out = (u64 *)buf;
6012 -+ pm.end = (u64 *)(buf + count);
6013 -
6014 - if (!ptrace_may_attach(task)) {
6015 - ret = -EIO;
6016 -@@ -718,9 +708,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
6017 - if (ret == PM_END_OF_BUFFER)
6018 - ret = 0;
6019 - /* don't need mmap_sem for these, but this looks cleaner */
6020 -- *ppos += pm.out - buf;
6021 -+ *ppos += (char *)pm.out - buf;
6022 - if (!ret)
6023 -- ret = pm.out - buf;
6024 -+ ret = (char *)pm.out - buf;
6025 - }
6026 -
6027 - out_pages:
6028 -diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
6029 -index e347bfd..9831c90 100644
6030 ---- a/fs/xfs/linux-2.6/xfs_buf.c
6031 -+++ b/fs/xfs/linux-2.6/xfs_buf.c
6032 -@@ -387,6 +387,8 @@ _xfs_buf_lookup_pages(
6033 - if (unlikely(page == NULL)) {
6034 - if (flags & XBF_READ_AHEAD) {
6035 - bp->b_page_count = i;
6036 -+ for (i = 0; i < bp->b_page_count; i++)
6037 -+ unlock_page(bp->b_pages[i]);
6038 - return -ENOMEM;
6039 - }
6040 -
6041 -@@ -416,17 +418,24 @@ _xfs_buf_lookup_pages(
6042 - ASSERT(!PagePrivate(page));
6043 - if (!PageUptodate(page)) {
6044 - page_count--;
6045 -- if (blocksize < PAGE_CACHE_SIZE && !PagePrivate(page)) {
6046 -+ if (blocksize >= PAGE_CACHE_SIZE) {
6047 -+ if (flags & XBF_READ)
6048 -+ bp->b_flags |= _XBF_PAGE_LOCKED;
6049 -+ } else if (!PagePrivate(page)) {
6050 - if (test_page_region(page, offset, nbytes))
6051 - page_count++;
6052 - }
6053 - }
6054 -
6055 -- unlock_page(page);
6056 - bp->b_pages[i] = page;
6057 - offset = 0;
6058 - }
6059 -
6060 -+ if (!(bp->b_flags & _XBF_PAGE_LOCKED)) {
6061 -+ for (i = 0; i < bp->b_page_count; i++)
6062 -+ unlock_page(bp->b_pages[i]);
6063 -+ }
6064 -+
6065 - if (page_count == bp->b_page_count)
6066 - bp->b_flags |= XBF_DONE;
6067 -
6068 -@@ -746,6 +755,7 @@ xfs_buf_associate_memory(
6069 - bp->b_count_desired = len;
6070 - bp->b_buffer_length = buflen;
6071 - bp->b_flags |= XBF_MAPPED;
6072 -+ bp->b_flags &= ~_XBF_PAGE_LOCKED;
6073 -
6074 - return 0;
6075 - }
6076 -@@ -1093,8 +1103,10 @@ _xfs_buf_ioend(
6077 - xfs_buf_t *bp,
6078 - int schedule)
6079 - {
6080 -- if (atomic_dec_and_test(&bp->b_io_remaining) == 1)
6081 -+ if (atomic_dec_and_test(&bp->b_io_remaining) == 1) {
6082 -+ bp->b_flags &= ~_XBF_PAGE_LOCKED;
6083 - xfs_buf_ioend(bp, schedule);
6084 -+ }
6085 - }
6086 -
6087 - STATIC void
6088 -@@ -1125,6 +1137,9 @@ xfs_buf_bio_end_io(
6089 -
6090 - if (--bvec >= bio->bi_io_vec)
6091 - prefetchw(&bvec->bv_page->flags);
6092 -+
6093 -+ if (bp->b_flags & _XBF_PAGE_LOCKED)
6094 -+ unlock_page(page);
6095 - } while (bvec >= bio->bi_io_vec);
6096 -
6097 - _xfs_buf_ioend(bp, 1);
6098 -@@ -1163,7 +1178,8 @@ _xfs_buf_ioapply(
6099 - * filesystem block size is not smaller than the page size.
6100 - */
6101 - if ((bp->b_buffer_length < PAGE_CACHE_SIZE) &&
6102 -- (bp->b_flags & XBF_READ) &&
6103 -+ ((bp->b_flags & (XBF_READ|_XBF_PAGE_LOCKED)) ==
6104 -+ (XBF_READ|_XBF_PAGE_LOCKED)) &&
6105 - (blocksize >= PAGE_CACHE_SIZE)) {
6106 - bio = bio_alloc(GFP_NOIO, 1);
6107 -
6108 -diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
6109 -index a3d207d..441f7c3 100644
6110 ---- a/fs/xfs/linux-2.6/xfs_buf.h
6111 -+++ b/fs/xfs/linux-2.6/xfs_buf.h
6112 -@@ -66,6 +66,25 @@ typedef enum {
6113 - _XBF_PAGES = (1 << 18), /* backed by refcounted pages */
6114 - _XBF_RUN_QUEUES = (1 << 19),/* run block device task queue */
6115 - _XBF_DELWRI_Q = (1 << 21), /* buffer on delwri queue */
6116 -+
6117 -+ /*
6118 -+ * Special flag for supporting metadata blocks smaller than a FSB.
6119 -+ *
6120 -+ * In this case we can have multiple xfs_buf_t on a single page and
6121 -+ * need to lock out concurrent xfs_buf_t readers as they only
6122 -+ * serialise access to the buffer.
6123 -+ *
6124 -+ * If the FSB size >= PAGE_CACHE_SIZE case, we have no serialisation
6125 -+ * between reads of the page. Hence we can have one thread read the
6126 -+ * page and modify it, but then race with another thread that thinks
6127 -+ * the page is not up-to-date and hence reads it again.
6128 -+ *
6129 -+ * The result is that the first modifcation to the page is lost.
6130 -+ * This sort of AGF/AGI reading race can happen when unlinking inodes
6131 -+ * that require truncation and results in the AGI unlinked list
6132 -+ * modifications being lost.
6133 -+ */
6134 -+ _XBF_PAGE_LOCKED = (1 << 22),
6135 - } xfs_buf_flags_t;
6136 -
6137 - typedef enum {
6138 -diff --git a/include/asm-x86/tlbflush.h b/include/asm-x86/tlbflush.h
6139 -index 3998709..b7a6a08 100644
6140 ---- a/include/asm-x86/tlbflush.h
6141 -+++ b/include/asm-x86/tlbflush.h
6142 -@@ -22,12 +22,23 @@ static inline void __native_flush_tlb(void)
6143 -
6144 - static inline void __native_flush_tlb_global(void)
6145 - {
6146 -- unsigned long cr4 = read_cr4();
6147 -+ unsigned long flags;
6148 -+ unsigned long cr4;
6149 -
6150 -+ /*
6151 -+ * Read-modify-write to CR4 - protect it from preemption and
6152 -+ * from interrupts. (Use the raw variant because this code can
6153 -+ * be called from deep inside debugging code.)
6154 -+ */
6155 -+ raw_local_irq_save(flags);
6156 -+
6157 -+ cr4 = read_cr4();
6158 - /* clear PGE */
6159 - write_cr4(cr4 & ~X86_CR4_PGE);
6160 - /* write old PGE again and flush TLBs */
6161 - write_cr4(cr4);
6162 -+
6163 -+ raw_local_irq_restore(flags);
6164 - }
6165 -
6166 - static inline void __native_flush_tlb_single(unsigned long addr)
6167 -diff --git a/include/linux/capability.h b/include/linux/capability.h
6168 -index 7d50ff6..bb8d915 100644
6169 ---- a/include/linux/capability.h
6170 -+++ b/include/linux/capability.h
6171 -@@ -31,11 +31,11 @@ struct task_struct;
6172 - #define _LINUX_CAPABILITY_VERSION_1 0x19980330
6173 - #define _LINUX_CAPABILITY_U32S_1 1
6174 -
6175 --#define _LINUX_CAPABILITY_VERSION_2 0x20071026
6176 -+#define _LINUX_CAPABILITY_VERSION_2 0x20071026 /* deprecated - use v3 */
6177 - #define _LINUX_CAPABILITY_U32S_2 2
6178 -
6179 --#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_2
6180 --#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_2
6181 -+#define _LINUX_CAPABILITY_VERSION_3 0x20080522
6182 -+#define _LINUX_CAPABILITY_U32S_3 2
6183 -
6184 - typedef struct __user_cap_header_struct {
6185 - __u32 version;
6186 -@@ -77,10 +77,23 @@ struct vfs_cap_data {
6187 - } data[VFS_CAP_U32];
6188 - };
6189 -
6190 --#ifdef __KERNEL__
6191 -+#ifndef __KERNEL__
6192 -+
6193 -+/*
6194 -+ * Backwardly compatible definition for source code - trapped in a
6195 -+ * 32-bit world. If you find you need this, please consider using
6196 -+ * libcap to untrap yourself...
6197 -+ */
6198 -+#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
6199 -+#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
6200 -+
6201 -+#else
6202 -+
6203 -+#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
6204 -+#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3
6205 -
6206 - typedef struct kernel_cap_struct {
6207 -- __u32 cap[_LINUX_CAPABILITY_U32S];
6208 -+ __u32 cap[_KERNEL_CAPABILITY_U32S];
6209 - } kernel_cap_t;
6210 -
6211 - #define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct))
6212 -@@ -350,7 +363,7 @@ typedef struct kernel_cap_struct {
6213 - */
6214 -
6215 - #define CAP_FOR_EACH_U32(__capi) \
6216 -- for (__capi = 0; __capi < _LINUX_CAPABILITY_U32S; ++__capi)
6217 -+ for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi)
6218 -
6219 - # define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \
6220 - | CAP_TO_MASK(CAP_DAC_OVERRIDE) \
6221 -@@ -360,7 +373,7 @@ typedef struct kernel_cap_struct {
6222 -
6223 - # define CAP_FS_MASK_B1 (CAP_TO_MASK(CAP_MAC_OVERRIDE))
6224 -
6225 --#if _LINUX_CAPABILITY_U32S != 2
6226 -+#if _KERNEL_CAPABILITY_U32S != 2
6227 - # error Fix up hand-coded capability macro initializers
6228 - #else /* HAND-CODED capability initializers */
6229 -
6230 -@@ -371,7 +384,7 @@ typedef struct kernel_cap_struct {
6231 - # define CAP_NFSD_SET {{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
6232 - CAP_FS_MASK_B1 } }
6233 -
6234 --#endif /* _LINUX_CAPABILITY_U32S != 2 */
6235 -+#endif /* _KERNEL_CAPABILITY_U32S != 2 */
6236 -
6237 - #define CAP_INIT_INH_SET CAP_EMPTY_SET
6238 -
6239 -diff --git a/include/linux/hid.h b/include/linux/hid.h
6240 -index 74ff575..02e70b7 100644
6241 ---- a/include/linux/hid.h
6242 -+++ b/include/linux/hid.h
6243 -@@ -284,6 +284,7 @@ struct hid_item {
6244 - #define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000
6245 - #define HID_QUIRK_HWHEEL_WHEEL_INVERT 0x04000000
6246 - #define HID_QUIRK_MICROSOFT_KEYS 0x08000000
6247 -+#define HID_QUIRK_APPLE_NUMLOCK_EMULATION 0x10000000
6248 -
6249 - /*
6250 - * Separate quirks for runtime report descriptor fixup
6251 -diff --git a/include/linux/types.h b/include/linux/types.h
6252 -index 9dc2346..d4a9ce6 100644
6253 ---- a/include/linux/types.h
6254 -+++ b/include/linux/types.h
6255 -@@ -197,8 +197,6 @@ typedef u64 resource_size_t;
6256 - typedef u32 resource_size_t;
6257 - #endif
6258 -
6259 --#endif /* __KERNEL__ */
6260 --
6261 - struct ustat {
6262 - __kernel_daddr_t f_tfree;
6263 - __kernel_ino_t f_tinode;
6264 -@@ -206,4 +204,6 @@ struct ustat {
6265 - char f_fpack[6];
6266 - };
6267 -
6268 -+#endif /* __KERNEL__ */
6269 -+
6270 - #endif /* _LINUX_TYPES_H */
6271 -diff --git a/kernel/capability.c b/kernel/capability.c
6272 -index 39e8193..cfbe442 100644
6273 ---- a/kernel/capability.c
6274 -+++ b/kernel/capability.c
6275 -@@ -53,6 +53,69 @@ static void warn_legacy_capability_use(void)
6276 - }
6277 -
6278 - /*
6279 -+ * Version 2 capabilities worked fine, but the linux/capability.h file
6280 -+ * that accompanied their introduction encouraged their use without
6281 -+ * the necessary user-space source code changes. As such, we have
6282 -+ * created a version 3 with equivalent functionality to version 2, but
6283 -+ * with a header change to protect legacy source code from using
6284 -+ * version 2 when it wanted to use version 1. If your system has code
6285 -+ * that trips the following warning, it is using version 2 specific
6286 -+ * capabilities and may be doing so insecurely.
6287 -+ *
6288 -+ * The remedy is to either upgrade your version of libcap (to 2.10+,
6289 -+ * if the application is linked against it), or recompile your
6290 -+ * application with modern kernel headers and this warning will go
6291 -+ * away.
6292 -+ */
6293 -+
6294 -+static void warn_deprecated_v2(void)
6295 -+{
6296 -+ static int warned;
6297 -+
6298 -+ if (!warned) {
6299 -+ char name[sizeof(current->comm)];
6300 -+
6301 -+ printk(KERN_INFO "warning: `%s' uses deprecated v2"
6302 -+ " capabilities in a way that may be insecure.\n",
6303 -+ get_task_comm(name, current));
6304 -+ warned = 1;
6305 -+ }
6306 -+}
6307 -+
6308 -+/*
6309 -+ * Version check. Return the number of u32s in each capability flag
6310 -+ * array, or a negative value on error.
6311 -+ */
6312 -+static int cap_validate_magic(cap_user_header_t header, unsigned *tocopy)
6313 -+{
6314 -+ __u32 version;
6315 -+
6316 -+ if (get_user(version, &header->version))
6317 -+ return -EFAULT;
6318 -+
6319 -+ switch (version) {
6320 -+ case _LINUX_CAPABILITY_VERSION_1:
6321 -+ warn_legacy_capability_use();
6322 -+ *tocopy = _LINUX_CAPABILITY_U32S_1;
6323 -+ break;
6324 -+ case _LINUX_CAPABILITY_VERSION_2:
6325 -+ warn_deprecated_v2();
6326 -+ /*
6327 -+ * fall through - v3 is otherwise equivalent to v2.
6328 -+ */
6329 -+ case _LINUX_CAPABILITY_VERSION_3:
6330 -+ *tocopy = _LINUX_CAPABILITY_U32S_3;
6331 -+ break;
6332 -+ default:
6333 -+ if (put_user((u32)_KERNEL_CAPABILITY_VERSION, &header->version))
6334 -+ return -EFAULT;
6335 -+ return -EINVAL;
6336 -+ }
6337 -+
6338 -+ return 0;
6339 -+}
6340 -+
6341 -+/*
6342 - * For sys_getproccap() and sys_setproccap(), any of the three
6343 - * capability set pointers may be NULL -- indicating that that set is
6344 - * uninteresting and/or not to be changed.
6345 -@@ -71,27 +134,13 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
6346 - {
6347 - int ret = 0;
6348 - pid_t pid;
6349 -- __u32 version;
6350 - struct task_struct *target;
6351 - unsigned tocopy;
6352 - kernel_cap_t pE, pI, pP;
6353 -
6354 -- if (get_user(version, &header->version))
6355 -- return -EFAULT;
6356 --
6357 -- switch (version) {
6358 -- case _LINUX_CAPABILITY_VERSION_1:
6359 -- warn_legacy_capability_use();
6360 -- tocopy = _LINUX_CAPABILITY_U32S_1;
6361 -- break;
6362 -- case _LINUX_CAPABILITY_VERSION_2:
6363 -- tocopy = _LINUX_CAPABILITY_U32S_2;
6364 -- break;
6365 -- default:
6366 -- if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
6367 -- return -EFAULT;
6368 -- return -EINVAL;
6369 -- }
6370 -+ ret = cap_validate_magic(header, &tocopy);
6371 -+ if (ret != 0)
6372 -+ return ret;
6373 -
6374 - if (get_user(pid, &header->pid))
6375 - return -EFAULT;
6376 -@@ -118,7 +167,7 @@ out:
6377 - spin_unlock(&task_capability_lock);
6378 -
6379 - if (!ret) {
6380 -- struct __user_cap_data_struct kdata[_LINUX_CAPABILITY_U32S];
6381 -+ struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
6382 - unsigned i;
6383 -
6384 - for (i = 0; i < tocopy; i++) {
6385 -@@ -128,7 +177,7 @@ out:
6386 - }
6387 -
6388 - /*
6389 -- * Note, in the case, tocopy < _LINUX_CAPABILITY_U32S,
6390 -+ * Note, in the case, tocopy < _KERNEL_CAPABILITY_U32S,
6391 - * we silently drop the upper capabilities here. This
6392 - * has the effect of making older libcap
6393 - * implementations implicitly drop upper capability
6394 -@@ -240,30 +289,16 @@ static inline int cap_set_all(kernel_cap_t *effective,
6395 - */
6396 - asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
6397 - {
6398 -- struct __user_cap_data_struct kdata[_LINUX_CAPABILITY_U32S];
6399 -+ struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
6400 - unsigned i, tocopy;
6401 - kernel_cap_t inheritable, permitted, effective;
6402 -- __u32 version;
6403 - struct task_struct *target;
6404 - int ret;
6405 - pid_t pid;
6406 -
6407 -- if (get_user(version, &header->version))
6408 -- return -EFAULT;
6409 --
6410 -- switch (version) {
6411 -- case _LINUX_CAPABILITY_VERSION_1:
6412 -- warn_legacy_capability_use();
6413 -- tocopy = _LINUX_CAPABILITY_U32S_1;
6414 -- break;
6415 -- case _LINUX_CAPABILITY_VERSION_2:
6416 -- tocopy = _LINUX_CAPABILITY_U32S_2;
6417 -- break;
6418 -- default:
6419 -- if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
6420 -- return -EFAULT;
6421 -- return -EINVAL;
6422 -- }
6423 -+ ret = cap_validate_magic(header, &tocopy);
6424 -+ if (ret != 0)
6425 -+ return ret;
6426 -
6427 - if (get_user(pid, &header->pid))
6428 - return -EFAULT;
6429 -@@ -281,7 +316,7 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
6430 - permitted.cap[i] = kdata[i].permitted;
6431 - inheritable.cap[i] = kdata[i].inheritable;
6432 - }
6433 -- while (i < _LINUX_CAPABILITY_U32S) {
6434 -+ while (i < _KERNEL_CAPABILITY_U32S) {
6435 - effective.cap[i] = 0;
6436 - permitted.cap[i] = 0;
6437 - inheritable.cap[i] = 0;
6438 -diff --git a/kernel/cgroup.c b/kernel/cgroup.c
6439 -index 6d8de05..4484139 100644
6440 ---- a/kernel/cgroup.c
6441 -+++ b/kernel/cgroup.c
6442 -@@ -2808,7 +2808,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys)
6443 - cg = tsk->cgroups;
6444 - parent = task_cgroup(tsk, subsys->subsys_id);
6445 -
6446 -- snprintf(nodename, MAX_CGROUP_TYPE_NAMELEN, "node_%d", tsk->pid);
6447 -+ snprintf(nodename, MAX_CGROUP_TYPE_NAMELEN, "%d", tsk->pid);
6448 -
6449 - /* Pin the hierarchy */
6450 - atomic_inc(&parent->root->sb->s_active);
6451 -diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
6452 -index 7469c50..4d1e8c7 100644
6453 ---- a/mm/memory_hotplug.c
6454 -+++ b/mm/memory_hotplug.c
6455 -@@ -58,23 +58,59 @@ static void release_memory_resource(struct resource *res)
6456 - return;
6457 - }
6458 -
6459 --
6460 - #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
6461 -+static void grow_zone_span(struct zone *zone, unsigned long start_pfn,
6462 -+ unsigned long end_pfn)
6463 -+{
6464 -+ unsigned long old_zone_end_pfn;
6465 -+
6466 -+ zone_span_writelock(zone);
6467 -+
6468 -+ old_zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages;
6469 -+ if (start_pfn < zone->zone_start_pfn)
6470 -+ zone->zone_start_pfn = start_pfn;
6471 -+
6472 -+ zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
6473 -+ zone->zone_start_pfn;
6474 -+
6475 -+ zone_span_writeunlock(zone);
6476 -+}
6477 -+
6478 -+static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn,
6479 -+ unsigned long end_pfn)
6480 -+{
6481 -+ unsigned long old_pgdat_end_pfn =
6482 -+ pgdat->node_start_pfn + pgdat->node_spanned_pages;
6483 -+
6484 -+ if (start_pfn < pgdat->node_start_pfn)
6485 -+ pgdat->node_start_pfn = start_pfn;
6486 -+
6487 -+ pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
6488 -+ pgdat->node_start_pfn;
6489 -+}
6490 -+
6491 - static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
6492 - {
6493 - struct pglist_data *pgdat = zone->zone_pgdat;
6494 - int nr_pages = PAGES_PER_SECTION;
6495 - int nid = pgdat->node_id;
6496 - int zone_type;
6497 -+ unsigned long flags;
6498 -
6499 - zone_type = zone - pgdat->node_zones;
6500 - if (!zone->wait_table) {
6501 -- int ret = 0;
6502 -+ int ret;
6503 -+
6504 - ret = init_currently_empty_zone(zone, phys_start_pfn,
6505 - nr_pages, MEMMAP_HOTPLUG);
6506 -- if (ret < 0)
6507 -+ if (ret)
6508 - return ret;
6509 - }
6510 -+ pgdat_resize_lock(zone->zone_pgdat, &flags);
6511 -+ grow_zone_span(zone, phys_start_pfn, phys_start_pfn + nr_pages);
6512 -+ grow_pgdat_span(zone->zone_pgdat, phys_start_pfn,
6513 -+ phys_start_pfn + nr_pages);
6514 -+ pgdat_resize_unlock(zone->zone_pgdat, &flags);
6515 - memmap_init_zone(nr_pages, nid, zone_type,
6516 - phys_start_pfn, MEMMAP_HOTPLUG);
6517 - return 0;
6518 -@@ -134,36 +170,6 @@ int __add_pages(struct zone *zone, unsigned long phys_start_pfn,
6519 - }
6520 - EXPORT_SYMBOL_GPL(__add_pages);
6521 -
6522 --static void grow_zone_span(struct zone *zone,
6523 -- unsigned long start_pfn, unsigned long end_pfn)
6524 --{
6525 -- unsigned long old_zone_end_pfn;
6526 --
6527 -- zone_span_writelock(zone);
6528 --
6529 -- old_zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages;
6530 -- if (start_pfn < zone->zone_start_pfn)
6531 -- zone->zone_start_pfn = start_pfn;
6532 --
6533 -- zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
6534 -- zone->zone_start_pfn;
6535 --
6536 -- zone_span_writeunlock(zone);
6537 --}
6538 --
6539 --static void grow_pgdat_span(struct pglist_data *pgdat,
6540 -- unsigned long start_pfn, unsigned long end_pfn)
6541 --{
6542 -- unsigned long old_pgdat_end_pfn =
6543 -- pgdat->node_start_pfn + pgdat->node_spanned_pages;
6544 --
6545 -- if (start_pfn < pgdat->node_start_pfn)
6546 -- pgdat->node_start_pfn = start_pfn;
6547 --
6548 -- pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
6549 -- pgdat->node_start_pfn;
6550 --}
6551 --
6552 - static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
6553 - void *arg)
6554 - {
6555 -@@ -183,7 +189,6 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
6556 -
6557 - int online_pages(unsigned long pfn, unsigned long nr_pages)
6558 - {
6559 -- unsigned long flags;
6560 - unsigned long onlined_pages = 0;
6561 - struct zone *zone;
6562 - int need_zonelists_rebuild = 0;
6563 -@@ -211,11 +216,6 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
6564 - * memory_block->state_sem.
6565 - */
6566 - zone = page_zone(pfn_to_page(pfn));
6567 -- pgdat_resize_lock(zone->zone_pgdat, &flags);
6568 -- grow_zone_span(zone, pfn, pfn + nr_pages);
6569 -- grow_pgdat_span(zone->zone_pgdat, pfn, pfn + nr_pages);
6570 -- pgdat_resize_unlock(zone->zone_pgdat, &flags);
6571 --
6572 - /*
6573 - * If this zone is not populated, then it is not in zonelist.
6574 - * This means the page allocator ignores this zone.
6575 -diff --git a/mm/mmap.c b/mm/mmap.c
6576 -index a32d28c..96bdd73 100644
6577 ---- a/mm/mmap.c
6578 -+++ b/mm/mmap.c
6579 -@@ -242,10 +242,16 @@ asmlinkage unsigned long sys_brk(unsigned long brk)
6580 - unsigned long rlim, retval;
6581 - unsigned long newbrk, oldbrk;
6582 - struct mm_struct *mm = current->mm;
6583 -+ unsigned long min_brk;
6584 -
6585 - down_write(&mm->mmap_sem);
6586 -
6587 -- if (brk < mm->start_brk)
6588 -+#ifdef CONFIG_COMPAT_BRK
6589 -+ min_brk = mm->end_code;
6590 -+#else
6591 -+ min_brk = mm->start_brk;
6592 -+#endif
6593 -+ if (brk < min_brk)
6594 - goto out;
6595 -
6596 - /*
6597 -diff --git a/mm/page_alloc.c b/mm/page_alloc.c
6598 -index 55443c2..f7082af 100644
6599 ---- a/mm/page_alloc.c
6600 -+++ b/mm/page_alloc.c
6601 -@@ -2837,8 +2837,6 @@ __meminit int init_currently_empty_zone(struct zone *zone,
6602 -
6603 - zone->zone_start_pfn = zone_start_pfn;
6604 -
6605 -- memmap_init(size, pgdat->node_id, zone_idx(zone), zone_start_pfn);
6606 --
6607 - zone_init_free_lists(zone);
6608 -
6609 - return 0;
6610 -@@ -3408,6 +3406,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
6611 - ret = init_currently_empty_zone(zone, zone_start_pfn,
6612 - size, MEMMAP_EARLY);
6613 - BUG_ON(ret);
6614 -+ memmap_init(size, nid, j, zone_start_pfn);
6615 - zone_start_pfn += size;
6616 - }
6617 - }
6618 -diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
6619 -index 24c0d03..b8a917b 100644
6620 ---- a/net/ipv6/netfilter/nf_conntrack_reasm.c
6621 -+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
6622 -@@ -209,7 +209,9 @@ fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst)
6623 - arg.dst = dst;
6624 - hash = ip6qhashfn(id, src, dst);
6625 -
6626 -+ local_bh_disable();
6627 - q = inet_frag_find(&nf_init_frags, &nf_frags, &arg, hash);
6628 -+ local_bh_enable();
6629 - if (q == NULL)
6630 - goto oom;
6631 -
6632 -@@ -638,10 +640,10 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
6633 - goto ret_orig;
6634 - }
6635 -
6636 -- spin_lock(&fq->q.lock);
6637 -+ spin_lock_bh(&fq->q.lock);
6638 -
6639 - if (nf_ct_frag6_queue(fq, clone, fhdr, nhoff) < 0) {
6640 -- spin_unlock(&fq->q.lock);
6641 -+ spin_unlock_bh(&fq->q.lock);
6642 - pr_debug("Can't insert skb to queue\n");
6643 - fq_put(fq);
6644 - goto ret_orig;
6645 -@@ -652,7 +654,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
6646 - if (ret_skb == NULL)
6647 - pr_debug("Can't reassemble fragmented packets\n");
6648 - }
6649 -- spin_unlock(&fq->q.lock);
6650 -+ spin_unlock_bh(&fq->q.lock);
6651 -
6652 - fq_put(fq);
6653 - return ret_skb;
6654 -diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
6655 -index 684ec9c..d15d70f 100644
6656 ---- a/net/netfilter/nf_conntrack_expect.c
6657 -+++ b/net/netfilter/nf_conntrack_expect.c
6658 -@@ -550,10 +550,10 @@ int __init nf_conntrack_expect_init(void)
6659 - return 0;
6660 -
6661 - err3:
6662 -+ kmem_cache_destroy(nf_ct_expect_cachep);
6663 -+err2:
6664 - nf_ct_free_hashtable(nf_ct_expect_hash, nf_ct_expect_vmalloc,
6665 - nf_ct_expect_hsize);
6666 --err2:
6667 -- kmem_cache_destroy(nf_ct_expect_cachep);
6668 - err1:
6669 - return err;
6670 - }
6671 -diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
6672 -index 3b01119..1692338 100644
6673 ---- a/net/netfilter/xt_connlimit.c
6674 -+++ b/net/netfilter/xt_connlimit.c
6675 -@@ -75,7 +75,8 @@ static inline bool already_closed(const struct nf_conn *conn)
6676 - u_int16_t proto = conn->tuplehash[0].tuple.dst.protonum;
6677 -
6678 - if (proto == IPPROTO_TCP)
6679 -- return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT;
6680 -+ return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT ||
6681 -+ conn->proto.tcp.state == TCP_CONNTRACK_CLOSE;
6682 - else
6683 - return 0;
6684 - }
6685 -diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c
6686 -index 500528d..c63e933 100644
6687 ---- a/net/netfilter/xt_iprange.c
6688 -+++ b/net/netfilter/xt_iprange.c
6689 -@@ -179,3 +179,5 @@ module_exit(iprange_mt_exit);
6690 - MODULE_LICENSE("GPL");
6691 - MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@××××××××××××××.hu>, Jan Engelhardt <jengelh@××××××××××××.de>");
6692 - MODULE_DESCRIPTION("Xtables: arbitrary IPv4 range matching");
6693 -+MODULE_ALIAS("ipt_iprange");
6694 -+MODULE_ALIAS("ip6t_iprange");
6695 -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
6696 -index 732ba27..62d77ff 100644
6697 ---- a/security/smack/smack_lsm.c
6698 -+++ b/security/smack/smack_lsm.c
6699 -@@ -1865,6 +1865,18 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
6700 - final = sbsp->smk_default;
6701 -
6702 - /*
6703 -+ * If this is the root inode the superblock
6704 -+ * may be in the process of initialization.
6705 -+ * If that is the case use the root value out
6706 -+ * of the superblock.
6707 -+ */
6708 -+ if (opt_dentry->d_parent == opt_dentry) {
6709 -+ isp->smk_inode = sbsp->smk_root;
6710 -+ isp->smk_flags |= SMK_INODE_INSTANT;
6711 -+ goto unlockandout;
6712 -+ }
6713 -+
6714 -+ /*
6715 - * This is pretty hackish.
6716 - * Casey says that we shouldn't have to do
6717 - * file system specific code, but it does help
6718
6719 Deleted: genpatches-2.6/trunk/2.6.26/1006_linux-2.6.25.7.patch
6720 ===================================================================
6721 --- genpatches-2.6/trunk/2.6.26/1006_linux-2.6.25.7.patch 2008-07-17 02:44:10 UTC (rev 1328)
6722 +++ genpatches-2.6/trunk/2.6.26/1006_linux-2.6.25.7.patch 2008-07-17 02:47:50 UTC (rev 1329)
6723 @@ -1,1669 +0,0 @@
6724 -diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt
6725 -index e65736c..63e59b8 100644
6726 ---- a/Documentation/cciss.txt
6727 -+++ b/Documentation/cciss.txt
6728 -@@ -21,6 +21,11 @@ This driver is known to work with the following cards:
6729 - * SA E200
6730 - * SA E200i
6731 - * SA E500
6732 -+ * SA P212
6733 -+ * SA P410
6734 -+ * SA P410i
6735 -+ * SA P411
6736 -+ * SA P812
6737 -
6738 - Detecting drive failures:
6739 - -------------------------
6740 -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
6741 -index 99a4ed3..6342a07 100644
6742 ---- a/arch/x86/Kconfig
6743 -+++ b/arch/x86/Kconfig
6744 -@@ -24,17 +24,10 @@ config X86
6745 - select HAVE_KRETPROBES
6746 - select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
6747 -
6748 --config DEFCONFIG_LIST
6749 -+config ARCH_DEFCONFIG
6750 - string
6751 -- depends on X86_32
6752 -- option defconfig_list
6753 -- default "arch/x86/configs/i386_defconfig"
6754 --
6755 --config DEFCONFIG_LIST
6756 -- string
6757 -- depends on X86_64
6758 -- option defconfig_list
6759 -- default "arch/x86/configs/x86_64_defconfig"
6760 -+ default "arch/x86/configs/i386_defconfig" if X86_32
6761 -+ default "arch/x86/configs/x86_64_defconfig" if X86_64
6762 -
6763 -
6764 - config GENERIC_LOCKBREAK
6765 -@@ -253,8 +246,7 @@ config X86_ELAN
6766 -
6767 - config X86_VOYAGER
6768 - bool "Voyager (NCR)"
6769 -- depends on X86_32
6770 -- select SMP if !BROKEN
6771 -+ depends on X86_32 && (SMP || BROKEN)
6772 - help
6773 - Voyager is an MCA-based 32-way capable SMP architecture proprietary
6774 - to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
6775 -@@ -266,9 +258,8 @@ config X86_VOYAGER
6776 -
6777 - config X86_NUMAQ
6778 - bool "NUMAQ (IBM/Sequent)"
6779 -- select SMP
6780 -+ depends on SMP && X86_32
6781 - select NUMA
6782 -- depends on X86_32
6783 - help
6784 - This option is used for getting Linux to run on a (IBM/Sequent) NUMA
6785 - multiquad box. This changes the way that processors are bootstrapped,
6786 -@@ -339,7 +330,7 @@ config X86_RDC321X
6787 -
6788 - config X86_VSMP
6789 - bool "Support for ScaleMP vSMP"
6790 -- depends on X86_64 && PCI
6791 -+ depends on X86_64
6792 - help
6793 - Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is
6794 - supposed to run on these EM64T-based machines. Only choose this option
6795 -@@ -1391,7 +1382,7 @@ endmenu
6796 - menu "Bus options (PCI etc.)"
6797 -
6798 - config PCI
6799 -- bool "PCI support" if !X86_VISWS
6800 -+ bool "PCI support" if !X86_VISWS && !X86_VSMP
6801 - depends on !X86_VOYAGER
6802 - default y
6803 - select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
6804 -diff --git a/drivers/block/brd.c b/drivers/block/brd.c
6805 -index 8536480..37560a0 100644
6806 ---- a/drivers/block/brd.c
6807 -+++ b/drivers/block/brd.c
6808 -@@ -392,6 +392,7 @@ module_param(rd_size, int, 0);
6809 - MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
6810 - MODULE_LICENSE("GPL");
6811 - MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
6812 -+MODULE_ALIAS("rd");
6813 -
6814 - #ifndef MODULE
6815 - /* Legacy boot options - nonmodular */
6816 -diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
6817 -index 9c9627e..41636b8 100644
6818 ---- a/drivers/block/cciss.c
6819 -+++ b/drivers/block/cciss.c
6820 -@@ -53,15 +53,16 @@
6821 - #include <linux/scatterlist.h>
6822 -
6823 - #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
6824 --#define DRIVER_NAME "HP CISS Driver (v 3.6.14)"
6825 --#define DRIVER_VERSION CCISS_DRIVER_VERSION(3,6,14)
6826 -+#define DRIVER_NAME "HP CISS Driver (v 3.6.20)"
6827 -+#define DRIVER_VERSION CCISS_DRIVER_VERSION(3, 6, 20)
6828 -
6829 - /* Embedded module documentation macros - see modules.h */
6830 - MODULE_AUTHOR("Hewlett-Packard Company");
6831 --MODULE_DESCRIPTION("Driver for HP Controller SA5xxx SA6xxx version 3.6.14");
6832 -+MODULE_DESCRIPTION("Driver for HP Smart Array Controllers");
6833 - MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400"
6834 -- " SA6i P600 P800 P400 P400i E200 E200i E500");
6835 --MODULE_VERSION("3.6.14");
6836 -+ " SA6i P600 P800 P400 P400i E200 E200i E500 P700m"
6837 -+ " Smart Array G2 Series SAS/SATA Controllers");
6838 -+MODULE_VERSION("3.6.20");
6839 - MODULE_LICENSE("GPL");
6840 -
6841 - #include "cciss_cmd.h"
6842 -@@ -90,6 +91,11 @@ static const struct pci_device_id cciss_pci_device_id[] = {
6843 - {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSD, 0x103C, 0x3215},
6844 - {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSC, 0x103C, 0x3237},
6845 - {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSC, 0x103C, 0x323D},
6846 -+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3241},
6847 -+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3243},
6848 -+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3245},
6849 -+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3247},
6850 -+ {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3249},
6851 - {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
6852 - PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0},
6853 - {0,}
6854 -@@ -123,6 +129,11 @@ static struct board_type products[] = {
6855 - {0x3215103C, "Smart Array E200i", &SA5_access, 120},
6856 - {0x3237103C, "Smart Array E500", &SA5_access, 512},
6857 - {0x323D103C, "Smart Array P700m", &SA5_access, 512},
6858 -+ {0x3241103C, "Smart Array P212", &SA5_access, 384},
6859 -+ {0x3243103C, "Smart Array P410", &SA5_access, 384},
6860 -+ {0x3245103C, "Smart Array P410i", &SA5_access, 384},
6861 -+ {0x3247103C, "Smart Array P411", &SA5_access, 384},
6862 -+ {0x3249103C, "Smart Array P812", &SA5_access, 384},
6863 - {0xFFFF103C, "Unknown Smart Array", &SA5_access, 120},
6864 - };
6865 -
6866 -diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c
6867 -index 1f978ff..d353866 100644
6868 ---- a/drivers/char/pcmcia/ipwireless/hardware.c
6869 -+++ b/drivers/char/pcmcia/ipwireless/hardware.c
6870 -@@ -251,10 +251,11 @@ struct ipw_hardware {
6871 - int init_loops;
6872 - struct timer_list setup_timer;
6873 -
6874 -+ /* Flag if hw is ready to send next packet */
6875 - int tx_ready;
6876 -- struct list_head tx_queue[NL_NUM_OF_PRIORITIES];
6877 -- /* True if any packets are queued for transmission */
6878 -+ /* Count of pending packets to be sent */
6879 - int tx_queued;
6880 -+ struct list_head tx_queue[NL_NUM_OF_PRIORITIES];
6881 -
6882 - int rx_bytes_queued;
6883 - struct list_head rx_queue;
6884 -@@ -430,6 +431,8 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data,
6885 -
6886 - spin_lock_irqsave(&hw->spinlock, flags);
6887 -
6888 -+ hw->tx_ready = 0;
6889 -+
6890 - if (hw->hw_version == HW_VERSION_1) {
6891 - outw((unsigned short) length, hw->base_port + IODWR);
6892 -
6893 -@@ -518,6 +521,7 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet)
6894 -
6895 - spin_lock_irqsave(&hw->spinlock, flags);
6896 - list_add(&packet->queue, &hw->tx_queue[0]);
6897 -+ hw->tx_queued++;
6898 - spin_unlock_irqrestore(&hw->spinlock, flags);
6899 - } else {
6900 - if (packet->packet_callback)
6901 -@@ -975,12 +979,10 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
6902 - unsigned long flags;
6903 -
6904 - spin_lock_irqsave(&hw->spinlock, flags);
6905 -- if (hw->tx_queued && hw->tx_ready != 0) {
6906 -+ if (hw->tx_queued && hw->tx_ready) {
6907 - int priority;
6908 - struct ipw_tx_packet *packet = NULL;
6909 -
6910 -- hw->tx_ready--;
6911 --
6912 - /* Pick a packet */
6913 - for (priority = 0; priority < priority_limit; priority++) {
6914 - if (!list_empty(&hw->tx_queue[priority])) {
6915 -@@ -989,6 +991,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
6916 - struct ipw_tx_packet,
6917 - queue);
6918 -
6919 -+ hw->tx_queued--;
6920 - list_del(&packet->queue);
6921 -
6922 - break;
6923 -@@ -999,6 +1002,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
6924 - spin_unlock_irqrestore(&hw->spinlock, flags);
6925 - return 0;
6926 - }
6927 -+
6928 - spin_unlock_irqrestore(&hw->spinlock, flags);
6929 -
6930 - /* Send */
6931 -@@ -1089,7 +1093,7 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq,
6932 - if (irqn & IR_TXINTR) {
6933 - ack |= IR_TXINTR;
6934 - spin_lock_irqsave(&hw->spinlock, flags);
6935 -- hw->tx_ready++;
6936 -+ hw->tx_ready = 1;
6937 - spin_unlock_irqrestore(&hw->spinlock, flags);
6938 - }
6939 - /* Received data */
6940 -@@ -1196,7 +1200,7 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq,
6941 - if (memrxdone & MEMRX_RX_DONE) {
6942 - writew(0, &hw->memory_info_regs->memreg_rx_done);
6943 - spin_lock_irqsave(&hw->spinlock, flags);
6944 -- hw->tx_ready++;
6945 -+ hw->tx_ready = 1;
6946 - spin_unlock_irqrestore(&hw->spinlock, flags);
6947 - tx = 1;
6948 - }
6949 -@@ -1260,7 +1264,7 @@ static void send_packet(struct ipw_hardware *hw, int priority,
6950 -
6951 - spin_lock_irqsave(&hw->spinlock, flags);
6952 - list_add_tail(&packet->queue, &hw->tx_queue[priority]);
6953 -- hw->tx_queued = 1;
6954 -+ hw->tx_queued++;
6955 - spin_unlock_irqrestore(&hw->spinlock, flags);
6956 -
6957 - flush_packets_to_hw(hw);
6958 -diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
6959 -index 99aa5f5..ebd68c1 100644
6960 ---- a/drivers/cpufreq/cpufreq.c
6961 -+++ b/drivers/cpufreq/cpufreq.c
6962 -@@ -410,7 +410,7 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
6963 - int ret;
6964 -
6965 - mutex_unlock(&cpufreq_governor_mutex);
6966 -- ret = request_module(name);
6967 -+ ret = request_module("%s", name);
6968 - mutex_lock(&cpufreq_governor_mutex);
6969 -
6970 - if (ret == 0)
6971 -diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
6972 -index 4e3128f..9d5b86c 100644
6973 ---- a/drivers/infiniband/core/umem.c
6974 -+++ b/drivers/infiniband/core/umem.c
6975 -@@ -144,7 +144,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
6976 - ret = 0;
6977 - while (npages) {
6978 - ret = get_user_pages(current, current->mm, cur_base,
6979 -- min_t(int, npages,
6980 -+ min_t(unsigned long, npages,
6981 - PAGE_SIZE / sizeof (struct page *)),
6982 - 1, !umem->writable, page_list, vma_list);
6983 -
6984 -diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
6985 -index fcf8f2d..594522a 100644
6986 ---- a/drivers/media/video/bt8xx/bttv-driver.c
6987 -+++ b/drivers/media/video/bt8xx/bttv-driver.c
6988 -@@ -2613,7 +2613,7 @@ static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
6989 - struct bttv_fh *fh = priv;
6990 -
6991 - mutex_lock(&fh->cap.vb_lock);
6992 -- retval = videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
6993 -+ retval = __videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
6994 - V4L2_MEMORY_MMAP);
6995 - if (retval < 0) {
6996 - mutex_unlock(&fh->cap.vb_lock);
6997 -diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c
6998 -index eab79ff..57a9de4 100644
6999 ---- a/drivers/media/video/videobuf-core.c
7000 -+++ b/drivers/media/video/videobuf-core.c
7001 -@@ -335,7 +335,7 @@ int videobuf_mmap_free(struct videobuf_queue *q)
7002 - }
7003 -
7004 - /* Locking: Caller holds q->vb_lock */
7005 --static int __videobuf_mmap_setup(struct videobuf_queue *q,
7006 -+int __videobuf_mmap_setup(struct videobuf_queue *q,
7007 - unsigned int bcount, unsigned int bsize,
7008 - enum v4l2_memory memory)
7009 - {
7010 -@@ -1093,6 +1093,7 @@ EXPORT_SYMBOL_GPL(videobuf_read_stream);
7011 - EXPORT_SYMBOL_GPL(videobuf_read_one);
7012 - EXPORT_SYMBOL_GPL(videobuf_poll_stream);
7013 -
7014 -+EXPORT_SYMBOL_GPL(__videobuf_mmap_setup);
7015 - EXPORT_SYMBOL_GPL(videobuf_mmap_setup);
7016 - EXPORT_SYMBOL_GPL(videobuf_mmap_free);
7017 - EXPORT_SYMBOL_GPL(videobuf_mmap_mapper);
7018 -diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c
7019 -index be624a0..c303e7f 100644
7020 ---- a/drivers/mmc/host/wbsd.c
7021 -+++ b/drivers/mmc/host/wbsd.c
7022 -@@ -1457,17 +1457,7 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq)
7023 - int ret;
7024 -
7025 - /*
7026 -- * Allocate interrupt.
7027 -- */
7028 --
7029 -- ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host);
7030 -- if (ret)
7031 -- return ret;
7032 --
7033 -- host->irq = irq;
7034 --
7035 -- /*
7036 -- * Set up tasklets.
7037 -+ * Set up tasklets. Must be done before requesting interrupt.
7038 - */
7039 - tasklet_init(&host->card_tasklet, wbsd_tasklet_card,
7040 - (unsigned long)host);
7041 -@@ -1480,6 +1470,15 @@ static int __devinit wbsd_request_irq(struct wbsd_host *host, int irq)
7042 - tasklet_init(&host->finish_tasklet, wbsd_tasklet_finish,
7043 - (unsigned long)host);
7044 -
7045 -+ /*
7046 -+ * Allocate interrupt.
7047 -+ */
7048 -+ ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host);
7049 -+ if (ret)
7050 -+ return ret;
7051 -+
7052 -+ host->irq = irq;
7053 -+
7054 - return 0;
7055 - }
7056 -
7057 -diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
7058 -index 14299f8..863d7f3 100644
7059 ---- a/drivers/net/cassini.c
7060 -+++ b/drivers/net/cassini.c
7061 -@@ -142,8 +142,8 @@
7062 -
7063 - #define DRV_MODULE_NAME "cassini"
7064 - #define PFX DRV_MODULE_NAME ": "
7065 --#define DRV_MODULE_VERSION "1.5"
7066 --#define DRV_MODULE_RELDATE "4 Jan 2008"
7067 -+#define DRV_MODULE_VERSION "1.6"
7068 -+#define DRV_MODULE_RELDATE "21 May 2008"
7069 -
7070 - #define CAS_DEF_MSG_ENABLE \
7071 - (NETIF_MSG_DRV | \
7072 -@@ -2140,9 +2140,12 @@ end_copy_pkt:
7073 - if (addr)
7074 - cas_page_unmap(addr);
7075 - }
7076 -- skb->csum = csum_unfold(~csum);
7077 -- skb->ip_summed = CHECKSUM_COMPLETE;
7078 - skb->protocol = eth_type_trans(skb, cp->dev);
7079 -+ if (skb->protocol == htons(ETH_P_IP)) {
7080 -+ skb->csum = csum_unfold(~csum);
7081 -+ skb->ip_summed = CHECKSUM_COMPLETE;
7082 -+ } else
7083 -+ skb->ip_summed = CHECKSUM_NONE;
7084 - return len;
7085 - }
7086 -
7087 -diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
7088 -index 9f088a4..8e877e7 100644
7089 ---- a/drivers/net/forcedeth.c
7090 -+++ b/drivers/net/forcedeth.c
7091 -@@ -3111,6 +3111,20 @@ static void nv_link_irq(struct net_device *dev)
7092 - dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
7093 - }
7094 -
7095 -+static void nv_msi_workaround(struct fe_priv *np)
7096 -+{
7097 -+
7098 -+ /* Need to toggle the msi irq mask within the ethernet device,
7099 -+ * otherwise, future interrupts will not be detected.
7100 -+ */
7101 -+ if (np->msi_flags & NV_MSI_ENABLED) {
7102 -+ u8 __iomem *base = np->base;
7103 -+
7104 -+ writel(0, base + NvRegMSIIrqMask);
7105 -+ writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
7106 -+ }
7107 -+}
7108 -+
7109 - static irqreturn_t nv_nic_irq(int foo, void *data)
7110 - {
7111 - struct net_device *dev = (struct net_device *) data;
7112 -@@ -3133,6 +3147,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
7113 - if (!(events & np->irqmask))
7114 - break;
7115 -
7116 -+ nv_msi_workaround(np);
7117 -+
7118 - spin_lock(&np->lock);
7119 - nv_tx_done(dev);
7120 - spin_unlock(&np->lock);
7121 -@@ -3248,6 +3264,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
7122 - if (!(events & np->irqmask))
7123 - break;
7124 -
7125 -+ nv_msi_workaround(np);
7126 -+
7127 - spin_lock(&np->lock);
7128 - nv_tx_done_optimized(dev, TX_WORK_PER_LOOP);
7129 - spin_unlock(&np->lock);
7130 -@@ -3588,6 +3606,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
7131 - if (!(events & NVREG_IRQ_TIMER))
7132 - return IRQ_RETVAL(0);
7133 -
7134 -+ nv_msi_workaround(np);
7135 -+
7136 - spin_lock(&np->lock);
7137 - np->intr_test = 1;
7138 - spin_unlock(&np->lock);
7139 -diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
7140 -index 3d10ca0..a629355 100644
7141 ---- a/drivers/net/pppol2tp.c
7142 -+++ b/drivers/net/pppol2tp.c
7143 -@@ -240,12 +240,15 @@ static inline struct pppol2tp_session *pppol2tp_sock_to_session(struct sock *sk)
7144 - if (sk == NULL)
7145 - return NULL;
7146 -
7147 -+ sock_hold(sk);
7148 - session = (struct pppol2tp_session *)(sk->sk_user_data);
7149 -- if (session == NULL)
7150 -- return NULL;
7151 -+ if (session == NULL) {
7152 -+ sock_put(sk);
7153 -+ goto out;
7154 -+ }
7155 -
7156 - BUG_ON(session->magic != L2TP_SESSION_MAGIC);
7157 --
7158 -+out:
7159 - return session;
7160 - }
7161 -
7162 -@@ -256,12 +259,15 @@ static inline struct pppol2tp_tunnel *pppol2tp_sock_to_tunnel(struct sock *sk)
7163 - if (sk == NULL)
7164 - return NULL;
7165 -
7166 -+ sock_hold(sk);
7167 - tunnel = (struct pppol2tp_tunnel *)(sk->sk_user_data);
7168 -- if (tunnel == NULL)
7169 -- return NULL;
7170 -+ if (tunnel == NULL) {
7171 -+ sock_put(sk);
7172 -+ goto out;
7173 -+ }
7174 -
7175 - BUG_ON(tunnel->magic != L2TP_TUNNEL_MAGIC);
7176 --
7177 -+out:
7178 - return tunnel;
7179 - }
7180 -
7181 -@@ -716,12 +722,14 @@ discard:
7182 - session->stats.rx_errors++;
7183 - kfree_skb(skb);
7184 - sock_put(session->sock);
7185 -+ sock_put(sock);
7186 -
7187 - return 0;
7188 -
7189 - error:
7190 - /* Put UDP header back */
7191 - __skb_push(skb, sizeof(struct udphdr));
7192 -+ sock_put(sock);
7193 -
7194 - no_tunnel:
7195 - return 1;
7196 -@@ -745,10 +753,13 @@ static int pppol2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
7197 - "%s: received %d bytes\n", tunnel->name, skb->len);
7198 -
7199 - if (pppol2tp_recv_core(sk, skb))
7200 -- goto pass_up;
7201 -+ goto pass_up_put;
7202 -
7203 -+ sock_put(sk);
7204 - return 0;
7205 -
7206 -+pass_up_put:
7207 -+ sock_put(sk);
7208 - pass_up:
7209 - return 1;
7210 - }
7211 -@@ -858,7 +869,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
7212 -
7213 - tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
7214 - if (tunnel == NULL)
7215 -- goto error;
7216 -+ goto error_put_sess;
7217 -
7218 - /* What header length is configured for this session? */
7219 - hdr_len = pppol2tp_l2tp_header_len(session);
7220 -@@ -870,7 +881,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
7221 - sizeof(ppph) + total_len,
7222 - 0, GFP_KERNEL);
7223 - if (!skb)
7224 -- goto error;
7225 -+ goto error_put_sess_tun;
7226 -
7227 - /* Reserve space for headers. */
7228 - skb_reserve(skb, NET_SKB_PAD);
7229 -@@ -900,7 +911,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
7230 - error = memcpy_fromiovec(skb->data, m->msg_iov, total_len);
7231 - if (error < 0) {
7232 - kfree_skb(skb);
7233 -- goto error;
7234 -+ goto error_put_sess_tun;
7235 - }
7236 - skb_put(skb, total_len);
7237 -
7238 -@@ -947,10 +958,33 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
7239 - session->stats.tx_errors++;
7240 - }
7241 -
7242 -+ return error;
7243 -+
7244 -+error_put_sess_tun:
7245 -+ sock_put(session->tunnel_sock);
7246 -+error_put_sess:
7247 -+ sock_put(sk);
7248 - error:
7249 - return error;
7250 - }
7251 -
7252 -+/* Automatically called when the skb is freed.
7253 -+ */
7254 -+static void pppol2tp_sock_wfree(struct sk_buff *skb)
7255 -+{
7256 -+ sock_put(skb->sk);
7257 -+}
7258 -+
7259 -+/* For data skbs that we transmit, we associate with the tunnel socket
7260 -+ * but don't do accounting.
7261 -+ */
7262 -+static inline void pppol2tp_skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
7263 -+{
7264 -+ sock_hold(sk);
7265 -+ skb->sk = sk;
7266 -+ skb->destructor = pppol2tp_sock_wfree;
7267 -+}
7268 -+
7269 - /* Transmit function called by generic PPP driver. Sends PPP frame
7270 - * over PPPoL2TP socket.
7271 - *
7272 -@@ -980,6 +1014,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
7273 - __wsum csum = 0;
7274 - struct udphdr *uh;
7275 - unsigned int len;
7276 -+ int old_headroom;
7277 -+ int new_headroom;
7278 -
7279 - if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED))
7280 - goto abort;
7281 -@@ -991,25 +1027,27 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
7282 -
7283 - sk_tun = session->tunnel_sock;
7284 - if (sk_tun == NULL)
7285 -- goto abort;
7286 -+ goto abort_put_sess;
7287 - tunnel = pppol2tp_sock_to_tunnel(sk_tun);
7288 - if (tunnel == NULL)
7289 -- goto abort;
7290 -+ goto abort_put_sess;
7291 -
7292 - /* What header length is configured for this session? */
7293 - hdr_len = pppol2tp_l2tp_header_len(session);
7294 -
7295 - /* Check that there's enough headroom in the skb to insert IP,
7296 - * UDP and L2TP and PPP headers. If not enough, expand it to
7297 -- * make room. Note that a new skb (or a clone) is
7298 -- * allocated. If we return an error from this point on, make
7299 -- * sure we free the new skb but do not free the original skb
7300 -- * since that is done by the caller for the error case.
7301 -+ * make room. Adjust truesize.
7302 - */
7303 - headroom = NET_SKB_PAD + sizeof(struct iphdr) +
7304 - sizeof(struct udphdr) + hdr_len + sizeof(ppph);
7305 -+ old_headroom = skb_headroom(skb);
7306 - if (skb_cow_head(skb, headroom))
7307 -- goto abort;
7308 -+ goto abort_put_sess_tun;
7309 -+
7310 -+ new_headroom = skb_headroom(skb);
7311 -+ skb_orphan(skb);
7312 -+ skb->truesize += new_headroom - old_headroom;
7313 -
7314 - /* Setup PPP header */
7315 - __skb_push(skb, sizeof(ppph));
7316 -@@ -1065,8 +1103,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
7317 - /* Get routing info from the tunnel socket */
7318 - dst_release(skb->dst);
7319 - skb->dst = dst_clone(__sk_dst_get(sk_tun));
7320 -- skb_orphan(skb);
7321 -- skb->sk = sk_tun;
7322 -+ pppol2tp_skb_set_owner_w(skb, sk_tun);
7323 -
7324 - /* Queue the packet to IP for output */
7325 - len = skb->len;
7326 -@@ -1083,8 +1120,14 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
7327 - session->stats.tx_errors++;
7328 - }
7329 -
7330 -+ sock_put(sk_tun);
7331 -+ sock_put(sk);
7332 - return 1;
7333 -
7334 -+abort_put_sess_tun:
7335 -+ sock_put(sk_tun);
7336 -+abort_put_sess:
7337 -+ sock_put(sk);
7338 - abort:
7339 - /* Free the original skb */
7340 - kfree_skb(skb);
7341 -@@ -1188,7 +1231,7 @@ static void pppol2tp_tunnel_destruct(struct sock *sk)
7342 - {
7343 - struct pppol2tp_tunnel *tunnel;
7344 -
7345 -- tunnel = pppol2tp_sock_to_tunnel(sk);
7346 -+ tunnel = sk->sk_user_data;
7347 - if (tunnel == NULL)
7348 - goto end;
7349 -
7350 -@@ -1227,10 +1270,12 @@ static void pppol2tp_session_destruct(struct sock *sk)
7351 - if (sk->sk_user_data != NULL) {
7352 - struct pppol2tp_tunnel *tunnel;
7353 -
7354 -- session = pppol2tp_sock_to_session(sk);
7355 -+ session = sk->sk_user_data;
7356 - if (session == NULL)
7357 - goto out;
7358 -
7359 -+ BUG_ON(session->magic != L2TP_SESSION_MAGIC);
7360 -+
7361 - /* Don't use pppol2tp_sock_to_tunnel() here to
7362 - * get the tunnel context because the tunnel
7363 - * socket might have already been closed (its
7364 -@@ -1276,6 +1321,7 @@ out:
7365 - static int pppol2tp_release(struct socket *sock)
7366 - {
7367 - struct sock *sk = sock->sk;
7368 -+ struct pppol2tp_session *session;
7369 - int error;
7370 -
7371 - if (!sk)
7372 -@@ -1293,9 +1339,18 @@ static int pppol2tp_release(struct socket *sock)
7373 - sock_orphan(sk);
7374 - sock->sk = NULL;
7375 -
7376 -+ session = pppol2tp_sock_to_session(sk);
7377 -+
7378 - /* Purge any queued data */
7379 - skb_queue_purge(&sk->sk_receive_queue);
7380 - skb_queue_purge(&sk->sk_write_queue);
7381 -+ if (session != NULL) {
7382 -+ struct sk_buff *skb;
7383 -+ while ((skb = skb_dequeue(&session->reorder_q))) {
7384 -+ kfree_skb(skb);
7385 -+ sock_put(sk);
7386 -+ }
7387 -+ }
7388 -
7389 - release_sock(sk);
7390 -
7391 -@@ -1598,7 +1653,7 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
7392 -
7393 - error = ppp_register_channel(&po->chan);
7394 - if (error)
7395 -- goto end;
7396 -+ goto end_put_tun;
7397 -
7398 - /* This is how we get the session context from the socket. */
7399 - sk->sk_user_data = session;
7400 -@@ -1618,6 +1673,8 @@ out_no_ppp:
7401 - PRINTK(session->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO,
7402 - "%s: created\n", session->name);
7403 -
7404 -+end_put_tun:
7405 -+ sock_put(tunnel_sock);
7406 - end:
7407 - release_sock(sk);
7408 -
7409 -@@ -1658,6 +1715,7 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
7410 - *usockaddr_len = len;
7411 -
7412 - error = 0;
7413 -+ sock_put(sock->sk);
7414 -
7415 - end:
7416 - return error;
7417 -@@ -1896,14 +1954,17 @@ static int pppol2tp_ioctl(struct socket *sock, unsigned int cmd,
7418 - err = -EBADF;
7419 - tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
7420 - if (tunnel == NULL)
7421 -- goto end;
7422 -+ goto end_put_sess;
7423 -
7424 - err = pppol2tp_tunnel_ioctl(tunnel, cmd, arg);
7425 -- goto end;
7426 -+ sock_put(session->tunnel_sock);
7427 -+ goto end_put_sess;
7428 - }
7429 -
7430 - err = pppol2tp_session_ioctl(session, cmd, arg);
7431 -
7432 -+end_put_sess:
7433 -+ sock_put(sk);
7434 - end:
7435 - return err;
7436 - }
7437 -@@ -2049,14 +2110,17 @@ static int pppol2tp_setsockopt(struct socket *sock, int level, int optname,
7438 - err = -EBADF;
7439 - tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
7440 - if (tunnel == NULL)
7441 -- goto end;
7442 -+ goto end_put_sess;
7443 -
7444 - err = pppol2tp_tunnel_setsockopt(sk, tunnel, optname, val);
7445 -+ sock_put(session->tunnel_sock);
7446 - } else
7447 - err = pppol2tp_session_setsockopt(sk, session, optname, val);
7448 -
7449 - err = 0;
7450 -
7451 -+end_put_sess:
7452 -+ sock_put(sk);
7453 - end:
7454 - return err;
7455 - }
7456 -@@ -2171,20 +2235,24 @@ static int pppol2tp_getsockopt(struct socket *sock, int level,
7457 - err = -EBADF;
7458 - tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
7459 - if (tunnel == NULL)
7460 -- goto end;
7461 -+ goto end_put_sess;
7462 -
7463 - err = pppol2tp_tunnel_getsockopt(sk, tunnel, optname, &val);
7464 -+ sock_put(session->tunnel_sock);
7465 - } else
7466 - err = pppol2tp_session_getsockopt(sk, session, optname, &val);
7467 -
7468 - err = -EFAULT;
7469 - if (put_user(len, (int __user *) optlen))
7470 -- goto end;
7471 -+ goto end_put_sess;
7472 -
7473 - if (copy_to_user((void __user *) optval, &val, len))
7474 -- goto end;
7475 -+ goto end_put_sess;
7476 -
7477 - err = 0;
7478 -+
7479 -+end_put_sess:
7480 -+ sock_put(sk);
7481 - end:
7482 - return err;
7483 - }
7484 -diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
7485 -index e0055d0..6966eec 100644
7486 ---- a/drivers/net/wireless/b43/main.c
7487 -+++ b/drivers/net/wireless/b43/main.c
7488 -@@ -3818,7 +3818,9 @@ static void b43_chip_reset(struct work_struct *work)
7489 - goto out;
7490 - }
7491 - }
7492 -- out:
7493 -+out:
7494 -+ if (err)
7495 -+ wl->current_dev = NULL; /* Failed to init the dev. */
7496 - mutex_unlock(&wl->mutex);
7497 - if (err)
7498 - b43err(wl, "Controller restart FAILED\n");
7499 -@@ -3967,9 +3969,11 @@ static void b43_one_core_detach(struct ssb_device *dev)
7500 - struct b43_wldev *wldev;
7501 - struct b43_wl *wl;
7502 -
7503 -+ /* Do not cancel ieee80211-workqueue based work here.
7504 -+ * See comment in b43_remove(). */
7505 -+
7506 - wldev = ssb_get_drvdata(dev);
7507 - wl = wldev->wl;
7508 -- cancel_work_sync(&wldev->restart_work);
7509 - b43_debugfs_remove_device(wldev);
7510 - b43_wireless_core_detach(wldev);
7511 - list_del(&wldev->list);
7512 -@@ -4152,6 +4156,10 @@ static void b43_remove(struct ssb_device *dev)
7513 - struct b43_wl *wl = ssb_get_devtypedata(dev);
7514 - struct b43_wldev *wldev = ssb_get_drvdata(dev);
7515 -
7516 -+ /* We must cancel any work here before unregistering from ieee80211,
7517 -+ * as the ieee80211 unreg will destroy the workqueue. */
7518 -+ cancel_work_sync(&wldev->restart_work);
7519 -+
7520 - B43_WARN_ON(!wl);
7521 - if (wl->current_dev == wldev)
7522 - ieee80211_unregister_hw(wl->hw);
7523 -diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
7524 -index 3bf9294..db9920e 100644
7525 ---- a/drivers/serial/serial_core.c
7526 -+++ b/drivers/serial/serial_core.c
7527 -@@ -2022,6 +2022,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
7528 - int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
7529 - {
7530 - struct uart_state *state = drv->state + port->line;
7531 -+ struct device *tty_dev;
7532 -+ struct uart_match match = {port, drv};
7533 -
7534 - mutex_lock(&state->mutex);
7535 -
7536 -@@ -2031,7 +2033,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
7537 - return 0;
7538 - }
7539 -
7540 -- if (!port->suspended) {
7541 -+ tty_dev = device_find_child(port->dev, &match, serial_match_port);
7542 -+ if (!port->suspended && device_may_wakeup(tty_dev)) {
7543 - disable_irq_wake(port->irq);
7544 - mutex_unlock(&state->mutex);
7545 - return 0;
7546 -diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
7547 -index 145c028..2847336 100644
7548 ---- a/drivers/serial/sunhv.c
7549 -+++ b/drivers/serial/sunhv.c
7550 -@@ -499,7 +499,6 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig
7551 - } else
7552 - spin_lock(&port->lock);
7553 -
7554 -- spin_lock_irqsave(&port->lock, flags);
7555 - for (i = 0; i < n; i++) {
7556 - if (*s == '\n')
7557 - sunhv_console_putchar(port, '\r');
7558 -diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
7559 -index 5d777f2..3c8239a 100644
7560 ---- a/drivers/ssb/driver_pcicore.c
7561 -+++ b/drivers/ssb/driver_pcicore.c
7562 -@@ -519,12 +519,12 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
7563 - int err = 0;
7564 - u32 tmp;
7565 -
7566 -- might_sleep();
7567 --
7568 - if (!pdev)
7569 - goto out;
7570 - bus = pdev->bus;
7571 -
7572 -+ might_sleep_if(pdev->id.coreid != SSB_DEV_PCI);
7573 -+
7574 - /* Enable interrupts for this device. */
7575 - if (bus->host_pci &&
7576 - ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE))) {
7577 -diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
7578 -index fb9e672..c18880d 100644
7579 ---- a/drivers/video/hgafb.c
7580 -+++ b/drivers/video/hgafb.c
7581 -@@ -279,7 +279,7 @@ static void hga_blank(int blank_mode)
7582 -
7583 - static int __init hga_card_detect(void)
7584 - {
7585 -- int count=0;
7586 -+ int count = 0;
7587 - void __iomem *p, *q;
7588 - unsigned short p_save, q_save;
7589 -
7590 -@@ -303,20 +303,18 @@ static int __init hga_card_detect(void)
7591 - writew(0x55aa, p); if (readw(p) == 0x55aa) count++;
7592 - writew(p_save, p);
7593 -
7594 -- if (count != 2) {
7595 -- return 0;
7596 -- }
7597 -+ if (count != 2)
7598 -+ goto error;
7599 -
7600 - /* Ok, there is definitely a card registering at the correct
7601 - * memory location, so now we do an I/O port test.
7602 - */
7603 -
7604 -- if (!test_hga_b(0x66, 0x0f)) { /* cursor low register */
7605 -- return 0;
7606 -- }
7607 -- if (!test_hga_b(0x99, 0x0f)) { /* cursor low register */
7608 -- return 0;
7609 -- }
7610 -+ if (!test_hga_b(0x66, 0x0f)) /* cursor low register */
7611 -+ goto error;
7612 -+
7613 -+ if (!test_hga_b(0x99, 0x0f)) /* cursor low register */
7614 -+ goto error;
7615 -
7616 - /* See if the card is a Hercules, by checking whether the vsync
7617 - * bit of the status register is changing. This test lasts for
7618 -@@ -331,7 +329,7 @@ static int __init hga_card_detect(void)
7619 - }
7620 -
7621 - if (p_save == q_save)
7622 -- return 0;
7623 -+ goto error;
7624 -
7625 - switch (inb_p(HGA_STATUS_PORT) & 0x70) {
7626 - case 0x10:
7627 -@@ -348,6 +346,12 @@ static int __init hga_card_detect(void)
7628 - break;
7629 - }
7630 - return 1;
7631 -+error:
7632 -+ if (release_io_ports)
7633 -+ release_region(0x3b0, 12);
7634 -+ if (release_io_port)
7635 -+ release_region(0x3bf, 1);
7636 -+ return 0;
7637 - }
7638 -
7639 - /**
7640 -diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
7641 -index 08d0725..971b338 100644
7642 ---- a/drivers/video/modedb.c
7643 -+++ b/drivers/video/modedb.c
7644 -@@ -28,6 +28,7 @@
7645 - #endif
7646 -
7647 - const char *fb_mode_option;
7648 -+EXPORT_SYMBOL_GPL(fb_mode_option);
7649 -
7650 - /*
7651 - * Standard video mode definitions (taken from XFree86)
7652 -diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
7653 -index a04b17e..b94fb5c 100644
7654 ---- a/fs/cifs/cifsfs.c
7655 -+++ b/fs/cifs/cifsfs.c
7656 -@@ -97,9 +97,6 @@ cifs_read_super(struct super_block *sb, void *data,
7657 - {
7658 - struct inode *inode;
7659 - struct cifs_sb_info *cifs_sb;
7660 --#ifdef CONFIG_CIFS_DFS_UPCALL
7661 -- int len;
7662 --#endif
7663 - int rc = 0;
7664 -
7665 - /* BB should we make this contingent on mount parm? */
7666 -@@ -117,15 +114,17 @@ cifs_read_super(struct super_block *sb, void *data,
7667 - * complex operation (mount), and in case of fail
7668 - * just exit instead of doing mount and attempting
7669 - * undo it if this copy fails?*/
7670 -- len = strlen(data);
7671 -- cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
7672 -- if (cifs_sb->mountdata == NULL) {
7673 -- kfree(sb->s_fs_info);
7674 -- sb->s_fs_info = NULL;
7675 -- return -ENOMEM;
7676 -+ if (data) {
7677 -+ int len = strlen(data);
7678 -+ cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
7679 -+ if (cifs_sb->mountdata == NULL) {
7680 -+ kfree(sb->s_fs_info);
7681 -+ sb->s_fs_info = NULL;
7682 -+ return -ENOMEM;
7683 -+ }
7684 -+ strncpy(cifs_sb->mountdata, data, len + 1);
7685 -+ cifs_sb->mountdata[len] = '\0';
7686 - }
7687 -- strncpy(cifs_sb->mountdata, data, len + 1);
7688 -- cifs_sb->mountdata[len] = '\0';
7689 - #endif
7690 -
7691 - rc = cifs_mount(sb, cifs_sb, data, devname);
7692 -diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
7693 -index a066e10..086b312 100644
7694 ---- a/fs/ecryptfs/crypto.c
7695 -+++ b/fs/ecryptfs/crypto.c
7696 -@@ -1907,9 +1907,9 @@ int ecryptfs_get_tfm_and_mutex_for_cipher_name(struct crypto_blkcipher **tfm,
7697 - goto out;
7698 - }
7699 - }
7700 -- mutex_unlock(&key_tfm_list_mutex);
7701 - (*tfm) = key_tfm->key_tfm;
7702 - (*tfm_mutex) = &key_tfm->key_tfm_mutex;
7703 - out:
7704 -+ mutex_unlock(&key_tfm_list_mutex);
7705 - return rc;
7706 - }
7707 -diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
7708 -index 2b8f5ed..2258b8f 100644
7709 ---- a/fs/ecryptfs/file.c
7710 -+++ b/fs/ecryptfs/file.c
7711 -@@ -195,7 +195,9 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
7712 - file, ecryptfs_inode_to_private(inode)->lower_file);
7713 - if (S_ISDIR(ecryptfs_dentry->d_inode->i_mode)) {
7714 - ecryptfs_printk(KERN_DEBUG, "This is a directory\n");
7715 -+ mutex_lock(&crypt_stat->cs_mutex);
7716 - crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
7717 -+ mutex_unlock(&crypt_stat->cs_mutex);
7718 - rc = 0;
7719 - goto out;
7720 - }
7721 -diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
7722 -index e238611..a2174c2 100644
7723 ---- a/fs/ecryptfs/inode.c
7724 -+++ b/fs/ecryptfs/inode.c
7725 -@@ -37,17 +37,11 @@ static struct dentry *lock_parent(struct dentry *dentry)
7726 - {
7727 - struct dentry *dir;
7728 -
7729 -- dir = dget(dentry->d_parent);
7730 -+ dir = dget_parent(dentry);
7731 - mutex_lock_nested(&(dir->d_inode->i_mutex), I_MUTEX_PARENT);
7732 - return dir;
7733 - }
7734 -
7735 --static void unlock_parent(struct dentry *dentry)
7736 --{
7737 -- mutex_unlock(&(dentry->d_parent->d_inode->i_mutex));
7738 -- dput(dentry->d_parent);
7739 --}
7740 --
7741 - static void unlock_dir(struct dentry *dir)
7742 - {
7743 - mutex_unlock(&dir->d_inode->i_mutex);
7744 -@@ -426,8 +420,9 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry)
7745 - int rc = 0;
7746 - struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
7747 - struct inode *lower_dir_inode = ecryptfs_inode_to_lower(dir);
7748 -+ struct dentry *lower_dir_dentry;
7749 -
7750 -- lock_parent(lower_dentry);
7751 -+ lower_dir_dentry = lock_parent(lower_dentry);
7752 - rc = vfs_unlink(lower_dir_inode, lower_dentry);
7753 - if (rc) {
7754 - printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc);
7755 -@@ -439,7 +434,7 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry)
7756 - dentry->d_inode->i_ctime = dir->i_ctime;
7757 - d_drop(dentry);
7758 - out_unlock:
7759 -- unlock_parent(lower_dentry);
7760 -+ unlock_dir(lower_dir_dentry);
7761 - return rc;
7762 - }
7763 -
7764 -@@ -908,7 +903,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
7765 - if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
7766 - ia->ia_valid &= ~ATTR_MODE;
7767 -
7768 -+ mutex_lock(&lower_dentry->d_inode->i_mutex);
7769 - rc = notify_change(lower_dentry, ia);
7770 -+ mutex_unlock(&lower_dentry->d_inode->i_mutex);
7771 - out:
7772 - fsstack_copy_attr_all(inode, lower_inode, NULL);
7773 - return rc;
7774 -diff --git a/fs/pipe.c b/fs/pipe.c
7775 -index 8be381b..f73492b 100644
7776 ---- a/fs/pipe.c
7777 -+++ b/fs/pipe.c
7778 -@@ -988,7 +988,10 @@ struct file *create_write_pipe(void)
7779 - return f;
7780 -
7781 - err_dentry:
7782 -+ free_pipe_info(inode);
7783 - dput(dentry);
7784 -+ return ERR_PTR(err);
7785 -+
7786 - err_inode:
7787 - free_pipe_info(inode);
7788 - iput(inode);
7789 -diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
7790 -index 83d1f28..fbb7f06 100644
7791 ---- a/include/asm-m68k/bitops.h
7792 -+++ b/include/asm-m68k/bitops.h
7793 -@@ -410,8 +410,50 @@ static inline int ext2_find_next_zero_bit(const void *vaddr, unsigned size,
7794 - res = ext2_find_first_zero_bit (p, size - 32 * (p - addr));
7795 - return (p - addr) * 32 + res;
7796 - }
7797 --#define ext2_find_next_bit(addr, size, off) \
7798 -- generic_find_next_le_bit((unsigned long *)(addr), (size), (off))
7799 -+
7800 -+static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
7801 -+{
7802 -+ const unsigned long *p = vaddr, *addr = vaddr;
7803 -+ int res;
7804 -+
7805 -+ if (!size)
7806 -+ return 0;
7807 -+
7808 -+ size = (size >> 5) + ((size & 31) > 0);
7809 -+ while (*p++ == 0UL)
7810 -+ {
7811 -+ if (--size == 0)
7812 -+ return (p - addr) << 5;
7813 -+ }
7814 -+
7815 -+ --p;
7816 -+ for (res = 0; res < 32; res++)
7817 -+ if (ext2_test_bit(res, p))
7818 -+ break;
7819 -+ return (p - addr) * 32 + res;
7820 -+}
7821 -+
7822 -+static inline int ext2_find_next_bit(const void *vaddr, unsigned size,
7823 -+ unsigned offset)
7824 -+{
7825 -+ const unsigned long *addr = vaddr;
7826 -+ const unsigned long *p = addr + (offset >> 5);
7827 -+ int bit = offset & 31UL, res;
7828 -+
7829 -+ if (offset >= size)
7830 -+ return size;
7831 -+
7832 -+ if (bit) {
7833 -+ /* Look for one in first longword */
7834 -+ for (res = bit; res < 32; res++)
7835 -+ if (ext2_test_bit(res, p))
7836 -+ return (p - addr) * 32 + res;
7837 -+ p++;
7838 -+ }
7839 -+ /* No set bit yet, search remaining full bytes for a set bit */
7840 -+ res = ext2_find_first_bit(p, size - 32 * (p - addr));
7841 -+ return (p - addr) * 32 + res;
7842 -+}
7843 -
7844 - #endif /* __KERNEL__ */
7845 -
7846 -diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
7847 -index 70eb3c8..f624e7c 100644
7848 ---- a/include/linux/pci_ids.h
7849 -+++ b/include/linux/pci_ids.h
7850 -@@ -716,6 +716,7 @@
7851 - #define PCI_DEVICE_ID_HP_CISSA 0x3220
7852 - #define PCI_DEVICE_ID_HP_CISSC 0x3230
7853 - #define PCI_DEVICE_ID_HP_CISSD 0x3238
7854 -+#define PCI_DEVICE_ID_HP_CISSE 0x323a
7855 - #define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
7856 -
7857 - #define PCI_VENDOR_ID_PCTECH 0x1042
7858 -diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
7859 -index 9903394..7552731 100644
7860 ---- a/include/media/videobuf-core.h
7861 -+++ b/include/media/videobuf-core.h
7862 -@@ -227,6 +227,9 @@ unsigned int videobuf_poll_stream(struct file *file,
7863 - int videobuf_mmap_setup(struct videobuf_queue *q,
7864 - unsigned int bcount, unsigned int bsize,
7865 - enum v4l2_memory memory);
7866 -+int __videobuf_mmap_setup(struct videobuf_queue *q,
7867 -+ unsigned int bcount, unsigned int bsize,
7868 -+ enum v4l2_memory memory);
7869 - int videobuf_mmap_free(struct videobuf_queue *q);
7870 - int videobuf_mmap_mapper(struct videobuf_queue *q,
7871 - struct vm_area_struct *vma);
7872 -diff --git a/include/net/netlink.h b/include/net/netlink.h
7873 -index a5506c4..112dcdf 100644
7874 ---- a/include/net/netlink.h
7875 -+++ b/include/net/netlink.h
7876 -@@ -772,12 +772,13 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
7877 - const struct nla_policy *policy,
7878 - int len)
7879 - {
7880 -- if (nla_len(nla) < len)
7881 -+ int nested_len = nla_len(nla) - NLA_ALIGN(len);
7882 -+
7883 -+ if (nested_len < 0)
7884 - return -1;
7885 -- if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
7886 -- return nla_parse_nested(tb, maxtype,
7887 -- nla_data(nla) + NLA_ALIGN(len),
7888 -- policy);
7889 -+ if (nested_len >= nla_attr_size(0))
7890 -+ return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
7891 -+ nested_len, policy);
7892 - memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
7893 - return 0;
7894 - }
7895 -diff --git a/init/Kconfig b/init/Kconfig
7896 -index a97924b..021476f 100644
7897 ---- a/init/Kconfig
7898 -+++ b/init/Kconfig
7899 -@@ -13,6 +13,7 @@ config DEFCONFIG_LIST
7900 - default "/lib/modules/$UNAME_RELEASE/.config"
7901 - default "/etc/kernel-config"
7902 - default "/boot/config-$UNAME_RELEASE"
7903 -+ default "$ARCH_DEFCONFIG"
7904 - default "arch/$ARCH/defconfig"
7905 -
7906 - menu "General setup"
7907 -diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
7908 -index b33410a..c0bac6d 100644
7909 ---- a/net/8021q/vlan.c
7910 -+++ b/net/8021q/vlan.c
7911 -@@ -397,10 +397,8 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
7912 - if (dev->nd_net != &init_net)
7913 - return NOTIFY_DONE;
7914 -
7915 -- if (is_vlan_dev(dev)) {
7916 -+ if (is_vlan_dev(dev))
7917 - __vlan_device_event(dev, event);
7918 -- goto out;
7919 -- }
7920 -
7921 - grp = __vlan_find_group(dev->ifindex);
7922 - if (!grp)
7923 -diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c
7924 -index d8f2157..034aa10 100644
7925 ---- a/net/ax25/ax25_subr.c
7926 -+++ b/net/ax25/ax25_subr.c
7927 -@@ -64,20 +64,15 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr)
7928 -
7929 - void ax25_requeue_frames(ax25_cb *ax25)
7930 - {
7931 -- struct sk_buff *skb, *skb_prev = NULL;
7932 -+ struct sk_buff *skb;
7933 -
7934 - /*
7935 - * Requeue all the un-ack-ed frames on the output queue to be picked
7936 - * up by ax25_kick called from the timer. This arrangement handles the
7937 - * possibility of an empty output queue.
7938 - */
7939 -- while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) {
7940 -- if (skb_prev == NULL)
7941 -- skb_queue_head(&ax25->write_queue, skb);
7942 -- else
7943 -- skb_append(skb_prev, skb, &ax25->write_queue);
7944 -- skb_prev = skb;
7945 -- }
7946 -+ while ((skb = skb_dequeue_tail(&ax25->ack_queue)) != NULL)
7947 -+ skb_queue_head(&ax25->write_queue, skb);
7948 - }
7949 -
7950 - /*
7951 -diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
7952 -index eb62558..0c2c937 100644
7953 ---- a/net/bluetooth/rfcomm/core.c
7954 -+++ b/net/bluetooth/rfcomm/core.c
7955 -@@ -423,8 +423,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
7956 -
7957 - rfcomm_dlc_lock(d);
7958 - d->state = BT_CLOSED;
7959 -- rfcomm_dlc_unlock(d);
7960 - d->state_change(d, err);
7961 -+ rfcomm_dlc_unlock(d);
7962 -
7963 - skb_queue_purge(&d->tx_queue);
7964 - rfcomm_dlc_unlink(d);
7965 -diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
7966 -index c3f749a..c919187 100644
7967 ---- a/net/bluetooth/rfcomm/tty.c
7968 -+++ b/net/bluetooth/rfcomm/tty.c
7969 -@@ -566,11 +566,22 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err)
7970 - if (dlc->state == BT_CLOSED) {
7971 - if (!dev->tty) {
7972 - if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) {
7973 -- if (rfcomm_dev_get(dev->id) == NULL)
7974 -+ /* Drop DLC lock here to avoid deadlock
7975 -+ * 1. rfcomm_dev_get will take rfcomm_dev_lock
7976 -+ * but in rfcomm_dev_add there's lock order:
7977 -+ * rfcomm_dev_lock -> dlc lock
7978 -+ * 2. rfcomm_dev_put will deadlock if it's
7979 -+ * the last reference
7980 -+ */
7981 -+ rfcomm_dlc_unlock(dlc);
7982 -+ if (rfcomm_dev_get(dev->id) == NULL) {
7983 -+ rfcomm_dlc_lock(dlc);
7984 - return;
7985 -+ }
7986 -
7987 - rfcomm_dev_del(dev);
7988 - rfcomm_dev_put(dev);
7989 -+ rfcomm_dlc_lock(dlc);
7990 - }
7991 - } else
7992 - tty_hangup(dev->tty);
7993 -diff --git a/net/can/raw.c b/net/can/raw.c
7994 -index c92cb8e..da26bbb 100644
7995 ---- a/net/can/raw.c
7996 -+++ b/net/can/raw.c
7997 -@@ -435,15 +435,13 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
7998 - if (!filter)
7999 - return -ENOMEM;
8000 -
8001 -- err = copy_from_user(filter, optval, optlen);
8002 -- if (err) {
8003 -+ if (copy_from_user(filter, optval, optlen)) {
8004 - kfree(filter);
8005 -- return err;
8006 -+ return -EFAULT;
8007 - }
8008 - } else if (count == 1) {
8009 -- err = copy_from_user(&sfilter, optval, optlen);
8010 -- if (err)
8011 -- return err;
8012 -+ if (copy_from_user(&sfilter, optval, optlen))
8013 -+ return -EFAULT;
8014 - }
8015 -
8016 - lock_sock(sk);
8017 -@@ -493,9 +491,8 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
8018 - if (optlen != sizeof(err_mask))
8019 - return -EINVAL;
8020 -
8021 -- err = copy_from_user(&err_mask, optval, optlen);
8022 -- if (err)
8023 -- return err;
8024 -+ if (copy_from_user(&err_mask, optval, optlen))
8025 -+ return -EFAULT;
8026 -
8027 - err_mask &= CAN_ERR_MASK;
8028 -
8029 -@@ -531,7 +528,8 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
8030 - if (optlen != sizeof(ro->loopback))
8031 - return -EINVAL;
8032 -
8033 -- err = copy_from_user(&ro->loopback, optval, optlen);
8034 -+ if (copy_from_user(&ro->loopback, optval, optlen))
8035 -+ return -EFAULT;
8036 -
8037 - break;
8038 -
8039 -@@ -539,7 +537,8 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
8040 - if (optlen != sizeof(ro->recv_own_msgs))
8041 - return -EINVAL;
8042 -
8043 -- err = copy_from_user(&ro->recv_own_msgs, optval, optlen);
8044 -+ if (copy_from_user(&ro->recv_own_msgs, optval, optlen))
8045 -+ return -EFAULT;
8046 -
8047 - break;
8048 -
8049 -diff --git a/net/core/dev.c b/net/core/dev.c
8050 -index 460e7f9..37ffd7a 100644
8051 ---- a/net/core/dev.c
8052 -+++ b/net/core/dev.c
8053 -@@ -3132,7 +3132,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
8054 - * Load in the correct multicast list now the flags have changed.
8055 - */
8056 -
8057 -- if (dev->change_rx_flags && (dev->flags ^ flags) & IFF_MULTICAST)
8058 -+ if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST)
8059 - dev->change_rx_flags(dev, IFF_MULTICAST);
8060 -
8061 - dev_set_rx_mode(dev);
8062 -diff --git a/net/ipv4/route.c b/net/ipv4/route.c
8063 -index 7b5e8e1..d39cf9f 100644
8064 ---- a/net/ipv4/route.c
8065 -+++ b/net/ipv4/route.c
8066 -@@ -162,7 +162,7 @@ static struct dst_ops ipv4_dst_ops = {
8067 - .negative_advice = ipv4_negative_advice,
8068 - .link_failure = ipv4_link_failure,
8069 - .update_pmtu = ip_rt_update_pmtu,
8070 -- .local_out = ip_local_out,
8071 -+ .local_out = __ip_local_out,
8072 - .entry_size = sizeof(struct rtable),
8073 - .entries = ATOMIC_INIT(0),
8074 - };
8075 -diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
8076 -index 3a6be23..fde7146 100644
8077 ---- a/net/ipv4/tcp_cong.c
8078 -+++ b/net/ipv4/tcp_cong.c
8079 -@@ -285,14 +285,12 @@ int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
8080 - if (in_flight >= tp->snd_cwnd)
8081 - return 1;
8082 -
8083 -- if (!sk_can_gso(sk))
8084 -- return 0;
8085 --
8086 - left = tp->snd_cwnd - in_flight;
8087 -- if (sysctl_tcp_tso_win_divisor)
8088 -- return left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd;
8089 -- else
8090 -- return left <= tcp_max_burst(tp);
8091 -+ if (sk_can_gso(sk) &&
8092 -+ left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd &&
8093 -+ left * tp->mss_cache < 65536)
8094 -+ return 1;
8095 -+ return left <= tcp_max_burst(tp);
8096 - }
8097 - EXPORT_SYMBOL_GPL(tcp_is_cwnd_limited);
8098 -
8099 -diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
8100 -index bbb7d88..3180963 100644
8101 ---- a/net/ipv4/tcp_input.c
8102 -+++ b/net/ipv4/tcp_input.c
8103 -@@ -113,8 +113,6 @@ int sysctl_tcp_abc __read_mostly;
8104 - #define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED)
8105 - #define FLAG_ANY_PROGRESS (FLAG_FORWARD_PROGRESS|FLAG_SND_UNA_ADVANCED)
8106 -
8107 --#define IsSackFrto() (sysctl_tcp_frto == 0x2)
8108 --
8109 - #define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH)
8110 - #define TCP_HP_BITS (~(TCP_RESERVED_BITS|TCP_FLAG_PSH))
8111 -
8112 -@@ -1393,9 +1391,9 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct sk_buff *skb,
8113 -
8114 - if (before(next_dup->start_seq, skip_to_seq)) {
8115 - skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq, fack_count);
8116 -- tcp_sacktag_walk(skb, sk, NULL,
8117 -- next_dup->start_seq, next_dup->end_seq,
8118 -- 1, fack_count, reord, flag);
8119 -+ skb = tcp_sacktag_walk(skb, sk, NULL,
8120 -+ next_dup->start_seq, next_dup->end_seq,
8121 -+ 1, fack_count, reord, flag);
8122 - }
8123 -
8124 - return skb;
8125 -@@ -1685,6 +1683,11 @@ static inline void tcp_reset_reno_sack(struct tcp_sock *tp)
8126 - tp->sacked_out = 0;
8127 - }
8128 -
8129 -+static int tcp_is_sackfrto(const struct tcp_sock *tp)
8130 -+{
8131 -+ return (sysctl_tcp_frto == 0x2) && !tcp_is_reno(tp);
8132 -+}
8133 -+
8134 - /* F-RTO can only be used if TCP has never retransmitted anything other than
8135 - * head (SACK enhanced variant from Appendix B of RFC4138 is more robust here)
8136 - */
8137 -@@ -1701,7 +1704,7 @@ int tcp_use_frto(struct sock *sk)
8138 - if (icsk->icsk_mtup.probe_size)
8139 - return 0;
8140 -
8141 -- if (IsSackFrto())
8142 -+ if (tcp_is_sackfrto(tp))
8143 - return 1;
8144 -
8145 - /* Avoid expensive walking of rexmit queue if possible */
8146 -@@ -1791,7 +1794,7 @@ void tcp_enter_frto(struct sock *sk)
8147 - /* Earlier loss recovery underway (see RFC4138; Appendix B).
8148 - * The last condition is necessary at least in tp->frto_counter case.
8149 - */
8150 -- if (IsSackFrto() && (tp->frto_counter ||
8151 -+ if (tcp_is_sackfrto(tp) && (tp->frto_counter ||
8152 - ((1 << icsk->icsk_ca_state) & (TCPF_CA_Recovery|TCPF_CA_Loss))) &&
8153 - after(tp->high_seq, tp->snd_una)) {
8154 - tp->frto_highmark = tp->high_seq;
8155 -@@ -1838,9 +1841,16 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
8156 - TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
8157 - }
8158 -
8159 -- /* Don't lost mark skbs that were fwd transmitted after RTO */
8160 -- if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED) &&
8161 -- !after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark)) {
8162 -+ /* Marking forward transmissions that were made after RTO lost
8163 -+ * can cause unnecessary retransmissions in some scenarios,
8164 -+ * SACK blocks will mitigate that in some but not in all cases.
8165 -+ * We used to not mark them but it was causing break-ups with
8166 -+ * receivers that do only in-order receival.
8167 -+ *
8168 -+ * TODO: we could detect presence of such receiver and select
8169 -+ * different behavior per flow.
8170 -+ */
8171 -+ if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {
8172 - TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
8173 - tp->lost_out += tcp_skb_pcount(skb);
8174 - }
8175 -@@ -1856,7 +1866,7 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
8176 - tp->reordering = min_t(unsigned int, tp->reordering,
8177 - sysctl_tcp_reordering);
8178 - tcp_set_ca_state(sk, TCP_CA_Loss);
8179 -- tp->high_seq = tp->frto_highmark;
8180 -+ tp->high_seq = tp->snd_nxt;
8181 - TCP_ECN_queue_cwr(tp);
8182 -
8183 - tcp_clear_retrans_hints_partial(tp);
8184 -@@ -2459,28 +2469,34 @@ static inline void tcp_complete_cwr(struct sock *sk)
8185 - tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
8186 - }
8187 -
8188 -+static void tcp_try_keep_open(struct sock *sk)
8189 -+{
8190 -+ struct tcp_sock *tp = tcp_sk(sk);
8191 -+ int state = TCP_CA_Open;
8192 -+
8193 -+ if (tcp_left_out(tp) || tp->retrans_out || tp->undo_marker)
8194 -+ state = TCP_CA_Disorder;
8195 -+
8196 -+ if (inet_csk(sk)->icsk_ca_state != state) {
8197 -+ tcp_set_ca_state(sk, state);
8198 -+ tp->high_seq = tp->snd_nxt;
8199 -+ }
8200 -+}
8201 -+
8202 - static void tcp_try_to_open(struct sock *sk, int flag)
8203 - {
8204 - struct tcp_sock *tp = tcp_sk(sk);
8205 -
8206 - tcp_verify_left_out(tp);
8207 -
8208 -- if (tp->retrans_out == 0)
8209 -+ if (!tp->frto_counter && tp->retrans_out == 0)
8210 - tp->retrans_stamp = 0;
8211 -
8212 - if (flag & FLAG_ECE)
8213 - tcp_enter_cwr(sk, 1);
8214 -
8215 - if (inet_csk(sk)->icsk_ca_state != TCP_CA_CWR) {
8216 -- int state = TCP_CA_Open;
8217 --
8218 -- if (tcp_left_out(tp) || tp->retrans_out || tp->undo_marker)
8219 -- state = TCP_CA_Disorder;
8220 --
8221 -- if (inet_csk(sk)->icsk_ca_state != state) {
8222 -- tcp_set_ca_state(sk, state);
8223 -- tp->high_seq = tp->snd_nxt;
8224 -- }
8225 -+ tcp_try_keep_open(sk);
8226 - tcp_moderate_cwnd(tp);
8227 - } else {
8228 - tcp_cwnd_down(sk, flag);
8229 -@@ -3110,7 +3126,7 @@ static int tcp_process_frto(struct sock *sk, int flag)
8230 - return 1;
8231 - }
8232 -
8233 -- if (!IsSackFrto() || tcp_is_reno(tp)) {
8234 -+ if (!tcp_is_sackfrto(tp)) {
8235 - /* RFC4138 shortcoming in step 2; should also have case c):
8236 - * ACK isn't duplicate nor advances window, e.g., opposite dir
8237 - * data, winupdate
8238 -@@ -3286,8 +3302,11 @@ no_queue:
8239 - return 1;
8240 -
8241 - old_ack:
8242 -- if (TCP_SKB_CB(skb)->sacked)
8243 -+ if (TCP_SKB_CB(skb)->sacked) {
8244 - tcp_sacktag_write_queue(sk, skb, prior_snd_una);
8245 -+ if (icsk->icsk_ca_state == TCP_CA_Open)
8246 -+ tcp_try_keep_open(sk);
8247 -+ }
8248 -
8249 - uninteresting_ack:
8250 - SOCK_DEBUG(sk, "Ack %u out of %u:%u\n", ack, tp->snd_una, tp->snd_nxt);
8251 -diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
8252 -index d29ef79..6c3d8a1 100644
8253 ---- a/net/ipv4/tcp_output.c
8254 -+++ b/net/ipv4/tcp_output.c
8255 -@@ -1836,7 +1836,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
8256 - {
8257 - struct tcp_sock *tp = tcp_sk(sk);
8258 - struct inet_connection_sock *icsk = inet_csk(sk);
8259 -- unsigned int cur_mss = tcp_current_mss(sk, 0);
8260 -+ unsigned int cur_mss;
8261 - int err;
8262 -
8263 - /* Inconslusive MTU probe */
8264 -@@ -1858,6 +1858,11 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
8265 - return -ENOMEM;
8266 - }
8267 -
8268 -+ if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk))
8269 -+ return -EHOSTUNREACH; /* Routing failure or similar. */
8270 -+
8271 -+ cur_mss = tcp_current_mss(sk, 0);
8272 -+
8273 - /* If receiver has shrunk his window, and skb is out of
8274 - * new window, do not retransmit it. The exception is the
8275 - * case, when window is shrunk to zero. In this case
8276 -@@ -1884,9 +1889,6 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
8277 - (sysctl_tcp_retrans_collapse != 0))
8278 - tcp_retrans_try_collapse(sk, skb, cur_mss);
8279 -
8280 -- if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk))
8281 -- return -EHOSTUNREACH; /* Routing failure or similar. */
8282 --
8283 - /* Some Solaris stacks overoptimize and ignore the FIN on a
8284 - * retransmit when old data is attached. So strip it off
8285 - * since it is cheap to do so and saves bytes on the network.
8286 -diff --git a/net/ipv6/route.c b/net/ipv6/route.c
8287 -index e8b241c..f95745f 100644
8288 ---- a/net/ipv6/route.c
8289 -+++ b/net/ipv6/route.c
8290 -@@ -105,7 +105,7 @@ static struct dst_ops ip6_dst_ops = {
8291 - .negative_advice = ip6_negative_advice,
8292 - .link_failure = ip6_link_failure,
8293 - .update_pmtu = ip6_rt_update_pmtu,
8294 -- .local_out = ip6_local_out,
8295 -+ .local_out = __ip6_local_out,
8296 - .entry_size = sizeof(struct rt6_info),
8297 - .entries = ATOMIC_INIT(0),
8298 - };
8299 -diff --git a/net/key/af_key.c b/net/key/af_key.c
8300 -index 5ceab25..11c42e3 100644
8301 ---- a/net/key/af_key.c
8302 -+++ b/net/key/af_key.c
8303 -@@ -1219,7 +1219,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
8304 - x->sel.prefixlen_s = addr->sadb_address_prefixlen;
8305 - }
8306 -
8307 -- if (x->props.mode == XFRM_MODE_TRANSPORT)
8308 -+ if (!x->sel.family)
8309 - x->sel.family = x->props.family;
8310 -
8311 - if (ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1]) {
8312 -diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
8313 -index c170685..7d5c263 100644
8314 ---- a/net/mac80211/ieee80211_sta.c
8315 -+++ b/net/mac80211/ieee80211_sta.c
8316 -@@ -2723,6 +2723,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
8317 - struct rate_selection ratesel;
8318 - u8 *pos;
8319 - struct ieee80211_sub_if_data *sdata;
8320 -+ union iwreq_data wrqu;
8321 -
8322 - /* Remove possible STA entries from other IBSS networks. */
8323 - sta_info_flush(local, NULL);
8324 -@@ -2863,6 +2864,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
8325 -
8326 - ieee80211_rx_bss_put(dev, bss);
8327 -
8328 -+ memset(&wrqu, 0, sizeof(wrqu));
8329 -+ memcpy(wrqu.ap_addr.sa_data, bss->bssid, ETH_ALEN);
8330 -+ wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
8331 -+
8332 - return res;
8333 - }
8334 -
8335 -diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
8336 -index 0fbedca..855c33c 100644
8337 ---- a/net/sched/cls_api.c
8338 -+++ b/net/sched/cls_api.c
8339 -@@ -220,7 +220,7 @@ replay:
8340 - tp = kzalloc(sizeof(*tp), GFP_KERNEL);
8341 - if (tp == NULL)
8342 - goto errout;
8343 -- err = -EINVAL;
8344 -+ err = -ENOENT;
8345 - tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND]);
8346 - if (tp_ops == NULL) {
8347 - #ifdef CONFIG_KMOD
8348 -diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
8349 -index 9a9b977..d0330d8 100644
8350 ---- a/sound/pci/emu10k1/emu10k1_main.c
8351 -+++ b/sound/pci/emu10k1/emu10k1_main.c
8352 -@@ -1817,13 +1817,6 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
8353 - }
8354 - emu->port = pci_resource_start(pci, 0);
8355 -
8356 -- if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED,
8357 -- "EMU10K1", emu)) {
8358 -- err = -EBUSY;
8359 -- goto error;
8360 -- }
8361 -- emu->irq = pci->irq;
8362 --
8363 - emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT;
8364 - if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
8365 - 32 * 1024, &emu->ptb_pages) < 0) {
8366 -@@ -1886,6 +1879,14 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
8367 - emu->fx8010.etram_pages.area = NULL;
8368 - emu->fx8010.etram_pages.bytes = 0;
8369 -
8370 -+ /* irq handler must be registered after I/O ports are activated */
8371 -+ if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED,
8372 -+ "EMU10K1", emu)) {
8373 -+ err = -EBUSY;
8374 -+ goto error;
8375 -+ }
8376 -+ emu->irq = pci->irq;
8377 -+
8378 - /*
8379 - * Init to 0x02109204 :
8380 - * Clock accuracy = 0 (1000ppm)
8381 -diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
8382 -index 33282f9..52a7f0f 100644
8383 ---- a/sound/pci/hda/patch_realtek.c
8384 -+++ b/sound/pci/hda/patch_realtek.c
8385 -@@ -940,7 +940,6 @@ do_sku:
8386 - AC_VERB_SET_UNSOLICITED_ENABLE,
8387 - AC_USRSP_EN | ALC880_HP_EVENT);
8388 - spec->unsol_event = alc_sku_unsol_event;
8389 -- spec->init_hook = alc_sku_automute;
8390 - }
8391 -
8392 - /*
8393
8394 Deleted: genpatches-2.6/trunk/2.6.26/1007_linux-2.6.25.8.patch
8395 ===================================================================
8396 --- genpatches-2.6/trunk/2.6.26/1007_linux-2.6.25.8.patch 2008-07-17 02:44:10 UTC (rev 1328)
8397 +++ genpatches-2.6/trunk/2.6.26/1007_linux-2.6.25.8.patch 2008-07-17 02:47:50 UTC (rev 1329)
8398 @@ -1,495 +0,0 @@
8399 -diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
8400 -index c8890b8..39b1b7e 100644
8401 ---- a/arch/x86/kernel/process_32.c
8402 -+++ b/arch/x86/kernel/process_32.c
8403 -@@ -259,12 +259,31 @@ static void mwait_idle(void)
8404 - mwait_idle_with_hints(0, 0);
8405 - }
8406 -
8407 -+/*
8408 -+ * mwait selection logic:
8409 -+ *
8410 -+ * It depends on the CPU. For AMD CPUs that support MWAIT this is
8411 -+ * wrong. Family 0x10 and 0x11 CPUs will enter C1 on HLT. Powersavings
8412 -+ * then depend on a clock divisor and current Pstate of the core. If
8413 -+ * all cores of a processor are in halt state (C1) the processor can
8414 -+ * enter the C1E (C1 enhanced) state. If mwait is used this will never
8415 -+ * happen.
8416 -+ *
8417 -+ * idle=mwait overrides this decision and forces the usage of mwait.
8418 -+ */
8419 - static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
8420 - {
8421 - if (force_mwait)
8422 - return 1;
8423 -- /* Any C1 states supported? */
8424 -- return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
8425 -+
8426 -+ if (c->x86_vendor == X86_VENDOR_AMD) {
8427 -+ switch(c->x86) {
8428 -+ case 0x10:
8429 -+ case 0x11:
8430 -+ return 0;
8431 -+ }
8432 -+ }
8433 -+ return 1;
8434 - }
8435 -
8436 - void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
8437 -diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
8438 -index 1316f1c..53b9c4c 100644
8439 ---- a/arch/x86/kernel/process_64.c
8440 -+++ b/arch/x86/kernel/process_64.c
8441 -@@ -254,13 +254,31 @@ static void mwait_idle(void)
8442 - }
8443 - }
8444 -
8445 --
8446 -+/*
8447 -+ * mwait selection logic:
8448 -+ *
8449 -+ * It depends on the CPU. For AMD CPUs that support MWAIT this is
8450 -+ * wrong. Family 0x10 and 0x11 CPUs will enter C1 on HLT. Powersavings
8451 -+ * then depend on a clock divisor and current Pstate of the core. If
8452 -+ * all cores of a processor are in halt state (C1) the processor can
8453 -+ * enter the C1E (C1 enhanced) state. If mwait is used this will never
8454 -+ * happen.
8455 -+ *
8456 -+ * idle=mwait overrides this decision and forces the usage of mwait.
8457 -+ */
8458 - static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
8459 - {
8460 - if (force_mwait)
8461 - return 1;
8462 -- /* Any C1 states supported? */
8463 -- return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
8464 -+
8465 -+ if (c->x86_vendor == X86_VENDOR_AMD) {
8466 -+ switch(c->x86) {
8467 -+ case 0x10:
8468 -+ case 0x11:
8469 -+ return 0;
8470 -+ }
8471 -+ }
8472 -+ return 1;
8473 - }
8474 -
8475 - void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
8476 -diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
8477 -index 70bebd3..ee1c3f6 100644
8478 ---- a/arch/x86/lib/copy_user_64.S
8479 -+++ b/arch/x86/lib/copy_user_64.S
8480 -@@ -217,19 +217,19 @@ ENTRY(copy_user_generic_unrolled)
8481 - /* table sorted by exception address */
8482 - .section __ex_table,"a"
8483 - .align 8
8484 -- .quad .Ls1,.Ls1e
8485 -- .quad .Ls2,.Ls2e
8486 -- .quad .Ls3,.Ls3e
8487 -- .quad .Ls4,.Ls4e
8488 -- .quad .Ld1,.Ls1e
8489 -+ .quad .Ls1,.Ls1e /* Ls1-Ls4 have copied zero bytes */
8490 -+ .quad .Ls2,.Ls1e
8491 -+ .quad .Ls3,.Ls1e
8492 -+ .quad .Ls4,.Ls1e
8493 -+ .quad .Ld1,.Ls1e /* Ld1-Ld4 have copied 0-24 bytes */
8494 - .quad .Ld2,.Ls2e
8495 - .quad .Ld3,.Ls3e
8496 - .quad .Ld4,.Ls4e
8497 -- .quad .Ls5,.Ls5e
8498 -- .quad .Ls6,.Ls6e
8499 -- .quad .Ls7,.Ls7e
8500 -- .quad .Ls8,.Ls8e
8501 -- .quad .Ld5,.Ls5e
8502 -+ .quad .Ls5,.Ls5e /* Ls5-Ls8 have copied 32 bytes */
8503 -+ .quad .Ls6,.Ls5e
8504 -+ .quad .Ls7,.Ls5e
8505 -+ .quad .Ls8,.Ls5e
8506 -+ .quad .Ld5,.Ls5e /* Ld5-Ld8 have copied 32-56 bytes */
8507 - .quad .Ld6,.Ls6e
8508 - .quad .Ld7,.Ls7e
8509 - .quad .Ld8,.Ls8e
8510 -@@ -244,11 +244,8 @@ ENTRY(copy_user_generic_unrolled)
8511 - .quad .Le5,.Le_zero
8512 - .previous
8513 -
8514 -- /* compute 64-offset for main loop. 8 bytes accuracy with error on the
8515 -- pessimistic side. this is gross. it would be better to fix the
8516 -- interface. */
8517 - /* eax: zero, ebx: 64 */
8518 --.Ls1e: addl $8,%eax
8519 -+.Ls1e: addl $8,%eax /* eax is bytes left uncopied within the loop (Ls1e: 64 .. Ls8e: 8) */
8520 - .Ls2e: addl $8,%eax
8521 - .Ls3e: addl $8,%eax
8522 - .Ls4e: addl $8,%eax
8523 -diff --git a/arch/x86/lib/copy_user_nocache_64.S b/arch/x86/lib/copy_user_nocache_64.S
8524 -index 5196762..9d3d1ab 100644
8525 ---- a/arch/x86/lib/copy_user_nocache_64.S
8526 -+++ b/arch/x86/lib/copy_user_nocache_64.S
8527 -@@ -145,19 +145,19 @@ ENTRY(__copy_user_nocache)
8528 - /* table sorted by exception address */
8529 - .section __ex_table,"a"
8530 - .align 8
8531 -- .quad .Ls1,.Ls1e
8532 -- .quad .Ls2,.Ls2e
8533 -- .quad .Ls3,.Ls3e
8534 -- .quad .Ls4,.Ls4e
8535 -- .quad .Ld1,.Ls1e
8536 -+ .quad .Ls1,.Ls1e /* .Ls[1-4] - 0 bytes copied */
8537 -+ .quad .Ls2,.Ls1e
8538 -+ .quad .Ls3,.Ls1e
8539 -+ .quad .Ls4,.Ls1e
8540 -+ .quad .Ld1,.Ls1e /* .Ld[1-4] - 0..24 bytes coped */
8541 - .quad .Ld2,.Ls2e
8542 - .quad .Ld3,.Ls3e
8543 - .quad .Ld4,.Ls4e
8544 -- .quad .Ls5,.Ls5e
8545 -- .quad .Ls6,.Ls6e
8546 -- .quad .Ls7,.Ls7e
8547 -- .quad .Ls8,.Ls8e
8548 -- .quad .Ld5,.Ls5e
8549 -+ .quad .Ls5,.Ls5e /* .Ls[5-8] - 32 bytes copied */
8550 -+ .quad .Ls6,.Ls5e
8551 -+ .quad .Ls7,.Ls5e
8552 -+ .quad .Ls8,.Ls5e
8553 -+ .quad .Ld5,.Ls5e /* .Ld[5-8] - 32..56 bytes copied */
8554 - .quad .Ld6,.Ls6e
8555 - .quad .Ld7,.Ls7e
8556 - .quad .Ld8,.Ls8e
8557 -@@ -172,11 +172,8 @@ ENTRY(__copy_user_nocache)
8558 - .quad .Le5,.Le_zero
8559 - .previous
8560 -
8561 -- /* compute 64-offset for main loop. 8 bytes accuracy with error on the
8562 -- pessimistic side. this is gross. it would be better to fix the
8563 -- interface. */
8564 - /* eax: zero, ebx: 64 */
8565 --.Ls1e: addl $8,%eax
8566 -+.Ls1e: addl $8,%eax /* eax: bytes left uncopied: Ls1e: 64 .. Ls8e: 8 */
8567 - .Ls2e: addl $8,%eax
8568 - .Ls3e: addl $8,%eax
8569 - .Ls4e: addl $8,%eax
8570 -diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
8571 -index 3bc0c67..225e88c 100644
8572 ---- a/drivers/acpi/tables/tbinstal.c
8573 -+++ b/drivers/acpi/tables/tbinstal.c
8574 -@@ -123,17 +123,13 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
8575 - }
8576 - }
8577 -
8578 -- /* The table must be either an SSDT or a PSDT or an OEMx */
8579 --
8580 -- if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT))
8581 -- &&
8582 -- (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
8583 -- && (strncmp(table_desc->pointer->signature, "OEM", 3))) {
8584 -- ACPI_ERROR((AE_INFO,
8585 -- "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx",
8586 -- table_desc->pointer->signature));
8587 -- return_ACPI_STATUS(AE_BAD_SIGNATURE);
8588 -- }
8589 -+ /*
8590 -+ * Originally, we checked the table signature for "SSDT" or "PSDT" here.
8591 -+ * Next, we added support for OEMx tables, signature "OEM".
8592 -+ * Valid tables were encountered with a null signature, so we've just
8593 -+ * given up on validating the signature, since it seems to be a waste
8594 -+ * of code. The original code was removed (05/2008).
8595 -+ */
8596 -
8597 - (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
8598 -
8599 -diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
8600 -index 46e8748..3eecbd4 100644
8601 ---- a/drivers/ide/pci/opti621.c
8602 -+++ b/drivers/ide/pci/opti621.c
8603 -@@ -103,18 +103,6 @@
8604 - * address: 50 ns, data: 50 ns, recovery: 100 ns.
8605 - */
8606 -
8607 --/* #define READ_PREFETCH 0 */
8608 --/* Uncomment for disable read prefetch.
8609 -- * There is some readprefetch capatibility in hdparm,
8610 -- * but when I type hdparm -P 1 /dev/hda, I got errors
8611 -- * and till reset drive is inaccessible.
8612 -- * This (hw) read prefetch is safe on my drive.
8613 -- */
8614 --
8615 --#ifndef READ_PREFETCH
8616 --#define READ_PREFETCH 0x40 /* read prefetch is enabled */
8617 --#endif /* else read prefetch is disabled */
8618 --
8619 - #define READ_REG 0 /* index of Read cycle timing register */
8620 - #define WRITE_REG 1 /* index of Write cycle timing register */
8621 - #define CNTRL_REG 3 /* index of Control register */
8622 -@@ -260,7 +248,8 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
8623 -
8624 - cycle1 = ((first.data_time-1)<<4) | (first.recovery_time-2);
8625 - cycle2 = ((second.data_time-1)<<4) | (second.recovery_time-2);
8626 -- misc = READ_PREFETCH | ((ax-1)<<4) | ((drdy-2)<<1);
8627 -+
8628 -+ misc = ((ax - 1) << 4) | ((drdy - 2) << 1);
8629 -
8630 - #ifdef OPTI621_DEBUG
8631 - printk("%s: master: address: %d, data: %d, "
8632 -@@ -335,20 +324,16 @@ static const struct ide_port_info opti621_chipsets[] __devinitdata = {
8633 - .name = "OPTI621",
8634 - .init_hwif = init_hwif_opti621,
8635 - .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
8636 -- .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
8637 -+ .host_flags = IDE_HFLAG_NO_DMA |
8638 - IDE_HFLAG_BOOTABLE,
8639 - .pio_mask = ATA_PIO3,
8640 -- .swdma_mask = ATA_SWDMA2,
8641 -- .mwdma_mask = ATA_MWDMA2,
8642 - },{ /* 1 */
8643 - .name = "OPTI621X",
8644 - .init_hwif = init_hwif_opti621,
8645 - .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
8646 -- .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
8647 -+ .host_flags = IDE_HFLAG_NO_DMA |
8648 - IDE_HFLAG_BOOTABLE,
8649 - .pio_mask = ATA_PIO3,
8650 -- .swdma_mask = ATA_SWDMA2,
8651 -- .mwdma_mask = ATA_MWDMA2,
8652 - }
8653 - };
8654 -
8655 -diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
8656 -index 555b70c..2d31587 100644
8657 ---- a/drivers/net/virtio_net.c
8658 -+++ b/drivers/net/virtio_net.c
8659 -@@ -83,9 +83,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
8660 - BUG_ON(len > MAX_PACKET_LEN);
8661 -
8662 - skb_trim(skb, len);
8663 -- skb->protocol = eth_type_trans(skb, dev);
8664 -- pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
8665 -- ntohs(skb->protocol), skb->len, skb->pkt_type);
8666 -+
8667 - dev->stats.rx_bytes += skb->len;
8668 - dev->stats.rx_packets++;
8669 -
8670 -@@ -95,6 +93,10 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
8671 - goto frame_err;
8672 - }
8673 -
8674 -+ skb->protocol = eth_type_trans(skb, dev);
8675 -+ pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
8676 -+ ntohs(skb->protocol), skb->len, skb->pkt_type);
8677 -+
8678 - if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
8679 - pr_debug("GSO!\n");
8680 - switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
8681 -diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
8682 -index 44ebdea..b14087b 100644
8683 ---- a/drivers/net/wireless/b43/b43.h
8684 -+++ b/drivers/net/wireless/b43/b43.h
8685 -@@ -596,7 +596,6 @@ struct b43_dma {
8686 -
8687 - /* Context information for a noise calculation (Link Quality). */
8688 - struct b43_noise_calculation {
8689 -- u8 channel_at_start;
8690 - bool calculation_running;
8691 - u8 nr_samples;
8692 - s8 samples[8][4];
8693 -diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
8694 -index 4ec1915..f74dba2 100644
8695 ---- a/drivers/net/wireless/b43/dma.c
8696 -+++ b/drivers/net/wireless/b43/dma.c
8697 -@@ -850,6 +850,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
8698 - if (!ring)
8699 - goto out;
8700 - ring->type = type;
8701 -+ ring->dev = dev;
8702 -
8703 - nr_slots = B43_RXRING_SLOTS;
8704 - if (for_tx)
8705 -@@ -901,7 +902,6 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
8706 - DMA_TO_DEVICE);
8707 - }
8708 -
8709 -- ring->dev = dev;
8710 - ring->nr_slots = nr_slots;
8711 - ring->mmio_base = b43_dmacontroller_base(type, controller_index);
8712 - ring->index = controller_index;
8713 -diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
8714 -index 6966eec..b4a2042 100644
8715 ---- a/drivers/net/wireless/b43/main.c
8716 -+++ b/drivers/net/wireless/b43/main.c
8717 -@@ -1027,7 +1027,6 @@ static void b43_generate_noise_sample(struct b43_wldev *dev)
8718 - b43_jssi_write(dev, 0x7F7F7F7F);
8719 - b43_write32(dev, B43_MMIO_MACCMD,
8720 - b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE);
8721 -- B43_WARN_ON(dev->noisecalc.channel_at_start != dev->phy.channel);
8722 - }
8723 -
8724 - static void b43_calculate_link_quality(struct b43_wldev *dev)
8725 -@@ -1036,7 +1035,6 @@ static void b43_calculate_link_quality(struct b43_wldev *dev)
8726 -
8727 - if (dev->noisecalc.calculation_running)
8728 - return;
8729 -- dev->noisecalc.channel_at_start = dev->phy.channel;
8730 - dev->noisecalc.calculation_running = 1;
8731 - dev->noisecalc.nr_samples = 0;
8732 -
8733 -@@ -1053,9 +1051,16 @@ static void handle_irq_noise(struct b43_wldev *dev)
8734 -
8735 - /* Bottom half of Link Quality calculation. */
8736 -
8737 -+ /* Possible race condition: It might be possible that the user
8738 -+ * changed to a different channel in the meantime since we
8739 -+ * started the calculation. We ignore that fact, since it's
8740 -+ * not really that much of a problem. The background noise is
8741 -+ * an estimation only anyway. Slightly wrong results will get damped
8742 -+ * by the averaging of the 8 sample rounds. Additionally the
8743 -+ * value is shortlived. So it will be replaced by the next noise
8744 -+ * calculation round soon. */
8745 -+
8746 - B43_WARN_ON(!dev->noisecalc.calculation_running);
8747 -- if (dev->noisecalc.channel_at_start != phy->channel)
8748 -- goto drop_calculation;
8749 - *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev));
8750 - if (noise[0] == 0x7F || noise[1] == 0x7F ||
8751 - noise[2] == 0x7F || noise[3] == 0x7F)
8752 -@@ -1096,11 +1101,10 @@ static void handle_irq_noise(struct b43_wldev *dev)
8753 - average -= 48;
8754 -
8755 - dev->stats.link_noise = average;
8756 -- drop_calculation:
8757 - dev->noisecalc.calculation_running = 0;
8758 - return;
8759 - }
8760 -- generate_new:
8761 -+generate_new:
8762 - b43_generate_noise_sample(dev);
8763 - }
8764 -
8765 -diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
8766 -index ed7e0a1..079c733 100644
8767 ---- a/drivers/scsi/hosts.c
8768 -+++ b/drivers/scsi/hosts.c
8769 -@@ -455,9 +455,10 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
8770 - struct Scsi_Host *shost = ERR_PTR(-ENXIO);
8771 -
8772 - cdev = class_find_child(&shost_class, &hostnum, __scsi_host_match);
8773 -- if (cdev)
8774 -+ if (cdev) {
8775 - shost = scsi_host_get(class_to_shost(cdev));
8776 --
8777 -+ class_device_put(cdev);
8778 -+ }
8779 - return shost;
8780 - }
8781 - EXPORT_SYMBOL(scsi_host_lookup);
8782 -diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
8783 -index 7ee86d4..c82df8b 100644
8784 ---- a/drivers/scsi/sr.c
8785 -+++ b/drivers/scsi/sr.c
8786 -@@ -178,6 +178,9 @@ int sr_test_unit_ready(struct scsi_device *sdev, struct scsi_sense_hdr *sshdr)
8787 - the_result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL,
8788 - 0, sshdr, SR_TIMEOUT,
8789 - retries--);
8790 -+ if (scsi_sense_valid(sshdr) &&
8791 -+ sshdr->sense_key == UNIT_ATTENTION)
8792 -+ sdev->changed = 1;
8793 -
8794 - } while (retries > 0 &&
8795 - (!scsi_status_is_good(the_result) ||
8796 -diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
8797 -index 77f7a7f..d60705e 100644
8798 ---- a/drivers/serial/8250.c
8799 -+++ b/drivers/serial/8250.c
8800 -@@ -2174,7 +2174,9 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
8801 - }
8802 - serial8250_set_mctrl(&up->port, up->port.mctrl);
8803 - spin_unlock_irqrestore(&up->port.lock, flags);
8804 -- tty_termios_encode_baud_rate(termios, baud, baud);
8805 -+ /* Don't rewrite B0 */
8806 -+ if (tty_termios_baud_rate(termios))
8807 -+ tty_termios_encode_baud_rate(termios, baud, baud);
8808 - }
8809 -
8810 - static void
8811 -diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
8812 -index 4147de6..8785784 100644
8813 ---- a/net/netfilter/nf_conntrack_core.c
8814 -+++ b/net/netfilter/nf_conntrack_core.c
8815 -@@ -199,8 +199,6 @@ destroy_conntrack(struct nf_conntrack *nfct)
8816 - if (l4proto && l4proto->destroy)
8817 - l4proto->destroy(ct);
8818 -
8819 -- nf_ct_ext_destroy(ct);
8820 --
8821 - rcu_read_unlock();
8822 -
8823 - spin_lock_bh(&nf_conntrack_lock);
8824 -@@ -523,6 +521,7 @@ static void nf_conntrack_free_rcu(struct rcu_head *head)
8825 -
8826 - void nf_conntrack_free(struct nf_conn *ct)
8827 - {
8828 -+ nf_ct_ext_destroy(ct);
8829 - call_rcu(&ct->rcu, nf_conntrack_free_rcu);
8830 - }
8831 - EXPORT_SYMBOL_GPL(nf_conntrack_free);
8832 -diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
8833 -index 898f192..7407dd3 100644
8834 ---- a/net/netfilter/nf_conntrack_h323_main.c
8835 -+++ b/net/netfilter/nf_conntrack_h323_main.c
8836 -@@ -617,6 +617,7 @@ static struct nf_conntrack_helper nf_conntrack_helper_h245 __read_mostly = {
8837 - .me = THIS_MODULE,
8838 - .max_expected = H323_RTP_CHANNEL_MAX * 4 + 2 /* T.120 */,
8839 - .timeout = 240,
8840 -+ .tuple.src.l3num = AF_UNSPEC,
8841 - .tuple.dst.protonum = IPPROTO_UDP,
8842 - .help = h245_help
8843 - };
8844 -@@ -1758,6 +1759,7 @@ static void __exit nf_conntrack_h323_fini(void)
8845 - nf_conntrack_helper_unregister(&nf_conntrack_helper_ras[0]);
8846 - nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[1]);
8847 - nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[0]);
8848 -+ nf_conntrack_helper_unregister(&nf_conntrack_helper_h245);
8849 - kfree(h323_buffer);
8850 - pr_debug("nf_ct_h323: fini\n");
8851 - }
8852 -@@ -1770,28 +1772,34 @@ static int __init nf_conntrack_h323_init(void)
8853 - h323_buffer = kmalloc(65536, GFP_KERNEL);
8854 - if (!h323_buffer)
8855 - return -ENOMEM;
8856 -- ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[0]);
8857 -+ ret = nf_conntrack_helper_register(&nf_conntrack_helper_h245);
8858 - if (ret < 0)
8859 - goto err1;
8860 -- ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[1]);
8861 -+ ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[0]);
8862 - if (ret < 0)
8863 - goto err2;
8864 -- ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[0]);
8865 -+ ret = nf_conntrack_helper_register(&nf_conntrack_helper_q931[1]);
8866 - if (ret < 0)
8867 - goto err3;
8868 -- ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[1]);
8869 -+ ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[0]);
8870 - if (ret < 0)
8871 - goto err4;
8872 -+ ret = nf_conntrack_helper_register(&nf_conntrack_helper_ras[1]);
8873 -+ if (ret < 0)
8874 -+ goto err5;
8875 - pr_debug("nf_ct_h323: init success\n");
8876 - return 0;
8877 -
8878 --err4:
8879 -+err5:
8880 - nf_conntrack_helper_unregister(&nf_conntrack_helper_ras[0]);
8881 --err3:
8882 -+err4:
8883 - nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[1]);
8884 --err2:
8885 -+err3:
8886 - nf_conntrack_helper_unregister(&nf_conntrack_helper_q931[0]);
8887 -+err2:
8888 -+ nf_conntrack_helper_unregister(&nf_conntrack_helper_h245);
8889 - err1:
8890 -+ kfree(h323_buffer);
8891 - return ret;
8892 - }
8893 -
8894
8895 Deleted: genpatches-2.6/trunk/2.6.26/1008_linux-2.6.25.9.patch
8896 ===================================================================
8897 --- genpatches-2.6/trunk/2.6.26/1008_linux-2.6.25.9.patch 2008-07-17 02:44:10 UTC (rev 1328)
8898 +++ genpatches-2.6/trunk/2.6.26/1008_linux-2.6.25.9.patch 2008-07-17 02:47:50 UTC (rev 1329)
8899 @@ -1,426 +0,0 @@
8900 -diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
8901 -index d3437c4..e3b2185 100644
8902 ---- a/arch/powerpc/kernel/vdso.c
8903 -+++ b/arch/powerpc/kernel/vdso.c
8904 -@@ -141,7 +141,7 @@ static void dump_one_vdso_page(struct page *pg, struct page *upg)
8905 - printk("kpg: %p (c:%d,f:%08lx)", __va(page_to_pfn(pg) << PAGE_SHIFT),
8906 - page_count(pg),
8907 - pg->flags);
8908 -- if (upg/* && pg != upg*/) {
8909 -+ if (upg && !IS_ERR(upg) /* && pg != upg*/) {
8910 - printk(" upg: %p (c:%d,f:%08lx)", __va(page_to_pfn(upg)
8911 - << PAGE_SHIFT),
8912 - page_count(upg),
8913 -diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
8914 -index 2b3e5d4..9ac056b 100644
8915 ---- a/arch/x86/kernel/setup_32.c
8916 -+++ b/arch/x86/kernel/setup_32.c
8917 -@@ -483,10 +483,16 @@ static void __init reserve_crashkernel(void)
8918 - (unsigned long)(crash_size >> 20),
8919 - (unsigned long)(crash_base >> 20),
8920 - (unsigned long)(total_mem >> 20));
8921 -+
8922 -+ if (reserve_bootmem(crash_base, crash_size,
8923 -+ BOOTMEM_EXCLUSIVE) < 0) {
8924 -+ printk(KERN_INFO "crashkernel reservation "
8925 -+ "failed - memory is in use\n");
8926 -+ return;
8927 -+ }
8928 -+
8929 - crashk_res.start = crash_base;
8930 - crashk_res.end = crash_base + crash_size - 1;
8931 -- reserve_bootmem(crash_base, crash_size,
8932 -- BOOTMEM_DEFAULT);
8933 - } else
8934 - printk(KERN_INFO "crashkernel reservation failed - "
8935 - "you have to specify a base address\n");
8936 -diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c
8937 -index 9587869..8396e0f 100644
8938 ---- a/drivers/hwmon/adt7473.c
8939 -+++ b/drivers/hwmon/adt7473.c
8940 -@@ -309,6 +309,9 @@ no_sensor_update:
8941 - ADT7473_REG_PWM_BHVR(i));
8942 - }
8943 -
8944 -+ i = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4);
8945 -+ data->max_duty_at_overheat = !!(i & ADT7473_CFG4_MAX_DUTY_AT_OVT);
8946 -+
8947 - data->limits_last_updated = local_jiffies;
8948 - data->limits_valid = 1;
8949 -
8950 -diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
8951 -index 182fe6a..30bdd50 100644
8952 ---- a/drivers/hwmon/lm85.c
8953 -+++ b/drivers/hwmon/lm85.c
8954 -@@ -192,7 +192,7 @@ static int RANGE_TO_REG( int range )
8955 - {
8956 - int i;
8957 -
8958 -- if ( range < lm85_range_map[0] ) {
8959 -+ if (range <= lm85_range_map[0]) {
8960 - return 0 ;
8961 - } else if ( range > lm85_range_map[15] ) {
8962 - return 15 ;
8963 -diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c
8964 -index 9d3bd22..a965f68 100644
8965 ---- a/drivers/net/atl1/atl1_hw.c
8966 -+++ b/drivers/net/atl1/atl1_hw.c
8967 -@@ -250,7 +250,6 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
8968 - memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
8969 - return 0;
8970 - }
8971 -- return 1;
8972 - }
8973 -
8974 - /* see if SPI FLAGS exist ? */
8975 -diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
8976 -index 6483d10..2b756ef 100644
8977 ---- a/drivers/watchdog/hpwdt.c
8978 -+++ b/drivers/watchdog/hpwdt.c
8979 -@@ -140,49 +140,52 @@ static struct pci_device_id hpwdt_devices[] = {
8980 - };
8981 - MODULE_DEVICE_TABLE(pci, hpwdt_devices);
8982 -
8983 -+extern asmlinkage void asminline_call(struct cmn_registers *pi86Regs, unsigned long *pRomEntry);
8984 -+
8985 - #ifndef CONFIG_X86_64
8986 - /* --32 Bit Bios------------------------------------------------------------ */
8987 -
8988 - #define HPWDT_ARCH 32
8989 -
8990 --static void asminline_call(struct cmn_registers *pi86Regs,
8991 -- unsigned long *pRomEntry)
8992 --{
8993 -- asm("pushl %ebp \n\t"
8994 -- "movl %esp, %ebp \n\t"
8995 -- "pusha \n\t"
8996 -- "pushf \n\t"
8997 -- "push %es \n\t"
8998 -- "push %ds \n\t"
8999 -- "pop %es \n\t"
9000 -- "movl 8(%ebp),%eax \n\t"
9001 -- "movl 4(%eax),%ebx \n\t"
9002 -- "movl 8(%eax),%ecx \n\t"
9003 -- "movl 12(%eax),%edx \n\t"
9004 -- "movl 16(%eax),%esi \n\t"
9005 -- "movl 20(%eax),%edi \n\t"
9006 -- "movl (%eax),%eax \n\t"
9007 -- "push %cs \n\t"
9008 -- "call *12(%ebp) \n\t"
9009 -- "pushf \n\t"
9010 -- "pushl %eax \n\t"
9011 -- "movl 8(%ebp),%eax \n\t"
9012 -- "movl %ebx,4(%eax) \n\t"
9013 -- "movl %ecx,8(%eax) \n\t"
9014 -- "movl %edx,12(%eax) \n\t"
9015 -- "movl %esi,16(%eax) \n\t"
9016 -- "movl %edi,20(%eax) \n\t"
9017 -- "movw %ds,24(%eax) \n\t"
9018 -- "movw %es,26(%eax) \n\t"
9019 -- "popl %ebx \n\t"
9020 -- "movl %ebx,(%eax) \n\t"
9021 -- "popl %ebx \n\t"
9022 -- "movl %ebx,28(%eax) \n\t"
9023 -- "pop %es \n\t"
9024 -- "popf \n\t"
9025 -- "popa \n\t"
9026 -- "leave \n\t" "ret");
9027 --}
9028 -+asm(".text \n\t"
9029 -+ ".align 4 \n"
9030 -+ "asminline_call: \n\t"
9031 -+ "pushl %ebp \n\t"
9032 -+ "movl %esp, %ebp \n\t"
9033 -+ "pusha \n\t"
9034 -+ "pushf \n\t"
9035 -+ "push %es \n\t"
9036 -+ "push %ds \n\t"
9037 -+ "pop %es \n\t"
9038 -+ "movl 8(%ebp),%eax \n\t"
9039 -+ "movl 4(%eax),%ebx \n\t"
9040 -+ "movl 8(%eax),%ecx \n\t"
9041 -+ "movl 12(%eax),%edx \n\t"
9042 -+ "movl 16(%eax),%esi \n\t"
9043 -+ "movl 20(%eax),%edi \n\t"
9044 -+ "movl (%eax),%eax \n\t"
9045 -+ "push %cs \n\t"
9046 -+ "call *12(%ebp) \n\t"
9047 -+ "pushf \n\t"
9048 -+ "pushl %eax \n\t"
9049 -+ "movl 8(%ebp),%eax \n\t"
9050 -+ "movl %ebx,4(%eax) \n\t"
9051 -+ "movl %ecx,8(%eax) \n\t"
9052 -+ "movl %edx,12(%eax) \n\t"
9053 -+ "movl %esi,16(%eax) \n\t"
9054 -+ "movl %edi,20(%eax) \n\t"
9055 -+ "movw %ds,24(%eax) \n\t"
9056 -+ "movw %es,26(%eax) \n\t"
9057 -+ "popl %ebx \n\t"
9058 -+ "movl %ebx,(%eax) \n\t"
9059 -+ "popl %ebx \n\t"
9060 -+ "movl %ebx,28(%eax) \n\t"
9061 -+ "pop %es \n\t"
9062 -+ "popf \n\t"
9063 -+ "popa \n\t"
9064 -+ "leave \n\t"
9065 -+ "ret \n\t"
9066 -+ ".previous");
9067 -
9068 - /*
9069 - * cru_detect
9070 -@@ -333,43 +336,44 @@ static int __devinit detect_cru_service(void)
9071 -
9072 - #define HPWDT_ARCH 64
9073 -
9074 --static void asminline_call(struct cmn_registers *pi86Regs,
9075 -- unsigned long *pRomEntry)
9076 --{
9077 -- asm("pushq %rbp \n\t"
9078 -- "movq %rsp, %rbp \n\t"
9079 -- "pushq %rax \n\t"
9080 -- "pushq %rbx \n\t"
9081 -- "pushq %rdx \n\t"
9082 -- "pushq %r12 \n\t"
9083 -- "pushq %r9 \n\t"
9084 -- "movq %rsi, %r12 \n\t"
9085 -- "movq %rdi, %r9 \n\t"
9086 -- "movl 4(%r9),%ebx \n\t"
9087 -- "movl 8(%r9),%ecx \n\t"
9088 -- "movl 12(%r9),%edx \n\t"
9089 -- "movl 16(%r9),%esi \n\t"
9090 -- "movl 20(%r9),%edi \n\t"
9091 -- "movl (%r9),%eax \n\t"
9092 -- "call *%r12 \n\t"
9093 -- "pushfq \n\t"
9094 -- "popq %r12 \n\t"
9095 -- "popfq \n\t"
9096 -- "movl %eax, (%r9) \n\t"
9097 -- "movl %ebx, 4(%r9) \n\t"
9098 -- "movl %ecx, 8(%r9) \n\t"
9099 -- "movl %edx, 12(%r9) \n\t"
9100 -- "movl %esi, 16(%r9) \n\t"
9101 -- "movl %edi, 20(%r9) \n\t"
9102 -- "movq %r12, %rax \n\t"
9103 -- "movl %eax, 28(%r9) \n\t"
9104 -- "popq %r9 \n\t"
9105 -- "popq %r12 \n\t"
9106 -- "popq %rdx \n\t"
9107 -- "popq %rbx \n\t"
9108 -- "popq %rax \n\t"
9109 -- "leave \n\t" "ret");
9110 --}
9111 -+asm(".text \n\t"
9112 -+ ".align 4 \n"
9113 -+ "asminline_call: \n\t"
9114 -+ "pushq %rbp \n\t"
9115 -+ "movq %rsp, %rbp \n\t"
9116 -+ "pushq %rax \n\t"
9117 -+ "pushq %rbx \n\t"
9118 -+ "pushq %rdx \n\t"
9119 -+ "pushq %r12 \n\t"
9120 -+ "pushq %r9 \n\t"
9121 -+ "movq %rsi, %r12 \n\t"
9122 -+ "movq %rdi, %r9 \n\t"
9123 -+ "movl 4(%r9),%ebx \n\t"
9124 -+ "movl 8(%r9),%ecx \n\t"
9125 -+ "movl 12(%r9),%edx \n\t"
9126 -+ "movl 16(%r9),%esi \n\t"
9127 -+ "movl 20(%r9),%edi \n\t"
9128 -+ "movl (%r9),%eax \n\t"
9129 -+ "call *%r12 \n\t"
9130 -+ "pushfq \n\t"
9131 -+ "popq %r12 \n\t"
9132 -+ "popfq \n\t"
9133 -+ "movl %eax, (%r9) \n\t"
9134 -+ "movl %ebx, 4(%r9) \n\t"
9135 -+ "movl %ecx, 8(%r9) \n\t"
9136 -+ "movl %edx, 12(%r9) \n\t"
9137 -+ "movl %esi, 16(%r9) \n\t"
9138 -+ "movl %edi, 20(%r9) \n\t"
9139 -+ "movq %r12, %rax \n\t"
9140 -+ "movl %eax, 28(%r9) \n\t"
9141 -+ "popq %r9 \n\t"
9142 -+ "popq %r12 \n\t"
9143 -+ "popq %rdx \n\t"
9144 -+ "popq %rbx \n\t"
9145 -+ "popq %rax \n\t"
9146 -+ "leave \n\t"
9147 -+ "ret \n\t"
9148 -+ ".previous");
9149 -
9150 - /*
9151 - * dmi_find_cru
9152 -diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h
9153 -index 5f7257f..8f8085b 100644
9154 ---- a/include/asm-x86/page_32.h
9155 -+++ b/include/asm-x86/page_32.h
9156 -@@ -14,7 +14,8 @@
9157 - #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
9158 -
9159 - #ifdef CONFIG_X86_PAE
9160 --#define __PHYSICAL_MASK_SHIFT 36
9161 -+/* 44=32+12, the limit we can fit into an unsigned long pfn */
9162 -+#define __PHYSICAL_MASK_SHIFT 44
9163 - #define __VIRTUAL_MASK_SHIFT 32
9164 - #define PAGETABLE_LEVELS 3
9165 -
9166 -diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
9167 -index 4e4e340..db3d837 100644
9168 ---- a/include/linux/bootmem.h
9169 -+++ b/include/linux/bootmem.h
9170 -@@ -94,7 +94,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
9171 - unsigned long freepfn,
9172 - unsigned long startpfn,
9173 - unsigned long endpfn);
9174 --extern void reserve_bootmem_node(pg_data_t *pgdat,
9175 -+extern int reserve_bootmem_node(pg_data_t *pgdat,
9176 - unsigned long physaddr,
9177 - unsigned long size,
9178 - int flags);
9179 -diff --git a/mm/bootmem.c b/mm/bootmem.c
9180 -index 2ccea70..8bb58da 100644
9181 ---- a/mm/bootmem.c
9182 -+++ b/mm/bootmem.c
9183 -@@ -398,10 +398,10 @@ unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn,
9184 - return init_bootmem_core(pgdat, freepfn, startpfn, endpfn);
9185 - }
9186 -
9187 --void __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
9188 -+int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
9189 - unsigned long size, int flags)
9190 - {
9191 -- reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);
9192 -+ return reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);
9193 - }
9194 -
9195 - void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
9196 -diff --git a/mm/memory.c b/mm/memory.c
9197 -index 0d14d1e..df84668 100644
9198 ---- a/mm/memory.c
9199 -+++ b/mm/memory.c
9200 -@@ -943,17 +943,15 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
9201 - }
9202 -
9203 - ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
9204 -- if (!ptep)
9205 -- goto out;
9206 -
9207 - pte = *ptep;
9208 - if (!pte_present(pte))
9209 -- goto unlock;
9210 -+ goto no_page;
9211 - if ((flags & FOLL_WRITE) && !pte_write(pte))
9212 - goto unlock;
9213 - page = vm_normal_page(vma, address, pte);
9214 - if (unlikely(!page))
9215 -- goto unlock;
9216 -+ goto bad_page;
9217 -
9218 - if (flags & FOLL_GET)
9219 - get_page(page);
9220 -@@ -968,6 +966,15 @@ unlock:
9221 - out:
9222 - return page;
9223 -
9224 -+bad_page:
9225 -+ pte_unmap_unlock(ptep, ptl);
9226 -+ return ERR_PTR(-EFAULT);
9227 -+
9228 -+no_page:
9229 -+ pte_unmap_unlock(ptep, ptl);
9230 -+ if (!pte_none(pte))
9231 -+ return page;
9232 -+ /* Fall through to ZERO_PAGE handling */
9233 - no_page_table:
9234 - /*
9235 - * When core dumping an enormous anonymous area that nobody
9236 -@@ -982,6 +989,26 @@ no_page_table:
9237 - return page;
9238 - }
9239 -
9240 -+/* Can we do the FOLL_ANON optimization? */
9241 -+static inline int use_zero_page(struct vm_area_struct *vma)
9242 -+{
9243 -+ /*
9244 -+ * We don't want to optimize FOLL_ANON for make_pages_present()
9245 -+ * when it tries to page in a VM_LOCKED region. As to VM_SHARED,
9246 -+ * we want to get the page from the page tables to make sure
9247 -+ * that we serialize and update with any other user of that
9248 -+ * mapping.
9249 -+ */
9250 -+ if (vma->vm_flags & (VM_LOCKED | VM_SHARED))
9251 -+ return 0;
9252 -+ /*
9253 -+ * And if we have a fault or a nopfn routine, it's not an
9254 -+ * anonymous region.
9255 -+ */
9256 -+ return !vma->vm_ops ||
9257 -+ (!vma->vm_ops->fault && !vma->vm_ops->nopfn);
9258 -+}
9259 -+
9260 - int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
9261 - unsigned long start, int len, int write, int force,
9262 - struct page **pages, struct vm_area_struct **vmas)
9263 -@@ -1056,9 +1083,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
9264 - foll_flags = FOLL_TOUCH;
9265 - if (pages)
9266 - foll_flags |= FOLL_GET;
9267 -- if (!write && !(vma->vm_flags & VM_LOCKED) &&
9268 -- (!vma->vm_ops || (!vma->vm_ops->nopage &&
9269 -- !vma->vm_ops->fault)))
9270 -+ if (!write && use_zero_page(vma))
9271 - foll_flags |= FOLL_ANON;
9272 -
9273 - do {
9274 -@@ -1104,6 +1129,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
9275 -
9276 - cond_resched();
9277 - }
9278 -+ if (IS_ERR(page))
9279 -+ return i ? i : PTR_ERR(page);
9280 - if (pages) {
9281 - pages[i] = page;
9282 -
9283 -diff --git a/mm/migrate.c b/mm/migrate.c
9284 -index 4e0eccc..6acc815 100644
9285 ---- a/mm/migrate.c
9286 -+++ b/mm/migrate.c
9287 -@@ -858,6 +858,11 @@ static int do_move_pages(struct mm_struct *mm, struct page_to_node *pm,
9288 - goto set_status;
9289 -
9290 - page = follow_page(vma, pp->addr, FOLL_GET);
9291 -+
9292 -+ err = PTR_ERR(page);
9293 -+ if (IS_ERR(page))
9294 -+ goto set_status;
9295 -+
9296 - err = -ENOENT;
9297 - if (!page)
9298 - goto set_status;
9299 -@@ -921,6 +926,11 @@ static int do_pages_stat(struct mm_struct *mm, struct page_to_node *pm)
9300 - goto set_status;
9301 -
9302 - page = follow_page(vma, pm->addr, 0);
9303 -+
9304 -+ err = PTR_ERR(page);
9305 -+ if (IS_ERR(page))
9306 -+ goto set_status;
9307 -+
9308 - err = -ENOENT;
9309 - /* Use PageReserved to check for zero page */
9310 - if (!page || PageReserved(page))
9311 -diff --git a/net/sctp/socket.c b/net/sctp/socket.c
9312 -index 998e63a..2d42260 100644
9313 ---- a/net/sctp/socket.c
9314 -+++ b/net/sctp/socket.c
9315 -@@ -4421,7 +4421,9 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len,
9316 - if (copy_from_user(&getaddrs, optval, len))
9317 - return -EFAULT;
9318 -
9319 -- if (getaddrs.addr_num <= 0) return -EINVAL;
9320 -+ if (getaddrs.addr_num <= 0 ||
9321 -+ getaddrs.addr_num >= (INT_MAX / sizeof(union sctp_addr)))
9322 -+ return -EINVAL;
9323 - /*
9324 - * For UDP-style sockets, id specifies the association to query.
9325 - * If the id field is set to the value '0' then the locally bound
9326
9327 Deleted: genpatches-2.6/trunk/2.6.26/2705_alsa-hda-fujitsu.patch
9328 ===================================================================
9329 --- genpatches-2.6/trunk/2.6.26/2705_alsa-hda-fujitsu.patch 2008-07-17 02:44:10 UTC (rev 1328)
9330 +++ genpatches-2.6/trunk/2.6.26/2705_alsa-hda-fujitsu.patch 2008-07-17 02:47:50 UTC (rev 1329)
9331 @@ -1,75 +0,0 @@
9332 -
9333 -From: Tony Vroon <chainsaw@g.o>
9334 -
9335 -Applied in ALSA upstream, queued for 2.6.25
9336 -
9337 ---- a/sound/pci/hda/patch_realtek.c.orig 2008-04-12 13:40:33.000000000 +0100
9338 -+++ b/sound/pci/hda/patch_realtek.c 2008-04-12 13:40:40.000000000 +0100
9339 -@@ -7939,7 +7939,8 @@
9340 -
9341 - /*
9342 - * fujitsu model
9343 -- * 0x14 = headphone/spdif-out, 0x15 = internal speaker
9344 -+ * 0x14 = headphone/spdif-out, 0x15 = internal speaker,
9345 -+ * 0x1b = port replicator headphone out
9346 - */
9347 -
9348 - #define ALC_HP_EVENT 0x37
9349 -@@ -7947,6 +7948,8 @@
9350 - static struct hda_verb alc262_fujitsu_unsol_verbs[] = {
9351 - {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
9352 - {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9353 -+ {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
9354 -+ {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9355 - {}
9356 - };
9357 -
9358 -@@ -7987,12 +7990,16 @@
9359 - unsigned int mute;
9360 -
9361 - if (force || !spec->sense_updated) {
9362 -- unsigned int present;
9363 -+ unsigned int present_int_hp, present_dock_hp;
9364 - /* need to execute and sync at first */
9365 - snd_hda_codec_read(codec, 0x14, 0, AC_VERB_SET_PIN_SENSE, 0);
9366 -- present = snd_hda_codec_read(codec, 0x14, 0,
9367 -+ present_int_hp = snd_hda_codec_read(codec, 0x14, 0,
9368 - AC_VERB_GET_PIN_SENSE, 0);
9369 -- spec->jack_present = (present & 0x80000000) != 0;
9370 -+ snd_hda_codec_read(codec, 0x1B, 0, AC_VERB_SET_PIN_SENSE, 0);
9371 -+ present_dock_hp = snd_hda_codec_read(codec, 0x1b, 0,
9372 -+ AC_VERB_GET_PIN_SENSE, 0);
9373 -+ spec->jack_present = (present_int_hp & 0x80000000) != 0;
9374 -+ spec->jack_present |= (present_dock_hp & 0x80000000) != 0;
9375 - spec->sense_updated = 1;
9376 - }
9377 - if (spec->jack_present) {
9378 -@@ -8034,12 +8041,13 @@
9379 - long *valp = ucontrol->value.integer.value;
9380 - int change;
9381 -
9382 -- change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0,
9383 -- HDA_AMP_MUTE,
9384 -- valp[0] ? 0 : HDA_AMP_MUTE);
9385 -- change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
9386 -- HDA_AMP_MUTE,
9387 -- valp[1] ? 0 : HDA_AMP_MUTE);
9388 -+ change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
9389 -+ HDA_AMP_MUTE,
9390 -+ valp ? 0 : HDA_AMP_MUTE);
9391 -+ change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
9392 -+ HDA_AMP_MUTE,
9393 -+ valp ? 0 : HDA_AMP_MUTE);
9394 -+
9395 - if (change)
9396 - alc262_fujitsu_automute(codec, 0);
9397 - return change;
9398 -@@ -8057,6 +8065,8 @@
9399 - },
9400 - HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
9401 - HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
9402 -+ HDA_CODEC_VOLUME("PC Speaker Volume", 0x0b, 0x05, HDA_INPUT),
9403 -+ HDA_CODEC_MUTE("PC Speaker Switch", 0x0b, 0x05, HDA_INPUT),
9404 - HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
9405 - HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
9406 - HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
9407
9408 Deleted: genpatches-2.6/trunk/2.6.26/2710_ssa7134-tuner-type-setup.patch
9409 ===================================================================
9410 --- genpatches-2.6/trunk/2.6.26/2710_ssa7134-tuner-type-setup.patch 2008-07-17 02:44:10 UTC (rev 1328)
9411 +++ genpatches-2.6/trunk/2.6.26/2710_ssa7134-tuner-type-setup.patch 2008-07-17 02:47:50 UTC (rev 1329)
9412 @@ -1,219 +0,0 @@
9413 -diff -urN linux-2.6.25.10.orig/drivers/media/video/saa7134/saa7134-cards.c linux-2.6.25.10/drivers/media/video/saa7134/saa7134-cards.c
9414 ---- linux-2.6.25.10.orig/drivers/media/video/saa7134/saa7134-cards.c 2008-07-12 09:34:30.000000000 +0200
9415 -+++ linux-2.6.25.10/drivers/media/video/saa7134/saa7134-cards.c 2008-07-12 09:35:22.000000000 +0200
9416 -@@ -50,7 +50,7 @@
9417 - .tuner_type = TUNER_ABSENT,
9418 - .radio_type = UNSET,
9419 - .tuner_addr = ADDR_UNSET,
9420 -- .radio_addr = ADDR_UNSET,
9421 -+ .radio_addr = 0x60,
9422 -
9423 - .inputs = {{
9424 - .name = "default",
9425 -@@ -5176,14 +5176,56 @@
9426 - return 0;
9427 - }
9428 -
9429 -+static void saa7134_tuner_setup(struct saa7134_dev *dev)
9430 -+{
9431 -+ struct tuner_setup tun_setup;
9432 -+ unsigned int mode_mask = T_RADIO |
9433 -+ T_ANALOG_TV |
9434 -+ T_DIGITAL_TV;
9435 -+
9436 -+ memset(&tun_setup, 0, sizeof(tun_setup));
9437 -+ tun_setup.tuner_callback = saa7134_tuner_callback;
9438 -+
9439 -+ if (saa7134_boards[dev->board].radio_type != UNSET) {
9440 -+ tun_setup.type = saa7134_boards[dev->board].radio_type;
9441 -+ tun_setup.addr = saa7134_boards[dev->board].radio_addr;
9442 -+
9443 -+ tun_setup.mode_mask = T_RADIO;
9444 -+
9445 -+ saa7134_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
9446 -+ mode_mask &= ~T_RADIO;
9447 -+ }
9448 -+
9449 -+ if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type != UNSET)) {
9450 -+ tun_setup.type = dev->tuner_type;
9451 -+ tun_setup.addr = dev->tuner_addr;
9452 -+ tun_setup.config = saa7134_boards[dev->board].tuner_config;
9453 -+ tun_setup.tuner_callback = saa7134_tuner_callback;
9454 -+
9455 -+ tun_setup.mode_mask = mode_mask;
9456 -+
9457 -+ saa7134_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
9458 -+ }
9459 -+
9460 -+ if (dev->tda9887_conf) {
9461 -+ struct v4l2_priv_tun_config tda9887_cfg;
9462 -+
9463 -+ tda9887_cfg.tuner = TUNER_TDA9887;
9464 -+ tda9887_cfg.priv = &dev->tda9887_conf;
9465 -+
9466 -+ saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG,
9467 -+ &tda9887_cfg);
9468 -+ }
9469 -+}
9470 -+
9471 - /* stuff which needs working i2c */
9472 - int saa7134_board_init2(struct saa7134_dev *dev)
9473 - {
9474 - unsigned char buf;
9475 - int board;
9476 -- struct tuner_setup tun_setup;
9477 -- tun_setup.config = 0;
9478 -- tun_setup.tuner_callback = saa7134_tuner_callback;
9479 -+
9480 -+ dev->tuner_type = saa7134_boards[dev->board].tuner_type;
9481 -+ dev->tuner_addr = saa7134_boards[dev->board].tuner_addr;
9482 -
9483 - switch (dev->board) {
9484 - case SAA7134_BOARD_BMK_MPEX_NOTUNER:
9485 -@@ -5198,14 +5240,6 @@
9486 - printk("%s: board type fixup: %s\n", dev->name,
9487 - saa7134_boards[dev->board].name);
9488 - dev->tuner_type = saa7134_boards[dev->board].tuner_type;
9489 --
9490 -- if (TUNER_ABSENT != dev->tuner_type) {
9491 -- tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
9492 -- tun_setup.type = dev->tuner_type;
9493 -- tun_setup.addr = ADDR_UNSET;
9494 --
9495 -- saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR, &tun_setup);
9496 -- }
9497 - break;
9498 - case SAA7134_BOARD_MD7134:
9499 - {
9500 -@@ -5261,25 +5295,6 @@
9501 - }
9502 -
9503 - printk(KERN_INFO "%s Tuner type is %d\n", dev->name, dev->tuner_type);
9504 -- if (dev->tuner_type == TUNER_PHILIPS_FMD1216ME_MK3) {
9505 -- struct v4l2_priv_tun_config tda9887_cfg;
9506 --
9507 -- tda9887_cfg.tuner = TUNER_TDA9887;
9508 -- tda9887_cfg.priv = &dev->tda9887_conf;
9509 --
9510 -- dev->tda9887_conf = TDA9887_PRESENT |
9511 -- TDA9887_PORT1_ACTIVE |
9512 -- TDA9887_PORT2_ACTIVE;
9513 --
9514 -- saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG,
9515 -- &tda9887_cfg);
9516 -- }
9517 --
9518 -- tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
9519 -- tun_setup.type = dev->tuner_type;
9520 -- tun_setup.addr = ADDR_UNSET;
9521 --
9522 -- saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup);
9523 - }
9524 - break;
9525 - case SAA7134_BOARD_PHILIPS_EUROPA:
9526 -@@ -5292,12 +5307,6 @@
9527 - u8 data[] = { 0x07, 0x02};
9528 - struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
9529 - i2c_transfer(&dev->i2c_adap, &msg, 1);
9530 --
9531 -- tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
9532 -- tun_setup.type = dev->tuner_type;
9533 -- tun_setup.addr = dev->tuner_addr;
9534 --
9535 -- saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup);
9536 - }
9537 - break;
9538 - case SAA7134_BOARD_PHILIPS_TIGER:
9539 -@@ -5310,14 +5319,18 @@
9540 - printk(KERN_INFO "%s: Reconfigured board as %s\n",
9541 - dev->name, saa7134_boards[dev->board].name);
9542 - }
9543 -- if(dev->board == SAA7134_BOARD_PHILIPS_TIGER_S) {
9544 -- tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
9545 -- tun_setup.type = TUNER_PHILIPS_TDA8290;
9546 -- tun_setup.addr = 0x4b;
9547 -- tun_setup.config = 2;
9548 -+ if (dev->board == SAA7134_BOARD_PHILIPS_TIGER_S) {
9549 -+ dev->tuner_type = TUNER_PHILIPS_TDA8290;
9550 -+
9551 -+ saa7134_tuner_setup(dev);
9552 -
9553 -- saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup);
9554 - data[2] = 0x68;
9555 -+ i2c_transfer(&dev->i2c_adap, &msg, 1);
9556 -+
9557 -+ /* Tuner setup is handled before I2C transfer.
9558 -+ Due to that, there's no need to do it later
9559 -+ */
9560 -+ return 0;
9561 - }
9562 - i2c_transfer(&dev->i2c_adap, &msg, 1);
9563 - }
9564 -@@ -5403,6 +5416,7 @@
9565 - }
9566 - break;
9567 - }
9568 -+ saa7134_tuner_setup(dev);
9569 - return 0;
9570 - }
9571 -
9572 -diff -urN linux-2.6.25.10.orig/drivers/media/video/saa7134/saa7134-i2c.c linux-2.6.25.10/drivers/media/video/saa7134/saa7134-i2c.c
9573 ---- linux-2.6.25.10.orig/drivers/media/video/saa7134/saa7134-i2c.c 2008-07-12 09:34:30.000000000 +0200
9574 -+++ linux-2.6.25.10/drivers/media/video/saa7134/saa7134-i2c.c 2008-07-12 09:35:22.000000000 +0200
9575 -@@ -322,8 +322,6 @@
9576 - static int attach_inform(struct i2c_client *client)
9577 - {
9578 - struct saa7134_dev *dev = client->adapter->algo_data;
9579 -- int tuner = dev->tuner_type;
9580 -- struct tuner_setup tun_setup;
9581 -
9582 - d1printk( "%s i2c attach [addr=0x%x,client=%s]\n",
9583 - client->driver->driver.name, client->addr, client->name);
9584 -@@ -344,46 +342,6 @@
9585 - }
9586 - }
9587 -
9588 -- if (!client->driver->command)
9589 -- return 0;
9590 --
9591 -- if (saa7134_boards[dev->board].radio_type != UNSET) {
9592 --
9593 -- tun_setup.type = saa7134_boards[dev->board].radio_type;
9594 -- tun_setup.addr = saa7134_boards[dev->board].radio_addr;
9595 --
9596 -- if ((tun_setup.addr == ADDR_UNSET) || (tun_setup.addr == client->addr)) {
9597 -- tun_setup.mode_mask = T_RADIO;
9598 --
9599 -- client->driver->command(client, TUNER_SET_TYPE_ADDR, &tun_setup);
9600 -- }
9601 -- }
9602 --
9603 -- if (tuner != UNSET) {
9604 -- tun_setup.type = tuner;
9605 -- tun_setup.addr = saa7134_boards[dev->board].tuner_addr;
9606 -- tun_setup.config = saa7134_boards[dev->board].tuner_config;
9607 -- tun_setup.tuner_callback = saa7134_tuner_callback;
9608 --
9609 -- if ((tun_setup.addr == ADDR_UNSET)||(tun_setup.addr == client->addr)) {
9610 --
9611 -- tun_setup.mode_mask = T_ANALOG_TV;
9612 --
9613 -- client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup);
9614 -- }
9615 --
9616 -- if (tuner == TUNER_TDA9887) {
9617 -- struct v4l2_priv_tun_config tda9887_cfg;
9618 --
9619 -- tda9887_cfg.tuner = TUNER_TDA9887;
9620 -- tda9887_cfg.priv = &dev->tda9887_conf;
9621 --
9622 -- client->driver->command(client, TUNER_SET_CONFIG,
9623 -- &tda9887_cfg);
9624 -- }
9625 -- }
9626 --
9627 --
9628 - return 0;
9629 - }
9630 -
9631 -
9632
9633 --
9634 gentoo-commits@l.g.o mailing list