Contents of /trunk/kernel26-alx/patches-2.6.20-r5/0107-2.6.20.7-all-fixes.patch
Parent Directory | Revision Log
Revision 199 -
(show annotations)
(download)
Fri May 18 11:04:36 2007 UTC (17 years, 4 months ago) by niro
File size: 39401 byte(s)
Fri May 18 11:04:36 2007 UTC (17 years, 4 months ago) by niro
File size: 39401 byte(s)
-import
1 | diff --git a/arch/i386/lib/usercopy.c b/arch/i386/lib/usercopy.c |
2 | index d22cfc9..086b372 100644 |
3 | --- a/arch/i386/lib/usercopy.c |
4 | +++ b/arch/i386/lib/usercopy.c |
5 | @@ -10,6 +10,7 @@ |
6 | #include <linux/blkdev.h> |
7 | #include <linux/module.h> |
8 | #include <linux/backing-dev.h> |
9 | +#include <linux/interrupt.h> |
10 | #include <asm/uaccess.h> |
11 | #include <asm/mmx.h> |
12 | |
13 | @@ -719,6 +720,14 @@ unsigned long __copy_to_user_ll(void __user *to, const void *from, |
14 | #ifndef CONFIG_X86_WP_WORKS_OK |
15 | if (unlikely(boot_cpu_data.wp_works_ok == 0) && |
16 | ((unsigned long )to) < TASK_SIZE) { |
17 | + /* |
18 | + * When we are in an atomic section (see |
19 | + * mm/filemap.c:file_read_actor), return the full |
20 | + * length to take the slow path. |
21 | + */ |
22 | + if (in_atomic()) |
23 | + return n; |
24 | + |
25 | /* |
26 | * CPU does not honor the WP bit when writing |
27 | * from supervisory mode, and due to preemption or SMP, |
28 | diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c |
29 | index dc2c082..21fb66f 100644 |
30 | --- a/drivers/ata/ahci.c |
31 | +++ b/drivers/ata/ahci.c |
32 | @@ -82,6 +82,7 @@ enum { |
33 | board_ahci_pi = 1, |
34 | board_ahci_vt8251 = 2, |
35 | board_ahci_ign_iferr = 3, |
36 | + board_ahci_sb600 = 4, |
37 | |
38 | /* global controller registers */ |
39 | HOST_CAP = 0x00, /* host capabilities */ |
40 | @@ -173,6 +174,7 @@ enum { |
41 | AHCI_FLAG_NO_NCQ = (1 << 24), |
42 | AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */ |
43 | AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */ |
44 | + AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */ |
45 | }; |
46 | |
47 | struct ahci_cmd_hdr { |
48 | @@ -365,6 +367,18 @@ static const struct ata_port_info ahci_port_info[] = { |
49 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
50 | .port_ops = &ahci_ops, |
51 | }, |
52 | + /* board_ahci_sb600 */ |
53 | + { |
54 | + .sht = &ahci_sht, |
55 | + .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
56 | + ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | |
57 | + ATA_FLAG_SKIP_D2H_BSY | |
58 | + AHCI_FLAG_IGN_SERR_INTERNAL, |
59 | + .pio_mask = 0x1f, /* pio0-4 */ |
60 | + .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
61 | + .port_ops = &ahci_ops, |
62 | + }, |
63 | + |
64 | }; |
65 | |
66 | static const struct pci_device_id ahci_pci_tbl[] = { |
67 | @@ -404,7 +418,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { |
68 | { PCI_VDEVICE(JMICRON, 0x2366), board_ahci_ign_iferr }, /* JMB366 */ |
69 | |
70 | /* ATI */ |
71 | - { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */ |
72 | + { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */ |
73 | { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */ |
74 | |
75 | /* VIA */ |
76 | @@ -1076,8 +1090,11 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) |
77 | if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR) |
78 | irq_stat &= ~PORT_IRQ_IF_ERR; |
79 | |
80 | - if (irq_stat & PORT_IRQ_TF_ERR) |
81 | + if (irq_stat & PORT_IRQ_TF_ERR) { |
82 | err_mask |= AC_ERR_DEV; |
83 | + if (ap->flags & AHCI_FLAG_IGN_SERR_INTERNAL) |
84 | + serror &= ~SERR_INTERNAL; |
85 | + } |
86 | |
87 | if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) { |
88 | err_mask |= AC_ERR_HOST_BUS; |
89 | diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c |
90 | index d6fcf0a..9a472c2 100644 |
91 | --- a/drivers/ata/libata-core.c |
92 | +++ b/drivers/ata/libata-core.c |
93 | @@ -3316,7 +3316,6 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { |
94 | { "WPI CDD-820", NULL, ATA_HORKAGE_NODMA }, |
95 | { "SAMSUNG CD-ROM SC-148C", NULL, ATA_HORKAGE_NODMA }, |
96 | { "SAMSUNG CD-ROM SC", NULL, ATA_HORKAGE_NODMA }, |
97 | - { "SanDisk SDP3B-64", NULL, ATA_HORKAGE_NODMA }, |
98 | { "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL,ATA_HORKAGE_NODMA }, |
99 | { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, |
100 | { "SAMSUNG CD-ROM SN-124","N001", ATA_HORKAGE_NODMA }, |
101 | @@ -3326,6 +3325,17 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { |
102 | /* Devices where NCQ should be avoided */ |
103 | /* NCQ is slow */ |
104 | { "WDC WD740ADFD-00", NULL, ATA_HORKAGE_NONCQ }, |
105 | + /* http://thread.gmane.org/gmane.linux.ide/14907 */ |
106 | + { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, |
107 | + /* NCQ is broken */ |
108 | + { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ }, |
109 | + /* NCQ hard hangs device under heavier load, needs hard power cycle */ |
110 | + { "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ }, |
111 | + /* Blacklist entries taken from Silicon Image 3124/3132 |
112 | + Windows driver .inf file - also several Linux problem reports */ |
113 | + { "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, }, |
114 | + { "HTS541080G9SA00", "MB4OC60D", ATA_HORKAGE_NONCQ, }, |
115 | + { "HTS541010G9SA00", "MBZOC60D", ATA_HORKAGE_NONCQ, }, |
116 | |
117 | /* Devices with NCQ limits */ |
118 | |
119 | @@ -4742,8 +4752,8 @@ static void fill_result_tf(struct ata_queued_cmd *qc) |
120 | { |
121 | struct ata_port *ap = qc->ap; |
122 | |
123 | - ap->ops->tf_read(ap, &qc->result_tf); |
124 | qc->result_tf.flags = qc->tf.flags; |
125 | + ap->ops->tf_read(ap, &qc->result_tf); |
126 | } |
127 | |
128 | /** |
129 | diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c |
130 | index 7484358..e1b0bff 100644 |
131 | --- a/drivers/ata/libata-eh.c |
132 | +++ b/drivers/ata/libata-eh.c |
133 | @@ -954,26 +954,27 @@ static int ata_eh_read_log_10h(struct ata_device *dev, |
134 | * RETURNS: |
135 | * 0 on success, AC_ERR_* mask on failure |
136 | */ |
137 | -static unsigned int atapi_eh_request_sense(struct ata_device *dev, |
138 | - unsigned char *sense_buf) |
139 | +static unsigned int atapi_eh_request_sense(struct ata_queued_cmd *qc) |
140 | { |
141 | + struct ata_device *dev = qc->dev; |
142 | + unsigned char *sense_buf = qc->scsicmd->sense_buffer; |
143 | struct ata_port *ap = dev->ap; |
144 | struct ata_taskfile tf; |
145 | u8 cdb[ATAPI_CDB_LEN]; |
146 | |
147 | DPRINTK("ATAPI request sense\n"); |
148 | |
149 | - ata_tf_init(dev, &tf); |
150 | - |
151 | /* FIXME: is this needed? */ |
152 | memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); |
153 | |
154 | - /* XXX: why tf_read here? */ |
155 | - ap->ops->tf_read(ap, &tf); |
156 | - |
157 | - /* fill these in, for the case where they are -not- overwritten */ |
158 | + /* initialize sense_buf with the error register, |
159 | + * for the case where they are -not- overwritten |
160 | + */ |
161 | sense_buf[0] = 0x70; |
162 | - sense_buf[2] = tf.feature >> 4; |
163 | + sense_buf[2] = qc->result_tf.feature >> 4; |
164 | + |
165 | + /* some devices time out if garbage left in tf */ |
166 | + ata_tf_init(dev, &tf); |
167 | |
168 | memset(cdb, 0, ATAPI_CDB_LEN); |
169 | cdb[0] = REQUEST_SENSE; |
170 | @@ -1137,8 +1138,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, |
171 | |
172 | case ATA_DEV_ATAPI: |
173 | if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { |
174 | - tmp = atapi_eh_request_sense(qc->dev, |
175 | - qc->scsicmd->sense_buffer); |
176 | + tmp = atapi_eh_request_sense(qc); |
177 | if (!tmp) { |
178 | /* ATA_QCFLAG_SENSE_VALID is used to |
179 | * tell atapi_qc_complete() that sense |
180 | diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c |
181 | index 1790542..fc436f6 100644 |
182 | --- a/drivers/ata/libata-scsi.c |
183 | +++ b/drivers/ata/libata-scsi.c |
184 | @@ -295,7 +295,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) |
185 | scsi_cmd[8] = args[3]; |
186 | scsi_cmd[10] = args[4]; |
187 | scsi_cmd[12] = args[5]; |
188 | - scsi_cmd[13] = args[6] & 0x0f; |
189 | + scsi_cmd[13] = args[6] & 0x4f; |
190 | scsi_cmd[14] = args[0]; |
191 | |
192 | /* Good values for timeout and retries? Values below |
193 | diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c |
194 | index 5cb2500..1ecad3e 100644 |
195 | --- a/drivers/hid/hid-core.c |
196 | +++ b/drivers/hid/hid-core.c |
197 | @@ -975,7 +975,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i |
198 | |
199 | if (size < rsize) { |
200 | dbg("report %d is too short, (%d < %d)", report->id, size, rsize); |
201 | - return -1; |
202 | + memset(data + size, 0, rsize - size); |
203 | } |
204 | |
205 | if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event) |
206 | diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c |
207 | index 99d1c43..d6ff4f2 100644 |
208 | --- a/drivers/ide/ide-io.c |
209 | +++ b/drivers/ide/ide-io.c |
210 | @@ -519,21 +519,24 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 |
211 | if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0) |
212 | try_to_flush_leftover_data(drive); |
213 | |
214 | + if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) { |
215 | + ide_kill_rq(drive, rq); |
216 | + return ide_stopped; |
217 | + } |
218 | + |
219 | if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) |
220 | - /* force an abort */ |
221 | - hwif->OUTB(WIN_IDLEIMMEDIATE, IDE_COMMAND_REG); |
222 | + rq->errors |= ERROR_RESET; |
223 | |
224 | - if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) |
225 | - ide_kill_rq(drive, rq); |
226 | - else { |
227 | - if ((rq->errors & ERROR_RESET) == ERROR_RESET) { |
228 | - ++rq->errors; |
229 | - return ide_do_reset(drive); |
230 | - } |
231 | - if ((rq->errors & ERROR_RECAL) == ERROR_RECAL) |
232 | - drive->special.b.recalibrate = 1; |
233 | + if ((rq->errors & ERROR_RESET) == ERROR_RESET) { |
234 | ++rq->errors; |
235 | + return ide_do_reset(drive); |
236 | } |
237 | + |
238 | + if ((rq->errors & ERROR_RECAL) == ERROR_RECAL) |
239 | + drive->special.b.recalibrate = 1; |
240 | + |
241 | + ++rq->errors; |
242 | + |
243 | return ide_stopped; |
244 | } |
245 | |
246 | @@ -1025,6 +1028,13 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) |
247 | if (!drive->special.all) { |
248 | ide_driver_t *drv; |
249 | |
250 | + /* |
251 | + * We reset the drive so we need to issue a SETFEATURES. |
252 | + * Do it _after_ do_special() restored device parameters. |
253 | + */ |
254 | + if (drive->current_speed == 0xff) |
255 | + ide_config_drive_speed(drive, drive->desired_speed); |
256 | + |
257 | if (rq->cmd_type == REQ_TYPE_ATA_CMD || |
258 | rq->cmd_type == REQ_TYPE_ATA_TASK || |
259 | rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
260 | diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c |
261 | index 59b10a0..133d9cd 100644 |
262 | --- a/drivers/ide/ide-iops.c |
263 | +++ b/drivers/ide/ide-iops.c |
264 | @@ -1123,6 +1123,9 @@ static void pre_reset(ide_drive_t *drive) |
265 | if (HWIF(drive)->pre_reset != NULL) |
266 | HWIF(drive)->pre_reset(drive); |
267 | |
268 | + if (drive->current_speed != 0xff) |
269 | + drive->desired_speed = drive->current_speed; |
270 | + drive->current_speed = 0xff; |
271 | } |
272 | |
273 | /* |
274 | diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c |
275 | index 059704f..cef1287 100644 |
276 | --- a/drivers/md/bitmap.c |
277 | +++ b/drivers/md/bitmap.c |
278 | @@ -863,9 +863,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) |
279 | |
280 | /* We need 4 bits per page, rounded up to a multiple of sizeof(unsigned long) */ |
281 | bitmap->filemap_attr = kzalloc( |
282 | - (((num_pages*4/8)+sizeof(unsigned long)-1) |
283 | - /sizeof(unsigned long)) |
284 | - *sizeof(unsigned long), |
285 | + roundup( DIV_ROUND_UP(num_pages*4, 8), sizeof(unsigned long)), |
286 | GFP_KERNEL); |
287 | if (!bitmap->filemap_attr) |
288 | goto out; |
289 | diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c |
290 | index 4c27a2d..ccc429c 100644 |
291 | --- a/drivers/media/dvb/frontends/tda10086.c |
292 | +++ b/drivers/media/dvb/frontends/tda10086.c |
293 | @@ -212,7 +212,7 @@ static int tda10086_send_master_cmd (struct dvb_frontend* fe, |
294 | for(i=0; i< cmd->msg_len; i++) { |
295 | tda10086_write_byte(state, 0x48+i, cmd->msg[i]); |
296 | } |
297 | - tda10086_write_byte(state, 0x36, 0x08 | ((cmd->msg_len + 1) << 4)); |
298 | + tda10086_write_byte(state, 0x36, 0x08 | ((cmd->msg_len - 1) << 4)); |
299 | |
300 | tda10086_diseqc_wait(state); |
301 | |
302 | diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c |
303 | index ffda71d..058df5c 100644 |
304 | --- a/drivers/media/dvb/pluto2/pluto2.c |
305 | +++ b/drivers/media/dvb/pluto2/pluto2.c |
306 | @@ -149,6 +149,15 @@ static inline void pluto_rw(struct pluto *pluto, u32 reg, u32 mask, u32 bits) |
307 | writel(val, &pluto->io_mem[reg]); |
308 | } |
309 | |
310 | +static void pluto_write_tscr(struct pluto *pluto, u32 val) |
311 | +{ |
312 | + /* set the number of packets */ |
313 | + val &= ~TSCR_ADEF; |
314 | + val |= TS_DMA_PACKETS / 2; |
315 | + |
316 | + pluto_writereg(pluto, REG_TSCR, val); |
317 | +} |
318 | + |
319 | static void pluto_setsda(void *data, int state) |
320 | { |
321 | struct pluto *pluto = data; |
322 | @@ -213,11 +222,11 @@ static void pluto_reset_ts(struct pluto *pluto, int reenable) |
323 | |
324 | if (val & TSCR_RSTN) { |
325 | val &= ~TSCR_RSTN; |
326 | - pluto_writereg(pluto, REG_TSCR, val); |
327 | + pluto_write_tscr(pluto, val); |
328 | } |
329 | if (reenable) { |
330 | val |= TSCR_RSTN; |
331 | - pluto_writereg(pluto, REG_TSCR, val); |
332 | + pluto_write_tscr(pluto, val); |
333 | } |
334 | } |
335 | |
336 | @@ -339,7 +348,7 @@ static irqreturn_t pluto_irq(int irq, void *dev_id) |
337 | } |
338 | |
339 | /* ACK the interrupt */ |
340 | - pluto_writereg(pluto, REG_TSCR, tscr | TSCR_IACK); |
341 | + pluto_write_tscr(pluto, tscr | TSCR_IACK); |
342 | |
343 | return IRQ_HANDLED; |
344 | } |
345 | @@ -348,9 +357,6 @@ static void __devinit pluto_enable_irqs(struct pluto *pluto) |
346 | { |
347 | u32 val = pluto_readreg(pluto, REG_TSCR); |
348 | |
349 | - /* set the number of packets */ |
350 | - val &= ~TSCR_ADEF; |
351 | - val |= TS_DMA_PACKETS / 2; |
352 | /* disable AFUL and LOCK interrupts */ |
353 | val |= (TSCR_MSKA | TSCR_MSKL); |
354 | /* enable DMA and OVERFLOW interrupts */ |
355 | @@ -358,7 +364,7 @@ static void __devinit pluto_enable_irqs(struct pluto *pluto) |
356 | /* clear pending interrupts */ |
357 | val |= TSCR_IACK; |
358 | |
359 | - pluto_writereg(pluto, REG_TSCR, val); |
360 | + pluto_write_tscr(pluto, val); |
361 | } |
362 | |
363 | static void pluto_disable_irqs(struct pluto *pluto) |
364 | @@ -370,7 +376,7 @@ static void pluto_disable_irqs(struct pluto *pluto) |
365 | /* clear pending interrupts */ |
366 | val |= TSCR_IACK; |
367 | |
368 | - pluto_writereg(pluto, REG_TSCR, val); |
369 | + pluto_write_tscr(pluto, val); |
370 | } |
371 | |
372 | static int __devinit pluto_hw_init(struct pluto *pluto) |
373 | diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c |
374 | index 35ad5cf..99304b2 100644 |
375 | --- a/drivers/net/8139too.c |
376 | +++ b/drivers/net/8139too.c |
377 | @@ -1109,6 +1109,8 @@ static void __devexit rtl8139_remove_one (struct pci_dev *pdev) |
378 | |
379 | assert (dev != NULL); |
380 | |
381 | + flush_scheduled_work(); |
382 | + |
383 | unregister_netdev (dev); |
384 | |
385 | __rtl8139_cleanup_dev (dev); |
386 | @@ -1603,18 +1605,21 @@ static void rtl8139_thread (struct work_struct *work) |
387 | struct net_device *dev = tp->mii.dev; |
388 | unsigned long thr_delay = next_tick; |
389 | |
390 | + rtnl_lock(); |
391 | + |
392 | + if (!netif_running(dev)) |
393 | + goto out_unlock; |
394 | + |
395 | if (tp->watchdog_fired) { |
396 | tp->watchdog_fired = 0; |
397 | rtl8139_tx_timeout_task(work); |
398 | - } else if (rtnl_trylock()) { |
399 | - rtl8139_thread_iter (dev, tp, tp->mmio_addr); |
400 | - rtnl_unlock (); |
401 | - } else { |
402 | - /* unlikely race. mitigate with fast poll. */ |
403 | - thr_delay = HZ / 2; |
404 | - } |
405 | + } else |
406 | + rtl8139_thread_iter(dev, tp, tp->mmio_addr); |
407 | |
408 | - schedule_delayed_work(&tp->thread, thr_delay); |
409 | + if (tp->have_thread) |
410 | + schedule_delayed_work(&tp->thread, thr_delay); |
411 | +out_unlock: |
412 | + rtnl_unlock (); |
413 | } |
414 | |
415 | static void rtl8139_start_thread(struct rtl8139_private *tp) |
416 | @@ -1626,19 +1631,11 @@ static void rtl8139_start_thread(struct rtl8139_private *tp) |
417 | return; |
418 | |
419 | tp->have_thread = 1; |
420 | + tp->watchdog_fired = 0; |
421 | |
422 | schedule_delayed_work(&tp->thread, next_tick); |
423 | } |
424 | |
425 | -static void rtl8139_stop_thread(struct rtl8139_private *tp) |
426 | -{ |
427 | - if (tp->have_thread) { |
428 | - cancel_rearming_delayed_work(&tp->thread); |
429 | - tp->have_thread = 0; |
430 | - } else |
431 | - flush_scheduled_work(); |
432 | -} |
433 | - |
434 | static inline void rtl8139_tx_clear (struct rtl8139_private *tp) |
435 | { |
436 | tp->cur_tx = 0; |
437 | @@ -1696,12 +1693,11 @@ static void rtl8139_tx_timeout (struct net_device *dev) |
438 | { |
439 | struct rtl8139_private *tp = netdev_priv(dev); |
440 | |
441 | + tp->watchdog_fired = 1; |
442 | if (!tp->have_thread) { |
443 | - INIT_DELAYED_WORK(&tp->thread, rtl8139_tx_timeout_task); |
444 | + INIT_DELAYED_WORK(&tp->thread, rtl8139_thread); |
445 | schedule_delayed_work(&tp->thread, next_tick); |
446 | - } else |
447 | - tp->watchdog_fired = 1; |
448 | - |
449 | + } |
450 | } |
451 | |
452 | static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) |
453 | @@ -2233,8 +2229,6 @@ static int rtl8139_close (struct net_device *dev) |
454 | |
455 | netif_stop_queue (dev); |
456 | |
457 | - rtl8139_stop_thread(tp); |
458 | - |
459 | if (netif_msg_ifdown(tp)) |
460 | printk(KERN_DEBUG "%s: Shutting down ethercard, status was 0x%4.4x.\n", |
461 | dev->name, RTL_R16 (IntrStatus)); |
462 | diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c |
463 | index ca2b21f..07b4c0d 100644 |
464 | --- a/drivers/net/ifb.c |
465 | +++ b/drivers/net/ifb.c |
466 | @@ -96,17 +96,24 @@ static void ri_tasklet(unsigned long dev) |
467 | skb->tc_verd = SET_TC_NCLS(skb->tc_verd); |
468 | stats->tx_packets++; |
469 | stats->tx_bytes +=skb->len; |
470 | + |
471 | + skb->dev = __dev_get_by_index(skb->iif); |
472 | + if (!skb->dev) { |
473 | + dev_kfree_skb(skb); |
474 | + stats->tx_dropped++; |
475 | + break; |
476 | + } |
477 | + skb->iif = _dev->ifindex; |
478 | + |
479 | if (from & AT_EGRESS) { |
480 | dp->st_rx_frm_egr++; |
481 | dev_queue_xmit(skb); |
482 | } else if (from & AT_INGRESS) { |
483 | - |
484 | dp->st_rx_frm_ing++; |
485 | + skb_pull(skb, skb->dev->hard_header_len); |
486 | netif_rx(skb); |
487 | - } else { |
488 | - dev_kfree_skb(skb); |
489 | - stats->tx_dropped++; |
490 | - } |
491 | + } else |
492 | + BUG(); |
493 | } |
494 | |
495 | if (netif_tx_trylock(_dev)) { |
496 | @@ -157,26 +164,10 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev) |
497 | stats->rx_packets++; |
498 | stats->rx_bytes+=skb->len; |
499 | |
500 | - if (!from || !skb->input_dev) { |
501 | -dropped: |
502 | + if (!(from & (AT_INGRESS|AT_EGRESS)) || !skb->iif) { |
503 | dev_kfree_skb(skb); |
504 | stats->rx_dropped++; |
505 | return ret; |
506 | - } else { |
507 | - /* |
508 | - * note we could be going |
509 | - * ingress -> egress or |
510 | - * egress -> ingress |
511 | - */ |
512 | - skb->dev = skb->input_dev; |
513 | - skb->input_dev = dev; |
514 | - if (from & AT_INGRESS) { |
515 | - skb_pull(skb, skb->dev->hard_header_len); |
516 | - } else { |
517 | - if (!(from & AT_EGRESS)) { |
518 | - goto dropped; |
519 | - } |
520 | - } |
521 | } |
522 | |
523 | if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) { |
524 | diff --git a/drivers/net/skge.c b/drivers/net/skge.c |
525 | index 45283f3..9bc9427 100644 |
526 | --- a/drivers/net/skge.c |
527 | +++ b/drivers/net/skge.c |
528 | @@ -2462,6 +2462,7 @@ static int skge_down(struct net_device *dev) |
529 | printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); |
530 | |
531 | netif_stop_queue(dev); |
532 | + netif_carrier_off(dev); |
533 | if (hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC) |
534 | cancel_rearming_delayed_work(&skge->link_thread); |
535 | |
536 | diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c |
537 | index f44c397..38e75cf 100644 |
538 | --- a/drivers/net/sky2.c |
539 | +++ b/drivers/net/sky2.c |
540 | @@ -524,9 +524,9 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) |
541 | ledover &= ~PHY_M_LED_MO_RX; |
542 | } |
543 | |
544 | - if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev == CHIP_REV_YU_EC_A1) { |
545 | + if (hw->chip_id == CHIP_ID_YUKON_EC_U && |
546 | + hw->chip_rev == CHIP_REV_YU_EC_U_A1) { |
547 | /* apply fixes in PHY AFE */ |
548 | - pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); |
549 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 255); |
550 | |
551 | /* increase differential signal amplitude in 10BASE-T */ |
552 | @@ -538,7 +538,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) |
553 | gm_phy_write(hw, port, 0x17, 0x2002); |
554 | |
555 | /* set page register to 0 */ |
556 | - gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); |
557 | + gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0); |
558 | } else { |
559 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); |
560 | |
561 | @@ -1506,6 +1506,7 @@ static int sky2_down(struct net_device *dev) |
562 | |
563 | /* Stop more packets from being queued */ |
564 | netif_stop_queue(dev); |
565 | + netif_carrier_off(dev); |
566 | |
567 | /* Disable port IRQ */ |
568 | imask = sky2_read32(hw, B0_IMSK); |
569 | @@ -1802,38 +1803,22 @@ static void sky2_tx_timeout(struct net_device *dev) |
570 | { |
571 | struct sky2_port *sky2 = netdev_priv(dev); |
572 | struct sky2_hw *hw = sky2->hw; |
573 | - unsigned txq = txqaddr[sky2->port]; |
574 | - u16 report, done; |
575 | + unsigned port = sky2->port; |
576 | |
577 | if (netif_msg_timer(sky2)) |
578 | printk(KERN_ERR PFX "%s: tx timeout\n", dev->name); |
579 | |
580 | - report = sky2_read16(hw, sky2->port == 0 ? STAT_TXA1_RIDX : STAT_TXA2_RIDX); |
581 | - done = sky2_read16(hw, Q_ADDR(txq, Q_DONE)); |
582 | - |
583 | - printk(KERN_DEBUG PFX "%s: transmit ring %u .. %u report=%u done=%u\n", |
584 | - dev->name, |
585 | - sky2->tx_cons, sky2->tx_prod, report, done); |
586 | - |
587 | - if (report != done) { |
588 | - printk(KERN_INFO PFX "status burst pending (irq moderation?)\n"); |
589 | - |
590 | - sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP); |
591 | - sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START); |
592 | - } else if (report != sky2->tx_cons) { |
593 | - printk(KERN_INFO PFX "status report lost?\n"); |
594 | - sky2_tx_complete(sky2, report); |
595 | - } else { |
596 | - printk(KERN_INFO PFX "hardware hung? flushing\n"); |
597 | - |
598 | - sky2_write32(hw, Q_ADDR(txq, Q_CSR), BMU_STOP); |
599 | - sky2_write32(hw, Y2_QADDR(txq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); |
600 | + /* Get information for bug report :-) */ |
601 | + printk(KERN_INFO PFX "%s: transmit ring %u .. %u report=%u done=%u\n", |
602 | + dev->name, sky2->tx_cons, sky2->tx_prod, |
603 | + sky2_read16(hw, port == 0 ? STAT_TXA1_RIDX : STAT_TXA2_RIDX), |
604 | + sky2_read16(hw, Q_ADDR(txqaddr[sky2->port], Q_DONE))); |
605 | |
606 | - sky2_tx_complete(sky2, sky2->tx_prod); |
607 | + printk(KERN_INFO PFX "gmac control %#x status %#x\n", |
608 | + gma_read16(hw, port, GM_GP_CTRL), gma_read16(hw, port, GM_GP_STAT)); |
609 | |
610 | - sky2_qset(hw, txq); |
611 | - sky2_prefetch_init(hw, txq, sky2->tx_le_map, TX_RING_SIZE - 1); |
612 | - } |
613 | + /* can't restart safely under softirq */ |
614 | + schedule_work(&hw->restart_work); |
615 | } |
616 | |
617 | static int sky2_change_mtu(struct net_device *dev, int new_mtu) |
618 | @@ -2436,6 +2421,10 @@ static int sky2_reset(struct sky2_hw *hw) |
619 | return -EOPNOTSUPP; |
620 | } |
621 | |
622 | + /* Make sure and enable all clocks */ |
623 | + if (hw->chip_id == CHIP_ID_YUKON_EC_U) |
624 | + sky2_pci_write32(hw, PCI_DEV_REG3, 0); |
625 | + |
626 | hw->chip_rev = (sky2_read8(hw, B2_MAC_CFG) & CFG_CHIP_R_MSK) >> 4; |
627 | |
628 | /* This rev is really old, and requires untested workarounds */ |
629 | @@ -2565,6 +2554,49 @@ static int sky2_reset(struct sky2_hw *hw) |
630 | return 0; |
631 | } |
632 | |
633 | +static void sky2_restart(struct work_struct *work) |
634 | +{ |
635 | + struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work); |
636 | + struct net_device *dev; |
637 | + int i, err; |
638 | + |
639 | + dev_dbg(&hw->pdev->dev, "restarting\n"); |
640 | + |
641 | + del_timer_sync(&hw->idle_timer); |
642 | + |
643 | + rtnl_lock(); |
644 | + sky2_write32(hw, B0_IMSK, 0); |
645 | + sky2_read32(hw, B0_IMSK); |
646 | + |
647 | + netif_poll_disable(hw->dev[0]); |
648 | + |
649 | + for (i = 0; i < hw->ports; i++) { |
650 | + dev = hw->dev[i]; |
651 | + if (netif_running(dev)) |
652 | + sky2_down(dev); |
653 | + } |
654 | + |
655 | + sky2_reset(hw); |
656 | + sky2_write32(hw, B0_IMSK, Y2_IS_BASE); |
657 | + netif_poll_enable(hw->dev[0]); |
658 | + |
659 | + for (i = 0; i < hw->ports; i++) { |
660 | + dev = hw->dev[i]; |
661 | + if (netif_running(dev)) { |
662 | + err = sky2_up(dev); |
663 | + if (err) { |
664 | + printk(KERN_INFO PFX "%s: could not restart %d\n", |
665 | + dev->name, err); |
666 | + dev_close(dev); |
667 | + } |
668 | + } |
669 | + } |
670 | + |
671 | + sky2_idle_start(hw); |
672 | + |
673 | + rtnl_unlock(); |
674 | +} |
675 | + |
676 | static u32 sky2_supported_modes(const struct sky2_hw *hw) |
677 | { |
678 | if (sky2_is_copper(hw)) { |
679 | @@ -3508,6 +3540,8 @@ static int __devinit sky2_probe(struct pci_dev *pdev, |
680 | } |
681 | |
682 | setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw); |
683 | + INIT_WORK(&hw->restart_work, sky2_restart); |
684 | + |
685 | sky2_idle_start(hw); |
686 | |
687 | pci_set_drvdata(pdev, hw); |
688 | @@ -3609,6 +3643,9 @@ static int sky2_resume(struct pci_dev *pdev) |
689 | |
690 | pci_restore_state(pdev); |
691 | pci_enable_wake(pdev, PCI_D0, 0); |
692 | + |
693 | + if (hw->chip_id == CHIP_ID_YUKON_EC_U) |
694 | + sky2_pci_write32(hw, PCI_DEV_REG3, 0); |
695 | sky2_set_power_state(hw, PCI_D0); |
696 | |
697 | err = sky2_reset(hw); |
698 | diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h |
699 | index 148aab2..5193714 100644 |
700 | --- a/drivers/net/sky2.h |
701 | +++ b/drivers/net/sky2.h |
702 | @@ -1898,6 +1898,7 @@ struct sky2_hw { |
703 | dma_addr_t st_dma; |
704 | |
705 | struct timer_list idle_timer; |
706 | + struct work_struct restart_work; |
707 | int msi; |
708 | wait_queue_head_t msi_wait; |
709 | }; |
710 | diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c |
711 | index 2ecb6ff..e71a8e6 100644 |
712 | --- a/drivers/scsi/scsi_error.c |
713 | +++ b/drivers/scsi/scsi_error.c |
714 | @@ -595,7 +595,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, |
715 | */ |
716 | if (copy_sense) { |
717 | if (!SCSI_SENSE_VALID(scmd)) { |
718 | - memcpy(scmd->sense_buffer, scmd->request_buffer, |
719 | + memcpy(scmd->sense_buffer, page_address(sgl.page), |
720 | sizeof(scmd->sense_buffer)); |
721 | } |
722 | __free_page(sgl.page); |
723 | diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c |
724 | index 51db118..b172b01 100644 |
725 | --- a/fs/binfmt_elf.c |
726 | +++ b/fs/binfmt_elf.c |
727 | @@ -1704,7 +1704,10 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file) |
728 | DUMP_SEEK(PAGE_SIZE); |
729 | } else { |
730 | if (page == ZERO_PAGE(addr)) { |
731 | - DUMP_SEEK(PAGE_SIZE); |
732 | + if (!dump_seek(file, PAGE_SIZE)) { |
733 | + page_cache_release(page); |
734 | + goto end_coredump; |
735 | + } |
736 | } else { |
737 | void *kaddr; |
738 | flush_cache_page(vma, addr, |
739 | diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c |
740 | index a4d933a..a852eb7 100644 |
741 | --- a/fs/binfmt_elf_fdpic.c |
742 | +++ b/fs/binfmt_elf_fdpic.c |
743 | @@ -1473,8 +1473,8 @@ static int elf_fdpic_dump_segments(struct file *file, struct mm_struct *mm, |
744 | DUMP_SEEK(file->f_pos + PAGE_SIZE); |
745 | } |
746 | else if (page == ZERO_PAGE(addr)) { |
747 | - DUMP_SEEK(file->f_pos + PAGE_SIZE); |
748 | page_cache_release(page); |
749 | + DUMP_SEEK(file->f_pos + PAGE_SIZE); |
750 | } |
751 | else { |
752 | void *kaddr; |
753 | diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c |
754 | index beaf25f..03ba5bc 100644 |
755 | --- a/fs/ext3/inode.c |
756 | +++ b/fs/ext3/inode.c |
757 | @@ -1148,102 +1148,37 @@ static int do_journal_get_write_access(handle_t *handle, |
758 | return ext3_journal_get_write_access(handle, bh); |
759 | } |
760 | |
761 | -/* |
762 | - * The idea of this helper function is following: |
763 | - * if prepare_write has allocated some blocks, but not all of them, the |
764 | - * transaction must include the content of the newly allocated blocks. |
765 | - * This content is expected to be set to zeroes by block_prepare_write(). |
766 | - * 2006/10/14 SAW |
767 | - */ |
768 | -static int ext3_prepare_failure(struct file *file, struct page *page, |
769 | - unsigned from, unsigned to) |
770 | -{ |
771 | - struct address_space *mapping; |
772 | - struct buffer_head *bh, *head, *next; |
773 | - unsigned block_start, block_end; |
774 | - unsigned blocksize; |
775 | - int ret; |
776 | - handle_t *handle = ext3_journal_current_handle(); |
777 | - |
778 | - mapping = page->mapping; |
779 | - if (ext3_should_writeback_data(mapping->host)) { |
780 | - /* optimization: no constraints about data */ |
781 | -skip: |
782 | - return ext3_journal_stop(handle); |
783 | - } |
784 | - |
785 | - head = page_buffers(page); |
786 | - blocksize = head->b_size; |
787 | - for ( bh = head, block_start = 0; |
788 | - bh != head || !block_start; |
789 | - block_start = block_end, bh = next) |
790 | - { |
791 | - next = bh->b_this_page; |
792 | - block_end = block_start + blocksize; |
793 | - if (block_end <= from) |
794 | - continue; |
795 | - if (block_start >= to) { |
796 | - block_start = to; |
797 | - break; |
798 | - } |
799 | - if (!buffer_mapped(bh)) |
800 | - /* prepare_write failed on this bh */ |
801 | - break; |
802 | - if (ext3_should_journal_data(mapping->host)) { |
803 | - ret = do_journal_get_write_access(handle, bh); |
804 | - if (ret) { |
805 | - ext3_journal_stop(handle); |
806 | - return ret; |
807 | - } |
808 | - } |
809 | - /* |
810 | - * block_start here becomes the first block where the current iteration |
811 | - * of prepare_write failed. |
812 | - */ |
813 | - } |
814 | - if (block_start <= from) |
815 | - goto skip; |
816 | - |
817 | - /* commit allocated and zeroed buffers */ |
818 | - return mapping->a_ops->commit_write(file, page, from, block_start); |
819 | -} |
820 | - |
821 | static int ext3_prepare_write(struct file *file, struct page *page, |
822 | unsigned from, unsigned to) |
823 | { |
824 | struct inode *inode = page->mapping->host; |
825 | - int ret, ret2; |
826 | - int needed_blocks = ext3_writepage_trans_blocks(inode); |
827 | + int ret, needed_blocks = ext3_writepage_trans_blocks(inode); |
828 | handle_t *handle; |
829 | int retries = 0; |
830 | |
831 | retry: |
832 | handle = ext3_journal_start(inode, needed_blocks); |
833 | - if (IS_ERR(handle)) |
834 | - return PTR_ERR(handle); |
835 | + if (IS_ERR(handle)) { |
836 | + ret = PTR_ERR(handle); |
837 | + goto out; |
838 | + } |
839 | if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode)) |
840 | ret = nobh_prepare_write(page, from, to, ext3_get_block); |
841 | else |
842 | ret = block_prepare_write(page, from, to, ext3_get_block); |
843 | if (ret) |
844 | - goto failure; |
845 | + goto prepare_write_failed; |
846 | |
847 | if (ext3_should_journal_data(inode)) { |
848 | ret = walk_page_buffers(handle, page_buffers(page), |
849 | from, to, NULL, do_journal_get_write_access); |
850 | - if (ret) |
851 | - /* fatal error, just put the handle and return */ |
852 | - journal_stop(handle); |
853 | } |
854 | - return ret; |
855 | - |
856 | -failure: |
857 | - ret2 = ext3_prepare_failure(file, page, from, to); |
858 | - if (ret2 < 0) |
859 | - return ret2; |
860 | +prepare_write_failed: |
861 | + if (ret) |
862 | + ext3_journal_stop(handle); |
863 | if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries)) |
864 | goto retry; |
865 | - /* retry number exceeded, or other error like -EDQUOT */ |
866 | +out: |
867 | return ret; |
868 | } |
869 | |
870 | diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
871 | index a127cc0..0a60ec5 100644 |
872 | --- a/fs/ext4/inode.c |
873 | +++ b/fs/ext4/inode.c |
874 | @@ -1147,102 +1147,37 @@ static int do_journal_get_write_access(handle_t *handle, |
875 | return ext4_journal_get_write_access(handle, bh); |
876 | } |
877 | |
878 | -/* |
879 | - * The idea of this helper function is following: |
880 | - * if prepare_write has allocated some blocks, but not all of them, the |
881 | - * transaction must include the content of the newly allocated blocks. |
882 | - * This content is expected to be set to zeroes by block_prepare_write(). |
883 | - * 2006/10/14 SAW |
884 | - */ |
885 | -static int ext4_prepare_failure(struct file *file, struct page *page, |
886 | - unsigned from, unsigned to) |
887 | -{ |
888 | - struct address_space *mapping; |
889 | - struct buffer_head *bh, *head, *next; |
890 | - unsigned block_start, block_end; |
891 | - unsigned blocksize; |
892 | - int ret; |
893 | - handle_t *handle = ext4_journal_current_handle(); |
894 | - |
895 | - mapping = page->mapping; |
896 | - if (ext4_should_writeback_data(mapping->host)) { |
897 | - /* optimization: no constraints about data */ |
898 | -skip: |
899 | - return ext4_journal_stop(handle); |
900 | - } |
901 | - |
902 | - head = page_buffers(page); |
903 | - blocksize = head->b_size; |
904 | - for ( bh = head, block_start = 0; |
905 | - bh != head || !block_start; |
906 | - block_start = block_end, bh = next) |
907 | - { |
908 | - next = bh->b_this_page; |
909 | - block_end = block_start + blocksize; |
910 | - if (block_end <= from) |
911 | - continue; |
912 | - if (block_start >= to) { |
913 | - block_start = to; |
914 | - break; |
915 | - } |
916 | - if (!buffer_mapped(bh)) |
917 | - /* prepare_write failed on this bh */ |
918 | - break; |
919 | - if (ext4_should_journal_data(mapping->host)) { |
920 | - ret = do_journal_get_write_access(handle, bh); |
921 | - if (ret) { |
922 | - ext4_journal_stop(handle); |
923 | - return ret; |
924 | - } |
925 | - } |
926 | - /* |
927 | - * block_start here becomes the first block where the current iteration |
928 | - * of prepare_write failed. |
929 | - */ |
930 | - } |
931 | - if (block_start <= from) |
932 | - goto skip; |
933 | - |
934 | - /* commit allocated and zeroed buffers */ |
935 | - return mapping->a_ops->commit_write(file, page, from, block_start); |
936 | -} |
937 | - |
938 | static int ext4_prepare_write(struct file *file, struct page *page, |
939 | unsigned from, unsigned to) |
940 | { |
941 | struct inode *inode = page->mapping->host; |
942 | - int ret, ret2; |
943 | - int needed_blocks = ext4_writepage_trans_blocks(inode); |
944 | + int ret, needed_blocks = ext4_writepage_trans_blocks(inode); |
945 | handle_t *handle; |
946 | int retries = 0; |
947 | |
948 | retry: |
949 | handle = ext4_journal_start(inode, needed_blocks); |
950 | - if (IS_ERR(handle)) |
951 | - return PTR_ERR(handle); |
952 | + if (IS_ERR(handle)) { |
953 | + ret = PTR_ERR(handle); |
954 | + goto out; |
955 | + } |
956 | if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode)) |
957 | ret = nobh_prepare_write(page, from, to, ext4_get_block); |
958 | else |
959 | ret = block_prepare_write(page, from, to, ext4_get_block); |
960 | if (ret) |
961 | - goto failure; |
962 | + goto prepare_write_failed; |
963 | |
964 | if (ext4_should_journal_data(inode)) { |
965 | ret = walk_page_buffers(handle, page_buffers(page), |
966 | from, to, NULL, do_journal_get_write_access); |
967 | - if (ret) |
968 | - /* fatal error, just put the handle and return */ |
969 | - ext4_journal_stop(handle); |
970 | } |
971 | - return ret; |
972 | - |
973 | -failure: |
974 | - ret2 = ext4_prepare_failure(file, page, from, to); |
975 | - if (ret2 < 0) |
976 | - return ret2; |
977 | +prepare_write_failed: |
978 | + if (ret) |
979 | + ext4_journal_stop(handle); |
980 | if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) |
981 | goto retry; |
982 | - /* retry number exceeded, or other error like -EDQUOT */ |
983 | +out: |
984 | return ret; |
985 | } |
986 | |
987 | diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c |
988 | index e695660..c1ba275 100644 |
989 | --- a/fs/nfsd/nfs3xdr.c |
990 | +++ b/fs/nfsd/nfs3xdr.c |
991 | @@ -844,8 +844,8 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, |
992 | #define NFS3_ENTRY_BAGGAGE (2 + 1 + 2 + 1) |
993 | #define NFS3_ENTRYPLUS_BAGGAGE (1 + 21 + 1 + (NFS3_FHSIZE >> 2)) |
994 | static int |
995 | -encode_entry(struct readdir_cd *ccd, const char *name, |
996 | - int namlen, off_t offset, ino_t ino, unsigned int d_type, int plus) |
997 | +encode_entry(struct readdir_cd *ccd, const char *name, int namlen, |
998 | + loff_t offset, ino_t ino, unsigned int d_type, int plus) |
999 | { |
1000 | struct nfsd3_readdirres *cd = container_of(ccd, struct nfsd3_readdirres, |
1001 | common); |
1002 | @@ -865,7 +865,7 @@ encode_entry(struct readdir_cd *ccd, const char *name, |
1003 | *cd->offset1 = htonl(offset64 & 0xffffffff); |
1004 | cd->offset1 = NULL; |
1005 | } else { |
1006 | - xdr_encode_hyper(cd->offset, (u64) offset); |
1007 | + xdr_encode_hyper(cd->offset, offset64); |
1008 | } |
1009 | } |
1010 | |
1011 | diff --git a/include/linux/ide.h b/include/linux/ide.h |
1012 | index 3808698..63e111e 100644 |
1013 | --- a/include/linux/ide.h |
1014 | +++ b/include/linux/ide.h |
1015 | @@ -607,6 +607,7 @@ typedef struct ide_drive_s { |
1016 | u8 init_speed; /* transfer rate set at boot */ |
1017 | u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ |
1018 | u8 current_speed; /* current transfer rate set */ |
1019 | + u8 desired_speed; /* desired transfer rate set */ |
1020 | u8 dn; /* now wide spread use */ |
1021 | u8 wcache; /* status of write cache */ |
1022 | u8 acoustic; /* acoustic management */ |
1023 | diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
1024 | index 4ff3940..82f43ad 100644 |
1025 | --- a/include/linux/skbuff.h |
1026 | +++ b/include/linux/skbuff.h |
1027 | @@ -188,7 +188,7 @@ enum { |
1028 | * @sk: Socket we are owned by |
1029 | * @tstamp: Time we arrived |
1030 | * @dev: Device we arrived on/are leaving by |
1031 | - * @input_dev: Device we arrived on |
1032 | + * @iif: ifindex of device we arrived on |
1033 | * @h: Transport layer header |
1034 | * @nh: Network layer header |
1035 | * @mac: Link layer header |
1036 | @@ -235,7 +235,8 @@ struct sk_buff { |
1037 | struct sock *sk; |
1038 | struct skb_timeval tstamp; |
1039 | struct net_device *dev; |
1040 | - struct net_device *input_dev; |
1041 | + int iif; |
1042 | + /* 4 byte hole on 64 bit*/ |
1043 | |
1044 | union { |
1045 | struct tcphdr *th; |
1046 | diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h |
1047 | index b902d24..02647fe 100644 |
1048 | --- a/include/net/pkt_cls.h |
1049 | +++ b/include/net/pkt_cls.h |
1050 | @@ -352,10 +352,13 @@ tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) |
1051 | static inline int |
1052 | tcf_match_indev(struct sk_buff *skb, char *indev) |
1053 | { |
1054 | + struct net_device *dev; |
1055 | + |
1056 | if (indev[0]) { |
1057 | - if (!skb->input_dev) |
1058 | + if (!skb->iif) |
1059 | return 0; |
1060 | - if (strcmp(indev, skb->input_dev->name)) |
1061 | + dev = __dev_get_by_index(skb->iif); |
1062 | + if (!dev || strcmp(indev, dev->name)) |
1063 | return 0; |
1064 | } |
1065 | |
1066 | diff --git a/net/core/dev.c b/net/core/dev.c |
1067 | index 295f8f9..2a587b8 100644 |
1068 | --- a/net/core/dev.c |
1069 | +++ b/net/core/dev.c |
1070 | @@ -1741,8 +1741,8 @@ static int ing_filter(struct sk_buff *skb) |
1071 | if (dev->qdisc_ingress) { |
1072 | __u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd); |
1073 | if (MAX_RED_LOOP < ttl++) { |
1074 | - printk(KERN_WARNING "Redir loop detected Dropping packet (%s->%s)\n", |
1075 | - skb->input_dev->name, skb->dev->name); |
1076 | + printk(KERN_WARNING "Redir loop detected Dropping packet (%d->%d)\n", |
1077 | + skb->iif, skb->dev->ifindex); |
1078 | return TC_ACT_SHOT; |
1079 | } |
1080 | |
1081 | @@ -1775,8 +1775,8 @@ int netif_receive_skb(struct sk_buff *skb) |
1082 | if (!skb->tstamp.off_sec) |
1083 | net_timestamp(skb); |
1084 | |
1085 | - if (!skb->input_dev) |
1086 | - skb->input_dev = skb->dev; |
1087 | + if (!skb->iif) |
1088 | + skb->iif = skb->dev->ifindex; |
1089 | |
1090 | orig_dev = skb_bond(skb); |
1091 | |
1092 | diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
1093 | index 5299083..ba94969 100644 |
1094 | --- a/net/core/skbuff.c |
1095 | +++ b/net/core/skbuff.c |
1096 | @@ -497,7 +497,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) |
1097 | n->tc_verd = SET_TC_VERD(skb->tc_verd,0); |
1098 | n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd); |
1099 | n->tc_verd = CLR_TC_MUNGED(n->tc_verd); |
1100 | - C(input_dev); |
1101 | + C(iif); |
1102 | #endif |
1103 | skb_copy_secmark(n, skb); |
1104 | #endif |
1105 | diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c |
1106 | index fa2f7da..fb58e03 100644 |
1107 | --- a/net/ieee80211/softmac/ieee80211softmac_wx.c |
1108 | +++ b/net/ieee80211/softmac/ieee80211softmac_wx.c |
1109 | @@ -265,6 +265,12 @@ ieee80211softmac_wx_get_rate(struct net_device *net_dev, |
1110 | int err = -EINVAL; |
1111 | |
1112 | spin_lock_irqsave(&mac->lock, flags); |
1113 | + |
1114 | + if (unlikely(!mac->running)) { |
1115 | + err = -ENODEV; |
1116 | + goto out_unlock; |
1117 | + } |
1118 | + |
1119 | switch (mac->txrates.default_rate) { |
1120 | case IEEE80211_CCK_RATE_1MB: |
1121 | data->bitrate.value = 1000000; |
1122 | diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c |
1123 | index b1c1116..9a37db2 100644 |
1124 | --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c |
1125 | +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c |
1126 | @@ -409,12 +409,10 @@ checkentry(const char *tablename, |
1127 | "has invalid config pointer!\n"); |
1128 | return 0; |
1129 | } |
1130 | - clusterip_config_entry_get(cipinfo->config); |
1131 | } else { |
1132 | /* Case B: This is a new rule referring to an existing |
1133 | * clusterip config. */ |
1134 | cipinfo->config = config; |
1135 | - clusterip_config_entry_get(cipinfo->config); |
1136 | } |
1137 | } else { |
1138 | /* Case C: This is a completely new clusterip config */ |
1139 | diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c |
1140 | index 1951eaa..340bcdd 100644 |
1141 | --- a/net/ipv4/tcp_output.c |
1142 | +++ b/net/ipv4/tcp_output.c |
1143 | @@ -943,7 +943,8 @@ static void tcp_cwnd_validate(struct sock *sk, struct tcp_sock *tp) |
1144 | if (tp->packets_out > tp->snd_cwnd_used) |
1145 | tp->snd_cwnd_used = tp->packets_out; |
1146 | |
1147 | - if ((s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= inet_csk(sk)->icsk_rto) |
1148 | + if (sysctl_tcp_slow_start_after_idle && |
1149 | + (s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= inet_csk(sk)->icsk_rto) |
1150 | tcp_cwnd_application_limited(sk); |
1151 | } |
1152 | } |
1153 | @@ -1607,6 +1608,9 @@ u32 __tcp_select_window(struct sock *sk) |
1154 | */ |
1155 | if (window <= free_space - mss || window > free_space) |
1156 | window = (free_space/mss)*mss; |
1157 | + else if (mss == full_space && |
1158 | + free_space > window + full_space/2) |
1159 | + window = free_space; |
1160 | } |
1161 | |
1162 | return window; |
1163 | diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c |
1164 | index 4ae1b19..9479fbd 100644 |
1165 | --- a/net/ipv6/raw.c |
1166 | +++ b/net/ipv6/raw.c |
1167 | @@ -688,9 +688,9 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, |
1168 | int err; |
1169 | |
1170 | /* Rough check on arithmetic overflow, |
1171 | - better check is made in ip6_build_xmit |
1172 | + better check is made in ip6_append_data(). |
1173 | */ |
1174 | - if (len < 0) |
1175 | + if (len > INT_MAX) |
1176 | return -EMSGSIZE; |
1177 | |
1178 | /* Mirror BSD error message compatibility */ |
1179 | diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c |
1180 | index f52a5c3..b5dc5db 100644 |
1181 | --- a/net/ipv6/udp.c |
1182 | +++ b/net/ipv6/udp.c |
1183 | @@ -616,7 +616,7 @@ do_udp_sendmsg: |
1184 | return udp_sendmsg(iocb, sk, msg, len); |
1185 | |
1186 | /* Rough check on arithmetic overflow, |
1187 | - better check is made in ip6_build_xmit |
1188 | + better check is made in ip6_append_data(). |
1189 | */ |
1190 | if (len > INT_MAX - sizeof(struct udphdr)) |
1191 | return -EMSGSIZE; |
1192 | diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c |
1193 | index 4838972..7263a2e 100644 |
1194 | --- a/net/sched/act_mirred.c |
1195 | +++ b/net/sched/act_mirred.c |
1196 | @@ -199,7 +199,7 @@ bad_mirred: |
1197 | skb2->tc_verd = SET_TC_FROM(skb2->tc_verd, at); |
1198 | |
1199 | skb2->dev = dev; |
1200 | - skb2->input_dev = skb->dev; |
1201 | + skb2->iif = skb->dev->ifindex; |
1202 | dev_queue_xmit(skb2); |
1203 | spin_unlock(&m->tcf_lock); |
1204 | return m->tcf_action; |
1205 | diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c |
1206 | index 5af8a59..49bb504 100644 |
1207 | --- a/net/sched/cls_tcindex.c |
1208 | +++ b/net/sched/cls_tcindex.c |
1209 | @@ -245,9 +245,9 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle, |
1210 | } |
1211 | |
1212 | if (tb[TCA_TCINDEX_SHIFT-1]) { |
1213 | - if (RTA_PAYLOAD(tb[TCA_TCINDEX_SHIFT-1]) < sizeof(u16)) |
1214 | + if (RTA_PAYLOAD(tb[TCA_TCINDEX_SHIFT-1]) < sizeof(int)) |
1215 | goto errout; |
1216 | - cp.shift = *(u16 *) RTA_DATA(tb[TCA_TCINDEX_SHIFT-1]); |
1217 | + cp.shift = *(int *) RTA_DATA(tb[TCA_TCINDEX_SHIFT-1]); |
1218 | } |
1219 | |
1220 | err = -EBUSY; |
1221 | diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c |
1222 | index f0f2c1a..7cd0f3c 100644 |
1223 | --- a/net/xfrm/xfrm_state.c |
1224 | +++ b/net/xfrm/xfrm_state.c |
1225 | @@ -1220,7 +1220,8 @@ int xfrm_replay_check(struct xfrm_state *x, __be32 net_seq) |
1226 | return 0; |
1227 | |
1228 | diff = x->replay.seq - seq; |
1229 | - if (diff >= x->props.replay_window) { |
1230 | + if (diff >= min_t(unsigned int, x->props.replay_window, |
1231 | + sizeof(x->replay.bitmap) * 8)) { |
1232 | x->stats.replay_window++; |
1233 | return -EINVAL; |
1234 | } |
1235 | diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c |
1236 | index 668a11a..6bc7e7c 100644 |
1237 | --- a/scripts/basic/fixdep.c |
1238 | +++ b/scripts/basic/fixdep.c |
1239 | @@ -28,9 +28,11 @@ |
1240 | * the dependency on linux/autoconf.h by a dependency on every config |
1241 | * option which is mentioned in any of the listed prequisites. |
1242 | * |
1243 | - * To be exact, split-include populates a tree in include/config/, |
1244 | - * e.g. include/config/his/driver.h, which contains the #define/#undef |
1245 | - * for the CONFIG_HIS_DRIVER option. |
1246 | + * kconfig populates a tree in include/config/ with an empty file |
1247 | + * for each config symbol and when the configuration is updated |
1248 | + * the files representing changed config options are touched |
1249 | + * which then let make pick up the changes and the files that use |
1250 | + * the config symbols are rebuilt. |
1251 | * |
1252 | * So if the user changes his CONFIG_HIS_DRIVER option, only the objects |
1253 | * which depend on "include/linux/config/his/driver.h" will be rebuilt, |
1254 | @@ -245,6 +247,8 @@ void parse_config_file(char *map, size_t len) |
1255 | continue; |
1256 | |
1257 | found: |
1258 | + if (!memcmp(q - 7, "_MODULE", 7)) |
1259 | + q -= 7; |
1260 | use_config(p+7, q-p-7); |
1261 | } |
1262 | } |