Annotation of /trunk/kernel26-alx/patches-2.6.23-r1/0108-2.6.23.9-all-fixes.patch
Parent Directory | Revision Log
Revision 658 -
(hide annotations)
(download)
Mon Jun 23 21:39:39 2008 UTC (15 years, 11 months ago) by niro
File size: 33140 byte(s)
Mon Jun 23 21:39:39 2008 UTC (15 years, 11 months ago) by niro
File size: 33140 byte(s)
2.6.23-alx-r1: new default as we fix the via epia clocksource=tsc quircks -linux-2.6.23.17 -fbcondecor-0.9.4 -squashfs-3.3 -unionfs-2.3.3 -ipw3945-1.2.2 -mptbase-vmware fix
1 | niro | 658 | diff --git a/arch/i386/lib/delay.c b/arch/i386/lib/delay.c |
2 | index f6edb11..66595ed 100644 | ||
3 | --- a/arch/i386/lib/delay.c | ||
4 | +++ b/arch/i386/lib/delay.c | ||
5 | @@ -12,6 +12,7 @@ | ||
6 | |||
7 | #include <linux/module.h> | ||
8 | #include <linux/sched.h> | ||
9 | +#include <linux/preempt.h> | ||
10 | #include <linux/delay.h> | ||
11 | |||
12 | #include <asm/processor.h> | ||
13 | @@ -42,11 +43,13 @@ static void delay_tsc(unsigned long loops) | ||
14 | { | ||
15 | unsigned long bclock, now; | ||
16 | |||
17 | + preempt_disable(); /* TSC's are per-cpu */ | ||
18 | rdtscl(bclock); | ||
19 | do { | ||
20 | rep_nop(); | ||
21 | rdtscl(now); | ||
22 | } while ((now-bclock) < loops); | ||
23 | + preempt_enable(); | ||
24 | } | ||
25 | |||
26 | /* | ||
27 | diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c | ||
28 | index 01437c4..91faa59 100644 | ||
29 | --- a/arch/i386/mm/pgtable.c | ||
30 | +++ b/arch/i386/mm/pgtable.c | ||
31 | @@ -97,8 +97,7 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) | ||
32 | } | ||
33 | pte = pte_offset_kernel(pmd, vaddr); | ||
34 | if (pgprot_val(flags)) | ||
35 | - /* <pfn,flags> stored as-is, to permit clearing entries */ | ||
36 | - set_pte(pte, pfn_pte(pfn, flags)); | ||
37 | + set_pte_present(&init_mm, vaddr, pte, pfn_pte(pfn, flags)); | ||
38 | else | ||
39 | pte_clear(&init_mm, vaddr, pte); | ||
40 | |||
41 | diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S | ||
42 | index 1d232e5..a6aad39 100644 | ||
43 | --- a/arch/x86_64/kernel/entry.S | ||
44 | +++ b/arch/x86_64/kernel/entry.S | ||
45 | @@ -989,7 +989,7 @@ child_rip: | ||
46 | movq %rsi, %rdi | ||
47 | call *%rax | ||
48 | # exit | ||
49 | - xorl %edi, %edi | ||
50 | + mov %eax, %edi | ||
51 | call do_exit | ||
52 | CFI_ENDPROC | ||
53 | ENDPROC(child_rip) | ||
54 | diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c | ||
55 | index 6d48a4e..4d0d1ac 100644 | ||
56 | --- a/arch/x86_64/kernel/time.c | ||
57 | +++ b/arch/x86_64/kernel/time.c | ||
58 | @@ -87,18 +87,15 @@ static int set_rtc_mmss(unsigned long nowtime) | ||
59 | int retval = 0; | ||
60 | int real_seconds, real_minutes, cmos_minutes; | ||
61 | unsigned char control, freq_select; | ||
62 | + unsigned long flags; | ||
63 | |||
64 | /* | ||
65 | - * IRQs are disabled when we're called from the timer interrupt, | ||
66 | - * no need for spin_lock_irqsave() | ||
67 | + * set_rtc_mmss is called when irqs are enabled, so disable irqs here | ||
68 | */ | ||
69 | - | ||
70 | - spin_lock(&rtc_lock); | ||
71 | - | ||
72 | + spin_lock_irqsave(&rtc_lock, flags); | ||
73 | /* | ||
74 | * Tell the clock it's being set and stop it. | ||
75 | */ | ||
76 | - | ||
77 | control = CMOS_READ(RTC_CONTROL); | ||
78 | CMOS_WRITE(control | RTC_SET, RTC_CONTROL); | ||
79 | |||
80 | @@ -143,7 +140,7 @@ static int set_rtc_mmss(unsigned long nowtime) | ||
81 | CMOS_WRITE(control, RTC_CONTROL); | ||
82 | CMOS_WRITE(freq_select, RTC_FREQ_SELECT); | ||
83 | |||
84 | - spin_unlock(&rtc_lock); | ||
85 | + spin_unlock_irqrestore(&rtc_lock, flags); | ||
86 | |||
87 | return retval; | ||
88 | } | ||
89 | diff --git a/arch/x86_64/lib/bitstr.c b/arch/x86_64/lib/bitstr.c | ||
90 | index 2467660..7445caf 100644 | ||
91 | --- a/arch/x86_64/lib/bitstr.c | ||
92 | +++ b/arch/x86_64/lib/bitstr.c | ||
93 | @@ -14,7 +14,7 @@ find_next_zero_string(unsigned long *bitmap, long start, long nbits, int len) | ||
94 | |||
95 | /* could test bitsliced, but it's hardly worth it */ | ||
96 | end = n+len; | ||
97 | - if (end >= nbits) | ||
98 | + if (end > nbits) | ||
99 | return -1; | ||
100 | for (i = n+1; i < end; i++) { | ||
101 | if (test_bit(i, bitmap)) { | ||
102 | diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c | ||
103 | index 2dbebd3..4d3f1f6 100644 | ||
104 | --- a/arch/x86_64/lib/delay.c | ||
105 | +++ b/arch/x86_64/lib/delay.c | ||
106 | @@ -10,7 +10,9 @@ | ||
107 | |||
108 | #include <linux/module.h> | ||
109 | #include <linux/sched.h> | ||
110 | +#include <linux/preempt.h> | ||
111 | #include <linux/delay.h> | ||
112 | + | ||
113 | #include <asm/delay.h> | ||
114 | #include <asm/msr.h> | ||
115 | |||
116 | @@ -27,14 +29,15 @@ int read_current_timer(unsigned long *timer_value) | ||
117 | void __delay(unsigned long loops) | ||
118 | { | ||
119 | unsigned bclock, now; | ||
120 | - | ||
121 | + | ||
122 | + preempt_disable(); /* TSC's are pre-cpu */ | ||
123 | rdtscl(bclock); | ||
124 | - do | ||
125 | - { | ||
126 | + do { | ||
127 | rep_nop(); | ||
128 | rdtscl(now); | ||
129 | } | ||
130 | - while((now-bclock) < loops); | ||
131 | + while ((now-bclock) < loops); | ||
132 | + preempt_enable(); | ||
133 | } | ||
134 | EXPORT_SYMBOL(__delay); | ||
135 | |||
136 | diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c | ||
137 | index 0416ffb..eff3b22 100644 | ||
138 | --- a/arch/x86_64/mm/pageattr.c | ||
139 | +++ b/arch/x86_64/mm/pageattr.c | ||
140 | @@ -148,6 +148,7 @@ __change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot, | ||
141 | split = split_large_page(address, prot, ref_prot2); | ||
142 | if (!split) | ||
143 | return -ENOMEM; | ||
144 | + pgprot_val(ref_prot2) &= ~_PAGE_NX; | ||
145 | set_pte(kpte, mk_pte(split, ref_prot2)); | ||
146 | kpte_page = split; | ||
147 | } | ||
148 | diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c | ||
149 | index d05891f..dad84c0 100644 | ||
150 | --- a/drivers/acpi/video.c | ||
151 | +++ b/drivers/acpi/video.c | ||
152 | @@ -1633,9 +1633,20 @@ static int | ||
153 | acpi_video_get_next_level(struct acpi_video_device *device, | ||
154 | u32 level_current, u32 event) | ||
155 | { | ||
156 | - int min, max, min_above, max_below, i, l; | ||
157 | + int min, max, min_above, max_below, i, l, delta = 255; | ||
158 | max = max_below = 0; | ||
159 | min = min_above = 255; | ||
160 | + /* Find closest level to level_current */ | ||
161 | + for (i = 0; i < device->brightness->count; i++) { | ||
162 | + l = device->brightness->levels[i]; | ||
163 | + if (abs(l - level_current) < abs(delta)) { | ||
164 | + delta = l - level_current; | ||
165 | + if (!delta) | ||
166 | + break; | ||
167 | + } | ||
168 | + } | ||
169 | + /* Ajust level_current to closest available level */ | ||
170 | + level_current += delta; | ||
171 | for (i = 0; i < device->brightness->count; i++) { | ||
172 | l = device->brightness->levels[i]; | ||
173 | if (l < min) | ||
174 | diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c | ||
175 | index 41c1d6e..e203974 100644 | ||
176 | --- a/drivers/ata/sata_sis.c | ||
177 | +++ b/drivers/ata/sata_sis.c | ||
178 | @@ -92,7 +92,7 @@ static struct scsi_host_template sis_sht = { | ||
179 | .queuecommand = ata_scsi_queuecmd, | ||
180 | .can_queue = ATA_DEF_QUEUE, | ||
181 | .this_id = ATA_SHT_THIS_ID, | ||
182 | - .sg_tablesize = ATA_MAX_PRD, | ||
183 | + .sg_tablesize = LIBATA_MAX_PRD, | ||
184 | .cmd_per_lun = ATA_SHT_CMD_PER_LUN, | ||
185 | .emulated = ATA_SHT_EMULATED, | ||
186 | .use_clustering = ATA_SHT_USE_CLUSTERING, | ||
187 | @@ -168,11 +168,11 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg) | ||
188 | return addr; | ||
189 | } | ||
190 | |||
191 | -static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg) | ||
192 | +static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg, u32 *val) | ||
193 | { | ||
194 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | ||
195 | unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg); | ||
196 | - u32 val, val2 = 0; | ||
197 | + u32 val2 = 0; | ||
198 | u8 pmr; | ||
199 | |||
200 | if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */ | ||
201 | @@ -180,13 +180,16 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg) | ||
202 | |||
203 | pci_read_config_byte(pdev, SIS_PMR, &pmr); | ||
204 | |||
205 | - pci_read_config_dword(pdev, cfg_addr, &val); | ||
206 | + pci_read_config_dword(pdev, cfg_addr, val); | ||
207 | |||
208 | if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || | ||
209 | (pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED)) | ||
210 | pci_read_config_dword(pdev, cfg_addr+0x10, &val2); | ||
211 | |||
212 | - return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */ | ||
213 | + *val |= val2; | ||
214 | + *val &= 0xfffffffb; /* avoid problems with powerdowned ports */ | ||
215 | + | ||
216 | + return 0; | ||
217 | } | ||
218 | |||
219 | static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 val) | ||
220 | @@ -216,7 +219,7 @@ static int sis_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | ||
221 | return -EINVAL; | ||
222 | |||
223 | if (ap->flags & SIS_FLAG_CFGSCR) | ||
224 | - return sis_scr_cfg_read(ap, sc_reg); | ||
225 | + return sis_scr_cfg_read(ap, sc_reg, val); | ||
226 | |||
227 | pci_read_config_byte(pdev, SIS_PMR, &pmr); | ||
228 | |||
229 | diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c | ||
230 | index 6a86958..fa4c990 100644 | ||
231 | --- a/drivers/crypto/geode-aes.c | ||
232 | +++ b/drivers/crypto/geode-aes.c | ||
233 | @@ -110,8 +110,7 @@ geode_aes_crypt(struct geode_aes_op *op) | ||
234 | * we don't need to worry | ||
235 | */ | ||
236 | |||
237 | - if (op->src == op->dst) | ||
238 | - flags |= (AES_CTRL_DCA | AES_CTRL_SCA); | ||
239 | + flags |= (AES_CTRL_DCA | AES_CTRL_SCA); | ||
240 | |||
241 | if (op->dir == AES_DIR_ENCRYPT) | ||
242 | flags |= AES_CTRL_ENCRYPT; | ||
243 | diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c | ||
244 | index 8248992..d59b2f4 100644 | ||
245 | --- a/drivers/dma/dmaengine.c | ||
246 | +++ b/drivers/dma/dmaengine.c | ||
247 | @@ -182,10 +182,9 @@ static void dma_client_chan_alloc(struct dma_client *client) | ||
248 | /* we are done once this client rejects | ||
249 | * an available resource | ||
250 | */ | ||
251 | - if (ack == DMA_ACK) { | ||
252 | + if (ack == DMA_ACK) | ||
253 | dma_chan_get(chan); | ||
254 | - kref_get(&device->refcount); | ||
255 | - } else if (ack == DMA_NAK) | ||
256 | + else if (ack == DMA_NAK) | ||
257 | return; | ||
258 | } | ||
259 | } | ||
260 | @@ -272,11 +271,8 @@ static void dma_clients_notify_removed(struct dma_chan *chan) | ||
261 | /* client was holding resources for this channel so | ||
262 | * free it | ||
263 | */ | ||
264 | - if (ack == DMA_ACK) { | ||
265 | + if (ack == DMA_ACK) | ||
266 | dma_chan_put(chan); | ||
267 | - kref_put(&chan->device->refcount, | ||
268 | - dma_async_device_cleanup); | ||
269 | - } | ||
270 | } | ||
271 | |||
272 | mutex_unlock(&dma_list_mutex); | ||
273 | @@ -316,11 +312,8 @@ void dma_async_client_unregister(struct dma_client *client) | ||
274 | ack = client->event_callback(client, chan, | ||
275 | DMA_RESOURCE_REMOVED); | ||
276 | |||
277 | - if (ack == DMA_ACK) { | ||
278 | + if (ack == DMA_ACK) | ||
279 | dma_chan_put(chan); | ||
280 | - kref_put(&chan->device->refcount, | ||
281 | - dma_async_device_cleanup); | ||
282 | - } | ||
283 | } | ||
284 | |||
285 | list_del(&client->global_node); | ||
286 | @@ -397,6 +390,8 @@ int dma_async_device_register(struct dma_device *device) | ||
287 | goto err_out; | ||
288 | } | ||
289 | |||
290 | + /* One for the channel, one of the class device */ | ||
291 | + kref_get(&device->refcount); | ||
292 | kref_get(&device->refcount); | ||
293 | kref_init(&chan->refcount); | ||
294 | chan->slow_ref = 0; | ||
295 | diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c | ||
296 | index 58e3271..dcf5dec 100644 | ||
297 | --- a/drivers/i2c/busses/i2c-pasemi.c | ||
298 | +++ b/drivers/i2c/busses/i2c-pasemi.c | ||
299 | @@ -51,6 +51,7 @@ struct pasemi_smbus { | ||
300 | #define MRXFIFO_DATA_M 0x000000ff | ||
301 | |||
302 | #define SMSTA_XEN 0x08000000 | ||
303 | +#define SMSTA_MTN 0x00200000 | ||
304 | |||
305 | #define CTL_MRR 0x00000400 | ||
306 | #define CTL_MTR 0x00000200 | ||
307 | @@ -98,6 +99,10 @@ static unsigned int pasemi_smb_waitready(struct pasemi_smbus *smbus) | ||
308 | status = reg_read(smbus, REG_SMSTA); | ||
309 | } | ||
310 | |||
311 | + /* Got NACK? */ | ||
312 | + if (status & SMSTA_MTN) | ||
313 | + return -ENXIO; | ||
314 | + | ||
315 | if (timeout < 0) { | ||
316 | dev_warn(&smbus->dev->dev, "Timeout, status 0x%08x\n", status); | ||
317 | reg_write(smbus, REG_SMSTA, status); | ||
318 | diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c | ||
319 | index d3da1fb..1a7eeeb 100644 | ||
320 | --- a/drivers/i2c/chips/eeprom.c | ||
321 | +++ b/drivers/i2c/chips/eeprom.c | ||
322 | @@ -128,13 +128,20 @@ static ssize_t eeprom_read(struct kobject *kobj, struct bin_attribute *bin_attr, | ||
323 | for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++) | ||
324 | eeprom_update_client(client, slice); | ||
325 | |||
326 | - /* Hide Vaio security settings to regular users (16 first bytes) */ | ||
327 | - if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) { | ||
328 | - size_t in_row1 = 16 - off; | ||
329 | - in_row1 = min(in_row1, count); | ||
330 | - memset(buf, 0, in_row1); | ||
331 | - if (count - in_row1 > 0) | ||
332 | - memcpy(buf + in_row1, &data->data[16], count - in_row1); | ||
333 | + /* Hide Vaio private settings to regular users: | ||
334 | + - BIOS passwords: bytes 0x00 to 0x0f | ||
335 | + - UUID: bytes 0x10 to 0x1f | ||
336 | + - Serial number: 0xc0 to 0xdf */ | ||
337 | + if (data->nature == VAIO && !capable(CAP_SYS_ADMIN)) { | ||
338 | + int i; | ||
339 | + | ||
340 | + for (i = 0; i < count; i++) { | ||
341 | + if ((off + i <= 0x1f) || | ||
342 | + (off + i >= 0xc0 && off + i <= 0xdf)) | ||
343 | + buf[i] = 0; | ||
344 | + else | ||
345 | + buf[i] = data->data[off + i]; | ||
346 | + } | ||
347 | } else { | ||
348 | memcpy(buf, &data->data[off], count); | ||
349 | } | ||
350 | @@ -197,14 +204,18 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) | ||
351 | goto exit_kfree; | ||
352 | |||
353 | /* Detect the Vaio nature of EEPROMs. | ||
354 | - We use the "PCG-" prefix as the signature. */ | ||
355 | + We use the "PCG-" or "VGN-" prefix as the signature. */ | ||
356 | if (address == 0x57) { | ||
357 | - if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P' | ||
358 | - && i2c_smbus_read_byte(new_client) == 'C' | ||
359 | - && i2c_smbus_read_byte(new_client) == 'G' | ||
360 | - && i2c_smbus_read_byte(new_client) == '-') { | ||
361 | + char name[4]; | ||
362 | + | ||
363 | + name[0] = i2c_smbus_read_byte_data(new_client, 0x80); | ||
364 | + name[1] = i2c_smbus_read_byte(new_client); | ||
365 | + name[2] = i2c_smbus_read_byte(new_client); | ||
366 | + name[3] = i2c_smbus_read_byte(new_client); | ||
367 | + | ||
368 | + if (!memcmp(name, "PCG-", 4) || !memcmp(name, "VGN-", 4)) { | ||
369 | dev_info(&new_client->dev, "Vaio EEPROM detected, " | ||
370 | - "enabling password protection\n"); | ||
371 | + "enabling privacy protection\n"); | ||
372 | data->nature = VAIO; | ||
373 | } | ||
374 | } | ||
375 | diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c | ||
376 | index 3808f52..e86cacb 100644 | ||
377 | --- a/drivers/md/raid5.c | ||
378 | +++ b/drivers/md/raid5.c | ||
379 | @@ -689,7 +689,8 @@ ops_run_prexor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx) | ||
380 | } | ||
381 | |||
382 | static struct dma_async_tx_descriptor * | ||
383 | -ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx) | ||
384 | +ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx, | ||
385 | + unsigned long pending) | ||
386 | { | ||
387 | int disks = sh->disks; | ||
388 | int pd_idx = sh->pd_idx, i; | ||
389 | @@ -697,7 +698,7 @@ ops_run_biodrain(struct stripe_head *sh, struct dma_async_tx_descriptor *tx) | ||
390 | /* check if prexor is active which means only process blocks | ||
391 | * that are part of a read-modify-write (Wantprexor) | ||
392 | */ | ||
393 | - int prexor = test_bit(STRIPE_OP_PREXOR, &sh->ops.pending); | ||
394 | + int prexor = test_bit(STRIPE_OP_PREXOR, &pending); | ||
395 | |||
396 | pr_debug("%s: stripe %llu\n", __FUNCTION__, | ||
397 | (unsigned long long)sh->sector); | ||
398 | @@ -774,7 +775,8 @@ static void ops_complete_write(void *stripe_head_ref) | ||
399 | } | ||
400 | |||
401 | static void | ||
402 | -ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx) | ||
403 | +ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx, | ||
404 | + unsigned long pending) | ||
405 | { | ||
406 | /* kernel stack size limits the total number of disks */ | ||
407 | int disks = sh->disks; | ||
408 | @@ -782,7 +784,7 @@ ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx) | ||
409 | |||
410 | int count = 0, pd_idx = sh->pd_idx, i; | ||
411 | struct page *xor_dest; | ||
412 | - int prexor = test_bit(STRIPE_OP_PREXOR, &sh->ops.pending); | ||
413 | + int prexor = test_bit(STRIPE_OP_PREXOR, &pending); | ||
414 | unsigned long flags; | ||
415 | dma_async_tx_callback callback; | ||
416 | |||
417 | @@ -809,7 +811,7 @@ ops_run_postxor(struct stripe_head *sh, struct dma_async_tx_descriptor *tx) | ||
418 | } | ||
419 | |||
420 | /* check whether this postxor is part of a write */ | ||
421 | - callback = test_bit(STRIPE_OP_BIODRAIN, &sh->ops.pending) ? | ||
422 | + callback = test_bit(STRIPE_OP_BIODRAIN, &pending) ? | ||
423 | ops_complete_write : ops_complete_postxor; | ||
424 | |||
425 | /* 1/ if we prexor'd then the dest is reused as a source | ||
426 | @@ -897,12 +899,12 @@ static void raid5_run_ops(struct stripe_head *sh, unsigned long pending) | ||
427 | tx = ops_run_prexor(sh, tx); | ||
428 | |||
429 | if (test_bit(STRIPE_OP_BIODRAIN, &pending)) { | ||
430 | - tx = ops_run_biodrain(sh, tx); | ||
431 | + tx = ops_run_biodrain(sh, tx, pending); | ||
432 | overlap_clear++; | ||
433 | } | ||
434 | |||
435 | if (test_bit(STRIPE_OP_POSTXOR, &pending)) | ||
436 | - ops_run_postxor(sh, tx); | ||
437 | + ops_run_postxor(sh, tx, pending); | ||
438 | |||
439 | if (test_bit(STRIPE_OP_CHECK, &pending)) | ||
440 | ops_run_check(sh); | ||
441 | diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c | ||
442 | index 61497c4..da91b3b 100644 | ||
443 | --- a/drivers/net/wireless/ipw2200.c | ||
444 | +++ b/drivers/net/wireless/ipw2200.c | ||
445 | @@ -1740,8 +1740,10 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) | ||
446 | if (disable_radio) { | ||
447 | priv->status |= STATUS_RF_KILL_SW; | ||
448 | |||
449 | - if (priv->workqueue) | ||
450 | + if (priv->workqueue) { | ||
451 | cancel_delayed_work(&priv->request_scan); | ||
452 | + cancel_delayed_work(&priv->scan_event); | ||
453 | + } | ||
454 | queue_work(priv->workqueue, &priv->down); | ||
455 | } else { | ||
456 | priv->status &= ~STATUS_RF_KILL_SW; | ||
457 | @@ -1992,6 +1994,7 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) | ||
458 | wake_up_interruptible(&priv->wait_command_queue); | ||
459 | priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); | ||
460 | cancel_delayed_work(&priv->request_scan); | ||
461 | + cancel_delayed_work(&priv->scan_event); | ||
462 | schedule_work(&priv->link_down); | ||
463 | queue_delayed_work(priv->workqueue, &priv->rf_kill, 2 * HZ); | ||
464 | handled |= IPW_INTA_BIT_RF_KILL_DONE; | ||
465 | @@ -4341,6 +4344,37 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv, | ||
466 | IPW_DEBUG_NOTIF("Missed beacon: %d\n", missed_count); | ||
467 | } | ||
468 | |||
469 | +static void ipw_scan_event(struct work_struct *work) | ||
470 | +{ | ||
471 | + union iwreq_data wrqu; | ||
472 | + | ||
473 | + struct ipw_priv *priv = | ||
474 | + container_of(work, struct ipw_priv, scan_event.work); | ||
475 | + | ||
476 | + wrqu.data.length = 0; | ||
477 | + wrqu.data.flags = 0; | ||
478 | + wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL); | ||
479 | +} | ||
480 | + | ||
481 | +static void handle_scan_event(struct ipw_priv *priv) | ||
482 | +{ | ||
483 | + /* Only userspace-requested scan completion events go out immediately */ | ||
484 | + if (!priv->user_requested_scan) { | ||
485 | + if (!delayed_work_pending(&priv->scan_event)) | ||
486 | + queue_delayed_work(priv->workqueue, &priv->scan_event, | ||
487 | + round_jiffies(msecs_to_jiffies(4000))); | ||
488 | + } else { | ||
489 | + union iwreq_data wrqu; | ||
490 | + | ||
491 | + priv->user_requested_scan = 0; | ||
492 | + cancel_delayed_work(&priv->scan_event); | ||
493 | + | ||
494 | + wrqu.data.length = 0; | ||
495 | + wrqu.data.flags = 0; | ||
496 | + wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL); | ||
497 | + } | ||
498 | +} | ||
499 | + | ||
500 | /** | ||
501 | * Handle host notification packet. | ||
502 | * Called from interrupt routine | ||
503 | @@ -4702,14 +4736,8 @@ static void ipw_rx_notification(struct ipw_priv *priv, | ||
504 | * on how the scan was initiated. User space can just | ||
505 | * sync on periodic scan to get fresh data... | ||
506 | * Jean II */ | ||
507 | - if (x->status == SCAN_COMPLETED_STATUS_COMPLETE) { | ||
508 | - union iwreq_data wrqu; | ||
509 | - | ||
510 | - wrqu.data.length = 0; | ||
511 | - wrqu.data.flags = 0; | ||
512 | - wireless_send_event(priv->net_dev, SIOCGIWSCAN, | ||
513 | - &wrqu, NULL); | ||
514 | - } | ||
515 | + if (x->status == SCAN_COMPLETED_STATUS_COMPLETE) | ||
516 | + handle_scan_event(priv); | ||
517 | break; | ||
518 | } | ||
519 | |||
520 | @@ -9472,6 +9500,10 @@ static int ipw_wx_set_scan(struct net_device *dev, | ||
521 | struct ipw_priv *priv = ieee80211_priv(dev); | ||
522 | struct iw_scan_req *req = (struct iw_scan_req *)extra; | ||
523 | |||
524 | + mutex_lock(&priv->mutex); | ||
525 | + priv->user_requested_scan = 1; | ||
526 | + mutex_unlock(&priv->mutex); | ||
527 | + | ||
528 | if (wrqu->data.length == sizeof(struct iw_scan_req)) { | ||
529 | if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { | ||
530 | ipw_request_direct_scan(priv, req->essid, | ||
531 | @@ -10647,6 +10679,7 @@ static void ipw_link_up(struct ipw_priv *priv) | ||
532 | } | ||
533 | |||
534 | cancel_delayed_work(&priv->request_scan); | ||
535 | + cancel_delayed_work(&priv->scan_event); | ||
536 | ipw_reset_stats(priv); | ||
537 | /* Ensure the rate is updated immediately */ | ||
538 | priv->last_rate = ipw_get_current_rate(priv); | ||
539 | @@ -10684,7 +10717,8 @@ static void ipw_link_down(struct ipw_priv *priv) | ||
540 | if (!(priv->status & STATUS_EXIT_PENDING)) { | ||
541 | /* Queue up another scan... */ | ||
542 | queue_delayed_work(priv->workqueue, &priv->request_scan, 0); | ||
543 | - } | ||
544 | + } else | ||
545 | + cancel_delayed_work(&priv->scan_event); | ||
546 | } | ||
547 | |||
548 | static void ipw_bg_link_down(struct work_struct *work) | ||
549 | @@ -10714,6 +10748,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv) | ||
550 | INIT_WORK(&priv->up, ipw_bg_up); | ||
551 | INIT_WORK(&priv->down, ipw_bg_down); | ||
552 | INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan); | ||
553 | + INIT_DELAYED_WORK(&priv->scan_event, ipw_scan_event); | ||
554 | INIT_WORK(&priv->request_passive_scan, ipw_request_passive_scan); | ||
555 | INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats); | ||
556 | INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan); | ||
557 | @@ -11746,6 +11781,7 @@ static void ipw_pci_remove(struct pci_dev *pdev) | ||
558 | cancel_delayed_work(&priv->adhoc_check); | ||
559 | cancel_delayed_work(&priv->gather_stats); | ||
560 | cancel_delayed_work(&priv->request_scan); | ||
561 | + cancel_delayed_work(&priv->scan_event); | ||
562 | cancel_delayed_work(&priv->rf_kill); | ||
563 | cancel_delayed_work(&priv->scan_check); | ||
564 | destroy_workqueue(priv->workqueue); | ||
565 | diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h | ||
566 | index 626a240..58b8fe5 100644 | ||
567 | --- a/drivers/net/wireless/ipw2200.h | ||
568 | +++ b/drivers/net/wireless/ipw2200.h | ||
569 | @@ -1288,6 +1288,8 @@ struct ipw_priv { | ||
570 | |||
571 | struct iw_public_data wireless_data; | ||
572 | |||
573 | + int user_requested_scan; | ||
574 | + | ||
575 | struct workqueue_struct *workqueue; | ||
576 | |||
577 | struct delayed_work adhoc_check; | ||
578 | @@ -1296,6 +1298,7 @@ struct ipw_priv { | ||
579 | struct work_struct system_config; | ||
580 | struct work_struct rx_replenish; | ||
581 | struct delayed_work request_scan; | ||
582 | + struct delayed_work scan_event; | ||
583 | struct work_struct request_passive_scan; | ||
584 | struct work_struct adapter_restart; | ||
585 | struct delayed_work rf_kill; | ||
586 | diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c | ||
587 | index a83c3db..c93d3d2 100644 | ||
588 | --- a/drivers/oprofile/cpu_buffer.c | ||
589 | +++ b/drivers/oprofile/cpu_buffer.c | ||
590 | @@ -64,6 +64,8 @@ int alloc_cpu_buffers(void) | ||
591 | b->head_pos = 0; | ||
592 | b->sample_received = 0; | ||
593 | b->sample_lost_overflow = 0; | ||
594 | + b->backtrace_aborted = 0; | ||
595 | + b->sample_invalid_eip = 0; | ||
596 | b->cpu = i; | ||
597 | INIT_DELAYED_WORK(&b->work, wq_sync_buffer); | ||
598 | } | ||
599 | @@ -175,6 +177,11 @@ static int log_sample(struct oprofile_cpu_buffer * cpu_buf, unsigned long pc, | ||
600 | |||
601 | cpu_buf->sample_received++; | ||
602 | |||
603 | + if (pc == ESCAPE_CODE) { | ||
604 | + cpu_buf->sample_invalid_eip++; | ||
605 | + return 0; | ||
606 | + } | ||
607 | + | ||
608 | if (nr_available_slots(cpu_buf) < 3) { | ||
609 | cpu_buf->sample_lost_overflow++; | ||
610 | return 0; | ||
611 | diff --git a/drivers/oprofile/cpu_buffer.h b/drivers/oprofile/cpu_buffer.h | ||
612 | index 49900d9..c66c025 100644 | ||
613 | --- a/drivers/oprofile/cpu_buffer.h | ||
614 | +++ b/drivers/oprofile/cpu_buffer.h | ||
615 | @@ -42,6 +42,7 @@ struct oprofile_cpu_buffer { | ||
616 | unsigned long sample_received; | ||
617 | unsigned long sample_lost_overflow; | ||
618 | unsigned long backtrace_aborted; | ||
619 | + unsigned long sample_invalid_eip; | ||
620 | int cpu; | ||
621 | struct delayed_work work; | ||
622 | } ____cacheline_aligned; | ||
623 | diff --git a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c | ||
624 | index f0acb66..d1f6d77 100644 | ||
625 | --- a/drivers/oprofile/oprofile_stats.c | ||
626 | +++ b/drivers/oprofile/oprofile_stats.c | ||
627 | @@ -26,6 +26,8 @@ void oprofile_reset_stats(void) | ||
628 | cpu_buf = &cpu_buffer[i]; | ||
629 | cpu_buf->sample_received = 0; | ||
630 | cpu_buf->sample_lost_overflow = 0; | ||
631 | + cpu_buf->backtrace_aborted = 0; | ||
632 | + cpu_buf->sample_invalid_eip = 0; | ||
633 | } | ||
634 | |||
635 | atomic_set(&oprofile_stats.sample_lost_no_mm, 0); | ||
636 | @@ -61,6 +63,8 @@ void oprofile_create_stats_files(struct super_block * sb, struct dentry * root) | ||
637 | &cpu_buf->sample_lost_overflow); | ||
638 | oprofilefs_create_ro_ulong(sb, cpudir, "backtrace_aborted", | ||
639 | &cpu_buf->backtrace_aborted); | ||
640 | + oprofilefs_create_ro_ulong(sb, cpudir, "sample_invalid_eip", | ||
641 | + &cpu_buf->sample_invalid_eip); | ||
642 | } | ||
643 | |||
644 | oprofilefs_create_ro_atomic(sb, dir, "sample_lost_no_mm", | ||
645 | diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h | ||
646 | index c6b78ba..b2b6405 100644 | ||
647 | --- a/drivers/usb/storage/unusual_devs.h | ||
648 | +++ b/drivers/usb/storage/unusual_devs.h | ||
649 | @@ -341,6 +341,13 @@ UNUSUAL_DEV( 0x04b0, 0x040d, 0x0100, 0x0100, | ||
650 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
651 | US_FL_FIX_CAPACITY), | ||
652 | |||
653 | +/* Reported by Graber and Mike Pagano <mpagano-kernel@mpagano.com> */ | ||
654 | +UNUSUAL_DEV( 0x04b0, 0x040f, 0x0200, 0x0200, | ||
655 | + "NIKON", | ||
656 | + "NIKON DSC D200", | ||
657 | + US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
658 | + US_FL_FIX_CAPACITY), | ||
659 | + | ||
660 | /* Reported by Emil Larsson <emil@swip.net> */ | ||
661 | UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0101, | ||
662 | "NIKON", | ||
663 | @@ -355,6 +362,13 @@ UNUSUAL_DEV( 0x04b0, 0x0413, 0x0110, 0x0110, | ||
664 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
665 | US_FL_FIX_CAPACITY), | ||
666 | |||
667 | +/* Reported by Shan Destromp (shansan@gmail.com) */ | ||
668 | +UNUSUAL_DEV( 0x04b0, 0x0417, 0x0100, 0x0100, | ||
669 | + "NIKON", | ||
670 | + "NIKON DSC D40X", | ||
671 | + US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
672 | + US_FL_FIX_CAPACITY), | ||
673 | + | ||
674 | /* BENQ DC5330 | ||
675 | * Reported by Manuel Fombuena <mfombuena@ya.com> and | ||
676 | * Frank Copeland <fjc@thingy.apana.org.au> */ | ||
677 | diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c | ||
678 | index 646ec82..0f2a7ba 100644 | ||
679 | --- a/drivers/video/ps3fb.c | ||
680 | +++ b/drivers/video/ps3fb.c | ||
681 | @@ -659,7 +659,7 @@ static int ps3fb_blank(int blank, struct fb_info *info) | ||
682 | |||
683 | static int ps3fb_get_vblank(struct fb_vblank *vblank) | ||
684 | { | ||
685 | - memset(vblank, 0, sizeof(&vblank)); | ||
686 | + memset(vblank, 0, sizeof(*vblank)); | ||
687 | vblank->flags = FB_VBLANK_HAVE_VSYNC; | ||
688 | return 0; | ||
689 | } | ||
690 | diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c | ||
691 | index b617428..0e5fa11 100644 | ||
692 | --- a/fs/nfsd/nfs2acl.c | ||
693 | +++ b/fs/nfsd/nfs2acl.c | ||
694 | @@ -41,7 +41,7 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp, | ||
695 | |||
696 | fh = fh_copy(&resp->fh, &argp->fh); | ||
697 | if ((nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP))) | ||
698 | - RETURN_STATUS(nfserr_inval); | ||
699 | + RETURN_STATUS(nfserr); | ||
700 | |||
701 | if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT)) | ||
702 | RETURN_STATUS(nfserr_inval); | ||
703 | diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c | ||
704 | index 3e3f2de..b647f2f 100644 | ||
705 | --- a/fs/nfsd/nfs3acl.c | ||
706 | +++ b/fs/nfsd/nfs3acl.c | ||
707 | @@ -37,7 +37,7 @@ static __be32 nfsd3_proc_getacl(struct svc_rqst * rqstp, | ||
708 | |||
709 | fh = fh_copy(&resp->fh, &argp->fh); | ||
710 | if ((nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP))) | ||
711 | - RETURN_STATUS(nfserr_inval); | ||
712 | + RETURN_STATUS(nfserr); | ||
713 | |||
714 | if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT)) | ||
715 | RETURN_STATUS(nfserr_inval); | ||
716 | diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c | ||
717 | index 7011d62..51221be 100644 | ||
718 | --- a/fs/nfsd/nfsfh.c | ||
719 | +++ b/fs/nfsd/nfsfh.c | ||
720 | @@ -95,6 +95,22 @@ nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type) | ||
721 | return 0; | ||
722 | } | ||
723 | |||
724 | +static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp, | ||
725 | + struct svc_export *exp) | ||
726 | +{ | ||
727 | + /* Check if the request originated from a secure port. */ | ||
728 | + if (!rqstp->rq_secure && EX_SECURE(exp)) { | ||
729 | + char buf[RPC_MAX_ADDRBUFLEN]; | ||
730 | + dprintk(KERN_WARNING | ||
731 | + "nfsd: request from insecure port %s!\n", | ||
732 | + svc_print_addr(rqstp, buf, sizeof(buf))); | ||
733 | + return nfserr_perm; | ||
734 | + } | ||
735 | + | ||
736 | + /* Set user creds for this exportpoint */ | ||
737 | + return nfserrno(nfsd_setuser(rqstp, exp)); | ||
738 | +} | ||
739 | + | ||
740 | /* | ||
741 | * Perform sanity checks on the dentry in a client's file handle. | ||
742 | * | ||
743 | @@ -167,18 +183,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | ||
744 | goto out; | ||
745 | } | ||
746 | |||
747 | - /* Check if the request originated from a secure port. */ | ||
748 | - error = nfserr_perm; | ||
749 | - if (!rqstp->rq_secure && EX_SECURE(exp)) { | ||
750 | - char buf[RPC_MAX_ADDRBUFLEN]; | ||
751 | - printk(KERN_WARNING | ||
752 | - "nfsd: request from insecure port %s!\n", | ||
753 | - svc_print_addr(rqstp, buf, sizeof(buf))); | ||
754 | - goto out; | ||
755 | - } | ||
756 | - | ||
757 | - /* Set user creds for this exportpoint */ | ||
758 | - error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
759 | + error = nfsd_setuser_and_check_port(rqstp, exp); | ||
760 | if (error) | ||
761 | goto out; | ||
762 | |||
763 | @@ -227,18 +232,22 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | ||
764 | fhp->fh_export = exp; | ||
765 | nfsd_nr_verified++; | ||
766 | } else { | ||
767 | - /* just rechecking permissions | ||
768 | - * (e.g. nfsproc_create calls fh_verify, then nfsd_create does as well) | ||
769 | + /* | ||
770 | + * just rechecking permissions | ||
771 | + * (e.g. nfsproc_create calls fh_verify, then nfsd_create | ||
772 | + * does as well) | ||
773 | */ | ||
774 | dprintk("nfsd: fh_verify - just checking\n"); | ||
775 | dentry = fhp->fh_dentry; | ||
776 | exp = fhp->fh_export; | ||
777 | - /* Set user creds for this exportpoint; necessary even | ||
778 | + /* | ||
779 | + * Set user creds for this exportpoint; necessary even | ||
780 | * in the "just checking" case because this may be a | ||
781 | * filehandle that was created by fh_compose, and that | ||
782 | * is about to be used in another nfsv4 compound | ||
783 | - * operation */ | ||
784 | - error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
785 | + * operation. | ||
786 | + */ | ||
787 | + error = nfsd_setuser_and_check_port(rqstp, exp); | ||
788 | if (error) | ||
789 | goto out; | ||
790 | } | ||
791 | diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c | ||
792 | index 981027d..ce3c937 100644 | ||
793 | --- a/fs/reiserfs/stree.c | ||
794 | +++ b/fs/reiserfs/stree.c | ||
795 | @@ -1458,9 +1458,6 @@ static void unmap_buffers(struct page *page, loff_t pos) | ||
796 | } | ||
797 | bh = next; | ||
798 | } while (bh != head); | ||
799 | - if (PAGE_SIZE == bh->b_size) { | ||
800 | - cancel_dirty_page(page, PAGE_CACHE_SIZE); | ||
801 | - } | ||
802 | } | ||
803 | } | ||
804 | } | ||
805 | diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h | ||
806 | index d69ba93..b104655 100644 | ||
807 | --- a/include/asm-i386/system.h | ||
808 | +++ b/include/asm-i386/system.h | ||
809 | @@ -141,7 +141,7 @@ static inline unsigned long native_read_cr4_safe(void) | ||
810 | { | ||
811 | unsigned long val; | ||
812 | /* This could fault if %cr4 does not exist */ | ||
813 | - asm("1: movl %%cr4, %0 \n" | ||
814 | + asm volatile("1: movl %%cr4, %0 \n" | ||
815 | "2: \n" | ||
816 | ".section __ex_table,\"a\" \n" | ||
817 | ".long 1b,2b \n" | ||
818 | diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h | ||
819 | index 02175aa..47682a6 100644 | ||
820 | --- a/include/asm-x86_64/system.h | ||
821 | +++ b/include/asm-x86_64/system.h | ||
822 | @@ -85,7 +85,7 @@ static inline void write_cr0(unsigned long val) | ||
823 | static inline unsigned long read_cr2(void) | ||
824 | { | ||
825 | unsigned long cr2; | ||
826 | - asm("movq %%cr2,%0" : "=r" (cr2)); | ||
827 | + asm volatile("movq %%cr2,%0" : "=r" (cr2)); | ||
828 | return cr2; | ||
829 | } | ||
830 | |||
831 | @@ -97,7 +97,7 @@ static inline void write_cr2(unsigned long val) | ||
832 | static inline unsigned long read_cr3(void) | ||
833 | { | ||
834 | unsigned long cr3; | ||
835 | - asm("movq %%cr3,%0" : "=r" (cr3)); | ||
836 | + asm volatile("movq %%cr3,%0" : "=r" (cr3)); | ||
837 | return cr3; | ||
838 | } | ||
839 | |||
840 | @@ -109,7 +109,7 @@ static inline void write_cr3(unsigned long val) | ||
841 | static inline unsigned long read_cr4(void) | ||
842 | { | ||
843 | unsigned long cr4; | ||
844 | - asm("movq %%cr4,%0" : "=r" (cr4)); | ||
845 | + asm volatile("movq %%cr4,%0" : "=r" (cr4)); | ||
846 | return cr4; | ||
847 | } | ||
848 | |||
849 | @@ -121,7 +121,7 @@ static inline void write_cr4(unsigned long val) | ||
850 | static inline unsigned long read_cr8(void) | ||
851 | { | ||
852 | unsigned long cr8; | ||
853 | - asm("movq %%cr8,%0" : "=r" (cr8)); | ||
854 | + asm volatile("movq %%cr8,%0" : "=r" (cr8)); | ||
855 | return cr8; | ||
856 | } | ||
857 | |||
858 | diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c | ||
859 | index 67c67a8..2f592fe 100644 | ||
860 | --- a/kernel/sched_fair.c | ||
861 | +++ b/kernel/sched_fair.c | ||
862 | @@ -93,7 +93,7 @@ unsigned int sysctl_sched_features __read_mostly = | ||
863 | SCHED_FEAT_FAIR_SLEEPERS *1 | | ||
864 | SCHED_FEAT_SLEEPER_AVG *0 | | ||
865 | SCHED_FEAT_SLEEPER_LOAD_AVG *1 | | ||
866 | - SCHED_FEAT_PRECISE_CPU_LOAD *1 | | ||
867 | + SCHED_FEAT_PRECISE_CPU_LOAD *0 | | ||
868 | SCHED_FEAT_START_DEBIT *1 | | ||
869 | SCHED_FEAT_SKIP_INITIAL *0; | ||
870 | |||
871 | diff --git a/kernel/softlockup.c b/kernel/softlockup.c | ||
872 | index e557c44..d857bb0 100644 | ||
873 | --- a/kernel/softlockup.c | ||
874 | +++ b/kernel/softlockup.c | ||
875 | @@ -15,13 +15,16 @@ | ||
876 | #include <linux/notifier.h> | ||
877 | #include <linux/module.h> | ||
878 | |||
879 | +#include <asm/irq_regs.h> | ||
880 | + | ||
881 | static DEFINE_SPINLOCK(print_lock); | ||
882 | |||
883 | static DEFINE_PER_CPU(unsigned long, touch_timestamp); | ||
884 | static DEFINE_PER_CPU(unsigned long, print_timestamp); | ||
885 | static DEFINE_PER_CPU(struct task_struct *, watchdog_task); | ||
886 | |||
887 | -static int did_panic = 0; | ||
888 | +static int did_panic; | ||
889 | +int softlockup_thresh = 10; | ||
890 | |||
891 | static int | ||
892 | softlock_panic(struct notifier_block *this, unsigned long event, void *ptr) | ||
893 | @@ -40,14 +43,16 @@ static struct notifier_block panic_block = { | ||
894 | * resolution, and we don't need to waste time with a big divide when | ||
895 | * 2^30ns == 1.074s. | ||
896 | */ | ||
897 | -static unsigned long get_timestamp(void) | ||
898 | +static unsigned long get_timestamp(int this_cpu) | ||
899 | { | ||
900 | - return sched_clock() >> 30; /* 2^30 ~= 10^9 */ | ||
901 | + return cpu_clock(this_cpu) >> 30; /* 2^30 ~= 10^9 */ | ||
902 | } | ||
903 | |||
904 | void touch_softlockup_watchdog(void) | ||
905 | { | ||
906 | - __raw_get_cpu_var(touch_timestamp) = get_timestamp(); | ||
907 | + int this_cpu = raw_smp_processor_id(); | ||
908 | + | ||
909 | + __raw_get_cpu_var(touch_timestamp) = get_timestamp(this_cpu); | ||
910 | } | ||
911 | EXPORT_SYMBOL(touch_softlockup_watchdog); | ||
912 | |||
913 | @@ -70,6 +75,7 @@ void softlockup_tick(void) | ||
914 | int this_cpu = smp_processor_id(); | ||
915 | unsigned long touch_timestamp = per_cpu(touch_timestamp, this_cpu); | ||
916 | unsigned long print_timestamp; | ||
917 | + struct pt_regs *regs = get_irq_regs(); | ||
918 | unsigned long now; | ||
919 | |||
920 | if (touch_timestamp == 0) { | ||
921 | @@ -92,28 +98,33 @@ void softlockup_tick(void) | ||
922 | return; | ||
923 | } | ||
924 | |||
925 | - now = get_timestamp(); | ||
926 | + now = get_timestamp(this_cpu); | ||
927 | |||
928 | /* Wake up the high-prio watchdog task every second: */ | ||
929 | if (now > (touch_timestamp + 1)) | ||
930 | wake_up_process(per_cpu(watchdog_task, this_cpu)); | ||
931 | |||
932 | /* Warn about unreasonable 10+ seconds delays: */ | ||
933 | - if (now > (touch_timestamp + 10)) { | ||
934 | - per_cpu(print_timestamp, this_cpu) = touch_timestamp; | ||
935 | + if (now <= (touch_timestamp + softlockup_thresh)) | ||
936 | + return; | ||
937 | + | ||
938 | + per_cpu(print_timestamp, this_cpu) = touch_timestamp; | ||
939 | |||
940 | - spin_lock(&print_lock); | ||
941 | - printk(KERN_ERR "BUG: soft lockup detected on CPU#%d!\n", | ||
942 | - this_cpu); | ||
943 | + spin_lock(&print_lock); | ||
944 | + printk(KERN_ERR "BUG: soft lockup - CPU#%d stuck for %lus! [%s:%d]\n", | ||
945 | + this_cpu, now - touch_timestamp, | ||
946 | + current->comm, current->pid); | ||
947 | + if (regs) | ||
948 | + show_regs(regs); | ||
949 | + else | ||
950 | dump_stack(); | ||
951 | - spin_unlock(&print_lock); | ||
952 | - } | ||
953 | + spin_unlock(&print_lock); | ||
954 | } | ||
955 | |||
956 | /* | ||
957 | * The watchdog thread - runs every second and touches the timestamp. | ||
958 | */ | ||
959 | -static int watchdog(void * __bind_cpu) | ||
960 | +static int watchdog(void *__bind_cpu) | ||
961 | { | ||
962 | struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; | ||
963 | |||
964 | @@ -151,13 +162,13 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | ||
965 | BUG_ON(per_cpu(watchdog_task, hotcpu)); | ||
966 | p = kthread_create(watchdog, hcpu, "watchdog/%d", hotcpu); | ||
967 | if (IS_ERR(p)) { | ||
968 | - printk("watchdog for %i failed\n", hotcpu); | ||
969 | + printk(KERN_ERR "watchdog for %i failed\n", hotcpu); | ||
970 | return NOTIFY_BAD; | ||
971 | } | ||
972 | - per_cpu(touch_timestamp, hotcpu) = 0; | ||
973 | - per_cpu(watchdog_task, hotcpu) = p; | ||
974 | + per_cpu(touch_timestamp, hotcpu) = 0; | ||
975 | + per_cpu(watchdog_task, hotcpu) = p; | ||
976 | kthread_bind(p, hotcpu); | ||
977 | - break; | ||
978 | + break; | ||
979 | case CPU_ONLINE: | ||
980 | case CPU_ONLINE_FROZEN: | ||
981 | wake_up_process(per_cpu(watchdog_task, hotcpu)); | ||
982 | @@ -177,7 +188,7 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | ||
983 | kthread_stop(p); | ||
984 | break; | ||
985 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
986 | - } | ||
987 | + } | ||
988 | return NOTIFY_OK; | ||
989 | } | ||
990 | |||
991 | diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c | ||
992 | index de6a2d6..14a2ecf 100644 | ||
993 | --- a/kernel/time/ntp.c | ||
994 | +++ b/kernel/time/ntp.c | ||
995 | @@ -205,7 +205,7 @@ static void sync_cmos_clock(unsigned long dummy) | ||
996 | return; | ||
997 | |||
998 | getnstimeofday(&now); | ||
999 | - if (abs(xtime.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2) | ||
1000 | + if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2) | ||
1001 | fail = update_persistent_clock(now); | ||
1002 | |||
1003 | next.tv_nsec = (NSEC_PER_SEC / 2) - now.tv_nsec; | ||
1004 | diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c | ||
1005 | index 60f4680..1f3a52e 100644 | ||
1006 | --- a/lib/libcrc32c.c | ||
1007 | +++ b/lib/libcrc32c.c | ||
1008 | @@ -33,7 +33,6 @@ | ||
1009 | #include <linux/crc32c.h> | ||
1010 | #include <linux/compiler.h> | ||
1011 | #include <linux/module.h> | ||
1012 | -#include <asm/byteorder.h> | ||
1013 | |||
1014 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); | ||
1015 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations"); | ||
1016 | @@ -161,15 +160,13 @@ static const u32 crc32c_table[256] = { | ||
1017 | */ | ||
1018 | |||
1019 | u32 __attribute_pure__ | ||
1020 | -crc32c_le(u32 seed, unsigned char const *data, size_t length) | ||
1021 | +crc32c_le(u32 crc, unsigned char const *data, size_t length) | ||
1022 | { | ||
1023 | - u32 crc = __cpu_to_le32(seed); | ||
1024 | - | ||
1025 | while (length--) | ||
1026 | crc = | ||
1027 | crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8); | ||
1028 | |||
1029 | - return __le32_to_cpu(crc); | ||
1030 | + return crc; | ||
1031 | } | ||
1032 | |||
1033 | #endif /* CRC_LE_BITS == 8 */ |