diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-08-04 09:14:38 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-08-04 09:14:38 -0400 |
commit | d790d4d583aeaed9fc6f8a9f4d9f8ce6b1c15c7f (patch) | |
tree | 854ab394486288d40fa8179cbfaf66e8bdc44b0f /drivers/char | |
parent | 73b2c7165b76b20eb1290e7efebc33cfd21db1ca (diff) | |
parent | 3a09b1be53d23df780a0cd0e4087a05e2ca4a00c (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/generic.c | 6 | ||||
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 13 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 23 | ||||
-rw-r--r-- | drivers/char/sysrq.c | 10 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.h | 1 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 9 |
6 files changed, 44 insertions, 18 deletions
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 4b51982fd23a..d2abf5143983 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -97,20 +97,18 @@ EXPORT_SYMBOL(agp_flush_chipset); | |||
97 | void agp_alloc_page_array(size_t size, struct agp_memory *mem) | 97 | void agp_alloc_page_array(size_t size, struct agp_memory *mem) |
98 | { | 98 | { |
99 | mem->pages = NULL; | 99 | mem->pages = NULL; |
100 | mem->vmalloc_flag = false; | ||
101 | 100 | ||
102 | if (size <= 2*PAGE_SIZE) | 101 | if (size <= 2*PAGE_SIZE) |
103 | mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY); | 102 | mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); |
104 | if (mem->pages == NULL) { | 103 | if (mem->pages == NULL) { |
105 | mem->pages = vmalloc(size); | 104 | mem->pages = vmalloc(size); |
106 | mem->vmalloc_flag = true; | ||
107 | } | 105 | } |
108 | } | 106 | } |
109 | EXPORT_SYMBOL(agp_alloc_page_array); | 107 | EXPORT_SYMBOL(agp_alloc_page_array); |
110 | 108 | ||
111 | void agp_free_page_array(struct agp_memory *mem) | 109 | void agp_free_page_array(struct agp_memory *mem) |
112 | { | 110 | { |
113 | if (mem->vmalloc_flag) { | 111 | if (is_vmalloc_addr(mem->pages)) { |
114 | vfree(mem->pages); | 112 | vfree(mem->pages); |
115 | } else { | 113 | } else { |
116 | kfree(mem->pages); | 114 | kfree(mem->pages); |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 9344216183a4..a7547150a705 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void) | |||
1216 | 1216 | ||
1217 | /* G33's GTT size defined in gmch_ctrl */ | 1217 | /* G33's GTT size defined in gmch_ctrl */ |
1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); | 1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); |
1219 | switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) { | 1219 | switch (gmch_ctrl & I830_GMCH_GMS_MASK) { |
1220 | case G33_PGETBL_SIZE_1M: | 1220 | case I830_GMCH_GMS_STOLEN_512: |
1221 | size = 512; | ||
1222 | break; | ||
1223 | case I830_GMCH_GMS_STOLEN_1024: | ||
1221 | size = 1024; | 1224 | size = 1024; |
1222 | break; | 1225 | break; |
1223 | case G33_PGETBL_SIZE_2M: | 1226 | case I830_GMCH_GMS_STOLEN_8192: |
1224 | size = 2048; | 1227 | size = 8*1024; |
1225 | break; | 1228 | break; |
1226 | default: | 1229 | default: |
1227 | dev_info(&agp_bridge->dev->dev, | 1230 | dev_info(&agp_bridge->dev->dev, |
1228 | "unknown page table size 0x%x, assuming 512KB\n", | 1231 | "unknown page table size 0x%x, assuming 512KB\n", |
1229 | (gmch_ctrl & G33_PGETBL_SIZE_MASK)); | 1232 | (gmch_ctrl & I830_GMCH_GMS_MASK)); |
1230 | size = 512; | 1233 | size = 512; |
1231 | } | 1234 | } |
1232 | } else { | 1235 | } else { |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 35603dd4e6c5..094bdc355b1f 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -302,6 +302,12 @@ struct smi_info { | |||
302 | 302 | ||
303 | static int force_kipmid[SI_MAX_PARMS]; | 303 | static int force_kipmid[SI_MAX_PARMS]; |
304 | static int num_force_kipmid; | 304 | static int num_force_kipmid; |
305 | #ifdef CONFIG_PCI | ||
306 | static int pci_registered; | ||
307 | #endif | ||
308 | #ifdef CONFIG_PPC_OF | ||
309 | static int of_registered; | ||
310 | #endif | ||
305 | 311 | ||
306 | static unsigned int kipmid_max_busy_us[SI_MAX_PARMS]; | 312 | static unsigned int kipmid_max_busy_us[SI_MAX_PARMS]; |
307 | static int num_max_busy_us; | 313 | static int num_max_busy_us; |
@@ -1018,7 +1024,7 @@ static int ipmi_thread(void *data) | |||
1018 | else if (smi_result == SI_SM_IDLE) | 1024 | else if (smi_result == SI_SM_IDLE) |
1019 | schedule_timeout_interruptible(100); | 1025 | schedule_timeout_interruptible(100); |
1020 | else | 1026 | else |
1021 | schedule_timeout_interruptible(0); | 1027 | schedule_timeout_interruptible(1); |
1022 | } | 1028 | } |
1023 | return 0; | 1029 | return 0; |
1024 | } | 1030 | } |
@@ -3314,6 +3320,8 @@ static __devinit int init_ipmi_si(void) | |||
3314 | rv = pci_register_driver(&ipmi_pci_driver); | 3320 | rv = pci_register_driver(&ipmi_pci_driver); |
3315 | if (rv) | 3321 | if (rv) |
3316 | printk(KERN_ERR PFX "Unable to register PCI driver: %d\n", rv); | 3322 | printk(KERN_ERR PFX "Unable to register PCI driver: %d\n", rv); |
3323 | else | ||
3324 | pci_registered = 1; | ||
3317 | #endif | 3325 | #endif |
3318 | 3326 | ||
3319 | #ifdef CONFIG_ACPI | 3327 | #ifdef CONFIG_ACPI |
@@ -3330,6 +3338,7 @@ static __devinit int init_ipmi_si(void) | |||
3330 | 3338 | ||
3331 | #ifdef CONFIG_PPC_OF | 3339 | #ifdef CONFIG_PPC_OF |
3332 | of_register_platform_driver(&ipmi_of_platform_driver); | 3340 | of_register_platform_driver(&ipmi_of_platform_driver); |
3341 | of_registered = 1; | ||
3333 | #endif | 3342 | #endif |
3334 | 3343 | ||
3335 | /* We prefer devices with interrupts, but in the case of a machine | 3344 | /* We prefer devices with interrupts, but in the case of a machine |
@@ -3383,11 +3392,13 @@ static __devinit int init_ipmi_si(void) | |||
3383 | if (unload_when_empty && list_empty(&smi_infos)) { | 3392 | if (unload_when_empty && list_empty(&smi_infos)) { |
3384 | mutex_unlock(&smi_infos_lock); | 3393 | mutex_unlock(&smi_infos_lock); |
3385 | #ifdef CONFIG_PCI | 3394 | #ifdef CONFIG_PCI |
3386 | pci_unregister_driver(&ipmi_pci_driver); | 3395 | if (pci_registered) |
3396 | pci_unregister_driver(&ipmi_pci_driver); | ||
3387 | #endif | 3397 | #endif |
3388 | 3398 | ||
3389 | #ifdef CONFIG_PPC_OF | 3399 | #ifdef CONFIG_PPC_OF |
3390 | of_unregister_platform_driver(&ipmi_of_platform_driver); | 3400 | if (of_registered) |
3401 | of_unregister_platform_driver(&ipmi_of_platform_driver); | ||
3391 | #endif | 3402 | #endif |
3392 | driver_unregister(&ipmi_driver.driver); | 3403 | driver_unregister(&ipmi_driver.driver); |
3393 | printk(KERN_WARNING PFX | 3404 | printk(KERN_WARNING PFX |
@@ -3478,14 +3489,16 @@ static __exit void cleanup_ipmi_si(void) | |||
3478 | return; | 3489 | return; |
3479 | 3490 | ||
3480 | #ifdef CONFIG_PCI | 3491 | #ifdef CONFIG_PCI |
3481 | pci_unregister_driver(&ipmi_pci_driver); | 3492 | if (pci_registered) |
3493 | pci_unregister_driver(&ipmi_pci_driver); | ||
3482 | #endif | 3494 | #endif |
3483 | #ifdef CONFIG_ACPI | 3495 | #ifdef CONFIG_ACPI |
3484 | pnp_unregister_driver(&ipmi_pnp_driver); | 3496 | pnp_unregister_driver(&ipmi_pnp_driver); |
3485 | #endif | 3497 | #endif |
3486 | 3498 | ||
3487 | #ifdef CONFIG_PPC_OF | 3499 | #ifdef CONFIG_PPC_OF |
3488 | of_unregister_platform_driver(&ipmi_of_platform_driver); | 3500 | if (of_registered) |
3501 | of_unregister_platform_driver(&ipmi_of_platform_driver); | ||
3489 | #endif | 3502 | #endif |
3490 | 3503 | ||
3491 | mutex_lock(&smi_infos_lock); | 3504 | mutex_lock(&smi_infos_lock); |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 5d15630a5830..878ac0c2cc68 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p) | |||
493 | sysrq_key_table[i] = op_p; | 493 | sysrq_key_table[i] = op_p; |
494 | } | 494 | } |
495 | 495 | ||
496 | static void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) | 496 | void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) |
497 | { | 497 | { |
498 | struct sysrq_key_op *op_p; | 498 | struct sysrq_key_op *op_p; |
499 | int orig_log_level; | 499 | int orig_log_level; |
@@ -580,8 +580,12 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type, | |||
580 | case KEY_RIGHTALT: | 580 | case KEY_RIGHTALT: |
581 | if (value) | 581 | if (value) |
582 | sysrq_alt = code; | 582 | sysrq_alt = code; |
583 | else if (sysrq_down && code == sysrq_alt_use) | 583 | else { |
584 | sysrq_down = false; | 584 | if (sysrq_down && code == sysrq_alt_use) |
585 | sysrq_down = false; | ||
586 | |||
587 | sysrq_alt = 0; | ||
588 | } | ||
585 | break; | 589 | break; |
586 | 590 | ||
587 | case KEY_SYSRQ: | 591 | case KEY_SYSRQ: |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 8e00b4ddd083..792868d24f2a 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -224,6 +224,7 @@ struct tpm_readpubek_params_out { | |||
224 | u8 algorithm[4]; | 224 | u8 algorithm[4]; |
225 | u8 encscheme[2]; | 225 | u8 encscheme[2]; |
226 | u8 sigscheme[2]; | 226 | u8 sigscheme[2]; |
227 | __be32 paramsize; | ||
227 | u8 parameters[12]; /*assuming RSA*/ | 228 | u8 parameters[12]; /*assuming RSA*/ |
228 | __be32 keysize; | 229 | __be32 keysize; |
229 | u8 modulus[256]; | 230 | u8 modulus[256]; |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 24314a9cffe8..1030f8420137 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -623,7 +623,14 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | |||
623 | 623 | ||
624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
625 | { | 625 | { |
626 | return tpm_pm_resume(&dev->dev); | 626 | struct tpm_chip *chip = pnp_get_drvdata(dev); |
627 | int ret; | ||
628 | |||
629 | ret = tpm_pm_resume(&dev->dev); | ||
630 | if (!ret) | ||
631 | tpm_continue_selftest(chip); | ||
632 | |||
633 | return ret; | ||
627 | } | 634 | } |
628 | 635 | ||
629 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { | 636 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { |