diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-07-20 03:42:59 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-07-20 03:42:59 -0400 |
commit | 9ff561fdf73493d757bbc74aa58627e1381650fb (patch) | |
tree | 4484d230662126b1ac94ea545ca5429c91e0a68b /drivers | |
parent | 7b98cf0cf4e8798b9e7435f966ed0d90a2a925de (diff) | |
parent | fdd85ec3eb8cc1b663678a3efa16ee59a32e0277 (diff) |
Merge branch 'common/pinctrl' into sh-latest
Diffstat (limited to 'drivers')
286 files changed, 2502 insertions, 1332 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index a43fa1a57d57..1502c50273b5 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" | 36 | #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" |
37 | #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 | 37 | #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 |
38 | static DEFINE_MUTEX(isolated_cpus_lock); | 38 | static DEFINE_MUTEX(isolated_cpus_lock); |
39 | static DEFINE_MUTEX(round_robin_lock); | ||
39 | 40 | ||
40 | static unsigned long power_saving_mwait_eax; | 41 | static unsigned long power_saving_mwait_eax; |
41 | 42 | ||
@@ -107,7 +108,7 @@ static void round_robin_cpu(unsigned int tsk_index) | |||
107 | if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) | 108 | if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) |
108 | return; | 109 | return; |
109 | 110 | ||
110 | mutex_lock(&isolated_cpus_lock); | 111 | mutex_lock(&round_robin_lock); |
111 | cpumask_clear(tmp); | 112 | cpumask_clear(tmp); |
112 | for_each_cpu(cpu, pad_busy_cpus) | 113 | for_each_cpu(cpu, pad_busy_cpus) |
113 | cpumask_or(tmp, tmp, topology_thread_cpumask(cpu)); | 114 | cpumask_or(tmp, tmp, topology_thread_cpumask(cpu)); |
@@ -116,7 +117,7 @@ static void round_robin_cpu(unsigned int tsk_index) | |||
116 | if (cpumask_empty(tmp)) | 117 | if (cpumask_empty(tmp)) |
117 | cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); | 118 | cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); |
118 | if (cpumask_empty(tmp)) { | 119 | if (cpumask_empty(tmp)) { |
119 | mutex_unlock(&isolated_cpus_lock); | 120 | mutex_unlock(&round_robin_lock); |
120 | return; | 121 | return; |
121 | } | 122 | } |
122 | for_each_cpu(cpu, tmp) { | 123 | for_each_cpu(cpu, tmp) { |
@@ -131,7 +132,7 @@ static void round_robin_cpu(unsigned int tsk_index) | |||
131 | tsk_in_cpu[tsk_index] = preferred_cpu; | 132 | tsk_in_cpu[tsk_index] = preferred_cpu; |
132 | cpumask_set_cpu(preferred_cpu, pad_busy_cpus); | 133 | cpumask_set_cpu(preferred_cpu, pad_busy_cpus); |
133 | cpu_weight[preferred_cpu]++; | 134 | cpu_weight[preferred_cpu]++; |
134 | mutex_unlock(&isolated_cpus_lock); | 135 | mutex_unlock(&round_robin_lock); |
135 | 136 | ||
136 | set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); | 137 | set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); |
137 | } | 138 | } |
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 5577762daee1..6686b1eaf13e 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c | |||
@@ -243,7 +243,7 @@ static int pre_map_gar_callback(struct apei_exec_context *ctx, | |||
243 | u8 ins = entry->instruction; | 243 | u8 ins = entry->instruction; |
244 | 244 | ||
245 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) | 245 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) |
246 | return acpi_os_map_generic_address(&entry->register_region); | 246 | return apei_map_generic_address(&entry->register_region); |
247 | 247 | ||
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
@@ -276,7 +276,7 @@ static int post_unmap_gar_callback(struct apei_exec_context *ctx, | |||
276 | u8 ins = entry->instruction; | 276 | u8 ins = entry->instruction; |
277 | 277 | ||
278 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) | 278 | if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) |
279 | acpi_os_unmap_generic_address(&entry->register_region); | 279 | apei_unmap_generic_address(&entry->register_region); |
280 | 280 | ||
281 | return 0; | 281 | return 0; |
282 | } | 282 | } |
@@ -606,6 +606,19 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr, | |||
606 | return 0; | 606 | return 0; |
607 | } | 607 | } |
608 | 608 | ||
609 | int apei_map_generic_address(struct acpi_generic_address *reg) | ||
610 | { | ||
611 | int rc; | ||
612 | u32 access_bit_width; | ||
613 | u64 address; | ||
614 | |||
615 | rc = apei_check_gar(reg, &address, &access_bit_width); | ||
616 | if (rc) | ||
617 | return rc; | ||
618 | return acpi_os_map_generic_address(reg); | ||
619 | } | ||
620 | EXPORT_SYMBOL_GPL(apei_map_generic_address); | ||
621 | |||
609 | /* read GAR in interrupt (including NMI) or process context */ | 622 | /* read GAR in interrupt (including NMI) or process context */ |
610 | int apei_read(u64 *val, struct acpi_generic_address *reg) | 623 | int apei_read(u64 *val, struct acpi_generic_address *reg) |
611 | { | 624 | { |
diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h index cca240a33038..f220d642136e 100644 --- a/drivers/acpi/apei/apei-internal.h +++ b/drivers/acpi/apei/apei-internal.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #define APEI_INTERNAL_H | 7 | #define APEI_INTERNAL_H |
8 | 8 | ||
9 | #include <linux/cper.h> | 9 | #include <linux/cper.h> |
10 | #include <linux/acpi.h> | ||
11 | #include <linux/acpi_io.h> | ||
10 | 12 | ||
11 | struct apei_exec_context; | 13 | struct apei_exec_context; |
12 | 14 | ||
@@ -68,6 +70,13 @@ static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 actio | |||
68 | /* IP has been set in instruction function */ | 70 | /* IP has been set in instruction function */ |
69 | #define APEI_EXEC_SET_IP 1 | 71 | #define APEI_EXEC_SET_IP 1 |
70 | 72 | ||
73 | int apei_map_generic_address(struct acpi_generic_address *reg); | ||
74 | |||
75 | static inline void apei_unmap_generic_address(struct acpi_generic_address *reg) | ||
76 | { | ||
77 | acpi_os_unmap_generic_address(reg); | ||
78 | } | ||
79 | |||
71 | int apei_read(u64 *val, struct acpi_generic_address *reg); | 80 | int apei_read(u64 *val, struct acpi_generic_address *reg); |
72 | int apei_write(u64 val, struct acpi_generic_address *reg); | 81 | int apei_write(u64 val, struct acpi_generic_address *reg); |
73 | 82 | ||
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 9b3cac0abecc..1599566ed1fe 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
@@ -301,7 +301,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic) | |||
301 | if (!ghes) | 301 | if (!ghes) |
302 | return ERR_PTR(-ENOMEM); | 302 | return ERR_PTR(-ENOMEM); |
303 | ghes->generic = generic; | 303 | ghes->generic = generic; |
304 | rc = acpi_os_map_generic_address(&generic->error_status_address); | 304 | rc = apei_map_generic_address(&generic->error_status_address); |
305 | if (rc) | 305 | if (rc) |
306 | goto err_free; | 306 | goto err_free; |
307 | error_block_length = generic->error_block_length; | 307 | error_block_length = generic->error_block_length; |
@@ -321,7 +321,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic) | |||
321 | return ghes; | 321 | return ghes; |
322 | 322 | ||
323 | err_unmap: | 323 | err_unmap: |
324 | acpi_os_unmap_generic_address(&generic->error_status_address); | 324 | apei_unmap_generic_address(&generic->error_status_address); |
325 | err_free: | 325 | err_free: |
326 | kfree(ghes); | 326 | kfree(ghes); |
327 | return ERR_PTR(rc); | 327 | return ERR_PTR(rc); |
@@ -330,7 +330,7 @@ err_free: | |||
330 | static void ghes_fini(struct ghes *ghes) | 330 | static void ghes_fini(struct ghes *ghes) |
331 | { | 331 | { |
332 | kfree(ghes->estatus); | 332 | kfree(ghes->estatus); |
333 | acpi_os_unmap_generic_address(&ghes->generic->error_status_address); | 333 | apei_unmap_generic_address(&ghes->generic->error_status_address); |
334 | } | 334 | } |
335 | 335 | ||
336 | enum { | 336 | enum { |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f3decb30223f..47a8caa89dbe 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -224,6 +224,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, | |||
224 | /* | 224 | /* |
225 | * Suspend / resume control | 225 | * Suspend / resume control |
226 | */ | 226 | */ |
227 | static int acpi_idle_suspend; | ||
227 | static u32 saved_bm_rld; | 228 | static u32 saved_bm_rld; |
228 | 229 | ||
229 | static void acpi_idle_bm_rld_save(void) | 230 | static void acpi_idle_bm_rld_save(void) |
@@ -242,13 +243,21 @@ static void acpi_idle_bm_rld_restore(void) | |||
242 | 243 | ||
243 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) | 244 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) |
244 | { | 245 | { |
246 | if (acpi_idle_suspend == 1) | ||
247 | return 0; | ||
248 | |||
245 | acpi_idle_bm_rld_save(); | 249 | acpi_idle_bm_rld_save(); |
250 | acpi_idle_suspend = 1; | ||
246 | return 0; | 251 | return 0; |
247 | } | 252 | } |
248 | 253 | ||
249 | int acpi_processor_resume(struct acpi_device * device) | 254 | int acpi_processor_resume(struct acpi_device * device) |
250 | { | 255 | { |
256 | if (acpi_idle_suspend == 0) | ||
257 | return 0; | ||
258 | |||
251 | acpi_idle_bm_rld_restore(); | 259 | acpi_idle_bm_rld_restore(); |
260 | acpi_idle_suspend = 0; | ||
252 | return 0; | 261 | return 0; |
253 | } | 262 | } |
254 | 263 | ||
@@ -754,6 +763,12 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
754 | 763 | ||
755 | local_irq_disable(); | 764 | local_irq_disable(); |
756 | 765 | ||
766 | if (acpi_idle_suspend) { | ||
767 | local_irq_enable(); | ||
768 | cpu_relax(); | ||
769 | return -EBUSY; | ||
770 | } | ||
771 | |||
757 | lapic_timer_state_broadcast(pr, cx, 1); | 772 | lapic_timer_state_broadcast(pr, cx, 1); |
758 | kt1 = ktime_get_real(); | 773 | kt1 = ktime_get_real(); |
759 | acpi_idle_do_entry(cx); | 774 | acpi_idle_do_entry(cx); |
@@ -823,6 +838,12 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
823 | 838 | ||
824 | local_irq_disable(); | 839 | local_irq_disable(); |
825 | 840 | ||
841 | if (acpi_idle_suspend) { | ||
842 | local_irq_enable(); | ||
843 | cpu_relax(); | ||
844 | return -EBUSY; | ||
845 | } | ||
846 | |||
826 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 847 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
827 | current_thread_info()->status &= ~TS_POLLING; | 848 | current_thread_info()->status &= ~TS_POLLING; |
828 | /* | 849 | /* |
@@ -907,14 +928,21 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
907 | drv, drv->safe_state_index); | 928 | drv, drv->safe_state_index); |
908 | } else { | 929 | } else { |
909 | local_irq_disable(); | 930 | local_irq_disable(); |
910 | acpi_safe_halt(); | 931 | if (!acpi_idle_suspend) |
932 | acpi_safe_halt(); | ||
911 | local_irq_enable(); | 933 | local_irq_enable(); |
912 | return -EINVAL; | 934 | return -EBUSY; |
913 | } | 935 | } |
914 | } | 936 | } |
915 | 937 | ||
916 | local_irq_disable(); | 938 | local_irq_disable(); |
917 | 939 | ||
940 | if (acpi_idle_suspend) { | ||
941 | local_irq_enable(); | ||
942 | cpu_relax(); | ||
943 | return -EBUSY; | ||
944 | } | ||
945 | |||
918 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 946 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
919 | current_thread_info()->status &= ~TS_POLLING; | 947 | current_thread_info()->status &= ~TS_POLLING; |
920 | /* | 948 | /* |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 9f66181c814e..240a24400976 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) | |||
173 | { | 173 | { |
174 | int result = 0; | 174 | int result = 0; |
175 | 175 | ||
176 | if (!strncmp(val, "enable", strlen("enable") - 1)) { | 176 | if (!strncmp(val, "enable", strlen("enable"))) { |
177 | result = acpi_debug_trace(trace_method_name, trace_debug_level, | 177 | result = acpi_debug_trace(trace_method_name, trace_debug_level, |
178 | trace_debug_layer, 0); | 178 | trace_debug_layer, 0); |
179 | if (result) | 179 | if (result) |
@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) | |||
181 | goto exit; | 181 | goto exit; |
182 | } | 182 | } |
183 | 183 | ||
184 | if (!strncmp(val, "disable", strlen("disable") - 1)) { | 184 | if (!strncmp(val, "disable", strlen("disable"))) { |
185 | int name = 0; | 185 | int name = 0; |
186 | result = acpi_debug_trace((char *)&name, trace_debug_level, | 186 | result = acpi_debug_trace((char *)&name, trace_debug_level, |
187 | trace_debug_layer, 0); | 187 | trace_debug_layer, 0); |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index a576575617d7..1e0a9e17c31d 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -558,6 +558,8 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) | |||
558 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; | 558 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; |
559 | struct acpi_object_list args = { 1, &arg0 }; | 559 | struct acpi_object_list args = { 1, &arg0 }; |
560 | 560 | ||
561 | if (!video->cap._DOS) | ||
562 | return 0; | ||
561 | 563 | ||
562 | if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) | 564 | if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) |
563 | return -EINVAL; | 565 | return -EINVAL; |
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index 3239517f4d90..ac6a5beb28f3 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Arasan Compact Flash host controller source file | 4 | * Arasan Compact Flash host controller source file |
5 | * | 5 | * |
6 | * Copyright (C) 2011 ST Microelectronics | 6 | * Copyright (C) 2011 ST Microelectronics |
7 | * Viresh Kumar <viresh.kumar@st.com> | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
@@ -959,7 +959,7 @@ static struct platform_driver arasan_cf_driver = { | |||
959 | 959 | ||
960 | module_platform_driver(arasan_cf_driver); | 960 | module_platform_driver(arasan_cf_driver); |
961 | 961 | ||
962 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 962 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
963 | MODULE_DESCRIPTION("Arasan ATA Compact Flash driver"); | 963 | MODULE_DESCRIPTION("Arasan ATA Compact Flash driver"); |
964 | MODULE_LICENSE("GPL"); | 964 | MODULE_LICENSE("GPL"); |
965 | MODULE_ALIAS("platform:" DRIVER_NAME); | 965 | MODULE_ALIAS("platform:" DRIVER_NAME); |
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 1b1cbb571d38..dcb8a6e48692 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -100,7 +100,7 @@ static void driver_deferred_probe_add(struct device *dev) | |||
100 | mutex_lock(&deferred_probe_mutex); | 100 | mutex_lock(&deferred_probe_mutex); |
101 | if (list_empty(&dev->p->deferred_probe)) { | 101 | if (list_empty(&dev->p->deferred_probe)) { |
102 | dev_dbg(dev, "Added to deferred list\n"); | 102 | dev_dbg(dev, "Added to deferred list\n"); |
103 | list_add(&dev->p->deferred_probe, &deferred_probe_pending_list); | 103 | list_add_tail(&dev->p->deferred_probe, &deferred_probe_pending_list); |
104 | } | 104 | } |
105 | mutex_unlock(&deferred_probe_mutex); | 105 | mutex_unlock(&deferred_probe_mutex); |
106 | } | 106 | } |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index e0fb5b0435a3..9cb845e49334 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -1031,7 +1031,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) | |||
1031 | dpm_wait_for_children(dev, async); | 1031 | dpm_wait_for_children(dev, async); |
1032 | 1032 | ||
1033 | if (async_error) | 1033 | if (async_error) |
1034 | return 0; | 1034 | goto Complete; |
1035 | 1035 | ||
1036 | pm_runtime_get_noresume(dev); | 1036 | pm_runtime_get_noresume(dev); |
1037 | if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) | 1037 | if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) |
@@ -1040,7 +1040,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) | |||
1040 | if (pm_wakeup_pending()) { | 1040 | if (pm_wakeup_pending()) { |
1041 | pm_runtime_put_sync(dev); | 1041 | pm_runtime_put_sync(dev); |
1042 | async_error = -EBUSY; | 1042 | async_error = -EBUSY; |
1043 | return 0; | 1043 | goto Complete; |
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | device_lock(dev); | 1046 | device_lock(dev); |
@@ -1097,6 +1097,8 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) | |||
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | device_unlock(dev); | 1099 | device_unlock(dev); |
1100 | |||
1101 | Complete: | ||
1100 | complete_all(&dev->power.completion); | 1102 | complete_all(&dev->power.completion); |
1101 | 1103 | ||
1102 | if (error) { | 1104 | if (error) { |
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index b5c5ff53cb57..fcb956bb4b4c 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c | |||
@@ -1475,10 +1475,17 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi | |||
1475 | first_word = 0; | 1475 | first_word = 0; |
1476 | spin_lock_irq(&b->bm_lock); | 1476 | spin_lock_irq(&b->bm_lock); |
1477 | } | 1477 | } |
1478 | |||
1479 | /* last page (respectively only page, for first page == last page) */ | 1478 | /* last page (respectively only page, for first page == last page) */ |
1480 | last_word = MLPP(el >> LN2_BPL); | 1479 | last_word = MLPP(el >> LN2_BPL); |
1481 | bm_set_full_words_within_one_page(mdev->bitmap, last_page, first_word, last_word); | 1480 | |
1481 | /* consider bitmap->bm_bits = 32768, bitmap->bm_number_of_pages = 1. (or multiples). | ||
1482 | * ==> e = 32767, el = 32768, last_page = 2, | ||
1483 | * and now last_word = 0. | ||
1484 | * We do not want to touch last_page in this case, | ||
1485 | * as we did not allocate it, it is not present in bitmap->bm_pages. | ||
1486 | */ | ||
1487 | if (last_word) | ||
1488 | bm_set_full_words_within_one_page(mdev->bitmap, last_page, first_word, last_word); | ||
1482 | 1489 | ||
1483 | /* possibly trailing bits. | 1490 | /* possibly trailing bits. |
1484 | * example: (e & 63) == 63, el will be e+1. | 1491 | * example: (e & 63) == 63, el will be e+1. |
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 9c5c84946b05..8e93a6ac9bb6 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -472,12 +472,17 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, | |||
472 | req->rq_state |= RQ_LOCAL_COMPLETED; | 472 | req->rq_state |= RQ_LOCAL_COMPLETED; |
473 | req->rq_state &= ~RQ_LOCAL_PENDING; | 473 | req->rq_state &= ~RQ_LOCAL_PENDING; |
474 | 474 | ||
475 | D_ASSERT(!(req->rq_state & RQ_NET_MASK)); | 475 | if (req->rq_state & RQ_LOCAL_ABORTED) { |
476 | _req_may_be_done(req, m); | ||
477 | break; | ||
478 | } | ||
476 | 479 | ||
477 | __drbd_chk_io_error(mdev, false); | 480 | __drbd_chk_io_error(mdev, false); |
478 | 481 | ||
479 | goto_queue_for_net_read: | 482 | goto_queue_for_net_read: |
480 | 483 | ||
484 | D_ASSERT(!(req->rq_state & RQ_NET_MASK)); | ||
485 | |||
481 | /* no point in retrying if there is no good remote data, | 486 | /* no point in retrying if there is no good remote data, |
482 | * or we have no connection. */ | 487 | * or we have no connection. */ |
483 | if (mdev->state.pdsk != D_UP_TO_DATE) { | 488 | if (mdev->state.pdsk != D_UP_TO_DATE) { |
@@ -765,6 +770,40 @@ static int drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int s | |||
765 | return 0 == drbd_bm_count_bits(mdev, sbnr, ebnr); | 770 | return 0 == drbd_bm_count_bits(mdev, sbnr, ebnr); |
766 | } | 771 | } |
767 | 772 | ||
773 | static void maybe_pull_ahead(struct drbd_conf *mdev) | ||
774 | { | ||
775 | int congested = 0; | ||
776 | |||
777 | /* If I don't even have good local storage, we can not reasonably try | ||
778 | * to pull ahead of the peer. We also need the local reference to make | ||
779 | * sure mdev->act_log is there. | ||
780 | * Note: caller has to make sure that net_conf is there. | ||
781 | */ | ||
782 | if (!get_ldev_if_state(mdev, D_UP_TO_DATE)) | ||
783 | return; | ||
784 | |||
785 | if (mdev->net_conf->cong_fill && | ||
786 | atomic_read(&mdev->ap_in_flight) >= mdev->net_conf->cong_fill) { | ||
787 | dev_info(DEV, "Congestion-fill threshold reached\n"); | ||
788 | congested = 1; | ||
789 | } | ||
790 | |||
791 | if (mdev->act_log->used >= mdev->net_conf->cong_extents) { | ||
792 | dev_info(DEV, "Congestion-extents threshold reached\n"); | ||
793 | congested = 1; | ||
794 | } | ||
795 | |||
796 | if (congested) { | ||
797 | queue_barrier(mdev); /* last barrier, after mirrored writes */ | ||
798 | |||
799 | if (mdev->net_conf->on_congestion == OC_PULL_AHEAD) | ||
800 | _drbd_set_state(_NS(mdev, conn, C_AHEAD), 0, NULL); | ||
801 | else /*mdev->net_conf->on_congestion == OC_DISCONNECT */ | ||
802 | _drbd_set_state(_NS(mdev, conn, C_DISCONNECTING), 0, NULL); | ||
803 | } | ||
804 | put_ldev(mdev); | ||
805 | } | ||
806 | |||
768 | static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, unsigned long start_time) | 807 | static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, unsigned long start_time) |
769 | { | 808 | { |
770 | const int rw = bio_rw(bio); | 809 | const int rw = bio_rw(bio); |
@@ -972,29 +1011,8 @@ allocate_barrier: | |||
972 | _req_mod(req, queue_for_send_oos); | 1011 | _req_mod(req, queue_for_send_oos); |
973 | 1012 | ||
974 | if (remote && | 1013 | if (remote && |
975 | mdev->net_conf->on_congestion != OC_BLOCK && mdev->agreed_pro_version >= 96) { | 1014 | mdev->net_conf->on_congestion != OC_BLOCK && mdev->agreed_pro_version >= 96) |
976 | int congested = 0; | 1015 | maybe_pull_ahead(mdev); |
977 | |||
978 | if (mdev->net_conf->cong_fill && | ||
979 | atomic_read(&mdev->ap_in_flight) >= mdev->net_conf->cong_fill) { | ||
980 | dev_info(DEV, "Congestion-fill threshold reached\n"); | ||
981 | congested = 1; | ||
982 | } | ||
983 | |||
984 | if (mdev->act_log->used >= mdev->net_conf->cong_extents) { | ||
985 | dev_info(DEV, "Congestion-extents threshold reached\n"); | ||
986 | congested = 1; | ||
987 | } | ||
988 | |||
989 | if (congested) { | ||
990 | queue_barrier(mdev); /* last barrier, after mirrored writes */ | ||
991 | |||
992 | if (mdev->net_conf->on_congestion == OC_PULL_AHEAD) | ||
993 | _drbd_set_state(_NS(mdev, conn, C_AHEAD), 0, NULL); | ||
994 | else /*mdev->net_conf->on_congestion == OC_DISCONNECT */ | ||
995 | _drbd_set_state(_NS(mdev, conn, C_DISCONNECTING), 0, NULL); | ||
996 | } | ||
997 | } | ||
998 | 1016 | ||
999 | spin_unlock_irq(&mdev->req_lock); | 1017 | spin_unlock_irq(&mdev->req_lock); |
1000 | kfree(b); /* if someone else has beaten us to it... */ | 1018 | kfree(b); /* if someone else has beaten us to it... */ |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index cce7df367b79..553f43a90953 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -671,6 +671,7 @@ static void __reschedule_timeout(int drive, const char *message) | |||
671 | 671 | ||
672 | if (drive == current_reqD) | 672 | if (drive == current_reqD) |
673 | drive = current_drive; | 673 | drive = current_drive; |
674 | __cancel_delayed_work(&fd_timeout); | ||
674 | 675 | ||
675 | if (drive < 0 || drive >= N_DRIVE) { | 676 | if (drive < 0 || drive >= N_DRIVE) { |
676 | delay = 20UL * HZ; | 677 | delay = 20UL * HZ; |
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 264bc77dcb91..a8fddeb3d638 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/kthread.h> | 37 | #include <linux/kthread.h> |
38 | #include <../drivers/ata/ahci.h> | 38 | #include <../drivers/ata/ahci.h> |
39 | #include <linux/export.h> | 39 | #include <linux/export.h> |
40 | #include <linux/debugfs.h> | ||
40 | #include "mtip32xx.h" | 41 | #include "mtip32xx.h" |
41 | 42 | ||
42 | #define HW_CMD_SLOT_SZ (MTIP_MAX_COMMAND_SLOTS * 32) | 43 | #define HW_CMD_SLOT_SZ (MTIP_MAX_COMMAND_SLOTS * 32) |
@@ -85,6 +86,7 @@ static int instance; | |||
85 | * allocated in mtip_init(). | 86 | * allocated in mtip_init(). |
86 | */ | 87 | */ |
87 | static int mtip_major; | 88 | static int mtip_major; |
89 | static struct dentry *dfs_parent; | ||
88 | 90 | ||
89 | static DEFINE_SPINLOCK(rssd_index_lock); | 91 | static DEFINE_SPINLOCK(rssd_index_lock); |
90 | static DEFINE_IDA(rssd_index_ida); | 92 | static DEFINE_IDA(rssd_index_ida); |
@@ -2546,7 +2548,7 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd, | |||
2546 | } | 2548 | } |
2547 | 2549 | ||
2548 | /* | 2550 | /* |
2549 | * Sysfs register/status dump. | 2551 | * Sysfs status dump. |
2550 | * | 2552 | * |
2551 | * @dev Pointer to the device structure, passed by the kernrel. | 2553 | * @dev Pointer to the device structure, passed by the kernrel. |
2552 | * @attr Pointer to the device_attribute structure passed by the kernel. | 2554 | * @attr Pointer to the device_attribute structure passed by the kernel. |
@@ -2555,45 +2557,68 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd, | |||
2555 | * return value | 2557 | * return value |
2556 | * The size, in bytes, of the data copied into buf. | 2558 | * The size, in bytes, of the data copied into buf. |
2557 | */ | 2559 | */ |
2558 | static ssize_t mtip_hw_show_registers(struct device *dev, | 2560 | static ssize_t mtip_hw_show_status(struct device *dev, |
2559 | struct device_attribute *attr, | 2561 | struct device_attribute *attr, |
2560 | char *buf) | 2562 | char *buf) |
2561 | { | 2563 | { |
2562 | u32 group_allocated; | ||
2563 | struct driver_data *dd = dev_to_disk(dev)->private_data; | 2564 | struct driver_data *dd = dev_to_disk(dev)->private_data; |
2564 | int size = 0; | 2565 | int size = 0; |
2566 | |||
2567 | if (test_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag)) | ||
2568 | size += sprintf(buf, "%s", "thermal_shutdown\n"); | ||
2569 | else if (test_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag)) | ||
2570 | size += sprintf(buf, "%s", "write_protect\n"); | ||
2571 | else | ||
2572 | size += sprintf(buf, "%s", "online\n"); | ||
2573 | |||
2574 | return size; | ||
2575 | } | ||
2576 | |||
2577 | static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL); | ||
2578 | |||
2579 | static ssize_t mtip_hw_read_registers(struct file *f, char __user *ubuf, | ||
2580 | size_t len, loff_t *offset) | ||
2581 | { | ||
2582 | struct driver_data *dd = (struct driver_data *)f->private_data; | ||
2583 | char buf[MTIP_DFS_MAX_BUF_SIZE]; | ||
2584 | u32 group_allocated; | ||
2585 | int size = *offset; | ||
2565 | int n; | 2586 | int n; |
2566 | 2587 | ||
2567 | size += sprintf(&buf[size], "Hardware\n--------\n"); | 2588 | if (!len || size) |
2568 | size += sprintf(&buf[size], "S ACTive : [ 0x"); | 2589 | return 0; |
2590 | |||
2591 | if (size < 0) | ||
2592 | return -EINVAL; | ||
2593 | |||
2594 | size += sprintf(&buf[size], "H/ S ACTive : [ 0x"); | ||
2569 | 2595 | ||
2570 | for (n = dd->slot_groups-1; n >= 0; n--) | 2596 | for (n = dd->slot_groups-1; n >= 0; n--) |
2571 | size += sprintf(&buf[size], "%08X ", | 2597 | size += sprintf(&buf[size], "%08X ", |
2572 | readl(dd->port->s_active[n])); | 2598 | readl(dd->port->s_active[n])); |
2573 | 2599 | ||
2574 | size += sprintf(&buf[size], "]\n"); | 2600 | size += sprintf(&buf[size], "]\n"); |
2575 | size += sprintf(&buf[size], "Command Issue : [ 0x"); | 2601 | size += sprintf(&buf[size], "H/ Command Issue : [ 0x"); |
2576 | 2602 | ||
2577 | for (n = dd->slot_groups-1; n >= 0; n--) | 2603 | for (n = dd->slot_groups-1; n >= 0; n--) |
2578 | size += sprintf(&buf[size], "%08X ", | 2604 | size += sprintf(&buf[size], "%08X ", |
2579 | readl(dd->port->cmd_issue[n])); | 2605 | readl(dd->port->cmd_issue[n])); |
2580 | 2606 | ||
2581 | size += sprintf(&buf[size], "]\n"); | 2607 | size += sprintf(&buf[size], "]\n"); |
2582 | size += sprintf(&buf[size], "Completed : [ 0x"); | 2608 | size += sprintf(&buf[size], "H/ Completed : [ 0x"); |
2583 | 2609 | ||
2584 | for (n = dd->slot_groups-1; n >= 0; n--) | 2610 | for (n = dd->slot_groups-1; n >= 0; n--) |
2585 | size += sprintf(&buf[size], "%08X ", | 2611 | size += sprintf(&buf[size], "%08X ", |
2586 | readl(dd->port->completed[n])); | 2612 | readl(dd->port->completed[n])); |
2587 | 2613 | ||
2588 | size += sprintf(&buf[size], "]\n"); | 2614 | size += sprintf(&buf[size], "]\n"); |
2589 | size += sprintf(&buf[size], "PORT IRQ STAT : [ 0x%08X ]\n", | 2615 | size += sprintf(&buf[size], "H/ PORT IRQ STAT : [ 0x%08X ]\n", |
2590 | readl(dd->port->mmio + PORT_IRQ_STAT)); | 2616 | readl(dd->port->mmio + PORT_IRQ_STAT)); |
2591 | size += sprintf(&buf[size], "HOST IRQ STAT : [ 0x%08X ]\n", | 2617 | size += sprintf(&buf[size], "H/ HOST IRQ STAT : [ 0x%08X ]\n", |
2592 | readl(dd->mmio + HOST_IRQ_STAT)); | 2618 | readl(dd->mmio + HOST_IRQ_STAT)); |
2593 | size += sprintf(&buf[size], "\n"); | 2619 | size += sprintf(&buf[size], "\n"); |
2594 | 2620 | ||
2595 | size += sprintf(&buf[size], "Local\n-----\n"); | 2621 | size += sprintf(&buf[size], "L/ Allocated : [ 0x"); |
2596 | size += sprintf(&buf[size], "Allocated : [ 0x"); | ||
2597 | 2622 | ||
2598 | for (n = dd->slot_groups-1; n >= 0; n--) { | 2623 | for (n = dd->slot_groups-1; n >= 0; n--) { |
2599 | if (sizeof(long) > sizeof(u32)) | 2624 | if (sizeof(long) > sizeof(u32)) |
@@ -2605,7 +2630,7 @@ static ssize_t mtip_hw_show_registers(struct device *dev, | |||
2605 | } | 2630 | } |
2606 | size += sprintf(&buf[size], "]\n"); | 2631 | size += sprintf(&buf[size], "]\n"); |
2607 | 2632 | ||
2608 | size += sprintf(&buf[size], "Commands in Q: [ 0x"); | 2633 | size += sprintf(&buf[size], "L/ Commands in Q : [ 0x"); |
2609 | 2634 | ||
2610 | for (n = dd->slot_groups-1; n >= 0; n--) { | 2635 | for (n = dd->slot_groups-1; n >= 0; n--) { |
2611 | if (sizeof(long) > sizeof(u32)) | 2636 | if (sizeof(long) > sizeof(u32)) |
@@ -2617,44 +2642,53 @@ static ssize_t mtip_hw_show_registers(struct device *dev, | |||
2617 | } | 2642 | } |
2618 | size += sprintf(&buf[size], "]\n"); | 2643 | size += sprintf(&buf[size], "]\n"); |
2619 | 2644 | ||
2620 | return size; | 2645 | *offset = size <= len ? size : len; |
2646 | size = copy_to_user(ubuf, buf, *offset); | ||
2647 | if (size) | ||
2648 | return -EFAULT; | ||
2649 | |||
2650 | return *offset; | ||
2621 | } | 2651 | } |
2622 | 2652 | ||
2623 | static ssize_t mtip_hw_show_status(struct device *dev, | 2653 | static ssize_t mtip_hw_read_flags(struct file *f, char __user *ubuf, |
2624 | struct device_attribute *attr, | 2654 | size_t len, loff_t *offset) |
2625 | char *buf) | ||
2626 | { | 2655 | { |
2627 | struct driver_data *dd = dev_to_disk(dev)->private_data; | 2656 | struct driver_data *dd = (struct driver_data *)f->private_data; |
2628 | int size = 0; | 2657 | char buf[MTIP_DFS_MAX_BUF_SIZE]; |
2658 | int size = *offset; | ||
2629 | 2659 | ||
2630 | if (test_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag)) | 2660 | if (!len || size) |
2631 | size += sprintf(buf, "%s", "thermal_shutdown\n"); | 2661 | return 0; |
2632 | else if (test_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag)) | ||
2633 | size += sprintf(buf, "%s", "write_protect\n"); | ||
2634 | else | ||
2635 | size += sprintf(buf, "%s", "online\n"); | ||
2636 | |||
2637 | return size; | ||
2638 | } | ||
2639 | 2662 | ||
2640 | static ssize_t mtip_hw_show_flags(struct device *dev, | 2663 | if (size < 0) |
2641 | struct device_attribute *attr, | 2664 | return -EINVAL; |
2642 | char *buf) | ||
2643 | { | ||
2644 | struct driver_data *dd = dev_to_disk(dev)->private_data; | ||
2645 | int size = 0; | ||
2646 | 2665 | ||
2647 | size += sprintf(&buf[size], "Flag in port struct : [ %08lX ]\n", | 2666 | size += sprintf(&buf[size], "Flag-port : [ %08lX ]\n", |
2648 | dd->port->flags); | 2667 | dd->port->flags); |
2649 | size += sprintf(&buf[size], "Flag in dd struct : [ %08lX ]\n", | 2668 | size += sprintf(&buf[size], "Flag-dd : [ %08lX ]\n", |
2650 | dd->dd_flag); | 2669 | dd->dd_flag); |
2651 | 2670 | ||
2652 | return size; | 2671 | *offset = size <= len ? size : len; |
2672 | size = copy_to_user(ubuf, buf, *offset); | ||
2673 | if (size) | ||
2674 | return -EFAULT; | ||
2675 | |||
2676 | return *offset; | ||
2653 | } | 2677 | } |
2654 | 2678 | ||
2655 | static DEVICE_ATTR(registers, S_IRUGO, mtip_hw_show_registers, NULL); | 2679 | static const struct file_operations mtip_regs_fops = { |
2656 | static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL); | 2680 | .owner = THIS_MODULE, |
2657 | static DEVICE_ATTR(flags, S_IRUGO, mtip_hw_show_flags, NULL); | 2681 | .open = simple_open, |
2682 | .read = mtip_hw_read_registers, | ||
2683 | .llseek = no_llseek, | ||
2684 | }; | ||
2685 | |||
2686 | static const struct file_operations mtip_flags_fops = { | ||
2687 | .owner = THIS_MODULE, | ||
2688 | .open = simple_open, | ||
2689 | .read = mtip_hw_read_flags, | ||
2690 | .llseek = no_llseek, | ||
2691 | }; | ||
2658 | 2692 | ||
2659 | /* | 2693 | /* |
2660 | * Create the sysfs related attributes. | 2694 | * Create the sysfs related attributes. |
@@ -2671,15 +2705,9 @@ static int mtip_hw_sysfs_init(struct driver_data *dd, struct kobject *kobj) | |||
2671 | if (!kobj || !dd) | 2705 | if (!kobj || !dd) |
2672 | return -EINVAL; | 2706 | return -EINVAL; |
2673 | 2707 | ||
2674 | if (sysfs_create_file(kobj, &dev_attr_registers.attr)) | ||
2675 | dev_warn(&dd->pdev->dev, | ||
2676 | "Error creating 'registers' sysfs entry\n"); | ||
2677 | if (sysfs_create_file(kobj, &dev_attr_status.attr)) | 2708 | if (sysfs_create_file(kobj, &dev_attr_status.attr)) |
2678 | dev_warn(&dd->pdev->dev, | 2709 | dev_warn(&dd->pdev->dev, |
2679 | "Error creating 'status' sysfs entry\n"); | 2710 | "Error creating 'status' sysfs entry\n"); |
2680 | if (sysfs_create_file(kobj, &dev_attr_flags.attr)) | ||
2681 | dev_warn(&dd->pdev->dev, | ||
2682 | "Error creating 'flags' sysfs entry\n"); | ||
2683 | return 0; | 2711 | return 0; |
2684 | } | 2712 | } |
2685 | 2713 | ||
@@ -2698,13 +2726,39 @@ static int mtip_hw_sysfs_exit(struct driver_data *dd, struct kobject *kobj) | |||
2698 | if (!kobj || !dd) | 2726 | if (!kobj || !dd) |
2699 | return -EINVAL; | 2727 | return -EINVAL; |
2700 | 2728 | ||
2701 | sysfs_remove_file(kobj, &dev_attr_registers.attr); | ||
2702 | sysfs_remove_file(kobj, &dev_attr_status.attr); | 2729 | sysfs_remove_file(kobj, &dev_attr_status.attr); |
2703 | sysfs_remove_file(kobj, &dev_attr_flags.attr); | ||
2704 | 2730 | ||
2705 | return 0; | 2731 | return 0; |
2706 | } | 2732 | } |
2707 | 2733 | ||
2734 | static int mtip_hw_debugfs_init(struct driver_data *dd) | ||
2735 | { | ||
2736 | if (!dfs_parent) | ||
2737 | return -1; | ||
2738 | |||
2739 | dd->dfs_node = debugfs_create_dir(dd->disk->disk_name, dfs_parent); | ||
2740 | if (IS_ERR_OR_NULL(dd->dfs_node)) { | ||
2741 | dev_warn(&dd->pdev->dev, | ||
2742 | "Error creating node %s under debugfs\n", | ||
2743 | dd->disk->disk_name); | ||
2744 | dd->dfs_node = NULL; | ||
2745 | return -1; | ||
2746 | } | ||
2747 | |||
2748 | debugfs_create_file("flags", S_IRUGO, dd->dfs_node, dd, | ||
2749 | &mtip_flags_fops); | ||
2750 | debugfs_create_file("registers", S_IRUGO, dd->dfs_node, dd, | ||
2751 | &mtip_regs_fops); | ||
2752 | |||
2753 | return 0; | ||
2754 | } | ||
2755 | |||
2756 | static void mtip_hw_debugfs_exit(struct driver_data *dd) | ||
2757 | { | ||
2758 | debugfs_remove_recursive(dd->dfs_node); | ||
2759 | } | ||
2760 | |||
2761 | |||
2708 | /* | 2762 | /* |
2709 | * Perform any init/resume time hardware setup | 2763 | * Perform any init/resume time hardware setup |
2710 | * | 2764 | * |
@@ -3730,6 +3784,7 @@ skip_create_disk: | |||
3730 | mtip_hw_sysfs_init(dd, kobj); | 3784 | mtip_hw_sysfs_init(dd, kobj); |
3731 | kobject_put(kobj); | 3785 | kobject_put(kobj); |
3732 | } | 3786 | } |
3787 | mtip_hw_debugfs_init(dd); | ||
3733 | 3788 | ||
3734 | if (dd->mtip_svc_handler) { | 3789 | if (dd->mtip_svc_handler) { |
3735 | set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag); | 3790 | set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag); |
@@ -3755,6 +3810,8 @@ start_service_thread: | |||
3755 | return rv; | 3810 | return rv; |
3756 | 3811 | ||
3757 | kthread_run_error: | 3812 | kthread_run_error: |
3813 | mtip_hw_debugfs_exit(dd); | ||
3814 | |||
3758 | /* Delete our gendisk. This also removes the device from /dev */ | 3815 | /* Delete our gendisk. This also removes the device from /dev */ |
3759 | del_gendisk(dd->disk); | 3816 | del_gendisk(dd->disk); |
3760 | 3817 | ||
@@ -3805,6 +3862,7 @@ static int mtip_block_remove(struct driver_data *dd) | |||
3805 | kobject_put(kobj); | 3862 | kobject_put(kobj); |
3806 | } | 3863 | } |
3807 | } | 3864 | } |
3865 | mtip_hw_debugfs_exit(dd); | ||
3808 | 3866 | ||
3809 | /* | 3867 | /* |
3810 | * Delete our gendisk structure. This also removes the device | 3868 | * Delete our gendisk structure. This also removes the device |
@@ -4152,10 +4210,20 @@ static int __init mtip_init(void) | |||
4152 | } | 4210 | } |
4153 | mtip_major = error; | 4211 | mtip_major = error; |
4154 | 4212 | ||
4213 | if (!dfs_parent) { | ||
4214 | dfs_parent = debugfs_create_dir("rssd", NULL); | ||
4215 | if (IS_ERR_OR_NULL(dfs_parent)) { | ||
4216 | printk(KERN_WARNING "Error creating debugfs parent\n"); | ||
4217 | dfs_parent = NULL; | ||
4218 | } | ||
4219 | } | ||
4220 | |||
4155 | /* Register our PCI operations. */ | 4221 | /* Register our PCI operations. */ |
4156 | error = pci_register_driver(&mtip_pci_driver); | 4222 | error = pci_register_driver(&mtip_pci_driver); |
4157 | if (error) | 4223 | if (error) { |
4224 | debugfs_remove(dfs_parent); | ||
4158 | unregister_blkdev(mtip_major, MTIP_DRV_NAME); | 4225 | unregister_blkdev(mtip_major, MTIP_DRV_NAME); |
4226 | } | ||
4159 | 4227 | ||
4160 | return error; | 4228 | return error; |
4161 | } | 4229 | } |
@@ -4172,6 +4240,8 @@ static int __init mtip_init(void) | |||
4172 | */ | 4240 | */ |
4173 | static void __exit mtip_exit(void) | 4241 | static void __exit mtip_exit(void) |
4174 | { | 4242 | { |
4243 | debugfs_remove_recursive(dfs_parent); | ||
4244 | |||
4175 | /* Release the allocated major block device number. */ | 4245 | /* Release the allocated major block device number. */ |
4176 | unregister_blkdev(mtip_major, MTIP_DRV_NAME); | 4246 | unregister_blkdev(mtip_major, MTIP_DRV_NAME); |
4177 | 4247 | ||
diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h index b2c88da26b2a..f51fc23d17bb 100644 --- a/drivers/block/mtip32xx/mtip32xx.h +++ b/drivers/block/mtip32xx/mtip32xx.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/ata.h> | 26 | #include <linux/ata.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/genhd.h> | 28 | #include <linux/genhd.h> |
29 | #include <linux/version.h> | ||
30 | 29 | ||
31 | /* Offset of Subsystem Device ID in pci confoguration space */ | 30 | /* Offset of Subsystem Device ID in pci confoguration space */ |
32 | #define PCI_SUBSYSTEM_DEVICEID 0x2E | 31 | #define PCI_SUBSYSTEM_DEVICEID 0x2E |
@@ -111,6 +110,8 @@ | |||
111 | #define dbg_printk(format, arg...) | 110 | #define dbg_printk(format, arg...) |
112 | #endif | 111 | #endif |
113 | 112 | ||
113 | #define MTIP_DFS_MAX_BUF_SIZE 1024 | ||
114 | |||
114 | #define __force_bit2int (unsigned int __force) | 115 | #define __force_bit2int (unsigned int __force) |
115 | 116 | ||
116 | enum { | 117 | enum { |
@@ -447,6 +448,8 @@ struct driver_data { | |||
447 | unsigned long dd_flag; /* NOTE: use atomic bit operations on this */ | 448 | unsigned long dd_flag; /* NOTE: use atomic bit operations on this */ |
448 | 449 | ||
449 | struct task_struct *mtip_svc_handler; /* task_struct of svc thd */ | 450 | struct task_struct *mtip_svc_handler; /* task_struct of svc thd */ |
451 | |||
452 | struct dentry *dfs_node; | ||
450 | }; | 453 | }; |
451 | 454 | ||
452 | #endif | 455 | #endif |
diff --git a/drivers/block/umem.c b/drivers/block/umem.c index aa2712060bfb..9a72277a31df 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c | |||
@@ -513,6 +513,44 @@ static void process_page(unsigned long data) | |||
513 | } | 513 | } |
514 | } | 514 | } |
515 | 515 | ||
516 | struct mm_plug_cb { | ||
517 | struct blk_plug_cb cb; | ||
518 | struct cardinfo *card; | ||
519 | }; | ||
520 | |||
521 | static void mm_unplug(struct blk_plug_cb *cb) | ||
522 | { | ||
523 | struct mm_plug_cb *mmcb = container_of(cb, struct mm_plug_cb, cb); | ||
524 | |||
525 | spin_lock_irq(&mmcb->card->lock); | ||
526 | activate(mmcb->card); | ||
527 | spin_unlock_irq(&mmcb->card->lock); | ||
528 | kfree(mmcb); | ||
529 | } | ||
530 | |||
531 | static int mm_check_plugged(struct cardinfo *card) | ||
532 | { | ||
533 | struct blk_plug *plug = current->plug; | ||
534 | struct mm_plug_cb *mmcb; | ||
535 | |||
536 | if (!plug) | ||
537 | return 0; | ||
538 | |||
539 | list_for_each_entry(mmcb, &plug->cb_list, cb.list) { | ||
540 | if (mmcb->cb.callback == mm_unplug && mmcb->card == card) | ||
541 | return 1; | ||
542 | } | ||
543 | /* Not currently on the callback list */ | ||
544 | mmcb = kmalloc(sizeof(*mmcb), GFP_ATOMIC); | ||
545 | if (!mmcb) | ||
546 | return 0; | ||
547 | |||
548 | mmcb->card = card; | ||
549 | mmcb->cb.callback = mm_unplug; | ||
550 | list_add(&mmcb->cb.list, &plug->cb_list); | ||
551 | return 1; | ||
552 | } | ||
553 | |||
516 | static void mm_make_request(struct request_queue *q, struct bio *bio) | 554 | static void mm_make_request(struct request_queue *q, struct bio *bio) |
517 | { | 555 | { |
518 | struct cardinfo *card = q->queuedata; | 556 | struct cardinfo *card = q->queuedata; |
@@ -523,6 +561,8 @@ static void mm_make_request(struct request_queue *q, struct bio *bio) | |||
523 | *card->biotail = bio; | 561 | *card->biotail = bio; |
524 | bio->bi_next = NULL; | 562 | bio->bi_next = NULL; |
525 | card->biotail = &bio->bi_next; | 563 | card->biotail = &bio->bi_next; |
564 | if (bio->bi_rw & REQ_SYNC || !mm_check_plugged(card)) | ||
565 | activate(card); | ||
526 | spin_unlock_irq(&card->lock); | 566 | spin_unlock_irq(&card->lock); |
527 | 567 | ||
528 | return; | 568 | return; |
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 773cf27dc23f..9ad3b5ec1dc1 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h | |||
@@ -257,6 +257,7 @@ static inline void blkif_get_x86_32_req(struct blkif_request *dst, | |||
257 | break; | 257 | break; |
258 | case BLKIF_OP_DISCARD: | 258 | case BLKIF_OP_DISCARD: |
259 | dst->u.discard.flag = src->u.discard.flag; | 259 | dst->u.discard.flag = src->u.discard.flag; |
260 | dst->u.discard.id = src->u.discard.id; | ||
260 | dst->u.discard.sector_number = src->u.discard.sector_number; | 261 | dst->u.discard.sector_number = src->u.discard.sector_number; |
261 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; | 262 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; |
262 | break; | 263 | break; |
@@ -287,6 +288,7 @@ static inline void blkif_get_x86_64_req(struct blkif_request *dst, | |||
287 | break; | 288 | break; |
288 | case BLKIF_OP_DISCARD: | 289 | case BLKIF_OP_DISCARD: |
289 | dst->u.discard.flag = src->u.discard.flag; | 290 | dst->u.discard.flag = src->u.discard.flag; |
291 | dst->u.discard.id = src->u.discard.id; | ||
290 | dst->u.discard.sector_number = src->u.discard.sector_number; | 292 | dst->u.discard.sector_number = src->u.discard.sector_number; |
291 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; | 293 | dst->u.discard.nr_sectors = src->u.discard.nr_sectors; |
292 | break; | 294 | break; |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 60eed4bdd2e4..e4fb3374dcd2 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -141,14 +141,36 @@ static int get_id_from_freelist(struct blkfront_info *info) | |||
141 | return free; | 141 | return free; |
142 | } | 142 | } |
143 | 143 | ||
144 | static void add_id_to_freelist(struct blkfront_info *info, | 144 | static int add_id_to_freelist(struct blkfront_info *info, |
145 | unsigned long id) | 145 | unsigned long id) |
146 | { | 146 | { |
147 | if (info->shadow[id].req.u.rw.id != id) | ||
148 | return -EINVAL; | ||
149 | if (info->shadow[id].request == NULL) | ||
150 | return -EINVAL; | ||
147 | info->shadow[id].req.u.rw.id = info->shadow_free; | 151 | info->shadow[id].req.u.rw.id = info->shadow_free; |
148 | info->shadow[id].request = NULL; | 152 | info->shadow[id].request = NULL; |
149 | info->shadow_free = id; | 153 | info->shadow_free = id; |
154 | return 0; | ||
150 | } | 155 | } |
151 | 156 | ||
157 | static const char *op_name(int op) | ||
158 | { | ||
159 | static const char *const names[] = { | ||
160 | [BLKIF_OP_READ] = "read", | ||
161 | [BLKIF_OP_WRITE] = "write", | ||
162 | [BLKIF_OP_WRITE_BARRIER] = "barrier", | ||
163 | [BLKIF_OP_FLUSH_DISKCACHE] = "flush", | ||
164 | [BLKIF_OP_DISCARD] = "discard" }; | ||
165 | |||
166 | if (op < 0 || op >= ARRAY_SIZE(names)) | ||
167 | return "unknown"; | ||
168 | |||
169 | if (!names[op]) | ||
170 | return "reserved"; | ||
171 | |||
172 | return names[op]; | ||
173 | } | ||
152 | static int xlbd_reserve_minors(unsigned int minor, unsigned int nr) | 174 | static int xlbd_reserve_minors(unsigned int minor, unsigned int nr) |
153 | { | 175 | { |
154 | unsigned int end = minor + nr; | 176 | unsigned int end = minor + nr; |
@@ -746,20 +768,36 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) | |||
746 | 768 | ||
747 | bret = RING_GET_RESPONSE(&info->ring, i); | 769 | bret = RING_GET_RESPONSE(&info->ring, i); |
748 | id = bret->id; | 770 | id = bret->id; |
771 | /* | ||
772 | * The backend has messed up and given us an id that we would | ||
773 | * never have given to it (we stamp it up to BLK_RING_SIZE - | ||
774 | * look in get_id_from_freelist. | ||
775 | */ | ||
776 | if (id >= BLK_RING_SIZE) { | ||
777 | WARN(1, "%s: response to %s has incorrect id (%ld)\n", | ||
778 | info->gd->disk_name, op_name(bret->operation), id); | ||
779 | /* We can't safely get the 'struct request' as | ||
780 | * the id is busted. */ | ||
781 | continue; | ||
782 | } | ||
749 | req = info->shadow[id].request; | 783 | req = info->shadow[id].request; |
750 | 784 | ||
751 | if (bret->operation != BLKIF_OP_DISCARD) | 785 | if (bret->operation != BLKIF_OP_DISCARD) |
752 | blkif_completion(&info->shadow[id]); | 786 | blkif_completion(&info->shadow[id]); |
753 | 787 | ||
754 | add_id_to_freelist(info, id); | 788 | if (add_id_to_freelist(info, id)) { |
789 | WARN(1, "%s: response to %s (id %ld) couldn't be recycled!\n", | ||
790 | info->gd->disk_name, op_name(bret->operation), id); | ||
791 | continue; | ||
792 | } | ||
755 | 793 | ||
756 | error = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO; | 794 | error = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO; |
757 | switch (bret->operation) { | 795 | switch (bret->operation) { |
758 | case BLKIF_OP_DISCARD: | 796 | case BLKIF_OP_DISCARD: |
759 | if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) { | 797 | if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) { |
760 | struct request_queue *rq = info->rq; | 798 | struct request_queue *rq = info->rq; |
761 | printk(KERN_WARNING "blkfront: %s: discard op failed\n", | 799 | printk(KERN_WARNING "blkfront: %s: %s op failed\n", |
762 | info->gd->disk_name); | 800 | info->gd->disk_name, op_name(bret->operation)); |
763 | error = -EOPNOTSUPP; | 801 | error = -EOPNOTSUPP; |
764 | info->feature_discard = 0; | 802 | info->feature_discard = 0; |
765 | info->feature_secdiscard = 0; | 803 | info->feature_secdiscard = 0; |
@@ -771,18 +809,14 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) | |||
771 | case BLKIF_OP_FLUSH_DISKCACHE: | 809 | case BLKIF_OP_FLUSH_DISKCACHE: |
772 | case BLKIF_OP_WRITE_BARRIER: | 810 | case BLKIF_OP_WRITE_BARRIER: |
773 | if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) { | 811 | if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) { |
774 | printk(KERN_WARNING "blkfront: %s: write %s op failed\n", | 812 | printk(KERN_WARNING "blkfront: %s: %s op failed\n", |
775 | info->flush_op == BLKIF_OP_WRITE_BARRIER ? | 813 | info->gd->disk_name, op_name(bret->operation)); |
776 | "barrier" : "flush disk cache", | ||
777 | info->gd->disk_name); | ||
778 | error = -EOPNOTSUPP; | 814 | error = -EOPNOTSUPP; |
779 | } | 815 | } |
780 | if (unlikely(bret->status == BLKIF_RSP_ERROR && | 816 | if (unlikely(bret->status == BLKIF_RSP_ERROR && |
781 | info->shadow[id].req.u.rw.nr_segments == 0)) { | 817 | info->shadow[id].req.u.rw.nr_segments == 0)) { |
782 | printk(KERN_WARNING "blkfront: %s: empty write %s op failed\n", | 818 | printk(KERN_WARNING "blkfront: %s: empty %s op failed\n", |
783 | info->flush_op == BLKIF_OP_WRITE_BARRIER ? | 819 | info->gd->disk_name, op_name(bret->operation)); |
784 | "barrier" : "flush disk cache", | ||
785 | info->gd->disk_name); | ||
786 | error = -EOPNOTSUPP; | 820 | error = -EOPNOTSUPP; |
787 | } | 821 | } |
788 | if (unlikely(error)) { | 822 | if (unlikely(error)) { |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index ad591bd240ec..10308cd8a7ed 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -63,6 +63,7 @@ static struct usb_device_id ath3k_table[] = { | |||
63 | 63 | ||
64 | /* Atheros AR3011 with sflash firmware*/ | 64 | /* Atheros AR3011 with sflash firmware*/ |
65 | { USB_DEVICE(0x0CF3, 0x3002) }, | 65 | { USB_DEVICE(0x0CF3, 0x3002) }, |
66 | { USB_DEVICE(0x0CF3, 0xE019) }, | ||
66 | { USB_DEVICE(0x13d3, 0x3304) }, | 67 | { USB_DEVICE(0x13d3, 0x3304) }, |
67 | { USB_DEVICE(0x0930, 0x0215) }, | 68 | { USB_DEVICE(0x0930, 0x0215) }, |
68 | { USB_DEVICE(0x0489, 0xE03D) }, | 69 | { USB_DEVICE(0x0489, 0xE03D) }, |
@@ -77,6 +78,7 @@ static struct usb_device_id ath3k_table[] = { | |||
77 | { USB_DEVICE(0x04CA, 0x3005) }, | 78 | { USB_DEVICE(0x04CA, 0x3005) }, |
78 | { USB_DEVICE(0x13d3, 0x3362) }, | 79 | { USB_DEVICE(0x13d3, 0x3362) }, |
79 | { USB_DEVICE(0x0CF3, 0xE004) }, | 80 | { USB_DEVICE(0x0CF3, 0xE004) }, |
81 | { USB_DEVICE(0x0930, 0x0219) }, | ||
80 | 82 | ||
81 | /* Atheros AR5BBU12 with sflash firmware */ | 83 | /* Atheros AR5BBU12 with sflash firmware */ |
82 | { USB_DEVICE(0x0489, 0xE02C) }, | 84 | { USB_DEVICE(0x0489, 0xE02C) }, |
@@ -101,6 +103,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { | |||
101 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, | 103 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
102 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 104 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
103 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 105 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
106 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, | ||
104 | 107 | ||
105 | /* Atheros AR5BBU22 with sflash firmware */ | 108 | /* Atheros AR5BBU22 with sflash firmware */ |
106 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, | 109 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/bluetooth/btmrvl_drv.h b/drivers/bluetooth/btmrvl_drv.h index 94f2d65131c4..27068d149380 100644 --- a/drivers/bluetooth/btmrvl_drv.h +++ b/drivers/bluetooth/btmrvl_drv.h | |||
@@ -136,7 +136,7 @@ int btmrvl_remove_card(struct btmrvl_private *priv); | |||
136 | 136 | ||
137 | void btmrvl_interrupt(struct btmrvl_private *priv); | 137 | void btmrvl_interrupt(struct btmrvl_private *priv); |
138 | 138 | ||
139 | void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb); | 139 | bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb); |
140 | int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb); | 140 | int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb); |
141 | 141 | ||
142 | int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd); | 142 | int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd); |
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index 681ca9d18e12..dc304def8400 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c | |||
@@ -44,23 +44,33 @@ void btmrvl_interrupt(struct btmrvl_private *priv) | |||
44 | } | 44 | } |
45 | EXPORT_SYMBOL_GPL(btmrvl_interrupt); | 45 | EXPORT_SYMBOL_GPL(btmrvl_interrupt); |
46 | 46 | ||
47 | void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) | 47 | bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) |
48 | { | 48 | { |
49 | struct hci_event_hdr *hdr = (void *) skb->data; | 49 | struct hci_event_hdr *hdr = (void *) skb->data; |
50 | struct hci_ev_cmd_complete *ec; | 50 | struct hci_ev_cmd_complete *ec; |
51 | u16 opcode, ocf; | 51 | u16 opcode, ocf, ogf; |
52 | 52 | ||
53 | if (hdr->evt == HCI_EV_CMD_COMPLETE) { | 53 | if (hdr->evt == HCI_EV_CMD_COMPLETE) { |
54 | ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); | 54 | ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); |
55 | opcode = __le16_to_cpu(ec->opcode); | 55 | opcode = __le16_to_cpu(ec->opcode); |
56 | ocf = hci_opcode_ocf(opcode); | 56 | ocf = hci_opcode_ocf(opcode); |
57 | ogf = hci_opcode_ogf(opcode); | ||
58 | |||
57 | if (ocf == BT_CMD_MODULE_CFG_REQ && | 59 | if (ocf == BT_CMD_MODULE_CFG_REQ && |
58 | priv->btmrvl_dev.sendcmdflag) { | 60 | priv->btmrvl_dev.sendcmdflag) { |
59 | priv->btmrvl_dev.sendcmdflag = false; | 61 | priv->btmrvl_dev.sendcmdflag = false; |
60 | priv->adapter->cmd_complete = true; | 62 | priv->adapter->cmd_complete = true; |
61 | wake_up_interruptible(&priv->adapter->cmd_wait_q); | 63 | wake_up_interruptible(&priv->adapter->cmd_wait_q); |
62 | } | 64 | } |
65 | |||
66 | if (ogf == OGF) { | ||
67 | BT_DBG("vendor event skipped: ogf 0x%4.4x", ogf); | ||
68 | kfree_skb(skb); | ||
69 | return false; | ||
70 | } | ||
63 | } | 71 | } |
72 | |||
73 | return true; | ||
64 | } | 74 | } |
65 | EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt); | 75 | EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt); |
66 | 76 | ||
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index a853244e7fd7..0cd61d9f07cd 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c | |||
@@ -562,10 +562,12 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) | |||
562 | skb_put(skb, buf_len); | 562 | skb_put(skb, buf_len); |
563 | skb_pull(skb, SDIO_HEADER_LEN); | 563 | skb_pull(skb, SDIO_HEADER_LEN); |
564 | 564 | ||
565 | if (type == HCI_EVENT_PKT) | 565 | if (type == HCI_EVENT_PKT) { |
566 | btmrvl_check_evtpkt(priv, skb); | 566 | if (btmrvl_check_evtpkt(priv, skb)) |
567 | hci_recv_frame(skb); | ||
568 | } else | ||
569 | hci_recv_frame(skb); | ||
567 | 570 | ||
568 | hci_recv_frame(skb); | ||
569 | hdev->stat.byte_rx += buf_len; | 571 | hdev->stat.byte_rx += buf_len; |
570 | break; | 572 | break; |
571 | 573 | ||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index c9463af8e564..83ebb241bfcc 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -125,6 +125,7 @@ static struct usb_device_id blacklist_table[] = { | |||
125 | 125 | ||
126 | /* Atheros 3011 with sflash firmware */ | 126 | /* Atheros 3011 with sflash firmware */ |
127 | { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, | 127 | { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, |
128 | { USB_DEVICE(0x0cf3, 0xe019), .driver_info = BTUSB_IGNORE }, | ||
128 | { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, | 129 | { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, |
129 | { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, | 130 | { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, |
130 | { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE }, | 131 | { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE }, |
@@ -139,6 +140,7 @@ static struct usb_device_id blacklist_table[] = { | |||
139 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, | 140 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
140 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 141 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
141 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 142 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
143 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, | ||
142 | 144 | ||
143 | /* Atheros AR5BBU12 with sflash firmware */ | 145 | /* Atheros AR5BBU12 with sflash firmware */ |
144 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, | 146 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, |
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 687b00d67c8a..9a1eb0cfa95f 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
@@ -850,18 +850,21 @@ static void clk_change_rate(struct clk *clk) | |||
850 | { | 850 | { |
851 | struct clk *child; | 851 | struct clk *child; |
852 | unsigned long old_rate; | 852 | unsigned long old_rate; |
853 | unsigned long best_parent_rate = 0; | ||
853 | struct hlist_node *tmp; | 854 | struct hlist_node *tmp; |
854 | 855 | ||
855 | old_rate = clk->rate; | 856 | old_rate = clk->rate; |
856 | 857 | ||
858 | if (clk->parent) | ||
859 | best_parent_rate = clk->parent->rate; | ||
860 | |||
857 | if (clk->ops->set_rate) | 861 | if (clk->ops->set_rate) |
858 | clk->ops->set_rate(clk->hw, clk->new_rate, clk->parent->rate); | 862 | clk->ops->set_rate(clk->hw, clk->new_rate, best_parent_rate); |
859 | 863 | ||
860 | if (clk->ops->recalc_rate) | 864 | if (clk->ops->recalc_rate) |
861 | clk->rate = clk->ops->recalc_rate(clk->hw, | 865 | clk->rate = clk->ops->recalc_rate(clk->hw, best_parent_rate); |
862 | clk->parent->rate); | ||
863 | else | 866 | else |
864 | clk->rate = clk->parent->rate; | 867 | clk->rate = best_parent_rate; |
865 | 868 | ||
866 | if (clk->notifier_count && old_rate != clk->rate) | 869 | if (clk->notifier_count && old_rate != clk->rate) |
867 | __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate); | 870 | __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate); |
@@ -999,7 +1002,7 @@ static struct clk *__clk_init_parent(struct clk *clk) | |||
999 | 1002 | ||
1000 | if (!clk->parents) | 1003 | if (!clk->parents) |
1001 | clk->parents = | 1004 | clk->parents = |
1002 | kmalloc((sizeof(struct clk*) * clk->num_parents), | 1005 | kzalloc((sizeof(struct clk*) * clk->num_parents), |
1003 | GFP_KERNEL); | 1006 | GFP_KERNEL); |
1004 | 1007 | ||
1005 | if (!clk->parents) | 1008 | if (!clk->parents) |
@@ -1064,21 +1067,24 @@ static int __clk_set_parent(struct clk *clk, struct clk *parent) | |||
1064 | 1067 | ||
1065 | old_parent = clk->parent; | 1068 | old_parent = clk->parent; |
1066 | 1069 | ||
1067 | /* find index of new parent clock using cached parent ptrs */ | 1070 | if (!clk->parents) |
1068 | for (i = 0; i < clk->num_parents; i++) | 1071 | clk->parents = kzalloc((sizeof(struct clk*) * clk->num_parents), |
1069 | if (clk->parents[i] == parent) | 1072 | GFP_KERNEL); |
1070 | break; | ||
1071 | 1073 | ||
1072 | /* | 1074 | /* |
1073 | * find index of new parent clock using string name comparison | 1075 | * find index of new parent clock using cached parent ptrs, |
1074 | * also try to cache the parent to avoid future calls to __clk_lookup | 1076 | * or if not yet cached, use string name comparison and cache |
1077 | * them now to avoid future calls to __clk_lookup. | ||
1075 | */ | 1078 | */ |
1076 | if (i == clk->num_parents) | 1079 | for (i = 0; i < clk->num_parents; i++) { |
1077 | for (i = 0; i < clk->num_parents; i++) | 1080 | if (clk->parents && clk->parents[i] == parent) |
1078 | if (!strcmp(clk->parent_names[i], parent->name)) { | 1081 | break; |
1082 | else if (!strcmp(clk->parent_names[i], parent->name)) { | ||
1083 | if (clk->parents) | ||
1079 | clk->parents[i] = __clk_lookup(parent->name); | 1084 | clk->parents[i] = __clk_lookup(parent->name); |
1080 | break; | 1085 | break; |
1081 | } | 1086 | } |
1087 | } | ||
1082 | 1088 | ||
1083 | if (i == clk->num_parents) { | 1089 | if (i == clk->num_parents) { |
1084 | pr_debug("%s: clock %s is not a possible parent of clock %s\n", | 1090 | pr_debug("%s: clock %s is not a possible parent of clock %s\n", |
diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c index f7be225f544c..db2391c054ee 100644 --- a/drivers/clk/mxs/clk-imx23.c +++ b/drivers/clk/mxs/clk-imx23.c | |||
@@ -71,7 +71,7 @@ static void __init clk_misc_init(void) | |||
71 | __mxs_setl(30 << BP_FRAC_IOFRAC, FRAC); | 71 | __mxs_setl(30 << BP_FRAC_IOFRAC, FRAC); |
72 | } | 72 | } |
73 | 73 | ||
74 | static struct clk_lookup uart_lookups[] __initdata = { | 74 | static struct clk_lookup uart_lookups[] = { |
75 | { .dev_id = "duart", }, | 75 | { .dev_id = "duart", }, |
76 | { .dev_id = "mxs-auart.0", }, | 76 | { .dev_id = "mxs-auart.0", }, |
77 | { .dev_id = "mxs-auart.1", }, | 77 | { .dev_id = "mxs-auart.1", }, |
@@ -80,31 +80,31 @@ static struct clk_lookup uart_lookups[] __initdata = { | |||
80 | { .dev_id = "80070000.serial", }, | 80 | { .dev_id = "80070000.serial", }, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static struct clk_lookup hbus_lookups[] __initdata = { | 83 | static struct clk_lookup hbus_lookups[] = { |
84 | { .dev_id = "imx23-dma-apbh", }, | 84 | { .dev_id = "imx23-dma-apbh", }, |
85 | { .dev_id = "80004000.dma-apbh", }, | 85 | { .dev_id = "80004000.dma-apbh", }, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static struct clk_lookup xbus_lookups[] __initdata = { | 88 | static struct clk_lookup xbus_lookups[] = { |
89 | { .dev_id = "duart", .con_id = "apb_pclk"}, | 89 | { .dev_id = "duart", .con_id = "apb_pclk"}, |
90 | { .dev_id = "80070000.serial", .con_id = "apb_pclk"}, | 90 | { .dev_id = "80070000.serial", .con_id = "apb_pclk"}, |
91 | { .dev_id = "imx23-dma-apbx", }, | 91 | { .dev_id = "imx23-dma-apbx", }, |
92 | { .dev_id = "80024000.dma-apbx", }, | 92 | { .dev_id = "80024000.dma-apbx", }, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static struct clk_lookup ssp_lookups[] __initdata = { | 95 | static struct clk_lookup ssp_lookups[] = { |
96 | { .dev_id = "imx23-mmc.0", }, | 96 | { .dev_id = "imx23-mmc.0", }, |
97 | { .dev_id = "imx23-mmc.1", }, | 97 | { .dev_id = "imx23-mmc.1", }, |
98 | { .dev_id = "80010000.ssp", }, | 98 | { .dev_id = "80010000.ssp", }, |
99 | { .dev_id = "80034000.ssp", }, | 99 | { .dev_id = "80034000.ssp", }, |
100 | }; | 100 | }; |
101 | 101 | ||
102 | static struct clk_lookup lcdif_lookups[] __initdata = { | 102 | static struct clk_lookup lcdif_lookups[] = { |
103 | { .dev_id = "imx23-fb", }, | 103 | { .dev_id = "imx23-fb", }, |
104 | { .dev_id = "80030000.lcdif", }, | 104 | { .dev_id = "80030000.lcdif", }, |
105 | }; | 105 | }; |
106 | 106 | ||
107 | static struct clk_lookup gpmi_lookups[] __initdata = { | 107 | static struct clk_lookup gpmi_lookups[] = { |
108 | { .dev_id = "imx23-gpmi-nand", }, | 108 | { .dev_id = "imx23-gpmi-nand", }, |
109 | { .dev_id = "8000c000.gpmi", }, | 109 | { .dev_id = "8000c000.gpmi", }, |
110 | }; | 110 | }; |
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c index 2826a2606a29..7fad6c8c13d2 100644 --- a/drivers/clk/mxs/clk-imx28.c +++ b/drivers/clk/mxs/clk-imx28.c | |||
@@ -120,7 +120,7 @@ static void __init clk_misc_init(void) | |||
120 | writel_relaxed(val, FRAC0); | 120 | writel_relaxed(val, FRAC0); |
121 | } | 121 | } |
122 | 122 | ||
123 | static struct clk_lookup uart_lookups[] __initdata = { | 123 | static struct clk_lookup uart_lookups[] = { |
124 | { .dev_id = "duart", }, | 124 | { .dev_id = "duart", }, |
125 | { .dev_id = "mxs-auart.0", }, | 125 | { .dev_id = "mxs-auart.0", }, |
126 | { .dev_id = "mxs-auart.1", }, | 126 | { .dev_id = "mxs-auart.1", }, |
@@ -135,71 +135,71 @@ static struct clk_lookup uart_lookups[] __initdata = { | |||
135 | { .dev_id = "80074000.serial", }, | 135 | { .dev_id = "80074000.serial", }, |
136 | }; | 136 | }; |
137 | 137 | ||
138 | static struct clk_lookup hbus_lookups[] __initdata = { | 138 | static struct clk_lookup hbus_lookups[] = { |
139 | { .dev_id = "imx28-dma-apbh", }, | 139 | { .dev_id = "imx28-dma-apbh", }, |
140 | { .dev_id = "80004000.dma-apbh", }, | 140 | { .dev_id = "80004000.dma-apbh", }, |
141 | }; | 141 | }; |
142 | 142 | ||
143 | static struct clk_lookup xbus_lookups[] __initdata = { | 143 | static struct clk_lookup xbus_lookups[] = { |
144 | { .dev_id = "duart", .con_id = "apb_pclk"}, | 144 | { .dev_id = "duart", .con_id = "apb_pclk"}, |
145 | { .dev_id = "80074000.serial", .con_id = "apb_pclk"}, | 145 | { .dev_id = "80074000.serial", .con_id = "apb_pclk"}, |
146 | { .dev_id = "imx28-dma-apbx", }, | 146 | { .dev_id = "imx28-dma-apbx", }, |
147 | { .dev_id = "80024000.dma-apbx", }, | 147 | { .dev_id = "80024000.dma-apbx", }, |
148 | }; | 148 | }; |
149 | 149 | ||
150 | static struct clk_lookup ssp0_lookups[] __initdata = { | 150 | static struct clk_lookup ssp0_lookups[] = { |
151 | { .dev_id = "imx28-mmc.0", }, | 151 | { .dev_id = "imx28-mmc.0", }, |
152 | { .dev_id = "80010000.ssp", }, | 152 | { .dev_id = "80010000.ssp", }, |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static struct clk_lookup ssp1_lookups[] __initdata = { | 155 | static struct clk_lookup ssp1_lookups[] = { |
156 | { .dev_id = "imx28-mmc.1", }, | 156 | { .dev_id = "imx28-mmc.1", }, |
157 | { .dev_id = "80012000.ssp", }, | 157 | { .dev_id = "80012000.ssp", }, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | static struct clk_lookup ssp2_lookups[] __initdata = { | 160 | static struct clk_lookup ssp2_lookups[] = { |
161 | { .dev_id = "imx28-mmc.2", }, | 161 | { .dev_id = "imx28-mmc.2", }, |
162 | { .dev_id = "80014000.ssp", }, | 162 | { .dev_id = "80014000.ssp", }, |
163 | }; | 163 | }; |
164 | 164 | ||
165 | static struct clk_lookup ssp3_lookups[] __initdata = { | 165 | static struct clk_lookup ssp3_lookups[] = { |
166 | { .dev_id = "imx28-mmc.3", }, | 166 | { .dev_id = "imx28-mmc.3", }, |
167 | { .dev_id = "80016000.ssp", }, | 167 | { .dev_id = "80016000.ssp", }, |
168 | }; | 168 | }; |
169 | 169 | ||
170 | static struct clk_lookup lcdif_lookups[] __initdata = { | 170 | static struct clk_lookup lcdif_lookups[] = { |
171 | { .dev_id = "imx28-fb", }, | 171 | { .dev_id = "imx28-fb", }, |
172 | { .dev_id = "80030000.lcdif", }, | 172 | { .dev_id = "80030000.lcdif", }, |
173 | }; | 173 | }; |
174 | 174 | ||
175 | static struct clk_lookup gpmi_lookups[] __initdata = { | 175 | static struct clk_lookup gpmi_lookups[] = { |
176 | { .dev_id = "imx28-gpmi-nand", }, | 176 | { .dev_id = "imx28-gpmi-nand", }, |
177 | { .dev_id = "8000c000.gpmi", }, | 177 | { .dev_id = "8000c000.gpmi", }, |
178 | }; | 178 | }; |
179 | 179 | ||
180 | static struct clk_lookup fec_lookups[] __initdata = { | 180 | static struct clk_lookup fec_lookups[] = { |
181 | { .dev_id = "imx28-fec.0", }, | 181 | { .dev_id = "imx28-fec.0", }, |
182 | { .dev_id = "imx28-fec.1", }, | 182 | { .dev_id = "imx28-fec.1", }, |
183 | { .dev_id = "800f0000.ethernet", }, | 183 | { .dev_id = "800f0000.ethernet", }, |
184 | { .dev_id = "800f4000.ethernet", }, | 184 | { .dev_id = "800f4000.ethernet", }, |
185 | }; | 185 | }; |
186 | 186 | ||
187 | static struct clk_lookup can0_lookups[] __initdata = { | 187 | static struct clk_lookup can0_lookups[] = { |
188 | { .dev_id = "flexcan.0", }, | 188 | { .dev_id = "flexcan.0", }, |
189 | { .dev_id = "80032000.can", }, | 189 | { .dev_id = "80032000.can", }, |
190 | }; | 190 | }; |
191 | 191 | ||
192 | static struct clk_lookup can1_lookups[] __initdata = { | 192 | static struct clk_lookup can1_lookups[] = { |
193 | { .dev_id = "flexcan.1", }, | 193 | { .dev_id = "flexcan.1", }, |
194 | { .dev_id = "80034000.can", }, | 194 | { .dev_id = "80034000.can", }, |
195 | }; | 195 | }; |
196 | 196 | ||
197 | static struct clk_lookup saif0_lookups[] __initdata = { | 197 | static struct clk_lookup saif0_lookups[] = { |
198 | { .dev_id = "mxs-saif.0", }, | 198 | { .dev_id = "mxs-saif.0", }, |
199 | { .dev_id = "80042000.saif", }, | 199 | { .dev_id = "80042000.saif", }, |
200 | }; | 200 | }; |
201 | 201 | ||
202 | static struct clk_lookup saif1_lookups[] __initdata = { | 202 | static struct clk_lookup saif1_lookups[] = { |
203 | { .dev_id = "mxs-saif.1", }, | 203 | { .dev_id = "mxs-saif.1", }, |
204 | { .dev_id = "80046000.saif", }, | 204 | { .dev_id = "80046000.saif", }, |
205 | }; | 205 | }; |
@@ -245,8 +245,8 @@ int __init mx28_clocks_init(void) | |||
245 | clks[pll2] = mxs_clk_pll("pll2", "ref_xtal", PLL2CTRL0, 23, 50000000); | 245 | clks[pll2] = mxs_clk_pll("pll2", "ref_xtal", PLL2CTRL0, 23, 50000000); |
246 | clks[ref_cpu] = mxs_clk_ref("ref_cpu", "pll0", FRAC0, 0); | 246 | clks[ref_cpu] = mxs_clk_ref("ref_cpu", "pll0", FRAC0, 0); |
247 | clks[ref_emi] = mxs_clk_ref("ref_emi", "pll0", FRAC0, 1); | 247 | clks[ref_emi] = mxs_clk_ref("ref_emi", "pll0", FRAC0, 1); |
248 | clks[ref_io0] = mxs_clk_ref("ref_io0", "pll0", FRAC0, 2); | 248 | clks[ref_io1] = mxs_clk_ref("ref_io1", "pll0", FRAC0, 2); |
249 | clks[ref_io1] = mxs_clk_ref("ref_io1", "pll0", FRAC0, 3); | 249 | clks[ref_io0] = mxs_clk_ref("ref_io0", "pll0", FRAC0, 3); |
250 | clks[ref_pix] = mxs_clk_ref("ref_pix", "pll0", FRAC1, 0); | 250 | clks[ref_pix] = mxs_clk_ref("ref_pix", "pll0", FRAC1, 0); |
251 | clks[ref_hsadc] = mxs_clk_ref("ref_hsadc", "pll0", FRAC1, 1); | 251 | clks[ref_hsadc] = mxs_clk_ref("ref_hsadc", "pll0", FRAC1, 1); |
252 | clks[ref_gpmi] = mxs_clk_ref("ref_gpmi", "pll0", FRAC1, 2); | 252 | clks[ref_gpmi] = mxs_clk_ref("ref_gpmi", "pll0", FRAC1, 2); |
diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c index af34074e702b..6756e7c3bc07 100644 --- a/drivers/clk/spear/clk-aux-synth.c +++ b/drivers/clk/spear/clk-aux-synth.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2012 ST Microelectronics | 2 | * Copyright (C) 2012 ST Microelectronics |
3 | * Viresh Kumar <viresh.kumar@st.com> | 3 | * Viresh Kumar <viresh.linux@gmail.com> |
4 | * | 4 | * |
5 | * This file is licensed under the terms of the GNU General Public | 5 | * This file is licensed under the terms of the GNU General Public |
6 | * License version 2. This program is licensed "as is" without any | 6 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/clk-frac-synth.c b/drivers/clk/spear/clk-frac-synth.c index 4dbdb3fe18e0..958aa3ad1d60 100644 --- a/drivers/clk/spear/clk-frac-synth.c +++ b/drivers/clk/spear/clk-frac-synth.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2012 ST Microelectronics | 2 | * Copyright (C) 2012 ST Microelectronics |
3 | * Viresh Kumar <viresh.kumar@st.com> | 3 | * Viresh Kumar <viresh.linux@gmail.com> |
4 | * | 4 | * |
5 | * This file is licensed under the terms of the GNU General Public | 5 | * This file is licensed under the terms of the GNU General Public |
6 | * License version 2. This program is licensed "as is" without any | 6 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/clk-gpt-synth.c b/drivers/clk/spear/clk-gpt-synth.c index b471c9762a97..1afc18c4effc 100644 --- a/drivers/clk/spear/clk-gpt-synth.c +++ b/drivers/clk/spear/clk-gpt-synth.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2012 ST Microelectronics | 2 | * Copyright (C) 2012 ST Microelectronics |
3 | * Viresh Kumar <viresh.kumar@st.com> | 3 | * Viresh Kumar <viresh.linux@gmail.com> |
4 | * | 4 | * |
5 | * This file is licensed under the terms of the GNU General Public | 5 | * This file is licensed under the terms of the GNU General Public |
6 | * License version 2. This program is licensed "as is" without any | 6 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/clk-vco-pll.c b/drivers/clk/spear/clk-vco-pll.c index dcd4bdf4b0d9..5f1b6badeb15 100644 --- a/drivers/clk/spear/clk-vco-pll.c +++ b/drivers/clk/spear/clk-vco-pll.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2012 ST Microelectronics | 2 | * Copyright (C) 2012 ST Microelectronics |
3 | * Viresh Kumar <viresh.kumar@st.com> | 3 | * Viresh Kumar <viresh.linux@gmail.com> |
4 | * | 4 | * |
5 | * This file is licensed under the terms of the GNU General Public | 5 | * This file is licensed under the terms of the GNU General Public |
6 | * License version 2. This program is licensed "as is" without any | 6 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/clk.c b/drivers/clk/spear/clk.c index 376d4e5ff326..7cd63788d546 100644 --- a/drivers/clk/spear/clk.c +++ b/drivers/clk/spear/clk.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2012 ST Microelectronics | 2 | * Copyright (C) 2012 ST Microelectronics |
3 | * Viresh Kumar <viresh.kumar@st.com> | 3 | * Viresh Kumar <viresh.linux@gmail.com> |
4 | * | 4 | * |
5 | * This file is licensed under the terms of the GNU General Public | 5 | * This file is licensed under the terms of the GNU General Public |
6 | * License version 2. This program is licensed "as is" without any | 6 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/clk.h b/drivers/clk/spear/clk.h index 3321c46a071c..931737677dfa 100644 --- a/drivers/clk/spear/clk.h +++ b/drivers/clk/spear/clk.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * Clock framework definitions for SPEAr platform | 2 | * Clock framework definitions for SPEAr platform |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/spear1310_clock.c b/drivers/clk/spear/spear1310_clock.c index 42b68df9aeef..8f05652d53e6 100644 --- a/drivers/clk/spear/spear1310_clock.c +++ b/drivers/clk/spear/spear1310_clock.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * SPEAr1310 machine clock framework source file | 4 | * SPEAr1310 machine clock framework source file |
5 | * | 5 | * |
6 | * Copyright (C) 2012 ST Microelectronics | 6 | * Copyright (C) 2012 ST Microelectronics |
7 | * Viresh Kumar <viresh.kumar@st.com> | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/spear1340_clock.c b/drivers/clk/spear/spear1340_clock.c index f130919d5bf8..e3ea72162236 100644 --- a/drivers/clk/spear/spear1340_clock.c +++ b/drivers/clk/spear/spear1340_clock.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * SPEAr1340 machine clock framework source file | 4 | * SPEAr1340 machine clock framework source file |
5 | * | 5 | * |
6 | * Copyright (C) 2012 ST Microelectronics | 6 | * Copyright (C) 2012 ST Microelectronics |
7 | * Viresh Kumar <viresh.kumar@st.com> | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/spear3xx_clock.c b/drivers/clk/spear/spear3xx_clock.c index 440bb3e4c971..01dd6daff2a1 100644 --- a/drivers/clk/spear/spear3xx_clock.c +++ b/drivers/clk/spear/spear3xx_clock.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * SPEAr3xx machines clock framework source file | 2 | * SPEAr3xx machines clock framework source file |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/clk/spear/spear6xx_clock.c b/drivers/clk/spear/spear6xx_clock.c index f9a20b382304..61026ae564ab 100644 --- a/drivers/clk/spear/spear6xx_clock.c +++ b/drivers/clk/spear/spear6xx_clock.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * SPEAr6xx machines clock framework source file | 2 | * SPEAr6xx machines clock framework source file |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
@@ -298,7 +298,7 @@ void __init spear6xx_clk_init(void) | |||
298 | 298 | ||
299 | clk = clk_register_gate(NULL, "gmac_clk", "ahb_clk", 0, PERIP1_CLK_ENB, | 299 | clk = clk_register_gate(NULL, "gmac_clk", "ahb_clk", 0, PERIP1_CLK_ENB, |
300 | GMAC_CLK_ENB, 0, &_lock); | 300 | GMAC_CLK_ENB, 0, &_lock); |
301 | clk_register_clkdev(clk, NULL, "gmac"); | 301 | clk_register_clkdev(clk, NULL, "e0800000.ethernet"); |
302 | 302 | ||
303 | clk = clk_register_gate(NULL, "i2c_clk", "ahb_clk", 0, PERIP1_CLK_ENB, | 303 | clk = clk_register_gate(NULL, "i2c_clk", "ahb_clk", 0, PERIP1_CLK_ENB, |
304 | I2C_CLK_ENB, 0, &_lock); | 304 | I2C_CLK_ENB, 0, &_lock); |
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index e23dc82d43ac..721296157577 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c | |||
@@ -1626,4 +1626,4 @@ module_exit(dw_exit); | |||
1626 | MODULE_LICENSE("GPL v2"); | 1626 | MODULE_LICENSE("GPL v2"); |
1627 | MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller driver"); | 1627 | MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller driver"); |
1628 | MODULE_AUTHOR("Haavard Skinnemoen (Atmel)"); | 1628 | MODULE_AUTHOR("Haavard Skinnemoen (Atmel)"); |
1629 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 1629 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index fb4f4990f5eb..1dc2a4ad0026 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -815,8 +815,6 @@ static int sdma_request_channel(struct sdma_channel *sdmac) | |||
815 | 815 | ||
816 | init_completion(&sdmac->done); | 816 | init_completion(&sdmac->done); |
817 | 817 | ||
818 | sdmac->buf_tail = 0; | ||
819 | |||
820 | return 0; | 818 | return 0; |
821 | out: | 819 | out: |
822 | 820 | ||
@@ -927,6 +925,8 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( | |||
927 | 925 | ||
928 | sdmac->flags = 0; | 926 | sdmac->flags = 0; |
929 | 927 | ||
928 | sdmac->buf_tail = 0; | ||
929 | |||
930 | dev_dbg(sdma->dev, "setting up %d entries for channel %d.\n", | 930 | dev_dbg(sdma->dev, "setting up %d entries for channel %d.\n", |
931 | sg_len, channel); | 931 | sg_len, channel); |
932 | 932 | ||
@@ -1027,6 +1027,8 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( | |||
1027 | 1027 | ||
1028 | sdmac->status = DMA_IN_PROGRESS; | 1028 | sdmac->status = DMA_IN_PROGRESS; |
1029 | 1029 | ||
1030 | sdmac->buf_tail = 0; | ||
1031 | |||
1030 | sdmac->flags |= IMX_DMA_SG_LOOP; | 1032 | sdmac->flags |= IMX_DMA_SG_LOOP; |
1031 | sdmac->direction = direction; | 1033 | sdmac->direction = direction; |
1032 | ret = sdma_load_context(sdmac); | 1034 | ret = sdma_load_context(sdmac); |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index cbcc28e79be6..e4feba6b03c0 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -392,6 +392,8 @@ struct pl330_req { | |||
392 | struct pl330_reqcfg *cfg; | 392 | struct pl330_reqcfg *cfg; |
393 | /* Pointer to first xfer in the request. */ | 393 | /* Pointer to first xfer in the request. */ |
394 | struct pl330_xfer *x; | 394 | struct pl330_xfer *x; |
395 | /* Hook to attach to DMAC's list of reqs with due callback */ | ||
396 | struct list_head rqd; | ||
395 | }; | 397 | }; |
396 | 398 | ||
397 | /* | 399 | /* |
@@ -461,8 +463,6 @@ struct _pl330_req { | |||
461 | /* Number of bytes taken to setup MC for the req */ | 463 | /* Number of bytes taken to setup MC for the req */ |
462 | u32 mc_len; | 464 | u32 mc_len; |
463 | struct pl330_req *r; | 465 | struct pl330_req *r; |
464 | /* Hook to attach to DMAC's list of reqs with due callback */ | ||
465 | struct list_head rqd; | ||
466 | }; | 466 | }; |
467 | 467 | ||
468 | /* ToBeDone for tasklet */ | 468 | /* ToBeDone for tasklet */ |
@@ -1683,7 +1683,7 @@ static void pl330_dotask(unsigned long data) | |||
1683 | /* Returns 1 if state was updated, 0 otherwise */ | 1683 | /* Returns 1 if state was updated, 0 otherwise */ |
1684 | static int pl330_update(const struct pl330_info *pi) | 1684 | static int pl330_update(const struct pl330_info *pi) |
1685 | { | 1685 | { |
1686 | struct _pl330_req *rqdone; | 1686 | struct pl330_req *rqdone, *tmp; |
1687 | struct pl330_dmac *pl330; | 1687 | struct pl330_dmac *pl330; |
1688 | unsigned long flags; | 1688 | unsigned long flags; |
1689 | void __iomem *regs; | 1689 | void __iomem *regs; |
@@ -1750,7 +1750,10 @@ static int pl330_update(const struct pl330_info *pi) | |||
1750 | if (active == -1) /* Aborted */ | 1750 | if (active == -1) /* Aborted */ |
1751 | continue; | 1751 | continue; |
1752 | 1752 | ||
1753 | rqdone = &thrd->req[active]; | 1753 | /* Detach the req */ |
1754 | rqdone = thrd->req[active].r; | ||
1755 | thrd->req[active].r = NULL; | ||
1756 | |||
1754 | mark_free(thrd, active); | 1757 | mark_free(thrd, active); |
1755 | 1758 | ||
1756 | /* Get going again ASAP */ | 1759 | /* Get going again ASAP */ |
@@ -1762,20 +1765,11 @@ static int pl330_update(const struct pl330_info *pi) | |||
1762 | } | 1765 | } |
1763 | 1766 | ||
1764 | /* Now that we are in no hurry, do the callbacks */ | 1767 | /* Now that we are in no hurry, do the callbacks */ |
1765 | while (!list_empty(&pl330->req_done)) { | 1768 | list_for_each_entry_safe(rqdone, tmp, &pl330->req_done, rqd) { |
1766 | struct pl330_req *r; | 1769 | list_del(&rqdone->rqd); |
1767 | |||
1768 | rqdone = container_of(pl330->req_done.next, | ||
1769 | struct _pl330_req, rqd); | ||
1770 | |||
1771 | list_del_init(&rqdone->rqd); | ||
1772 | |||
1773 | /* Detach the req */ | ||
1774 | r = rqdone->r; | ||
1775 | rqdone->r = NULL; | ||
1776 | 1770 | ||
1777 | spin_unlock_irqrestore(&pl330->lock, flags); | 1771 | spin_unlock_irqrestore(&pl330->lock, flags); |
1778 | _callback(r, PL330_ERR_NONE); | 1772 | _callback(rqdone, PL330_ERR_NONE); |
1779 | spin_lock_irqsave(&pl330->lock, flags); | 1773 | spin_lock_irqsave(&pl330->lock, flags); |
1780 | } | 1774 | } |
1781 | 1775 | ||
@@ -2321,7 +2315,7 @@ static void pl330_tasklet(unsigned long data) | |||
2321 | /* Pick up ripe tomatoes */ | 2315 | /* Pick up ripe tomatoes */ |
2322 | list_for_each_entry_safe(desc, _dt, &pch->work_list, node) | 2316 | list_for_each_entry_safe(desc, _dt, &pch->work_list, node) |
2323 | if (desc->status == DONE) { | 2317 | if (desc->status == DONE) { |
2324 | if (pch->cyclic) | 2318 | if (!pch->cyclic) |
2325 | dma_cookie_complete(&desc->txd); | 2319 | dma_cookie_complete(&desc->txd); |
2326 | list_move_tail(&desc->node, &list); | 2320 | list_move_tail(&desc->node, &list); |
2327 | } | 2321 | } |
@@ -2539,7 +2533,7 @@ static inline void _init_desc(struct dma_pl330_desc *desc) | |||
2539 | } | 2533 | } |
2540 | 2534 | ||
2541 | /* Returns the number of descriptors added to the DMAC pool */ | 2535 | /* Returns the number of descriptors added to the DMAC pool */ |
2542 | int add_desc(struct dma_pl330_dmac *pdmac, gfp_t flg, int count) | 2536 | static int add_desc(struct dma_pl330_dmac *pdmac, gfp_t flg, int count) |
2543 | { | 2537 | { |
2544 | struct dma_pl330_desc *desc; | 2538 | struct dma_pl330_desc *desc; |
2545 | unsigned long flags; | 2539 | unsigned long flags; |
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 23416e443765..a4ed30bd9a41 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c | |||
@@ -116,8 +116,8 @@ const char *max8997_extcon_cable[] = { | |||
116 | [5] = "Charge-downstream", | 116 | [5] = "Charge-downstream", |
117 | [6] = "MHL", | 117 | [6] = "MHL", |
118 | [7] = "Dock-desk", | 118 | [7] = "Dock-desk", |
119 | [7] = "Dock-card", | 119 | [8] = "Dock-card", |
120 | [8] = "JIG", | 120 | [9] = "JIG", |
121 | 121 | ||
122 | NULL, | 122 | NULL, |
123 | }; | 123 | }; |
@@ -514,6 +514,7 @@ static int __devexit max8997_muic_remove(struct platform_device *pdev) | |||
514 | 514 | ||
515 | extcon_dev_unregister(info->edev); | 515 | extcon_dev_unregister(info->edev); |
516 | 516 | ||
517 | kfree(info->edev); | ||
517 | kfree(info); | 518 | kfree(info); |
518 | 519 | ||
519 | return 0; | 520 | return 0; |
diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c index f598a700ec15..159aeb07b3ba 100644 --- a/drivers/extcon/extcon_class.c +++ b/drivers/extcon/extcon_class.c | |||
@@ -762,7 +762,7 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev) | |||
762 | #if defined(CONFIG_ANDROID) | 762 | #if defined(CONFIG_ANDROID) |
763 | if (switch_class) | 763 | if (switch_class) |
764 | ret = class_compat_create_link(switch_class, edev->dev, | 764 | ret = class_compat_create_link(switch_class, edev->dev, |
765 | dev); | 765 | NULL); |
766 | #endif /* CONFIG_ANDROID */ | 766 | #endif /* CONFIG_ANDROID */ |
767 | 767 | ||
768 | spin_lock_init(&edev->lock); | 768 | spin_lock_init(&edev->lock); |
diff --git a/drivers/extcon/extcon_gpio.c b/drivers/extcon/extcon_gpio.c index fe7a07b47336..8a0dcc11c7c7 100644 --- a/drivers/extcon/extcon_gpio.c +++ b/drivers/extcon/extcon_gpio.c | |||
@@ -125,6 +125,7 @@ static int __devinit gpio_extcon_probe(struct platform_device *pdev) | |||
125 | if (ret < 0) | 125 | if (ret < 0) |
126 | goto err_request_irq; | 126 | goto err_request_irq; |
127 | 127 | ||
128 | platform_set_drvdata(pdev, extcon_data); | ||
128 | /* Perform initial detection */ | 129 | /* Perform initial detection */ |
129 | gpio_extcon_work(&extcon_data->work.work); | 130 | gpio_extcon_work(&extcon_data->work.work); |
130 | 131 | ||
@@ -146,6 +147,7 @@ static int __devexit gpio_extcon_remove(struct platform_device *pdev) | |||
146 | struct gpio_extcon_data *extcon_data = platform_get_drvdata(pdev); | 147 | struct gpio_extcon_data *extcon_data = platform_get_drvdata(pdev); |
147 | 148 | ||
148 | cancel_delayed_work_sync(&extcon_data->work); | 149 | cancel_delayed_work_sync(&extcon_data->work); |
150 | free_irq(extcon_data->irq, extcon_data); | ||
149 | gpio_free(extcon_data->gpio); | 151 | gpio_free(extcon_data->gpio); |
150 | extcon_dev_unregister(&extcon_data->edev); | 152 | extcon_dev_unregister(&extcon_data->edev); |
151 | devm_kfree(&pdev->dev, extcon_data); | 153 | devm_kfree(&pdev->dev, extcon_data); |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index eb92fe257a39..a8743c399e83 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -610,7 +610,7 @@ static bool | |||
610 | drm_monitor_supports_rb(struct edid *edid) | 610 | drm_monitor_supports_rb(struct edid *edid) |
611 | { | 611 | { |
612 | if (edid->revision >= 4) { | 612 | if (edid->revision >= 4) { |
613 | bool ret; | 613 | bool ret = false; |
614 | drm_for_each_detailed_block((u8 *)edid, is_rb, &ret); | 614 | drm_for_each_detailed_block((u8 *)edid, is_rb, &ret); |
615 | return ret; | 615 | return ret; |
616 | } | 616 | } |
@@ -1039,6 +1039,24 @@ mode_in_range(const struct drm_display_mode *mode, struct edid *edid, | |||
1039 | return true; | 1039 | return true; |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | static bool valid_inferred_mode(const struct drm_connector *connector, | ||
1043 | const struct drm_display_mode *mode) | ||
1044 | { | ||
1045 | struct drm_display_mode *m; | ||
1046 | bool ok = false; | ||
1047 | |||
1048 | list_for_each_entry(m, &connector->probed_modes, head) { | ||
1049 | if (mode->hdisplay == m->hdisplay && | ||
1050 | mode->vdisplay == m->vdisplay && | ||
1051 | drm_mode_vrefresh(mode) == drm_mode_vrefresh(m)) | ||
1052 | return false; /* duplicated */ | ||
1053 | if (mode->hdisplay <= m->hdisplay && | ||
1054 | mode->vdisplay <= m->vdisplay) | ||
1055 | ok = true; | ||
1056 | } | ||
1057 | return ok; | ||
1058 | } | ||
1059 | |||
1042 | static int | 1060 | static int |
1043 | drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid, | 1061 | drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid, |
1044 | struct detailed_timing *timing) | 1062 | struct detailed_timing *timing) |
@@ -1048,7 +1066,8 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid, | |||
1048 | struct drm_device *dev = connector->dev; | 1066 | struct drm_device *dev = connector->dev; |
1049 | 1067 | ||
1050 | for (i = 0; i < drm_num_dmt_modes; i++) { | 1068 | for (i = 0; i < drm_num_dmt_modes; i++) { |
1051 | if (mode_in_range(drm_dmt_modes + i, edid, timing)) { | 1069 | if (mode_in_range(drm_dmt_modes + i, edid, timing) && |
1070 | valid_inferred_mode(connector, drm_dmt_modes + i)) { | ||
1052 | newmode = drm_mode_duplicate(dev, &drm_dmt_modes[i]); | 1071 | newmode = drm_mode_duplicate(dev, &drm_dmt_modes[i]); |
1053 | if (newmode) { | 1072 | if (newmode) { |
1054 | drm_mode_probed_add(connector, newmode); | 1073 | drm_mode_probed_add(connector, newmode); |
@@ -1088,7 +1107,8 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid, | |||
1088 | return modes; | 1107 | return modes; |
1089 | 1108 | ||
1090 | fixup_mode_1366x768(newmode); | 1109 | fixup_mode_1366x768(newmode); |
1091 | if (!mode_in_range(newmode, edid, timing)) { | 1110 | if (!mode_in_range(newmode, edid, timing) || |
1111 | !valid_inferred_mode(connector, newmode)) { | ||
1092 | drm_mode_destroy(dev, newmode); | 1112 | drm_mode_destroy(dev, newmode); |
1093 | continue; | 1113 | continue; |
1094 | } | 1114 | } |
@@ -1116,7 +1136,8 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid, | |||
1116 | return modes; | 1136 | return modes; |
1117 | 1137 | ||
1118 | fixup_mode_1366x768(newmode); | 1138 | fixup_mode_1366x768(newmode); |
1119 | if (!mode_in_range(newmode, edid, timing)) { | 1139 | if (!mode_in_range(newmode, edid, timing) || |
1140 | !valid_inferred_mode(connector, newmode)) { | ||
1120 | drm_mode_destroy(dev, newmode); | 1141 | drm_mode_destroy(dev, newmode); |
1121 | continue; | 1142 | continue; |
1122 | } | 1143 | } |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index f94792626b94..36822b924eb1 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1401,6 +1401,27 @@ i915_mtrr_setup(struct drm_i915_private *dev_priv, unsigned long base, | |||
1401 | } | 1401 | } |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv) | ||
1405 | { | ||
1406 | struct apertures_struct *ap; | ||
1407 | struct pci_dev *pdev = dev_priv->dev->pdev; | ||
1408 | bool primary; | ||
1409 | |||
1410 | ap = alloc_apertures(1); | ||
1411 | if (!ap) | ||
1412 | return; | ||
1413 | |||
1414 | ap->ranges[0].base = dev_priv->dev->agp->base; | ||
1415 | ap->ranges[0].size = | ||
1416 | dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; | ||
1417 | primary = | ||
1418 | pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; | ||
1419 | |||
1420 | remove_conflicting_framebuffers(ap, "inteldrmfb", primary); | ||
1421 | |||
1422 | kfree(ap); | ||
1423 | } | ||
1424 | |||
1404 | /** | 1425 | /** |
1405 | * i915_driver_load - setup chip and create an initial config | 1426 | * i915_driver_load - setup chip and create an initial config |
1406 | * @dev: DRM device | 1427 | * @dev: DRM device |
@@ -1446,6 +1467,15 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1446 | goto free_priv; | 1467 | goto free_priv; |
1447 | } | 1468 | } |
1448 | 1469 | ||
1470 | dev_priv->mm.gtt = intel_gtt_get(); | ||
1471 | if (!dev_priv->mm.gtt) { | ||
1472 | DRM_ERROR("Failed to initialize GTT\n"); | ||
1473 | ret = -ENODEV; | ||
1474 | goto put_bridge; | ||
1475 | } | ||
1476 | |||
1477 | i915_kick_out_firmware_fb(dev_priv); | ||
1478 | |||
1449 | pci_set_master(dev->pdev); | 1479 | pci_set_master(dev->pdev); |
1450 | 1480 | ||
1451 | /* overlay on gen2 is broken and can't address above 1G */ | 1481 | /* overlay on gen2 is broken and can't address above 1G */ |
@@ -1471,13 +1501,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1471 | goto put_bridge; | 1501 | goto put_bridge; |
1472 | } | 1502 | } |
1473 | 1503 | ||
1474 | dev_priv->mm.gtt = intel_gtt_get(); | ||
1475 | if (!dev_priv->mm.gtt) { | ||
1476 | DRM_ERROR("Failed to initialize GTT\n"); | ||
1477 | ret = -ENODEV; | ||
1478 | goto out_rmmap; | ||
1479 | } | ||
1480 | |||
1481 | aperture_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; | 1504 | aperture_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; |
1482 | 1505 | ||
1483 | dev_priv->mm.gtt_mapping = | 1506 | dev_priv->mm.gtt_mapping = |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index b1fe0edda955..ed3224c37423 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -412,7 +412,6 @@ static void gen6_queue_rps_work(struct drm_i915_private *dev_priv, | |||
412 | */ | 412 | */ |
413 | 413 | ||
414 | spin_lock_irqsave(&dev_priv->rps_lock, flags); | 414 | spin_lock_irqsave(&dev_priv->rps_lock, flags); |
415 | WARN(dev_priv->pm_iir & pm_iir, "Missed a PM interrupt\n"); | ||
416 | dev_priv->pm_iir |= pm_iir; | 415 | dev_priv->pm_iir |= pm_iir; |
417 | I915_WRITE(GEN6_PMIMR, dev_priv->pm_iir); | 416 | I915_WRITE(GEN6_PMIMR, dev_priv->pm_iir); |
418 | POSTING_READ(GEN6_PMIMR); | 417 | POSTING_READ(GEN6_PMIMR); |
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 0ede02a99d91..a748e5cabe14 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
@@ -740,8 +740,11 @@ static void i915_restore_display(struct drm_device *dev) | |||
740 | if (HAS_PCH_SPLIT(dev)) { | 740 | if (HAS_PCH_SPLIT(dev)) { |
741 | I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->saveBLC_PWM_CTL); | 741 | I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->saveBLC_PWM_CTL); |
742 | I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->saveBLC_PWM_CTL2); | 742 | I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->saveBLC_PWM_CTL2); |
743 | I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->saveBLC_CPU_PWM_CTL); | 743 | /* NOTE: BLC_PWM_CPU_CTL must be written after BLC_PWM_CPU_CTL2; |
744 | * otherwise we get blank eDP screen after S3 on some machines | ||
745 | */ | ||
744 | I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->saveBLC_CPU_PWM_CTL2); | 746 | I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->saveBLC_CPU_PWM_CTL2); |
747 | I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->saveBLC_CPU_PWM_CTL); | ||
745 | I915_WRITE(PCH_PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS); | 748 | I915_WRITE(PCH_PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS); |
746 | I915_WRITE(PCH_PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS); | 749 | I915_WRITE(PCH_PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS); |
747 | I915_WRITE(PCH_PP_DIVISOR, dev_priv->savePP_DIVISOR); | 750 | I915_WRITE(PCH_PP_DIVISOR, dev_priv->savePP_DIVISOR); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a7c727d0c105..a8538ac0299d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6921,19 +6921,6 @@ static void i915_disable_vga(struct drm_device *dev) | |||
6921 | POSTING_READ(vga_reg); | 6921 | POSTING_READ(vga_reg); |
6922 | } | 6922 | } |
6923 | 6923 | ||
6924 | static void ivb_pch_pwm_override(struct drm_device *dev) | ||
6925 | { | ||
6926 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
6927 | |||
6928 | /* | ||
6929 | * IVB has CPU eDP backlight regs too, set things up to let the | ||
6930 | * PCH regs control the backlight | ||
6931 | */ | ||
6932 | I915_WRITE(BLC_PWM_CPU_CTL2, PWM_ENABLE); | ||
6933 | I915_WRITE(BLC_PWM_CPU_CTL, 0); | ||
6934 | I915_WRITE(BLC_PWM_PCH_CTL1, PWM_ENABLE | (1<<30)); | ||
6935 | } | ||
6936 | |||
6937 | void intel_modeset_init_hw(struct drm_device *dev) | 6924 | void intel_modeset_init_hw(struct drm_device *dev) |
6938 | { | 6925 | { |
6939 | struct drm_i915_private *dev_priv = dev->dev_private; | 6926 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -6950,9 +6937,6 @@ void intel_modeset_init_hw(struct drm_device *dev) | |||
6950 | gen6_enable_rps(dev_priv); | 6937 | gen6_enable_rps(dev_priv); |
6951 | gen6_update_ring_freq(dev_priv); | 6938 | gen6_update_ring_freq(dev_priv); |
6952 | } | 6939 | } |
6953 | |||
6954 | if (IS_IVYBRIDGE(dev)) | ||
6955 | ivb_pch_pwm_override(dev); | ||
6956 | } | 6940 | } |
6957 | 6941 | ||
6958 | void intel_modeset_init(struct drm_device *dev) | 6942 | void intel_modeset_init(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 153b9a15469b..1074bc5dd418 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
@@ -467,7 +467,7 @@ int nouveau_fbcon_init(struct drm_device *dev) | |||
467 | nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; | 467 | nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; |
468 | 468 | ||
469 | ret = drm_fb_helper_init(dev, &nfbdev->helper, | 469 | ret = drm_fb_helper_init(dev, &nfbdev->helper, |
470 | nv_two_heads(dev) ? 2 : 1, 4); | 470 | dev->mode_config.num_crtc, 4); |
471 | if (ret) { | 471 | if (ret) { |
472 | kfree(nfbdev); | 472 | kfree(nfbdev); |
473 | return ret; | 473 | return ret; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index a89240e5fb29..a25cf2cb931f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c | |||
@@ -1,3 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Red Hat Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Authors: Dave Airlie | ||
23 | */ | ||
1 | 24 | ||
2 | #include "drmP.h" | 25 | #include "drmP.h" |
3 | #include "drm.h" | 26 | #include "drm.h" |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 01d77d1554f4..3904d7964a4b 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -1149,7 +1149,9 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, | |||
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | if (tiling_flags & RADEON_TILING_MACRO) { | 1151 | if (tiling_flags & RADEON_TILING_MACRO) { |
1152 | if (rdev->family >= CHIP_CAYMAN) | 1152 | if (rdev->family >= CHIP_TAHITI) |
1153 | tmp = rdev->config.si.tile_config; | ||
1154 | else if (rdev->family >= CHIP_CAYMAN) | ||
1153 | tmp = rdev->config.cayman.tile_config; | 1155 | tmp = rdev->config.cayman.tile_config; |
1154 | else | 1156 | else |
1155 | tmp = rdev->config.evergreen.tile_config; | 1157 | tmp = rdev->config.evergreen.tile_config; |
@@ -1177,6 +1179,12 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, | |||
1177 | } else if (tiling_flags & RADEON_TILING_MICRO) | 1179 | } else if (tiling_flags & RADEON_TILING_MICRO) |
1178 | fb_format |= EVERGREEN_GRPH_ARRAY_MODE(EVERGREEN_GRPH_ARRAY_1D_TILED_THIN1); | 1180 | fb_format |= EVERGREEN_GRPH_ARRAY_MODE(EVERGREEN_GRPH_ARRAY_1D_TILED_THIN1); |
1179 | 1181 | ||
1182 | if ((rdev->family == CHIP_TAHITI) || | ||
1183 | (rdev->family == CHIP_PITCAIRN)) | ||
1184 | fb_format |= SI_GRPH_PIPE_CONFIG(SI_ADDR_SURF_P8_32x32_8x16); | ||
1185 | else if (rdev->family == CHIP_VERDE) | ||
1186 | fb_format |= SI_GRPH_PIPE_CONFIG(SI_ADDR_SURF_P4_8x16); | ||
1187 | |||
1180 | switch (radeon_crtc->crtc_id) { | 1188 | switch (radeon_crtc->crtc_id) { |
1181 | case 0: | 1189 | case 0: |
1182 | WREG32(AVIVO_D1VGA_CONTROL, 0); | 1190 | WREG32(AVIVO_D1VGA_CONTROL, 0); |
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 59d44937dd9f..84b648a7ddd8 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c | |||
@@ -289,8 +289,9 @@ int radeon_vm_manager_init(struct radeon_device *rdev) | |||
289 | rdev->vm_manager.enabled = false; | 289 | rdev->vm_manager.enabled = false; |
290 | 290 | ||
291 | /* mark first vm as always in use, it's the system one */ | 291 | /* mark first vm as always in use, it's the system one */ |
292 | /* allocate enough for 2 full VM pts */ | ||
292 | r = radeon_sa_bo_manager_init(rdev, &rdev->vm_manager.sa_manager, | 293 | r = radeon_sa_bo_manager_init(rdev, &rdev->vm_manager.sa_manager, |
293 | rdev->vm_manager.max_pfn * 8, | 294 | rdev->vm_manager.max_pfn * 8 * 2, |
294 | RADEON_GEM_DOMAIN_VRAM); | 295 | RADEON_GEM_DOMAIN_VRAM); |
295 | if (r) { | 296 | if (r) { |
296 | dev_err(rdev->dev, "failed to allocate vm bo (%dKB)\n", | 297 | dev_err(rdev->dev, "failed to allocate vm bo (%dKB)\n", |
@@ -633,7 +634,15 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm) | |||
633 | mutex_init(&vm->mutex); | 634 | mutex_init(&vm->mutex); |
634 | INIT_LIST_HEAD(&vm->list); | 635 | INIT_LIST_HEAD(&vm->list); |
635 | INIT_LIST_HEAD(&vm->va); | 636 | INIT_LIST_HEAD(&vm->va); |
636 | vm->last_pfn = 0; | 637 | /* SI requires equal sized PTs for all VMs, so always set |
638 | * last_pfn to max_pfn. cayman allows variable sized | ||
639 | * pts so we can grow then as needed. Once we switch | ||
640 | * to two level pts we can unify this again. | ||
641 | */ | ||
642 | if (rdev->family >= CHIP_TAHITI) | ||
643 | vm->last_pfn = rdev->vm_manager.max_pfn; | ||
644 | else | ||
645 | vm->last_pfn = 0; | ||
637 | /* map the ib pool buffer at 0 in virtual address space, set | 646 | /* map the ib pool buffer at 0 in virtual address space, set |
638 | * read only | 647 | * read only |
639 | */ | 648 | */ |
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index f28bd4b7ef98..21ec9f5653ce 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c | |||
@@ -292,6 +292,7 @@ int radeon_gem_mmap_ioctl(struct drm_device *dev, void *data, | |||
292 | int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, | 292 | int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, |
293 | struct drm_file *filp) | 293 | struct drm_file *filp) |
294 | { | 294 | { |
295 | struct radeon_device *rdev = dev->dev_private; | ||
295 | struct drm_radeon_gem_busy *args = data; | 296 | struct drm_radeon_gem_busy *args = data; |
296 | struct drm_gem_object *gobj; | 297 | struct drm_gem_object *gobj; |
297 | struct radeon_bo *robj; | 298 | struct radeon_bo *robj; |
@@ -317,13 +318,14 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, | |||
317 | break; | 318 | break; |
318 | } | 319 | } |
319 | drm_gem_object_unreference_unlocked(gobj); | 320 | drm_gem_object_unreference_unlocked(gobj); |
320 | r = radeon_gem_handle_lockup(robj->rdev, r); | 321 | r = radeon_gem_handle_lockup(rdev, r); |
321 | return r; | 322 | return r; |
322 | } | 323 | } |
323 | 324 | ||
324 | int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, | 325 | int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, |
325 | struct drm_file *filp) | 326 | struct drm_file *filp) |
326 | { | 327 | { |
328 | struct radeon_device *rdev = dev->dev_private; | ||
327 | struct drm_radeon_gem_wait_idle *args = data; | 329 | struct drm_radeon_gem_wait_idle *args = data; |
328 | struct drm_gem_object *gobj; | 330 | struct drm_gem_object *gobj; |
329 | struct radeon_bo *robj; | 331 | struct radeon_bo *robj; |
@@ -336,10 +338,10 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, | |||
336 | robj = gem_to_radeon_bo(gobj); | 338 | robj = gem_to_radeon_bo(gobj); |
337 | r = radeon_bo_wait(robj, NULL, false); | 339 | r = radeon_bo_wait(robj, NULL, false); |
338 | /* callback hw specific functions if any */ | 340 | /* callback hw specific functions if any */ |
339 | if (robj->rdev->asic->ioctl_wait_idle) | 341 | if (rdev->asic->ioctl_wait_idle) |
340 | robj->rdev->asic->ioctl_wait_idle(robj->rdev, robj); | 342 | robj->rdev->asic->ioctl_wait_idle(rdev, robj); |
341 | drm_gem_object_unreference_unlocked(gobj); | 343 | drm_gem_object_unreference_unlocked(gobj); |
342 | r = radeon_gem_handle_lockup(robj->rdev, r); | 344 | r = radeon_gem_handle_lockup(rdev, r); |
343 | return r; | 345 | return r; |
344 | } | 346 | } |
345 | 347 | ||
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index c7b61f16ecfd..0b0279291a73 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -2365,12 +2365,12 @@ int si_pcie_gart_enable(struct radeon_device *rdev) | |||
2365 | WREG32(0x15DC, 0); | 2365 | WREG32(0x15DC, 0); |
2366 | 2366 | ||
2367 | /* empty context1-15 */ | 2367 | /* empty context1-15 */ |
2368 | /* FIXME start with 1G, once using 2 level pt switch to full | 2368 | /* FIXME start with 4G, once using 2 level pt switch to full |
2369 | * vm size space | 2369 | * vm size space |
2370 | */ | 2370 | */ |
2371 | /* set vm size, must be a multiple of 4 */ | 2371 | /* set vm size, must be a multiple of 4 */ |
2372 | WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0); | 2372 | WREG32(VM_CONTEXT1_PAGE_TABLE_START_ADDR, 0); |
2373 | WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, (1 << 30) / RADEON_GPU_PAGE_SIZE); | 2373 | WREG32(VM_CONTEXT1_PAGE_TABLE_END_ADDR, rdev->vm_manager.max_pfn); |
2374 | for (i = 1; i < 16; i++) { | 2374 | for (i = 1; i < 16; i++) { |
2375 | if (i < 8) | 2375 | if (i < 8) |
2376 | WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2), | 2376 | WREG32(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (i << 2), |
diff --git a/drivers/gpu/drm/radeon/si_reg.h b/drivers/gpu/drm/radeon/si_reg.h index eda938a7cb6e..501f9d431d57 100644 --- a/drivers/gpu/drm/radeon/si_reg.h +++ b/drivers/gpu/drm/radeon/si_reg.h | |||
@@ -30,4 +30,76 @@ | |||
30 | #define SI_DC_GPIO_HPD_EN 0x65b8 | 30 | #define SI_DC_GPIO_HPD_EN 0x65b8 |
31 | #define SI_DC_GPIO_HPD_Y 0x65bc | 31 | #define SI_DC_GPIO_HPD_Y 0x65bc |
32 | 32 | ||
33 | #define SI_GRPH_CONTROL 0x6804 | ||
34 | # define SI_GRPH_DEPTH(x) (((x) & 0x3) << 0) | ||
35 | # define SI_GRPH_DEPTH_8BPP 0 | ||
36 | # define SI_GRPH_DEPTH_16BPP 1 | ||
37 | # define SI_GRPH_DEPTH_32BPP 2 | ||
38 | # define SI_GRPH_NUM_BANKS(x) (((x) & 0x3) << 2) | ||
39 | # define SI_ADDR_SURF_2_BANK 0 | ||
40 | # define SI_ADDR_SURF_4_BANK 1 | ||
41 | # define SI_ADDR_SURF_8_BANK 2 | ||
42 | # define SI_ADDR_SURF_16_BANK 3 | ||
43 | # define SI_GRPH_Z(x) (((x) & 0x3) << 4) | ||
44 | # define SI_GRPH_BANK_WIDTH(x) (((x) & 0x3) << 6) | ||
45 | # define SI_ADDR_SURF_BANK_WIDTH_1 0 | ||
46 | # define SI_ADDR_SURF_BANK_WIDTH_2 1 | ||
47 | # define SI_ADDR_SURF_BANK_WIDTH_4 2 | ||
48 | # define SI_ADDR_SURF_BANK_WIDTH_8 3 | ||
49 | # define SI_GRPH_FORMAT(x) (((x) & 0x7) << 8) | ||
50 | /* 8 BPP */ | ||
51 | # define SI_GRPH_FORMAT_INDEXED 0 | ||
52 | /* 16 BPP */ | ||
53 | # define SI_GRPH_FORMAT_ARGB1555 0 | ||
54 | # define SI_GRPH_FORMAT_ARGB565 1 | ||
55 | # define SI_GRPH_FORMAT_ARGB4444 2 | ||
56 | # define SI_GRPH_FORMAT_AI88 3 | ||
57 | # define SI_GRPH_FORMAT_MONO16 4 | ||
58 | # define SI_GRPH_FORMAT_BGRA5551 5 | ||
59 | /* 32 BPP */ | ||
60 | # define SI_GRPH_FORMAT_ARGB8888 0 | ||
61 | # define SI_GRPH_FORMAT_ARGB2101010 1 | ||
62 | # define SI_GRPH_FORMAT_32BPP_DIG 2 | ||
63 | # define SI_GRPH_FORMAT_8B_ARGB2101010 3 | ||
64 | # define SI_GRPH_FORMAT_BGRA1010102 4 | ||
65 | # define SI_GRPH_FORMAT_8B_BGRA1010102 5 | ||
66 | # define SI_GRPH_FORMAT_RGB111110 6 | ||
67 | # define SI_GRPH_FORMAT_BGR101111 7 | ||
68 | # define SI_GRPH_BANK_HEIGHT(x) (((x) & 0x3) << 11) | ||
69 | # define SI_ADDR_SURF_BANK_HEIGHT_1 0 | ||
70 | # define SI_ADDR_SURF_BANK_HEIGHT_2 1 | ||
71 | # define SI_ADDR_SURF_BANK_HEIGHT_4 2 | ||
72 | # define SI_ADDR_SURF_BANK_HEIGHT_8 3 | ||
73 | # define SI_GRPH_TILE_SPLIT(x) (((x) & 0x7) << 13) | ||
74 | # define SI_ADDR_SURF_TILE_SPLIT_64B 0 | ||
75 | # define SI_ADDR_SURF_TILE_SPLIT_128B 1 | ||
76 | # define SI_ADDR_SURF_TILE_SPLIT_256B 2 | ||
77 | # define SI_ADDR_SURF_TILE_SPLIT_512B 3 | ||
78 | # define SI_ADDR_SURF_TILE_SPLIT_1KB 4 | ||
79 | # define SI_ADDR_SURF_TILE_SPLIT_2KB 5 | ||
80 | # define SI_ADDR_SURF_TILE_SPLIT_4KB 6 | ||
81 | # define SI_GRPH_MACRO_TILE_ASPECT(x) (((x) & 0x3) << 18) | ||
82 | # define SI_ADDR_SURF_MACRO_TILE_ASPECT_1 0 | ||
83 | # define SI_ADDR_SURF_MACRO_TILE_ASPECT_2 1 | ||
84 | # define SI_ADDR_SURF_MACRO_TILE_ASPECT_4 2 | ||
85 | # define SI_ADDR_SURF_MACRO_TILE_ASPECT_8 3 | ||
86 | # define SI_GRPH_ARRAY_MODE(x) (((x) & 0x7) << 20) | ||
87 | # define SI_GRPH_ARRAY_LINEAR_GENERAL 0 | ||
88 | # define SI_GRPH_ARRAY_LINEAR_ALIGNED 1 | ||
89 | # define SI_GRPH_ARRAY_1D_TILED_THIN1 2 | ||
90 | # define SI_GRPH_ARRAY_2D_TILED_THIN1 4 | ||
91 | # define SI_GRPH_PIPE_CONFIG(x) (((x) & 0x1f) << 24) | ||
92 | # define SI_ADDR_SURF_P2 0 | ||
93 | # define SI_ADDR_SURF_P4_8x16 4 | ||
94 | # define SI_ADDR_SURF_P4_16x16 5 | ||
95 | # define SI_ADDR_SURF_P4_16x32 6 | ||
96 | # define SI_ADDR_SURF_P4_32x32 7 | ||
97 | # define SI_ADDR_SURF_P8_16x16_8x16 8 | ||
98 | # define SI_ADDR_SURF_P8_16x32_8x16 9 | ||
99 | # define SI_ADDR_SURF_P8_32x32_8x16 10 | ||
100 | # define SI_ADDR_SURF_P8_16x32_16x16 11 | ||
101 | # define SI_ADDR_SURF_P8_32x32_16x16 12 | ||
102 | # define SI_ADDR_SURF_P8_32x32_16x32 13 | ||
103 | # define SI_ADDR_SURF_P8_32x64_32x32 14 | ||
104 | |||
33 | #endif | 105 | #endif |
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index a8d5f09428c7..4c2d836a0893 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c | |||
@@ -61,7 +61,7 @@ static int udl_parse_vendor_descriptor(struct drm_device *dev, | |||
61 | u8 length; | 61 | u8 length; |
62 | u16 key; | 62 | u16 key; |
63 | 63 | ||
64 | key = *((u16 *) desc); | 64 | key = le16_to_cpu(*((u16 *) desc)); |
65 | desc += sizeof(u16); | 65 | desc += sizeof(u16); |
66 | length = *desc; | 66 | length = *desc; |
67 | desc++; | 67 | desc++; |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 034c80a10f1f..bef04c192768 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -1,20 +1,11 @@ | |||
1 | # | 1 | # |
2 | # HID driver configuration | 2 | # HID driver configuration |
3 | # | 3 | # |
4 | menuconfig HID_SUPPORT | 4 | menu "HID support" |
5 | bool "HID Devices" | 5 | depends on INPUT |
6 | depends on INPUT | ||
7 | default y | ||
8 | ---help--- | ||
9 | Say Y here to get to see options for various computer-human interface | ||
10 | device drivers. This option alone does not add any kernel code. | ||
11 | |||
12 | If you say N, all options in this submenu will be skipped and disabled. | ||
13 | |||
14 | if HID_SUPPORT | ||
15 | 6 | ||
16 | config HID | 7 | config HID |
17 | tristate "Generic HID support" | 8 | tristate "HID bus support" |
18 | depends on INPUT | 9 | depends on INPUT |
19 | default y | 10 | default y |
20 | ---help--- | 11 | ---help--- |
@@ -23,14 +14,17 @@ config HID | |||
23 | most commonly used to refer to the USB-HID specification, but other | 14 | most commonly used to refer to the USB-HID specification, but other |
24 | devices (such as, but not strictly limited to, Bluetooth) are | 15 | devices (such as, but not strictly limited to, Bluetooth) are |
25 | designed using HID specification (this involves certain keyboards, | 16 | designed using HID specification (this involves certain keyboards, |
26 | mice, tablets, etc). This option compiles into kernel the generic | 17 | mice, tablets, etc). This option adds the HID bus to the kernel, |
27 | HID layer code (parser, usages, etc.), which can then be used by | 18 | together with generic HID layer code. The HID devices are added and |
28 | transport-specific HID implementation (like USB or Bluetooth). | 19 | removed from the HID bus by the transport-layer drivers, such as |
20 | usbhid (USB_HID) and hidp (BT_HIDP). | ||
29 | 21 | ||
30 | For docs and specs, see http://www.usb.org/developers/hidpage/ | 22 | For docs and specs, see http://www.usb.org/developers/hidpage/ |
31 | 23 | ||
32 | If unsure, say Y. | 24 | If unsure, say Y. |
33 | 25 | ||
26 | if HID | ||
27 | |||
34 | config HID_BATTERY_STRENGTH | 28 | config HID_BATTERY_STRENGTH |
35 | bool "Battery level reporting for HID devices" | 29 | bool "Battery level reporting for HID devices" |
36 | depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY | 30 | depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY |
@@ -59,23 +53,22 @@ config HIDRAW | |||
59 | 53 | ||
60 | If unsure, say Y. | 54 | If unsure, say Y. |
61 | 55 | ||
62 | source "drivers/hid/usbhid/Kconfig" | ||
63 | |||
64 | menu "Special HID drivers" | ||
65 | depends on HID | ||
66 | |||
67 | config HID_GENERIC | 56 | config HID_GENERIC |
68 | tristate "Generic HID driver" | 57 | tristate "Generic HID driver" |
69 | depends on HID | 58 | depends on HID |
70 | default y | 59 | default HID |
71 | ---help--- | 60 | ---help--- |
72 | Support for generic HID devices. | 61 | Support for generic devices on the HID bus. This includes most |
62 | keyboards and mice, joysticks, tablets and digitizers. | ||
73 | 63 | ||
74 | To compile this driver as a module, choose M here: the module | 64 | To compile this driver as a module, choose M here: the module |
75 | will be called hid-generic. | 65 | will be called hid-generic. |
76 | 66 | ||
77 | If unsure, say Y. | 67 | If unsure, say Y. |
78 | 68 | ||
69 | menu "Special HID drivers" | ||
70 | depends on HID | ||
71 | |||
79 | config HID_A4TECH | 72 | config HID_A4TECH |
80 | tristate "A4 tech mice" if EXPERT | 73 | tristate "A4 tech mice" if EXPERT |
81 | depends on USB_HID | 74 | depends on USB_HID |
@@ -662,4 +655,8 @@ config HID_ZYDACRON | |||
662 | 655 | ||
663 | endmenu | 656 | endmenu |
664 | 657 | ||
665 | endif # HID_SUPPORT | 658 | endif # HID |
659 | |||
660 | source "drivers/hid/usbhid/Kconfig" | ||
661 | |||
662 | endmenu | ||
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8e3a6b261477..6ac0286b5375 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1880,6 +1880,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1880 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)}, | 1880 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)}, |
1881 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM2)}, | 1881 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM2)}, |
1882 | { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) }, | 1882 | { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) }, |
1883 | { HID_USB_DEVICE(USB_VENDOR_ID_AXENTIA, USB_DEVICE_ID_AXENTIA_FM_RADIO) }, | ||
1883 | { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, | 1884 | { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, |
1884 | { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, | 1885 | { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, |
1885 | { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, | 1886 | { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 9373f535dfe9..d1cdd2d28409 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -160,6 +160,9 @@ | |||
160 | #define USB_VENDOR_ID_AVERMEDIA 0x07ca | 160 | #define USB_VENDOR_ID_AVERMEDIA 0x07ca |
161 | #define USB_DEVICE_ID_AVER_FM_MR800 0xb800 | 161 | #define USB_DEVICE_ID_AVER_FM_MR800 0xb800 |
162 | 162 | ||
163 | #define USB_VENDOR_ID_AXENTIA 0x12cf | ||
164 | #define USB_DEVICE_ID_AXENTIA_FM_RADIO 0x7111 | ||
165 | |||
163 | #define USB_VENDOR_ID_BAANTO 0x2453 | 166 | #define USB_VENDOR_ID_BAANTO 0x2453 |
164 | #define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100 | 167 | #define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100 |
165 | 168 | ||
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 5e8a7ed42344..0f9c146fc00d 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c | |||
@@ -436,27 +436,37 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev, | |||
436 | 436 | ||
437 | static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) | 437 | static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) |
438 | { | 438 | { |
439 | struct dj_report dj_report; | 439 | struct dj_report *dj_report; |
440 | int retval; | ||
440 | 441 | ||
441 | memset(&dj_report, 0, sizeof(dj_report)); | 442 | dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL); |
442 | dj_report.report_id = REPORT_ID_DJ_SHORT; | 443 | if (!dj_report) |
443 | dj_report.device_index = 0xFF; | 444 | return -ENOMEM; |
444 | dj_report.report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES; | 445 | dj_report->report_id = REPORT_ID_DJ_SHORT; |
445 | return logi_dj_recv_send_report(djrcv_dev, &dj_report); | 446 | dj_report->device_index = 0xFF; |
447 | dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES; | ||
448 | retval = logi_dj_recv_send_report(djrcv_dev, dj_report); | ||
449 | kfree(dj_report); | ||
450 | return retval; | ||
446 | } | 451 | } |
447 | 452 | ||
448 | static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, | 453 | static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, |
449 | unsigned timeout) | 454 | unsigned timeout) |
450 | { | 455 | { |
451 | struct dj_report dj_report; | 456 | struct dj_report *dj_report; |
457 | int retval; | ||
452 | 458 | ||
453 | memset(&dj_report, 0, sizeof(dj_report)); | 459 | dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL); |
454 | dj_report.report_id = REPORT_ID_DJ_SHORT; | 460 | if (!dj_report) |
455 | dj_report.device_index = 0xFF; | 461 | return -ENOMEM; |
456 | dj_report.report_type = REPORT_TYPE_CMD_SWITCH; | 462 | dj_report->report_id = REPORT_ID_DJ_SHORT; |
457 | dj_report.report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F; | 463 | dj_report->device_index = 0xFF; |
458 | dj_report.report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = (u8)timeout; | 464 | dj_report->report_type = REPORT_TYPE_CMD_SWITCH; |
459 | return logi_dj_recv_send_report(djrcv_dev, &dj_report); | 465 | dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F; |
466 | dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = (u8)timeout; | ||
467 | retval = logi_dj_recv_send_report(djrcv_dev, dj_report); | ||
468 | kfree(dj_report); | ||
469 | return retval; | ||
460 | } | 470 | } |
461 | 471 | ||
462 | 472 | ||
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 7cf3ffe4b7bc..40ac6654f1d1 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c | |||
@@ -426,8 +426,10 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h | |||
426 | __set_bit(EV_ABS, input->evbit); | 426 | __set_bit(EV_ABS, input->evbit); |
427 | 427 | ||
428 | input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0); | 428 | input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0); |
429 | input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 4, 0); | 429 | input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255 << 2, |
430 | input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255, 4, 0); | 430 | 4, 0); |
431 | input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255 << 2, | ||
432 | 4, 0); | ||
431 | input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0); | 433 | input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0); |
432 | 434 | ||
433 | /* Note: Touch Y position from the device is inverted relative | 435 | /* Note: Touch Y position from the device is inverted relative |
diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig index 0f20fd17cf06..0108c5991a04 100644 --- a/drivers/hid/usbhid/Kconfig +++ b/drivers/hid/usbhid/Kconfig | |||
@@ -1,13 +1,13 @@ | |||
1 | comment "USB Input Devices" | 1 | menu "USB HID support" |
2 | depends on USB | 2 | depends on USB |
3 | 3 | ||
4 | config USB_HID | 4 | config USB_HID |
5 | tristate "USB Human Interface Device (full HID) support" | 5 | tristate "USB HID transport layer" |
6 | default y | 6 | default y |
7 | depends on USB && INPUT | 7 | depends on USB && INPUT |
8 | select HID | 8 | select HID |
9 | ---help--- | 9 | ---help--- |
10 | Say Y here if you want full HID support to connect USB keyboards, | 10 | Say Y here if you want to connect USB keyboards, |
11 | mice, joysticks, graphic tablets, or any other HID based devices | 11 | mice, joysticks, graphic tablets, or any other HID based devices |
12 | to your computer via USB, as well as Uninterruptible Power Supply | 12 | to your computer via USB, as well as Uninterruptible Power Supply |
13 | (UPS) and monitor control devices. | 13 | (UPS) and monitor control devices. |
@@ -81,4 +81,4 @@ config USB_MOUSE | |||
81 | 81 | ||
82 | endmenu | 82 | endmenu |
83 | 83 | ||
84 | 84 | endmenu | |
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index f082e48ab113..2cde9ecf7731 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * | 8 | * |
9 | * Based on hdaps.c driver: | 9 | * Based on hdaps.c driver: |
10 | * Copyright (C) 2005 Robert Love <rml@novell.com> | 10 | * Copyright (C) 2005 Robert Love <rml@novell.com> |
11 | * Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com> | 11 | * Copyright (C) 2005 Jesper Juhl <jj@chaosbits.net> |
12 | * | 12 | * |
13 | * Fan control based on smcFanControl: | 13 | * Fan control based on smcFanControl: |
14 | * Copyright (C) 2006 Hendrik Holtmann <holtmann@mac.com> | 14 | * Copyright (C) 2006 Hendrik Holtmann <holtmann@mac.com> |
@@ -215,7 +215,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
215 | int i; | 215 | int i; |
216 | 216 | ||
217 | if (send_command(cmd) || send_argument(key)) { | 217 | if (send_command(cmd) || send_argument(key)) { |
218 | pr_warn("%s: read arg fail\n", key); | 218 | pr_warn("%.4s: read arg fail\n", key); |
219 | return -EIO; | 219 | return -EIO; |
220 | } | 220 | } |
221 | 221 | ||
@@ -223,7 +223,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | |||
223 | 223 | ||
224 | for (i = 0; i < len; i++) { | 224 | for (i = 0; i < len; i++) { |
225 | if (__wait_status(0x05)) { | 225 | if (__wait_status(0x05)) { |
226 | pr_warn("%s: read data fail\n", key); | 226 | pr_warn("%.4s: read data fail\n", key); |
227 | return -EIO; | 227 | return -EIO; |
228 | } | 228 | } |
229 | buffer[i] = inb(APPLESMC_DATA_PORT); | 229 | buffer[i] = inb(APPLESMC_DATA_PORT); |
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 7f1feb2f467a..637c51c11b44 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -693,7 +693,7 @@ static void __cpuinit get_core_online(unsigned int cpu) | |||
693 | * sensors. We check this bit only, all the early CPUs | 693 | * sensors. We check this bit only, all the early CPUs |
694 | * without thermal sensors will be filtered out. | 694 | * without thermal sensors will be filtered out. |
695 | */ | 695 | */ |
696 | if (!cpu_has(c, X86_FEATURE_DTS)) | 696 | if (!cpu_has(c, X86_FEATURE_DTHERM)) |
697 | return; | 697 | return; |
698 | 698 | ||
699 | if (!pdev) { | 699 | if (!pdev) { |
@@ -794,7 +794,7 @@ static struct notifier_block coretemp_cpu_notifier __refdata = { | |||
794 | }; | 794 | }; |
795 | 795 | ||
796 | static const struct x86_cpu_id coretemp_ids[] = { | 796 | static const struct x86_cpu_id coretemp_ids[] = { |
797 | { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTS }, | 797 | { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTHERM }, |
798 | {} | 798 | {} |
799 | }; | 799 | }; |
800 | MODULE_DEVICE_TABLE(x86cpu, coretemp_ids); | 800 | MODULE_DEVICE_TABLE(x86cpu, coretemp_ids); |
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c index 9691f664c76e..e7d234b59312 100644 --- a/drivers/hwmon/emc2103.c +++ b/drivers/hwmon/emc2103.c | |||
@@ -451,11 +451,15 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
451 | data->fan_rpm_control = true; | 451 | data->fan_rpm_control = true; |
452 | break; | 452 | break; |
453 | default: | 453 | default: |
454 | mutex_unlock(&data->update_lock); | 454 | count = -EINVAL; |
455 | return -EINVAL; | 455 | goto err; |
456 | } | 456 | } |
457 | 457 | ||
458 | read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); | 458 | result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); |
459 | if (result) { | ||
460 | count = result; | ||
461 | goto err; | ||
462 | } | ||
459 | 463 | ||
460 | if (data->fan_rpm_control) | 464 | if (data->fan_rpm_control) |
461 | conf_reg |= 0x80; | 465 | conf_reg |= 0x80; |
@@ -463,7 +467,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
463 | conf_reg &= ~0x80; | 467 | conf_reg &= ~0x80; |
464 | 468 | ||
465 | i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); | 469 | i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); |
466 | 470 | err: | |
467 | mutex_unlock(&data->update_lock); | 471 | mutex_unlock(&data->update_lock); |
468 | return count; | 472 | return count; |
469 | } | 473 | } |
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c index a9bfd6736d9a..e72ba5d2a824 100644 --- a/drivers/hwmon/jc42.c +++ b/drivers/hwmon/jc42.c | |||
@@ -590,6 +590,6 @@ abort: | |||
590 | 590 | ||
591 | module_i2c_driver(jc42_driver); | 591 | module_i2c_driver(jc42_driver); |
592 | 592 | ||
593 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 593 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
594 | MODULE_DESCRIPTION("JC42 driver"); | 594 | MODULE_DESCRIPTION("JC42 driver"); |
595 | MODULE_LICENSE("GPL"); | 595 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwmon/lineage-pem.c b/drivers/hwmon/lineage-pem.c index d264937c7f5e..bd75d2415432 100644 --- a/drivers/hwmon/lineage-pem.c +++ b/drivers/hwmon/lineage-pem.c | |||
@@ -567,6 +567,6 @@ static struct i2c_driver pem_driver = { | |||
567 | 567 | ||
568 | module_i2c_driver(pem_driver); | 568 | module_i2c_driver(pem_driver); |
569 | 569 | ||
570 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 570 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
571 | MODULE_DESCRIPTION("Lineage CPL PEM hardware monitoring driver"); | 571 | MODULE_DESCRIPTION("Lineage CPL PEM hardware monitoring driver"); |
572 | MODULE_LICENSE("GPL"); | 572 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwmon/ltc4261.c b/drivers/hwmon/ltc4261.c index 069b7d34d8f9..77476a575c4e 100644 --- a/drivers/hwmon/ltc4261.c +++ b/drivers/hwmon/ltc4261.c | |||
@@ -292,6 +292,6 @@ static struct i2c_driver ltc4261_driver = { | |||
292 | 292 | ||
293 | module_i2c_driver(ltc4261_driver); | 293 | module_i2c_driver(ltc4261_driver); |
294 | 294 | ||
295 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 295 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
296 | MODULE_DESCRIPTION("LTC4261 driver"); | 296 | MODULE_DESCRIPTION("LTC4261 driver"); |
297 | MODULE_LICENSE("GPL"); | 297 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c index 822261be84dd..019427d7a5fd 100644 --- a/drivers/hwmon/max16065.c +++ b/drivers/hwmon/max16065.c | |||
@@ -692,6 +692,6 @@ static struct i2c_driver max16065_driver = { | |||
692 | 692 | ||
693 | module_i2c_driver(max16065_driver); | 693 | module_i2c_driver(max16065_driver); |
694 | 694 | ||
695 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 695 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
696 | MODULE_DESCRIPTION("MAX16065 driver"); | 696 | MODULE_DESCRIPTION("MAX16065 driver"); |
697 | MODULE_LICENSE("GPL"); | 697 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index 61c9cf15fa52..1201a15784c3 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c | |||
@@ -345,7 +345,7 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, | |||
345 | spin_lock_init(&hwlock->lock); | 345 | spin_lock_init(&hwlock->lock); |
346 | hwlock->bank = bank; | 346 | hwlock->bank = bank; |
347 | 347 | ||
348 | ret = hwspin_lock_register_single(hwlock, i); | 348 | ret = hwspin_lock_register_single(hwlock, base_id + i); |
349 | if (ret) | 349 | if (ret) |
350 | goto reg_failed; | 350 | goto reg_failed; |
351 | } | 351 | } |
@@ -354,7 +354,7 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, | |||
354 | 354 | ||
355 | reg_failed: | 355 | reg_failed: |
356 | while (--i >= 0) | 356 | while (--i >= 0) |
357 | hwspin_lock_unregister_single(i); | 357 | hwspin_lock_unregister_single(base_id + i); |
358 | return ret; | 358 | return ret; |
359 | } | 359 | } |
360 | EXPORT_SYMBOL_GPL(hwspin_lock_register); | 360 | EXPORT_SYMBOL_GPL(hwspin_lock_register); |
diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig index 56eecefcec75..2ec93da41e2c 100644 --- a/drivers/iio/Kconfig +++ b/drivers/iio/Kconfig | |||
@@ -8,8 +8,7 @@ menuconfig IIO | |||
8 | help | 8 | help |
9 | The industrial I/O subsystem provides a unified framework for | 9 | The industrial I/O subsystem provides a unified framework for |
10 | drivers for many different types of embedded sensors using a | 10 | drivers for many different types of embedded sensors using a |
11 | number of different physical interfaces (i2c, spi, etc). See | 11 | number of different physical interfaces (i2c, spi, etc). |
12 | Documentation/iio for more information. | ||
13 | 12 | ||
14 | if IIO | 13 | if IIO |
15 | 14 | ||
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 1ddd8861c71b..4f947e4377ef 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
@@ -661,7 +661,6 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev) | |||
661 | * New channel registration method - relies on the fact a group does | 661 | * New channel registration method - relies on the fact a group does |
662 | * not need to be initialized if it is name is NULL. | 662 | * not need to be initialized if it is name is NULL. |
663 | */ | 663 | */ |
664 | INIT_LIST_HEAD(&indio_dev->channel_attr_list); | ||
665 | if (indio_dev->channels) | 664 | if (indio_dev->channels) |
666 | for (i = 0; i < indio_dev->num_channels; i++) { | 665 | for (i = 0; i < indio_dev->num_channels; i++) { |
667 | ret = iio_device_add_channel_sysfs(indio_dev, | 666 | ret = iio_device_add_channel_sysfs(indio_dev, |
@@ -725,12 +724,16 @@ static void iio_device_unregister_sysfs(struct iio_dev *indio_dev) | |||
725 | static void iio_dev_release(struct device *device) | 724 | static void iio_dev_release(struct device *device) |
726 | { | 725 | { |
727 | struct iio_dev *indio_dev = dev_to_iio_dev(device); | 726 | struct iio_dev *indio_dev = dev_to_iio_dev(device); |
728 | cdev_del(&indio_dev->chrdev); | 727 | if (indio_dev->chrdev.dev) |
728 | cdev_del(&indio_dev->chrdev); | ||
729 | if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) | 729 | if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) |
730 | iio_device_unregister_trigger_consumer(indio_dev); | 730 | iio_device_unregister_trigger_consumer(indio_dev); |
731 | iio_device_unregister_eventset(indio_dev); | 731 | iio_device_unregister_eventset(indio_dev); |
732 | iio_device_unregister_sysfs(indio_dev); | 732 | iio_device_unregister_sysfs(indio_dev); |
733 | iio_device_unregister_debugfs(indio_dev); | 733 | iio_device_unregister_debugfs(indio_dev); |
734 | |||
735 | ida_simple_remove(&iio_ida, indio_dev->id); | ||
736 | kfree(indio_dev); | ||
734 | } | 737 | } |
735 | 738 | ||
736 | static struct device_type iio_dev_type = { | 739 | static struct device_type iio_dev_type = { |
@@ -761,6 +764,7 @@ struct iio_dev *iio_device_alloc(int sizeof_priv) | |||
761 | dev_set_drvdata(&dev->dev, (void *)dev); | 764 | dev_set_drvdata(&dev->dev, (void *)dev); |
762 | mutex_init(&dev->mlock); | 765 | mutex_init(&dev->mlock); |
763 | mutex_init(&dev->info_exist_lock); | 766 | mutex_init(&dev->info_exist_lock); |
767 | INIT_LIST_HEAD(&dev->channel_attr_list); | ||
764 | 768 | ||
765 | dev->id = ida_simple_get(&iio_ida, 0, 0, GFP_KERNEL); | 769 | dev->id = ida_simple_get(&iio_ida, 0, 0, GFP_KERNEL); |
766 | if (dev->id < 0) { | 770 | if (dev->id < 0) { |
@@ -778,10 +782,8 @@ EXPORT_SYMBOL(iio_device_alloc); | |||
778 | 782 | ||
779 | void iio_device_free(struct iio_dev *dev) | 783 | void iio_device_free(struct iio_dev *dev) |
780 | { | 784 | { |
781 | if (dev) { | 785 | if (dev) |
782 | ida_simple_remove(&iio_ida, dev->id); | 786 | put_device(&dev->dev); |
783 | kfree(dev); | ||
784 | } | ||
785 | } | 787 | } |
786 | EXPORT_SYMBOL(iio_device_free); | 788 | EXPORT_SYMBOL(iio_device_free); |
787 | 789 | ||
@@ -902,7 +904,7 @@ void iio_device_unregister(struct iio_dev *indio_dev) | |||
902 | mutex_lock(&indio_dev->info_exist_lock); | 904 | mutex_lock(&indio_dev->info_exist_lock); |
903 | indio_dev->info = NULL; | 905 | indio_dev->info = NULL; |
904 | mutex_unlock(&indio_dev->info_exist_lock); | 906 | mutex_unlock(&indio_dev->info_exist_lock); |
905 | device_unregister(&indio_dev->dev); | 907 | device_del(&indio_dev->dev); |
906 | } | 908 | } |
907 | EXPORT_SYMBOL(iio_device_unregister); | 909 | EXPORT_SYMBOL(iio_device_unregister); |
908 | subsys_initcall(iio_init); | 910 | subsys_initcall(iio_init); |
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 55d5642eb10a..2e826f9702c6 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -1184,7 +1184,7 @@ static void cma_set_req_event_data(struct rdma_cm_event *event, | |||
1184 | 1184 | ||
1185 | static int cma_check_req_qp_type(struct rdma_cm_id *id, struct ib_cm_event *ib_event) | 1185 | static int cma_check_req_qp_type(struct rdma_cm_id *id, struct ib_cm_event *ib_event) |
1186 | { | 1186 | { |
1187 | return (((ib_event->event == IB_CM_REQ_RECEIVED) || | 1187 | return (((ib_event->event == IB_CM_REQ_RECEIVED) && |
1188 | (ib_event->param.req_rcvd.qp_type == id->qp_type)) || | 1188 | (ib_event->param.req_rcvd.qp_type == id->qp_type)) || |
1189 | ((ib_event->event == IB_CM_SIDR_REQ_RECEIVED) && | 1189 | ((ib_event->event == IB_CM_SIDR_REQ_RECEIVED) && |
1190 | (id->qp_type == IB_QPT_UD)) || | 1190 | (id->qp_type == IB_QPT_UD)) || |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h index 037f5cea85bd..48970af23679 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma.h | |||
@@ -61,6 +61,7 @@ struct ocrdma_dev_attr { | |||
61 | u32 max_inline_data; | 61 | u32 max_inline_data; |
62 | int max_send_sge; | 62 | int max_send_sge; |
63 | int max_recv_sge; | 63 | int max_recv_sge; |
64 | int max_srq_sge; | ||
64 | int max_mr; | 65 | int max_mr; |
65 | u64 max_mr_size; | 66 | u64 max_mr_size; |
66 | u32 max_num_mr_pbl; | 67 | u32 max_num_mr_pbl; |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 9343a1522977..71942af4fce9 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c | |||
@@ -990,8 +990,6 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, | |||
990 | struct ocrdma_dev_attr *attr, | 990 | struct ocrdma_dev_attr *attr, |
991 | struct ocrdma_mbx_query_config *rsp) | 991 | struct ocrdma_mbx_query_config *rsp) |
992 | { | 992 | { |
993 | int max_q_mem; | ||
994 | |||
995 | attr->max_pd = | 993 | attr->max_pd = |
996 | (rsp->max_pd_ca_ack_delay & OCRDMA_MBX_QUERY_CFG_MAX_PD_MASK) >> | 994 | (rsp->max_pd_ca_ack_delay & OCRDMA_MBX_QUERY_CFG_MAX_PD_MASK) >> |
997 | OCRDMA_MBX_QUERY_CFG_MAX_PD_SHIFT; | 995 | OCRDMA_MBX_QUERY_CFG_MAX_PD_SHIFT; |
@@ -1004,6 +1002,9 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, | |||
1004 | attr->max_recv_sge = (rsp->max_write_send_sge & | 1002 | attr->max_recv_sge = (rsp->max_write_send_sge & |
1005 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK) >> | 1003 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK) >> |
1006 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT; | 1004 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT; |
1005 | attr->max_srq_sge = (rsp->max_srq_rqe_sge & | ||
1006 | OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_MASK) >> | ||
1007 | OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_OFFSET; | ||
1007 | attr->max_ord_per_qp = (rsp->max_ird_ord_per_qp & | 1008 | attr->max_ord_per_qp = (rsp->max_ird_ord_per_qp & |
1008 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK) >> | 1009 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK) >> |
1009 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT; | 1010 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT; |
@@ -1037,18 +1038,15 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, | |||
1037 | attr->max_inline_data = | 1038 | attr->max_inline_data = |
1038 | attr->wqe_size - (sizeof(struct ocrdma_hdr_wqe) + | 1039 | attr->wqe_size - (sizeof(struct ocrdma_hdr_wqe) + |
1039 | sizeof(struct ocrdma_sge)); | 1040 | sizeof(struct ocrdma_sge)); |
1040 | max_q_mem = OCRDMA_Q_PAGE_BASE_SIZE << (OCRDMA_MAX_Q_PAGE_SIZE_CNT - 1); | ||
1041 | /* hw can queue one less then the configured size, | ||
1042 | * so publish less by one to stack. | ||
1043 | */ | ||
1044 | if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) { | 1041 | if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) { |
1045 | dev->attr.max_wqe = max_q_mem / dev->attr.wqe_size; | ||
1046 | attr->ird = 1; | 1042 | attr->ird = 1; |
1047 | attr->ird_page_size = OCRDMA_MIN_Q_PAGE_SIZE; | 1043 | attr->ird_page_size = OCRDMA_MIN_Q_PAGE_SIZE; |
1048 | attr->num_ird_pages = MAX_OCRDMA_IRD_PAGES; | 1044 | attr->num_ird_pages = MAX_OCRDMA_IRD_PAGES; |
1049 | } else | 1045 | } |
1050 | dev->attr.max_wqe = (max_q_mem / dev->attr.wqe_size) - 1; | 1046 | dev->attr.max_wqe = rsp->max_wqes_rqes_per_q >> |
1051 | dev->attr.max_rqe = (max_q_mem / dev->attr.rqe_size) - 1; | 1047 | OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET; |
1048 | dev->attr.max_rqe = rsp->max_wqes_rqes_per_q & | ||
1049 | OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_MASK; | ||
1052 | } | 1050 | } |
1053 | 1051 | ||
1054 | static int ocrdma_check_fw_config(struct ocrdma_dev *dev, | 1052 | static int ocrdma_check_fw_config(struct ocrdma_dev *dev, |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 04fef3de6d75..b050e629e9c3 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c | |||
@@ -97,13 +97,11 @@ static void ocrdma_build_sgid_mac(union ib_gid *sgid, unsigned char *mac_addr, | |||
97 | sgid->raw[15] = mac_addr[5]; | 97 | sgid->raw[15] = mac_addr[5]; |
98 | } | 98 | } |
99 | 99 | ||
100 | static void ocrdma_add_sgid(struct ocrdma_dev *dev, unsigned char *mac_addr, | 100 | static bool ocrdma_add_sgid(struct ocrdma_dev *dev, unsigned char *mac_addr, |
101 | bool is_vlan, u16 vlan_id) | 101 | bool is_vlan, u16 vlan_id) |
102 | { | 102 | { |
103 | int i; | 103 | int i; |
104 | bool found = false; | ||
105 | union ib_gid new_sgid; | 104 | union ib_gid new_sgid; |
106 | int free_idx = OCRDMA_MAX_SGID; | ||
107 | unsigned long flags; | 105 | unsigned long flags; |
108 | 106 | ||
109 | memset(&ocrdma_zero_sgid, 0, sizeof(union ib_gid)); | 107 | memset(&ocrdma_zero_sgid, 0, sizeof(union ib_gid)); |
@@ -115,23 +113,19 @@ static void ocrdma_add_sgid(struct ocrdma_dev *dev, unsigned char *mac_addr, | |||
115 | if (!memcmp(&dev->sgid_tbl[i], &ocrdma_zero_sgid, | 113 | if (!memcmp(&dev->sgid_tbl[i], &ocrdma_zero_sgid, |
116 | sizeof(union ib_gid))) { | 114 | sizeof(union ib_gid))) { |
117 | /* found free entry */ | 115 | /* found free entry */ |
118 | if (!found) { | 116 | memcpy(&dev->sgid_tbl[i], &new_sgid, |
119 | free_idx = i; | 117 | sizeof(union ib_gid)); |
120 | found = true; | 118 | spin_unlock_irqrestore(&dev->sgid_lock, flags); |
121 | break; | 119 | return true; |
122 | } | ||
123 | } else if (!memcmp(&dev->sgid_tbl[i], &new_sgid, | 120 | } else if (!memcmp(&dev->sgid_tbl[i], &new_sgid, |
124 | sizeof(union ib_gid))) { | 121 | sizeof(union ib_gid))) { |
125 | /* entry already present, no addition is required. */ | 122 | /* entry already present, no addition is required. */ |
126 | spin_unlock_irqrestore(&dev->sgid_lock, flags); | 123 | spin_unlock_irqrestore(&dev->sgid_lock, flags); |
127 | return; | 124 | return false; |
128 | } | 125 | } |
129 | } | 126 | } |
130 | /* if entry doesn't exist and if table has some space, add entry */ | ||
131 | if (found) | ||
132 | memcpy(&dev->sgid_tbl[free_idx], &new_sgid, | ||
133 | sizeof(union ib_gid)); | ||
134 | spin_unlock_irqrestore(&dev->sgid_lock, flags); | 127 | spin_unlock_irqrestore(&dev->sgid_lock, flags); |
128 | return false; | ||
135 | } | 129 | } |
136 | 130 | ||
137 | static bool ocrdma_del_sgid(struct ocrdma_dev *dev, unsigned char *mac_addr, | 131 | static bool ocrdma_del_sgid(struct ocrdma_dev *dev, unsigned char *mac_addr, |
@@ -167,7 +161,8 @@ static void ocrdma_add_default_sgid(struct ocrdma_dev *dev) | |||
167 | ocrdma_get_guid(dev, &sgid->raw[8]); | 161 | ocrdma_get_guid(dev, &sgid->raw[8]); |
168 | } | 162 | } |
169 | 163 | ||
170 | static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) | 164 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
165 | static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev) | ||
171 | { | 166 | { |
172 | struct net_device *netdev, *tmp; | 167 | struct net_device *netdev, *tmp; |
173 | u16 vlan_id; | 168 | u16 vlan_id; |
@@ -175,8 +170,6 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) | |||
175 | 170 | ||
176 | netdev = dev->nic_info.netdev; | 171 | netdev = dev->nic_info.netdev; |
177 | 172 | ||
178 | ocrdma_add_default_sgid(dev); | ||
179 | |||
180 | rcu_read_lock(); | 173 | rcu_read_lock(); |
181 | for_each_netdev_rcu(&init_net, tmp) { | 174 | for_each_netdev_rcu(&init_net, tmp) { |
182 | if (netdev == tmp || vlan_dev_real_dev(tmp) == netdev) { | 175 | if (netdev == tmp || vlan_dev_real_dev(tmp) == netdev) { |
@@ -194,10 +187,23 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) | |||
194 | } | 187 | } |
195 | } | 188 | } |
196 | rcu_read_unlock(); | 189 | rcu_read_unlock(); |
190 | } | ||
191 | #else | ||
192 | static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev) | ||
193 | { | ||
194 | |||
195 | } | ||
196 | #endif /* VLAN */ | ||
197 | |||
198 | static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) | ||
199 | { | ||
200 | ocrdma_add_default_sgid(dev); | ||
201 | ocrdma_add_vlan_sgids(dev); | ||
197 | return 0; | 202 | return 0; |
198 | } | 203 | } |
199 | 204 | ||
200 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 205 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) || \ |
206 | defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
201 | 207 | ||
202 | static int ocrdma_inet6addr_event(struct notifier_block *notifier, | 208 | static int ocrdma_inet6addr_event(struct notifier_block *notifier, |
203 | unsigned long event, void *ptr) | 209 | unsigned long event, void *ptr) |
@@ -208,6 +214,7 @@ static int ocrdma_inet6addr_event(struct notifier_block *notifier, | |||
208 | struct ib_event gid_event; | 214 | struct ib_event gid_event; |
209 | struct ocrdma_dev *dev; | 215 | struct ocrdma_dev *dev; |
210 | bool found = false; | 216 | bool found = false; |
217 | bool updated = false; | ||
211 | bool is_vlan = false; | 218 | bool is_vlan = false; |
212 | u16 vid = 0; | 219 | u16 vid = 0; |
213 | 220 | ||
@@ -233,23 +240,21 @@ static int ocrdma_inet6addr_event(struct notifier_block *notifier, | |||
233 | mutex_lock(&dev->dev_lock); | 240 | mutex_lock(&dev->dev_lock); |
234 | switch (event) { | 241 | switch (event) { |
235 | case NETDEV_UP: | 242 | case NETDEV_UP: |
236 | ocrdma_add_sgid(dev, netdev->dev_addr, is_vlan, vid); | 243 | updated = ocrdma_add_sgid(dev, netdev->dev_addr, is_vlan, vid); |
237 | break; | 244 | break; |
238 | case NETDEV_DOWN: | 245 | case NETDEV_DOWN: |
239 | found = ocrdma_del_sgid(dev, netdev->dev_addr, is_vlan, vid); | 246 | updated = ocrdma_del_sgid(dev, netdev->dev_addr, is_vlan, vid); |
240 | if (found) { | ||
241 | /* found the matching entry, notify | ||
242 | * the consumers about it | ||
243 | */ | ||
244 | gid_event.device = &dev->ibdev; | ||
245 | gid_event.element.port_num = 1; | ||
246 | gid_event.event = IB_EVENT_GID_CHANGE; | ||
247 | ib_dispatch_event(&gid_event); | ||
248 | } | ||
249 | break; | 247 | break; |
250 | default: | 248 | default: |
251 | break; | 249 | break; |
252 | } | 250 | } |
251 | if (updated) { | ||
252 | /* GID table updated, notify the consumers about it */ | ||
253 | gid_event.device = &dev->ibdev; | ||
254 | gid_event.element.port_num = 1; | ||
255 | gid_event.event = IB_EVENT_GID_CHANGE; | ||
256 | ib_dispatch_event(&gid_event); | ||
257 | } | ||
253 | mutex_unlock(&dev->dev_lock); | 258 | mutex_unlock(&dev->dev_lock); |
254 | return NOTIFY_OK; | 259 | return NOTIFY_OK; |
255 | } | 260 | } |
@@ -258,7 +263,7 @@ static struct notifier_block ocrdma_inet6addr_notifier = { | |||
258 | .notifier_call = ocrdma_inet6addr_event | 263 | .notifier_call = ocrdma_inet6addr_event |
259 | }; | 264 | }; |
260 | 265 | ||
261 | #endif /* IPV6 */ | 266 | #endif /* IPV6 and VLAN */ |
262 | 267 | ||
263 | static enum rdma_link_layer ocrdma_link_layer(struct ib_device *device, | 268 | static enum rdma_link_layer ocrdma_link_layer(struct ib_device *device, |
264 | u8 port_num) | 269 | u8 port_num) |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h index 7fd80cc0f037..c75cbdfa87e7 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h | |||
@@ -418,6 +418,9 @@ enum { | |||
418 | 418 | ||
419 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT = 0, | 419 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT = 0, |
420 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK = 0xFFFF, | 420 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK = 0xFFFF, |
421 | OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_SHIFT = 16, | ||
422 | OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_MASK = 0xFFFF << | ||
423 | OCRDMA_MBX_QUERY_CFG_MAX_WRITE_SGE_SHIFT, | ||
421 | 424 | ||
422 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT = 0, | 425 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT = 0, |
423 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK = 0xFFFF, | 426 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK = 0xFFFF, |
@@ -458,7 +461,7 @@ enum { | |||
458 | OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET, | 461 | OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET, |
459 | OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_OFFSET = 0, | 462 | OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_OFFSET = 0, |
460 | OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_MASK = 0xFFFF << | 463 | OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_MASK = 0xFFFF << |
461 | OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET, | 464 | OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_OFFSET, |
462 | 465 | ||
463 | OCRDMA_MBX_QUERY_CFG_MAX_CQ_OFFSET = 16, | 466 | OCRDMA_MBX_QUERY_CFG_MAX_CQ_OFFSET = 16, |
464 | OCRDMA_MBX_QUERY_CFG_MAX_CQ_MASK = 0xFFFF << | 467 | OCRDMA_MBX_QUERY_CFG_MAX_CQ_MASK = 0xFFFF << |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index d16d172b6b6b..2e2e7aecc990 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | |||
@@ -53,7 +53,7 @@ int ocrdma_query_gid(struct ib_device *ibdev, u8 port, | |||
53 | 53 | ||
54 | dev = get_ocrdma_dev(ibdev); | 54 | dev = get_ocrdma_dev(ibdev); |
55 | memset(sgid, 0, sizeof(*sgid)); | 55 | memset(sgid, 0, sizeof(*sgid)); |
56 | if (index > OCRDMA_MAX_SGID) | 56 | if (index >= OCRDMA_MAX_SGID) |
57 | return -EINVAL; | 57 | return -EINVAL; |
58 | 58 | ||
59 | memcpy(sgid, &dev->sgid_tbl[index], sizeof(*sgid)); | 59 | memcpy(sgid, &dev->sgid_tbl[index], sizeof(*sgid)); |
@@ -83,8 +83,8 @@ int ocrdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr) | |||
83 | IB_DEVICE_SHUTDOWN_PORT | | 83 | IB_DEVICE_SHUTDOWN_PORT | |
84 | IB_DEVICE_SYS_IMAGE_GUID | | 84 | IB_DEVICE_SYS_IMAGE_GUID | |
85 | IB_DEVICE_LOCAL_DMA_LKEY; | 85 | IB_DEVICE_LOCAL_DMA_LKEY; |
86 | attr->max_sge = dev->attr.max_send_sge; | 86 | attr->max_sge = min(dev->attr.max_send_sge, dev->attr.max_srq_sge); |
87 | attr->max_sge_rd = dev->attr.max_send_sge; | 87 | attr->max_sge_rd = 0; |
88 | attr->max_cq = dev->attr.max_cq; | 88 | attr->max_cq = dev->attr.max_cq; |
89 | attr->max_cqe = dev->attr.max_cqe; | 89 | attr->max_cqe = dev->attr.max_cqe; |
90 | attr->max_mr = dev->attr.max_mr; | 90 | attr->max_mr = dev->attr.max_mr; |
@@ -97,7 +97,7 @@ int ocrdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr) | |||
97 | min(dev->attr.max_ord_per_qp, dev->attr.max_ird_per_qp); | 97 | min(dev->attr.max_ord_per_qp, dev->attr.max_ird_per_qp); |
98 | attr->max_qp_init_rd_atom = dev->attr.max_ord_per_qp; | 98 | attr->max_qp_init_rd_atom = dev->attr.max_ord_per_qp; |
99 | attr->max_srq = (dev->attr.max_qp - 1); | 99 | attr->max_srq = (dev->attr.max_qp - 1); |
100 | attr->max_srq_sge = attr->max_sge; | 100 | attr->max_srq_sge = attr->max_srq_sge; |
101 | attr->max_srq_wr = dev->attr.max_rqe; | 101 | attr->max_srq_wr = dev->attr.max_rqe; |
102 | attr->local_ca_ack_delay = dev->attr.local_ca_ack_delay; | 102 | attr->local_ca_ack_delay = dev->attr.local_ca_ack_delay; |
103 | attr->max_fast_reg_page_list_len = 0; | 103 | attr->max_fast_reg_page_list_len = 0; |
@@ -2301,8 +2301,10 @@ static bool ocrdma_poll_err_rcqe(struct ocrdma_qp *qp, struct ocrdma_cqe *cqe, | |||
2301 | *stop = true; | 2301 | *stop = true; |
2302 | expand = false; | 2302 | expand = false; |
2303 | } | 2303 | } |
2304 | } else | 2304 | } else { |
2305 | *polled = true; | ||
2305 | expand = ocrdma_update_err_rcqe(ibwc, cqe, qp, status); | 2306 | expand = ocrdma_update_err_rcqe(ibwc, cqe, qp, status); |
2307 | } | ||
2306 | return expand; | 2308 | return expand; |
2307 | } | 2309 | } |
2308 | 2310 | ||
diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c index 57d19d4e0a2d..c96653b58867 100644 --- a/drivers/input/joystick/as5011.c +++ b/drivers/input/joystick/as5011.c | |||
@@ -282,7 +282,8 @@ static int __devinit as5011_probe(struct i2c_client *client, | |||
282 | 282 | ||
283 | error = request_threaded_irq(as5011->button_irq, | 283 | error = request_threaded_irq(as5011->button_irq, |
284 | NULL, as5011_button_interrupt, | 284 | NULL, as5011_button_interrupt, |
285 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 285 | IRQF_TRIGGER_RISING | |
286 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | ||
286 | "as5011_button", as5011); | 287 | "as5011_button", as5011); |
287 | if (error < 0) { | 288 | if (error < 0) { |
288 | dev_err(&client->dev, | 289 | dev_err(&client->dev, |
@@ -296,7 +297,7 @@ static int __devinit as5011_probe(struct i2c_client *client, | |||
296 | 297 | ||
297 | error = request_threaded_irq(as5011->axis_irq, NULL, | 298 | error = request_threaded_irq(as5011->axis_irq, NULL, |
298 | as5011_axis_interrupt, | 299 | as5011_axis_interrupt, |
299 | plat_data->axis_irqflags, | 300 | plat_data->axis_irqflags | IRQF_ONESHOT, |
300 | "as5011_joystick", as5011); | 301 | "as5011_joystick", as5011); |
301 | if (error) { | 302 | if (error) { |
302 | dev_err(&client->dev, | 303 | dev_err(&client->dev, |
diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c index 64a0ca4c92f3..0d77f6c84950 100644 --- a/drivers/input/keyboard/mcs_touchkey.c +++ b/drivers/input/keyboard/mcs_touchkey.c | |||
@@ -178,7 +178,8 @@ static int __devinit mcs_touchkey_probe(struct i2c_client *client, | |||
178 | } | 178 | } |
179 | 179 | ||
180 | error = request_threaded_irq(client->irq, NULL, mcs_touchkey_interrupt, | 180 | error = request_threaded_irq(client->irq, NULL, mcs_touchkey_interrupt, |
181 | IRQF_TRIGGER_FALLING, client->dev.driver->name, data); | 181 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
182 | client->dev.driver->name, data); | ||
182 | if (error) { | 183 | if (error) { |
183 | dev_err(&client->dev, "Failed to register interrupt\n"); | 184 | dev_err(&client->dev, "Failed to register interrupt\n"); |
184 | goto err_free_mem; | 185 | goto err_free_mem; |
diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index caa218a51b5a..7613f1cac951 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c | |||
@@ -248,7 +248,7 @@ static int __devinit mpr_touchkey_probe(struct i2c_client *client, | |||
248 | 248 | ||
249 | error = request_threaded_irq(client->irq, NULL, | 249 | error = request_threaded_irq(client->irq, NULL, |
250 | mpr_touchkey_interrupt, | 250 | mpr_touchkey_interrupt, |
251 | IRQF_TRIGGER_FALLING, | 251 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
252 | client->dev.driver->name, mpr121); | 252 | client->dev.driver->name, mpr121); |
253 | if (error) { | 253 | if (error) { |
254 | dev_err(&client->dev, "Failed to register interrupt\n"); | 254 | dev_err(&client->dev, "Failed to register interrupt\n"); |
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c index 0b7b2f891752..ca68f2992d72 100644 --- a/drivers/input/keyboard/qt1070.c +++ b/drivers/input/keyboard/qt1070.c | |||
@@ -201,7 +201,8 @@ static int __devinit qt1070_probe(struct i2c_client *client, | |||
201 | msleep(QT1070_RESET_TIME); | 201 | msleep(QT1070_RESET_TIME); |
202 | 202 | ||
203 | err = request_threaded_irq(client->irq, NULL, qt1070_interrupt, | 203 | err = request_threaded_irq(client->irq, NULL, qt1070_interrupt, |
204 | IRQF_TRIGGER_NONE, client->dev.driver->name, data); | 204 | IRQF_TRIGGER_NONE | IRQF_ONESHOT, |
205 | client->dev.driver->name, data); | ||
205 | if (err) { | 206 | if (err) { |
206 | dev_err(&client->dev, "fail to request irq\n"); | 207 | dev_err(&client->dev, "fail to request irq\n"); |
207 | goto err_free_mem; | 208 | goto err_free_mem; |
diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c index 3afea3f89718..c355cdde8d22 100644 --- a/drivers/input/keyboard/tca6416-keypad.c +++ b/drivers/input/keyboard/tca6416-keypad.c | |||
@@ -278,7 +278,8 @@ static int __devinit tca6416_keypad_probe(struct i2c_client *client, | |||
278 | 278 | ||
279 | error = request_threaded_irq(chip->irqnum, NULL, | 279 | error = request_threaded_irq(chip->irqnum, NULL, |
280 | tca6416_keys_isr, | 280 | tca6416_keys_isr, |
281 | IRQF_TRIGGER_FALLING, | 281 | IRQF_TRIGGER_FALLING | |
282 | IRQF_ONESHOT, | ||
282 | "tca6416-keypad", chip); | 283 | "tca6416-keypad", chip); |
283 | if (error) { | 284 | if (error) { |
284 | dev_dbg(&client->dev, | 285 | dev_dbg(&client->dev, |
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 5f87b28b3192..893869b29ed9 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c | |||
@@ -360,7 +360,7 @@ static int __devinit tca8418_keypad_probe(struct i2c_client *client, | |||
360 | client->irq = gpio_to_irq(client->irq); | 360 | client->irq = gpio_to_irq(client->irq); |
361 | 361 | ||
362 | error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler, | 362 | error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler, |
363 | IRQF_TRIGGER_FALLING, | 363 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
364 | client->name, keypad_data); | 364 | client->name, keypad_data); |
365 | if (error) { | 365 | if (error) { |
366 | dev_dbg(&client->dev, | 366 | dev_dbg(&client->dev, |
diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c index a4a445fb7020..4c34f21fbe2d 100644 --- a/drivers/input/keyboard/tnetv107x-keypad.c +++ b/drivers/input/keyboard/tnetv107x-keypad.c | |||
@@ -227,15 +227,15 @@ static int __devinit keypad_probe(struct platform_device *pdev) | |||
227 | goto error_clk; | 227 | goto error_clk; |
228 | } | 228 | } |
229 | 229 | ||
230 | error = request_threaded_irq(kp->irq_press, NULL, keypad_irq, 0, | 230 | error = request_threaded_irq(kp->irq_press, NULL, keypad_irq, |
231 | dev_name(dev), kp); | 231 | IRQF_ONESHOT, dev_name(dev), kp); |
232 | if (error < 0) { | 232 | if (error < 0) { |
233 | dev_err(kp->dev, "Could not allocate keypad press key irq\n"); | 233 | dev_err(kp->dev, "Could not allocate keypad press key irq\n"); |
234 | goto error_irq_press; | 234 | goto error_irq_press; |
235 | } | 235 | } |
236 | 236 | ||
237 | error = request_threaded_irq(kp->irq_release, NULL, keypad_irq, 0, | 237 | error = request_threaded_irq(kp->irq_release, NULL, keypad_irq, |
238 | dev_name(dev), kp); | 238 | IRQF_ONESHOT, dev_name(dev), kp); |
239 | if (error < 0) { | 239 | if (error < 0) { |
240 | dev_err(kp->dev, "Could not allocate keypad release key irq\n"); | 240 | dev_err(kp->dev, "Could not allocate keypad release key irq\n"); |
241 | goto error_irq_release; | 241 | goto error_irq_release; |
diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c index 0ac75bbad4d6..2e5d5e1de647 100644 --- a/drivers/input/misc/ad714x.c +++ b/drivers/input/misc/ad714x.c | |||
@@ -972,6 +972,7 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, | |||
972 | struct ad714x_platform_data *plat_data = dev->platform_data; | 972 | struct ad714x_platform_data *plat_data = dev->platform_data; |
973 | struct ad714x_chip *ad714x; | 973 | struct ad714x_chip *ad714x; |
974 | void *drv_mem; | 974 | void *drv_mem; |
975 | unsigned long irqflags; | ||
975 | 976 | ||
976 | struct ad714x_button_drv *bt_drv; | 977 | struct ad714x_button_drv *bt_drv; |
977 | struct ad714x_slider_drv *sd_drv; | 978 | struct ad714x_slider_drv *sd_drv; |
@@ -1162,10 +1163,11 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, | |||
1162 | alloc_idx++; | 1163 | alloc_idx++; |
1163 | } | 1164 | } |
1164 | 1165 | ||
1166 | irqflags = plat_data->irqflags ?: IRQF_TRIGGER_FALLING; | ||
1167 | irqflags |= IRQF_ONESHOT; | ||
1168 | |||
1165 | error = request_threaded_irq(ad714x->irq, NULL, ad714x_interrupt_thread, | 1169 | error = request_threaded_irq(ad714x->irq, NULL, ad714x_interrupt_thread, |
1166 | plat_data->irqflags ? | 1170 | irqflags, "ad714x_captouch", ad714x); |
1167 | plat_data->irqflags : IRQF_TRIGGER_FALLING, | ||
1168 | "ad714x_captouch", ad714x); | ||
1169 | if (error) { | 1171 | if (error) { |
1170 | dev_err(dev, "can't allocate irq %d\n", ad714x->irq); | 1172 | dev_err(dev, "can't allocate irq %d\n", ad714x->irq); |
1171 | goto err_unreg_dev; | 1173 | goto err_unreg_dev; |
diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c index 35083c6836c3..c1313d8535c3 100644 --- a/drivers/input/misc/dm355evm_keys.c +++ b/drivers/input/misc/dm355evm_keys.c | |||
@@ -213,7 +213,8 @@ static int __devinit dm355evm_keys_probe(struct platform_device *pdev) | |||
213 | /* REVISIT: flush the event queue? */ | 213 | /* REVISIT: flush the event queue? */ |
214 | 214 | ||
215 | status = request_threaded_irq(keys->irq, NULL, dm355evm_keys_irq, | 215 | status = request_threaded_irq(keys->irq, NULL, dm355evm_keys_irq, |
216 | IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), keys); | 216 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
217 | dev_name(&pdev->dev), keys); | ||
217 | if (status < 0) | 218 | if (status < 0) |
218 | goto fail2; | 219 | goto fail2; |
219 | 220 | ||
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index cad5602d3ce4..8b31473a81fe 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -216,7 +216,7 @@ static void wacom_retrieve_report_data(struct usb_interface *intf, | |||
216 | 216 | ||
217 | rep_data[0] = 12; | 217 | rep_data[0] = 12; |
218 | result = wacom_get_report(intf, WAC_HID_FEATURE_REPORT, | 218 | result = wacom_get_report(intf, WAC_HID_FEATURE_REPORT, |
219 | rep_data[0], &rep_data, 2, | 219 | rep_data[0], rep_data, 2, |
220 | WAC_MSG_RETRIES); | 220 | WAC_MSG_RETRIES); |
221 | 221 | ||
222 | if (result >= 0 && rep_data[1] > 2) | 222 | if (result >= 0 && rep_data[1] > 2) |
@@ -401,7 +401,9 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
401 | break; | 401 | break; |
402 | 402 | ||
403 | case HID_USAGE_CONTACTMAX: | 403 | case HID_USAGE_CONTACTMAX: |
404 | wacom_retrieve_report_data(intf, features); | 404 | /* leave touch_max as is if predefined */ |
405 | if (!features->touch_max) | ||
406 | wacom_retrieve_report_data(intf, features); | ||
405 | i++; | 407 | i++; |
406 | break; | 408 | break; |
407 | } | 409 | } |
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index e2482b40da51..bd4eb4277697 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c | |||
@@ -597,7 +597,7 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, | |||
597 | AD7879_TMR(ts->pen_down_acc_interval); | 597 | AD7879_TMR(ts->pen_down_acc_interval); |
598 | 598 | ||
599 | err = request_threaded_irq(ts->irq, NULL, ad7879_irq, | 599 | err = request_threaded_irq(ts->irq, NULL, ad7879_irq, |
600 | IRQF_TRIGGER_FALLING, | 600 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
601 | dev_name(dev), ts); | 601 | dev_name(dev), ts); |
602 | if (err) { | 602 | if (err) { |
603 | dev_err(dev, "irq %d busy?\n", ts->irq); | 603 | dev_err(dev, "irq %d busy?\n", ts->irq); |
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 42e645062c20..25fd0561a17d 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c | |||
@@ -1149,7 +1149,8 @@ static int __devinit mxt_probe(struct i2c_client *client, | |||
1149 | goto err_free_object; | 1149 | goto err_free_object; |
1150 | 1150 | ||
1151 | error = request_threaded_irq(client->irq, NULL, mxt_interrupt, | 1151 | error = request_threaded_irq(client->irq, NULL, mxt_interrupt, |
1152 | pdata->irqflags, client->dev.driver->name, data); | 1152 | pdata->irqflags | IRQF_ONESHOT, |
1153 | client->dev.driver->name, data); | ||
1153 | if (error) { | 1154 | if (error) { |
1154 | dev_err(&client->dev, "Failed to register interrupt\n"); | 1155 | dev_err(&client->dev, "Failed to register interrupt\n"); |
1155 | goto err_free_object; | 1156 | goto err_free_object; |
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index f2d03c06c2da..5c487d23f11c 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c | |||
@@ -509,7 +509,8 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
509 | input_set_drvdata(in_dev, bu21013_data); | 509 | input_set_drvdata(in_dev, bu21013_data); |
510 | 510 | ||
511 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, | 511 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, |
512 | IRQF_TRIGGER_FALLING | IRQF_SHARED, | 512 | IRQF_TRIGGER_FALLING | IRQF_SHARED | |
513 | IRQF_ONESHOT, | ||
513 | DRIVER_TP, bu21013_data); | 514 | DRIVER_TP, bu21013_data); |
514 | if (error) { | 515 | if (error) { |
515 | dev_err(&client->dev, "request irq %d failed\n", pdata->irq); | 516 | dev_err(&client->dev, "request irq %d failed\n", pdata->irq); |
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index 237753ad1031..464f1bf4b61d 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c | |||
@@ -251,7 +251,8 @@ static int __devinit cy8ctmg110_probe(struct i2c_client *client, | |||
251 | } | 251 | } |
252 | 252 | ||
253 | err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread, | 253 | err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread, |
254 | IRQF_TRIGGER_RISING, "touch_reset_key", ts); | 254 | IRQF_TRIGGER_RISING | IRQF_ONESHOT, |
255 | "touch_reset_key", ts); | ||
255 | if (err < 0) { | 256 | if (err < 0) { |
256 | dev_err(&client->dev, | 257 | dev_err(&client->dev, |
257 | "irq %d busy? error %d\n", client->irq, err); | 258 | "irq %d busy? error %d\n", client->irq, err); |
diff --git a/drivers/input/touchscreen/intel-mid-touch.c b/drivers/input/touchscreen/intel-mid-touch.c index 3cd7a837f82b..cf299377fc49 100644 --- a/drivers/input/touchscreen/intel-mid-touch.c +++ b/drivers/input/touchscreen/intel-mid-touch.c | |||
@@ -620,7 +620,7 @@ static int __devinit mrstouch_probe(struct platform_device *pdev) | |||
620 | MRST_PRESSURE_MIN, MRST_PRESSURE_MAX, 0, 0); | 620 | MRST_PRESSURE_MIN, MRST_PRESSURE_MAX, 0, 0); |
621 | 621 | ||
622 | err = request_threaded_irq(tsdev->irq, NULL, mrstouch_pendet_irq, | 622 | err = request_threaded_irq(tsdev->irq, NULL, mrstouch_pendet_irq, |
623 | 0, "mrstouch", tsdev); | 623 | IRQF_ONESHOT, "mrstouch", tsdev); |
624 | if (err) { | 624 | if (err) { |
625 | dev_err(tsdev->dev, "unable to allocate irq\n"); | 625 | dev_err(tsdev->dev, "unable to allocate irq\n"); |
626 | goto err_free_mem; | 626 | goto err_free_mem; |
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 72f6ba3a4709..953b4c105cad 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c | |||
@@ -165,7 +165,7 @@ static int __devinit pixcir_i2c_ts_probe(struct i2c_client *client, | |||
165 | input_set_drvdata(input, tsdata); | 165 | input_set_drvdata(input, tsdata); |
166 | 166 | ||
167 | error = request_threaded_irq(client->irq, NULL, pixcir_ts_isr, | 167 | error = request_threaded_irq(client->irq, NULL, pixcir_ts_isr, |
168 | IRQF_TRIGGER_FALLING, | 168 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
169 | client->name, tsdata); | 169 | client->name, tsdata); |
170 | if (error) { | 170 | if (error) { |
171 | dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); | 171 | dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); |
diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c index 7e7488097359..368d2c6cf780 100644 --- a/drivers/input/touchscreen/tnetv107x-ts.c +++ b/drivers/input/touchscreen/tnetv107x-ts.c | |||
@@ -297,7 +297,7 @@ static int __devinit tsc_probe(struct platform_device *pdev) | |||
297 | goto error_clk; | 297 | goto error_clk; |
298 | } | 298 | } |
299 | 299 | ||
300 | error = request_threaded_irq(ts->tsc_irq, NULL, tsc_irq, 0, | 300 | error = request_threaded_irq(ts->tsc_irq, NULL, tsc_irq, IRQF_ONESHOT, |
301 | dev_name(dev), ts); | 301 | dev_name(dev), ts); |
302 | if (error < 0) { | 302 | if (error < 0) { |
303 | dev_err(ts->dev, "Could not allocate ts irq\n"); | 303 | dev_err(ts->dev, "Could not allocate ts irq\n"); |
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index b6adeaee9cc5..5ce3fa8ce646 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c | |||
@@ -650,7 +650,8 @@ static int __devinit tsc2005_probe(struct spi_device *spi) | |||
650 | tsc2005_stop_scan(ts); | 650 | tsc2005_stop_scan(ts); |
651 | 651 | ||
652 | error = request_threaded_irq(spi->irq, NULL, tsc2005_irq_thread, | 652 | error = request_threaded_irq(spi->irq, NULL, tsc2005_irq_thread, |
653 | IRQF_TRIGGER_RISING, "tsc2005", ts); | 653 | IRQF_TRIGGER_RISING | IRQF_ONESHOT, |
654 | "tsc2005", ts); | ||
654 | if (error) { | 655 | if (error) { |
655 | dev_err(&spi->dev, "Failed to request irq, err: %d\n", error); | 656 | dev_err(&spi->dev, "Failed to request irq, err: %d\n", error); |
656 | goto err_free_mem; | 657 | goto err_free_mem; |
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index a2e418cba0ff..625626391f2d 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -83,6 +83,8 @@ static struct iommu_ops amd_iommu_ops; | |||
83 | static ATOMIC_NOTIFIER_HEAD(ppr_notifier); | 83 | static ATOMIC_NOTIFIER_HEAD(ppr_notifier); |
84 | int amd_iommu_max_glx_val = -1; | 84 | int amd_iommu_max_glx_val = -1; |
85 | 85 | ||
86 | static struct dma_map_ops amd_iommu_dma_ops; | ||
87 | |||
86 | /* | 88 | /* |
87 | * general struct to manage commands send to an IOMMU | 89 | * general struct to manage commands send to an IOMMU |
88 | */ | 90 | */ |
@@ -402,7 +404,7 @@ static void amd_iommu_stats_init(void) | |||
402 | return; | 404 | return; |
403 | 405 | ||
404 | de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, | 406 | de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, |
405 | (u32 *)&amd_iommu_unmap_flush); | 407 | &amd_iommu_unmap_flush); |
406 | 408 | ||
407 | amd_iommu_stats_add(&compl_wait); | 409 | amd_iommu_stats_add(&compl_wait); |
408 | amd_iommu_stats_add(&cnt_map_single); | 410 | amd_iommu_stats_add(&cnt_map_single); |
@@ -2267,6 +2269,13 @@ static int device_change_notifier(struct notifier_block *nb, | |||
2267 | list_add_tail(&dma_domain->list, &iommu_pd_list); | 2269 | list_add_tail(&dma_domain->list, &iommu_pd_list); |
2268 | spin_unlock_irqrestore(&iommu_pd_list_lock, flags); | 2270 | spin_unlock_irqrestore(&iommu_pd_list_lock, flags); |
2269 | 2271 | ||
2272 | dev_data = get_dev_data(dev); | ||
2273 | |||
2274 | if (!dev_data->passthrough) | ||
2275 | dev->archdata.dma_ops = &amd_iommu_dma_ops; | ||
2276 | else | ||
2277 | dev->archdata.dma_ops = &nommu_dma_ops; | ||
2278 | |||
2270 | break; | 2279 | break; |
2271 | case BUS_NOTIFY_DEL_DEVICE: | 2280 | case BUS_NOTIFY_DEL_DEVICE: |
2272 | 2281 | ||
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 542024ba6dba..a33612f3206f 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -129,7 +129,7 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have | |||
129 | to handle */ | 129 | to handle */ |
130 | LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings | 130 | LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings |
131 | we find in ACPI */ | 131 | we find in ACPI */ |
132 | bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ | 132 | u32 amd_iommu_unmap_flush; /* if true, flush on every unmap */ |
133 | 133 | ||
134 | LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the | 134 | LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the |
135 | system */ | 135 | system */ |
@@ -1641,6 +1641,8 @@ static int __init amd_iommu_init(void) | |||
1641 | 1641 | ||
1642 | amd_iommu_init_api(); | 1642 | amd_iommu_init_api(); |
1643 | 1643 | ||
1644 | x86_platform.iommu_shutdown = disable_iommus; | ||
1645 | |||
1644 | if (iommu_pass_through) | 1646 | if (iommu_pass_through) |
1645 | goto out; | 1647 | goto out; |
1646 | 1648 | ||
@@ -1649,8 +1651,6 @@ static int __init amd_iommu_init(void) | |||
1649 | else | 1651 | else |
1650 | printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n"); | 1652 | printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n"); |
1651 | 1653 | ||
1652 | x86_platform.iommu_shutdown = disable_iommus; | ||
1653 | |||
1654 | out: | 1654 | out: |
1655 | return ret; | 1655 | return ret; |
1656 | 1656 | ||
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index 24355559a2ad..c1b1d489817e 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h | |||
@@ -652,7 +652,7 @@ extern unsigned long *amd_iommu_pd_alloc_bitmap; | |||
652 | * If true, the addresses will be flushed on unmap time, not when | 652 | * If true, the addresses will be flushed on unmap time, not when |
653 | * they are reused | 653 | * they are reused |
654 | */ | 654 | */ |
655 | extern bool amd_iommu_unmap_flush; | 655 | extern u32 amd_iommu_unmap_flush; |
656 | 656 | ||
657 | /* Smallest number of PASIDs supported by any IOMMU in the system */ | 657 | /* Smallest number of PASIDs supported by any IOMMU in the system */ |
658 | extern u32 amd_iommu_max_pasids; | 658 | extern u32 amd_iommu_max_pasids; |
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index ecd679043d77..3f3d09d560ea 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c | |||
@@ -550,13 +550,13 @@ static int alloc_pdir(struct smmu_as *as) | |||
550 | return 0; | 550 | return 0; |
551 | 551 | ||
552 | as->pte_count = devm_kzalloc(smmu->dev, | 552 | as->pte_count = devm_kzalloc(smmu->dev, |
553 | sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_KERNEL); | 553 | sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_ATOMIC); |
554 | if (!as->pte_count) { | 554 | if (!as->pte_count) { |
555 | dev_err(smmu->dev, | 555 | dev_err(smmu->dev, |
556 | "failed to allocate smmu_device PTE cunters\n"); | 556 | "failed to allocate smmu_device PTE cunters\n"); |
557 | return -ENOMEM; | 557 | return -ENOMEM; |
558 | } | 558 | } |
559 | as->pdir_page = alloc_page(GFP_KERNEL | __GFP_DMA); | 559 | as->pdir_page = alloc_page(GFP_ATOMIC | __GFP_DMA); |
560 | if (!as->pdir_page) { | 560 | if (!as->pdir_page) { |
561 | dev_err(smmu->dev, | 561 | dev_err(smmu->dev, |
562 | "failed to allocate smmu_device page directory\n"); | 562 | "failed to allocate smmu_device page directory\n"); |
diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c index 41dc76db4311..a019fbb70880 100644 --- a/drivers/leds/ledtrig-heartbeat.c +++ b/drivers/leds/ledtrig-heartbeat.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/reboot.h> | 21 | #include <linux/reboot.h> |
22 | #include "leds.h" | 22 | #include "leds.h" |
23 | 23 | ||
24 | static int panic_heartbeats; | ||
25 | |||
24 | struct heartbeat_trig_data { | 26 | struct heartbeat_trig_data { |
25 | unsigned int phase; | 27 | unsigned int phase; |
26 | unsigned int period; | 28 | unsigned int period; |
@@ -34,6 +36,11 @@ static void led_heartbeat_function(unsigned long data) | |||
34 | unsigned long brightness = LED_OFF; | 36 | unsigned long brightness = LED_OFF; |
35 | unsigned long delay = 0; | 37 | unsigned long delay = 0; |
36 | 38 | ||
39 | if (unlikely(panic_heartbeats)) { | ||
40 | led_set_brightness(led_cdev, LED_OFF); | ||
41 | return; | ||
42 | } | ||
43 | |||
37 | /* acts like an actual heart beat -- ie thump-thump-pause... */ | 44 | /* acts like an actual heart beat -- ie thump-thump-pause... */ |
38 | switch (heartbeat_data->phase) { | 45 | switch (heartbeat_data->phase) { |
39 | case 0: | 46 | case 0: |
@@ -111,12 +118,19 @@ static int heartbeat_reboot_notifier(struct notifier_block *nb, | |||
111 | return NOTIFY_DONE; | 118 | return NOTIFY_DONE; |
112 | } | 119 | } |
113 | 120 | ||
121 | static int heartbeat_panic_notifier(struct notifier_block *nb, | ||
122 | unsigned long code, void *unused) | ||
123 | { | ||
124 | panic_heartbeats = 1; | ||
125 | return NOTIFY_DONE; | ||
126 | } | ||
127 | |||
114 | static struct notifier_block heartbeat_reboot_nb = { | 128 | static struct notifier_block heartbeat_reboot_nb = { |
115 | .notifier_call = heartbeat_reboot_notifier, | 129 | .notifier_call = heartbeat_reboot_notifier, |
116 | }; | 130 | }; |
117 | 131 | ||
118 | static struct notifier_block heartbeat_panic_nb = { | 132 | static struct notifier_block heartbeat_panic_nb = { |
119 | .notifier_call = heartbeat_reboot_notifier, | 133 | .notifier_call = heartbeat_panic_notifier, |
120 | }; | 134 | }; |
121 | 135 | ||
122 | static int __init heartbeat_trig_init(void) | 136 | static int __init heartbeat_trig_init(void) |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 37fdaf81bd1f..ce59824fb414 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -2292,6 +2292,13 @@ static int process_reserve_metadata_snap_mesg(unsigned argc, char **argv, struct | |||
2292 | if (r) | 2292 | if (r) |
2293 | return r; | 2293 | return r; |
2294 | 2294 | ||
2295 | r = dm_pool_commit_metadata(pool->pmd); | ||
2296 | if (r) { | ||
2297 | DMERR("%s: dm_pool_commit_metadata() failed, error = %d", | ||
2298 | __func__, r); | ||
2299 | return r; | ||
2300 | } | ||
2301 | |||
2295 | r = dm_pool_reserve_metadata_snap(pool->pmd); | 2302 | r = dm_pool_reserve_metadata_snap(pool->pmd); |
2296 | if (r) | 2303 | if (r) |
2297 | DMWARN("reserve_metadata_snap message failed."); | 2304 | DMWARN("reserve_metadata_snap message failed."); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 1c2f9048e1ae..a4c219e3c859 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5784,8 +5784,7 @@ static int add_new_disk(struct mddev * mddev, mdu_disk_info_t *info) | |||
5784 | super_types[mddev->major_version]. | 5784 | super_types[mddev->major_version]. |
5785 | validate_super(mddev, rdev); | 5785 | validate_super(mddev, rdev); |
5786 | if ((info->state & (1<<MD_DISK_SYNC)) && | 5786 | if ((info->state & (1<<MD_DISK_SYNC)) && |
5787 | (!test_bit(In_sync, &rdev->flags) || | 5787 | rdev->raid_disk != info->raid_disk) { |
5788 | rdev->raid_disk != info->raid_disk)) { | ||
5789 | /* This was a hot-add request, but events doesn't | 5788 | /* This was a hot-add request, but events doesn't |
5790 | * match, so reject it. | 5789 | * match, so reject it. |
5791 | */ | 5790 | */ |
@@ -6751,7 +6750,7 @@ struct md_thread *md_register_thread(void (*run) (struct mddev *), struct mddev | |||
6751 | thread->tsk = kthread_run(md_thread, thread, | 6750 | thread->tsk = kthread_run(md_thread, thread, |
6752 | "%s_%s", | 6751 | "%s_%s", |
6753 | mdname(thread->mddev), | 6752 | mdname(thread->mddev), |
6754 | name ?: mddev->pers->name); | 6753 | name); |
6755 | if (IS_ERR(thread->tsk)) { | 6754 | if (IS_ERR(thread->tsk)) { |
6756 | kfree(thread); | 6755 | kfree(thread); |
6757 | return NULL; | 6756 | return NULL; |
@@ -7298,6 +7297,7 @@ void md_do_sync(struct mddev *mddev) | |||
7298 | int skipped = 0; | 7297 | int skipped = 0; |
7299 | struct md_rdev *rdev; | 7298 | struct md_rdev *rdev; |
7300 | char *desc; | 7299 | char *desc; |
7300 | struct blk_plug plug; | ||
7301 | 7301 | ||
7302 | /* just incase thread restarts... */ | 7302 | /* just incase thread restarts... */ |
7303 | if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) | 7303 | if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) |
@@ -7447,6 +7447,7 @@ void md_do_sync(struct mddev *mddev) | |||
7447 | } | 7447 | } |
7448 | mddev->curr_resync_completed = j; | 7448 | mddev->curr_resync_completed = j; |
7449 | 7449 | ||
7450 | blk_start_plug(&plug); | ||
7450 | while (j < max_sectors) { | 7451 | while (j < max_sectors) { |
7451 | sector_t sectors; | 7452 | sector_t sectors; |
7452 | 7453 | ||
@@ -7552,6 +7553,7 @@ void md_do_sync(struct mddev *mddev) | |||
7552 | * this also signals 'finished resyncing' to md_stop | 7553 | * this also signals 'finished resyncing' to md_stop |
7553 | */ | 7554 | */ |
7554 | out: | 7555 | out: |
7556 | blk_finish_plug(&plug); | ||
7555 | wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); | 7557 | wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); |
7556 | 7558 | ||
7557 | /* tell personality that we are finished */ | 7559 | /* tell personality that we are finished */ |
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 9339e67fcc79..61a1833ebaf3 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -474,7 +474,8 @@ static int multipath_run (struct mddev *mddev) | |||
474 | } | 474 | } |
475 | 475 | ||
476 | { | 476 | { |
477 | mddev->thread = md_register_thread(multipathd, mddev, NULL); | 477 | mddev->thread = md_register_thread(multipathd, mddev, |
478 | "multipath"); | ||
478 | if (!mddev->thread) { | 479 | if (!mddev->thread) { |
479 | printk(KERN_ERR "multipath: couldn't allocate thread" | 480 | printk(KERN_ERR "multipath: couldn't allocate thread" |
480 | " for %s\n", mdname(mddev)); | 481 | " for %s\n", mdname(mddev)); |
diff --git a/drivers/md/persistent-data/dm-space-map-checker.c b/drivers/md/persistent-data/dm-space-map-checker.c index 50ed53bf4aa2..fc90c11620ad 100644 --- a/drivers/md/persistent-data/dm-space-map-checker.c +++ b/drivers/md/persistent-data/dm-space-map-checker.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/device-mapper.h> | 9 | #include <linux/device-mapper.h> |
10 | #include <linux/export.h> | 10 | #include <linux/export.h> |
11 | #include <linux/vmalloc.h> | ||
11 | 12 | ||
12 | #ifdef CONFIG_DM_DEBUG_SPACE_MAPS | 13 | #ifdef CONFIG_DM_DEBUG_SPACE_MAPS |
13 | 14 | ||
@@ -89,13 +90,23 @@ static int ca_create(struct count_array *ca, struct dm_space_map *sm) | |||
89 | 90 | ||
90 | ca->nr = nr_blocks; | 91 | ca->nr = nr_blocks; |
91 | ca->nr_free = nr_blocks; | 92 | ca->nr_free = nr_blocks; |
92 | ca->counts = kzalloc(sizeof(*ca->counts) * nr_blocks, GFP_KERNEL); | 93 | |
93 | if (!ca->counts) | 94 | if (!nr_blocks) |
94 | return -ENOMEM; | 95 | ca->counts = NULL; |
96 | else { | ||
97 | ca->counts = vzalloc(sizeof(*ca->counts) * nr_blocks); | ||
98 | if (!ca->counts) | ||
99 | return -ENOMEM; | ||
100 | } | ||
95 | 101 | ||
96 | return 0; | 102 | return 0; |
97 | } | 103 | } |
98 | 104 | ||
105 | static void ca_destroy(struct count_array *ca) | ||
106 | { | ||
107 | vfree(ca->counts); | ||
108 | } | ||
109 | |||
99 | static int ca_load(struct count_array *ca, struct dm_space_map *sm) | 110 | static int ca_load(struct count_array *ca, struct dm_space_map *sm) |
100 | { | 111 | { |
101 | int r; | 112 | int r; |
@@ -126,12 +137,14 @@ static int ca_load(struct count_array *ca, struct dm_space_map *sm) | |||
126 | static int ca_extend(struct count_array *ca, dm_block_t extra_blocks) | 137 | static int ca_extend(struct count_array *ca, dm_block_t extra_blocks) |
127 | { | 138 | { |
128 | dm_block_t nr_blocks = ca->nr + extra_blocks; | 139 | dm_block_t nr_blocks = ca->nr + extra_blocks; |
129 | uint32_t *counts = kzalloc(sizeof(*counts) * nr_blocks, GFP_KERNEL); | 140 | uint32_t *counts = vzalloc(sizeof(*counts) * nr_blocks); |
130 | if (!counts) | 141 | if (!counts) |
131 | return -ENOMEM; | 142 | return -ENOMEM; |
132 | 143 | ||
133 | memcpy(counts, ca->counts, sizeof(*counts) * ca->nr); | 144 | if (ca->counts) { |
134 | kfree(ca->counts); | 145 | memcpy(counts, ca->counts, sizeof(*counts) * ca->nr); |
146 | ca_destroy(ca); | ||
147 | } | ||
135 | ca->nr = nr_blocks; | 148 | ca->nr = nr_blocks; |
136 | ca->nr_free += extra_blocks; | 149 | ca->nr_free += extra_blocks; |
137 | ca->counts = counts; | 150 | ca->counts = counts; |
@@ -151,11 +164,6 @@ static int ca_commit(struct count_array *old, struct count_array *new) | |||
151 | return 0; | 164 | return 0; |
152 | } | 165 | } |
153 | 166 | ||
154 | static void ca_destroy(struct count_array *ca) | ||
155 | { | ||
156 | kfree(ca->counts); | ||
157 | } | ||
158 | |||
159 | /*----------------------------------------------------------------*/ | 167 | /*----------------------------------------------------------------*/ |
160 | 168 | ||
161 | struct sm_checker { | 169 | struct sm_checker { |
@@ -343,25 +351,25 @@ struct dm_space_map *dm_sm_checker_create(struct dm_space_map *sm) | |||
343 | int r; | 351 | int r; |
344 | struct sm_checker *smc; | 352 | struct sm_checker *smc; |
345 | 353 | ||
346 | if (!sm) | 354 | if (IS_ERR_OR_NULL(sm)) |
347 | return NULL; | 355 | return ERR_PTR(-EINVAL); |
348 | 356 | ||
349 | smc = kmalloc(sizeof(*smc), GFP_KERNEL); | 357 | smc = kmalloc(sizeof(*smc), GFP_KERNEL); |
350 | if (!smc) | 358 | if (!smc) |
351 | return NULL; | 359 | return ERR_PTR(-ENOMEM); |
352 | 360 | ||
353 | memcpy(&smc->sm, &ops_, sizeof(smc->sm)); | 361 | memcpy(&smc->sm, &ops_, sizeof(smc->sm)); |
354 | r = ca_create(&smc->old_counts, sm); | 362 | r = ca_create(&smc->old_counts, sm); |
355 | if (r) { | 363 | if (r) { |
356 | kfree(smc); | 364 | kfree(smc); |
357 | return NULL; | 365 | return ERR_PTR(r); |
358 | } | 366 | } |
359 | 367 | ||
360 | r = ca_create(&smc->counts, sm); | 368 | r = ca_create(&smc->counts, sm); |
361 | if (r) { | 369 | if (r) { |
362 | ca_destroy(&smc->old_counts); | 370 | ca_destroy(&smc->old_counts); |
363 | kfree(smc); | 371 | kfree(smc); |
364 | return NULL; | 372 | return ERR_PTR(r); |
365 | } | 373 | } |
366 | 374 | ||
367 | smc->real_sm = sm; | 375 | smc->real_sm = sm; |
@@ -371,7 +379,7 @@ struct dm_space_map *dm_sm_checker_create(struct dm_space_map *sm) | |||
371 | ca_destroy(&smc->counts); | 379 | ca_destroy(&smc->counts); |
372 | ca_destroy(&smc->old_counts); | 380 | ca_destroy(&smc->old_counts); |
373 | kfree(smc); | 381 | kfree(smc); |
374 | return NULL; | 382 | return ERR_PTR(r); |
375 | } | 383 | } |
376 | 384 | ||
377 | r = ca_commit(&smc->old_counts, &smc->counts); | 385 | r = ca_commit(&smc->old_counts, &smc->counts); |
@@ -379,7 +387,7 @@ struct dm_space_map *dm_sm_checker_create(struct dm_space_map *sm) | |||
379 | ca_destroy(&smc->counts); | 387 | ca_destroy(&smc->counts); |
380 | ca_destroy(&smc->old_counts); | 388 | ca_destroy(&smc->old_counts); |
381 | kfree(smc); | 389 | kfree(smc); |
382 | return NULL; | 390 | return ERR_PTR(r); |
383 | } | 391 | } |
384 | 392 | ||
385 | return &smc->sm; | 393 | return &smc->sm; |
@@ -391,25 +399,25 @@ struct dm_space_map *dm_sm_checker_create_fresh(struct dm_space_map *sm) | |||
391 | int r; | 399 | int r; |
392 | struct sm_checker *smc; | 400 | struct sm_checker *smc; |
393 | 401 | ||
394 | if (!sm) | 402 | if (IS_ERR_OR_NULL(sm)) |
395 | return NULL; | 403 | return ERR_PTR(-EINVAL); |
396 | 404 | ||
397 | smc = kmalloc(sizeof(*smc), GFP_KERNEL); | 405 | smc = kmalloc(sizeof(*smc), GFP_KERNEL); |
398 | if (!smc) | 406 | if (!smc) |
399 | return NULL; | 407 | return ERR_PTR(-ENOMEM); |
400 | 408 | ||
401 | memcpy(&smc->sm, &ops_, sizeof(smc->sm)); | 409 | memcpy(&smc->sm, &ops_, sizeof(smc->sm)); |
402 | r = ca_create(&smc->old_counts, sm); | 410 | r = ca_create(&smc->old_counts, sm); |
403 | if (r) { | 411 | if (r) { |
404 | kfree(smc); | 412 | kfree(smc); |
405 | return NULL; | 413 | return ERR_PTR(r); |
406 | } | 414 | } |
407 | 415 | ||
408 | r = ca_create(&smc->counts, sm); | 416 | r = ca_create(&smc->counts, sm); |
409 | if (r) { | 417 | if (r) { |
410 | ca_destroy(&smc->old_counts); | 418 | ca_destroy(&smc->old_counts); |
411 | kfree(smc); | 419 | kfree(smc); |
412 | return NULL; | 420 | return ERR_PTR(r); |
413 | } | 421 | } |
414 | 422 | ||
415 | smc->real_sm = sm; | 423 | smc->real_sm = sm; |
diff --git a/drivers/md/persistent-data/dm-space-map-disk.c b/drivers/md/persistent-data/dm-space-map-disk.c index fc469ba9f627..3d0ed5332883 100644 --- a/drivers/md/persistent-data/dm-space-map-disk.c +++ b/drivers/md/persistent-data/dm-space-map-disk.c | |||
@@ -290,7 +290,16 @@ struct dm_space_map *dm_sm_disk_create(struct dm_transaction_manager *tm, | |||
290 | dm_block_t nr_blocks) | 290 | dm_block_t nr_blocks) |
291 | { | 291 | { |
292 | struct dm_space_map *sm = dm_sm_disk_create_real(tm, nr_blocks); | 292 | struct dm_space_map *sm = dm_sm_disk_create_real(tm, nr_blocks); |
293 | return dm_sm_checker_create_fresh(sm); | 293 | struct dm_space_map *smc; |
294 | |||
295 | if (IS_ERR_OR_NULL(sm)) | ||
296 | return sm; | ||
297 | |||
298 | smc = dm_sm_checker_create_fresh(sm); | ||
299 | if (IS_ERR(smc)) | ||
300 | dm_sm_destroy(sm); | ||
301 | |||
302 | return smc; | ||
294 | } | 303 | } |
295 | EXPORT_SYMBOL_GPL(dm_sm_disk_create); | 304 | EXPORT_SYMBOL_GPL(dm_sm_disk_create); |
296 | 305 | ||
diff --git a/drivers/md/persistent-data/dm-transaction-manager.c b/drivers/md/persistent-data/dm-transaction-manager.c index 400fe144c0cd..e5604b32d91f 100644 --- a/drivers/md/persistent-data/dm-transaction-manager.c +++ b/drivers/md/persistent-data/dm-transaction-manager.c | |||
@@ -138,6 +138,9 @@ EXPORT_SYMBOL_GPL(dm_tm_create_non_blocking_clone); | |||
138 | 138 | ||
139 | void dm_tm_destroy(struct dm_transaction_manager *tm) | 139 | void dm_tm_destroy(struct dm_transaction_manager *tm) |
140 | { | 140 | { |
141 | if (!tm->is_clone) | ||
142 | wipe_shadow_table(tm); | ||
143 | |||
141 | kfree(tm); | 144 | kfree(tm); |
142 | } | 145 | } |
143 | EXPORT_SYMBOL_GPL(dm_tm_destroy); | 146 | EXPORT_SYMBOL_GPL(dm_tm_destroy); |
@@ -344,8 +347,10 @@ static int dm_tm_create_internal(struct dm_block_manager *bm, | |||
344 | } | 347 | } |
345 | 348 | ||
346 | *sm = dm_sm_checker_create(inner); | 349 | *sm = dm_sm_checker_create(inner); |
347 | if (!*sm) | 350 | if (IS_ERR(*sm)) { |
351 | r = PTR_ERR(*sm); | ||
348 | goto bad2; | 352 | goto bad2; |
353 | } | ||
349 | 354 | ||
350 | } else { | 355 | } else { |
351 | r = dm_bm_write_lock(dm_tm_get_bm(*tm), sb_location, | 356 | r = dm_bm_write_lock(dm_tm_get_bm(*tm), sb_location, |
@@ -364,8 +369,10 @@ static int dm_tm_create_internal(struct dm_block_manager *bm, | |||
364 | } | 369 | } |
365 | 370 | ||
366 | *sm = dm_sm_checker_create(inner); | 371 | *sm = dm_sm_checker_create(inner); |
367 | if (!*sm) | 372 | if (IS_ERR(*sm)) { |
373 | r = PTR_ERR(*sm); | ||
368 | goto bad2; | 374 | goto bad2; |
375 | } | ||
369 | } | 376 | } |
370 | 377 | ||
371 | return 0; | 378 | return 0; |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a9c7981ddd24..8c2754f835ef 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -517,8 +517,8 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect | |||
517 | int bad_sectors; | 517 | int bad_sectors; |
518 | 518 | ||
519 | int disk = start_disk + i; | 519 | int disk = start_disk + i; |
520 | if (disk >= conf->raid_disks) | 520 | if (disk >= conf->raid_disks * 2) |
521 | disk -= conf->raid_disks; | 521 | disk -= conf->raid_disks * 2; |
522 | 522 | ||
523 | rdev = rcu_dereference(conf->mirrors[disk].rdev); | 523 | rdev = rcu_dereference(conf->mirrors[disk].rdev); |
524 | if (r1_bio->bios[disk] == IO_BLOCKED | 524 | if (r1_bio->bios[disk] == IO_BLOCKED |
@@ -883,7 +883,6 @@ static void make_request(struct mddev *mddev, struct bio * bio) | |||
883 | const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); | 883 | const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); |
884 | const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); | 884 | const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); |
885 | struct md_rdev *blocked_rdev; | 885 | struct md_rdev *blocked_rdev; |
886 | int plugged; | ||
887 | int first_clone; | 886 | int first_clone; |
888 | int sectors_handled; | 887 | int sectors_handled; |
889 | int max_sectors; | 888 | int max_sectors; |
@@ -1034,7 +1033,6 @@ read_again: | |||
1034 | * the bad blocks. Each set of writes gets it's own r1bio | 1033 | * the bad blocks. Each set of writes gets it's own r1bio |
1035 | * with a set of bios attached. | 1034 | * with a set of bios attached. |
1036 | */ | 1035 | */ |
1037 | plugged = mddev_check_plugged(mddev); | ||
1038 | 1036 | ||
1039 | disks = conf->raid_disks * 2; | 1037 | disks = conf->raid_disks * 2; |
1040 | retry_write: | 1038 | retry_write: |
@@ -1191,6 +1189,8 @@ read_again: | |||
1191 | bio_list_add(&conf->pending_bio_list, mbio); | 1189 | bio_list_add(&conf->pending_bio_list, mbio); |
1192 | conf->pending_count++; | 1190 | conf->pending_count++; |
1193 | spin_unlock_irqrestore(&conf->device_lock, flags); | 1191 | spin_unlock_irqrestore(&conf->device_lock, flags); |
1192 | if (!mddev_check_plugged(mddev)) | ||
1193 | md_wakeup_thread(mddev->thread); | ||
1194 | } | 1194 | } |
1195 | /* Mustn't call r1_bio_write_done before this next test, | 1195 | /* Mustn't call r1_bio_write_done before this next test, |
1196 | * as it could result in the bio being freed. | 1196 | * as it could result in the bio being freed. |
@@ -1213,9 +1213,6 @@ read_again: | |||
1213 | 1213 | ||
1214 | /* In case raid1d snuck in to freeze_array */ | 1214 | /* In case raid1d snuck in to freeze_array */ |
1215 | wake_up(&conf->wait_barrier); | 1215 | wake_up(&conf->wait_barrier); |
1216 | |||
1217 | if (do_sync || !bitmap || !plugged) | ||
1218 | md_wakeup_thread(mddev->thread); | ||
1219 | } | 1216 | } |
1220 | 1217 | ||
1221 | static void status(struct seq_file *seq, struct mddev *mddev) | 1218 | static void status(struct seq_file *seq, struct mddev *mddev) |
@@ -2621,7 +2618,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) | |||
2621 | goto abort; | 2618 | goto abort; |
2622 | } | 2619 | } |
2623 | err = -ENOMEM; | 2620 | err = -ENOMEM; |
2624 | conf->thread = md_register_thread(raid1d, mddev, NULL); | 2621 | conf->thread = md_register_thread(raid1d, mddev, "raid1"); |
2625 | if (!conf->thread) { | 2622 | if (!conf->thread) { |
2626 | printk(KERN_ERR | 2623 | printk(KERN_ERR |
2627 | "md/raid1:%s: couldn't allocate thread\n", | 2624 | "md/raid1:%s: couldn't allocate thread\n", |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 99ae6068e456..8da6282254c3 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1039,7 +1039,6 @@ static void make_request(struct mddev *mddev, struct bio * bio) | |||
1039 | const unsigned long do_fua = (bio->bi_rw & REQ_FUA); | 1039 | const unsigned long do_fua = (bio->bi_rw & REQ_FUA); |
1040 | unsigned long flags; | 1040 | unsigned long flags; |
1041 | struct md_rdev *blocked_rdev; | 1041 | struct md_rdev *blocked_rdev; |
1042 | int plugged; | ||
1043 | int sectors_handled; | 1042 | int sectors_handled; |
1044 | int max_sectors; | 1043 | int max_sectors; |
1045 | int sectors; | 1044 | int sectors; |
@@ -1239,7 +1238,6 @@ read_again: | |||
1239 | * of r10_bios is recored in bio->bi_phys_segments just as with | 1238 | * of r10_bios is recored in bio->bi_phys_segments just as with |
1240 | * the read case. | 1239 | * the read case. |
1241 | */ | 1240 | */ |
1242 | plugged = mddev_check_plugged(mddev); | ||
1243 | 1241 | ||
1244 | r10_bio->read_slot = -1; /* make sure repl_bio gets freed */ | 1242 | r10_bio->read_slot = -1; /* make sure repl_bio gets freed */ |
1245 | raid10_find_phys(conf, r10_bio); | 1243 | raid10_find_phys(conf, r10_bio); |
@@ -1396,6 +1394,8 @@ retry_write: | |||
1396 | bio_list_add(&conf->pending_bio_list, mbio); | 1394 | bio_list_add(&conf->pending_bio_list, mbio); |
1397 | conf->pending_count++; | 1395 | conf->pending_count++; |
1398 | spin_unlock_irqrestore(&conf->device_lock, flags); | 1396 | spin_unlock_irqrestore(&conf->device_lock, flags); |
1397 | if (!mddev_check_plugged(mddev)) | ||
1398 | md_wakeup_thread(mddev->thread); | ||
1399 | 1399 | ||
1400 | if (!r10_bio->devs[i].repl_bio) | 1400 | if (!r10_bio->devs[i].repl_bio) |
1401 | continue; | 1401 | continue; |
@@ -1423,6 +1423,8 @@ retry_write: | |||
1423 | bio_list_add(&conf->pending_bio_list, mbio); | 1423 | bio_list_add(&conf->pending_bio_list, mbio); |
1424 | conf->pending_count++; | 1424 | conf->pending_count++; |
1425 | spin_unlock_irqrestore(&conf->device_lock, flags); | 1425 | spin_unlock_irqrestore(&conf->device_lock, flags); |
1426 | if (!mddev_check_plugged(mddev)) | ||
1427 | md_wakeup_thread(mddev->thread); | ||
1426 | } | 1428 | } |
1427 | 1429 | ||
1428 | /* Don't remove the bias on 'remaining' (one_write_done) until | 1430 | /* Don't remove the bias on 'remaining' (one_write_done) until |
@@ -1448,9 +1450,6 @@ retry_write: | |||
1448 | 1450 | ||
1449 | /* In case raid10d snuck in to freeze_array */ | 1451 | /* In case raid10d snuck in to freeze_array */ |
1450 | wake_up(&conf->wait_barrier); | 1452 | wake_up(&conf->wait_barrier); |
1451 | |||
1452 | if (do_sync || !mddev->bitmap || !plugged) | ||
1453 | md_wakeup_thread(mddev->thread); | ||
1454 | } | 1453 | } |
1455 | 1454 | ||
1456 | static void status(struct seq_file *seq, struct mddev *mddev) | 1455 | static void status(struct seq_file *seq, struct mddev *mddev) |
@@ -2310,7 +2309,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 | |||
2310 | if (r10_sync_page_io(rdev, | 2309 | if (r10_sync_page_io(rdev, |
2311 | r10_bio->devs[sl].addr + | 2310 | r10_bio->devs[sl].addr + |
2312 | sect, | 2311 | sect, |
2313 | s<<9, conf->tmppage, WRITE) | 2312 | s, conf->tmppage, WRITE) |
2314 | == 0) { | 2313 | == 0) { |
2315 | /* Well, this device is dead */ | 2314 | /* Well, this device is dead */ |
2316 | printk(KERN_NOTICE | 2315 | printk(KERN_NOTICE |
@@ -2349,7 +2348,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 | |||
2349 | switch (r10_sync_page_io(rdev, | 2348 | switch (r10_sync_page_io(rdev, |
2350 | r10_bio->devs[sl].addr + | 2349 | r10_bio->devs[sl].addr + |
2351 | sect, | 2350 | sect, |
2352 | s<<9, conf->tmppage, | 2351 | s, conf->tmppage, |
2353 | READ)) { | 2352 | READ)) { |
2354 | case 0: | 2353 | case 0: |
2355 | /* Well, this device is dead */ | 2354 | /* Well, this device is dead */ |
@@ -2512,7 +2511,7 @@ read_more: | |||
2512 | slot = r10_bio->read_slot; | 2511 | slot = r10_bio->read_slot; |
2513 | printk_ratelimited( | 2512 | printk_ratelimited( |
2514 | KERN_ERR | 2513 | KERN_ERR |
2515 | "md/raid10:%s: %s: redirecting" | 2514 | "md/raid10:%s: %s: redirecting " |
2516 | "sector %llu to another mirror\n", | 2515 | "sector %llu to another mirror\n", |
2517 | mdname(mddev), | 2516 | mdname(mddev), |
2518 | bdevname(rdev->bdev, b), | 2517 | bdevname(rdev->bdev, b), |
@@ -2661,7 +2660,8 @@ static void raid10d(struct mddev *mddev) | |||
2661 | blk_start_plug(&plug); | 2660 | blk_start_plug(&plug); |
2662 | for (;;) { | 2661 | for (;;) { |
2663 | 2662 | ||
2664 | flush_pending_writes(conf); | 2663 | if (atomic_read(&mddev->plug_cnt) == 0) |
2664 | flush_pending_writes(conf); | ||
2665 | 2665 | ||
2666 | spin_lock_irqsave(&conf->device_lock, flags); | 2666 | spin_lock_irqsave(&conf->device_lock, flags); |
2667 | if (list_empty(head)) { | 2667 | if (list_empty(head)) { |
@@ -2890,6 +2890,12 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, | |||
2890 | /* want to reconstruct this device */ | 2890 | /* want to reconstruct this device */ |
2891 | rb2 = r10_bio; | 2891 | rb2 = r10_bio; |
2892 | sect = raid10_find_virt(conf, sector_nr, i); | 2892 | sect = raid10_find_virt(conf, sector_nr, i); |
2893 | if (sect >= mddev->resync_max_sectors) { | ||
2894 | /* last stripe is not complete - don't | ||
2895 | * try to recover this sector. | ||
2896 | */ | ||
2897 | continue; | ||
2898 | } | ||
2893 | /* Unless we are doing a full sync, or a replacement | 2899 | /* Unless we are doing a full sync, or a replacement |
2894 | * we only need to recover the block if it is set in | 2900 | * we only need to recover the block if it is set in |
2895 | * the bitmap | 2901 | * the bitmap |
@@ -3421,7 +3427,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) | |||
3421 | spin_lock_init(&conf->resync_lock); | 3427 | spin_lock_init(&conf->resync_lock); |
3422 | init_waitqueue_head(&conf->wait_barrier); | 3428 | init_waitqueue_head(&conf->wait_barrier); |
3423 | 3429 | ||
3424 | conf->thread = md_register_thread(raid10d, mddev, NULL); | 3430 | conf->thread = md_register_thread(raid10d, mddev, "raid10"); |
3425 | if (!conf->thread) | 3431 | if (!conf->thread) |
3426 | goto out; | 3432 | goto out; |
3427 | 3433 | ||
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index d26767246d26..04348d76bb30 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -196,12 +196,14 @@ static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) | |||
196 | BUG_ON(!list_empty(&sh->lru)); | 196 | BUG_ON(!list_empty(&sh->lru)); |
197 | BUG_ON(atomic_read(&conf->active_stripes)==0); | 197 | BUG_ON(atomic_read(&conf->active_stripes)==0); |
198 | if (test_bit(STRIPE_HANDLE, &sh->state)) { | 198 | if (test_bit(STRIPE_HANDLE, &sh->state)) { |
199 | if (test_bit(STRIPE_DELAYED, &sh->state)) | 199 | if (test_bit(STRIPE_DELAYED, &sh->state) && |
200 | !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) | ||
200 | list_add_tail(&sh->lru, &conf->delayed_list); | 201 | list_add_tail(&sh->lru, &conf->delayed_list); |
201 | else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && | 202 | else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && |
202 | sh->bm_seq - conf->seq_write > 0) | 203 | sh->bm_seq - conf->seq_write > 0) |
203 | list_add_tail(&sh->lru, &conf->bitmap_list); | 204 | list_add_tail(&sh->lru, &conf->bitmap_list); |
204 | else { | 205 | else { |
206 | clear_bit(STRIPE_DELAYED, &sh->state); | ||
205 | clear_bit(STRIPE_BIT_DELAY, &sh->state); | 207 | clear_bit(STRIPE_BIT_DELAY, &sh->state); |
206 | list_add_tail(&sh->lru, &conf->handle_list); | 208 | list_add_tail(&sh->lru, &conf->handle_list); |
207 | } | 209 | } |
@@ -606,6 +608,12 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||
606 | * a chance*/ | 608 | * a chance*/ |
607 | md_check_recovery(conf->mddev); | 609 | md_check_recovery(conf->mddev); |
608 | } | 610 | } |
611 | /* | ||
612 | * Because md_wait_for_blocked_rdev | ||
613 | * will dec nr_pending, we must | ||
614 | * increment it first. | ||
615 | */ | ||
616 | atomic_inc(&rdev->nr_pending); | ||
609 | md_wait_for_blocked_rdev(rdev, conf->mddev); | 617 | md_wait_for_blocked_rdev(rdev, conf->mddev); |
610 | } else { | 618 | } else { |
611 | /* Acknowledged bad block - skip the write */ | 619 | /* Acknowledged bad block - skip the write */ |
@@ -1737,6 +1745,7 @@ static void raid5_end_read_request(struct bio * bi, int error) | |||
1737 | } else { | 1745 | } else { |
1738 | const char *bdn = bdevname(rdev->bdev, b); | 1746 | const char *bdn = bdevname(rdev->bdev, b); |
1739 | int retry = 0; | 1747 | int retry = 0; |
1748 | int set_bad = 0; | ||
1740 | 1749 | ||
1741 | clear_bit(R5_UPTODATE, &sh->dev[i].flags); | 1750 | clear_bit(R5_UPTODATE, &sh->dev[i].flags); |
1742 | atomic_inc(&rdev->read_errors); | 1751 | atomic_inc(&rdev->read_errors); |
@@ -1748,7 +1757,8 @@ static void raid5_end_read_request(struct bio * bi, int error) | |||
1748 | mdname(conf->mddev), | 1757 | mdname(conf->mddev), |
1749 | (unsigned long long)s, | 1758 | (unsigned long long)s, |
1750 | bdn); | 1759 | bdn); |
1751 | else if (conf->mddev->degraded >= conf->max_degraded) | 1760 | else if (conf->mddev->degraded >= conf->max_degraded) { |
1761 | set_bad = 1; | ||
1752 | printk_ratelimited( | 1762 | printk_ratelimited( |
1753 | KERN_WARNING | 1763 | KERN_WARNING |
1754 | "md/raid:%s: read error not correctable " | 1764 | "md/raid:%s: read error not correctable " |
@@ -1756,8 +1766,9 @@ static void raid5_end_read_request(struct bio * bi, int error) | |||
1756 | mdname(conf->mddev), | 1766 | mdname(conf->mddev), |
1757 | (unsigned long long)s, | 1767 | (unsigned long long)s, |
1758 | bdn); | 1768 | bdn); |
1759 | else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) | 1769 | } else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) { |
1760 | /* Oh, no!!! */ | 1770 | /* Oh, no!!! */ |
1771 | set_bad = 1; | ||
1761 | printk_ratelimited( | 1772 | printk_ratelimited( |
1762 | KERN_WARNING | 1773 | KERN_WARNING |
1763 | "md/raid:%s: read error NOT corrected!! " | 1774 | "md/raid:%s: read error NOT corrected!! " |
@@ -1765,7 +1776,7 @@ static void raid5_end_read_request(struct bio * bi, int error) | |||
1765 | mdname(conf->mddev), | 1776 | mdname(conf->mddev), |
1766 | (unsigned long long)s, | 1777 | (unsigned long long)s, |
1767 | bdn); | 1778 | bdn); |
1768 | else if (atomic_read(&rdev->read_errors) | 1779 | } else if (atomic_read(&rdev->read_errors) |
1769 | > conf->max_nr_stripes) | 1780 | > conf->max_nr_stripes) |
1770 | printk(KERN_WARNING | 1781 | printk(KERN_WARNING |
1771 | "md/raid:%s: Too many read errors, failing device %s.\n", | 1782 | "md/raid:%s: Too many read errors, failing device %s.\n", |
@@ -1777,7 +1788,11 @@ static void raid5_end_read_request(struct bio * bi, int error) | |||
1777 | else { | 1788 | else { |
1778 | clear_bit(R5_ReadError, &sh->dev[i].flags); | 1789 | clear_bit(R5_ReadError, &sh->dev[i].flags); |
1779 | clear_bit(R5_ReWrite, &sh->dev[i].flags); | 1790 | clear_bit(R5_ReWrite, &sh->dev[i].flags); |
1780 | md_error(conf->mddev, rdev); | 1791 | if (!(set_bad |
1792 | && test_bit(In_sync, &rdev->flags) | ||
1793 | && rdev_set_badblocks( | ||
1794 | rdev, sh->sector, STRIPE_SECTORS, 0))) | ||
1795 | md_error(conf->mddev, rdev); | ||
1781 | } | 1796 | } |
1782 | } | 1797 | } |
1783 | rdev_dec_pending(rdev, conf->mddev); | 1798 | rdev_dec_pending(rdev, conf->mddev); |
@@ -3582,8 +3597,18 @@ static void handle_stripe(struct stripe_head *sh) | |||
3582 | 3597 | ||
3583 | finish: | 3598 | finish: |
3584 | /* wait for this device to become unblocked */ | 3599 | /* wait for this device to become unblocked */ |
3585 | if (conf->mddev->external && unlikely(s.blocked_rdev)) | 3600 | if (unlikely(s.blocked_rdev)) { |
3586 | md_wait_for_blocked_rdev(s.blocked_rdev, conf->mddev); | 3601 | if (conf->mddev->external) |
3602 | md_wait_for_blocked_rdev(s.blocked_rdev, | ||
3603 | conf->mddev); | ||
3604 | else | ||
3605 | /* Internal metadata will immediately | ||
3606 | * be written by raid5d, so we don't | ||
3607 | * need to wait here. | ||
3608 | */ | ||
3609 | rdev_dec_pending(s.blocked_rdev, | ||
3610 | conf->mddev); | ||
3611 | } | ||
3587 | 3612 | ||
3588 | if (s.handle_bad_blocks) | 3613 | if (s.handle_bad_blocks) |
3589 | for (i = disks; i--; ) { | 3614 | for (i = disks; i--; ) { |
@@ -3881,8 +3906,6 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio) | |||
3881 | raid_bio->bi_next = (void*)rdev; | 3906 | raid_bio->bi_next = (void*)rdev; |
3882 | align_bi->bi_bdev = rdev->bdev; | 3907 | align_bi->bi_bdev = rdev->bdev; |
3883 | align_bi->bi_flags &= ~(1 << BIO_SEG_VALID); | 3908 | align_bi->bi_flags &= ~(1 << BIO_SEG_VALID); |
3884 | /* No reshape active, so we can trust rdev->data_offset */ | ||
3885 | align_bi->bi_sector += rdev->data_offset; | ||
3886 | 3909 | ||
3887 | if (!bio_fits_rdev(align_bi) || | 3910 | if (!bio_fits_rdev(align_bi) || |
3888 | is_badblock(rdev, align_bi->bi_sector, align_bi->bi_size>>9, | 3911 | is_badblock(rdev, align_bi->bi_sector, align_bi->bi_size>>9, |
@@ -3893,6 +3916,9 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio) | |||
3893 | return 0; | 3916 | return 0; |
3894 | } | 3917 | } |
3895 | 3918 | ||
3919 | /* No reshape active, so we can trust rdev->data_offset */ | ||
3920 | align_bi->bi_sector += rdev->data_offset; | ||
3921 | |||
3896 | spin_lock_irq(&conf->device_lock); | 3922 | spin_lock_irq(&conf->device_lock); |
3897 | wait_event_lock_irq(conf->wait_for_stripe, | 3923 | wait_event_lock_irq(conf->wait_for_stripe, |
3898 | conf->quiesce == 0, | 3924 | conf->quiesce == 0, |
@@ -3971,7 +3997,6 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
3971 | struct stripe_head *sh; | 3997 | struct stripe_head *sh; |
3972 | const int rw = bio_data_dir(bi); | 3998 | const int rw = bio_data_dir(bi); |
3973 | int remaining; | 3999 | int remaining; |
3974 | int plugged; | ||
3975 | 4000 | ||
3976 | if (unlikely(bi->bi_rw & REQ_FLUSH)) { | 4001 | if (unlikely(bi->bi_rw & REQ_FLUSH)) { |
3977 | md_flush_request(mddev, bi); | 4002 | md_flush_request(mddev, bi); |
@@ -3990,7 +4015,6 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
3990 | bi->bi_next = NULL; | 4015 | bi->bi_next = NULL; |
3991 | bi->bi_phys_segments = 1; /* over-loaded to count active stripes */ | 4016 | bi->bi_phys_segments = 1; /* over-loaded to count active stripes */ |
3992 | 4017 | ||
3993 | plugged = mddev_check_plugged(mddev); | ||
3994 | for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) { | 4018 | for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) { |
3995 | DEFINE_WAIT(w); | 4019 | DEFINE_WAIT(w); |
3996 | int previous; | 4020 | int previous; |
@@ -4092,6 +4116,7 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
4092 | if ((bi->bi_rw & REQ_SYNC) && | 4116 | if ((bi->bi_rw & REQ_SYNC) && |
4093 | !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) | 4117 | !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) |
4094 | atomic_inc(&conf->preread_active_stripes); | 4118 | atomic_inc(&conf->preread_active_stripes); |
4119 | mddev_check_plugged(mddev); | ||
4095 | release_stripe(sh); | 4120 | release_stripe(sh); |
4096 | } else { | 4121 | } else { |
4097 | /* cannot get stripe for read-ahead, just give-up */ | 4122 | /* cannot get stripe for read-ahead, just give-up */ |
@@ -4099,10 +4124,7 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
4099 | finish_wait(&conf->wait_for_overlap, &w); | 4124 | finish_wait(&conf->wait_for_overlap, &w); |
4100 | break; | 4125 | break; |
4101 | } | 4126 | } |
4102 | |||
4103 | } | 4127 | } |
4104 | if (!plugged) | ||
4105 | md_wakeup_thread(mddev->thread); | ||
4106 | 4128 | ||
4107 | spin_lock_irq(&conf->device_lock); | 4129 | spin_lock_irq(&conf->device_lock); |
4108 | remaining = raid5_dec_bi_phys_segments(bi); | 4130 | remaining = raid5_dec_bi_phys_segments(bi); |
@@ -4823,6 +4845,7 @@ static struct r5conf *setup_conf(struct mddev *mddev) | |||
4823 | int raid_disk, memory, max_disks; | 4845 | int raid_disk, memory, max_disks; |
4824 | struct md_rdev *rdev; | 4846 | struct md_rdev *rdev; |
4825 | struct disk_info *disk; | 4847 | struct disk_info *disk; |
4848 | char pers_name[6]; | ||
4826 | 4849 | ||
4827 | if (mddev->new_level != 5 | 4850 | if (mddev->new_level != 5 |
4828 | && mddev->new_level != 4 | 4851 | && mddev->new_level != 4 |
@@ -4946,7 +4969,8 @@ static struct r5conf *setup_conf(struct mddev *mddev) | |||
4946 | printk(KERN_INFO "md/raid:%s: allocated %dkB\n", | 4969 | printk(KERN_INFO "md/raid:%s: allocated %dkB\n", |
4947 | mdname(mddev), memory); | 4970 | mdname(mddev), memory); |
4948 | 4971 | ||
4949 | conf->thread = md_register_thread(raid5d, mddev, NULL); | 4972 | sprintf(pers_name, "raid%d", mddev->new_level); |
4973 | conf->thread = md_register_thread(raid5d, mddev, pers_name); | ||
4950 | if (!conf->thread) { | 4974 | if (!conf->thread) { |
4951 | printk(KERN_ERR | 4975 | printk(KERN_ERR |
4952 | "md/raid:%s: couldn't allocate thread.\n", | 4976 | "md/raid:%s: couldn't allocate thread.\n", |
@@ -5465,10 +5489,9 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev) | |||
5465 | if (rdev->saved_raid_disk >= 0 && | 5489 | if (rdev->saved_raid_disk >= 0 && |
5466 | rdev->saved_raid_disk >= first && | 5490 | rdev->saved_raid_disk >= first && |
5467 | conf->disks[rdev->saved_raid_disk].rdev == NULL) | 5491 | conf->disks[rdev->saved_raid_disk].rdev == NULL) |
5468 | disk = rdev->saved_raid_disk; | 5492 | first = rdev->saved_raid_disk; |
5469 | else | 5493 | |
5470 | disk = first; | 5494 | for (disk = first; disk <= last; disk++) { |
5471 | for ( ; disk <= last ; disk++) { | ||
5472 | p = conf->disks + disk; | 5495 | p = conf->disks + disk; |
5473 | if (p->rdev == NULL) { | 5496 | if (p->rdev == NULL) { |
5474 | clear_bit(In_sync, &rdev->flags); | 5497 | clear_bit(In_sync, &rdev->flags); |
@@ -5477,8 +5500,11 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev) | |||
5477 | if (rdev->saved_raid_disk != disk) | 5500 | if (rdev->saved_raid_disk != disk) |
5478 | conf->fullsync = 1; | 5501 | conf->fullsync = 1; |
5479 | rcu_assign_pointer(p->rdev, rdev); | 5502 | rcu_assign_pointer(p->rdev, rdev); |
5480 | break; | 5503 | goto out; |
5481 | } | 5504 | } |
5505 | } | ||
5506 | for (disk = first; disk <= last; disk++) { | ||
5507 | p = conf->disks + disk; | ||
5482 | if (test_bit(WantReplacement, &p->rdev->flags) && | 5508 | if (test_bit(WantReplacement, &p->rdev->flags) && |
5483 | p->replacement == NULL) { | 5509 | p->replacement == NULL) { |
5484 | clear_bit(In_sync, &rdev->flags); | 5510 | clear_bit(In_sync, &rdev->flags); |
@@ -5490,6 +5516,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev) | |||
5490 | break; | 5516 | break; |
5491 | } | 5517 | } |
5492 | } | 5518 | } |
5519 | out: | ||
5493 | print_raid5_conf(conf); | 5520 | print_raid5_conf(conf); |
5494 | return err; | 5521 | return err; |
5495 | } | 5522 | } |
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c index 7d42c11c8684..0cdbd742974a 100644 --- a/drivers/media/common/saa7146_fops.c +++ b/drivers/media/common/saa7146_fops.c | |||
@@ -198,7 +198,6 @@ static int fops_open(struct file *file) | |||
198 | struct saa7146_dev *dev = video_drvdata(file); | 198 | struct saa7146_dev *dev = video_drvdata(file); |
199 | struct saa7146_fh *fh = NULL; | 199 | struct saa7146_fh *fh = NULL; |
200 | int result = 0; | 200 | int result = 0; |
201 | enum v4l2_buf_type type; | ||
202 | 201 | ||
203 | DEB_EE("file:%p, dev:%s\n", file, video_device_node_name(vdev)); | 202 | DEB_EE("file:%p, dev:%s\n", file, video_device_node_name(vdev)); |
204 | 203 | ||
@@ -207,10 +206,6 @@ static int fops_open(struct file *file) | |||
207 | 206 | ||
208 | DEB_D("using: %p\n", dev); | 207 | DEB_D("using: %p\n", dev); |
209 | 208 | ||
210 | type = vdev->vfl_type == VFL_TYPE_GRABBER | ||
211 | ? V4L2_BUF_TYPE_VIDEO_CAPTURE | ||
212 | : V4L2_BUF_TYPE_VBI_CAPTURE; | ||
213 | |||
214 | /* check if an extension is registered */ | 209 | /* check if an extension is registered */ |
215 | if( NULL == dev->ext ) { | 210 | if( NULL == dev->ext ) { |
216 | DEB_S("no extension registered for this device\n"); | 211 | DEB_S("no extension registered for this device\n"); |
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c index 98ecaf0900d6..3180f5b2a6a6 100644 --- a/drivers/media/dvb/frontends/cx24110.c +++ b/drivers/media/dvb/frontends/cx24110.c | |||
@@ -516,9 +516,9 @@ static int cx24110_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
516 | if(cx24110_readreg(state,0x10)&0x40) { | 516 | if(cx24110_readreg(state,0x10)&0x40) { |
517 | /* the RS error counter has finished one counting window */ | 517 | /* the RS error counter has finished one counting window */ |
518 | cx24110_writereg(state,0x10,0x60); /* select the byer reg */ | 518 | cx24110_writereg(state,0x10,0x60); /* select the byer reg */ |
519 | cx24110_readreg(state, 0x12) | | 519 | (void)(cx24110_readreg(state, 0x12) | |
520 | (cx24110_readreg(state, 0x13) << 8) | | 520 | (cx24110_readreg(state, 0x13) << 8) | |
521 | (cx24110_readreg(state, 0x14) << 16); | 521 | (cx24110_readreg(state, 0x14) << 16)); |
522 | cx24110_writereg(state,0x10,0x70); /* select the bler reg */ | 522 | cx24110_writereg(state,0x10,0x70); /* select the bler reg */ |
523 | state->lastbler=cx24110_readreg(state,0x12)| | 523 | state->lastbler=cx24110_readreg(state,0x12)| |
524 | (cx24110_readreg(state,0x13)<<8)| | 524 | (cx24110_readreg(state,0x13)<<8)| |
diff --git a/drivers/media/dvb/frontends/cxd2820r_c.c b/drivers/media/dvb/frontends/cxd2820r_c.c index 945404991529..ed3b0ba624de 100644 --- a/drivers/media/dvb/frontends/cxd2820r_c.c +++ b/drivers/media/dvb/frontends/cxd2820r_c.c | |||
@@ -121,7 +121,7 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe) | |||
121 | if (ret) | 121 | if (ret) |
122 | goto error; | 122 | goto error; |
123 | 123 | ||
124 | switch ((buf[0] >> 0) & 0x03) { | 124 | switch ((buf[0] >> 0) & 0x07) { |
125 | case 0: | 125 | case 0: |
126 | c->modulation = QAM_16; | 126 | c->modulation = QAM_16; |
127 | break; | 127 | break; |
diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c index a3ab1a5b6597..cc11260e99df 100644 --- a/drivers/media/dvb/frontends/lg2160.c +++ b/drivers/media/dvb/frontends/lg2160.c | |||
@@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state, | |||
126 | 126 | ||
127 | lg_reg("writing %d registers...\n", len); | 127 | lg_reg("writing %d registers...\n", len); |
128 | 128 | ||
129 | for (i = 0; i < len - 1; i++) { | 129 | for (i = 0; i < len; i++) { |
130 | ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); | 130 | ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); |
131 | if (lg_fail(ret)) | 131 | if (lg_fail(ret)) |
132 | return ret; | 132 | return ret; |
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c index 63c004a25e0b..664e460f247b 100644 --- a/drivers/media/dvb/siano/smsusb.c +++ b/drivers/media/dvb/siano/smsusb.c | |||
@@ -544,6 +544,8 @@ static const struct usb_device_id smsusb_id_table[] __devinitconst = { | |||
544 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 544 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
545 | { USB_DEVICE(0x2040, 0xc0a0), | 545 | { USB_DEVICE(0x2040, 0xc0a0), |
546 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | 546 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, |
547 | { USB_DEVICE(0x2040, 0xf5a0), | ||
548 | .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, | ||
547 | { } /* Terminating entry */ | 549 | { } /* Terminating entry */ |
548 | }; | 550 | }; |
549 | 551 | ||
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 740a3d5520c7..b415211d0c4b 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c | |||
@@ -157,7 +157,7 @@ static int __devinit maxiradio_probe(struct pci_dev *pdev, const struct pci_devi | |||
157 | goto err_out_free_region; | 157 | goto err_out_free_region; |
158 | 158 | ||
159 | dev->io = pci_resource_start(pdev, 0); | 159 | dev->io = pci_resource_start(pdev, 0); |
160 | if (snd_tea575x_init(&dev->tea)) { | 160 | if (snd_tea575x_init(&dev->tea, THIS_MODULE)) { |
161 | printk(KERN_ERR "radio-maxiradio: Unable to detect TEA575x tuner\n"); | 161 | printk(KERN_ERR "radio-maxiradio: Unable to detect TEA575x tuner\n"); |
162 | goto err_out_free_region; | 162 | goto err_out_free_region; |
163 | } | 163 | } |
diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index 52b8011f1b23..4efcbec74c52 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c | |||
@@ -238,7 +238,7 @@ static int __devinit fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io) | |||
238 | snprintf(fmr2->tea.bus_info, sizeof(fmr2->tea.bus_info), "%s:%s", | 238 | snprintf(fmr2->tea.bus_info, sizeof(fmr2->tea.bus_info), "%s:%s", |
239 | fmr2->is_fmd2 ? "PnP" : "ISA", dev_name(pdev)); | 239 | fmr2->is_fmd2 ? "PnP" : "ISA", dev_name(pdev)); |
240 | 240 | ||
241 | if (snd_tea575x_init(&fmr2->tea)) { | 241 | if (snd_tea575x_init(&fmr2->tea, THIS_MODULE)) { |
242 | printk(KERN_ERR "radio-sf16fmr2: Unable to detect TEA575x tuner\n"); | 242 | printk(KERN_ERR "radio-sf16fmr2: Unable to detect TEA575x tuner\n"); |
243 | release_region(fmr2->io, 2); | 243 | release_region(fmr2->io, 2); |
244 | return -ENODEV; | 244 | return -ENODEV; |
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index e9f638761296..f412f7ab270b 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c | |||
@@ -51,6 +51,8 @@ static struct usb_device_id si470x_usb_driver_id_table[] = { | |||
51 | { USB_DEVICE_AND_INTERFACE_INFO(0x1b80, 0xd700, USB_CLASS_HID, 0, 0) }, | 51 | { USB_DEVICE_AND_INTERFACE_INFO(0x1b80, 0xd700, USB_CLASS_HID, 0, 0) }, |
52 | /* Sanei Electric, Inc. FM USB Radio (sold as DealExtreme.com PCear) */ | 52 | /* Sanei Electric, Inc. FM USB Radio (sold as DealExtreme.com PCear) */ |
53 | { USB_DEVICE_AND_INTERFACE_INFO(0x10c5, 0x819a, USB_CLASS_HID, 0, 0) }, | 53 | { USB_DEVICE_AND_INTERFACE_INFO(0x10c5, 0x819a, USB_CLASS_HID, 0, 0) }, |
54 | /* Axentia ALERT FM USB Receiver */ | ||
55 | { USB_DEVICE_AND_INTERFACE_INFO(0x12cf, 0x7111, USB_CLASS_HID, 0, 0) }, | ||
54 | /* Terminating entry */ | 56 | /* Terminating entry */ |
55 | { } | 57 | { } |
56 | }; | 58 | }; |
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index ff2933ab705f..856ab962cd63 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
@@ -371,7 +371,6 @@ struct tvcard bttv_tvcards[] = { | |||
371 | .muxsel = MUXSEL(2, 3, 1, 1), | 371 | .muxsel = MUXSEL(2, 3, 1, 1), |
372 | .gpiomux = { 2, 0, 0, 0 }, | 372 | .gpiomux = { 2, 0, 0, 0 }, |
373 | .gpiomute = 10, | 373 | .gpiomute = 10, |
374 | .needs_tvaudio = 1, | ||
375 | .tuner_type = UNSET, | 374 | .tuner_type = UNSET, |
376 | .tuner_addr = ADDR_UNSET, | 375 | .tuner_addr = ADDR_UNSET, |
377 | }, | 376 | }, |
@@ -384,7 +383,6 @@ struct tvcard bttv_tvcards[] = { | |||
384 | .muxsel = MUXSEL(2, 3, 1, 1), | 383 | .muxsel = MUXSEL(2, 3, 1, 1), |
385 | .gpiomux = { 0, 1, 2, 3 }, | 384 | .gpiomux = { 0, 1, 2, 3 }, |
386 | .gpiomute = 4, | 385 | .gpiomute = 4, |
387 | .needs_tvaudio = 1, | ||
388 | .tuner_type = UNSET, | 386 | .tuner_type = UNSET, |
389 | .tuner_addr = ADDR_UNSET, | 387 | .tuner_addr = ADDR_UNSET, |
390 | }, | 388 | }, |
@@ -398,7 +396,6 @@ struct tvcard bttv_tvcards[] = { | |||
398 | .gpiomux = { 4, 0, 2, 3 }, | 396 | .gpiomux = { 4, 0, 2, 3 }, |
399 | .gpiomute = 1, | 397 | .gpiomute = 1, |
400 | .no_msp34xx = 1, | 398 | .no_msp34xx = 1, |
401 | .needs_tvaudio = 1, | ||
402 | .tuner_type = TUNER_PHILIPS_NTSC, | 399 | .tuner_type = TUNER_PHILIPS_NTSC, |
403 | .tuner_addr = ADDR_UNSET, | 400 | .tuner_addr = ADDR_UNSET, |
404 | .pll = PLL_28, | 401 | .pll = PLL_28, |
@@ -414,7 +411,6 @@ struct tvcard bttv_tvcards[] = { | |||
414 | .gpiomask = 0, | 411 | .gpiomask = 0, |
415 | .muxsel = MUXSEL(2, 3, 1, 1), | 412 | .muxsel = MUXSEL(2, 3, 1, 1), |
416 | .gpiomux = { 0 }, | 413 | .gpiomux = { 0 }, |
417 | .needs_tvaudio = 0, | ||
418 | .tuner_type = TUNER_ABSENT, | 414 | .tuner_type = TUNER_ABSENT, |
419 | .tuner_addr = ADDR_UNSET, | 415 | .tuner_addr = ADDR_UNSET, |
420 | }, | 416 | }, |
@@ -427,7 +423,6 @@ struct tvcard bttv_tvcards[] = { | |||
427 | .muxsel = MUXSEL(2, 3, 1, 0), | 423 | .muxsel = MUXSEL(2, 3, 1, 0), |
428 | .gpiomux = { 0, 1, 0, 1 }, | 424 | .gpiomux = { 0, 1, 0, 1 }, |
429 | .gpiomute = 3, | 425 | .gpiomute = 3, |
430 | .needs_tvaudio = 1, | ||
431 | .tuner_type = UNSET, | 426 | .tuner_type = UNSET, |
432 | .tuner_addr = ADDR_UNSET, | 427 | .tuner_addr = ADDR_UNSET, |
433 | }, | 428 | }, |
@@ -440,7 +435,6 @@ struct tvcard bttv_tvcards[] = { | |||
440 | .gpiomask = 0x0f, | 435 | .gpiomask = 0x0f, |
441 | .gpiomux = { 0x0c, 0x04, 0x08, 0x04 }, | 436 | .gpiomux = { 0x0c, 0x04, 0x08, 0x04 }, |
442 | /* 0x04 for some cards ?? */ | 437 | /* 0x04 for some cards ?? */ |
443 | .needs_tvaudio = 1, | ||
444 | .tuner_type = UNSET, | 438 | .tuner_type = UNSET, |
445 | .tuner_addr = ADDR_UNSET, | 439 | .tuner_addr = ADDR_UNSET, |
446 | .audio_mode_gpio= avermedia_tvphone_audio, | 440 | .audio_mode_gpio= avermedia_tvphone_audio, |
@@ -454,7 +448,6 @@ struct tvcard bttv_tvcards[] = { | |||
454 | .gpiomask = 0, | 448 | .gpiomask = 0, |
455 | .muxsel = MUXSEL(2, 3, 1, 0, 0), | 449 | .muxsel = MUXSEL(2, 3, 1, 0, 0), |
456 | .gpiomux = { 0 }, | 450 | .gpiomux = { 0 }, |
457 | .needs_tvaudio = 1, | ||
458 | .tuner_type = TUNER_ABSENT, | 451 | .tuner_type = TUNER_ABSENT, |
459 | .tuner_addr = ADDR_UNSET, | 452 | .tuner_addr = ADDR_UNSET, |
460 | }, | 453 | }, |
@@ -469,7 +462,6 @@ struct tvcard bttv_tvcards[] = { | |||
469 | .muxsel = MUXSEL(2, 3, 1, 1), | 462 | .muxsel = MUXSEL(2, 3, 1, 1), |
470 | .gpiomux = { 0, 0xc00, 0x800, 0x400 }, | 463 | .gpiomux = { 0, 0xc00, 0x800, 0x400 }, |
471 | .gpiomute = 0xc00, | 464 | .gpiomute = 0xc00, |
472 | .needs_tvaudio = 1, | ||
473 | .pll = PLL_28, | 465 | .pll = PLL_28, |
474 | .tuner_type = UNSET, | 466 | .tuner_type = UNSET, |
475 | .tuner_addr = ADDR_UNSET, | 467 | .tuner_addr = ADDR_UNSET, |
@@ -482,7 +474,6 @@ struct tvcard bttv_tvcards[] = { | |||
482 | .gpiomask = 3, | 474 | .gpiomask = 3, |
483 | .muxsel = MUXSEL(2, 3, 1, 1), | 475 | .muxsel = MUXSEL(2, 3, 1, 1), |
484 | .gpiomux = { 1, 1, 2, 3 }, | 476 | .gpiomux = { 1, 1, 2, 3 }, |
485 | .needs_tvaudio = 0, | ||
486 | .pll = PLL_28, | 477 | .pll = PLL_28, |
487 | .tuner_type = TUNER_TEMIC_PAL, | 478 | .tuner_type = TUNER_TEMIC_PAL, |
488 | .tuner_addr = ADDR_UNSET, | 479 | .tuner_addr = ADDR_UNSET, |
@@ -496,7 +487,6 @@ struct tvcard bttv_tvcards[] = { | |||
496 | .muxsel = MUXSEL(2, 0, 1, 1), | 487 | .muxsel = MUXSEL(2, 0, 1, 1), |
497 | .gpiomux = { 0, 1, 2, 3 }, | 488 | .gpiomux = { 0, 1, 2, 3 }, |
498 | .gpiomute = 4, | 489 | .gpiomute = 4, |
499 | .needs_tvaudio = 1, | ||
500 | .pll = PLL_28, | 490 | .pll = PLL_28, |
501 | .tuner_type = UNSET, | 491 | .tuner_type = UNSET, |
502 | .tuner_addr = ADDR_UNSET, | 492 | .tuner_addr = ADDR_UNSET, |
@@ -510,7 +500,6 @@ struct tvcard bttv_tvcards[] = { | |||
510 | .muxsel = MUXSEL(2, 3, 1, 1), | 500 | .muxsel = MUXSEL(2, 3, 1, 1), |
511 | .gpiomux = { 0x20001,0x10001, 0, 0 }, | 501 | .gpiomux = { 0x20001,0x10001, 0, 0 }, |
512 | .gpiomute = 10, | 502 | .gpiomute = 10, |
513 | .needs_tvaudio = 1, | ||
514 | .tuner_type = UNSET, | 503 | .tuner_type = UNSET, |
515 | .tuner_addr = ADDR_UNSET, | 504 | .tuner_addr = ADDR_UNSET, |
516 | }, | 505 | }, |
@@ -524,7 +513,6 @@ struct tvcard bttv_tvcards[] = { | |||
524 | .gpiomask = 15, | 513 | .gpiomask = 15, |
525 | .muxsel = MUXSEL(2, 3, 1, 1), | 514 | .muxsel = MUXSEL(2, 3, 1, 1), |
526 | .gpiomux = { 13, 14, 11, 7 }, | 515 | .gpiomux = { 13, 14, 11, 7 }, |
527 | .needs_tvaudio = 1, | ||
528 | .tuner_type = UNSET, | 516 | .tuner_type = UNSET, |
529 | .tuner_addr = ADDR_UNSET, | 517 | .tuner_addr = ADDR_UNSET, |
530 | }, | 518 | }, |
@@ -536,7 +524,6 @@ struct tvcard bttv_tvcards[] = { | |||
536 | .gpiomask = 15, | 524 | .gpiomask = 15, |
537 | .muxsel = MUXSEL(2, 3, 1, 1), | 525 | .muxsel = MUXSEL(2, 3, 1, 1), |
538 | .gpiomux = { 13, 14, 11, 7 }, | 526 | .gpiomux = { 13, 14, 11, 7 }, |
539 | .needs_tvaudio = 1, | ||
540 | .msp34xx_alt = 1, | 527 | .msp34xx_alt = 1, |
541 | .pll = PLL_28, | 528 | .pll = PLL_28, |
542 | .tuner_type = TUNER_PHILIPS_PAL, | 529 | .tuner_type = TUNER_PHILIPS_PAL, |
@@ -553,7 +540,6 @@ struct tvcard bttv_tvcards[] = { | |||
553 | .muxsel = MUXSEL(2, 3, 1, 1), | 540 | .muxsel = MUXSEL(2, 3, 1, 1), |
554 | .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */ | 541 | .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */ |
555 | .gpiomute = 4, | 542 | .gpiomute = 4, |
556 | .needs_tvaudio = 1, | ||
557 | .pll = PLL_28, | 543 | .pll = PLL_28, |
558 | .tuner_type = UNSET, | 544 | .tuner_type = UNSET, |
559 | .tuner_addr = ADDR_UNSET, | 545 | .tuner_addr = ADDR_UNSET, |
@@ -567,7 +553,6 @@ struct tvcard bttv_tvcards[] = { | |||
567 | .muxsel = MUXSEL(2, 3, 1, 1), | 553 | .muxsel = MUXSEL(2, 3, 1, 1), |
568 | .gpiomux = { 0, 0, 1, 0 }, | 554 | .gpiomux = { 0, 0, 1, 0 }, |
569 | .gpiomute = 10, | 555 | .gpiomute = 10, |
570 | .needs_tvaudio = 1, | ||
571 | .tuner_type = UNSET, | 556 | .tuner_type = UNSET, |
572 | .tuner_addr = ADDR_UNSET, | 557 | .tuner_addr = ADDR_UNSET, |
573 | }, | 558 | }, |
@@ -583,7 +568,6 @@ struct tvcard bttv_tvcards[] = { | |||
583 | /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */ | 568 | /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */ |
584 | .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, | 569 | .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, |
585 | .gpiomute = 0x002000, | 570 | .gpiomute = 0x002000, |
586 | .needs_tvaudio = 1, | ||
587 | .pll = PLL_28, | 571 | .pll = PLL_28, |
588 | .tuner_type = UNSET, | 572 | .tuner_type = UNSET, |
589 | .tuner_addr = ADDR_UNSET, | 573 | .tuner_addr = ADDR_UNSET, |
@@ -597,7 +581,6 @@ struct tvcard bttv_tvcards[] = { | |||
597 | .muxsel = MUXSEL(2, 3, 1, 1, 0), | 581 | .muxsel = MUXSEL(2, 3, 1, 1, 0), |
598 | .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 }, | 582 | .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 }, |
599 | .gpiomute = 0xcfa007, | 583 | .gpiomute = 0xcfa007, |
600 | .needs_tvaudio = 1, | ||
601 | .tuner_type = UNSET, | 584 | .tuner_type = UNSET, |
602 | .tuner_addr = ADDR_UNSET, | 585 | .tuner_addr = ADDR_UNSET, |
603 | .volume_gpio = winview_volume, | 586 | .volume_gpio = winview_volume, |
@@ -611,7 +594,6 @@ struct tvcard bttv_tvcards[] = { | |||
611 | .gpiomask = 0, | 594 | .gpiomask = 0, |
612 | .muxsel = MUXSEL(2, 3, 1, 1), | 595 | .muxsel = MUXSEL(2, 3, 1, 1), |
613 | .gpiomux = { 1, 0, 0, 0 }, | 596 | .gpiomux = { 1, 0, 0, 0 }, |
614 | .needs_tvaudio = 1, | ||
615 | .tuner_type = UNSET, | 597 | .tuner_type = UNSET, |
616 | .tuner_addr = ADDR_UNSET, | 598 | .tuner_addr = ADDR_UNSET, |
617 | }, | 599 | }, |
@@ -660,7 +642,6 @@ struct tvcard bttv_tvcards[] = { | |||
660 | .muxsel = MUXSEL(2, 3, 1, 1), | 642 | .muxsel = MUXSEL(2, 3, 1, 1), |
661 | .gpiomux = { 0, 1, 0x800, 0x400 }, | 643 | .gpiomux = { 0, 1, 0x800, 0x400 }, |
662 | .gpiomute = 0xc00, | 644 | .gpiomute = 0xc00, |
663 | .needs_tvaudio = 1, | ||
664 | .pll = PLL_28, | 645 | .pll = PLL_28, |
665 | .tuner_type = UNSET, | 646 | .tuner_type = UNSET, |
666 | .tuner_addr = ADDR_UNSET, | 647 | .tuner_addr = ADDR_UNSET, |
@@ -691,7 +672,6 @@ struct tvcard bttv_tvcards[] = { | |||
691 | .muxsel = MUXSEL(2, 3, 1, 1), | 672 | .muxsel = MUXSEL(2, 3, 1, 1), |
692 | .gpiomux = {0x400, 0x400, 0x400, 0x400 }, | 673 | .gpiomux = {0x400, 0x400, 0x400, 0x400 }, |
693 | .gpiomute = 0xc00, | 674 | .gpiomute = 0xc00, |
694 | .needs_tvaudio = 1, | ||
695 | .pll = PLL_28, | 675 | .pll = PLL_28, |
696 | .tuner_type = UNSET, | 676 | .tuner_type = UNSET, |
697 | .tuner_addr = ADDR_UNSET, | 677 | .tuner_addr = ADDR_UNSET, |
@@ -706,7 +686,6 @@ struct tvcard bttv_tvcards[] = { | |||
706 | .muxsel = MUXSEL(2, 3, 1, 1), | 686 | .muxsel = MUXSEL(2, 3, 1, 1), |
707 | .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, | 687 | .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, |
708 | .gpiomute = 0x40000, | 688 | .gpiomute = 0x40000, |
709 | .needs_tvaudio = 0, | ||
710 | .tuner_type = TUNER_PHILIPS_PAL, | 689 | .tuner_type = TUNER_PHILIPS_PAL, |
711 | .tuner_addr = ADDR_UNSET, | 690 | .tuner_addr = ADDR_UNSET, |
712 | .audio_mode_gpio= terratv_audio, | 691 | .audio_mode_gpio= terratv_audio, |
@@ -720,7 +699,6 @@ struct tvcard bttv_tvcards[] = { | |||
720 | .muxsel = MUXSEL(2, 0, 1, 1), | 699 | .muxsel = MUXSEL(2, 0, 1, 1), |
721 | .gpiomux = { 0, 1, 2, 3 }, | 700 | .gpiomux = { 0, 1, 2, 3 }, |
722 | .gpiomute = 4, | 701 | .gpiomute = 4, |
723 | .needs_tvaudio = 1, | ||
724 | .tuner_type = UNSET, | 702 | .tuner_type = UNSET, |
725 | .tuner_addr = ADDR_UNSET, | 703 | .tuner_addr = ADDR_UNSET, |
726 | }, | 704 | }, |
@@ -748,7 +726,6 @@ struct tvcard bttv_tvcards[] = { | |||
748 | .muxsel = MUXSEL(2, 3, 1, 1), | 726 | .muxsel = MUXSEL(2, 3, 1, 1), |
749 | .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 }, | 727 | .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 }, |
750 | .gpiomute = 0x40000, | 728 | .gpiomute = 0x40000, |
751 | .needs_tvaudio = 0, | ||
752 | .tuner_type = TUNER_PHILIPS_PAL, | 729 | .tuner_type = TUNER_PHILIPS_PAL, |
753 | .tuner_addr = ADDR_UNSET, | 730 | .tuner_addr = ADDR_UNSET, |
754 | .audio_mode_gpio= terratv_audio, | 731 | .audio_mode_gpio= terratv_audio, |
@@ -793,7 +770,6 @@ struct tvcard bttv_tvcards[] = { | |||
793 | .gpiomask = 0, | 770 | .gpiomask = 0, |
794 | .muxsel = MUXSEL(2, 3, 1, 0, 0), | 771 | .muxsel = MUXSEL(2, 3, 1, 0, 0), |
795 | .gpiomux = { 0 }, | 772 | .gpiomux = { 0 }, |
796 | .needs_tvaudio = 1, | ||
797 | .tuner_type = TUNER_ABSENT, | 773 | .tuner_type = TUNER_ABSENT, |
798 | .tuner_addr = ADDR_UNSET, | 774 | .tuner_addr = ADDR_UNSET, |
799 | .muxsel_hook = PXC200_muxsel, | 775 | .muxsel_hook = PXC200_muxsel, |
@@ -834,7 +810,6 @@ struct tvcard bttv_tvcards[] = { | |||
834 | .gpiomask = 0, | 810 | .gpiomask = 0, |
835 | .muxsel = MUXSEL(2, 3, 1, 1), | 811 | .muxsel = MUXSEL(2, 3, 1, 1), |
836 | .gpiomux = { 0 }, | 812 | .gpiomux = { 0 }, |
837 | .needs_tvaudio = 0, | ||
838 | .tuner_type = TUNER_ABSENT, | 813 | .tuner_type = TUNER_ABSENT, |
839 | .tuner_addr = ADDR_UNSET, | 814 | .tuner_addr = ADDR_UNSET, |
840 | }, | 815 | }, |
@@ -847,7 +822,6 @@ struct tvcard bttv_tvcards[] = { | |||
847 | .muxsel = MUXSEL(2, 3, 1, 1), | 822 | .muxsel = MUXSEL(2, 3, 1, 1), |
848 | .gpiomux = { 0x500, 0, 0x300, 0x900 }, | 823 | .gpiomux = { 0x500, 0, 0x300, 0x900 }, |
849 | .gpiomute = 0x900, | 824 | .gpiomute = 0x900, |
850 | .needs_tvaudio = 1, | ||
851 | .pll = PLL_28, | 825 | .pll = PLL_28, |
852 | .tuner_type = TUNER_PHILIPS_PAL, | 826 | .tuner_type = TUNER_PHILIPS_PAL, |
853 | .tuner_addr = ADDR_UNSET, | 827 | .tuner_addr = ADDR_UNSET, |
@@ -874,7 +848,6 @@ struct tvcard bttv_tvcards[] = { | |||
874 | Note: There exists another variant "Winfast 2000" with tv stereo !? | 848 | Note: There exists another variant "Winfast 2000" with tv stereo !? |
875 | Note: eeprom only contains FF and pci subsystem id 107d:6606 | 849 | Note: eeprom only contains FF and pci subsystem id 107d:6606 |
876 | */ | 850 | */ |
877 | .needs_tvaudio = 0, | ||
878 | .pll = PLL_28, | 851 | .pll = PLL_28, |
879 | .has_radio = 1, | 852 | .has_radio = 1, |
880 | .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */ | 853 | .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */ |
@@ -934,7 +907,6 @@ struct tvcard bttv_tvcards[] = { | |||
934 | .muxsel = MUXSEL(2, 3, 1, 0), | 907 | .muxsel = MUXSEL(2, 3, 1, 0), |
935 | .gpiomux = { 0x551400, 0x551200, 0, 0 }, | 908 | .gpiomux = { 0x551400, 0x551200, 0, 0 }, |
936 | .gpiomute = 0x551c00, | 909 | .gpiomute = 0x551c00, |
937 | .needs_tvaudio = 1, | ||
938 | .pll = PLL_28, | 910 | .pll = PLL_28, |
939 | .tuner_type = TUNER_PHILIPS_PAL_I, | 911 | .tuner_type = TUNER_PHILIPS_PAL_I, |
940 | .tuner_addr = ADDR_UNSET, | 912 | .tuner_addr = ADDR_UNSET, |
@@ -949,7 +921,6 @@ struct tvcard bttv_tvcards[] = { | |||
949 | .muxsel = MUXSEL(2, 3, 1, 1), | 921 | .muxsel = MUXSEL(2, 3, 1, 1), |
950 | .gpiomux = { 2, 0xd0001, 0, 0 }, | 922 | .gpiomux = { 2, 0xd0001, 0, 0 }, |
951 | .gpiomute = 1, | 923 | .gpiomute = 1, |
952 | .needs_tvaudio = 0, | ||
953 | .pll = PLL_28, | 924 | .pll = PLL_28, |
954 | .tuner_type = UNSET, | 925 | .tuner_type = UNSET, |
955 | .tuner_addr = ADDR_UNSET, | 926 | .tuner_addr = ADDR_UNSET, |
@@ -966,7 +937,6 @@ struct tvcard bttv_tvcards[] = { | |||
966 | .gpiomux = { 4, 0, 2, 3 }, | 937 | .gpiomux = { 4, 0, 2, 3 }, |
967 | .gpiomute = 1, | 938 | .gpiomute = 1, |
968 | .no_msp34xx = 1, | 939 | .no_msp34xx = 1, |
969 | .needs_tvaudio = 1, | ||
970 | .tuner_type = TUNER_PHILIPS_NTSC, | 940 | .tuner_type = TUNER_PHILIPS_NTSC, |
971 | .tuner_addr = ADDR_UNSET, | 941 | .tuner_addr = ADDR_UNSET, |
972 | .pll = PLL_28, | 942 | .pll = PLL_28, |
@@ -980,7 +950,6 @@ struct tvcard bttv_tvcards[] = { | |||
980 | .gpiomask = 15, | 950 | .gpiomask = 15, |
981 | .muxsel = MUXSEL(2, 3, 1, 1), | 951 | .muxsel = MUXSEL(2, 3, 1, 1), |
982 | .gpiomux = { 13, 4, 11, 7 }, | 952 | .gpiomux = { 13, 4, 11, 7 }, |
983 | .needs_tvaudio = 1, | ||
984 | .pll = PLL_28, | 953 | .pll = PLL_28, |
985 | .tuner_type = UNSET, | 954 | .tuner_type = UNSET, |
986 | .tuner_addr = ADDR_UNSET, | 955 | .tuner_addr = ADDR_UNSET, |
@@ -995,7 +964,6 @@ struct tvcard bttv_tvcards[] = { | |||
995 | .gpiomask = 0, | 964 | .gpiomask = 0, |
996 | .muxsel = MUXSEL(2, 3, 1, 1), | 965 | .muxsel = MUXSEL(2, 3, 1, 1), |
997 | .gpiomux = { 0, 0, 0, 0}, | 966 | .gpiomux = { 0, 0, 0, 0}, |
998 | .needs_tvaudio = 1, | ||
999 | .no_msp34xx = 1, | 967 | .no_msp34xx = 1, |
1000 | .pll = PLL_28, | 968 | .pll = PLL_28, |
1001 | .tuner_type = TUNER_PHILIPS_PAL_I, | 969 | .tuner_type = TUNER_PHILIPS_PAL_I, |
@@ -1066,7 +1034,6 @@ struct tvcard bttv_tvcards[] = { | |||
1066 | .muxsel = MUXSEL(2, 3, 1, 1), | 1034 | .muxsel = MUXSEL(2, 3, 1, 1), |
1067 | .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, | 1035 | .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, |
1068 | .gpiomute = 0x40000, | 1036 | .gpiomute = 0x40000, |
1069 | .needs_tvaudio = 1, | ||
1070 | .no_msp34xx = 1, | 1037 | .no_msp34xx = 1, |
1071 | .pll = PLL_35, | 1038 | .pll = PLL_35, |
1072 | .tuner_type = TUNER_PHILIPS_PAL_I, | 1039 | .tuner_type = TUNER_PHILIPS_PAL_I, |
@@ -1084,7 +1051,6 @@ struct tvcard bttv_tvcards[] = { | |||
1084 | .muxsel = MUXSEL(2, 3, 1, 1), | 1051 | .muxsel = MUXSEL(2, 3, 1, 1), |
1085 | .gpiomux = {2,0,0,0 }, | 1052 | .gpiomux = {2,0,0,0 }, |
1086 | .gpiomute = 1, | 1053 | .gpiomute = 1, |
1087 | .needs_tvaudio = 1, | ||
1088 | .pll = PLL_28, | 1054 | .pll = PLL_28, |
1089 | .tuner_type = UNSET, | 1055 | .tuner_type = UNSET, |
1090 | .tuner_addr = ADDR_UNSET, | 1056 | .tuner_addr = ADDR_UNSET, |
@@ -1163,7 +1129,6 @@ struct tvcard bttv_tvcards[] = { | |||
1163 | MUX2 (mask 0x30000): | 1129 | MUX2 (mask 0x30000): |
1164 | 0,2,3= from MSP34xx | 1130 | 0,2,3= from MSP34xx |
1165 | 1= FM stereo Radio from Tuner */ | 1131 | 1= FM stereo Radio from Tuner */ |
1166 | .needs_tvaudio = 0, | ||
1167 | .pll = PLL_28, | 1132 | .pll = PLL_28, |
1168 | .tuner_type = UNSET, | 1133 | .tuner_type = UNSET, |
1169 | .tuner_addr = ADDR_UNSET, | 1134 | .tuner_addr = ADDR_UNSET, |
@@ -1179,7 +1144,6 @@ struct tvcard bttv_tvcards[] = { | |||
1179 | .muxsel = MUXSEL(2, 3, 1, 1), | 1144 | .muxsel = MUXSEL(2, 3, 1, 1), |
1180 | .gpiomux = { 0, 0, 0x10, 8 }, | 1145 | .gpiomux = { 0, 0, 0x10, 8 }, |
1181 | .gpiomute = 4, | 1146 | .gpiomute = 4, |
1182 | .needs_tvaudio = 1, | ||
1183 | .pll = PLL_28, | 1147 | .pll = PLL_28, |
1184 | .tuner_type = TUNER_PHILIPS_PAL, | 1148 | .tuner_type = TUNER_PHILIPS_PAL, |
1185 | .tuner_addr = ADDR_UNSET, | 1149 | .tuner_addr = ADDR_UNSET, |
@@ -1218,7 +1182,6 @@ struct tvcard bttv_tvcards[] = { | |||
1218 | .muxsel = MUXSEL(2, 3, 1, 0), | 1182 | .muxsel = MUXSEL(2, 3, 1, 0), |
1219 | .gpiomux = { 2, 0, 0, 0 }, | 1183 | .gpiomux = { 2, 0, 0, 0 }, |
1220 | .gpiomute = 10, | 1184 | .gpiomute = 10, |
1221 | .needs_tvaudio = 0, | ||
1222 | .pll = PLL_28, | 1185 | .pll = PLL_28, |
1223 | .tuner_type = TUNER_TEMIC_PAL, | 1186 | .tuner_type = TUNER_TEMIC_PAL, |
1224 | .tuner_addr = ADDR_UNSET, | 1187 | .tuner_addr = ADDR_UNSET, |
@@ -1250,7 +1213,6 @@ struct tvcard bttv_tvcards[] = { | |||
1250 | .gpiomask = 0, | 1213 | .gpiomask = 0, |
1251 | .muxsel = MUXSEL(3, 1), | 1214 | .muxsel = MUXSEL(3, 1), |
1252 | .gpiomux = { 0 }, | 1215 | .gpiomux = { 0 }, |
1253 | .needs_tvaudio = 0, | ||
1254 | .no_msp34xx = 1, | 1216 | .no_msp34xx = 1, |
1255 | .pll = PLL_35, | 1217 | .pll = PLL_35, |
1256 | .tuner_type = TUNER_ABSENT, | 1218 | .tuner_type = TUNER_ABSENT, |
@@ -1266,7 +1228,6 @@ struct tvcard bttv_tvcards[] = { | |||
1266 | .muxsel = MUXSEL(2, 3, 1, 1), | 1228 | .muxsel = MUXSEL(2, 3, 1, 1), |
1267 | .gpiomux = { 0x400, 0x400, 0x400, 0x400 }, | 1229 | .gpiomux = { 0x400, 0x400, 0x400, 0x400 }, |
1268 | .gpiomute = 0x800, | 1230 | .gpiomute = 0x800, |
1269 | .needs_tvaudio = 1, | ||
1270 | .pll = PLL_28, | 1231 | .pll = PLL_28, |
1271 | .tuner_type = TUNER_TEMIC_4036FY5_NTSC, | 1232 | .tuner_type = TUNER_TEMIC_4036FY5_NTSC, |
1272 | .tuner_addr = ADDR_UNSET, | 1233 | .tuner_addr = ADDR_UNSET, |
@@ -1312,7 +1273,6 @@ struct tvcard bttv_tvcards[] = { | |||
1312 | .muxsel = MUXSEL(2, 2), | 1273 | .muxsel = MUXSEL(2, 2), |
1313 | .gpiomux = { }, | 1274 | .gpiomux = { }, |
1314 | .no_msp34xx = 1, | 1275 | .no_msp34xx = 1, |
1315 | .needs_tvaudio = 0, | ||
1316 | .pll = PLL_28, | 1276 | .pll = PLL_28, |
1317 | .tuner_type = TUNER_ABSENT, | 1277 | .tuner_type = TUNER_ABSENT, |
1318 | .tuner_addr = ADDR_UNSET, | 1278 | .tuner_addr = ADDR_UNSET, |
@@ -1329,7 +1289,6 @@ struct tvcard bttv_tvcards[] = { | |||
1329 | .muxsel = MUXSEL(2, 3, 1, 0), | 1289 | .muxsel = MUXSEL(2, 3, 1, 0), |
1330 | .gpiomux = { 1, 0, 4, 4 }, | 1290 | .gpiomux = { 1, 0, 4, 4 }, |
1331 | .gpiomute = 9, | 1291 | .gpiomute = 9, |
1332 | .needs_tvaudio = 0, | ||
1333 | .pll = PLL_28, | 1292 | .pll = PLL_28, |
1334 | .tuner_type = TUNER_PHILIPS_PAL, | 1293 | .tuner_type = TUNER_PHILIPS_PAL, |
1335 | .tuner_addr = ADDR_UNSET, | 1294 | .tuner_addr = ADDR_UNSET, |
@@ -1379,7 +1338,6 @@ struct tvcard bttv_tvcards[] = { | |||
1379 | .gpiomute = 0x1800, | 1338 | .gpiomute = 0x1800, |
1380 | .audio_mode_gpio= fv2000s_audio, | 1339 | .audio_mode_gpio= fv2000s_audio, |
1381 | .no_msp34xx = 1, | 1340 | .no_msp34xx = 1, |
1382 | .needs_tvaudio = 1, | ||
1383 | .pll = PLL_28, | 1341 | .pll = PLL_28, |
1384 | .tuner_type = TUNER_PHILIPS_PAL, | 1342 | .tuner_type = TUNER_PHILIPS_PAL, |
1385 | .tuner_addr = ADDR_UNSET, | 1343 | .tuner_addr = ADDR_UNSET, |
@@ -1393,7 +1351,6 @@ struct tvcard bttv_tvcards[] = { | |||
1393 | .muxsel = MUXSEL(2, 3, 1, 1), | 1351 | .muxsel = MUXSEL(2, 3, 1, 1), |
1394 | .gpiomux = { 0x500, 0x500, 0x300, 0x900 }, | 1352 | .gpiomux = { 0x500, 0x500, 0x300, 0x900 }, |
1395 | .gpiomute = 0x900, | 1353 | .gpiomute = 0x900, |
1396 | .needs_tvaudio = 1, | ||
1397 | .pll = PLL_28, | 1354 | .pll = PLL_28, |
1398 | .tuner_type = TUNER_PHILIPS_PAL, | 1355 | .tuner_type = TUNER_PHILIPS_PAL, |
1399 | .tuner_addr = ADDR_UNSET, | 1356 | .tuner_addr = ADDR_UNSET, |
@@ -1477,7 +1434,6 @@ struct tvcard bttv_tvcards[] = { | |||
1477 | .muxsel = MUXSEL(2, 3, 1, 1), | 1434 | .muxsel = MUXSEL(2, 3, 1, 1), |
1478 | .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */ | 1435 | .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */ |
1479 | .gpiomute = 13, | 1436 | .gpiomute = 13, |
1480 | .needs_tvaudio = 1, | ||
1481 | .pll = PLL_28, | 1437 | .pll = PLL_28, |
1482 | .tuner_type = TUNER_LG_PAL_I_FM, | 1438 | .tuner_type = TUNER_LG_PAL_I_FM, |
1483 | .tuner_addr = ADDR_UNSET, | 1439 | .tuner_addr = ADDR_UNSET, |
@@ -1514,7 +1470,6 @@ struct tvcard bttv_tvcards[] = { | |||
1514 | .muxsel = MUXSEL(2, 3, 1, 1), | 1470 | .muxsel = MUXSEL(2, 3, 1, 1), |
1515 | .gpiomux = { 0x01, 0x00, 0x03, 0x03 }, | 1471 | .gpiomux = { 0x01, 0x00, 0x03, 0x03 }, |
1516 | .gpiomute = 0x09, | 1472 | .gpiomute = 0x09, |
1517 | .needs_tvaudio = 1, | ||
1518 | .no_msp34xx = 1, | 1473 | .no_msp34xx = 1, |
1519 | .pll = PLL_28, | 1474 | .pll = PLL_28, |
1520 | .tuner_type = TUNER_PHILIPS_PAL, | 1475 | .tuner_type = TUNER_PHILIPS_PAL, |
@@ -1540,7 +1495,6 @@ struct tvcard bttv_tvcards[] = { | |||
1540 | .gpiomask = 0, | 1495 | .gpiomask = 0, |
1541 | .muxsel = MUXSEL(2, 3, 1, 0, 0), | 1496 | .muxsel = MUXSEL(2, 3, 1, 0, 0), |
1542 | .gpiomux = { 0 }, | 1497 | .gpiomux = { 0 }, |
1543 | .needs_tvaudio = 0, | ||
1544 | .tuner_type = TUNER_ABSENT, | 1498 | .tuner_type = TUNER_ABSENT, |
1545 | .tuner_addr = ADDR_UNSET, | 1499 | .tuner_addr = ADDR_UNSET, |
1546 | }, | 1500 | }, |
@@ -1567,7 +1521,6 @@ struct tvcard bttv_tvcards[] = { | |||
1567 | .muxsel = MUXSEL(2, 1, 1), | 1521 | .muxsel = MUXSEL(2, 1, 1), |
1568 | .gpiomux = { 0, 1, 2, 2 }, | 1522 | .gpiomux = { 0, 1, 2, 2 }, |
1569 | .gpiomute = 4, | 1523 | .gpiomute = 4, |
1570 | .needs_tvaudio = 0, | ||
1571 | .tuner_type = TUNER_PHILIPS_PAL, | 1524 | .tuner_type = TUNER_PHILIPS_PAL, |
1572 | .tuner_addr = ADDR_UNSET, | 1525 | .tuner_addr = ADDR_UNSET, |
1573 | .pll = PLL_28, | 1526 | .pll = PLL_28, |
@@ -1597,7 +1550,6 @@ struct tvcard bttv_tvcards[] = { | |||
1597 | .gpiomask = 0, | 1550 | .gpiomask = 0, |
1598 | .muxsel = MUXSEL(2, 3, 1, 0), | 1551 | .muxsel = MUXSEL(2, 3, 1, 0), |
1599 | .gpiomux = { 0 }, | 1552 | .gpiomux = { 0 }, |
1600 | .needs_tvaudio = 0, | ||
1601 | .no_msp34xx = 1, | 1553 | .no_msp34xx = 1, |
1602 | .pll = PLL_28, | 1554 | .pll = PLL_28, |
1603 | .tuner_type = TUNER_ABSENT, | 1555 | .tuner_type = TUNER_ABSENT, |
@@ -1619,7 +1571,6 @@ struct tvcard bttv_tvcards[] = { | |||
1619 | * btwincap uses 0x80000/0x80003 | 1571 | * btwincap uses 0x80000/0x80003 |
1620 | */ | 1572 | */ |
1621 | .gpiomute = 4, | 1573 | .gpiomute = 4, |
1622 | .needs_tvaudio = 0, | ||
1623 | .no_msp34xx = 1, | 1574 | .no_msp34xx = 1, |
1624 | .pll = PLL_28, | 1575 | .pll = PLL_28, |
1625 | .tuner_type = TUNER_PHILIPS_PAL, | 1576 | .tuner_type = TUNER_PHILIPS_PAL, |
@@ -1655,7 +1606,6 @@ struct tvcard bttv_tvcards[] = { | |||
1655 | /* .audio_inputs= 1, */ | 1606 | /* .audio_inputs= 1, */ |
1656 | .svhs = 2, | 1607 | .svhs = 2, |
1657 | .muxsel = MUXSEL(2, 0, 1, 1), | 1608 | .muxsel = MUXSEL(2, 0, 1, 1), |
1658 | .needs_tvaudio = 1, | ||
1659 | .pll = PLL_28, | 1609 | .pll = PLL_28, |
1660 | .tuner_type = UNSET, | 1610 | .tuner_type = UNSET, |
1661 | .tuner_addr = ADDR_UNSET, | 1611 | .tuner_addr = ADDR_UNSET, |
@@ -1875,7 +1825,6 @@ struct tvcard bttv_tvcards[] = { | |||
1875 | .muxsel = MUXSEL(2, 3, 1, 1), | 1825 | .muxsel = MUXSEL(2, 3, 1, 1), |
1876 | .gpiomux = { 0, 1, 2, 3}, | 1826 | .gpiomux = { 0, 1, 2, 3}, |
1877 | .gpiomute = 4, | 1827 | .gpiomute = 4, |
1878 | .needs_tvaudio = 1, | ||
1879 | .tuner_type = TUNER_PHILIPS_PAL, | 1828 | .tuner_type = TUNER_PHILIPS_PAL, |
1880 | .tuner_addr = ADDR_UNSET, | 1829 | .tuner_addr = ADDR_UNSET, |
1881 | .pll = PLL_28, | 1830 | .pll = PLL_28, |
@@ -1902,7 +1851,6 @@ struct tvcard bttv_tvcards[] = { | |||
1902 | .gpiomask = 0, | 1851 | .gpiomask = 0, |
1903 | .muxsel = MUXSEL(2, 3), | 1852 | .muxsel = MUXSEL(2, 3), |
1904 | .gpiomux = { 0 }, | 1853 | .gpiomux = { 0 }, |
1905 | .needs_tvaudio = 0, | ||
1906 | .no_msp34xx = 1, | 1854 | .no_msp34xx = 1, |
1907 | .pll = PLL_28, | 1855 | .pll = PLL_28, |
1908 | .tuner_type = TUNER_ABSENT, | 1856 | .tuner_type = TUNER_ABSENT, |
@@ -1920,7 +1868,6 @@ struct tvcard bttv_tvcards[] = { | |||
1920 | /* Tuner, Radio, external, internal, off, on */ | 1868 | /* Tuner, Radio, external, internal, off, on */ |
1921 | .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 }, | 1869 | .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 }, |
1922 | .gpiomute = 0x0f, | 1870 | .gpiomute = 0x0f, |
1923 | .needs_tvaudio = 0, | ||
1924 | .no_msp34xx = 1, | 1871 | .no_msp34xx = 1, |
1925 | .pll = PLL_28, | 1872 | .pll = PLL_28, |
1926 | .tuner_type = TUNER_PHILIPS_NTSC, | 1873 | .tuner_type = TUNER_PHILIPS_NTSC, |
@@ -1936,7 +1883,6 @@ struct tvcard bttv_tvcards[] = { | |||
1936 | .svhs = 2, | 1883 | .svhs = 2, |
1937 | .gpiomask = 0x00, | 1884 | .gpiomask = 0x00, |
1938 | .muxsel = MUXSEL(2, 3, 1, 1), | 1885 | .muxsel = MUXSEL(2, 3, 1, 1), |
1939 | .needs_tvaudio = 1, | ||
1940 | .no_msp34xx = 1, | 1886 | .no_msp34xx = 1, |
1941 | .pll = PLL_28, | 1887 | .pll = PLL_28, |
1942 | .tuner_type = TUNER_PHILIPS_PAL, | 1888 | .tuner_type = TUNER_PHILIPS_PAL, |
@@ -2034,7 +1980,6 @@ struct tvcard bttv_tvcards[] = { | |||
2034 | .gpiomask = 0, | 1980 | .gpiomask = 0, |
2035 | .muxsel = MUXSEL(2, 3, 1, 0), | 1981 | .muxsel = MUXSEL(2, 3, 1, 0), |
2036 | .gpiomux = { 0 }, | 1982 | .gpiomux = { 0 }, |
2037 | .needs_tvaudio = 0, | ||
2038 | .no_msp34xx = 1, | 1983 | .no_msp34xx = 1, |
2039 | .pll = PLL_28, | 1984 | .pll = PLL_28, |
2040 | .tuner_type = TUNER_ABSENT, | 1985 | .tuner_type = TUNER_ABSENT, |
@@ -2049,7 +1994,6 @@ struct tvcard bttv_tvcards[] = { | |||
2049 | .gpiomask = 0x00, | 1994 | .gpiomask = 0x00, |
2050 | .muxsel = MUXSEL(2, 3, 1, 0), | 1995 | .muxsel = MUXSEL(2, 3, 1, 0), |
2051 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 1996 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2052 | .needs_tvaudio = 0, | ||
2053 | .pll = PLL_28, | 1997 | .pll = PLL_28, |
2054 | .tuner_type = TUNER_ABSENT, | 1998 | .tuner_type = TUNER_ABSENT, |
2055 | .tuner_addr = ADDR_UNSET, | 1999 | .tuner_addr = ADDR_UNSET, |
@@ -2062,7 +2006,6 @@ struct tvcard bttv_tvcards[] = { | |||
2062 | .gpiomask = 0x00, | 2006 | .gpiomask = 0x00, |
2063 | .muxsel = MUXSEL(2, 3, 1, 1), | 2007 | .muxsel = MUXSEL(2, 3, 1, 1), |
2064 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 2008 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2065 | .needs_tvaudio = 0, | ||
2066 | .pll = PLL_28, | 2009 | .pll = PLL_28, |
2067 | .tuner_type = TUNER_ABSENT, | 2010 | .tuner_type = TUNER_ABSENT, |
2068 | .tuner_addr = ADDR_UNSET, | 2011 | .tuner_addr = ADDR_UNSET, |
@@ -2079,7 +2022,6 @@ struct tvcard bttv_tvcards[] = { | |||
2079 | .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0), | 2022 | .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0), |
2080 | .muxsel_hook = phytec_muxsel, | 2023 | .muxsel_hook = phytec_muxsel, |
2081 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 2024 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2082 | .needs_tvaudio = 1, | ||
2083 | .pll = PLL_28, | 2025 | .pll = PLL_28, |
2084 | .tuner_type = TUNER_ABSENT, | 2026 | .tuner_type = TUNER_ABSENT, |
2085 | .tuner_addr = ADDR_UNSET, | 2027 | .tuner_addr = ADDR_UNSET, |
@@ -2094,7 +2036,6 @@ struct tvcard bttv_tvcards[] = { | |||
2094 | .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1), | 2036 | .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1), |
2095 | .muxsel_hook = phytec_muxsel, | 2037 | .muxsel_hook = phytec_muxsel, |
2096 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 2038 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2097 | .needs_tvaudio = 1, | ||
2098 | .pll = PLL_28, | 2039 | .pll = PLL_28, |
2099 | .tuner_type = TUNER_ABSENT, | 2040 | .tuner_type = TUNER_ABSENT, |
2100 | .tuner_addr = ADDR_UNSET, | 2041 | .tuner_addr = ADDR_UNSET, |
@@ -2118,7 +2059,6 @@ struct tvcard bttv_tvcards[] = { | |||
2118 | .tuner_type = TUNER_ABSENT, | 2059 | .tuner_type = TUNER_ABSENT, |
2119 | .tuner_addr = ADDR_UNSET, | 2060 | .tuner_addr = ADDR_UNSET, |
2120 | .svhs = NO_SVHS, /* card has no svhs */ | 2061 | .svhs = NO_SVHS, /* card has no svhs */ |
2121 | .needs_tvaudio = 0, | ||
2122 | .no_msp34xx = 1, | 2062 | .no_msp34xx = 1, |
2123 | .no_tda7432 = 1, | 2063 | .no_tda7432 = 1, |
2124 | .gpiomask = 0x00, | 2064 | .gpiomask = 0x00, |
@@ -2168,7 +2108,6 @@ struct tvcard bttv_tvcards[] = { | |||
2168 | .gpiomask = 3, | 2108 | .gpiomask = 3, |
2169 | .muxsel = MUXSEL(2, 3, 1, 1), | 2109 | .muxsel = MUXSEL(2, 3, 1, 1), |
2170 | .gpiomux = { 1, 1, 1, 1 }, | 2110 | .gpiomux = { 1, 1, 1, 1 }, |
2171 | .needs_tvaudio = 1, | ||
2172 | .tuner_type = TUNER_PHILIPS_PAL, | 2111 | .tuner_type = TUNER_PHILIPS_PAL, |
2173 | .tuner_addr = ADDR_UNSET, | 2112 | .tuner_addr = ADDR_UNSET, |
2174 | .pll = PLL_35, | 2113 | .pll = PLL_35, |
@@ -2210,7 +2149,6 @@ struct tvcard bttv_tvcards[] = { | |||
2210 | .muxsel = MUXSEL(2, 3, 1, 0), | 2149 | .muxsel = MUXSEL(2, 3, 1, 0), |
2211 | .no_msp34xx = 1, | 2150 | .no_msp34xx = 1, |
2212 | .no_tda7432 = 1, | 2151 | .no_tda7432 = 1, |
2213 | .needs_tvaudio = 0, | ||
2214 | .tuner_type = TUNER_ABSENT, | 2152 | .tuner_type = TUNER_ABSENT, |
2215 | .tuner_addr = ADDR_UNSET, | 2153 | .tuner_addr = ADDR_UNSET, |
2216 | }, | 2154 | }, |
@@ -2222,7 +2160,6 @@ struct tvcard bttv_tvcards[] = { | |||
2222 | .tuner_type = TUNER_PHILIPS_PAL, | 2160 | .tuner_type = TUNER_PHILIPS_PAL, |
2223 | .tuner_addr = ADDR_UNSET, | 2161 | .tuner_addr = ADDR_UNSET, |
2224 | .svhs = 2, | 2162 | .svhs = 2, |
2225 | .needs_tvaudio = 0, | ||
2226 | .gpiomask = 0x68, | 2163 | .gpiomask = 0x68, |
2227 | .muxsel = MUXSEL(2, 3, 1), | 2164 | .muxsel = MUXSEL(2, 3, 1), |
2228 | .gpiomux = { 0x68, 0x68, 0x61, 0x61 }, | 2165 | .gpiomux = { 0x68, 0x68, 0x61, 0x61 }, |
@@ -2241,7 +2178,6 @@ struct tvcard bttv_tvcards[] = { | |||
2241 | .muxsel = MUXSEL(2, 3, 1, 1), | 2178 | .muxsel = MUXSEL(2, 3, 1, 1), |
2242 | .gpiomux = { 0, 1, 2, 2 }, | 2179 | .gpiomux = { 0, 1, 2, 2 }, |
2243 | .gpiomute = 3, | 2180 | .gpiomute = 3, |
2244 | .needs_tvaudio = 0, | ||
2245 | .pll = PLL_28, | 2181 | .pll = PLL_28, |
2246 | .tuner_type = TUNER_PHILIPS_PAL, | 2182 | .tuner_type = TUNER_PHILIPS_PAL, |
2247 | .tuner_addr = ADDR_UNSET, | 2183 | .tuner_addr = ADDR_UNSET, |
@@ -2265,7 +2201,6 @@ struct tvcard bttv_tvcards[] = { | |||
2265 | .muxsel = MUXSEL(2, 2, 2, 2), | 2201 | .muxsel = MUXSEL(2, 2, 2, 2), |
2266 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 2202 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2267 | .pll = PLL_28, | 2203 | .pll = PLL_28, |
2268 | .needs_tvaudio = 0, | ||
2269 | .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/ | 2204 | .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/ |
2270 | .tuner_type = TUNER_ABSENT, | 2205 | .tuner_type = TUNER_ABSENT, |
2271 | .tuner_addr = ADDR_UNSET, | 2206 | .tuner_addr = ADDR_UNSET, |
@@ -2358,7 +2293,6 @@ struct tvcard bttv_tvcards[] = { | |||
2358 | .muxsel = MUXSEL(2, 3, 1, 1), | 2293 | .muxsel = MUXSEL(2, 3, 1, 1), |
2359 | .gpiomux = { 2, 0, 0, 0 }, | 2294 | .gpiomux = { 2, 0, 0, 0 }, |
2360 | .gpiomute = 10, | 2295 | .gpiomute = 10, |
2361 | .needs_tvaudio = 0, | ||
2362 | .pll = PLL_28, | 2296 | .pll = PLL_28, |
2363 | .tuner_type = TUNER_PHILIPS_PAL, | 2297 | .tuner_type = TUNER_PHILIPS_PAL, |
2364 | .tuner_addr = ADDR_UNSET, | 2298 | .tuner_addr = ADDR_UNSET, |
@@ -2405,7 +2339,6 @@ struct tvcard bttv_tvcards[] = { | |||
2405 | .tuner_addr = ADDR_UNSET, | 2339 | .tuner_addr = ADDR_UNSET, |
2406 | .gpiomask = 0x008007, | 2340 | .gpiomask = 0x008007, |
2407 | .gpiomux = { 0, 0x000001,0,0 }, | 2341 | .gpiomux = { 0, 0x000001,0,0 }, |
2408 | .needs_tvaudio = 1, | ||
2409 | .has_radio = 1, | 2342 | .has_radio = 1, |
2410 | }, | 2343 | }, |
2411 | [BTTV_BOARD_TIBET_CS16] = { | 2344 | [BTTV_BOARD_TIBET_CS16] = { |
@@ -2518,7 +2451,6 @@ struct tvcard bttv_tvcards[] = { | |||
2518 | .muxsel = MUXSEL(2, 3, 1, 1), | 2451 | .muxsel = MUXSEL(2, 3, 1, 1), |
2519 | .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, | 2452 | .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, |
2520 | .gpiomute = 0x002000, | 2453 | .gpiomute = 0x002000, |
2521 | .needs_tvaudio = 1, | ||
2522 | .pll = PLL_28, | 2454 | .pll = PLL_28, |
2523 | .tuner_type = TUNER_YMEC_TVF66T5_B_DFF, | 2455 | .tuner_type = TUNER_YMEC_TVF66T5_B_DFF, |
2524 | .tuner_addr = 0xc1 >>1, | 2456 | .tuner_addr = 0xc1 >>1, |
@@ -2534,7 +2466,6 @@ struct tvcard bttv_tvcards[] = { | |||
2534 | .muxsel = MUXSEL(2, 3, 1, 1), | 2466 | .muxsel = MUXSEL(2, 3, 1, 1), |
2535 | .gpiomux = { 0, 1, 2, 2 }, | 2467 | .gpiomux = { 0, 1, 2, 2 }, |
2536 | .gpiomute = 3, | 2468 | .gpiomute = 3, |
2537 | .needs_tvaudio = 0, | ||
2538 | .pll = PLL_28, | 2469 | .pll = PLL_28, |
2539 | .tuner_type = TUNER_TENA_9533_DI, | 2470 | .tuner_type = TUNER_TENA_9533_DI, |
2540 | .tuner_addr = ADDR_UNSET, | 2471 | .tuner_addr = ADDR_UNSET, |
@@ -2615,7 +2546,6 @@ struct tvcard bttv_tvcards[] = { | |||
2615 | .muxsel = MUXSEL(2, 3, 1, 1), | 2546 | .muxsel = MUXSEL(2, 3, 1, 1), |
2616 | .gpiomux = { 2, 0, 0, 0 }, | 2547 | .gpiomux = { 2, 0, 0, 0 }, |
2617 | .gpiomute = 1, | 2548 | .gpiomute = 1, |
2618 | .needs_tvaudio = 1, | ||
2619 | .pll = PLL_28, | 2549 | .pll = PLL_28, |
2620 | .tuner_type = TUNER_PHILIPS_NTSC, | 2550 | .tuner_type = TUNER_PHILIPS_NTSC, |
2621 | .tuner_addr = ADDR_UNSET, | 2551 | .tuner_addr = ADDR_UNSET, |
@@ -2714,7 +2644,6 @@ struct tvcard bttv_tvcards[] = { | |||
2714 | .muxsel = MUXSEL(2, 3, 1, 1), | 2644 | .muxsel = MUXSEL(2, 3, 1, 1), |
2715 | .gpiomux = { 0x20001,0x10001, 0, 0 }, | 2645 | .gpiomux = { 0x20001,0x10001, 0, 0 }, |
2716 | .gpiomute = 10, | 2646 | .gpiomute = 10, |
2717 | .needs_tvaudio = 1, | ||
2718 | .pll = PLL_28, | 2647 | .pll = PLL_28, |
2719 | .tuner_type = TUNER_PHILIPS_PAL_I, | 2648 | .tuner_type = TUNER_PHILIPS_PAL_I, |
2720 | .tuner_addr = ADDR_UNSET, | 2649 | .tuner_addr = ADDR_UNSET, |
@@ -2746,7 +2675,6 @@ struct tvcard bttv_tvcards[] = { | |||
2746 | .muxsel = MUXSEL(2, 3, 1, 1), | 2675 | .muxsel = MUXSEL(2, 3, 1, 1), |
2747 | .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */ | 2676 | .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */ |
2748 | .gpiomute = 3, /* CONTVFMi */ | 2677 | .gpiomute = 3, /* CONTVFMi */ |
2749 | .needs_tvaudio = 0, | ||
2750 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */ | 2678 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */ |
2751 | .tuner_addr = ADDR_UNSET, | 2679 | .tuner_addr = ADDR_UNSET, |
2752 | .pll = PLL_28, | 2680 | .pll = PLL_28, |
@@ -2785,7 +2713,6 @@ struct tvcard bttv_tvcards[] = { | |||
2785 | .gpiomask = 0x00, | 2713 | .gpiomask = 0x00, |
2786 | .muxsel = MUXSEL(0, 2, 3, 1), | 2714 | .muxsel = MUXSEL(0, 2, 3, 1), |
2787 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 2715 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2788 | .needs_tvaudio = 0, | ||
2789 | .pll = PLL_28, | 2716 | .pll = PLL_28, |
2790 | .tuner_type = TUNER_ABSENT, | 2717 | .tuner_type = TUNER_ABSENT, |
2791 | .tuner_addr = ADDR_UNSET, | 2718 | .tuner_addr = ADDR_UNSET, |
@@ -2799,7 +2726,6 @@ struct tvcard bttv_tvcards[] = { | |||
2799 | .gpiomask = 0x00, | 2726 | .gpiomask = 0x00, |
2800 | .muxsel = MUXSEL(2, 3, 1), | 2727 | .muxsel = MUXSEL(2, 3, 1), |
2801 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 2728 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2802 | .needs_tvaudio = 0, | ||
2803 | .pll = PLL_28, | 2729 | .pll = PLL_28, |
2804 | .tuner_type = TUNER_ABSENT, | 2730 | .tuner_type = TUNER_ABSENT, |
2805 | .tuner_addr = ADDR_UNSET, | 2731 | .tuner_addr = ADDR_UNSET, |
@@ -2813,7 +2739,6 @@ struct tvcard bttv_tvcards[] = { | |||
2813 | .gpiomask = 0x00, | 2739 | .gpiomask = 0x00, |
2814 | .muxsel = MUXSEL(3, 2, 1), | 2740 | .muxsel = MUXSEL(3, 2, 1), |
2815 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ | 2741 | .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ |
2816 | .needs_tvaudio = 0, | ||
2817 | .pll = PLL_28, | 2742 | .pll = PLL_28, |
2818 | .tuner_type = TUNER_ABSENT, | 2743 | .tuner_type = TUNER_ABSENT, |
2819 | .tuner_addr = ADDR_UNSET, | 2744 | .tuner_addr = ADDR_UNSET, |
@@ -2877,7 +2802,6 @@ struct tvcard bttv_tvcards[] = { | |||
2877 | .gpiomask = 0, | 2802 | .gpiomask = 0, |
2878 | .muxsel = MUXSEL(2, 3), | 2803 | .muxsel = MUXSEL(2, 3), |
2879 | .gpiomux = { 0 }, | 2804 | .gpiomux = { 0 }, |
2880 | .needs_tvaudio = 0, | ||
2881 | .no_msp34xx = 1, | 2805 | .no_msp34xx = 1, |
2882 | .pll = PLL_28, | 2806 | .pll = PLL_28, |
2883 | .tuner_type = TUNER_ABSENT, | 2807 | .tuner_type = TUNER_ABSENT, |
@@ -3649,7 +3573,7 @@ void __devinit bttv_init_tuner(struct bttv *btv) | |||
3649 | struct tuner_setup tun_setup; | 3573 | struct tuner_setup tun_setup; |
3650 | 3574 | ||
3651 | /* Load tuner module before issuing tuner config call! */ | 3575 | /* Load tuner module before issuing tuner config call! */ |
3652 | if (bttv_tvcards[btv->c.type].has_radio) | 3576 | if (btv->has_radio) |
3653 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3577 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
3654 | &btv->c.i2c_adap, "tuner", | 3578 | &btv->c.i2c_adap, "tuner", |
3655 | 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO)); | 3579 | 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO)); |
@@ -3664,7 +3588,7 @@ void __devinit bttv_init_tuner(struct bttv *btv) | |||
3664 | tun_setup.type = btv->tuner_type; | 3588 | tun_setup.type = btv->tuner_type; |
3665 | tun_setup.addr = addr; | 3589 | tun_setup.addr = addr; |
3666 | 3590 | ||
3667 | if (bttv_tvcards[btv->c.type].has_radio) | 3591 | if (btv->has_radio) |
3668 | tun_setup.mode_mask |= T_RADIO; | 3592 | tun_setup.mode_mask |= T_RADIO; |
3669 | 3593 | ||
3670 | bttv_call_all(btv, tuner, s_type_addr, &tun_setup); | 3594 | bttv_call_all(btv, tuner, s_type_addr, &tun_setup); |
@@ -3724,6 +3648,10 @@ static void __devinit hauppauge_eeprom(struct bttv *btv) | |||
3724 | bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name); | 3648 | bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name); |
3725 | btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB; | 3649 | btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB; |
3726 | } | 3650 | } |
3651 | |||
3652 | /* The 61334 needs the msp3410 to do the radio demod to get sound */ | ||
3653 | if (tv.model == 61334) | ||
3654 | btv->radio_uses_msp_demodulator = 1; | ||
3727 | } | 3655 | } |
3728 | 3656 | ||
3729 | static int terratec_active_radio_upgrade(struct bttv *btv) | 3657 | static int terratec_active_radio_upgrade(struct bttv *btv) |
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index a9cfb0f4be48..ff7a589d8e0f 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -1218,6 +1218,11 @@ audio_mux(struct bttv *btv, int input, int mute) | |||
1218 | For now this is sufficient. */ | 1218 | For now this is sufficient. */ |
1219 | switch (input) { | 1219 | switch (input) { |
1220 | case TVAUDIO_INPUT_RADIO: | 1220 | case TVAUDIO_INPUT_RADIO: |
1221 | /* Some boards need the msp do to the radio demod */ | ||
1222 | if (btv->radio_uses_msp_demodulator) { | ||
1223 | in = MSP_INPUT_DEFAULT; | ||
1224 | break; | ||
1225 | } | ||
1221 | in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, | 1226 | in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, |
1222 | MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); | 1227 | MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); |
1223 | break; | 1228 | break; |
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h index c5171619ac79..acfe2f3b92d9 100644 --- a/drivers/media/video/bt8xx/bttv.h +++ b/drivers/media/video/bt8xx/bttv.h | |||
@@ -236,7 +236,6 @@ struct tvcard { | |||
236 | /* i2c audio flags */ | 236 | /* i2c audio flags */ |
237 | unsigned int no_msp34xx:1; | 237 | unsigned int no_msp34xx:1; |
238 | unsigned int no_tda7432:1; | 238 | unsigned int no_tda7432:1; |
239 | unsigned int needs_tvaudio:1; | ||
240 | unsigned int msp34xx_alt:1; | 239 | unsigned int msp34xx_alt:1; |
241 | /* Note: currently no card definition needs to mark the presence | 240 | /* Note: currently no card definition needs to mark the presence |
242 | of a RDS saa6588 chip. If this is ever needed, then add a new | 241 | of a RDS saa6588 chip. If this is ever needed, then add a new |
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index db943a8d580d..70fd4f23f605 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h | |||
@@ -440,6 +440,7 @@ struct bttv { | |||
440 | /* radio data/state */ | 440 | /* radio data/state */ |
441 | int has_radio; | 441 | int has_radio; |
442 | int radio_user; | 442 | int radio_user; |
443 | int radio_uses_msp_demodulator; | ||
443 | 444 | ||
444 | /* miro/pinnacle + Aimslab VHX | 445 | /* miro/pinnacle + Aimslab VHX |
445 | philips matchbox (tea5757 radio tuner) support */ | 446 | philips matchbox (tea5757 radio tuner) support */ |
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index 2520219f01ba..5b75a64b199b 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c | |||
@@ -607,8 +607,9 @@ static long qc_capture(struct qcam *q, char __user *buf, unsigned long len) | |||
607 | } | 607 | } |
608 | o = i * pixels_per_line + pixels_read + k; | 608 | o = i * pixels_per_line + pixels_read + k; |
609 | if (o < len) { | 609 | if (o < len) { |
610 | u8 ch = invert - buffer[k]; | ||
610 | got++; | 611 | got++; |
611 | put_user((invert - buffer[k]) << shift, buf + o); | 612 | put_user(ch << shift, buf + o); |
612 | } | 613 | } |
613 | } | 614 | } |
614 | pixels_read += bytes; | 615 | pixels_read += bytes; |
@@ -648,8 +649,8 @@ static int qcam_querycap(struct file *file, void *priv, | |||
648 | struct qcam *qcam = video_drvdata(file); | 649 | struct qcam *qcam = video_drvdata(file); |
649 | 650 | ||
650 | strlcpy(vcap->driver, qcam->v4l2_dev.name, sizeof(vcap->driver)); | 651 | strlcpy(vcap->driver, qcam->v4l2_dev.name, sizeof(vcap->driver)); |
651 | strlcpy(vcap->card, "B&W Quickcam", sizeof(vcap->card)); | 652 | strlcpy(vcap->card, "Connectix B&W Quickcam", sizeof(vcap->card)); |
652 | strlcpy(vcap->bus_info, "parport", sizeof(vcap->bus_info)); | 653 | strlcpy(vcap->bus_info, qcam->pport->name, sizeof(vcap->bus_info)); |
653 | vcap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE; | 654 | vcap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE; |
654 | vcap->capabilities = vcap->device_caps | V4L2_CAP_DEVICE_CAPS; | 655 | vcap->capabilities = vcap->device_caps | V4L2_CAP_DEVICE_CAPS; |
655 | return 0; | 656 | return 0; |
@@ -688,8 +689,8 @@ static int qcam_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f | |||
688 | pix->height = qcam->height / qcam->transfer_scale; | 689 | pix->height = qcam->height / qcam->transfer_scale; |
689 | pix->pixelformat = (qcam->bpp == 4) ? V4L2_PIX_FMT_Y4 : V4L2_PIX_FMT_Y6; | 690 | pix->pixelformat = (qcam->bpp == 4) ? V4L2_PIX_FMT_Y4 : V4L2_PIX_FMT_Y6; |
690 | pix->field = V4L2_FIELD_NONE; | 691 | pix->field = V4L2_FIELD_NONE; |
691 | pix->bytesperline = qcam->width; | 692 | pix->bytesperline = pix->width; |
692 | pix->sizeimage = qcam->width * qcam->height; | 693 | pix->sizeimage = pix->width * pix->height; |
693 | /* Just a guess */ | 694 | /* Just a guess */ |
694 | pix->colorspace = V4L2_COLORSPACE_SRGB; | 695 | pix->colorspace = V4L2_COLORSPACE_SRGB; |
695 | return 0; | 696 | return 0; |
@@ -757,7 +758,7 @@ static int qcam_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdes | |||
757 | "4-Bit Monochrome", V4L2_PIX_FMT_Y4, | 758 | "4-Bit Monochrome", V4L2_PIX_FMT_Y4, |
758 | { 0, 0, 0, 0 } | 759 | { 0, 0, 0, 0 } |
759 | }, | 760 | }, |
760 | { 0, 0, 0, | 761 | { 1, 0, 0, |
761 | "6-Bit Monochrome", V4L2_PIX_FMT_Y6, | 762 | "6-Bit Monochrome", V4L2_PIX_FMT_Y6, |
762 | { 0, 0, 0, 0 } | 763 | { 0, 0, 0, 0 } |
763 | }, | 764 | }, |
@@ -772,6 +773,25 @@ static int qcam_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdes | |||
772 | return 0; | 773 | return 0; |
773 | } | 774 | } |
774 | 775 | ||
776 | static int qcam_enum_framesizes(struct file *file, void *fh, | ||
777 | struct v4l2_frmsizeenum *fsize) | ||
778 | { | ||
779 | static const struct v4l2_frmsize_discrete sizes[] = { | ||
780 | { 80, 60 }, | ||
781 | { 160, 120 }, | ||
782 | { 320, 240 }, | ||
783 | }; | ||
784 | |||
785 | if (fsize->index > 2) | ||
786 | return -EINVAL; | ||
787 | if (fsize->pixel_format != V4L2_PIX_FMT_Y4 && | ||
788 | fsize->pixel_format != V4L2_PIX_FMT_Y6) | ||
789 | return -EINVAL; | ||
790 | fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; | ||
791 | fsize->discrete = sizes[fsize->index]; | ||
792 | return 0; | ||
793 | } | ||
794 | |||
775 | static ssize_t qcam_read(struct file *file, char __user *buf, | 795 | static ssize_t qcam_read(struct file *file, char __user *buf, |
776 | size_t count, loff_t *ppos) | 796 | size_t count, loff_t *ppos) |
777 | { | 797 | { |
@@ -795,6 +815,11 @@ static ssize_t qcam_read(struct file *file, char __user *buf, | |||
795 | return len; | 815 | return len; |
796 | } | 816 | } |
797 | 817 | ||
818 | static unsigned int qcam_poll(struct file *filp, poll_table *wait) | ||
819 | { | ||
820 | return v4l2_ctrl_poll(filp, wait) | POLLIN | POLLRDNORM; | ||
821 | } | ||
822 | |||
798 | static int qcam_s_ctrl(struct v4l2_ctrl *ctrl) | 823 | static int qcam_s_ctrl(struct v4l2_ctrl *ctrl) |
799 | { | 824 | { |
800 | struct qcam *qcam = | 825 | struct qcam *qcam = |
@@ -828,7 +853,7 @@ static const struct v4l2_file_operations qcam_fops = { | |||
828 | .owner = THIS_MODULE, | 853 | .owner = THIS_MODULE, |
829 | .open = v4l2_fh_open, | 854 | .open = v4l2_fh_open, |
830 | .release = v4l2_fh_release, | 855 | .release = v4l2_fh_release, |
831 | .poll = v4l2_ctrl_poll, | 856 | .poll = qcam_poll, |
832 | .unlocked_ioctl = video_ioctl2, | 857 | .unlocked_ioctl = video_ioctl2, |
833 | .read = qcam_read, | 858 | .read = qcam_read, |
834 | }; | 859 | }; |
@@ -839,6 +864,7 @@ static const struct v4l2_ioctl_ops qcam_ioctl_ops = { | |||
839 | .vidioc_s_input = qcam_s_input, | 864 | .vidioc_s_input = qcam_s_input, |
840 | .vidioc_enum_input = qcam_enum_input, | 865 | .vidioc_enum_input = qcam_enum_input, |
841 | .vidioc_enum_fmt_vid_cap = qcam_enum_fmt_vid_cap, | 866 | .vidioc_enum_fmt_vid_cap = qcam_enum_fmt_vid_cap, |
867 | .vidioc_enum_framesizes = qcam_enum_framesizes, | ||
842 | .vidioc_g_fmt_vid_cap = qcam_g_fmt_vid_cap, | 868 | .vidioc_g_fmt_vid_cap = qcam_g_fmt_vid_cap, |
843 | .vidioc_s_fmt_vid_cap = qcam_s_fmt_vid_cap, | 869 | .vidioc_s_fmt_vid_cap = qcam_s_fmt_vid_cap, |
844 | .vidioc_try_fmt_vid_cap = qcam_try_fmt_vid_cap, | 870 | .vidioc_try_fmt_vid_cap = qcam_try_fmt_vid_cap, |
@@ -864,9 +890,9 @@ static struct qcam *qcam_init(struct parport *port) | |||
864 | return NULL; | 890 | return NULL; |
865 | 891 | ||
866 | v4l2_dev = &qcam->v4l2_dev; | 892 | v4l2_dev = &qcam->v4l2_dev; |
867 | strlcpy(v4l2_dev->name, "bw-qcam", sizeof(v4l2_dev->name)); | 893 | snprintf(v4l2_dev->name, sizeof(v4l2_dev->name), "bw-qcam%d", num_cams); |
868 | 894 | ||
869 | if (v4l2_device_register(NULL, v4l2_dev) < 0) { | 895 | if (v4l2_device_register(port->dev, v4l2_dev) < 0) { |
870 | v4l2_err(v4l2_dev, "Could not register v4l2_device\n"); | 896 | v4l2_err(v4l2_dev, "Could not register v4l2_device\n"); |
871 | kfree(qcam); | 897 | kfree(qcam); |
872 | return NULL; | 898 | return NULL; |
@@ -886,7 +912,7 @@ static struct qcam *qcam_init(struct parport *port) | |||
886 | return NULL; | 912 | return NULL; |
887 | } | 913 | } |
888 | qcam->pport = port; | 914 | qcam->pport = port; |
889 | qcam->pdev = parport_register_device(port, "bw-qcam", NULL, NULL, | 915 | qcam->pdev = parport_register_device(port, v4l2_dev->name, NULL, NULL, |
890 | NULL, 0, NULL); | 916 | NULL, 0, NULL); |
891 | if (qcam->pdev == NULL) { | 917 | if (qcam->pdev == NULL) { |
892 | v4l2_err(v4l2_dev, "couldn't register for %s.\n", port->name); | 918 | v4l2_err(v4l2_dev, "couldn't register for %s.\n", port->name); |
@@ -975,6 +1001,7 @@ static int init_bwqcam(struct parport *port) | |||
975 | return -ENODEV; | 1001 | return -ENODEV; |
976 | } | 1002 | } |
977 | qc_calibrate(qcam); | 1003 | qc_calibrate(qcam); |
1004 | v4l2_ctrl_handler_setup(&qcam->hdl); | ||
978 | 1005 | ||
979 | parport_release(qcam->pdev); | 1006 | parport_release(qcam->pdev); |
980 | 1007 | ||
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index b55d57cc1a1c..7e5ffd6f5178 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -838,10 +838,10 @@ static int cx18_setup_pci(struct cx18 *cx, struct pci_dev *pci_dev, | |||
838 | } | 838 | } |
839 | 839 | ||
840 | CX18_DEBUG_INFO("cx%d (rev %d) at %02x:%02x.%x, " | 840 | CX18_DEBUG_INFO("cx%d (rev %d) at %02x:%02x.%x, " |
841 | "irq: %d, latency: %d, memory: 0x%lx\n", | 841 | "irq: %d, latency: %d, memory: 0x%llx\n", |
842 | cx->pci_dev->device, cx->card_rev, pci_dev->bus->number, | 842 | cx->pci_dev->device, cx->card_rev, pci_dev->bus->number, |
843 | PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn), | 843 | PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn), |
844 | cx->pci_dev->irq, pci_latency, (unsigned long)cx->base_addr); | 844 | cx->pci_dev->irq, pci_latency, (u64)cx->base_addr); |
845 | 845 | ||
846 | return 0; | 846 | return 0; |
847 | } | 847 | } |
@@ -938,7 +938,7 @@ static int __devinit cx18_probe(struct pci_dev *pci_dev, | |||
938 | if (retval) | 938 | if (retval) |
939 | goto err; | 939 | goto err; |
940 | 940 | ||
941 | CX18_DEBUG_INFO("base addr: 0x%08x\n", cx->base_addr); | 941 | CX18_DEBUG_INFO("base addr: 0x%llx\n", (u64)cx->base_addr); |
942 | 942 | ||
943 | /* PCI Device Setup */ | 943 | /* PCI Device Setup */ |
944 | retval = cx18_setup_pci(cx, pci_dev, pci_id); | 944 | retval = cx18_setup_pci(cx, pci_dev, pci_id); |
@@ -946,8 +946,8 @@ static int __devinit cx18_probe(struct pci_dev *pci_dev, | |||
946 | goto free_workqueues; | 946 | goto free_workqueues; |
947 | 947 | ||
948 | /* map io memory */ | 948 | /* map io memory */ |
949 | CX18_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", | 949 | CX18_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n", |
950 | cx->base_addr + CX18_MEM_OFFSET, CX18_MEM_SIZE); | 950 | (u64)cx->base_addr + CX18_MEM_OFFSET, CX18_MEM_SIZE); |
951 | cx->enc_mem = ioremap_nocache(cx->base_addr + CX18_MEM_OFFSET, | 951 | cx->enc_mem = ioremap_nocache(cx->base_addr + CX18_MEM_OFFSET, |
952 | CX18_MEM_SIZE); | 952 | CX18_MEM_SIZE); |
953 | if (!cx->enc_mem) { | 953 | if (!cx->enc_mem) { |
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 7a37e0ee136f..2767c64df0c8 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -622,7 +622,7 @@ struct cx18 { | |||
622 | unique ID. Starts at 1, so 0 can be used as | 622 | unique ID. Starts at 1, so 0 can be used as |
623 | uninitialized value in the stream->id. */ | 623 | uninitialized value in the stream->id. */ |
624 | 624 | ||
625 | u32 base_addr; | 625 | resource_size_t base_addr; |
626 | 626 | ||
627 | u8 card_rev; | 627 | u8 card_rev; |
628 | void __iomem *enc_mem, *reg_mem; | 628 | void __iomem *enc_mem, *reg_mem; |
diff --git a/drivers/media/video/cx18/cx18-firmware.c b/drivers/media/video/cx18/cx18-firmware.c index 1b3fb502e6be..b85c292a849a 100644 --- a/drivers/media/video/cx18/cx18-firmware.c +++ b/drivers/media/video/cx18/cx18-firmware.c | |||
@@ -164,8 +164,13 @@ static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx, | |||
164 | 164 | ||
165 | apu_version = (vers[0] << 24) | (vers[4] << 16) | vers[32]; | 165 | apu_version = (vers[0] << 24) | (vers[4] << 16) | vers[32]; |
166 | while (offset + sizeof(seghdr) < fw->size) { | 166 | while (offset + sizeof(seghdr) < fw->size) { |
167 | /* TODO: byteswapping */ | 167 | const u32 *shptr = src + offset / 4; |
168 | memcpy(&seghdr, src + offset / 4, sizeof(seghdr)); | 168 | |
169 | seghdr.sync1 = le32_to_cpu(shptr[0]); | ||
170 | seghdr.sync2 = le32_to_cpu(shptr[1]); | ||
171 | seghdr.addr = le32_to_cpu(shptr[2]); | ||
172 | seghdr.size = le32_to_cpu(shptr[3]); | ||
173 | |||
169 | offset += sizeof(seghdr); | 174 | offset += sizeof(seghdr); |
170 | if (seghdr.sync1 != APU_ROM_SYNC1 || | 175 | if (seghdr.sync1 != APU_ROM_SYNC1 || |
171 | seghdr.sync2 != APU_ROM_SYNC2) { | 176 | seghdr.sync2 != APU_ROM_SYNC2) { |
diff --git a/drivers/media/video/cx18/cx18-mailbox.c b/drivers/media/video/cx18/cx18-mailbox.c index ed8118390b02..eabf00c6351b 100644 --- a/drivers/media/video/cx18/cx18-mailbox.c +++ b/drivers/media/video/cx18/cx18-mailbox.c | |||
@@ -434,6 +434,7 @@ static int epu_dma_done_irq(struct cx18 *cx, struct cx18_in_work_order *order) | |||
434 | { | 434 | { |
435 | u32 handle, mdl_ack_offset, mdl_ack_count; | 435 | u32 handle, mdl_ack_offset, mdl_ack_count; |
436 | struct cx18_mailbox *mb; | 436 | struct cx18_mailbox *mb; |
437 | int i; | ||
437 | 438 | ||
438 | mb = &order->mb; | 439 | mb = &order->mb; |
439 | handle = mb->args[0]; | 440 | handle = mb->args[0]; |
@@ -447,8 +448,9 @@ static int epu_dma_done_irq(struct cx18 *cx, struct cx18_in_work_order *order) | |||
447 | return -1; | 448 | return -1; |
448 | } | 449 | } |
449 | 450 | ||
450 | cx18_memcpy_fromio(cx, order->mdl_ack, cx->enc_mem + mdl_ack_offset, | 451 | for (i = 0; i < sizeof(struct cx18_mdl_ack) * mdl_ack_count; i += sizeof(u32)) |
451 | sizeof(struct cx18_mdl_ack) * mdl_ack_count); | 452 | ((u32 *)order->mdl_ack)[i / sizeof(u32)] = |
453 | cx18_readl(cx, cx->enc_mem + mdl_ack_offset + i); | ||
452 | 454 | ||
453 | if ((order->flags & CX18_F_EWO_MB_STALE) == 0) | 455 | if ((order->flags & CX18_F_EWO_MB_STALE) == 0) |
454 | mb_ack_irq(cx, order); | 456 | mb_ack_irq(cx, order); |
@@ -538,6 +540,7 @@ void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu) | |||
538 | struct cx18_mailbox *order_mb; | 540 | struct cx18_mailbox *order_mb; |
539 | struct cx18_in_work_order *order; | 541 | struct cx18_in_work_order *order; |
540 | int submit; | 542 | int submit; |
543 | int i; | ||
541 | 544 | ||
542 | switch (rpu) { | 545 | switch (rpu) { |
543 | case CPU: | 546 | case CPU: |
@@ -562,10 +565,12 @@ void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu) | |||
562 | order_mb = &order->mb; | 565 | order_mb = &order->mb; |
563 | 566 | ||
564 | /* mb->cmd and mb->args[0] through mb->args[2] */ | 567 | /* mb->cmd and mb->args[0] through mb->args[2] */ |
565 | cx18_memcpy_fromio(cx, &order_mb->cmd, &mb->cmd, 4 * sizeof(u32)); | 568 | for (i = 0; i < 4; i++) |
569 | (&order_mb->cmd)[i] = cx18_readl(cx, &mb->cmd + i); | ||
570 | |||
566 | /* mb->request and mb->ack. N.B. we want to read mb->ack last */ | 571 | /* mb->request and mb->ack. N.B. we want to read mb->ack last */ |
567 | cx18_memcpy_fromio(cx, &order_mb->request, &mb->request, | 572 | for (i = 0; i < 2; i++) |
568 | 2 * sizeof(u32)); | 573 | (&order_mb->request)[i] = cx18_readl(cx, &mb->request + i); |
569 | 574 | ||
570 | if (order_mb->request == order_mb->ack) { | 575 | if (order_mb->request == order_mb->ack) { |
571 | CX18_DEBUG_WARN("Possibly falling behind: %s self-ack'ed our " | 576 | CX18_DEBUG_WARN("Possibly falling behind: %s self-ack'ed our " |
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index e46446a449c0..ed7b2aa1ed83 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -471,7 +471,7 @@ static int blackbird_load_firmware(struct cx8802_dev *dev) | |||
471 | dprintk(1,"Loading firmware ...\n"); | 471 | dprintk(1,"Loading firmware ...\n"); |
472 | dataptr = (u32*)firmware->data; | 472 | dataptr = (u32*)firmware->data; |
473 | for (i = 0; i < (firmware->size >> 2); i++) { | 473 | for (i = 0; i < (firmware->size >> 2); i++) { |
474 | value = *dataptr; | 474 | value = le32_to_cpu(*dataptr); |
475 | checksum += ~value; | 475 | checksum += ~value; |
476 | memory_write(dev->core, i, value); | 476 | memory_write(dev->core, i, value); |
477 | dataptr++; | 477 | dataptr++; |
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 20a7e24de6fb..92da7c28b6f0 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -974,6 +974,7 @@ struct em28xx_board em28xx_boards[] = { | |||
974 | [EM2884_BOARD_CINERGY_HTC_STICK] = { | 974 | [EM2884_BOARD_CINERGY_HTC_STICK] = { |
975 | .name = "Terratec Cinergy HTC Stick", | 975 | .name = "Terratec Cinergy HTC Stick", |
976 | .has_dvb = 1, | 976 | .has_dvb = 1, |
977 | .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS, | ||
977 | #if 0 | 978 | #if 0 |
978 | .tuner_type = TUNER_PHILIPS_TDA8290, | 979 | .tuner_type = TUNER_PHILIPS_TDA8290, |
979 | .tuner_addr = 0x41, | 980 | .tuner_addr = 0x41, |
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index fce5f7680c99..5e30c4f3f248 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c | |||
@@ -527,6 +527,8 @@ static int em28xx_ir_init(struct em28xx *dev) | |||
527 | 527 | ||
528 | if (dev->board.ir_codes == NULL) { | 528 | if (dev->board.ir_codes == NULL) { |
529 | /* No remote control support */ | 529 | /* No remote control support */ |
530 | em28xx_warn("Remote control support is not available for " | ||
531 | "this card.\n"); | ||
530 | return 0; | 532 | return 0; |
531 | } | 533 | } |
532 | 534 | ||
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 137166d73945..31721eadc597 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -1653,7 +1653,7 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1653 | enum v4l2_buf_type buf_type) | 1653 | enum v4l2_buf_type buf_type) |
1654 | { | 1654 | { |
1655 | struct gspca_dev *gspca_dev = video_drvdata(file); | 1655 | struct gspca_dev *gspca_dev = video_drvdata(file); |
1656 | int ret; | 1656 | int i, ret; |
1657 | 1657 | ||
1658 | if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 1658 | if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
1659 | return -EINVAL; | 1659 | return -EINVAL; |
@@ -1678,6 +1678,8 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1678 | wake_up_interruptible(&gspca_dev->wq); | 1678 | wake_up_interruptible(&gspca_dev->wq); |
1679 | 1679 | ||
1680 | /* empty the transfer queues */ | 1680 | /* empty the transfer queues */ |
1681 | for (i = 0; i < gspca_dev->nframes; i++) | ||
1682 | gspca_dev->frame[i].v4l2_buf.flags &= ~BUF_ALL_FLAGS; | ||
1681 | atomic_set(&gspca_dev->fr_q, 0); | 1683 | atomic_set(&gspca_dev->fr_q, 0); |
1682 | atomic_set(&gspca_dev->fr_i, 0); | 1684 | atomic_set(&gspca_dev->fr_i, 0); |
1683 | gspca_dev->fr_o = 0; | 1685 | gspca_dev->fr_o = 0; |
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index b5acb1e4b4e7..80c81dd6d68b 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -96,7 +96,7 @@ static void setbrightness(struct gspca_dev *gspca_dev); | |||
96 | static void setcontrast(struct gspca_dev *gspca_dev); | 96 | static void setcontrast(struct gspca_dev *gspca_dev); |
97 | static void setgain(struct gspca_dev *gspca_dev); | 97 | static void setgain(struct gspca_dev *gspca_dev); |
98 | static void setexposure(struct gspca_dev *gspca_dev); | 98 | static void setexposure(struct gspca_dev *gspca_dev); |
99 | static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val); | 99 | static void setagc(struct gspca_dev *gspca_dev); |
100 | static void setawb(struct gspca_dev *gspca_dev); | 100 | static void setawb(struct gspca_dev *gspca_dev); |
101 | static void setaec(struct gspca_dev *gspca_dev); | 101 | static void setaec(struct gspca_dev *gspca_dev); |
102 | static void setsharpness(struct gspca_dev *gspca_dev); | 102 | static void setsharpness(struct gspca_dev *gspca_dev); |
@@ -189,7 +189,7 @@ static const struct ctrl sd_ctrls[] = { | |||
189 | .step = 1, | 189 | .step = 1, |
190 | .default_value = 1, | 190 | .default_value = 1, |
191 | }, | 191 | }, |
192 | .set = sd_setagc | 192 | .set_control = setagc |
193 | }, | 193 | }, |
194 | [AWB] = { | 194 | [AWB] = { |
195 | { | 195 | { |
@@ -851,6 +851,7 @@ static int sccb_check_status(struct gspca_dev *gspca_dev) | |||
851 | int i; | 851 | int i; |
852 | 852 | ||
853 | for (i = 0; i < 5; i++) { | 853 | for (i = 0; i < 5; i++) { |
854 | msleep(10); | ||
854 | data = ov534_reg_read(gspca_dev, OV534_REG_STATUS); | 855 | data = ov534_reg_read(gspca_dev, OV534_REG_STATUS); |
855 | 856 | ||
856 | switch (data) { | 857 | switch (data) { |
@@ -1242,10 +1243,6 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1242 | 1243 | ||
1243 | cam->ctrls = sd->ctrls; | 1244 | cam->ctrls = sd->ctrls; |
1244 | 1245 | ||
1245 | /* the auto white balance control works only when auto gain is set */ | ||
1246 | if (sd_ctrls[AGC].qctrl.default_value == 0) | ||
1247 | gspca_dev->ctrl_inac |= (1 << AWB); | ||
1248 | |||
1249 | cam->cam_mode = ov772x_mode; | 1246 | cam->cam_mode = ov772x_mode; |
1250 | cam->nmodes = ARRAY_SIZE(ov772x_mode); | 1247 | cam->nmodes = ARRAY_SIZE(ov772x_mode); |
1251 | 1248 | ||
@@ -1486,29 +1483,6 @@ scan_next: | |||
1486 | } while (remaining_len > 0); | 1483 | } while (remaining_len > 0); |
1487 | } | 1484 | } |
1488 | 1485 | ||
1489 | static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val) | ||
1490 | { | ||
1491 | struct sd *sd = (struct sd *) gspca_dev; | ||
1492 | |||
1493 | sd->ctrls[AGC].val = val; | ||
1494 | |||
1495 | /* the auto white balance control works only | ||
1496 | * when auto gain is set */ | ||
1497 | if (val) { | ||
1498 | gspca_dev->ctrl_inac &= ~(1 << AWB); | ||
1499 | } else { | ||
1500 | gspca_dev->ctrl_inac |= (1 << AWB); | ||
1501 | if (sd->ctrls[AWB].val) { | ||
1502 | sd->ctrls[AWB].val = 0; | ||
1503 | if (gspca_dev->streaming) | ||
1504 | setawb(gspca_dev); | ||
1505 | } | ||
1506 | } | ||
1507 | if (gspca_dev->streaming) | ||
1508 | setagc(gspca_dev); | ||
1509 | return gspca_dev->usb_err; | ||
1510 | } | ||
1511 | |||
1512 | static int sd_querymenu(struct gspca_dev *gspca_dev, | 1486 | static int sd_querymenu(struct gspca_dev *gspca_dev, |
1513 | struct v4l2_querymenu *menu) | 1487 | struct v4l2_querymenu *menu) |
1514 | { | 1488 | { |
diff --git a/drivers/media/video/gspca/ov534_9.c b/drivers/media/video/gspca/ov534_9.c index b5797308a39b..1fd41f0d2e95 100644 --- a/drivers/media/video/gspca/ov534_9.c +++ b/drivers/media/video/gspca/ov534_9.c | |||
@@ -1008,6 +1008,7 @@ static int sccb_check_status(struct gspca_dev *gspca_dev) | |||
1008 | int i; | 1008 | int i; |
1009 | 1009 | ||
1010 | for (i = 0; i < 5; i++) { | 1010 | for (i = 0; i < 5; i++) { |
1011 | msleep(10); | ||
1011 | data = reg_r(gspca_dev, OV534_REG_STATUS); | 1012 | data = reg_r(gspca_dev, OV534_REG_STATUS); |
1012 | 1013 | ||
1013 | switch (data) { | 1014 | switch (data) { |
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c index 2cb7d95f7be7..115da169f32a 100644 --- a/drivers/media/video/gspca/pac7311.c +++ b/drivers/media/video/gspca/pac7311.c | |||
@@ -418,7 +418,7 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
418 | struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; | 418 | struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; |
419 | 419 | ||
420 | gspca_dev->vdev.ctrl_handler = hdl; | 420 | gspca_dev->vdev.ctrl_handler = hdl; |
421 | v4l2_ctrl_handler_init(hdl, 4); | 421 | v4l2_ctrl_handler_init(hdl, 5); |
422 | 422 | ||
423 | sd->contrast = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 423 | sd->contrast = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
424 | V4L2_CID_CONTRAST, 0, 15, 1, 7); | 424 | V4L2_CID_CONTRAST, 0, 15, 1, 7); |
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index ad098202d7f0..b9c6f17eabb2 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -1761,7 +1761,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1761 | V4L2_CID_SATURATION, 0, 255, 1, 127); | 1761 | V4L2_CID_SATURATION, 0, 255, 1, 127); |
1762 | sd->hue = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1762 | sd->hue = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1763 | V4L2_CID_HUE, -180, 180, 1, 0); | 1763 | V4L2_CID_HUE, -180, 180, 1, 0); |
1764 | v4l2_ctrl_cluster(4, &sd->brightness); | ||
1765 | 1764 | ||
1766 | sd->gamma = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1765 | sd->gamma = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1767 | V4L2_CID_GAMMA, 0, 255, 1, 0x10); | 1766 | V4L2_CID_GAMMA, 0, 255, 1, 0x10); |
@@ -1770,7 +1769,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1770 | V4L2_CID_BLUE_BALANCE, 0, 127, 1, 0x28); | 1769 | V4L2_CID_BLUE_BALANCE, 0, 127, 1, 0x28); |
1771 | sd->red = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1770 | sd->red = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1772 | V4L2_CID_RED_BALANCE, 0, 127, 1, 0x28); | 1771 | V4L2_CID_RED_BALANCE, 0, 127, 1, 0x28); |
1773 | v4l2_ctrl_cluster(2, &sd->blue); | ||
1774 | 1772 | ||
1775 | if (sd->sensor != SENSOR_OV9655 && sd->sensor != SENSOR_SOI968 && | 1773 | if (sd->sensor != SENSOR_OV9655 && sd->sensor != SENSOR_SOI968 && |
1776 | sd->sensor != SENSOR_OV7670 && sd->sensor != SENSOR_MT9M001 && | 1774 | sd->sensor != SENSOR_OV7670 && sd->sensor != SENSOR_MT9M001 && |
@@ -1779,7 +1777,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1779 | V4L2_CID_HFLIP, 0, 1, 1, 0); | 1777 | V4L2_CID_HFLIP, 0, 1, 1, 0); |
1780 | sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1778 | sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1781 | V4L2_CID_VFLIP, 0, 1, 1, 0); | 1779 | V4L2_CID_VFLIP, 0, 1, 1, 0); |
1782 | v4l2_ctrl_cluster(2, &sd->hflip); | ||
1783 | } | 1780 | } |
1784 | 1781 | ||
1785 | if (sd->sensor != SENSOR_SOI968 && sd->sensor != SENSOR_MT9VPRB && | 1782 | if (sd->sensor != SENSOR_SOI968 && sd->sensor != SENSOR_MT9VPRB && |
@@ -1794,6 +1791,20 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1794 | V4L2_CID_GAIN, 0, 28, 1, 0); | 1791 | V4L2_CID_GAIN, 0, 28, 1, 0); |
1795 | sd->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | 1792 | sd->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, |
1796 | V4L2_CID_AUTOGAIN, 0, 1, 1, 1); | 1793 | V4L2_CID_AUTOGAIN, 0, 1, 1, 1); |
1794 | } | ||
1795 | |||
1796 | sd->jpegqual = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | ||
1797 | V4L2_CID_JPEG_COMPRESSION_QUALITY, 50, 90, 1, 80); | ||
1798 | if (hdl->error) { | ||
1799 | pr_err("Could not initialize controls\n"); | ||
1800 | return hdl->error; | ||
1801 | } | ||
1802 | |||
1803 | v4l2_ctrl_cluster(4, &sd->brightness); | ||
1804 | v4l2_ctrl_cluster(2, &sd->blue); | ||
1805 | if (sd->hflip) | ||
1806 | v4l2_ctrl_cluster(2, &sd->hflip); | ||
1807 | if (sd->autogain) { | ||
1797 | if (sd->sensor == SENSOR_SOI968) | 1808 | if (sd->sensor == SENSOR_SOI968) |
1798 | /* this sensor doesn't have the exposure control and | 1809 | /* this sensor doesn't have the exposure control and |
1799 | autogain is clustered with gain instead. This works | 1810 | autogain is clustered with gain instead. This works |
@@ -1803,13 +1814,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) | |||
1803 | /* Otherwise autogain is clustered with exposure. */ | 1814 | /* Otherwise autogain is clustered with exposure. */ |
1804 | v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, false); | 1815 | v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, false); |
1805 | } | 1816 | } |
1806 | |||
1807 | sd->jpegqual = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, | ||
1808 | V4L2_CID_JPEG_COMPRESSION_QUALITY, 50, 90, 1, 80); | ||
1809 | if (hdl->error) { | ||
1810 | pr_err("Could not initialize controls\n"); | ||
1811 | return hdl->error; | ||
1812 | } | ||
1813 | return 0; | 1817 | return 0; |
1814 | } | 1818 | } |
1815 | 1819 | ||
@@ -2066,10 +2070,13 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
2066 | set_gamma(gspca_dev, v4l2_ctrl_g_ctrl(sd->gamma)); | 2070 | set_gamma(gspca_dev, v4l2_ctrl_g_ctrl(sd->gamma)); |
2067 | set_redblue(gspca_dev, v4l2_ctrl_g_ctrl(sd->blue), | 2071 | set_redblue(gspca_dev, v4l2_ctrl_g_ctrl(sd->blue), |
2068 | v4l2_ctrl_g_ctrl(sd->red)); | 2072 | v4l2_ctrl_g_ctrl(sd->red)); |
2069 | set_gain(gspca_dev, v4l2_ctrl_g_ctrl(sd->gain)); | 2073 | if (sd->gain) |
2070 | set_exposure(gspca_dev, v4l2_ctrl_g_ctrl(sd->exposure)); | 2074 | set_gain(gspca_dev, v4l2_ctrl_g_ctrl(sd->gain)); |
2071 | set_hvflip(gspca_dev, v4l2_ctrl_g_ctrl(sd->hflip), | 2075 | if (sd->exposure) |
2072 | v4l2_ctrl_g_ctrl(sd->vflip)); | 2076 | set_exposure(gspca_dev, v4l2_ctrl_g_ctrl(sd->exposure)); |
2077 | if (sd->hflip) | ||
2078 | set_hvflip(gspca_dev, v4l2_ctrl_g_ctrl(sd->hflip), | ||
2079 | v4l2_ctrl_g_ctrl(sd->vflip)); | ||
2073 | 2080 | ||
2074 | reg_w1(gspca_dev, 0x1007, 0x20); | 2081 | reg_w1(gspca_dev, 0x1007, 0x20); |
2075 | reg_w1(gspca_dev, 0x1061, 0x03); | 2082 | reg_w1(gspca_dev, 0x1061, 0x03); |
@@ -2172,7 +2179,7 @@ static void sd_dqcallback(struct gspca_dev *gspca_dev) | |||
2172 | struct sd *sd = (struct sd *) gspca_dev; | 2179 | struct sd *sd = (struct sd *) gspca_dev; |
2173 | int avg_lum; | 2180 | int avg_lum; |
2174 | 2181 | ||
2175 | if (!v4l2_ctrl_g_ctrl(sd->autogain)) | 2182 | if (sd->autogain == NULL || !v4l2_ctrl_g_ctrl(sd->autogain)) |
2176 | return; | 2183 | return; |
2177 | 2184 | ||
2178 | avg_lum = atomic_read(&sd->avg_lum); | 2185 | avg_lum = atomic_read(&sd->avg_lum); |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 4d1696d1a7f4..f38faa9b37c3 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -3120,7 +3120,7 @@ static const struct sd_desc sd_desc = { | |||
3120 | | (SENSOR_ ## sensor << 8) \ | 3120 | | (SENSOR_ ## sensor << 8) \ |
3121 | | (flags) | 3121 | | (flags) |
3122 | static const struct usb_device_id device_table[] = { | 3122 | static const struct usb_device_id device_table[] = { |
3123 | {USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)}, | 3123 | {USB_DEVICE(0x0458, 0x7025), BSF(SN9C120, MI0360B, F_PDN_INV)}, |
3124 | {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)}, | 3124 | {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)}, |
3125 | {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)}, | 3125 | {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)}, |
3126 | {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)}, | 3126 | {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)}, |
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 057929e165ab..5462ce2f60ea 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c | |||
@@ -866,10 +866,10 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev, | |||
866 | pci_write_config_dword(pdev, 0x40, 0xffff); | 866 | pci_write_config_dword(pdev, 0x40, 0xffff); |
867 | 867 | ||
868 | IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, " | 868 | IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, " |
869 | "irq: %d, latency: %d, memory: 0x%lx\n", | 869 | "irq: %d, latency: %d, memory: 0x%llx\n", |
870 | pdev->device, pdev->revision, pdev->bus->number, | 870 | pdev->device, pdev->revision, pdev->bus->number, |
871 | PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), | 871 | PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), |
872 | pdev->irq, pci_latency, (unsigned long)itv->base_addr); | 872 | pdev->irq, pci_latency, (u64)itv->base_addr); |
873 | 873 | ||
874 | return 0; | 874 | return 0; |
875 | } | 875 | } |
@@ -1007,7 +1007,7 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, | |||
1007 | itv->cxhdl.priv = itv; | 1007 | itv->cxhdl.priv = itv; |
1008 | itv->cxhdl.func = ivtv_api_func; | 1008 | itv->cxhdl.func = ivtv_api_func; |
1009 | 1009 | ||
1010 | IVTV_DEBUG_INFO("base addr: 0x%08x\n", itv->base_addr); | 1010 | IVTV_DEBUG_INFO("base addr: 0x%llx\n", (u64)itv->base_addr); |
1011 | 1011 | ||
1012 | /* PCI Device Setup */ | 1012 | /* PCI Device Setup */ |
1013 | retval = ivtv_setup_pci(itv, pdev, pci_id); | 1013 | retval = ivtv_setup_pci(itv, pdev, pci_id); |
@@ -1017,8 +1017,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, | |||
1017 | goto free_mem; | 1017 | goto free_mem; |
1018 | 1018 | ||
1019 | /* map io memory */ | 1019 | /* map io memory */ |
1020 | IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", | 1020 | IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n", |
1021 | itv->base_addr + IVTV_ENCODER_OFFSET, IVTV_ENCODER_SIZE); | 1021 | (u64)itv->base_addr + IVTV_ENCODER_OFFSET, IVTV_ENCODER_SIZE); |
1022 | itv->enc_mem = ioremap_nocache(itv->base_addr + IVTV_ENCODER_OFFSET, | 1022 | itv->enc_mem = ioremap_nocache(itv->base_addr + IVTV_ENCODER_OFFSET, |
1023 | IVTV_ENCODER_SIZE); | 1023 | IVTV_ENCODER_SIZE); |
1024 | if (!itv->enc_mem) { | 1024 | if (!itv->enc_mem) { |
@@ -1034,8 +1034,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, | |||
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | if (itv->has_cx23415) { | 1036 | if (itv->has_cx23415) { |
1037 | IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", | 1037 | IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n", |
1038 | itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE); | 1038 | (u64)itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE); |
1039 | itv->dec_mem = ioremap_nocache(itv->base_addr + IVTV_DECODER_OFFSET, | 1039 | itv->dec_mem = ioremap_nocache(itv->base_addr + IVTV_DECODER_OFFSET, |
1040 | IVTV_DECODER_SIZE); | 1040 | IVTV_DECODER_SIZE); |
1041 | if (!itv->dec_mem) { | 1041 | if (!itv->dec_mem) { |
@@ -1056,8 +1056,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, | |||
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | /* map registers memory */ | 1058 | /* map registers memory */ |
1059 | IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", | 1059 | IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n", |
1060 | itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); | 1060 | (u64)itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); |
1061 | itv->reg_mem = | 1061 | itv->reg_mem = |
1062 | ioremap_nocache(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); | 1062 | ioremap_nocache(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); |
1063 | if (!itv->reg_mem) { | 1063 | if (!itv->reg_mem) { |
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h index 2e220028aad2..a7e00f8938f8 100644 --- a/drivers/media/video/ivtv/ivtv-driver.h +++ b/drivers/media/video/ivtv/ivtv-driver.h | |||
@@ -622,7 +622,7 @@ struct ivtv { | |||
622 | struct v4l2_subdev *sd_video; /* controlling video decoder subdev */ | 622 | struct v4l2_subdev *sd_video; /* controlling video decoder subdev */ |
623 | struct v4l2_subdev *sd_audio; /* controlling audio subdev */ | 623 | struct v4l2_subdev *sd_audio; /* controlling audio subdev */ |
624 | struct v4l2_subdev *sd_muxer; /* controlling audio muxer subdev */ | 624 | struct v4l2_subdev *sd_muxer; /* controlling audio muxer subdev */ |
625 | u32 base_addr; /* PCI resource base address */ | 625 | resource_size_t base_addr; /* PCI resource base address */ |
626 | volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */ | 626 | volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */ |
627 | volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */ | 627 | volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */ |
628 | volatile void __iomem *reg_mem; /* pointer to mapped registers */ | 628 | volatile void __iomem *reg_mem; /* pointer to mapped registers */ |
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c index d2dec585e61b..3945556f5733 100644 --- a/drivers/media/video/mem2mem_testdev.c +++ b/drivers/media/video/mem2mem_testdev.c | |||
@@ -110,22 +110,6 @@ enum { | |||
110 | V4L2_M2M_DST = 1, | 110 | V4L2_M2M_DST = 1, |
111 | }; | 111 | }; |
112 | 112 | ||
113 | /* Source and destination queue data */ | ||
114 | static struct m2mtest_q_data q_data[2]; | ||
115 | |||
116 | static struct m2mtest_q_data *get_q_data(enum v4l2_buf_type type) | ||
117 | { | ||
118 | switch (type) { | ||
119 | case V4L2_BUF_TYPE_VIDEO_OUTPUT: | ||
120 | return &q_data[V4L2_M2M_SRC]; | ||
121 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: | ||
122 | return &q_data[V4L2_M2M_DST]; | ||
123 | default: | ||
124 | BUG(); | ||
125 | } | ||
126 | return NULL; | ||
127 | } | ||
128 | |||
129 | #define V4L2_CID_TRANS_TIME_MSEC V4L2_CID_PRIVATE_BASE | 113 | #define V4L2_CID_TRANS_TIME_MSEC V4L2_CID_PRIVATE_BASE |
130 | #define V4L2_CID_TRANS_NUM_BUFS (V4L2_CID_PRIVATE_BASE + 1) | 114 | #define V4L2_CID_TRANS_NUM_BUFS (V4L2_CID_PRIVATE_BASE + 1) |
131 | 115 | ||
@@ -198,8 +182,26 @@ struct m2mtest_ctx { | |||
198 | int aborting; | 182 | int aborting; |
199 | 183 | ||
200 | struct v4l2_m2m_ctx *m2m_ctx; | 184 | struct v4l2_m2m_ctx *m2m_ctx; |
185 | |||
186 | /* Source and destination queue data */ | ||
187 | struct m2mtest_q_data q_data[2]; | ||
201 | }; | 188 | }; |
202 | 189 | ||
190 | static struct m2mtest_q_data *get_q_data(struct m2mtest_ctx *ctx, | ||
191 | enum v4l2_buf_type type) | ||
192 | { | ||
193 | switch (type) { | ||
194 | case V4L2_BUF_TYPE_VIDEO_OUTPUT: | ||
195 | return &ctx->q_data[V4L2_M2M_SRC]; | ||
196 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: | ||
197 | return &ctx->q_data[V4L2_M2M_DST]; | ||
198 | default: | ||
199 | BUG(); | ||
200 | } | ||
201 | return NULL; | ||
202 | } | ||
203 | |||
204 | |||
203 | static struct v4l2_queryctrl *get_ctrl(int id) | 205 | static struct v4l2_queryctrl *get_ctrl(int id) |
204 | { | 206 | { |
205 | int i; | 207 | int i; |
@@ -223,7 +225,7 @@ static int device_process(struct m2mtest_ctx *ctx, | |||
223 | int tile_w, bytes_left; | 225 | int tile_w, bytes_left; |
224 | int width, height, bytesperline; | 226 | int width, height, bytesperline; |
225 | 227 | ||
226 | q_data = get_q_data(V4L2_BUF_TYPE_VIDEO_OUTPUT); | 228 | q_data = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT); |
227 | 229 | ||
228 | width = q_data->width; | 230 | width = q_data->width; |
229 | height = q_data->height; | 231 | height = q_data->height; |
@@ -436,7 +438,7 @@ static int vidioc_g_fmt(struct m2mtest_ctx *ctx, struct v4l2_format *f) | |||
436 | if (!vq) | 438 | if (!vq) |
437 | return -EINVAL; | 439 | return -EINVAL; |
438 | 440 | ||
439 | q_data = get_q_data(f->type); | 441 | q_data = get_q_data(ctx, f->type); |
440 | 442 | ||
441 | f->fmt.pix.width = q_data->width; | 443 | f->fmt.pix.width = q_data->width; |
442 | f->fmt.pix.height = q_data->height; | 444 | f->fmt.pix.height = q_data->height; |
@@ -535,7 +537,7 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct v4l2_format *f) | |||
535 | if (!vq) | 537 | if (!vq) |
536 | return -EINVAL; | 538 | return -EINVAL; |
537 | 539 | ||
538 | q_data = get_q_data(f->type); | 540 | q_data = get_q_data(ctx, f->type); |
539 | if (!q_data) | 541 | if (!q_data) |
540 | return -EINVAL; | 542 | return -EINVAL; |
541 | 543 | ||
@@ -747,7 +749,7 @@ static int m2mtest_queue_setup(struct vb2_queue *vq, | |||
747 | struct m2mtest_q_data *q_data; | 749 | struct m2mtest_q_data *q_data; |
748 | unsigned int size, count = *nbuffers; | 750 | unsigned int size, count = *nbuffers; |
749 | 751 | ||
750 | q_data = get_q_data(vq->type); | 752 | q_data = get_q_data(ctx, vq->type); |
751 | 753 | ||
752 | size = q_data->width * q_data->height * q_data->fmt->depth >> 3; | 754 | size = q_data->width * q_data->height * q_data->fmt->depth >> 3; |
753 | 755 | ||
@@ -775,7 +777,7 @@ static int m2mtest_buf_prepare(struct vb2_buffer *vb) | |||
775 | 777 | ||
776 | dprintk(ctx->dev, "type: %d\n", vb->vb2_queue->type); | 778 | dprintk(ctx->dev, "type: %d\n", vb->vb2_queue->type); |
777 | 779 | ||
778 | q_data = get_q_data(vb->vb2_queue->type); | 780 | q_data = get_q_data(ctx, vb->vb2_queue->type); |
779 | 781 | ||
780 | if (vb2_plane_size(vb, 0) < q_data->sizeimage) { | 782 | if (vb2_plane_size(vb, 0) < q_data->sizeimage) { |
781 | dprintk(ctx->dev, "%s data will not fit into plane (%lu < %lu)\n", | 783 | dprintk(ctx->dev, "%s data will not fit into plane (%lu < %lu)\n", |
@@ -860,6 +862,9 @@ static int m2mtest_open(struct file *file) | |||
860 | ctx->transtime = MEM2MEM_DEF_TRANSTIME; | 862 | ctx->transtime = MEM2MEM_DEF_TRANSTIME; |
861 | ctx->num_processed = 0; | 863 | ctx->num_processed = 0; |
862 | 864 | ||
865 | ctx->q_data[V4L2_M2M_SRC].fmt = &formats[0]; | ||
866 | ctx->q_data[V4L2_M2M_DST].fmt = &formats[0]; | ||
867 | |||
863 | ctx->m2m_ctx = v4l2_m2m_ctx_init(dev->m2m_dev, ctx, &queue_init); | 868 | ctx->m2m_ctx = v4l2_m2m_ctx_init(dev->m2m_dev, ctx, &queue_init); |
864 | 869 | ||
865 | if (IS_ERR(ctx->m2m_ctx)) { | 870 | if (IS_ERR(ctx->m2m_ctx)) { |
@@ -986,9 +991,6 @@ static int m2mtest_probe(struct platform_device *pdev) | |||
986 | goto err_m2m; | 991 | goto err_m2m; |
987 | } | 992 | } |
988 | 993 | ||
989 | q_data[V4L2_M2M_SRC].fmt = &formats[0]; | ||
990 | q_data[V4L2_M2M_DST].fmt = &formats[0]; | ||
991 | |||
992 | return 0; | 994 | return 0; |
993 | 995 | ||
994 | v4l2_m2m_release(dev->m2m_dev); | 996 | v4l2_m2m_release(dev->m2m_dev); |
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index ded26b7286fa..41f9a254b245 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
@@ -345,19 +345,6 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { | |||
345 | PRP_INTR_CH2OVF, | 345 | PRP_INTR_CH2OVF, |
346 | } | 346 | } |
347 | }, | 347 | }, |
348 | { | ||
349 | .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8, | ||
350 | .out_fmt = V4L2_PIX_FMT_YUV420, | ||
351 | .cfg = { | ||
352 | .channel = 2, | ||
353 | .in_fmt = PRP_CNTL_DATA_IN_YUV422, | ||
354 | .out_fmt = PRP_CNTL_CH2_OUT_YUV420, | ||
355 | .src_pixel = 0x22000888, /* YUV422 (YUYV) */ | ||
356 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | | ||
357 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | | ||
358 | PRP_INTR_CH2OVF, | ||
359 | } | ||
360 | }, | ||
361 | }; | 348 | }; |
362 | 349 | ||
363 | static struct mx2_fmt_cfg *mx27_emma_prp_get_format( | 350 | static struct mx2_fmt_cfg *mx27_emma_prp_get_format( |
@@ -984,7 +971,6 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
984 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | 971 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
985 | struct mx2_camera_dev *pcdev = ici->priv; | 972 | struct mx2_camera_dev *pcdev = ici->priv; |
986 | struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; | 973 | struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; |
987 | const struct soc_camera_format_xlate *xlate; | ||
988 | unsigned long common_flags; | 974 | unsigned long common_flags; |
989 | int ret; | 975 | int ret; |
990 | int bytesperline; | 976 | int bytesperline; |
@@ -1029,31 +1015,14 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
1029 | return ret; | 1015 | return ret; |
1030 | } | 1016 | } |
1031 | 1017 | ||
1032 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | ||
1033 | if (!xlate) { | ||
1034 | dev_warn(icd->parent, "Format %x not found\n", pixfmt); | ||
1035 | return -EINVAL; | ||
1036 | } | ||
1037 | |||
1038 | if (xlate->code == V4L2_MBUS_FMT_YUYV8_2X8) { | ||
1039 | csicr1 |= CSICR1_PACK_DIR; | ||
1040 | csicr1 &= ~CSICR1_SWAP16_EN; | ||
1041 | dev_dbg(icd->parent, "already yuyv format, don't convert\n"); | ||
1042 | } else if (xlate->code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1043 | csicr1 &= ~CSICR1_PACK_DIR; | ||
1044 | csicr1 |= CSICR1_SWAP16_EN; | ||
1045 | dev_dbg(icd->parent, "convert uyvy mbus format into yuyv\n"); | ||
1046 | } else { | ||
1047 | dev_warn(icd->parent, "mbus format not supported\n"); | ||
1048 | return -EINVAL; | ||
1049 | } | ||
1050 | |||
1051 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) | 1018 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) |
1052 | csicr1 |= CSICR1_REDGE; | 1019 | csicr1 |= CSICR1_REDGE; |
1053 | if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) | 1020 | if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) |
1054 | csicr1 |= CSICR1_SOF_POL; | 1021 | csicr1 |= CSICR1_SOF_POL; |
1055 | if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) | 1022 | if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) |
1056 | csicr1 |= CSICR1_HSYNC_POL; | 1023 | csicr1 |= CSICR1_HSYNC_POL; |
1024 | if (pcdev->platform_flags & MX2_CAMERA_SWAP16) | ||
1025 | csicr1 |= CSICR1_SWAP16_EN; | ||
1057 | if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) | 1026 | if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) |
1058 | csicr1 |= CSICR1_EXT_VSYNC; | 1027 | csicr1 |= CSICR1_EXT_VSYNC; |
1059 | if (pcdev->platform_flags & MX2_CAMERA_CCIR) | 1028 | if (pcdev->platform_flags & MX2_CAMERA_CCIR) |
@@ -1064,6 +1033,8 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
1064 | csicr1 |= CSICR1_GCLK_MODE; | 1033 | csicr1 |= CSICR1_GCLK_MODE; |
1065 | if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) | 1034 | if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) |
1066 | csicr1 |= CSICR1_INV_DATA; | 1035 | csicr1 |= CSICR1_INV_DATA; |
1036 | if (pcdev->platform_flags & MX2_CAMERA_PACK_DIR_MSB) | ||
1037 | csicr1 |= CSICR1_PACK_DIR; | ||
1067 | 1038 | ||
1068 | pcdev->csicr1 = csicr1; | 1039 | pcdev->csicr1 = csicr1; |
1069 | 1040 | ||
@@ -1138,8 +1109,7 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, | |||
1138 | return 0; | 1109 | return 0; |
1139 | } | 1110 | } |
1140 | 1111 | ||
1141 | if (code == V4L2_MBUS_FMT_YUYV8_2X8 || | 1112 | if (code == V4L2_MBUS_FMT_YUYV8_2X8) { |
1142 | code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1143 | formats++; | 1113 | formats++; |
1144 | if (xlate) { | 1114 | if (xlate) { |
1145 | /* | 1115 | /* |
@@ -1155,18 +1125,6 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, | |||
1155 | } | 1125 | } |
1156 | } | 1126 | } |
1157 | 1127 | ||
1158 | if (code == V4L2_MBUS_FMT_UYVY8_2X8) { | ||
1159 | formats++; | ||
1160 | if (xlate) { | ||
1161 | xlate->host_fmt = | ||
1162 | soc_mbus_get_fmtdesc(V4L2_MBUS_FMT_YUYV8_2X8); | ||
1163 | xlate->code = code; | ||
1164 | dev_dbg(dev, "Providing host format %s for sensor code %d\n", | ||
1165 | xlate->host_fmt->name, code); | ||
1166 | xlate++; | ||
1167 | } | ||
1168 | } | ||
1169 | |||
1170 | /* Generic pass-trough */ | 1128 | /* Generic pass-trough */ |
1171 | formats++; | 1129 | formats++; |
1172 | if (xlate) { | 1130 | if (xlate) { |
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c index af2d9086d7e8..c370c2d87c17 100644 --- a/drivers/media/video/pms.c +++ b/drivers/media/video/pms.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/ioport.h> | 29 | #include <linux/ioport.h> |
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
32 | #include <linux/slab.h> | ||
32 | #include <linux/uaccess.h> | 33 | #include <linux/uaccess.h> |
33 | #include <linux/isa.h> | 34 | #include <linux/isa.h> |
34 | #include <asm/io.h> | 35 | #include <asm/io.h> |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index fedcd561ba27..92fc5a20fb76 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
@@ -615,7 +615,7 @@ int fimc_ctrls_create(struct fimc_ctx *ctx) | |||
615 | ctx->effect.type = FIMC_REG_CIIMGEFF_FIN_BYPASS; | 615 | ctx->effect.type = FIMC_REG_CIIMGEFF_FIN_BYPASS; |
616 | 616 | ||
617 | if (!handler->error) { | 617 | if (!handler->error) { |
618 | v4l2_ctrl_cluster(3, &ctrls->colorfx); | 618 | v4l2_ctrl_cluster(2, &ctrls->colorfx); |
619 | ctrls->ready = true; | 619 | ctrls->ready = true; |
620 | } | 620 | } |
621 | 621 | ||
diff --git a/drivers/media/video/s5p-mfc/regs-mfc.h b/drivers/media/video/s5p-mfc/regs-mfc.h index 053a8a872fd7..a19bece41ba9 100644 --- a/drivers/media/video/s5p-mfc/regs-mfc.h +++ b/drivers/media/video/s5p-mfc/regs-mfc.h | |||
@@ -164,10 +164,15 @@ | |||
164 | decoded pic */ | 164 | decoded pic */ |
165 | #define S5P_FIMV_SI_DISPLAY_Y_ADR 0x2010 /* luma addr of displayed pic */ | 165 | #define S5P_FIMV_SI_DISPLAY_Y_ADR 0x2010 /* luma addr of displayed pic */ |
166 | #define S5P_FIMV_SI_DISPLAY_C_ADR 0x2014 /* chroma addrof displayed pic */ | 166 | #define S5P_FIMV_SI_DISPLAY_C_ADR 0x2014 /* chroma addrof displayed pic */ |
167 | |||
167 | #define S5P_FIMV_SI_CONSUMED_BYTES 0x2018 /* Consumed number of bytes to | 168 | #define S5P_FIMV_SI_CONSUMED_BYTES 0x2018 /* Consumed number of bytes to |
168 | decode a frame */ | 169 | decode a frame */ |
169 | #define S5P_FIMV_SI_DISPLAY_STATUS 0x201c /* status of decoded picture */ | 170 | #define S5P_FIMV_SI_DISPLAY_STATUS 0x201c /* status of decoded picture */ |
170 | 171 | ||
172 | #define S5P_FIMV_SI_DECODE_Y_ADR 0x2024 /* luma addr of decoded pic */ | ||
173 | #define S5P_FIMV_SI_DECODE_C_ADR 0x2028 /* chroma addrof decoded pic */ | ||
174 | #define S5P_FIMV_SI_DECODE_STATUS 0x202c /* status of decoded picture */ | ||
175 | |||
171 | #define S5P_FIMV_SI_CH0_SB_ST_ADR 0x2044 /* start addr of stream buf */ | 176 | #define S5P_FIMV_SI_CH0_SB_ST_ADR 0x2044 /* start addr of stream buf */ |
172 | #define S5P_FIMV_SI_CH0_SB_FRM_SIZE 0x2048 /* size of stream buf */ | 177 | #define S5P_FIMV_SI_CH0_SB_FRM_SIZE 0x2048 /* size of stream buf */ |
173 | #define S5P_FIMV_SI_CH0_DESC_ADR 0x204c /* addr of descriptor buf */ | 178 | #define S5P_FIMV_SI_CH0_DESC_ADR 0x204c /* addr of descriptor buf */ |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c index c25ec022d267..4dd32fc8fd82 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c | |||
@@ -627,13 +627,13 @@ static int s5p_mfc_dec_s_ctrl(struct v4l2_ctrl *ctrl) | |||
627 | 627 | ||
628 | switch (ctrl->id) { | 628 | switch (ctrl->id) { |
629 | case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY: | 629 | case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY: |
630 | ctx->loop_filter_mpeg4 = ctrl->val; | 630 | ctx->display_delay = ctrl->val; |
631 | break; | 631 | break; |
632 | case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE: | 632 | case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE: |
633 | ctx->display_delay_enable = ctrl->val; | 633 | ctx->display_delay_enable = ctrl->val; |
634 | break; | 634 | break; |
635 | case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: | 635 | case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: |
636 | ctx->display_delay = ctrl->val; | 636 | ctx->loop_filter_mpeg4 = ctrl->val; |
637 | break; | 637 | break; |
638 | case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: | 638 | case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: |
639 | ctx->slice_interface = ctrl->val; | 639 | ctx->slice_interface = ctrl->val; |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c index acedb2004be3..03d83340e7fb 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c | |||
@@ -243,12 +243,6 @@ static struct mfc_control controls[] = { | |||
243 | .minimum = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, | 243 | .minimum = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, |
244 | .maximum = V4L2_MPEG_VIDEO_H264_LEVEL_4_0, | 244 | .maximum = V4L2_MPEG_VIDEO_H264_LEVEL_4_0, |
245 | .default_value = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, | 245 | .default_value = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, |
246 | .menu_skip_mask = ~( | ||
247 | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_1) | | ||
248 | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_2) | | ||
249 | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_5_0) | | ||
250 | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_5_1) | ||
251 | ), | ||
252 | }, | 246 | }, |
253 | { | 247 | { |
254 | .id = V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL, | 248 | .id = V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL, |
@@ -494,7 +488,7 @@ static struct mfc_control controls[] = { | |||
494 | .type = V4L2_CTRL_TYPE_MENU, | 488 | .type = V4L2_CTRL_TYPE_MENU, |
495 | .minimum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED, | 489 | .minimum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED, |
496 | .maximum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED, | 490 | .maximum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED, |
497 | .default_value = 0, | 491 | .default_value = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED, |
498 | .menu_skip_mask = 0, | 492 | .menu_skip_mask = 0, |
499 | }, | 493 | }, |
500 | { | 494 | { |
@@ -534,7 +528,7 @@ static struct mfc_control controls[] = { | |||
534 | .type = V4L2_CTRL_TYPE_MENU, | 528 | .type = V4L2_CTRL_TYPE_MENU, |
535 | .minimum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE, | 529 | .minimum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE, |
536 | .maximum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE, | 530 | .maximum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE, |
537 | .default_value = 0, | 531 | .default_value = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE, |
538 | .menu_skip_mask = 0, | 532 | .menu_skip_mask = 0, |
539 | }, | 533 | }, |
540 | { | 534 | { |
@@ -907,6 +901,8 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f) | |||
907 | mfc_err("failed to try output format\n"); | 901 | mfc_err("failed to try output format\n"); |
908 | return -EINVAL; | 902 | return -EINVAL; |
909 | } | 903 | } |
904 | v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1, | ||
905 | &pix_fmt_mp->height, 4, 1080, 1, 0); | ||
910 | } else { | 906 | } else { |
911 | mfc_err("invalid buf type\n"); | 907 | mfc_err("invalid buf type\n"); |
912 | return -EINVAL; | 908 | return -EINVAL; |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_opr.h b/drivers/media/video/s5p-mfc/s5p_mfc_opr.h index db83836e6a9f..5932d1c782c5 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_opr.h +++ b/drivers/media/video/s5p-mfc/s5p_mfc_opr.h | |||
@@ -57,10 +57,12 @@ void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq); | |||
57 | S5P_FIMV_SI_DISPLAY_Y_ADR) << \ | 57 | S5P_FIMV_SI_DISPLAY_Y_ADR) << \ |
58 | MFC_OFFSET_SHIFT) | 58 | MFC_OFFSET_SHIFT) |
59 | #define s5p_mfc_get_dec_y_adr() (readl(dev->regs_base + \ | 59 | #define s5p_mfc_get_dec_y_adr() (readl(dev->regs_base + \ |
60 | S5P_FIMV_SI_DISPLAY_Y_ADR) << \ | 60 | S5P_FIMV_SI_DECODE_Y_ADR) << \ |
61 | MFC_OFFSET_SHIFT) | 61 | MFC_OFFSET_SHIFT) |
62 | #define s5p_mfc_get_dspl_status() readl(dev->regs_base + \ | 62 | #define s5p_mfc_get_dspl_status() readl(dev->regs_base + \ |
63 | S5P_FIMV_SI_DISPLAY_STATUS) | 63 | S5P_FIMV_SI_DISPLAY_STATUS) |
64 | #define s5p_mfc_get_dec_status() readl(dev->regs_base + \ | ||
65 | S5P_FIMV_SI_DECODE_STATUS) | ||
64 | #define s5p_mfc_get_frame_type() (readl(dev->regs_base + \ | 66 | #define s5p_mfc_get_frame_type() (readl(dev->regs_base + \ |
65 | S5P_FIMV_DECODE_FRAME_TYPE) \ | 67 | S5P_FIMV_DECODE_FRAME_TYPE) \ |
66 | & S5P_FIMV_DECODE_FRAME_MASK) | 68 | & S5P_FIMV_DECODE_FRAME_MASK) |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_shm.h b/drivers/media/video/s5p-mfc/s5p_mfc_shm.h index 764eac6bcc4c..cf962a466276 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_shm.h +++ b/drivers/media/video/s5p-mfc/s5p_mfc_shm.h | |||
@@ -13,8 +13,7 @@ | |||
13 | #ifndef S5P_MFC_SHM_H_ | 13 | #ifndef S5P_MFC_SHM_H_ |
14 | #define S5P_MFC_SHM_H_ | 14 | #define S5P_MFC_SHM_H_ |
15 | 15 | ||
16 | enum MFC_SHM_OFS | 16 | enum MFC_SHM_OFS { |
17 | { | ||
18 | EXTENEDED_DECODE_STATUS = 0x00, /* D */ | 17 | EXTENEDED_DECODE_STATUS = 0x00, /* D */ |
19 | SET_FRAME_TAG = 0x04, /* D */ | 18 | SET_FRAME_TAG = 0x04, /* D */ |
20 | GET_FRAME_TAG_TOP = 0x08, /* D */ | 19 | GET_FRAME_TAG_TOP = 0x08, /* D */ |
diff --git a/drivers/media/video/smiapp/Kconfig b/drivers/media/video/smiapp/Kconfig index f7b35ff443bf..fb99ff18be07 100644 --- a/drivers/media/video/smiapp/Kconfig +++ b/drivers/media/video/smiapp/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config VIDEO_SMIAPP | 1 | config VIDEO_SMIAPP |
2 | tristate "SMIA++/SMIA sensor support" | 2 | tristate "SMIA++/SMIA sensor support" |
3 | depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API | 3 | depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAVE_CLK |
4 | select VIDEO_SMIAPP_PLL | 4 | select VIDEO_SMIAPP_PLL |
5 | ---help--- | 5 | ---help--- |
6 | This is a generic driver for SMIA++/SMIA camera modules. | 6 | This is a generic driver for SMIA++/SMIA camera modules. |
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c index f518026cb67b..e8c93c89265a 100644 --- a/drivers/media/video/smiapp/smiapp-core.c +++ b/drivers/media/video/smiapp/smiapp-core.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
34 | #include <linux/regulator/consumer.h> | 34 | #include <linux/regulator/consumer.h> |
35 | #include <linux/slab.h> | ||
35 | #include <linux/v4l2-mediabus.h> | 36 | #include <linux/v4l2-mediabus.h> |
36 | #include <media/v4l2-device.h> | 37 | #include <media/v4l2-device.h> |
37 | 38 | ||
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 3e050e12153b..1ad5ab6ce5cf 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -1178,7 +1178,7 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) | |||
1178 | return 0; | 1178 | return 0; |
1179 | if (vt->type == t->mode && analog_ops->get_afc) | 1179 | if (vt->type == t->mode && analog_ops->get_afc) |
1180 | vt->afc = analog_ops->get_afc(&t->fe); | 1180 | vt->afc = analog_ops->get_afc(&t->fe); |
1181 | if (t->mode != V4L2_TUNER_RADIO) { | 1181 | if (vt->type != V4L2_TUNER_RADIO) { |
1182 | vt->capability |= V4L2_TUNER_CAP_NORM; | 1182 | vt->capability |= V4L2_TUNER_CAP_NORM; |
1183 | vt->rangelow = tv_range[0] * 16; | 1183 | vt->rangelow = tv_range[0] * 16; |
1184 | vt->rangehigh = tv_range[1] * 16; | 1184 | vt->rangehigh = tv_range[1] * 16; |
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 5ccbd4629f9c..83dbb2ddff10 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -656,7 +656,7 @@ static void determine_valid_ioctls(struct video_device *vdev) | |||
656 | SET_VALID_IOCTL(ops, VIDIOC_TRY_ENCODER_CMD, vidioc_try_encoder_cmd); | 656 | SET_VALID_IOCTL(ops, VIDIOC_TRY_ENCODER_CMD, vidioc_try_encoder_cmd); |
657 | SET_VALID_IOCTL(ops, VIDIOC_DECODER_CMD, vidioc_decoder_cmd); | 657 | SET_VALID_IOCTL(ops, VIDIOC_DECODER_CMD, vidioc_decoder_cmd); |
658 | SET_VALID_IOCTL(ops, VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd); | 658 | SET_VALID_IOCTL(ops, VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd); |
659 | if (ops->vidioc_g_parm || vdev->current_norm) | 659 | if (ops->vidioc_g_parm || vdev->vfl_type == VFL_TYPE_GRABBER) |
660 | set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls); | 660 | set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls); |
661 | SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm); | 661 | SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm); |
662 | SET_VALID_IOCTL(ops, VIDIOC_G_TUNER, vidioc_g_tuner); | 662 | SET_VALID_IOCTL(ops, VIDIOC_G_TUNER, vidioc_g_tuner); |
@@ -679,6 +679,8 @@ static void determine_valid_ioctls(struct video_device *vdev) | |||
679 | SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_PRESET, vidioc_query_dv_preset); | 679 | SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_PRESET, vidioc_query_dv_preset); |
680 | SET_VALID_IOCTL(ops, VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings); | 680 | SET_VALID_IOCTL(ops, VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings); |
681 | SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings); | 681 | SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings); |
682 | SET_VALID_IOCTL(ops, VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings); | ||
683 | SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_TIMINGS, vidioc_query_dv_timings); | ||
682 | /* yes, really vidioc_subscribe_event */ | 684 | /* yes, really vidioc_subscribe_event */ |
683 | SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event); | 685 | SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event); |
684 | SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event); | 686 | SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event); |
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 91be4e871f43..d7fa8962d8b3 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -1680,6 +1680,7 @@ static long __video_do_ioctl(struct file *file, | |||
1680 | break; | 1680 | break; |
1681 | 1681 | ||
1682 | ret = 0; | 1682 | ret = 0; |
1683 | p->parm.capture.readbuffers = 2; | ||
1683 | if (ops->vidioc_g_std) | 1684 | if (ops->vidioc_g_std) |
1684 | ret = ops->vidioc_g_std(file, fh, &std); | 1685 | ret = ops->vidioc_g_std(file, fh, &std); |
1685 | if (ret == 0) | 1686 | if (ret == 0) |
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c index 4d7391ec8001..aae1720b2f2d 100644 --- a/drivers/media/video/vino.c +++ b/drivers/media/video/vino.c | |||
@@ -2561,7 +2561,7 @@ static int vino_acquire_input(struct vino_channel_settings *vcs) | |||
2561 | } else if (vino_drvdata->decoder | 2561 | } else if (vino_drvdata->decoder |
2562 | && (vino_drvdata->decoder_owner == VINO_NO_CHANNEL)) { | 2562 | && (vino_drvdata->decoder_owner == VINO_NO_CHANNEL)) { |
2563 | int input; | 2563 | int input; |
2564 | int data_norm; | 2564 | int data_norm = 0; |
2565 | v4l2_std_id norm; | 2565 | v4l2_std_id norm; |
2566 | 2566 | ||
2567 | input = VINO_INPUT_COMPOSITE; | 2567 | input = VINO_INPUT_COMPOSITE; |
@@ -2651,7 +2651,7 @@ static int vino_set_input(struct vino_channel_settings *vcs, int input) | |||
2651 | } | 2651 | } |
2652 | 2652 | ||
2653 | if (vino_drvdata->decoder_owner == vcs->channel) { | 2653 | if (vino_drvdata->decoder_owner == vcs->channel) { |
2654 | int data_norm; | 2654 | int data_norm = 0; |
2655 | v4l2_std_id norm; | 2655 | v4l2_std_id norm; |
2656 | 2656 | ||
2657 | ret = decoder_call(video, s_routing, | 2657 | ret = decoder_call(video, s_routing, |
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 0960d7f0d394..08c10240e70f 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -1149,10 +1149,14 @@ static ssize_t | |||
1149 | vivi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) | 1149 | vivi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) |
1150 | { | 1150 | { |
1151 | struct vivi_dev *dev = video_drvdata(file); | 1151 | struct vivi_dev *dev = video_drvdata(file); |
1152 | int err; | ||
1152 | 1153 | ||
1153 | dprintk(dev, 1, "read called\n"); | 1154 | dprintk(dev, 1, "read called\n"); |
1154 | return vb2_read(&dev->vb_vidq, data, count, ppos, | 1155 | mutex_lock(&dev->mutex); |
1156 | err = vb2_read(&dev->vb_vidq, data, count, ppos, | ||
1155 | file->f_flags & O_NONBLOCK); | 1157 | file->f_flags & O_NONBLOCK); |
1158 | mutex_unlock(&dev->mutex); | ||
1159 | return err; | ||
1156 | } | 1160 | } |
1157 | 1161 | ||
1158 | static unsigned int | 1162 | static unsigned int |
diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c index 373f423b1181..947a06a1845f 100644 --- a/drivers/mfd/stmpe-i2c.c +++ b/drivers/mfd/stmpe-i2c.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * License Terms: GNU General Public License, version 2 | 7 | * License Terms: GNU General Public License, version 2 |
8 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | 8 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson |
9 | * Author: Viresh Kumar <viresh.kumar@st.com> for ST Microelectronics | 9 | * Author: Viresh Kumar <viresh.linux@gmail.com> for ST Microelectronics |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/i2c.h> | 12 | #include <linux/i2c.h> |
diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c index afd459013ecb..9edfe864cc05 100644 --- a/drivers/mfd/stmpe-spi.c +++ b/drivers/mfd/stmpe-spi.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) ST Microelectronics SA 2011 | 4 | * Copyright (C) ST Microelectronics SA 2011 |
5 | * | 5 | * |
6 | * License Terms: GNU General Public License, version 2 | 6 | * License Terms: GNU General Public License, version 2 |
7 | * Author: Viresh Kumar <viresh.kumar@st.com> for ST Microelectronics | 7 | * Author: Viresh Kumar <viresh.linux@gmail.com> for ST Microelectronics |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/spi/spi.h> | 10 | #include <linux/spi/spi.h> |
@@ -146,4 +146,4 @@ module_exit(stmpe_exit); | |||
146 | 146 | ||
147 | MODULE_LICENSE("GPL v2"); | 147 | MODULE_LICENSE("GPL v2"); |
148 | MODULE_DESCRIPTION("STMPE MFD SPI Interface Driver"); | 148 | MODULE_DESCRIPTION("STMPE MFD SPI Interface Driver"); |
149 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 149 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 93936f1b75eb..23f5463d4cae 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -835,7 +835,7 @@ static int _mei_irq_thread_read(struct mei_device *dev, s32 *slots, | |||
835 | struct mei_cl *cl, | 835 | struct mei_cl *cl, |
836 | struct mei_io_list *cmpl_list) | 836 | struct mei_io_list *cmpl_list) |
837 | { | 837 | { |
838 | if ((*slots * sizeof(u32)) >= (sizeof(struct mei_msg_hdr) + | 838 | if ((*slots * sizeof(u32)) < (sizeof(struct mei_msg_hdr) + |
839 | sizeof(struct hbm_flow_control))) { | 839 | sizeof(struct hbm_flow_control))) { |
840 | /* return the cancel routine */ | 840 | /* return the cancel routine */ |
841 | list_del(&cb_pos->cb_list); | 841 | list_del(&cb_pos->cb_list); |
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index c70333228337..7de13891e49e 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -982,7 +982,7 @@ static int __devinit mei_probe(struct pci_dev *pdev, | |||
982 | err = request_threaded_irq(pdev->irq, | 982 | err = request_threaded_irq(pdev->irq, |
983 | NULL, | 983 | NULL, |
984 | mei_interrupt_thread_handler, | 984 | mei_interrupt_thread_handler, |
985 | 0, mei_driver_name, dev); | 985 | IRQF_ONESHOT, mei_driver_name, dev); |
986 | else | 986 | else |
987 | err = request_threaded_irq(pdev->irq, | 987 | err = request_threaded_irq(pdev->irq, |
988 | mei_interrupt_quick_handler, | 988 | mei_interrupt_quick_handler, |
@@ -992,7 +992,7 @@ static int __devinit mei_probe(struct pci_dev *pdev, | |||
992 | if (err) { | 992 | if (err) { |
993 | dev_err(&pdev->dev, "request_threaded_irq failure. irq = %d\n", | 993 | dev_err(&pdev->dev, "request_threaded_irq failure. irq = %d\n", |
994 | pdev->irq); | 994 | pdev->irq); |
995 | goto unmap_memory; | 995 | goto disable_msi; |
996 | } | 996 | } |
997 | INIT_DELAYED_WORK(&dev->timer_work, mei_timer); | 997 | INIT_DELAYED_WORK(&dev->timer_work, mei_timer); |
998 | if (mei_hw_init(dev)) { | 998 | if (mei_hw_init(dev)) { |
@@ -1023,8 +1023,8 @@ release_irq: | |||
1023 | mei_disable_interrupts(dev); | 1023 | mei_disable_interrupts(dev); |
1024 | flush_scheduled_work(); | 1024 | flush_scheduled_work(); |
1025 | free_irq(pdev->irq, dev); | 1025 | free_irq(pdev->irq, dev); |
1026 | disable_msi: | ||
1026 | pci_disable_msi(pdev); | 1027 | pci_disable_msi(pdev); |
1027 | unmap_memory: | ||
1028 | pci_iounmap(pdev, dev->mem_addr); | 1028 | pci_iounmap(pdev, dev->mem_addr); |
1029 | free_device: | 1029 | free_device: |
1030 | kfree(dev); | 1030 | kfree(dev); |
@@ -1101,6 +1101,8 @@ static void __devexit mei_remove(struct pci_dev *pdev) | |||
1101 | 1101 | ||
1102 | pci_release_regions(pdev); | 1102 | pci_release_regions(pdev); |
1103 | pci_disable_device(pdev); | 1103 | pci_disable_device(pdev); |
1104 | |||
1105 | misc_deregister(&mei_misc_device); | ||
1104 | } | 1106 | } |
1105 | #ifdef CONFIG_PM | 1107 | #ifdef CONFIG_PM |
1106 | static int mei_pci_suspend(struct device *device) | 1108 | static int mei_pci_suspend(struct device *device) |
@@ -1216,7 +1218,6 @@ module_init(mei_init_module); | |||
1216 | */ | 1218 | */ |
1217 | static void __exit mei_exit_module(void) | 1219 | static void __exit mei_exit_module(void) |
1218 | { | 1220 | { |
1219 | misc_deregister(&mei_misc_device); | ||
1220 | pci_unregister_driver(&mei_driver); | 1221 | pci_unregister_driver(&mei_driver); |
1221 | 1222 | ||
1222 | pr_debug("unloaded successfully.\n"); | 1223 | pr_debug("unloaded successfully.\n"); |
diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c index 6be5605707b4..e2ec0505eb5c 100644 --- a/drivers/misc/mei/wd.c +++ b/drivers/misc/mei/wd.c | |||
@@ -341,7 +341,7 @@ static const struct watchdog_ops wd_ops = { | |||
341 | }; | 341 | }; |
342 | static const struct watchdog_info wd_info = { | 342 | static const struct watchdog_info wd_info = { |
343 | .identity = INTEL_AMT_WATCHDOG_ID, | 343 | .identity = INTEL_AMT_WATCHDOG_ID, |
344 | .options = WDIOF_KEEPALIVEPING, | 344 | .options = WDIOF_KEEPALIVEPING | WDIOF_ALARMONLY, |
345 | }; | 345 | }; |
346 | 346 | ||
347 | static struct watchdog_device amt_wd_dev = { | 347 | static struct watchdog_device amt_wd_dev = { |
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index dd2d374dcc7a..276d21ce6bc1 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -554,7 +554,6 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) | |||
554 | struct mmc_request mrq = {NULL}; | 554 | struct mmc_request mrq = {NULL}; |
555 | struct mmc_command cmd = {0}; | 555 | struct mmc_command cmd = {0}; |
556 | struct mmc_data data = {0}; | 556 | struct mmc_data data = {0}; |
557 | unsigned int timeout_us; | ||
558 | 557 | ||
559 | struct scatterlist sg; | 558 | struct scatterlist sg; |
560 | 559 | ||
@@ -574,23 +573,12 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) | |||
574 | cmd.arg = 0; | 573 | cmd.arg = 0; |
575 | cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; | 574 | cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; |
576 | 575 | ||
577 | data.timeout_ns = card->csd.tacc_ns * 100; | ||
578 | data.timeout_clks = card->csd.tacc_clks * 100; | ||
579 | |||
580 | timeout_us = data.timeout_ns / 1000; | ||
581 | timeout_us += data.timeout_clks * 1000 / | ||
582 | (card->host->ios.clock / 1000); | ||
583 | |||
584 | if (timeout_us > 100000) { | ||
585 | data.timeout_ns = 100000000; | ||
586 | data.timeout_clks = 0; | ||
587 | } | ||
588 | |||
589 | data.blksz = 4; | 576 | data.blksz = 4; |
590 | data.blocks = 1; | 577 | data.blocks = 1; |
591 | data.flags = MMC_DATA_READ; | 578 | data.flags = MMC_DATA_READ; |
592 | data.sg = &sg; | 579 | data.sg = &sg; |
593 | data.sg_len = 1; | 580 | data.sg_len = 1; |
581 | mmc_set_data_timeout(&data, card); | ||
594 | 582 | ||
595 | mrq.cmd = &cmd; | 583 | mrq.cmd = &cmd; |
596 | mrq.data = &data; | 584 | mrq.data = &data; |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f0fcce40cd8d..50ff19a62368 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -1216,12 +1216,7 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np, | |||
1216 | int bus_width = 0; | 1216 | int bus_width = 0; |
1217 | 1217 | ||
1218 | pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0); | 1218 | pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0); |
1219 | if (!pdata->gpio_wp) | ||
1220 | pdata->gpio_wp = -1; | ||
1221 | |||
1222 | pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0); | 1219 | pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0); |
1223 | if (!pdata->gpio_cd) | ||
1224 | pdata->gpio_cd = -1; | ||
1225 | 1220 | ||
1226 | if (of_get_property(np, "cd-inverted", NULL)) | 1221 | if (of_get_property(np, "cd-inverted", NULL)) |
1227 | pdata->cd_invert = true; | 1222 | pdata->cd_invert = true; |
@@ -1276,6 +1271,12 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
1276 | return -EINVAL; | 1271 | return -EINVAL; |
1277 | } | 1272 | } |
1278 | 1273 | ||
1274 | if (!plat) { | ||
1275 | plat = devm_kzalloc(&dev->dev, sizeof(*plat), GFP_KERNEL); | ||
1276 | if (!plat) | ||
1277 | return -ENOMEM; | ||
1278 | } | ||
1279 | |||
1279 | if (np) | 1280 | if (np) |
1280 | mmci_dt_populate_generic_pdata(np, plat); | 1281 | mmci_dt_populate_generic_pdata(np, plat); |
1281 | 1282 | ||
@@ -1424,6 +1425,10 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
1424 | writel(0, host->base + MMCIMASK1); | 1425 | writel(0, host->base + MMCIMASK1); |
1425 | writel(0xfff, host->base + MMCICLEAR); | 1426 | writel(0xfff, host->base + MMCICLEAR); |
1426 | 1427 | ||
1428 | if (plat->gpio_cd == -EPROBE_DEFER) { | ||
1429 | ret = -EPROBE_DEFER; | ||
1430 | goto err_gpio_cd; | ||
1431 | } | ||
1427 | if (gpio_is_valid(plat->gpio_cd)) { | 1432 | if (gpio_is_valid(plat->gpio_cd)) { |
1428 | ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)"); | 1433 | ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)"); |
1429 | if (ret == 0) | 1434 | if (ret == 0) |
@@ -1447,6 +1452,10 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
1447 | if (ret >= 0) | 1452 | if (ret >= 0) |
1448 | host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); | 1453 | host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); |
1449 | } | 1454 | } |
1455 | if (plat->gpio_wp == -EPROBE_DEFER) { | ||
1456 | ret = -EPROBE_DEFER; | ||
1457 | goto err_gpio_wp; | ||
1458 | } | ||
1450 | if (gpio_is_valid(plat->gpio_wp)) { | 1459 | if (gpio_is_valid(plat->gpio_wp)) { |
1451 | ret = gpio_request(plat->gpio_wp, DRIVER_NAME " (wp)"); | 1460 | ret = gpio_request(plat->gpio_wp, DRIVER_NAME " (wp)"); |
1452 | if (ret == 0) | 1461 | if (ret == 0) |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 9a7a60aeb19e..389a3eedfc24 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -85,7 +85,6 @@ | |||
85 | #define BRR_ENABLE (1 << 5) | 85 | #define BRR_ENABLE (1 << 5) |
86 | #define DTO_ENABLE (1 << 20) | 86 | #define DTO_ENABLE (1 << 20) |
87 | #define INIT_STREAM (1 << 1) | 87 | #define INIT_STREAM (1 << 1) |
88 | #define ACEN_ACMD12 (1 << 2) | ||
89 | #define DP_SELECT (1 << 21) | 88 | #define DP_SELECT (1 << 21) |
90 | #define DDIR (1 << 4) | 89 | #define DDIR (1 << 4) |
91 | #define DMA_EN 0x1 | 90 | #define DMA_EN 0x1 |
@@ -117,7 +116,6 @@ | |||
117 | #define OMAP_MMC_MAX_CLOCK 52000000 | 116 | #define OMAP_MMC_MAX_CLOCK 52000000 |
118 | #define DRIVER_NAME "omap_hsmmc" | 117 | #define DRIVER_NAME "omap_hsmmc" |
119 | 118 | ||
120 | #define AUTO_CMD12 (1 << 0) /* Auto CMD12 support */ | ||
121 | /* | 119 | /* |
122 | * One controller can have multiple slots, like on some omap boards using | 120 | * One controller can have multiple slots, like on some omap boards using |
123 | * omap.c controller driver. Luckily this is not currently done on any known | 121 | * omap.c controller driver. Luckily this is not currently done on any known |
@@ -177,7 +175,6 @@ struct omap_hsmmc_host { | |||
177 | int reqs_blocked; | 175 | int reqs_blocked; |
178 | int use_reg; | 176 | int use_reg; |
179 | int req_in_progress; | 177 | int req_in_progress; |
180 | unsigned int flags; | ||
181 | struct omap_hsmmc_next next_data; | 178 | struct omap_hsmmc_next next_data; |
182 | 179 | ||
183 | struct omap_mmc_platform_data *pdata; | 180 | struct omap_mmc_platform_data *pdata; |
@@ -773,8 +770,6 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd, | |||
773 | cmdtype = 0x3; | 770 | cmdtype = 0x3; |
774 | 771 | ||
775 | cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22); | 772 | cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22); |
776 | if ((host->flags & AUTO_CMD12) && mmc_op_multi(cmd->opcode)) | ||
777 | cmdreg |= ACEN_ACMD12; | ||
778 | 773 | ||
779 | if (data) { | 774 | if (data) { |
780 | cmdreg |= DP_SELECT | MSBS | BCE; | 775 | cmdreg |= DP_SELECT | MSBS | BCE; |
@@ -847,14 +842,11 @@ omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data) | |||
847 | else | 842 | else |
848 | data->bytes_xfered = 0; | 843 | data->bytes_xfered = 0; |
849 | 844 | ||
850 | if (data->stop && ((!(host->flags & AUTO_CMD12)) || data->error)) { | 845 | if (!data->stop) { |
851 | omap_hsmmc_start_command(host, data->stop, NULL); | ||
852 | } else { | ||
853 | if (data->stop) | ||
854 | data->stop->resp[0] = OMAP_HSMMC_READ(host->base, | ||
855 | RSP76); | ||
856 | omap_hsmmc_request_done(host, data->mrq); | 846 | omap_hsmmc_request_done(host, data->mrq); |
847 | return; | ||
857 | } | 848 | } |
849 | omap_hsmmc_start_command(host, data->stop, NULL); | ||
858 | } | 850 | } |
859 | 851 | ||
860 | /* | 852 | /* |
@@ -1859,7 +1851,6 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev) | |||
1859 | host->mapbase = res->start + pdata->reg_offset; | 1851 | host->mapbase = res->start + pdata->reg_offset; |
1860 | host->base = ioremap(host->mapbase, SZ_4K); | 1852 | host->base = ioremap(host->mapbase, SZ_4K); |
1861 | host->power_mode = MMC_POWER_OFF; | 1853 | host->power_mode = MMC_POWER_OFF; |
1862 | host->flags = AUTO_CMD12; | ||
1863 | host->next_data.cookie = 1; | 1854 | host->next_data.cookie = 1; |
1864 | 1855 | ||
1865 | platform_set_drvdata(pdev, host); | 1856 | platform_set_drvdata(pdev, host); |
diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c index 1fe32dfa7cd4..423da8194cd8 100644 --- a/drivers/mmc/host/sdhci-spear.c +++ b/drivers/mmc/host/sdhci-spear.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Support of SDHCI platform devices for spear soc family | 4 | * Support of SDHCI platform devices for spear soc family |
5 | * | 5 | * |
6 | * Copyright (C) 2010 ST Microelectronics | 6 | * Copyright (C) 2010 ST Microelectronics |
7 | * Viresh Kumar<viresh.kumar@st.com> | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
8 | * | 8 | * |
9 | * Inspired by sdhci-pltfm.c | 9 | * Inspired by sdhci-pltfm.c |
10 | * | 10 | * |
@@ -289,5 +289,5 @@ static struct platform_driver sdhci_driver = { | |||
289 | module_platform_driver(sdhci_driver); | 289 | module_platform_driver(sdhci_driver); |
290 | 290 | ||
291 | MODULE_DESCRIPTION("SPEAr Secure Digital Host Controller Interface driver"); | 291 | MODULE_DESCRIPTION("SPEAr Secure Digital Host Controller Interface driver"); |
292 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 292 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
293 | MODULE_LICENSE("GPL v2"); | 293 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index ae36d7e1e913..551e316e4454 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c | |||
@@ -304,32 +304,17 @@ static void find_next_position(struct mtdoops_context *cxt) | |||
304 | } | 304 | } |
305 | 305 | ||
306 | static void mtdoops_do_dump(struct kmsg_dumper *dumper, | 306 | static void mtdoops_do_dump(struct kmsg_dumper *dumper, |
307 | enum kmsg_dump_reason reason, const char *s1, unsigned long l1, | 307 | enum kmsg_dump_reason reason) |
308 | const char *s2, unsigned long l2) | ||
309 | { | 308 | { |
310 | struct mtdoops_context *cxt = container_of(dumper, | 309 | struct mtdoops_context *cxt = container_of(dumper, |
311 | struct mtdoops_context, dump); | 310 | struct mtdoops_context, dump); |
312 | unsigned long s1_start, s2_start; | ||
313 | unsigned long l1_cpy, l2_cpy; | ||
314 | char *dst; | ||
315 | |||
316 | if (reason != KMSG_DUMP_OOPS && | ||
317 | reason != KMSG_DUMP_PANIC) | ||
318 | return; | ||
319 | 311 | ||
320 | /* Only dump oopses if dump_oops is set */ | 312 | /* Only dump oopses if dump_oops is set */ |
321 | if (reason == KMSG_DUMP_OOPS && !dump_oops) | 313 | if (reason == KMSG_DUMP_OOPS && !dump_oops) |
322 | return; | 314 | return; |
323 | 315 | ||
324 | dst = cxt->oops_buf + MTDOOPS_HEADER_SIZE; /* Skip the header */ | 316 | kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE, |
325 | l2_cpy = min(l2, record_size - MTDOOPS_HEADER_SIZE); | 317 | record_size - MTDOOPS_HEADER_SIZE, NULL); |
326 | l1_cpy = min(l1, record_size - MTDOOPS_HEADER_SIZE - l2_cpy); | ||
327 | |||
328 | s2_start = l2 - l2_cpy; | ||
329 | s1_start = l1 - l1_cpy; | ||
330 | |||
331 | memcpy(dst, s1 + s1_start, l1_cpy); | ||
332 | memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy); | ||
333 | 318 | ||
334 | /* Panics must be written immediately */ | 319 | /* Panics must be written immediately */ |
335 | if (reason != KMSG_DUMP_OOPS) | 320 | if (reason != KMSG_DUMP_OOPS) |
@@ -375,6 +360,7 @@ static void mtdoops_notify_add(struct mtd_info *mtd) | |||
375 | return; | 360 | return; |
376 | } | 361 | } |
377 | 362 | ||
363 | cxt->dump.max_reason = KMSG_DUMP_OOPS; | ||
378 | cxt->dump.dump = mtdoops_do_dump; | 364 | cxt->dump.dump = mtdoops_do_dump; |
379 | err = kmsg_dump_register(&cxt->dump); | 365 | err = kmsg_dump_register(&cxt->dump); |
380 | if (err) { | 366 | if (err) { |
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index 41371ba1a811..f3f6cfedd69e 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c | |||
@@ -102,7 +102,7 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; | |||
102 | static int cafe_device_ready(struct mtd_info *mtd) | 102 | static int cafe_device_ready(struct mtd_info *mtd) |
103 | { | 103 | { |
104 | struct cafe_priv *cafe = mtd->priv; | 104 | struct cafe_priv *cafe = mtd->priv; |
105 | int result = !!(cafe_readl(cafe, NAND_STATUS) | 0x40000000); | 105 | int result = !!(cafe_readl(cafe, NAND_STATUS) & 0x40000000); |
106 | uint32_t irqs = cafe_readl(cafe, NAND_IRQ); | 106 | uint32_t irqs = cafe_readl(cafe, NAND_IRQ); |
107 | 107 | ||
108 | cafe_writel(cafe, irqs, NAND_IRQ); | 108 | cafe_writel(cafe, irqs, NAND_IRQ); |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index d47586cf64ce..a11253a0fcab 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -3501,6 +3501,13 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3501 | /* propagate ecc info to mtd_info */ | 3501 | /* propagate ecc info to mtd_info */ |
3502 | mtd->ecclayout = chip->ecc.layout; | 3502 | mtd->ecclayout = chip->ecc.layout; |
3503 | mtd->ecc_strength = chip->ecc.strength; | 3503 | mtd->ecc_strength = chip->ecc.strength; |
3504 | /* | ||
3505 | * Initialize bitflip_threshold to its default prior scan_bbt() call. | ||
3506 | * scan_bbt() might invoke mtd_read(), thus bitflip_threshold must be | ||
3507 | * properly set. | ||
3508 | */ | ||
3509 | if (!mtd->bitflip_threshold) | ||
3510 | mtd->bitflip_threshold = mtd->ecc_strength; | ||
3504 | 3511 | ||
3505 | /* Check, if we should skip the bad block table scan */ | 3512 | /* Check, if we should skip the bad block table scan */ |
3506 | if (chip->options & NAND_SKIP_BBTSCAN) | 3513 | if (chip->options & NAND_SKIP_BBTSCAN) |
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index 09d4f8d9d592..7c1380305219 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c | |||
@@ -264,7 +264,7 @@ static struct dentry *dfs_rootdir; | |||
264 | */ | 264 | */ |
265 | int ubi_debugfs_init(void) | 265 | int ubi_debugfs_init(void) |
266 | { | 266 | { |
267 | if (!IS_ENABLED(DEBUG_FS)) | 267 | if (!IS_ENABLED(CONFIG_DEBUG_FS)) |
268 | return 0; | 268 | return 0; |
269 | 269 | ||
270 | dfs_rootdir = debugfs_create_dir("ubi", NULL); | 270 | dfs_rootdir = debugfs_create_dir("ubi", NULL); |
@@ -284,7 +284,7 @@ int ubi_debugfs_init(void) | |||
284 | */ | 284 | */ |
285 | void ubi_debugfs_exit(void) | 285 | void ubi_debugfs_exit(void) |
286 | { | 286 | { |
287 | if (IS_ENABLED(DEBUG_FS)) | 287 | if (IS_ENABLED(CONFIG_DEBUG_FS)) |
288 | debugfs_remove(dfs_rootdir); | 288 | debugfs_remove(dfs_rootdir); |
289 | } | 289 | } |
290 | 290 | ||
@@ -407,7 +407,7 @@ int ubi_debugfs_init_dev(struct ubi_device *ubi) | |||
407 | struct dentry *dent; | 407 | struct dentry *dent; |
408 | struct ubi_debug_info *d = ubi->dbg; | 408 | struct ubi_debug_info *d = ubi->dbg; |
409 | 409 | ||
410 | if (!IS_ENABLED(DEBUG_FS)) | 410 | if (!IS_ENABLED(CONFIG_DEBUG_FS)) |
411 | return 0; | 411 | return 0; |
412 | 412 | ||
413 | n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME, | 413 | n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME, |
@@ -477,6 +477,6 @@ out: | |||
477 | */ | 477 | */ |
478 | void ubi_debugfs_exit_dev(struct ubi_device *ubi) | 478 | void ubi_debugfs_exit_dev(struct ubi_device *ubi) |
479 | { | 479 | { |
480 | if (IS_ENABLED(DEBUG_FS)) | 480 | if (IS_ENABLED(CONFIG_DEBUG_FS)) |
481 | debugfs_remove_recursive(ubi->dbg->dfs_dir); | 481 | debugfs_remove_recursive(ubi->dbg->dfs_dir); |
482 | } | 482 | } |
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c index ad284baafe87..3cea38d37344 100644 --- a/drivers/net/bonding/bond_procfs.c +++ b/drivers/net/bonding/bond_procfs.c | |||
@@ -150,14 +150,25 @@ static void bond_info_show_master(struct seq_file *seq) | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | static const char *bond_slave_link_status(s8 link) | ||
154 | { | ||
155 | static const char * const status[] = { | ||
156 | [BOND_LINK_UP] = "up", | ||
157 | [BOND_LINK_FAIL] = "going down", | ||
158 | [BOND_LINK_DOWN] = "down", | ||
159 | [BOND_LINK_BACK] = "going back", | ||
160 | }; | ||
161 | |||
162 | return status[link]; | ||
163 | } | ||
164 | |||
153 | static void bond_info_show_slave(struct seq_file *seq, | 165 | static void bond_info_show_slave(struct seq_file *seq, |
154 | const struct slave *slave) | 166 | const struct slave *slave) |
155 | { | 167 | { |
156 | struct bonding *bond = seq->private; | 168 | struct bonding *bond = seq->private; |
157 | 169 | ||
158 | seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); | 170 | seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); |
159 | seq_printf(seq, "MII Status: %s\n", | 171 | seq_printf(seq, "MII Status: %s\n", bond_slave_link_status(slave->link)); |
160 | (slave->link == BOND_LINK_UP) ? "up" : "down"); | ||
161 | if (slave->speed == SPEED_UNKNOWN) | 172 | if (slave->speed == SPEED_UNKNOWN) |
162 | seq_printf(seq, "Speed: %s\n", "Unknown"); | 173 | seq_printf(seq, "Speed: %s\n", "Unknown"); |
163 | else | 174 | else |
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 1520814c77c7..4a27adb7ae67 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c | |||
@@ -693,8 +693,6 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi) | |||
693 | */ | 693 | */ |
694 | memcpy(rx_buf, (u8 *)piggy_desc, | 694 | memcpy(rx_buf, (u8 *)piggy_desc, |
695 | CFHSI_DESC_SHORT_SZ); | 695 | CFHSI_DESC_SHORT_SZ); |
696 | /* Mark no embedded frame here */ | ||
697 | piggy_desc->offset = 0; | ||
698 | if (desc_pld_len == -EPROTO) | 696 | if (desc_pld_len == -EPROTO) |
699 | goto out_of_sync; | 697 | goto out_of_sync; |
700 | } | 698 | } |
@@ -737,6 +735,8 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi) | |||
737 | /* Extract any payload in piggyback descriptor. */ | 735 | /* Extract any payload in piggyback descriptor. */ |
738 | if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0) | 736 | if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0) |
739 | goto out_of_sync; | 737 | goto out_of_sync; |
738 | /* Mark no embedded frame after extracting it */ | ||
739 | piggy_desc->offset = 0; | ||
740 | } | 740 | } |
741 | } | 741 | } |
742 | 742 | ||
@@ -1178,6 +1178,7 @@ int cfhsi_probe(struct platform_device *pdev) | |||
1178 | dev_err(&ndev->dev, "%s: Registration error: %d.\n", | 1178 | dev_err(&ndev->dev, "%s: Registration error: %d.\n", |
1179 | __func__, res); | 1179 | __func__, res); |
1180 | free_netdev(ndev); | 1180 | free_netdev(ndev); |
1181 | return -ENODEV; | ||
1181 | } | 1182 | } |
1182 | /* Add CAIF HSI device to list. */ | 1183 | /* Add CAIF HSI device to list. */ |
1183 | spin_lock(&cfhsi_list_lock); | 1184 | spin_lock(&cfhsi_list_lock); |
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index 8dc84d66eea1..86cd532c78f9 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c | |||
@@ -590,8 +590,8 @@ static void c_can_chip_config(struct net_device *dev) | |||
590 | priv->write_reg(priv, &priv->regs->control, | 590 | priv->write_reg(priv, &priv->regs->control, |
591 | CONTROL_ENABLE_AR); | 591 | CONTROL_ENABLE_AR); |
592 | 592 | ||
593 | if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY & | 593 | if ((priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) && |
594 | CAN_CTRLMODE_LOOPBACK)) { | 594 | (priv->can.ctrlmode & CAN_CTRLMODE_LOOPBACK)) { |
595 | /* loopback + silent mode : useful for hot self-test */ | 595 | /* loopback + silent mode : useful for hot self-test */ |
596 | priv->write_reg(priv, &priv->regs->control, CONTROL_EIE | | 596 | priv->write_reg(priv, &priv->regs->control, CONTROL_EIE | |
597 | CONTROL_SIE | CONTROL_IE | CONTROL_TEST); | 597 | CONTROL_SIE | CONTROL_IE | CONTROL_TEST); |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 38c0690df5c8..81d474102378 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -939,12 +939,12 @@ static int __devinit flexcan_probe(struct platform_device *pdev) | |||
939 | return PTR_ERR(pinctrl); | 939 | return PTR_ERR(pinctrl); |
940 | 940 | ||
941 | if (pdev->dev.of_node) { | 941 | if (pdev->dev.of_node) { |
942 | const u32 *clock_freq_p; | 942 | const __be32 *clock_freq_p; |
943 | 943 | ||
944 | clock_freq_p = of_get_property(pdev->dev.of_node, | 944 | clock_freq_p = of_get_property(pdev->dev.of_node, |
945 | "clock-frequency", NULL); | 945 | "clock-frequency", NULL); |
946 | if (clock_freq_p) | 946 | if (clock_freq_p) |
947 | clock_freq = *clock_freq_p; | 947 | clock_freq = be32_to_cpup(clock_freq_p); |
948 | } | 948 | } |
949 | 949 | ||
950 | if (!clock_freq) { | 950 | if (!clock_freq) { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index cbc56f274e0c..8098eea9704d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -190,7 +190,7 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata) | |||
190 | 190 | ||
191 | if ((netif_tx_queue_stopped(txq)) && | 191 | if ((netif_tx_queue_stopped(txq)) && |
192 | (bp->state == BNX2X_STATE_OPEN) && | 192 | (bp->state == BNX2X_STATE_OPEN) && |
193 | (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3)) | 193 | (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4)) |
194 | netif_tx_wake_queue(txq); | 194 | netif_tx_wake_queue(txq); |
195 | 195 | ||
196 | __netif_tx_unlock(txq); | 196 | __netif_tx_unlock(txq); |
@@ -2516,8 +2516,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget) | |||
2516 | /* we split the first BD into headers and data BDs | 2516 | /* we split the first BD into headers and data BDs |
2517 | * to ease the pain of our fellow microcode engineers | 2517 | * to ease the pain of our fellow microcode engineers |
2518 | * we use one mapping for both BDs | 2518 | * we use one mapping for both BDs |
2519 | * So far this has only been observed to happen | ||
2520 | * in Other Operating Systems(TM) | ||
2521 | */ | 2519 | */ |
2522 | static noinline u16 bnx2x_tx_split(struct bnx2x *bp, | 2520 | static noinline u16 bnx2x_tx_split(struct bnx2x *bp, |
2523 | struct bnx2x_fp_txdata *txdata, | 2521 | struct bnx2x_fp_txdata *txdata, |
@@ -3171,7 +3169,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3171 | 3169 | ||
3172 | txdata->tx_bd_prod += nbd; | 3170 | txdata->tx_bd_prod += nbd; |
3173 | 3171 | ||
3174 | if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 3)) { | 3172 | if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 4)) { |
3175 | netif_tx_stop_queue(txq); | 3173 | netif_tx_stop_queue(txq); |
3176 | 3174 | ||
3177 | /* paired memory barrier is in bnx2x_tx_int(), we have to keep | 3175 | /* paired memory barrier is in bnx2x_tx_int(), we have to keep |
@@ -3180,7 +3178,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3180 | smp_mb(); | 3178 | smp_mb(); |
3181 | 3179 | ||
3182 | fp->eth_q_stats.driver_xoff++; | 3180 | fp->eth_q_stats.driver_xoff++; |
3183 | if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3) | 3181 | if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4) |
3184 | netif_tx_wake_queue(txq); | 3182 | netif_tx_wake_queue(txq); |
3185 | } | 3183 | } |
3186 | txdata->tx_pkt++; | 3184 | txdata->tx_pkt++; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index a3fb7215cd89..6e7d5c0843b4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #define I2C_BSC0 0 | 40 | #define I2C_BSC0 0 |
41 | #define I2C_BSC1 1 | 41 | #define I2C_BSC1 1 |
42 | #define I2C_WA_RETRY_CNT 3 | 42 | #define I2C_WA_RETRY_CNT 3 |
43 | #define I2C_WA_PWR_ITER (I2C_WA_RETRY_CNT - 1) | ||
43 | #define MCPR_IMC_COMMAND_READ_OP 1 | 44 | #define MCPR_IMC_COMMAND_READ_OP 1 |
44 | #define MCPR_IMC_COMMAND_WRITE_OP 2 | 45 | #define MCPR_IMC_COMMAND_WRITE_OP 2 |
45 | 46 | ||
@@ -7659,6 +7660,28 @@ static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy, | |||
7659 | return -EINVAL; | 7660 | return -EINVAL; |
7660 | } | 7661 | } |
7661 | 7662 | ||
7663 | static void bnx2x_warpcore_power_module(struct link_params *params, | ||
7664 | struct bnx2x_phy *phy, | ||
7665 | u8 power) | ||
7666 | { | ||
7667 | u32 pin_cfg; | ||
7668 | struct bnx2x *bp = params->bp; | ||
7669 | |||
7670 | pin_cfg = (REG_RD(bp, params->shmem_base + | ||
7671 | offsetof(struct shmem_region, | ||
7672 | dev_info.port_hw_config[params->port].e3_sfp_ctrl)) & | ||
7673 | PORT_HW_CFG_E3_PWR_DIS_MASK) >> | ||
7674 | PORT_HW_CFG_E3_PWR_DIS_SHIFT; | ||
7675 | |||
7676 | if (pin_cfg == PIN_CFG_NA) | ||
7677 | return; | ||
7678 | DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n", | ||
7679 | power, pin_cfg); | ||
7680 | /* Low ==> corresponding SFP+ module is powered | ||
7681 | * high ==> the SFP+ module is powered down | ||
7682 | */ | ||
7683 | bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1); | ||
7684 | } | ||
7662 | static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, | 7685 | static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, |
7663 | struct link_params *params, | 7686 | struct link_params *params, |
7664 | u16 addr, u8 byte_cnt, | 7687 | u16 addr, u8 byte_cnt, |
@@ -7678,6 +7701,12 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, | |||
7678 | /* 4 byte aligned address */ | 7701 | /* 4 byte aligned address */ |
7679 | addr32 = addr & (~0x3); | 7702 | addr32 = addr & (~0x3); |
7680 | do { | 7703 | do { |
7704 | if (cnt == I2C_WA_PWR_ITER) { | ||
7705 | bnx2x_warpcore_power_module(params, phy, 0); | ||
7706 | /* Note that 100us are not enough here */ | ||
7707 | usleep_range(1000,1000); | ||
7708 | bnx2x_warpcore_power_module(params, phy, 1); | ||
7709 | } | ||
7681 | rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt, | 7710 | rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt, |
7682 | data_array); | 7711 | data_array); |
7683 | } while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT)); | 7712 | } while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT)); |
@@ -8200,29 +8229,6 @@ static void bnx2x_set_sfp_module_fault_led(struct link_params *params, | |||
8200 | bnx2x_set_e1e2_module_fault_led(params, gpio_mode); | 8229 | bnx2x_set_e1e2_module_fault_led(params, gpio_mode); |
8201 | } | 8230 | } |
8202 | 8231 | ||
8203 | static void bnx2x_warpcore_power_module(struct link_params *params, | ||
8204 | struct bnx2x_phy *phy, | ||
8205 | u8 power) | ||
8206 | { | ||
8207 | u32 pin_cfg; | ||
8208 | struct bnx2x *bp = params->bp; | ||
8209 | |||
8210 | pin_cfg = (REG_RD(bp, params->shmem_base + | ||
8211 | offsetof(struct shmem_region, | ||
8212 | dev_info.port_hw_config[params->port].e3_sfp_ctrl)) & | ||
8213 | PORT_HW_CFG_E3_PWR_DIS_MASK) >> | ||
8214 | PORT_HW_CFG_E3_PWR_DIS_SHIFT; | ||
8215 | |||
8216 | if (pin_cfg == PIN_CFG_NA) | ||
8217 | return; | ||
8218 | DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n", | ||
8219 | power, pin_cfg); | ||
8220 | /* Low ==> corresponding SFP+ module is powered | ||
8221 | * high ==> the SFP+ module is powered down | ||
8222 | */ | ||
8223 | bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1); | ||
8224 | } | ||
8225 | |||
8226 | static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy, | 8232 | static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy, |
8227 | struct link_params *params) | 8233 | struct link_params *params) |
8228 | { | 8234 | { |
@@ -9748,7 +9754,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, | |||
9748 | 9754 | ||
9749 | msleep(1); | 9755 | msleep(1); |
9750 | 9756 | ||
9751 | if (!(CHIP_IS_E1(bp))) | 9757 | if (!(CHIP_IS_E1x(bp))) |
9752 | port = BP_PATH(bp); | 9758 | port = BP_PATH(bp); |
9753 | else | 9759 | else |
9754 | port = params->port; | 9760 | port = params->port; |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 8d06ea381741..921c2082af4c 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -122,15 +122,15 @@ static int be_mcc_compl_process(struct be_adapter *adapter, | |||
122 | goto done; | 122 | goto done; |
123 | 123 | ||
124 | if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) { | 124 | if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) { |
125 | dev_warn(&adapter->pdev->dev, "This domain(VM) is not " | 125 | dev_warn(&adapter->pdev->dev, |
126 | "permitted to execute this cmd (opcode %d)\n", | 126 | "opcode %d-%d is not permitted\n", |
127 | opcode); | 127 | opcode, subsystem); |
128 | } else { | 128 | } else { |
129 | extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) & | 129 | extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) & |
130 | CQE_STATUS_EXTD_MASK; | 130 | CQE_STATUS_EXTD_MASK; |
131 | dev_err(&adapter->pdev->dev, "Cmd (opcode %d) failed:" | 131 | dev_err(&adapter->pdev->dev, |
132 | "status %d, extd-status %d\n", | 132 | "opcode %d-%d failed:status %d-%d\n", |
133 | opcode, compl_status, extd_status); | 133 | opcode, subsystem, compl_status, extd_status); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | done: | 136 | done: |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h index 9625bf420c16..b3f3fc3d1323 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.h +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h | |||
@@ -1566,7 +1566,7 @@ struct be_hw_stats_v1 { | |||
1566 | u32 rsvd0[BE_TXP_SW_SZ]; | 1566 | u32 rsvd0[BE_TXP_SW_SZ]; |
1567 | struct be_erx_stats_v1 erx; | 1567 | struct be_erx_stats_v1 erx; |
1568 | struct be_pmem_stats pmem; | 1568 | struct be_pmem_stats pmem; |
1569 | u32 rsvd1[3]; | 1569 | u32 rsvd1[18]; |
1570 | }; | 1570 | }; |
1571 | 1571 | ||
1572 | struct be_cmd_req_get_stats_v1 { | 1572 | struct be_cmd_req_get_stats_v1 { |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index fdb50cec6b51..501dfa9c88ec 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -3237,7 +3237,7 @@ static void be_netdev_init(struct net_device *netdev) | |||
3237 | 3237 | ||
3238 | netdev->flags |= IFF_MULTICAST; | 3238 | netdev->flags |= IFF_MULTICAST; |
3239 | 3239 | ||
3240 | netif_set_gso_max_size(netdev, 65535); | 3240 | netif_set_gso_max_size(netdev, 65535 - ETH_HLEN); |
3241 | 3241 | ||
3242 | netdev->netdev_ops = &be_netdev_ops; | 3242 | netdev->netdev_ops = &be_netdev_ops; |
3243 | 3243 | ||
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 0741aded9eb0..f2db8fca46a1 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -1804,18 +1804,16 @@ void gfar_configure_coalescing(struct gfar_private *priv, | |||
1804 | if (priv->mode == MQ_MG_MODE) { | 1804 | if (priv->mode == MQ_MG_MODE) { |
1805 | baddr = ®s->txic0; | 1805 | baddr = ®s->txic0; |
1806 | for_each_set_bit(i, &tx_mask, priv->num_tx_queues) { | 1806 | for_each_set_bit(i, &tx_mask, priv->num_tx_queues) { |
1807 | if (likely(priv->tx_queue[i]->txcoalescing)) { | 1807 | gfar_write(baddr + i, 0); |
1808 | gfar_write(baddr + i, 0); | 1808 | if (likely(priv->tx_queue[i]->txcoalescing)) |
1809 | gfar_write(baddr + i, priv->tx_queue[i]->txic); | 1809 | gfar_write(baddr + i, priv->tx_queue[i]->txic); |
1810 | } | ||
1811 | } | 1810 | } |
1812 | 1811 | ||
1813 | baddr = ®s->rxic0; | 1812 | baddr = ®s->rxic0; |
1814 | for_each_set_bit(i, &rx_mask, priv->num_rx_queues) { | 1813 | for_each_set_bit(i, &rx_mask, priv->num_rx_queues) { |
1815 | if (likely(priv->rx_queue[i]->rxcoalescing)) { | 1814 | gfar_write(baddr + i, 0); |
1816 | gfar_write(baddr + i, 0); | 1815 | if (likely(priv->rx_queue[i]->rxcoalescing)) |
1817 | gfar_write(baddr + i, priv->rx_queue[i]->rxic); | 1816 | gfar_write(baddr + i, priv->rx_queue[i]->rxic); |
1818 | } | ||
1819 | } | 1817 | } |
1820 | } | 1818 | } |
1821 | } | 1819 | } |
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig index 79b07ec6726f..0cafe4fe9406 100644 --- a/drivers/net/ethernet/intel/Kconfig +++ b/drivers/net/ethernet/intel/Kconfig | |||
@@ -122,8 +122,10 @@ config IGB_DCA | |||
122 | 122 | ||
123 | config IGB_PTP | 123 | config IGB_PTP |
124 | bool "PTP Hardware Clock (PHC)" | 124 | bool "PTP Hardware Clock (PHC)" |
125 | default y | 125 | default n |
126 | depends on IGB && PTP_1588_CLOCK | 126 | depends on IGB && EXPERIMENTAL |
127 | select PPS | ||
128 | select PTP_1588_CLOCK | ||
127 | ---help--- | 129 | ---help--- |
128 | Say Y here if you want to use PTP Hardware Clock (PHC) in the | 130 | Say Y here if you want to use PTP Hardware Clock (PHC) in the |
129 | driver. Only the basic clock operations have been implemented. | 131 | driver. Only the basic clock operations have been implemented. |
@@ -223,7 +225,9 @@ config IXGBE_DCB | |||
223 | config IXGBE_PTP | 225 | config IXGBE_PTP |
224 | bool "PTP Clock Support" | 226 | bool "PTP Clock Support" |
225 | default n | 227 | default n |
226 | depends on IXGBE && PTP_1588_CLOCK | 228 | depends on IXGBE && EXPERIMENTAL |
229 | select PPS | ||
230 | select PTP_1588_CLOCK | ||
227 | ---help--- | 231 | ---help--- |
228 | Say Y here if you want support for 1588 Timestamping with a | 232 | Say Y here if you want support for 1588 Timestamping with a |
229 | PHC device, using the PTP 1588 Clock support. This is | 233 | PHC device, using the PTP 1588 Clock support. This is |
diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h index 351a4097b2ba..76edbc1be33b 100644 --- a/drivers/net/ethernet/intel/e1000e/defines.h +++ b/drivers/net/ethernet/intel/e1000e/defines.h | |||
@@ -103,6 +103,7 @@ | |||
103 | #define E1000_RXD_ERR_SEQ 0x04 /* Sequence Error */ | 103 | #define E1000_RXD_ERR_SEQ 0x04 /* Sequence Error */ |
104 | #define E1000_RXD_ERR_CXE 0x10 /* Carrier Extension Error */ | 104 | #define E1000_RXD_ERR_CXE 0x10 /* Carrier Extension Error */ |
105 | #define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */ | 105 | #define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */ |
106 | #define E1000_RXD_ERR_IPE 0x40 /* IP Checksum Error */ | ||
106 | #define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */ | 107 | #define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */ |
107 | #define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */ | 108 | #define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */ |
108 | 109 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 31d37a2b5ba8..623e30b9964d 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -496,7 +496,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter, | |||
496 | * @sk_buff: socket buffer with received data | 496 | * @sk_buff: socket buffer with received data |
497 | **/ | 497 | **/ |
498 | static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, | 498 | static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, |
499 | __le16 csum, struct sk_buff *skb) | 499 | struct sk_buff *skb) |
500 | { | 500 | { |
501 | u16 status = (u16)status_err; | 501 | u16 status = (u16)status_err; |
502 | u8 errors = (u8)(status_err >> 24); | 502 | u8 errors = (u8)(status_err >> 24); |
@@ -511,8 +511,8 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, | |||
511 | if (status & E1000_RXD_STAT_IXSM) | 511 | if (status & E1000_RXD_STAT_IXSM) |
512 | return; | 512 | return; |
513 | 513 | ||
514 | /* TCP/UDP checksum error bit is set */ | 514 | /* TCP/UDP checksum error bit or IP checksum error bit is set */ |
515 | if (errors & E1000_RXD_ERR_TCPE) { | 515 | if (errors & (E1000_RXD_ERR_TCPE | E1000_RXD_ERR_IPE)) { |
516 | /* let the stack verify checksum errors */ | 516 | /* let the stack verify checksum errors */ |
517 | adapter->hw_csum_err++; | 517 | adapter->hw_csum_err++; |
518 | return; | 518 | return; |
@@ -523,19 +523,7 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, | |||
523 | return; | 523 | return; |
524 | 524 | ||
525 | /* It must be a TCP or UDP packet with a valid checksum */ | 525 | /* It must be a TCP or UDP packet with a valid checksum */ |
526 | if (status & E1000_RXD_STAT_TCPCS) { | 526 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
527 | /* TCP checksum is good */ | ||
528 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
529 | } else { | ||
530 | /* | ||
531 | * IP fragment with UDP payload | ||
532 | * Hardware complements the payload checksum, so we undo it | ||
533 | * and then put the value in host order for further stack use. | ||
534 | */ | ||
535 | __sum16 sum = (__force __sum16)swab16((__force u16)csum); | ||
536 | skb->csum = csum_unfold(~sum); | ||
537 | skb->ip_summed = CHECKSUM_COMPLETE; | ||
538 | } | ||
539 | adapter->hw_csum_good++; | 527 | adapter->hw_csum_good++; |
540 | } | 528 | } |
541 | 529 | ||
@@ -954,8 +942,7 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done, | |||
954 | skb_put(skb, length); | 942 | skb_put(skb, length); |
955 | 943 | ||
956 | /* Receive Checksum Offload */ | 944 | /* Receive Checksum Offload */ |
957 | e1000_rx_checksum(adapter, staterr, | 945 | e1000_rx_checksum(adapter, staterr, skb); |
958 | rx_desc->wb.lower.hi_dword.csum_ip.csum, skb); | ||
959 | 946 | ||
960 | e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); | 947 | e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); |
961 | 948 | ||
@@ -1341,8 +1328,7 @@ copydone: | |||
1341 | total_rx_bytes += skb->len; | 1328 | total_rx_bytes += skb->len; |
1342 | total_rx_packets++; | 1329 | total_rx_packets++; |
1343 | 1330 | ||
1344 | e1000_rx_checksum(adapter, staterr, | 1331 | e1000_rx_checksum(adapter, staterr, skb); |
1345 | rx_desc->wb.lower.hi_dword.csum_ip.csum, skb); | ||
1346 | 1332 | ||
1347 | e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); | 1333 | e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); |
1348 | 1334 | ||
@@ -1512,9 +1498,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done, | |||
1512 | } | 1498 | } |
1513 | } | 1499 | } |
1514 | 1500 | ||
1515 | /* Receive Checksum Offload XXX recompute due to CRC strip? */ | 1501 | /* Receive Checksum Offload */ |
1516 | e1000_rx_checksum(adapter, staterr, | 1502 | e1000_rx_checksum(adapter, staterr, skb); |
1517 | rx_desc->wb.lower.hi_dword.csum_ip.csum, skb); | ||
1518 | 1503 | ||
1519 | e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); | 1504 | e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); |
1520 | 1505 | ||
@@ -3098,19 +3083,10 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) | |||
3098 | 3083 | ||
3099 | /* Enable Receive Checksum Offload for TCP and UDP */ | 3084 | /* Enable Receive Checksum Offload for TCP and UDP */ |
3100 | rxcsum = er32(RXCSUM); | 3085 | rxcsum = er32(RXCSUM); |
3101 | if (adapter->netdev->features & NETIF_F_RXCSUM) { | 3086 | if (adapter->netdev->features & NETIF_F_RXCSUM) |
3102 | rxcsum |= E1000_RXCSUM_TUOFL; | 3087 | rxcsum |= E1000_RXCSUM_TUOFL; |
3103 | 3088 | else | |
3104 | /* | ||
3105 | * IPv4 payload checksum for UDP fragments must be | ||
3106 | * used in conjunction with packet-split. | ||
3107 | */ | ||
3108 | if (adapter->rx_ps_pages) | ||
3109 | rxcsum |= E1000_RXCSUM_IPPCSE; | ||
3110 | } else { | ||
3111 | rxcsum &= ~E1000_RXCSUM_TUOFL; | 3089 | rxcsum &= ~E1000_RXCSUM_TUOFL; |
3112 | /* no need to clear IPPCSE as it defaults to 0 */ | ||
3113 | } | ||
3114 | ew32(RXCSUM, rxcsum); | 3090 | ew32(RXCSUM, rxcsum); |
3115 | 3091 | ||
3116 | if (adapter->hw.mac.type == e1000_pch2lan) { | 3092 | if (adapter->hw.mac.type == e1000_pch2lan) { |
@@ -5241,22 +5217,10 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
5241 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; | 5217 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; |
5242 | 5218 | ||
5243 | /* Jumbo frame support */ | 5219 | /* Jumbo frame support */ |
5244 | if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) { | 5220 | if ((max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) && |
5245 | if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { | 5221 | !(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { |
5246 | e_err("Jumbo Frames not supported.\n"); | 5222 | e_err("Jumbo Frames not supported.\n"); |
5247 | return -EINVAL; | 5223 | return -EINVAL; |
5248 | } | ||
5249 | |||
5250 | /* | ||
5251 | * IP payload checksum (enabled with jumbos/packet-split when | ||
5252 | * Rx checksum is enabled) and generation of RSS hash is | ||
5253 | * mutually exclusive in the hardware. | ||
5254 | */ | ||
5255 | if ((netdev->features & NETIF_F_RXCSUM) && | ||
5256 | (netdev->features & NETIF_F_RXHASH)) { | ||
5257 | e_err("Jumbo frames cannot be enabled when both receive checksum offload and receive hashing are enabled. Disable one of the receive offload features before enabling jumbos.\n"); | ||
5258 | return -EINVAL; | ||
5259 | } | ||
5260 | } | 5224 | } |
5261 | 5225 | ||
5262 | /* Supported frame sizes */ | 5226 | /* Supported frame sizes */ |
@@ -6030,17 +5994,6 @@ static int e1000_set_features(struct net_device *netdev, | |||
6030 | NETIF_F_RXALL))) | 5994 | NETIF_F_RXALL))) |
6031 | return 0; | 5995 | return 0; |
6032 | 5996 | ||
6033 | /* | ||
6034 | * IP payload checksum (enabled with jumbos/packet-split when Rx | ||
6035 | * checksum is enabled) and generation of RSS hash is mutually | ||
6036 | * exclusive in the hardware. | ||
6037 | */ | ||
6038 | if (adapter->rx_ps_pages && | ||
6039 | (features & NETIF_F_RXCSUM) && (features & NETIF_F_RXHASH)) { | ||
6040 | e_err("Enabling both receive checksum offload and receive hashing is not possible with jumbo frames. Disable jumbos or enable only one of the receive offload features.\n"); | ||
6041 | return -EINVAL; | ||
6042 | } | ||
6043 | |||
6044 | if (changed & NETIF_F_RXFCS) { | 5997 | if (changed & NETIF_F_RXFCS) { |
6045 | if (features & NETIF_F_RXFCS) { | 5998 | if (features & NETIF_F_RXFCS) { |
6046 | adapter->flags2 &= ~FLAG2_CRC_STRIPPING; | 5999 | adapter->flags2 &= ~FLAG2_CRC_STRIPPING; |
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index e65083958421..5e84eaac48c1 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c | |||
@@ -206,8 +206,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
206 | mac->rar_entry_count = E1000_RAR_ENTRIES_82580; | 206 | mac->rar_entry_count = E1000_RAR_ENTRIES_82580; |
207 | break; | 207 | break; |
208 | case e1000_i350: | 208 | case e1000_i350: |
209 | case e1000_i210: | ||
210 | case e1000_i211: | ||
211 | mac->rar_entry_count = E1000_RAR_ENTRIES_I350; | 209 | mac->rar_entry_count = E1000_RAR_ENTRIES_I350; |
212 | break; | 210 | break; |
213 | default: | 211 | default: |
diff --git a/drivers/net/ethernet/intel/igbvf/ethtool.c b/drivers/net/ethernet/intel/igbvf/ethtool.c index 8ce67064b9c5..90eef07943f4 100644 --- a/drivers/net/ethernet/intel/igbvf/ethtool.c +++ b/drivers/net/ethernet/intel/igbvf/ethtool.c | |||
@@ -357,21 +357,28 @@ static int igbvf_set_coalesce(struct net_device *netdev, | |||
357 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 357 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
358 | struct e1000_hw *hw = &adapter->hw; | 358 | struct e1000_hw *hw = &adapter->hw; |
359 | 359 | ||
360 | if ((ec->rx_coalesce_usecs > IGBVF_MAX_ITR_USECS) || | 360 | if ((ec->rx_coalesce_usecs >= IGBVF_MIN_ITR_USECS) && |
361 | ((ec->rx_coalesce_usecs > 3) && | 361 | (ec->rx_coalesce_usecs <= IGBVF_MAX_ITR_USECS)) { |
362 | (ec->rx_coalesce_usecs < IGBVF_MIN_ITR_USECS)) || | 362 | adapter->current_itr = ec->rx_coalesce_usecs << 2; |
363 | (ec->rx_coalesce_usecs == 2)) | 363 | adapter->requested_itr = 1000000000 / |
364 | return -EINVAL; | 364 | (adapter->current_itr * 256); |
365 | 365 | } else if ((ec->rx_coalesce_usecs == 3) || | |
366 | /* convert to rate of irq's per second */ | 366 | (ec->rx_coalesce_usecs == 2)) { |
367 | if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3) { | ||
368 | adapter->current_itr = IGBVF_START_ITR; | 367 | adapter->current_itr = IGBVF_START_ITR; |
369 | adapter->requested_itr = ec->rx_coalesce_usecs; | 368 | adapter->requested_itr = ec->rx_coalesce_usecs; |
370 | } else { | 369 | } else if (ec->rx_coalesce_usecs == 0) { |
371 | adapter->current_itr = ec->rx_coalesce_usecs << 2; | 370 | /* |
371 | * The user's desire is to turn off interrupt throttling | ||
372 | * altogether, but due to HW limitations, we can't do that. | ||
373 | * Instead we set a very small value in EITR, which would | ||
374 | * allow ~967k interrupts per second, but allow the adapter's | ||
375 | * internal clocking to still function properly. | ||
376 | */ | ||
377 | adapter->current_itr = 4; | ||
372 | adapter->requested_itr = 1000000000 / | 378 | adapter->requested_itr = 1000000000 / |
373 | (adapter->current_itr * 256); | 379 | (adapter->current_itr * 256); |
374 | } | 380 | } else |
381 | return -EINVAL; | ||
375 | 382 | ||
376 | writel(adapter->current_itr, | 383 | writel(adapter->current_itr, |
377 | hw->hw_addr + adapter->rx_ring->itr_register); | 384 | hw->hw_addr + adapter->rx_ring->itr_register); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 3ef3c5284e52..7af291e236bf 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h | |||
@@ -196,7 +196,7 @@ enum ixgbe_ring_state_t { | |||
196 | __IXGBE_HANG_CHECK_ARMED, | 196 | __IXGBE_HANG_CHECK_ARMED, |
197 | __IXGBE_RX_RSC_ENABLED, | 197 | __IXGBE_RX_RSC_ENABLED, |
198 | __IXGBE_RX_CSUM_UDP_ZERO_ERR, | 198 | __IXGBE_RX_CSUM_UDP_ZERO_ERR, |
199 | __IXGBE_RX_FCOE_BUFSZ, | 199 | __IXGBE_RX_FCOE, |
200 | }; | 200 | }; |
201 | 201 | ||
202 | #define check_for_tx_hang(ring) \ | 202 | #define check_for_tx_hang(ring) \ |
@@ -290,7 +290,7 @@ struct ixgbe_ring_feature { | |||
290 | #if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192) | 290 | #if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192) |
291 | static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring) | 291 | static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring) |
292 | { | 292 | { |
293 | return test_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state) ? 1 : 0; | 293 | return test_bit(__IXGBE_RX_FCOE, &ring->state) ? 1 : 0; |
294 | } | 294 | } |
295 | #else | 295 | #else |
296 | #define ixgbe_rx_pg_order(_ring) 0 | 296 | #define ixgbe_rx_pg_order(_ring) 0 |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c index af1a5314b494..c377706e81a8 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | |||
@@ -634,7 +634,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, | |||
634 | f = &adapter->ring_feature[RING_F_FCOE]; | 634 | f = &adapter->ring_feature[RING_F_FCOE]; |
635 | if ((rxr_idx >= f->mask) && | 635 | if ((rxr_idx >= f->mask) && |
636 | (rxr_idx < f->mask + f->indices)) | 636 | (rxr_idx < f->mask + f->indices)) |
637 | set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state); | 637 | set_bit(__IXGBE_RX_FCOE, &ring->state); |
638 | } | 638 | } |
639 | 639 | ||
640 | #endif /* IXGBE_FCOE */ | 640 | #endif /* IXGBE_FCOE */ |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 17ad6a3c1be1..18ca3bcadf0c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1058,17 +1058,17 @@ static inline void ixgbe_rx_hash(struct ixgbe_ring *ring, | |||
1058 | #ifdef IXGBE_FCOE | 1058 | #ifdef IXGBE_FCOE |
1059 | /** | 1059 | /** |
1060 | * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type | 1060 | * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type |
1061 | * @adapter: address of board private structure | 1061 | * @ring: structure containing ring specific data |
1062 | * @rx_desc: advanced rx descriptor | 1062 | * @rx_desc: advanced rx descriptor |
1063 | * | 1063 | * |
1064 | * Returns : true if it is FCoE pkt | 1064 | * Returns : true if it is FCoE pkt |
1065 | */ | 1065 | */ |
1066 | static inline bool ixgbe_rx_is_fcoe(struct ixgbe_adapter *adapter, | 1066 | static inline bool ixgbe_rx_is_fcoe(struct ixgbe_ring *ring, |
1067 | union ixgbe_adv_rx_desc *rx_desc) | 1067 | union ixgbe_adv_rx_desc *rx_desc) |
1068 | { | 1068 | { |
1069 | __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; | 1069 | __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; |
1070 | 1070 | ||
1071 | return (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && | 1071 | return test_bit(__IXGBE_RX_FCOE, &ring->state) && |
1072 | ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) == | 1072 | ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) == |
1073 | (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE << | 1073 | (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE << |
1074 | IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT))); | 1074 | IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT))); |
@@ -1148,7 +1148,7 @@ static bool ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring, | |||
1148 | 1148 | ||
1149 | /* alloc new page for storage */ | 1149 | /* alloc new page for storage */ |
1150 | if (likely(!page)) { | 1150 | if (likely(!page)) { |
1151 | page = alloc_pages(GFP_ATOMIC | __GFP_COLD, | 1151 | page = alloc_pages(GFP_ATOMIC | __GFP_COLD | __GFP_COMP, |
1152 | ixgbe_rx_pg_order(rx_ring)); | 1152 | ixgbe_rx_pg_order(rx_ring)); |
1153 | if (unlikely(!page)) { | 1153 | if (unlikely(!page)) { |
1154 | rx_ring->rx_stats.alloc_rx_page_failed++; | 1154 | rx_ring->rx_stats.alloc_rx_page_failed++; |
@@ -1549,6 +1549,12 @@ static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring, | |||
1549 | skb->truesize -= ixgbe_rx_bufsz(rx_ring); | 1549 | skb->truesize -= ixgbe_rx_bufsz(rx_ring); |
1550 | } | 1550 | } |
1551 | 1551 | ||
1552 | #ifdef IXGBE_FCOE | ||
1553 | /* do not attempt to pad FCoE Frames as this will disrupt DDP */ | ||
1554 | if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) | ||
1555 | return false; | ||
1556 | |||
1557 | #endif | ||
1552 | /* if skb_pad returns an error the skb was freed */ | 1558 | /* if skb_pad returns an error the skb was freed */ |
1553 | if (unlikely(skb->len < 60)) { | 1559 | if (unlikely(skb->len < 60)) { |
1554 | int pad_len = 60 - skb->len; | 1560 | int pad_len = 60 - skb->len; |
@@ -1775,7 +1781,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1775 | 1781 | ||
1776 | #ifdef IXGBE_FCOE | 1782 | #ifdef IXGBE_FCOE |
1777 | /* if ddp, not passing to ULD unless for FCP_RSP or error */ | 1783 | /* if ddp, not passing to ULD unless for FCP_RSP or error */ |
1778 | if (ixgbe_rx_is_fcoe(adapter, rx_desc)) { | 1784 | if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) { |
1779 | ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); | 1785 | ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); |
1780 | if (!ddp_bytes) { | 1786 | if (!ddp_bytes) { |
1781 | dev_kfree_skb_any(skb); | 1787 | dev_kfree_skb_any(skb); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c index ddc6a4d19302..dcebd128becf 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | |||
@@ -708,6 +708,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter) | |||
708 | { | 708 | { |
709 | struct ixgbe_hw *hw = &adapter->hw; | 709 | struct ixgbe_hw *hw = &adapter->hw; |
710 | u32 incval = 0; | 710 | u32 incval = 0; |
711 | u32 timinca = 0; | ||
711 | u32 shift = 0; | 712 | u32 shift = 0; |
712 | u32 cycle_speed; | 713 | u32 cycle_speed; |
713 | unsigned long flags; | 714 | unsigned long flags; |
@@ -730,8 +731,16 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter) | |||
730 | break; | 731 | break; |
731 | } | 732 | } |
732 | 733 | ||
733 | /* Bail if the cycle speed didn't change */ | 734 | /* |
734 | if (adapter->cycle_speed == cycle_speed) | 735 | * grab the current TIMINCA value from the register so that it can be |
736 | * double checked. If the register value has been cleared, it must be | ||
737 | * reset to the correct value for generating a cyclecounter. If | ||
738 | * TIMINCA is zero, the SYSTIME registers do not increment at all. | ||
739 | */ | ||
740 | timinca = IXGBE_READ_REG(hw, IXGBE_TIMINCA); | ||
741 | |||
742 | /* Bail if the cycle speed didn't change and TIMINCA is non-zero */ | ||
743 | if (adapter->cycle_speed == cycle_speed && timinca) | ||
735 | return; | 744 | return; |
736 | 745 | ||
737 | /* disable the SDP clock out */ | 746 | /* disable the SDP clock out */ |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 926d8aac941c..073b85b45fc5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -929,15 +929,20 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv) | |||
929 | if (priv->rx_cq[i].buf) | 929 | if (priv->rx_cq[i].buf) |
930 | mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); | 930 | mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); |
931 | } | 931 | } |
932 | |||
933 | if (priv->base_tx_qpn) { | ||
934 | mlx4_qp_release_range(priv->mdev->dev, priv->base_tx_qpn, priv->tx_ring_num); | ||
935 | priv->base_tx_qpn = 0; | ||
936 | } | ||
932 | } | 937 | } |
933 | 938 | ||
934 | int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) | 939 | int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) |
935 | { | 940 | { |
936 | struct mlx4_en_port_profile *prof = priv->prof; | 941 | struct mlx4_en_port_profile *prof = priv->prof; |
937 | int i; | 942 | int i; |
938 | int base_tx_qpn, err; | 943 | int err; |
939 | 944 | ||
940 | err = mlx4_qp_reserve_range(priv->mdev->dev, priv->tx_ring_num, 256, &base_tx_qpn); | 945 | err = mlx4_qp_reserve_range(priv->mdev->dev, priv->tx_ring_num, 256, &priv->base_tx_qpn); |
941 | if (err) { | 946 | if (err) { |
942 | en_err(priv, "failed reserving range for TX rings\n"); | 947 | en_err(priv, "failed reserving range for TX rings\n"); |
943 | return err; | 948 | return err; |
@@ -949,7 +954,7 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) | |||
949 | prof->tx_ring_size, i, TX)) | 954 | prof->tx_ring_size, i, TX)) |
950 | goto err; | 955 | goto err; |
951 | 956 | ||
952 | if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], base_tx_qpn + i, | 957 | if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], priv->base_tx_qpn + i, |
953 | prof->tx_ring_size, TXBB_SIZE)) | 958 | prof->tx_ring_size, TXBB_SIZE)) |
954 | goto err; | 959 | goto err; |
955 | } | 960 | } |
@@ -969,7 +974,6 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) | |||
969 | 974 | ||
970 | err: | 975 | err: |
971 | en_err(priv, "Failed to allocate NIC resources\n"); | 976 | en_err(priv, "Failed to allocate NIC resources\n"); |
972 | mlx4_qp_release_range(priv->mdev->dev, base_tx_qpn, priv->tx_ring_num); | ||
973 | return -ENOMEM; | 977 | return -ENOMEM; |
974 | } | 978 | } |
975 | 979 | ||
@@ -1204,9 +1208,11 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
1204 | en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num); | 1208 | en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num); |
1205 | 1209 | ||
1206 | /* Configure port */ | 1210 | /* Configure port */ |
1211 | mlx4_en_calc_rx_buf(dev); | ||
1207 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, | 1212 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, |
1208 | MLX4_EN_MIN_MTU, | 1213 | priv->rx_skb_size + ETH_FCS_LEN, |
1209 | 0, 0, 0, 0); | 1214 | prof->tx_pause, prof->tx_ppp, |
1215 | prof->rx_pause, prof->rx_ppp); | ||
1210 | if (err) { | 1216 | if (err) { |
1211 | en_err(priv, "Failed setting port general configurations " | 1217 | en_err(priv, "Failed setting port general configurations " |
1212 | "for port %d, with error %d\n", priv->port, err); | 1218 | "for port %d, with error %d\n", priv->port, err); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index ee6f4fe00837..a0313de122de 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -1975,6 +1975,8 @@ slave_start: | |||
1975 | if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) && | 1975 | if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) && |
1976 | !mlx4_is_mfunc(dev)) { | 1976 | !mlx4_is_mfunc(dev)) { |
1977 | dev->flags &= ~MLX4_FLAG_MSI_X; | 1977 | dev->flags &= ~MLX4_FLAG_MSI_X; |
1978 | dev->caps.num_comp_vectors = 1; | ||
1979 | dev->caps.comp_pool = 0; | ||
1978 | pci_disable_msix(pdev); | 1980 | pci_disable_msix(pdev); |
1979 | err = mlx4_setup_hca(dev); | 1981 | err = mlx4_setup_hca(dev); |
1980 | } | 1982 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 6ae350921b1a..225c20d47900 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -495,6 +495,7 @@ struct mlx4_en_priv { | |||
495 | int vids[128]; | 495 | int vids[128]; |
496 | bool wol; | 496 | bool wol; |
497 | struct device *ddev; | 497 | struct device *ddev; |
498 | int base_tx_qpn; | ||
498 | 499 | ||
499 | #ifdef CONFIG_MLX4_EN_DCB | 500 | #ifdef CONFIG_MLX4_EN_DCB |
500 | struct ieee_ets ets; | 501 | struct ieee_ets ets; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 46e77a2c5121..ad98f4d7919d 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -479,7 +479,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter) | |||
479 | 479 | ||
480 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { | 480 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { |
481 | pfn = pci_info[i].id; | 481 | pfn = pci_info[i].id; |
482 | if (pfn > QLCNIC_MAX_PCI_FUNC) { | 482 | if (pfn >= QLCNIC_MAX_PCI_FUNC) { |
483 | ret = QL_STATUS_INVALID_PARAM; | 483 | ret = QL_STATUS_INVALID_PARAM; |
484 | goto err_eswitch; | 484 | goto err_eswitch; |
485 | } | 485 | } |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 7260aa79466a..d7a04e091101 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -3894,6 +3894,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp) | |||
3894 | case RTL_GIGA_MAC_VER_22: | 3894 | case RTL_GIGA_MAC_VER_22: |
3895 | case RTL_GIGA_MAC_VER_23: | 3895 | case RTL_GIGA_MAC_VER_23: |
3896 | case RTL_GIGA_MAC_VER_24: | 3896 | case RTL_GIGA_MAC_VER_24: |
3897 | case RTL_GIGA_MAC_VER_34: | ||
3897 | RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); | 3898 | RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); |
3898 | break; | 3899 | break; |
3899 | default: | 3900 | default: |
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 667169b82526..79bf09b41971 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -1011,7 +1011,7 @@ static int sh_eth_txfree(struct net_device *ndev) | |||
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | /* Packet receive function */ | 1013 | /* Packet receive function */ |
1014 | static int sh_eth_rx(struct net_device *ndev) | 1014 | static int sh_eth_rx(struct net_device *ndev, u32 intr_status) |
1015 | { | 1015 | { |
1016 | struct sh_eth_private *mdp = netdev_priv(ndev); | 1016 | struct sh_eth_private *mdp = netdev_priv(ndev); |
1017 | struct sh_eth_rxdesc *rxdesc; | 1017 | struct sh_eth_rxdesc *rxdesc; |
@@ -1102,9 +1102,11 @@ static int sh_eth_rx(struct net_device *ndev) | |||
1102 | /* Restart Rx engine if stopped. */ | 1102 | /* Restart Rx engine if stopped. */ |
1103 | /* If we don't need to check status, don't. -KDU */ | 1103 | /* If we don't need to check status, don't. -KDU */ |
1104 | if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) { | 1104 | if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) { |
1105 | /* fix the values for the next receiving */ | 1105 | /* fix the values for the next receiving if RDE is set */ |
1106 | mdp->cur_rx = mdp->dirty_rx = (sh_eth_read(ndev, RDFAR) - | 1106 | if (intr_status & EESR_RDE) |
1107 | sh_eth_read(ndev, RDLAR)) >> 4; | 1107 | mdp->cur_rx = mdp->dirty_rx = |
1108 | (sh_eth_read(ndev, RDFAR) - | ||
1109 | sh_eth_read(ndev, RDLAR)) >> 4; | ||
1108 | sh_eth_write(ndev, EDRRR_R, EDRRR); | 1110 | sh_eth_write(ndev, EDRRR_R, EDRRR); |
1109 | } | 1111 | } |
1110 | 1112 | ||
@@ -1273,7 +1275,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
1273 | EESR_RTSF | /* short frame recv */ | 1275 | EESR_RTSF | /* short frame recv */ |
1274 | EESR_PRE | /* PHY-LSI recv error */ | 1276 | EESR_PRE | /* PHY-LSI recv error */ |
1275 | EESR_CERF)){ /* recv frame CRC error */ | 1277 | EESR_CERF)){ /* recv frame CRC error */ |
1276 | sh_eth_rx(ndev); | 1278 | sh_eth_rx(ndev, intr_status); |
1277 | } | 1279 | } |
1278 | 1280 | ||
1279 | /* Tx Check */ | 1281 | /* Tx Check */ |
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index d614c374ed9d..3b5c4571b55e 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/module.h> | ||
18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
19 | #include <linux/err.h> | 20 | #include <linux/err.h> |
20 | #include <linux/dma-mapping.h> | 21 | #include <linux/dma-mapping.h> |
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 590f902deb6b..9d6c80c8a0cf 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
@@ -161,7 +161,7 @@ static struct phy_driver ks8051_driver = { | |||
161 | static struct phy_driver ks8001_driver = { | 161 | static struct phy_driver ks8001_driver = { |
162 | .phy_id = PHY_ID_KS8001, | 162 | .phy_id = PHY_ID_KS8001, |
163 | .name = "Micrel KS8001 or KS8721", | 163 | .name = "Micrel KS8001 or KS8721", |
164 | .phy_id_mask = 0x00fffff0, | 164 | .phy_id_mask = 0x00ffffff, |
165 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), | 165 | .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), |
166 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, | 166 | .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, |
167 | .config_init = kszphy_config_init, | 167 | .config_init = kszphy_config_init, |
@@ -174,7 +174,7 @@ static struct phy_driver ks8001_driver = { | |||
174 | 174 | ||
175 | static struct phy_driver ksz9021_driver = { | 175 | static struct phy_driver ksz9021_driver = { |
176 | .phy_id = PHY_ID_KSZ9021, | 176 | .phy_id = PHY_ID_KSZ9021, |
177 | .phy_id_mask = 0x000fff10, | 177 | .phy_id_mask = 0x000ffffe, |
178 | .name = "Micrel KSZ9021 Gigabit PHY", | 178 | .name = "Micrel KSZ9021 Gigabit PHY", |
179 | .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause | 179 | .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause |
180 | | SUPPORTED_Asym_Pause), | 180 | | SUPPORTED_Asym_Pause), |
@@ -240,8 +240,8 @@ MODULE_AUTHOR("David J. Choi"); | |||
240 | MODULE_LICENSE("GPL"); | 240 | MODULE_LICENSE("GPL"); |
241 | 241 | ||
242 | static struct mdio_device_id __maybe_unused micrel_tbl[] = { | 242 | static struct mdio_device_id __maybe_unused micrel_tbl[] = { |
243 | { PHY_ID_KSZ9021, 0x000fff10 }, | 243 | { PHY_ID_KSZ9021, 0x000ffffe }, |
244 | { PHY_ID_KS8001, 0x00fffff0 }, | 244 | { PHY_ID_KS8001, 0x00ffffff }, |
245 | { PHY_ID_KS8737, 0x00fffff0 }, | 245 | { PHY_ID_KS8737, 0x00fffff0 }, |
246 | { PHY_ID_KS8041, 0x00fffff0 }, | 246 | { PHY_ID_KS8041, 0x00fffff0 }, |
247 | { PHY_ID_KS8051, 0x00fffff0 }, | 247 | { PHY_ID_KS8051, 0x00fffff0 }, |
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index 964031e3da87..a28a983d465e 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #define USB_PRODUCT_IPHONE_3G 0x1292 | 59 | #define USB_PRODUCT_IPHONE_3G 0x1292 |
60 | #define USB_PRODUCT_IPHONE_3GS 0x1294 | 60 | #define USB_PRODUCT_IPHONE_3GS 0x1294 |
61 | #define USB_PRODUCT_IPHONE_4 0x1297 | 61 | #define USB_PRODUCT_IPHONE_4 0x1297 |
62 | #define USB_PRODUCT_IPAD 0x129a | ||
62 | #define USB_PRODUCT_IPHONE_4_VZW 0x129c | 63 | #define USB_PRODUCT_IPHONE_4_VZW 0x129c |
63 | #define USB_PRODUCT_IPHONE_4S 0x12a0 | 64 | #define USB_PRODUCT_IPHONE_4S 0x12a0 |
64 | 65 | ||
@@ -101,6 +102,10 @@ static struct usb_device_id ipheth_table[] = { | |||
101 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | 102 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, |
102 | IPHETH_USBINTF_PROTO) }, | 103 | IPHETH_USBINTF_PROTO) }, |
103 | { USB_DEVICE_AND_INTERFACE_INFO( | 104 | { USB_DEVICE_AND_INTERFACE_INFO( |
105 | USB_VENDOR_APPLE, USB_PRODUCT_IPAD, | ||
106 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | ||
107 | IPHETH_USBINTF_PROTO) }, | ||
108 | { USB_DEVICE_AND_INTERFACE_INFO( | ||
104 | USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, | 109 | USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, |
105 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, | 110 | IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, |
106 | IPHETH_USBINTF_PROTO) }, | 111 | IPHETH_USBINTF_PROTO) }, |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 3b206786b5e7..b01960fcfbc9 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -197,6 +197,10 @@ err: | |||
197 | static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on) | 197 | static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on) |
198 | { | 198 | { |
199 | struct usbnet *dev = usb_get_intfdata(intf); | 199 | struct usbnet *dev = usb_get_intfdata(intf); |
200 | |||
201 | /* can be called while disconnecting */ | ||
202 | if (!dev) | ||
203 | return 0; | ||
200 | return qmi_wwan_manage_power(dev, on); | 204 | return qmi_wwan_manage_power(dev, on); |
201 | } | 205 | } |
202 | 206 | ||
@@ -257,29 +261,6 @@ err: | |||
257 | return rv; | 261 | return rv; |
258 | } | 262 | } |
259 | 263 | ||
260 | /* Gobi devices uses identical class/protocol codes for all interfaces regardless | ||
261 | * of function. Some of these are CDC ACM like and have the exact same endpoints | ||
262 | * we are looking for. This leaves two possible strategies for identifying the | ||
263 | * correct interface: | ||
264 | * a) hardcoding interface number, or | ||
265 | * b) use the fact that the wwan interface is the only one lacking additional | ||
266 | * (CDC functional) descriptors | ||
267 | * | ||
268 | * Let's see if we can get away with the generic b) solution. | ||
269 | */ | ||
270 | static int qmi_wwan_bind_gobi(struct usbnet *dev, struct usb_interface *intf) | ||
271 | { | ||
272 | int rv = -EINVAL; | ||
273 | |||
274 | /* ignore any interface with additional descriptors */ | ||
275 | if (intf->cur_altsetting->extralen) | ||
276 | goto err; | ||
277 | |||
278 | rv = qmi_wwan_bind_shared(dev, intf); | ||
279 | err: | ||
280 | return rv; | ||
281 | } | ||
282 | |||
283 | static void qmi_wwan_unbind_shared(struct usbnet *dev, struct usb_interface *intf) | 264 | static void qmi_wwan_unbind_shared(struct usbnet *dev, struct usb_interface *intf) |
284 | { | 265 | { |
285 | struct usb_driver *subdriver = (void *)dev->data[0]; | 266 | struct usb_driver *subdriver = (void *)dev->data[0]; |
@@ -347,15 +328,15 @@ static const struct driver_info qmi_wwan_shared = { | |||
347 | .manage_power = qmi_wwan_manage_power, | 328 | .manage_power = qmi_wwan_manage_power, |
348 | }; | 329 | }; |
349 | 330 | ||
350 | static const struct driver_info qmi_wwan_gobi = { | 331 | static const struct driver_info qmi_wwan_force_int0 = { |
351 | .description = "Qualcomm Gobi wwan/QMI device", | 332 | .description = "Qualcomm WWAN/QMI device", |
352 | .flags = FLAG_WWAN, | 333 | .flags = FLAG_WWAN, |
353 | .bind = qmi_wwan_bind_gobi, | 334 | .bind = qmi_wwan_bind_shared, |
354 | .unbind = qmi_wwan_unbind_shared, | 335 | .unbind = qmi_wwan_unbind_shared, |
355 | .manage_power = qmi_wwan_manage_power, | 336 | .manage_power = qmi_wwan_manage_power, |
337 | .data = BIT(0), /* interface whitelist bitmap */ | ||
356 | }; | 338 | }; |
357 | 339 | ||
358 | /* ZTE suck at making USB descriptors */ | ||
359 | static const struct driver_info qmi_wwan_force_int1 = { | 340 | static const struct driver_info qmi_wwan_force_int1 = { |
360 | .description = "Qualcomm WWAN/QMI device", | 341 | .description = "Qualcomm WWAN/QMI device", |
361 | .flags = FLAG_WWAN, | 342 | .flags = FLAG_WWAN, |
@@ -365,6 +346,15 @@ static const struct driver_info qmi_wwan_force_int1 = { | |||
365 | .data = BIT(1), /* interface whitelist bitmap */ | 346 | .data = BIT(1), /* interface whitelist bitmap */ |
366 | }; | 347 | }; |
367 | 348 | ||
349 | static const struct driver_info qmi_wwan_force_int3 = { | ||
350 | .description = "Qualcomm WWAN/QMI device", | ||
351 | .flags = FLAG_WWAN, | ||
352 | .bind = qmi_wwan_bind_shared, | ||
353 | .unbind = qmi_wwan_unbind_shared, | ||
354 | .manage_power = qmi_wwan_manage_power, | ||
355 | .data = BIT(3), /* interface whitelist bitmap */ | ||
356 | }; | ||
357 | |||
368 | static const struct driver_info qmi_wwan_force_int4 = { | 358 | static const struct driver_info qmi_wwan_force_int4 = { |
369 | .description = "Qualcomm WWAN/QMI device", | 359 | .description = "Qualcomm WWAN/QMI device", |
370 | .flags = FLAG_WWAN, | 360 | .flags = FLAG_WWAN, |
@@ -390,16 +380,23 @@ static const struct driver_info qmi_wwan_force_int4 = { | |||
390 | static const struct driver_info qmi_wwan_sierra = { | 380 | static const struct driver_info qmi_wwan_sierra = { |
391 | .description = "Sierra Wireless wwan/QMI device", | 381 | .description = "Sierra Wireless wwan/QMI device", |
392 | .flags = FLAG_WWAN, | 382 | .flags = FLAG_WWAN, |
393 | .bind = qmi_wwan_bind_gobi, | 383 | .bind = qmi_wwan_bind_shared, |
394 | .unbind = qmi_wwan_unbind_shared, | 384 | .unbind = qmi_wwan_unbind_shared, |
395 | .manage_power = qmi_wwan_manage_power, | 385 | .manage_power = qmi_wwan_manage_power, |
396 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ | 386 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ |
397 | }; | 387 | }; |
398 | 388 | ||
399 | #define HUAWEI_VENDOR_ID 0x12D1 | 389 | #define HUAWEI_VENDOR_ID 0x12D1 |
390 | |||
391 | /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */ | ||
392 | #define QMI_GOBI1K_DEVICE(vend, prod) \ | ||
393 | USB_DEVICE(vend, prod), \ | ||
394 | .driver_info = (unsigned long)&qmi_wwan_force_int3 | ||
395 | |||
396 | /* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */ | ||
400 | #define QMI_GOBI_DEVICE(vend, prod) \ | 397 | #define QMI_GOBI_DEVICE(vend, prod) \ |
401 | USB_DEVICE(vend, prod), \ | 398 | USB_DEVICE(vend, prod), \ |
402 | .driver_info = (unsigned long)&qmi_wwan_gobi | 399 | .driver_info = (unsigned long)&qmi_wwan_force_int0 |
403 | 400 | ||
404 | static const struct usb_device_id products[] = { | 401 | static const struct usb_device_id products[] = { |
405 | { /* Huawei E392, E398 and possibly others sharing both device id and more... */ | 402 | { /* Huawei E392, E398 and possibly others sharing both device id and more... */ |
@@ -510,20 +507,24 @@ static const struct usb_device_id products[] = { | |||
510 | .bInterfaceProtocol = 0xff, | 507 | .bInterfaceProtocol = 0xff, |
511 | .driver_info = (unsigned long)&qmi_wwan_sierra, | 508 | .driver_info = (unsigned long)&qmi_wwan_sierra, |
512 | }, | 509 | }, |
513 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 510 | |
514 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 511 | /* Gobi 1000 devices */ |
515 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | 512 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
516 | {QMI_GOBI_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ | 513 | {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
517 | {QMI_GOBI_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ | 514 | {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ |
518 | {QMI_GOBI_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ | 515 | {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ |
519 | {QMI_GOBI_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ | 516 | {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ |
520 | {QMI_GOBI_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ | 517 | {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ |
521 | {QMI_GOBI_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ | 518 | {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ |
522 | {QMI_GOBI_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ | 519 | {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ |
523 | {QMI_GOBI_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ | 520 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ |
524 | {QMI_GOBI_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ | 521 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ |
525 | {QMI_GOBI_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | 522 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ |
526 | {QMI_GOBI_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ | 523 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ |
524 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | ||
525 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ | ||
526 | |||
527 | /* Gobi 2000 and 3000 devices */ | ||
527 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 528 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
528 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ | 529 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ |
529 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | 530 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 9f58330f1312..aba769d77459 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -796,11 +796,13 @@ int usbnet_open (struct net_device *net) | |||
796 | if (info->manage_power) { | 796 | if (info->manage_power) { |
797 | retval = info->manage_power(dev, 1); | 797 | retval = info->manage_power(dev, 1); |
798 | if (retval < 0) | 798 | if (retval < 0) |
799 | goto done; | 799 | goto done_manage_power_error; |
800 | usb_autopm_put_interface(dev->intf); | 800 | usb_autopm_put_interface(dev->intf); |
801 | } | 801 | } |
802 | return retval; | 802 | return retval; |
803 | 803 | ||
804 | done_manage_power_error: | ||
805 | clear_bit(EVENT_DEV_OPEN, &dev->flags); | ||
804 | done: | 806 | done: |
805 | usb_autopm_put_interface(dev->intf); | 807 | usb_autopm_put_interface(dev->intf); |
806 | done_nopm: | 808 | done_nopm: |
@@ -876,9 +878,9 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info) | |||
876 | { | 878 | { |
877 | struct usbnet *dev = netdev_priv(net); | 879 | struct usbnet *dev = netdev_priv(net); |
878 | 880 | ||
879 | strncpy (info->driver, dev->driver_name, sizeof info->driver); | 881 | strlcpy (info->driver, dev->driver_name, sizeof info->driver); |
880 | strncpy (info->version, DRIVER_VERSION, sizeof info->version); | 882 | strlcpy (info->version, DRIVER_VERSION, sizeof info->version); |
881 | strncpy (info->fw_version, dev->driver_info->description, | 883 | strlcpy (info->fw_version, dev->driver_info->description, |
882 | sizeof info->fw_version); | 884 | sizeof info->fw_version); |
883 | usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info); | 885 | usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info); |
884 | } | 886 | } |
@@ -1202,6 +1204,21 @@ deferred: | |||
1202 | } | 1204 | } |
1203 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); | 1205 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); |
1204 | 1206 | ||
1207 | static void rx_alloc_submit(struct usbnet *dev, gfp_t flags) | ||
1208 | { | ||
1209 | struct urb *urb; | ||
1210 | int i; | ||
1211 | |||
1212 | /* don't refill the queue all at once */ | ||
1213 | for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) { | ||
1214 | urb = usb_alloc_urb(0, flags); | ||
1215 | if (urb != NULL) { | ||
1216 | if (rx_submit(dev, urb, flags) == -ENOLINK) | ||
1217 | return; | ||
1218 | } | ||
1219 | } | ||
1220 | } | ||
1221 | |||
1205 | /*-------------------------------------------------------------------------*/ | 1222 | /*-------------------------------------------------------------------------*/ |
1206 | 1223 | ||
1207 | // tasklet (work deferred from completions, in_irq) or timer | 1224 | // tasklet (work deferred from completions, in_irq) or timer |
@@ -1241,26 +1258,14 @@ static void usbnet_bh (unsigned long param) | |||
1241 | !timer_pending (&dev->delay) && | 1258 | !timer_pending (&dev->delay) && |
1242 | !test_bit (EVENT_RX_HALT, &dev->flags)) { | 1259 | !test_bit (EVENT_RX_HALT, &dev->flags)) { |
1243 | int temp = dev->rxq.qlen; | 1260 | int temp = dev->rxq.qlen; |
1244 | int qlen = RX_QLEN (dev); | 1261 | |
1245 | 1262 | if (temp < RX_QLEN(dev)) { | |
1246 | if (temp < qlen) { | 1263 | rx_alloc_submit(dev, GFP_ATOMIC); |
1247 | struct urb *urb; | ||
1248 | int i; | ||
1249 | |||
1250 | // don't refill the queue all at once | ||
1251 | for (i = 0; i < 10 && dev->rxq.qlen < qlen; i++) { | ||
1252 | urb = usb_alloc_urb (0, GFP_ATOMIC); | ||
1253 | if (urb != NULL) { | ||
1254 | if (rx_submit (dev, urb, GFP_ATOMIC) == | ||
1255 | -ENOLINK) | ||
1256 | return; | ||
1257 | } | ||
1258 | } | ||
1259 | if (temp != dev->rxq.qlen) | 1264 | if (temp != dev->rxq.qlen) |
1260 | netif_dbg(dev, link, dev->net, | 1265 | netif_dbg(dev, link, dev->net, |
1261 | "rxqlen %d --> %d\n", | 1266 | "rxqlen %d --> %d\n", |
1262 | temp, dev->rxq.qlen); | 1267 | temp, dev->rxq.qlen); |
1263 | if (dev->rxq.qlen < qlen) | 1268 | if (dev->rxq.qlen < RX_QLEN(dev)) |
1264 | tasklet_schedule (&dev->bh); | 1269 | tasklet_schedule (&dev->bh); |
1265 | } | 1270 | } |
1266 | if (dev->txq.qlen < TX_QLEN (dev)) | 1271 | if (dev->txq.qlen < TX_QLEN (dev)) |
@@ -1513,6 +1518,7 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message) | |||
1513 | spin_lock_irq(&dev->txq.lock); | 1518 | spin_lock_irq(&dev->txq.lock); |
1514 | /* don't autosuspend while transmitting */ | 1519 | /* don't autosuspend while transmitting */ |
1515 | if (dev->txq.qlen && PMSG_IS_AUTO(message)) { | 1520 | if (dev->txq.qlen && PMSG_IS_AUTO(message)) { |
1521 | dev->suspend_count--; | ||
1516 | spin_unlock_irq(&dev->txq.lock); | 1522 | spin_unlock_irq(&dev->txq.lock); |
1517 | return -EBUSY; | 1523 | return -EBUSY; |
1518 | } else { | 1524 | } else { |
@@ -1569,6 +1575,13 @@ int usbnet_resume (struct usb_interface *intf) | |||
1569 | spin_unlock_irq(&dev->txq.lock); | 1575 | spin_unlock_irq(&dev->txq.lock); |
1570 | 1576 | ||
1571 | if (test_bit(EVENT_DEV_OPEN, &dev->flags)) { | 1577 | if (test_bit(EVENT_DEV_OPEN, &dev->flags)) { |
1578 | /* handle remote wakeup ASAP */ | ||
1579 | if (!dev->wait && | ||
1580 | netif_device_present(dev->net) && | ||
1581 | !timer_pending(&dev->delay) && | ||
1582 | !test_bit(EVENT_RX_HALT, &dev->flags)) | ||
1583 | rx_alloc_submit(dev, GFP_KERNEL); | ||
1584 | |||
1572 | if (!(dev->txq.qlen >= TX_QLEN(dev))) | 1585 | if (!(dev->txq.qlen >= TX_QLEN(dev))) |
1573 | netif_tx_wake_all_queues(dev->net); | 1586 | netif_tx_wake_all_queues(dev->net); |
1574 | tasklet_schedule (&dev->bh); | 1587 | tasklet_schedule (&dev->bh); |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 520a4b2eb9cc..a747c632597a 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -7233,8 +7233,8 @@ static int airo_get_aplist(struct net_device *dev, | |||
7233 | } | 7233 | } |
7234 | } else { | 7234 | } else { |
7235 | dwrq->flags = 1; /* Should be define'd */ | 7235 | dwrq->flags = 1; /* Should be define'd */ |
7236 | memcpy(extra + sizeof(struct sockaddr)*i, | 7236 | memcpy(extra + sizeof(struct sockaddr) * i, qual, |
7237 | &qual, sizeof(struct iw_quality)*i); | 7237 | sizeof(struct iw_quality) * i); |
7238 | } | 7238 | } |
7239 | dwrq->length = i; | 7239 | dwrq->length = i; |
7240 | 7240 | ||
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index c54b7d37bff1..420d69b2674c 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h | |||
@@ -143,6 +143,7 @@ struct ath_common { | |||
143 | u32 keymax; | 143 | u32 keymax; |
144 | DECLARE_BITMAP(keymap, ATH_KEYMAX); | 144 | DECLARE_BITMAP(keymap, ATH_KEYMAX); |
145 | DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX); | 145 | DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX); |
146 | DECLARE_BITMAP(ccmp_keymap, ATH_KEYMAX); | ||
146 | enum ath_crypt_caps crypt_caps; | 147 | enum ath_crypt_caps crypt_caps; |
147 | 148 | ||
148 | unsigned int clockrate; | 149 | unsigned int clockrate; |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index fbaa30930076..44ad6fe0278f 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -1045,11 +1045,11 @@ ath5k_drain_tx_buffs(struct ath5k_hw *ah) | |||
1045 | 1045 | ||
1046 | ath5k_txbuf_free_skb(ah, bf); | 1046 | ath5k_txbuf_free_skb(ah, bf); |
1047 | 1047 | ||
1048 | spin_lock_bh(&ah->txbuflock); | 1048 | spin_lock(&ah->txbuflock); |
1049 | list_move_tail(&bf->list, &ah->txbuf); | 1049 | list_move_tail(&bf->list, &ah->txbuf); |
1050 | ah->txbuf_len++; | 1050 | ah->txbuf_len++; |
1051 | txq->txq_len--; | 1051 | txq->txq_len--; |
1052 | spin_unlock_bh(&ah->txbuflock); | 1052 | spin_unlock(&ah->txbuflock); |
1053 | } | 1053 | } |
1054 | txq->link = NULL; | 1054 | txq->link = NULL; |
1055 | txq->txq_poll_mark = false; | 1055 | txq->txq_poll_mark = false; |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index a277cf6f339d..4866550ddd96 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -214,6 +214,7 @@ struct ath_frame_info { | |||
214 | enum ath9k_key_type keytype; | 214 | enum ath9k_key_type keytype; |
215 | u8 keyix; | 215 | u8 keyix; |
216 | u8 retries; | 216 | u8 retries; |
217 | u8 rtscts_rate; | ||
217 | }; | 218 | }; |
218 | 219 | ||
219 | struct ath_buf_state { | 220 | struct ath_buf_state { |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 2b8f61c210e1..abbd6effd60d 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -1496,6 +1496,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, | |||
1496 | priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--; | 1496 | priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--; |
1497 | 1497 | ||
1498 | if (priv->ah->opmode == NL80211_IFTYPE_STATION) { | 1498 | if (priv->ah->opmode == NL80211_IFTYPE_STATION) { |
1499 | ath9k_htc_choose_set_bssid(priv); | ||
1499 | if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1)) | 1500 | if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1)) |
1500 | ath9k_htc_start_ani(priv); | 1501 | ath9k_htc_start_ani(priv); |
1501 | else if (priv->num_sta_assoc_vif == 0) | 1502 | else if (priv->num_sta_assoc_vif == 0) |
@@ -1503,13 +1504,11 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, | |||
1503 | } | 1504 | } |
1504 | } | 1505 | } |
1505 | 1506 | ||
1506 | if (changed & BSS_CHANGED_BSSID) { | 1507 | if (changed & BSS_CHANGED_IBSS) { |
1507 | if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) { | 1508 | if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) { |
1508 | common->curaid = bss_conf->aid; | 1509 | common->curaid = bss_conf->aid; |
1509 | memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); | 1510 | memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); |
1510 | ath9k_htc_set_bssid(priv); | 1511 | ath9k_htc_set_bssid(priv); |
1511 | } else if (priv->ah->opmode == NL80211_IFTYPE_STATION) { | ||
1512 | ath9k_htc_choose_set_bssid(priv); | ||
1513 | } | 1512 | } |
1514 | } | 1513 | } |
1515 | 1514 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 7db1890448f2..995ca8e1302e 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -622,7 +622,7 @@ static int __ath9k_hw_init(struct ath_hw *ah) | |||
622 | 622 | ||
623 | if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_AUTO) { | 623 | if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_AUTO) { |
624 | if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCI || | 624 | if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCI || |
625 | ((AR_SREV_9160(ah) || AR_SREV_9280(ah)) && | 625 | ((AR_SREV_9160(ah) || AR_SREV_9280(ah) || AR_SREV_9287(ah)) && |
626 | !ah->is_pciexpress)) { | 626 | !ah->is_pciexpress)) { |
627 | ah->config.serialize_regmode = | 627 | ah->config.serialize_regmode = |
628 | SER_REG_MODE_ON; | 628 | SER_REG_MODE_ON; |
@@ -784,13 +784,25 @@ static void ath9k_hw_init_qos(struct ath_hw *ah) | |||
784 | 784 | ||
785 | u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah) | 785 | u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah) |
786 | { | 786 | { |
787 | struct ath_common *common = ath9k_hw_common(ah); | ||
788 | int i = 0; | ||
789 | |||
787 | REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); | 790 | REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); |
788 | udelay(100); | 791 | udelay(100); |
789 | REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); | 792 | REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); |
790 | 793 | ||
791 | while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) | 794 | while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) { |
795 | |||
792 | udelay(100); | 796 | udelay(100); |
793 | 797 | ||
798 | if (WARN_ON_ONCE(i >= 100)) { | ||
799 | ath_err(common, "PLL4 meaurement not done\n"); | ||
800 | break; | ||
801 | } | ||
802 | |||
803 | i++; | ||
804 | } | ||
805 | |||
794 | return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3; | 806 | return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3; |
795 | } | 807 | } |
796 | EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc); | 808 | EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 4de4473776ac..dac1a2709e3c 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -971,6 +971,15 @@ void ath_hw_pll_work(struct work_struct *work) | |||
971 | hw_pll_work.work); | 971 | hw_pll_work.work); |
972 | u32 pll_sqsum; | 972 | u32 pll_sqsum; |
973 | 973 | ||
974 | /* | ||
975 | * ensure that the PLL WAR is executed only | ||
976 | * after the STA is associated (or) if the | ||
977 | * beaconing had started in interfaces that | ||
978 | * uses beacons. | ||
979 | */ | ||
980 | if (!(sc->sc_flags & SC_OP_BEACONS)) | ||
981 | return; | ||
982 | |||
974 | if (AR_SREV_9485(sc->sc_ah)) { | 983 | if (AR_SREV_9485(sc->sc_ah)) { |
975 | 984 | ||
976 | ath9k_ps_wakeup(sc); | 985 | ath9k_ps_wakeup(sc); |
@@ -1443,15 +1452,6 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
1443 | } | 1452 | } |
1444 | } | 1453 | } |
1445 | 1454 | ||
1446 | if ((ah->opmode == NL80211_IFTYPE_ADHOC) || | ||
1447 | ((vif->type == NL80211_IFTYPE_ADHOC) && | ||
1448 | sc->nvifs > 0)) { | ||
1449 | ath_err(common, "Cannot create ADHOC interface when other" | ||
1450 | " interfaces already exist.\n"); | ||
1451 | ret = -EINVAL; | ||
1452 | goto out; | ||
1453 | } | ||
1454 | |||
1455 | ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); | 1455 | ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); |
1456 | 1456 | ||
1457 | sc->nvifs++; | 1457 | sc->nvifs++; |
@@ -1476,15 +1476,6 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, | |||
1476 | mutex_lock(&sc->mutex); | 1476 | mutex_lock(&sc->mutex); |
1477 | ath9k_ps_wakeup(sc); | 1477 | ath9k_ps_wakeup(sc); |
1478 | 1478 | ||
1479 | /* See if new interface type is valid. */ | ||
1480 | if ((new_type == NL80211_IFTYPE_ADHOC) && | ||
1481 | (sc->nvifs > 1)) { | ||
1482 | ath_err(common, "When using ADHOC, it must be the only" | ||
1483 | " interface.\n"); | ||
1484 | ret = -EINVAL; | ||
1485 | goto out; | ||
1486 | } | ||
1487 | |||
1488 | if (ath9k_uses_beacons(new_type) && | 1479 | if (ath9k_uses_beacons(new_type) && |
1489 | !ath9k_uses_beacons(vif->type)) { | 1480 | !ath9k_uses_beacons(vif->type)) { |
1490 | if (sc->nbcnvifs >= ATH_BCBUF) { | 1481 | if (sc->nbcnvifs >= ATH_BCBUF) { |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index e1fcc68124dc..0735aeb3b26c 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -695,9 +695,9 @@ static bool ath_edma_get_buffers(struct ath_softc *sc, | |||
695 | __skb_unlink(skb, &rx_edma->rx_fifo); | 695 | __skb_unlink(skb, &rx_edma->rx_fifo); |
696 | list_add_tail(&bf->list, &sc->rx.rxbuf); | 696 | list_add_tail(&bf->list, &sc->rx.rxbuf); |
697 | ath_rx_edma_buf_link(sc, qtype); | 697 | ath_rx_edma_buf_link(sc, qtype); |
698 | } else { | ||
699 | bf = NULL; | ||
700 | } | 698 | } |
699 | |||
700 | bf = NULL; | ||
701 | } | 701 | } |
702 | 702 | ||
703 | *dest = bf; | 703 | *dest = bf; |
@@ -822,7 +822,8 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
822 | * descriptor does contain a valid key index. This has been observed | 822 | * descriptor does contain a valid key index. This has been observed |
823 | * mostly with CCMP encryption. | 823 | * mostly with CCMP encryption. |
824 | */ | 824 | */ |
825 | if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) | 825 | if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID || |
826 | !test_bit(rx_stats->rs_keyix, common->ccmp_keymap)) | ||
826 | rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; | 827 | rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; |
827 | 828 | ||
828 | if (!rx_stats->rs_datalen) { | 829 | if (!rx_stats->rs_datalen) { |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index d59dd01d6cde..4d571394c7a8 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -938,6 +938,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
938 | struct ieee80211_tx_rate *rates; | 938 | struct ieee80211_tx_rate *rates; |
939 | const struct ieee80211_rate *rate; | 939 | const struct ieee80211_rate *rate; |
940 | struct ieee80211_hdr *hdr; | 940 | struct ieee80211_hdr *hdr; |
941 | struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu); | ||
941 | int i; | 942 | int i; |
942 | u8 rix = 0; | 943 | u8 rix = 0; |
943 | 944 | ||
@@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
948 | 949 | ||
949 | /* set dur_update_en for l-sig computation except for PS-Poll frames */ | 950 | /* set dur_update_en for l-sig computation except for PS-Poll frames */ |
950 | info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); | 951 | info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); |
951 | 952 | info->rtscts_rate = fi->rtscts_rate; | |
952 | /* | ||
953 | * We check if Short Preamble is needed for the CTS rate by | ||
954 | * checking the BSS's global flag. | ||
955 | * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. | ||
956 | */ | ||
957 | rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info); | ||
958 | info->rtscts_rate = rate->hw_value; | ||
959 | |||
960 | if (tx_info->control.vif && | ||
961 | tx_info->control.vif->bss_conf.use_short_preamble) | ||
962 | info->rtscts_rate |= rate->hw_value_short; | ||
963 | 953 | ||
964 | for (i = 0; i < 4; i++) { | 954 | for (i = 0; i < 4; i++) { |
965 | bool is_40, is_sgi, is_sp; | 955 | bool is_40, is_sgi, is_sp; |
@@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, | |||
1001 | } | 991 | } |
1002 | 992 | ||
1003 | /* legacy rates */ | 993 | /* legacy rates */ |
994 | rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; | ||
1004 | if ((tx_info->band == IEEE80211_BAND_2GHZ) && | 995 | if ((tx_info->band == IEEE80211_BAND_2GHZ) && |
1005 | !(rate->flags & IEEE80211_RATE_ERP_G)) | 996 | !(rate->flags & IEEE80211_RATE_ERP_G)) |
1006 | phy = WLAN_RC_PHY_CCK; | 997 | phy = WLAN_RC_PHY_CCK; |
1007 | else | 998 | else |
1008 | phy = WLAN_RC_PHY_OFDM; | 999 | phy = WLAN_RC_PHY_OFDM; |
1009 | 1000 | ||
1010 | rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx]; | ||
1011 | info->rates[i].Rate = rate->hw_value; | 1001 | info->rates[i].Rate = rate->hw_value; |
1012 | if (rate->hw_value_short) { | 1002 | if (rate->hw_value_short) { |
1013 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | 1003 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |
@@ -1776,10 +1766,22 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1776 | struct ieee80211_sta *sta = tx_info->control.sta; | 1766 | struct ieee80211_sta *sta = tx_info->control.sta; |
1777 | struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; | 1767 | struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; |
1778 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1768 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1769 | const struct ieee80211_rate *rate; | ||
1779 | struct ath_frame_info *fi = get_frame_info(skb); | 1770 | struct ath_frame_info *fi = get_frame_info(skb); |
1780 | struct ath_node *an = NULL; | 1771 | struct ath_node *an = NULL; |
1781 | enum ath9k_key_type keytype; | 1772 | enum ath9k_key_type keytype; |
1773 | bool short_preamble = false; | ||
1774 | |||
1775 | /* | ||
1776 | * We check if Short Preamble is needed for the CTS rate by | ||
1777 | * checking the BSS's global flag. | ||
1778 | * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used. | ||
1779 | */ | ||
1780 | if (tx_info->control.vif && | ||
1781 | tx_info->control.vif->bss_conf.use_short_preamble) | ||
1782 | short_preamble = true; | ||
1782 | 1783 | ||
1784 | rate = ieee80211_get_rts_cts_rate(hw, tx_info); | ||
1783 | keytype = ath9k_cmn_get_hw_crypto_keytype(skb); | 1785 | keytype = ath9k_cmn_get_hw_crypto_keytype(skb); |
1784 | 1786 | ||
1785 | if (sta) | 1787 | if (sta) |
@@ -1794,6 +1796,9 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1794 | fi->keyix = ATH9K_TXKEYIX_INVALID; | 1796 | fi->keyix = ATH9K_TXKEYIX_INVALID; |
1795 | fi->keytype = keytype; | 1797 | fi->keytype = keytype; |
1796 | fi->framelen = framelen; | 1798 | fi->framelen = framelen; |
1799 | fi->rtscts_rate = rate->hw_value; | ||
1800 | if (short_preamble) | ||
1801 | fi->rtscts_rate |= rate->hw_value_short; | ||
1797 | } | 1802 | } |
1798 | 1803 | ||
1799 | u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) | 1804 | u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) |
diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c index 0e81904956cf..5c54aa43ca2d 100644 --- a/drivers/net/wireless/ath/key.c +++ b/drivers/net/wireless/ath/key.c | |||
@@ -556,6 +556,9 @@ int ath_key_config(struct ath_common *common, | |||
556 | return -EIO; | 556 | return -EIO; |
557 | 557 | ||
558 | set_bit(idx, common->keymap); | 558 | set_bit(idx, common->keymap); |
559 | if (key->cipher == WLAN_CIPHER_SUITE_CCMP) | ||
560 | set_bit(idx, common->ccmp_keymap); | ||
561 | |||
559 | if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { | 562 | if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { |
560 | set_bit(idx + 64, common->keymap); | 563 | set_bit(idx + 64, common->keymap); |
561 | set_bit(idx, common->tkip_keymap); | 564 | set_bit(idx, common->tkip_keymap); |
@@ -582,6 +585,7 @@ void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key) | |||
582 | return; | 585 | return; |
583 | 586 | ||
584 | clear_bit(key->hw_key_idx, common->keymap); | 587 | clear_bit(key->hw_key_idx, common->keymap); |
588 | clear_bit(key->hw_key_idx, common->ccmp_keymap); | ||
585 | if (key->cipher != WLAN_CIPHER_SUITE_TKIP) | 589 | if (key->cipher != WLAN_CIPHER_SUITE_TKIP) |
586 | return; | 590 | return; |
587 | 591 | ||
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index acd03a4f9730..1b988f26bdf1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -3767,7 +3767,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan) | |||
3767 | if (prev_status >= B43_STAT_STARTED) { | 3767 | if (prev_status >= B43_STAT_STARTED) { |
3768 | err = b43_wireless_core_start(up_dev); | 3768 | err = b43_wireless_core_start(up_dev); |
3769 | if (err) { | 3769 | if (err) { |
3770 | b43err(wl, "Fatal: Coult not start device for " | 3770 | b43err(wl, "Fatal: Could not start device for " |
3771 | "selected %s-GHz band\n", | 3771 | "selected %s-GHz band\n", |
3772 | band_to_string(chan->band)); | 3772 | band_to_string(chan->band)); |
3773 | b43_wireless_core_exit(up_dev); | 3773 | b43_wireless_core_exit(up_dev); |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index cd9c9bc186d9..eae691e2f7dd 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2633,7 +2633,7 @@ static int b43legacy_switch_phymode(struct b43legacy_wl *wl, | |||
2633 | if (prev_status >= B43legacy_STAT_STARTED) { | 2633 | if (prev_status >= B43legacy_STAT_STARTED) { |
2634 | err = b43legacy_wireless_core_start(up_dev); | 2634 | err = b43legacy_wireless_core_start(up_dev); |
2635 | if (err) { | 2635 | if (err) { |
2636 | b43legacyerr(wl, "Fatal: Coult not start device for " | 2636 | b43legacyerr(wl, "Fatal: Could not start device for " |
2637 | "newly selected %s-PHY mode\n", | 2637 | "newly selected %s-PHY mode\n", |
2638 | phymode_to_string(new_mode)); | 2638 | phymode_to_string(new_mode)); |
2639 | b43legacy_wireless_core_exit(up_dev); | 2639 | b43legacy_wireless_core_exit(up_dev); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index e7c157e5ebeb..7f97dec8534d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -2239,6 +2239,7 @@ static ssize_t iwl_dbgfs_echo_test_write(struct file *file, | |||
2239 | return count; | 2239 | return count; |
2240 | } | 2240 | } |
2241 | 2241 | ||
2242 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
2242 | static ssize_t iwl_dbgfs_log_event_read(struct file *file, | 2243 | static ssize_t iwl_dbgfs_log_event_read(struct file *file, |
2243 | char __user *user_buf, | 2244 | char __user *user_buf, |
2244 | size_t count, loff_t *ppos) | 2245 | size_t count, loff_t *ppos) |
@@ -2276,6 +2277,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file, | |||
2276 | 2277 | ||
2277 | return count; | 2278 | return count; |
2278 | } | 2279 | } |
2280 | #endif | ||
2279 | 2281 | ||
2280 | static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file, | 2282 | static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file, |
2281 | char __user *user_buf, | 2283 | char __user *user_buf, |
@@ -2345,7 +2347,9 @@ DEBUGFS_READ_FILE_OPS(bt_traffic); | |||
2345 | DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); | 2347 | DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); |
2346 | DEBUGFS_READ_FILE_OPS(reply_tx_error); | 2348 | DEBUGFS_READ_FILE_OPS(reply_tx_error); |
2347 | DEBUGFS_WRITE_FILE_OPS(echo_test); | 2349 | DEBUGFS_WRITE_FILE_OPS(echo_test); |
2350 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
2348 | DEBUGFS_READ_WRITE_FILE_OPS(log_event); | 2351 | DEBUGFS_READ_WRITE_FILE_OPS(log_event); |
2352 | #endif | ||
2349 | DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled); | 2353 | DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled); |
2350 | 2354 | ||
2351 | /* | 2355 | /* |
@@ -2405,7 +2409,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
2405 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); | 2409 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); |
2406 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); | 2410 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); |
2407 | DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR); | 2411 | DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR); |
2412 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
2408 | DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR); | 2413 | DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR); |
2414 | #endif | ||
2409 | 2415 | ||
2410 | if (iwl_advanced_bt_coexist(priv)) | 2416 | if (iwl_advanced_bt_coexist(priv)) |
2411 | DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); | 2417 | DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index 3ee23134c02b..013680332f07 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -796,6 +796,18 @@ int iwlagn_mac_sta_state(struct ieee80211_hw *hw, | |||
796 | switch (op) { | 796 | switch (op) { |
797 | case ADD: | 797 | case ADD: |
798 | ret = iwlagn_mac_sta_add(hw, vif, sta); | 798 | ret = iwlagn_mac_sta_add(hw, vif, sta); |
799 | if (ret) | ||
800 | break; | ||
801 | /* | ||
802 | * Clear the in-progress flag, the AP station entry was added | ||
803 | * but we'll initialize LQ only when we've associated (which | ||
804 | * would also clear the in-progress flag). This is necessary | ||
805 | * in case we never initialize LQ because association fails. | ||
806 | */ | ||
807 | spin_lock_bh(&priv->sta_lock); | ||
808 | priv->stations[iwl_sta_id(sta)].used &= | ||
809 | ~IWL_STA_UCODE_INPROGRESS; | ||
810 | spin_unlock_bh(&priv->sta_lock); | ||
799 | break; | 811 | break; |
800 | case REMOVE: | 812 | case REMOVE: |
801 | ret = iwlagn_mac_sta_remove(hw, vif, sta); | 813 | ret = iwlagn_mac_sta_remove(hw, vif, sta); |
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c index 9c44088054dd..900ee129e825 100644 --- a/drivers/net/wireless/mwifiex/11n_rxreorder.c +++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c | |||
@@ -256,7 +256,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, | |||
256 | else | 256 | else |
257 | last_seq = priv->rx_seq[tid]; | 257 | last_seq = priv->rx_seq[tid]; |
258 | 258 | ||
259 | if (last_seq >= new_node->start_win) | 259 | if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM && |
260 | last_seq >= new_node->start_win) | ||
260 | new_node->start_win = last_seq + 1; | 261 | new_node->start_win = last_seq + 1; |
261 | 262 | ||
262 | new_node->win_size = win_size; | 263 | new_node->win_size = win_size; |
@@ -596,5 +597,5 @@ void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv) | |||
596 | spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags); | 597 | spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags); |
597 | 598 | ||
598 | INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr); | 599 | INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr); |
599 | memset(priv->rx_seq, 0, sizeof(priv->rx_seq)); | 600 | mwifiex_reset_11n_rx_seq_num(priv); |
600 | } | 601 | } |
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.h b/drivers/net/wireless/mwifiex/11n_rxreorder.h index f1bffebabc60..6c9815a0f5d8 100644 --- a/drivers/net/wireless/mwifiex/11n_rxreorder.h +++ b/drivers/net/wireless/mwifiex/11n_rxreorder.h | |||
@@ -37,6 +37,13 @@ | |||
37 | 37 | ||
38 | #define ADDBA_RSP_STATUS_ACCEPT 0 | 38 | #define ADDBA_RSP_STATUS_ACCEPT 0 |
39 | 39 | ||
40 | #define MWIFIEX_DEF_11N_RX_SEQ_NUM 0xffff | ||
41 | |||
42 | static inline void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv) | ||
43 | { | ||
44 | memset(priv->rx_seq, 0xff, sizeof(priv->rx_seq)); | ||
45 | } | ||
46 | |||
40 | int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *, | 47 | int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *, |
41 | u16 seqNum, | 48 | u16 seqNum, |
42 | u16 tid, u8 *ta, | 49 | u16 tid, u8 *ta, |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 015fec3371a0..ce61b6fae1c9 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1484,7 +1484,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1484 | struct wireless_dev *wdev; | 1484 | struct wireless_dev *wdev; |
1485 | 1485 | ||
1486 | if (!adapter) | 1486 | if (!adapter) |
1487 | return NULL; | 1487 | return ERR_PTR(-EFAULT); |
1488 | 1488 | ||
1489 | switch (type) { | 1489 | switch (type) { |
1490 | case NL80211_IFTYPE_UNSPECIFIED: | 1490 | case NL80211_IFTYPE_UNSPECIFIED: |
@@ -1494,12 +1494,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1494 | if (priv->bss_mode) { | 1494 | if (priv->bss_mode) { |
1495 | wiphy_err(wiphy, | 1495 | wiphy_err(wiphy, |
1496 | "cannot create multiple sta/adhoc ifaces\n"); | 1496 | "cannot create multiple sta/adhoc ifaces\n"); |
1497 | return NULL; | 1497 | return ERR_PTR(-EINVAL); |
1498 | } | 1498 | } |
1499 | 1499 | ||
1500 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1500 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
1501 | if (!wdev) | 1501 | if (!wdev) |
1502 | return NULL; | 1502 | return ERR_PTR(-ENOMEM); |
1503 | 1503 | ||
1504 | wdev->wiphy = wiphy; | 1504 | wdev->wiphy = wiphy; |
1505 | priv->wdev = wdev; | 1505 | priv->wdev = wdev; |
@@ -1522,12 +1522,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1522 | 1522 | ||
1523 | if (priv->bss_mode) { | 1523 | if (priv->bss_mode) { |
1524 | wiphy_err(wiphy, "Can't create multiple AP interfaces"); | 1524 | wiphy_err(wiphy, "Can't create multiple AP interfaces"); |
1525 | return NULL; | 1525 | return ERR_PTR(-EINVAL); |
1526 | } | 1526 | } |
1527 | 1527 | ||
1528 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1528 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
1529 | if (!wdev) | 1529 | if (!wdev) |
1530 | return NULL; | 1530 | return ERR_PTR(-ENOMEM); |
1531 | 1531 | ||
1532 | priv->wdev = wdev; | 1532 | priv->wdev = wdev; |
1533 | wdev->wiphy = wiphy; | 1533 | wdev->wiphy = wiphy; |
@@ -1544,14 +1544,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1544 | break; | 1544 | break; |
1545 | default: | 1545 | default: |
1546 | wiphy_err(wiphy, "type not supported\n"); | 1546 | wiphy_err(wiphy, "type not supported\n"); |
1547 | return NULL; | 1547 | return ERR_PTR(-EINVAL); |
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, | 1550 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, |
1551 | ether_setup, 1); | 1551 | ether_setup, 1); |
1552 | if (!dev) { | 1552 | if (!dev) { |
1553 | wiphy_err(wiphy, "no memory available for netdevice\n"); | 1553 | wiphy_err(wiphy, "no memory available for netdevice\n"); |
1554 | goto error; | 1554 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
1555 | return ERR_PTR(-ENOMEM); | ||
1555 | } | 1556 | } |
1556 | 1557 | ||
1557 | mwifiex_init_priv_params(priv, dev); | 1558 | mwifiex_init_priv_params(priv, dev); |
@@ -1582,7 +1583,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1582 | /* Register network device */ | 1583 | /* Register network device */ |
1583 | if (register_netdevice(dev)) { | 1584 | if (register_netdevice(dev)) { |
1584 | wiphy_err(wiphy, "cannot register virtual network device\n"); | 1585 | wiphy_err(wiphy, "cannot register virtual network device\n"); |
1585 | goto error; | 1586 | free_netdev(dev); |
1587 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | ||
1588 | return ERR_PTR(-EFAULT); | ||
1586 | } | 1589 | } |
1587 | 1590 | ||
1588 | sema_init(&priv->async_sem, 1); | 1591 | sema_init(&priv->async_sem, 1); |
@@ -1594,12 +1597,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1594 | mwifiex_dev_debugfs_init(priv); | 1597 | mwifiex_dev_debugfs_init(priv); |
1595 | #endif | 1598 | #endif |
1596 | return dev; | 1599 | return dev; |
1597 | error: | ||
1598 | if (dev && (dev->reg_state == NETREG_UNREGISTERED)) | ||
1599 | free_netdev(dev); | ||
1600 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | ||
1601 | |||
1602 | return NULL; | ||
1603 | } | 1600 | } |
1604 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); | 1601 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); |
1605 | 1602 | ||
diff --git a/drivers/net/wireless/mwifiex/ie.c b/drivers/net/wireless/mwifiex/ie.c index ceb82cd749cc..383820a52beb 100644 --- a/drivers/net/wireless/mwifiex/ie.c +++ b/drivers/net/wireless/mwifiex/ie.c | |||
@@ -213,6 +213,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv, | |||
213 | /* save assoc resp ie index after auto-indexing */ | 213 | /* save assoc resp ie index after auto-indexing */ |
214 | *assoc_idx = *((u16 *)pos); | 214 | *assoc_idx = *((u16 *)pos); |
215 | 215 | ||
216 | kfree(ap_custom_ie); | ||
216 | return ret; | 217 | return ret; |
217 | } | 218 | } |
218 | 219 | ||
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index e0377473282f..fc8a9bfa1248 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -978,10 +978,10 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter, | |||
978 | dev_dbg(adapter->dev, "info: --- Rx: Event ---\n"); | 978 | dev_dbg(adapter->dev, "info: --- Rx: Event ---\n"); |
979 | adapter->event_cause = *(u32 *) skb->data; | 979 | adapter->event_cause = *(u32 *) skb->data; |
980 | 980 | ||
981 | skb_pull(skb, MWIFIEX_EVENT_HEADER_LEN); | ||
982 | |||
983 | if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE)) | 981 | if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE)) |
984 | memcpy(adapter->event_body, skb->data, skb->len); | 982 | memcpy(adapter->event_body, |
983 | skb->data + MWIFIEX_EVENT_HEADER_LEN, | ||
984 | skb->len); | ||
985 | 985 | ||
986 | /* event cause has been saved to adapter->event_cause */ | 986 | /* event cause has been saved to adapter->event_cause */ |
987 | adapter->event_received = true; | 987 | adapter->event_received = true; |
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index 4ace5a3dcd23..11e731f3581c 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -406,9 +406,9 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
406 | break; | 406 | break; |
407 | 407 | ||
408 | case EVENT_UAP_STA_ASSOC: | 408 | case EVENT_UAP_STA_ASSOC: |
409 | skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER); | ||
410 | memset(&sinfo, 0, sizeof(sinfo)); | 409 | memset(&sinfo, 0, sizeof(sinfo)); |
411 | event = (struct mwifiex_assoc_event *)adapter->event_skb->data; | 410 | event = (struct mwifiex_assoc_event *) |
411 | (adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER); | ||
412 | if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { | 412 | if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { |
413 | len = -1; | 413 | len = -1; |
414 | 414 | ||
@@ -433,9 +433,8 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) | |||
433 | GFP_KERNEL); | 433 | GFP_KERNEL); |
434 | break; | 434 | break; |
435 | case EVENT_UAP_STA_DEAUTH: | 435 | case EVENT_UAP_STA_DEAUTH: |
436 | skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER); | 436 | cfg80211_del_sta(priv->netdev, adapter->event_body + |
437 | cfg80211_del_sta(priv->netdev, adapter->event_skb->data, | 437 | MWIFIEX_UAP_EVENT_EXTRA_HEADER, GFP_KERNEL); |
438 | GFP_KERNEL); | ||
439 | break; | 438 | break; |
440 | case EVENT_UAP_BSS_IDLE: | 439 | case EVENT_UAP_BSS_IDLE: |
441 | priv->media_connected = false; | 440 | priv->media_connected = false; |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index e2faec4db108..cecb27283196 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -161,15 +161,11 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, | |||
161 | goto done; | 161 | goto done; |
162 | 162 | ||
163 | for (i = 0; i < adapter->priv_num; i++) { | 163 | for (i = 0; i < adapter->priv_num; i++) { |
164 | |||
165 | tpriv = adapter->priv[i]; | 164 | tpriv = adapter->priv[i]; |
166 | 165 | ||
167 | if ((GET_BSS_ROLE(tpriv) == MWIFIEX_BSS_ROLE_STA) && | 166 | if (tpriv->media_connected && |
168 | (tpriv->media_connected)) { | 167 | netif_queue_stopped(tpriv->netdev)) |
169 | if (netif_queue_stopped(tpriv->netdev)) | 168 | mwifiex_wake_up_net_dev_queue(tpriv->netdev, adapter); |
170 | mwifiex_wake_up_net_dev_queue(tpriv->netdev, | ||
171 | adapter); | ||
172 | } | ||
173 | } | 169 | } |
174 | done: | 170 | done: |
175 | dev_kfree_skb_any(skb); | 171 | dev_kfree_skb_any(skb); |
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c index 8173ab66066d..89f9a2a45de3 100644 --- a/drivers/net/wireless/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/mwifiex/uap_cmd.c | |||
@@ -27,6 +27,17 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, | |||
27 | struct cfg80211_ap_settings *params) { | 27 | struct cfg80211_ap_settings *params) { |
28 | int i; | 28 | int i; |
29 | 29 | ||
30 | if (!params->privacy) { | ||
31 | bss_config->protocol = PROTOCOL_NO_SECURITY; | ||
32 | bss_config->key_mgmt = KEY_MGMT_NONE; | ||
33 | bss_config->wpa_cfg.length = 0; | ||
34 | priv->sec_info.wep_enabled = 0; | ||
35 | priv->sec_info.wpa_enabled = 0; | ||
36 | priv->sec_info.wpa2_enabled = 0; | ||
37 | |||
38 | return 0; | ||
39 | } | ||
40 | |||
30 | switch (params->auth_type) { | 41 | switch (params->auth_type) { |
31 | case NL80211_AUTHTYPE_OPEN_SYSTEM: | 42 | case NL80211_AUTHTYPE_OPEN_SYSTEM: |
32 | bss_config->auth_mode = WLAN_AUTH_OPEN; | 43 | bss_config->auth_mode = WLAN_AUTH_OPEN; |
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c index 49ebf20c56eb..22a5916564b8 100644 --- a/drivers/net/wireless/mwifiex/usb.c +++ b/drivers/net/wireless/mwifiex/usb.c | |||
@@ -49,6 +49,7 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, | |||
49 | struct device *dev = adapter->dev; | 49 | struct device *dev = adapter->dev; |
50 | u32 recv_type; | 50 | u32 recv_type; |
51 | __le32 tmp; | 51 | __le32 tmp; |
52 | int ret; | ||
52 | 53 | ||
53 | if (adapter->hs_activated) | 54 | if (adapter->hs_activated) |
54 | mwifiex_process_hs_config(adapter); | 55 | mwifiex_process_hs_config(adapter); |
@@ -69,16 +70,19 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, | |||
69 | case MWIFIEX_USB_TYPE_CMD: | 70 | case MWIFIEX_USB_TYPE_CMD: |
70 | if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) { | 71 | if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) { |
71 | dev_err(dev, "CMD: skb->len too large\n"); | 72 | dev_err(dev, "CMD: skb->len too large\n"); |
72 | return -1; | 73 | ret = -1; |
74 | goto exit_restore_skb; | ||
73 | } else if (!adapter->curr_cmd) { | 75 | } else if (!adapter->curr_cmd) { |
74 | dev_dbg(dev, "CMD: no curr_cmd\n"); | 76 | dev_dbg(dev, "CMD: no curr_cmd\n"); |
75 | if (adapter->ps_state == PS_STATE_SLEEP_CFM) { | 77 | if (adapter->ps_state == PS_STATE_SLEEP_CFM) { |
76 | mwifiex_process_sleep_confirm_resp( | 78 | mwifiex_process_sleep_confirm_resp( |
77 | adapter, skb->data, | 79 | adapter, skb->data, |
78 | skb->len); | 80 | skb->len); |
79 | return 0; | 81 | ret = 0; |
82 | goto exit_restore_skb; | ||
80 | } | 83 | } |
81 | return -1; | 84 | ret = -1; |
85 | goto exit_restore_skb; | ||
82 | } | 86 | } |
83 | 87 | ||
84 | adapter->curr_cmd->resp_skb = skb; | 88 | adapter->curr_cmd->resp_skb = skb; |
@@ -87,20 +91,22 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, | |||
87 | case MWIFIEX_USB_TYPE_EVENT: | 91 | case MWIFIEX_USB_TYPE_EVENT: |
88 | if (skb->len < sizeof(u32)) { | 92 | if (skb->len < sizeof(u32)) { |
89 | dev_err(dev, "EVENT: skb->len too small\n"); | 93 | dev_err(dev, "EVENT: skb->len too small\n"); |
90 | return -1; | 94 | ret = -1; |
95 | goto exit_restore_skb; | ||
91 | } | 96 | } |
92 | skb_copy_from_linear_data(skb, &tmp, sizeof(u32)); | 97 | skb_copy_from_linear_data(skb, &tmp, sizeof(u32)); |
93 | adapter->event_cause = le32_to_cpu(tmp); | 98 | adapter->event_cause = le32_to_cpu(tmp); |
94 | skb_pull(skb, sizeof(u32)); | ||
95 | dev_dbg(dev, "event_cause %#x\n", adapter->event_cause); | 99 | dev_dbg(dev, "event_cause %#x\n", adapter->event_cause); |
96 | 100 | ||
97 | if (skb->len > MAX_EVENT_SIZE) { | 101 | if (skb->len > MAX_EVENT_SIZE) { |
98 | dev_err(dev, "EVENT: event body too large\n"); | 102 | dev_err(dev, "EVENT: event body too large\n"); |
99 | return -1; | 103 | ret = -1; |
104 | goto exit_restore_skb; | ||
100 | } | 105 | } |
101 | 106 | ||
102 | skb_copy_from_linear_data(skb, adapter->event_body, | 107 | memcpy(adapter->event_body, skb->data + |
103 | skb->len); | 108 | MWIFIEX_EVENT_HEADER_LEN, skb->len); |
109 | |||
104 | adapter->event_received = true; | 110 | adapter->event_received = true; |
105 | adapter->event_skb = skb; | 111 | adapter->event_skb = skb; |
106 | break; | 112 | break; |
@@ -124,6 +130,12 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter, | |||
124 | } | 130 | } |
125 | 131 | ||
126 | return -EINPROGRESS; | 132 | return -EINPROGRESS; |
133 | |||
134 | exit_restore_skb: | ||
135 | /* The buffer will be reused for further cmds/events */ | ||
136 | skb_push(skb, INTF_HEADER_LEN); | ||
137 | |||
138 | return ret; | ||
127 | } | 139 | } |
128 | 140 | ||
129 | static void mwifiex_usb_rx_complete(struct urb *urb) | 141 | static void mwifiex_usb_rx_complete(struct urb *urb) |
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index f3fc65515857..3fa4d4176993 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -404,6 +404,8 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter) | |||
404 | priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; | 404 | priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; |
405 | priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE; | 405 | priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE; |
406 | 406 | ||
407 | mwifiex_reset_11n_rx_seq_num(priv); | ||
408 | |||
407 | atomic_set(&priv->wmm.tx_pkts_queued, 0); | 409 | atomic_set(&priv->wmm.tx_pkts_queued, 0); |
408 | atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID); | 410 | atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID); |
409 | } | 411 | } |
@@ -1221,6 +1223,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) | |||
1221 | 1223 | ||
1222 | if (!ptr->is_11n_enabled || | 1224 | if (!ptr->is_11n_enabled || |
1223 | mwifiex_is_ba_stream_setup(priv, ptr, tid) || | 1225 | mwifiex_is_ba_stream_setup(priv, ptr, tid) || |
1226 | priv->wps.session_enable || | ||
1224 | ((priv->sec_info.wpa_enabled || | 1227 | ((priv->sec_info.wpa_enabled || |
1225 | priv->sec_info.wpa2_enabled) && | 1228 | priv->sec_info.wpa2_enabled) && |
1226 | !priv->wpa_is_gtk_set)) { | 1229 | !priv->wpa_is_gtk_set)) { |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 2e9e6af21362..dfcd02ab6cae 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -2110,7 +2110,7 @@ resize_buf: | |||
2110 | while (check_bssid_list_item(bssid, bssid_len, buf, len)) { | 2110 | while (check_bssid_list_item(bssid, bssid_len, buf, len)) { |
2111 | if (rndis_bss_info_update(usbdev, bssid) && match_bssid && | 2111 | if (rndis_bss_info_update(usbdev, bssid) && match_bssid && |
2112 | matched) { | 2112 | matched) { |
2113 | if (!ether_addr_equal(bssid->mac, match_bssid)) | 2113 | if (ether_addr_equal(bssid->mac, match_bssid)) |
2114 | *matched = true; | 2114 | *matched = true; |
2115 | } | 2115 | } |
2116 | 2116 | ||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index d228358e6a40..9970c2b1b199 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
@@ -301,9 +301,11 @@ static struct usb_device_id rtl8192c_usb_ids[] = { | |||
301 | {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ | 301 | {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ |
302 | {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ | 302 | {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ |
303 | {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ | 303 | {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ |
304 | {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/ | ||
304 | {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ | 305 | {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ |
305 | {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ | 306 | {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ |
306 | {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ | 307 | {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ |
308 | {RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/ | ||
307 | /* HP - Lite-On ,8188CUS Slim Combo */ | 309 | /* HP - Lite-On ,8188CUS Slim Combo */ |
308 | {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)}, | 310 | {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)}, |
309 | {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */ | 311 | {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */ |
@@ -346,6 +348,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { | |||
346 | {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ | 348 | {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ |
347 | {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ | 349 | {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ |
348 | {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ | 350 | {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ |
351 | {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/ | ||
349 | {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/ | 352 | {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/ |
350 | {RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/ | 353 | {RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/ |
351 | {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/ | 354 | {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/ |
diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c index ad87a1ac6462..db6430c1a084 100644 --- a/drivers/net/wireless/ti/wl1251/acx.c +++ b/drivers/net/wireless/ti/wl1251/acx.c | |||
@@ -869,7 +869,7 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime) | |||
869 | } | 869 | } |
870 | 870 | ||
871 | *mactime = tsf_info->current_tsf_lsb | | 871 | *mactime = tsf_info->current_tsf_lsb | |
872 | (tsf_info->current_tsf_msb << 31); | 872 | ((u64)tsf_info->current_tsf_msb << 32); |
873 | 873 | ||
874 | out: | 874 | out: |
875 | kfree(tsf_info); | 875 | kfree(tsf_info); |
diff --git a/drivers/net/wireless/ti/wl1251/event.c b/drivers/net/wireless/ti/wl1251/event.c index 9f15ccaf8f05..5ec50a476a69 100644 --- a/drivers/net/wireless/ti/wl1251/event.c +++ b/drivers/net/wireless/ti/wl1251/event.c | |||
@@ -76,8 +76,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox) | |||
76 | } | 76 | } |
77 | } | 77 | } |
78 | 78 | ||
79 | if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID && | 79 | if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) { |
80 | wl->station_mode != STATION_ACTIVE_MODE) { | ||
81 | wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT"); | 80 | wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT"); |
82 | 81 | ||
83 | /* indicate to the stack, that beacons have been lost */ | 82 | /* indicate to the stack, that beacons have been lost */ |
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c index 87f6305bda2c..567660cd2fcd 100644 --- a/drivers/net/wireless/ti/wl1251/spi.c +++ b/drivers/net/wireless/ti/wl1251/spi.c | |||
@@ -73,6 +73,8 @@ static void wl1251_spi_reset(struct wl1251 *wl) | |||
73 | spi_sync(wl_to_spi(wl), &m); | 73 | spi_sync(wl_to_spi(wl), &m); |
74 | 74 | ||
75 | wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); | 75 | wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); |
76 | |||
77 | kfree(cmd); | ||
76 | } | 78 | } |
77 | 79 | ||
78 | static void wl1251_spi_wake(struct wl1251 *wl) | 80 | static void wl1251_spi_wake(struct wl1251 *wl) |
@@ -127,6 +129,8 @@ static void wl1251_spi_wake(struct wl1251 *wl) | |||
127 | spi_sync(wl_to_spi(wl), &m); | 129 | spi_sync(wl_to_spi(wl), &m); |
128 | 130 | ||
129 | wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN); | 131 | wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN); |
132 | |||
133 | kfree(cmd); | ||
130 | } | 134 | } |
131 | 135 | ||
132 | static void wl1251_spi_reset_wake(struct wl1251 *wl) | 136 | static void wl1251_spi_reset_wake(struct wl1251 *wl) |
diff --git a/drivers/net/wireless/ti/wlcore/Kconfig b/drivers/net/wireless/ti/wlcore/Kconfig index 54156b0b5c2d..d7b907e67170 100644 --- a/drivers/net/wireless/ti/wlcore/Kconfig +++ b/drivers/net/wireless/ti/wlcore/Kconfig | |||
@@ -1,7 +1,6 @@ | |||
1 | config WLCORE | 1 | config WLCORE |
2 | tristate "TI wlcore support" | 2 | tristate "TI wlcore support" |
3 | depends on WL_TI && GENERIC_HARDIRQS && MAC80211 | 3 | depends on WL_TI && GENERIC_HARDIRQS && MAC80211 |
4 | depends on INET | ||
5 | select FW_LOADER | 4 | select FW_LOADER |
6 | ---help--- | 5 | ---help--- |
7 | This module contains the main code for TI WLAN chips. It abstracts | 6 | This module contains the main code for TI WLAN chips. It abstracts |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 2027afe405fe..30899901aef5 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1935,14 +1935,14 @@ static int __devexit xennet_remove(struct xenbus_device *dev) | |||
1935 | 1935 | ||
1936 | dev_dbg(&dev->dev, "%s\n", dev->nodename); | 1936 | dev_dbg(&dev->dev, "%s\n", dev->nodename); |
1937 | 1937 | ||
1938 | unregister_netdev(info->netdev); | ||
1939 | |||
1940 | xennet_disconnect_backend(info); | 1938 | xennet_disconnect_backend(info); |
1941 | 1939 | ||
1942 | del_timer_sync(&info->rx_refill_timer); | ||
1943 | |||
1944 | xennet_sysfs_delif(info->netdev); | 1940 | xennet_sysfs_delif(info->netdev); |
1945 | 1941 | ||
1942 | unregister_netdev(info->netdev); | ||
1943 | |||
1944 | del_timer_sync(&info->rx_refill_timer); | ||
1945 | |||
1946 | free_percpu(info->stats); | 1946 | free_percpu(info->stats); |
1947 | 1947 | ||
1948 | free_netdev(info->netdev); | 1948 | free_netdev(info->netdev); |
diff --git a/drivers/of/base.c b/drivers/of/base.c index d9bfd49b1935..eada3f4ef801 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -511,6 +511,22 @@ out: | |||
511 | } | 511 | } |
512 | EXPORT_SYMBOL(of_find_node_with_property); | 512 | EXPORT_SYMBOL(of_find_node_with_property); |
513 | 513 | ||
514 | static const struct of_device_id *of_match_compat(const struct of_device_id *matches, | ||
515 | const char *compat) | ||
516 | { | ||
517 | while (matches->name[0] || matches->type[0] || matches->compatible[0]) { | ||
518 | const char *cp = matches->compatible; | ||
519 | int len = strlen(cp); | ||
520 | |||
521 | if (len > 0 && of_compat_cmp(compat, cp, len) == 0) | ||
522 | return matches; | ||
523 | |||
524 | matches++; | ||
525 | } | ||
526 | |||
527 | return NULL; | ||
528 | } | ||
529 | |||
514 | /** | 530 | /** |
515 | * of_match_node - Tell if an device_node has a matching of_match structure | 531 | * of_match_node - Tell if an device_node has a matching of_match structure |
516 | * @matches: array of of device match structures to search in | 532 | * @matches: array of of device match structures to search in |
@@ -521,9 +537,18 @@ EXPORT_SYMBOL(of_find_node_with_property); | |||
521 | const struct of_device_id *of_match_node(const struct of_device_id *matches, | 537 | const struct of_device_id *of_match_node(const struct of_device_id *matches, |
522 | const struct device_node *node) | 538 | const struct device_node *node) |
523 | { | 539 | { |
540 | struct property *prop; | ||
541 | const char *cp; | ||
542 | |||
524 | if (!matches) | 543 | if (!matches) |
525 | return NULL; | 544 | return NULL; |
526 | 545 | ||
546 | of_property_for_each_string(node, "compatible", prop, cp) { | ||
547 | const struct of_device_id *match = of_match_compat(matches, cp); | ||
548 | if (match) | ||
549 | return match; | ||
550 | } | ||
551 | |||
527 | while (matches->name[0] || matches->type[0] || matches->compatible[0]) { | 552 | while (matches->name[0] || matches->type[0] || matches->compatible[0]) { |
528 | int match = 1; | 553 | int match = 1; |
529 | if (matches->name[0]) | 554 | if (matches->name[0]) |
@@ -532,10 +557,7 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches, | |||
532 | if (matches->type[0]) | 557 | if (matches->type[0]) |
533 | match &= node->type | 558 | match &= node->type |
534 | && !strcmp(matches->type, node->type); | 559 | && !strcmp(matches->type, node->type); |
535 | if (matches->compatible[0]) | 560 | if (match && !matches->compatible[0]) |
536 | match &= of_device_is_compatible(node, | ||
537 | matches->compatible); | ||
538 | if (match) | ||
539 | return matches; | 561 | return matches; |
540 | matches++; | 562 | matches++; |
541 | } | 563 | } |
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 343ad29e211c..3132ea068d95 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -462,4 +462,5 @@ int of_platform_populate(struct device_node *root, | |||
462 | of_node_put(root); | 462 | of_node_put(root); |
463 | return rc; | 463 | return rc; |
464 | } | 464 | } |
465 | EXPORT_SYMBOL_GPL(of_platform_populate); | ||
465 | #endif /* CONFIG_OF_ADDRESS */ | 466 | #endif /* CONFIG_OF_ADDRESS */ |
diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c index da14432806c6..efc4b7f308cf 100644 --- a/drivers/oprofile/oprofile_perf.c +++ b/drivers/oprofile/oprofile_perf.c | |||
@@ -25,7 +25,7 @@ static int oprofile_perf_enabled; | |||
25 | static DEFINE_MUTEX(oprofile_perf_mutex); | 25 | static DEFINE_MUTEX(oprofile_perf_mutex); |
26 | 26 | ||
27 | static struct op_counter_config *counter_config; | 27 | static struct op_counter_config *counter_config; |
28 | static struct perf_event **perf_events[nr_cpumask_bits]; | 28 | static struct perf_event **perf_events[NR_CPUS]; |
29 | static int num_counters; | 29 | static int num_counters; |
30 | 30 | ||
31 | /* | 31 | /* |
diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c index afb50ee64598..4ba4636b6a4a 100644 --- a/drivers/pinctrl/pinctrl-mxs.c +++ b/drivers/pinctrl/pinctrl-mxs.c | |||
@@ -137,7 +137,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
137 | 137 | ||
138 | free_group: | 138 | free_group: |
139 | if (!purecfg) | 139 | if (!purecfg) |
140 | free(group); | 140 | kfree(group); |
141 | free: | 141 | free: |
142 | kfree(new_map); | 142 | kfree(new_map); |
143 | return ret; | 143 | return ret; |
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index e8937e7e4999..3e7e47d6b385 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -1438,7 +1438,27 @@ static int nmk_pmx_enable(struct pinctrl_dev *pctldev, unsigned function, | |||
1438 | 1438 | ||
1439 | dev_dbg(npct->dev, "enable group %s, %u pins\n", g->name, g->npins); | 1439 | dev_dbg(npct->dev, "enable group %s, %u pins\n", g->name, g->npins); |
1440 | 1440 | ||
1441 | /* Handle this special glitch on altfunction C */ | 1441 | /* |
1442 | * If we're setting altfunc C by setting both AFSLA and AFSLB to 1, | ||
1443 | * we may pass through an undesired state. In this case we take | ||
1444 | * some extra care. | ||
1445 | * | ||
1446 | * Safe sequence used to switch IOs between GPIO and Alternate-C mode: | ||
1447 | * - Save SLPM registers (since we have a shadow register in the | ||
1448 | * nmk_chip we're using that as backup) | ||
1449 | * - Set SLPM=0 for the IOs you want to switch and others to 1 | ||
1450 | * - Configure the GPIO registers for the IOs that are being switched | ||
1451 | * - Set IOFORCE=1 | ||
1452 | * - Modify the AFLSA/B registers for the IOs that are being switched | ||
1453 | * - Set IOFORCE=0 | ||
1454 | * - Restore SLPM registers | ||
1455 | * - Any spurious wake up event during switch sequence to be ignored | ||
1456 | * and cleared | ||
1457 | * | ||
1458 | * We REALLY need to save ALL slpm registers, because the external | ||
1459 | * IOFORCE will switch *all* ports to their sleepmode setting to as | ||
1460 | * to avoid glitches. (Not just one port!) | ||
1461 | */ | ||
1442 | glitch = (g->altsetting == NMK_GPIO_ALT_C); | 1462 | glitch = (g->altsetting == NMK_GPIO_ALT_C); |
1443 | 1463 | ||
1444 | if (glitch) { | 1464 | if (glitch) { |
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c index 5ae50aadf885..b3f6b2873fdd 100644 --- a/drivers/pinctrl/spear/pinctrl-spear.c +++ b/drivers/pinctrl/spear/pinctrl-spear.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for the ST Microelectronics SPEAr pinmux | 2 | * Driver for the ST Microelectronics SPEAr pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * Inspired from: | 7 | * Inspired from: |
8 | * - U300 Pinctl drivers | 8 | * - U300 Pinctl drivers |
diff --git a/drivers/pinctrl/spear/pinctrl-spear.h b/drivers/pinctrl/spear/pinctrl-spear.h index 9155783bb47f..d950eb78d939 100644 --- a/drivers/pinctrl/spear/pinctrl-spear.h +++ b/drivers/pinctrl/spear/pinctrl-spear.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver header file for the ST Microelectronics SPEAr pinmux | 2 | * Driver header file for the ST Microelectronics SPEAr pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/pinctrl/spear/pinctrl-spear1310.c b/drivers/pinctrl/spear/pinctrl-spear1310.c index fff168be7f00..d6cca8c81b92 100644 --- a/drivers/pinctrl/spear/pinctrl-spear1310.c +++ b/drivers/pinctrl/spear/pinctrl-spear1310.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for the ST Microelectronics SPEAr1310 pinmux | 2 | * Driver for the ST Microelectronics SPEAr1310 pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
@@ -2192,7 +2192,7 @@ static void __exit spear1310_pinctrl_exit(void) | |||
2192 | } | 2192 | } |
2193 | module_exit(spear1310_pinctrl_exit); | 2193 | module_exit(spear1310_pinctrl_exit); |
2194 | 2194 | ||
2195 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 2195 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
2196 | MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver"); | 2196 | MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver"); |
2197 | MODULE_LICENSE("GPL v2"); | 2197 | MODULE_LICENSE("GPL v2"); |
2198 | MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match); | 2198 | MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match); |
diff --git a/drivers/pinctrl/spear/pinctrl-spear1340.c b/drivers/pinctrl/spear/pinctrl-spear1340.c index a8ab2a6f51bf..a0eb057e55bd 100644 --- a/drivers/pinctrl/spear/pinctrl-spear1340.c +++ b/drivers/pinctrl/spear/pinctrl-spear1340.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for the ST Microelectronics SPEAr1340 pinmux | 2 | * Driver for the ST Microelectronics SPEAr1340 pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
@@ -1983,7 +1983,7 @@ static void __exit spear1340_pinctrl_exit(void) | |||
1983 | } | 1983 | } |
1984 | module_exit(spear1340_pinctrl_exit); | 1984 | module_exit(spear1340_pinctrl_exit); |
1985 | 1985 | ||
1986 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 1986 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
1987 | MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver"); | 1987 | MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver"); |
1988 | MODULE_LICENSE("GPL v2"); | 1988 | MODULE_LICENSE("GPL v2"); |
1989 | MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match); | 1989 | MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match); |
diff --git a/drivers/pinctrl/spear/pinctrl-spear300.c b/drivers/pinctrl/spear/pinctrl-spear300.c index 9c82a35e4e78..4dfc2849b172 100644 --- a/drivers/pinctrl/spear/pinctrl-spear300.c +++ b/drivers/pinctrl/spear/pinctrl-spear300.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for the ST Microelectronics SPEAr300 pinmux | 2 | * Driver for the ST Microelectronics SPEAr300 pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
@@ -702,7 +702,7 @@ static void __exit spear300_pinctrl_exit(void) | |||
702 | } | 702 | } |
703 | module_exit(spear300_pinctrl_exit); | 703 | module_exit(spear300_pinctrl_exit); |
704 | 704 | ||
705 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 705 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
706 | MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver"); | 706 | MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver"); |
707 | MODULE_LICENSE("GPL v2"); | 707 | MODULE_LICENSE("GPL v2"); |
708 | MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match); | 708 | MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match); |
diff --git a/drivers/pinctrl/spear/pinctrl-spear310.c b/drivers/pinctrl/spear/pinctrl-spear310.c index 1a9707605125..96883693fb7e 100644 --- a/drivers/pinctrl/spear/pinctrl-spear310.c +++ b/drivers/pinctrl/spear/pinctrl-spear310.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for the ST Microelectronics SPEAr310 pinmux | 2 | * Driver for the ST Microelectronics SPEAr310 pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
@@ -425,7 +425,7 @@ static void __exit spear310_pinctrl_exit(void) | |||
425 | } | 425 | } |
426 | module_exit(spear310_pinctrl_exit); | 426 | module_exit(spear310_pinctrl_exit); |
427 | 427 | ||
428 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 428 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
429 | MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver"); | 429 | MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver"); |
430 | MODULE_LICENSE("GPL v2"); | 430 | MODULE_LICENSE("GPL v2"); |
431 | MODULE_DEVICE_TABLE(of, SPEAr310_pinctrl_of_match); | 431 | MODULE_DEVICE_TABLE(of, SPEAr310_pinctrl_of_match); |
diff --git a/drivers/pinctrl/spear/pinctrl-spear320.c b/drivers/pinctrl/spear/pinctrl-spear320.c index de726e6c283a..020b1e0bdb3e 100644 --- a/drivers/pinctrl/spear/pinctrl-spear320.c +++ b/drivers/pinctrl/spear/pinctrl-spear320.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for the ST Microelectronics SPEAr320 pinmux | 2 | * Driver for the ST Microelectronics SPEAr320 pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
@@ -3462,7 +3462,7 @@ static void __exit spear320_pinctrl_exit(void) | |||
3462 | } | 3462 | } |
3463 | module_exit(spear320_pinctrl_exit); | 3463 | module_exit(spear320_pinctrl_exit); |
3464 | 3464 | ||
3465 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 3465 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
3466 | MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver"); | 3466 | MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver"); |
3467 | MODULE_LICENSE("GPL v2"); | 3467 | MODULE_LICENSE("GPL v2"); |
3468 | MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match); | 3468 | MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match); |
diff --git a/drivers/pinctrl/spear/pinctrl-spear3xx.c b/drivers/pinctrl/spear/pinctrl-spear3xx.c index 91c883bc46a6..0242378f7cb8 100644 --- a/drivers/pinctrl/spear/pinctrl-spear3xx.c +++ b/drivers/pinctrl/spear/pinctrl-spear3xx.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for the ST Microelectronics SPEAr3xx pinmux | 2 | * Driver for the ST Microelectronics SPEAr3xx pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/pinctrl/spear/pinctrl-spear3xx.h b/drivers/pinctrl/spear/pinctrl-spear3xx.h index 5d5fdd8df7b8..31f44347f17c 100644 --- a/drivers/pinctrl/spear/pinctrl-spear3xx.h +++ b/drivers/pinctrl/spear/pinctrl-spear3xx.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * Header file for the ST Microelectronics SPEAr3xx pinmux | 2 | * Header file for the ST Microelectronics SPEAr3xx pinmux |
3 | * | 3 | * |
4 | * Copyright (C) 2012 ST Microelectronics | 4 | * Copyright (C) 2012 ST Microelectronics |
5 | * Viresh Kumar <viresh.kumar@st.com> | 5 | * Viresh Kumar <viresh.linux@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 09a737c868b5..8b4b3829d9e7 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2519,9 +2519,12 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load) | |||
2519 | { | 2519 | { |
2520 | struct regulator_dev *rdev = regulator->rdev; | 2520 | struct regulator_dev *rdev = regulator->rdev; |
2521 | struct regulator *consumer; | 2521 | struct regulator *consumer; |
2522 | int ret, output_uV, input_uV, total_uA_load = 0; | 2522 | int ret, output_uV, input_uV = 0, total_uA_load = 0; |
2523 | unsigned int mode; | 2523 | unsigned int mode; |
2524 | 2524 | ||
2525 | if (rdev->supply) | ||
2526 | input_uV = regulator_get_voltage(rdev->supply); | ||
2527 | |||
2525 | mutex_lock(&rdev->mutex); | 2528 | mutex_lock(&rdev->mutex); |
2526 | 2529 | ||
2527 | /* | 2530 | /* |
@@ -2554,10 +2557,7 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load) | |||
2554 | goto out; | 2557 | goto out; |
2555 | } | 2558 | } |
2556 | 2559 | ||
2557 | /* get input voltage */ | 2560 | /* No supply? Use constraint voltage */ |
2558 | input_uV = 0; | ||
2559 | if (rdev->supply) | ||
2560 | input_uV = regulator_get_voltage(rdev->supply); | ||
2561 | if (input_uV <= 0) | 2561 | if (input_uV <= 0) |
2562 | input_uV = rdev->constraints->input_uV; | 2562 | input_uV = rdev->constraints->input_uV; |
2563 | if (input_uV <= 0) { | 2563 | if (input_uV <= 0) { |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 9b7ca90057d5..795f75a6ac33 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -673,7 +673,9 @@ static __devinit int palmas_probe(struct platform_device *pdev) | |||
673 | pmic->desc[id].ops = &palmas_ops_smps10; | 673 | pmic->desc[id].ops = &palmas_ops_smps10; |
674 | pmic->desc[id].vsel_reg = PALMAS_SMPS10_CTRL; | 674 | pmic->desc[id].vsel_reg = PALMAS_SMPS10_CTRL; |
675 | pmic->desc[id].vsel_mask = SMPS10_VSEL; | 675 | pmic->desc[id].vsel_mask = SMPS10_VSEL; |
676 | pmic->desc[id].enable_reg = PALMAS_SMPS10_STATUS; | 676 | pmic->desc[id].enable_reg = |
677 | PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, | ||
678 | PALMAS_SMPS10_STATUS); | ||
677 | pmic->desc[id].enable_mask = SMPS10_BOOST_EN; | 679 | pmic->desc[id].enable_mask = SMPS10_BOOST_EN; |
678 | } | 680 | } |
679 | 681 | ||
@@ -739,7 +741,8 @@ static __devinit int palmas_probe(struct platform_device *pdev) | |||
739 | 741 | ||
740 | pmic->desc[id].type = REGULATOR_VOLTAGE; | 742 | pmic->desc[id].type = REGULATOR_VOLTAGE; |
741 | pmic->desc[id].owner = THIS_MODULE; | 743 | pmic->desc[id].owner = THIS_MODULE; |
742 | pmic->desc[id].enable_reg = palmas_regs_info[id].ctrl_addr; | 744 | pmic->desc[id].enable_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, |
745 | palmas_regs_info[id].ctrl_addr); | ||
743 | pmic->desc[id].enable_mask = PALMAS_LDO1_CTRL_MODE_ACTIVE; | 746 | pmic->desc[id].enable_mask = PALMAS_LDO1_CTRL_MODE_ACTIVE; |
744 | 747 | ||
745 | if (pdata && pdata->reg_data) | 748 | if (pdata && pdata->reg_data) |
diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c index f841bd0db6aa..8f1be8586c72 100644 --- a/drivers/regulator/tps65023-regulator.c +++ b/drivers/regulator/tps65023-regulator.c | |||
@@ -71,7 +71,7 @@ | |||
71 | 71 | ||
72 | /* LDO_CTRL bitfields */ | 72 | /* LDO_CTRL bitfields */ |
73 | #define TPS65023_LDO_CTRL_LDOx_SHIFT(ldo_id) ((ldo_id)*4) | 73 | #define TPS65023_LDO_CTRL_LDOx_SHIFT(ldo_id) ((ldo_id)*4) |
74 | #define TPS65023_LDO_CTRL_LDOx_MASK(ldo_id) (0x0F << ((ldo_id)*4)) | 74 | #define TPS65023_LDO_CTRL_LDOx_MASK(ldo_id) (0x07 << ((ldo_id)*4)) |
75 | 75 | ||
76 | /* Number of step-down converters available */ | 76 | /* Number of step-down converters available */ |
77 | #define TPS65023_NUM_DCDC 3 | 77 | #define TPS65023_NUM_DCDC 3 |
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c index b88b3df82381..1b299aacf22f 100644 --- a/drivers/regulator/tps6524x-regulator.c +++ b/drivers/regulator/tps6524x-regulator.c | |||
@@ -482,7 +482,7 @@ static int get_voltage_sel(struct regulator_dev *rdev) | |||
482 | info = &supply_info[rdev_get_id(rdev)]; | 482 | info = &supply_info[rdev_get_id(rdev)]; |
483 | 483 | ||
484 | if (info->flags & FIXED_VOLTAGE) | 484 | if (info->flags & FIXED_VOLTAGE) |
485 | return info->fixed_voltage; | 485 | return 0; |
486 | 486 | ||
487 | ret = read_field(hw, &info->voltage); | 487 | ret = read_field(hw, &info->voltage); |
488 | if (ret < 0) | 488 | if (ret < 0) |
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 24d880e78ec6..f8d818abf98c 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig | |||
@@ -4,9 +4,11 @@ menu "Remoteproc drivers (EXPERIMENTAL)" | |||
4 | config REMOTEPROC | 4 | config REMOTEPROC |
5 | tristate | 5 | tristate |
6 | depends on EXPERIMENTAL | 6 | depends on EXPERIMENTAL |
7 | select FW_CONFIG | ||
7 | 8 | ||
8 | config OMAP_REMOTEPROC | 9 | config OMAP_REMOTEPROC |
9 | tristate "OMAP remoteproc support" | 10 | tristate "OMAP remoteproc support" |
11 | depends on EXPERIMENTAL | ||
10 | depends on ARCH_OMAP4 | 12 | depends on ARCH_OMAP4 |
11 | depends on OMAP_IOMMU | 13 | depends on OMAP_IOMMU |
12 | select REMOTEPROC | 14 | select REMOTEPROC |
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 75506ec2840e..39d3aa41adda 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c | |||
@@ -188,6 +188,26 @@ static int rpmsg_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
188 | rpdev->id.name); | 188 | rpdev->id.name); |
189 | } | 189 | } |
190 | 190 | ||
191 | /** | ||
192 | * __ept_release() - deallocate an rpmsg endpoint | ||
193 | * @kref: the ept's reference count | ||
194 | * | ||
195 | * This function deallocates an ept, and is invoked when its @kref refcount | ||
196 | * drops to zero. | ||
197 | * | ||
198 | * Never invoke this function directly! | ||
199 | */ | ||
200 | static void __ept_release(struct kref *kref) | ||
201 | { | ||
202 | struct rpmsg_endpoint *ept = container_of(kref, struct rpmsg_endpoint, | ||
203 | refcount); | ||
204 | /* | ||
205 | * At this point no one holds a reference to ept anymore, | ||
206 | * so we can directly free it | ||
207 | */ | ||
208 | kfree(ept); | ||
209 | } | ||
210 | |||
191 | /* for more info, see below documentation of rpmsg_create_ept() */ | 211 | /* for more info, see below documentation of rpmsg_create_ept() */ |
192 | static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp, | 212 | static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp, |
193 | struct rpmsg_channel *rpdev, rpmsg_rx_cb_t cb, | 213 | struct rpmsg_channel *rpdev, rpmsg_rx_cb_t cb, |
@@ -206,6 +226,9 @@ static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp, | |||
206 | return NULL; | 226 | return NULL; |
207 | } | 227 | } |
208 | 228 | ||
229 | kref_init(&ept->refcount); | ||
230 | mutex_init(&ept->cb_lock); | ||
231 | |||
209 | ept->rpdev = rpdev; | 232 | ept->rpdev = rpdev; |
210 | ept->cb = cb; | 233 | ept->cb = cb; |
211 | ept->priv = priv; | 234 | ept->priv = priv; |
@@ -238,7 +261,7 @@ rem_idr: | |||
238 | idr_remove(&vrp->endpoints, request); | 261 | idr_remove(&vrp->endpoints, request); |
239 | free_ept: | 262 | free_ept: |
240 | mutex_unlock(&vrp->endpoints_lock); | 263 | mutex_unlock(&vrp->endpoints_lock); |
241 | kfree(ept); | 264 | kref_put(&ept->refcount, __ept_release); |
242 | return NULL; | 265 | return NULL; |
243 | } | 266 | } |
244 | 267 | ||
@@ -302,11 +325,17 @@ EXPORT_SYMBOL(rpmsg_create_ept); | |||
302 | static void | 325 | static void |
303 | __rpmsg_destroy_ept(struct virtproc_info *vrp, struct rpmsg_endpoint *ept) | 326 | __rpmsg_destroy_ept(struct virtproc_info *vrp, struct rpmsg_endpoint *ept) |
304 | { | 327 | { |
328 | /* make sure new inbound messages can't find this ept anymore */ | ||
305 | mutex_lock(&vrp->endpoints_lock); | 329 | mutex_lock(&vrp->endpoints_lock); |
306 | idr_remove(&vrp->endpoints, ept->addr); | 330 | idr_remove(&vrp->endpoints, ept->addr); |
307 | mutex_unlock(&vrp->endpoints_lock); | 331 | mutex_unlock(&vrp->endpoints_lock); |
308 | 332 | ||
309 | kfree(ept); | 333 | /* make sure in-flight inbound messages won't invoke cb anymore */ |
334 | mutex_lock(&ept->cb_lock); | ||
335 | ept->cb = NULL; | ||
336 | mutex_unlock(&ept->cb_lock); | ||
337 | |||
338 | kref_put(&ept->refcount, __ept_release); | ||
310 | } | 339 | } |
311 | 340 | ||
312 | /** | 341 | /** |
@@ -790,12 +819,28 @@ static void rpmsg_recv_done(struct virtqueue *rvq) | |||
790 | 819 | ||
791 | /* use the dst addr to fetch the callback of the appropriate user */ | 820 | /* use the dst addr to fetch the callback of the appropriate user */ |
792 | mutex_lock(&vrp->endpoints_lock); | 821 | mutex_lock(&vrp->endpoints_lock); |
822 | |||
793 | ept = idr_find(&vrp->endpoints, msg->dst); | 823 | ept = idr_find(&vrp->endpoints, msg->dst); |
824 | |||
825 | /* let's make sure no one deallocates ept while we use it */ | ||
826 | if (ept) | ||
827 | kref_get(&ept->refcount); | ||
828 | |||
794 | mutex_unlock(&vrp->endpoints_lock); | 829 | mutex_unlock(&vrp->endpoints_lock); |
795 | 830 | ||
796 | if (ept && ept->cb) | 831 | if (ept) { |
797 | ept->cb(ept->rpdev, msg->data, msg->len, ept->priv, msg->src); | 832 | /* make sure ept->cb doesn't go away while we use it */ |
798 | else | 833 | mutex_lock(&ept->cb_lock); |
834 | |||
835 | if (ept->cb) | ||
836 | ept->cb(ept->rpdev, msg->data, msg->len, ept->priv, | ||
837 | msg->src); | ||
838 | |||
839 | mutex_unlock(&ept->cb_lock); | ||
840 | |||
841 | /* farewell, ept, we don't need you anymore */ | ||
842 | kref_put(&ept->refcount, __ept_release); | ||
843 | } else | ||
799 | dev_warn(dev, "msg received with no recepient\n"); | 844 | dev_warn(dev, "msg received with no recepient\n"); |
800 | 845 | ||
801 | /* publish the real size of the buffer */ | 846 | /* publish the real size of the buffer */ |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 6986552b47e6..77759c78cc21 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -3960,7 +3960,7 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
3960 | { | 3960 | { |
3961 | struct qla_hw_data *ha = vha->hw; | 3961 | struct qla_hw_data *ha = vha->hw; |
3962 | struct qla_tgt *tgt = ha->tgt.qla_tgt; | 3962 | struct qla_tgt *tgt = ha->tgt.qla_tgt; |
3963 | int reason_code; | 3963 | int login_code; |
3964 | 3964 | ||
3965 | ql_dbg(ql_dbg_tgt, vha, 0xe039, | 3965 | ql_dbg(ql_dbg_tgt, vha, 0xe039, |
3966 | "scsi(%ld): ha state %d init_done %d oper_mode %d topo %d\n", | 3966 | "scsi(%ld): ha state %d init_done %d oper_mode %d topo %d\n", |
@@ -4003,9 +4003,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4003 | { | 4003 | { |
4004 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b, | 4004 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b, |
4005 | "qla_target(%d): Async LOOP_UP occured " | 4005 | "qla_target(%d): Async LOOP_UP occured " |
4006 | "(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, | 4006 | "(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, |
4007 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4007 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4008 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4008 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4009 | if (tgt->link_reinit_iocb_pending) { | 4009 | if (tgt->link_reinit_iocb_pending) { |
4010 | qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb, | 4010 | qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb, |
4011 | 0, 0, 0, 0, 0, 0); | 4011 | 0, 0, 0, 0, 0, 0); |
@@ -4020,23 +4020,24 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4020 | case MBA_RSCN_UPDATE: | 4020 | case MBA_RSCN_UPDATE: |
4021 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c, | 4021 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c, |
4022 | "qla_target(%d): Async event %#x occured " | 4022 | "qla_target(%d): Async event %#x occured " |
4023 | "(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, code, | 4023 | "(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, code, |
4024 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4024 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4025 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4025 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4026 | break; | 4026 | break; |
4027 | 4027 | ||
4028 | case MBA_PORT_UPDATE: | 4028 | case MBA_PORT_UPDATE: |
4029 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d, | 4029 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d, |
4030 | "qla_target(%d): Port update async event %#x " | 4030 | "qla_target(%d): Port update async event %#x " |
4031 | "occured: updating the ports database (m[1]=%x, m[2]=%x, " | 4031 | "occured: updating the ports database (m[0]=%x, m[1]=%x, " |
4032 | "m[3]=%x, m[4]=%x)", vha->vp_idx, code, | 4032 | "m[2]=%x, m[3]=%x)", vha->vp_idx, code, |
4033 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4033 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4034 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4034 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4035 | reason_code = le16_to_cpu(mailbox[2]); | 4035 | |
4036 | if (reason_code == 0x4) | 4036 | login_code = le16_to_cpu(mailbox[2]); |
4037 | if (login_code == 0x4) | ||
4037 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e, | 4038 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e, |
4038 | "Async MB 2: Got PLOGI Complete\n"); | 4039 | "Async MB 2: Got PLOGI Complete\n"); |
4039 | else if (reason_code == 0x7) | 4040 | else if (login_code == 0x7) |
4040 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f, | 4041 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f, |
4041 | "Async MB 2: Port Logged Out\n"); | 4042 | "Async MB 2: Port Logged Out\n"); |
4042 | break; | 4043 | break; |
@@ -4044,9 +4045,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4044 | default: | 4045 | default: |
4045 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040, | 4046 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040, |
4046 | "qla_target(%d): Async event %#x occured: " | 4047 | "qla_target(%d): Async event %#x occured: " |
4047 | "ignore (m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, | 4048 | "ignore (m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, |
4048 | code, le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4049 | code, le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4049 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4050 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4050 | break; | 4051 | break; |
4051 | } | 4052 | } |
4052 | 4053 | ||
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 6f0a4c612b3b..6f72b80121a0 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1899,6 +1899,8 @@ static int sd_try_rc16_first(struct scsi_device *sdp) | |||
1899 | { | 1899 | { |
1900 | if (sdp->host->max_cmd_len < 16) | 1900 | if (sdp->host->max_cmd_len < 16) |
1901 | return 0; | 1901 | return 0; |
1902 | if (sdp->try_rc_10_first) | ||
1903 | return 0; | ||
1902 | if (sdp->scsi_level > SCSI_SPC_2) | 1904 | if (sdp->scsi_level > SCSI_SPC_2) |
1903 | return 1; | 1905 | return 1; |
1904 | if (scsi_device_protection(sdp)) | 1906 | if (scsi_device_protection(sdp)) |
diff --git a/drivers/sh/Kconfig b/drivers/sh/Kconfig index d7dbfee1bc70..d860ef743568 100644 --- a/drivers/sh/Kconfig +++ b/drivers/sh/Kconfig | |||
@@ -1,20 +1,6 @@ | |||
1 | menu "SuperH / SH-Mobile Driver Options" | 1 | menu "SuperH / SH-Mobile Driver Options" |
2 | 2 | ||
3 | source "drivers/sh/intc/Kconfig" | 3 | source "drivers/sh/intc/Kconfig" |
4 | 4 | source "drivers/sh/pfc/Kconfig" | |
5 | comment "Pin function controller options" | ||
6 | |||
7 | config SH_PFC | ||
8 | # XXX move off the gpio dependency | ||
9 | depends on GENERIC_GPIO | ||
10 | select GPIO_SH_PFC if ARCH_REQUIRE_GPIOLIB | ||
11 | def_bool y | ||
12 | |||
13 | config GPIO_SH_PFC | ||
14 | tristate "SuperH PFC GPIO support" | ||
15 | depends on SH_PFC && GPIOLIB | ||
16 | help | ||
17 | This enables support for GPIOs within the SoC's pin function | ||
18 | controller. | ||
19 | 5 | ||
20 | endmenu | 6 | endmenu |
diff --git a/drivers/sh/Makefile b/drivers/sh/Makefile index f5d93e8de090..e57895b1a425 100644 --- a/drivers/sh/Makefile +++ b/drivers/sh/Makefile | |||
@@ -5,7 +5,7 @@ obj-y := intc/ | |||
5 | 5 | ||
6 | obj-$(CONFIG_HAVE_CLK) += clk/ | 6 | obj-$(CONFIG_HAVE_CLK) += clk/ |
7 | obj-$(CONFIG_MAPLE) += maple/ | 7 | obj-$(CONFIG_MAPLE) += maple/ |
8 | obj-$(CONFIG_SH_PFC) += pfc/ | ||
8 | obj-$(CONFIG_SUPERHYWAY) += superhyway/ | 9 | obj-$(CONFIG_SUPERHYWAY) += superhyway/ |
9 | obj-$(CONFIG_SH_PFC) += pfc.o | 10 | |
10 | obj-$(CONFIG_GPIO_SH_PFC) += pfc-gpio.o | ||
11 | obj-y += pm_runtime.o | 11 | obj-y += pm_runtime.o |
diff --git a/drivers/sh/pfc/Kconfig b/drivers/sh/pfc/Kconfig new file mode 100644 index 000000000000..804f9ad1bf4a --- /dev/null +++ b/drivers/sh/pfc/Kconfig | |||
@@ -0,0 +1,26 @@ | |||
1 | comment "Pin function controller options" | ||
2 | |||
3 | config SH_PFC | ||
4 | # XXX move off the gpio dependency | ||
5 | depends on GENERIC_GPIO | ||
6 | select GPIO_SH_PFC if ARCH_REQUIRE_GPIOLIB | ||
7 | select PINCTRL_SH_PFC | ||
8 | def_bool y | ||
9 | |||
10 | # | ||
11 | # Placeholder for now, rehome to drivers/pinctrl once the PFC APIs | ||
12 | # have settled. | ||
13 | # | ||
14 | config PINCTRL_SH_PFC | ||
15 | tristate "SuperH PFC pin controller driver" | ||
16 | depends on SH_PFC | ||
17 | select PINCTRL | ||
18 | select PINMUX | ||
19 | select PINCONF | ||
20 | |||
21 | config GPIO_SH_PFC | ||
22 | tristate "SuperH PFC GPIO support" | ||
23 | depends on SH_PFC && GPIOLIB | ||
24 | help | ||
25 | This enables support for GPIOs within the SoC's pin function | ||
26 | controller. | ||
diff --git a/drivers/sh/pfc/Makefile b/drivers/sh/pfc/Makefile new file mode 100644 index 000000000000..7916027cce37 --- /dev/null +++ b/drivers/sh/pfc/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | obj-y += core.o | ||
2 | obj-$(CONFIG_PINCTRL_SH_PFC) += pinctrl.o | ||
3 | obj-$(CONFIG_GPIO_SH_PFC) += gpio.o | ||
diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc/core.c index ce4579ebd602..68169373c98b 100644 --- a/drivers/sh/pfc.c +++ b/drivers/sh/pfc/core.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 9 | * for more details. |
10 | */ | 10 | */ |
11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 11 | #define pr_fmt(fmt) "sh_pfc " KBUILD_MODNAME ": " fmt |
12 | 12 | ||
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/ioport.h> | 21 | #include <linux/ioport.h> |
22 | #include <linux/pinctrl/machine.h> | ||
22 | 23 | ||
23 | static struct sh_pfc *sh_pfc __read_mostly; | 24 | static struct sh_pfc *sh_pfc __read_mostly; |
24 | 25 | ||
@@ -501,49 +502,6 @@ int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type, | |||
501 | } | 502 | } |
502 | EXPORT_SYMBOL_GPL(sh_pfc_config_gpio); | 503 | EXPORT_SYMBOL_GPL(sh_pfc_config_gpio); |
503 | 504 | ||
504 | int sh_pfc_set_direction(struct sh_pfc *pfc, unsigned gpio, | ||
505 | int new_pinmux_type) | ||
506 | { | ||
507 | int pinmux_type; | ||
508 | int ret = -EINVAL; | ||
509 | |||
510 | if (!pfc) | ||
511 | goto err_out; | ||
512 | |||
513 | pinmux_type = pfc->gpios[gpio].flags & PINMUX_FLAG_TYPE; | ||
514 | |||
515 | switch (pinmux_type) { | ||
516 | case PINMUX_TYPE_GPIO: | ||
517 | break; | ||
518 | case PINMUX_TYPE_OUTPUT: | ||
519 | case PINMUX_TYPE_INPUT: | ||
520 | case PINMUX_TYPE_INPUT_PULLUP: | ||
521 | case PINMUX_TYPE_INPUT_PULLDOWN: | ||
522 | sh_pfc_config_gpio(pfc, gpio, pinmux_type, GPIO_CFG_FREE); | ||
523 | break; | ||
524 | default: | ||
525 | goto err_out; | ||
526 | } | ||
527 | |||
528 | if (sh_pfc_config_gpio(pfc, gpio, | ||
529 | new_pinmux_type, | ||
530 | GPIO_CFG_DRYRUN) != 0) | ||
531 | goto err_out; | ||
532 | |||
533 | if (sh_pfc_config_gpio(pfc, gpio, | ||
534 | new_pinmux_type, | ||
535 | GPIO_CFG_REQ) != 0) | ||
536 | BUG(); | ||
537 | |||
538 | pfc->gpios[gpio].flags &= ~PINMUX_FLAG_TYPE; | ||
539 | pfc->gpios[gpio].flags |= new_pinmux_type; | ||
540 | |||
541 | ret = 0; | ||
542 | err_out: | ||
543 | return ret; | ||
544 | } | ||
545 | EXPORT_SYMBOL_GPL(sh_pfc_set_direction); | ||
546 | |||
547 | int register_sh_pfc(struct sh_pfc *pfc) | 505 | int register_sh_pfc(struct sh_pfc *pfc) |
548 | { | 506 | { |
549 | int (*initroutine)(struct sh_pfc *) = NULL; | 507 | int (*initroutine)(struct sh_pfc *) = NULL; |
@@ -563,16 +521,52 @@ int register_sh_pfc(struct sh_pfc *pfc) | |||
563 | 521 | ||
564 | spin_lock_init(&pfc->lock); | 522 | spin_lock_init(&pfc->lock); |
565 | 523 | ||
524 | pinctrl_provide_dummies(); | ||
566 | setup_data_regs(pfc); | 525 | setup_data_regs(pfc); |
567 | 526 | ||
568 | sh_pfc = pfc; | 527 | sh_pfc = pfc; |
569 | pr_info("%s support registered\n", pfc->name); | ||
570 | 528 | ||
529 | /* | ||
530 | * Initialize pinctrl bindings first | ||
531 | */ | ||
532 | initroutine = symbol_request(sh_pfc_register_pinctrl); | ||
533 | if (initroutine) { | ||
534 | ret = (*initroutine)(pfc); | ||
535 | symbol_put_addr(initroutine); | ||
536 | |||
537 | if (unlikely(ret != 0)) | ||
538 | goto err; | ||
539 | } else { | ||
540 | pr_err("failed to initialize pinctrl bindings\n"); | ||
541 | goto err; | ||
542 | } | ||
543 | |||
544 | /* | ||
545 | * Then the GPIO chip | ||
546 | */ | ||
571 | initroutine = symbol_request(sh_pfc_register_gpiochip); | 547 | initroutine = symbol_request(sh_pfc_register_gpiochip); |
572 | if (initroutine) { | 548 | if (initroutine) { |
573 | (*initroutine)(pfc); | 549 | ret = (*initroutine)(pfc); |
574 | symbol_put_addr(initroutine); | 550 | symbol_put_addr(initroutine); |
551 | |||
552 | /* | ||
553 | * If the GPIO chip fails to come up we still leave the | ||
554 | * PFC state as it is, given that there are already | ||
555 | * extant users of it that have succeeded by this point. | ||
556 | */ | ||
557 | if (unlikely(ret != 0)) { | ||
558 | pr_notice("failed to init GPIO chip, ignoring...\n"); | ||
559 | ret = 0; | ||
560 | } | ||
575 | } | 561 | } |
576 | 562 | ||
563 | pr_info("%s support registered\n", pfc->name); | ||
564 | |||
577 | return 0; | 565 | return 0; |
566 | |||
567 | err: | ||
568 | pfc_iounmap(pfc); | ||
569 | sh_pfc = NULL; | ||
570 | |||
571 | return ret; | ||
578 | } | 572 | } |
diff --git a/drivers/sh/pfc-gpio.c b/drivers/sh/pfc/gpio.c index d74e5a96024b..62bca98474a9 100644 --- a/drivers/sh/pfc-gpio.c +++ b/drivers/sh/pfc/gpio.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 9 | * for more details. |
10 | */ | 10 | */ |
11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 11 | #define pr_fmt(fmt) "sh_pfc " KBUILD_MODNAME ": " fmt |
12 | 12 | ||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/pinctrl/consumer.h> | ||
19 | 20 | ||
20 | struct sh_pfc_chip { | 21 | struct sh_pfc_chip { |
21 | struct sh_pfc *pfc; | 22 | struct sh_pfc *pfc; |
@@ -34,80 +35,12 @@ static struct sh_pfc *gpio_to_pfc(struct gpio_chip *gc) | |||
34 | 35 | ||
35 | static int sh_gpio_request(struct gpio_chip *gc, unsigned offset) | 36 | static int sh_gpio_request(struct gpio_chip *gc, unsigned offset) |
36 | { | 37 | { |
37 | struct sh_pfc *pfc = gpio_to_pfc(gc); | 38 | return pinctrl_request_gpio(offset); |
38 | struct pinmux_data_reg *dummy; | ||
39 | unsigned long flags; | ||
40 | int i, ret, pinmux_type; | ||
41 | |||
42 | ret = -EINVAL; | ||
43 | |||
44 | if (!pfc) | ||
45 | goto err_out; | ||
46 | |||
47 | spin_lock_irqsave(&pfc->lock, flags); | ||
48 | |||
49 | if ((pfc->gpios[offset].flags & PINMUX_FLAG_TYPE) != PINMUX_TYPE_NONE) | ||
50 | goto err_unlock; | ||
51 | |||
52 | /* setup pin function here if no data is associated with pin */ | ||
53 | |||
54 | if (sh_pfc_get_data_reg(pfc, offset, &dummy, &i) != 0) | ||
55 | pinmux_type = PINMUX_TYPE_FUNCTION; | ||
56 | else | ||
57 | pinmux_type = PINMUX_TYPE_GPIO; | ||
58 | |||
59 | if (pinmux_type == PINMUX_TYPE_FUNCTION) { | ||
60 | if (sh_pfc_config_gpio(pfc, offset, | ||
61 | pinmux_type, | ||
62 | GPIO_CFG_DRYRUN) != 0) | ||
63 | goto err_unlock; | ||
64 | |||
65 | if (sh_pfc_config_gpio(pfc, offset, | ||
66 | pinmux_type, | ||
67 | GPIO_CFG_REQ) != 0) | ||
68 | BUG(); | ||
69 | } | ||
70 | |||
71 | pfc->gpios[offset].flags &= ~PINMUX_FLAG_TYPE; | ||
72 | pfc->gpios[offset].flags |= pinmux_type; | ||
73 | |||
74 | ret = 0; | ||
75 | err_unlock: | ||
76 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
77 | err_out: | ||
78 | return ret; | ||
79 | } | 39 | } |
80 | 40 | ||
81 | static void sh_gpio_free(struct gpio_chip *gc, unsigned offset) | 41 | static void sh_gpio_free(struct gpio_chip *gc, unsigned offset) |
82 | { | 42 | { |
83 | struct sh_pfc *pfc = gpio_to_pfc(gc); | 43 | pinctrl_free_gpio(offset); |
84 | unsigned long flags; | ||
85 | int pinmux_type; | ||
86 | |||
87 | if (!pfc) | ||
88 | return; | ||
89 | |||
90 | spin_lock_irqsave(&pfc->lock, flags); | ||
91 | |||
92 | pinmux_type = pfc->gpios[offset].flags & PINMUX_FLAG_TYPE; | ||
93 | sh_pfc_config_gpio(pfc, offset, pinmux_type, GPIO_CFG_FREE); | ||
94 | pfc->gpios[offset].flags &= ~PINMUX_FLAG_TYPE; | ||
95 | pfc->gpios[offset].flags |= PINMUX_TYPE_NONE; | ||
96 | |||
97 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
98 | } | ||
99 | |||
100 | static int sh_gpio_direction_input(struct gpio_chip *gc, unsigned offset) | ||
101 | { | ||
102 | struct sh_pfc *pfc = gpio_to_pfc(gc); | ||
103 | unsigned long flags; | ||
104 | int ret; | ||
105 | |||
106 | spin_lock_irqsave(&pfc->lock, flags); | ||
107 | ret = sh_pfc_set_direction(pfc, offset, PINMUX_TYPE_INPUT); | ||
108 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
109 | |||
110 | return ret; | ||
111 | } | 44 | } |
112 | 45 | ||
113 | static void sh_gpio_set_value(struct sh_pfc *pfc, unsigned gpio, int value) | 46 | static void sh_gpio_set_value(struct sh_pfc *pfc, unsigned gpio, int value) |
@@ -121,22 +54,6 @@ static void sh_gpio_set_value(struct sh_pfc *pfc, unsigned gpio, int value) | |||
121 | sh_pfc_write_bit(dr, bit, value); | 54 | sh_pfc_write_bit(dr, bit, value); |
122 | } | 55 | } |
123 | 56 | ||
124 | static int sh_gpio_direction_output(struct gpio_chip *gc, unsigned offset, | ||
125 | int value) | ||
126 | { | ||
127 | struct sh_pfc *pfc = gpio_to_pfc(gc); | ||
128 | unsigned long flags; | ||
129 | int ret; | ||
130 | |||
131 | sh_gpio_set_value(pfc, offset, value); | ||
132 | |||
133 | spin_lock_irqsave(&pfc->lock, flags); | ||
134 | ret = sh_pfc_set_direction(pfc, offset, PINMUX_TYPE_OUTPUT); | ||
135 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
136 | |||
137 | return ret; | ||
138 | } | ||
139 | |||
140 | static int sh_gpio_get_value(struct sh_pfc *pfc, unsigned gpio) | 57 | static int sh_gpio_get_value(struct sh_pfc *pfc, unsigned gpio) |
141 | { | 58 | { |
142 | struct pinmux_data_reg *dr = NULL; | 59 | struct pinmux_data_reg *dr = NULL; |
@@ -148,6 +65,19 @@ static int sh_gpio_get_value(struct sh_pfc *pfc, unsigned gpio) | |||
148 | return sh_pfc_read_bit(dr, bit); | 65 | return sh_pfc_read_bit(dr, bit); |
149 | } | 66 | } |
150 | 67 | ||
68 | static int sh_gpio_direction_input(struct gpio_chip *gc, unsigned offset) | ||
69 | { | ||
70 | return pinctrl_gpio_direction_input(offset); | ||
71 | } | ||
72 | |||
73 | static int sh_gpio_direction_output(struct gpio_chip *gc, unsigned offset, | ||
74 | int value) | ||
75 | { | ||
76 | sh_gpio_set_value(gpio_to_pfc(gc), offset, value); | ||
77 | |||
78 | return pinctrl_gpio_direction_output(offset); | ||
79 | } | ||
80 | |||
151 | static int sh_gpio_get(struct gpio_chip *gc, unsigned offset) | 81 | static int sh_gpio_get(struct gpio_chip *gc, unsigned offset) |
152 | { | 82 | { |
153 | return sh_gpio_get_value(gpio_to_pfc(gc), offset); | 83 | return sh_gpio_get_value(gpio_to_pfc(gc), offset); |
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c new file mode 100644 index 000000000000..0802b6c0d653 --- /dev/null +++ b/drivers/sh/pfc/pinctrl.c | |||
@@ -0,0 +1,530 @@ | |||
1 | /* | ||
2 | * SuperH Pin Function Controller pinmux support. | ||
3 | * | ||
4 | * Copyright (C) 2012 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #define DRV_NAME "pinctrl-sh_pfc" | ||
11 | |||
12 | #define pr_fmt(fmt) DRV_NAME " " KBUILD_MODNAME ": " fmt | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/sh_pfc.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/slab.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/pinctrl/consumer.h> | ||
22 | #include <linux/pinctrl/pinctrl.h> | ||
23 | #include <linux/pinctrl/pinconf.h> | ||
24 | #include <linux/pinctrl/pinmux.h> | ||
25 | #include <linux/pinctrl/pinconf-generic.h> | ||
26 | |||
27 | struct sh_pfc_pinctrl { | ||
28 | struct pinctrl_dev *pctl; | ||
29 | struct sh_pfc *pfc; | ||
30 | |||
31 | struct pinmux_gpio **functions; | ||
32 | unsigned int nr_functions; | ||
33 | |||
34 | struct pinctrl_pin_desc *pads; | ||
35 | unsigned int nr_pads; | ||
36 | |||
37 | spinlock_t lock; | ||
38 | }; | ||
39 | |||
40 | static struct sh_pfc_pinctrl *sh_pfc_pmx; | ||
41 | |||
42 | static int sh_pfc_get_groups_count(struct pinctrl_dev *pctldev) | ||
43 | { | ||
44 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
45 | |||
46 | return pmx->nr_pads; | ||
47 | } | ||
48 | |||
49 | static const char *sh_pfc_get_group_name(struct pinctrl_dev *pctldev, | ||
50 | unsigned selector) | ||
51 | { | ||
52 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
53 | |||
54 | return pmx->pads[selector].name; | ||
55 | } | ||
56 | |||
57 | static int sh_pfc_get_group_pins(struct pinctrl_dev *pctldev, unsigned group, | ||
58 | const unsigned **pins, unsigned *num_pins) | ||
59 | { | ||
60 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
61 | |||
62 | *pins = &pmx->pads[group].number; | ||
63 | *num_pins = 1; | ||
64 | |||
65 | return 0; | ||
66 | } | ||
67 | |||
68 | static void sh_pfc_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, | ||
69 | unsigned offset) | ||
70 | { | ||
71 | seq_printf(s, "%s", DRV_NAME); | ||
72 | } | ||
73 | |||
74 | static struct pinctrl_ops sh_pfc_pinctrl_ops = { | ||
75 | .get_groups_count = sh_pfc_get_groups_count, | ||
76 | .get_group_name = sh_pfc_get_group_name, | ||
77 | .get_group_pins = sh_pfc_get_group_pins, | ||
78 | .pin_dbg_show = sh_pfc_pin_dbg_show, | ||
79 | }; | ||
80 | |||
81 | static int sh_pfc_get_functions_count(struct pinctrl_dev *pctldev) | ||
82 | { | ||
83 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
84 | |||
85 | return pmx->nr_functions; | ||
86 | } | ||
87 | |||
88 | static const char *sh_pfc_get_function_name(struct pinctrl_dev *pctldev, | ||
89 | unsigned selector) | ||
90 | { | ||
91 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
92 | |||
93 | return pmx->functions[selector]->name; | ||
94 | } | ||
95 | |||
96 | static int sh_pfc_get_function_groups(struct pinctrl_dev *pctldev, unsigned func, | ||
97 | const char * const **groups, | ||
98 | unsigned * const num_groups) | ||
99 | { | ||
100 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
101 | |||
102 | *groups = &pmx->functions[func]->name; | ||
103 | *num_groups = 1; | ||
104 | |||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | static int sh_pfc_noop_enable(struct pinctrl_dev *pctldev, unsigned func, | ||
109 | unsigned group) | ||
110 | { | ||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | static void sh_pfc_noop_disable(struct pinctrl_dev *pctldev, unsigned func, | ||
115 | unsigned group) | ||
116 | { | ||
117 | } | ||
118 | |||
119 | static inline int sh_pfc_config_function(struct sh_pfc *pfc, unsigned offset) | ||
120 | { | ||
121 | if (sh_pfc_config_gpio(pfc, offset, | ||
122 | PINMUX_TYPE_FUNCTION, | ||
123 | GPIO_CFG_DRYRUN) != 0) | ||
124 | return -EINVAL; | ||
125 | |||
126 | if (sh_pfc_config_gpio(pfc, offset, | ||
127 | PINMUX_TYPE_FUNCTION, | ||
128 | GPIO_CFG_REQ) != 0) | ||
129 | return -EINVAL; | ||
130 | |||
131 | return 0; | ||
132 | } | ||
133 | |||
134 | static int sh_pfc_reconfig_pin(struct sh_pfc *pfc, unsigned offset, | ||
135 | int new_type) | ||
136 | { | ||
137 | unsigned long flags; | ||
138 | int pinmux_type; | ||
139 | int ret = -EINVAL; | ||
140 | |||
141 | spin_lock_irqsave(&pfc->lock, flags); | ||
142 | |||
143 | pinmux_type = pfc->gpios[offset].flags & PINMUX_FLAG_TYPE; | ||
144 | |||
145 | /* | ||
146 | * See if the present config needs to first be de-configured. | ||
147 | */ | ||
148 | switch (pinmux_type) { | ||
149 | case PINMUX_TYPE_GPIO: | ||
150 | break; | ||
151 | case PINMUX_TYPE_OUTPUT: | ||
152 | case PINMUX_TYPE_INPUT: | ||
153 | case PINMUX_TYPE_INPUT_PULLUP: | ||
154 | case PINMUX_TYPE_INPUT_PULLDOWN: | ||
155 | sh_pfc_config_gpio(pfc, offset, pinmux_type, GPIO_CFG_FREE); | ||
156 | break; | ||
157 | default: | ||
158 | goto err; | ||
159 | } | ||
160 | |||
161 | /* | ||
162 | * Dry run | ||
163 | */ | ||
164 | if (sh_pfc_config_gpio(pfc, offset, new_type, | ||
165 | GPIO_CFG_DRYRUN) != 0) | ||
166 | goto err; | ||
167 | |||
168 | /* | ||
169 | * Request | ||
170 | */ | ||
171 | if (sh_pfc_config_gpio(pfc, offset, new_type, | ||
172 | GPIO_CFG_REQ) != 0) | ||
173 | goto err; | ||
174 | |||
175 | pfc->gpios[offset].flags &= ~PINMUX_FLAG_TYPE; | ||
176 | pfc->gpios[offset].flags |= new_type; | ||
177 | |||
178 | ret = 0; | ||
179 | |||
180 | err: | ||
181 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
182 | |||
183 | return ret; | ||
184 | } | ||
185 | |||
186 | |||
187 | static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev, | ||
188 | struct pinctrl_gpio_range *range, | ||
189 | unsigned offset) | ||
190 | { | ||
191 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
192 | struct sh_pfc *pfc = pmx->pfc; | ||
193 | unsigned long flags; | ||
194 | int ret, pinmux_type; | ||
195 | |||
196 | spin_lock_irqsave(&pfc->lock, flags); | ||
197 | |||
198 | pinmux_type = pfc->gpios[offset].flags & PINMUX_FLAG_TYPE; | ||
199 | |||
200 | switch (pinmux_type) { | ||
201 | case PINMUX_TYPE_FUNCTION: | ||
202 | pr_notice_once("Use of GPIO API for function requests is " | ||
203 | "deprecated, convert to pinctrl\n"); | ||
204 | /* handle for now */ | ||
205 | ret = sh_pfc_config_function(pfc, offset); | ||
206 | if (unlikely(ret < 0)) | ||
207 | goto err; | ||
208 | |||
209 | break; | ||
210 | case PINMUX_TYPE_GPIO: | ||
211 | break; | ||
212 | default: | ||
213 | pr_err("Unsupported mux type (%d), bailing...\n", pinmux_type); | ||
214 | return -ENOTSUPP; | ||
215 | } | ||
216 | |||
217 | ret = 0; | ||
218 | |||
219 | err: | ||
220 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
221 | |||
222 | return ret; | ||
223 | } | ||
224 | |||
225 | static void sh_pfc_gpio_disable_free(struct pinctrl_dev *pctldev, | ||
226 | struct pinctrl_gpio_range *range, | ||
227 | unsigned offset) | ||
228 | { | ||
229 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
230 | struct sh_pfc *pfc = pmx->pfc; | ||
231 | unsigned long flags; | ||
232 | int pinmux_type; | ||
233 | |||
234 | spin_lock_irqsave(&pfc->lock, flags); | ||
235 | |||
236 | pinmux_type = pfc->gpios[offset].flags & PINMUX_FLAG_TYPE; | ||
237 | |||
238 | sh_pfc_config_gpio(pfc, offset, pinmux_type, GPIO_CFG_FREE); | ||
239 | |||
240 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
241 | } | ||
242 | |||
243 | static int sh_pfc_gpio_set_direction(struct pinctrl_dev *pctldev, | ||
244 | struct pinctrl_gpio_range *range, | ||
245 | unsigned offset, bool input) | ||
246 | { | ||
247 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
248 | int type = input ? PINMUX_TYPE_INPUT : PINMUX_TYPE_OUTPUT; | ||
249 | |||
250 | return sh_pfc_reconfig_pin(pmx->pfc, offset, type); | ||
251 | } | ||
252 | |||
253 | static struct pinmux_ops sh_pfc_pinmux_ops = { | ||
254 | .get_functions_count = sh_pfc_get_functions_count, | ||
255 | .get_function_name = sh_pfc_get_function_name, | ||
256 | .get_function_groups = sh_pfc_get_function_groups, | ||
257 | .enable = sh_pfc_noop_enable, | ||
258 | .disable = sh_pfc_noop_disable, | ||
259 | .gpio_request_enable = sh_pfc_gpio_request_enable, | ||
260 | .gpio_disable_free = sh_pfc_gpio_disable_free, | ||
261 | .gpio_set_direction = sh_pfc_gpio_set_direction, | ||
262 | }; | ||
263 | |||
264 | static int sh_pfc_pinconf_get(struct pinctrl_dev *pctldev, unsigned pin, | ||
265 | unsigned long *config) | ||
266 | { | ||
267 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
268 | struct sh_pfc *pfc = pmx->pfc; | ||
269 | |||
270 | *config = pfc->gpios[pin].flags & PINMUX_FLAG_TYPE; | ||
271 | |||
272 | return 0; | ||
273 | } | ||
274 | |||
275 | static int sh_pfc_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin, | ||
276 | unsigned long config) | ||
277 | { | ||
278 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | ||
279 | struct sh_pfc *pfc = pmx->pfc; | ||
280 | |||
281 | /* Validate the new type */ | ||
282 | if (config >= PINMUX_FLAG_TYPE) | ||
283 | return -EINVAL; | ||
284 | |||
285 | return sh_pfc_reconfig_pin(pmx->pfc, pin, config); | ||
286 | } | ||
287 | |||
288 | static void sh_pfc_pinconf_dbg_show(struct pinctrl_dev *pctldev, | ||
289 | struct seq_file *s, unsigned pin) | ||
290 | { | ||
291 | const char *pinmux_type_str[] = { | ||
292 | [PINMUX_TYPE_NONE] = "none", | ||
293 | [PINMUX_TYPE_FUNCTION] = "function", | ||
294 | [PINMUX_TYPE_GPIO] = "gpio", | ||
295 | [PINMUX_TYPE_OUTPUT] = "output", | ||
296 | [PINMUX_TYPE_INPUT] = "input", | ||
297 | [PINMUX_TYPE_INPUT_PULLUP] = "input bias pull up", | ||
298 | [PINMUX_TYPE_INPUT_PULLDOWN] = "input bias pull down", | ||
299 | }; | ||
300 | unsigned long config; | ||
301 | int rc; | ||
302 | |||
303 | rc = sh_pfc_pinconf_get(pctldev, pin, &config); | ||
304 | if (unlikely(rc != 0)) | ||
305 | return; | ||
306 | |||
307 | seq_printf(s, " %s", pinmux_type_str[config]); | ||
308 | } | ||
309 | |||
310 | static struct pinconf_ops sh_pfc_pinconf_ops = { | ||
311 | .pin_config_get = sh_pfc_pinconf_get, | ||
312 | .pin_config_set = sh_pfc_pinconf_set, | ||
313 | .pin_config_dbg_show = sh_pfc_pinconf_dbg_show, | ||
314 | }; | ||
315 | |||
316 | static struct pinctrl_gpio_range sh_pfc_gpio_range = { | ||
317 | .name = DRV_NAME, | ||
318 | .id = 0, | ||
319 | }; | ||
320 | |||
321 | static struct pinctrl_desc sh_pfc_pinctrl_desc = { | ||
322 | .name = DRV_NAME, | ||
323 | .owner = THIS_MODULE, | ||
324 | .pctlops = &sh_pfc_pinctrl_ops, | ||
325 | .pmxops = &sh_pfc_pinmux_ops, | ||
326 | .confops = &sh_pfc_pinconf_ops, | ||
327 | }; | ||
328 | |||
329 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc) | ||
330 | { | ||
331 | sh_pfc_pmx = kzalloc(sizeof(struct sh_pfc_pinctrl), GFP_KERNEL); | ||
332 | if (unlikely(!sh_pfc_pmx)) | ||
333 | return -ENOMEM; | ||
334 | |||
335 | spin_lock_init(&sh_pfc_pmx->lock); | ||
336 | |||
337 | sh_pfc_pmx->pfc = pfc; | ||
338 | |||
339 | return 0; | ||
340 | } | ||
341 | EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl); | ||
342 | |||
343 | static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc, | ||
344 | struct sh_pfc_pinctrl *pmx, | ||
345 | struct pinmux_gpio *gpio, | ||
346 | unsigned offset) | ||
347 | { | ||
348 | struct pinmux_data_reg *dummy; | ||
349 | unsigned long flags; | ||
350 | int bit; | ||
351 | |||
352 | gpio->flags &= ~PINMUX_FLAG_TYPE; | ||
353 | |||
354 | if (sh_pfc_get_data_reg(pfc, offset, &dummy, &bit) == 0) | ||
355 | gpio->flags |= PINMUX_TYPE_GPIO; | ||
356 | else { | ||
357 | gpio->flags |= PINMUX_TYPE_FUNCTION; | ||
358 | |||
359 | spin_lock_irqsave(&pmx->lock, flags); | ||
360 | pmx->nr_functions++; | ||
361 | spin_unlock_irqrestore(&pmx->lock, flags); | ||
362 | } | ||
363 | } | ||
364 | |||
365 | /* pinmux ranges -> pinctrl pin descs */ | ||
366 | static int __devinit sh_pfc_map_gpios(struct sh_pfc *pfc, | ||
367 | struct sh_pfc_pinctrl *pmx) | ||
368 | { | ||
369 | unsigned long flags; | ||
370 | int i; | ||
371 | |||
372 | pmx->nr_pads = pfc->last_gpio - pfc->first_gpio + 1; | ||
373 | |||
374 | pmx->pads = kmalloc(sizeof(struct pinctrl_pin_desc) * pmx->nr_pads, | ||
375 | GFP_KERNEL); | ||
376 | if (unlikely(!pmx->pads)) { | ||
377 | pmx->nr_pads = 0; | ||
378 | return -ENOMEM; | ||
379 | } | ||
380 | |||
381 | spin_lock_irqsave(&pfc->lock, flags); | ||
382 | |||
383 | /* | ||
384 | * We don't necessarily have a 1:1 mapping between pin and linux | ||
385 | * GPIO number, as the latter maps to the associated enum_id. | ||
386 | * Care needs to be taken to translate back to pin space when | ||
387 | * dealing with any pin configurations. | ||
388 | */ | ||
389 | for (i = 0; i < pmx->nr_pads; i++) { | ||
390 | struct pinctrl_pin_desc *pin = pmx->pads + i; | ||
391 | struct pinmux_gpio *gpio = pfc->gpios + i; | ||
392 | |||
393 | pin->number = pfc->first_gpio + i; | ||
394 | pin->name = gpio->name; | ||
395 | |||
396 | /* XXX */ | ||
397 | if (unlikely(!gpio->enum_id)) | ||
398 | continue; | ||
399 | |||
400 | sh_pfc_map_one_gpio(pfc, pmx, gpio, i); | ||
401 | } | ||
402 | |||
403 | spin_unlock_irqrestore(&pfc->lock, flags); | ||
404 | |||
405 | sh_pfc_pinctrl_desc.pins = pmx->pads; | ||
406 | sh_pfc_pinctrl_desc.npins = pmx->nr_pads; | ||
407 | |||
408 | return 0; | ||
409 | } | ||
410 | |||
411 | static int __devinit sh_pfc_map_functions(struct sh_pfc *pfc, | ||
412 | struct sh_pfc_pinctrl *pmx) | ||
413 | { | ||
414 | unsigned long flags; | ||
415 | int i, fn; | ||
416 | |||
417 | pmx->functions = kzalloc(pmx->nr_functions * sizeof(void *), | ||
418 | GFP_KERNEL); | ||
419 | if (unlikely(!pmx->functions)) | ||
420 | return -ENOMEM; | ||
421 | |||
422 | spin_lock_irqsave(&pmx->lock, flags); | ||
423 | |||
424 | for (i = fn = 0; i < pmx->nr_pads; i++) { | ||
425 | struct pinmux_gpio *gpio = pfc->gpios + i; | ||
426 | |||
427 | if ((gpio->flags & PINMUX_FLAG_TYPE) == PINMUX_TYPE_FUNCTION) | ||
428 | pmx->functions[fn++] = gpio; | ||
429 | } | ||
430 | |||
431 | spin_unlock_irqrestore(&pmx->lock, flags); | ||
432 | |||
433 | return 0; | ||
434 | } | ||
435 | |||
436 | static int __devinit sh_pfc_pinctrl_probe(struct platform_device *pdev) | ||
437 | { | ||
438 | struct sh_pfc *pfc; | ||
439 | int ret; | ||
440 | |||
441 | if (unlikely(!sh_pfc_pmx)) | ||
442 | return -ENODEV; | ||
443 | |||
444 | pfc = sh_pfc_pmx->pfc; | ||
445 | |||
446 | ret = sh_pfc_map_gpios(pfc, sh_pfc_pmx); | ||
447 | if (unlikely(ret != 0)) | ||
448 | return ret; | ||
449 | |||
450 | ret = sh_pfc_map_functions(pfc, sh_pfc_pmx); | ||
451 | if (unlikely(ret != 0)) | ||
452 | goto free_pads; | ||
453 | |||
454 | sh_pfc_pmx->pctl = pinctrl_register(&sh_pfc_pinctrl_desc, &pdev->dev, | ||
455 | sh_pfc_pmx); | ||
456 | if (IS_ERR(sh_pfc_pmx->pctl)) { | ||
457 | ret = PTR_ERR(sh_pfc_pmx->pctl); | ||
458 | goto free_functions; | ||
459 | } | ||
460 | |||
461 | sh_pfc_gpio_range.npins = pfc->last_gpio - pfc->first_gpio + 1; | ||
462 | sh_pfc_gpio_range.base = pfc->first_gpio; | ||
463 | sh_pfc_gpio_range.pin_base = pfc->first_gpio; | ||
464 | |||
465 | pinctrl_add_gpio_range(sh_pfc_pmx->pctl, &sh_pfc_gpio_range); | ||
466 | |||
467 | platform_set_drvdata(pdev, sh_pfc_pmx); | ||
468 | |||
469 | return 0; | ||
470 | |||
471 | free_functions: | ||
472 | kfree(sh_pfc_pmx->functions); | ||
473 | free_pads: | ||
474 | kfree(sh_pfc_pmx->pads); | ||
475 | kfree(sh_pfc_pmx); | ||
476 | |||
477 | return ret; | ||
478 | } | ||
479 | |||
480 | static int __devexit sh_pfc_pinctrl_remove(struct platform_device *pdev) | ||
481 | { | ||
482 | struct sh_pfc_pinctrl *pmx = platform_get_drvdata(pdev); | ||
483 | |||
484 | pinctrl_remove_gpio_range(pmx->pctl, &sh_pfc_gpio_range); | ||
485 | pinctrl_unregister(pmx->pctl); | ||
486 | |||
487 | platform_set_drvdata(pdev, NULL); | ||
488 | |||
489 | kfree(sh_pfc_pmx->functions); | ||
490 | kfree(sh_pfc_pmx->pads); | ||
491 | kfree(sh_pfc_pmx); | ||
492 | |||
493 | return 0; | ||
494 | } | ||
495 | |||
496 | static struct platform_driver sh_pfc_pinctrl_driver = { | ||
497 | .probe = sh_pfc_pinctrl_probe, | ||
498 | .remove = __devexit_p(sh_pfc_pinctrl_remove), | ||
499 | .driver = { | ||
500 | .name = DRV_NAME, | ||
501 | .owner = THIS_MODULE, | ||
502 | }, | ||
503 | }; | ||
504 | |||
505 | static struct platform_device sh_pfc_pinctrl_device = { | ||
506 | .name = DRV_NAME, | ||
507 | .id = -1, | ||
508 | }; | ||
509 | |||
510 | static int __init sh_pfc_pinctrl_init(void) | ||
511 | { | ||
512 | int rc; | ||
513 | |||
514 | rc = platform_driver_register(&sh_pfc_pinctrl_driver); | ||
515 | if (likely(!rc)) { | ||
516 | rc = platform_device_register(&sh_pfc_pinctrl_device); | ||
517 | if (unlikely(rc)) | ||
518 | platform_driver_unregister(&sh_pfc_pinctrl_driver); | ||
519 | } | ||
520 | |||
521 | return rc; | ||
522 | } | ||
523 | |||
524 | static void __exit sh_pfc_pinctrl_exit(void) | ||
525 | { | ||
526 | platform_driver_unregister(&sh_pfc_pinctrl_driver); | ||
527 | } | ||
528 | |||
529 | subsys_initcall(sh_pfc_pinctrl_init); | ||
530 | module_exit(sh_pfc_pinctrl_exit); | ||
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 46ef5fe51db5..0c73dd4f43a0 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c | |||
@@ -801,7 +801,7 @@ static int omap2_mcspi_setup(struct spi_device *spi) | |||
801 | mcspi_dma = &mcspi->dma_channels[spi->chip_select]; | 801 | mcspi_dma = &mcspi->dma_channels[spi->chip_select]; |
802 | 802 | ||
803 | if (!cs) { | 803 | if (!cs) { |
804 | cs = devm_kzalloc(&spi->dev , sizeof *cs, GFP_KERNEL); | 804 | cs = kzalloc(sizeof *cs, GFP_KERNEL); |
805 | if (!cs) | 805 | if (!cs) |
806 | return -ENOMEM; | 806 | return -ENOMEM; |
807 | cs->base = mcspi->base + spi->chip_select * 0x14; | 807 | cs->base = mcspi->base + spi->chip_select * 0x14; |
@@ -842,6 +842,7 @@ static void omap2_mcspi_cleanup(struct spi_device *spi) | |||
842 | cs = spi->controller_state; | 842 | cs = spi->controller_state; |
843 | list_del(&cs->node); | 843 | list_del(&cs->node); |
844 | 844 | ||
845 | kfree(cs); | ||
845 | } | 846 | } |
846 | 847 | ||
847 | if (spi->chip_select < spi->master->num_chipselect) { | 848 | if (spi->chip_select < spi->master->num_chipselect) { |
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 1c3d6386ea36..aeac1caba3f9 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
31 | #include <linux/usb.h> | 31 | #include <linux/usb.h> |
32 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
33 | #include <linux/kconfig.h> | ||
33 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
34 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
35 | #include <linux/fcntl.h> | 36 | #include <linux/fcntl.h> |
@@ -981,6 +982,8 @@ void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver, | |||
981 | } | 982 | } |
982 | EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister); | 983 | EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister); |
983 | 984 | ||
985 | #if IS_ENABLED(CONFIG_USB) | ||
986 | |||
984 | static int comedi_old_usb_auto_config(struct usb_interface *intf, | 987 | static int comedi_old_usb_auto_config(struct usb_interface *intf, |
985 | struct comedi_driver *driver) | 988 | struct comedi_driver *driver) |
986 | { | 989 | { |
@@ -1043,3 +1046,5 @@ void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver, | |||
1043 | comedi_driver_unregister(comedi_driver); | 1046 | comedi_driver_unregister(comedi_driver); |
1044 | } | 1047 | } |
1045 | EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister); | 1048 | EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister); |
1049 | |||
1050 | #endif | ||
diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c index 292af0f7f451..51665132c61b 100644 --- a/drivers/staging/gdm72xx/netlink_k.c +++ b/drivers/staging/gdm72xx/netlink_k.c | |||
@@ -104,7 +104,7 @@ struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type, | |||
104 | 104 | ||
105 | void netlink_exit(struct sock *sock) | 105 | void netlink_exit(struct sock *sock) |
106 | { | 106 | { |
107 | sock_release(sock->sk_socket); | 107 | netlink_kernel_release(sock); |
108 | } | 108 | } |
109 | 109 | ||
110 | int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) | 110 | int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) |
diff --git a/drivers/staging/iio/Documentation/device.txt b/drivers/staging/iio/Documentation/device.txt index 0338c7cd0a8b..f03fbd3bb454 100644 --- a/drivers/staging/iio/Documentation/device.txt +++ b/drivers/staging/iio/Documentation/device.txt | |||
@@ -29,8 +29,6 @@ Then fill in the following: | |||
29 | * info->driver_module: | 29 | * info->driver_module: |
30 | Set to THIS_MODULE. Used to ensure correct ownership | 30 | Set to THIS_MODULE. Used to ensure correct ownership |
31 | of various resources allocate by the core. | 31 | of various resources allocate by the core. |
32 | * info->num_interrupt_lines: | ||
33 | Number of event triggering hardware lines the device has. | ||
34 | * info->event_attrs: | 32 | * info->event_attrs: |
35 | Attributes used to enable / disable hardware events. | 33 | Attributes used to enable / disable hardware events. |
36 | * info->attrs: | 34 | * info->attrs: |
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig index 2490dd25093b..8f1b3af02f29 100644 --- a/drivers/staging/iio/adc/Kconfig +++ b/drivers/staging/iio/adc/Kconfig | |||
@@ -13,6 +13,7 @@ config AD7291 | |||
13 | config AD7298 | 13 | config AD7298 |
14 | tristate "Analog Devices AD7298 ADC driver" | 14 | tristate "Analog Devices AD7298 ADC driver" |
15 | depends on SPI | 15 | depends on SPI |
16 | select IIO_KFIFO_BUF if IIO_BUFFER | ||
16 | help | 17 | help |
17 | Say yes here to build support for Analog Devices AD7298 | 18 | Say yes here to build support for Analog Devices AD7298 |
18 | 8 Channel ADC with temperature sensor. | 19 | 8 Channel ADC with temperature sensor. |
diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c index 10ab6dc823b9..a13afff2dfe6 100644 --- a/drivers/staging/iio/adc/ad7606_core.c +++ b/drivers/staging/iio/adc/ad7606_core.c | |||
@@ -235,7 +235,8 @@ static const struct attribute_group ad7606_attribute_group_range = { | |||
235 | .indexed = 1, \ | 235 | .indexed = 1, \ |
236 | .channel = num, \ | 236 | .channel = num, \ |
237 | .address = num, \ | 237 | .address = num, \ |
238 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT, \ | 238 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ |
239 | IIO_CHAN_INFO_SCALE_SHARED_BIT, \ | ||
239 | .scan_index = num, \ | 240 | .scan_index = num, \ |
240 | .scan_type = IIO_ST('s', 16, 16, 0), \ | 241 | .scan_type = IIO_ST('s', 16, 16, 0), \ |
241 | } | 242 | } |
diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c index 3295ea63f3eb..97ef67036e3f 100644 --- a/drivers/staging/media/lirc/lirc_serial.c +++ b/drivers/staging/media/lirc/lirc_serial.c | |||
@@ -129,6 +129,7 @@ static void send_space_homebrew(long length); | |||
129 | 129 | ||
130 | static struct lirc_serial hardware[] = { | 130 | static struct lirc_serial hardware[] = { |
131 | [LIRC_HOMEBREW] = { | 131 | [LIRC_HOMEBREW] = { |
132 | .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_HOMEBREW].lock), | ||
132 | .signal_pin = UART_MSR_DCD, | 133 | .signal_pin = UART_MSR_DCD, |
133 | .signal_pin_change = UART_MSR_DDCD, | 134 | .signal_pin_change = UART_MSR_DDCD, |
134 | .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), | 135 | .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), |
@@ -145,6 +146,7 @@ static struct lirc_serial hardware[] = { | |||
145 | }, | 146 | }, |
146 | 147 | ||
147 | [LIRC_IRDEO] = { | 148 | [LIRC_IRDEO] = { |
149 | .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_IRDEO].lock), | ||
148 | .signal_pin = UART_MSR_DSR, | 150 | .signal_pin = UART_MSR_DSR, |
149 | .signal_pin_change = UART_MSR_DDSR, | 151 | .signal_pin_change = UART_MSR_DDSR, |
150 | .on = UART_MCR_OUT2, | 152 | .on = UART_MCR_OUT2, |
@@ -156,6 +158,7 @@ static struct lirc_serial hardware[] = { | |||
156 | }, | 158 | }, |
157 | 159 | ||
158 | [LIRC_IRDEO_REMOTE] = { | 160 | [LIRC_IRDEO_REMOTE] = { |
161 | .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_IRDEO_REMOTE].lock), | ||
159 | .signal_pin = UART_MSR_DSR, | 162 | .signal_pin = UART_MSR_DSR, |
160 | .signal_pin_change = UART_MSR_DDSR, | 163 | .signal_pin_change = UART_MSR_DDSR, |
161 | .on = (UART_MCR_RTS | UART_MCR_DTR | UART_MCR_OUT2), | 164 | .on = (UART_MCR_RTS | UART_MCR_DTR | UART_MCR_OUT2), |
@@ -167,6 +170,7 @@ static struct lirc_serial hardware[] = { | |||
167 | }, | 170 | }, |
168 | 171 | ||
169 | [LIRC_ANIMAX] = { | 172 | [LIRC_ANIMAX] = { |
173 | .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_ANIMAX].lock), | ||
170 | .signal_pin = UART_MSR_DCD, | 174 | .signal_pin = UART_MSR_DCD, |
171 | .signal_pin_change = UART_MSR_DDCD, | 175 | .signal_pin_change = UART_MSR_DDCD, |
172 | .on = 0, | 176 | .on = 0, |
@@ -177,6 +181,7 @@ static struct lirc_serial hardware[] = { | |||
177 | }, | 181 | }, |
178 | 182 | ||
179 | [LIRC_IGOR] = { | 183 | [LIRC_IGOR] = { |
184 | .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_IGOR].lock), | ||
180 | .signal_pin = UART_MSR_DSR, | 185 | .signal_pin = UART_MSR_DSR, |
181 | .signal_pin_change = UART_MSR_DDSR, | 186 | .signal_pin_change = UART_MSR_DDSR, |
182 | .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), | 187 | .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), |
@@ -201,6 +206,7 @@ static struct lirc_serial hardware[] = { | |||
201 | * See also http://www.nslu2-linux.org for this device | 206 | * See also http://www.nslu2-linux.org for this device |
202 | */ | 207 | */ |
203 | [LIRC_NSLU2] = { | 208 | [LIRC_NSLU2] = { |
209 | .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_NSLU2].lock), | ||
204 | .signal_pin = UART_MSR_CTS, | 210 | .signal_pin = UART_MSR_CTS, |
205 | .signal_pin_change = UART_MSR_DCTS, | 211 | .signal_pin_change = UART_MSR_DCTS, |
206 | .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), | 212 | .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), |
diff --git a/drivers/staging/omapdrm/omap_fbdev.c b/drivers/staging/omapdrm/omap_fbdev.c index 11acd4c35ed2..8c6ed3b0c6f6 100644 --- a/drivers/staging/omapdrm/omap_fbdev.c +++ b/drivers/staging/omapdrm/omap_fbdev.c | |||
@@ -208,7 +208,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, | |||
208 | */ | 208 | */ |
209 | ret = omap_gem_get_paddr(fbdev->bo, &paddr, true); | 209 | ret = omap_gem_get_paddr(fbdev->bo, &paddr, true); |
210 | if (ret) { | 210 | if (ret) { |
211 | dev_err(dev->dev, "could not map (paddr)!\n"); | 211 | dev_err(dev->dev, |
212 | "could not map (paddr)! Skipping framebuffer alloc\n"); | ||
212 | ret = -ENOMEM; | 213 | ret = -ENOMEM; |
213 | goto fail; | 214 | goto fail; |
214 | } | 215 | } |
@@ -388,8 +389,11 @@ void omap_fbdev_free(struct drm_device *dev) | |||
388 | 389 | ||
389 | fbi = helper->fbdev; | 390 | fbi = helper->fbdev; |
390 | 391 | ||
391 | unregister_framebuffer(fbi); | 392 | /* only cleanup framebuffer if it is present */ |
392 | framebuffer_release(fbi); | 393 | if (fbi) { |
394 | unregister_framebuffer(fbi); | ||
395 | framebuffer_release(fbi); | ||
396 | } | ||
393 | 397 | ||
394 | drm_fb_helper_fini(helper); | 398 | drm_fb_helper_fini(helper); |
395 | 399 | ||
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index 9bd18e2d0513..69f616c6964e 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c | |||
@@ -102,6 +102,8 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = { | |||
102 | /* - */ | 102 | /* - */ |
103 | {USB_DEVICE(0x20F4, 0x646B)}, | 103 | {USB_DEVICE(0x20F4, 0x646B)}, |
104 | {USB_DEVICE(0x083A, 0xC512)}, | 104 | {USB_DEVICE(0x083A, 0xC512)}, |
105 | {USB_DEVICE(0x25D4, 0x4CA1)}, | ||
106 | {USB_DEVICE(0x25D4, 0x4CAB)}, | ||
105 | 107 | ||
106 | /* RTL8191SU */ | 108 | /* RTL8191SU */ |
107 | /* Realtek */ | 109 | /* Realtek */ |
diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index cb99da920068..87901fa74dd7 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c | |||
@@ -58,7 +58,8 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport) | |||
58 | struct ft_tport *tport; | 58 | struct ft_tport *tport; |
59 | int i; | 59 | int i; |
60 | 60 | ||
61 | tport = rcu_dereference(lport->prov[FC_TYPE_FCP]); | 61 | tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP], |
62 | lockdep_is_held(&ft_lport_lock)); | ||
62 | if (tport && tport->tpg) | 63 | if (tport && tport->tpg) |
63 | return tport; | 64 | return tport; |
64 | 65 | ||
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c index 47d061b9ad4d..6e1958a325bd 100644 --- a/drivers/tty/serial/8250/8250.c +++ b/drivers/tty/serial/8250/8250.c | |||
@@ -3113,7 +3113,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * | |||
3113 | 3113 | ||
3114 | /** | 3114 | /** |
3115 | * serial8250_register_8250_port - register a serial port | 3115 | * serial8250_register_8250_port - register a serial port |
3116 | * @port: serial port template | 3116 | * @up: serial port template |
3117 | * | 3117 | * |
3118 | * Configure the serial port specified by the request. If the | 3118 | * Configure the serial port specified by the request. If the |
3119 | * port exists and is in use, it is hung up and unregistered | 3119 | * port exists and is in use, it is hung up and unregistered |
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 4ad721fb8405..c17923ec6e95 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -133,6 +133,10 @@ struct pl011_dmatx_data { | |||
133 | struct uart_amba_port { | 133 | struct uart_amba_port { |
134 | struct uart_port port; | 134 | struct uart_port port; |
135 | struct clk *clk; | 135 | struct clk *clk; |
136 | /* Two optional pin states - default & sleep */ | ||
137 | struct pinctrl *pinctrl; | ||
138 | struct pinctrl_state *pins_default; | ||
139 | struct pinctrl_state *pins_sleep; | ||
136 | const struct vendor_data *vendor; | 140 | const struct vendor_data *vendor; |
137 | unsigned int dmacr; /* dma control reg */ | 141 | unsigned int dmacr; /* dma control reg */ |
138 | unsigned int im; /* interrupt mask */ | 142 | unsigned int im; /* interrupt mask */ |
@@ -1312,6 +1316,14 @@ static int pl011_startup(struct uart_port *port) | |||
1312 | unsigned int cr; | 1316 | unsigned int cr; |
1313 | int retval; | 1317 | int retval; |
1314 | 1318 | ||
1319 | /* Optionaly enable pins to be muxed in and configured */ | ||
1320 | if (!IS_ERR(uap->pins_default)) { | ||
1321 | retval = pinctrl_select_state(uap->pinctrl, uap->pins_default); | ||
1322 | if (retval) | ||
1323 | dev_err(port->dev, | ||
1324 | "could not set default pins\n"); | ||
1325 | } | ||
1326 | |||
1315 | retval = clk_prepare(uap->clk); | 1327 | retval = clk_prepare(uap->clk); |
1316 | if (retval) | 1328 | if (retval) |
1317 | goto out; | 1329 | goto out; |
@@ -1420,6 +1432,7 @@ static void pl011_shutdown(struct uart_port *port) | |||
1420 | { | 1432 | { |
1421 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 1433 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
1422 | unsigned int cr; | 1434 | unsigned int cr; |
1435 | int retval; | ||
1423 | 1436 | ||
1424 | /* | 1437 | /* |
1425 | * disable all interrupts | 1438 | * disable all interrupts |
@@ -1462,6 +1475,14 @@ static void pl011_shutdown(struct uart_port *port) | |||
1462 | */ | 1475 | */ |
1463 | clk_disable(uap->clk); | 1476 | clk_disable(uap->clk); |
1464 | clk_unprepare(uap->clk); | 1477 | clk_unprepare(uap->clk); |
1478 | /* Optionally let pins go into sleep states */ | ||
1479 | if (!IS_ERR(uap->pins_sleep)) { | ||
1480 | retval = pinctrl_select_state(uap->pinctrl, uap->pins_sleep); | ||
1481 | if (retval) | ||
1482 | dev_err(port->dev, | ||
1483 | "could not set pins to sleep state\n"); | ||
1484 | } | ||
1485 | |||
1465 | 1486 | ||
1466 | if (uap->port.dev->platform_data) { | 1487 | if (uap->port.dev->platform_data) { |
1467 | struct amba_pl011_data *plat; | 1488 | struct amba_pl011_data *plat; |
@@ -1792,6 +1813,14 @@ static int __init pl011_console_setup(struct console *co, char *options) | |||
1792 | if (!uap) | 1813 | if (!uap) |
1793 | return -ENODEV; | 1814 | return -ENODEV; |
1794 | 1815 | ||
1816 | /* Allow pins to be muxed in and configured */ | ||
1817 | if (!IS_ERR(uap->pins_default)) { | ||
1818 | ret = pinctrl_select_state(uap->pinctrl, uap->pins_default); | ||
1819 | if (ret) | ||
1820 | dev_err(uap->port.dev, | ||
1821 | "could not set default pins\n"); | ||
1822 | } | ||
1823 | |||
1795 | ret = clk_prepare(uap->clk); | 1824 | ret = clk_prepare(uap->clk); |
1796 | if (ret) | 1825 | if (ret) |
1797 | return ret; | 1826 | return ret; |
@@ -1844,7 +1873,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
1844 | { | 1873 | { |
1845 | struct uart_amba_port *uap; | 1874 | struct uart_amba_port *uap; |
1846 | struct vendor_data *vendor = id->data; | 1875 | struct vendor_data *vendor = id->data; |
1847 | struct pinctrl *pinctrl; | ||
1848 | void __iomem *base; | 1876 | void __iomem *base; |
1849 | int i, ret; | 1877 | int i, ret; |
1850 | 1878 | ||
@@ -1869,11 +1897,20 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
1869 | goto free; | 1897 | goto free; |
1870 | } | 1898 | } |
1871 | 1899 | ||
1872 | pinctrl = devm_pinctrl_get_select_default(&dev->dev); | 1900 | uap->pinctrl = devm_pinctrl_get(&dev->dev); |
1873 | if (IS_ERR(pinctrl)) { | 1901 | if (IS_ERR(uap->pinctrl)) { |
1874 | ret = PTR_ERR(pinctrl); | 1902 | ret = PTR_ERR(uap->pinctrl); |
1875 | goto unmap; | 1903 | goto unmap; |
1876 | } | 1904 | } |
1905 | uap->pins_default = pinctrl_lookup_state(uap->pinctrl, | ||
1906 | PINCTRL_STATE_DEFAULT); | ||
1907 | if (IS_ERR(uap->pins_default)) | ||
1908 | dev_err(&dev->dev, "could not get default pinstate\n"); | ||
1909 | |||
1910 | uap->pins_sleep = pinctrl_lookup_state(uap->pinctrl, | ||
1911 | PINCTRL_STATE_SLEEP); | ||
1912 | if (IS_ERR(uap->pins_sleep)) | ||
1913 | dev_dbg(&dev->dev, "could not get sleep pinstate\n"); | ||
1877 | 1914 | ||
1878 | uap->clk = clk_get(&dev->dev, NULL); | 1915 | uap->clk = clk_get(&dev->dev, NULL); |
1879 | if (IS_ERR(uap->clk)) { | 1916 | if (IS_ERR(uap->clk)) { |
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c index 34bd345da775..6ae2a58d62f2 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c | |||
@@ -466,7 +466,7 @@ static void serial_txx9_break_ctl(struct uart_port *port, int break_state) | |||
466 | spin_unlock_irqrestore(&up->port.lock, flags); | 466 | spin_unlock_irqrestore(&up->port.lock, flags); |
467 | } | 467 | } |
468 | 468 | ||
469 | #if defined(CONFIG_SERIAL_TXX9_CONSOLE) || (CONFIG_CONSOLE_POLL) | 469 | #if defined(CONFIG_SERIAL_TXX9_CONSOLE) || defined(CONFIG_CONSOLE_POLL) |
470 | /* | 470 | /* |
471 | * Wait for transmitter & holding register to empty | 471 | * Wait for transmitter & holding register to empty |
472 | */ | 472 | */ |
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index c691eea51537..f5ed3d75fa5a 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile | |||
@@ -46,7 +46,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/ | |||
46 | obj-$(CONFIG_USB_SERIAL) += serial/ | 46 | obj-$(CONFIG_USB_SERIAL) += serial/ |
47 | 47 | ||
48 | obj-$(CONFIG_USB) += misc/ | 48 | obj-$(CONFIG_USB) += misc/ |
49 | obj-$(CONFIG_USB) += phy/ | 49 | obj-$(CONFIG_USB_COMMON) += phy/ |
50 | obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/ | 50 | obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/ |
51 | 51 | ||
52 | obj-$(CONFIG_USB_ATM) += atm/ | 52 | obj-$(CONFIG_USB_ATM) += atm/ |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3df1a1973b05..ec70df7aba17 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -1091,7 +1091,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, | |||
1091 | if (r == req) { | 1091 | if (r == req) { |
1092 | /* wait until it is processed */ | 1092 | /* wait until it is processed */ |
1093 | dwc3_stop_active_transfer(dwc, dep->number); | 1093 | dwc3_stop_active_transfer(dwc, dep->number); |
1094 | goto out0; | 1094 | goto out1; |
1095 | } | 1095 | } |
1096 | dev_err(dwc->dev, "request %p was not queued to %s\n", | 1096 | dev_err(dwc->dev, "request %p was not queued to %s\n", |
1097 | request, ep->name); | 1097 | request, ep->name); |
@@ -1099,6 +1099,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, | |||
1099 | goto out0; | 1099 | goto out0; |
1100 | } | 1100 | } |
1101 | 1101 | ||
1102 | out1: | ||
1102 | /* giveback the request */ | 1103 | /* giveback the request */ |
1103 | dwc3_gadget_giveback(dep, req, -ECONNRESET); | 1104 | dwc3_gadget_giveback(dep, req, -ECONNRESET); |
1104 | 1105 | ||
diff --git a/drivers/usb/gadget/fsl_qe_udc.h b/drivers/usb/gadget/fsl_qe_udc.h index 4c07ca9cebf3..7026919fc901 100644 --- a/drivers/usb/gadget/fsl_qe_udc.h +++ b/drivers/usb/gadget/fsl_qe_udc.h | |||
@@ -153,10 +153,10 @@ struct usb_ep_para{ | |||
153 | #define USB_BUSMODE_DTB 0x02 | 153 | #define USB_BUSMODE_DTB 0x02 |
154 | 154 | ||
155 | /* Endpoint basic handle */ | 155 | /* Endpoint basic handle */ |
156 | #define ep_index(EP) ((EP)->desc->bEndpointAddress & 0xF) | 156 | #define ep_index(EP) ((EP)->ep.desc->bEndpointAddress & 0xF) |
157 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) | 157 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) |
158 | #define ep_is_in(EP) ((ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ | 158 | #define ep_is_in(EP) ((ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ |
159 | USB_DIR_IN) : ((EP)->desc->bEndpointAddress \ | 159 | USB_DIR_IN) : ((EP)->ep.desc->bEndpointAddress \ |
160 | & USB_DIR_IN) == USB_DIR_IN) | 160 | & USB_DIR_IN) == USB_DIR_IN) |
161 | 161 | ||
162 | /* ep0 transfer state */ | 162 | /* ep0 transfer state */ |
diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c index 262acfd53e32..2ab0388d93eb 100644 --- a/drivers/usb/gadget/lpc32xx_udc.c +++ b/drivers/usb/gadget/lpc32xx_udc.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <mach/irqs.h> | 61 | #include <mach/irqs.h> |
62 | #include <mach/board.h> | 62 | #include <mach/board.h> |
63 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES | 63 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES |
64 | #include <linux/debugfs.h> | ||
64 | #include <linux/seq_file.h> | 65 | #include <linux/seq_file.h> |
65 | #endif | 66 | #endif |
66 | 67 | ||
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index ef8d744800ac..e090c799d87b 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -375,11 +375,21 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb, | |||
375 | */ | 375 | */ |
376 | if (list_empty(&qh->hep->urb_list)) { | 376 | if (list_empty(&qh->hep->urb_list)) { |
377 | struct list_head *head; | 377 | struct list_head *head; |
378 | struct dma_controller *dma = musb->dma_controller; | ||
378 | 379 | ||
379 | if (is_in) | 380 | if (is_in) { |
380 | ep->rx_reinit = 1; | 381 | ep->rx_reinit = 1; |
381 | else | 382 | if (ep->rx_channel) { |
383 | dma->channel_release(ep->rx_channel); | ||
384 | ep->rx_channel = NULL; | ||
385 | } | ||
386 | } else { | ||
382 | ep->tx_reinit = 1; | 387 | ep->tx_reinit = 1; |
388 | if (ep->tx_channel) { | ||
389 | dma->channel_release(ep->tx_channel); | ||
390 | ep->tx_channel = NULL; | ||
391 | } | ||
392 | } | ||
383 | 393 | ||
384 | /* Clobber old pointers to this qh */ | 394 | /* Clobber old pointers to this qh */ |
385 | musb_ep_set_qh(ep, is_in, NULL); | 395 | musb_ep_set_qh(ep, is_in, NULL); |
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c index d2a9a8e691b9..0eabb049b6a9 100644 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c | |||
@@ -305,9 +305,8 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) | |||
305 | 305 | ||
306 | regulator_enable(twl->usb3v3); | 306 | regulator_enable(twl->usb3v3); |
307 | twl->asleep = 1; | 307 | twl->asleep = 1; |
308 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR, 0x1); | 308 | twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_CLR); |
309 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, | 309 | twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_SET); |
310 | 0x10); | ||
311 | status = USB_EVENT_ID; | 310 | status = USB_EVENT_ID; |
312 | otg->default_a = true; | 311 | otg->default_a = true; |
313 | twl->phy.state = OTG_STATE_A_IDLE; | 312 | twl->phy.state = OTG_STATE_A_IDLE; |
@@ -316,12 +315,10 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) | |||
316 | atomic_notifier_call_chain(&twl->phy.notifier, status, | 315 | atomic_notifier_call_chain(&twl->phy.notifier, status, |
317 | otg->gadget); | 316 | otg->gadget); |
318 | } else { | 317 | } else { |
319 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR, | 318 | twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_CLR); |
320 | 0x10); | 319 | twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET); |
321 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, | ||
322 | 0x1); | ||
323 | } | 320 | } |
324 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_LATCH_CLR, status); | 321 | twl6030_writeb(twl, TWL_MODULE_USB, status, USB_ID_INT_LATCH_CLR); |
325 | 322 | ||
326 | return IRQ_HANDLED; | 323 | return IRQ_HANDLED; |
327 | } | 324 | } |
@@ -343,7 +340,7 @@ static int twl6030_enable_irq(struct usb_phy *x) | |||
343 | { | 340 | { |
344 | struct twl6030_usb *twl = phy_to_twl(x); | 341 | struct twl6030_usb *twl = phy_to_twl(x); |
345 | 342 | ||
346 | twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, 0x1); | 343 | twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET); |
347 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_LINE_C); | 344 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_LINE_C); |
348 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_STS_C); | 345 | twl6030_interrupt_unmask(0x05, REG_INT_MSK_STS_C); |
349 | 346 | ||
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 3cfabcba7447..e7cf84f0751a 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig | |||
@@ -2,11 +2,11 @@ | |||
2 | # Physical Layer USB driver configuration | 2 | # Physical Layer USB driver configuration |
3 | # | 3 | # |
4 | comment "USB Physical Layer drivers" | 4 | comment "USB Physical Layer drivers" |
5 | depends on USB | 5 | depends on USB || USB_GADGET |
6 | 6 | ||
7 | config USB_ISP1301 | 7 | config USB_ISP1301 |
8 | tristate "NXP ISP1301 USB transceiver support" | 8 | tristate "NXP ISP1301 USB transceiver support" |
9 | depends on USB | 9 | depends on USB || USB_GADGET |
10 | depends on I2C | 10 | depends on I2C |
11 | help | 11 | help |
12 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. | 12 | Say Y here to add support for the NXP ISP1301 USB transceiver driver. |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 73d25cd8cba5..1e71079ce33b 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -93,6 +93,7 @@ static const struct usb_device_id id_table[] = { | |||
93 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ | 93 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ |
94 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ | 94 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ |
95 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ | 95 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
96 | { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */ | ||
96 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ | 97 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ |
97 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ | 98 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ |
98 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ | 99 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ |
@@ -134,7 +135,13 @@ static const struct usb_device_id id_table[] = { | |||
134 | { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ | 135 | { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ |
135 | { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ | 136 | { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ |
136 | { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ | 137 | { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ |
138 | { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */ | ||
139 | { USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */ | ||
137 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ | 140 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ |
141 | { USB_DEVICE(0x166A, 0x0304) }, /* Clipsal 5000CT2 C-Bus Black and White Touchscreen */ | ||
142 | { USB_DEVICE(0x166A, 0x0305) }, /* Clipsal C-5000CT2 C-Bus Spectrum Colour Touchscreen */ | ||
143 | { USB_DEVICE(0x166A, 0x0401) }, /* Clipsal L51xx C-Bus Architectural Dimmer */ | ||
144 | { USB_DEVICE(0x166A, 0x0101) }, /* Clipsal 5560884 C-Bus Multi-room Audio Matrix Switcher */ | ||
138 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ | 145 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ |
139 | { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ | 146 | { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ |
140 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ | 147 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ |
@@ -146,7 +153,11 @@ static const struct usb_device_id id_table[] = { | |||
146 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | 153 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
147 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 154 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
148 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ | 155 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ |
156 | { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ | ||
157 | { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ | ||
149 | { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ | 158 | { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ |
159 | { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ | ||
160 | { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */ | ||
150 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ | 161 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ |
151 | { } /* Terminating Entry */ | 162 | { } /* Terminating Entry */ |
152 | }; | 163 | }; |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index e668a2460bd4..adf8ce72be50 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -236,6 +236,7 @@ static void option_instat_callback(struct urb *urb); | |||
236 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 | 236 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 |
237 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 | 237 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 |
238 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | 238 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 |
239 | #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 | ||
239 | 240 | ||
240 | /* AMOI PRODUCTS */ | 241 | /* AMOI PRODUCTS */ |
241 | #define AMOI_VENDOR_ID 0x1614 | 242 | #define AMOI_VENDOR_ID 0x1614 |
@@ -497,6 +498,10 @@ static void option_instat_callback(struct urb *urb); | |||
497 | /* MediaTek products */ | 498 | /* MediaTek products */ |
498 | #define MEDIATEK_VENDOR_ID 0x0e8d | 499 | #define MEDIATEK_VENDOR_ID 0x0e8d |
499 | 500 | ||
501 | /* Cellient products */ | ||
502 | #define CELLIENT_VENDOR_ID 0x2692 | ||
503 | #define CELLIENT_PRODUCT_MEN200 0x9005 | ||
504 | |||
500 | /* some devices interfaces need special handling due to a number of reasons */ | 505 | /* some devices interfaces need special handling due to a number of reasons */ |
501 | enum option_blacklist_reason { | 506 | enum option_blacklist_reason { |
502 | OPTION_BLACKLIST_NONE = 0, | 507 | OPTION_BLACKLIST_NONE = 0, |
@@ -734,6 +739,8 @@ static const struct usb_device_id option_ids[] = { | |||
734 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, | 739 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, |
735 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, | 740 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, |
736 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, | 741 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, |
742 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ | ||
743 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, | ||
737 | 744 | ||
738 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 745 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
739 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 746 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
@@ -1233,6 +1240,7 @@ static const struct usb_device_id option_ids[] = { | |||
1233 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, | 1240 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, |
1234 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, | 1241 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, |
1235 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ | 1242 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ |
1243 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, | ||
1236 | { } /* Terminating entry */ | 1244 | { } /* Terminating entry */ |
1237 | }; | 1245 | }; |
1238 | MODULE_DEVICE_TABLE(usb, option_ids); | 1246 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index a324a5d21e99..11418da9bc09 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -202,6 +202,12 @@ static int slave_configure(struct scsi_device *sdev) | |||
202 | if (us->fflags & US_FL_NO_READ_CAPACITY_16) | 202 | if (us->fflags & US_FL_NO_READ_CAPACITY_16) |
203 | sdev->no_read_capacity_16 = 1; | 203 | sdev->no_read_capacity_16 = 1; |
204 | 204 | ||
205 | /* | ||
206 | * Many devices do not respond properly to READ_CAPACITY_16. | ||
207 | * Tell the SCSI layer to try READ_CAPACITY_10 first. | ||
208 | */ | ||
209 | sdev->try_rc_10_first = 1; | ||
210 | |||
205 | /* assume SPC3 or latter devices support sense size > 18 */ | 211 | /* assume SPC3 or latter devices support sense size > 18 */ |
206 | if (sdev->scsi_level > SCSI_SPC_2) | 212 | if (sdev->scsi_level > SCSI_SPC_2) |
207 | us->fflags |= US_FL_SANE_SENSE; | 213 | us->fflags |= US_FL_SANE_SENSE; |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index caf22bf5f822..1719886bb9be 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -1107,13 +1107,6 @@ UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999, | |||
1107 | USB_SC_RBC, USB_PR_BULK, NULL, | 1107 | USB_SC_RBC, USB_PR_BULK, NULL, |
1108 | 0 ), | 1108 | 0 ), |
1109 | 1109 | ||
1110 | /* Feiya QDI U2 DISK, reported by Hans de Goede <hdegoede@redhat.com> */ | ||
1111 | UNUSUAL_DEV( 0x090c, 0x1000, 0x0000, 0xffff, | ||
1112 | "Feiya", | ||
1113 | "QDI U2 DISK", | ||
1114 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
1115 | US_FL_NO_READ_CAPACITY_16 ), | ||
1116 | |||
1117 | /* aeb */ | 1110 | /* aeb */ |
1118 | UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, | 1111 | UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, |
1119 | "Feiya", | 1112 | "Feiya", |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 94dbd25caa30..112156f68afb 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -191,7 +191,9 @@ static int vhost_worker(void *data) | |||
191 | struct vhost_dev *dev = data; | 191 | struct vhost_dev *dev = data; |
192 | struct vhost_work *work = NULL; | 192 | struct vhost_work *work = NULL; |
193 | unsigned uninitialized_var(seq); | 193 | unsigned uninitialized_var(seq); |
194 | mm_segment_t oldfs = get_fs(); | ||
194 | 195 | ||
196 | set_fs(USER_DS); | ||
195 | use_mm(dev->mm); | 197 | use_mm(dev->mm); |
196 | 198 | ||
197 | for (;;) { | 199 | for (;;) { |
@@ -229,6 +231,7 @@ static int vhost_worker(void *data) | |||
229 | 231 | ||
230 | } | 232 | } |
231 | unuse_mm(dev->mm); | 233 | unuse_mm(dev->mm); |
234 | set_fs(oldfs); | ||
232 | return 0; | 235 | return 0; |
233 | } | 236 | } |
234 | 237 | ||
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index bfbc15ca38dd..0908e6044333 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -47,7 +47,7 @@ struct virtio_balloon | |||
47 | struct task_struct *thread; | 47 | struct task_struct *thread; |
48 | 48 | ||
49 | /* Waiting for host to ack the pages we released. */ | 49 | /* Waiting for host to ack the pages we released. */ |
50 | struct completion acked; | 50 | wait_queue_head_t acked; |
51 | 51 | ||
52 | /* Number of balloon pages we've told the Host we're not using. */ | 52 | /* Number of balloon pages we've told the Host we're not using. */ |
53 | unsigned int num_pages; | 53 | unsigned int num_pages; |
@@ -89,29 +89,25 @@ static struct page *balloon_pfn_to_page(u32 pfn) | |||
89 | 89 | ||
90 | static void balloon_ack(struct virtqueue *vq) | 90 | static void balloon_ack(struct virtqueue *vq) |
91 | { | 91 | { |
92 | struct virtio_balloon *vb; | 92 | struct virtio_balloon *vb = vq->vdev->priv; |
93 | unsigned int len; | ||
94 | 93 | ||
95 | vb = virtqueue_get_buf(vq, &len); | 94 | wake_up(&vb->acked); |
96 | if (vb) | ||
97 | complete(&vb->acked); | ||
98 | } | 95 | } |
99 | 96 | ||
100 | static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) | 97 | static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) |
101 | { | 98 | { |
102 | struct scatterlist sg; | 99 | struct scatterlist sg; |
100 | unsigned int len; | ||
103 | 101 | ||
104 | sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); | 102 | sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns); |
105 | 103 | ||
106 | init_completion(&vb->acked); | ||
107 | |||
108 | /* We should always be able to add one buffer to an empty queue. */ | 104 | /* We should always be able to add one buffer to an empty queue. */ |
109 | if (virtqueue_add_buf(vq, &sg, 1, 0, vb, GFP_KERNEL) < 0) | 105 | if (virtqueue_add_buf(vq, &sg, 1, 0, vb, GFP_KERNEL) < 0) |
110 | BUG(); | 106 | BUG(); |
111 | virtqueue_kick(vq); | 107 | virtqueue_kick(vq); |
112 | 108 | ||
113 | /* When host has read buffer, this completes via balloon_ack */ | 109 | /* When host has read buffer, this completes via balloon_ack */ |
114 | wait_for_completion(&vb->acked); | 110 | wait_event(vb->acked, virtqueue_get_buf(vq, &len)); |
115 | } | 111 | } |
116 | 112 | ||
117 | static void set_page_pfns(u32 pfns[], struct page *page) | 113 | static void set_page_pfns(u32 pfns[], struct page *page) |
@@ -231,12 +227,8 @@ static void update_balloon_stats(struct virtio_balloon *vb) | |||
231 | */ | 227 | */ |
232 | static void stats_request(struct virtqueue *vq) | 228 | static void stats_request(struct virtqueue *vq) |
233 | { | 229 | { |
234 | struct virtio_balloon *vb; | 230 | struct virtio_balloon *vb = vq->vdev->priv; |
235 | unsigned int len; | ||
236 | 231 | ||
237 | vb = virtqueue_get_buf(vq, &len); | ||
238 | if (!vb) | ||
239 | return; | ||
240 | vb->need_stats_update = 1; | 232 | vb->need_stats_update = 1; |
241 | wake_up(&vb->config_change); | 233 | wake_up(&vb->config_change); |
242 | } | 234 | } |
@@ -245,11 +237,14 @@ static void stats_handle_request(struct virtio_balloon *vb) | |||
245 | { | 237 | { |
246 | struct virtqueue *vq; | 238 | struct virtqueue *vq; |
247 | struct scatterlist sg; | 239 | struct scatterlist sg; |
240 | unsigned int len; | ||
248 | 241 | ||
249 | vb->need_stats_update = 0; | 242 | vb->need_stats_update = 0; |
250 | update_balloon_stats(vb); | 243 | update_balloon_stats(vb); |
251 | 244 | ||
252 | vq = vb->stats_vq; | 245 | vq = vb->stats_vq; |
246 | if (!virtqueue_get_buf(vq, &len)) | ||
247 | return; | ||
253 | sg_init_one(&sg, vb->stats, sizeof(vb->stats)); | 248 | sg_init_one(&sg, vb->stats, sizeof(vb->stats)); |
254 | if (virtqueue_add_buf(vq, &sg, 1, 0, vb, GFP_KERNEL) < 0) | 249 | if (virtqueue_add_buf(vq, &sg, 1, 0, vb, GFP_KERNEL) < 0) |
255 | BUG(); | 250 | BUG(); |
@@ -358,6 +353,7 @@ static int virtballoon_probe(struct virtio_device *vdev) | |||
358 | INIT_LIST_HEAD(&vb->pages); | 353 | INIT_LIST_HEAD(&vb->pages); |
359 | vb->num_pages = 0; | 354 | vb->num_pages = 0; |
360 | init_waitqueue_head(&vb->config_change); | 355 | init_waitqueue_head(&vb->config_change); |
356 | init_waitqueue_head(&vb->acked); | ||
361 | vb->vdev = vdev; | 357 | vb->vdev = vdev; |
362 | vb->need_stats_update = 0; | 358 | vb->need_stats_update = 0; |
363 | 359 | ||
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 2b763815aeec..1eff743ec497 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -146,7 +146,7 @@ struct cmn_registers { | |||
146 | } __attribute__((packed)); | 146 | } __attribute__((packed)); |
147 | 147 | ||
148 | static unsigned int hpwdt_nmi_decoding; | 148 | static unsigned int hpwdt_nmi_decoding; |
149 | static unsigned int allow_kdump; | 149 | static unsigned int allow_kdump = 1; |
150 | static unsigned int is_icru; | 150 | static unsigned int is_icru; |
151 | static DEFINE_SPINLOCK(rom_lock); | 151 | static DEFINE_SPINLOCK(rom_lock); |
152 | static void *cru_rom_addr; | 152 | static void *cru_rom_addr; |
@@ -756,6 +756,8 @@ error: | |||
756 | static void hpwdt_exit_nmi_decoding(void) | 756 | static void hpwdt_exit_nmi_decoding(void) |
757 | { | 757 | { |
758 | unregister_nmi_handler(NMI_UNKNOWN, "hpwdt"); | 758 | unregister_nmi_handler(NMI_UNKNOWN, "hpwdt"); |
759 | unregister_nmi_handler(NMI_SERR, "hpwdt"); | ||
760 | unregister_nmi_handler(NMI_IO_CHECK, "hpwdt"); | ||
759 | if (cru_rom_addr) | 761 | if (cru_rom_addr) |
760 | iounmap(cru_rom_addr); | 762 | iounmap(cru_rom_addr); |
761 | } | 763 | } |
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index bc47e9012f37..9c2c27c3b424 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
@@ -699,3 +699,4 @@ MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver"); | |||
699 | MODULE_VERSION(DRV_VERSION); | 699 | MODULE_VERSION(DRV_VERSION); |
700 | MODULE_LICENSE("GPL"); | 700 | MODULE_LICENSE("GPL"); |
701 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 701 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
702 | MODULE_ALIAS("platform:" DRV_NAME); | ||
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index afcd13676542..e4841c36798b 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Watchdog driver for ARM SP805 watchdog module | 4 | * Watchdog driver for ARM SP805 watchdog module |
5 | * | 5 | * |
6 | * Copyright (C) 2010 ST Microelectronics | 6 | * Copyright (C) 2010 ST Microelectronics |
7 | * Viresh Kumar<viresh.kumar@st.com> | 7 | * Viresh Kumar <viresh.linux@gmail.com> |
8 | * | 8 | * |
9 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
10 | * License version 2 or later. This program is licensed "as is" without any | 10 | * License version 2 or later. This program is licensed "as is" without any |
@@ -331,6 +331,6 @@ static struct amba_driver sp805_wdt_driver = { | |||
331 | 331 | ||
332 | module_amba_driver(sp805_wdt_driver); | 332 | module_amba_driver(sp805_wdt_driver); |
333 | 333 | ||
334 | MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); | 334 | MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>"); |
335 | MODULE_DESCRIPTION("ARM SP805 Watchdog Driver"); | 335 | MODULE_DESCRIPTION("ARM SP805 Watchdog Driver"); |
336 | MODULE_LICENSE("GPL"); | 336 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 672d169bf1da..ef8edecfc526 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c | |||
@@ -349,7 +349,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, | |||
349 | sizeof(struct watchdog_info)) ? -EFAULT : 0; | 349 | sizeof(struct watchdog_info)) ? -EFAULT : 0; |
350 | case WDIOC_GETSTATUS: | 350 | case WDIOC_GETSTATUS: |
351 | err = watchdog_get_status(wdd, &val); | 351 | err = watchdog_get_status(wdd, &val); |
352 | if (err) | 352 | if (err == -ENODEV) |
353 | return err; | 353 | return err; |
354 | return put_user(val, p); | 354 | return put_user(val, p); |
355 | case WDIOC_GETBOOTSTATUS: | 355 | case WDIOC_GETBOOTSTATUS: |