diff options
Diffstat (limited to 'drivers')
67 files changed, 478 insertions, 262 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 071c1dfb93f3..350d52a8f781 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -68,7 +68,7 @@ MODULE_AUTHOR("Bruno Ducrot"); | |||
68 | MODULE_DESCRIPTION("ACPI Video Driver"); | 68 | MODULE_DESCRIPTION("ACPI Video Driver"); |
69 | MODULE_LICENSE("GPL"); | 69 | MODULE_LICENSE("GPL"); |
70 | 70 | ||
71 | static bool brightness_switch_enabled; | 71 | static bool brightness_switch_enabled = 1; |
72 | module_param(brightness_switch_enabled, bool, 0644); | 72 | module_param(brightness_switch_enabled, bool, 0644); |
73 | 73 | ||
74 | /* | 74 | /* |
@@ -581,6 +581,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
581 | }, | 581 | }, |
582 | { | 582 | { |
583 | .callback = video_set_use_native_backlight, | 583 | .callback = video_set_use_native_backlight, |
584 | .ident = "HP ProBook 4540s", | ||
585 | .matches = { | ||
586 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
587 | DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4540s"), | ||
588 | }, | ||
589 | }, | ||
590 | { | ||
591 | .callback = video_set_use_native_backlight, | ||
584 | .ident = "HP ProBook 2013 models", | 592 | .ident = "HP ProBook 2013 models", |
585 | .matches = { | 593 | .matches = { |
586 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | 594 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index dae5607e1115..4cd52a4541a9 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -456,6 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
456 | 456 | ||
457 | /* Promise */ | 457 | /* Promise */ |
458 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ | 458 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ |
459 | { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */ | ||
459 | 460 | ||
460 | /* Asmedia */ | 461 | /* Asmedia */ |
461 | { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ | 462 | { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 18d97d5c7d90..d19c37a7abc9 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4787,6 +4787,10 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) | |||
4787 | * ata_qc_new - Request an available ATA command, for queueing | 4787 | * ata_qc_new - Request an available ATA command, for queueing |
4788 | * @ap: target port | 4788 | * @ap: target port |
4789 | * | 4789 | * |
4790 | * Some ATA host controllers may implement a queue depth which is less | ||
4791 | * than ATA_MAX_QUEUE. So we shouldn't allocate a tag which is beyond | ||
4792 | * the hardware limitation. | ||
4793 | * | ||
4790 | * LOCKING: | 4794 | * LOCKING: |
4791 | * None. | 4795 | * None. |
4792 | */ | 4796 | */ |
@@ -4794,14 +4798,16 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) | |||
4794 | static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) | 4798 | static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) |
4795 | { | 4799 | { |
4796 | struct ata_queued_cmd *qc = NULL; | 4800 | struct ata_queued_cmd *qc = NULL; |
4797 | unsigned int i, tag; | 4801 | unsigned int i, tag, max_queue; |
4802 | |||
4803 | max_queue = ap->scsi_host->can_queue; | ||
4798 | 4804 | ||
4799 | /* no command while frozen */ | 4805 | /* no command while frozen */ |
4800 | if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) | 4806 | if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) |
4801 | return NULL; | 4807 | return NULL; |
4802 | 4808 | ||
4803 | for (i = 0; i < ATA_MAX_QUEUE; i++) { | 4809 | for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { |
4804 | tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE; | 4810 | tag = tag < max_queue ? tag : 0; |
4805 | 4811 | ||
4806 | /* the last tag is reserved for internal command. */ | 4812 | /* the last tag is reserved for internal command. */ |
4807 | if (tag == ATA_TAG_INTERNAL) | 4813 | if (tag == ATA_TAG_INTERNAL) |
@@ -6169,6 +6175,16 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) | |||
6169 | { | 6175 | { |
6170 | int i, rc; | 6176 | int i, rc; |
6171 | 6177 | ||
6178 | /* | ||
6179 | * The max queue supported by hardware must not be greater than | ||
6180 | * ATA_MAX_QUEUE. | ||
6181 | */ | ||
6182 | if (sht->can_queue > ATA_MAX_QUEUE) { | ||
6183 | dev_err(host->dev, "BUG: the hardware max queue is too large\n"); | ||
6184 | WARN_ON(1); | ||
6185 | return -EINVAL; | ||
6186 | } | ||
6187 | |||
6172 | /* host must have been started */ | 6188 | /* host must have been started */ |
6173 | if (!(host->flags & ATA_HOST_STARTED)) { | 6189 | if (!(host->flags & ATA_HOST_STARTED)) { |
6174 | dev_err(host->dev, "BUG: trying to register unstarted host\n"); | 6190 | dev_err(host->dev, "BUG: trying to register unstarted host\n"); |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 6760fc4e85b8..dad83df555c4 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1811,7 +1811,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, | |||
1811 | case ATA_DEV_ATA: | 1811 | case ATA_DEV_ATA: |
1812 | if (err & ATA_ICRC) | 1812 | if (err & ATA_ICRC) |
1813 | qc->err_mask |= AC_ERR_ATA_BUS; | 1813 | qc->err_mask |= AC_ERR_ATA_BUS; |
1814 | if (err & ATA_UNC) | 1814 | if (err & (ATA_UNC | ATA_AMNF)) |
1815 | qc->err_mask |= AC_ERR_MEDIA; | 1815 | qc->err_mask |= AC_ERR_MEDIA; |
1816 | if (err & ATA_IDNF) | 1816 | if (err & ATA_IDNF) |
1817 | qc->err_mask |= AC_ERR_INVALID; | 1817 | qc->err_mask |= AC_ERR_INVALID; |
@@ -2556,11 +2556,12 @@ static void ata_eh_link_report(struct ata_link *link) | |||
2556 | } | 2556 | } |
2557 | 2557 | ||
2558 | if (cmd->command != ATA_CMD_PACKET && | 2558 | if (cmd->command != ATA_CMD_PACKET && |
2559 | (res->feature & (ATA_ICRC | ATA_UNC | ATA_IDNF | | 2559 | (res->feature & (ATA_ICRC | ATA_UNC | ATA_AMNF | |
2560 | ATA_ABORTED))) | 2560 | ATA_IDNF | ATA_ABORTED))) |
2561 | ata_dev_err(qc->dev, "error: { %s%s%s%s}\n", | 2561 | ata_dev_err(qc->dev, "error: { %s%s%s%s%s}\n", |
2562 | res->feature & ATA_ICRC ? "ICRC " : "", | 2562 | res->feature & ATA_ICRC ? "ICRC " : "", |
2563 | res->feature & ATA_UNC ? "UNC " : "", | 2563 | res->feature & ATA_UNC ? "UNC " : "", |
2564 | res->feature & ATA_AMNF ? "AMNF " : "", | ||
2564 | res->feature & ATA_IDNF ? "IDNF " : "", | 2565 | res->feature & ATA_IDNF ? "IDNF " : "", |
2565 | res->feature & ATA_ABORTED ? "ABRT " : ""); | 2566 | res->feature & ATA_ABORTED ? "ABRT " : ""); |
2566 | #endif | 2567 | #endif |
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c index 6ad5c072ce34..4d37c5415fc7 100644 --- a/drivers/ata/pata_ep93xx.c +++ b/drivers/ata/pata_ep93xx.c | |||
@@ -915,7 +915,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev) | |||
915 | struct ep93xx_pata_data *drv_data; | 915 | struct ep93xx_pata_data *drv_data; |
916 | struct ata_host *host; | 916 | struct ata_host *host; |
917 | struct ata_port *ap; | 917 | struct ata_port *ap; |
918 | unsigned int irq; | 918 | int irq; |
919 | struct resource *mem_res; | 919 | struct resource *mem_res; |
920 | void __iomem *ide_base; | 920 | void __iomem *ide_base; |
921 | int err; | 921 | int err; |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9e9227e1762d..eee48c49f5de 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -89,8 +89,13 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) | |||
89 | return dev->archdata.irqs[num]; | 89 | return dev->archdata.irqs[num]; |
90 | #else | 90 | #else |
91 | struct resource *r; | 91 | struct resource *r; |
92 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) | 92 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { |
93 | return of_irq_get(dev->dev.of_node, num); | 93 | int ret; |
94 | |||
95 | ret = of_irq_get(dev->dev.of_node, num); | ||
96 | if (ret >= 0 || ret == -EPROBE_DEFER) | ||
97 | return ret; | ||
98 | } | ||
94 | 99 | ||
95 | r = platform_get_resource(dev, IORESOURCE_IRQ, num); | 100 | r = platform_get_resource(dev, IORESOURCE_IRQ, num); |
96 | 101 | ||
@@ -133,8 +138,13 @@ int platform_get_irq_byname(struct platform_device *dev, const char *name) | |||
133 | { | 138 | { |
134 | struct resource *r; | 139 | struct resource *r; |
135 | 140 | ||
136 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) | 141 | if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { |
137 | return of_irq_get_byname(dev->dev.of_node, name); | 142 | int ret; |
143 | |||
144 | ret = of_irq_get_byname(dev->dev.of_node, name); | ||
145 | if (ret >= 0 || ret == -EPROBE_DEFER) | ||
146 | return ret; | ||
147 | } | ||
138 | 148 | ||
139 | r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); | 149 | r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); |
140 | return r ? r->start : -ENXIO; | 150 | return r ? r->start : -ENXIO; |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 1b35c45c92b7..3f2e16738080 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -544,6 +544,12 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection) | |||
544 | struct task_struct *opa; | 544 | struct task_struct *opa; |
545 | 545 | ||
546 | kref_get(&connection->kref); | 546 | kref_get(&connection->kref); |
547 | /* We may just have force_sig()'ed this thread | ||
548 | * to get it out of some blocking network function. | ||
549 | * Clear signals; otherwise kthread_run(), which internally uses | ||
550 | * wait_on_completion_killable(), will mistake our pending signal | ||
551 | * for a new fatal signal and fail. */ | ||
552 | flush_signals(current); | ||
547 | opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h"); | 553 | opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h"); |
548 | if (IS_ERR(opa)) { | 554 | if (IS_ERR(opa)) { |
549 | drbd_err(connection, "out of mem, failed to invoke fence-peer helper\n"); | 555 | drbd_err(connection, "out of mem, failed to invoke fence-peer helper\n"); |
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 334601cc81cf..c4419ea1ab07 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c | |||
@@ -55,16 +55,41 @@ static DEFINE_MUTEX(rng_mutex); | |||
55 | static int data_avail; | 55 | static int data_avail; |
56 | static u8 *rng_buffer; | 56 | static u8 *rng_buffer; |
57 | 57 | ||
58 | static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, | ||
59 | int wait); | ||
60 | |||
58 | static size_t rng_buffer_size(void) | 61 | static size_t rng_buffer_size(void) |
59 | { | 62 | { |
60 | return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; | 63 | return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; |
61 | } | 64 | } |
62 | 65 | ||
66 | static void add_early_randomness(struct hwrng *rng) | ||
67 | { | ||
68 | unsigned char bytes[16]; | ||
69 | int bytes_read; | ||
70 | |||
71 | /* | ||
72 | * Currently only virtio-rng cannot return data during device | ||
73 | * probe, and that's handled in virtio-rng.c itself. If there | ||
74 | * are more such devices, this call to rng_get_data can be | ||
75 | * made conditional here instead of doing it per-device. | ||
76 | */ | ||
77 | bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); | ||
78 | if (bytes_read > 0) | ||
79 | add_device_randomness(bytes, bytes_read); | ||
80 | } | ||
81 | |||
63 | static inline int hwrng_init(struct hwrng *rng) | 82 | static inline int hwrng_init(struct hwrng *rng) |
64 | { | 83 | { |
65 | if (!rng->init) | 84 | if (rng->init) { |
66 | return 0; | 85 | int ret; |
67 | return rng->init(rng); | 86 | |
87 | ret = rng->init(rng); | ||
88 | if (ret) | ||
89 | return ret; | ||
90 | } | ||
91 | add_early_randomness(rng); | ||
92 | return 0; | ||
68 | } | 93 | } |
69 | 94 | ||
70 | static inline void hwrng_cleanup(struct hwrng *rng) | 95 | static inline void hwrng_cleanup(struct hwrng *rng) |
@@ -304,8 +329,6 @@ int hwrng_register(struct hwrng *rng) | |||
304 | { | 329 | { |
305 | int err = -EINVAL; | 330 | int err = -EINVAL; |
306 | struct hwrng *old_rng, *tmp; | 331 | struct hwrng *old_rng, *tmp; |
307 | unsigned char bytes[16]; | ||
308 | int bytes_read; | ||
309 | 332 | ||
310 | if (rng->name == NULL || | 333 | if (rng->name == NULL || |
311 | (rng->data_read == NULL && rng->read == NULL)) | 334 | (rng->data_read == NULL && rng->read == NULL)) |
@@ -347,9 +370,17 @@ int hwrng_register(struct hwrng *rng) | |||
347 | INIT_LIST_HEAD(&rng->list); | 370 | INIT_LIST_HEAD(&rng->list); |
348 | list_add_tail(&rng->list, &rng_list); | 371 | list_add_tail(&rng->list, &rng_list); |
349 | 372 | ||
350 | bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); | 373 | if (old_rng && !rng->init) { |
351 | if (bytes_read > 0) | 374 | /* |
352 | add_device_randomness(bytes, bytes_read); | 375 | * Use a new device's input to add some randomness to |
376 | * the system. If this rng device isn't going to be | ||
377 | * used right away, its init function hasn't been | ||
378 | * called yet; so only use the randomness from devices | ||
379 | * that don't need an init callback. | ||
380 | */ | ||
381 | add_early_randomness(rng); | ||
382 | } | ||
383 | |||
353 | out_unlock: | 384 | out_unlock: |
354 | mutex_unlock(&rng_mutex); | 385 | mutex_unlock(&rng_mutex); |
355 | out: | 386 | out: |
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index f3e71501de54..e9b15bc18b4d 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -38,6 +38,8 @@ struct virtrng_info { | |||
38 | int index; | 38 | int index; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static bool probe_done; | ||
42 | |||
41 | static void random_recv_done(struct virtqueue *vq) | 43 | static void random_recv_done(struct virtqueue *vq) |
42 | { | 44 | { |
43 | struct virtrng_info *vi = vq->vdev->priv; | 45 | struct virtrng_info *vi = vq->vdev->priv; |
@@ -67,6 +69,13 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) | |||
67 | int ret; | 69 | int ret; |
68 | struct virtrng_info *vi = (struct virtrng_info *)rng->priv; | 70 | struct virtrng_info *vi = (struct virtrng_info *)rng->priv; |
69 | 71 | ||
72 | /* | ||
73 | * Don't ask host for data till we're setup. This call can | ||
74 | * happen during hwrng_register(), after commit d9e7972619. | ||
75 | */ | ||
76 | if (unlikely(!probe_done)) | ||
77 | return 0; | ||
78 | |||
70 | if (!vi->busy) { | 79 | if (!vi->busy) { |
71 | vi->busy = true; | 80 | vi->busy = true; |
72 | init_completion(&vi->have_data); | 81 | init_completion(&vi->have_data); |
@@ -137,6 +146,7 @@ static int probe_common(struct virtio_device *vdev) | |||
137 | return err; | 146 | return err; |
138 | } | 147 | } |
139 | 148 | ||
149 | probe_done = true; | ||
140 | return 0; | 150 | return 0; |
141 | } | 151 | } |
142 | 152 | ||
diff --git a/drivers/char/random.c b/drivers/char/random.c index 0a7ac0a7b252..71529e196b84 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -641,7 +641,7 @@ retry: | |||
641 | } while (unlikely(entropy_count < pool_size-2 && pnfrac)); | 641 | } while (unlikely(entropy_count < pool_size-2 && pnfrac)); |
642 | } | 642 | } |
643 | 643 | ||
644 | if (entropy_count < 0) { | 644 | if (unlikely(entropy_count < 0)) { |
645 | pr_warn("random: negative entropy/overflow: pool %s count %d\n", | 645 | pr_warn("random: negative entropy/overflow: pool %s count %d\n", |
646 | r->name, entropy_count); | 646 | r->name, entropy_count); |
647 | WARN_ON(1); | 647 | WARN_ON(1); |
@@ -981,7 +981,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min, | |||
981 | int reserved) | 981 | int reserved) |
982 | { | 982 | { |
983 | int entropy_count, orig; | 983 | int entropy_count, orig; |
984 | size_t ibytes; | 984 | size_t ibytes, nfrac; |
985 | 985 | ||
986 | BUG_ON(r->entropy_count > r->poolinfo->poolfracbits); | 986 | BUG_ON(r->entropy_count > r->poolinfo->poolfracbits); |
987 | 987 | ||
@@ -999,7 +999,17 @@ retry: | |||
999 | } | 999 | } |
1000 | if (ibytes < min) | 1000 | if (ibytes < min) |
1001 | ibytes = 0; | 1001 | ibytes = 0; |
1002 | if ((entropy_count -= ibytes << (ENTROPY_SHIFT + 3)) < 0) | 1002 | |
1003 | if (unlikely(entropy_count < 0)) { | ||
1004 | pr_warn("random: negative entropy count: pool %s count %d\n", | ||
1005 | r->name, entropy_count); | ||
1006 | WARN_ON(1); | ||
1007 | entropy_count = 0; | ||
1008 | } | ||
1009 | nfrac = ibytes << (ENTROPY_SHIFT + 3); | ||
1010 | if ((size_t) entropy_count > nfrac) | ||
1011 | entropy_count -= nfrac; | ||
1012 | else | ||
1003 | entropy_count = 0; | 1013 | entropy_count = 0; |
1004 | 1014 | ||
1005 | if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) | 1015 | if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig) |
@@ -1376,6 +1386,7 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) | |||
1376 | "with %d bits of entropy available\n", | 1386 | "with %d bits of entropy available\n", |
1377 | current->comm, nonblocking_pool.entropy_total); | 1387 | current->comm, nonblocking_pool.entropy_total); |
1378 | 1388 | ||
1389 | nbytes = min_t(size_t, nbytes, INT_MAX >> (ENTROPY_SHIFT + 3)); | ||
1379 | ret = extract_entropy_user(&nonblocking_pool, buf, nbytes); | 1390 | ret = extract_entropy_user(&nonblocking_pool, buf, nbytes); |
1380 | 1391 | ||
1381 | trace_urandom_read(8 * nbytes, ENTROPY_BITS(&nonblocking_pool), | 1392 | trace_urandom_read(8 * nbytes, ENTROPY_BITS(&nonblocking_pool), |
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index ebac67115009..7364a538e056 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm | |||
@@ -104,6 +104,7 @@ config ARM_IMX6Q_CPUFREQ | |||
104 | tristate "Freescale i.MX6 cpufreq support" | 104 | tristate "Freescale i.MX6 cpufreq support" |
105 | depends on ARCH_MXC | 105 | depends on ARCH_MXC |
106 | depends on REGULATOR_ANATOP | 106 | depends on REGULATOR_ANATOP |
107 | select PM_OPP | ||
107 | help | 108 | help |
108 | This adds cpufreq driver support for Freescale i.MX6 series SoCs. | 109 | This adds cpufreq driver support for Freescale i.MX6 series SoCs. |
109 | 110 | ||
@@ -118,7 +119,7 @@ config ARM_INTEGRATOR | |||
118 | If in doubt, say Y. | 119 | If in doubt, say Y. |
119 | 120 | ||
120 | config ARM_KIRKWOOD_CPUFREQ | 121 | config ARM_KIRKWOOD_CPUFREQ |
121 | def_bool MACH_KIRKWOOD | 122 | def_bool ARCH_KIRKWOOD || MACH_KIRKWOOD |
122 | help | 123 | help |
123 | This adds the CPUFreq driver for Marvell Kirkwood | 124 | This adds the CPUFreq driver for Marvell Kirkwood |
124 | SoCs. | 125 | SoCs. |
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index ee1ae303a07c..86beda9f950b 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
@@ -152,11 +152,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
152 | goto out_put_reg; | 152 | goto out_put_reg; |
153 | } | 153 | } |
154 | 154 | ||
155 | ret = of_init_opp_table(cpu_dev); | 155 | /* OPPs might be populated at runtime, don't check for error here */ |
156 | if (ret) { | 156 | of_init_opp_table(cpu_dev); |
157 | pr_err("failed to init OPP table: %d\n", ret); | ||
158 | goto out_put_clk; | ||
159 | } | ||
160 | 157 | ||
161 | ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); | 158 | ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); |
162 | if (ret) { | 159 | if (ret) { |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 62259d27f03e..6f024852c6fb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1153,10 +1153,12 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) | |||
1153 | * the creation of a brand new one. So we need to perform this update | 1153 | * the creation of a brand new one. So we need to perform this update |
1154 | * by invoking update_policy_cpu(). | 1154 | * by invoking update_policy_cpu(). |
1155 | */ | 1155 | */ |
1156 | if (recover_policy && cpu != policy->cpu) | 1156 | if (recover_policy && cpu != policy->cpu) { |
1157 | update_policy_cpu(policy, cpu); | 1157 | update_policy_cpu(policy, cpu); |
1158 | else | 1158 | WARN_ON(kobject_move(&policy->kobj, &dev->kobj)); |
1159 | } else { | ||
1159 | policy->cpu = cpu; | 1160 | policy->cpu = cpu; |
1161 | } | ||
1160 | 1162 | ||
1161 | cpumask_copy(policy->cpus, cpumask_of(cpu)); | 1163 | cpumask_copy(policy->cpus, cpumask_of(cpu)); |
1162 | 1164 | ||
diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c index 546376719d8f..b5befc211172 100644 --- a/drivers/cpufreq/sa1110-cpufreq.c +++ b/drivers/cpufreq/sa1110-cpufreq.c | |||
@@ -349,7 +349,7 @@ static int __init sa1110_clk_init(void) | |||
349 | name = "K4S641632D"; | 349 | name = "K4S641632D"; |
350 | if (machine_is_h3100()) | 350 | if (machine_is_h3100()) |
351 | name = "KM416S4030CT"; | 351 | name = "KM416S4030CT"; |
352 | if (machine_is_jornada720()) | 352 | if (machine_is_jornada720() || machine_is_h3600()) |
353 | name = "K4S281632B-1H"; | 353 | name = "K4S281632B-1H"; |
354 | if (machine_is_nanoengine()) | 354 | if (machine_is_nanoengine()) |
355 | name = "MT48LC8M16A2TG-75"; | 355 | name = "MT48LC8M16A2TG-75"; |
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index eff1a2f22f09..dc79346689e6 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c | |||
@@ -346,6 +346,7 @@ static __initdata struct { | |||
346 | 346 | ||
347 | struct param_info { | 347 | struct param_info { |
348 | int verbose; | 348 | int verbose; |
349 | int found; | ||
349 | void *params; | 350 | void *params; |
350 | }; | 351 | }; |
351 | 352 | ||
@@ -362,16 +363,12 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, | |||
362 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) | 363 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) |
363 | return 0; | 364 | return 0; |
364 | 365 | ||
365 | pr_info("Getting parameters from FDT:\n"); | ||
366 | |||
367 | for (i = 0; i < ARRAY_SIZE(dt_params); i++) { | 366 | for (i = 0; i < ARRAY_SIZE(dt_params); i++) { |
368 | prop = of_get_flat_dt_prop(node, dt_params[i].propname, &len); | 367 | prop = of_get_flat_dt_prop(node, dt_params[i].propname, &len); |
369 | if (!prop) { | 368 | if (!prop) |
370 | pr_err("Can't find %s in device tree!\n", | ||
371 | dt_params[i].name); | ||
372 | return 0; | 369 | return 0; |
373 | } | ||
374 | dest = info->params + dt_params[i].offset; | 370 | dest = info->params + dt_params[i].offset; |
371 | info->found++; | ||
375 | 372 | ||
376 | val = of_read_number(prop, len / sizeof(u32)); | 373 | val = of_read_number(prop, len / sizeof(u32)); |
377 | 374 | ||
@@ -390,10 +387,21 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, | |||
390 | int __init efi_get_fdt_params(struct efi_fdt_params *params, int verbose) | 387 | int __init efi_get_fdt_params(struct efi_fdt_params *params, int verbose) |
391 | { | 388 | { |
392 | struct param_info info; | 389 | struct param_info info; |
390 | int ret; | ||
391 | |||
392 | pr_info("Getting EFI parameters from FDT:\n"); | ||
393 | 393 | ||
394 | info.verbose = verbose; | 394 | info.verbose = verbose; |
395 | info.found = 0; | ||
395 | info.params = params; | 396 | info.params = params; |
396 | 397 | ||
397 | return of_scan_flat_dt(fdt_find_uefi_params, &info); | 398 | ret = of_scan_flat_dt(fdt_find_uefi_params, &info); |
399 | if (!info.found) | ||
400 | pr_info("UEFI not found.\n"); | ||
401 | else if (!ret) | ||
402 | pr_err("Can't find '%s' in device tree!\n", | ||
403 | dt_params[info.found].name); | ||
404 | |||
405 | return ret; | ||
398 | } | 406 | } |
399 | #endif /* CONFIG_EFI_PARAMS_FROM_FDT */ | 407 | #endif /* CONFIG_EFI_PARAMS_FROM_FDT */ |
diff --git a/drivers/firmware/efi/fdt.c b/drivers/firmware/efi/fdt.c index 82d774161cc9..507a3df46a5d 100644 --- a/drivers/firmware/efi/fdt.c +++ b/drivers/firmware/efi/fdt.c | |||
@@ -23,16 +23,6 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, | |||
23 | u32 fdt_val32; | 23 | u32 fdt_val32; |
24 | u64 fdt_val64; | 24 | u64 fdt_val64; |
25 | 25 | ||
26 | /* | ||
27 | * Copy definition of linux_banner here. Since this code is | ||
28 | * built as part of the decompressor for ARM v7, pulling | ||
29 | * in version.c where linux_banner is defined for the | ||
30 | * kernel brings other kernel dependencies with it. | ||
31 | */ | ||
32 | const char linux_banner[] = | ||
33 | "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" | ||
34 | LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; | ||
35 | |||
36 | /* Do some checks on provided FDT, if it exists*/ | 26 | /* Do some checks on provided FDT, if it exists*/ |
37 | if (orig_fdt) { | 27 | if (orig_fdt) { |
38 | if (fdt_check_header(orig_fdt)) { | 28 | if (fdt_check_header(orig_fdt)) { |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e27e7804c0b9..f0be855ddf45 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -11673,6 +11673,9 @@ static struct intel_quirk intel_quirks[] = { | |||
11673 | 11673 | ||
11674 | /* Toshiba CB35 Chromebook (Celeron 2955U) */ | 11674 | /* Toshiba CB35 Chromebook (Celeron 2955U) */ |
11675 | { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present }, | 11675 | { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present }, |
11676 | |||
11677 | /* HP Chromebook 14 (Celeron 2955U) */ | ||
11678 | { 0x0a06, 0x103c, 0x21ed, quirk_backlight_present }, | ||
11676 | }; | 11679 | }; |
11677 | 11680 | ||
11678 | static void intel_init_quirks(struct drm_device *dev) | 11681 | static void intel_init_quirks(struct drm_device *dev) |
@@ -11911,6 +11914,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) | |||
11911 | * ... */ | 11914 | * ... */ |
11912 | plane = crtc->plane; | 11915 | plane = crtc->plane; |
11913 | crtc->plane = !plane; | 11916 | crtc->plane = !plane; |
11917 | crtc->primary_enabled = true; | ||
11914 | dev_priv->display.crtc_disable(&crtc->base); | 11918 | dev_priv->display.crtc_disable(&crtc->base); |
11915 | crtc->plane = plane; | 11919 | crtc->plane = plane; |
11916 | 11920 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 075170d1844f..8a1a4fbc06ac 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -906,8 +906,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, | |||
906 | mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock, | 906 | mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock, |
907 | bpp); | 907 | bpp); |
908 | 908 | ||
909 | for (lane_count = min_lane_count; lane_count <= max_lane_count; lane_count <<= 1) { | 909 | for (clock = min_clock; clock <= max_clock; clock++) { |
910 | for (clock = min_clock; clock <= max_clock; clock++) { | 910 | for (lane_count = min_lane_count; lane_count <= max_lane_count; lane_count <<= 1) { |
911 | link_clock = drm_dp_bw_code_to_link_rate(bws[clock]); | 911 | link_clock = drm_dp_bw_code_to_link_rate(bws[clock]); |
912 | link_avail = intel_dp_max_data_rate(link_clock, | 912 | link_avail = intel_dp_max_data_rate(link_clock, |
913 | lane_count); | 913 | lane_count); |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 23126023aeba..5e5a72fca5fb 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -111,6 +111,13 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, | |||
111 | 111 | ||
112 | pipe_config->adjusted_mode.flags |= flags; | 112 | pipe_config->adjusted_mode.flags |= flags; |
113 | 113 | ||
114 | /* gen2/3 store dither state in pfit control, needs to match */ | ||
115 | if (INTEL_INFO(dev)->gen < 4) { | ||
116 | tmp = I915_READ(PFIT_CONTROL); | ||
117 | |||
118 | pipe_config->gmch_pfit.control |= tmp & PANEL_8TO6_DITHER_ENABLE; | ||
119 | } | ||
120 | |||
114 | dotclock = pipe_config->port_clock; | 121 | dotclock = pipe_config->port_clock; |
115 | 122 | ||
116 | if (HAS_PCH_SPLIT(dev_priv->dev)) | 123 | if (HAS_PCH_SPLIT(dev_priv->dev)) |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 628cd8938274..12b02fe1d0ae 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -361,16 +361,16 @@ void intel_gmch_panel_fitting(struct intel_crtc *intel_crtc, | |||
361 | pfit_control |= ((intel_crtc->pipe << PFIT_PIPE_SHIFT) | | 361 | pfit_control |= ((intel_crtc->pipe << PFIT_PIPE_SHIFT) | |
362 | PFIT_FILTER_FUZZY); | 362 | PFIT_FILTER_FUZZY); |
363 | 363 | ||
364 | /* Make sure pre-965 set dither correctly for 18bpp panels. */ | ||
365 | if (INTEL_INFO(dev)->gen < 4 && pipe_config->pipe_bpp == 18) | ||
366 | pfit_control |= PANEL_8TO6_DITHER_ENABLE; | ||
367 | |||
368 | out: | 364 | out: |
369 | if ((pfit_control & PFIT_ENABLE) == 0) { | 365 | if ((pfit_control & PFIT_ENABLE) == 0) { |
370 | pfit_control = 0; | 366 | pfit_control = 0; |
371 | pfit_pgm_ratios = 0; | 367 | pfit_pgm_ratios = 0; |
372 | } | 368 | } |
373 | 369 | ||
370 | /* Make sure pre-965 set dither correctly for 18bpp panels. */ | ||
371 | if (INTEL_INFO(dev)->gen < 4 && pipe_config->pipe_bpp == 18) | ||
372 | pfit_control |= PANEL_8TO6_DITHER_ENABLE; | ||
373 | |||
374 | pipe_config->gmch_pfit.control = pfit_control; | 374 | pipe_config->gmch_pfit.control = pfit_control; |
375 | pipe_config->gmch_pfit.pgm_ratios = pfit_pgm_ratios; | 375 | pipe_config->gmch_pfit.pgm_ratios = pfit_pgm_ratios; |
376 | pipe_config->gmch_pfit.lvds_border_bits = border; | 376 | pipe_config->gmch_pfit.lvds_border_bits = border; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c index cfde9eb44ad0..6212537b90c5 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/temp.c | |||
@@ -192,11 +192,11 @@ alarm_timer_callback(struct nouveau_alarm *alarm) | |||
192 | nouveau_therm_threshold_hyst_polling(therm, &sensor->thrs_shutdown, | 192 | nouveau_therm_threshold_hyst_polling(therm, &sensor->thrs_shutdown, |
193 | NOUVEAU_THERM_THRS_SHUTDOWN); | 193 | NOUVEAU_THERM_THRS_SHUTDOWN); |
194 | 194 | ||
195 | spin_unlock_irqrestore(&priv->sensor.alarm_program_lock, flags); | ||
196 | |||
195 | /* schedule the next poll in one second */ | 197 | /* schedule the next poll in one second */ |
196 | if (therm->temp_get(therm) >= 0 && list_empty(&alarm->head)) | 198 | if (therm->temp_get(therm) >= 0 && list_empty(&alarm->head)) |
197 | ptimer->alarm(ptimer, 1000 * 1000 * 1000, alarm); | 199 | ptimer->alarm(ptimer, 1000000000ULL, alarm); |
198 | |||
199 | spin_unlock_irqrestore(&priv->sensor.alarm_program_lock, flags); | ||
200 | } | 200 | } |
201 | 201 | ||
202 | void | 202 | void |
diff --git a/drivers/gpu/drm/qxl/qxl_irq.c b/drivers/gpu/drm/qxl/qxl_irq.c index 34d6a85e9023..0bf1e20c6e44 100644 --- a/drivers/gpu/drm/qxl/qxl_irq.c +++ b/drivers/gpu/drm/qxl/qxl_irq.c | |||
@@ -33,6 +33,9 @@ irqreturn_t qxl_irq_handler(int irq, void *arg) | |||
33 | 33 | ||
34 | pending = xchg(&qdev->ram_header->int_pending, 0); | 34 | pending = xchg(&qdev->ram_header->int_pending, 0); |
35 | 35 | ||
36 | if (!pending) | ||
37 | return IRQ_NONE; | ||
38 | |||
36 | atomic_inc(&qdev->irq_received); | 39 | atomic_inc(&qdev->irq_received); |
37 | 40 | ||
38 | if (pending & QXL_INTERRUPT_DISPLAY) { | 41 | if (pending & QXL_INTERRUPT_DISPLAY) { |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index a03c73411a56..30d242b25078 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -1414,8 +1414,8 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, | |||
1414 | tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN; | 1414 | tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN; |
1415 | WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); | 1415 | WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); |
1416 | 1416 | ||
1417 | /* set pageflip to happen anywhere in vblank interval */ | 1417 | /* set pageflip to happen only at start of vblank interval (front porch) */ |
1418 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0); | 1418 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 3); |
1419 | 1419 | ||
1420 | if (!atomic && fb && fb != crtc->primary->fb) { | 1420 | if (!atomic && fb && fb != crtc->primary->fb) { |
1421 | radeon_fb = to_radeon_framebuffer(fb); | 1421 | radeon_fb = to_radeon_framebuffer(fb); |
@@ -1614,8 +1614,8 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
1614 | tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN; | 1614 | tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN; |
1615 | WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); | 1615 | WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp); |
1616 | 1616 | ||
1617 | /* set pageflip to happen anywhere in vblank interval */ | 1617 | /* set pageflip to happen only at start of vblank interval (front porch) */ |
1618 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0); | 1618 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 3); |
1619 | 1619 | ||
1620 | if (!atomic && fb && fb != crtc->primary->fb) { | 1620 | if (!atomic && fb && fb != crtc->primary->fb) { |
1621 | radeon_fb = to_radeon_framebuffer(fb); | 1621 | radeon_fb = to_radeon_framebuffer(fb); |
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 2b2908440644..7d68203a3737 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -183,7 +183,6 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, | |||
183 | struct backlight_properties props; | 183 | struct backlight_properties props; |
184 | struct radeon_backlight_privdata *pdata; | 184 | struct radeon_backlight_privdata *pdata; |
185 | struct radeon_encoder_atom_dig *dig; | 185 | struct radeon_encoder_atom_dig *dig; |
186 | u8 backlight_level; | ||
187 | char bl_name[16]; | 186 | char bl_name[16]; |
188 | 187 | ||
189 | /* Mac laptops with multiple GPUs use the gmux driver for backlight | 188 | /* Mac laptops with multiple GPUs use the gmux driver for backlight |
@@ -222,12 +221,17 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder, | |||
222 | 221 | ||
223 | pdata->encoder = radeon_encoder; | 222 | pdata->encoder = radeon_encoder; |
224 | 223 | ||
225 | backlight_level = radeon_atom_get_backlight_level_from_reg(rdev); | ||
226 | |||
227 | dig = radeon_encoder->enc_priv; | 224 | dig = radeon_encoder->enc_priv; |
228 | dig->bl_dev = bd; | 225 | dig->bl_dev = bd; |
229 | 226 | ||
230 | bd->props.brightness = radeon_atom_backlight_get_brightness(bd); | 227 | bd->props.brightness = radeon_atom_backlight_get_brightness(bd); |
228 | /* Set a reasonable default here if the level is 0 otherwise | ||
229 | * fbdev will attempt to turn the backlight on after console | ||
230 | * unblanking and it will try and restore 0 which turns the backlight | ||
231 | * off again. | ||
232 | */ | ||
233 | if (bd->props.brightness == 0) | ||
234 | bd->props.brightness = RADEON_MAX_BL_LEVEL; | ||
231 | bd->props.power = FB_BLANK_UNBLANK; | 235 | bd->props.power = FB_BLANK_UNBLANK; |
232 | backlight_update_status(bd); | 236 | backlight_update_status(bd); |
233 | 237 | ||
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index f7ece0ff431b..250bac3935a4 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2642,8 +2642,9 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s | |||
2642 | for (i = 0; i < rdev->num_crtc; i++) { | 2642 | for (i = 0; i < rdev->num_crtc; i++) { |
2643 | if (save->crtc_enabled[i]) { | 2643 | if (save->crtc_enabled[i]) { |
2644 | tmp = RREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i]); | 2644 | tmp = RREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i]); |
2645 | if ((tmp & 0x3) != 0) { | 2645 | if ((tmp & 0x7) != 3) { |
2646 | tmp &= ~0x3; | 2646 | tmp &= ~0x7; |
2647 | tmp |= 0x3; | ||
2647 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); | 2648 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); |
2648 | } | 2649 | } |
2649 | tmp = RREG32(EVERGREEN_GRPH_UPDATE + crtc_offsets[i]); | 2650 | tmp = RREG32(EVERGREEN_GRPH_UPDATE + crtc_offsets[i]); |
diff --git a/drivers/gpu/drm/radeon/evergreen_reg.h b/drivers/gpu/drm/radeon/evergreen_reg.h index 333d143fca2c..23bff590fb6e 100644 --- a/drivers/gpu/drm/radeon/evergreen_reg.h +++ b/drivers/gpu/drm/radeon/evergreen_reg.h | |||
@@ -239,7 +239,6 @@ | |||
239 | # define EVERGREEN_CRTC_V_BLANK (1 << 0) | 239 | # define EVERGREEN_CRTC_V_BLANK (1 << 0) |
240 | #define EVERGREEN_CRTC_STATUS_POSITION 0x6e90 | 240 | #define EVERGREEN_CRTC_STATUS_POSITION 0x6e90 |
241 | #define EVERGREEN_CRTC_STATUS_HV_COUNT 0x6ea0 | 241 | #define EVERGREEN_CRTC_STATUS_HV_COUNT 0x6ea0 |
242 | #define EVERGREEN_MASTER_UPDATE_MODE 0x6ef8 | ||
243 | #define EVERGREEN_CRTC_UPDATE_LOCK 0x6ed4 | 242 | #define EVERGREEN_CRTC_UPDATE_LOCK 0x6ed4 |
244 | #define EVERGREEN_MASTER_UPDATE_LOCK 0x6ef4 | 243 | #define EVERGREEN_MASTER_UPDATE_LOCK 0x6ef4 |
245 | #define EVERGREEN_MASTER_UPDATE_MODE 0x6ef8 | 244 | #define EVERGREEN_MASTER_UPDATE_MODE 0x6ef8 |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 29d9cc04c04e..b7204500a9a6 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -684,10 +684,9 @@ struct radeon_flip_work { | |||
684 | struct work_struct unpin_work; | 684 | struct work_struct unpin_work; |
685 | struct radeon_device *rdev; | 685 | struct radeon_device *rdev; |
686 | int crtc_id; | 686 | int crtc_id; |
687 | struct drm_framebuffer *fb; | 687 | uint64_t base; |
688 | struct drm_pending_vblank_event *event; | 688 | struct drm_pending_vblank_event *event; |
689 | struct radeon_bo *old_rbo; | 689 | struct radeon_bo *old_rbo; |
690 | struct radeon_bo *new_rbo; | ||
691 | struct radeon_fence *fence; | 690 | struct radeon_fence *fence; |
692 | }; | 691 | }; |
693 | 692 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 13896edcf0b6..bf25061c8ac4 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -366,7 +366,6 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) | |||
366 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); | 366 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); |
367 | 367 | ||
368 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); | 368 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); |
369 | radeon_fence_unref(&work->fence); | ||
370 | radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); | 369 | radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); |
371 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); | 370 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); |
372 | } | 371 | } |
@@ -386,51 +385,108 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
386 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[work->crtc_id]; | 385 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[work->crtc_id]; |
387 | 386 | ||
388 | struct drm_crtc *crtc = &radeon_crtc->base; | 387 | struct drm_crtc *crtc = &radeon_crtc->base; |
389 | struct drm_framebuffer *fb = work->fb; | ||
390 | |||
391 | uint32_t tiling_flags, pitch_pixels; | ||
392 | uint64_t base; | ||
393 | |||
394 | unsigned long flags; | 388 | unsigned long flags; |
395 | int r; | 389 | int r; |
396 | 390 | ||
397 | down_read(&rdev->exclusive_lock); | 391 | down_read(&rdev->exclusive_lock); |
398 | while (work->fence) { | 392 | if (work->fence) { |
399 | r = radeon_fence_wait(work->fence, false); | 393 | r = radeon_fence_wait(work->fence, false); |
400 | if (r == -EDEADLK) { | 394 | if (r == -EDEADLK) { |
401 | up_read(&rdev->exclusive_lock); | 395 | up_read(&rdev->exclusive_lock); |
402 | r = radeon_gpu_reset(rdev); | 396 | r = radeon_gpu_reset(rdev); |
403 | down_read(&rdev->exclusive_lock); | 397 | down_read(&rdev->exclusive_lock); |
404 | } | 398 | } |
399 | if (r) | ||
400 | DRM_ERROR("failed to wait on page flip fence (%d)!\n", r); | ||
405 | 401 | ||
406 | if (r) { | 402 | /* We continue with the page flip even if we failed to wait on |
407 | DRM_ERROR("failed to wait on page flip fence (%d)!\n", | 403 | * the fence, otherwise the DRM core and userspace will be |
408 | r); | 404 | * confused about which BO the CRTC is scanning out |
409 | goto cleanup; | 405 | */ |
410 | } else | 406 | |
411 | radeon_fence_unref(&work->fence); | 407 | radeon_fence_unref(&work->fence); |
412 | } | 408 | } |
413 | 409 | ||
410 | /* We borrow the event spin lock for protecting flip_status */ | ||
411 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | ||
412 | |||
413 | /* set the proper interrupt */ | ||
414 | radeon_irq_kms_pflip_irq_get(rdev, radeon_crtc->crtc_id); | ||
415 | |||
416 | /* do the flip (mmio) */ | ||
417 | radeon_page_flip(rdev, radeon_crtc->crtc_id, work->base); | ||
418 | |||
419 | radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; | ||
420 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
421 | up_read(&rdev->exclusive_lock); | ||
422 | } | ||
423 | |||
424 | static int radeon_crtc_page_flip(struct drm_crtc *crtc, | ||
425 | struct drm_framebuffer *fb, | ||
426 | struct drm_pending_vblank_event *event, | ||
427 | uint32_t page_flip_flags) | ||
428 | { | ||
429 | struct drm_device *dev = crtc->dev; | ||
430 | struct radeon_device *rdev = dev->dev_private; | ||
431 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | ||
432 | struct radeon_framebuffer *old_radeon_fb; | ||
433 | struct radeon_framebuffer *new_radeon_fb; | ||
434 | struct drm_gem_object *obj; | ||
435 | struct radeon_flip_work *work; | ||
436 | struct radeon_bo *new_rbo; | ||
437 | uint32_t tiling_flags, pitch_pixels; | ||
438 | uint64_t base; | ||
439 | unsigned long flags; | ||
440 | int r; | ||
441 | |||
442 | work = kzalloc(sizeof *work, GFP_KERNEL); | ||
443 | if (work == NULL) | ||
444 | return -ENOMEM; | ||
445 | |||
446 | INIT_WORK(&work->flip_work, radeon_flip_work_func); | ||
447 | INIT_WORK(&work->unpin_work, radeon_unpin_work_func); | ||
448 | |||
449 | work->rdev = rdev; | ||
450 | work->crtc_id = radeon_crtc->crtc_id; | ||
451 | work->event = event; | ||
452 | |||
453 | /* schedule unpin of the old buffer */ | ||
454 | old_radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | ||
455 | obj = old_radeon_fb->obj; | ||
456 | |||
457 | /* take a reference to the old object */ | ||
458 | drm_gem_object_reference(obj); | ||
459 | work->old_rbo = gem_to_radeon_bo(obj); | ||
460 | |||
461 | new_radeon_fb = to_radeon_framebuffer(fb); | ||
462 | obj = new_radeon_fb->obj; | ||
463 | new_rbo = gem_to_radeon_bo(obj); | ||
464 | |||
465 | spin_lock(&new_rbo->tbo.bdev->fence_lock); | ||
466 | if (new_rbo->tbo.sync_obj) | ||
467 | work->fence = radeon_fence_ref(new_rbo->tbo.sync_obj); | ||
468 | spin_unlock(&new_rbo->tbo.bdev->fence_lock); | ||
469 | |||
414 | /* pin the new buffer */ | 470 | /* pin the new buffer */ |
415 | DRM_DEBUG_DRIVER("flip-ioctl() cur_fbo = %p, cur_bbo = %p\n", | 471 | DRM_DEBUG_DRIVER("flip-ioctl() cur_rbo = %p, new_rbo = %p\n", |
416 | work->old_rbo, work->new_rbo); | 472 | work->old_rbo, new_rbo); |
417 | 473 | ||
418 | r = radeon_bo_reserve(work->new_rbo, false); | 474 | r = radeon_bo_reserve(new_rbo, false); |
419 | if (unlikely(r != 0)) { | 475 | if (unlikely(r != 0)) { |
420 | DRM_ERROR("failed to reserve new rbo buffer before flip\n"); | 476 | DRM_ERROR("failed to reserve new rbo buffer before flip\n"); |
421 | goto cleanup; | 477 | goto cleanup; |
422 | } | 478 | } |
423 | /* Only 27 bit offset for legacy CRTC */ | 479 | /* Only 27 bit offset for legacy CRTC */ |
424 | r = radeon_bo_pin_restricted(work->new_rbo, RADEON_GEM_DOMAIN_VRAM, | 480 | r = radeon_bo_pin_restricted(new_rbo, RADEON_GEM_DOMAIN_VRAM, |
425 | ASIC_IS_AVIVO(rdev) ? 0 : 1 << 27, &base); | 481 | ASIC_IS_AVIVO(rdev) ? 0 : 1 << 27, &base); |
426 | if (unlikely(r != 0)) { | 482 | if (unlikely(r != 0)) { |
427 | radeon_bo_unreserve(work->new_rbo); | 483 | radeon_bo_unreserve(new_rbo); |
428 | r = -EINVAL; | 484 | r = -EINVAL; |
429 | DRM_ERROR("failed to pin new rbo buffer before flip\n"); | 485 | DRM_ERROR("failed to pin new rbo buffer before flip\n"); |
430 | goto cleanup; | 486 | goto cleanup; |
431 | } | 487 | } |
432 | radeon_bo_get_tiling_flags(work->new_rbo, &tiling_flags, NULL); | 488 | radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL); |
433 | radeon_bo_unreserve(work->new_rbo); | 489 | radeon_bo_unreserve(new_rbo); |
434 | 490 | ||
435 | if (!ASIC_IS_AVIVO(rdev)) { | 491 | if (!ASIC_IS_AVIVO(rdev)) { |
436 | /* crtc offset is from display base addr not FB location */ | 492 | /* crtc offset is from display base addr not FB location */ |
@@ -467,6 +523,7 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
467 | } | 523 | } |
468 | base &= ~7; | 524 | base &= ~7; |
469 | } | 525 | } |
526 | work->base = base; | ||
470 | 527 | ||
471 | r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id); | 528 | r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id); |
472 | if (r) { | 529 | if (r) { |
@@ -477,100 +534,42 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
477 | /* We borrow the event spin lock for protecting flip_work */ | 534 | /* We borrow the event spin lock for protecting flip_work */ |
478 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | 535 | spin_lock_irqsave(&crtc->dev->event_lock, flags); |
479 | 536 | ||
480 | /* set the proper interrupt */ | 537 | if (radeon_crtc->flip_status != RADEON_FLIP_NONE) { |
481 | radeon_irq_kms_pflip_irq_get(rdev, radeon_crtc->crtc_id); | 538 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); |
539 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
540 | r = -EBUSY; | ||
541 | goto vblank_cleanup; | ||
542 | } | ||
543 | radeon_crtc->flip_status = RADEON_FLIP_PENDING; | ||
544 | radeon_crtc->flip_work = work; | ||
482 | 545 | ||
483 | /* do the flip (mmio) */ | 546 | /* update crtc fb */ |
484 | radeon_page_flip(rdev, radeon_crtc->crtc_id, base); | 547 | crtc->primary->fb = fb; |
485 | 548 | ||
486 | radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED; | ||
487 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | 549 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); |
488 | up_read(&rdev->exclusive_lock); | ||
489 | 550 | ||
490 | return; | 551 | queue_work(radeon_crtc->flip_queue, &work->flip_work); |
552 | return 0; | ||
553 | |||
554 | vblank_cleanup: | ||
555 | drm_vblank_put(crtc->dev, radeon_crtc->crtc_id); | ||
491 | 556 | ||
492 | pflip_cleanup: | 557 | pflip_cleanup: |
493 | if (unlikely(radeon_bo_reserve(work->new_rbo, false) != 0)) { | 558 | if (unlikely(radeon_bo_reserve(new_rbo, false) != 0)) { |
494 | DRM_ERROR("failed to reserve new rbo in error path\n"); | 559 | DRM_ERROR("failed to reserve new rbo in error path\n"); |
495 | goto cleanup; | 560 | goto cleanup; |
496 | } | 561 | } |
497 | if (unlikely(radeon_bo_unpin(work->new_rbo) != 0)) { | 562 | if (unlikely(radeon_bo_unpin(new_rbo) != 0)) { |
498 | DRM_ERROR("failed to unpin new rbo in error path\n"); | 563 | DRM_ERROR("failed to unpin new rbo in error path\n"); |
499 | } | 564 | } |
500 | radeon_bo_unreserve(work->new_rbo); | 565 | radeon_bo_unreserve(new_rbo); |
501 | 566 | ||
502 | cleanup: | 567 | cleanup: |
503 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); | 568 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); |
504 | radeon_fence_unref(&work->fence); | 569 | radeon_fence_unref(&work->fence); |
505 | kfree(work); | 570 | kfree(work); |
506 | up_read(&rdev->exclusive_lock); | ||
507 | } | ||
508 | |||
509 | static int radeon_crtc_page_flip(struct drm_crtc *crtc, | ||
510 | struct drm_framebuffer *fb, | ||
511 | struct drm_pending_vblank_event *event, | ||
512 | uint32_t page_flip_flags) | ||
513 | { | ||
514 | struct drm_device *dev = crtc->dev; | ||
515 | struct radeon_device *rdev = dev->dev_private; | ||
516 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | ||
517 | struct radeon_framebuffer *old_radeon_fb; | ||
518 | struct radeon_framebuffer *new_radeon_fb; | ||
519 | struct drm_gem_object *obj; | ||
520 | struct radeon_flip_work *work; | ||
521 | unsigned long flags; | ||
522 | |||
523 | work = kzalloc(sizeof *work, GFP_KERNEL); | ||
524 | if (work == NULL) | ||
525 | return -ENOMEM; | ||
526 | |||
527 | INIT_WORK(&work->flip_work, radeon_flip_work_func); | ||
528 | INIT_WORK(&work->unpin_work, radeon_unpin_work_func); | ||
529 | |||
530 | work->rdev = rdev; | ||
531 | work->crtc_id = radeon_crtc->crtc_id; | ||
532 | work->fb = fb; | ||
533 | work->event = event; | ||
534 | |||
535 | /* schedule unpin of the old buffer */ | ||
536 | old_radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | ||
537 | obj = old_radeon_fb->obj; | ||
538 | |||
539 | /* take a reference to the old object */ | ||
540 | drm_gem_object_reference(obj); | ||
541 | work->old_rbo = gem_to_radeon_bo(obj); | ||
542 | |||
543 | new_radeon_fb = to_radeon_framebuffer(fb); | ||
544 | obj = new_radeon_fb->obj; | ||
545 | work->new_rbo = gem_to_radeon_bo(obj); | ||
546 | |||
547 | spin_lock(&work->new_rbo->tbo.bdev->fence_lock); | ||
548 | if (work->new_rbo->tbo.sync_obj) | ||
549 | work->fence = radeon_fence_ref(work->new_rbo->tbo.sync_obj); | ||
550 | spin_unlock(&work->new_rbo->tbo.bdev->fence_lock); | ||
551 | |||
552 | /* We borrow the event spin lock for protecting flip_work */ | ||
553 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | ||
554 | 571 | ||
555 | if (radeon_crtc->flip_status != RADEON_FLIP_NONE) { | 572 | return r; |
556 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); | ||
557 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
558 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); | ||
559 | radeon_fence_unref(&work->fence); | ||
560 | kfree(work); | ||
561 | return -EBUSY; | ||
562 | } | ||
563 | radeon_crtc->flip_status = RADEON_FLIP_PENDING; | ||
564 | radeon_crtc->flip_work = work; | ||
565 | |||
566 | /* update crtc fb */ | ||
567 | crtc->primary->fb = fb; | ||
568 | |||
569 | spin_unlock_irqrestore(&crtc->dev->event_lock, flags); | ||
570 | |||
571 | queue_work(radeon_crtc->flip_queue, &work->flip_work); | ||
572 | |||
573 | return 0; | ||
574 | } | 573 | } |
575 | 574 | ||
576 | static int | 575 | static int |
@@ -830,6 +829,10 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector) | |||
830 | struct radeon_device *rdev = dev->dev_private; | 829 | struct radeon_device *rdev = dev->dev_private; |
831 | int ret = 0; | 830 | int ret = 0; |
832 | 831 | ||
832 | /* don't leak the edid if we already fetched it in detect() */ | ||
833 | if (radeon_connector->edid) | ||
834 | goto got_edid; | ||
835 | |||
833 | /* on hw with routers, select right port */ | 836 | /* on hw with routers, select right port */ |
834 | if (radeon_connector->router.ddc_valid) | 837 | if (radeon_connector->router.ddc_valid) |
835 | radeon_router_select_ddc_port(radeon_connector); | 838 | radeon_router_select_ddc_port(radeon_connector); |
@@ -868,6 +871,7 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector) | |||
868 | radeon_connector->edid = radeon_bios_get_hardcoded_edid(rdev); | 871 | radeon_connector->edid = radeon_bios_get_hardcoded_edid(rdev); |
869 | } | 872 | } |
870 | if (radeon_connector->edid) { | 873 | if (radeon_connector->edid) { |
874 | got_edid: | ||
871 | drm_mode_connector_update_edid_property(&radeon_connector->base, radeon_connector->edid); | 875 | drm_mode_connector_update_edid_property(&radeon_connector->base, radeon_connector->edid); |
872 | ret = drm_add_edid_modes(&radeon_connector->base, radeon_connector->edid); | 876 | ret = drm_add_edid_modes(&radeon_connector->base, radeon_connector->edid); |
873 | drm_edid_to_eld(&radeon_connector->base, radeon_connector->edid); | 877 | drm_edid_to_eld(&radeon_connector->base, radeon_connector->edid); |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 237dd29d9f1c..3e21e869015f 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -406,8 +406,9 @@ void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save) | |||
406 | for (i = 0; i < rdev->num_crtc; i++) { | 406 | for (i = 0; i < rdev->num_crtc; i++) { |
407 | if (save->crtc_enabled[i]) { | 407 | if (save->crtc_enabled[i]) { |
408 | tmp = RREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i]); | 408 | tmp = RREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i]); |
409 | if ((tmp & 0x3) != 0) { | 409 | if ((tmp & 0x7) != 3) { |
410 | tmp &= ~0x3; | 410 | tmp &= ~0x7; |
411 | tmp |= 0x3; | ||
411 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); | 412 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + crtc_offsets[i], tmp); |
412 | } | 413 | } |
413 | tmp = RREG32(AVIVO_D1GRPH_UPDATE + crtc_offsets[i]); | 414 | tmp = RREG32(AVIVO_D1GRPH_UPDATE + crtc_offsets[i]); |
diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c index eaaa3d843b80..23b2ce294c4c 100644 --- a/drivers/hv/hv_fcopy.c +++ b/drivers/hv/hv_fcopy.c | |||
@@ -246,8 +246,8 @@ void hv_fcopy_onchannelcallback(void *context) | |||
246 | /* | 246 | /* |
247 | * Send the information to the user-level daemon. | 247 | * Send the information to the user-level daemon. |
248 | */ | 248 | */ |
249 | fcopy_send_data(); | ||
250 | schedule_delayed_work(&fcopy_work, 5*HZ); | 249 | schedule_delayed_work(&fcopy_work, 5*HZ); |
250 | fcopy_send_data(); | ||
251 | return; | 251 | return; |
252 | } | 252 | } |
253 | icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE; | 253 | icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE; |
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c index 0f4dea5ccf17..9ee3913850d6 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c | |||
@@ -515,7 +515,7 @@ static ssize_t set_temp_min(struct device *dev, | |||
515 | return -EINVAL; | 515 | return -EINVAL; |
516 | 516 | ||
517 | temp = DIV_ROUND_CLOSEST(temp, 1000); | 517 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
518 | temp = clamp_val(temp, 0, 255); | 518 | temp = clamp_val(temp, -128, 127); |
519 | 519 | ||
520 | mutex_lock(&data->lock); | 520 | mutex_lock(&data->lock); |
521 | data->temp_min[attr->index] = temp; | 521 | data->temp_min[attr->index] = temp; |
@@ -549,7 +549,7 @@ static ssize_t set_temp_max(struct device *dev, | |||
549 | return -EINVAL; | 549 | return -EINVAL; |
550 | 550 | ||
551 | temp = DIV_ROUND_CLOSEST(temp, 1000); | 551 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
552 | temp = clamp_val(temp, 0, 255); | 552 | temp = clamp_val(temp, -128, 127); |
553 | 553 | ||
554 | mutex_lock(&data->lock); | 554 | mutex_lock(&data->lock); |
555 | data->temp_max[attr->index] = temp; | 555 | data->temp_max[attr->index] = temp; |
@@ -826,7 +826,7 @@ static ssize_t set_pwm_tmin(struct device *dev, | |||
826 | return -EINVAL; | 826 | return -EINVAL; |
827 | 827 | ||
828 | temp = DIV_ROUND_CLOSEST(temp, 1000); | 828 | temp = DIV_ROUND_CLOSEST(temp, 1000); |
829 | temp = clamp_val(temp, 0, 255); | 829 | temp = clamp_val(temp, -128, 127); |
830 | 830 | ||
831 | mutex_lock(&data->lock); | 831 | mutex_lock(&data->lock); |
832 | data->pwm_tmin[attr->index] = temp; | 832 | data->pwm_tmin[attr->index] = temp; |
diff --git a/drivers/hwmon/da9052-hwmon.c b/drivers/hwmon/da9052-hwmon.c index afd31042b452..d14ab3c45daa 100644 --- a/drivers/hwmon/da9052-hwmon.c +++ b/drivers/hwmon/da9052-hwmon.c | |||
@@ -194,7 +194,7 @@ static ssize_t da9052_hwmon_show_name(struct device *dev, | |||
194 | struct device_attribute *devattr, | 194 | struct device_attribute *devattr, |
195 | char *buf) | 195 | char *buf) |
196 | { | 196 | { |
197 | return sprintf(buf, "da9052-hwmon\n"); | 197 | return sprintf(buf, "da9052\n"); |
198 | } | 198 | } |
199 | 199 | ||
200 | static ssize_t show_label(struct device *dev, | 200 | static ssize_t show_label(struct device *dev, |
diff --git a/drivers/hwmon/da9055-hwmon.c b/drivers/hwmon/da9055-hwmon.c index 73b3865f1207..35eb7738d711 100644 --- a/drivers/hwmon/da9055-hwmon.c +++ b/drivers/hwmon/da9055-hwmon.c | |||
@@ -204,7 +204,7 @@ static ssize_t da9055_hwmon_show_name(struct device *dev, | |||
204 | struct device_attribute *devattr, | 204 | struct device_attribute *devattr, |
205 | char *buf) | 205 | char *buf) |
206 | { | 206 | { |
207 | return sprintf(buf, "da9055-hwmon\n"); | 207 | return sprintf(buf, "da9055\n"); |
208 | } | 208 | } |
209 | 209 | ||
210 | static ssize_t show_label(struct device *dev, | 210 | static ssize_t show_label(struct device *dev, |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 8fb46aab2d87..a04c49f2a011 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -416,6 +416,7 @@ config BLK_DEV_CY82C693 | |||
416 | 416 | ||
417 | config BLK_DEV_CS5520 | 417 | config BLK_DEV_CS5520 |
418 | tristate "Cyrix CS5510/20 MediaGX chipset support (VERY EXPERIMENTAL)" | 418 | tristate "Cyrix CS5510/20 MediaGX chipset support (VERY EXPERIMENTAL)" |
419 | depends on X86_32 || COMPILE_TEST | ||
419 | select BLK_DEV_IDEDMA_PCI | 420 | select BLK_DEV_IDEDMA_PCI |
420 | help | 421 | help |
421 | Include support for PIO tuning and virtual DMA on the Cyrix MediaGX | 422 | Include support for PIO tuning and virtual DMA on the Cyrix MediaGX |
@@ -426,6 +427,7 @@ config BLK_DEV_CS5520 | |||
426 | 427 | ||
427 | config BLK_DEV_CS5530 | 428 | config BLK_DEV_CS5530 |
428 | tristate "Cyrix/National Semiconductor CS5530 MediaGX chipset support" | 429 | tristate "Cyrix/National Semiconductor CS5530 MediaGX chipset support" |
430 | depends on X86_32 || COMPILE_TEST | ||
429 | select BLK_DEV_IDEDMA_PCI | 431 | select BLK_DEV_IDEDMA_PCI |
430 | help | 432 | help |
431 | Include support for UDMA on the Cyrix MediaGX 5530 chipset. This | 433 | Include support for UDMA on the Cyrix MediaGX 5530 chipset. This |
@@ -435,7 +437,7 @@ config BLK_DEV_CS5530 | |||
435 | 437 | ||
436 | config BLK_DEV_CS5535 | 438 | config BLK_DEV_CS5535 |
437 | tristate "AMD CS5535 chipset support" | 439 | tristate "AMD CS5535 chipset support" |
438 | depends on X86 && !X86_64 | 440 | depends on X86_32 |
439 | select BLK_DEV_IDEDMA_PCI | 441 | select BLK_DEV_IDEDMA_PCI |
440 | help | 442 | help |
441 | Include support for UDMA on the NSC/AMD CS5535 companion chipset. | 443 | Include support for UDMA on the NSC/AMD CS5535 companion chipset. |
@@ -486,6 +488,7 @@ config BLK_DEV_JMICRON | |||
486 | 488 | ||
487 | config BLK_DEV_SC1200 | 489 | config BLK_DEV_SC1200 |
488 | tristate "National SCx200 chipset support" | 490 | tristate "National SCx200 chipset support" |
491 | depends on X86_32 || COMPILE_TEST | ||
489 | select BLK_DEV_IDEDMA_PCI | 492 | select BLK_DEV_IDEDMA_PCI |
490 | help | 493 | help |
491 | This driver adds support for the on-board IDE controller on the | 494 | This driver adds support for the on-board IDE controller on the |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 2a744a91370e..a3d3b1733c49 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -853,8 +853,9 @@ static int init_irq (ide_hwif_t *hwif) | |||
853 | if (irq_handler == NULL) | 853 | if (irq_handler == NULL) |
854 | irq_handler = ide_intr; | 854 | irq_handler = ide_intr; |
855 | 855 | ||
856 | if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) | 856 | if (!host->get_lock) |
857 | goto out_up; | 857 | if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif)) |
858 | goto out_up; | ||
858 | 859 | ||
859 | #if !defined(__mc68000__) | 860 | #if !defined(__mc68000__) |
860 | printk(KERN_INFO "%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, | 861 | printk(KERN_INFO "%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, |
@@ -1533,7 +1534,8 @@ static void ide_unregister(ide_hwif_t *hwif) | |||
1533 | 1534 | ||
1534 | ide_proc_unregister_port(hwif); | 1535 | ide_proc_unregister_port(hwif); |
1535 | 1536 | ||
1536 | free_irq(hwif->irq, hwif); | 1537 | if (!hwif->host->get_lock) |
1538 | free_irq(hwif->irq, hwif); | ||
1537 | 1539 | ||
1538 | device_unregister(hwif->portdev); | 1540 | device_unregister(hwif->portdev); |
1539 | device_unregister(&hwif->gendev); | 1541 | device_unregister(&hwif->gendev); |
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 17aeea170566..2a5fa9a436e5 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c | |||
@@ -111,8 +111,14 @@ static const int mma8452_samp_freq[8][2] = { | |||
111 | {6, 250000}, {1, 560000} | 111 | {6, 250000}, {1, 560000} |
112 | }; | 112 | }; |
113 | 113 | ||
114 | /* | ||
115 | * Hardware has fullscale of -2G, -4G, -8G corresponding to raw value -2048 | ||
116 | * The userspace interface uses m/s^2 and we declare micro units | ||
117 | * So scale factor is given by: | ||
118 | * g * N * 1000000 / 2048 for N = 2, 4, 8 and g=9.80665 | ||
119 | */ | ||
114 | static const int mma8452_scales[3][2] = { | 120 | static const int mma8452_scales[3][2] = { |
115 | {0, 977}, {0, 1953}, {0, 3906} | 121 | {0, 9577}, {0, 19154}, {0, 38307} |
116 | }; | 122 | }; |
117 | 123 | ||
118 | static ssize_t mma8452_show_samp_freq_avail(struct device *dev, | 124 | static ssize_t mma8452_show_samp_freq_avail(struct device *dev, |
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index 258a973a1fb8..bfbf4d419f41 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c | |||
@@ -345,6 +345,9 @@ static int iio_device_add_event(struct iio_dev *indio_dev, | |||
345 | &indio_dev->event_interface->dev_attr_list); | 345 | &indio_dev->event_interface->dev_attr_list); |
346 | kfree(postfix); | 346 | kfree(postfix); |
347 | 347 | ||
348 | if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE)) | ||
349 | continue; | ||
350 | |||
348 | if (ret) | 351 | if (ret) |
349 | return ret; | 352 | return ret; |
350 | 353 | ||
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 5e153f6d4b48..768a0fb67dd6 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -432,8 +432,17 @@ static void arp_failure_discard(void *handle, struct sk_buff *skb) | |||
432 | */ | 432 | */ |
433 | static void act_open_req_arp_failure(void *handle, struct sk_buff *skb) | 433 | static void act_open_req_arp_failure(void *handle, struct sk_buff *skb) |
434 | { | 434 | { |
435 | struct c4iw_ep *ep = handle; | ||
436 | |||
435 | printk(KERN_ERR MOD "ARP failure duing connect\n"); | 437 | printk(KERN_ERR MOD "ARP failure duing connect\n"); |
436 | kfree_skb(skb); | 438 | kfree_skb(skb); |
439 | connect_reply_upcall(ep, -EHOSTUNREACH); | ||
440 | state_set(&ep->com, DEAD); | ||
441 | remove_handle(ep->com.dev, &ep->com.dev->atid_idr, ep->atid); | ||
442 | cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); | ||
443 | dst_release(ep->dst); | ||
444 | cxgb4_l2t_release(ep->l2t); | ||
445 | c4iw_put_ep(&ep->com); | ||
437 | } | 446 | } |
438 | 447 | ||
439 | /* | 448 | /* |
@@ -658,7 +667,7 @@ static int send_connect(struct c4iw_ep *ep) | |||
658 | opt2 |= T5_OPT_2_VALID; | 667 | opt2 |= T5_OPT_2_VALID; |
659 | opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); | 668 | opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); |
660 | } | 669 | } |
661 | t4_set_arp_err_handler(skb, NULL, act_open_req_arp_failure); | 670 | t4_set_arp_err_handler(skb, ep, act_open_req_arp_failure); |
662 | 671 | ||
663 | if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { | 672 | if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { |
664 | if (ep->com.remote_addr.ss_family == AF_INET) { | 673 | if (ep->com.remote_addr.ss_family == AF_INET) { |
@@ -2180,7 +2189,6 @@ static void reject_cr(struct c4iw_dev *dev, u32 hwtid, struct sk_buff *skb) | |||
2180 | PDBG("%s c4iw_dev %p tid %u\n", __func__, dev, hwtid); | 2189 | PDBG("%s c4iw_dev %p tid %u\n", __func__, dev, hwtid); |
2181 | BUG_ON(skb_cloned(skb)); | 2190 | BUG_ON(skb_cloned(skb)); |
2182 | skb_trim(skb, sizeof(struct cpl_tid_release)); | 2191 | skb_trim(skb, sizeof(struct cpl_tid_release)); |
2183 | skb_get(skb); | ||
2184 | release_tid(&dev->rdev, hwtid, skb); | 2192 | release_tid(&dev->rdev, hwtid, skb); |
2185 | return; | 2193 | return; |
2186 | } | 2194 | } |
@@ -3917,7 +3925,7 @@ int __init c4iw_cm_init(void) | |||
3917 | return 0; | 3925 | return 0; |
3918 | } | 3926 | } |
3919 | 3927 | ||
3920 | void __exit c4iw_cm_term(void) | 3928 | void c4iw_cm_term(void) |
3921 | { | 3929 | { |
3922 | WARN_ON(!list_empty(&timeout_list)); | 3930 | WARN_ON(!list_empty(&timeout_list)); |
3923 | flush_workqueue(workq); | 3931 | flush_workqueue(workq); |
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index dd93aadc996e..7db82b24302b 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c | |||
@@ -696,6 +696,7 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) | |||
696 | pr_err(MOD "error allocating status page\n"); | 696 | pr_err(MOD "error allocating status page\n"); |
697 | goto err4; | 697 | goto err4; |
698 | } | 698 | } |
699 | rdev->status_page->db_off = 0; | ||
699 | return 0; | 700 | return 0; |
700 | err4: | 701 | err4: |
701 | c4iw_rqtpool_destroy(rdev); | 702 | c4iw_rqtpool_destroy(rdev); |
@@ -729,7 +730,6 @@ static void c4iw_dealloc(struct uld_ctx *ctx) | |||
729 | if (ctx->dev->rdev.oc_mw_kva) | 730 | if (ctx->dev->rdev.oc_mw_kva) |
730 | iounmap(ctx->dev->rdev.oc_mw_kva); | 731 | iounmap(ctx->dev->rdev.oc_mw_kva); |
731 | ib_dealloc_device(&ctx->dev->ibdev); | 732 | ib_dealloc_device(&ctx->dev->ibdev); |
732 | iwpm_exit(RDMA_NL_C4IW); | ||
733 | ctx->dev = NULL; | 733 | ctx->dev = NULL; |
734 | } | 734 | } |
735 | 735 | ||
@@ -826,12 +826,6 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) | |||
826 | setup_debugfs(devp); | 826 | setup_debugfs(devp); |
827 | } | 827 | } |
828 | 828 | ||
829 | ret = iwpm_init(RDMA_NL_C4IW); | ||
830 | if (ret) { | ||
831 | pr_err("port mapper initialization failed with %d\n", ret); | ||
832 | ib_dealloc_device(&devp->ibdev); | ||
833 | return ERR_PTR(ret); | ||
834 | } | ||
835 | 829 | ||
836 | return devp; | 830 | return devp; |
837 | } | 831 | } |
@@ -1332,6 +1326,15 @@ static int __init c4iw_init_module(void) | |||
1332 | pr_err("%s[%u]: Failed to add netlink callback\n" | 1326 | pr_err("%s[%u]: Failed to add netlink callback\n" |
1333 | , __func__, __LINE__); | 1327 | , __func__, __LINE__); |
1334 | 1328 | ||
1329 | err = iwpm_init(RDMA_NL_C4IW); | ||
1330 | if (err) { | ||
1331 | pr_err("port mapper initialization failed with %d\n", err); | ||
1332 | ibnl_remove_client(RDMA_NL_C4IW); | ||
1333 | c4iw_cm_term(); | ||
1334 | debugfs_remove_recursive(c4iw_debugfs_root); | ||
1335 | return err; | ||
1336 | } | ||
1337 | |||
1335 | cxgb4_register_uld(CXGB4_ULD_RDMA, &c4iw_uld_info); | 1338 | cxgb4_register_uld(CXGB4_ULD_RDMA, &c4iw_uld_info); |
1336 | 1339 | ||
1337 | return 0; | 1340 | return 0; |
@@ -1349,6 +1352,7 @@ static void __exit c4iw_exit_module(void) | |||
1349 | } | 1352 | } |
1350 | mutex_unlock(&dev_mutex); | 1353 | mutex_unlock(&dev_mutex); |
1351 | cxgb4_unregister_uld(CXGB4_ULD_RDMA); | 1354 | cxgb4_unregister_uld(CXGB4_ULD_RDMA); |
1355 | iwpm_exit(RDMA_NL_C4IW); | ||
1352 | ibnl_remove_client(RDMA_NL_C4IW); | 1356 | ibnl_remove_client(RDMA_NL_C4IW); |
1353 | c4iw_cm_term(); | 1357 | c4iw_cm_term(); |
1354 | debugfs_remove_recursive(c4iw_debugfs_root); | 1358 | debugfs_remove_recursive(c4iw_debugfs_root); |
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index 125bc5d1e175..361fff7a0742 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |||
@@ -908,7 +908,7 @@ int c4iw_destroy_ctrl_qp(struct c4iw_rdev *rdev); | |||
908 | int c4iw_register_device(struct c4iw_dev *dev); | 908 | int c4iw_register_device(struct c4iw_dev *dev); |
909 | void c4iw_unregister_device(struct c4iw_dev *dev); | 909 | void c4iw_unregister_device(struct c4iw_dev *dev); |
910 | int __init c4iw_cm_init(void); | 910 | int __init c4iw_cm_init(void); |
911 | void __exit c4iw_cm_term(void); | 911 | void c4iw_cm_term(void); |
912 | void c4iw_release_dev_ucontext(struct c4iw_rdev *rdev, | 912 | void c4iw_release_dev_ucontext(struct c4iw_rdev *rdev, |
913 | struct c4iw_dev_ucontext *uctx); | 913 | struct c4iw_dev_ucontext *uctx); |
914 | void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev, | 914 | void c4iw_init_dev_ucontext(struct c4iw_rdev *rdev, |
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index d13ddf1c0033..bbbcf389272c 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
@@ -675,7 +675,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, | |||
675 | int err; | 675 | int err; |
676 | 676 | ||
677 | uuari = &dev->mdev.priv.uuari; | 677 | uuari = &dev->mdev.priv.uuari; |
678 | if (init_attr->create_flags & ~IB_QP_CREATE_SIGNATURE_EN) | 678 | if (init_attr->create_flags & ~(IB_QP_CREATE_SIGNATURE_EN | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK)) |
679 | return -EINVAL; | 679 | return -EINVAL; |
680 | 680 | ||
681 | if (init_attr->qp_type == MLX5_IB_QPT_REG_UMR) | 681 | if (init_attr->qp_type == MLX5_IB_QPT_REG_UMR) |
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index b99dd88e31b9..bb446d742a2d 100644 --- a/drivers/iommu/fsl_pamu.c +++ b/drivers/iommu/fsl_pamu.c | |||
@@ -170,10 +170,10 @@ int pamu_disable_liodn(int liodn) | |||
170 | static unsigned int map_addrspace_size_to_wse(phys_addr_t addrspace_size) | 170 | static unsigned int map_addrspace_size_to_wse(phys_addr_t addrspace_size) |
171 | { | 171 | { |
172 | /* Bug if not a power of 2 */ | 172 | /* Bug if not a power of 2 */ |
173 | BUG_ON(!is_power_of_2(addrspace_size)); | 173 | BUG_ON((addrspace_size & (addrspace_size - 1))); |
174 | 174 | ||
175 | /* window size is 2^(WSE+1) bytes */ | 175 | /* window size is 2^(WSE+1) bytes */ |
176 | return __ffs(addrspace_size) - 1; | 176 | return fls64(addrspace_size) - 2; |
177 | } | 177 | } |
178 | 178 | ||
179 | /* Derive the PAACE window count encoding for the subwindow count */ | 179 | /* Derive the PAACE window count encoding for the subwindow count */ |
@@ -351,7 +351,7 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size, | |||
351 | struct paace *ppaace; | 351 | struct paace *ppaace; |
352 | unsigned long fspi; | 352 | unsigned long fspi; |
353 | 353 | ||
354 | if (!is_power_of_2(win_size) || win_size < PAMU_PAGE_SIZE) { | 354 | if ((win_size & (win_size - 1)) || win_size < PAMU_PAGE_SIZE) { |
355 | pr_debug("window size too small or not a power of two %llx\n", win_size); | 355 | pr_debug("window size too small or not a power of two %llx\n", win_size); |
356 | return -EINVAL; | 356 | return -EINVAL; |
357 | } | 357 | } |
@@ -464,7 +464,7 @@ int pamu_config_spaace(int liodn, u32 subwin_cnt, u32 subwin, | |||
464 | return -ENOENT; | 464 | return -ENOENT; |
465 | } | 465 | } |
466 | 466 | ||
467 | if (!is_power_of_2(subwin_size) || subwin_size < PAMU_PAGE_SIZE) { | 467 | if ((subwin_size & (subwin_size - 1)) || subwin_size < PAMU_PAGE_SIZE) { |
468 | pr_debug("subwindow size out of range, or not a power of 2\n"); | 468 | pr_debug("subwindow size out of range, or not a power of 2\n"); |
469 | return -EINVAL; | 469 | return -EINVAL; |
470 | } | 470 | } |
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 93072ba44b1d..af47648301a9 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c | |||
@@ -301,7 +301,7 @@ static int check_size(u64 size, dma_addr_t iova) | |||
301 | * Size must be a power of two and at least be equal | 301 | * Size must be a power of two and at least be equal |
302 | * to PAMU page size. | 302 | * to PAMU page size. |
303 | */ | 303 | */ |
304 | if (!is_power_of_2(size) || size < PAMU_PAGE_SIZE) { | 304 | if ((size & (size - 1)) || size < PAMU_PAGE_SIZE) { |
305 | pr_debug("%s: size too small or not a power of two\n", __func__); | 305 | pr_debug("%s: size too small or not a power of two\n", __func__); |
306 | return -EINVAL; | 306 | return -EINVAL; |
307 | } | 307 | } |
@@ -335,11 +335,6 @@ static struct fsl_dma_domain *iommu_alloc_dma_domain(void) | |||
335 | return domain; | 335 | return domain; |
336 | } | 336 | } |
337 | 337 | ||
338 | static inline struct device_domain_info *find_domain(struct device *dev) | ||
339 | { | ||
340 | return dev->archdata.iommu_domain; | ||
341 | } | ||
342 | |||
343 | static void remove_device_ref(struct device_domain_info *info, u32 win_cnt) | 338 | static void remove_device_ref(struct device_domain_info *info, u32 win_cnt) |
344 | { | 339 | { |
345 | unsigned long flags; | 340 | unsigned long flags; |
@@ -380,7 +375,7 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d | |||
380 | * Check here if the device is already attached to domain or not. | 375 | * Check here if the device is already attached to domain or not. |
381 | * If the device is already attached to a domain detach it. | 376 | * If the device is already attached to a domain detach it. |
382 | */ | 377 | */ |
383 | old_domain_info = find_domain(dev); | 378 | old_domain_info = dev->archdata.iommu_domain; |
384 | if (old_domain_info && old_domain_info->domain != dma_domain) { | 379 | if (old_domain_info && old_domain_info->domain != dma_domain) { |
385 | spin_unlock_irqrestore(&device_domain_lock, flags); | 380 | spin_unlock_irqrestore(&device_domain_lock, flags); |
386 | detach_device(dev, old_domain_info->domain); | 381 | detach_device(dev, old_domain_info->domain); |
@@ -399,7 +394,7 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d | |||
399 | * the info for the first LIODN as all | 394 | * the info for the first LIODN as all |
400 | * LIODNs share the same domain | 395 | * LIODNs share the same domain |
401 | */ | 396 | */ |
402 | if (!old_domain_info) | 397 | if (!dev->archdata.iommu_domain) |
403 | dev->archdata.iommu_domain = info; | 398 | dev->archdata.iommu_domain = info; |
404 | spin_unlock_irqrestore(&device_domain_lock, flags); | 399 | spin_unlock_irqrestore(&device_domain_lock, flags); |
405 | 400 | ||
@@ -1042,12 +1037,15 @@ root_bus: | |||
1042 | group = get_shared_pci_device_group(pdev); | 1037 | group = get_shared_pci_device_group(pdev); |
1043 | } | 1038 | } |
1044 | 1039 | ||
1040 | if (!group) | ||
1041 | group = ERR_PTR(-ENODEV); | ||
1042 | |||
1045 | return group; | 1043 | return group; |
1046 | } | 1044 | } |
1047 | 1045 | ||
1048 | static int fsl_pamu_add_device(struct device *dev) | 1046 | static int fsl_pamu_add_device(struct device *dev) |
1049 | { | 1047 | { |
1050 | struct iommu_group *group = NULL; | 1048 | struct iommu_group *group = ERR_PTR(-ENODEV); |
1051 | struct pci_dev *pdev; | 1049 | struct pci_dev *pdev; |
1052 | const u32 *prop; | 1050 | const u32 *prop; |
1053 | int ret, len; | 1051 | int ret, len; |
@@ -1070,7 +1068,7 @@ static int fsl_pamu_add_device(struct device *dev) | |||
1070 | group = get_device_iommu_group(dev); | 1068 | group = get_device_iommu_group(dev); |
1071 | } | 1069 | } |
1072 | 1070 | ||
1073 | if (!group || IS_ERR(group)) | 1071 | if (IS_ERR(group)) |
1074 | return PTR_ERR(group); | 1072 | return PTR_ERR(group); |
1075 | 1073 | ||
1076 | ret = iommu_group_add_device(group, dev); | 1074 | ret = iommu_group_add_device(group, dev); |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 7e11c9d6ae8c..7c131cf7cc13 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/irqchip/chained_irq.h> | 42 | #include <linux/irqchip/chained_irq.h> |
43 | #include <linux/irqchip/arm-gic.h> | 43 | #include <linux/irqchip/arm-gic.h> |
44 | 44 | ||
45 | #include <asm/cputype.h> | ||
45 | #include <asm/irq.h> | 46 | #include <asm/irq.h> |
46 | #include <asm/exception.h> | 47 | #include <asm/exception.h> |
47 | #include <asm/smp_plat.h> | 48 | #include <asm/smp_plat.h> |
@@ -954,7 +955,9 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, | |||
954 | } | 955 | } |
955 | 956 | ||
956 | for_each_possible_cpu(cpu) { | 957 | for_each_possible_cpu(cpu) { |
957 | unsigned long offset = percpu_offset * cpu_logical_map(cpu); | 958 | u32 mpidr = cpu_logical_map(cpu); |
959 | u32 core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0); | ||
960 | unsigned long offset = percpu_offset * core_id; | ||
958 | *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset; | 961 | *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset; |
959 | *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset; | 962 | *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset; |
960 | } | 963 | } |
@@ -1071,8 +1074,10 @@ gic_of_init(struct device_node *node, struct device_node *parent) | |||
1071 | gic_cnt++; | 1074 | gic_cnt++; |
1072 | return 0; | 1075 | return 0; |
1073 | } | 1076 | } |
1077 | IRQCHIP_DECLARE(gic_400, "arm,gic-400", gic_of_init); | ||
1074 | IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init); | 1078 | IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init); |
1075 | IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init); | 1079 | IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init); |
1080 | IRQCHIP_DECLARE(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init); | ||
1076 | IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init); | 1081 | IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init); |
1077 | IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init); | 1082 | IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init); |
1078 | 1083 | ||
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 4ead4ba60656..d2899e7eb3aa 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c | |||
@@ -425,6 +425,15 @@ static int __open_metadata(struct dm_cache_metadata *cmd) | |||
425 | 425 | ||
426 | disk_super = dm_block_data(sblock); | 426 | disk_super = dm_block_data(sblock); |
427 | 427 | ||
428 | /* Verify the data block size hasn't changed */ | ||
429 | if (le32_to_cpu(disk_super->data_block_size) != cmd->data_block_size) { | ||
430 | DMERR("changing the data block size (from %u to %llu) is not supported", | ||
431 | le32_to_cpu(disk_super->data_block_size), | ||
432 | (unsigned long long)cmd->data_block_size); | ||
433 | r = -EINVAL; | ||
434 | goto bad; | ||
435 | } | ||
436 | |||
428 | r = __check_incompat_features(disk_super, cmd); | 437 | r = __check_incompat_features(disk_super, cmd); |
429 | if (r < 0) | 438 | if (r < 0) |
430 | goto bad; | 439 | goto bad; |
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index b086a945edcb..e9d33ad59df5 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -613,6 +613,15 @@ static int __open_metadata(struct dm_pool_metadata *pmd) | |||
613 | 613 | ||
614 | disk_super = dm_block_data(sblock); | 614 | disk_super = dm_block_data(sblock); |
615 | 615 | ||
616 | /* Verify the data block size hasn't changed */ | ||
617 | if (le32_to_cpu(disk_super->data_block_size) != pmd->data_block_size) { | ||
618 | DMERR("changing the data block size (from %u to %llu) is not supported", | ||
619 | le32_to_cpu(disk_super->data_block_size), | ||
620 | (unsigned long long)pmd->data_block_size); | ||
621 | r = -EINVAL; | ||
622 | goto bad_unlock_sblock; | ||
623 | } | ||
624 | |||
616 | r = __check_incompat_features(disk_super, pmd); | 625 | r = __check_incompat_features(disk_super, pmd); |
617 | if (r < 0) | 626 | if (r < 0) |
618 | goto bad_unlock_sblock; | 627 | goto bad_unlock_sblock; |
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index 8637d2ed7623..2e3cdcfa0a67 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c | |||
@@ -60,7 +60,7 @@ static int si2168_cmd_execute(struct si2168 *s, struct si2168_cmd *cmd) | |||
60 | jiffies_to_msecs(jiffies) - | 60 | jiffies_to_msecs(jiffies) - |
61 | (jiffies_to_msecs(timeout) - TIMEOUT)); | 61 | (jiffies_to_msecs(timeout) - TIMEOUT)); |
62 | 62 | ||
63 | if (!(cmd->args[0] >> 7) & 0x01) { | 63 | if (!((cmd->args[0] >> 7) & 0x01)) { |
64 | ret = -ETIMEDOUT; | 64 | ret = -ETIMEDOUT; |
65 | goto err_mutex_unlock; | 65 | goto err_mutex_unlock; |
66 | } | 66 | } |
@@ -485,20 +485,6 @@ static int si2168_init(struct dvb_frontend *fe) | |||
485 | if (ret) | 485 | if (ret) |
486 | goto err; | 486 | goto err; |
487 | 487 | ||
488 | cmd.args[0] = 0x05; | ||
489 | cmd.args[1] = 0x00; | ||
490 | cmd.args[2] = 0xaa; | ||
491 | cmd.args[3] = 0x4d; | ||
492 | cmd.args[4] = 0x56; | ||
493 | cmd.args[5] = 0x40; | ||
494 | cmd.args[6] = 0x00; | ||
495 | cmd.args[7] = 0x00; | ||
496 | cmd.wlen = 8; | ||
497 | cmd.rlen = 1; | ||
498 | ret = si2168_cmd_execute(s, &cmd); | ||
499 | if (ret) | ||
500 | goto err; | ||
501 | |||
502 | /* cold state - try to download firmware */ | 488 | /* cold state - try to download firmware */ |
503 | dev_info(&s->client->dev, "%s: found a '%s' in cold state\n", | 489 | dev_info(&s->client->dev, "%s: found a '%s' in cold state\n", |
504 | KBUILD_MODNAME, si2168_ops.info.name); | 490 | KBUILD_MODNAME, si2168_ops.info.name); |
diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h index 2a343e896f40..53f7f06ae343 100644 --- a/drivers/media/dvb-frontends/si2168_priv.h +++ b/drivers/media/dvb-frontends/si2168_priv.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/firmware.h> | 22 | #include <linux/firmware.h> |
23 | #include <linux/i2c-mux.h> | 23 | #include <linux/i2c-mux.h> |
24 | 24 | ||
25 | #define SI2168_FIRMWARE "dvb-demod-si2168-01.fw" | 25 | #define SI2168_FIRMWARE "dvb-demod-si2168-02.fw" |
26 | 26 | ||
27 | /* state struct */ | 27 | /* state struct */ |
28 | struct si2168 { | 28 | struct si2168 { |
diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c index 522fe00f5eee..9619be5d4827 100644 --- a/drivers/media/dvb-frontends/tda10071.c +++ b/drivers/media/dvb-frontends/tda10071.c | |||
@@ -668,6 +668,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) | |||
668 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 668 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
669 | int ret, i; | 669 | int ret, i; |
670 | u8 mode, rolloff, pilot, inversion, div; | 670 | u8 mode, rolloff, pilot, inversion, div; |
671 | fe_modulation_t modulation; | ||
671 | 672 | ||
672 | dev_dbg(&priv->i2c->dev, | 673 | dev_dbg(&priv->i2c->dev, |
673 | "%s: delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d pilot=%d rolloff=%d\n", | 674 | "%s: delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d pilot=%d rolloff=%d\n", |
@@ -702,10 +703,13 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) | |||
702 | 703 | ||
703 | switch (c->delivery_system) { | 704 | switch (c->delivery_system) { |
704 | case SYS_DVBS: | 705 | case SYS_DVBS: |
706 | modulation = QPSK; | ||
705 | rolloff = 0; | 707 | rolloff = 0; |
706 | pilot = 2; | 708 | pilot = 2; |
707 | break; | 709 | break; |
708 | case SYS_DVBS2: | 710 | case SYS_DVBS2: |
711 | modulation = c->modulation; | ||
712 | |||
709 | switch (c->rolloff) { | 713 | switch (c->rolloff) { |
710 | case ROLLOFF_20: | 714 | case ROLLOFF_20: |
711 | rolloff = 2; | 715 | rolloff = 2; |
@@ -750,7 +754,7 @@ static int tda10071_set_frontend(struct dvb_frontend *fe) | |||
750 | 754 | ||
751 | for (i = 0, mode = 0xff; i < ARRAY_SIZE(TDA10071_MODCOD); i++) { | 755 | for (i = 0, mode = 0xff; i < ARRAY_SIZE(TDA10071_MODCOD); i++) { |
752 | if (c->delivery_system == TDA10071_MODCOD[i].delivery_system && | 756 | if (c->delivery_system == TDA10071_MODCOD[i].delivery_system && |
753 | c->modulation == TDA10071_MODCOD[i].modulation && | 757 | modulation == TDA10071_MODCOD[i].modulation && |
754 | c->fec_inner == TDA10071_MODCOD[i].fec) { | 758 | c->fec_inner == TDA10071_MODCOD[i].fec) { |
755 | mode = TDA10071_MODCOD[i].val; | 759 | mode = TDA10071_MODCOD[i].val; |
756 | dev_dbg(&priv->i2c->dev, "%s: mode found=%02x\n", | 760 | dev_dbg(&priv->i2c->dev, "%s: mode found=%02x\n", |
@@ -834,10 +838,10 @@ static int tda10071_get_frontend(struct dvb_frontend *fe) | |||
834 | 838 | ||
835 | switch ((buf[1] >> 0) & 0x01) { | 839 | switch ((buf[1] >> 0) & 0x01) { |
836 | case 0: | 840 | case 0: |
837 | c->inversion = INVERSION_OFF; | 841 | c->inversion = INVERSION_ON; |
838 | break; | 842 | break; |
839 | case 1: | 843 | case 1: |
840 | c->inversion = INVERSION_ON; | 844 | c->inversion = INVERSION_OFF; |
841 | break; | 845 | break; |
842 | } | 846 | } |
843 | 847 | ||
@@ -856,7 +860,7 @@ static int tda10071_get_frontend(struct dvb_frontend *fe) | |||
856 | if (ret) | 860 | if (ret) |
857 | goto error; | 861 | goto error; |
858 | 862 | ||
859 | c->symbol_rate = (buf[0] << 16) | (buf[1] << 8) | (buf[2] << 0); | 863 | c->symbol_rate = ((buf[0] << 16) | (buf[1] << 8) | (buf[2] << 0)) * 1000; |
860 | 864 | ||
861 | return ret; | 865 | return ret; |
862 | error: | 866 | error: |
diff --git a/drivers/media/dvb-frontends/tda10071_priv.h b/drivers/media/dvb-frontends/tda10071_priv.h index 4baf14bfb65a..420486192736 100644 --- a/drivers/media/dvb-frontends/tda10071_priv.h +++ b/drivers/media/dvb-frontends/tda10071_priv.h | |||
@@ -55,6 +55,7 @@ static struct tda10071_modcod { | |||
55 | { SYS_DVBS2, QPSK, FEC_8_9, 0x0a }, | 55 | { SYS_DVBS2, QPSK, FEC_8_9, 0x0a }, |
56 | { SYS_DVBS2, QPSK, FEC_9_10, 0x0b }, | 56 | { SYS_DVBS2, QPSK, FEC_9_10, 0x0b }, |
57 | /* 8PSK */ | 57 | /* 8PSK */ |
58 | { SYS_DVBS2, PSK_8, FEC_AUTO, 0x00 }, | ||
58 | { SYS_DVBS2, PSK_8, FEC_3_5, 0x0c }, | 59 | { SYS_DVBS2, PSK_8, FEC_3_5, 0x0c }, |
59 | { SYS_DVBS2, PSK_8, FEC_2_3, 0x0d }, | 60 | { SYS_DVBS2, PSK_8, FEC_2_3, 0x0d }, |
60 | { SYS_DVBS2, PSK_8, FEC_3_4, 0x0e }, | 61 | { SYS_DVBS2, PSK_8, FEC_3_4, 0x0e }, |
diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c index e65c760e4e8b..0006d6bf8c18 100644 --- a/drivers/media/pci/saa7134/saa7134-empress.c +++ b/drivers/media/pci/saa7134/saa7134-empress.c | |||
@@ -179,7 +179,7 @@ static const struct v4l2_file_operations ts_fops = | |||
179 | .read = vb2_fop_read, | 179 | .read = vb2_fop_read, |
180 | .poll = vb2_fop_poll, | 180 | .poll = vb2_fop_poll, |
181 | .mmap = vb2_fop_mmap, | 181 | .mmap = vb2_fop_mmap, |
182 | .ioctl = video_ioctl2, | 182 | .unlocked_ioctl = video_ioctl2, |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static const struct v4l2_ioctl_ops ts_ioctl_ops = { | 185 | static const struct v4l2_ioctl_ops ts_ioctl_ops = { |
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index a7ed16497903..1e4ec697fb10 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c | |||
@@ -269,6 +269,7 @@ err: | |||
269 | list_del(&buf->list); | 269 | list_del(&buf->list); |
270 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); | 270 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); |
271 | } | 271 | } |
272 | spin_unlock_irqrestore(&common->irqlock, flags); | ||
272 | 273 | ||
273 | return ret; | 274 | return ret; |
274 | } | 275 | } |
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 5bb085b19bcb..b431b58f39e3 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c | |||
@@ -233,6 +233,7 @@ err: | |||
233 | list_del(&buf->list); | 233 | list_del(&buf->list); |
234 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); | 234 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); |
235 | } | 235 | } |
236 | spin_unlock_irqrestore(&common->irqlock, flags); | ||
236 | 237 | ||
237 | return ret; | 238 | return ret; |
238 | } | 239 | } |
diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 271a752cee54..fa4cc7b880aa 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c | |||
@@ -57,7 +57,7 @@ static int si2157_cmd_execute(struct si2157 *s, struct si2157_cmd *cmd) | |||
57 | jiffies_to_msecs(jiffies) - | 57 | jiffies_to_msecs(jiffies) - |
58 | (jiffies_to_msecs(timeout) - TIMEOUT)); | 58 | (jiffies_to_msecs(timeout) - TIMEOUT)); |
59 | 59 | ||
60 | if (!(buf[0] >> 7) & 0x01) { | 60 | if (!((buf[0] >> 7) & 0x01)) { |
61 | ret = -ETIMEDOUT; | 61 | ret = -ETIMEDOUT; |
62 | goto err_mutex_unlock; | 62 | goto err_mutex_unlock; |
63 | } else { | 63 | } else { |
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 021e4d35e4d7..7b9b75f60774 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c | |||
@@ -704,15 +704,41 @@ static int af9035_read_config(struct dvb_usb_device *d) | |||
704 | if (ret < 0) | 704 | if (ret < 0) |
705 | goto err; | 705 | goto err; |
706 | 706 | ||
707 | if (tmp == 0x00) | 707 | dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n", |
708 | dev_dbg(&d->udev->dev, | 708 | __func__, i, tmp); |
709 | "%s: [%d]tuner not set, using default\n", | 709 | |
710 | __func__, i); | 710 | /* tuner sanity check */ |
711 | else | 711 | if (state->chip_type == 0x9135) { |
712 | if (state->chip_version == 0x02) { | ||
713 | /* IT9135 BX (v2) */ | ||
714 | switch (tmp) { | ||
715 | case AF9033_TUNER_IT9135_60: | ||
716 | case AF9033_TUNER_IT9135_61: | ||
717 | case AF9033_TUNER_IT9135_62: | ||
718 | state->af9033_config[i].tuner = tmp; | ||
719 | break; | ||
720 | } | ||
721 | } else { | ||
722 | /* IT9135 AX (v1) */ | ||
723 | switch (tmp) { | ||
724 | case AF9033_TUNER_IT9135_38: | ||
725 | case AF9033_TUNER_IT9135_51: | ||
726 | case AF9033_TUNER_IT9135_52: | ||
727 | state->af9033_config[i].tuner = tmp; | ||
728 | break; | ||
729 | } | ||
730 | } | ||
731 | } else { | ||
732 | /* AF9035 */ | ||
712 | state->af9033_config[i].tuner = tmp; | 733 | state->af9033_config[i].tuner = tmp; |
734 | } | ||
713 | 735 | ||
714 | dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n", | 736 | if (state->af9033_config[i].tuner != tmp) { |
715 | __func__, i, state->af9033_config[i].tuner); | 737 | dev_info(&d->udev->dev, |
738 | "%s: [%d] overriding tuner from %02x to %02x\n", | ||
739 | KBUILD_MODNAME, i, tmp, | ||
740 | state->af9033_config[i].tuner); | ||
741 | } | ||
716 | 742 | ||
717 | switch (state->af9033_config[i].tuner) { | 743 | switch (state->af9033_config[i].tuner) { |
718 | case AF9033_TUNER_TUA9001: | 744 | case AF9033_TUNER_TUA9001: |
diff --git a/drivers/media/usb/gspca/pac7302.c b/drivers/media/usb/gspca/pac7302.c index 2fd1c5e31a0f..339adce7c7a5 100644 --- a/drivers/media/usb/gspca/pac7302.c +++ b/drivers/media/usb/gspca/pac7302.c | |||
@@ -928,6 +928,7 @@ static const struct usb_device_id device_table[] = { | |||
928 | {USB_DEVICE(0x093a, 0x2620)}, | 928 | {USB_DEVICE(0x093a, 0x2620)}, |
929 | {USB_DEVICE(0x093a, 0x2621)}, | 929 | {USB_DEVICE(0x093a, 0x2621)}, |
930 | {USB_DEVICE(0x093a, 0x2622), .driver_info = FL_VFLIP}, | 930 | {USB_DEVICE(0x093a, 0x2622), .driver_info = FL_VFLIP}, |
931 | {USB_DEVICE(0x093a, 0x2623), .driver_info = FL_VFLIP}, | ||
931 | {USB_DEVICE(0x093a, 0x2624), .driver_info = FL_VFLIP}, | 932 | {USB_DEVICE(0x093a, 0x2624), .driver_info = FL_VFLIP}, |
932 | {USB_DEVICE(0x093a, 0x2625)}, | 933 | {USB_DEVICE(0x093a, 0x2625)}, |
933 | {USB_DEVICE(0x093a, 0x2626)}, | 934 | {USB_DEVICE(0x093a, 0x2626)}, |
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 0500c4175d5f..6bce01a674f9 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c | |||
@@ -82,7 +82,7 @@ static void hdpvr_read_bulk_callback(struct urb *urb) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | /*=========================================================================*/ | 84 | /*=========================================================================*/ |
85 | /* bufffer bits */ | 85 | /* buffer bits */ |
86 | 86 | ||
87 | /* function expects dev->io_mutex to be hold by caller */ | 87 | /* function expects dev->io_mutex to be hold by caller */ |
88 | int hdpvr_cancel_queue(struct hdpvr_device *dev) | 88 | int hdpvr_cancel_queue(struct hdpvr_device *dev) |
@@ -926,7 +926,7 @@ static int hdpvr_s_ctrl(struct v4l2_ctrl *ctrl) | |||
926 | case V4L2_CID_MPEG_AUDIO_ENCODING: | 926 | case V4L2_CID_MPEG_AUDIO_ENCODING: |
927 | if (dev->flags & HDPVR_FLAG_AC3_CAP) { | 927 | if (dev->flags & HDPVR_FLAG_AC3_CAP) { |
928 | opt->audio_codec = ctrl->val; | 928 | opt->audio_codec = ctrl->val; |
929 | return hdpvr_set_audio(dev, opt->audio_input, | 929 | return hdpvr_set_audio(dev, opt->audio_input + 1, |
930 | opt->audio_codec); | 930 | opt->audio_codec); |
931 | } | 931 | } |
932 | return 0; | 932 | return 0; |
@@ -1198,7 +1198,7 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent, | |||
1198 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, | 1198 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, |
1199 | V4L2_CID_MPEG_AUDIO_ENCODING, | 1199 | V4L2_CID_MPEG_AUDIO_ENCODING, |
1200 | ac3 ? V4L2_MPEG_AUDIO_ENCODING_AC3 : V4L2_MPEG_AUDIO_ENCODING_AAC, | 1200 | ac3 ? V4L2_MPEG_AUDIO_ENCODING_AC3 : V4L2_MPEG_AUDIO_ENCODING_AAC, |
1201 | 0x7, V4L2_MPEG_AUDIO_ENCODING_AAC); | 1201 | 0x7, ac3 ? dev->options.audio_codec : V4L2_MPEG_AUDIO_ENCODING_AAC); |
1202 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, | 1202 | v4l2_ctrl_new_std_menu(hdl, &hdpvr_ctrl_ops, |
1203 | V4L2_CID_MPEG_VIDEO_ENCODING, | 1203 | V4L2_CID_MPEG_VIDEO_ENCODING, |
1204 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 0x3, | 1204 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 0x3, |
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index 4ae54caadd03..ce1c9f5d9dee 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c | |||
@@ -610,10 +610,10 @@ struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait) | |||
610 | aspect.denominator = 9; | 610 | aspect.denominator = 9; |
611 | } else if (ratio == 34) { | 611 | } else if (ratio == 34) { |
612 | aspect.numerator = 4; | 612 | aspect.numerator = 4; |
613 | aspect.numerator = 3; | 613 | aspect.denominator = 3; |
614 | } else if (ratio == 68) { | 614 | } else if (ratio == 68) { |
615 | aspect.numerator = 15; | 615 | aspect.numerator = 15; |
616 | aspect.numerator = 9; | 616 | aspect.denominator = 9; |
617 | } else { | 617 | } else { |
618 | aspect.numerator = hor_landscape + 99; | 618 | aspect.numerator = hor_landscape + 99; |
619 | aspect.denominator = 100; | 619 | aspect.denominator = 100; |
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index b04e7d059888..0431b46d9fd9 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c | |||
@@ -125,7 +125,7 @@ static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai, int vol_id, | |||
125 | parent = *p; | 125 | parent = *p; |
126 | av = rb_entry(parent, struct ubi_ainf_volume, rb); | 126 | av = rb_entry(parent, struct ubi_ainf_volume, rb); |
127 | 127 | ||
128 | if (vol_id < av->vol_id) | 128 | if (vol_id > av->vol_id) |
129 | p = &(*p)->rb_left; | 129 | p = &(*p)->rb_left; |
130 | else | 130 | else |
131 | p = &(*p)->rb_right; | 131 | p = &(*p)->rb_right; |
@@ -423,7 +423,7 @@ static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai, | |||
423 | pnum, err); | 423 | pnum, err); |
424 | ret = err > 0 ? UBI_BAD_FASTMAP : err; | 424 | ret = err > 0 ? UBI_BAD_FASTMAP : err; |
425 | goto out; | 425 | goto out; |
426 | } else if (ret == UBI_IO_BITFLIPS) | 426 | } else if (err == UBI_IO_BITFLIPS) |
427 | scrub = 1; | 427 | scrub = 1; |
428 | 428 | ||
429 | /* | 429 | /* |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mr.c b/drivers/net/ethernet/mellanox/mlx5/core/mr.c index ba0401d4af50..184c3615f479 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/mr.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/mr.c | |||
@@ -94,6 +94,11 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | |||
94 | write_lock_irq(&table->lock); | 94 | write_lock_irq(&table->lock); |
95 | err = radix_tree_insert(&table->tree, mlx5_base_mkey(mr->key), mr); | 95 | err = radix_tree_insert(&table->tree, mlx5_base_mkey(mr->key), mr); |
96 | write_unlock_irq(&table->lock); | 96 | write_unlock_irq(&table->lock); |
97 | if (err) { | ||
98 | mlx5_core_warn(dev, "failed radix tree insert of mr 0x%x, %d\n", | ||
99 | mlx5_base_mkey(mr->key), err); | ||
100 | mlx5_core_destroy_mkey(dev, mr); | ||
101 | } | ||
97 | 102 | ||
98 | return err; | 103 | return err; |
99 | } | 104 | } |
@@ -104,12 +109,22 @@ int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr) | |||
104 | struct mlx5_mr_table *table = &dev->priv.mr_table; | 109 | struct mlx5_mr_table *table = &dev->priv.mr_table; |
105 | struct mlx5_destroy_mkey_mbox_in in; | 110 | struct mlx5_destroy_mkey_mbox_in in; |
106 | struct mlx5_destroy_mkey_mbox_out out; | 111 | struct mlx5_destroy_mkey_mbox_out out; |
112 | struct mlx5_core_mr *deleted_mr; | ||
107 | unsigned long flags; | 113 | unsigned long flags; |
108 | int err; | 114 | int err; |
109 | 115 | ||
110 | memset(&in, 0, sizeof(in)); | 116 | memset(&in, 0, sizeof(in)); |
111 | memset(&out, 0, sizeof(out)); | 117 | memset(&out, 0, sizeof(out)); |
112 | 118 | ||
119 | write_lock_irqsave(&table->lock, flags); | ||
120 | deleted_mr = radix_tree_delete(&table->tree, mlx5_base_mkey(mr->key)); | ||
121 | write_unlock_irqrestore(&table->lock, flags); | ||
122 | if (!deleted_mr) { | ||
123 | mlx5_core_warn(dev, "failed radix tree delete of mr 0x%x\n", | ||
124 | mlx5_base_mkey(mr->key)); | ||
125 | return -ENOENT; | ||
126 | } | ||
127 | |||
113 | in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_DESTROY_MKEY); | 128 | in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_DESTROY_MKEY); |
114 | in.mkey = cpu_to_be32(mlx5_mkey_to_idx(mr->key)); | 129 | in.mkey = cpu_to_be32(mlx5_mkey_to_idx(mr->key)); |
115 | err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); | 130 | err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); |
@@ -119,10 +134,6 @@ int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr) | |||
119 | if (out.hdr.status) | 134 | if (out.hdr.status) |
120 | return mlx5_cmd_status_to_err(&out.hdr); | 135 | return mlx5_cmd_status_to_err(&out.hdr); |
121 | 136 | ||
122 | write_lock_irqsave(&table->lock, flags); | ||
123 | radix_tree_delete(&table->tree, mlx5_base_mkey(mr->key)); | ||
124 | write_unlock_irqrestore(&table->lock, flags); | ||
125 | |||
126 | return err; | 137 | return err; |
127 | } | 138 | } |
128 | EXPORT_SYMBOL(mlx5_core_destroy_mkey); | 139 | EXPORT_SYMBOL(mlx5_core_destroy_mkey); |
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 15b3459f8656..220acb4cbee5 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c | |||
@@ -633,7 +633,6 @@ raw3270_reset_device_cb(struct raw3270_request *rq, void *data) | |||
633 | } else | 633 | } else |
634 | raw3270_writesf_readpart(rp); | 634 | raw3270_writesf_readpart(rp); |
635 | memset(&rp->init_reset, 0, sizeof(rp->init_reset)); | 635 | memset(&rp->init_reset, 0, sizeof(rp->init_reset)); |
636 | memset(&rp->init_data, 0, sizeof(rp->init_data)); | ||
637 | } | 636 | } |
638 | 637 | ||
639 | static int | 638 | static int |
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 69ef4f8cfac8..4038437ff033 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -901,10 +901,15 @@ static int ap_device_probe(struct device *dev) | |||
901 | int rc; | 901 | int rc; |
902 | 902 | ||
903 | ap_dev->drv = ap_drv; | 903 | ap_dev->drv = ap_drv; |
904 | |||
905 | spin_lock_bh(&ap_device_list_lock); | ||
906 | list_add(&ap_dev->list, &ap_device_list); | ||
907 | spin_unlock_bh(&ap_device_list_lock); | ||
908 | |||
904 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; | 909 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; |
905 | if (!rc) { | 910 | if (rc) { |
906 | spin_lock_bh(&ap_device_list_lock); | 911 | spin_lock_bh(&ap_device_list_lock); |
907 | list_add(&ap_dev->list, &ap_device_list); | 912 | list_del_init(&ap_dev->list); |
908 | spin_unlock_bh(&ap_device_list_lock); | 913 | spin_unlock_bh(&ap_device_list_lock); |
909 | } | 914 | } |
910 | return rc; | 915 | return rc; |
diff --git a/drivers/staging/media/omap4iss/Kconfig b/drivers/staging/media/omap4iss/Kconfig index 78b0fba7047e..8afc6fee40c5 100644 --- a/drivers/staging/media/omap4iss/Kconfig +++ b/drivers/staging/media/omap4iss/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config VIDEO_OMAP4 | 1 | config VIDEO_OMAP4 |
2 | bool "OMAP 4 Camera support" | 2 | bool "OMAP 4 Camera support" |
3 | depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4 | 3 | depends on VIDEO_V4L2=y && VIDEO_V4L2_SUBDEV_API && I2C=y && ARCH_OMAP4 |
4 | select VIDEOBUF2_DMA_CONTIG | 4 | select VIDEOBUF2_DMA_CONTIG |
5 | ---help--- | 5 | ---help--- |
6 | Driver for an OMAP 4 ISS controller. | 6 | Driver for an OMAP 4 ISS controller. |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 9d2b673f90e3..b8125aa64ad8 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1169,8 +1169,8 @@ static int ep_enable(struct usb_ep *ep, | |||
1169 | 1169 | ||
1170 | if (hwep->type == USB_ENDPOINT_XFER_CONTROL) | 1170 | if (hwep->type == USB_ENDPOINT_XFER_CONTROL) |
1171 | cap |= QH_IOS; | 1171 | cap |= QH_IOS; |
1172 | if (hwep->num) | 1172 | |
1173 | cap |= QH_ZLT; | 1173 | cap |= QH_ZLT; |
1174 | cap |= (hwep->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT; | 1174 | cap |= (hwep->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT; |
1175 | /* | 1175 | /* |
1176 | * For ISO-TX, we set mult at QH as the largest value, and use | 1176 | * For ISO-TX, we set mult at QH as the largest value, and use |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 21b99b4b4082..0e950ad8cb25 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -889,6 +889,25 @@ static int hub_usb3_port_disable(struct usb_hub *hub, int port1) | |||
889 | if (!hub_is_superspeed(hub->hdev)) | 889 | if (!hub_is_superspeed(hub->hdev)) |
890 | return -EINVAL; | 890 | return -EINVAL; |
891 | 891 | ||
892 | ret = hub_port_status(hub, port1, &portstatus, &portchange); | ||
893 | if (ret < 0) | ||
894 | return ret; | ||
895 | |||
896 | /* | ||
897 | * USB controller Advanced Micro Devices, Inc. [AMD] FCH USB XHCI | ||
898 | * Controller [1022:7814] will have spurious result making the following | ||
899 | * usb 3.0 device hotplugging route to the 2.0 root hub and recognized | ||
900 | * as high-speed device if we set the usb 3.0 port link state to | ||
901 | * Disabled. Since it's already in USB_SS_PORT_LS_RX_DETECT state, we | ||
902 | * check the state here to avoid the bug. | ||
903 | */ | ||
904 | if ((portstatus & USB_PORT_STAT_LINK_STATE) == | ||
905 | USB_SS_PORT_LS_RX_DETECT) { | ||
906 | dev_dbg(&hub->ports[port1 - 1]->dev, | ||
907 | "Not disabling port; link state is RxDetect\n"); | ||
908 | return ret; | ||
909 | } | ||
910 | |||
892 | ret = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_SS_DISABLED); | 911 | ret = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_SS_DISABLED); |
893 | if (ret) | 912 | if (ret) |
894 | return ret; | 913 | return ret; |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index b7a506f2bb14..5c660c77f03b 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -426,20 +426,18 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) | |||
426 | * p2m are consistent. | 426 | * p2m are consistent. |
427 | */ | 427 | */ |
428 | if (!xen_feature(XENFEAT_auto_translated_physmap)) { | 428 | if (!xen_feature(XENFEAT_auto_translated_physmap)) { |
429 | unsigned long p; | ||
430 | struct page *scratch_page = get_balloon_scratch_page(); | ||
431 | |||
432 | if (!PageHighMem(page)) { | 429 | if (!PageHighMem(page)) { |
430 | struct page *scratch_page = get_balloon_scratch_page(); | ||
431 | |||
433 | ret = HYPERVISOR_update_va_mapping( | 432 | ret = HYPERVISOR_update_va_mapping( |
434 | (unsigned long)__va(pfn << PAGE_SHIFT), | 433 | (unsigned long)__va(pfn << PAGE_SHIFT), |
435 | pfn_pte(page_to_pfn(scratch_page), | 434 | pfn_pte(page_to_pfn(scratch_page), |
436 | PAGE_KERNEL_RO), 0); | 435 | PAGE_KERNEL_RO), 0); |
437 | BUG_ON(ret); | 436 | BUG_ON(ret); |
438 | } | ||
439 | p = page_to_pfn(scratch_page); | ||
440 | __set_phys_to_machine(pfn, pfn_to_mfn(p)); | ||
441 | 437 | ||
442 | put_balloon_scratch_page(); | 438 | put_balloon_scratch_page(); |
439 | } | ||
440 | __set_phys_to_machine(pfn, INVALID_P2M_ENTRY); | ||
443 | } | 441 | } |
444 | #endif | 442 | #endif |
445 | 443 | ||
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index c3667b202f2f..5f1e1f3cd186 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -88,7 +88,6 @@ static int xen_suspend(void *data) | |||
88 | 88 | ||
89 | if (!si->cancelled) { | 89 | if (!si->cancelled) { |
90 | xen_irq_resume(); | 90 | xen_irq_resume(); |
91 | xen_console_resume(); | ||
92 | xen_timer_resume(); | 91 | xen_timer_resume(); |
93 | } | 92 | } |
94 | 93 | ||
@@ -135,6 +134,10 @@ static void do_suspend(void) | |||
135 | 134 | ||
136 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); | 135 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); |
137 | 136 | ||
137 | /* Resume console as early as possible. */ | ||
138 | if (!si.cancelled) | ||
139 | xen_console_resume(); | ||
140 | |||
138 | raw_notifier_call_chain(&xen_resume_notifier, 0, NULL); | 141 | raw_notifier_call_chain(&xen_resume_notifier, 0, NULL); |
139 | 142 | ||
140 | dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE); | 143 | dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE); |