diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2012-11-21 05:38:13 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-11-21 05:38:13 -0500 |
commit | 851462444d421c223965b12b836bef63da61b57f (patch) | |
tree | 495baa14e638817941496c36e1443aed7dae0ea0 /drivers/char | |
parent | 5a6ea4af0907f995dc06df21a9c9ef764c7cd3bc (diff) | |
parent | 6924d99fcdf1a688538a3cdebd1f135c22eec191 (diff) |
Merge branch 'for-3.7' of git://git.infradead.org/users/dedekind/l2-mtd
Conflicts:
drivers/mtd/nand/nand_base.c
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Makefile | 1 | ||||
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 2 | ||||
-rw-r--r-- | drivers/char/ds1620.c | 8 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 2 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 36 | ||||
-rw-r--r-- | drivers/char/nwflash.c | 4 | ||||
-rw-r--r-- | drivers/char/raw.c | 2 | ||||
-rw-r--r-- | drivers/char/sonypi.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 24 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.h | 9 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_ppi.c | 18 |
11 files changed, 77 insertions, 31 deletions
diff --git a/drivers/char/Makefile b/drivers/char/Makefile index d0b27a39f1d4..7ff1d0d208a7 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile | |||
@@ -52,7 +52,6 @@ obj-$(CONFIG_TELCLOCK) += tlclk.o | |||
52 | obj-$(CONFIG_MWAVE) += mwave/ | 52 | obj-$(CONFIG_MWAVE) += mwave/ |
53 | obj-$(CONFIG_AGP) += agp/ | 53 | obj-$(CONFIG_AGP) += agp/ |
54 | obj-$(CONFIG_PCMCIA) += pcmcia/ | 54 | obj-$(CONFIG_PCMCIA) += pcmcia/ |
55 | obj-$(CONFIG_IPMI_HANDLER) += ipmi/ | ||
56 | 55 | ||
57 | obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o | 56 | obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o |
58 | obj-$(CONFIG_TCG_TPM) += tpm/ | 57 | obj-$(CONFIG_TCG_TPM) += tpm/ |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index e01f5eaaec82..38390f7c6ab6 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -667,7 +667,7 @@ static int intel_gtt_init(void) | |||
667 | gtt_map_size = intel_private.base.gtt_total_entries * 4; | 667 | gtt_map_size = intel_private.base.gtt_total_entries * 4; |
668 | 668 | ||
669 | intel_private.gtt = NULL; | 669 | intel_private.gtt = NULL; |
670 | if (INTEL_GTT_GEN < 6) | 670 | if (INTEL_GTT_GEN < 6 && INTEL_GTT_GEN > 2) |
671 | intel_private.gtt = ioremap_wc(intel_private.gtt_bus_addr, | 671 | intel_private.gtt = ioremap_wc(intel_private.gtt_bus_addr, |
672 | gtt_map_size); | 672 | gtt_map_size); |
673 | if (intel_private.gtt == NULL) | 673 | if (intel_private.gtt == NULL) |
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index aab9605f0b43..24ffd8cec51e 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c | |||
@@ -74,21 +74,21 @@ static inline void netwinder_ds1620_reset(void) | |||
74 | 74 | ||
75 | static inline void netwinder_lock(unsigned long *flags) | 75 | static inline void netwinder_lock(unsigned long *flags) |
76 | { | 76 | { |
77 | spin_lock_irqsave(&nw_gpio_lock, *flags); | 77 | raw_spin_lock_irqsave(&nw_gpio_lock, *flags); |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline void netwinder_unlock(unsigned long *flags) | 80 | static inline void netwinder_unlock(unsigned long *flags) |
81 | { | 81 | { |
82 | spin_unlock_irqrestore(&nw_gpio_lock, *flags); | 82 | raw_spin_unlock_irqrestore(&nw_gpio_lock, *flags); |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline void netwinder_set_fan(int i) | 85 | static inline void netwinder_set_fan(int i) |
86 | { | 86 | { |
87 | unsigned long flags; | 87 | unsigned long flags; |
88 | 88 | ||
89 | spin_lock_irqsave(&nw_gpio_lock, flags); | 89 | raw_spin_lock_irqsave(&nw_gpio_lock, flags); |
90 | nw_gpio_modify_op(GPIO_FAN, i ? GPIO_FAN : 0); | 90 | nw_gpio_modify_op(GPIO_FAN, i ? GPIO_FAN : 0); |
91 | spin_unlock_irqrestore(&nw_gpio_lock, flags); | 91 | raw_spin_unlock_irqrestore(&nw_gpio_lock, flags); |
92 | } | 92 | } |
93 | 93 | ||
94 | static inline int netwinder_get_fan(void) | 94 | static inline int netwinder_get_fan(void) |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 2c29942b1326..a0c84bb30856 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -1880,7 +1880,7 @@ int ipmi_request_supply_msgs(ipmi_user_t user, | |||
1880 | struct ipmi_recv_msg *supplied_recv, | 1880 | struct ipmi_recv_msg *supplied_recv, |
1881 | int priority) | 1881 | int priority) |
1882 | { | 1882 | { |
1883 | unsigned char saddr, lun; | 1883 | unsigned char saddr = 0, lun = 0; |
1884 | int rv; | 1884 | int rv; |
1885 | 1885 | ||
1886 | if (!user) | 1886 | if (!user) |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 83f85cf7fb1b..32a6c7e256bd 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2424,6 +2424,38 @@ static void ipmi_pci_cleanup(struct smi_info *info) | |||
2424 | pci_disable_device(pdev); | 2424 | pci_disable_device(pdev); |
2425 | } | 2425 | } |
2426 | 2426 | ||
2427 | static int __devinit ipmi_pci_probe_regspacing(struct smi_info *info) | ||
2428 | { | ||
2429 | if (info->si_type == SI_KCS) { | ||
2430 | unsigned char status; | ||
2431 | int regspacing; | ||
2432 | |||
2433 | info->io.regsize = DEFAULT_REGSIZE; | ||
2434 | info->io.regshift = 0; | ||
2435 | info->io_size = 2; | ||
2436 | info->handlers = &kcs_smi_handlers; | ||
2437 | |||
2438 | /* detect 1, 4, 16byte spacing */ | ||
2439 | for (regspacing = DEFAULT_REGSPACING; regspacing <= 16;) { | ||
2440 | info->io.regspacing = regspacing; | ||
2441 | if (info->io_setup(info)) { | ||
2442 | dev_err(info->dev, | ||
2443 | "Could not setup I/O space\n"); | ||
2444 | return DEFAULT_REGSPACING; | ||
2445 | } | ||
2446 | /* write invalid cmd */ | ||
2447 | info->io.outputb(&info->io, 1, 0x10); | ||
2448 | /* read status back */ | ||
2449 | status = info->io.inputb(&info->io, 1); | ||
2450 | info->io_cleanup(info); | ||
2451 | if (status) | ||
2452 | return regspacing; | ||
2453 | regspacing *= 4; | ||
2454 | } | ||
2455 | } | ||
2456 | return DEFAULT_REGSPACING; | ||
2457 | } | ||
2458 | |||
2427 | static int __devinit ipmi_pci_probe(struct pci_dev *pdev, | 2459 | static int __devinit ipmi_pci_probe(struct pci_dev *pdev, |
2428 | const struct pci_device_id *ent) | 2460 | const struct pci_device_id *ent) |
2429 | { | 2461 | { |
@@ -2476,8 +2508,8 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev, | |||
2476 | } | 2508 | } |
2477 | info->io.addr_data = pci_resource_start(pdev, 0); | 2509 | info->io.addr_data = pci_resource_start(pdev, 0); |
2478 | 2510 | ||
2479 | info->io.regspacing = DEFAULT_REGSPACING; | 2511 | info->io.regspacing = ipmi_pci_probe_regspacing(info); |
2480 | info->io.regsize = DEFAULT_REGSPACING; | 2512 | info->io.regsize = DEFAULT_REGSIZE; |
2481 | info->io.regshift = 0; | 2513 | info->io.regshift = 0; |
2482 | 2514 | ||
2483 | info->irq = pdev->irq; | 2515 | info->irq = pdev->irq; |
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c index a0e2f7d70355..e371480d3639 100644 --- a/drivers/char/nwflash.c +++ b/drivers/char/nwflash.c | |||
@@ -583,9 +583,9 @@ static void kick_open(void) | |||
583 | * we want to write a bit pattern XXX1 to Xilinx to enable | 583 | * we want to write a bit pattern XXX1 to Xilinx to enable |
584 | * the write gate, which will be open for about the next 2ms. | 584 | * the write gate, which will be open for about the next 2ms. |
585 | */ | 585 | */ |
586 | spin_lock_irqsave(&nw_gpio_lock, flags); | 586 | raw_spin_lock_irqsave(&nw_gpio_lock, flags); |
587 | nw_cpld_modify(CPLD_FLASH_WR_ENABLE, CPLD_FLASH_WR_ENABLE); | 587 | nw_cpld_modify(CPLD_FLASH_WR_ENABLE, CPLD_FLASH_WR_ENABLE); |
588 | spin_unlock_irqrestore(&nw_gpio_lock, flags); | 588 | raw_spin_unlock_irqrestore(&nw_gpio_lock, flags); |
589 | 589 | ||
590 | /* | 590 | /* |
591 | * let the ISA bus to catch on... | 591 | * let the ISA bus to catch on... |
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index 54a3a6d09819..0bb207eaef2f 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -285,7 +285,7 @@ static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd, | |||
285 | 285 | ||
286 | static const struct file_operations raw_fops = { | 286 | static const struct file_operations raw_fops = { |
287 | .read = do_sync_read, | 287 | .read = do_sync_read, |
288 | .aio_read = generic_file_aio_read, | 288 | .aio_read = blkdev_aio_read, |
289 | .write = do_sync_write, | 289 | .write = do_sync_write, |
290 | .aio_write = blkdev_aio_write, | 290 | .aio_write = blkdev_aio_write, |
291 | .fsync = blkdev_fsync, | 291 | .fsync = blkdev_fsync, |
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 320debbe32fa..9b4f0116ff21 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -1456,7 +1456,7 @@ static int __devexit sonypi_remove(struct platform_device *dev) | |||
1456 | return 0; | 1456 | return 0; |
1457 | } | 1457 | } |
1458 | 1458 | ||
1459 | #ifdef CONFIG_PM | 1459 | #ifdef CONFIG_PM_SLEEP |
1460 | static int old_camera_power; | 1460 | static int old_camera_power; |
1461 | 1461 | ||
1462 | static int sonypi_suspend(struct device *dev) | 1462 | static int sonypi_suspend(struct device *dev) |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index f26afdb1a702..93211df52aab 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -1182,17 +1182,20 @@ ssize_t tpm_write(struct file *file, const char __user *buf, | |||
1182 | size_t size, loff_t *off) | 1182 | size_t size, loff_t *off) |
1183 | { | 1183 | { |
1184 | struct tpm_chip *chip = file->private_data; | 1184 | struct tpm_chip *chip = file->private_data; |
1185 | size_t in_size = size, out_size; | 1185 | size_t in_size = size; |
1186 | ssize_t out_size; | ||
1186 | 1187 | ||
1187 | /* cannot perform a write until the read has cleared | 1188 | /* cannot perform a write until the read has cleared |
1188 | either via tpm_read or a user_read_timer timeout */ | 1189 | either via tpm_read or a user_read_timer timeout. |
1189 | while (atomic_read(&chip->data_pending) != 0) | 1190 | This also prevents splitted buffered writes from blocking here. |
1190 | msleep(TPM_TIMEOUT); | 1191 | */ |
1191 | 1192 | if (atomic_read(&chip->data_pending) != 0) | |
1192 | mutex_lock(&chip->buffer_mutex); | 1193 | return -EBUSY; |
1193 | 1194 | ||
1194 | if (in_size > TPM_BUFSIZE) | 1195 | if (in_size > TPM_BUFSIZE) |
1195 | in_size = TPM_BUFSIZE; | 1196 | return -E2BIG; |
1197 | |||
1198 | mutex_lock(&chip->buffer_mutex); | ||
1196 | 1199 | ||
1197 | if (copy_from_user | 1200 | if (copy_from_user |
1198 | (chip->data_buffer, (void __user *) buf, in_size)) { | 1201 | (chip->data_buffer, (void __user *) buf, in_size)) { |
@@ -1202,6 +1205,10 @@ ssize_t tpm_write(struct file *file, const char __user *buf, | |||
1202 | 1205 | ||
1203 | /* atomic tpm command send and result receive */ | 1206 | /* atomic tpm command send and result receive */ |
1204 | out_size = tpm_transmit(chip, chip->data_buffer, TPM_BUFSIZE); | 1207 | out_size = tpm_transmit(chip, chip->data_buffer, TPM_BUFSIZE); |
1208 | if (out_size < 0) { | ||
1209 | mutex_unlock(&chip->buffer_mutex); | ||
1210 | return out_size; | ||
1211 | } | ||
1205 | 1212 | ||
1206 | atomic_set(&chip->data_pending, out_size); | 1213 | atomic_set(&chip->data_pending, out_size); |
1207 | mutex_unlock(&chip->buffer_mutex); | 1214 | mutex_unlock(&chip->buffer_mutex); |
@@ -1259,6 +1266,7 @@ void tpm_remove_hardware(struct device *dev) | |||
1259 | 1266 | ||
1260 | misc_deregister(&chip->vendor.miscdev); | 1267 | misc_deregister(&chip->vendor.miscdev); |
1261 | sysfs_remove_group(&dev->kobj, chip->vendor.attr_group); | 1268 | sysfs_remove_group(&dev->kobj, chip->vendor.attr_group); |
1269 | tpm_remove_ppi(&dev->kobj); | ||
1262 | tpm_bios_log_teardown(chip->bios_dir); | 1270 | tpm_bios_log_teardown(chip->bios_dir); |
1263 | 1271 | ||
1264 | /* write it this way to be explicit (chip->dev == dev) */ | 1272 | /* write it this way to be explicit (chip->dev == dev) */ |
@@ -1476,7 +1484,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, | |||
1476 | goto put_device; | 1484 | goto put_device; |
1477 | } | 1485 | } |
1478 | 1486 | ||
1479 | if (sys_add_ppi(&dev->kobj)) { | 1487 | if (tpm_add_ppi(&dev->kobj)) { |
1480 | misc_deregister(&chip->vendor.miscdev); | 1488 | misc_deregister(&chip->vendor.miscdev); |
1481 | goto put_device; | 1489 | goto put_device; |
1482 | } | 1490 | } |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 02c266aa2bf7..8ef7649a50aa 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -329,10 +329,15 @@ extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long, | |||
329 | wait_queue_head_t *); | 329 | wait_queue_head_t *); |
330 | 330 | ||
331 | #ifdef CONFIG_ACPI | 331 | #ifdef CONFIG_ACPI |
332 | extern ssize_t sys_add_ppi(struct kobject *parent); | 332 | extern int tpm_add_ppi(struct kobject *); |
333 | extern void tpm_remove_ppi(struct kobject *); | ||
333 | #else | 334 | #else |
334 | static inline ssize_t sys_add_ppi(struct kobject *parent) | 335 | static inline int tpm_add_ppi(struct kobject *parent) |
335 | { | 336 | { |
336 | return 0; | 337 | return 0; |
337 | } | 338 | } |
339 | |||
340 | static inline void tpm_remove_ppi(struct kobject *parent) | ||
341 | { | ||
342 | } | ||
338 | #endif | 343 | #endif |
diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c index f27b58cfae98..720ebcf29fdf 100644 --- a/drivers/char/tpm/tpm_ppi.c +++ b/drivers/char/tpm/tpm_ppi.c | |||
@@ -444,18 +444,20 @@ static struct attribute *ppi_attrs[] = { | |||
444 | &dev_attr_vs_operations.attr, NULL, | 444 | &dev_attr_vs_operations.attr, NULL, |
445 | }; | 445 | }; |
446 | static struct attribute_group ppi_attr_grp = { | 446 | static struct attribute_group ppi_attr_grp = { |
447 | .name = "ppi", | ||
447 | .attrs = ppi_attrs | 448 | .attrs = ppi_attrs |
448 | }; | 449 | }; |
449 | 450 | ||
450 | ssize_t sys_add_ppi(struct kobject *parent) | 451 | int tpm_add_ppi(struct kobject *parent) |
451 | { | 452 | { |
452 | struct kobject *ppi; | 453 | return sysfs_create_group(parent, &ppi_attr_grp); |
453 | ppi = kobject_create_and_add("ppi", parent); | 454 | } |
454 | if (sysfs_create_group(ppi, &ppi_attr_grp)) | 455 | EXPORT_SYMBOL_GPL(tpm_add_ppi); |
455 | return -EFAULT; | 456 | |
456 | else | 457 | void tpm_remove_ppi(struct kobject *parent) |
457 | return 0; | 458 | { |
459 | sysfs_remove_group(parent, &ppi_attr_grp); | ||
458 | } | 460 | } |
459 | EXPORT_SYMBOL_GPL(sys_add_ppi); | 461 | EXPORT_SYMBOL_GPL(tpm_remove_ppi); |
460 | 462 | ||
461 | MODULE_LICENSE("GPL"); | 463 | MODULE_LICENSE("GPL"); |