aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2008-10-22 23:57:26 -0400
committerLen Brown <len.brown@intel.com>2008-10-23 00:11:07 -0400
commit057316cc6a5b521b332a1d7ccc871cd60c904c74 (patch)
tree4333e608da237c73ff69b10878025cca96dcb4c8 /drivers/misc
parent3e2dab9a1c2deb03c311eb3f83466009147ed4d3 (diff)
parent2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff)
Merge branch 'linus' into test
Conflicts: MAINTAINERS arch/x86/kernel/acpi/boot.c arch/x86/kernel/acpi/sleep.c drivers/acpi/Kconfig drivers/pnp/Makefile drivers/pnp/quirks.c Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/Kconfig3
-rw-r--r--drivers/misc/hp-wmi.c3
-rw-r--r--drivers/misc/phantom.c6
-rw-r--r--drivers/misc/sgi-gru/gru.h4
-rw-r--r--drivers/misc/sgi-gru/gru_instructions.h10
-rw-r--r--drivers/misc/sgi-gru/grufault.c11
-rw-r--r--drivers/misc/sgi-gru/grufile.c8
-rw-r--r--drivers/misc/sgi-gru/gruhandles.h5
-rw-r--r--drivers/misc/sgi-gru/grukservices.c3
-rw-r--r--drivers/misc/sgi-gru/grumain.c29
10 files changed, 47 insertions, 35 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 0ed74d076a27..9494400e8fd0 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -15,7 +15,7 @@ if MISC_DEVICES
15 15
16config ATMEL_PWM 16config ATMEL_PWM
17 tristate "Atmel AT32/AT91 PWM support" 17 tristate "Atmel AT32/AT91 PWM support"
18 depends on AVR32 || ARCH_AT91 18 depends on AVR32 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9
19 help 19 help
20 This option enables device driver support for the PWM channels 20 This option enables device driver support for the PWM channels
21 on certain Atmel prcoessors. Pulse Width Modulation is used for 21 on certain Atmel prcoessors. Pulse Width Modulation is used for
@@ -421,6 +421,7 @@ config EEEPC_LAPTOP
421 depends on BACKLIGHT_CLASS_DEVICE 421 depends on BACKLIGHT_CLASS_DEVICE
422 depends on HWMON 422 depends on HWMON
423 depends on EXPERIMENTAL 423 depends on EXPERIMENTAL
424 depends on RFKILL
424 ---help--- 425 ---help---
425 This driver supports the Fn-Fx keys on Eee PC laptops. 426 This driver supports the Fn-Fx keys on Eee PC laptops.
426 It also adds the ability to switch camera/wlan on/off. 427 It also adds the ability to switch camera/wlan on/off.
diff --git a/drivers/misc/hp-wmi.c b/drivers/misc/hp-wmi.c
index 6d407c2a4f91..4b7c24c519c3 100644
--- a/drivers/misc/hp-wmi.c
+++ b/drivers/misc/hp-wmi.c
@@ -82,6 +82,7 @@ static struct key_entry hp_wmi_keymap[] = {
82 {KE_KEY, 0x03, KEY_BRIGHTNESSDOWN}, 82 {KE_KEY, 0x03, KEY_BRIGHTNESSDOWN},
83 {KE_KEY, 0x20e6, KEY_PROG1}, 83 {KE_KEY, 0x20e6, KEY_PROG1},
84 {KE_KEY, 0x2142, KEY_MEDIA}, 84 {KE_KEY, 0x2142, KEY_MEDIA},
85 {KE_KEY, 0x213b, KEY_INFO},
85 {KE_KEY, 0x231b, KEY_HELP}, 86 {KE_KEY, 0x231b, KEY_HELP},
86 {KE_END, 0} 87 {KE_END, 0}
87}; 88};
@@ -309,7 +310,7 @@ static int hp_wmi_setkeycode(struct input_dev *dev, int scancode, int keycode)
309 return -EINVAL; 310 return -EINVAL;
310} 311}
311 312
312void hp_wmi_notify(u32 value, void *context) 313static void hp_wmi_notify(u32 value, void *context)
313{ 314{
314 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; 315 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
315 static struct key_entry *key; 316 static struct key_entry *key;
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index daf585689ce3..abdebe347383 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -399,9 +399,9 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
399 goto err_irq; 399 goto err_irq;
400 } 400 }
401 401
402 if (IS_ERR(device_create_drvdata(phantom_class, &pdev->dev, 402 if (IS_ERR(device_create(phantom_class, &pdev->dev,
403 MKDEV(phantom_major, minor), 403 MKDEV(phantom_major, minor), NULL,
404 NULL, "phantom%u", minor))) 404 "phantom%u", minor)))
405 dev_err(&pdev->dev, "can't create device\n"); 405 dev_err(&pdev->dev, "can't create device\n");
406 406
407 pci_set_drvdata(pdev, pht); 407 pci_set_drvdata(pdev, pht);
diff --git a/drivers/misc/sgi-gru/gru.h b/drivers/misc/sgi-gru/gru.h
index 40df7cb3f0a5..f93f03a9e6e9 100644
--- a/drivers/misc/sgi-gru/gru.h
+++ b/drivers/misc/sgi-gru/gru.h
@@ -30,9 +30,9 @@
30/* 30/*
31 * Size used to map GRU GSeg 31 * Size used to map GRU GSeg
32 */ 32 */
33#if defined CONFIG_IA64 33#if defined(CONFIG_IA64)
34#define GRU_GSEG_PAGESIZE (256 * 1024UL) 34#define GRU_GSEG_PAGESIZE (256 * 1024UL)
35#elif defined CONFIG_X86_64 35#elif defined(CONFIG_X86_64)
36#define GRU_GSEG_PAGESIZE (256 * 1024UL) /* ZZZ 2MB ??? */ 36#define GRU_GSEG_PAGESIZE (256 * 1024UL) /* ZZZ 2MB ??? */
37#else 37#else
38#error "Unsupported architecture" 38#error "Unsupported architecture"
diff --git a/drivers/misc/sgi-gru/gru_instructions.h b/drivers/misc/sgi-gru/gru_instructions.h
index 0dc36225c7c6..48762e7b98be 100644
--- a/drivers/misc/sgi-gru/gru_instructions.h
+++ b/drivers/misc/sgi-gru/gru_instructions.h
@@ -26,7 +26,7 @@
26 * Architecture dependent functions 26 * Architecture dependent functions
27 */ 27 */
28 28
29#if defined CONFIG_IA64 29#if defined(CONFIG_IA64)
30#include <linux/compiler.h> 30#include <linux/compiler.h>
31#include <asm/intrinsics.h> 31#include <asm/intrinsics.h>
32#define __flush_cache(p) ia64_fc(p) 32#define __flush_cache(p) ia64_fc(p)
@@ -36,7 +36,7 @@
36 barrier(); \ 36 barrier(); \
37 *((volatile int *)(p)) = v; /* force st.rel */ \ 37 *((volatile int *)(p)) = v; /* force st.rel */ \
38 } while (0) 38 } while (0)
39#elif defined CONFIG_X86_64 39#elif defined(CONFIG_X86_64)
40#define __flush_cache(p) clflush(p) 40#define __flush_cache(p) clflush(p)
41#define gru_ordered_store_int(p,v) \ 41#define gru_ordered_store_int(p,v) \
42 do { \ 42 do { \
@@ -299,6 +299,7 @@ static inline void gru_flush_cache(void *p)
299static inline void gru_start_instruction(struct gru_instruction *ins, int op32) 299static inline void gru_start_instruction(struct gru_instruction *ins, int op32)
300{ 300{
301 gru_ordered_store_int(ins, op32); 301 gru_ordered_store_int(ins, op32);
302 gru_flush_cache(ins);
302} 303}
303 304
304 305
@@ -604,8 +605,9 @@ static inline int gru_get_cb_substatus(void *cb)
604static inline int gru_check_status(void *cb) 605static inline int gru_check_status(void *cb)
605{ 606{
606 struct gru_control_block_status *cbs = (void *)cb; 607 struct gru_control_block_status *cbs = (void *)cb;
607 int ret = cbs->istatus; 608 int ret;
608 609
610 ret = cbs->istatus;
609 if (ret == CBS_CALL_OS) 611 if (ret == CBS_CALL_OS)
610 ret = gru_check_status_proc(cb); 612 ret = gru_check_status_proc(cb);
611 return ret; 613 return ret;
@@ -617,7 +619,7 @@ static inline int gru_check_status(void *cb)
617static inline int gru_wait(void *cb) 619static inline int gru_wait(void *cb)
618{ 620{
619 struct gru_control_block_status *cbs = (void *)cb; 621 struct gru_control_block_status *cbs = (void *)cb;
620 int ret = cbs->istatus;; 622 int ret = cbs->istatus;
621 623
622 if (ret != CBS_IDLE) 624 if (ret != CBS_IDLE)
623 ret = gru_wait_proc(cb); 625 ret = gru_wait_proc(cb);
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
index 3d33015bbf31..8c389d606c30 100644
--- a/drivers/misc/sgi-gru/grufault.c
+++ b/drivers/misc/sgi-gru/grufault.c
@@ -214,12 +214,14 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma,
214} 214}
215 215
216/* 216/*
217 *
218 * atomic_pte_lookup 217 * atomic_pte_lookup
219 * 218 *
220 * Convert a user virtual address to a physical address 219 * Convert a user virtual address to a physical address
221 * Only supports Intel large pages (2MB only) on x86_64. 220 * Only supports Intel large pages (2MB only) on x86_64.
222 * ZZZ - hugepage support is incomplete 221 * ZZZ - hugepage support is incomplete
222 *
223 * NOTE: mmap_sem is already held on entry to this function. This
224 * guarantees existence of the page tables.
223 */ 225 */
224static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr, 226static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
225 int write, unsigned long *paddr, int *pageshift) 227 int write, unsigned long *paddr, int *pageshift)
@@ -229,9 +231,6 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
229 pud_t *pudp; 231 pud_t *pudp;
230 pte_t pte; 232 pte_t pte;
231 233
232 WARN_ON(irqs_disabled()); /* ZZZ debug */
233
234 local_irq_disable();
235 pgdp = pgd_offset(vma->vm_mm, vaddr); 234 pgdp = pgd_offset(vma->vm_mm, vaddr);
236 if (unlikely(pgd_none(*pgdp))) 235 if (unlikely(pgd_none(*pgdp)))
237 goto err; 236 goto err;
@@ -250,8 +249,6 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
250#endif 249#endif
251 pte = *pte_offset_kernel(pmdp, vaddr); 250 pte = *pte_offset_kernel(pmdp, vaddr);
252 251
253 local_irq_enable();
254
255 if (unlikely(!pte_present(pte) || 252 if (unlikely(!pte_present(pte) ||
256 (write && (!pte_write(pte) || !pte_dirty(pte))))) 253 (write && (!pte_write(pte) || !pte_dirty(pte)))))
257 return 1; 254 return 1;
@@ -324,6 +321,7 @@ static int gru_try_dropin(struct gru_thread_state *gts,
324 * Atomic lookup is faster & usually works even if called in non-atomic 321 * Atomic lookup is faster & usually works even if called in non-atomic
325 * context. 322 * context.
326 */ 323 */
324 rmb(); /* Must/check ms_range_active before loading PTEs */
327 ret = atomic_pte_lookup(vma, vaddr, write, &paddr, &pageshift); 325 ret = atomic_pte_lookup(vma, vaddr, write, &paddr, &pageshift);
328 if (ret) { 326 if (ret) {
329 if (!cb) 327 if (!cb)
@@ -543,6 +541,7 @@ int gru_get_exception_detail(unsigned long arg)
543 ucbnum = get_cb_number((void *)excdet.cb); 541 ucbnum = get_cb_number((void *)excdet.cb);
544 cbrnum = thread_cbr_number(gts, ucbnum); 542 cbrnum = thread_cbr_number(gts, ucbnum);
545 cbe = get_cbe_by_index(gts->ts_gru, cbrnum); 543 cbe = get_cbe_by_index(gts->ts_gru, cbrnum);
544 prefetchw(cbe); /* Harmless on hardware, required for emulator */
546 excdet.opc = cbe->opccpy; 545 excdet.opc = cbe->opccpy;
547 excdet.exopc = cbe->exopccpy; 546 excdet.exopc = cbe->exopccpy;
548 excdet.ecause = cbe->ecause; 547 excdet.ecause = cbe->ecause;
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index d61cee796efd..5c027b6b4e5a 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -113,7 +113,7 @@ static int gru_file_mmap(struct file *file, struct vm_area_struct *vma)
113 return -EPERM; 113 return -EPERM;
114 114
115 if (vma->vm_start & (GRU_GSEG_PAGESIZE - 1) || 115 if (vma->vm_start & (GRU_GSEG_PAGESIZE - 1) ||
116 vma->vm_end & (GRU_GSEG_PAGESIZE - 1)) 116 vma->vm_end & (GRU_GSEG_PAGESIZE - 1))
117 return -EINVAL; 117 return -EINVAL;
118 118
119 vma->vm_flags |= 119 vma->vm_flags |=
@@ -398,6 +398,12 @@ static int __init gru_init(void)
398 irq = get_base_irq(); 398 irq = get_base_irq();
399 for (chip = 0; chip < GRU_CHIPLETS_PER_BLADE; chip++) { 399 for (chip = 0; chip < GRU_CHIPLETS_PER_BLADE; chip++) {
400 ret = request_irq(irq + chip, gru_intr, 0, id, NULL); 400 ret = request_irq(irq + chip, gru_intr, 0, id, NULL);
401 /* TODO: fix irq handling on x86. For now ignore failures because
402 * interrupts are not required & not yet fully supported */
403 if (ret) {
404 printk("!!!WARNING: GRU ignoring request failure!!!\n");
405 ret = 0;
406 }
401 if (ret) { 407 if (ret) {
402 printk(KERN_ERR "%s: request_irq failed\n", 408 printk(KERN_ERR "%s: request_irq failed\n",
403 GRU_DRIVER_ID_STR); 409 GRU_DRIVER_ID_STR);
diff --git a/drivers/misc/sgi-gru/gruhandles.h b/drivers/misc/sgi-gru/gruhandles.h
index d16031d62673..b63018d60fe1 100644
--- a/drivers/misc/sgi-gru/gruhandles.h
+++ b/drivers/misc/sgi-gru/gruhandles.h
@@ -91,12 +91,7 @@
91#define GSEGPOFF(h) ((h) & (GRU_SIZE - 1)) 91#define GSEGPOFF(h) ((h) & (GRU_SIZE - 1))
92 92
93/* Convert an arbitrary handle address to the beginning of the GRU segment */ 93/* Convert an arbitrary handle address to the beginning of the GRU segment */
94#ifndef __PLUGIN__
95#define GRUBASE(h) ((void *)((unsigned long)(h) & ~(GRU_SIZE - 1))) 94#define GRUBASE(h) ((void *)((unsigned long)(h) & ~(GRU_SIZE - 1)))
96#else
97extern void *gmu_grubase(void *h);
98#define GRUBASE(h) gmu_grubase(h)
99#endif
100 95
101/* General addressing macros. */ 96/* General addressing macros. */
102static inline void *get_gseg_base_address(void *base, int ctxnum) 97static inline void *get_gseg_base_address(void *base, int ctxnum)
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c
index dfd49af0fe18..880c55dfb662 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -122,6 +122,7 @@ int gru_get_cb_exception_detail(void *cb,
122 struct gru_control_block_extended *cbe; 122 struct gru_control_block_extended *cbe;
123 123
124 cbe = get_cbe(GRUBASE(cb), get_cb_number(cb)); 124 cbe = get_cbe(GRUBASE(cb), get_cb_number(cb));
125 prefetchw(cbe); /* Harmless on hardware, required for emulator */
125 excdet->opc = cbe->opccpy; 126 excdet->opc = cbe->opccpy;
126 excdet->exopc = cbe->exopccpy; 127 excdet->exopc = cbe->exopccpy;
127 excdet->ecause = cbe->ecause; 128 excdet->ecause = cbe->ecause;
@@ -466,7 +467,7 @@ int gru_send_message_gpa(unsigned long mq, void *mesg, unsigned int bytes)
466 STAT(mesq_send); 467 STAT(mesq_send);
467 BUG_ON(bytes < sizeof(int) || bytes > 2 * GRU_CACHE_LINE_BYTES); 468 BUG_ON(bytes < sizeof(int) || bytes > 2 * GRU_CACHE_LINE_BYTES);
468 469
469 clines = (bytes + GRU_CACHE_LINE_BYTES - 1) / GRU_CACHE_LINE_BYTES; 470 clines = DIV_ROUND_UP(bytes, GRU_CACHE_LINE_BYTES);
470 if (gru_get_cpu_resources(bytes, &cb, &dsr)) 471 if (gru_get_cpu_resources(bytes, &cb, &dsr))
471 return MQE_BUG_NO_RESOURCES; 472 return MQE_BUG_NO_RESOURCES;
472 memcpy(dsr, mesg, bytes); 473 memcpy(dsr, mesg, bytes);
diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c
index 0eeb8dddd2f5..e11e1ac50900 100644
--- a/drivers/misc/sgi-gru/grumain.c
+++ b/drivers/misc/sgi-gru/grumain.c
@@ -432,29 +432,35 @@ static inline long gru_copy_handle(void *d, void *s)
432 return GRU_HANDLE_BYTES; 432 return GRU_HANDLE_BYTES;
433} 433}
434 434
435/* rewrite in assembly & use lots of prefetch */ 435static void gru_prefetch_context(void *gseg, void *cb, void *cbe, unsigned long cbrmap,
436static void gru_load_context_data(void *save, void *grubase, int ctxnum, 436 unsigned long length)
437 unsigned long cbrmap, unsigned long dsrmap)
438{ 437{
439 void *gseg, *cb, *cbe;
440 unsigned long length;
441 int i, scr; 438 int i, scr;
442 439
443 gseg = grubase + ctxnum * GRU_GSEG_STRIDE;
444 length = hweight64(dsrmap) * GRU_DSR_AU_BYTES;
445 prefetch_data(gseg + GRU_DS_BASE, length / GRU_CACHE_LINE_BYTES, 440 prefetch_data(gseg + GRU_DS_BASE, length / GRU_CACHE_LINE_BYTES,
446 GRU_CACHE_LINE_BYTES); 441 GRU_CACHE_LINE_BYTES);
447 442
448 cb = gseg + GRU_CB_BASE;
449 cbe = grubase + GRU_CBE_BASE;
450 for_each_cbr_in_allocation_map(i, &cbrmap, scr) { 443 for_each_cbr_in_allocation_map(i, &cbrmap, scr) {
451 prefetch_data(cb, 1, GRU_CACHE_LINE_BYTES); 444 prefetch_data(cb, 1, GRU_CACHE_LINE_BYTES);
452 prefetch_data(cbe + i * GRU_HANDLE_STRIDE, 1, 445 prefetch_data(cbe + i * GRU_HANDLE_STRIDE, 1,
453 GRU_CACHE_LINE_BYTES); 446 GRU_CACHE_LINE_BYTES);
454 cb += GRU_HANDLE_STRIDE; 447 cb += GRU_HANDLE_STRIDE;
455 } 448 }
449}
450
451static void gru_load_context_data(void *save, void *grubase, int ctxnum,
452 unsigned long cbrmap, unsigned long dsrmap)
453{
454 void *gseg, *cb, *cbe;
455 unsigned long length;
456 int i, scr;
456 457
458 gseg = grubase + ctxnum * GRU_GSEG_STRIDE;
457 cb = gseg + GRU_CB_BASE; 459 cb = gseg + GRU_CB_BASE;
460 cbe = grubase + GRU_CBE_BASE;
461 length = hweight64(dsrmap) * GRU_DSR_AU_BYTES;
462 gru_prefetch_context(gseg, cb, cbe, cbrmap, length);
463
458 for_each_cbr_in_allocation_map(i, &cbrmap, scr) { 464 for_each_cbr_in_allocation_map(i, &cbrmap, scr) {
459 save += gru_copy_handle(cb, save); 465 save += gru_copy_handle(cb, save);
460 save += gru_copy_handle(cbe + i * GRU_HANDLE_STRIDE, save); 466 save += gru_copy_handle(cbe + i * GRU_HANDLE_STRIDE, save);
@@ -472,15 +478,16 @@ static void gru_unload_context_data(void *save, void *grubase, int ctxnum,
472 int i, scr; 478 int i, scr;
473 479
474 gseg = grubase + ctxnum * GRU_GSEG_STRIDE; 480 gseg = grubase + ctxnum * GRU_GSEG_STRIDE;
475
476 cb = gseg + GRU_CB_BASE; 481 cb = gseg + GRU_CB_BASE;
477 cbe = grubase + GRU_CBE_BASE; 482 cbe = grubase + GRU_CBE_BASE;
483 length = hweight64(dsrmap) * GRU_DSR_AU_BYTES;
484 gru_prefetch_context(gseg, cb, cbe, cbrmap, length);
485
478 for_each_cbr_in_allocation_map(i, &cbrmap, scr) { 486 for_each_cbr_in_allocation_map(i, &cbrmap, scr) {
479 save += gru_copy_handle(save, cb); 487 save += gru_copy_handle(save, cb);
480 save += gru_copy_handle(save, cbe + i * GRU_HANDLE_STRIDE); 488 save += gru_copy_handle(save, cbe + i * GRU_HANDLE_STRIDE);
481 cb += GRU_HANDLE_STRIDE; 489 cb += GRU_HANDLE_STRIDE;
482 } 490 }
483 length = hweight64(dsrmap) * GRU_DSR_AU_BYTES;
484 memcpy(save, gseg + GRU_DS_BASE, length); 491 memcpy(save, gseg + GRU_DS_BASE, length);
485} 492}
486 493