1 |
Author: dsd |
2 |
Date: 2008-05-02 17:04:07 +0000 (Fri, 02 May 2008) |
3 |
New Revision: 1303 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/2.6.25/1000_linux-2.6.25.1.patch |
7 |
Modified: |
8 |
genpatches-2.6/trunk/2.6.25/0000_README |
9 |
Log: |
10 |
Linux 2.6.25.1 |
11 |
|
12 |
Modified: genpatches-2.6/trunk/2.6.25/0000_README |
13 |
=================================================================== |
14 |
--- genpatches-2.6/trunk/2.6.25/0000_README 2008-05-02 17:03:13 UTC (rev 1302) |
15 |
+++ genpatches-2.6/trunk/2.6.25/0000_README 2008-05-02 17:04:07 UTC (rev 1303) |
16 |
@@ -39,6 +39,10 @@ |
17 |
Individual Patch Descriptions: |
18 |
-------------------------------------------------------------------------- |
19 |
|
20 |
+Patch: 1000_linux-2.6.25.1.patch |
21 |
+From: http://www.kernel.org |
22 |
+Desc: Linux 2.6.25.1 |
23 |
+ |
24 |
Patch: 1700_x86-defconfig.patch |
25 |
From: http://bugs.gentoo.org/215442 |
26 |
Desc: Fix import of default config on i386/x86_64 |
27 |
|
28 |
Added: genpatches-2.6/trunk/2.6.25/1000_linux-2.6.25.1.patch |
29 |
=================================================================== |
30 |
--- genpatches-2.6/trunk/2.6.25/1000_linux-2.6.25.1.patch (rev 0) |
31 |
+++ genpatches-2.6/trunk/2.6.25/1000_linux-2.6.25.1.patch 2008-05-02 17:04:07 UTC (rev 1303) |
32 |
@@ -0,0 +1,1145 @@ |
33 |
+diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c |
34 |
+index 8c71daf..9fee37e 100644 |
35 |
+--- a/arch/alpha/kernel/osf_sys.c |
36 |
++++ b/arch/alpha/kernel/osf_sys.c |
37 |
+@@ -75,6 +75,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len, |
38 |
+ lock_kernel(); |
39 |
+ mm = current->mm; |
40 |
+ mm->end_code = bss_start + bss_len; |
41 |
++ mm->start_brk = bss_start + bss_len; |
42 |
+ mm->brk = bss_start + bss_len; |
43 |
+ #if 0 |
44 |
+ printk("set_program_attributes(%lx %lx %lx %lx)\n", |
45 |
+diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c |
46 |
+index 4ca5486..f239b30 100644 |
47 |
+--- a/arch/x86/kernel/io_apic_32.c |
48 |
++++ b/arch/x86/kernel/io_apic_32.c |
49 |
+@@ -2477,6 +2477,7 @@ void destroy_irq(unsigned int irq) |
50 |
+ dynamic_irq_cleanup(irq); |
51 |
+ |
52 |
+ spin_lock_irqsave(&vector_lock, flags); |
53 |
++ clear_bit(irq_vector[irq], used_vectors); |
54 |
+ irq_vector[irq] = 0; |
55 |
+ spin_unlock_irqrestore(&vector_lock, flags); |
56 |
+ } |
57 |
+diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c |
58 |
+index a871586..579745c 100644 |
59 |
+--- a/arch/x86/pci/irq.c |
60 |
++++ b/arch/x86/pci/irq.c |
61 |
+@@ -200,7 +200,7 @@ static int pirq_ali_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
62 |
+ { |
63 |
+ static const unsigned char irqmap[16] = { 0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15 }; |
64 |
+ |
65 |
+- WARN_ON_ONCE(pirq >= 16); |
66 |
++ WARN_ON_ONCE(pirq > 16); |
67 |
+ return irqmap[read_config_nybble(router, 0x48, pirq-1)]; |
68 |
+ } |
69 |
+ |
70 |
+@@ -209,7 +209,7 @@ static int pirq_ali_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i |
71 |
+ static const unsigned char irqmap[16] = { 0, 8, 0, 2, 4, 5, 7, 6, 0, 1, 3, 9, 11, 0, 13, 15 }; |
72 |
+ unsigned int val = irqmap[irq]; |
73 |
+ |
74 |
+- WARN_ON_ONCE(pirq >= 16); |
75 |
++ WARN_ON_ONCE(pirq > 16); |
76 |
+ if (val) { |
77 |
+ write_config_nybble(router, 0x48, pirq-1, val); |
78 |
+ return 1; |
79 |
+@@ -260,7 +260,7 @@ static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq |
80 |
+ { |
81 |
+ static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; |
82 |
+ |
83 |
+- WARN_ON_ONCE(pirq >= 5); |
84 |
++ WARN_ON_ONCE(pirq > 5); |
85 |
+ return read_config_nybble(router, 0x55, pirqmap[pirq-1]); |
86 |
+ } |
87 |
+ |
88 |
+@@ -268,7 +268,7 @@ static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq |
89 |
+ { |
90 |
+ static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; |
91 |
+ |
92 |
+- WARN_ON_ONCE(pirq >= 5); |
93 |
++ WARN_ON_ONCE(pirq > 5); |
94 |
+ write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); |
95 |
+ return 1; |
96 |
+ } |
97 |
+@@ -282,7 +282,7 @@ static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
98 |
+ { |
99 |
+ static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; |
100 |
+ |
101 |
+- WARN_ON_ONCE(pirq >= 4); |
102 |
++ WARN_ON_ONCE(pirq > 4); |
103 |
+ return read_config_nybble(router,0x43, pirqmap[pirq-1]); |
104 |
+ } |
105 |
+ |
106 |
+@@ -290,7 +290,7 @@ static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i |
107 |
+ { |
108 |
+ static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; |
109 |
+ |
110 |
+- WARN_ON_ONCE(pirq >= 4); |
111 |
++ WARN_ON_ONCE(pirq > 4); |
112 |
+ write_config_nybble(router, 0x43, pirqmap[pirq-1], irq); |
113 |
+ return 1; |
114 |
+ } |
115 |
+diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c |
116 |
+index b2112f5..a3b2374 100644 |
117 |
+--- a/drivers/infiniband/hw/nes/nes.c |
118 |
++++ b/drivers/infiniband/hw/nes/nes.c |
119 |
+@@ -751,13 +751,13 @@ static void __devexit nes_remove(struct pci_dev *pcidev) |
120 |
+ |
121 |
+ list_del(&nesdev->list); |
122 |
+ nes_destroy_cqp(nesdev); |
123 |
++ |
124 |
++ free_irq(pcidev->irq, nesdev); |
125 |
+ tasklet_kill(&nesdev->dpc_tasklet); |
126 |
+ |
127 |
+ /* Deallocate the Adapter Structure */ |
128 |
+ nes_destroy_adapter(nesdev->nesadapter); |
129 |
+ |
130 |
+- free_irq(pcidev->irq, nesdev); |
131 |
+- |
132 |
+ if (nesdev->msi_enabled) { |
133 |
+ pci_disable_msi(pcidev); |
134 |
+ } |
135 |
+diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c |
136 |
+index 0bef878..96b1a0e 100644 |
137 |
+--- a/drivers/infiniband/hw/nes/nes_cm.c |
138 |
++++ b/drivers/infiniband/hw/nes/nes_cm.c |
139 |
+@@ -1834,8 +1834,10 @@ int mini_cm_recv_pkt(struct nes_cm_core *cm_core, struct nes_vnic *nesvnic, |
140 |
+ nfo.rem_addr = ntohl(iph->saddr); |
141 |
+ nfo.rem_port = ntohs(tcph->source); |
142 |
+ |
143 |
+- nes_debug(NES_DBG_CM, "Received packet: dest=0x%08X:0x%04X src=0x%08X:0x%04X\n", |
144 |
+- iph->daddr, tcph->dest, iph->saddr, tcph->source); |
145 |
++ nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT |
146 |
++ ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n", |
147 |
++ NIPQUAD(iph->daddr), tcph->dest, |
148 |
++ NIPQUAD(iph->saddr), tcph->source); |
149 |
+ |
150 |
+ /* note: this call is going to increment cm_node ref count */ |
151 |
+ cm_node = find_node(cm_core, |
152 |
+diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c |
153 |
+index 49e53e4..496655e 100644 |
154 |
+--- a/drivers/infiniband/hw/nes/nes_hw.c |
155 |
++++ b/drivers/infiniband/hw/nes/nes_hw.c |
156 |
+@@ -625,6 +625,15 @@ unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode) |
157 |
+ nes_debug(NES_DBG_INIT, "Did not see full soft reset done.\n"); |
158 |
+ return 0; |
159 |
+ } |
160 |
++ |
161 |
++ i = 0; |
162 |
++ while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000) |
163 |
++ mdelay(1); |
164 |
++ if (i >= 10000) { |
165 |
++ printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n", |
166 |
++ nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS)); |
167 |
++ return 0; |
168 |
++ } |
169 |
+ } |
170 |
+ |
171 |
+ /* port reset */ |
172 |
+@@ -673,17 +682,6 @@ unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode) |
173 |
+ } |
174 |
+ } |
175 |
+ |
176 |
+- |
177 |
+- |
178 |
+- i = 0; |
179 |
+- while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000) |
180 |
+- mdelay(1); |
181 |
+- if (i >= 10000) { |
182 |
+- printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n", |
183 |
+- nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS)); |
184 |
+- return 0; |
185 |
+- } |
186 |
+- |
187 |
+ return port_count; |
188 |
+ } |
189 |
+ |
190 |
+diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c |
191 |
+index 5bbce29..c7d305b 100644 |
192 |
+--- a/drivers/md/dm-exception-store.c |
193 |
++++ b/drivers/md/dm-exception-store.c |
194 |
+@@ -131,7 +131,7 @@ struct pstore { |
195 |
+ |
196 |
+ static unsigned sectors_to_pages(unsigned sectors) |
197 |
+ { |
198 |
+- return sectors / (PAGE_SIZE >> 9); |
199 |
++ return DIV_ROUND_UP(sectors, PAGE_SIZE >> 9); |
200 |
+ } |
201 |
+ |
202 |
+ static int alloc_area(struct pstore *ps) |
203 |
+diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c |
204 |
+index 8c9a8ad..8bf5596 100644 |
205 |
+--- a/drivers/media/video/cx88/cx88-cards.c |
206 |
++++ b/drivers/media/video/cx88/cx88-cards.c |
207 |
+@@ -1354,6 +1354,10 @@ static const struct cx88_board cx88_boards[] = { |
208 |
+ }}, |
209 |
+ /* fixme: Add radio support */ |
210 |
+ .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, |
211 |
++ .radio = { |
212 |
++ .type = CX88_RADIO, |
213 |
++ .gpio0 = 0xe780, |
214 |
++ }, |
215 |
+ }, |
216 |
+ [CX88_BOARD_ADSTECH_PTV_390] = { |
217 |
+ .name = "ADS Tech Instant Video PCI", |
218 |
+diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c |
219 |
+index edef2a5..1e6f36e 100644 |
220 |
+--- a/drivers/media/video/ivtv/ivtv-ioctl.c |
221 |
++++ b/drivers/media/video/ivtv/ivtv-ioctl.c |
222 |
+@@ -741,7 +741,8 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void |
223 |
+ |
224 |
+ memset(vcap, 0, sizeof(*vcap)); |
225 |
+ strcpy(vcap->driver, IVTV_DRIVER_NAME); /* driver name */ |
226 |
+- strcpy(vcap->card, itv->card_name); /* card type */ |
227 |
++ strncpy(vcap->card, itv->card_name, |
228 |
++ sizeof(vcap->card)-1); /* card type */ |
229 |
+ strcpy(vcap->bus_info, pci_name(itv->dev)); /* bus info... */ |
230 |
+ vcap->version = IVTV_DRIVER_VERSION; /* version */ |
231 |
+ vcap->capabilities = itv->v4l2_cap; /* capabilities */ |
232 |
+diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c |
233 |
+index 5326eec..de7e060 100644 |
234 |
+--- a/drivers/media/video/tea5761.c |
235 |
++++ b/drivers/media/video/tea5761.c |
236 |
+@@ -249,14 +249,19 @@ int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr) |
237 |
+ |
238 |
+ if (16 != (rc = tuner_i2c_xfer_recv(&i2c, buffer, 16))) { |
239 |
+ printk(KERN_WARNING "it is not a TEA5761. Received %i chars.\n", rc); |
240 |
+- return EINVAL; |
241 |
++ return -EINVAL; |
242 |
+ } |
243 |
+ |
244 |
+- if (!((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061))) { |
245 |
+- printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x. It is not a TEA5761\n",buffer[13],buffer[14],buffer[15]); |
246 |
+- return EINVAL; |
247 |
++ if ((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061)) { |
248 |
++ printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x." |
249 |
++ " It is not a TEA5761\n", |
250 |
++ buffer[13], buffer[14], buffer[15]); |
251 |
++ return -EINVAL; |
252 |
+ } |
253 |
+- printk(KERN_WARNING "TEA5761 detected.\n"); |
254 |
++ printk(KERN_WARNING "tea5761: TEA%02x%02x detected. " |
255 |
++ "Manufacturer ID= 0x%02x\n", |
256 |
++ buffer[14], buffer[15], buffer[13]); |
257 |
++ |
258 |
+ return 0; |
259 |
+ } |
260 |
+ |
261 |
+diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c |
262 |
+index 78a09a2..8cdbdd0 100644 |
263 |
+--- a/drivers/media/video/tuner-core.c |
264 |
++++ b/drivers/media/video/tuner-core.c |
265 |
+@@ -1112,8 +1112,8 @@ static int tuner_probe(struct i2c_client *client) |
266 |
+ if (!no_autodetect) { |
267 |
+ switch (client->addr) { |
268 |
+ case 0x10: |
269 |
+- if (tea5761_autodetection(t->i2c->adapter, t->i2c->addr) |
270 |
+- != EINVAL) { |
271 |
++ if (tea5761_autodetection(t->i2c->adapter, |
272 |
++ t->i2c->addr) >= 0) { |
273 |
+ t->type = TUNER_TEA5761; |
274 |
+ t->mode_mask = T_RADIO; |
275 |
+ t->mode = T_STANDBY; |
276 |
+@@ -1125,7 +1125,7 @@ static int tuner_probe(struct i2c_client *client) |
277 |
+ |
278 |
+ goto register_client; |
279 |
+ } |
280 |
+- break; |
281 |
++ return -ENODEV; |
282 |
+ case 0x42: |
283 |
+ case 0x43: |
284 |
+ case 0x4a: |
285 |
+diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c |
286 |
+index c082cf0..de11039 100644 |
287 |
+--- a/drivers/net/s2io.c |
288 |
++++ b/drivers/net/s2io.c |
289 |
+@@ -84,7 +84,7 @@ |
290 |
+ #include "s2io.h" |
291 |
+ #include "s2io-regs.h" |
292 |
+ |
293 |
+-#define DRV_VERSION "2.0.26.20" |
294 |
++#define DRV_VERSION "2.0.26.22" |
295 |
+ |
296 |
+ /* S2io Driver name & version. */ |
297 |
+ static char s2io_driver_name[] = "Neterion"; |
298 |
+@@ -2339,7 +2339,7 @@ static void free_tx_buffers(struct s2io_nic *nic) |
299 |
+ for (i = 0; i < config->tx_fifo_num; i++) { |
300 |
+ unsigned long flags; |
301 |
+ spin_lock_irqsave(&mac_control->fifos[i].tx_lock, flags); |
302 |
+- for (j = 0; j < config->tx_cfg[i].fifo_len - 1; j++) { |
303 |
++ for (j = 0; j < config->tx_cfg[i].fifo_len; j++) { |
304 |
+ txdp = (struct TxD *) \ |
305 |
+ mac_control->fifos[i].list_info[j].list_virt_addr; |
306 |
+ skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j); |
307 |
+diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c |
308 |
+index 17585e5..432e837 100644 |
309 |
+--- a/drivers/net/tehuti.c |
310 |
++++ b/drivers/net/tehuti.c |
311 |
+@@ -625,6 +625,12 @@ static void __init bdx_firmware_endianess(void) |
312 |
+ s_firmLoad[i] = CPU_CHIP_SWAP32(s_firmLoad[i]); |
313 |
+ } |
314 |
+ |
315 |
++static int bdx_range_check(struct bdx_priv *priv, u32 offset) |
316 |
++{ |
317 |
++ return (offset > (u32) (BDX_REGS_SIZE / priv->nic->port_num)) ? |
318 |
++ -EINVAL : 0; |
319 |
++} |
320 |
++ |
321 |
+ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) |
322 |
+ { |
323 |
+ struct bdx_priv *priv = ndev->priv; |
324 |
+@@ -643,9 +649,15 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) |
325 |
+ DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]); |
326 |
+ } |
327 |
+ |
328 |
++ if (!capable(CAP_SYS_RAWIO)) |
329 |
++ return -EPERM; |
330 |
++ |
331 |
+ switch (data[0]) { |
332 |
+ |
333 |
+ case BDX_OP_READ: |
334 |
++ error = bdx_range_check(priv, data[1]); |
335 |
++ if (error < 0) |
336 |
++ return error; |
337 |
+ data[2] = READ_REG(priv, data[1]); |
338 |
+ DBG("read_reg(0x%x)=0x%x (dec %d)\n", data[1], data[2], |
339 |
+ data[2]); |
340 |
+@@ -655,6 +667,9 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) |
341 |
+ break; |
342 |
+ |
343 |
+ case BDX_OP_WRITE: |
344 |
++ error = bdx_range_check(priv, data[1]); |
345 |
++ if (error < 0) |
346 |
++ return error; |
347 |
+ WRITE_REG(priv, data[1], data[2]); |
348 |
+ DBG("write_reg(0x%x, 0x%x)\n", data[1], data[2]); |
349 |
+ break; |
350 |
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c |
351 |
+index 96043c5..bc4c62b 100644 |
352 |
+--- a/drivers/net/tg3.c |
353 |
++++ b/drivers/net/tg3.c |
354 |
+@@ -64,8 +64,8 @@ |
355 |
+ |
356 |
+ #define DRV_MODULE_NAME "tg3" |
357 |
+ #define PFX DRV_MODULE_NAME ": " |
358 |
+-#define DRV_MODULE_VERSION "3.90" |
359 |
+-#define DRV_MODULE_RELDATE "April 12, 2008" |
360 |
++#define DRV_MODULE_VERSION "3.91" |
361 |
++#define DRV_MODULE_RELDATE "April 18, 2008" |
362 |
+ |
363 |
+ #define TG3_DEF_MAC_MODE 0 |
364 |
+ #define TG3_DEF_RX_MODE 0 |
365 |
+@@ -4135,11 +4135,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, |
366 |
+ u32 last_plus_one, u32 *start, |
367 |
+ u32 base_flags, u32 mss) |
368 |
+ { |
369 |
+- struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC); |
370 |
++ struct sk_buff *new_skb; |
371 |
+ dma_addr_t new_addr = 0; |
372 |
+ u32 entry = *start; |
373 |
+ int i, ret = 0; |
374 |
+ |
375 |
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) |
376 |
++ new_skb = skb_copy(skb, GFP_ATOMIC); |
377 |
++ else { |
378 |
++ int more_headroom = 4 - ((unsigned long)skb->data & 3); |
379 |
++ |
380 |
++ new_skb = skb_copy_expand(skb, |
381 |
++ skb_headroom(skb) + more_headroom, |
382 |
++ skb_tailroom(skb), GFP_ATOMIC); |
383 |
++ } |
384 |
++ |
385 |
+ if (!new_skb) { |
386 |
+ ret = -1; |
387 |
+ } else { |
388 |
+@@ -4462,7 +4472,9 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) |
389 |
+ |
390 |
+ would_hit_hwbug = 0; |
391 |
+ |
392 |
+- if (tg3_4g_overflow_test(mapping, len)) |
393 |
++ if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG) |
394 |
++ would_hit_hwbug = 1; |
395 |
++ else if (tg3_4g_overflow_test(mapping, len)) |
396 |
+ would_hit_hwbug = 1; |
397 |
+ |
398 |
+ tg3_set_txd(tp, entry, mapping, len, base_flags, |
399 |
+@@ -11339,6 +11351,38 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) |
400 |
+ } |
401 |
+ } |
402 |
+ |
403 |
++ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) { |
404 |
++ static struct tg3_dev_id { |
405 |
++ u32 vendor; |
406 |
++ u32 device; |
407 |
++ } bridge_chipsets[] = { |
408 |
++ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0 }, |
409 |
++ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1 }, |
410 |
++ { }, |
411 |
++ }; |
412 |
++ struct tg3_dev_id *pci_id = &bridge_chipsets[0]; |
413 |
++ struct pci_dev *bridge = NULL; |
414 |
++ |
415 |
++ while (pci_id->vendor != 0) { |
416 |
++ bridge = pci_get_device(pci_id->vendor, |
417 |
++ pci_id->device, |
418 |
++ bridge); |
419 |
++ if (!bridge) { |
420 |
++ pci_id++; |
421 |
++ continue; |
422 |
++ } |
423 |
++ if (bridge->subordinate && |
424 |
++ (bridge->subordinate->number <= |
425 |
++ tp->pdev->bus->number) && |
426 |
++ (bridge->subordinate->subordinate >= |
427 |
++ tp->pdev->bus->number)) { |
428 |
++ tp->tg3_flags3 |= TG3_FLG3_5701_DMA_BUG; |
429 |
++ pci_dev_put(bridge); |
430 |
++ break; |
431 |
++ } |
432 |
++ } |
433 |
++ } |
434 |
++ |
435 |
+ /* The EPB bridge inside 5714, 5715, and 5780 cannot support |
436 |
+ * DMA addresses > 40-bit. This bridge may have other additional |
437 |
+ * 57xx devices behind it in some 4-port NIC designs for example. |
438 |
+diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h |
439 |
+index c1075a7..c688c3a 100644 |
440 |
+--- a/drivers/net/tg3.h |
441 |
++++ b/drivers/net/tg3.h |
442 |
+@@ -2476,6 +2476,7 @@ struct tg3 { |
443 |
+ #define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001 |
444 |
+ #define TG3_FLG3_ENABLE_APE 0x00000002 |
445 |
+ #define TG3_FLG3_5761_5784_AX_FIXES 0x00000004 |
446 |
++#define TG3_FLG3_5701_DMA_BUG 0x00000008 |
447 |
+ |
448 |
+ struct timer_list timer; |
449 |
+ u16 timer_counter; |
450 |
+diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c |
451 |
+index 48e9124..4ec1915 100644 |
452 |
+--- a/drivers/net/wireless/b43/dma.c |
453 |
++++ b/drivers/net/wireless/b43/dma.c |
454 |
+@@ -822,6 +822,18 @@ static u64 supported_dma_mask(struct b43_wldev *dev) |
455 |
+ return DMA_30BIT_MASK; |
456 |
+ } |
457 |
+ |
458 |
++static enum b43_dmatype dma_mask_to_engine_type(u64 dmamask) |
459 |
++{ |
460 |
++ if (dmamask == DMA_30BIT_MASK) |
461 |
++ return B43_DMA_30BIT; |
462 |
++ if (dmamask == DMA_32BIT_MASK) |
463 |
++ return B43_DMA_32BIT; |
464 |
++ if (dmamask == DMA_64BIT_MASK) |
465 |
++ return B43_DMA_64BIT; |
466 |
++ B43_WARN_ON(1); |
467 |
++ return B43_DMA_30BIT; |
468 |
++} |
469 |
++ |
470 |
+ /* Main initialization function. */ |
471 |
+ static |
472 |
+ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, |
473 |
+@@ -982,6 +994,42 @@ void b43_dma_free(struct b43_wldev *dev) |
474 |
+ dma->tx_ring0 = NULL; |
475 |
+ } |
476 |
+ |
477 |
++static int b43_dma_set_mask(struct b43_wldev *dev, u64 mask) |
478 |
++{ |
479 |
++ u64 orig_mask = mask; |
480 |
++ bool fallback = 0; |
481 |
++ int err; |
482 |
++ |
483 |
++ /* Try to set the DMA mask. If it fails, try falling back to a |
484 |
++ * lower mask, as we can always also support a lower one. */ |
485 |
++ while (1) { |
486 |
++ err = ssb_dma_set_mask(dev->dev, mask); |
487 |
++ if (!err) |
488 |
++ break; |
489 |
++ if (mask == DMA_64BIT_MASK) { |
490 |
++ mask = DMA_32BIT_MASK; |
491 |
++ fallback = 1; |
492 |
++ continue; |
493 |
++ } |
494 |
++ if (mask == DMA_32BIT_MASK) { |
495 |
++ mask = DMA_30BIT_MASK; |
496 |
++ fallback = 1; |
497 |
++ continue; |
498 |
++ } |
499 |
++ b43err(dev->wl, "The machine/kernel does not support " |
500 |
++ "the required %u-bit DMA mask\n", |
501 |
++ (unsigned int)dma_mask_to_engine_type(orig_mask)); |
502 |
++ return -EOPNOTSUPP; |
503 |
++ } |
504 |
++ if (fallback) { |
505 |
++ b43info(dev->wl, "DMA mask fallback from %u-bit to %u-bit\n", |
506 |
++ (unsigned int)dma_mask_to_engine_type(orig_mask), |
507 |
++ (unsigned int)dma_mask_to_engine_type(mask)); |
508 |
++ } |
509 |
++ |
510 |
++ return 0; |
511 |
++} |
512 |
++ |
513 |
+ int b43_dma_init(struct b43_wldev *dev) |
514 |
+ { |
515 |
+ struct b43_dma *dma = &dev->dma; |
516 |
+@@ -991,27 +1039,10 @@ int b43_dma_init(struct b43_wldev *dev) |
517 |
+ enum b43_dmatype type; |
518 |
+ |
519 |
+ dmamask = supported_dma_mask(dev); |
520 |
+- switch (dmamask) { |
521 |
+- default: |
522 |
+- B43_WARN_ON(1); |
523 |
+- case DMA_30BIT_MASK: |
524 |
+- type = B43_DMA_30BIT; |
525 |
+- break; |
526 |
+- case DMA_32BIT_MASK: |
527 |
+- type = B43_DMA_32BIT; |
528 |
+- break; |
529 |
+- case DMA_64BIT_MASK: |
530 |
+- type = B43_DMA_64BIT; |
531 |
+- break; |
532 |
+- } |
533 |
+- err = ssb_dma_set_mask(dev->dev, dmamask); |
534 |
+- if (err) { |
535 |
+- b43err(dev->wl, "The machine/kernel does not support " |
536 |
+- "the required DMA mask (0x%08X%08X)\n", |
537 |
+- (unsigned int)((dmamask & 0xFFFFFFFF00000000ULL) >> 32), |
538 |
+- (unsigned int)(dmamask & 0x00000000FFFFFFFFULL)); |
539 |
+- return -EOPNOTSUPP; |
540 |
+- } |
541 |
++ type = dma_mask_to_engine_type(dmamask); |
542 |
++ err = b43_dma_set_mask(dev, dmamask); |
543 |
++ if (err) |
544 |
++ return err; |
545 |
+ |
546 |
+ err = -ENOMEM; |
547 |
+ /* setup TX DMA channels. */ |
548 |
+diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c |
549 |
+index c73a75b..f23317e 100644 |
550 |
+--- a/drivers/net/wireless/b43/main.c |
551 |
++++ b/drivers/net/wireless/b43/main.c |
552 |
+@@ -78,6 +78,11 @@ static int modparam_nohwcrypt; |
553 |
+ module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444); |
554 |
+ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); |
555 |
+ |
556 |
++static int modparam_btcoex = 1; |
557 |
++module_param_named(btcoex, modparam_btcoex, int, 0444); |
558 |
++MODULE_PARM_DESC(btcoex, "Enable Bluetooth coexistance (default on)"); |
559 |
++ |
560 |
++ |
561 |
+ static const struct ssb_device_id b43_ssb_tbl[] = { |
562 |
+ SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5), |
563 |
+ SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 6), |
564 |
+@@ -3339,6 +3344,8 @@ static void b43_bluetooth_coext_enable(struct b43_wldev *dev) |
565 |
+ struct ssb_sprom *sprom = &dev->dev->bus->sprom; |
566 |
+ u32 hf; |
567 |
+ |
568 |
++ if (!modparam_btcoex) |
569 |
++ return; |
570 |
+ if (!(sprom->boardflags_lo & B43_BFL_BTCOEXIST)) |
571 |
+ return; |
572 |
+ if (dev->phy.type != B43_PHYTYPE_B && !dev->phy.gmode) |
573 |
+@@ -3350,11 +3357,13 @@ static void b43_bluetooth_coext_enable(struct b43_wldev *dev) |
574 |
+ else |
575 |
+ hf |= B43_HF_BTCOEX; |
576 |
+ b43_hf_write(dev, hf); |
577 |
+- //TODO |
578 |
+ } |
579 |
+ |
580 |
+ static void b43_bluetooth_coext_disable(struct b43_wldev *dev) |
581 |
+-{ //TODO |
582 |
++{ |
583 |
++ if (!modparam_btcoex) |
584 |
++ return; |
585 |
++ //TODO |
586 |
+ } |
587 |
+ |
588 |
+ static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev) |
589 |
+@@ -4000,8 +4009,16 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl) |
590 |
+ return err; |
591 |
+ } |
592 |
+ |
593 |
++#define IS_PDEV(pdev, _vendor, _device, _subvendor, _subdevice) ( \ |
594 |
++ (pdev->vendor == PCI_VENDOR_ID_##_vendor) && \ |
595 |
++ (pdev->device == _device) && \ |
596 |
++ (pdev->subsystem_vendor == PCI_VENDOR_ID_##_subvendor) && \ |
597 |
++ (pdev->subsystem_device == _subdevice) ) |
598 |
++ |
599 |
+ static void b43_sprom_fixup(struct ssb_bus *bus) |
600 |
+ { |
601 |
++ struct pci_dev *pdev; |
602 |
++ |
603 |
+ /* boardflags workarounds */ |
604 |
+ if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL && |
605 |
+ bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74) |
606 |
+@@ -4009,6 +4026,13 @@ static void b43_sprom_fixup(struct ssb_bus *bus) |
607 |
+ if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && |
608 |
+ bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40) |
609 |
+ bus->sprom.boardflags_lo |= B43_BFL_PACTRL; |
610 |
++ if (bus->bustype == SSB_BUSTYPE_PCI) { |
611 |
++ pdev = bus->host_pci; |
612 |
++ if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) || |
613 |
++ IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) || |
614 |
++ IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013)) |
615 |
++ bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST; |
616 |
++ } |
617 |
+ } |
618 |
+ |
619 |
+ static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl) |
620 |
+diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c |
621 |
+index 8b39970..3d09d8f 100644 |
622 |
+--- a/drivers/rtc/rtc-pcf8583.c |
623 |
++++ b/drivers/rtc/rtc-pcf8583.c |
624 |
+@@ -15,7 +15,7 @@ |
625 |
+ #include <linux/i2c.h> |
626 |
+ #include <linux/slab.h> |
627 |
+ #include <linux/string.h> |
628 |
+-#include <linux/mc146818rtc.h> |
629 |
++#include <linux/rtc.h> |
630 |
+ #include <linux/init.h> |
631 |
+ #include <linux/errno.h> |
632 |
+ #include <linux/bcd.h> |
633 |
+diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c |
634 |
+index 3c1b433..0e8e092 100644 |
635 |
+--- a/drivers/scsi/qla2xxx/qla_os.c |
636 |
++++ b/drivers/scsi/qla2xxx/qla_os.c |
637 |
+@@ -2357,7 +2357,7 @@ qla2x00_do_dpc(void *data) |
638 |
+ } else { |
639 |
+ fcport->login_retry = 0; |
640 |
+ } |
641 |
+- if (fcport->login_retry == 0) |
642 |
++ if (fcport->login_retry == 0 && status != QLA_SUCCESS) |
643 |
+ fcport->loop_id = FC_NO_LOOP_ID; |
644 |
+ } |
645 |
+ if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) |
646 |
+diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c |
647 |
+index 116211f..0dddd68 100644 |
648 |
+--- a/drivers/serial/dz.c |
649 |
++++ b/drivers/serial/dz.c |
650 |
+@@ -819,7 +819,7 @@ static void dz_console_putchar(struct uart_port *uport, int ch) |
651 |
+ dz_out(dport, DZ_TCR, mask); |
652 |
+ iob(); |
653 |
+ udelay(2); |
654 |
+- } while (loops--); |
655 |
++ } while (--loops); |
656 |
+ |
657 |
+ if (loops) /* Cannot send otherwise. */ |
658 |
+ dz_out(dport, DZ_TDR, ch); |
659 |
+diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c |
660 |
+index b434df7..274a448 100644 |
661 |
+--- a/drivers/ssb/pci.c |
662 |
++++ b/drivers/ssb/pci.c |
663 |
+@@ -482,6 +482,11 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out, |
664 |
+ goto unsupported; |
665 |
+ } |
666 |
+ |
667 |
++ if (out->boardflags_lo == 0xFFFF) |
668 |
++ out->boardflags_lo = 0; /* per specs */ |
669 |
++ if (out->boardflags_hi == 0xFFFF) |
670 |
++ out->boardflags_hi = 0; /* per specs */ |
671 |
++ |
672 |
+ return 0; |
673 |
+ unsupported: |
674 |
+ ssb_printk(KERN_WARNING PFX "Unsupported SPROM revision %d " |
675 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
676 |
+index 68fc521..7f1bc97 100644 |
677 |
+--- a/drivers/usb/core/hub.c |
678 |
++++ b/drivers/usb/core/hub.c |
679 |
+@@ -2664,6 +2664,7 @@ loop: |
680 |
+ if ((status == -ENOTCONN) || (status == -ENOTSUPP)) |
681 |
+ break; |
682 |
+ } |
683 |
++ dev_err(hub_dev, "unable to enumerate USB device on port %d\n", port1); |
684 |
+ |
685 |
+ done: |
686 |
+ hub_port_disable(hub, port1, 1); |
687 |
+diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c |
688 |
+index d0360f6..b0e2275 100644 |
689 |
+--- a/drivers/usb/host/ohci-pci.c |
690 |
++++ b/drivers/usb/host/ohci-pci.c |
691 |
+@@ -312,11 +312,13 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message) |
692 |
+ |
693 |
+ static int ohci_pci_resume (struct usb_hcd *hcd) |
694 |
+ { |
695 |
++ struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
696 |
++ |
697 |
+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
698 |
+ |
699 |
+ /* FIXME: we should try to detect loss of VBUS power here */ |
700 |
+ prepare_for_handover(hcd); |
701 |
+- |
702 |
++ ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrenable); |
703 |
+ return 0; |
704 |
+ } |
705 |
+ |
706 |
+diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c |
707 |
+index ed67881..7b02a4a 100644 |
708 |
+--- a/drivers/usb/serial/sierra.c |
709 |
++++ b/drivers/usb/serial/sierra.c |
710 |
+@@ -164,6 +164,7 @@ static struct usb_device_id id_table [] = { |
711 |
+ { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */ |
712 |
+ { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */ |
713 |
+ { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */ |
714 |
++ { USB_DEVICE(0x03f0, 0x1e1d) }, /* HP hs2300 a.k.a MC8775 */ |
715 |
+ { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ |
716 |
+ { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/ |
717 |
+ { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/ |
718 |
+diff --git a/fs/aio.c b/fs/aio.c |
719 |
+index 2283686..ae94e1d 100644 |
720 |
+--- a/fs/aio.c |
721 |
++++ b/fs/aio.c |
722 |
+@@ -1166,7 +1166,10 @@ retry: |
723 |
+ break; |
724 |
+ if (min_nr <= i) |
725 |
+ break; |
726 |
+- ret = 0; |
727 |
++ if (unlikely(ctx->dead)) { |
728 |
++ ret = -EINVAL; |
729 |
++ break; |
730 |
++ } |
731 |
+ if (to.timed_out) /* Only check after read evt */ |
732 |
+ break; |
733 |
+ /* Try to only show up in io wait if there are ops |
734 |
+@@ -1231,6 +1234,13 @@ static void io_destroy(struct kioctx *ioctx) |
735 |
+ |
736 |
+ aio_cancel_all(ioctx); |
737 |
+ wait_for_all_aios(ioctx); |
738 |
++ |
739 |
++ /* |
740 |
++ * Wake up any waiters. The setting of ctx->dead must be seen |
741 |
++ * by other CPUs at this point. Right now, we rely on the |
742 |
++ * locking done by the above calls to ensure this consistency. |
743 |
++ */ |
744 |
++ wake_up(&ioctx->wait); |
745 |
+ put_ioctx(ioctx); /* once for the lookup */ |
746 |
+ } |
747 |
+ |
748 |
+diff --git a/fs/dnotify.c b/fs/dnotify.c |
749 |
+index 28d01ed..eaecc4c 100644 |
750 |
+--- a/fs/dnotify.c |
751 |
++++ b/fs/dnotify.c |
752 |
+@@ -20,6 +20,7 @@ |
753 |
+ #include <linux/init.h> |
754 |
+ #include <linux/spinlock.h> |
755 |
+ #include <linux/slab.h> |
756 |
++#include <linux/file.h> |
757 |
+ |
758 |
+ int dir_notify_enable __read_mostly = 1; |
759 |
+ |
760 |
+@@ -66,6 +67,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) |
761 |
+ struct dnotify_struct **prev; |
762 |
+ struct inode *inode; |
763 |
+ fl_owner_t id = current->files; |
764 |
++ struct file *f; |
765 |
+ int error = 0; |
766 |
+ |
767 |
+ if ((arg & ~DN_MULTISHOT) == 0) { |
768 |
+@@ -92,6 +94,15 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) |
769 |
+ prev = &odn->dn_next; |
770 |
+ } |
771 |
+ |
772 |
++ rcu_read_lock(); |
773 |
++ f = fcheck(fd); |
774 |
++ rcu_read_unlock(); |
775 |
++ /* we'd lost the race with close(), sod off silently */ |
776 |
++ /* note that inode->i_lock prevents reordering problems |
777 |
++ * between accesses to descriptor table and ->i_dnotify */ |
778 |
++ if (f != filp) |
779 |
++ goto out_free; |
780 |
++ |
781 |
+ error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0); |
782 |
+ if (error) |
783 |
+ goto out_free; |
784 |
+diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c |
785 |
+index a1db918..4c895f3 100644 |
786 |
+--- a/fs/jffs2/erase.c |
787 |
++++ b/fs/jffs2/erase.c |
788 |
+@@ -419,9 +419,6 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb |
789 |
+ if (jffs2_write_nand_cleanmarker(c, jeb)) |
790 |
+ goto filebad; |
791 |
+ } |
792 |
+- |
793 |
+- /* Everything else got zeroed before the erase */ |
794 |
+- jeb->free_size = c->sector_size; |
795 |
+ } else { |
796 |
+ |
797 |
+ struct kvec vecs[1]; |
798 |
+@@ -449,18 +446,19 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb |
799 |
+ |
800 |
+ goto filebad; |
801 |
+ } |
802 |
+- |
803 |
+- /* Everything else got zeroed before the erase */ |
804 |
+- jeb->free_size = c->sector_size; |
805 |
+- /* FIXME Special case for cleanmarker in empty block */ |
806 |
+- jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL); |
807 |
+ } |
808 |
++ /* Everything else got zeroed before the erase */ |
809 |
++ jeb->free_size = c->sector_size; |
810 |
+ |
811 |
+ down(&c->erase_free_sem); |
812 |
+ spin_lock(&c->erase_completion_lock); |
813 |
++ |
814 |
+ c->erasing_size -= c->sector_size; |
815 |
+- c->free_size += jeb->free_size; |
816 |
+- c->used_size += jeb->used_size; |
817 |
++ c->free_size += c->sector_size; |
818 |
++ |
819 |
++ /* Account for cleanmarker now, if it's in-band */ |
820 |
++ if (c->cleanmarker_size && !jffs2_cleanmarker_oob(c)) |
821 |
++ jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL); |
822 |
+ |
823 |
+ jffs2_dbg_acct_sanity_check_nolock(c,jeb); |
824 |
+ jffs2_dbg_acct_paranoia_check_nolock(c, jeb); |
825 |
+diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h |
826 |
+index b9e1740..44c81c7 100644 |
827 |
+--- a/include/linux/rtnetlink.h |
828 |
++++ b/include/linux/rtnetlink.h |
829 |
+@@ -740,13 +740,13 @@ extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); |
830 |
+ extern void rtnl_lock(void); |
831 |
+ extern void rtnl_unlock(void); |
832 |
+ extern int rtnl_trylock(void); |
833 |
++extern int rtnl_is_locked(void); |
834 |
+ |
835 |
+ extern void rtnetlink_init(void); |
836 |
+ extern void __rtnl_unlock(void); |
837 |
+ |
838 |
+ #define ASSERT_RTNL() do { \ |
839 |
+- if (unlikely(rtnl_trylock())) { \ |
840 |
+- rtnl_unlock(); \ |
841 |
++ if (unlikely(!rtnl_is_locked())) { \ |
842 |
+ printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ |
843 |
+ __FILE__, __LINE__); \ |
844 |
+ dump_stack(); \ |
845 |
+diff --git a/include/net/tcp.h b/include/net/tcp.h |
846 |
+index 4fd3eb2..d69d12e 100644 |
847 |
+--- a/include/net/tcp.h |
848 |
++++ b/include/net/tcp.h |
849 |
+@@ -776,11 +776,14 @@ extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); |
850 |
+ extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); |
851 |
+ |
852 |
+ /* Slow start with delack produces 3 packets of burst, so that |
853 |
+- * it is safe "de facto". |
854 |
++ * it is safe "de facto". This will be the default - same as |
855 |
++ * the default reordering threshold - but if reordering increases, |
856 |
++ * we must be able to allow cwnd to burst at least this much in order |
857 |
++ * to not pull it back when holes are filled. |
858 |
+ */ |
859 |
+ static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp) |
860 |
+ { |
861 |
+- return 3; |
862 |
++ return tp->reordering; |
863 |
+ } |
864 |
+ |
865 |
+ /* Returns end sequence number of the receiver's advertised window */ |
866 |
+diff --git a/include/net/xfrm.h b/include/net/xfrm.h |
867 |
+index 0d255ae..97577de 100644 |
868 |
+--- a/include/net/xfrm.h |
869 |
++++ b/include/net/xfrm.h |
870 |
+@@ -435,6 +435,9 @@ struct xfrm_tmpl |
871 |
+ /* May skip this transfomration if no SA is found */ |
872 |
+ __u8 optional; |
873 |
+ |
874 |
++/* Skip aalgos/ealgos/calgos checks. */ |
875 |
++ __u8 allalgs; |
876 |
++ |
877 |
+ /* Bit mask of algos allowed for acquisition */ |
878 |
+ __u32 aalgos; |
879 |
+ __u32 ealgos; |
880 |
+diff --git a/kernel/cgroup.c b/kernel/cgroup.c |
881 |
+index 2727f92..6d8de05 100644 |
882 |
+--- a/kernel/cgroup.c |
883 |
++++ b/kernel/cgroup.c |
884 |
+@@ -1722,7 +1722,12 @@ void cgroup_enable_task_cg_lists(void) |
885 |
+ use_task_css_set_links = 1; |
886 |
+ do_each_thread(g, p) { |
887 |
+ task_lock(p); |
888 |
+- if (list_empty(&p->cg_list)) |
889 |
++ /* |
890 |
++ * We should check if the process is exiting, otherwise |
891 |
++ * it will race with cgroup_exit() in that the list |
892 |
++ * entry won't be deleted though the process has exited. |
893 |
++ */ |
894 |
++ if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list)) |
895 |
+ list_add(&p->cg_list, &p->cgroups->tasks); |
896 |
+ task_unlock(p); |
897 |
+ } while_each_thread(g, p); |
898 |
+diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c |
899 |
+index 98bee01..c15a359 100644 |
900 |
+--- a/kernel/hrtimer.c |
901 |
++++ b/kernel/hrtimer.c |
902 |
+@@ -590,7 +590,6 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, |
903 |
+ list_add_tail(&timer->cb_entry, |
904 |
+ &base->cpu_base->cb_pending); |
905 |
+ timer->state = HRTIMER_STATE_PENDING; |
906 |
+- raise_softirq(HRTIMER_SOFTIRQ); |
907 |
+ return 1; |
908 |
+ default: |
909 |
+ BUG(); |
910 |
+@@ -633,6 +632,11 @@ static int hrtimer_switch_to_hres(void) |
911 |
+ return 1; |
912 |
+ } |
913 |
+ |
914 |
++static inline void hrtimer_raise_softirq(void) |
915 |
++{ |
916 |
++ raise_softirq(HRTIMER_SOFTIRQ); |
917 |
++} |
918 |
++ |
919 |
+ #else |
920 |
+ |
921 |
+ static inline int hrtimer_hres_active(void) { return 0; } |
922 |
+@@ -651,6 +655,7 @@ static inline int hrtimer_reprogram(struct hrtimer *timer, |
923 |
+ { |
924 |
+ return 0; |
925 |
+ } |
926 |
++static inline void hrtimer_raise_softirq(void) { } |
927 |
+ |
928 |
+ #endif /* CONFIG_HIGH_RES_TIMERS */ |
929 |
+ |
930 |
+@@ -850,7 +855,7 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) |
931 |
+ { |
932 |
+ struct hrtimer_clock_base *base, *new_base; |
933 |
+ unsigned long flags; |
934 |
+- int ret; |
935 |
++ int ret, raise; |
936 |
+ |
937 |
+ base = lock_hrtimer_base(timer, &flags); |
938 |
+ |
939 |
+@@ -884,8 +889,18 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) |
940 |
+ enqueue_hrtimer(timer, new_base, |
941 |
+ new_base->cpu_base == &__get_cpu_var(hrtimer_bases)); |
942 |
+ |
943 |
++ /* |
944 |
++ * The timer may be expired and moved to the cb_pending |
945 |
++ * list. We can not raise the softirq with base lock held due |
946 |
++ * to a possible deadlock with runqueue lock. |
947 |
++ */ |
948 |
++ raise = timer->state == HRTIMER_STATE_PENDING; |
949 |
++ |
950 |
+ unlock_hrtimer_base(timer, &flags); |
951 |
+ |
952 |
++ if (raise) |
953 |
++ hrtimer_raise_softirq(); |
954 |
++ |
955 |
+ return ret; |
956 |
+ } |
957 |
+ EXPORT_SYMBOL_GPL(hrtimer_start); |
958 |
+@@ -1080,8 +1095,19 @@ static void run_hrtimer_pending(struct hrtimer_cpu_base *cpu_base) |
959 |
+ * If the timer was rearmed on another CPU, reprogram |
960 |
+ * the event device. |
961 |
+ */ |
962 |
+- if (timer->base->first == &timer->node) |
963 |
+- hrtimer_reprogram(timer, timer->base); |
964 |
++ struct hrtimer_clock_base *base = timer->base; |
965 |
++ |
966 |
++ if (base->first == &timer->node && |
967 |
++ hrtimer_reprogram(timer, base)) { |
968 |
++ /* |
969 |
++ * Timer is expired. Thus move it from tree to |
970 |
++ * pending list again. |
971 |
++ */ |
972 |
++ __remove_hrtimer(timer, base, |
973 |
++ HRTIMER_STATE_PENDING, 0); |
974 |
++ list_add_tail(&timer->cb_entry, |
975 |
++ &base->cpu_base->cb_pending); |
976 |
++ } |
977 |
+ } |
978 |
+ } |
979 |
+ spin_unlock_irq(&cpu_base->lock); |
980 |
+diff --git a/mm/pagewalk.c b/mm/pagewalk.c |
981 |
+index 1cf1417..0afd238 100644 |
982 |
+--- a/mm/pagewalk.c |
983 |
++++ b/mm/pagewalk.c |
984 |
+@@ -9,11 +9,15 @@ static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, |
985 |
+ int err = 0; |
986 |
+ |
987 |
+ pte = pte_offset_map(pmd, addr); |
988 |
+- do { |
989 |
++ for (;;) { |
990 |
+ err = walk->pte_entry(pte, addr, addr + PAGE_SIZE, private); |
991 |
+ if (err) |
992 |
+ break; |
993 |
+- } while (pte++, addr += PAGE_SIZE, addr != end); |
994 |
++ addr += PAGE_SIZE; |
995 |
++ if (addr == end) |
996 |
++ break; |
997 |
++ pte++; |
998 |
++ } |
999 |
+ |
1000 |
+ pte_unmap(pte); |
1001 |
+ return err; |
1002 |
+diff --git a/net/can/raw.c b/net/can/raw.c |
1003 |
+index 94cd7f2..c92cb8e 100644 |
1004 |
+--- a/net/can/raw.c |
1005 |
++++ b/net/can/raw.c |
1006 |
+@@ -573,7 +573,8 @@ static int raw_getsockopt(struct socket *sock, int level, int optname, |
1007 |
+ int fsize = ro->count * sizeof(struct can_filter); |
1008 |
+ if (len > fsize) |
1009 |
+ len = fsize; |
1010 |
+- err = copy_to_user(optval, ro->filter, len); |
1011 |
++ if (copy_to_user(optval, ro->filter, len)) |
1012 |
++ err = -EFAULT; |
1013 |
+ } else |
1014 |
+ len = 0; |
1015 |
+ release_sock(sk); |
1016 |
+diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c |
1017 |
+index 2bd9c5f..0cb2772 100644 |
1018 |
+--- a/net/core/rtnetlink.c |
1019 |
++++ b/net/core/rtnetlink.c |
1020 |
+@@ -82,6 +82,11 @@ int rtnl_trylock(void) |
1021 |
+ return mutex_trylock(&rtnl_mutex); |
1022 |
+ } |
1023 |
+ |
1024 |
++int rtnl_is_locked(void) |
1025 |
++{ |
1026 |
++ return mutex_is_locked(&rtnl_mutex); |
1027 |
++} |
1028 |
++ |
1029 |
+ static struct rtnl_link *rtnl_msg_handlers[NPROTO]; |
1030 |
+ |
1031 |
+ static inline int rtm_msgindex(int msgtype) |
1032 |
+@@ -1389,6 +1394,7 @@ EXPORT_SYMBOL(rtnetlink_put_metrics); |
1033 |
+ EXPORT_SYMBOL(rtnl_lock); |
1034 |
+ EXPORT_SYMBOL(rtnl_trylock); |
1035 |
+ EXPORT_SYMBOL(rtnl_unlock); |
1036 |
++EXPORT_SYMBOL(rtnl_is_locked); |
1037 |
+ EXPORT_SYMBOL(rtnl_unicast); |
1038 |
+ EXPORT_SYMBOL(rtnl_notify); |
1039 |
+ EXPORT_SYMBOL(rtnl_set_sk_err); |
1040 |
+diff --git a/net/dccp/probe.c b/net/dccp/probe.c |
1041 |
+index 7053bb8..44eddcf 100644 |
1042 |
+--- a/net/dccp/probe.c |
1043 |
++++ b/net/dccp/probe.c |
1044 |
+@@ -145,7 +145,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf, |
1045 |
+ goto out_free; |
1046 |
+ |
1047 |
+ cnt = kfifo_get(dccpw.fifo, tbuf, len); |
1048 |
+- error = copy_to_user(buf, tbuf, cnt); |
1049 |
++ error = copy_to_user(buf, tbuf, cnt) ? -EFAULT : 0; |
1050 |
+ |
1051 |
+ out_free: |
1052 |
+ vfree(tbuf); |
1053 |
+diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c |
1054 |
+index 87dd5bf..a79a547 100644 |
1055 |
+--- a/net/ipv4/tcp_probe.c |
1056 |
++++ b/net/ipv4/tcp_probe.c |
1057 |
+@@ -190,19 +190,18 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf, |
1058 |
+ |
1059 |
+ width = tcpprobe_sprint(tbuf, sizeof(tbuf)); |
1060 |
+ |
1061 |
+- if (width < len) |
1062 |
++ if (cnt + width < len) |
1063 |
+ tcp_probe.tail = (tcp_probe.tail + 1) % bufsize; |
1064 |
+ |
1065 |
+ spin_unlock_bh(&tcp_probe.lock); |
1066 |
+ |
1067 |
+ /* if record greater than space available |
1068 |
+ return partial buffer (so far) */ |
1069 |
+- if (width >= len) |
1070 |
++ if (cnt + width >= len) |
1071 |
+ break; |
1072 |
+ |
1073 |
+- error = copy_to_user(buf + cnt, tbuf, width); |
1074 |
+- if (error) |
1075 |
+- break; |
1076 |
++ if (copy_to_user(buf + cnt, tbuf, width)) |
1077 |
++ return -EFAULT; |
1078 |
+ cnt += width; |
1079 |
+ } |
1080 |
+ |
1081 |
+diff --git a/net/key/af_key.c b/net/key/af_key.c |
1082 |
+index e9ef9af..5ceab25 100644 |
1083 |
+--- a/net/key/af_key.c |
1084 |
++++ b/net/key/af_key.c |
1085 |
+@@ -1856,7 +1856,7 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq) |
1086 |
+ t->encap_family = xp->family; |
1087 |
+ |
1088 |
+ /* No way to set this via kame pfkey */ |
1089 |
+- t->aalgos = t->ealgos = t->calgos = ~0; |
1090 |
++ t->allalgs = 1; |
1091 |
+ xp->xfrm_nr++; |
1092 |
+ return 0; |
1093 |
+ } |
1094 |
+diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c |
1095 |
+index 063cbc5..f9293c7 100644 |
1096 |
+--- a/net/rose/af_rose.c |
1097 |
++++ b/net/rose/af_rose.c |
1098 |
+@@ -760,8 +760,10 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le |
1099 |
+ |
1100 |
+ rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, |
1101 |
+ &diagnostic); |
1102 |
+- if (!rose->neighbour) |
1103 |
+- return -ENETUNREACH; |
1104 |
++ if (!rose->neighbour) { |
1105 |
++ err = -ENETUNREACH; |
1106 |
++ goto out_release; |
1107 |
++ } |
1108 |
+ |
1109 |
+ rose->lci = rose_new_lci(rose->neighbour); |
1110 |
+ if (!rose->lci) { |
1111 |
+diff --git a/net/tipc/socket.c b/net/tipc/socket.c |
1112 |
+index 2290903..ac04733 100644 |
1113 |
+--- a/net/tipc/socket.c |
1114 |
++++ b/net/tipc/socket.c |
1115 |
+@@ -1600,8 +1600,8 @@ static int getsockopt(struct socket *sock, |
1116 |
+ else if (len < sizeof(value)) { |
1117 |
+ res = -EINVAL; |
1118 |
+ } |
1119 |
+- else if ((res = copy_to_user(ov, &value, sizeof(value)))) { |
1120 |
+- /* couldn't return value */ |
1121 |
++ else if (copy_to_user(ov, &value, sizeof(value))) { |
1122 |
++ res = -EFAULT; |
1123 |
+ } |
1124 |
+ else { |
1125 |
+ res = put_user(sizeof(value), ol); |
1126 |
+diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c |
1127 |
+index 9fc4c31..c44076c 100644 |
1128 |
+--- a/net/xfrm/xfrm_policy.c |
1129 |
++++ b/net/xfrm/xfrm_policy.c |
1130 |
+@@ -1772,7 +1772,7 @@ xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x, |
1131 |
+ (x->id.spi == tmpl->id.spi || !tmpl->id.spi) && |
1132 |
+ (x->props.reqid == tmpl->reqid || !tmpl->reqid) && |
1133 |
+ x->props.mode == tmpl->mode && |
1134 |
+- ((tmpl->aalgos & (1<<x->props.aalgo)) || |
1135 |
++ (tmpl->allalgs || (tmpl->aalgos & (1<<x->props.aalgo)) || |
1136 |
+ !(xfrm_id_proto_match(tmpl->id.proto, IPSEC_PROTO_ANY))) && |
1137 |
+ !(x->props.mode != XFRM_MODE_TRANSPORT && |
1138 |
+ xfrm_state_addr_cmp(tmpl, x, family)); |
1139 |
+diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c |
1140 |
+index 019d21d..12f19be 100644 |
1141 |
+--- a/net/xfrm/xfrm_user.c |
1142 |
++++ b/net/xfrm/xfrm_user.c |
1143 |
+@@ -975,6 +975,8 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, |
1144 |
+ t->aalgos = ut->aalgos; |
1145 |
+ t->ealgos = ut->ealgos; |
1146 |
+ t->calgos = ut->calgos; |
1147 |
++ /* If all masks are ~0, then we allow all algorithms. */ |
1148 |
++ t->allalgs = !~(t->aalgos & t->ealgos & t->calgos); |
1149 |
+ t->encap_family = ut->family; |
1150 |
+ } |
1151 |
+ } |
1152 |
+diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c |
1153 |
+index d39b59c..f4fa982 100644 |
1154 |
+--- a/security/selinux/hooks.c |
1155 |
++++ b/security/selinux/hooks.c |
1156 |
+@@ -756,9 +756,18 @@ static void selinux_sb_clone_mnt_opts(const struct super_block *oldsb, |
1157 |
+ int set_context = (oldsbsec->flags & CONTEXT_MNT); |
1158 |
+ int set_rootcontext = (oldsbsec->flags & ROOTCONTEXT_MNT); |
1159 |
+ |
1160 |
+- /* we can't error, we can't save the info, this shouldn't get called |
1161 |
+- * this early in the boot process. */ |
1162 |
+- BUG_ON(!ss_initialized); |
1163 |
++ /* |
1164 |
++ * if the parent was able to be mounted it clearly had no special lsm |
1165 |
++ * mount options. thus we can safely put this sb on the list and deal |
1166 |
++ * with it later |
1167 |
++ */ |
1168 |
++ if (!ss_initialized) { |
1169 |
++ spin_lock(&sb_security_lock); |
1170 |
++ if (list_empty(&newsbsec->list)) |
1171 |
++ list_add(&newsbsec->list, &superblock_security_head); |
1172 |
++ spin_unlock(&sb_security_lock); |
1173 |
++ return; |
1174 |
++ } |
1175 |
+ |
1176 |
+ /* how can we clone if the old one wasn't set up?? */ |
1177 |
+ BUG_ON(!oldsbsec->initialized); |
1178 |
|
1179 |
-- |
1180 |
gentoo-commits@l.g.o mailing list |