diff options
Diffstat (limited to 'drivers')
669 files changed, 9695 insertions, 4621 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 6512b20aeccd..d1fcbc0f6cbc 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -292,7 +292,9 @@ static int acpi_ac_add(struct acpi_device *device) | |||
292 | ac->charger.properties = ac_props; | 292 | ac->charger.properties = ac_props; |
293 | ac->charger.num_properties = ARRAY_SIZE(ac_props); | 293 | ac->charger.num_properties = ARRAY_SIZE(ac_props); |
294 | ac->charger.get_property = get_ac_property; | 294 | ac->charger.get_property = get_ac_property; |
295 | power_supply_register(&ac->device->dev, &ac->charger); | 295 | result = power_supply_register(&ac->device->dev, &ac->charger); |
296 | if (result) | ||
297 | goto end; | ||
296 | 298 | ||
297 | printk(KERN_INFO PREFIX "%s [%s] (%s)\n", | 299 | printk(KERN_INFO PREFIX "%s [%s] (%s)\n", |
298 | acpi_device_name(device), acpi_device_bid(device), | 300 | acpi_device_name(device), acpi_device_bid(device), |
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index d98571385656..24c807f96636 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -341,7 +341,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
341 | { | 341 | { |
342 | struct acpi_memory_device *mem_device; | 342 | struct acpi_memory_device *mem_device; |
343 | struct acpi_device *device; | 343 | struct acpi_device *device; |
344 | 344 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | |
345 | 345 | ||
346 | switch (event) { | 346 | switch (event) { |
347 | case ACPI_NOTIFY_BUS_CHECK: | 347 | case ACPI_NOTIFY_BUS_CHECK: |
@@ -354,15 +354,20 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
354 | "\nReceived DEVICE CHECK notification for device\n")); | 354 | "\nReceived DEVICE CHECK notification for device\n")); |
355 | if (acpi_memory_get_device(handle, &mem_device)) { | 355 | if (acpi_memory_get_device(handle, &mem_device)) { |
356 | printk(KERN_ERR PREFIX "Cannot find driver data\n"); | 356 | printk(KERN_ERR PREFIX "Cannot find driver data\n"); |
357 | return; | 357 | break; |
358 | } | 358 | } |
359 | 359 | ||
360 | if (!acpi_memory_check_device(mem_device)) { | 360 | if (acpi_memory_check_device(mem_device)) |
361 | if (acpi_memory_enable_device(mem_device)) | 361 | break; |
362 | printk(KERN_ERR PREFIX | 362 | |
363 | "Cannot enable memory device\n"); | 363 | if (acpi_memory_enable_device(mem_device)) { |
364 | printk(KERN_ERR PREFIX "Cannot enable memory device\n"); | ||
365 | break; | ||
364 | } | 366 | } |
367 | |||
368 | ost_code = ACPI_OST_SC_SUCCESS; | ||
365 | break; | 369 | break; |
370 | |||
366 | case ACPI_NOTIFY_EJECT_REQUEST: | 371 | case ACPI_NOTIFY_EJECT_REQUEST: |
367 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 372 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
368 | "\nReceived EJECT REQUEST notification for device\n")); | 373 | "\nReceived EJECT REQUEST notification for device\n")); |
@@ -383,19 +388,35 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
383 | * TBD: Can also be disabled by Callback registration | 388 | * TBD: Can also be disabled by Callback registration |
384 | * with generic sysfs driver | 389 | * with generic sysfs driver |
385 | */ | 390 | */ |
386 | if (acpi_memory_disable_device(mem_device)) | 391 | if (acpi_memory_disable_device(mem_device)) { |
387 | printk(KERN_ERR PREFIX | 392 | printk(KERN_ERR PREFIX "Disable memory device\n"); |
388 | "Disable memory device\n"); | 393 | /* |
394 | * If _EJ0 was called but failed, _OST is not | ||
395 | * necessary. | ||
396 | */ | ||
397 | if (mem_device->state == MEMORY_INVALID_STATE) | ||
398 | return; | ||
399 | |||
400 | break; | ||
401 | } | ||
402 | |||
389 | /* | 403 | /* |
390 | * TBD: Invoke acpi_bus_remove to cleanup data structures | 404 | * TBD: Invoke acpi_bus_remove to cleanup data structures |
391 | */ | 405 | */ |
392 | break; | 406 | |
407 | /* _EJ0 succeeded; _OST is not necessary */ | ||
408 | return; | ||
409 | |||
393 | default: | 410 | default: |
394 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 411 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
395 | "Unsupported event [0x%x]\n", event)); | 412 | "Unsupported event [0x%x]\n", event)); |
396 | break; | 413 | |
414 | /* non-hotplug event; possibly handled by other handler */ | ||
415 | return; | ||
397 | } | 416 | } |
398 | 417 | ||
418 | /* Inform firmware that the hotplug operation has completed */ | ||
419 | (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); | ||
399 | return; | 420 | return; |
400 | } | 421 | } |
401 | 422 | ||
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index a43fa1a57d57..af4aad6ee2eb 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 | } |
@@ -144,7 +145,7 @@ static void exit_round_robin(unsigned int tsk_index) | |||
144 | } | 145 | } |
145 | 146 | ||
146 | static unsigned int idle_pct = 5; /* percentage */ | 147 | static unsigned int idle_pct = 5; /* percentage */ |
147 | static unsigned int round_robin_time = 10; /* second */ | 148 | static unsigned int round_robin_time = 1; /* second */ |
148 | static int power_saving_thread(void *data) | 149 | static int power_saving_thread(void *data) |
149 | { | 150 | { |
150 | struct sched_param param = {.sched_priority = 1}; | 151 | struct sched_param param = {.sched_priority = 1}; |
@@ -234,7 +235,7 @@ static int create_power_saving_task(void) | |||
234 | 235 | ||
235 | ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread, | 236 | ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread, |
236 | (void *)(unsigned long)ps_tsk_num, | 237 | (void *)(unsigned long)ps_tsk_num, |
237 | "power_saving/%d", ps_tsk_num); | 238 | "acpi_pad/%d", ps_tsk_num); |
238 | rc = IS_ERR(ps_tsks[ps_tsk_num]) ? PTR_ERR(ps_tsks[ps_tsk_num]) : 0; | 239 | rc = IS_ERR(ps_tsks[ps_tsk_num]) ? PTR_ERR(ps_tsks[ps_tsk_num]) : 0; |
239 | if (!rc) | 240 | if (!rc) |
240 | ps_tsk_num++; | 241 | ps_tsk_num++; |
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index 793b8cc8e256..0a1b3435f920 100644 --- a/drivers/acpi/acpica/Makefile +++ b/drivers/acpi/acpica/Makefile | |||
@@ -134,12 +134,14 @@ acpi-y += \ | |||
134 | tbinstal.o \ | 134 | tbinstal.o \ |
135 | tbutils.o \ | 135 | tbutils.o \ |
136 | tbxface.o \ | 136 | tbxface.o \ |
137 | tbxfload.o \ | ||
137 | tbxfroot.o | 138 | tbxfroot.o |
138 | 139 | ||
139 | acpi-y += \ | 140 | acpi-y += \ |
140 | utaddress.o \ | 141 | utaddress.o \ |
141 | utalloc.o \ | 142 | utalloc.o \ |
142 | utcopy.o \ | 143 | utcopy.o \ |
144 | utexcep.o \ | ||
143 | utdebug.o \ | 145 | utdebug.o \ |
144 | utdecode.o \ | 146 | utdecode.o \ |
145 | utdelete.o \ | 147 | utdelete.o \ |
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index d700f63e4701..c0a43b38c6a3 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h | |||
@@ -237,7 +237,7 @@ u32 acpi_ev_install_sci_handler(void); | |||
237 | 237 | ||
238 | acpi_status acpi_ev_remove_sci_handler(void); | 238 | acpi_status acpi_ev_remove_sci_handler(void); |
239 | 239 | ||
240 | u32 acpi_ev_initialize_sCI(u32 program_sCI); | 240 | u32 acpi_ev_initialize_SCI(u32 program_SCI); |
241 | 241 | ||
242 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) | 242 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) |
243 | #endif /* __ACEVENTS_H__ */ | 243 | #endif /* __ACEVENTS_H__ */ |
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 4f7d3f57d05c..ce79100fb5eb 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -278,8 +278,7 @@ ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; | |||
278 | 278 | ||
279 | /* Global handlers */ | 279 | /* Global handlers */ |
280 | 280 | ||
281 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; | 281 | ACPI_EXTERN struct acpi_global_notify_handler acpi_gbl_global_notify[2]; |
282 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; | ||
283 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; | 282 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; |
284 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; | 283 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; |
285 | ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler; | 284 | ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler; |
@@ -327,14 +326,6 @@ extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; | |||
327 | 326 | ||
328 | #endif | 327 | #endif |
329 | 328 | ||
330 | /* Exception codes */ | ||
331 | |||
332 | extern char const *acpi_gbl_exception_names_env[]; | ||
333 | extern char const *acpi_gbl_exception_names_pgm[]; | ||
334 | extern char const *acpi_gbl_exception_names_tbl[]; | ||
335 | extern char const *acpi_gbl_exception_names_aml[]; | ||
336 | extern char const *acpi_gbl_exception_names_ctrl[]; | ||
337 | |||
338 | /***************************************************************************** | 329 | /***************************************************************************** |
339 | * | 330 | * |
340 | * Namespace globals | 331 | * Namespace globals |
@@ -463,4 +454,12 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; | |||
463 | 454 | ||
464 | #endif /* ACPI_DEBUGGER */ | 455 | #endif /* ACPI_DEBUGGER */ |
465 | 456 | ||
457 | /***************************************************************************** | ||
458 | * | ||
459 | * Info/help support | ||
460 | * | ||
461 | ****************************************************************************/ | ||
462 | |||
463 | extern const struct ah_predefined_name asl_predefined_info[]; | ||
464 | |||
466 | #endif /* __ACGLOBAL_H__ */ | 465 | #endif /* __ACGLOBAL_H__ */ |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index e3922ca20e7f..cc80fe10e8ea 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -299,7 +299,7 @@ acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); | |||
299 | * Information structure for ACPI predefined names. | 299 | * Information structure for ACPI predefined names. |
300 | * Each entry in the table contains the following items: | 300 | * Each entry in the table contains the following items: |
301 | * | 301 | * |
302 | * Name - The ACPI reserved name | 302 | * name - The ACPI reserved name |
303 | * param_count - Number of arguments to the method | 303 | * param_count - Number of arguments to the method |
304 | * expected_return_btypes - Allowed type(s) for the return value | 304 | * expected_return_btypes - Allowed type(s) for the return value |
305 | */ | 305 | */ |
@@ -404,6 +404,13 @@ struct acpi_gpe_handler_info { | |||
404 | u8 originally_enabled; /* True if GPE was originally enabled */ | 404 | u8 originally_enabled; /* True if GPE was originally enabled */ |
405 | }; | 405 | }; |
406 | 406 | ||
407 | /* Notify info for implicit notify, multiple device objects */ | ||
408 | |||
409 | struct acpi_gpe_notify_info { | ||
410 | struct acpi_namespace_node *device_node; /* Device to be notified */ | ||
411 | struct acpi_gpe_notify_info *next; | ||
412 | }; | ||
413 | |||
407 | struct acpi_gpe_notify_object { | 414 | struct acpi_gpe_notify_object { |
408 | struct acpi_namespace_node *node; | 415 | struct acpi_namespace_node *node; |
409 | struct acpi_gpe_notify_object *next; | 416 | struct acpi_gpe_notify_object *next; |
@@ -412,7 +419,7 @@ struct acpi_gpe_notify_object { | |||
412 | union acpi_gpe_dispatch_info { | 419 | union acpi_gpe_dispatch_info { |
413 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ | 420 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ |
414 | struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ | 421 | struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ |
415 | struct acpi_gpe_notify_object device; /* List of _PRW devices for implicit notify */ | 422 | struct acpi_gpe_notify_info *notify_list; /* List of _PRW devices for implicit notifies */ |
416 | }; | 423 | }; |
417 | 424 | ||
418 | /* | 425 | /* |
@@ -420,7 +427,7 @@ union acpi_gpe_dispatch_info { | |||
420 | * NOTE: Important to keep this struct as small as possible. | 427 | * NOTE: Important to keep this struct as small as possible. |
421 | */ | 428 | */ |
422 | struct acpi_gpe_event_info { | 429 | struct acpi_gpe_event_info { |
423 | union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ | 430 | union acpi_gpe_dispatch_info dispatch; /* Either Method, Handler, or notify_list */ |
424 | struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ | 431 | struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ |
425 | u8 flags; /* Misc info about this GPE */ | 432 | u8 flags; /* Misc info about this GPE */ |
426 | u8 gpe_number; /* This GPE */ | 433 | u8 gpe_number; /* This GPE */ |
@@ -600,13 +607,22 @@ acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, | |||
600 | 607 | ||
601 | typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); | 608 | typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); |
602 | 609 | ||
610 | /* Global handlers for AML Notifies */ | ||
611 | |||
612 | struct acpi_global_notify_handler { | ||
613 | acpi_notify_handler handler; | ||
614 | void *context; | ||
615 | }; | ||
616 | |||
603 | /* | 617 | /* |
604 | * Notify info - used to pass info to the deferred notify | 618 | * Notify info - used to pass info to the deferred notify |
605 | * handler/dispatcher. | 619 | * handler/dispatcher. |
606 | */ | 620 | */ |
607 | struct acpi_notify_info { | 621 | struct acpi_notify_info { |
608 | ACPI_STATE_COMMON struct acpi_namespace_node *node; | 622 | ACPI_STATE_COMMON u8 handler_list_id; |
609 | union acpi_operand_object *handler_obj; | 623 | struct acpi_namespace_node *node; |
624 | union acpi_operand_object *handler_list_head; | ||
625 | struct acpi_global_notify_handler *global; | ||
610 | }; | 626 | }; |
611 | 627 | ||
612 | /* Generic state is union of structs above */ | 628 | /* Generic state is union of structs above */ |
@@ -718,7 +734,7 @@ struct acpi_parse_obj_named { | |||
718 | u32 name; /* 4-byte name or zero if no name */ | 734 | u32 name; /* 4-byte name or zero if no name */ |
719 | }; | 735 | }; |
720 | 736 | ||
721 | /* This version is used by the i_aSL compiler only */ | 737 | /* This version is used by the iASL compiler only */ |
722 | 738 | ||
723 | #define ACPI_MAX_PARSEOP_NAME 20 | 739 | #define ACPI_MAX_PARSEOP_NAME 20 |
724 | 740 | ||
@@ -787,6 +803,7 @@ struct acpi_parse_state { | |||
787 | #define ACPI_PARSEOP_IGNORE 0x01 | 803 | #define ACPI_PARSEOP_IGNORE 0x01 |
788 | #define ACPI_PARSEOP_PARAMLIST 0x02 | 804 | #define ACPI_PARSEOP_PARAMLIST 0x02 |
789 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 | 805 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 |
806 | #define ACPI_PARSEOP_PREDEF_CHECKED 0x08 | ||
790 | #define ACPI_PARSEOP_SPECIAL 0x10 | 807 | #define ACPI_PARSEOP_SPECIAL 0x10 |
791 | 808 | ||
792 | /***************************************************************************** | 809 | /***************************************************************************** |
@@ -1075,4 +1092,18 @@ struct acpi_debug_mem_block { | |||
1075 | #define ACPI_MEM_LIST_MAX 1 | 1092 | #define ACPI_MEM_LIST_MAX 1 |
1076 | #define ACPI_NUM_MEM_LISTS 2 | 1093 | #define ACPI_NUM_MEM_LISTS 2 |
1077 | 1094 | ||
1095 | /***************************************************************************** | ||
1096 | * | ||
1097 | * Info/help support | ||
1098 | * | ||
1099 | ****************************************************************************/ | ||
1100 | |||
1101 | struct ah_predefined_name { | ||
1102 | char *name; | ||
1103 | char *description; | ||
1104 | #ifndef ACPI_ASL_COMPILER | ||
1105 | char *action; | ||
1106 | #endif | ||
1107 | }; | ||
1108 | |||
1078 | #endif /* __ACLOCAL_H__ */ | 1109 | #endif /* __ACLOCAL_H__ */ |
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index f119f473f71a..832b6198652e 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h | |||
@@ -62,7 +62,7 @@ | |||
62 | * printf() format helpers | 62 | * printf() format helpers |
63 | */ | 63 | */ |
64 | 64 | ||
65 | /* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */ | 65 | /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ |
66 | 66 | ||
67 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) | 67 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) |
68 | 68 | ||
@@ -283,8 +283,8 @@ | |||
283 | #define ACPI_INSERT_BITS(target, mask, source) target = ((target & (~(mask))) | (source & mask)) | 283 | #define ACPI_INSERT_BITS(target, mask, source) target = ((target & (~(mask))) | (source & mask)) |
284 | 284 | ||
285 | /* | 285 | /* |
286 | * A struct acpi_namespace_node can appear in some contexts | 286 | * An object of type struct acpi_namespace_node can appear in some contexts |
287 | * where a pointer to a union acpi_operand_object can also | 287 | * where a pointer to an object of type union acpi_operand_object can also |
288 | * appear. This macro is used to distinguish them. | 288 | * appear. This macro is used to distinguish them. |
289 | * | 289 | * |
290 | * The "Descriptor" field is the first field in both structures. | 290 | * The "Descriptor" field is the first field in both structures. |
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h index c065078ca83b..364a1303fb8f 100644 --- a/drivers/acpi/acpica/acobject.h +++ b/drivers/acpi/acpica/acobject.h | |||
@@ -113,8 +113,8 @@ struct acpi_object_integer { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Note: The String and Buffer object must be identical through the Pointer | 116 | * Note: The String and Buffer object must be identical through the |
117 | * and length elements. There is code that depends on this. | 117 | * pointer and length elements. There is code that depends on this. |
118 | * | 118 | * |
119 | * Fields common to both Strings and Buffers | 119 | * Fields common to both Strings and Buffers |
120 | */ | 120 | */ |
@@ -206,8 +206,7 @@ struct acpi_object_method { | |||
206 | * Common fields for objects that support ASL notifications | 206 | * Common fields for objects that support ASL notifications |
207 | */ | 207 | */ |
208 | #define ACPI_COMMON_NOTIFY_INFO \ | 208 | #define ACPI_COMMON_NOTIFY_INFO \ |
209 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ | 209 | union acpi_operand_object *notify_list[2]; /* Handlers for system/device notifies */\ |
210 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ | ||
211 | union acpi_operand_object *handler; /* Handler for Address space */ | 210 | union acpi_operand_object *handler; /* Handler for Address space */ |
212 | 211 | ||
213 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ | 212 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ |
@@ -296,10 +295,10 @@ struct acpi_object_buffer_field { | |||
296 | 295 | ||
297 | struct acpi_object_notify_handler { | 296 | struct acpi_object_notify_handler { |
298 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ | 297 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ |
299 | u32 handler_type; | 298 | u32 handler_type; /* Type: Device/System/Both */ |
300 | acpi_notify_handler handler; | 299 | acpi_notify_handler handler; /* Handler address */ |
301 | void *context; | 300 | void *context; |
302 | struct acpi_object_notify_handler *next; | 301 | union acpi_operand_object *next[2]; /* Device and System handler lists */ |
303 | }; | 302 | }; |
304 | 303 | ||
305 | struct acpi_object_addr_handler { | 304 | struct acpi_object_addr_handler { |
@@ -382,7 +381,7 @@ struct acpi_object_cache_list { | |||
382 | 381 | ||
383 | /****************************************************************************** | 382 | /****************************************************************************** |
384 | * | 383 | * |
385 | * union acpi_operand_object Descriptor - a giant union of all of the above | 384 | * union acpi_operand_object descriptor - a giant union of all of the above |
386 | * | 385 | * |
387 | *****************************************************************************/ | 386 | *****************************************************************************/ |
388 | 387 | ||
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h index bbb34c9be4e8..3080c017f5ba 100644 --- a/drivers/acpi/acpica/acpredef.h +++ b/drivers/acpi/acpica/acpredef.h | |||
@@ -140,7 +140,7 @@ enum acpi_return_package_types { | |||
140 | * | 140 | * |
141 | * The main entries in the table each contain the following items: | 141 | * The main entries in the table each contain the following items: |
142 | * | 142 | * |
143 | * Name - The ACPI reserved name | 143 | * name - The ACPI reserved name |
144 | * param_count - Number of arguments to the method | 144 | * param_count - Number of arguments to the method |
145 | * expected_btypes - Allowed type(s) for the return value. | 145 | * expected_btypes - Allowed type(s) for the return value. |
146 | * 0 means that no return value is expected. | 146 | * 0 means that no return value is expected. |
@@ -511,14 +511,14 @@ static const union acpi_predefined_info predefined_names[] = | |||
511 | {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, | 511 | {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, |
512 | {{"_TPC", 0, ACPI_RTYPE_INTEGER}}, | 512 | {{"_TPC", 0, ACPI_RTYPE_INTEGER}}, |
513 | {{"_TPT", 1, 0}}, | 513 | {{"_TPT", 1, 0}}, |
514 | {{"_TRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2_ref/6_int */ | 514 | {{"_TRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2 Ref/6 Int */ |
515 | {{{ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 6, 0}}, | 515 | {{{ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 6, 0}}, |
516 | 516 | ||
517 | {{"_TSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5_int with count */ | 517 | {{"_TSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5 Int with count */ |
518 | {{{ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, | 518 | {{{ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, |
519 | 519 | ||
520 | {{"_TSP", 0, ACPI_RTYPE_INTEGER}}, | 520 | {{"_TSP", 0, ACPI_RTYPE_INTEGER}}, |
521 | {{"_TSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5_int */ | 521 | {{"_TSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5 Int */ |
522 | {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, | 522 | {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, |
523 | 523 | ||
524 | {{"_TST", 0, ACPI_RTYPE_INTEGER}}, | 524 | {{"_TST", 0, ACPI_RTYPE_INTEGER}}, |
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h index 0404df605bc1..f196e2c9a71f 100644 --- a/drivers/acpi/acpica/acstruct.h +++ b/drivers/acpi/acpica/acstruct.h | |||
@@ -68,7 +68,7 @@ | |||
68 | #define ACPI_WALK_METHOD 0x01 | 68 | #define ACPI_WALK_METHOD 0x01 |
69 | #define ACPI_WALK_METHOD_RESTART 0x02 | 69 | #define ACPI_WALK_METHOD_RESTART 0x02 |
70 | 70 | ||
71 | /* Flags for i_aSL compiler only */ | 71 | /* Flags for iASL compiler only */ |
72 | 72 | ||
73 | #define ACPI_WALK_CONST_REQUIRED 0x10 | 73 | #define ACPI_WALK_CONST_REQUIRED 0x10 |
74 | #define ACPI_WALK_CONST_OPTIONAL 0x20 | 74 | #define ACPI_WALK_CONST_OPTIONAL 0x20 |
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index 925ccf22101b..5035327ebccc 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h | |||
@@ -460,6 +460,8 @@ acpi_ut_short_divide(u64 in_dividend, | |||
460 | /* | 460 | /* |
461 | * utmisc | 461 | * utmisc |
462 | */ | 462 | */ |
463 | void ut_convert_backslashes(char *pathname); | ||
464 | |||
463 | const char *acpi_ut_validate_exception(acpi_status status); | 465 | const char *acpi_ut_validate_exception(acpi_status status); |
464 | 466 | ||
465 | u8 acpi_ut_is_pci_root_bridge(char *id); | 467 | u8 acpi_ut_is_pci_root_bridge(char *id); |
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h index 905280fec0fa..c26f8ff6c3b9 100644 --- a/drivers/acpi/acpica/amlcode.h +++ b/drivers/acpi/acpica/amlcode.h | |||
@@ -182,7 +182,7 @@ | |||
182 | 182 | ||
183 | /* | 183 | /* |
184 | * Combination opcodes (actually two one-byte opcodes) | 184 | * Combination opcodes (actually two one-byte opcodes) |
185 | * Used by the disassembler and i_aSL compiler | 185 | * Used by the disassembler and iASL compiler |
186 | */ | 186 | */ |
187 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 | 187 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 |
188 | #define AML_LLESSEQUAL_OP (u16) 0x9294 | 188 | #define AML_LLESSEQUAL_OP (u16) 0x9294 |
@@ -280,7 +280,7 @@ | |||
280 | 280 | ||
281 | /* Multiple/complex types */ | 281 | /* Multiple/complex types */ |
282 | 282 | ||
283 | #define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */ | 283 | #define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a node - Used only by size_of operator */ |
284 | #define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ | 284 | #define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ |
285 | #define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ | 285 | #define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ |
286 | #define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */ | 286 | #define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */ |
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h index 7b2128f274e7..af4947956ec2 100644 --- a/drivers/acpi/acpica/amlresrc.h +++ b/drivers/acpi/acpica/amlresrc.h | |||
@@ -98,7 +98,7 @@ | |||
98 | #define ACPI_RESTAG_TRANSLATION "_TRA" | 98 | #define ACPI_RESTAG_TRANSLATION "_TRA" |
99 | #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ | 99 | #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ |
100 | #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ | 100 | #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ |
101 | #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ | 101 | #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ |
102 | #define ACPI_RESTAG_VENDORDATA "_VEN" | 102 | #define ACPI_RESTAG_VENDORDATA "_VEN" |
103 | 103 | ||
104 | /* Default sizes for "small" resource descriptors */ | 104 | /* Default sizes for "small" resource descriptors */ |
@@ -235,7 +235,7 @@ AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; | |||
235 | 235 | ||
236 | struct aml_resource_extended_address64 { | 236 | struct aml_resource_extended_address64 { |
237 | AML_RESOURCE_LARGE_HEADER_COMMON | 237 | AML_RESOURCE_LARGE_HEADER_COMMON |
238 | AML_RESOURCE_ADDRESS_COMMON u8 revision_iD; | 238 | AML_RESOURCE_ADDRESS_COMMON u8 revision_ID; |
239 | u8 reserved; | 239 | u8 reserved; |
240 | u64 granularity; | 240 | u64 granularity; |
241 | u64 minimum; | 241 | u64 minimum; |
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c index 80eb1900297f..c8b5e2565b98 100644 --- a/drivers/acpi/acpica/dsargs.c +++ b/drivers/acpi/acpica/dsargs.c | |||
@@ -62,7 +62,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node, | |||
62 | * | 62 | * |
63 | * FUNCTION: acpi_ds_execute_arguments | 63 | * FUNCTION: acpi_ds_execute_arguments |
64 | * | 64 | * |
65 | * PARAMETERS: Node - Object NS node | 65 | * PARAMETERS: node - Object NS node |
66 | * scope_node - Parent NS node | 66 | * scope_node - Parent NS node |
67 | * aml_length - Length of executable AML | 67 | * aml_length - Length of executable AML |
68 | * aml_start - Pointer to the AML | 68 | * aml_start - Pointer to the AML |
diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c index effe4ca1133f..465f02134b89 100644 --- a/drivers/acpi/acpica/dscontrol.c +++ b/drivers/acpi/acpica/dscontrol.c | |||
@@ -56,7 +56,7 @@ ACPI_MODULE_NAME("dscontrol") | |||
56 | * FUNCTION: acpi_ds_exec_begin_control_op | 56 | * FUNCTION: acpi_ds_exec_begin_control_op |
57 | * | 57 | * |
58 | * PARAMETERS: walk_list - The list that owns the walk stack | 58 | * PARAMETERS: walk_list - The list that owns the walk stack |
59 | * Op - The control Op | 59 | * op - The control Op |
60 | * | 60 | * |
61 | * RETURN: Status | 61 | * RETURN: Status |
62 | * | 62 | * |
@@ -153,7 +153,7 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, | |||
153 | * FUNCTION: acpi_ds_exec_end_control_op | 153 | * FUNCTION: acpi_ds_exec_end_control_op |
154 | * | 154 | * |
155 | * PARAMETERS: walk_list - The list that owns the walk stack | 155 | * PARAMETERS: walk_list - The list that owns the walk stack |
156 | * Op - The control Op | 156 | * op - The control Op |
157 | * | 157 | * |
158 | * RETURN: Status | 158 | * RETURN: Status |
159 | * | 159 | * |
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c index cd243cf2cab2..3da6fd8530c5 100644 --- a/drivers/acpi/acpica/dsfield.c +++ b/drivers/acpi/acpica/dsfield.c | |||
@@ -53,16 +53,84 @@ | |||
53 | ACPI_MODULE_NAME("dsfield") | 53 | ACPI_MODULE_NAME("dsfield") |
54 | 54 | ||
55 | /* Local prototypes */ | 55 | /* Local prototypes */ |
56 | #ifdef ACPI_ASL_COMPILER | ||
57 | #include "acdisasm.h" | ||
58 | static acpi_status | ||
59 | acpi_ds_create_external_region(acpi_status lookup_status, | ||
60 | union acpi_parse_object *op, | ||
61 | char *path, | ||
62 | struct acpi_walk_state *walk_state, | ||
63 | struct acpi_namespace_node **node); | ||
64 | #endif | ||
65 | |||
56 | static acpi_status | 66 | static acpi_status |
57 | acpi_ds_get_field_names(struct acpi_create_field_info *info, | 67 | acpi_ds_get_field_names(struct acpi_create_field_info *info, |
58 | struct acpi_walk_state *walk_state, | 68 | struct acpi_walk_state *walk_state, |
59 | union acpi_parse_object *arg); | 69 | union acpi_parse_object *arg); |
60 | 70 | ||
71 | #ifdef ACPI_ASL_COMPILER | ||
72 | /******************************************************************************* | ||
73 | * | ||
74 | * FUNCTION: acpi_ds_create_external_region (iASL Disassembler only) | ||
75 | * | ||
76 | * PARAMETERS: lookup_status - Status from ns_lookup operation | ||
77 | * op - Op containing the Field definition and args | ||
78 | * path - Pathname of the region | ||
79 | * ` walk_state - Current method state | ||
80 | * node - Where the new region node is returned | ||
81 | * | ||
82 | * RETURN: Status | ||
83 | * | ||
84 | * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new | ||
85 | * region node/object. | ||
86 | * | ||
87 | ******************************************************************************/ | ||
88 | |||
89 | static acpi_status | ||
90 | acpi_ds_create_external_region(acpi_status lookup_status, | ||
91 | union acpi_parse_object *op, | ||
92 | char *path, | ||
93 | struct acpi_walk_state *walk_state, | ||
94 | struct acpi_namespace_node **node) | ||
95 | { | ||
96 | acpi_status status; | ||
97 | union acpi_operand_object *obj_desc; | ||
98 | |||
99 | if (lookup_status != AE_NOT_FOUND) { | ||
100 | return (lookup_status); | ||
101 | } | ||
102 | |||
103 | /* | ||
104 | * Table disassembly: | ||
105 | * operation_region not found. Generate an External for it, and | ||
106 | * insert the name into the namespace. | ||
107 | */ | ||
108 | acpi_dm_add_to_external_list(op, path, ACPI_TYPE_REGION, 0); | ||
109 | status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION, | ||
110 | ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, | ||
111 | walk_state, node); | ||
112 | if (ACPI_FAILURE(status)) { | ||
113 | return (status); | ||
114 | } | ||
115 | |||
116 | /* Must create and install a region object for the new node */ | ||
117 | |||
118 | obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_REGION); | ||
119 | if (!obj_desc) { | ||
120 | return (AE_NO_MEMORY); | ||
121 | } | ||
122 | |||
123 | obj_desc->region.node = *node; | ||
124 | status = acpi_ns_attach_object(*node, obj_desc, ACPI_TYPE_REGION); | ||
125 | return (status); | ||
126 | } | ||
127 | #endif | ||
128 | |||
61 | /******************************************************************************* | 129 | /******************************************************************************* |
62 | * | 130 | * |
63 | * FUNCTION: acpi_ds_create_buffer_field | 131 | * FUNCTION: acpi_ds_create_buffer_field |
64 | * | 132 | * |
65 | * PARAMETERS: Op - Current parse op (create_xXField) | 133 | * PARAMETERS: op - Current parse op (create_XXField) |
66 | * walk_state - Current state | 134 | * walk_state - Current state |
67 | * | 135 | * |
68 | * RETURN: Status | 136 | * RETURN: Status |
@@ -99,7 +167,7 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, | |||
99 | 167 | ||
100 | arg = acpi_ps_get_arg(op, 3); | 168 | arg = acpi_ps_get_arg(op, 3); |
101 | } else { | 169 | } else { |
102 | /* For all other create_xXXField operators, name is the 3rd argument */ | 170 | /* For all other create_XXXField operators, name is the 3rd argument */ |
103 | 171 | ||
104 | arg = acpi_ps_get_arg(op, 2); | 172 | arg = acpi_ps_get_arg(op, 2); |
105 | } | 173 | } |
@@ -203,9 +271,9 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, | |||
203 | * | 271 | * |
204 | * FUNCTION: acpi_ds_get_field_names | 272 | * FUNCTION: acpi_ds_get_field_names |
205 | * | 273 | * |
206 | * PARAMETERS: Info - create_field info structure | 274 | * PARAMETERS: info - create_field info structure |
207 | * ` walk_state - Current method state | 275 | * ` walk_state - Current method state |
208 | * Arg - First parser arg for the field name list | 276 | * arg - First parser arg for the field name list |
209 | * | 277 | * |
210 | * RETURN: Status | 278 | * RETURN: Status |
211 | * | 279 | * |
@@ -234,10 +302,10 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, | |||
234 | while (arg) { | 302 | while (arg) { |
235 | /* | 303 | /* |
236 | * Four types of field elements are handled: | 304 | * Four types of field elements are handled: |
237 | * 1) Name - Enters a new named field into the namespace | 305 | * 1) name - Enters a new named field into the namespace |
238 | * 2) Offset - specifies a bit offset | 306 | * 2) offset - specifies a bit offset |
239 | * 3) access_as - changes the access mode/attributes | 307 | * 3) access_as - changes the access mode/attributes |
240 | * 4) Connection - Associate a resource template with the field | 308 | * 4) connection - Associate a resource template with the field |
241 | */ | 309 | */ |
242 | switch (arg->common.aml_opcode) { | 310 | switch (arg->common.aml_opcode) { |
243 | case AML_INT_RESERVEDFIELD_OP: | 311 | case AML_INT_RESERVEDFIELD_OP: |
@@ -389,7 +457,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, | |||
389 | * | 457 | * |
390 | * FUNCTION: acpi_ds_create_field | 458 | * FUNCTION: acpi_ds_create_field |
391 | * | 459 | * |
392 | * PARAMETERS: Op - Op containing the Field definition and args | 460 | * PARAMETERS: op - Op containing the Field definition and args |
393 | * region_node - Object for the containing Operation Region | 461 | * region_node - Object for the containing Operation Region |
394 | * ` walk_state - Current method state | 462 | * ` walk_state - Current method state |
395 | * | 463 | * |
@@ -413,12 +481,19 @@ acpi_ds_create_field(union acpi_parse_object *op, | |||
413 | /* First arg is the name of the parent op_region (must already exist) */ | 481 | /* First arg is the name of the parent op_region (must already exist) */ |
414 | 482 | ||
415 | arg = op->common.value.arg; | 483 | arg = op->common.value.arg; |
484 | |||
416 | if (!region_node) { | 485 | if (!region_node) { |
417 | status = | 486 | status = |
418 | acpi_ns_lookup(walk_state->scope_info, | 487 | acpi_ns_lookup(walk_state->scope_info, |
419 | arg->common.value.name, ACPI_TYPE_REGION, | 488 | arg->common.value.name, ACPI_TYPE_REGION, |
420 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, | 489 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, |
421 | walk_state, ®ion_node); | 490 | walk_state, ®ion_node); |
491 | #ifdef ACPI_ASL_COMPILER | ||
492 | status = acpi_ds_create_external_region(status, arg, | ||
493 | arg->common.value.name, | ||
494 | walk_state, | ||
495 | ®ion_node); | ||
496 | #endif | ||
422 | if (ACPI_FAILURE(status)) { | 497 | if (ACPI_FAILURE(status)) { |
423 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); | 498 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); |
424 | return_ACPI_STATUS(status); | 499 | return_ACPI_STATUS(status); |
@@ -446,7 +521,7 @@ acpi_ds_create_field(union acpi_parse_object *op, | |||
446 | * | 521 | * |
447 | * FUNCTION: acpi_ds_init_field_objects | 522 | * FUNCTION: acpi_ds_init_field_objects |
448 | * | 523 | * |
449 | * PARAMETERS: Op - Op containing the Field definition and args | 524 | * PARAMETERS: op - Op containing the Field definition and args |
450 | * ` walk_state - Current method state | 525 | * ` walk_state - Current method state |
451 | * | 526 | * |
452 | * RETURN: Status | 527 | * RETURN: Status |
@@ -561,7 +636,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op, | |||
561 | * | 636 | * |
562 | * FUNCTION: acpi_ds_create_bank_field | 637 | * FUNCTION: acpi_ds_create_bank_field |
563 | * | 638 | * |
564 | * PARAMETERS: Op - Op containing the Field definition and args | 639 | * PARAMETERS: op - Op containing the Field definition and args |
565 | * region_node - Object for the containing Operation Region | 640 | * region_node - Object for the containing Operation Region |
566 | * walk_state - Current method state | 641 | * walk_state - Current method state |
567 | * | 642 | * |
@@ -591,6 +666,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, | |||
591 | arg->common.value.name, ACPI_TYPE_REGION, | 666 | arg->common.value.name, ACPI_TYPE_REGION, |
592 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, | 667 | ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, |
593 | walk_state, ®ion_node); | 668 | walk_state, ®ion_node); |
669 | #ifdef ACPI_ASL_COMPILER | ||
670 | status = acpi_ds_create_external_region(status, arg, | ||
671 | arg->common.value.name, | ||
672 | walk_state, | ||
673 | ®ion_node); | ||
674 | #endif | ||
594 | if (ACPI_FAILURE(status)) { | 675 | if (ACPI_FAILURE(status)) { |
595 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); | 676 | ACPI_ERROR_NAMESPACE(arg->common.value.name, status); |
596 | return_ACPI_STATUS(status); | 677 | return_ACPI_STATUS(status); |
@@ -645,7 +726,7 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, | |||
645 | * | 726 | * |
646 | * FUNCTION: acpi_ds_create_index_field | 727 | * FUNCTION: acpi_ds_create_index_field |
647 | * | 728 | * |
648 | * PARAMETERS: Op - Op containing the Field definition and args | 729 | * PARAMETERS: op - Op containing the Field definition and args |
649 | * region_node - Object for the containing Operation Region | 730 | * region_node - Object for the containing Operation Region |
650 | * ` walk_state - Current method state | 731 | * ` walk_state - Current method state |
651 | * | 732 | * |
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c index 9e5ac7f780a7..87eff701ecfa 100644 --- a/drivers/acpi/acpica/dsinit.c +++ b/drivers/acpi/acpica/dsinit.c | |||
@@ -60,8 +60,8 @@ acpi_ds_init_one_object(acpi_handle obj_handle, | |||
60 | * FUNCTION: acpi_ds_init_one_object | 60 | * FUNCTION: acpi_ds_init_one_object |
61 | * | 61 | * |
62 | * PARAMETERS: obj_handle - Node for the object | 62 | * PARAMETERS: obj_handle - Node for the object |
63 | * Level - Current nesting level | 63 | * level - Current nesting level |
64 | * Context - Points to a init info struct | 64 | * context - Points to a init info struct |
65 | * return_value - Not used | 65 | * return_value - Not used |
66 | * | 66 | * |
67 | * RETURN: Status | 67 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index 00f5dab5bcc0..aa9a5d4e4052 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c | |||
@@ -61,7 +61,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc); | |||
61 | * | 61 | * |
62 | * FUNCTION: acpi_ds_method_error | 62 | * FUNCTION: acpi_ds_method_error |
63 | * | 63 | * |
64 | * PARAMETERS: Status - Execution status | 64 | * PARAMETERS: status - Execution status |
65 | * walk_state - Current state | 65 | * walk_state - Current state |
66 | * | 66 | * |
67 | * RETURN: Status | 67 | * RETURN: Status |
@@ -306,9 +306,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | |||
306 | * | 306 | * |
307 | * FUNCTION: acpi_ds_call_control_method | 307 | * FUNCTION: acpi_ds_call_control_method |
308 | * | 308 | * |
309 | * PARAMETERS: Thread - Info for this thread | 309 | * PARAMETERS: thread - Info for this thread |
310 | * this_walk_state - Current walk state | 310 | * this_walk_state - Current walk state |
311 | * Op - Current Op to be walked | 311 | * op - Current Op to be walked |
312 | * | 312 | * |
313 | * RETURN: Status | 313 | * RETURN: Status |
314 | * | 314 | * |
diff --git a/drivers/acpi/acpica/dsmthdat.c b/drivers/acpi/acpica/dsmthdat.c index b40bd507be5d..8d55cebaa656 100644 --- a/drivers/acpi/acpica/dsmthdat.c +++ b/drivers/acpi/acpica/dsmthdat.c | |||
@@ -177,7 +177,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state) | |||
177 | * | 177 | * |
178 | * FUNCTION: acpi_ds_method_data_init_args | 178 | * FUNCTION: acpi_ds_method_data_init_args |
179 | * | 179 | * |
180 | * PARAMETERS: *Params - Pointer to a parameter list for the method | 180 | * PARAMETERS: *params - Pointer to a parameter list for the method |
181 | * max_param_count - The arg count for this method | 181 | * max_param_count - The arg count for this method |
182 | * walk_state - Current walk state object | 182 | * walk_state - Current walk state object |
183 | * | 183 | * |
@@ -232,11 +232,11 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params, | |||
232 | * | 232 | * |
233 | * FUNCTION: acpi_ds_method_data_get_node | 233 | * FUNCTION: acpi_ds_method_data_get_node |
234 | * | 234 | * |
235 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 235 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
236 | * ACPI_REFCLASS_ARG | 236 | * ACPI_REFCLASS_ARG |
237 | * Index - Which Local or Arg whose type to get | 237 | * index - Which Local or Arg whose type to get |
238 | * walk_state - Current walk state object | 238 | * walk_state - Current walk state object |
239 | * Node - Where the node is returned. | 239 | * node - Where the node is returned. |
240 | * | 240 | * |
241 | * RETURN: Status and node | 241 | * RETURN: Status and node |
242 | * | 242 | * |
@@ -296,10 +296,10 @@ acpi_ds_method_data_get_node(u8 type, | |||
296 | * | 296 | * |
297 | * FUNCTION: acpi_ds_method_data_set_value | 297 | * FUNCTION: acpi_ds_method_data_set_value |
298 | * | 298 | * |
299 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 299 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
300 | * ACPI_REFCLASS_ARG | 300 | * ACPI_REFCLASS_ARG |
301 | * Index - Which Local or Arg to get | 301 | * index - Which Local or Arg to get |
302 | * Object - Object to be inserted into the stack entry | 302 | * object - Object to be inserted into the stack entry |
303 | * walk_state - Current walk state object | 303 | * walk_state - Current walk state object |
304 | * | 304 | * |
305 | * RETURN: Status | 305 | * RETURN: Status |
@@ -336,7 +336,7 @@ acpi_ds_method_data_set_value(u8 type, | |||
336 | * Increment ref count so object can't be deleted while installed. | 336 | * Increment ref count so object can't be deleted while installed. |
337 | * NOTE: We do not copy the object in order to preserve the call by | 337 | * NOTE: We do not copy the object in order to preserve the call by |
338 | * reference semantics of ACPI Control Method invocation. | 338 | * reference semantics of ACPI Control Method invocation. |
339 | * (See ACPI Specification 2.0_c) | 339 | * (See ACPI Specification 2.0C) |
340 | */ | 340 | */ |
341 | acpi_ut_add_reference(object); | 341 | acpi_ut_add_reference(object); |
342 | 342 | ||
@@ -350,9 +350,9 @@ acpi_ds_method_data_set_value(u8 type, | |||
350 | * | 350 | * |
351 | * FUNCTION: acpi_ds_method_data_get_value | 351 | * FUNCTION: acpi_ds_method_data_get_value |
352 | * | 352 | * |
353 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 353 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
354 | * ACPI_REFCLASS_ARG | 354 | * ACPI_REFCLASS_ARG |
355 | * Index - Which local_var or argument to get | 355 | * index - Which localVar or argument to get |
356 | * walk_state - Current walk state object | 356 | * walk_state - Current walk state object |
357 | * dest_desc - Where Arg or Local value is returned | 357 | * dest_desc - Where Arg or Local value is returned |
358 | * | 358 | * |
@@ -458,9 +458,9 @@ acpi_ds_method_data_get_value(u8 type, | |||
458 | * | 458 | * |
459 | * FUNCTION: acpi_ds_method_data_delete_value | 459 | * FUNCTION: acpi_ds_method_data_delete_value |
460 | * | 460 | * |
461 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 461 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
462 | * ACPI_REFCLASS_ARG | 462 | * ACPI_REFCLASS_ARG |
463 | * Index - Which local_var or argument to delete | 463 | * index - Which localVar or argument to delete |
464 | * walk_state - Current walk state object | 464 | * walk_state - Current walk state object |
465 | * | 465 | * |
466 | * RETURN: None | 466 | * RETURN: None |
@@ -515,9 +515,9 @@ acpi_ds_method_data_delete_value(u8 type, | |||
515 | * | 515 | * |
516 | * FUNCTION: acpi_ds_store_object_to_local | 516 | * FUNCTION: acpi_ds_store_object_to_local |
517 | * | 517 | * |
518 | * PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or | 518 | * PARAMETERS: type - Either ACPI_REFCLASS_LOCAL or |
519 | * ACPI_REFCLASS_ARG | 519 | * ACPI_REFCLASS_ARG |
520 | * Index - Which Local or Arg to set | 520 | * index - Which Local or Arg to set |
521 | * obj_desc - Value to be stored | 521 | * obj_desc - Value to be stored |
522 | * walk_state - Current walk state | 522 | * walk_state - Current walk state |
523 | * | 523 | * |
@@ -670,8 +670,8 @@ acpi_ds_store_object_to_local(u8 type, | |||
670 | * | 670 | * |
671 | * FUNCTION: acpi_ds_method_data_get_type | 671 | * FUNCTION: acpi_ds_method_data_get_type |
672 | * | 672 | * |
673 | * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP | 673 | * PARAMETERS: opcode - Either AML_LOCAL_OP or AML_ARG_OP |
674 | * Index - Which Local or Arg whose type to get | 674 | * index - Which Local or Arg whose type to get |
675 | * walk_state - Current walk state object | 675 | * walk_state - Current walk state object |
676 | * | 676 | * |
677 | * RETURN: Data type of current value of the selected Arg or Local | 677 | * RETURN: Data type of current value of the selected Arg or Local |
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c index d7045ca3e32a..68592dd34960 100644 --- a/drivers/acpi/acpica/dsobject.c +++ b/drivers/acpi/acpica/dsobject.c | |||
@@ -64,7 +64,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, | |||
64 | * FUNCTION: acpi_ds_build_internal_object | 64 | * FUNCTION: acpi_ds_build_internal_object |
65 | * | 65 | * |
66 | * PARAMETERS: walk_state - Current walk state | 66 | * PARAMETERS: walk_state - Current walk state |
67 | * Op - Parser object to be translated | 67 | * op - Parser object to be translated |
68 | * obj_desc_ptr - Where the ACPI internal object is returned | 68 | * obj_desc_ptr - Where the ACPI internal object is returned |
69 | * | 69 | * |
70 | * RETURN: Status | 70 | * RETURN: Status |
@@ -250,7 +250,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, | |||
250 | * FUNCTION: acpi_ds_build_internal_buffer_obj | 250 | * FUNCTION: acpi_ds_build_internal_buffer_obj |
251 | * | 251 | * |
252 | * PARAMETERS: walk_state - Current walk state | 252 | * PARAMETERS: walk_state - Current walk state |
253 | * Op - Parser object to be translated | 253 | * op - Parser object to be translated |
254 | * buffer_length - Length of the buffer | 254 | * buffer_length - Length of the buffer |
255 | * obj_desc_ptr - Where the ACPI internal object is returned | 255 | * obj_desc_ptr - Where the ACPI internal object is returned |
256 | * | 256 | * |
@@ -354,7 +354,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state, | |||
354 | * FUNCTION: acpi_ds_build_internal_package_obj | 354 | * FUNCTION: acpi_ds_build_internal_package_obj |
355 | * | 355 | * |
356 | * PARAMETERS: walk_state - Current walk state | 356 | * PARAMETERS: walk_state - Current walk state |
357 | * Op - Parser object to be translated | 357 | * op - Parser object to be translated |
358 | * element_count - Number of elements in the package - this is | 358 | * element_count - Number of elements in the package - this is |
359 | * the num_elements argument to Package() | 359 | * the num_elements argument to Package() |
360 | * obj_desc_ptr - Where the ACPI internal object is returned | 360 | * obj_desc_ptr - Where the ACPI internal object is returned |
@@ -547,8 +547,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, | |||
547 | * FUNCTION: acpi_ds_create_node | 547 | * FUNCTION: acpi_ds_create_node |
548 | * | 548 | * |
549 | * PARAMETERS: walk_state - Current walk state | 549 | * PARAMETERS: walk_state - Current walk state |
550 | * Node - NS Node to be initialized | 550 | * node - NS Node to be initialized |
551 | * Op - Parser object to be translated | 551 | * op - Parser object to be translated |
552 | * | 552 | * |
553 | * RETURN: Status | 553 | * RETURN: Status |
554 | * | 554 | * |
@@ -611,8 +611,8 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state, | |||
611 | * FUNCTION: acpi_ds_init_object_from_op | 611 | * FUNCTION: acpi_ds_init_object_from_op |
612 | * | 612 | * |
613 | * PARAMETERS: walk_state - Current walk state | 613 | * PARAMETERS: walk_state - Current walk state |
614 | * Op - Parser op used to init the internal object | 614 | * op - Parser op used to init the internal object |
615 | * Opcode - AML opcode associated with the object | 615 | * opcode - AML opcode associated with the object |
616 | * ret_obj_desc - Namespace object to be initialized | 616 | * ret_obj_desc - Namespace object to be initialized |
617 | * | 617 | * |
618 | * RETURN: Status | 618 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c index e5eff7585102..aa34d8984d34 100644 --- a/drivers/acpi/acpica/dsopcode.c +++ b/drivers/acpi/acpica/dsopcode.c | |||
@@ -286,7 +286,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode, | |||
286 | * FUNCTION: acpi_ds_eval_buffer_field_operands | 286 | * FUNCTION: acpi_ds_eval_buffer_field_operands |
287 | * | 287 | * |
288 | * PARAMETERS: walk_state - Current walk | 288 | * PARAMETERS: walk_state - Current walk |
289 | * Op - A valid buffer_field Op object | 289 | * op - A valid buffer_field Op object |
290 | * | 290 | * |
291 | * RETURN: Status | 291 | * RETURN: Status |
292 | * | 292 | * |
@@ -370,7 +370,7 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state, | |||
370 | * FUNCTION: acpi_ds_eval_region_operands | 370 | * FUNCTION: acpi_ds_eval_region_operands |
371 | * | 371 | * |
372 | * PARAMETERS: walk_state - Current walk | 372 | * PARAMETERS: walk_state - Current walk |
373 | * Op - A valid region Op object | 373 | * op - A valid region Op object |
374 | * | 374 | * |
375 | * RETURN: Status | 375 | * RETURN: Status |
376 | * | 376 | * |
@@ -397,7 +397,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, | |||
397 | */ | 397 | */ |
398 | node = op->common.node; | 398 | node = op->common.node; |
399 | 399 | ||
400 | /* next_op points to the op that holds the space_iD */ | 400 | /* next_op points to the op that holds the space_ID */ |
401 | 401 | ||
402 | next_op = op->common.value.arg; | 402 | next_op = op->common.value.arg; |
403 | 403 | ||
@@ -461,7 +461,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, | |||
461 | * FUNCTION: acpi_ds_eval_table_region_operands | 461 | * FUNCTION: acpi_ds_eval_table_region_operands |
462 | * | 462 | * |
463 | * PARAMETERS: walk_state - Current walk | 463 | * PARAMETERS: walk_state - Current walk |
464 | * Op - A valid region Op object | 464 | * op - A valid region Op object |
465 | * | 465 | * |
466 | * RETURN: Status | 466 | * RETURN: Status |
467 | * | 467 | * |
@@ -560,7 +560,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state, | |||
560 | * FUNCTION: acpi_ds_eval_data_object_operands | 560 | * FUNCTION: acpi_ds_eval_data_object_operands |
561 | * | 561 | * |
562 | * PARAMETERS: walk_state - Current walk | 562 | * PARAMETERS: walk_state - Current walk |
563 | * Op - A valid data_object Op object | 563 | * op - A valid data_object Op object |
564 | * obj_desc - data_object | 564 | * obj_desc - data_object |
565 | * | 565 | * |
566 | * RETURN: Status | 566 | * RETURN: Status |
@@ -662,7 +662,7 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, | |||
662 | * FUNCTION: acpi_ds_eval_bank_field_operands | 662 | * FUNCTION: acpi_ds_eval_bank_field_operands |
663 | * | 663 | * |
664 | * PARAMETERS: walk_state - Current walk | 664 | * PARAMETERS: walk_state - Current walk |
665 | * Op - A valid bank_field Op object | 665 | * op - A valid bank_field Op object |
666 | * | 666 | * |
667 | * RETURN: Status | 667 | * RETURN: Status |
668 | * | 668 | * |
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c index 1abcda31037f..73a5447475f5 100644 --- a/drivers/acpi/acpica/dsutils.c +++ b/drivers/acpi/acpica/dsutils.c | |||
@@ -157,7 +157,7 @@ acpi_ds_do_implicit_return(union acpi_operand_object *return_desc, | |||
157 | * | 157 | * |
158 | * FUNCTION: acpi_ds_is_result_used | 158 | * FUNCTION: acpi_ds_is_result_used |
159 | * | 159 | * |
160 | * PARAMETERS: Op - Current Op | 160 | * PARAMETERS: op - Current Op |
161 | * walk_state - Current State | 161 | * walk_state - Current State |
162 | * | 162 | * |
163 | * RETURN: TRUE if result is used, FALSE otherwise | 163 | * RETURN: TRUE if result is used, FALSE otherwise |
@@ -323,7 +323,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op, | |||
323 | * | 323 | * |
324 | * FUNCTION: acpi_ds_delete_result_if_not_used | 324 | * FUNCTION: acpi_ds_delete_result_if_not_used |
325 | * | 325 | * |
326 | * PARAMETERS: Op - Current parse Op | 326 | * PARAMETERS: op - Current parse Op |
327 | * result_obj - Result of the operation | 327 | * result_obj - Result of the operation |
328 | * walk_state - Current state | 328 | * walk_state - Current state |
329 | * | 329 | * |
@@ -445,7 +445,7 @@ void acpi_ds_clear_operands(struct acpi_walk_state *walk_state) | |||
445 | * FUNCTION: acpi_ds_create_operand | 445 | * FUNCTION: acpi_ds_create_operand |
446 | * | 446 | * |
447 | * PARAMETERS: walk_state - Current walk state | 447 | * PARAMETERS: walk_state - Current walk state |
448 | * Arg - Parse object for the argument | 448 | * arg - Parse object for the argument |
449 | * arg_index - Which argument (zero based) | 449 | * arg_index - Which argument (zero based) |
450 | * | 450 | * |
451 | * RETURN: Status | 451 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dswscope.c b/drivers/acpi/acpica/dswscope.c index 9e9490a9cbf0..f6c4295470ae 100644 --- a/drivers/acpi/acpica/dswscope.c +++ b/drivers/acpi/acpica/dswscope.c | |||
@@ -85,8 +85,8 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state) | |||
85 | * | 85 | * |
86 | * FUNCTION: acpi_ds_scope_stack_push | 86 | * FUNCTION: acpi_ds_scope_stack_push |
87 | * | 87 | * |
88 | * PARAMETERS: Node - Name to be made current | 88 | * PARAMETERS: node - Name to be made current |
89 | * Type - Type of frame being pushed | 89 | * type - Type of frame being pushed |
90 | * walk_state - Current state | 90 | * walk_state - Current state |
91 | * | 91 | * |
92 | * RETURN: Status | 92 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c index c9c2ac13e7cc..d0e6555061e4 100644 --- a/drivers/acpi/acpica/dswstate.c +++ b/drivers/acpi/acpica/dswstate.c | |||
@@ -58,7 +58,7 @@ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *ws); | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_ds_result_pop | 59 | * FUNCTION: acpi_ds_result_pop |
60 | * | 60 | * |
61 | * PARAMETERS: Object - Where to return the popped object | 61 | * PARAMETERS: object - Where to return the popped object |
62 | * walk_state - Current Walk state | 62 | * walk_state - Current Walk state |
63 | * | 63 | * |
64 | * RETURN: Status | 64 | * RETURN: Status |
@@ -132,7 +132,7 @@ acpi_ds_result_pop(union acpi_operand_object **object, | |||
132 | * | 132 | * |
133 | * FUNCTION: acpi_ds_result_push | 133 | * FUNCTION: acpi_ds_result_push |
134 | * | 134 | * |
135 | * PARAMETERS: Object - Where to return the popped object | 135 | * PARAMETERS: object - Where to return the popped object |
136 | * walk_state - Current Walk state | 136 | * walk_state - Current Walk state |
137 | * | 137 | * |
138 | * RETURN: Status | 138 | * RETURN: Status |
@@ -296,7 +296,7 @@ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state) | |||
296 | * | 296 | * |
297 | * FUNCTION: acpi_ds_obj_stack_push | 297 | * FUNCTION: acpi_ds_obj_stack_push |
298 | * | 298 | * |
299 | * PARAMETERS: Object - Object to push | 299 | * PARAMETERS: object - Object to push |
300 | * walk_state - Current Walk state | 300 | * walk_state - Current Walk state |
301 | * | 301 | * |
302 | * RETURN: Status | 302 | * RETURN: Status |
@@ -433,7 +433,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count, | |||
433 | * | 433 | * |
434 | * FUNCTION: acpi_ds_get_current_walk_state | 434 | * FUNCTION: acpi_ds_get_current_walk_state |
435 | * | 435 | * |
436 | * PARAMETERS: Thread - Get current active state for this Thread | 436 | * PARAMETERS: thread - Get current active state for this Thread |
437 | * | 437 | * |
438 | * RETURN: Pointer to the current walk state | 438 | * RETURN: Pointer to the current walk state |
439 | * | 439 | * |
@@ -462,7 +462,7 @@ struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state | |||
462 | * FUNCTION: acpi_ds_push_walk_state | 462 | * FUNCTION: acpi_ds_push_walk_state |
463 | * | 463 | * |
464 | * PARAMETERS: walk_state - State to push | 464 | * PARAMETERS: walk_state - State to push |
465 | * Thread - Thread state object | 465 | * thread - Thread state object |
466 | * | 466 | * |
467 | * RETURN: None | 467 | * RETURN: None |
468 | * | 468 | * |
@@ -486,7 +486,7 @@ acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, | |||
486 | * | 486 | * |
487 | * FUNCTION: acpi_ds_pop_walk_state | 487 | * FUNCTION: acpi_ds_pop_walk_state |
488 | * | 488 | * |
489 | * PARAMETERS: Thread - Current thread state | 489 | * PARAMETERS: thread - Current thread state |
490 | * | 490 | * |
491 | * RETURN: A walk_state object popped from the thread's stack | 491 | * RETURN: A walk_state object popped from the thread's stack |
492 | * | 492 | * |
@@ -525,9 +525,9 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread) | |||
525 | * FUNCTION: acpi_ds_create_walk_state | 525 | * FUNCTION: acpi_ds_create_walk_state |
526 | * | 526 | * |
527 | * PARAMETERS: owner_id - ID for object creation | 527 | * PARAMETERS: owner_id - ID for object creation |
528 | * Origin - Starting point for this walk | 528 | * origin - Starting point for this walk |
529 | * method_desc - Method object | 529 | * method_desc - Method object |
530 | * Thread - Current thread state | 530 | * thread - Current thread state |
531 | * | 531 | * |
532 | * RETURN: Pointer to the new walk state. | 532 | * RETURN: Pointer to the new walk state. |
533 | * | 533 | * |
@@ -578,11 +578,11 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union | |||
578 | * FUNCTION: acpi_ds_init_aml_walk | 578 | * FUNCTION: acpi_ds_init_aml_walk |
579 | * | 579 | * |
580 | * PARAMETERS: walk_state - New state to be initialized | 580 | * PARAMETERS: walk_state - New state to be initialized |
581 | * Op - Current parse op | 581 | * op - Current parse op |
582 | * method_node - Control method NS node, if any | 582 | * method_node - Control method NS node, if any |
583 | * aml_start - Start of AML | 583 | * aml_start - Start of AML |
584 | * aml_length - Length of AML | 584 | * aml_length - Length of AML |
585 | * Info - Method info block (params, etc.) | 585 | * info - Method info block (params, etc.) |
586 | * pass_number - 1, 2, or 3 | 586 | * pass_number - 1, 2, or 3 |
587 | * | 587 | * |
588 | * RETURN: Status | 588 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c index 07e4dc44f81c..d4acfbbe5b29 100644 --- a/drivers/acpi/acpica/evevent.c +++ b/drivers/acpi/acpica/evevent.c | |||
@@ -251,7 +251,7 @@ u32 acpi_ev_fixed_event_detect(void) | |||
251 | * | 251 | * |
252 | * FUNCTION: acpi_ev_fixed_event_dispatch | 252 | * FUNCTION: acpi_ev_fixed_event_dispatch |
253 | * | 253 | * |
254 | * PARAMETERS: Event - Event type | 254 | * PARAMETERS: event - Event type |
255 | * | 255 | * |
256 | * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED | 256 | * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED |
257 | * | 257 | * |
diff --git a/drivers/acpi/acpica/evglock.c b/drivers/acpi/acpica/evglock.c index cfeab38795d8..af14a7137632 100644 --- a/drivers/acpi/acpica/evglock.c +++ b/drivers/acpi/acpica/evglock.c | |||
@@ -135,7 +135,7 @@ acpi_status acpi_ev_remove_global_lock_handler(void) | |||
135 | * | 135 | * |
136 | * FUNCTION: acpi_ev_global_lock_handler | 136 | * FUNCTION: acpi_ev_global_lock_handler |
137 | * | 137 | * |
138 | * PARAMETERS: Context - From thread interface, not used | 138 | * PARAMETERS: context - From thread interface, not used |
139 | * | 139 | * |
140 | * RETURN: ACPI_INTERRUPT_HANDLED | 140 | * RETURN: ACPI_INTERRUPT_HANDLED |
141 | * | 141 | * |
@@ -182,7 +182,7 @@ static u32 acpi_ev_global_lock_handler(void *context) | |||
182 | * | 182 | * |
183 | * FUNCTION: acpi_ev_acquire_global_lock | 183 | * FUNCTION: acpi_ev_acquire_global_lock |
184 | * | 184 | * |
185 | * PARAMETERS: Timeout - Max time to wait for the lock, in millisec. | 185 | * PARAMETERS: timeout - Max time to wait for the lock, in millisec. |
186 | * | 186 | * |
187 | * RETURN: Status | 187 | * RETURN: Status |
188 | * | 188 | * |
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index 8ba0e5f17091..afbd5cb391f6 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c | |||
@@ -466,7 +466,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) | |||
466 | acpi_status status; | 466 | acpi_status status; |
467 | struct acpi_gpe_event_info *local_gpe_event_info; | 467 | struct acpi_gpe_event_info *local_gpe_event_info; |
468 | struct acpi_evaluate_info *info; | 468 | struct acpi_evaluate_info *info; |
469 | struct acpi_gpe_notify_object *notify_object; | 469 | struct acpi_gpe_notify_info *notify; |
470 | 470 | ||
471 | ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); | 471 | ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); |
472 | 472 | ||
@@ -517,17 +517,17 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) | |||
517 | * completes. The notify handlers are NOT invoked synchronously | 517 | * completes. The notify handlers are NOT invoked synchronously |
518 | * from this thread -- because handlers may in turn run other | 518 | * from this thread -- because handlers may in turn run other |
519 | * control methods. | 519 | * control methods. |
520 | * | ||
521 | * June 2012: Expand implicit notify mechanism to support | ||
522 | * notifies on multiple device objects. | ||
520 | */ | 523 | */ |
521 | status = acpi_ev_queue_notify_request( | 524 | notify = local_gpe_event_info->dispatch.notify_list; |
522 | local_gpe_event_info->dispatch.device.node, | 525 | while (ACPI_SUCCESS(status) && notify) { |
523 | ACPI_NOTIFY_DEVICE_WAKE); | 526 | status = |
524 | 527 | acpi_ev_queue_notify_request(notify->device_node, | |
525 | notify_object = local_gpe_event_info->dispatch.device.next; | 528 | ACPI_NOTIFY_DEVICE_WAKE); |
526 | while (ACPI_SUCCESS(status) && notify_object) { | 529 | |
527 | status = acpi_ev_queue_notify_request( | 530 | notify = notify->next; |
528 | notify_object->node, | ||
529 | ACPI_NOTIFY_DEVICE_WAKE); | ||
530 | notify_object = notify_object->next; | ||
531 | } | 531 | } |
532 | 532 | ||
533 | break; | 533 | break; |
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index 23a3ca86b2eb..8cf4c104c7b7 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c | |||
@@ -318,7 +318,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) | |||
318 | * FUNCTION: acpi_ev_create_gpe_block | 318 | * FUNCTION: acpi_ev_create_gpe_block |
319 | * | 319 | * |
320 | * PARAMETERS: gpe_device - Handle to the parent GPE block | 320 | * PARAMETERS: gpe_device - Handle to the parent GPE block |
321 | * gpe_block_address - Address and space_iD | 321 | * gpe_block_address - Address and space_ID |
322 | * register_count - Number of GPE register pairs in the block | 322 | * register_count - Number of GPE register pairs in the block |
323 | * gpe_block_base_number - Starting GPE number for the block | 323 | * gpe_block_base_number - Starting GPE number for the block |
324 | * interrupt_number - H/W interrupt for the block | 324 | * interrupt_number - H/W interrupt for the block |
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c index 3c43796b8361..cb50dd91bc18 100644 --- a/drivers/acpi/acpica/evgpeutil.c +++ b/drivers/acpi/acpica/evgpeutil.c | |||
@@ -54,7 +54,7 @@ ACPI_MODULE_NAME("evgpeutil") | |||
54 | * FUNCTION: acpi_ev_walk_gpe_list | 54 | * FUNCTION: acpi_ev_walk_gpe_list |
55 | * | 55 | * |
56 | * PARAMETERS: gpe_walk_callback - Routine called for each GPE block | 56 | * PARAMETERS: gpe_walk_callback - Routine called for each GPE block |
57 | * Context - Value passed to callback | 57 | * context - Value passed to callback |
58 | * | 58 | * |
59 | * RETURN: Status | 59 | * RETURN: Status |
60 | * | 60 | * |
@@ -347,6 +347,8 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
347 | void *context) | 347 | void *context) |
348 | { | 348 | { |
349 | struct acpi_gpe_event_info *gpe_event_info; | 349 | struct acpi_gpe_event_info *gpe_event_info; |
350 | struct acpi_gpe_notify_info *notify; | ||
351 | struct acpi_gpe_notify_info *next; | ||
350 | u32 i; | 352 | u32 i; |
351 | u32 j; | 353 | u32 j; |
352 | 354 | ||
@@ -365,10 +367,28 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
365 | 367 | ||
366 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == | 368 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
367 | ACPI_GPE_DISPATCH_HANDLER) { | 369 | ACPI_GPE_DISPATCH_HANDLER) { |
370 | |||
371 | /* Delete an installed handler block */ | ||
372 | |||
368 | ACPI_FREE(gpe_event_info->dispatch.handler); | 373 | ACPI_FREE(gpe_event_info->dispatch.handler); |
369 | gpe_event_info->dispatch.handler = NULL; | 374 | gpe_event_info->dispatch.handler = NULL; |
370 | gpe_event_info->flags &= | 375 | gpe_event_info->flags &= |
371 | ~ACPI_GPE_DISPATCH_MASK; | 376 | ~ACPI_GPE_DISPATCH_MASK; |
377 | } else if ((gpe_event_info-> | ||
378 | flags & ACPI_GPE_DISPATCH_MASK) == | ||
379 | ACPI_GPE_DISPATCH_NOTIFY) { | ||
380 | |||
381 | /* Delete the implicit notification device list */ | ||
382 | |||
383 | notify = gpe_event_info->dispatch.notify_list; | ||
384 | while (notify) { | ||
385 | next = notify->next; | ||
386 | ACPI_FREE(notify); | ||
387 | notify = next; | ||
388 | } | ||
389 | gpe_event_info->dispatch.notify_list = NULL; | ||
390 | gpe_event_info->flags &= | ||
391 | ~ACPI_GPE_DISPATCH_MASK; | ||
372 | } | 392 | } |
373 | } | 393 | } |
374 | } | 394 | } |
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c index 51ef9f5e002d..51f537937c1f 100644 --- a/drivers/acpi/acpica/evmisc.c +++ b/drivers/acpi/acpica/evmisc.c | |||
@@ -56,7 +56,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context); | |||
56 | * | 56 | * |
57 | * FUNCTION: acpi_ev_is_notify_object | 57 | * FUNCTION: acpi_ev_is_notify_object |
58 | * | 58 | * |
59 | * PARAMETERS: Node - Node to check | 59 | * PARAMETERS: node - Node to check |
60 | * | 60 | * |
61 | * RETURN: TRUE if notifies allowed on this object | 61 | * RETURN: TRUE if notifies allowed on this object |
62 | * | 62 | * |
@@ -86,7 +86,7 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node) | |||
86 | * | 86 | * |
87 | * FUNCTION: acpi_ev_queue_notify_request | 87 | * FUNCTION: acpi_ev_queue_notify_request |
88 | * | 88 | * |
89 | * PARAMETERS: Node - NS node for the notified object | 89 | * PARAMETERS: node - NS node for the notified object |
90 | * notify_value - Value from the Notify() request | 90 | * notify_value - Value from the Notify() request |
91 | * | 91 | * |
92 | * RETURN: Status | 92 | * RETURN: Status |
@@ -101,102 +101,77 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
101 | u32 notify_value) | 101 | u32 notify_value) |
102 | { | 102 | { |
103 | union acpi_operand_object *obj_desc; | 103 | union acpi_operand_object *obj_desc; |
104 | union acpi_operand_object *handler_obj = NULL; | 104 | union acpi_operand_object *handler_list_head = NULL; |
105 | union acpi_generic_state *notify_info; | 105 | union acpi_generic_state *info; |
106 | u8 handler_list_id = 0; | ||
106 | acpi_status status = AE_OK; | 107 | acpi_status status = AE_OK; |
107 | 108 | ||
108 | ACPI_FUNCTION_NAME(ev_queue_notify_request); | 109 | ACPI_FUNCTION_NAME(ev_queue_notify_request); |
109 | 110 | ||
110 | /* | 111 | /* Are Notifies allowed on this object? */ |
111 | * For value 0x03 (Ejection Request), may need to run a device method. | ||
112 | * For value 0x02 (Device Wake), if _PRW exists, may need to run | ||
113 | * the _PS0 method. | ||
114 | * For value 0x80 (Status Change) on the power button or sleep button, | ||
115 | * initiate soft-off or sleep operation. | ||
116 | * | ||
117 | * For all cases, simply dispatch the notify to the handler. | ||
118 | */ | ||
119 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
120 | "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", | ||
121 | acpi_ut_get_node_name(node), | ||
122 | acpi_ut_get_type_name(node->type), notify_value, | ||
123 | acpi_ut_get_notify_name(notify_value), node)); | ||
124 | 112 | ||
125 | /* Get the notify object attached to the NS Node */ | 113 | if (!acpi_ev_is_notify_object(node)) { |
126 | 114 | return (AE_TYPE); | |
127 | obj_desc = acpi_ns_get_attached_object(node); | 115 | } |
128 | if (obj_desc) { | ||
129 | |||
130 | /* We have the notify object, Get the correct handler */ | ||
131 | |||
132 | switch (node->type) { | ||
133 | 116 | ||
134 | /* Notify is allowed only on these types */ | 117 | /* Get the correct notify list type (System or Device) */ |
135 | 118 | ||
136 | case ACPI_TYPE_DEVICE: | 119 | if (notify_value <= ACPI_MAX_SYS_NOTIFY) { |
137 | case ACPI_TYPE_THERMAL: | 120 | handler_list_id = ACPI_SYSTEM_HANDLER_LIST; |
138 | case ACPI_TYPE_PROCESSOR: | 121 | } else { |
122 | handler_list_id = ACPI_DEVICE_HANDLER_LIST; | ||
123 | } | ||
139 | 124 | ||
140 | if (notify_value <= ACPI_MAX_SYS_NOTIFY) { | 125 | /* Get the notify object attached to the namespace Node */ |
141 | handler_obj = | ||
142 | obj_desc->common_notify.system_notify; | ||
143 | } else { | ||
144 | handler_obj = | ||
145 | obj_desc->common_notify.device_notify; | ||
146 | } | ||
147 | break; | ||
148 | 126 | ||
149 | default: | 127 | obj_desc = acpi_ns_get_attached_object(node); |
128 | if (obj_desc) { | ||
150 | 129 | ||
151 | /* All other types are not supported */ | 130 | /* We have an attached object, Get the correct handler list */ |
152 | 131 | ||
153 | return (AE_TYPE); | 132 | handler_list_head = |
154 | } | 133 | obj_desc->common_notify.notify_list[handler_list_id]; |
155 | } | 134 | } |
156 | 135 | ||
157 | /* | 136 | /* |
158 | * If there is a handler to run, schedule the dispatcher. | 137 | * If there is no notify handler (Global or Local) |
159 | * Check for: | 138 | * for this object, just ignore the notify |
160 | * 1) Global system notify handler | ||
161 | * 2) Global device notify handler | ||
162 | * 3) Per-device notify handler | ||
163 | */ | 139 | */ |
164 | if ((acpi_gbl_system_notify.handler && | 140 | if (!acpi_gbl_global_notify[handler_list_id].handler |
165 | (notify_value <= ACPI_MAX_SYS_NOTIFY)) || | 141 | && !handler_list_head) { |
166 | (acpi_gbl_device_notify.handler && | 142 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
167 | (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) { | 143 | "No notify handler for Notify, ignoring (%4.4s, %X) node %p\n", |
168 | notify_info = acpi_ut_create_generic_state(); | 144 | acpi_ut_get_node_name(node), notify_value, |
169 | if (!notify_info) { | 145 | node)); |
170 | return (AE_NO_MEMORY); | ||
171 | } | ||
172 | 146 | ||
173 | if (!handler_obj) { | 147 | return (AE_OK); |
174 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 148 | } |
175 | "Executing system notify handler for Notify (%4.4s, %X) " | ||
176 | "node %p\n", | ||
177 | acpi_ut_get_node_name(node), | ||
178 | notify_value, node)); | ||
179 | } | ||
180 | 149 | ||
181 | notify_info->common.descriptor_type = | 150 | /* Setup notify info and schedule the notify dispatcher */ |
182 | ACPI_DESC_TYPE_STATE_NOTIFY; | ||
183 | notify_info->notify.node = node; | ||
184 | notify_info->notify.value = (u16) notify_value; | ||
185 | notify_info->notify.handler_obj = handler_obj; | ||
186 | 151 | ||
187 | status = | 152 | info = acpi_ut_create_generic_state(); |
188 | acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, | 153 | if (!info) { |
189 | notify_info); | 154 | return (AE_NO_MEMORY); |
190 | if (ACPI_FAILURE(status)) { | 155 | } |
191 | acpi_ut_delete_generic_state(notify_info); | ||
192 | } | ||
193 | } else { | ||
194 | /* There is no notify handler (per-device or system) for this device */ | ||
195 | 156 | ||
196 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 157 | info->common.descriptor_type = ACPI_DESC_TYPE_STATE_NOTIFY; |
197 | "No notify handler for Notify (%4.4s, %X) node %p\n", | 158 | |
198 | acpi_ut_get_node_name(node), notify_value, | 159 | info->notify.node = node; |
199 | node)); | 160 | info->notify.value = (u16)notify_value; |
161 | info->notify.handler_list_id = handler_list_id; | ||
162 | info->notify.handler_list_head = handler_list_head; | ||
163 | info->notify.global = &acpi_gbl_global_notify[handler_list_id]; | ||
164 | |||
165 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
166 | "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", | ||
167 | acpi_ut_get_node_name(node), | ||
168 | acpi_ut_get_type_name(node->type), notify_value, | ||
169 | acpi_ut_get_notify_name(notify_value), node)); | ||
170 | |||
171 | status = acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, | ||
172 | info); | ||
173 | if (ACPI_FAILURE(status)) { | ||
174 | acpi_ut_delete_generic_state(info); | ||
200 | } | 175 | } |
201 | 176 | ||
202 | return (status); | 177 | return (status); |
@@ -206,7 +181,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
206 | * | 181 | * |
207 | * FUNCTION: acpi_ev_notify_dispatch | 182 | * FUNCTION: acpi_ev_notify_dispatch |
208 | * | 183 | * |
209 | * PARAMETERS: Context - To be passed to the notify handler | 184 | * PARAMETERS: context - To be passed to the notify handler |
210 | * | 185 | * |
211 | * RETURN: None. | 186 | * RETURN: None. |
212 | * | 187 | * |
@@ -217,60 +192,34 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
217 | 192 | ||
218 | static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) | 193 | static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) |
219 | { | 194 | { |
220 | union acpi_generic_state *notify_info = | 195 | union acpi_generic_state *info = (union acpi_generic_state *)context; |
221 | (union acpi_generic_state *)context; | ||
222 | acpi_notify_handler global_handler = NULL; | ||
223 | void *global_context = NULL; | ||
224 | union acpi_operand_object *handler_obj; | 196 | union acpi_operand_object *handler_obj; |
225 | 197 | ||
226 | ACPI_FUNCTION_ENTRY(); | 198 | ACPI_FUNCTION_ENTRY(); |
227 | 199 | ||
228 | /* | 200 | /* Invoke a global notify handler if installed */ |
229 | * We will invoke a global notify handler if installed. This is done | ||
230 | * _before_ we invoke the per-device handler attached to the device. | ||
231 | */ | ||
232 | if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { | ||
233 | |||
234 | /* Global system notification handler */ | ||
235 | |||
236 | if (acpi_gbl_system_notify.handler) { | ||
237 | global_handler = acpi_gbl_system_notify.handler; | ||
238 | global_context = acpi_gbl_system_notify.context; | ||
239 | } | ||
240 | } else { | ||
241 | /* Global driver notification handler */ | ||
242 | |||
243 | if (acpi_gbl_device_notify.handler) { | ||
244 | global_handler = acpi_gbl_device_notify.handler; | ||
245 | global_context = acpi_gbl_device_notify.context; | ||
246 | } | ||
247 | } | ||
248 | |||
249 | /* Invoke the system handler first, if present */ | ||
250 | 201 | ||
251 | if (global_handler) { | 202 | if (info->notify.global->handler) { |
252 | global_handler(notify_info->notify.node, | 203 | info->notify.global->handler(info->notify.node, |
253 | notify_info->notify.value, global_context); | 204 | info->notify.value, |
205 | info->notify.global->context); | ||
254 | } | 206 | } |
255 | 207 | ||
256 | /* Now invoke the per-device handler, if present */ | 208 | /* Now invoke the local notify handler(s) if any are installed */ |
257 | 209 | ||
258 | handler_obj = notify_info->notify.handler_obj; | 210 | handler_obj = info->notify.handler_list_head; |
259 | if (handler_obj) { | 211 | while (handler_obj) { |
260 | struct acpi_object_notify_handler *notifier; | 212 | handler_obj->notify.handler(info->notify.node, |
213 | info->notify.value, | ||
214 | handler_obj->notify.context); | ||
261 | 215 | ||
262 | notifier = &handler_obj->notify; | 216 | handler_obj = |
263 | while (notifier) { | 217 | handler_obj->notify.next[info->notify.handler_list_id]; |
264 | notifier->handler(notify_info->notify.node, | ||
265 | notify_info->notify.value, | ||
266 | notifier->context); | ||
267 | notifier = notifier->next; | ||
268 | } | ||
269 | } | 218 | } |
270 | 219 | ||
271 | /* All done with the info object */ | 220 | /* All done with the info object */ |
272 | 221 | ||
273 | acpi_ut_delete_generic_state(notify_info); | 222 | acpi_ut_delete_generic_state(info); |
274 | } | 223 | } |
275 | 224 | ||
276 | #if (!ACPI_REDUCED_HARDWARE) | 225 | #if (!ACPI_REDUCED_HARDWARE) |
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c index 1b0180a1b798..0cc6a16fedc7 100644 --- a/drivers/acpi/acpica/evregion.c +++ b/drivers/acpi/acpica/evregion.c | |||
@@ -150,7 +150,7 @@ acpi_status acpi_ev_install_region_handlers(void) | |||
150 | * | 150 | * |
151 | * FUNCTION: acpi_ev_has_default_handler | 151 | * FUNCTION: acpi_ev_has_default_handler |
152 | * | 152 | * |
153 | * PARAMETERS: Node - Namespace node for the device | 153 | * PARAMETERS: node - Namespace node for the device |
154 | * space_id - The address space ID | 154 | * space_id - The address space ID |
155 | * | 155 | * |
156 | * RETURN: TRUE if default handler is installed, FALSE otherwise | 156 | * RETURN: TRUE if default handler is installed, FALSE otherwise |
@@ -244,7 +244,7 @@ acpi_status acpi_ev_initialize_op_regions(void) | |||
244 | * FUNCTION: acpi_ev_execute_reg_method | 244 | * FUNCTION: acpi_ev_execute_reg_method |
245 | * | 245 | * |
246 | * PARAMETERS: region_obj - Region object | 246 | * PARAMETERS: region_obj - Region object |
247 | * Function - Passed to _REG: On (1) or Off (0) | 247 | * function - Passed to _REG: On (1) or Off (0) |
248 | * | 248 | * |
249 | * RETURN: Status | 249 | * RETURN: Status |
250 | * | 250 | * |
@@ -286,10 +286,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | |||
286 | /* | 286 | /* |
287 | * The _REG method has two arguments: | 287 | * The _REG method has two arguments: |
288 | * | 288 | * |
289 | * Arg0 - Integer: | 289 | * arg0 - Integer: |
290 | * Operation region space ID Same value as region_obj->Region.space_id | 290 | * Operation region space ID Same value as region_obj->Region.space_id |
291 | * | 291 | * |
292 | * Arg1 - Integer: | 292 | * arg1 - Integer: |
293 | * connection status 1 for connecting the handler, 0 for disconnecting | 293 | * connection status 1 for connecting the handler, 0 for disconnecting |
294 | * the handler (Passed as a parameter) | 294 | * the handler (Passed as a parameter) |
295 | */ | 295 | */ |
@@ -330,10 +330,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function) | |||
330 | * | 330 | * |
331 | * PARAMETERS: region_obj - Internal region object | 331 | * PARAMETERS: region_obj - Internal region object |
332 | * field_obj - Corresponding field. Can be NULL. | 332 | * field_obj - Corresponding field. Can be NULL. |
333 | * Function - Read or Write operation | 333 | * function - Read or Write operation |
334 | * region_offset - Where in the region to read or write | 334 | * region_offset - Where in the region to read or write |
335 | * bit_width - Field width in bits (8, 16, 32, or 64) | 335 | * bit_width - Field width in bits (8, 16, 32, or 64) |
336 | * Value - Pointer to in or out value, must be | 336 | * value - Pointer to in or out value, must be |
337 | * a full 64-bit integer | 337 | * a full 64-bit integer |
338 | * | 338 | * |
339 | * RETURN: Status | 339 | * RETURN: Status |
@@ -840,11 +840,11 @@ acpi_ev_install_handler(acpi_handle obj_handle, | |||
840 | * | 840 | * |
841 | * FUNCTION: acpi_ev_install_space_handler | 841 | * FUNCTION: acpi_ev_install_space_handler |
842 | * | 842 | * |
843 | * PARAMETERS: Node - Namespace node for the device | 843 | * PARAMETERS: node - Namespace node for the device |
844 | * space_id - The address space ID | 844 | * space_id - The address space ID |
845 | * Handler - Address of the handler | 845 | * handler - Address of the handler |
846 | * Setup - Address of the setup function | 846 | * setup - Address of the setup function |
847 | * Context - Value passed to the handler on each access | 847 | * context - Value passed to the handler on each access |
848 | * | 848 | * |
849 | * RETURN: Status | 849 | * RETURN: Status |
850 | * | 850 | * |
@@ -1061,7 +1061,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, | |||
1061 | * | 1061 | * |
1062 | * FUNCTION: acpi_ev_execute_reg_methods | 1062 | * FUNCTION: acpi_ev_execute_reg_methods |
1063 | * | 1063 | * |
1064 | * PARAMETERS: Node - Namespace node for the device | 1064 | * PARAMETERS: node - Namespace node for the device |
1065 | * space_id - The address space ID | 1065 | * space_id - The address space ID |
1066 | * | 1066 | * |
1067 | * RETURN: Status | 1067 | * RETURN: Status |
@@ -1104,7 +1104,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, | |||
1104 | * | 1104 | * |
1105 | * PARAMETERS: walk_namespace callback | 1105 | * PARAMETERS: walk_namespace callback |
1106 | * | 1106 | * |
1107 | * DESCRIPTION: Run _REG method for region objects of the requested space_iD | 1107 | * DESCRIPTION: Run _REG method for region objects of the requested spaceID |
1108 | * | 1108 | * |
1109 | ******************************************************************************/ | 1109 | ******************************************************************************/ |
1110 | 1110 | ||
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c index 819c17f5897a..4c1c8261166f 100644 --- a/drivers/acpi/acpica/evrgnini.c +++ b/drivers/acpi/acpica/evrgnini.c | |||
@@ -56,8 +56,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node); | |||
56 | * | 56 | * |
57 | * FUNCTION: acpi_ev_system_memory_region_setup | 57 | * FUNCTION: acpi_ev_system_memory_region_setup |
58 | * | 58 | * |
59 | * PARAMETERS: Handle - Region we are interested in | 59 | * PARAMETERS: handle - Region we are interested in |
60 | * Function - Start or stop | 60 | * function - Start or stop |
61 | * handler_context - Address space handler context | 61 | * handler_context - Address space handler context |
62 | * region_context - Region specific context | 62 | * region_context - Region specific context |
63 | * | 63 | * |
@@ -118,8 +118,8 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, | |||
118 | * | 118 | * |
119 | * FUNCTION: acpi_ev_io_space_region_setup | 119 | * FUNCTION: acpi_ev_io_space_region_setup |
120 | * | 120 | * |
121 | * PARAMETERS: Handle - Region we are interested in | 121 | * PARAMETERS: handle - Region we are interested in |
122 | * Function - Start or stop | 122 | * function - Start or stop |
123 | * handler_context - Address space handler context | 123 | * handler_context - Address space handler context |
124 | * region_context - Region specific context | 124 | * region_context - Region specific context |
125 | * | 125 | * |
@@ -149,8 +149,8 @@ acpi_ev_io_space_region_setup(acpi_handle handle, | |||
149 | * | 149 | * |
150 | * FUNCTION: acpi_ev_pci_config_region_setup | 150 | * FUNCTION: acpi_ev_pci_config_region_setup |
151 | * | 151 | * |
152 | * PARAMETERS: Handle - Region we are interested in | 152 | * PARAMETERS: handle - Region we are interested in |
153 | * Function - Start or stop | 153 | * function - Start or stop |
154 | * handler_context - Address space handler context | 154 | * handler_context - Address space handler context |
155 | * region_context - Region specific context | 155 | * region_context - Region specific context |
156 | * | 156 | * |
@@ -338,7 +338,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, | |||
338 | * | 338 | * |
339 | * FUNCTION: acpi_ev_is_pci_root_bridge | 339 | * FUNCTION: acpi_ev_is_pci_root_bridge |
340 | * | 340 | * |
341 | * PARAMETERS: Node - Device node being examined | 341 | * PARAMETERS: node - Device node being examined |
342 | * | 342 | * |
343 | * RETURN: TRUE if device is a PCI/PCI-Express Root Bridge | 343 | * RETURN: TRUE if device is a PCI/PCI-Express Root Bridge |
344 | * | 344 | * |
@@ -393,14 +393,14 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) | |||
393 | * | 393 | * |
394 | * FUNCTION: acpi_ev_pci_bar_region_setup | 394 | * FUNCTION: acpi_ev_pci_bar_region_setup |
395 | * | 395 | * |
396 | * PARAMETERS: Handle - Region we are interested in | 396 | * PARAMETERS: handle - Region we are interested in |
397 | * Function - Start or stop | 397 | * function - Start or stop |
398 | * handler_context - Address space handler context | 398 | * handler_context - Address space handler context |
399 | * region_context - Region specific context | 399 | * region_context - Region specific context |
400 | * | 400 | * |
401 | * RETURN: Status | 401 | * RETURN: Status |
402 | * | 402 | * |
403 | * DESCRIPTION: Setup a pci_bAR operation region | 403 | * DESCRIPTION: Setup a pci_BAR operation region |
404 | * | 404 | * |
405 | * MUTEX: Assumes namespace is not locked | 405 | * MUTEX: Assumes namespace is not locked |
406 | * | 406 | * |
@@ -420,8 +420,8 @@ acpi_ev_pci_bar_region_setup(acpi_handle handle, | |||
420 | * | 420 | * |
421 | * FUNCTION: acpi_ev_cmos_region_setup | 421 | * FUNCTION: acpi_ev_cmos_region_setup |
422 | * | 422 | * |
423 | * PARAMETERS: Handle - Region we are interested in | 423 | * PARAMETERS: handle - Region we are interested in |
424 | * Function - Start or stop | 424 | * function - Start or stop |
425 | * handler_context - Address space handler context | 425 | * handler_context - Address space handler context |
426 | * region_context - Region specific context | 426 | * region_context - Region specific context |
427 | * | 427 | * |
@@ -447,8 +447,8 @@ acpi_ev_cmos_region_setup(acpi_handle handle, | |||
447 | * | 447 | * |
448 | * FUNCTION: acpi_ev_default_region_setup | 448 | * FUNCTION: acpi_ev_default_region_setup |
449 | * | 449 | * |
450 | * PARAMETERS: Handle - Region we are interested in | 450 | * PARAMETERS: handle - Region we are interested in |
451 | * Function - Start or stop | 451 | * function - Start or stop |
452 | * handler_context - Address space handler context | 452 | * handler_context - Address space handler context |
453 | * region_context - Region specific context | 453 | * region_context - Region specific context |
454 | * | 454 | * |
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c index 6a57aa2d70d1..f9661e2b46a9 100644 --- a/drivers/acpi/acpica/evsci.c +++ b/drivers/acpi/acpica/evsci.c | |||
@@ -56,7 +56,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context); | |||
56 | * | 56 | * |
57 | * FUNCTION: acpi_ev_sci_xrupt_handler | 57 | * FUNCTION: acpi_ev_sci_xrupt_handler |
58 | * | 58 | * |
59 | * PARAMETERS: Context - Calling Context | 59 | * PARAMETERS: context - Calling Context |
60 | * | 60 | * |
61 | * RETURN: Status code indicates whether interrupt was handled. | 61 | * RETURN: Status code indicates whether interrupt was handled. |
62 | * | 62 | * |
@@ -96,7 +96,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context) | |||
96 | * | 96 | * |
97 | * FUNCTION: acpi_ev_gpe_xrupt_handler | 97 | * FUNCTION: acpi_ev_gpe_xrupt_handler |
98 | * | 98 | * |
99 | * PARAMETERS: Context - Calling Context | 99 | * PARAMETERS: context - Calling Context |
100 | * | 100 | * |
101 | * RETURN: Status code indicates whether interrupt was handled. | 101 | * RETURN: Status code indicates whether interrupt was handled. |
102 | * | 102 | * |
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c index 44bef5744ebb..7587eb6c9584 100644 --- a/drivers/acpi/acpica/evxface.c +++ b/drivers/acpi/acpica/evxface.c | |||
@@ -54,86 +54,25 @@ ACPI_MODULE_NAME("evxface") | |||
54 | 54 | ||
55 | /******************************************************************************* | 55 | /******************************************************************************* |
56 | * | 56 | * |
57 | * FUNCTION: acpi_populate_handler_object | ||
58 | * | ||
59 | * PARAMETERS: handler_obj - Handler object to populate | ||
60 | * handler_type - The type of handler: | ||
61 | * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) | ||
62 | * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) | ||
63 | * ACPI_ALL_NOTIFY: both system and device | ||
64 | * handler - Address of the handler | ||
65 | * context - Value passed to the handler on each GPE | ||
66 | * next - Address of a handler object to link to | ||
67 | * | ||
68 | * RETURN: None | ||
69 | * | ||
70 | * DESCRIPTION: Populate a handler object. | ||
71 | * | ||
72 | ******************************************************************************/ | ||
73 | static void | ||
74 | acpi_populate_handler_object(struct acpi_object_notify_handler *handler_obj, | ||
75 | u32 handler_type, | ||
76 | acpi_notify_handler handler, void *context, | ||
77 | struct acpi_object_notify_handler *next) | ||
78 | { | ||
79 | handler_obj->handler_type = handler_type; | ||
80 | handler_obj->handler = handler; | ||
81 | handler_obj->context = context; | ||
82 | handler_obj->next = next; | ||
83 | } | ||
84 | |||
85 | /******************************************************************************* | ||
86 | * | ||
87 | * FUNCTION: acpi_add_handler_object | ||
88 | * | ||
89 | * PARAMETERS: parent_obj - Parent of the new object | ||
90 | * handler - Address of the handler | ||
91 | * context - Value passed to the handler on each GPE | ||
92 | * | ||
93 | * RETURN: Status | ||
94 | * | ||
95 | * DESCRIPTION: Create a new handler object and populate it. | ||
96 | * | ||
97 | ******************************************************************************/ | ||
98 | static acpi_status | ||
99 | acpi_add_handler_object(struct acpi_object_notify_handler *parent_obj, | ||
100 | acpi_notify_handler handler, void *context) | ||
101 | { | ||
102 | struct acpi_object_notify_handler *handler_obj; | ||
103 | |||
104 | /* The parent must not be a defice notify handler object. */ | ||
105 | if (parent_obj->handler_type & ACPI_DEVICE_NOTIFY) | ||
106 | return AE_BAD_PARAMETER; | ||
107 | |||
108 | handler_obj = ACPI_ALLOCATE_ZEROED(sizeof(*handler_obj)); | ||
109 | if (!handler_obj) | ||
110 | return AE_NO_MEMORY; | ||
111 | |||
112 | acpi_populate_handler_object(handler_obj, | ||
113 | ACPI_SYSTEM_NOTIFY, | ||
114 | handler, context, | ||
115 | parent_obj->next); | ||
116 | parent_obj->next = handler_obj; | ||
117 | |||
118 | return AE_OK; | ||
119 | } | ||
120 | |||
121 | |||
122 | /******************************************************************************* | ||
123 | * | ||
124 | * FUNCTION: acpi_install_notify_handler | 57 | * FUNCTION: acpi_install_notify_handler |
125 | * | 58 | * |
126 | * PARAMETERS: Device - The device for which notifies will be handled | 59 | * PARAMETERS: Device - The device for which notifies will be handled |
127 | * handler_type - The type of handler: | 60 | * handler_type - The type of handler: |
128 | * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) | 61 | * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) |
129 | * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) | 62 | * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) |
130 | * ACPI_ALL_NOTIFY: both system and device | 63 | * ACPI_ALL_NOTIFY: Both System and Device |
131 | * Handler - Address of the handler | 64 | * Handler - Address of the handler |
132 | * Context - Value passed to the handler on each GPE | 65 | * Context - Value passed to the handler on each GPE |
133 | * | 66 | * |
134 | * RETURN: Status | 67 | * RETURN: Status |
135 | * | 68 | * |
136 | * DESCRIPTION: Install a handler for notifies on an ACPI device | 69 | * DESCRIPTION: Install a handler for notifications on an ACPI Device, |
70 | * thermal_zone, or Processor object. | ||
71 | * | ||
72 | * NOTES: The Root namespace object may have only one handler for each | ||
73 | * type of notify (System/Device). Device/Thermal/Processor objects | ||
74 | * may have one device notify handler, and multiple system notify | ||
75 | * handlers. | ||
137 | * | 76 | * |
138 | ******************************************************************************/ | 77 | ******************************************************************************/ |
139 | acpi_status | 78 | acpi_status |
@@ -141,17 +80,19 @@ acpi_install_notify_handler(acpi_handle device, | |||
141 | u32 handler_type, | 80 | u32 handler_type, |
142 | acpi_notify_handler handler, void *context) | 81 | acpi_notify_handler handler, void *context) |
143 | { | 82 | { |
83 | struct acpi_namespace_node *node = | ||
84 | ACPI_CAST_PTR(struct acpi_namespace_node, device); | ||
144 | union acpi_operand_object *obj_desc; | 85 | union acpi_operand_object *obj_desc; |
145 | union acpi_operand_object *notify_obj; | 86 | union acpi_operand_object *handler_obj; |
146 | struct acpi_namespace_node *node; | ||
147 | acpi_status status; | 87 | acpi_status status; |
88 | u32 i; | ||
148 | 89 | ||
149 | ACPI_FUNCTION_TRACE(acpi_install_notify_handler); | 90 | ACPI_FUNCTION_TRACE(acpi_install_notify_handler); |
150 | 91 | ||
151 | /* Parameter validation */ | 92 | /* Parameter validation */ |
152 | 93 | ||
153 | if ((!device) || | 94 | if ((!device) || (!handler) || (!handler_type) || |
154 | (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { | 95 | (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { |
155 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 96 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
156 | } | 97 | } |
157 | 98 | ||
@@ -160,144 +101,112 @@ acpi_install_notify_handler(acpi_handle device, | |||
160 | return_ACPI_STATUS(status); | 101 | return_ACPI_STATUS(status); |
161 | } | 102 | } |
162 | 103 | ||
163 | /* Convert and validate the device handle */ | ||
164 | |||
165 | node = acpi_ns_validate_handle(device); | ||
166 | if (!node) { | ||
167 | status = AE_BAD_PARAMETER; | ||
168 | goto unlock_and_exit; | ||
169 | } | ||
170 | |||
171 | /* | 104 | /* |
172 | * Root Object: | 105 | * Root Object: |
173 | * Registering a notify handler on the root object indicates that the | 106 | * Registering a notify handler on the root object indicates that the |
174 | * caller wishes to receive notifications for all objects. Note that | 107 | * caller wishes to receive notifications for all objects. Note that |
175 | * only one <external> global handler can be regsitered (per notify type). | 108 | * only one global handler can be registered per notify type. |
109 | * Ensure that a handler is not already installed. | ||
176 | */ | 110 | */ |
177 | if (device == ACPI_ROOT_OBJECT) { | 111 | if (device == ACPI_ROOT_OBJECT) { |
112 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { | ||
113 | if (handler_type & (i + 1)) { | ||
114 | if (acpi_gbl_global_notify[i].handler) { | ||
115 | status = AE_ALREADY_EXISTS; | ||
116 | goto unlock_and_exit; | ||
117 | } | ||
178 | 118 | ||
179 | /* Make sure the handler is not already installed */ | 119 | acpi_gbl_global_notify[i].handler = handler; |
180 | 120 | acpi_gbl_global_notify[i].context = context; | |
181 | if (((handler_type & ACPI_SYSTEM_NOTIFY) && | 121 | } |
182 | acpi_gbl_system_notify.handler) || | ||
183 | ((handler_type & ACPI_DEVICE_NOTIFY) && | ||
184 | acpi_gbl_device_notify.handler)) { | ||
185 | status = AE_ALREADY_EXISTS; | ||
186 | goto unlock_and_exit; | ||
187 | } | ||
188 | |||
189 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | ||
190 | acpi_gbl_system_notify.node = node; | ||
191 | acpi_gbl_system_notify.handler = handler; | ||
192 | acpi_gbl_system_notify.context = context; | ||
193 | } | ||
194 | |||
195 | if (handler_type & ACPI_DEVICE_NOTIFY) { | ||
196 | acpi_gbl_device_notify.node = node; | ||
197 | acpi_gbl_device_notify.handler = handler; | ||
198 | acpi_gbl_device_notify.context = context; | ||
199 | } | 122 | } |
200 | 123 | ||
201 | /* Global notify handler installed */ | 124 | goto unlock_and_exit; /* Global notify handler installed, all done */ |
202 | } | 125 | } |
203 | 126 | ||
204 | /* | 127 | /* |
205 | * All Other Objects: | 128 | * All Other Objects: |
206 | * Caller will only receive notifications specific to the target object. | 129 | * Caller will only receive notifications specific to the target |
207 | * Note that only certain object types can receive notifications. | 130 | * object. Note that only certain object types are allowed to |
131 | * receive notifications. | ||
208 | */ | 132 | */ |
209 | else { | ||
210 | /* Notifies allowed on this object? */ | ||
211 | 133 | ||
212 | if (!acpi_ev_is_notify_object(node)) { | 134 | /* Are Notifies allowed on this object? */ |
213 | status = AE_TYPE; | ||
214 | goto unlock_and_exit; | ||
215 | } | ||
216 | 135 | ||
217 | /* Check for an existing internal object */ | 136 | if (!acpi_ev_is_notify_object(node)) { |
137 | status = AE_TYPE; | ||
138 | goto unlock_and_exit; | ||
139 | } | ||
218 | 140 | ||
219 | obj_desc = acpi_ns_get_attached_object(node); | 141 | /* Check for an existing internal object, might not exist */ |
220 | if (obj_desc) { | ||
221 | 142 | ||
222 | /* Object exists. */ | 143 | obj_desc = acpi_ns_get_attached_object(node); |
144 | if (!obj_desc) { | ||
223 | 145 | ||
224 | /* For a device notify, make sure there's no handler. */ | 146 | /* Create a new object */ |
225 | if ((handler_type & ACPI_DEVICE_NOTIFY) && | ||
226 | obj_desc->common_notify.device_notify) { | ||
227 | status = AE_ALREADY_EXISTS; | ||
228 | goto unlock_and_exit; | ||
229 | } | ||
230 | 147 | ||
231 | /* System notifies may have more handlers installed. */ | 148 | obj_desc = acpi_ut_create_internal_object(node->type); |
232 | notify_obj = obj_desc->common_notify.system_notify; | 149 | if (!obj_desc) { |
150 | status = AE_NO_MEMORY; | ||
151 | goto unlock_and_exit; | ||
152 | } | ||
233 | 153 | ||
234 | if ((handler_type & ACPI_SYSTEM_NOTIFY) && notify_obj) { | 154 | /* Attach new object to the Node, remove local reference */ |
235 | struct acpi_object_notify_handler *parent_obj; | 155 | |
156 | status = acpi_ns_attach_object(device, obj_desc, node->type); | ||
157 | acpi_ut_remove_reference(obj_desc); | ||
158 | if (ACPI_FAILURE(status)) { | ||
159 | goto unlock_and_exit; | ||
160 | } | ||
161 | } | ||
236 | 162 | ||
237 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 163 | /* Ensure that the handler is not already installed in the lists */ |
164 | |||
165 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { | ||
166 | if (handler_type & (i + 1)) { | ||
167 | handler_obj = obj_desc->common_notify.notify_list[i]; | ||
168 | while (handler_obj) { | ||
169 | if (handler_obj->notify.handler == handler) { | ||
238 | status = AE_ALREADY_EXISTS; | 170 | status = AE_ALREADY_EXISTS; |
239 | goto unlock_and_exit; | 171 | goto unlock_and_exit; |
240 | } | 172 | } |
241 | 173 | ||
242 | parent_obj = ¬ify_obj->notify; | 174 | handler_obj = handler_obj->notify.next[i]; |
243 | status = acpi_add_handler_object(parent_obj, | ||
244 | handler, | ||
245 | context); | ||
246 | goto unlock_and_exit; | ||
247 | } | ||
248 | } else { | ||
249 | /* Create a new object */ | ||
250 | |||
251 | obj_desc = acpi_ut_create_internal_object(node->type); | ||
252 | if (!obj_desc) { | ||
253 | status = AE_NO_MEMORY; | ||
254 | goto unlock_and_exit; | ||
255 | } | ||
256 | |||
257 | /* Attach new object to the Node */ | ||
258 | |||
259 | status = | ||
260 | acpi_ns_attach_object(device, obj_desc, node->type); | ||
261 | |||
262 | /* Remove local reference to the object */ | ||
263 | |||
264 | acpi_ut_remove_reference(obj_desc); | ||
265 | if (ACPI_FAILURE(status)) { | ||
266 | goto unlock_and_exit; | ||
267 | } | 175 | } |
268 | } | 176 | } |
177 | } | ||
269 | 178 | ||
270 | /* Install the handler */ | 179 | /* Create and populate a new notify handler object */ |
271 | 180 | ||
272 | notify_obj = | 181 | handler_obj = acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY); |
273 | acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_NOTIFY); | 182 | if (!handler_obj) { |
274 | if (!notify_obj) { | 183 | status = AE_NO_MEMORY; |
275 | status = AE_NO_MEMORY; | 184 | goto unlock_and_exit; |
276 | goto unlock_and_exit; | 185 | } |
277 | } | ||
278 | 186 | ||
279 | acpi_populate_handler_object(¬ify_obj->notify, | 187 | handler_obj->notify.node = node; |
280 | handler_type, | 188 | handler_obj->notify.handler_type = handler_type; |
281 | handler, context, | 189 | handler_obj->notify.handler = handler; |
282 | NULL); | 190 | handler_obj->notify.context = context; |
283 | 191 | ||
284 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | 192 | /* Install the handler at the list head(s) */ |
285 | obj_desc->common_notify.system_notify = notify_obj; | ||
286 | } | ||
287 | 193 | ||
288 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 194 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
289 | obj_desc->common_notify.device_notify = notify_obj; | 195 | if (handler_type & (i + 1)) { |
290 | } | 196 | handler_obj->notify.next[i] = |
197 | obj_desc->common_notify.notify_list[i]; | ||
291 | 198 | ||
292 | if (handler_type == ACPI_ALL_NOTIFY) { | 199 | obj_desc->common_notify.notify_list[i] = handler_obj; |
200 | } | ||
201 | } | ||
293 | 202 | ||
294 | /* Extra ref if installed in both */ | 203 | /* Add an extra reference if handler was installed in both lists */ |
295 | 204 | ||
296 | acpi_ut_add_reference(notify_obj); | 205 | if (handler_type == ACPI_ALL_NOTIFY) { |
297 | } | 206 | acpi_ut_add_reference(handler_obj); |
298 | } | 207 | } |
299 | 208 | ||
300 | unlock_and_exit: | 209 | unlock_and_exit: |
301 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | 210 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); |
302 | return_ACPI_STATUS(status); | 211 | return_ACPI_STATUS(status); |
303 | } | 212 | } |
@@ -308,11 +217,11 @@ ACPI_EXPORT_SYMBOL(acpi_install_notify_handler) | |||
308 | * | 217 | * |
309 | * FUNCTION: acpi_remove_notify_handler | 218 | * FUNCTION: acpi_remove_notify_handler |
310 | * | 219 | * |
311 | * PARAMETERS: Device - The device for which notifies will be handled | 220 | * PARAMETERS: Device - The device for which the handler is installed |
312 | * handler_type - The type of handler: | 221 | * handler_type - The type of handler: |
313 | * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) | 222 | * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) |
314 | * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) | 223 | * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) |
315 | * ACPI_ALL_NOTIFY: both system and device | 224 | * ACPI_ALL_NOTIFY: Both System and Device |
316 | * Handler - Address of the handler | 225 | * Handler - Address of the handler |
317 | * | 226 | * |
318 | * RETURN: Status | 227 | * RETURN: Status |
@@ -324,165 +233,106 @@ acpi_status | |||
324 | acpi_remove_notify_handler(acpi_handle device, | 233 | acpi_remove_notify_handler(acpi_handle device, |
325 | u32 handler_type, acpi_notify_handler handler) | 234 | u32 handler_type, acpi_notify_handler handler) |
326 | { | 235 | { |
327 | union acpi_operand_object *notify_obj; | 236 | struct acpi_namespace_node *node = |
237 | ACPI_CAST_PTR(struct acpi_namespace_node, device); | ||
328 | union acpi_operand_object *obj_desc; | 238 | union acpi_operand_object *obj_desc; |
329 | struct acpi_namespace_node *node; | 239 | union acpi_operand_object *handler_obj; |
240 | union acpi_operand_object *previous_handler_obj; | ||
330 | acpi_status status; | 241 | acpi_status status; |
242 | u32 i; | ||
331 | 243 | ||
332 | ACPI_FUNCTION_TRACE(acpi_remove_notify_handler); | 244 | ACPI_FUNCTION_TRACE(acpi_remove_notify_handler); |
333 | 245 | ||
334 | /* Parameter validation */ | 246 | /* Parameter validation */ |
335 | 247 | ||
336 | if ((!device) || | 248 | if ((!device) || (!handler) || (!handler_type) || |
337 | (!handler) || (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { | 249 | (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { |
338 | status = AE_BAD_PARAMETER; | 250 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
339 | goto exit; | ||
340 | } | 251 | } |
341 | |||
342 | |||
343 | /* Make sure all deferred tasks are completed */ | 252 | /* Make sure all deferred tasks are completed */ |
344 | acpi_os_wait_events_complete(NULL); | 253 | |
254 | acpi_os_wait_events_complete(); | ||
345 | 255 | ||
346 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | 256 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); |
347 | if (ACPI_FAILURE(status)) { | 257 | if (ACPI_FAILURE(status)) { |
348 | goto exit; | 258 | return_ACPI_STATUS(status); |
349 | } | ||
350 | |||
351 | /* Convert and validate the device handle */ | ||
352 | |||
353 | node = acpi_ns_validate_handle(device); | ||
354 | if (!node) { | ||
355 | status = AE_BAD_PARAMETER; | ||
356 | goto unlock_and_exit; | ||
357 | } | 259 | } |
358 | 260 | ||
359 | /* Root Object */ | 261 | /* Root Object. Global handlers are removed here */ |
360 | 262 | ||
361 | if (device == ACPI_ROOT_OBJECT) { | 263 | if (device == ACPI_ROOT_OBJECT) { |
362 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 264 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
363 | "Removing notify handler for namespace root object\n")); | 265 | if (handler_type & (i + 1)) { |
266 | if (!acpi_gbl_global_notify[i].handler || | ||
267 | (acpi_gbl_global_notify[i].handler != | ||
268 | handler)) { | ||
269 | status = AE_NOT_EXIST; | ||
270 | goto unlock_and_exit; | ||
271 | } | ||
364 | 272 | ||
365 | if (((handler_type & ACPI_SYSTEM_NOTIFY) && | 273 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
366 | !acpi_gbl_system_notify.handler) || | 274 | "Removing global notify handler\n")); |
367 | ((handler_type & ACPI_DEVICE_NOTIFY) && | ||
368 | !acpi_gbl_device_notify.handler)) { | ||
369 | status = AE_NOT_EXIST; | ||
370 | goto unlock_and_exit; | ||
371 | } | ||
372 | 275 | ||
373 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | 276 | acpi_gbl_global_notify[i].handler = NULL; |
374 | acpi_gbl_system_notify.node = NULL; | 277 | acpi_gbl_global_notify[i].context = NULL; |
375 | acpi_gbl_system_notify.handler = NULL; | 278 | } |
376 | acpi_gbl_system_notify.context = NULL; | ||
377 | } | 279 | } |
378 | 280 | ||
379 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 281 | goto unlock_and_exit; |
380 | acpi_gbl_device_notify.node = NULL; | ||
381 | acpi_gbl_device_notify.handler = NULL; | ||
382 | acpi_gbl_device_notify.context = NULL; | ||
383 | } | ||
384 | } | 282 | } |
385 | 283 | ||
386 | /* All Other Objects */ | 284 | /* All other objects: Are Notifies allowed on this object? */ |
387 | 285 | ||
388 | else { | 286 | if (!acpi_ev_is_notify_object(node)) { |
389 | /* Notifies allowed on this object? */ | 287 | status = AE_TYPE; |
288 | goto unlock_and_exit; | ||
289 | } | ||
390 | 290 | ||
391 | if (!acpi_ev_is_notify_object(node)) { | 291 | /* Must have an existing internal object */ |
392 | status = AE_TYPE; | ||
393 | goto unlock_and_exit; | ||
394 | } | ||
395 | 292 | ||
396 | /* Check for an existing internal object */ | 293 | obj_desc = acpi_ns_get_attached_object(node); |
294 | if (!obj_desc) { | ||
295 | status = AE_NOT_EXIST; | ||
296 | goto unlock_and_exit; | ||
297 | } | ||
397 | 298 | ||
398 | obj_desc = acpi_ns_get_attached_object(node); | 299 | /* Internal object exists. Find the handler and remove it */ |
399 | if (!obj_desc) { | ||
400 | status = AE_NOT_EXIST; | ||
401 | goto unlock_and_exit; | ||
402 | } | ||
403 | 300 | ||
404 | /* Object exists - make sure there's an existing handler */ | 301 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
302 | if (handler_type & (i + 1)) { | ||
303 | handler_obj = obj_desc->common_notify.notify_list[i]; | ||
304 | previous_handler_obj = NULL; | ||
405 | 305 | ||
406 | if (handler_type & ACPI_SYSTEM_NOTIFY) { | 306 | /* Attempt to find the handler in the handler list */ |
407 | struct acpi_object_notify_handler *handler_obj; | ||
408 | struct acpi_object_notify_handler *parent_obj; | ||
409 | 307 | ||
410 | notify_obj = obj_desc->common_notify.system_notify; | 308 | while (handler_obj && |
411 | if (!notify_obj) { | 309 | (handler_obj->notify.handler != handler)) { |
412 | status = AE_NOT_EXIST; | 310 | previous_handler_obj = handler_obj; |
413 | goto unlock_and_exit; | 311 | handler_obj = handler_obj->notify.next[i]; |
414 | } | ||
415 | |||
416 | handler_obj = ¬ify_obj->notify; | ||
417 | parent_obj = NULL; | ||
418 | while (handler_obj->handler != handler) { | ||
419 | if (handler_obj->next) { | ||
420 | parent_obj = handler_obj; | ||
421 | handler_obj = handler_obj->next; | ||
422 | } else { | ||
423 | break; | ||
424 | } | ||
425 | } | 312 | } |
426 | 313 | ||
427 | if (handler_obj->handler != handler) { | 314 | if (!handler_obj) { |
428 | status = AE_BAD_PARAMETER; | 315 | status = AE_NOT_EXIST; |
429 | goto unlock_and_exit; | 316 | goto unlock_and_exit; |
430 | } | 317 | } |
431 | 318 | ||
432 | /* | 319 | /* Remove the handler object from the list */ |
433 | * Remove the handler. There are three possible cases. | ||
434 | * First, we may need to remove a non-embedded object. | ||
435 | * Second, we may need to remove the embedded object's | ||
436 | * handler data, while non-embedded objects exist. | ||
437 | * Finally, we may need to remove the embedded object | ||
438 | * entirely along with its container. | ||
439 | */ | ||
440 | if (parent_obj) { | ||
441 | /* Non-embedded object is being removed. */ | ||
442 | parent_obj->next = handler_obj->next; | ||
443 | ACPI_FREE(handler_obj); | ||
444 | } else if (notify_obj->notify.next) { | ||
445 | /* | ||
446 | * The handler matches the embedded object, but | ||
447 | * there are more handler objects in the list. | ||
448 | * Replace the embedded object's data with the | ||
449 | * first next object's data and remove that | ||
450 | * object. | ||
451 | */ | ||
452 | parent_obj = ¬ify_obj->notify; | ||
453 | handler_obj = notify_obj->notify.next; | ||
454 | *parent_obj = *handler_obj; | ||
455 | ACPI_FREE(handler_obj); | ||
456 | } else { | ||
457 | /* No more handler objects in the list. */ | ||
458 | obj_desc->common_notify.system_notify = NULL; | ||
459 | acpi_ut_remove_reference(notify_obj); | ||
460 | } | ||
461 | } | ||
462 | 320 | ||
463 | if (handler_type & ACPI_DEVICE_NOTIFY) { | 321 | if (previous_handler_obj) { /* Handler is not at the list head */ |
464 | notify_obj = obj_desc->common_notify.device_notify; | 322 | previous_handler_obj->notify.next[i] = |
465 | if (!notify_obj) { | 323 | handler_obj->notify.next[i]; |
466 | status = AE_NOT_EXIST; | 324 | } else { /* Handler is at the list head */ |
467 | goto unlock_and_exit; | ||
468 | } | ||
469 | 325 | ||
470 | if (notify_obj->notify.handler != handler) { | 326 | obj_desc->common_notify.notify_list[i] = |
471 | status = AE_BAD_PARAMETER; | 327 | handler_obj->notify.next[i]; |
472 | goto unlock_and_exit; | ||
473 | } | 328 | } |
474 | 329 | ||
475 | /* Remove the handler */ | 330 | acpi_ut_remove_reference(handler_obj); |
476 | obj_desc->common_notify.device_notify = NULL; | ||
477 | acpi_ut_remove_reference(notify_obj); | ||
478 | } | 331 | } |
479 | } | 332 | } |
480 | 333 | ||
481 | unlock_and_exit: | 334 | unlock_and_exit: |
482 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | 335 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); |
483 | exit: | ||
484 | if (ACPI_FAILURE(status)) | ||
485 | ACPI_EXCEPTION((AE_INFO, status, "Removing notify handler")); | ||
486 | return_ACPI_STATUS(status); | 336 | return_ACPI_STATUS(status); |
487 | } | 337 | } |
488 | 338 | ||
@@ -492,7 +342,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler) | |||
492 | * | 342 | * |
493 | * FUNCTION: acpi_install_exception_handler | 343 | * FUNCTION: acpi_install_exception_handler |
494 | * | 344 | * |
495 | * PARAMETERS: Handler - Pointer to the handler function for the | 345 | * PARAMETERS: handler - Pointer to the handler function for the |
496 | * event | 346 | * event |
497 | * | 347 | * |
498 | * RETURN: Status | 348 | * RETURN: Status |
@@ -536,8 +386,8 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) | |||
536 | * | 386 | * |
537 | * FUNCTION: acpi_install_global_event_handler | 387 | * FUNCTION: acpi_install_global_event_handler |
538 | * | 388 | * |
539 | * PARAMETERS: Handler - Pointer to the global event handler function | 389 | * PARAMETERS: handler - Pointer to the global event handler function |
540 | * Context - Value passed to the handler on each event | 390 | * context - Value passed to the handler on each event |
541 | * | 391 | * |
542 | * RETURN: Status | 392 | * RETURN: Status |
543 | * | 393 | * |
@@ -586,10 +436,10 @@ ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler) | |||
586 | * | 436 | * |
587 | * FUNCTION: acpi_install_fixed_event_handler | 437 | * FUNCTION: acpi_install_fixed_event_handler |
588 | * | 438 | * |
589 | * PARAMETERS: Event - Event type to enable. | 439 | * PARAMETERS: event - Event type to enable. |
590 | * Handler - Pointer to the handler function for the | 440 | * handler - Pointer to the handler function for the |
591 | * event | 441 | * event |
592 | * Context - Value passed to the handler on each GPE | 442 | * context - Value passed to the handler on each GPE |
593 | * | 443 | * |
594 | * RETURN: Status | 444 | * RETURN: Status |
595 | * | 445 | * |
@@ -656,8 +506,8 @@ ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler) | |||
656 | * | 506 | * |
657 | * FUNCTION: acpi_remove_fixed_event_handler | 507 | * FUNCTION: acpi_remove_fixed_event_handler |
658 | * | 508 | * |
659 | * PARAMETERS: Event - Event type to disable. | 509 | * PARAMETERS: event - Event type to disable. |
660 | * Handler - Address of the handler | 510 | * handler - Address of the handler |
661 | * | 511 | * |
662 | * RETURN: Status | 512 | * RETURN: Status |
663 | * | 513 | * |
@@ -713,10 +563,10 @@ ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler) | |||
713 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT | 563 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT |
714 | * defined GPEs) | 564 | * defined GPEs) |
715 | * gpe_number - The GPE number within the GPE block | 565 | * gpe_number - The GPE number within the GPE block |
716 | * Type - Whether this GPE should be treated as an | 566 | * type - Whether this GPE should be treated as an |
717 | * edge- or level-triggered interrupt. | 567 | * edge- or level-triggered interrupt. |
718 | * Address - Address of the handler | 568 | * address - Address of the handler |
719 | * Context - Value passed to the handler on each GPE | 569 | * context - Value passed to the handler on each GPE |
720 | * | 570 | * |
721 | * RETURN: Status | 571 | * RETURN: Status |
722 | * | 572 | * |
@@ -823,7 +673,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler) | |||
823 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT | 673 | * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT |
824 | * defined GPEs) | 674 | * defined GPEs) |
825 | * gpe_number - The event to remove a handler | 675 | * gpe_number - The event to remove a handler |
826 | * Address - Address of the handler | 676 | * address - Address of the handler |
827 | * | 677 | * |
828 | * RETURN: Status | 678 | * RETURN: Status |
829 | * | 679 | * |
@@ -849,7 +699,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, | |||
849 | 699 | ||
850 | /* Make sure all deferred tasks are completed */ | 700 | /* Make sure all deferred tasks are completed */ |
851 | 701 | ||
852 | acpi_os_wait_events_complete(NULL); | 702 | acpi_os_wait_events_complete(); |
853 | 703 | ||
854 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); | 704 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); |
855 | if (ACPI_FAILURE(status)) { | 705 | if (ACPI_FAILURE(status)) { |
@@ -919,8 +769,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler) | |||
919 | * | 769 | * |
920 | * FUNCTION: acpi_acquire_global_lock | 770 | * FUNCTION: acpi_acquire_global_lock |
921 | * | 771 | * |
922 | * PARAMETERS: Timeout - How long the caller is willing to wait | 772 | * PARAMETERS: timeout - How long the caller is willing to wait |
923 | * Handle - Where the handle to the lock is returned | 773 | * handle - Where the handle to the lock is returned |
924 | * (if acquired) | 774 | * (if acquired) |
925 | * | 775 | * |
926 | * RETURN: Status | 776 | * RETURN: Status |
@@ -967,7 +817,7 @@ ACPI_EXPORT_SYMBOL(acpi_acquire_global_lock) | |||
967 | * | 817 | * |
968 | * FUNCTION: acpi_release_global_lock | 818 | * FUNCTION: acpi_release_global_lock |
969 | * | 819 | * |
970 | * PARAMETERS: Handle - Returned from acpi_acquire_global_lock | 820 | * PARAMETERS: handle - Returned from acpi_acquire_global_lock |
971 | * | 821 | * |
972 | * RETURN: Status | 822 | * RETURN: Status |
973 | * | 823 | * |
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c index 77cee5a5e891..35520c6eeefb 100644 --- a/drivers/acpi/acpica/evxfevnt.c +++ b/drivers/acpi/acpica/evxfevnt.c | |||
@@ -153,8 +153,8 @@ ACPI_EXPORT_SYMBOL(acpi_disable) | |||
153 | * | 153 | * |
154 | * FUNCTION: acpi_enable_event | 154 | * FUNCTION: acpi_enable_event |
155 | * | 155 | * |
156 | * PARAMETERS: Event - The fixed eventto be enabled | 156 | * PARAMETERS: event - The fixed eventto be enabled |
157 | * Flags - Reserved | 157 | * flags - Reserved |
158 | * | 158 | * |
159 | * RETURN: Status | 159 | * RETURN: Status |
160 | * | 160 | * |
@@ -265,7 +265,7 @@ ACPI_EXPORT_SYMBOL(acpi_disable_event) | |||
265 | * | 265 | * |
266 | * FUNCTION: acpi_clear_event | 266 | * FUNCTION: acpi_clear_event |
267 | * | 267 | * |
268 | * PARAMETERS: Event - The fixed event to be cleared | 268 | * PARAMETERS: event - The fixed event to be cleared |
269 | * | 269 | * |
270 | * RETURN: Status | 270 | * RETURN: Status |
271 | * | 271 | * |
@@ -301,7 +301,7 @@ ACPI_EXPORT_SYMBOL(acpi_clear_event) | |||
301 | * | 301 | * |
302 | * FUNCTION: acpi_get_event_status | 302 | * FUNCTION: acpi_get_event_status |
303 | * | 303 | * |
304 | * PARAMETERS: Event - The fixed event | 304 | * PARAMETERS: event - The fixed event |
305 | * event_status - Where the current status of the event will | 305 | * event_status - Where the current status of the event will |
306 | * be returned | 306 | * be returned |
307 | * | 307 | * |
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c index 86f9b343ebd4..6affbdb4b88c 100644 --- a/drivers/acpi/acpica/evxfgpe.c +++ b/drivers/acpi/acpica/evxfgpe.c | |||
@@ -197,12 +197,12 @@ acpi_status | |||
197 | acpi_setup_gpe_for_wake(acpi_handle wake_device, | 197 | acpi_setup_gpe_for_wake(acpi_handle wake_device, |
198 | acpi_handle gpe_device, u32 gpe_number) | 198 | acpi_handle gpe_device, u32 gpe_number) |
199 | { | 199 | { |
200 | acpi_status status = AE_BAD_PARAMETER; | 200 | acpi_status status; |
201 | struct acpi_gpe_event_info *gpe_event_info; | 201 | struct acpi_gpe_event_info *gpe_event_info; |
202 | struct acpi_namespace_node *device_node; | 202 | struct acpi_namespace_node *device_node; |
203 | struct acpi_gpe_notify_object *notify_object; | 203 | struct acpi_gpe_notify_info *notify; |
204 | struct acpi_gpe_notify_info *new_notify; | ||
204 | acpi_cpu_flags flags; | 205 | acpi_cpu_flags flags; |
205 | u8 gpe_dispatch_mask; | ||
206 | 206 | ||
207 | ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); | 207 | ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); |
208 | 208 | ||
@@ -216,63 +216,95 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device, | |||
216 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 216 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
217 | } | 217 | } |
218 | 218 | ||
219 | /* Handle root object case */ | ||
220 | |||
221 | if (wake_device == ACPI_ROOT_OBJECT) { | ||
222 | device_node = acpi_gbl_root_node; | ||
223 | } else { | ||
224 | device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); | ||
225 | } | ||
226 | |||
227 | /* Validate WakeDevice is of type Device */ | ||
228 | |||
229 | if (device_node->type != ACPI_TYPE_DEVICE) { | ||
230 | return_ACPI_STATUS (AE_BAD_PARAMETER); | ||
231 | } | ||
232 | |||
233 | /* | ||
234 | * Allocate a new notify object up front, in case it is needed. | ||
235 | * Memory allocation while holding a spinlock is a big no-no | ||
236 | * on some hosts. | ||
237 | */ | ||
238 | new_notify = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_notify_info)); | ||
239 | if (!new_notify) { | ||
240 | return_ACPI_STATUS(AE_NO_MEMORY); | ||
241 | } | ||
242 | |||
219 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | 243 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); |
220 | 244 | ||
221 | /* Ensure that we have a valid GPE number */ | 245 | /* Ensure that we have a valid GPE number */ |
222 | 246 | ||
223 | gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); | 247 | gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); |
224 | if (!gpe_event_info) { | 248 | if (!gpe_event_info) { |
249 | status = AE_BAD_PARAMETER; | ||
225 | goto unlock_and_exit; | 250 | goto unlock_and_exit; |
226 | } | 251 | } |
227 | 252 | ||
228 | if (wake_device == ACPI_ROOT_OBJECT) { | ||
229 | goto out; | ||
230 | } | ||
231 | |||
232 | /* | 253 | /* |
233 | * If there is no method or handler for this GPE, then the | 254 | * If there is no method or handler for this GPE, then the |
234 | * wake_device will be notified whenever this GPE fires (aka | 255 | * wake_device will be notified whenever this GPE fires. This is |
235 | * "implicit notify") Note: The GPE is assumed to be | 256 | * known as an "implicit notify". Note: The GPE is assumed to be |
236 | * level-triggered (for windows compatibility). | 257 | * level-triggered (for windows compatibility). |
237 | */ | 258 | */ |
238 | gpe_dispatch_mask = gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK; | 259 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
239 | if (gpe_dispatch_mask != ACPI_GPE_DISPATCH_NONE | 260 | ACPI_GPE_DISPATCH_NONE) { |
240 | && gpe_dispatch_mask != ACPI_GPE_DISPATCH_NOTIFY) { | 261 | /* |
241 | goto out; | 262 | * This is the first device for implicit notify on this GPE. |
242 | } | 263 | * Just set the flags here, and enter the NOTIFY block below. |
243 | 264 | */ | |
244 | /* Validate wake_device is of type Device */ | 265 | gpe_event_info->flags = |
245 | 266 | (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); | |
246 | device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); | ||
247 | if (device_node->type != ACPI_TYPE_DEVICE) { | ||
248 | goto unlock_and_exit; | ||
249 | } | 267 | } |
250 | 268 | ||
251 | if (gpe_dispatch_mask == ACPI_GPE_DISPATCH_NONE) { | 269 | /* |
252 | gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | | 270 | * If we already have an implicit notify on this GPE, add |
253 | ACPI_GPE_LEVEL_TRIGGERED); | 271 | * this device to the notify list. |
254 | gpe_event_info->dispatch.device.node = device_node; | 272 | */ |
255 | gpe_event_info->dispatch.device.next = NULL; | 273 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
256 | } else { | 274 | ACPI_GPE_DISPATCH_NOTIFY) { |
257 | /* There are multiple devices to notify implicitly. */ | 275 | |
258 | 276 | /* Ensure that the device is not already in the list */ | |
259 | notify_object = ACPI_ALLOCATE_ZEROED(sizeof(*notify_object)); | 277 | |
260 | if (!notify_object) { | 278 | notify = gpe_event_info->dispatch.notify_list; |
261 | status = AE_NO_MEMORY; | 279 | while (notify) { |
262 | goto unlock_and_exit; | 280 | if (notify->device_node == device_node) { |
281 | status = AE_ALREADY_EXISTS; | ||
282 | goto unlock_and_exit; | ||
283 | } | ||
284 | notify = notify->next; | ||
263 | } | 285 | } |
264 | 286 | ||
265 | notify_object->node = device_node; | 287 | /* Add this device to the notify list for this GPE */ |
266 | notify_object->next = gpe_event_info->dispatch.device.next; | 288 | |
267 | gpe_event_info->dispatch.device.next = notify_object; | 289 | new_notify->device_node = device_node; |
290 | new_notify->next = gpe_event_info->dispatch.notify_list; | ||
291 | gpe_event_info->dispatch.notify_list = new_notify; | ||
292 | new_notify = NULL; | ||
268 | } | 293 | } |
269 | 294 | ||
270 | out: | 295 | /* Mark the GPE as a possible wake event */ |
296 | |||
271 | gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; | 297 | gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; |
272 | status = AE_OK; | 298 | status = AE_OK; |
273 | 299 | ||
274 | unlock_and_exit: | 300 | unlock_and_exit: |
275 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | 301 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); |
302 | |||
303 | /* Delete the notify object if it was not used above */ | ||
304 | |||
305 | if (new_notify) { | ||
306 | ACPI_FREE(new_notify); | ||
307 | } | ||
276 | return_ACPI_STATUS(status); | 308 | return_ACPI_STATUS(status); |
277 | } | 309 | } |
278 | ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) | 310 | ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) |
@@ -283,7 +315,7 @@ ACPI_EXPORT_SYMBOL(acpi_setup_gpe_for_wake) | |||
283 | * | 315 | * |
284 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 | 316 | * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 |
285 | * gpe_number - GPE level within the GPE block | 317 | * gpe_number - GPE level within the GPE block |
286 | * Action - Enable or Disable | 318 | * action - Enable or Disable |
287 | * | 319 | * |
288 | * RETURN: Status | 320 | * RETURN: Status |
289 | * | 321 | * |
@@ -508,7 +540,7 @@ ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes) | |||
508 | * FUNCTION: acpi_install_gpe_block | 540 | * FUNCTION: acpi_install_gpe_block |
509 | * | 541 | * |
510 | * PARAMETERS: gpe_device - Handle to the parent GPE Block Device | 542 | * PARAMETERS: gpe_device - Handle to the parent GPE Block Device |
511 | * gpe_block_address - Address and space_iD | 543 | * gpe_block_address - Address and space_ID |
512 | * register_count - Number of GPE register pairs in the block | 544 | * register_count - Number of GPE register pairs in the block |
513 | * interrupt_number - H/W interrupt for the block | 545 | * interrupt_number - H/W interrupt for the block |
514 | * | 546 | * |
@@ -653,7 +685,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_block) | |||
653 | * | 685 | * |
654 | * FUNCTION: acpi_get_gpe_device | 686 | * FUNCTION: acpi_get_gpe_device |
655 | * | 687 | * |
656 | * PARAMETERS: Index - System GPE index (0-current_gpe_count) | 688 | * PARAMETERS: index - System GPE index (0-current_gpe_count) |
657 | * gpe_device - Where the parent GPE Device is returned | 689 | * gpe_device - Where the parent GPE Device is returned |
658 | * | 690 | * |
659 | * RETURN: Status | 691 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c index 6019208cd4b6..96b412d03950 100644 --- a/drivers/acpi/acpica/evxfregn.c +++ b/drivers/acpi/acpica/evxfregn.c | |||
@@ -55,11 +55,11 @@ ACPI_MODULE_NAME("evxfregn") | |||
55 | * | 55 | * |
56 | * FUNCTION: acpi_install_address_space_handler | 56 | * FUNCTION: acpi_install_address_space_handler |
57 | * | 57 | * |
58 | * PARAMETERS: Device - Handle for the device | 58 | * PARAMETERS: device - Handle for the device |
59 | * space_id - The address space ID | 59 | * space_id - The address space ID |
60 | * Handler - Address of the handler | 60 | * handler - Address of the handler |
61 | * Setup - Address of the setup function | 61 | * setup - Address of the setup function |
62 | * Context - Value passed to the handler on each access | 62 | * context - Value passed to the handler on each access |
63 | * | 63 | * |
64 | * RETURN: Status | 64 | * RETURN: Status |
65 | * | 65 | * |
@@ -112,16 +112,16 @@ acpi_install_address_space_handler(acpi_handle device, | |||
112 | } | 112 | } |
113 | 113 | ||
114 | /* | 114 | /* |
115 | * For the default space_iDs, (the IDs for which there are default region handlers | 115 | * For the default space_IDs, (the IDs for which there are default region handlers |
116 | * installed) Only execute the _REG methods if the global initialization _REG | 116 | * installed) Only execute the _REG methods if the global initialization _REG |
117 | * methods have already been run (via acpi_initialize_objects). In other words, | 117 | * methods have already been run (via acpi_initialize_objects). In other words, |
118 | * we will defer the execution of the _REG methods for these space_iDs until | 118 | * we will defer the execution of the _REG methods for these space_IDs until |
119 | * execution of acpi_initialize_objects. This is done because we need the handlers | 119 | * execution of acpi_initialize_objects. This is done because we need the handlers |
120 | * for the default spaces (mem/io/pci/table) to be installed before we can run | 120 | * for the default spaces (mem/io/pci/table) to be installed before we can run |
121 | * any control methods (or _REG methods). There is known BIOS code that depends | 121 | * any control methods (or _REG methods). There is known BIOS code that depends |
122 | * on this. | 122 | * on this. |
123 | * | 123 | * |
124 | * For all other space_iDs, we can safely execute the _REG methods immediately. | 124 | * For all other space_IDs, we can safely execute the _REG methods immediately. |
125 | * This means that for IDs like embedded_controller, this function should be called | 125 | * This means that for IDs like embedded_controller, this function should be called |
126 | * only after acpi_enable_subsystem has been called. | 126 | * only after acpi_enable_subsystem has been called. |
127 | */ | 127 | */ |
@@ -157,9 +157,9 @@ ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler) | |||
157 | * | 157 | * |
158 | * FUNCTION: acpi_remove_address_space_handler | 158 | * FUNCTION: acpi_remove_address_space_handler |
159 | * | 159 | * |
160 | * PARAMETERS: Device - Handle for the device | 160 | * PARAMETERS: device - Handle for the device |
161 | * space_id - The address space ID | 161 | * space_id - The address space ID |
162 | * Handler - Address of the handler | 162 | * handler - Address of the handler |
163 | * | 163 | * |
164 | * RETURN: Status | 164 | * RETURN: Status |
165 | * | 165 | * |
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index c86d44e41bc8..16219bde48da 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c | |||
@@ -66,7 +66,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, | |||
66 | * | 66 | * |
67 | * FUNCTION: acpi_ex_add_table | 67 | * FUNCTION: acpi_ex_add_table |
68 | * | 68 | * |
69 | * PARAMETERS: Table - Pointer to raw table | 69 | * PARAMETERS: table - Pointer to raw table |
70 | * parent_node - Where to load the table (scope) | 70 | * parent_node - Where to load the table (scope) |
71 | * ddb_handle - Where to return the table handle. | 71 | * ddb_handle - Where to return the table handle. |
72 | * | 72 | * |
@@ -276,8 +276,8 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, | |||
276 | * FUNCTION: acpi_ex_region_read | 276 | * FUNCTION: acpi_ex_region_read |
277 | * | 277 | * |
278 | * PARAMETERS: obj_desc - Region descriptor | 278 | * PARAMETERS: obj_desc - Region descriptor |
279 | * Length - Number of bytes to read | 279 | * length - Number of bytes to read |
280 | * Buffer - Pointer to where to put the data | 280 | * buffer - Pointer to where to put the data |
281 | * | 281 | * |
282 | * RETURN: Status | 282 | * RETURN: Status |
283 | * | 283 | * |
@@ -318,7 +318,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer) | |||
318 | * | 318 | * |
319 | * PARAMETERS: obj_desc - Region or Buffer/Field where the table will be | 319 | * PARAMETERS: obj_desc - Region or Buffer/Field where the table will be |
320 | * obtained | 320 | * obtained |
321 | * Target - Where a handle to the table will be stored | 321 | * target - Where a handle to the table will be stored |
322 | * walk_state - Current state | 322 | * walk_state - Current state |
323 | * | 323 | * |
324 | * RETURN: Status | 324 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c index e385436bd424..bfb062e4c4b4 100644 --- a/drivers/acpi/acpica/exconvrt.c +++ b/drivers/acpi/acpica/exconvrt.c | |||
@@ -60,7 +60,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length); | |||
60 | * PARAMETERS: obj_desc - Object to be converted. Must be an | 60 | * PARAMETERS: obj_desc - Object to be converted. Must be an |
61 | * Integer, Buffer, or String | 61 | * Integer, Buffer, or String |
62 | * result_desc - Where the new Integer object is returned | 62 | * result_desc - Where the new Integer object is returned |
63 | * Flags - Used for string conversion | 63 | * flags - Used for string conversion |
64 | * | 64 | * |
65 | * RETURN: Status | 65 | * RETURN: Status |
66 | * | 66 | * |
@@ -272,9 +272,9 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, | |||
272 | * | 272 | * |
273 | * FUNCTION: acpi_ex_convert_to_ascii | 273 | * FUNCTION: acpi_ex_convert_to_ascii |
274 | * | 274 | * |
275 | * PARAMETERS: Integer - Value to be converted | 275 | * PARAMETERS: integer - Value to be converted |
276 | * Base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX | 276 | * base - ACPI_STRING_DECIMAL or ACPI_STRING_HEX |
277 | * String - Where the string is returned | 277 | * string - Where the string is returned |
278 | * data_width - Size of data item to be converted, in bytes | 278 | * data_width - Size of data item to be converted, in bytes |
279 | * | 279 | * |
280 | * RETURN: Actual string length | 280 | * RETURN: Actual string length |
@@ -385,7 +385,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width) | |||
385 | * PARAMETERS: obj_desc - Object to be converted. Must be an | 385 | * PARAMETERS: obj_desc - Object to be converted. Must be an |
386 | * Integer, Buffer, or String | 386 | * Integer, Buffer, or String |
387 | * result_desc - Where the string object is returned | 387 | * result_desc - Where the string object is returned |
388 | * Type - String flags (base and conversion type) | 388 | * type - String flags (base and conversion type) |
389 | * | 389 | * |
390 | * RETURN: Status | 390 | * RETURN: Status |
391 | * | 391 | * |
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c index 3f5bc998c1cb..691d4763102c 100644 --- a/drivers/acpi/acpica/excreate.c +++ b/drivers/acpi/acpica/excreate.c | |||
@@ -369,7 +369,7 @@ acpi_ex_create_region(u8 * aml_start, | |||
369 | * | 369 | * |
370 | * DESCRIPTION: Create a new processor object and populate the fields | 370 | * DESCRIPTION: Create a new processor object and populate the fields |
371 | * | 371 | * |
372 | * Processor (Name[0], cpu_iD[1], pblock_addr[2], pblock_length[3]) | 372 | * Processor (Name[0], cpu_ID[1], pblock_addr[2], pblock_length[3]) |
373 | * | 373 | * |
374 | ******************************************************************************/ | 374 | ******************************************************************************/ |
375 | 375 | ||
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c index e211e9c19215..bc5b9a6a1316 100644 --- a/drivers/acpi/acpica/exdebug.c +++ b/drivers/acpi/acpica/exdebug.c | |||
@@ -54,8 +54,8 @@ ACPI_MODULE_NAME("exdebug") | |||
54 | * FUNCTION: acpi_ex_do_debug_object | 54 | * FUNCTION: acpi_ex_do_debug_object |
55 | * | 55 | * |
56 | * PARAMETERS: source_desc - Object to be output to "Debug Object" | 56 | * PARAMETERS: source_desc - Object to be output to "Debug Object" |
57 | * Level - Indentation level (used for packages) | 57 | * level - Indentation level (used for packages) |
58 | * Index - Current package element, zero if not pkg | 58 | * index - Current package element, zero if not pkg |
59 | * | 59 | * |
60 | * RETURN: None | 60 | * RETURN: None |
61 | * | 61 | * |
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c index 2a6ac0a3bc1e..213c081776fc 100644 --- a/drivers/acpi/acpica/exdump.c +++ b/drivers/acpi/acpica/exdump.c | |||
@@ -109,9 +109,9 @@ static struct acpi_exdump_info acpi_ex_dump_package[5] = { | |||
109 | static struct acpi_exdump_info acpi_ex_dump_device[4] = { | 109 | static struct acpi_exdump_info acpi_ex_dump_device[4] = { |
110 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL}, | 110 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_device), NULL}, |
111 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.handler), "Handler"}, | 111 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.handler), "Handler"}, |
112 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.system_notify), | 112 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[0]), |
113 | "System Notify"}, | 113 | "System Notify"}, |
114 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.device_notify), | 114 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(device.notify_list[1]), |
115 | "Device Notify"} | 115 | "Device Notify"} |
116 | }; | 116 | }; |
117 | 117 | ||
@@ -158,9 +158,9 @@ static struct acpi_exdump_info acpi_ex_dump_power[5] = { | |||
158 | "System Level"}, | 158 | "System Level"}, |
159 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order), | 159 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(power_resource.resource_order), |
160 | "Resource Order"}, | 160 | "Resource Order"}, |
161 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.system_notify), | 161 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[0]), |
162 | "System Notify"}, | 162 | "System Notify"}, |
163 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.device_notify), | 163 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(power_resource.notify_list[1]), |
164 | "Device Notify"} | 164 | "Device Notify"} |
165 | }; | 165 | }; |
166 | 166 | ||
@@ -169,18 +169,18 @@ static struct acpi_exdump_info acpi_ex_dump_processor[7] = { | |||
169 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"}, | 169 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.proc_id), "Processor ID"}, |
170 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"}, | 170 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(processor.length), "Length"}, |
171 | {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"}, | 171 | {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET(processor.address), "Address"}, |
172 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.system_notify), | 172 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[0]), |
173 | "System Notify"}, | 173 | "System Notify"}, |
174 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.device_notify), | 174 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.notify_list[1]), |
175 | "Device Notify"}, | 175 | "Device Notify"}, |
176 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"} | 176 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(processor.handler), "Handler"} |
177 | }; | 177 | }; |
178 | 178 | ||
179 | static struct acpi_exdump_info acpi_ex_dump_thermal[4] = { | 179 | static struct acpi_exdump_info acpi_ex_dump_thermal[4] = { |
180 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL}, | 180 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_thermal), NULL}, |
181 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.system_notify), | 181 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[0]), |
182 | "System Notify"}, | 182 | "System Notify"}, |
183 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.device_notify), | 183 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.notify_list[1]), |
184 | "Device Notify"}, | 184 | "Device Notify"}, |
185 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"} | 185 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(thermal_zone.handler), "Handler"} |
186 | }; | 186 | }; |
@@ -241,10 +241,15 @@ static struct acpi_exdump_info acpi_ex_dump_address_handler[6] = { | |||
241 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"} | 241 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(address_space.context), "Context"} |
242 | }; | 242 | }; |
243 | 243 | ||
244 | static struct acpi_exdump_info acpi_ex_dump_notify[3] = { | 244 | static struct acpi_exdump_info acpi_ex_dump_notify[7] = { |
245 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL}, | 245 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_notify), NULL}, |
246 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.node), "Node"}, | 246 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.node), "Node"}, |
247 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"} | 247 | {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(notify.handler_type), "Handler Type"}, |
248 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.handler), "Handler"}, | ||
249 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.context), "Context"}, | ||
250 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[0]), | ||
251 | "Next System Notify"}, | ||
252 | {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(notify.next[1]), "Next Device Notify"} | ||
248 | }; | 253 | }; |
249 | 254 | ||
250 | /* Miscellaneous tables */ | 255 | /* Miscellaneous tables */ |
@@ -318,7 +323,7 @@ static struct acpi_exdump_info *acpi_ex_dump_info[] = { | |||
318 | * FUNCTION: acpi_ex_dump_object | 323 | * FUNCTION: acpi_ex_dump_object |
319 | * | 324 | * |
320 | * PARAMETERS: obj_desc - Descriptor to dump | 325 | * PARAMETERS: obj_desc - Descriptor to dump |
321 | * Info - Info table corresponding to this object | 326 | * info - Info table corresponding to this object |
322 | * type | 327 | * type |
323 | * | 328 | * |
324 | * RETURN: None | 329 | * RETURN: None |
@@ -444,7 +449,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc, | |||
444 | * FUNCTION: acpi_ex_dump_operand | 449 | * FUNCTION: acpi_ex_dump_operand |
445 | * | 450 | * |
446 | * PARAMETERS: *obj_desc - Pointer to entry to be dumped | 451 | * PARAMETERS: *obj_desc - Pointer to entry to be dumped |
447 | * Depth - Current nesting depth | 452 | * depth - Current nesting depth |
448 | * | 453 | * |
449 | * RETURN: None | 454 | * RETURN: None |
450 | * | 455 | * |
@@ -726,7 +731,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
726 | * | 731 | * |
727 | * FUNCTION: acpi_ex_dump_operands | 732 | * FUNCTION: acpi_ex_dump_operands |
728 | * | 733 | * |
729 | * PARAMETERS: Operands - A list of Operand objects | 734 | * PARAMETERS: operands - A list of Operand objects |
730 | * opcode_name - AML opcode name | 735 | * opcode_name - AML opcode name |
731 | * num_operands - Operand count for this opcode | 736 | * num_operands - Operand count for this opcode |
732 | * | 737 | * |
@@ -769,8 +774,8 @@ acpi_ex_dump_operands(union acpi_operand_object **operands, | |||
769 | * | 774 | * |
770 | * FUNCTION: acpi_ex_out* functions | 775 | * FUNCTION: acpi_ex_out* functions |
771 | * | 776 | * |
772 | * PARAMETERS: Title - Descriptive text | 777 | * PARAMETERS: title - Descriptive text |
773 | * Value - Value to be displayed | 778 | * value - Value to be displayed |
774 | * | 779 | * |
775 | * DESCRIPTION: Object dump output formatting functions. These functions | 780 | * DESCRIPTION: Object dump output formatting functions. These functions |
776 | * reduce the number of format strings required and keeps them | 781 | * reduce the number of format strings required and keeps them |
@@ -792,8 +797,8 @@ static void acpi_ex_out_pointer(char *title, void *value) | |||
792 | * | 797 | * |
793 | * FUNCTION: acpi_ex_dump_namespace_node | 798 | * FUNCTION: acpi_ex_dump_namespace_node |
794 | * | 799 | * |
795 | * PARAMETERS: Node - Descriptor to dump | 800 | * PARAMETERS: node - Descriptor to dump |
796 | * Flags - Force display if TRUE | 801 | * flags - Force display if TRUE |
797 | * | 802 | * |
798 | * DESCRIPTION: Dumps the members of the given.Node | 803 | * DESCRIPTION: Dumps the members of the given.Node |
799 | * | 804 | * |
@@ -825,7 +830,7 @@ void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags) | |||
825 | * | 830 | * |
826 | * FUNCTION: acpi_ex_dump_reference_obj | 831 | * FUNCTION: acpi_ex_dump_reference_obj |
827 | * | 832 | * |
828 | * PARAMETERS: Object - Descriptor to dump | 833 | * PARAMETERS: object - Descriptor to dump |
829 | * | 834 | * |
830 | * DESCRIPTION: Dumps a reference object | 835 | * DESCRIPTION: Dumps a reference object |
831 | * | 836 | * |
@@ -882,8 +887,8 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc) | |||
882 | * FUNCTION: acpi_ex_dump_package_obj | 887 | * FUNCTION: acpi_ex_dump_package_obj |
883 | * | 888 | * |
884 | * PARAMETERS: obj_desc - Descriptor to dump | 889 | * PARAMETERS: obj_desc - Descriptor to dump |
885 | * Level - Indentation Level | 890 | * level - Indentation Level |
886 | * Index - Package index for this object | 891 | * index - Package index for this object |
887 | * | 892 | * |
888 | * DESCRIPTION: Dumps the elements of the package | 893 | * DESCRIPTION: Dumps the elements of the package |
889 | * | 894 | * |
@@ -926,9 +931,7 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, | |||
926 | case ACPI_TYPE_STRING: | 931 | case ACPI_TYPE_STRING: |
927 | 932 | ||
928 | acpi_os_printf("[String] Value: "); | 933 | acpi_os_printf("[String] Value: "); |
929 | for (i = 0; i < obj_desc->string.length; i++) { | 934 | acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX); |
930 | acpi_os_printf("%c", obj_desc->string.pointer[i]); | ||
931 | } | ||
932 | acpi_os_printf("\n"); | 935 | acpi_os_printf("\n"); |
933 | break; | 936 | break; |
934 | 937 | ||
@@ -977,7 +980,7 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, | |||
977 | * FUNCTION: acpi_ex_dump_object_descriptor | 980 | * FUNCTION: acpi_ex_dump_object_descriptor |
978 | * | 981 | * |
979 | * PARAMETERS: obj_desc - Descriptor to dump | 982 | * PARAMETERS: obj_desc - Descriptor to dump |
980 | * Flags - Force display if TRUE | 983 | * flags - Force display if TRUE |
981 | * | 984 | * |
982 | * DESCRIPTION: Dumps the members of the object descriptor given. | 985 | * DESCRIPTION: Dumps the members of the object descriptor given. |
983 | * | 986 | * |
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index 149de45fdadd..a7784152ed30 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c | |||
@@ -222,9 +222,9 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
222 | * PARAMETERS: obj_desc - Field to be read | 222 | * PARAMETERS: obj_desc - Field to be read |
223 | * field_datum_byte_offset - Byte offset of this datum within the | 223 | * field_datum_byte_offset - Byte offset of this datum within the |
224 | * parent field | 224 | * parent field |
225 | * Value - Where to store value (must at least | 225 | * value - Where to store value (must at least |
226 | * 64 bits) | 226 | * 64 bits) |
227 | * Function - Read or Write flag plus other region- | 227 | * function - Read or Write flag plus other region- |
228 | * dependent flags | 228 | * dependent flags |
229 | * | 229 | * |
230 | * RETURN: Status | 230 | * RETURN: Status |
@@ -315,7 +315,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, | |||
315 | * FUNCTION: acpi_ex_register_overflow | 315 | * FUNCTION: acpi_ex_register_overflow |
316 | * | 316 | * |
317 | * PARAMETERS: obj_desc - Register(Field) to be written | 317 | * PARAMETERS: obj_desc - Register(Field) to be written |
318 | * Value - Value to be stored | 318 | * value - Value to be stored |
319 | * | 319 | * |
320 | * RETURN: TRUE if value overflows the field, FALSE otherwise | 320 | * RETURN: TRUE if value overflows the field, FALSE otherwise |
321 | * | 321 | * |
@@ -365,7 +365,7 @@ acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value) | |||
365 | * PARAMETERS: obj_desc - Field to be read | 365 | * PARAMETERS: obj_desc - Field to be read |
366 | * field_datum_byte_offset - Byte offset of this datum within the | 366 | * field_datum_byte_offset - Byte offset of this datum within the |
367 | * parent field | 367 | * parent field |
368 | * Value - Where to store value (must be 64 bits) | 368 | * value - Where to store value (must be 64 bits) |
369 | * read_write - Read or Write flag | 369 | * read_write - Read or Write flag |
370 | * | 370 | * |
371 | * RETURN: Status | 371 | * RETURN: Status |
@@ -574,7 +574,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
574 | * FUNCTION: acpi_ex_write_with_update_rule | 574 | * FUNCTION: acpi_ex_write_with_update_rule |
575 | * | 575 | * |
576 | * PARAMETERS: obj_desc - Field to be written | 576 | * PARAMETERS: obj_desc - Field to be written |
577 | * Mask - bitmask within field datum | 577 | * mask - bitmask within field datum |
578 | * field_value - Value to write | 578 | * field_value - Value to write |
579 | * field_datum_byte_offset - Offset of datum within field | 579 | * field_datum_byte_offset - Offset of datum within field |
580 | * | 580 | * |
@@ -678,7 +678,7 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, | |||
678 | * FUNCTION: acpi_ex_extract_from_field | 678 | * FUNCTION: acpi_ex_extract_from_field |
679 | * | 679 | * |
680 | * PARAMETERS: obj_desc - Field to be read | 680 | * PARAMETERS: obj_desc - Field to be read |
681 | * Buffer - Where to store the field data | 681 | * buffer - Where to store the field data |
682 | * buffer_length - Length of Buffer | 682 | * buffer_length - Length of Buffer |
683 | * | 683 | * |
684 | * RETURN: Status | 684 | * RETURN: Status |
@@ -823,7 +823,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, | |||
823 | * FUNCTION: acpi_ex_insert_into_field | 823 | * FUNCTION: acpi_ex_insert_into_field |
824 | * | 824 | * |
825 | * PARAMETERS: obj_desc - Field to be written | 825 | * PARAMETERS: obj_desc - Field to be written |
826 | * Buffer - Data to be written | 826 | * buffer - Data to be written |
827 | * buffer_length - Length of Buffer | 827 | * buffer_length - Length of Buffer |
828 | * | 828 | * |
829 | * RETURN: Status | 829 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c index 0a0893310348..271c0c57ea10 100644 --- a/drivers/acpi/acpica/exmisc.c +++ b/drivers/acpi/acpica/exmisc.c | |||
@@ -144,8 +144,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, | |||
144 | * | 144 | * |
145 | * FUNCTION: acpi_ex_concat_template | 145 | * FUNCTION: acpi_ex_concat_template |
146 | * | 146 | * |
147 | * PARAMETERS: Operand0 - First source object | 147 | * PARAMETERS: operand0 - First source object |
148 | * Operand1 - Second source object | 148 | * operand1 - Second source object |
149 | * actual_return_desc - Where to place the return object | 149 | * actual_return_desc - Where to place the return object |
150 | * walk_state - Current walk state | 150 | * walk_state - Current walk state |
151 | * | 151 | * |
@@ -229,8 +229,8 @@ acpi_ex_concat_template(union acpi_operand_object *operand0, | |||
229 | * | 229 | * |
230 | * FUNCTION: acpi_ex_do_concatenate | 230 | * FUNCTION: acpi_ex_do_concatenate |
231 | * | 231 | * |
232 | * PARAMETERS: Operand0 - First source object | 232 | * PARAMETERS: operand0 - First source object |
233 | * Operand1 - Second source object | 233 | * operand1 - Second source object |
234 | * actual_return_desc - Where to place the return object | 234 | * actual_return_desc - Where to place the return object |
235 | * walk_state - Current walk state | 235 | * walk_state - Current walk state |
236 | * | 236 | * |
@@ -397,9 +397,9 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
397 | * | 397 | * |
398 | * FUNCTION: acpi_ex_do_math_op | 398 | * FUNCTION: acpi_ex_do_math_op |
399 | * | 399 | * |
400 | * PARAMETERS: Opcode - AML opcode | 400 | * PARAMETERS: opcode - AML opcode |
401 | * Integer0 - Integer operand #0 | 401 | * integer0 - Integer operand #0 |
402 | * Integer1 - Integer operand #1 | 402 | * integer1 - Integer operand #1 |
403 | * | 403 | * |
404 | * RETURN: Integer result of the operation | 404 | * RETURN: Integer result of the operation |
405 | * | 405 | * |
@@ -479,9 +479,9 @@ u64 acpi_ex_do_math_op(u16 opcode, u64 integer0, u64 integer1) | |||
479 | * | 479 | * |
480 | * FUNCTION: acpi_ex_do_logical_numeric_op | 480 | * FUNCTION: acpi_ex_do_logical_numeric_op |
481 | * | 481 | * |
482 | * PARAMETERS: Opcode - AML opcode | 482 | * PARAMETERS: opcode - AML opcode |
483 | * Integer0 - Integer operand #0 | 483 | * integer0 - Integer operand #0 |
484 | * Integer1 - Integer operand #1 | 484 | * integer1 - Integer operand #1 |
485 | * logical_result - TRUE/FALSE result of the operation | 485 | * logical_result - TRUE/FALSE result of the operation |
486 | * | 486 | * |
487 | * RETURN: Status | 487 | * RETURN: Status |
@@ -534,9 +534,9 @@ acpi_ex_do_logical_numeric_op(u16 opcode, | |||
534 | * | 534 | * |
535 | * FUNCTION: acpi_ex_do_logical_op | 535 | * FUNCTION: acpi_ex_do_logical_op |
536 | * | 536 | * |
537 | * PARAMETERS: Opcode - AML opcode | 537 | * PARAMETERS: opcode - AML opcode |
538 | * Operand0 - operand #0 | 538 | * operand0 - operand #0 |
539 | * Operand1 - operand #1 | 539 | * operand1 - operand #1 |
540 | * logical_result - TRUE/FALSE result of the operation | 540 | * logical_result - TRUE/FALSE result of the operation |
541 | * | 541 | * |
542 | * RETURN: Status | 542 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c index 60933e9dc3c0..bcceda5be9e3 100644 --- a/drivers/acpi/acpica/exmutex.c +++ b/drivers/acpi/acpica/exmutex.c | |||
@@ -102,7 +102,7 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc) | |||
102 | * FUNCTION: acpi_ex_link_mutex | 102 | * FUNCTION: acpi_ex_link_mutex |
103 | * | 103 | * |
104 | * PARAMETERS: obj_desc - The mutex to be linked | 104 | * PARAMETERS: obj_desc - The mutex to be linked |
105 | * Thread - Current executing thread object | 105 | * thread - Current executing thread object |
106 | * | 106 | * |
107 | * RETURN: None | 107 | * RETURN: None |
108 | * | 108 | * |
@@ -138,7 +138,7 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc, | |||
138 | * | 138 | * |
139 | * FUNCTION: acpi_ex_acquire_mutex_object | 139 | * FUNCTION: acpi_ex_acquire_mutex_object |
140 | * | 140 | * |
141 | * PARAMETERS: Timeout - Timeout in milliseconds | 141 | * PARAMETERS: timeout - Timeout in milliseconds |
142 | * obj_desc - Mutex object | 142 | * obj_desc - Mutex object |
143 | * thread_id - Current thread state | 143 | * thread_id - Current thread state |
144 | * | 144 | * |
@@ -443,7 +443,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
443 | * | 443 | * |
444 | * FUNCTION: acpi_ex_release_all_mutexes | 444 | * FUNCTION: acpi_ex_release_all_mutexes |
445 | * | 445 | * |
446 | * PARAMETERS: Thread - Current executing thread object | 446 | * PARAMETERS: thread - Current executing thread object |
447 | * | 447 | * |
448 | * RETURN: Status | 448 | * RETURN: Status |
449 | * | 449 | * |
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c index 30157f5a12d7..81eca60d2748 100644 --- a/drivers/acpi/acpica/exprep.c +++ b/drivers/acpi/acpica/exprep.c | |||
@@ -391,12 +391,12 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc, | |||
391 | * | 391 | * |
392 | * FUNCTION: acpi_ex_prep_field_value | 392 | * FUNCTION: acpi_ex_prep_field_value |
393 | * | 393 | * |
394 | * PARAMETERS: Info - Contains all field creation info | 394 | * PARAMETERS: info - Contains all field creation info |
395 | * | 395 | * |
396 | * RETURN: Status | 396 | * RETURN: Status |
397 | * | 397 | * |
398 | * DESCRIPTION: Construct a union acpi_operand_object of type def_field and | 398 | * DESCRIPTION: Construct an object of type union acpi_operand_object with a |
399 | * connect it to the parent Node. | 399 | * subtype of def_field and connect it to the parent Node. |
400 | * | 400 | * |
401 | ******************************************************************************/ | 401 | ******************************************************************************/ |
402 | 402 | ||
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c index 12d51df6d3bf..1f1ce0c3d2f8 100644 --- a/drivers/acpi/acpica/exregion.c +++ b/drivers/acpi/acpica/exregion.c | |||
@@ -53,10 +53,10 @@ ACPI_MODULE_NAME("exregion") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ex_system_memory_space_handler | 54 | * FUNCTION: acpi_ex_system_memory_space_handler |
55 | * | 55 | * |
56 | * PARAMETERS: Function - Read or Write operation | 56 | * PARAMETERS: function - Read or Write operation |
57 | * Address - Where in the space to read or write | 57 | * address - Where in the space to read or write |
58 | * bit_width - Field width in bits (8, 16, or 32) | 58 | * bit_width - Field width in bits (8, 16, or 32) |
59 | * Value - Pointer to in or out value | 59 | * value - Pointer to in or out value |
60 | * handler_context - Pointer to Handler's context | 60 | * handler_context - Pointer to Handler's context |
61 | * region_context - Pointer to context specific to the | 61 | * region_context - Pointer to context specific to the |
62 | * accessed region | 62 | * accessed region |
@@ -270,10 +270,10 @@ acpi_ex_system_memory_space_handler(u32 function, | |||
270 | * | 270 | * |
271 | * FUNCTION: acpi_ex_system_io_space_handler | 271 | * FUNCTION: acpi_ex_system_io_space_handler |
272 | * | 272 | * |
273 | * PARAMETERS: Function - Read or Write operation | 273 | * PARAMETERS: function - Read or Write operation |
274 | * Address - Where in the space to read or write | 274 | * address - Where in the space to read or write |
275 | * bit_width - Field width in bits (8, 16, or 32) | 275 | * bit_width - Field width in bits (8, 16, or 32) |
276 | * Value - Pointer to in or out value | 276 | * value - Pointer to in or out value |
277 | * handler_context - Pointer to Handler's context | 277 | * handler_context - Pointer to Handler's context |
278 | * region_context - Pointer to context specific to the | 278 | * region_context - Pointer to context specific to the |
279 | * accessed region | 279 | * accessed region |
@@ -329,10 +329,10 @@ acpi_ex_system_io_space_handler(u32 function, | |||
329 | * | 329 | * |
330 | * FUNCTION: acpi_ex_pci_config_space_handler | 330 | * FUNCTION: acpi_ex_pci_config_space_handler |
331 | * | 331 | * |
332 | * PARAMETERS: Function - Read or Write operation | 332 | * PARAMETERS: function - Read or Write operation |
333 | * Address - Where in the space to read or write | 333 | * address - Where in the space to read or write |
334 | * bit_width - Field width in bits (8, 16, or 32) | 334 | * bit_width - Field width in bits (8, 16, or 32) |
335 | * Value - Pointer to in or out value | 335 | * value - Pointer to in or out value |
336 | * handler_context - Pointer to Handler's context | 336 | * handler_context - Pointer to Handler's context |
337 | * region_context - Pointer to context specific to the | 337 | * region_context - Pointer to context specific to the |
338 | * accessed region | 338 | * accessed region |
@@ -365,7 +365,7 @@ acpi_ex_pci_config_space_handler(u32 function, | |||
365 | * pci_function is the PCI device function number | 365 | * pci_function is the PCI device function number |
366 | * pci_register is the Config space register range 0-255 bytes | 366 | * pci_register is the Config space register range 0-255 bytes |
367 | * | 367 | * |
368 | * Value - input value for write, output address for read | 368 | * value - input value for write, output address for read |
369 | * | 369 | * |
370 | */ | 370 | */ |
371 | pci_id = (struct acpi_pci_id *)region_context; | 371 | pci_id = (struct acpi_pci_id *)region_context; |
@@ -402,10 +402,10 @@ acpi_ex_pci_config_space_handler(u32 function, | |||
402 | * | 402 | * |
403 | * FUNCTION: acpi_ex_cmos_space_handler | 403 | * FUNCTION: acpi_ex_cmos_space_handler |
404 | * | 404 | * |
405 | * PARAMETERS: Function - Read or Write operation | 405 | * PARAMETERS: function - Read or Write operation |
406 | * Address - Where in the space to read or write | 406 | * address - Where in the space to read or write |
407 | * bit_width - Field width in bits (8, 16, or 32) | 407 | * bit_width - Field width in bits (8, 16, or 32) |
408 | * Value - Pointer to in or out value | 408 | * value - Pointer to in or out value |
409 | * handler_context - Pointer to Handler's context | 409 | * handler_context - Pointer to Handler's context |
410 | * region_context - Pointer to context specific to the | 410 | * region_context - Pointer to context specific to the |
411 | * accessed region | 411 | * accessed region |
@@ -434,10 +434,10 @@ acpi_ex_cmos_space_handler(u32 function, | |||
434 | * | 434 | * |
435 | * FUNCTION: acpi_ex_pci_bar_space_handler | 435 | * FUNCTION: acpi_ex_pci_bar_space_handler |
436 | * | 436 | * |
437 | * PARAMETERS: Function - Read or Write operation | 437 | * PARAMETERS: function - Read or Write operation |
438 | * Address - Where in the space to read or write | 438 | * address - Where in the space to read or write |
439 | * bit_width - Field width in bits (8, 16, or 32) | 439 | * bit_width - Field width in bits (8, 16, or 32) |
440 | * Value - Pointer to in or out value | 440 | * value - Pointer to in or out value |
441 | * handler_context - Pointer to Handler's context | 441 | * handler_context - Pointer to Handler's context |
442 | * region_context - Pointer to context specific to the | 442 | * region_context - Pointer to context specific to the |
443 | * accessed region | 443 | * accessed region |
@@ -466,10 +466,10 @@ acpi_ex_pci_bar_space_handler(u32 function, | |||
466 | * | 466 | * |
467 | * FUNCTION: acpi_ex_data_table_space_handler | 467 | * FUNCTION: acpi_ex_data_table_space_handler |
468 | * | 468 | * |
469 | * PARAMETERS: Function - Read or Write operation | 469 | * PARAMETERS: function - Read or Write operation |
470 | * Address - Where in the space to read or write | 470 | * address - Where in the space to read or write |
471 | * bit_width - Field width in bits (8, 16, or 32) | 471 | * bit_width - Field width in bits (8, 16, or 32) |
472 | * Value - Pointer to in or out value | 472 | * value - Pointer to in or out value |
473 | * handler_context - Pointer to Handler's context | 473 | * handler_context - Pointer to Handler's context |
474 | * region_context - Pointer to context specific to the | 474 | * region_context - Pointer to context specific to the |
475 | * accessed region | 475 | * accessed region |
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c index 6e335dc34528..bbf40ac27585 100644 --- a/drivers/acpi/acpica/exresolv.c +++ b/drivers/acpi/acpica/exresolv.c | |||
@@ -147,7 +147,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, | |||
147 | 147 | ||
148 | stack_desc = *stack_ptr; | 148 | stack_desc = *stack_ptr; |
149 | 149 | ||
150 | /* This is a union acpi_operand_object */ | 150 | /* This is an object of type union acpi_operand_object */ |
151 | 151 | ||
152 | switch (stack_desc->common.type) { | 152 | switch (stack_desc->common.type) { |
153 | case ACPI_TYPE_LOCAL_REFERENCE: | 153 | case ACPI_TYPE_LOCAL_REFERENCE: |
@@ -321,7 +321,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, | |||
321 | * FUNCTION: acpi_ex_resolve_multiple | 321 | * FUNCTION: acpi_ex_resolve_multiple |
322 | * | 322 | * |
323 | * PARAMETERS: walk_state - Current state (contains AML opcode) | 323 | * PARAMETERS: walk_state - Current state (contains AML opcode) |
324 | * Operand - Starting point for resolution | 324 | * operand - Starting point for resolution |
325 | * return_type - Where the object type is returned | 325 | * return_type - Where the object type is returned |
326 | * return_desc - Where the resolved object is returned | 326 | * return_desc - Where the resolved object is returned |
327 | * | 327 | * |
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c index a67b1d925ddd..f232fbabdea8 100644 --- a/drivers/acpi/acpica/exresop.c +++ b/drivers/acpi/acpica/exresop.c | |||
@@ -113,7 +113,7 @@ acpi_ex_check_object_type(acpi_object_type type_needed, | |||
113 | * | 113 | * |
114 | * FUNCTION: acpi_ex_resolve_operands | 114 | * FUNCTION: acpi_ex_resolve_operands |
115 | * | 115 | * |
116 | * PARAMETERS: Opcode - Opcode being interpreted | 116 | * PARAMETERS: opcode - Opcode being interpreted |
117 | * stack_ptr - Pointer to the operand stack to be | 117 | * stack_ptr - Pointer to the operand stack to be |
118 | * resolved | 118 | * resolved |
119 | * walk_state - Current state | 119 | * walk_state - Current state |
@@ -307,7 +307,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
307 | case ARGI_DEVICE_REF: | 307 | case ARGI_DEVICE_REF: |
308 | case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ | 308 | case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ |
309 | case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ | 309 | case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ |
310 | case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ | 310 | case ARGI_SIMPLE_TARGET: /* Name, Local, or arg - no implicit conversion */ |
311 | 311 | ||
312 | /* | 312 | /* |
313 | * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE | 313 | * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE |
@@ -410,7 +410,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
410 | /* | 410 | /* |
411 | * Need an operand of type ACPI_TYPE_INTEGER, | 411 | * Need an operand of type ACPI_TYPE_INTEGER, |
412 | * But we can implicitly convert from a STRING or BUFFER | 412 | * But we can implicitly convert from a STRING or BUFFER |
413 | * Aka - "Implicit Source Operand Conversion" | 413 | * aka - "Implicit Source Operand Conversion" |
414 | */ | 414 | */ |
415 | status = | 415 | status = |
416 | acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16); | 416 | acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16); |
@@ -437,7 +437,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
437 | /* | 437 | /* |
438 | * Need an operand of type ACPI_TYPE_BUFFER, | 438 | * Need an operand of type ACPI_TYPE_BUFFER, |
439 | * But we can implicitly convert from a STRING or INTEGER | 439 | * But we can implicitly convert from a STRING or INTEGER |
440 | * Aka - "Implicit Source Operand Conversion" | 440 | * aka - "Implicit Source Operand Conversion" |
441 | */ | 441 | */ |
442 | status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr); | 442 | status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr); |
443 | if (ACPI_FAILURE(status)) { | 443 | if (ACPI_FAILURE(status)) { |
@@ -463,7 +463,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
463 | /* | 463 | /* |
464 | * Need an operand of type ACPI_TYPE_STRING, | 464 | * Need an operand of type ACPI_TYPE_STRING, |
465 | * But we can implicitly convert from a BUFFER or INTEGER | 465 | * But we can implicitly convert from a BUFFER or INTEGER |
466 | * Aka - "Implicit Source Operand Conversion" | 466 | * aka - "Implicit Source Operand Conversion" |
467 | */ | 467 | */ |
468 | status = acpi_ex_convert_to_string(obj_desc, stack_ptr, | 468 | status = acpi_ex_convert_to_string(obj_desc, stack_ptr, |
469 | ACPI_IMPLICIT_CONVERT_HEX); | 469 | ACPI_IMPLICIT_CONVERT_HEX); |
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c index c6cf843cc4c9..5fffe7ab5ece 100644 --- a/drivers/acpi/acpica/exstore.c +++ b/drivers/acpi/acpica/exstore.c | |||
@@ -62,8 +62,8 @@ acpi_ex_store_object_to_index(union acpi_operand_object *val_desc, | |||
62 | * FUNCTION: acpi_ex_store | 62 | * FUNCTION: acpi_ex_store |
63 | * | 63 | * |
64 | * PARAMETERS: *source_desc - Value to be stored | 64 | * PARAMETERS: *source_desc - Value to be stored |
65 | * *dest_desc - Where to store it. Must be an NS node | 65 | * *dest_desc - Where to store it. Must be an NS node |
66 | * or a union acpi_operand_object of type | 66 | * or union acpi_operand_object of type |
67 | * Reference; | 67 | * Reference; |
68 | * walk_state - Current walk state | 68 | * walk_state - Current walk state |
69 | * | 69 | * |
@@ -361,7 +361,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, | |||
361 | * FUNCTION: acpi_ex_store_object_to_node | 361 | * FUNCTION: acpi_ex_store_object_to_node |
362 | * | 362 | * |
363 | * PARAMETERS: source_desc - Value to be stored | 363 | * PARAMETERS: source_desc - Value to be stored |
364 | * Node - Named object to receive the value | 364 | * node - Named object to receive the value |
365 | * walk_state - Current walk state | 365 | * walk_state - Current walk state |
366 | * implicit_conversion - Perform implicit conversion (yes/no) | 366 | * implicit_conversion - Perform implicit conversion (yes/no) |
367 | * | 367 | * |
diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c index 65a45d8335c8..53c248473547 100644 --- a/drivers/acpi/acpica/exstorob.c +++ b/drivers/acpi/acpica/exstorob.c | |||
@@ -110,7 +110,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc, | |||
110 | * NOTE: ACPI versions up to 3.0 specified that the buffer must be | 110 | * NOTE: ACPI versions up to 3.0 specified that the buffer must be |
111 | * truncated if the string is smaller than the buffer. However, "other" | 111 | * truncated if the string is smaller than the buffer. However, "other" |
112 | * implementations of ACPI never did this and thus became the defacto | 112 | * implementations of ACPI never did this and thus became the defacto |
113 | * standard. ACPI 3.0_a changes this behavior such that the buffer | 113 | * standard. ACPI 3.0A changes this behavior such that the buffer |
114 | * is no longer truncated. | 114 | * is no longer truncated. |
115 | */ | 115 | */ |
116 | 116 | ||
diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c index 191a12945226..b760641e2fc6 100644 --- a/drivers/acpi/acpica/exsystem.c +++ b/drivers/acpi/acpica/exsystem.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("exsystem") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ex_system_wait_semaphore | 54 | * FUNCTION: acpi_ex_system_wait_semaphore |
55 | * | 55 | * |
56 | * PARAMETERS: Semaphore - Semaphore to wait on | 56 | * PARAMETERS: semaphore - Semaphore to wait on |
57 | * Timeout - Max time to wait | 57 | * timeout - Max time to wait |
58 | * | 58 | * |
59 | * RETURN: Status | 59 | * RETURN: Status |
60 | * | 60 | * |
@@ -98,8 +98,8 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) | |||
98 | * | 98 | * |
99 | * FUNCTION: acpi_ex_system_wait_mutex | 99 | * FUNCTION: acpi_ex_system_wait_mutex |
100 | * | 100 | * |
101 | * PARAMETERS: Mutex - Mutex to wait on | 101 | * PARAMETERS: mutex - Mutex to wait on |
102 | * Timeout - Max time to wait | 102 | * timeout - Max time to wait |
103 | * | 103 | * |
104 | * RETURN: Status | 104 | * RETURN: Status |
105 | * | 105 | * |
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c index eb6798ba8b59..d1ab7917eed7 100644 --- a/drivers/acpi/acpica/exutils.c +++ b/drivers/acpi/acpica/exutils.c | |||
@@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void) | |||
109 | * | 109 | * |
110 | * DESCRIPTION: Reacquire the interpreter execution region from within the | 110 | * DESCRIPTION: Reacquire the interpreter execution region from within the |
111 | * interpreter code. Failure to enter the interpreter region is a | 111 | * interpreter code. Failure to enter the interpreter region is a |
112 | * fatal system error. Used in conjunction with | 112 | * fatal system error. Used in conjunction with |
113 | * relinquish_interpreter | 113 | * relinquish_interpreter |
114 | * | 114 | * |
115 | ******************************************************************************/ | 115 | ******************************************************************************/ |
@@ -317,8 +317,8 @@ void acpi_ex_release_global_lock(u32 field_flags) | |||
317 | * | 317 | * |
318 | * FUNCTION: acpi_ex_digits_needed | 318 | * FUNCTION: acpi_ex_digits_needed |
319 | * | 319 | * |
320 | * PARAMETERS: Value - Value to be represented | 320 | * PARAMETERS: value - Value to be represented |
321 | * Base - Base of representation | 321 | * base - Base of representation |
322 | * | 322 | * |
323 | * RETURN: The number of digits. | 323 | * RETURN: The number of digits. |
324 | * | 324 | * |
@@ -408,7 +408,7 @@ void acpi_ex_eisa_id_to_string(char *out_string, u64 compressed_id) | |||
408 | * PARAMETERS: out_string - Where to put the converted string. At least | 408 | * PARAMETERS: out_string - Where to put the converted string. At least |
409 | * 21 bytes are needed to hold the largest | 409 | * 21 bytes are needed to hold the largest |
410 | * possible 64-bit integer. | 410 | * possible 64-bit integer. |
411 | * Value - Value to be converted | 411 | * value - Value to be converted |
412 | * | 412 | * |
413 | * RETURN: None, string | 413 | * RETURN: None, string |
414 | * | 414 | * |
@@ -443,7 +443,7 @@ void acpi_ex_integer_to_string(char *out_string, u64 value) | |||
443 | * | 443 | * |
444 | * RETURN: TRUE if valid/supported ID. | 444 | * RETURN: TRUE if valid/supported ID. |
445 | * | 445 | * |
446 | * DESCRIPTION: Validate an operation region space_iD. | 446 | * DESCRIPTION: Validate an operation region space_ID. |
447 | * | 447 | * |
448 | ******************************************************************************/ | 448 | ******************************************************************************/ |
449 | 449 | ||
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c index d0b9ed5df97e..a1e71d0ef57b 100644 --- a/drivers/acpi/acpica/hwacpi.c +++ b/drivers/acpi/acpica/hwacpi.c | |||
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("hwacpi") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_hw_set_mode | 54 | * FUNCTION: acpi_hw_set_mode |
55 | * | 55 | * |
56 | * PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY | 56 | * PARAMETERS: mode - SYS_MODE_ACPI or SYS_MODE_LEGACY |
57 | * | 57 | * |
58 | * RETURN: Status | 58 | * RETURN: Status |
59 | * | 59 | * |
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c index 29e859293edd..48518dac5342 100644 --- a/drivers/acpi/acpica/hwesleep.c +++ b/drivers/acpi/acpica/hwesleep.c | |||
@@ -90,7 +90,7 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument) | |||
90 | * FUNCTION: acpi_hw_extended_sleep | 90 | * FUNCTION: acpi_hw_extended_sleep |
91 | * | 91 | * |
92 | * PARAMETERS: sleep_state - Which sleep state to enter | 92 | * PARAMETERS: sleep_state - Which sleep state to enter |
93 | * Flags - ACPI_EXECUTE_GTS to run optional method | 93 | * flags - ACPI_EXECUTE_GTS to run optional method |
94 | * | 94 | * |
95 | * RETURN: Status | 95 | * RETURN: Status |
96 | * | 96 | * |
@@ -117,7 +117,8 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | |||
117 | 117 | ||
118 | /* Clear wake status (WAK_STS) */ | 118 | /* Clear wake status (WAK_STS) */ |
119 | 119 | ||
120 | status = acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); | 120 | status = |
121 | acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); | ||
121 | if (ACPI_FAILURE(status)) { | 122 | if (ACPI_FAILURE(status)) { |
122 | return_ACPI_STATUS(status); | 123 | return_ACPI_STATUS(status); |
123 | } | 124 | } |
@@ -147,7 +148,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | |||
147 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & | 148 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & |
148 | ACPI_X_SLEEP_TYPE_MASK); | 149 | ACPI_X_SLEEP_TYPE_MASK); |
149 | 150 | ||
150 | status = acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), | 151 | status = acpi_write((u64)(sleep_type_value | ACPI_X_SLEEP_ENABLE), |
151 | &acpi_gbl_FADT.sleep_control); | 152 | &acpi_gbl_FADT.sleep_control); |
152 | if (ACPI_FAILURE(status)) { | 153 | if (ACPI_FAILURE(status)) { |
153 | return_ACPI_STATUS(status); | 154 | return_ACPI_STATUS(status); |
@@ -171,7 +172,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) | |||
171 | * FUNCTION: acpi_hw_extended_wake_prep | 172 | * FUNCTION: acpi_hw_extended_wake_prep |
172 | * | 173 | * |
173 | * PARAMETERS: sleep_state - Which sleep state we just exited | 174 | * PARAMETERS: sleep_state - Which sleep state we just exited |
174 | * Flags - ACPI_EXECUTE_BFS to run optional method | 175 | * flags - ACPI_EXECUTE_BFS to run optional method |
175 | * | 176 | * |
176 | * RETURN: Status | 177 | * RETURN: Status |
177 | * | 178 | * |
@@ -195,7 +196,7 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) | |||
195 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & | 196 | ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & |
196 | ACPI_X_SLEEP_TYPE_MASK); | 197 | ACPI_X_SLEEP_TYPE_MASK); |
197 | 198 | ||
198 | (void)acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), | 199 | (void)acpi_write((u64)(sleep_type_value | ACPI_X_SLEEP_ENABLE), |
199 | &acpi_gbl_FADT.sleep_control); | 200 | &acpi_gbl_FADT.sleep_control); |
200 | } | 201 | } |
201 | 202 | ||
@@ -212,7 +213,7 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) | |||
212 | * FUNCTION: acpi_hw_extended_wake | 213 | * FUNCTION: acpi_hw_extended_wake |
213 | * | 214 | * |
214 | * PARAMETERS: sleep_state - Which sleep state we just exited | 215 | * PARAMETERS: sleep_state - Which sleep state we just exited |
215 | * Flags - Reserved, set to zero | 216 | * flags - Reserved, set to zero |
216 | * | 217 | * |
217 | * RETURN: Status | 218 | * RETURN: Status |
218 | * | 219 | * |
@@ -239,7 +240,7 @@ acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags) | |||
239 | * and use it to determine whether the system is rebooting or | 240 | * and use it to determine whether the system is rebooting or |
240 | * resuming. Clear WAK_STS for compatibility. | 241 | * resuming. Clear WAK_STS for compatibility. |
241 | */ | 242 | */ |
242 | (void)acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); | 243 | (void)acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); |
243 | acpi_gbl_system_awake_and_running = TRUE; | 244 | acpi_gbl_system_awake_and_running = TRUE; |
244 | 245 | ||
245 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); | 246 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); |
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c index 6b6c83b87b52..4af6d20ef077 100644 --- a/drivers/acpi/acpica/hwregs.c +++ b/drivers/acpi/acpica/hwregs.c | |||
@@ -69,9 +69,9 @@ acpi_hw_write_multiple(u32 value, | |||
69 | * | 69 | * |
70 | * FUNCTION: acpi_hw_validate_register | 70 | * FUNCTION: acpi_hw_validate_register |
71 | * | 71 | * |
72 | * PARAMETERS: Reg - GAS register structure | 72 | * PARAMETERS: reg - GAS register structure |
73 | * max_bit_width - Max bit_width supported (32 or 64) | 73 | * max_bit_width - Max bit_width supported (32 or 64) |
74 | * Address - Pointer to where the gas->address | 74 | * address - Pointer to where the gas->address |
75 | * is returned | 75 | * is returned |
76 | * | 76 | * |
77 | * RETURN: Status | 77 | * RETURN: Status |
@@ -102,7 +102,7 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, | |||
102 | return (AE_BAD_ADDRESS); | 102 | return (AE_BAD_ADDRESS); |
103 | } | 103 | } |
104 | 104 | ||
105 | /* Validate the space_iD */ | 105 | /* Validate the space_ID */ |
106 | 106 | ||
107 | if ((reg->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && | 107 | if ((reg->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && |
108 | (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { | 108 | (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { |
@@ -137,8 +137,8 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, | |||
137 | * | 137 | * |
138 | * FUNCTION: acpi_hw_read | 138 | * FUNCTION: acpi_hw_read |
139 | * | 139 | * |
140 | * PARAMETERS: Value - Where the value is returned | 140 | * PARAMETERS: value - Where the value is returned |
141 | * Reg - GAS register structure | 141 | * reg - GAS register structure |
142 | * | 142 | * |
143 | * RETURN: Status | 143 | * RETURN: Status |
144 | * | 144 | * |
@@ -148,7 +148,7 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, | |||
148 | * | 148 | * |
149 | * LIMITATIONS: <These limitations also apply to acpi_hw_write> | 149 | * LIMITATIONS: <These limitations also apply to acpi_hw_write> |
150 | * bit_width must be exactly 8, 16, or 32. | 150 | * bit_width must be exactly 8, 16, or 32. |
151 | * space_iD must be system_memory or system_iO. | 151 | * space_ID must be system_memory or system_IO. |
152 | * bit_offset and access_width are currently ignored, as there has | 152 | * bit_offset and access_width are currently ignored, as there has |
153 | * not been a need to implement these. | 153 | * not been a need to implement these. |
154 | * | 154 | * |
@@ -200,8 +200,8 @@ acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) | |||
200 | * | 200 | * |
201 | * FUNCTION: acpi_hw_write | 201 | * FUNCTION: acpi_hw_write |
202 | * | 202 | * |
203 | * PARAMETERS: Value - Value to be written | 203 | * PARAMETERS: value - Value to be written |
204 | * Reg - GAS register structure | 204 | * reg - GAS register structure |
205 | * | 205 | * |
206 | * RETURN: Status | 206 | * RETURN: Status |
207 | * | 207 | * |
@@ -439,7 +439,7 @@ acpi_hw_register_read(u32 register_id, u32 * return_value) | |||
439 | * FUNCTION: acpi_hw_register_write | 439 | * FUNCTION: acpi_hw_register_write |
440 | * | 440 | * |
441 | * PARAMETERS: register_id - ACPI Register ID | 441 | * PARAMETERS: register_id - ACPI Register ID |
442 | * Value - The value to write | 442 | * value - The value to write |
443 | * | 443 | * |
444 | * RETURN: Status | 444 | * RETURN: Status |
445 | * | 445 | * |
@@ -571,7 +571,7 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value) | |||
571 | * | 571 | * |
572 | * FUNCTION: acpi_hw_read_multiple | 572 | * FUNCTION: acpi_hw_read_multiple |
573 | * | 573 | * |
574 | * PARAMETERS: Value - Where the register value is returned | 574 | * PARAMETERS: value - Where the register value is returned |
575 | * register_a - First ACPI register (required) | 575 | * register_a - First ACPI register (required) |
576 | * register_b - Second ACPI register (optional) | 576 | * register_b - Second ACPI register (optional) |
577 | * | 577 | * |
@@ -624,7 +624,7 @@ acpi_hw_read_multiple(u32 *value, | |||
624 | * | 624 | * |
625 | * FUNCTION: acpi_hw_write_multiple | 625 | * FUNCTION: acpi_hw_write_multiple |
626 | * | 626 | * |
627 | * PARAMETERS: Value - The value to write | 627 | * PARAMETERS: value - The value to write |
628 | * register_a - First ACPI register (required) | 628 | * register_a - First ACPI register (required) |
629 | * register_b - Second ACPI register (optional) | 629 | * register_b - Second ACPI register (optional) |
630 | * | 630 | * |
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index 0ed85cac3231..9960fe9ef533 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c | |||
@@ -56,7 +56,7 @@ ACPI_MODULE_NAME("hwsleep") | |||
56 | * FUNCTION: acpi_hw_legacy_sleep | 56 | * FUNCTION: acpi_hw_legacy_sleep |
57 | * | 57 | * |
58 | * PARAMETERS: sleep_state - Which sleep state to enter | 58 | * PARAMETERS: sleep_state - Which sleep state to enter |
59 | * Flags - ACPI_EXECUTE_GTS to run optional method | 59 | * flags - ACPI_EXECUTE_GTS to run optional method |
60 | * | 60 | * |
61 | * RETURN: Status | 61 | * RETURN: Status |
62 | * | 62 | * |
@@ -95,18 +95,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) | |||
95 | return_ACPI_STATUS(status); | 95 | return_ACPI_STATUS(status); |
96 | } | 96 | } |
97 | 97 | ||
98 | if (sleep_state != ACPI_STATE_S5) { | ||
99 | /* | ||
100 | * Disable BM arbitration. This feature is contained within an | ||
101 | * optional register (PM2 Control), so ignore a BAD_ADDRESS | ||
102 | * exception. | ||
103 | */ | ||
104 | status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1); | ||
105 | if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) { | ||
106 | return_ACPI_STATUS(status); | ||
107 | } | ||
108 | } | ||
109 | |||
110 | /* | 98 | /* |
111 | * 1) Disable/Clear all GPEs | 99 | * 1) Disable/Clear all GPEs |
112 | * 2) Enable all wakeup GPEs | 100 | * 2) Enable all wakeup GPEs |
@@ -226,7 +214,7 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) | |||
226 | * FUNCTION: acpi_hw_legacy_wake_prep | 214 | * FUNCTION: acpi_hw_legacy_wake_prep |
227 | * | 215 | * |
228 | * PARAMETERS: sleep_state - Which sleep state we just exited | 216 | * PARAMETERS: sleep_state - Which sleep state we just exited |
229 | * Flags - ACPI_EXECUTE_BFS to run optional method | 217 | * flags - ACPI_EXECUTE_BFS to run optional method |
230 | * | 218 | * |
231 | * RETURN: Status | 219 | * RETURN: Status |
232 | * | 220 | * |
@@ -300,7 +288,7 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) | |||
300 | * FUNCTION: acpi_hw_legacy_wake | 288 | * FUNCTION: acpi_hw_legacy_wake |
301 | * | 289 | * |
302 | * PARAMETERS: sleep_state - Which sleep state we just exited | 290 | * PARAMETERS: sleep_state - Which sleep state we just exited |
303 | * Flags - Reserved, set to zero | 291 | * flags - Reserved, set to zero |
304 | * | 292 | * |
305 | * RETURN: Status | 293 | * RETURN: Status |
306 | * | 294 | * |
@@ -364,16 +352,6 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags) | |||
364 | [ACPI_EVENT_POWER_BUTTON]. | 352 | [ACPI_EVENT_POWER_BUTTON]. |
365 | status_register_id, ACPI_CLEAR_STATUS); | 353 | status_register_id, ACPI_CLEAR_STATUS); |
366 | 354 | ||
367 | /* | ||
368 | * Enable BM arbitration. This feature is contained within an | ||
369 | * optional register (PM2 Control), so ignore a BAD_ADDRESS | ||
370 | * exception. | ||
371 | */ | ||
372 | status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0); | ||
373 | if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) { | ||
374 | return_ACPI_STATUS(status); | ||
375 | } | ||
376 | |||
377 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); | 355 | acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); |
378 | return_ACPI_STATUS(status); | 356 | return_ACPI_STATUS(status); |
379 | } | 357 | } |
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c index f1b2c3b94cac..b6411f16832f 100644 --- a/drivers/acpi/acpica/hwtimer.c +++ b/drivers/acpi/acpica/hwtimer.c | |||
@@ -54,7 +54,7 @@ ACPI_MODULE_NAME("hwtimer") | |||
54 | * | 54 | * |
55 | * FUNCTION: acpi_get_timer_resolution | 55 | * FUNCTION: acpi_get_timer_resolution |
56 | * | 56 | * |
57 | * PARAMETERS: Resolution - Where the resolution is returned | 57 | * PARAMETERS: resolution - Where the resolution is returned |
58 | * | 58 | * |
59 | * RETURN: Status and timer resolution | 59 | * RETURN: Status and timer resolution |
60 | * | 60 | * |
@@ -84,7 +84,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_timer_resolution) | |||
84 | * | 84 | * |
85 | * FUNCTION: acpi_get_timer | 85 | * FUNCTION: acpi_get_timer |
86 | * | 86 | * |
87 | * PARAMETERS: Ticks - Where the timer value is returned | 87 | * PARAMETERS: ticks - Where the timer value is returned |
88 | * | 88 | * |
89 | * RETURN: Status and current timer value (ticks) | 89 | * RETURN: Status and current timer value (ticks) |
90 | * | 90 | * |
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c index 6e5c43a60bb7..c99d546b217f 100644 --- a/drivers/acpi/acpica/hwvalid.c +++ b/drivers/acpi/acpica/hwvalid.c | |||
@@ -58,7 +58,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width); | |||
58 | * | 58 | * |
59 | * The table is used to implement the Microsoft port access rules that | 59 | * The table is used to implement the Microsoft port access rules that |
60 | * first appeared in Windows XP. Some ports are always illegal, and some | 60 | * first appeared in Windows XP. Some ports are always illegal, and some |
61 | * ports are only illegal if the BIOS calls _OSI with a win_xP string or | 61 | * ports are only illegal if the BIOS calls _OSI with a win_XP string or |
62 | * later (meaning that the BIOS itelf is post-XP.) | 62 | * later (meaning that the BIOS itelf is post-XP.) |
63 | * | 63 | * |
64 | * This provides ACPICA with the desired port protections and | 64 | * This provides ACPICA with the desired port protections and |
@@ -66,7 +66,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width); | |||
66 | * | 66 | * |
67 | * Description of port entries: | 67 | * Description of port entries: |
68 | * DMA: DMA controller | 68 | * DMA: DMA controller |
69 | * PIC0: Programmable Interrupt Controller (8259_a) | 69 | * PIC0: Programmable Interrupt Controller (8259A) |
70 | * PIT1: System Timer 1 | 70 | * PIT1: System Timer 1 |
71 | * PIT2: System Timer 2 failsafe | 71 | * PIT2: System Timer 2 failsafe |
72 | * RTC: Real-time clock | 72 | * RTC: Real-time clock |
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c index a716fede4f25..7bfd649d1996 100644 --- a/drivers/acpi/acpica/hwxface.c +++ b/drivers/acpi/acpica/hwxface.c | |||
@@ -104,8 +104,8 @@ ACPI_EXPORT_SYMBOL(acpi_reset) | |||
104 | * | 104 | * |
105 | * FUNCTION: acpi_read | 105 | * FUNCTION: acpi_read |
106 | * | 106 | * |
107 | * PARAMETERS: Value - Where the value is returned | 107 | * PARAMETERS: value - Where the value is returned |
108 | * Reg - GAS register structure | 108 | * reg - GAS register structure |
109 | * | 109 | * |
110 | * RETURN: Status | 110 | * RETURN: Status |
111 | * | 111 | * |
@@ -113,7 +113,7 @@ ACPI_EXPORT_SYMBOL(acpi_reset) | |||
113 | * | 113 | * |
114 | * LIMITATIONS: <These limitations also apply to acpi_write> | 114 | * LIMITATIONS: <These limitations also apply to acpi_write> |
115 | * bit_width must be exactly 8, 16, 32, or 64. | 115 | * bit_width must be exactly 8, 16, 32, or 64. |
116 | * space_iD must be system_memory or system_iO. | 116 | * space_ID must be system_memory or system_IO. |
117 | * bit_offset and access_width are currently ignored, as there has | 117 | * bit_offset and access_width are currently ignored, as there has |
118 | * not been a need to implement these. | 118 | * not been a need to implement these. |
119 | * | 119 | * |
@@ -196,8 +196,8 @@ ACPI_EXPORT_SYMBOL(acpi_read) | |||
196 | * | 196 | * |
197 | * FUNCTION: acpi_write | 197 | * FUNCTION: acpi_write |
198 | * | 198 | * |
199 | * PARAMETERS: Value - Value to be written | 199 | * PARAMETERS: value - Value to be written |
200 | * Reg - GAS register structure | 200 | * reg - GAS register structure |
201 | * | 201 | * |
202 | * RETURN: Status | 202 | * RETURN: Status |
203 | * | 203 | * |
@@ -441,7 +441,7 @@ ACPI_EXPORT_SYMBOL(acpi_write_bit_register) | |||
441 | * *sleep_type_a - Where SLP_TYPa is returned | 441 | * *sleep_type_a - Where SLP_TYPa is returned |
442 | * *sleep_type_b - Where SLP_TYPb is returned | 442 | * *sleep_type_b - Where SLP_TYPb is returned |
443 | * | 443 | * |
444 | * RETURN: Status - ACPI status | 444 | * RETURN: status - ACPI status |
445 | * | 445 | * |
446 | * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep | 446 | * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep |
447 | * state. | 447 | * state. |
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c index 762d059bb508..f8684bfe7907 100644 --- a/drivers/acpi/acpica/hwxfsleep.c +++ b/drivers/acpi/acpica/hwxfsleep.c | |||
@@ -205,7 +205,7 @@ acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) | |||
205 | ACPI_FLUSH_CPU_CACHE(); | 205 | ACPI_FLUSH_CPU_CACHE(); |
206 | 206 | ||
207 | status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, | 207 | status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, |
208 | (u32)acpi_gbl_FADT.S4bios_request, 8); | 208 | (u32)acpi_gbl_FADT.s4_bios_request, 8); |
209 | 209 | ||
210 | do { | 210 | do { |
211 | acpi_os_stall(1000); | 211 | acpi_os_stall(1000); |
@@ -349,7 +349,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) | |||
349 | * FUNCTION: acpi_enter_sleep_state | 349 | * FUNCTION: acpi_enter_sleep_state |
350 | * | 350 | * |
351 | * PARAMETERS: sleep_state - Which sleep state to enter | 351 | * PARAMETERS: sleep_state - Which sleep state to enter |
352 | * Flags - ACPI_EXECUTE_GTS to run optional method | 352 | * flags - ACPI_EXECUTE_GTS to run optional method |
353 | * | 353 | * |
354 | * RETURN: Status | 354 | * RETURN: Status |
355 | * | 355 | * |
@@ -382,7 +382,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) | |||
382 | * FUNCTION: acpi_leave_sleep_state_prep | 382 | * FUNCTION: acpi_leave_sleep_state_prep |
383 | * | 383 | * |
384 | * PARAMETERS: sleep_state - Which sleep state we are exiting | 384 | * PARAMETERS: sleep_state - Which sleep state we are exiting |
385 | * Flags - ACPI_EXECUTE_BFS to run optional method | 385 | * flags - ACPI_EXECUTE_BFS to run optional method |
386 | * | 386 | * |
387 | * RETURN: Status | 387 | * RETURN: Status |
388 | * | 388 | * |
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index 61623f3f6826..23db53ce2293 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c | |||
@@ -157,7 +157,7 @@ acpi_status acpi_ns_root_initialize(void) | |||
157 | 157 | ||
158 | #if defined (ACPI_ASL_COMPILER) | 158 | #if defined (ACPI_ASL_COMPILER) |
159 | 159 | ||
160 | /* Save the parameter count for the i_aSL compiler */ | 160 | /* Save the parameter count for the iASL compiler */ |
161 | 161 | ||
162 | new_node->value = obj_desc->method.param_count; | 162 | new_node->value = obj_desc->method.param_count; |
163 | #else | 163 | #else |
@@ -258,11 +258,11 @@ acpi_status acpi_ns_root_initialize(void) | |||
258 | * FUNCTION: acpi_ns_lookup | 258 | * FUNCTION: acpi_ns_lookup |
259 | * | 259 | * |
260 | * PARAMETERS: scope_info - Current scope info block | 260 | * PARAMETERS: scope_info - Current scope info block |
261 | * Pathname - Search pathname, in internal format | 261 | * pathname - Search pathname, in internal format |
262 | * (as represented in the AML stream) | 262 | * (as represented in the AML stream) |
263 | * Type - Type associated with name | 263 | * type - Type associated with name |
264 | * interpreter_mode - IMODE_LOAD_PASS2 => add name if not found | 264 | * interpreter_mode - IMODE_LOAD_PASS2 => add name if not found |
265 | * Flags - Flags describing the search restrictions | 265 | * flags - Flags describing the search restrictions |
266 | * walk_state - Current state of the walk | 266 | * walk_state - Current state of the walk |
267 | * return_node - Where the Node is placed (if found | 267 | * return_node - Where the Node is placed (if found |
268 | * or created successfully) | 268 | * or created successfully) |
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 7c3d3ceb98b3..ac389e5bb594 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c | |||
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("nsalloc") | |||
52 | * | 52 | * |
53 | * FUNCTION: acpi_ns_create_node | 53 | * FUNCTION: acpi_ns_create_node |
54 | * | 54 | * |
55 | * PARAMETERS: Name - Name of the new node (4 char ACPI name) | 55 | * PARAMETERS: name - Name of the new node (4 char ACPI name) |
56 | * | 56 | * |
57 | * RETURN: New namespace node (Null on failure) | 57 | * RETURN: New namespace node (Null on failure) |
58 | * | 58 | * |
@@ -92,7 +92,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name) | |||
92 | * | 92 | * |
93 | * FUNCTION: acpi_ns_delete_node | 93 | * FUNCTION: acpi_ns_delete_node |
94 | * | 94 | * |
95 | * PARAMETERS: Node - Node to be deleted | 95 | * PARAMETERS: node - Node to be deleted |
96 | * | 96 | * |
97 | * RETURN: None | 97 | * RETURN: None |
98 | * | 98 | * |
@@ -143,7 +143,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) | |||
143 | * | 143 | * |
144 | * FUNCTION: acpi_ns_remove_node | 144 | * FUNCTION: acpi_ns_remove_node |
145 | * | 145 | * |
146 | * PARAMETERS: Node - Node to be removed/deleted | 146 | * PARAMETERS: node - Node to be removed/deleted |
147 | * | 147 | * |
148 | * RETURN: None | 148 | * RETURN: None |
149 | * | 149 | * |
@@ -196,8 +196,8 @@ void acpi_ns_remove_node(struct acpi_namespace_node *node) | |||
196 | * | 196 | * |
197 | * PARAMETERS: walk_state - Current state of the walk | 197 | * PARAMETERS: walk_state - Current state of the walk |
198 | * parent_node - The parent of the new Node | 198 | * parent_node - The parent of the new Node |
199 | * Node - The new Node to install | 199 | * node - The new Node to install |
200 | * Type - ACPI object type of the new Node | 200 | * type - ACPI object type of the new Node |
201 | * | 201 | * |
202 | * RETURN: None | 202 | * RETURN: None |
203 | * | 203 | * |
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c index 3f7f3f6e7dd5..7ee4e6aeb0a2 100644 --- a/drivers/acpi/acpica/nsdump.c +++ b/drivers/acpi/acpica/nsdump.c | |||
@@ -63,7 +63,7 @@ acpi_ns_dump_one_device(acpi_handle obj_handle, | |||
63 | * FUNCTION: acpi_ns_print_pathname | 63 | * FUNCTION: acpi_ns_print_pathname |
64 | * | 64 | * |
65 | * PARAMETERS: num_segments - Number of ACPI name segments | 65 | * PARAMETERS: num_segments - Number of ACPI name segments |
66 | * Pathname - The compressed (internal) path | 66 | * pathname - The compressed (internal) path |
67 | * | 67 | * |
68 | * RETURN: None | 68 | * RETURN: None |
69 | * | 69 | * |
@@ -107,10 +107,10 @@ void acpi_ns_print_pathname(u32 num_segments, char *pathname) | |||
107 | * | 107 | * |
108 | * FUNCTION: acpi_ns_dump_pathname | 108 | * FUNCTION: acpi_ns_dump_pathname |
109 | * | 109 | * |
110 | * PARAMETERS: Handle - Object | 110 | * PARAMETERS: handle - Object |
111 | * Msg - Prefix message | 111 | * msg - Prefix message |
112 | * Level - Desired debug level | 112 | * level - Desired debug level |
113 | * Component - Caller's component ID | 113 | * component - Caller's component ID |
114 | * | 114 | * |
115 | * RETURN: None | 115 | * RETURN: None |
116 | * | 116 | * |
@@ -143,8 +143,8 @@ acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component) | |||
143 | * FUNCTION: acpi_ns_dump_one_object | 143 | * FUNCTION: acpi_ns_dump_one_object |
144 | * | 144 | * |
145 | * PARAMETERS: obj_handle - Node to be dumped | 145 | * PARAMETERS: obj_handle - Node to be dumped |
146 | * Level - Nesting level of the handle | 146 | * level - Nesting level of the handle |
147 | * Context - Passed into walk_namespace | 147 | * context - Passed into walk_namespace |
148 | * return_value - Not used | 148 | * return_value - Not used |
149 | * | 149 | * |
150 | * RETURN: Status | 150 | * RETURN: Status |
@@ -615,7 +615,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
615 | * | 615 | * |
616 | * FUNCTION: acpi_ns_dump_objects | 616 | * FUNCTION: acpi_ns_dump_objects |
617 | * | 617 | * |
618 | * PARAMETERS: Type - Object type to be dumped | 618 | * PARAMETERS: type - Object type to be dumped |
619 | * display_type - 0 or ACPI_DISPLAY_SUMMARY | 619 | * display_type - 0 or ACPI_DISPLAY_SUMMARY |
620 | * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX | 620 | * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX |
621 | * for an effectively unlimited depth. | 621 | * for an effectively unlimited depth. |
@@ -671,7 +671,7 @@ acpi_ns_dump_objects(acpi_object_type type, | |||
671 | * | 671 | * |
672 | * FUNCTION: acpi_ns_dump_entry | 672 | * FUNCTION: acpi_ns_dump_entry |
673 | * | 673 | * |
674 | * PARAMETERS: Handle - Node to be dumped | 674 | * PARAMETERS: handle - Node to be dumped |
675 | * debug_level - Output level | 675 | * debug_level - Output level |
676 | * | 676 | * |
677 | * RETURN: None | 677 | * RETURN: None |
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c index 3b5acb0eb406..944d4c8d9438 100644 --- a/drivers/acpi/acpica/nsdumpdv.c +++ b/drivers/acpi/acpica/nsdumpdv.c | |||
@@ -55,9 +55,9 @@ ACPI_MODULE_NAME("nsdumpdv") | |||
55 | * | 55 | * |
56 | * FUNCTION: acpi_ns_dump_one_device | 56 | * FUNCTION: acpi_ns_dump_one_device |
57 | * | 57 | * |
58 | * PARAMETERS: Handle - Node to be dumped | 58 | * PARAMETERS: handle - Node to be dumped |
59 | * Level - Nesting level of the handle | 59 | * level - Nesting level of the handle |
60 | * Context - Passed into walk_namespace | 60 | * context - Passed into walk_namespace |
61 | * return_value - Not used | 61 | * return_value - Not used |
62 | * | 62 | * |
63 | * RETURN: Status | 63 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c index f375cb82e321..69074be498e8 100644 --- a/drivers/acpi/acpica/nseval.c +++ b/drivers/acpi/acpica/nseval.c | |||
@@ -59,11 +59,11 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, | |||
59 | * | 59 | * |
60 | * FUNCTION: acpi_ns_evaluate | 60 | * FUNCTION: acpi_ns_evaluate |
61 | * | 61 | * |
62 | * PARAMETERS: Info - Evaluation info block, contains: | 62 | * PARAMETERS: info - Evaluation info block, contains: |
63 | * prefix_node - Prefix or Method/Object Node to execute | 63 | * prefix_node - Prefix or Method/Object Node to execute |
64 | * Pathname - Name of method to execute, If NULL, the | 64 | * pathname - Name of method to execute, If NULL, the |
65 | * Node is the object to execute | 65 | * Node is the object to execute |
66 | * Parameters - List of parameters to pass to the method, | 66 | * parameters - List of parameters to pass to the method, |
67 | * terminated by NULL. Params itself may be | 67 | * terminated by NULL. Params itself may be |
68 | * NULL if no parameters are being passed. | 68 | * NULL if no parameters are being passed. |
69 | * return_object - Where to put method's return value (if | 69 | * return_object - Where to put method's return value (if |
@@ -71,7 +71,7 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, | |||
71 | * parameter_type - Type of Parameter list | 71 | * parameter_type - Type of Parameter list |
72 | * return_object - Where to put method's return value (if | 72 | * return_object - Where to put method's return value (if |
73 | * any). If NULL, no value is returned. | 73 | * any). If NULL, no value is returned. |
74 | * Flags - ACPI_IGNORE_RETURN_VALUE to delete return | 74 | * flags - ACPI_IGNORE_RETURN_VALUE to delete return |
75 | * | 75 | * |
76 | * RETURN: Status | 76 | * RETURN: Status |
77 | * | 77 | * |
@@ -351,7 +351,7 @@ void acpi_ns_exec_module_code_list(void) | |||
351 | * FUNCTION: acpi_ns_exec_module_code | 351 | * FUNCTION: acpi_ns_exec_module_code |
352 | * | 352 | * |
353 | * PARAMETERS: method_obj - Object container for the module-level code | 353 | * PARAMETERS: method_obj - Object container for the module-level code |
354 | * Info - Info block for method evaluation | 354 | * info - Info block for method evaluation |
355 | * | 355 | * |
356 | * RETURN: None. Exceptions during method execution are ignored, since | 356 | * RETURN: None. Exceptions during method execution are ignored, since |
357 | * we cannot abort a table load. | 357 | * we cannot abort a table load. |
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c index 9d84ec2f0211..95ffe8dfa1f1 100644 --- a/drivers/acpi/acpica/nsinit.c +++ b/drivers/acpi/acpica/nsinit.c | |||
@@ -224,8 +224,8 @@ acpi_status acpi_ns_initialize_devices(void) | |||
224 | * FUNCTION: acpi_ns_init_one_object | 224 | * FUNCTION: acpi_ns_init_one_object |
225 | * | 225 | * |
226 | * PARAMETERS: obj_handle - Node | 226 | * PARAMETERS: obj_handle - Node |
227 | * Level - Current nesting level | 227 | * level - Current nesting level |
228 | * Context - Points to a init info struct | 228 | * context - Points to a init info struct |
229 | * return_value - Not used | 229 | * return_value - Not used |
230 | * | 230 | * |
231 | * RETURN: Status | 231 | * RETURN: Status |
@@ -530,7 +530,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
530 | * we will not run _INI, but we continue to examine the children | 530 | * we will not run _INI, but we continue to examine the children |
531 | * of this device. | 531 | * of this device. |
532 | * | 532 | * |
533 | * From the ACPI spec, description of _STA: (Note - no mention | 533 | * From the ACPI spec, description of _STA: (note - no mention |
534 | * of whether to run _INI or not on the device in question) | 534 | * of whether to run _INI or not on the device in question) |
535 | * | 535 | * |
536 | * "_STA may return bit 0 clear (not present) with bit 3 set | 536 | * "_STA may return bit 0 clear (not present) with bit 3 set |
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c index 5cbf15ffe7d8..76935ff29289 100644 --- a/drivers/acpi/acpica/nsload.c +++ b/drivers/acpi/acpica/nsload.c | |||
@@ -63,7 +63,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle); | |||
63 | * FUNCTION: acpi_ns_load_table | 63 | * FUNCTION: acpi_ns_load_table |
64 | * | 64 | * |
65 | * PARAMETERS: table_index - Index for table to be loaded | 65 | * PARAMETERS: table_index - Index for table to be loaded |
66 | * Node - Owning NS node | 66 | * node - Owning NS node |
67 | * | 67 | * |
68 | * RETURN: Status | 68 | * RETURN: Status |
69 | * | 69 | * |
@@ -278,7 +278,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle) | |||
278 | * | 278 | * |
279 | * FUNCTION: acpi_ns_unload_name_space | 279 | * FUNCTION: acpi_ns_unload_name_space |
280 | * | 280 | * |
281 | * PARAMETERS: Handle - Root of namespace subtree to be deleted | 281 | * PARAMETERS: handle - Root of namespace subtree to be deleted |
282 | * | 282 | * |
283 | * RETURN: Status | 283 | * RETURN: Status |
284 | * | 284 | * |
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c index b20e7c8c3ffb..96e0eb609bb4 100644 --- a/drivers/acpi/acpica/nsnames.c +++ b/drivers/acpi/acpica/nsnames.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("nsnames") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ns_build_external_path | 54 | * FUNCTION: acpi_ns_build_external_path |
55 | * | 55 | * |
56 | * PARAMETERS: Node - NS node whose pathname is needed | 56 | * PARAMETERS: node - NS node whose pathname is needed |
57 | * Size - Size of the pathname | 57 | * size - Size of the pathname |
58 | * *name_buffer - Where to return the pathname | 58 | * *name_buffer - Where to return the pathname |
59 | * | 59 | * |
60 | * RETURN: Status | 60 | * RETURN: Status |
@@ -120,7 +120,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node, | |||
120 | * | 120 | * |
121 | * FUNCTION: acpi_ns_get_external_pathname | 121 | * FUNCTION: acpi_ns_get_external_pathname |
122 | * | 122 | * |
123 | * PARAMETERS: Node - Namespace node whose pathname is needed | 123 | * PARAMETERS: node - Namespace node whose pathname is needed |
124 | * | 124 | * |
125 | * RETURN: Pointer to storage containing the fully qualified name of | 125 | * RETURN: Pointer to storage containing the fully qualified name of |
126 | * the node, In external format (name segments separated by path | 126 | * the node, In external format (name segments separated by path |
@@ -168,7 +168,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) | |||
168 | * | 168 | * |
169 | * FUNCTION: acpi_ns_get_pathname_length | 169 | * FUNCTION: acpi_ns_get_pathname_length |
170 | * | 170 | * |
171 | * PARAMETERS: Node - Namespace node | 171 | * PARAMETERS: node - Namespace node |
172 | * | 172 | * |
173 | * RETURN: Length of path, including prefix | 173 | * RETURN: Length of path, including prefix |
174 | * | 174 | * |
@@ -214,7 +214,7 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node) | |||
214 | * | 214 | * |
215 | * PARAMETERS: target_handle - Handle of named object whose name is | 215 | * PARAMETERS: target_handle - Handle of named object whose name is |
216 | * to be found | 216 | * to be found |
217 | * Buffer - Where the pathname is returned | 217 | * buffer - Where the pathname is returned |
218 | * | 218 | * |
219 | * RETURN: Status, Buffer is filled with pathname if status is AE_OK | 219 | * RETURN: Status, Buffer is filled with pathname if status is AE_OK |
220 | * | 220 | * |
diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c index dd77a3ce6e50..d6c9a3cc6716 100644 --- a/drivers/acpi/acpica/nsobject.c +++ b/drivers/acpi/acpica/nsobject.c | |||
@@ -53,9 +53,9 @@ ACPI_MODULE_NAME("nsobject") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_ns_attach_object | 54 | * FUNCTION: acpi_ns_attach_object |
55 | * | 55 | * |
56 | * PARAMETERS: Node - Parent Node | 56 | * PARAMETERS: node - Parent Node |
57 | * Object - Object to be attached | 57 | * object - Object to be attached |
58 | * Type - Type of object, or ACPI_TYPE_ANY if not | 58 | * type - Type of object, or ACPI_TYPE_ANY if not |
59 | * known | 59 | * known |
60 | * | 60 | * |
61 | * RETURN: Status | 61 | * RETURN: Status |
@@ -191,7 +191,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node, | |||
191 | * | 191 | * |
192 | * FUNCTION: acpi_ns_detach_object | 192 | * FUNCTION: acpi_ns_detach_object |
193 | * | 193 | * |
194 | * PARAMETERS: Node - A Namespace node whose object will be detached | 194 | * PARAMETERS: node - A Namespace node whose object will be detached |
195 | * | 195 | * |
196 | * RETURN: None. | 196 | * RETURN: None. |
197 | * | 197 | * |
@@ -250,7 +250,7 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node) | |||
250 | * | 250 | * |
251 | * FUNCTION: acpi_ns_get_attached_object | 251 | * FUNCTION: acpi_ns_get_attached_object |
252 | * | 252 | * |
253 | * PARAMETERS: Node - Namespace node | 253 | * PARAMETERS: node - Namespace node |
254 | * | 254 | * |
255 | * RETURN: Current value of the object field from the Node whose | 255 | * RETURN: Current value of the object field from the Node whose |
256 | * handle is passed | 256 | * handle is passed |
@@ -285,7 +285,7 @@ union acpi_operand_object *acpi_ns_get_attached_object(struct | |||
285 | * | 285 | * |
286 | * FUNCTION: acpi_ns_get_secondary_object | 286 | * FUNCTION: acpi_ns_get_secondary_object |
287 | * | 287 | * |
288 | * PARAMETERS: Node - Namespace node | 288 | * PARAMETERS: node - Namespace node |
289 | * | 289 | * |
290 | * RETURN: Current value of the object field from the Node whose | 290 | * RETURN: Current value of the object field from the Node whose |
291 | * handle is passed. | 291 | * handle is passed. |
@@ -315,9 +315,9 @@ union acpi_operand_object *acpi_ns_get_secondary_object(union | |||
315 | * | 315 | * |
316 | * FUNCTION: acpi_ns_attach_data | 316 | * FUNCTION: acpi_ns_attach_data |
317 | * | 317 | * |
318 | * PARAMETERS: Node - Namespace node | 318 | * PARAMETERS: node - Namespace node |
319 | * Handler - Handler to be associated with the data | 319 | * handler - Handler to be associated with the data |
320 | * Data - Data to be attached | 320 | * data - Data to be attached |
321 | * | 321 | * |
322 | * RETURN: Status | 322 | * RETURN: Status |
323 | * | 323 | * |
@@ -372,8 +372,8 @@ acpi_ns_attach_data(struct acpi_namespace_node *node, | |||
372 | * | 372 | * |
373 | * FUNCTION: acpi_ns_detach_data | 373 | * FUNCTION: acpi_ns_detach_data |
374 | * | 374 | * |
375 | * PARAMETERS: Node - Namespace node | 375 | * PARAMETERS: node - Namespace node |
376 | * Handler - Handler associated with the data | 376 | * handler - Handler associated with the data |
377 | * | 377 | * |
378 | * RETURN: Status | 378 | * RETURN: Status |
379 | * | 379 | * |
@@ -416,9 +416,9 @@ acpi_ns_detach_data(struct acpi_namespace_node * node, | |||
416 | * | 416 | * |
417 | * FUNCTION: acpi_ns_get_attached_data | 417 | * FUNCTION: acpi_ns_get_attached_data |
418 | * | 418 | * |
419 | * PARAMETERS: Node - Namespace node | 419 | * PARAMETERS: node - Namespace node |
420 | * Handler - Handler associated with the data | 420 | * handler - Handler associated with the data |
421 | * Data - Where the data is returned | 421 | * data - Where the data is returned |
422 | * | 422 | * |
423 | * RETURN: Status | 423 | * RETURN: Status |
424 | * | 424 | * |
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c index 23ce09686418..2419f417ea33 100644 --- a/drivers/acpi/acpica/nspredef.c +++ b/drivers/acpi/acpica/nspredef.c | |||
@@ -116,7 +116,7 @@ static const char *acpi_rtype_names[] = { | |||
116 | * | 116 | * |
117 | * FUNCTION: acpi_ns_check_predefined_names | 117 | * FUNCTION: acpi_ns_check_predefined_names |
118 | * | 118 | * |
119 | * PARAMETERS: Node - Namespace node for the method/object | 119 | * PARAMETERS: node - Namespace node for the method/object |
120 | * user_param_count - Number of parameters actually passed | 120 | * user_param_count - Number of parameters actually passed |
121 | * return_status - Status from the object evaluation | 121 | * return_status - Status from the object evaluation |
122 | * return_object_ptr - Pointer to the object returned from the | 122 | * return_object_ptr - Pointer to the object returned from the |
@@ -275,10 +275,10 @@ cleanup: | |||
275 | * | 275 | * |
276 | * FUNCTION: acpi_ns_check_parameter_count | 276 | * FUNCTION: acpi_ns_check_parameter_count |
277 | * | 277 | * |
278 | * PARAMETERS: Pathname - Full pathname to the node (for error msgs) | 278 | * PARAMETERS: pathname - Full pathname to the node (for error msgs) |
279 | * Node - Namespace node for the method/object | 279 | * node - Namespace node for the method/object |
280 | * user_param_count - Number of args passed in by the caller | 280 | * user_param_count - Number of args passed in by the caller |
281 | * Predefined - Pointer to entry in predefined name table | 281 | * predefined - Pointer to entry in predefined name table |
282 | * | 282 | * |
283 | * RETURN: None | 283 | * RETURN: None |
284 | * | 284 | * |
@@ -364,7 +364,7 @@ acpi_ns_check_parameter_count(char *pathname, | |||
364 | * | 364 | * |
365 | * FUNCTION: acpi_ns_check_for_predefined_name | 365 | * FUNCTION: acpi_ns_check_for_predefined_name |
366 | * | 366 | * |
367 | * PARAMETERS: Node - Namespace node for the method/object | 367 | * PARAMETERS: node - Namespace node for the method/object |
368 | * | 368 | * |
369 | * RETURN: Pointer to entry in predefined table. NULL indicates not found. | 369 | * RETURN: Pointer to entry in predefined table. NULL indicates not found. |
370 | * | 370 | * |
@@ -410,7 +410,7 @@ const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct | |||
410 | * | 410 | * |
411 | * FUNCTION: acpi_ns_check_package | 411 | * FUNCTION: acpi_ns_check_package |
412 | * | 412 | * |
413 | * PARAMETERS: Data - Pointer to validation data structure | 413 | * PARAMETERS: data - Pointer to validation data structure |
414 | * return_object_ptr - Pointer to the object returned from the | 414 | * return_object_ptr - Pointer to the object returned from the |
415 | * evaluation of a method or object | 415 | * evaluation of a method or object |
416 | * | 416 | * |
@@ -638,7 +638,7 @@ acpi_ns_check_package(struct acpi_predefined_data *data, | |||
638 | /* Create the new outer package and populate it */ | 638 | /* Create the new outer package and populate it */ |
639 | 639 | ||
640 | status = | 640 | status = |
641 | acpi_ns_wrap_with_package(data, *elements, | 641 | acpi_ns_wrap_with_package(data, return_object, |
642 | return_object_ptr); | 642 | return_object_ptr); |
643 | if (ACPI_FAILURE(status)) { | 643 | if (ACPI_FAILURE(status)) { |
644 | return (status); | 644 | return (status); |
@@ -685,11 +685,11 @@ package_too_small: | |||
685 | * | 685 | * |
686 | * FUNCTION: acpi_ns_check_package_list | 686 | * FUNCTION: acpi_ns_check_package_list |
687 | * | 687 | * |
688 | * PARAMETERS: Data - Pointer to validation data structure | 688 | * PARAMETERS: data - Pointer to validation data structure |
689 | * Package - Pointer to package-specific info for method | 689 | * package - Pointer to package-specific info for method |
690 | * Elements - Element list of parent package. All elements | 690 | * elements - Element list of parent package. All elements |
691 | * of this list should be of type Package. | 691 | * of this list should be of type Package. |
692 | * Count - Count of subpackages | 692 | * count - Count of subpackages |
693 | * | 693 | * |
694 | * RETURN: Status | 694 | * RETURN: Status |
695 | * | 695 | * |
@@ -911,12 +911,12 @@ package_too_small: | |||
911 | * | 911 | * |
912 | * FUNCTION: acpi_ns_check_package_elements | 912 | * FUNCTION: acpi_ns_check_package_elements |
913 | * | 913 | * |
914 | * PARAMETERS: Data - Pointer to validation data structure | 914 | * PARAMETERS: data - Pointer to validation data structure |
915 | * Elements - Pointer to the package elements array | 915 | * elements - Pointer to the package elements array |
916 | * Type1 - Object type for first group | 916 | * type1 - Object type for first group |
917 | * Count1 - Count for first group | 917 | * count1 - Count for first group |
918 | * Type2 - Object type for second group | 918 | * type2 - Object type for second group |
919 | * Count2 - Count for second group | 919 | * count2 - Count for second group |
920 | * start_index - Start of the first group of elements | 920 | * start_index - Start of the first group of elements |
921 | * | 921 | * |
922 | * RETURN: Status | 922 | * RETURN: Status |
@@ -968,7 +968,7 @@ acpi_ns_check_package_elements(struct acpi_predefined_data *data, | |||
968 | * | 968 | * |
969 | * FUNCTION: acpi_ns_check_object_type | 969 | * FUNCTION: acpi_ns_check_object_type |
970 | * | 970 | * |
971 | * PARAMETERS: Data - Pointer to validation data structure | 971 | * PARAMETERS: data - Pointer to validation data structure |
972 | * return_object_ptr - Pointer to the object returned from the | 972 | * return_object_ptr - Pointer to the object returned from the |
973 | * evaluation of a method or object | 973 | * evaluation of a method or object |
974 | * expected_btypes - Bitmap of expected return type(s) | 974 | * expected_btypes - Bitmap of expected return type(s) |
@@ -1102,7 +1102,7 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data, | |||
1102 | * | 1102 | * |
1103 | * FUNCTION: acpi_ns_check_reference | 1103 | * FUNCTION: acpi_ns_check_reference |
1104 | * | 1104 | * |
1105 | * PARAMETERS: Data - Pointer to validation data structure | 1105 | * PARAMETERS: data - Pointer to validation data structure |
1106 | * return_object - Object returned from the evaluation of a | 1106 | * return_object - Object returned from the evaluation of a |
1107 | * method or object | 1107 | * method or object |
1108 | * | 1108 | * |
@@ -1140,7 +1140,7 @@ acpi_ns_check_reference(struct acpi_predefined_data *data, | |||
1140 | * | 1140 | * |
1141 | * FUNCTION: acpi_ns_get_expected_types | 1141 | * FUNCTION: acpi_ns_get_expected_types |
1142 | * | 1142 | * |
1143 | * PARAMETERS: Buffer - Pointer to where the string is returned | 1143 | * PARAMETERS: buffer - Pointer to where the string is returned |
1144 | * expected_btypes - Bitmap of expected return type(s) | 1144 | * expected_btypes - Bitmap of expected return type(s) |
1145 | * | 1145 | * |
1146 | * RETURN: Buffer is populated with type names. | 1146 | * RETURN: Buffer is populated with type names. |
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c index 5519a64a353f..8c5f292860fc 100644 --- a/drivers/acpi/acpica/nsrepair.c +++ b/drivers/acpi/acpica/nsrepair.c | |||
@@ -94,7 +94,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, | |||
94 | * | 94 | * |
95 | * FUNCTION: acpi_ns_repair_object | 95 | * FUNCTION: acpi_ns_repair_object |
96 | * | 96 | * |
97 | * PARAMETERS: Data - Pointer to validation data structure | 97 | * PARAMETERS: data - Pointer to validation data structure |
98 | * expected_btypes - Object types expected | 98 | * expected_btypes - Object types expected |
99 | * package_index - Index of object within parent package (if | 99 | * package_index - Index of object within parent package (if |
100 | * applicable - ACPI_NOT_PACKAGE_ELEMENT | 100 | * applicable - ACPI_NOT_PACKAGE_ELEMENT |
@@ -470,7 +470,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, | |||
470 | * | 470 | * |
471 | * FUNCTION: acpi_ns_repair_null_element | 471 | * FUNCTION: acpi_ns_repair_null_element |
472 | * | 472 | * |
473 | * PARAMETERS: Data - Pointer to validation data structure | 473 | * PARAMETERS: data - Pointer to validation data structure |
474 | * expected_btypes - Object types expected | 474 | * expected_btypes - Object types expected |
475 | * package_index - Index of object within parent package (if | 475 | * package_index - Index of object within parent package (if |
476 | * applicable - ACPI_NOT_PACKAGE_ELEMENT | 476 | * applicable - ACPI_NOT_PACKAGE_ELEMENT |
@@ -509,17 +509,17 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data, | |||
509 | */ | 509 | */ |
510 | if (expected_btypes & ACPI_RTYPE_INTEGER) { | 510 | if (expected_btypes & ACPI_RTYPE_INTEGER) { |
511 | 511 | ||
512 | /* Need an Integer - create a zero-value integer */ | 512 | /* Need an integer - create a zero-value integer */ |
513 | 513 | ||
514 | new_object = acpi_ut_create_integer_object((u64)0); | 514 | new_object = acpi_ut_create_integer_object((u64)0); |
515 | } else if (expected_btypes & ACPI_RTYPE_STRING) { | 515 | } else if (expected_btypes & ACPI_RTYPE_STRING) { |
516 | 516 | ||
517 | /* Need a String - create a NULL string */ | 517 | /* Need a string - create a NULL string */ |
518 | 518 | ||
519 | new_object = acpi_ut_create_string_object(0); | 519 | new_object = acpi_ut_create_string_object(0); |
520 | } else if (expected_btypes & ACPI_RTYPE_BUFFER) { | 520 | } else if (expected_btypes & ACPI_RTYPE_BUFFER) { |
521 | 521 | ||
522 | /* Need a Buffer - create a zero-length buffer */ | 522 | /* Need a buffer - create a zero-length buffer */ |
523 | 523 | ||
524 | new_object = acpi_ut_create_buffer_object(0); | 524 | new_object = acpi_ut_create_buffer_object(0); |
525 | } else { | 525 | } else { |
@@ -552,7 +552,7 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data, | |||
552 | * | 552 | * |
553 | * FUNCTION: acpi_ns_remove_null_elements | 553 | * FUNCTION: acpi_ns_remove_null_elements |
554 | * | 554 | * |
555 | * PARAMETERS: Data - Pointer to validation data structure | 555 | * PARAMETERS: data - Pointer to validation data structure |
556 | * package_type - An acpi_return_package_types value | 556 | * package_type - An acpi_return_package_types value |
557 | * obj_desc - A Package object | 557 | * obj_desc - A Package object |
558 | * | 558 | * |
@@ -635,7 +635,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data, | |||
635 | * | 635 | * |
636 | * FUNCTION: acpi_ns_wrap_with_package | 636 | * FUNCTION: acpi_ns_wrap_with_package |
637 | * | 637 | * |
638 | * PARAMETERS: Data - Pointer to validation data structure | 638 | * PARAMETERS: data - Pointer to validation data structure |
639 | * original_object - Pointer to the object to repair. | 639 | * original_object - Pointer to the object to repair. |
640 | * obj_desc_ptr - The new package object is returned here | 640 | * obj_desc_ptr - The new package object is returned here |
641 | * | 641 | * |
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c index 726bc8e687f7..90189251cdf0 100644 --- a/drivers/acpi/acpica/nsrepair2.c +++ b/drivers/acpi/acpica/nsrepair2.c | |||
@@ -149,8 +149,8 @@ static const struct acpi_repair_info acpi_ns_repairable_names[] = { | |||
149 | * | 149 | * |
150 | * FUNCTION: acpi_ns_complex_repairs | 150 | * FUNCTION: acpi_ns_complex_repairs |
151 | * | 151 | * |
152 | * PARAMETERS: Data - Pointer to validation data structure | 152 | * PARAMETERS: data - Pointer to validation data structure |
153 | * Node - Namespace node for the method/object | 153 | * node - Namespace node for the method/object |
154 | * validate_status - Original status of earlier validation | 154 | * validate_status - Original status of earlier validation |
155 | * return_object_ptr - Pointer to the object returned from the | 155 | * return_object_ptr - Pointer to the object returned from the |
156 | * evaluation of a method or object | 156 | * evaluation of a method or object |
@@ -187,7 +187,7 @@ acpi_ns_complex_repairs(struct acpi_predefined_data *data, | |||
187 | * | 187 | * |
188 | * FUNCTION: acpi_ns_match_repairable_name | 188 | * FUNCTION: acpi_ns_match_repairable_name |
189 | * | 189 | * |
190 | * PARAMETERS: Node - Namespace node for the method/object | 190 | * PARAMETERS: node - Namespace node for the method/object |
191 | * | 191 | * |
192 | * RETURN: Pointer to entry in repair table. NULL indicates not found. | 192 | * RETURN: Pointer to entry in repair table. NULL indicates not found. |
193 | * | 193 | * |
@@ -218,7 +218,7 @@ static const struct acpi_repair_info *acpi_ns_match_repairable_name(struct | |||
218 | * | 218 | * |
219 | * FUNCTION: acpi_ns_repair_ALR | 219 | * FUNCTION: acpi_ns_repair_ALR |
220 | * | 220 | * |
221 | * PARAMETERS: Data - Pointer to validation data structure | 221 | * PARAMETERS: data - Pointer to validation data structure |
222 | * return_object_ptr - Pointer to the object returned from the | 222 | * return_object_ptr - Pointer to the object returned from the |
223 | * evaluation of a method or object | 223 | * evaluation of a method or object |
224 | * | 224 | * |
@@ -247,7 +247,7 @@ acpi_ns_repair_ALR(struct acpi_predefined_data *data, | |||
247 | * | 247 | * |
248 | * FUNCTION: acpi_ns_repair_FDE | 248 | * FUNCTION: acpi_ns_repair_FDE |
249 | * | 249 | * |
250 | * PARAMETERS: Data - Pointer to validation data structure | 250 | * PARAMETERS: data - Pointer to validation data structure |
251 | * return_object_ptr - Pointer to the object returned from the | 251 | * return_object_ptr - Pointer to the object returned from the |
252 | * evaluation of a method or object | 252 | * evaluation of a method or object |
253 | * | 253 | * |
@@ -335,7 +335,7 @@ acpi_ns_repair_FDE(struct acpi_predefined_data *data, | |||
335 | * | 335 | * |
336 | * FUNCTION: acpi_ns_repair_CID | 336 | * FUNCTION: acpi_ns_repair_CID |
337 | * | 337 | * |
338 | * PARAMETERS: Data - Pointer to validation data structure | 338 | * PARAMETERS: data - Pointer to validation data structure |
339 | * return_object_ptr - Pointer to the object returned from the | 339 | * return_object_ptr - Pointer to the object returned from the |
340 | * evaluation of a method or object | 340 | * evaluation of a method or object |
341 | * | 341 | * |
@@ -405,7 +405,7 @@ acpi_ns_repair_CID(struct acpi_predefined_data *data, | |||
405 | * | 405 | * |
406 | * FUNCTION: acpi_ns_repair_HID | 406 | * FUNCTION: acpi_ns_repair_HID |
407 | * | 407 | * |
408 | * PARAMETERS: Data - Pointer to validation data structure | 408 | * PARAMETERS: data - Pointer to validation data structure |
409 | * return_object_ptr - Pointer to the object returned from the | 409 | * return_object_ptr - Pointer to the object returned from the |
410 | * evaluation of a method or object | 410 | * evaluation of a method or object |
411 | * | 411 | * |
@@ -487,7 +487,7 @@ acpi_ns_repair_HID(struct acpi_predefined_data *data, | |||
487 | * | 487 | * |
488 | * FUNCTION: acpi_ns_repair_TSS | 488 | * FUNCTION: acpi_ns_repair_TSS |
489 | * | 489 | * |
490 | * PARAMETERS: Data - Pointer to validation data structure | 490 | * PARAMETERS: data - Pointer to validation data structure |
491 | * return_object_ptr - Pointer to the object returned from the | 491 | * return_object_ptr - Pointer to the object returned from the |
492 | * evaluation of a method or object | 492 | * evaluation of a method or object |
493 | * | 493 | * |
@@ -531,7 +531,7 @@ acpi_ns_repair_TSS(struct acpi_predefined_data *data, | |||
531 | * | 531 | * |
532 | * FUNCTION: acpi_ns_repair_PSS | 532 | * FUNCTION: acpi_ns_repair_PSS |
533 | * | 533 | * |
534 | * PARAMETERS: Data - Pointer to validation data structure | 534 | * PARAMETERS: data - Pointer to validation data structure |
535 | * return_object_ptr - Pointer to the object returned from the | 535 | * return_object_ptr - Pointer to the object returned from the |
536 | * evaluation of a method or object | 536 | * evaluation of a method or object |
537 | * | 537 | * |
@@ -600,7 +600,7 @@ acpi_ns_repair_PSS(struct acpi_predefined_data *data, | |||
600 | * | 600 | * |
601 | * FUNCTION: acpi_ns_check_sorted_list | 601 | * FUNCTION: acpi_ns_check_sorted_list |
602 | * | 602 | * |
603 | * PARAMETERS: Data - Pointer to validation data structure | 603 | * PARAMETERS: data - Pointer to validation data structure |
604 | * return_object - Pointer to the top-level returned object | 604 | * return_object - Pointer to the top-level returned object |
605 | * expected_count - Minimum length of each sub-package | 605 | * expected_count - Minimum length of each sub-package |
606 | * sort_index - Sub-package entry to sort on | 606 | * sort_index - Sub-package entry to sort on |
@@ -707,9 +707,9 @@ acpi_ns_check_sorted_list(struct acpi_predefined_data *data, | |||
707 | * | 707 | * |
708 | * FUNCTION: acpi_ns_sort_list | 708 | * FUNCTION: acpi_ns_sort_list |
709 | * | 709 | * |
710 | * PARAMETERS: Elements - Package object element list | 710 | * PARAMETERS: elements - Package object element list |
711 | * Count - Element count for above | 711 | * count - Element count for above |
712 | * Index - Sort by which package element | 712 | * index - Sort by which package element |
713 | * sort_direction - Ascending or Descending sort | 713 | * sort_direction - Ascending or Descending sort |
714 | * | 714 | * |
715 | * RETURN: None | 715 | * RETURN: None |
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c index 507043d66114..456cc859f869 100644 --- a/drivers/acpi/acpica/nssearch.c +++ b/drivers/acpi/acpica/nssearch.c | |||
@@ -65,7 +65,7 @@ acpi_ns_search_parent_tree(u32 target_name, | |||
65 | * | 65 | * |
66 | * PARAMETERS: target_name - Ascii ACPI name to search for | 66 | * PARAMETERS: target_name - Ascii ACPI name to search for |
67 | * parent_node - Starting node where search will begin | 67 | * parent_node - Starting node where search will begin |
68 | * Type - Object type to match | 68 | * type - Object type to match |
69 | * return_node - Where the matched Named obj is returned | 69 | * return_node - Where the matched Named obj is returned |
70 | * | 70 | * |
71 | * RETURN: Status | 71 | * RETURN: Status |
@@ -175,8 +175,8 @@ acpi_ns_search_one_scope(u32 target_name, | |||
175 | * FUNCTION: acpi_ns_search_parent_tree | 175 | * FUNCTION: acpi_ns_search_parent_tree |
176 | * | 176 | * |
177 | * PARAMETERS: target_name - Ascii ACPI name to search for | 177 | * PARAMETERS: target_name - Ascii ACPI name to search for |
178 | * Node - Starting node where search will begin | 178 | * node - Starting node where search will begin |
179 | * Type - Object type to match | 179 | * type - Object type to match |
180 | * return_node - Where the matched Node is returned | 180 | * return_node - Where the matched Node is returned |
181 | * | 181 | * |
182 | * RETURN: Status | 182 | * RETURN: Status |
@@ -264,11 +264,11 @@ acpi_ns_search_parent_tree(u32 target_name, | |||
264 | * | 264 | * |
265 | * PARAMETERS: target_name - Ascii ACPI name to search for (4 chars) | 265 | * PARAMETERS: target_name - Ascii ACPI name to search for (4 chars) |
266 | * walk_state - Current state of the walk | 266 | * walk_state - Current state of the walk |
267 | * Node - Starting node where search will begin | 267 | * node - Starting node where search will begin |
268 | * interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x. | 268 | * interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x. |
269 | * Otherwise,search only. | 269 | * Otherwise,search only. |
270 | * Type - Object type to match | 270 | * type - Object type to match |
271 | * Flags - Flags describing the search restrictions | 271 | * flags - Flags describing the search restrictions |
272 | * return_node - Where the Node is returned | 272 | * return_node - Where the Node is returned |
273 | * | 273 | * |
274 | * RETURN: Status | 274 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c index 75113759f69d..ef753a41e087 100644 --- a/drivers/acpi/acpica/nsutils.c +++ b/drivers/acpi/acpica/nsutils.c | |||
@@ -62,8 +62,8 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search); | |||
62 | * | 62 | * |
63 | * FUNCTION: acpi_ns_print_node_pathname | 63 | * FUNCTION: acpi_ns_print_node_pathname |
64 | * | 64 | * |
65 | * PARAMETERS: Node - Object | 65 | * PARAMETERS: node - Object |
66 | * Message - Prefix message | 66 | * message - Prefix message |
67 | * | 67 | * |
68 | * DESCRIPTION: Print an object's full namespace pathname | 68 | * DESCRIPTION: Print an object's full namespace pathname |
69 | * Manages allocation/freeing of a pathname buffer | 69 | * Manages allocation/freeing of a pathname buffer |
@@ -101,7 +101,7 @@ acpi_ns_print_node_pathname(struct acpi_namespace_node *node, | |||
101 | * | 101 | * |
102 | * FUNCTION: acpi_ns_valid_root_prefix | 102 | * FUNCTION: acpi_ns_valid_root_prefix |
103 | * | 103 | * |
104 | * PARAMETERS: Prefix - Character to be checked | 104 | * PARAMETERS: prefix - Character to be checked |
105 | * | 105 | * |
106 | * RETURN: TRUE if a valid prefix | 106 | * RETURN: TRUE if a valid prefix |
107 | * | 107 | * |
@@ -119,7 +119,7 @@ u8 acpi_ns_valid_root_prefix(char prefix) | |||
119 | * | 119 | * |
120 | * FUNCTION: acpi_ns_valid_path_separator | 120 | * FUNCTION: acpi_ns_valid_path_separator |
121 | * | 121 | * |
122 | * PARAMETERS: Sep - Character to be checked | 122 | * PARAMETERS: sep - Character to be checked |
123 | * | 123 | * |
124 | * RETURN: TRUE if a valid path separator | 124 | * RETURN: TRUE if a valid path separator |
125 | * | 125 | * |
@@ -137,7 +137,7 @@ static u8 acpi_ns_valid_path_separator(char sep) | |||
137 | * | 137 | * |
138 | * FUNCTION: acpi_ns_get_type | 138 | * FUNCTION: acpi_ns_get_type |
139 | * | 139 | * |
140 | * PARAMETERS: Node - Parent Node to be examined | 140 | * PARAMETERS: node - Parent Node to be examined |
141 | * | 141 | * |
142 | * RETURN: Type field from Node whose handle is passed | 142 | * RETURN: Type field from Node whose handle is passed |
143 | * | 143 | * |
@@ -161,7 +161,7 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node) | |||
161 | * | 161 | * |
162 | * FUNCTION: acpi_ns_local | 162 | * FUNCTION: acpi_ns_local |
163 | * | 163 | * |
164 | * PARAMETERS: Type - A namespace object type | 164 | * PARAMETERS: type - A namespace object type |
165 | * | 165 | * |
166 | * RETURN: LOCAL if names must be found locally in objects of the | 166 | * RETURN: LOCAL if names must be found locally in objects of the |
167 | * passed type, 0 if enclosing scopes should be searched | 167 | * passed type, 0 if enclosing scopes should be searched |
@@ -189,7 +189,7 @@ u32 acpi_ns_local(acpi_object_type type) | |||
189 | * | 189 | * |
190 | * FUNCTION: acpi_ns_get_internal_name_length | 190 | * FUNCTION: acpi_ns_get_internal_name_length |
191 | * | 191 | * |
192 | * PARAMETERS: Info - Info struct initialized with the | 192 | * PARAMETERS: info - Info struct initialized with the |
193 | * external name pointer. | 193 | * external name pointer. |
194 | * | 194 | * |
195 | * RETURN: None | 195 | * RETURN: None |
@@ -260,7 +260,7 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) | |||
260 | * | 260 | * |
261 | * FUNCTION: acpi_ns_build_internal_name | 261 | * FUNCTION: acpi_ns_build_internal_name |
262 | * | 262 | * |
263 | * PARAMETERS: Info - Info struct fully initialized | 263 | * PARAMETERS: info - Info struct fully initialized |
264 | * | 264 | * |
265 | * RETURN: Status | 265 | * RETURN: Status |
266 | * | 266 | * |
@@ -371,7 +371,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
371 | * FUNCTION: acpi_ns_internalize_name | 371 | * FUNCTION: acpi_ns_internalize_name |
372 | * | 372 | * |
373 | * PARAMETERS: *external_name - External representation of name | 373 | * PARAMETERS: *external_name - External representation of name |
374 | * **Converted Name - Where to return the resulting | 374 | * **Converted name - Where to return the resulting |
375 | * internal represention of the name | 375 | * internal represention of the name |
376 | * | 376 | * |
377 | * RETURN: Status | 377 | * RETURN: Status |
@@ -575,7 +575,7 @@ acpi_ns_externalize_name(u32 internal_name_length, | |||
575 | * | 575 | * |
576 | * FUNCTION: acpi_ns_validate_handle | 576 | * FUNCTION: acpi_ns_validate_handle |
577 | * | 577 | * |
578 | * PARAMETERS: Handle - Handle to be validated and typecast to a | 578 | * PARAMETERS: handle - Handle to be validated and typecast to a |
579 | * namespace node. | 579 | * namespace node. |
580 | * | 580 | * |
581 | * RETURN: A pointer to a namespace node | 581 | * RETURN: A pointer to a namespace node |
@@ -651,7 +651,7 @@ void acpi_ns_terminate(void) | |||
651 | * | 651 | * |
652 | * FUNCTION: acpi_ns_opens_scope | 652 | * FUNCTION: acpi_ns_opens_scope |
653 | * | 653 | * |
654 | * PARAMETERS: Type - A valid namespace type | 654 | * PARAMETERS: type - A valid namespace type |
655 | * | 655 | * |
656 | * RETURN: NEWSCOPE if the passed type "opens a name scope" according | 656 | * RETURN: NEWSCOPE if the passed type "opens a name scope" according |
657 | * to the ACPI specification, else 0 | 657 | * to the ACPI specification, else 0 |
@@ -677,14 +677,14 @@ u32 acpi_ns_opens_scope(acpi_object_type type) | |||
677 | * | 677 | * |
678 | * FUNCTION: acpi_ns_get_node | 678 | * FUNCTION: acpi_ns_get_node |
679 | * | 679 | * |
680 | * PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The | 680 | * PARAMETERS: *pathname - Name to be found, in external (ASL) format. The |
681 | * \ (backslash) and ^ (carat) prefixes, and the | 681 | * \ (backslash) and ^ (carat) prefixes, and the |
682 | * . (period) to separate segments are supported. | 682 | * . (period) to separate segments are supported. |
683 | * prefix_node - Root of subtree to be searched, or NS_ALL for the | 683 | * prefix_node - Root of subtree to be searched, or NS_ALL for the |
684 | * root of the name space. If Name is fully | 684 | * root of the name space. If Name is fully |
685 | * qualified (first s8 is '\'), the passed value | 685 | * qualified (first s8 is '\'), the passed value |
686 | * of Scope will not be accessed. | 686 | * of Scope will not be accessed. |
687 | * Flags - Used to indicate whether to perform upsearch or | 687 | * flags - Used to indicate whether to perform upsearch or |
688 | * not. | 688 | * not. |
689 | * return_node - Where the Node is returned | 689 | * return_node - Where the Node is returned |
690 | * | 690 | * |
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c index f69895a54895..730bccc5e7f7 100644 --- a/drivers/acpi/acpica/nswalk.c +++ b/drivers/acpi/acpica/nswalk.c | |||
@@ -88,7 +88,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node | |||
88 | * | 88 | * |
89 | * FUNCTION: acpi_ns_get_next_node_typed | 89 | * FUNCTION: acpi_ns_get_next_node_typed |
90 | * | 90 | * |
91 | * PARAMETERS: Type - Type of node to be searched for | 91 | * PARAMETERS: type - Type of node to be searched for |
92 | * parent_node - Parent node whose children we are | 92 | * parent_node - Parent node whose children we are |
93 | * getting | 93 | * getting |
94 | * child_node - Previous child that was found. | 94 | * child_node - Previous child that was found. |
@@ -151,16 +151,16 @@ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, | |||
151 | * | 151 | * |
152 | * FUNCTION: acpi_ns_walk_namespace | 152 | * FUNCTION: acpi_ns_walk_namespace |
153 | * | 153 | * |
154 | * PARAMETERS: Type - acpi_object_type to search for | 154 | * PARAMETERS: type - acpi_object_type to search for |
155 | * start_node - Handle in namespace where search begins | 155 | * start_node - Handle in namespace where search begins |
156 | * max_depth - Depth to which search is to reach | 156 | * max_depth - Depth to which search is to reach |
157 | * Flags - Whether to unlock the NS before invoking | 157 | * flags - Whether to unlock the NS before invoking |
158 | * the callback routine | 158 | * the callback routine |
159 | * pre_order_visit - Called during tree pre-order visit | 159 | * pre_order_visit - Called during tree pre-order visit |
160 | * when an object of "Type" is found | 160 | * when an object of "Type" is found |
161 | * post_order_visit - Called during tree post-order visit | 161 | * post_order_visit - Called during tree post-order visit |
162 | * when an object of "Type" is found | 162 | * when an object of "Type" is found |
163 | * Context - Passed to user function(s) above | 163 | * context - Passed to user function(s) above |
164 | * return_value - from the user_function if terminated | 164 | * return_value - from the user_function if terminated |
165 | * early. Otherwise, returns NULL. | 165 | * early. Otherwise, returns NULL. |
166 | * RETURNS: Status | 166 | * RETURNS: Status |
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c index 71d15f61807b..9692e6702333 100644 --- a/drivers/acpi/acpica/nsxfeval.c +++ b/drivers/acpi/acpica/nsxfeval.c | |||
@@ -58,8 +58,8 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info); | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_evaluate_object_typed | 59 | * FUNCTION: acpi_evaluate_object_typed |
60 | * | 60 | * |
61 | * PARAMETERS: Handle - Object handle (optional) | 61 | * PARAMETERS: handle - Object handle (optional) |
62 | * Pathname - Object pathname (optional) | 62 | * pathname - Object pathname (optional) |
63 | * external_params - List of parameters to pass to method, | 63 | * external_params - List of parameters to pass to method, |
64 | * terminated by NULL. May be NULL | 64 | * terminated by NULL. May be NULL |
65 | * if no parameters are being passed. | 65 | * if no parameters are being passed. |
@@ -152,8 +152,8 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed) | |||
152 | * | 152 | * |
153 | * FUNCTION: acpi_evaluate_object | 153 | * FUNCTION: acpi_evaluate_object |
154 | * | 154 | * |
155 | * PARAMETERS: Handle - Object handle (optional) | 155 | * PARAMETERS: handle - Object handle (optional) |
156 | * Pathname - Object pathname (optional) | 156 | * pathname - Object pathname (optional) |
157 | * external_params - List of parameters to pass to method, | 157 | * external_params - List of parameters to pass to method, |
158 | * terminated by NULL. May be NULL | 158 | * terminated by NULL. May be NULL |
159 | * if no parameters are being passed. | 159 | * if no parameters are being passed. |
@@ -364,7 +364,7 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object) | |||
364 | * | 364 | * |
365 | * FUNCTION: acpi_ns_resolve_references | 365 | * FUNCTION: acpi_ns_resolve_references |
366 | * | 366 | * |
367 | * PARAMETERS: Info - Evaluation info block | 367 | * PARAMETERS: info - Evaluation info block |
368 | * | 368 | * |
369 | * RETURN: Info->return_object is replaced with the dereferenced object | 369 | * RETURN: Info->return_object is replaced with the dereferenced object |
370 | * | 370 | * |
@@ -431,14 +431,14 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info) | |||
431 | * | 431 | * |
432 | * FUNCTION: acpi_walk_namespace | 432 | * FUNCTION: acpi_walk_namespace |
433 | * | 433 | * |
434 | * PARAMETERS: Type - acpi_object_type to search for | 434 | * PARAMETERS: type - acpi_object_type to search for |
435 | * start_object - Handle in namespace where search begins | 435 | * start_object - Handle in namespace where search begins |
436 | * max_depth - Depth to which search is to reach | 436 | * max_depth - Depth to which search is to reach |
437 | * pre_order_visit - Called during tree pre-order visit | 437 | * pre_order_visit - Called during tree pre-order visit |
438 | * when an object of "Type" is found | 438 | * when an object of "Type" is found |
439 | * post_order_visit - Called during tree post-order visit | 439 | * post_order_visit - Called during tree post-order visit |
440 | * when an object of "Type" is found | 440 | * when an object of "Type" is found |
441 | * Context - Passed to user function(s) above | 441 | * context - Passed to user function(s) above |
442 | * return_value - Location where return value of | 442 | * return_value - Location where return value of |
443 | * user_function is put if terminated early | 443 | * user_function is put if terminated early |
444 | * | 444 | * |
@@ -646,7 +646,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, | |||
646 | * | 646 | * |
647 | * PARAMETERS: HID - HID to search for. Can be NULL. | 647 | * PARAMETERS: HID - HID to search for. Can be NULL. |
648 | * user_function - Called when a matching object is found | 648 | * user_function - Called when a matching object is found |
649 | * Context - Passed to user function | 649 | * context - Passed to user function |
650 | * return_value - Location where return value of | 650 | * return_value - Location where return value of |
651 | * user_function is put if terminated early | 651 | * user_function is put if terminated early |
652 | * | 652 | * |
@@ -716,8 +716,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_devices) | |||
716 | * FUNCTION: acpi_attach_data | 716 | * FUNCTION: acpi_attach_data |
717 | * | 717 | * |
718 | * PARAMETERS: obj_handle - Namespace node | 718 | * PARAMETERS: obj_handle - Namespace node |
719 | * Handler - Handler for this attachment | 719 | * handler - Handler for this attachment |
720 | * Data - Pointer to data to be attached | 720 | * data - Pointer to data to be attached |
721 | * | 721 | * |
722 | * RETURN: Status | 722 | * RETURN: Status |
723 | * | 723 | * |
@@ -764,7 +764,7 @@ ACPI_EXPORT_SYMBOL(acpi_attach_data) | |||
764 | * FUNCTION: acpi_detach_data | 764 | * FUNCTION: acpi_detach_data |
765 | * | 765 | * |
766 | * PARAMETERS: obj_handle - Namespace node handle | 766 | * PARAMETERS: obj_handle - Namespace node handle |
767 | * Handler - Handler used in call to acpi_attach_data | 767 | * handler - Handler used in call to acpi_attach_data |
768 | * | 768 | * |
769 | * RETURN: Status | 769 | * RETURN: Status |
770 | * | 770 | * |
@@ -810,8 +810,8 @@ ACPI_EXPORT_SYMBOL(acpi_detach_data) | |||
810 | * FUNCTION: acpi_get_data | 810 | * FUNCTION: acpi_get_data |
811 | * | 811 | * |
812 | * PARAMETERS: obj_handle - Namespace node | 812 | * PARAMETERS: obj_handle - Namespace node |
813 | * Handler - Handler used in call to attach_data | 813 | * handler - Handler used in call to attach_data |
814 | * Data - Where the data is returned | 814 | * data - Where the data is returned |
815 | * | 815 | * |
816 | * RETURN: Status | 816 | * RETURN: Status |
817 | * | 817 | * |
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c index af401c9c4dfc..08e9610b34ca 100644 --- a/drivers/acpi/acpica/nsxfname.c +++ b/drivers/acpi/acpica/nsxfname.c | |||
@@ -61,8 +61,8 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, | |||
61 | * | 61 | * |
62 | * FUNCTION: acpi_get_handle | 62 | * FUNCTION: acpi_get_handle |
63 | * | 63 | * |
64 | * PARAMETERS: Parent - Object to search under (search scope). | 64 | * PARAMETERS: parent - Object to search under (search scope). |
65 | * Pathname - Pointer to an asciiz string containing the | 65 | * pathname - Pointer to an asciiz string containing the |
66 | * name | 66 | * name |
67 | * ret_handle - Where the return handle is returned | 67 | * ret_handle - Where the return handle is returned |
68 | * | 68 | * |
@@ -142,9 +142,9 @@ ACPI_EXPORT_SYMBOL(acpi_get_handle) | |||
142 | * | 142 | * |
143 | * FUNCTION: acpi_get_name | 143 | * FUNCTION: acpi_get_name |
144 | * | 144 | * |
145 | * PARAMETERS: Handle - Handle to be converted to a pathname | 145 | * PARAMETERS: handle - Handle to be converted to a pathname |
146 | * name_type - Full pathname or single segment | 146 | * name_type - Full pathname or single segment |
147 | * Buffer - Buffer for returned path | 147 | * buffer - Buffer for returned path |
148 | * | 148 | * |
149 | * RETURN: Pointer to a string containing the fully qualified Name. | 149 | * RETURN: Pointer to a string containing the fully qualified Name. |
150 | * | 150 | * |
@@ -219,8 +219,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_name) | |||
219 | * | 219 | * |
220 | * FUNCTION: acpi_ns_copy_device_id | 220 | * FUNCTION: acpi_ns_copy_device_id |
221 | * | 221 | * |
222 | * PARAMETERS: Dest - Pointer to the destination DEVICE_ID | 222 | * PARAMETERS: dest - Pointer to the destination DEVICE_ID |
223 | * Source - Pointer to the source DEVICE_ID | 223 | * source - Pointer to the source DEVICE_ID |
224 | * string_area - Pointer to where to copy the dest string | 224 | * string_area - Pointer to where to copy the dest string |
225 | * | 225 | * |
226 | * RETURN: Pointer to the next string area | 226 | * RETURN: Pointer to the next string area |
@@ -247,7 +247,7 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, | |||
247 | * | 247 | * |
248 | * FUNCTION: acpi_get_object_info | 248 | * FUNCTION: acpi_get_object_info |
249 | * | 249 | * |
250 | * PARAMETERS: Handle - Object Handle | 250 | * PARAMETERS: handle - Object Handle |
251 | * return_buffer - Where the info is returned | 251 | * return_buffer - Where the info is returned |
252 | * | 252 | * |
253 | * RETURN: Status | 253 | * RETURN: Status |
@@ -493,7 +493,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_object_info) | |||
493 | * | 493 | * |
494 | * FUNCTION: acpi_install_method | 494 | * FUNCTION: acpi_install_method |
495 | * | 495 | * |
496 | * PARAMETERS: Buffer - An ACPI table containing one control method | 496 | * PARAMETERS: buffer - An ACPI table containing one control method |
497 | * | 497 | * |
498 | * RETURN: Status | 498 | * RETURN: Status |
499 | * | 499 | * |
diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c index 880a605cee20..6766fc4f088f 100644 --- a/drivers/acpi/acpica/nsxfobj.c +++ b/drivers/acpi/acpica/nsxfobj.c | |||
@@ -98,7 +98,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_id) | |||
98 | * | 98 | * |
99 | * FUNCTION: acpi_get_type | 99 | * FUNCTION: acpi_get_type |
100 | * | 100 | * |
101 | * PARAMETERS: Handle - Handle of object whose type is desired | 101 | * PARAMETERS: handle - Handle of object whose type is desired |
102 | * ret_type - Where the type will be placed | 102 | * ret_type - Where the type will be placed |
103 | * | 103 | * |
104 | * RETURN: Status | 104 | * RETURN: Status |
@@ -151,7 +151,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_type) | |||
151 | * | 151 | * |
152 | * FUNCTION: acpi_get_parent | 152 | * FUNCTION: acpi_get_parent |
153 | * | 153 | * |
154 | * PARAMETERS: Handle - Handle of object whose parent is desired | 154 | * PARAMETERS: handle - Handle of object whose parent is desired |
155 | * ret_handle - Where the parent handle will be placed | 155 | * ret_handle - Where the parent handle will be placed |
156 | * | 156 | * |
157 | * RETURN: Status | 157 | * RETURN: Status |
@@ -212,8 +212,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_parent) | |||
212 | * | 212 | * |
213 | * FUNCTION: acpi_get_next_object | 213 | * FUNCTION: acpi_get_next_object |
214 | * | 214 | * |
215 | * PARAMETERS: Type - Type of object to be searched for | 215 | * PARAMETERS: type - Type of object to be searched for |
216 | * Parent - Parent object whose children we are getting | 216 | * parent - Parent object whose children we are getting |
217 | * last_child - Previous child that was found. | 217 | * last_child - Previous child that was found. |
218 | * The NEXT child will be returned | 218 | * The NEXT child will be returned |
219 | * ret_handle - Where handle to the next object is placed | 219 | * ret_handle - Where handle to the next object is placed |
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c index 5ac36aba507c..844464c4f901 100644 --- a/drivers/acpi/acpica/psargs.c +++ b/drivers/acpi/acpica/psargs.c | |||
@@ -210,7 +210,7 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state) | |||
210 | * FUNCTION: acpi_ps_get_next_namepath | 210 | * FUNCTION: acpi_ps_get_next_namepath |
211 | * | 211 | * |
212 | * PARAMETERS: parser_state - Current parser state object | 212 | * PARAMETERS: parser_state - Current parser state object |
213 | * Arg - Where the namepath will be stored | 213 | * arg - Where the namepath will be stored |
214 | * arg_count - If the namepath points to a control method | 214 | * arg_count - If the namepath points to a control method |
215 | * the method's argument is returned here. | 215 | * the method's argument is returned here. |
216 | * possible_method_call - Whether the namepath can possibly be the | 216 | * possible_method_call - Whether the namepath can possibly be the |
@@ -379,7 +379,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, | |||
379 | * | 379 | * |
380 | * PARAMETERS: parser_state - Current parser state object | 380 | * PARAMETERS: parser_state - Current parser state object |
381 | * arg_type - The argument type (AML_*_ARG) | 381 | * arg_type - The argument type (AML_*_ARG) |
382 | * Arg - Where the argument is returned | 382 | * arg - Where the argument is returned |
383 | * | 383 | * |
384 | * RETURN: None | 384 | * RETURN: None |
385 | * | 385 | * |
@@ -618,6 +618,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state | |||
618 | 618 | ||
619 | arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); | 619 | arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); |
620 | if (!arg) { | 620 | if (!arg) { |
621 | acpi_ps_free_op(field); | ||
621 | return_PTR(NULL); | 622 | return_PTR(NULL); |
622 | } | 623 | } |
623 | 624 | ||
@@ -662,6 +663,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state | |||
662 | } else { | 663 | } else { |
663 | arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); | 664 | arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); |
664 | if (!arg) { | 665 | if (!arg) { |
666 | acpi_ps_free_op(field); | ||
665 | return_PTR(NULL); | 667 | return_PTR(NULL); |
666 | } | 668 | } |
667 | 669 | ||
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c index 9547ad8a620b..799162c1b6df 100644 --- a/drivers/acpi/acpica/psloop.c +++ b/drivers/acpi/acpica/psloop.c | |||
@@ -167,7 +167,7 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state) | |||
167 | * PARAMETERS: walk_state - Current state | 167 | * PARAMETERS: walk_state - Current state |
168 | * aml_op_start - Begin of named Op in AML | 168 | * aml_op_start - Begin of named Op in AML |
169 | * unnamed_op - Early Op (not a named Op) | 169 | * unnamed_op - Early Op (not a named Op) |
170 | * Op - Returned Op | 170 | * op - Returned Op |
171 | * | 171 | * |
172 | * RETURN: Status | 172 | * RETURN: Status |
173 | * | 173 | * |
@@ -323,7 +323,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, | |||
323 | 323 | ||
324 | if (walk_state->op_info->flags & AML_CREATE) { | 324 | if (walk_state->op_info->flags & AML_CREATE) { |
325 | /* | 325 | /* |
326 | * Backup to beginning of create_xXXfield declaration | 326 | * Backup to beginning of create_XXXfield declaration |
327 | * body_length is unknown until we parse the body | 327 | * body_length is unknown until we parse the body |
328 | */ | 328 | */ |
329 | op->named.data = aml_op_start; | 329 | op->named.data = aml_op_start; |
@@ -380,7 +380,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state, | |||
380 | * | 380 | * |
381 | * PARAMETERS: walk_state - Current state | 381 | * PARAMETERS: walk_state - Current state |
382 | * aml_op_start - Op start in AML | 382 | * aml_op_start - Op start in AML |
383 | * Op - Current Op | 383 | * op - Current Op |
384 | * | 384 | * |
385 | * RETURN: Status | 385 | * RETURN: Status |
386 | * | 386 | * |
@@ -679,8 +679,8 @@ acpi_ps_link_module_code(union acpi_parse_object *parent_op, | |||
679 | * FUNCTION: acpi_ps_complete_op | 679 | * FUNCTION: acpi_ps_complete_op |
680 | * | 680 | * |
681 | * PARAMETERS: walk_state - Current state | 681 | * PARAMETERS: walk_state - Current state |
682 | * Op - Returned Op | 682 | * op - Returned Op |
683 | * Status - Parse status before complete Op | 683 | * status - Parse status before complete Op |
684 | * | 684 | * |
685 | * RETURN: Status | 685 | * RETURN: Status |
686 | * | 686 | * |
@@ -853,8 +853,8 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state, | |||
853 | * FUNCTION: acpi_ps_complete_final_op | 853 | * FUNCTION: acpi_ps_complete_final_op |
854 | * | 854 | * |
855 | * PARAMETERS: walk_state - Current state | 855 | * PARAMETERS: walk_state - Current state |
856 | * Op - Current Op | 856 | * op - Current Op |
857 | * Status - Current parse status before complete last | 857 | * status - Current parse status before complete last |
858 | * Op | 858 | * Op |
859 | * | 859 | * |
860 | * RETURN: Status | 860 | * RETURN: Status |
@@ -1165,7 +1165,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) | |||
1165 | 1165 | ||
1166 | if (walk_state->op_info->flags & AML_CREATE) { | 1166 | if (walk_state->op_info->flags & AML_CREATE) { |
1167 | /* | 1167 | /* |
1168 | * Backup to beginning of create_xXXfield declaration (1 for | 1168 | * Backup to beginning of create_XXXfield declaration (1 for |
1169 | * Opcode) | 1169 | * Opcode) |
1170 | * | 1170 | * |
1171 | * body_length is unknown until we parse the body | 1171 | * body_length is unknown until we parse the body |
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c index a0226fdcf75c..ed1d457bd5ca 100644 --- a/drivers/acpi/acpica/psopcode.c +++ b/drivers/acpi/acpica/psopcode.c | |||
@@ -724,7 +724,7 @@ static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = { | |||
724 | * | 724 | * |
725 | * FUNCTION: acpi_ps_get_opcode_info | 725 | * FUNCTION: acpi_ps_get_opcode_info |
726 | * | 726 | * |
727 | * PARAMETERS: Opcode - The AML opcode | 727 | * PARAMETERS: opcode - The AML opcode |
728 | * | 728 | * |
729 | * RETURN: A pointer to the info about the opcode. | 729 | * RETURN: A pointer to the info about the opcode. |
730 | * | 730 | * |
@@ -769,7 +769,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode) | |||
769 | * | 769 | * |
770 | * FUNCTION: acpi_ps_get_opcode_name | 770 | * FUNCTION: acpi_ps_get_opcode_name |
771 | * | 771 | * |
772 | * PARAMETERS: Opcode - The AML opcode | 772 | * PARAMETERS: opcode - The AML opcode |
773 | * | 773 | * |
774 | * RETURN: A pointer to the name of the opcode (ASCII String) | 774 | * RETURN: A pointer to the name of the opcode (ASCII String) |
775 | * Note: Never returns NULL. | 775 | * Note: Never returns NULL. |
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index 2ff9c35a1968..01985703bb98 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c | |||
@@ -64,7 +64,7 @@ ACPI_MODULE_NAME("psparse") | |||
64 | * | 64 | * |
65 | * FUNCTION: acpi_ps_get_opcode_size | 65 | * FUNCTION: acpi_ps_get_opcode_size |
66 | * | 66 | * |
67 | * PARAMETERS: Opcode - An AML opcode | 67 | * PARAMETERS: opcode - An AML opcode |
68 | * | 68 | * |
69 | * RETURN: Size of the opcode, in bytes (1 or 2) | 69 | * RETURN: Size of the opcode, in bytes (1 or 2) |
70 | * | 70 | * |
@@ -121,7 +121,7 @@ u16 acpi_ps_peek_opcode(struct acpi_parse_state * parser_state) | |||
121 | * FUNCTION: acpi_ps_complete_this_op | 121 | * FUNCTION: acpi_ps_complete_this_op |
122 | * | 122 | * |
123 | * PARAMETERS: walk_state - Current State | 123 | * PARAMETERS: walk_state - Current State |
124 | * Op - Op to complete | 124 | * op - Op to complete |
125 | * | 125 | * |
126 | * RETURN: Status | 126 | * RETURN: Status |
127 | * | 127 | * |
@@ -311,7 +311,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, | |||
311 | * FUNCTION: acpi_ps_next_parse_state | 311 | * FUNCTION: acpi_ps_next_parse_state |
312 | * | 312 | * |
313 | * PARAMETERS: walk_state - Current state | 313 | * PARAMETERS: walk_state - Current state |
314 | * Op - Current parse op | 314 | * op - Current parse op |
315 | * callback_status - Status from previous operation | 315 | * callback_status - Status from previous operation |
316 | * | 316 | * |
317 | * RETURN: Status | 317 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/psscope.c b/drivers/acpi/acpica/psscope.c index c872aa4b926e..608dc20dc173 100644 --- a/drivers/acpi/acpica/psscope.c +++ b/drivers/acpi/acpica/psscope.c | |||
@@ -93,7 +93,7 @@ u8 acpi_ps_has_completed_scope(struct acpi_parse_state * parser_state) | |||
93 | * FUNCTION: acpi_ps_init_scope | 93 | * FUNCTION: acpi_ps_init_scope |
94 | * | 94 | * |
95 | * PARAMETERS: parser_state - Current parser state object | 95 | * PARAMETERS: parser_state - Current parser state object |
96 | * Root - the Root Node of this new scope | 96 | * root - the Root Node of this new scope |
97 | * | 97 | * |
98 | * RETURN: Status | 98 | * RETURN: Status |
99 | * | 99 | * |
@@ -131,7 +131,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state, | |||
131 | * FUNCTION: acpi_ps_push_scope | 131 | * FUNCTION: acpi_ps_push_scope |
132 | * | 132 | * |
133 | * PARAMETERS: parser_state - Current parser state object | 133 | * PARAMETERS: parser_state - Current parser state object |
134 | * Op - Current op to be pushed | 134 | * op - Current op to be pushed |
135 | * remaining_args - List of args remaining | 135 | * remaining_args - List of args remaining |
136 | * arg_count - Fixed or variable number of args | 136 | * arg_count - Fixed or variable number of args |
137 | * | 137 | * |
@@ -184,7 +184,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state, | |||
184 | * FUNCTION: acpi_ps_pop_scope | 184 | * FUNCTION: acpi_ps_pop_scope |
185 | * | 185 | * |
186 | * PARAMETERS: parser_state - Current parser state object | 186 | * PARAMETERS: parser_state - Current parser state object |
187 | * Op - Where the popped op is returned | 187 | * op - Where the popped op is returned |
188 | * arg_list - Where the popped "next argument" is | 188 | * arg_list - Where the popped "next argument" is |
189 | * returned | 189 | * returned |
190 | * arg_count - Count of objects in arg_list | 190 | * arg_count - Count of objects in arg_list |
diff --git a/drivers/acpi/acpica/pstree.c b/drivers/acpi/acpica/pstree.c index 2b03cdbbe1c0..fdb2e71f3046 100644 --- a/drivers/acpi/acpica/pstree.c +++ b/drivers/acpi/acpica/pstree.c | |||
@@ -58,8 +58,8 @@ union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op); | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_ps_get_arg | 59 | * FUNCTION: acpi_ps_get_arg |
60 | * | 60 | * |
61 | * PARAMETERS: Op - Get an argument for this op | 61 | * PARAMETERS: op - Get an argument for this op |
62 | * Argn - Nth argument to get | 62 | * argn - Nth argument to get |
63 | * | 63 | * |
64 | * RETURN: The argument (as an Op object). NULL if argument does not exist | 64 | * RETURN: The argument (as an Op object). NULL if argument does not exist |
65 | * | 65 | * |
@@ -114,8 +114,8 @@ union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn) | |||
114 | * | 114 | * |
115 | * FUNCTION: acpi_ps_append_arg | 115 | * FUNCTION: acpi_ps_append_arg |
116 | * | 116 | * |
117 | * PARAMETERS: Op - Append an argument to this Op. | 117 | * PARAMETERS: op - Append an argument to this Op. |
118 | * Arg - Argument Op to append | 118 | * arg - Argument Op to append |
119 | * | 119 | * |
120 | * RETURN: None. | 120 | * RETURN: None. |
121 | * | 121 | * |
@@ -188,8 +188,8 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg) | |||
188 | * | 188 | * |
189 | * FUNCTION: acpi_ps_get_depth_next | 189 | * FUNCTION: acpi_ps_get_depth_next |
190 | * | 190 | * |
191 | * PARAMETERS: Origin - Root of subtree to search | 191 | * PARAMETERS: origin - Root of subtree to search |
192 | * Op - Last (previous) Op that was found | 192 | * op - Last (previous) Op that was found |
193 | * | 193 | * |
194 | * RETURN: Next Op found in the search. | 194 | * RETURN: Next Op found in the search. |
195 | * | 195 | * |
@@ -261,7 +261,7 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, | |||
261 | * | 261 | * |
262 | * FUNCTION: acpi_ps_get_child | 262 | * FUNCTION: acpi_ps_get_child |
263 | * | 263 | * |
264 | * PARAMETERS: Op - Get the child of this Op | 264 | * PARAMETERS: op - Get the child of this Op |
265 | * | 265 | * |
266 | * RETURN: Child Op, Null if none is found. | 266 | * RETURN: Child Op, Null if none is found. |
267 | * | 267 | * |
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c index 13bb131ae125..8736ad5f04d3 100644 --- a/drivers/acpi/acpica/psutils.c +++ b/drivers/acpi/acpica/psutils.c | |||
@@ -77,8 +77,8 @@ union acpi_parse_object *acpi_ps_create_scope_op(void) | |||
77 | * | 77 | * |
78 | * FUNCTION: acpi_ps_init_op | 78 | * FUNCTION: acpi_ps_init_op |
79 | * | 79 | * |
80 | * PARAMETERS: Op - A newly allocated Op object | 80 | * PARAMETERS: op - A newly allocated Op object |
81 | * Opcode - Opcode to store in the Op | 81 | * opcode - Opcode to store in the Op |
82 | * | 82 | * |
83 | * RETURN: None | 83 | * RETURN: None |
84 | * | 84 | * |
@@ -103,7 +103,7 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode) | |||
103 | * | 103 | * |
104 | * FUNCTION: acpi_ps_alloc_op | 104 | * FUNCTION: acpi_ps_alloc_op |
105 | * | 105 | * |
106 | * PARAMETERS: Opcode - Opcode that will be stored in the new Op | 106 | * PARAMETERS: opcode - Opcode that will be stored in the new Op |
107 | * | 107 | * |
108 | * RETURN: Pointer to the new Op, null on failure | 108 | * RETURN: Pointer to the new Op, null on failure |
109 | * | 109 | * |
@@ -160,7 +160,7 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode) | |||
160 | * | 160 | * |
161 | * FUNCTION: acpi_ps_free_op | 161 | * FUNCTION: acpi_ps_free_op |
162 | * | 162 | * |
163 | * PARAMETERS: Op - Op to be freed | 163 | * PARAMETERS: op - Op to be freed |
164 | * | 164 | * |
165 | * RETURN: None. | 165 | * RETURN: None. |
166 | * | 166 | * |
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c index 9d98c5ff66a5..963e16225797 100644 --- a/drivers/acpi/acpica/psxface.c +++ b/drivers/acpi/acpica/psxface.c | |||
@@ -66,7 +66,7 @@ acpi_ps_update_parameter_list(struct acpi_evaluate_info *info, u16 action); | |||
66 | * PARAMETERS: method_name - Valid ACPI name string | 66 | * PARAMETERS: method_name - Valid ACPI name string |
67 | * debug_level - Optional level mask. 0 to use default | 67 | * debug_level - Optional level mask. 0 to use default |
68 | * debug_layer - Optional layer mask. 0 to use default | 68 | * debug_layer - Optional layer mask. 0 to use default |
69 | * Flags - bit 1: one shot(1) or persistent(0) | 69 | * flags - bit 1: one shot(1) or persistent(0) |
70 | * | 70 | * |
71 | * RETURN: Status | 71 | * RETURN: Status |
72 | * | 72 | * |
@@ -105,7 +105,7 @@ acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags) | |||
105 | * | 105 | * |
106 | * FUNCTION: acpi_ps_start_trace | 106 | * FUNCTION: acpi_ps_start_trace |
107 | * | 107 | * |
108 | * PARAMETERS: Info - Method info struct | 108 | * PARAMETERS: info - Method info struct |
109 | * | 109 | * |
110 | * RETURN: None | 110 | * RETURN: None |
111 | * | 111 | * |
@@ -150,7 +150,7 @@ static void acpi_ps_start_trace(struct acpi_evaluate_info *info) | |||
150 | * | 150 | * |
151 | * FUNCTION: acpi_ps_stop_trace | 151 | * FUNCTION: acpi_ps_stop_trace |
152 | * | 152 | * |
153 | * PARAMETERS: Info - Method info struct | 153 | * PARAMETERS: info - Method info struct |
154 | * | 154 | * |
155 | * RETURN: None | 155 | * RETURN: None |
156 | * | 156 | * |
@@ -193,10 +193,10 @@ static void acpi_ps_stop_trace(struct acpi_evaluate_info *info) | |||
193 | * | 193 | * |
194 | * FUNCTION: acpi_ps_execute_method | 194 | * FUNCTION: acpi_ps_execute_method |
195 | * | 195 | * |
196 | * PARAMETERS: Info - Method info block, contains: | 196 | * PARAMETERS: info - Method info block, contains: |
197 | * Node - Method Node to execute | 197 | * node - Method Node to execute |
198 | * obj_desc - Method object | 198 | * obj_desc - Method object |
199 | * Parameters - List of parameters to pass to the method, | 199 | * parameters - List of parameters to pass to the method, |
200 | * terminated by NULL. Params itself may be | 200 | * terminated by NULL. Params itself may be |
201 | * NULL if no parameters are being passed. | 201 | * NULL if no parameters are being passed. |
202 | * return_object - Where to put method's return value (if | 202 | * return_object - Where to put method's return value (if |
@@ -361,9 +361,9 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) | |||
361 | * | 361 | * |
362 | * FUNCTION: acpi_ps_update_parameter_list | 362 | * FUNCTION: acpi_ps_update_parameter_list |
363 | * | 363 | * |
364 | * PARAMETERS: Info - See struct acpi_evaluate_info | 364 | * PARAMETERS: info - See struct acpi_evaluate_info |
365 | * (Used: parameter_type and Parameters) | 365 | * (Used: parameter_type and Parameters) |
366 | * Action - Add or Remove reference | 366 | * action - Add or Remove reference |
367 | * | 367 | * |
368 | * RETURN: Status | 368 | * RETURN: Status |
369 | * | 369 | * |
diff --git a/drivers/acpi/acpica/rsaddr.c b/drivers/acpi/acpica/rsaddr.c index a0305652394f..856ff075b6ab 100644 --- a/drivers/acpi/acpica/rsaddr.c +++ b/drivers/acpi/acpica/rsaddr.c | |||
@@ -182,8 +182,8 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_address64[5] = { | |||
182 | 182 | ||
183 | /* Revision ID */ | 183 | /* Revision ID */ |
184 | 184 | ||
185 | {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_iD), | 185 | {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_ID), |
186 | AML_OFFSET(ext_address64.revision_iD), | 186 | AML_OFFSET(ext_address64.revision_ID), |
187 | 1}, | 187 | 1}, |
188 | /* | 188 | /* |
189 | * These fields are contiguous in both the source and destination: | 189 | * These fields are contiguous in both the source and destination: |
@@ -215,7 +215,7 @@ static struct acpi_rsconvert_info acpi_rs_convert_general_flags[6] = { | |||
215 | AML_OFFSET(address.resource_type), | 215 | AML_OFFSET(address.resource_type), |
216 | 1}, | 216 | 1}, |
217 | 217 | ||
218 | /* General Flags - Consume, Decode, min_fixed, max_fixed */ | 218 | /* General flags - Consume, Decode, min_fixed, max_fixed */ |
219 | 219 | ||
220 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.producer_consumer), | 220 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.producer_consumer), |
221 | AML_OFFSET(address.flags), | 221 | AML_OFFSET(address.flags), |
@@ -293,8 +293,8 @@ static struct acpi_rsconvert_info acpi_rs_convert_io_flags[4] = { | |||
293 | * | 293 | * |
294 | * FUNCTION: acpi_rs_get_address_common | 294 | * FUNCTION: acpi_rs_get_address_common |
295 | * | 295 | * |
296 | * PARAMETERS: Resource - Pointer to the internal resource struct | 296 | * PARAMETERS: resource - Pointer to the internal resource struct |
297 | * Aml - Pointer to the AML resource descriptor | 297 | * aml - Pointer to the AML resource descriptor |
298 | * | 298 | * |
299 | * RETURN: TRUE if the resource_type field is OK, FALSE otherwise | 299 | * RETURN: TRUE if the resource_type field is OK, FALSE otherwise |
300 | * | 300 | * |
@@ -343,8 +343,8 @@ acpi_rs_get_address_common(struct acpi_resource *resource, | |||
343 | * | 343 | * |
344 | * FUNCTION: acpi_rs_set_address_common | 344 | * FUNCTION: acpi_rs_set_address_common |
345 | * | 345 | * |
346 | * PARAMETERS: Aml - Pointer to the AML resource descriptor | 346 | * PARAMETERS: aml - Pointer to the AML resource descriptor |
347 | * Resource - Pointer to the internal resource struct | 347 | * resource - Pointer to the internal resource struct |
348 | * | 348 | * |
349 | * RETURN: None | 349 | * RETURN: None |
350 | * | 350 | * |
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index 3c6df4b7eb2d..de12469d1c9c 100644 --- a/drivers/acpi/acpica/rscalc.c +++ b/drivers/acpi/acpica/rscalc.c | |||
@@ -173,7 +173,7 @@ acpi_rs_stream_option_length(u32 resource_length, | |||
173 | * | 173 | * |
174 | * FUNCTION: acpi_rs_get_aml_length | 174 | * FUNCTION: acpi_rs_get_aml_length |
175 | * | 175 | * |
176 | * PARAMETERS: Resource - Pointer to the resource linked list | 176 | * PARAMETERS: resource - Pointer to the resource linked list |
177 | * size_needed - Where the required size is returned | 177 | * size_needed - Where the required size is returned |
178 | * | 178 | * |
179 | * RETURN: Status | 179 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 46d6eb38ae66..311cbc4f05fa 100644 --- a/drivers/acpi/acpica/rscreate.c +++ b/drivers/acpi/acpica/rscreate.c | |||
@@ -190,8 +190,8 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, | |||
190 | * | 190 | * |
191 | * FUNCTION: acpi_rs_create_pci_routing_table | 191 | * FUNCTION: acpi_rs_create_pci_routing_table |
192 | * | 192 | * |
193 | * PARAMETERS: package_object - Pointer to a union acpi_operand_object | 193 | * PARAMETERS: package_object - Pointer to a package containing one |
194 | * package | 194 | * of more ACPI_OPERAND_OBJECTs |
195 | * output_buffer - Pointer to the user's buffer | 195 | * output_buffer - Pointer to the user's buffer |
196 | * | 196 | * |
197 | * RETURN: Status AE_OK if okay, else a valid acpi_status code. | 197 | * RETURN: Status AE_OK if okay, else a valid acpi_status code. |
@@ -199,7 +199,7 @@ acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, | |||
199 | * AE_BUFFER_OVERFLOW and output_buffer->Length will point | 199 | * AE_BUFFER_OVERFLOW and output_buffer->Length will point |
200 | * to the size buffer needed. | 200 | * to the size buffer needed. |
201 | * | 201 | * |
202 | * DESCRIPTION: Takes the union acpi_operand_object package and creates a | 202 | * DESCRIPTION: Takes the union acpi_operand_object package and creates a |
203 | * linked list of PCI interrupt descriptions | 203 | * linked list of PCI interrupt descriptions |
204 | * | 204 | * |
205 | * NOTE: It is the caller's responsibility to ensure that the start of the | 205 | * NOTE: It is the caller's responsibility to ensure that the start of the |
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c index b4c581132393..4d11b072388c 100644 --- a/drivers/acpi/acpica/rsdump.c +++ b/drivers/acpi/acpica/rsdump.c | |||
@@ -703,7 +703,7 @@ acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source) | |||
703 | * | 703 | * |
704 | * FUNCTION: acpi_rs_dump_address_common | 704 | * FUNCTION: acpi_rs_dump_address_common |
705 | * | 705 | * |
706 | * PARAMETERS: Resource - Pointer to an internal resource descriptor | 706 | * PARAMETERS: resource - Pointer to an internal resource descriptor |
707 | * | 707 | * |
708 | * RETURN: None | 708 | * RETURN: None |
709 | * | 709 | * |
@@ -850,8 +850,8 @@ void acpi_rs_dump_irq_list(u8 * route_table) | |||
850 | * | 850 | * |
851 | * FUNCTION: acpi_rs_out* | 851 | * FUNCTION: acpi_rs_out* |
852 | * | 852 | * |
853 | * PARAMETERS: Title - Name of the resource field | 853 | * PARAMETERS: title - Name of the resource field |
854 | * Value - Value of the resource field | 854 | * value - Value of the resource field |
855 | * | 855 | * |
856 | * RETURN: None | 856 | * RETURN: None |
857 | * | 857 | * |
@@ -898,8 +898,8 @@ static void acpi_rs_out_title(char *title) | |||
898 | * | 898 | * |
899 | * FUNCTION: acpi_rs_dump*List | 899 | * FUNCTION: acpi_rs_dump*List |
900 | * | 900 | * |
901 | * PARAMETERS: Length - Number of elements in the list | 901 | * PARAMETERS: length - Number of elements in the list |
902 | * Data - Start of the list | 902 | * data - Start of the list |
903 | * | 903 | * |
904 | * RETURN: None | 904 | * RETURN: None |
905 | * | 905 | * |
diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c index 9be129f5d6f4..46b5324b22d6 100644 --- a/drivers/acpi/acpica/rslist.c +++ b/drivers/acpi/acpica/rslist.c | |||
@@ -139,7 +139,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml, | |||
139 | * | 139 | * |
140 | * FUNCTION: acpi_rs_convert_resources_to_aml | 140 | * FUNCTION: acpi_rs_convert_resources_to_aml |
141 | * | 141 | * |
142 | * PARAMETERS: Resource - Pointer to the resource linked list | 142 | * PARAMETERS: resource - Pointer to the resource linked list |
143 | * aml_size_needed - Calculated size of the byte stream | 143 | * aml_size_needed - Calculated size of the byte stream |
144 | * needed from calling acpi_rs_get_aml_length() | 144 | * needed from calling acpi_rs_get_aml_length() |
145 | * The size of the output_buffer is | 145 | * The size of the output_buffer is |
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c index 8073b371cc7c..c6f291c2bc83 100644 --- a/drivers/acpi/acpica/rsmisc.c +++ b/drivers/acpi/acpica/rsmisc.c | |||
@@ -57,9 +57,9 @@ ACPI_MODULE_NAME("rsmisc") | |||
57 | * | 57 | * |
58 | * FUNCTION: acpi_rs_convert_aml_to_resource | 58 | * FUNCTION: acpi_rs_convert_aml_to_resource |
59 | * | 59 | * |
60 | * PARAMETERS: Resource - Pointer to the resource descriptor | 60 | * PARAMETERS: resource - Pointer to the resource descriptor |
61 | * Aml - Where the AML descriptor is returned | 61 | * aml - Where the AML descriptor is returned |
62 | * Info - Pointer to appropriate conversion table | 62 | * info - Pointer to appropriate conversion table |
63 | * | 63 | * |
64 | * RETURN: Status | 64 | * RETURN: Status |
65 | * | 65 | * |
@@ -406,7 +406,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
406 | 406 | ||
407 | case ACPI_RSC_EXIT_NE: | 407 | case ACPI_RSC_EXIT_NE: |
408 | /* | 408 | /* |
409 | * Control - Exit conversion if not equal | 409 | * control - Exit conversion if not equal |
410 | */ | 410 | */ |
411 | switch (info->resource_offset) { | 411 | switch (info->resource_offset) { |
412 | case ACPI_RSC_COMPARE_AML_LENGTH: | 412 | case ACPI_RSC_COMPARE_AML_LENGTH: |
@@ -454,9 +454,9 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
454 | * | 454 | * |
455 | * FUNCTION: acpi_rs_convert_resource_to_aml | 455 | * FUNCTION: acpi_rs_convert_resource_to_aml |
456 | * | 456 | * |
457 | * PARAMETERS: Resource - Pointer to the resource descriptor | 457 | * PARAMETERS: resource - Pointer to the resource descriptor |
458 | * Aml - Where the AML descriptor is returned | 458 | * aml - Where the AML descriptor is returned |
459 | * Info - Pointer to appropriate conversion table | 459 | * info - Pointer to appropriate conversion table |
460 | * | 460 | * |
461 | * RETURN: Status | 461 | * RETURN: Status |
462 | * | 462 | * |
@@ -726,7 +726,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
726 | 726 | ||
727 | case ACPI_RSC_EXIT_LE: | 727 | case ACPI_RSC_EXIT_LE: |
728 | /* | 728 | /* |
729 | * Control - Exit conversion if less than or equal | 729 | * control - Exit conversion if less than or equal |
730 | */ | 730 | */ |
731 | if (item_count <= info->value) { | 731 | if (item_count <= info->value) { |
732 | goto exit; | 732 | goto exit; |
@@ -735,7 +735,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
735 | 735 | ||
736 | case ACPI_RSC_EXIT_NE: | 736 | case ACPI_RSC_EXIT_NE: |
737 | /* | 737 | /* |
738 | * Control - Exit conversion if not equal | 738 | * control - Exit conversion if not equal |
739 | */ | 739 | */ |
740 | switch (COMPARE_OPCODE(info)) { | 740 | switch (COMPARE_OPCODE(info)) { |
741 | case ACPI_RSC_COMPARE_VALUE: | 741 | case ACPI_RSC_COMPARE_VALUE: |
@@ -757,7 +757,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
757 | 757 | ||
758 | case ACPI_RSC_EXIT_EQ: | 758 | case ACPI_RSC_EXIT_EQ: |
759 | /* | 759 | /* |
760 | * Control - Exit conversion if equal | 760 | * control - Exit conversion if equal |
761 | */ | 761 | */ |
762 | if (*ACPI_ADD_PTR(u8, resource, | 762 | if (*ACPI_ADD_PTR(u8, resource, |
763 | COMPARE_TARGET(info)) == | 763 | COMPARE_TARGET(info)) == |
@@ -783,7 +783,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
783 | #if 0 | 783 | #if 0 |
784 | /* Previous resource validations */ | 784 | /* Previous resource validations */ |
785 | 785 | ||
786 | if (aml->ext_address64.revision_iD != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { | 786 | if (aml->ext_address64.revision_ID != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { |
787 | return_ACPI_STATUS(AE_SUPPORT); | 787 | return_ACPI_STATUS(AE_SUPPORT); |
788 | } | 788 | } |
789 | 789 | ||
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index 433a375deb93..37d5241c0acf 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("rsutils") | |||
53 | * | 53 | * |
54 | * FUNCTION: acpi_rs_decode_bitmask | 54 | * FUNCTION: acpi_rs_decode_bitmask |
55 | * | 55 | * |
56 | * PARAMETERS: Mask - Bitmask to decode | 56 | * PARAMETERS: mask - Bitmask to decode |
57 | * List - Where the converted list is returned | 57 | * list - Where the converted list is returned |
58 | * | 58 | * |
59 | * RETURN: Count of bits set (length of list) | 59 | * RETURN: Count of bits set (length of list) |
60 | * | 60 | * |
@@ -86,8 +86,8 @@ u8 acpi_rs_decode_bitmask(u16 mask, u8 * list) | |||
86 | * | 86 | * |
87 | * FUNCTION: acpi_rs_encode_bitmask | 87 | * FUNCTION: acpi_rs_encode_bitmask |
88 | * | 88 | * |
89 | * PARAMETERS: List - List of values to encode | 89 | * PARAMETERS: list - List of values to encode |
90 | * Count - Length of list | 90 | * count - Length of list |
91 | * | 91 | * |
92 | * RETURN: Encoded bitmask | 92 | * RETURN: Encoded bitmask |
93 | * | 93 | * |
@@ -115,8 +115,8 @@ u16 acpi_rs_encode_bitmask(u8 * list, u8 count) | |||
115 | * | 115 | * |
116 | * FUNCTION: acpi_rs_move_data | 116 | * FUNCTION: acpi_rs_move_data |
117 | * | 117 | * |
118 | * PARAMETERS: Destination - Pointer to the destination descriptor | 118 | * PARAMETERS: destination - Pointer to the destination descriptor |
119 | * Source - Pointer to the source descriptor | 119 | * source - Pointer to the source descriptor |
120 | * item_count - How many items to move | 120 | * item_count - How many items to move |
121 | * move_type - Byte width | 121 | * move_type - Byte width |
122 | * | 122 | * |
@@ -183,7 +183,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type) | |||
183 | * | 183 | * |
184 | * PARAMETERS: total_length - Length of the AML descriptor, including | 184 | * PARAMETERS: total_length - Length of the AML descriptor, including |
185 | * the header and length fields. | 185 | * the header and length fields. |
186 | * Aml - Pointer to the raw AML descriptor | 186 | * aml - Pointer to the raw AML descriptor |
187 | * | 187 | * |
188 | * RETURN: None | 188 | * RETURN: None |
189 | * | 189 | * |
@@ -235,7 +235,7 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length, | |||
235 | * PARAMETERS: descriptor_type - Byte to be inserted as the type | 235 | * PARAMETERS: descriptor_type - Byte to be inserted as the type |
236 | * total_length - Length of the AML descriptor, including | 236 | * total_length - Length of the AML descriptor, including |
237 | * the header and length fields. | 237 | * the header and length fields. |
238 | * Aml - Pointer to the raw AML descriptor | 238 | * aml - Pointer to the raw AML descriptor |
239 | * | 239 | * |
240 | * RETURN: None | 240 | * RETURN: None |
241 | * | 241 | * |
@@ -265,8 +265,8 @@ acpi_rs_set_resource_header(u8 descriptor_type, | |||
265 | * | 265 | * |
266 | * FUNCTION: acpi_rs_strcpy | 266 | * FUNCTION: acpi_rs_strcpy |
267 | * | 267 | * |
268 | * PARAMETERS: Destination - Pointer to the destination string | 268 | * PARAMETERS: destination - Pointer to the destination string |
269 | * Source - Pointer to the source string | 269 | * source - Pointer to the source string |
270 | * | 270 | * |
271 | * RETURN: String length, including NULL terminator | 271 | * RETURN: String length, including NULL terminator |
272 | * | 272 | * |
@@ -300,7 +300,7 @@ static u16 acpi_rs_strcpy(char *destination, char *source) | |||
300 | * minimum_length - Minimum length of the descriptor (minus | 300 | * minimum_length - Minimum length of the descriptor (minus |
301 | * any optional fields) | 301 | * any optional fields) |
302 | * resource_source - Where the resource_source is returned | 302 | * resource_source - Where the resource_source is returned |
303 | * Aml - Pointer to the raw AML descriptor | 303 | * aml - Pointer to the raw AML descriptor |
304 | * string_ptr - (optional) where to store the actual | 304 | * string_ptr - (optional) where to store the actual |
305 | * resource_source string | 305 | * resource_source string |
306 | * | 306 | * |
@@ -386,7 +386,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, | |||
386 | * | 386 | * |
387 | * FUNCTION: acpi_rs_set_resource_source | 387 | * FUNCTION: acpi_rs_set_resource_source |
388 | * | 388 | * |
389 | * PARAMETERS: Aml - Pointer to the raw AML descriptor | 389 | * PARAMETERS: aml - Pointer to the raw AML descriptor |
390 | * minimum_length - Minimum length of the descriptor (minus | 390 | * minimum_length - Minimum length of the descriptor (minus |
391 | * any optional fields) | 391 | * any optional fields) |
392 | * resource_source - Internal resource_source | 392 | * resource_source - Internal resource_source |
@@ -445,7 +445,7 @@ acpi_rs_set_resource_source(union aml_resource * aml, | |||
445 | * | 445 | * |
446 | * FUNCTION: acpi_rs_get_prt_method_data | 446 | * FUNCTION: acpi_rs_get_prt_method_data |
447 | * | 447 | * |
448 | * PARAMETERS: Node - Device node | 448 | * PARAMETERS: node - Device node |
449 | * ret_buffer - Pointer to a buffer structure for the | 449 | * ret_buffer - Pointer to a buffer structure for the |
450 | * results | 450 | * results |
451 | * | 451 | * |
@@ -494,7 +494,7 @@ acpi_rs_get_prt_method_data(struct acpi_namespace_node * node, | |||
494 | * | 494 | * |
495 | * FUNCTION: acpi_rs_get_crs_method_data | 495 | * FUNCTION: acpi_rs_get_crs_method_data |
496 | * | 496 | * |
497 | * PARAMETERS: Node - Device node | 497 | * PARAMETERS: node - Device node |
498 | * ret_buffer - Pointer to a buffer structure for the | 498 | * ret_buffer - Pointer to a buffer structure for the |
499 | * results | 499 | * results |
500 | * | 500 | * |
@@ -534,7 +534,7 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, | |||
534 | */ | 534 | */ |
535 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 535 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
536 | 536 | ||
537 | /* On exit, we must delete the object returned by evaluate_object */ | 537 | /* On exit, we must delete the object returned by evaluateObject */ |
538 | 538 | ||
539 | acpi_ut_remove_reference(obj_desc); | 539 | acpi_ut_remove_reference(obj_desc); |
540 | return_ACPI_STATUS(status); | 540 | return_ACPI_STATUS(status); |
@@ -544,7 +544,7 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, | |||
544 | * | 544 | * |
545 | * FUNCTION: acpi_rs_get_prs_method_data | 545 | * FUNCTION: acpi_rs_get_prs_method_data |
546 | * | 546 | * |
547 | * PARAMETERS: Node - Device node | 547 | * PARAMETERS: node - Device node |
548 | * ret_buffer - Pointer to a buffer structure for the | 548 | * ret_buffer - Pointer to a buffer structure for the |
549 | * results | 549 | * results |
550 | * | 550 | * |
@@ -585,7 +585,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, | |||
585 | */ | 585 | */ |
586 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 586 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
587 | 587 | ||
588 | /* On exit, we must delete the object returned by evaluate_object */ | 588 | /* On exit, we must delete the object returned by evaluateObject */ |
589 | 589 | ||
590 | acpi_ut_remove_reference(obj_desc); | 590 | acpi_ut_remove_reference(obj_desc); |
591 | return_ACPI_STATUS(status); | 591 | return_ACPI_STATUS(status); |
@@ -596,7 +596,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, | |||
596 | * | 596 | * |
597 | * FUNCTION: acpi_rs_get_aei_method_data | 597 | * FUNCTION: acpi_rs_get_aei_method_data |
598 | * | 598 | * |
599 | * PARAMETERS: Node - Device node | 599 | * PARAMETERS: node - Device node |
600 | * ret_buffer - Pointer to a buffer structure for the | 600 | * ret_buffer - Pointer to a buffer structure for the |
601 | * results | 601 | * results |
602 | * | 602 | * |
@@ -636,7 +636,7 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, | |||
636 | */ | 636 | */ |
637 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | 637 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); |
638 | 638 | ||
639 | /* On exit, we must delete the object returned by evaluate_object */ | 639 | /* On exit, we must delete the object returned by evaluateObject */ |
640 | 640 | ||
641 | acpi_ut_remove_reference(obj_desc); | 641 | acpi_ut_remove_reference(obj_desc); |
642 | return_ACPI_STATUS(status); | 642 | return_ACPI_STATUS(status); |
@@ -646,8 +646,8 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, | |||
646 | * | 646 | * |
647 | * FUNCTION: acpi_rs_get_method_data | 647 | * FUNCTION: acpi_rs_get_method_data |
648 | * | 648 | * |
649 | * PARAMETERS: Handle - Handle to the containing object | 649 | * PARAMETERS: handle - Handle to the containing object |
650 | * Path - Path to method, relative to Handle | 650 | * path - Path to method, relative to Handle |
651 | * ret_buffer - Pointer to a buffer structure for the | 651 | * ret_buffer - Pointer to a buffer structure for the |
652 | * results | 652 | * results |
653 | * | 653 | * |
@@ -697,7 +697,7 @@ acpi_rs_get_method_data(acpi_handle handle, | |||
697 | * | 697 | * |
698 | * FUNCTION: acpi_rs_set_srs_method_data | 698 | * FUNCTION: acpi_rs_set_srs_method_data |
699 | * | 699 | * |
700 | * PARAMETERS: Node - Device node | 700 | * PARAMETERS: node - Device node |
701 | * in_buffer - Pointer to a buffer structure of the | 701 | * in_buffer - Pointer to a buffer structure of the |
702 | * parameter | 702 | * parameter |
703 | * | 703 | * |
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index f58c098c7aeb..5aad744b5b83 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c | |||
@@ -79,7 +79,7 @@ acpi_rs_validate_parameters(acpi_handle device_handle, | |||
79 | * FUNCTION: acpi_rs_validate_parameters | 79 | * FUNCTION: acpi_rs_validate_parameters |
80 | * | 80 | * |
81 | * PARAMETERS: device_handle - Handle to a device | 81 | * PARAMETERS: device_handle - Handle to a device |
82 | * Buffer - Pointer to a data buffer | 82 | * buffer - Pointer to a data buffer |
83 | * return_node - Pointer to where the device node is returned | 83 | * return_node - Pointer to where the device node is returned |
84 | * | 84 | * |
85 | * RETURN: Status | 85 | * RETURN: Status |
@@ -351,8 +351,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_event_resources) | |||
351 | * | 351 | * |
352 | * FUNCTION: acpi_resource_to_address64 | 352 | * FUNCTION: acpi_resource_to_address64 |
353 | * | 353 | * |
354 | * PARAMETERS: Resource - Pointer to a resource | 354 | * PARAMETERS: resource - Pointer to a resource |
355 | * Out - Pointer to the users's return buffer | 355 | * out - Pointer to the users's return buffer |
356 | * (a struct acpi_resource_address64) | 356 | * (a struct acpi_resource_address64) |
357 | * | 357 | * |
358 | * RETURN: Status | 358 | * RETURN: Status |
@@ -415,9 +415,9 @@ ACPI_EXPORT_SYMBOL(acpi_resource_to_address64) | |||
415 | * FUNCTION: acpi_get_vendor_resource | 415 | * FUNCTION: acpi_get_vendor_resource |
416 | * | 416 | * |
417 | * PARAMETERS: device_handle - Handle for the parent device object | 417 | * PARAMETERS: device_handle - Handle for the parent device object |
418 | * Name - Method name for the parent resource | 418 | * name - Method name for the parent resource |
419 | * (METHOD_NAME__CRS or METHOD_NAME__PRS) | 419 | * (METHOD_NAME__CRS or METHOD_NAME__PRS) |
420 | * Uuid - Pointer to the UUID to be matched. | 420 | * uuid - Pointer to the UUID to be matched. |
421 | * includes both subtype and 16-byte UUID | 421 | * includes both subtype and 16-byte UUID |
422 | * ret_buffer - Where the vendor resource is returned | 422 | * ret_buffer - Where the vendor resource is returned |
423 | * | 423 | * |
@@ -526,11 +526,11 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context) | |||
526 | * | 526 | * |
527 | * PARAMETERS: device_handle - Handle to the device object for the | 527 | * PARAMETERS: device_handle - Handle to the device object for the |
528 | * device we are querying | 528 | * device we are querying |
529 | * Name - Method name of the resources we want. | 529 | * name - Method name of the resources we want. |
530 | * (METHOD_NAME__CRS, METHOD_NAME__PRS, or | 530 | * (METHOD_NAME__CRS, METHOD_NAME__PRS, or |
531 | * METHOD_NAME__AEI) | 531 | * METHOD_NAME__AEI) |
532 | * user_function - Called for each resource | 532 | * user_function - Called for each resource |
533 | * Context - Passed to user_function | 533 | * context - Passed to user_function |
534 | * | 534 | * |
535 | * RETURN: Status | 535 | * RETURN: Status |
536 | * | 536 | * |
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 4c9c760db4a4..390651860bf0 100644 --- a/drivers/acpi/acpica/tbfadt.c +++ b/drivers/acpi/acpica/tbfadt.c | |||
@@ -49,9 +49,10 @@ | |||
49 | ACPI_MODULE_NAME("tbfadt") | 49 | ACPI_MODULE_NAME("tbfadt") |
50 | 50 | ||
51 | /* Local prototypes */ | 51 | /* Local prototypes */ |
52 | static ACPI_INLINE void | 52 | static void |
53 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | 53 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, |
54 | u8 space_id, u8 byte_width, u64 address); | 54 | u8 space_id, |
55 | u8 byte_width, u64 address, char *register_name); | ||
55 | 56 | ||
56 | static void acpi_tb_convert_fadt(void); | 57 | static void acpi_tb_convert_fadt(void); |
57 | 58 | ||
@@ -172,7 +173,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { | |||
172 | * | 173 | * |
173 | * PARAMETERS: generic_address - GAS struct to be initialized | 174 | * PARAMETERS: generic_address - GAS struct to be initialized |
174 | * byte_width - Width of this register | 175 | * byte_width - Width of this register |
175 | * Address - Address of the register | 176 | * address - Address of the register |
176 | * | 177 | * |
177 | * RETURN: None | 178 | * RETURN: None |
178 | * | 179 | * |
@@ -182,10 +183,25 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { | |||
182 | * | 183 | * |
183 | ******************************************************************************/ | 184 | ******************************************************************************/ |
184 | 185 | ||
185 | static ACPI_INLINE void | 186 | static void |
186 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | 187 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, |
187 | u8 space_id, u8 byte_width, u64 address) | 188 | u8 space_id, |
189 | u8 byte_width, u64 address, char *register_name) | ||
188 | { | 190 | { |
191 | u8 bit_width; | ||
192 | |||
193 | /* Bit width field in the GAS is only one byte long, 255 max */ | ||
194 | |||
195 | bit_width = (u8)(byte_width * 8); | ||
196 | |||
197 | if (byte_width > 31) { /* (31*8)=248 */ | ||
198 | ACPI_ERROR((AE_INFO, | ||
199 | "%s - 32-bit FADT register is too long (%u bytes, %u bits) " | ||
200 | "to convert to GAS struct - 255 bits max, truncating", | ||
201 | register_name, byte_width, (byte_width * 8))); | ||
202 | |||
203 | bit_width = 255; | ||
204 | } | ||
189 | 205 | ||
190 | /* | 206 | /* |
191 | * The 64-bit Address field is non-aligned in the byte packed | 207 | * The 64-bit Address field is non-aligned in the byte packed |
@@ -196,7 +212,7 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | |||
196 | /* All other fields are byte-wide */ | 212 | /* All other fields are byte-wide */ |
197 | 213 | ||
198 | generic_address->space_id = space_id; | 214 | generic_address->space_id = space_id; |
199 | generic_address->bit_width = (u8)ACPI_MUL_8(byte_width); | 215 | generic_address->bit_width = bit_width; |
200 | generic_address->bit_offset = 0; | 216 | generic_address->bit_offset = 0; |
201 | generic_address->access_width = 0; /* Access width ANY */ | 217 | generic_address->access_width = 0; /* Access width ANY */ |
202 | } | 218 | } |
@@ -267,8 +283,8 @@ void acpi_tb_parse_fadt(u32 table_index) | |||
267 | * | 283 | * |
268 | * FUNCTION: acpi_tb_create_local_fadt | 284 | * FUNCTION: acpi_tb_create_local_fadt |
269 | * | 285 | * |
270 | * PARAMETERS: Table - Pointer to BIOS FADT | 286 | * PARAMETERS: table - Pointer to BIOS FADT |
271 | * Length - Length of the table | 287 | * length - Length of the table |
272 | * | 288 | * |
273 | * RETURN: None | 289 | * RETURN: None |
274 | * | 290 | * |
@@ -287,11 +303,11 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) | |||
287 | * a warning. | 303 | * a warning. |
288 | */ | 304 | */ |
289 | if (length > sizeof(struct acpi_table_fadt)) { | 305 | if (length > sizeof(struct acpi_table_fadt)) { |
290 | ACPI_WARNING((AE_INFO, | 306 | ACPI_BIOS_WARNING((AE_INFO, |
291 | "FADT (revision %u) is longer than ACPI 5.0 version, " | 307 | "FADT (revision %u) is longer than ACPI 5.0 version, " |
292 | "truncating length %u to %u", | 308 | "truncating length %u to %u", |
293 | table->revision, length, | 309 | table->revision, length, |
294 | (u32)sizeof(struct acpi_table_fadt))); | 310 | (u32)sizeof(struct acpi_table_fadt))); |
295 | } | 311 | } |
296 | 312 | ||
297 | /* Clear the entire local FADT */ | 313 | /* Clear the entire local FADT */ |
@@ -436,11 +452,13 @@ static void acpi_tb_convert_fadt(void) | |||
436 | * they must match. | 452 | * they must match. |
437 | */ | 453 | */ |
438 | if (address64->address && address32 && | 454 | if (address64->address && address32 && |
439 | (address64->address != (u64) address32)) { | 455 | (address64->address != (u64)address32)) { |
440 | ACPI_ERROR((AE_INFO, | 456 | ACPI_BIOS_ERROR((AE_INFO, |
441 | "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", | 457 | "32/64X address mismatch in FADT/%s: " |
442 | fadt_info_table[i].name, address32, | 458 | "0x%8.8X/0x%8.8X%8.8X, using 32", |
443 | ACPI_FORMAT_UINT64(address64->address))); | 459 | fadt_info_table[i].name, address32, |
460 | ACPI_FORMAT_UINT64(address64-> | ||
461 | address))); | ||
444 | } | 462 | } |
445 | 463 | ||
446 | /* Always use 32-bit address if it is valid (non-null) */ | 464 | /* Always use 32-bit address if it is valid (non-null) */ |
@@ -456,7 +474,8 @@ static void acpi_tb_convert_fadt(void) | |||
456 | &acpi_gbl_FADT, | 474 | &acpi_gbl_FADT, |
457 | fadt_info_table | 475 | fadt_info_table |
458 | [i].length), | 476 | [i].length), |
459 | (u64) address32); | 477 | (u64) address32, |
478 | fadt_info_table[i].name); | ||
460 | } | 479 | } |
461 | } | 480 | } |
462 | } | 481 | } |
@@ -465,7 +484,7 @@ static void acpi_tb_convert_fadt(void) | |||
465 | * | 484 | * |
466 | * FUNCTION: acpi_tb_validate_fadt | 485 | * FUNCTION: acpi_tb_validate_fadt |
467 | * | 486 | * |
468 | * PARAMETERS: Table - Pointer to the FADT to be validated | 487 | * PARAMETERS: table - Pointer to the FADT to be validated |
469 | * | 488 | * |
470 | * RETURN: None | 489 | * RETURN: None |
471 | * | 490 | * |
@@ -494,25 +513,25 @@ static void acpi_tb_validate_fadt(void) | |||
494 | * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. | 513 | * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. |
495 | */ | 514 | */ |
496 | if (acpi_gbl_FADT.facs && | 515 | if (acpi_gbl_FADT.facs && |
497 | (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) { | 516 | (acpi_gbl_FADT.Xfacs != (u64)acpi_gbl_FADT.facs)) { |
498 | ACPI_WARNING((AE_INFO, | 517 | ACPI_BIOS_WARNING((AE_INFO, |
499 | "32/64X FACS address mismatch in FADT - " | 518 | "32/64X FACS address mismatch in FADT - " |
500 | "0x%8.8X/0x%8.8X%8.8X, using 32", | 519 | "0x%8.8X/0x%8.8X%8.8X, using 32", |
501 | acpi_gbl_FADT.facs, | 520 | acpi_gbl_FADT.facs, |
502 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); | 521 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); |
503 | 522 | ||
504 | acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs; | 523 | acpi_gbl_FADT.Xfacs = (u64)acpi_gbl_FADT.facs; |
505 | } | 524 | } |
506 | 525 | ||
507 | if (acpi_gbl_FADT.dsdt && | 526 | if (acpi_gbl_FADT.dsdt && |
508 | (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) { | 527 | (acpi_gbl_FADT.Xdsdt != (u64)acpi_gbl_FADT.dsdt)) { |
509 | ACPI_WARNING((AE_INFO, | 528 | ACPI_BIOS_WARNING((AE_INFO, |
510 | "32/64X DSDT address mismatch in FADT - " | 529 | "32/64X DSDT address mismatch in FADT - " |
511 | "0x%8.8X/0x%8.8X%8.8X, using 32", | 530 | "0x%8.8X/0x%8.8X%8.8X, using 32", |
512 | acpi_gbl_FADT.dsdt, | 531 | acpi_gbl_FADT.dsdt, |
513 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); | 532 | ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); |
514 | 533 | ||
515 | acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt; | 534 | acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt; |
516 | } | 535 | } |
517 | 536 | ||
518 | /* If Hardware Reduced flag is set, we are all done */ | 537 | /* If Hardware Reduced flag is set, we are all done */ |
@@ -542,10 +561,10 @@ static void acpi_tb_validate_fadt(void) | |||
542 | */ | 561 | */ |
543 | if (address64->address && | 562 | if (address64->address && |
544 | (address64->bit_width != ACPI_MUL_8(length))) { | 563 | (address64->bit_width != ACPI_MUL_8(length))) { |
545 | ACPI_WARNING((AE_INFO, | 564 | ACPI_BIOS_WARNING((AE_INFO, |
546 | "32/64X length mismatch in %s: %u/%u", | 565 | "32/64X length mismatch in FADT/%s: %u/%u", |
547 | name, ACPI_MUL_8(length), | 566 | name, ACPI_MUL_8(length), |
548 | address64->bit_width)); | 567 | address64->bit_width)); |
549 | } | 568 | } |
550 | 569 | ||
551 | if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) { | 570 | if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) { |
@@ -554,29 +573,29 @@ static void acpi_tb_validate_fadt(void) | |||
554 | * Both the address and length must be non-zero. | 573 | * Both the address and length must be non-zero. |
555 | */ | 574 | */ |
556 | if (!address64->address || !length) { | 575 | if (!address64->address || !length) { |
557 | ACPI_ERROR((AE_INFO, | 576 | ACPI_BIOS_ERROR((AE_INFO, |
558 | "Required field %s has zero address and/or length:" | 577 | "Required FADT field %s has zero address and/or length: " |
559 | " 0x%8.8X%8.8X/0x%X", | 578 | "0x%8.8X%8.8X/0x%X", |
560 | name, | 579 | name, |
561 | ACPI_FORMAT_UINT64(address64-> | 580 | ACPI_FORMAT_UINT64(address64-> |
562 | address), | 581 | address), |
563 | length)); | 582 | length)); |
564 | } | 583 | } |
565 | } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { | 584 | } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { |
566 | /* | 585 | /* |
567 | * Field is optional (PM2Control, GPE0, GPE1) AND has its own | 586 | * Field is optional (Pm2_control, GPE0, GPE1) AND has its own |
568 | * length field. If present, both the address and length must | 587 | * length field. If present, both the address and length must |
569 | * be valid. | 588 | * be valid. |
570 | */ | 589 | */ |
571 | if ((address64->address && !length) || | 590 | if ((address64->address && !length) || |
572 | (!address64->address && length)) { | 591 | (!address64->address && length)) { |
573 | ACPI_WARNING((AE_INFO, | 592 | ACPI_BIOS_WARNING((AE_INFO, |
574 | "Optional field %s has zero address or length: " | 593 | "Optional FADT field %s has zero address or length: " |
575 | "0x%8.8X%8.8X/0x%X", | 594 | "0x%8.8X%8.8X/0x%X", |
576 | name, | 595 | name, |
577 | ACPI_FORMAT_UINT64(address64-> | 596 | ACPI_FORMAT_UINT64 |
578 | address), | 597 | (address64->address), |
579 | length)); | 598 | length)); |
580 | } | 599 | } |
581 | } | 600 | } |
582 | } | 601 | } |
@@ -621,12 +640,12 @@ static void acpi_tb_setup_fadt_registers(void) | |||
621 | (fadt_info_table[i].default_length > 0) && | 640 | (fadt_info_table[i].default_length > 0) && |
622 | (fadt_info_table[i].default_length != | 641 | (fadt_info_table[i].default_length != |
623 | target64->bit_width)) { | 642 | target64->bit_width)) { |
624 | ACPI_WARNING((AE_INFO, | 643 | ACPI_BIOS_WARNING((AE_INFO, |
625 | "Invalid length for %s: %u, using default %u", | 644 | "Invalid length for FADT/%s: %u, using default %u", |
626 | fadt_info_table[i].name, | 645 | fadt_info_table[i].name, |
627 | target64->bit_width, | 646 | target64->bit_width, |
628 | fadt_info_table[i]. | 647 | fadt_info_table[i]. |
629 | default_length)); | 648 | default_length)); |
630 | 649 | ||
631 | /* Incorrect size, set width to the default */ | 650 | /* Incorrect size, set width to the default */ |
632 | 651 | ||
@@ -670,7 +689,8 @@ static void acpi_tb_setup_fadt_registers(void) | |||
670 | source64->address + | 689 | source64->address + |
671 | (fadt_pm_info_table[i]. | 690 | (fadt_pm_info_table[i]. |
672 | register_num * | 691 | register_num * |
673 | pm1_register_byte_width)); | 692 | pm1_register_byte_width), |
693 | "PmRegisters"); | ||
674 | } | 694 | } |
675 | } | 695 | } |
676 | } | 696 | } |
diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c index 4903e36ea75a..57deae166577 100644 --- a/drivers/acpi/acpica/tbfind.c +++ b/drivers/acpi/acpica/tbfind.c | |||
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("tbfind") | |||
52 | * | 52 | * |
53 | * FUNCTION: acpi_tb_find_table | 53 | * FUNCTION: acpi_tb_find_table |
54 | * | 54 | * |
55 | * PARAMETERS: Signature - String with ACPI table signature | 55 | * PARAMETERS: signature - String with ACPI table signature |
56 | * oem_id - String with the table OEM ID | 56 | * oem_id - String with the table OEM ID |
57 | * oem_table_id - String with the OEM Table ID | 57 | * oem_table_id - String with the OEM Table ID |
58 | * table_index - Where the table index is returned | 58 | * table_index - Where the table index is returned |
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index c03500b4cc7a..74f97d74db1c 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -138,13 +138,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) | |||
138 | if ((table_desc->pointer->signature[0] != 0x00) && | 138 | if ((table_desc->pointer->signature[0] != 0x00) && |
139 | (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) | 139 | (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) |
140 | && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { | 140 | && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { |
141 | ACPI_ERROR((AE_INFO, | 141 | ACPI_BIOS_ERROR((AE_INFO, |
142 | "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", | 142 | "Table has invalid signature [%4.4s] (0x%8.8X), " |
143 | acpi_ut_valid_acpi_name(*(u32 *)table_desc-> | 143 | "must be SSDT or OEMx", |
144 | pointer-> | 144 | acpi_ut_valid_acpi_name(*(u32 *)table_desc-> |
145 | signature) ? table_desc-> | 145 | pointer-> |
146 | pointer->signature : "????", | 146 | signature) ? |
147 | *(u32 *)table_desc->pointer->signature)); | 147 | table_desc->pointer->signature : "????", |
148 | *(u32 *)table_desc->pointer->signature)); | ||
148 | 149 | ||
149 | return_ACPI_STATUS(AE_BAD_SIGNATURE); | 150 | return_ACPI_STATUS(AE_BAD_SIGNATURE); |
150 | } | 151 | } |
@@ -396,10 +397,10 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
396 | * | 397 | * |
397 | * FUNCTION: acpi_tb_store_table | 398 | * FUNCTION: acpi_tb_store_table |
398 | * | 399 | * |
399 | * PARAMETERS: Address - Table address | 400 | * PARAMETERS: address - Table address |
400 | * Table - Table header | 401 | * table - Table header |
401 | * Length - Table length | 402 | * length - Table length |
402 | * Flags - flags | 403 | * flags - flags |
403 | * | 404 | * |
404 | * RETURN: Status and table index. | 405 | * RETURN: Status and table index. |
405 | * | 406 | * |
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 0a706cac37de..b6cea30da638 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c | |||
@@ -178,8 +178,8 @@ u8 acpi_tb_tables_loaded(void) | |||
178 | * | 178 | * |
179 | * FUNCTION: acpi_tb_fix_string | 179 | * FUNCTION: acpi_tb_fix_string |
180 | * | 180 | * |
181 | * PARAMETERS: String - String to be repaired | 181 | * PARAMETERS: string - String to be repaired |
182 | * Length - Maximum length | 182 | * length - Maximum length |
183 | * | 183 | * |
184 | * RETURN: None | 184 | * RETURN: None |
185 | * | 185 | * |
@@ -205,7 +205,7 @@ static void acpi_tb_fix_string(char *string, acpi_size length) | |||
205 | * FUNCTION: acpi_tb_cleanup_table_header | 205 | * FUNCTION: acpi_tb_cleanup_table_header |
206 | * | 206 | * |
207 | * PARAMETERS: out_header - Where the cleaned header is returned | 207 | * PARAMETERS: out_header - Where the cleaned header is returned |
208 | * Header - Input ACPI table header | 208 | * header - Input ACPI table header |
209 | * | 209 | * |
210 | * RETURN: Returns the cleaned header in out_header | 210 | * RETURN: Returns the cleaned header in out_header |
211 | * | 211 | * |
@@ -231,8 +231,8 @@ acpi_tb_cleanup_table_header(struct acpi_table_header *out_header, | |||
231 | * | 231 | * |
232 | * FUNCTION: acpi_tb_print_table_header | 232 | * FUNCTION: acpi_tb_print_table_header |
233 | * | 233 | * |
234 | * PARAMETERS: Address - Table physical address | 234 | * PARAMETERS: address - Table physical address |
235 | * Header - Table header | 235 | * header - Table header |
236 | * | 236 | * |
237 | * RETURN: None | 237 | * RETURN: None |
238 | * | 238 | * |
@@ -296,8 +296,8 @@ acpi_tb_print_table_header(acpi_physical_address address, | |||
296 | * | 296 | * |
297 | * FUNCTION: acpi_tb_validate_checksum | 297 | * FUNCTION: acpi_tb_validate_checksum |
298 | * | 298 | * |
299 | * PARAMETERS: Table - ACPI table to verify | 299 | * PARAMETERS: table - ACPI table to verify |
300 | * Length - Length of entire table | 300 | * length - Length of entire table |
301 | * | 301 | * |
302 | * RETURN: Status | 302 | * RETURN: Status |
303 | * | 303 | * |
@@ -317,10 +317,11 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) | |||
317 | /* Checksum ok? (should be zero) */ | 317 | /* Checksum ok? (should be zero) */ |
318 | 318 | ||
319 | if (checksum) { | 319 | if (checksum) { |
320 | ACPI_WARNING((AE_INFO, | 320 | ACPI_BIOS_WARNING((AE_INFO, |
321 | "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", | 321 | "Incorrect checksum in table [%4.4s] - 0x%2.2X, " |
322 | table->signature, table->checksum, | 322 | "should be 0x%2.2X", |
323 | (u8) (table->checksum - checksum))); | 323 | table->signature, table->checksum, |
324 | (u8)(table->checksum - checksum))); | ||
324 | 325 | ||
325 | #if (ACPI_CHECKSUM_ABORT) | 326 | #if (ACPI_CHECKSUM_ABORT) |
326 | 327 | ||
@@ -335,8 +336,8 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) | |||
335 | * | 336 | * |
336 | * FUNCTION: acpi_tb_checksum | 337 | * FUNCTION: acpi_tb_checksum |
337 | * | 338 | * |
338 | * PARAMETERS: Buffer - Pointer to memory region to be checked | 339 | * PARAMETERS: buffer - Pointer to memory region to be checked |
339 | * Length - Length of this memory region | 340 | * length - Length of this memory region |
340 | * | 341 | * |
341 | * RETURN: Checksum (u8) | 342 | * RETURN: Checksum (u8) |
342 | * | 343 | * |
@@ -377,8 +378,9 @@ void acpi_tb_check_dsdt_header(void) | |||
377 | 378 | ||
378 | if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || | 379 | if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || |
379 | acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { | 380 | acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { |
380 | ACPI_ERROR((AE_INFO, | 381 | ACPI_BIOS_ERROR((AE_INFO, |
381 | "The DSDT has been corrupted or replaced - old, new headers below")); | 382 | "The DSDT has been corrupted or replaced - " |
383 | "old, new headers below")); | ||
382 | acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); | 384 | acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); |
383 | acpi_tb_print_table_header(0, acpi_gbl_DSDT); | 385 | acpi_tb_print_table_header(0, acpi_gbl_DSDT); |
384 | 386 | ||
@@ -438,8 +440,8 @@ struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index) | |||
438 | * | 440 | * |
439 | * FUNCTION: acpi_tb_install_table | 441 | * FUNCTION: acpi_tb_install_table |
440 | * | 442 | * |
441 | * PARAMETERS: Address - Physical address of DSDT or FACS | 443 | * PARAMETERS: address - Physical address of DSDT or FACS |
442 | * Signature - Table signature, NULL if no need to | 444 | * signature - Table signature, NULL if no need to |
443 | * match | 445 | * match |
444 | * table_index - Index into root table array | 446 | * table_index - Index into root table array |
445 | * | 447 | * |
@@ -480,9 +482,10 @@ acpi_tb_install_table(acpi_physical_address address, | |||
480 | /* If a particular signature is expected (DSDT/FACS), it must match */ | 482 | /* If a particular signature is expected (DSDT/FACS), it must match */ |
481 | 483 | ||
482 | if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) { | 484 | if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) { |
483 | ACPI_ERROR((AE_INFO, | 485 | ACPI_BIOS_ERROR((AE_INFO, |
484 | "Invalid signature 0x%X for ACPI table, expected [%s]", | 486 | "Invalid signature 0x%X for ACPI table, expected [%s]", |
485 | *ACPI_CAST_PTR(u32, table->signature), signature)); | 487 | *ACPI_CAST_PTR(u32, table->signature), |
488 | signature)); | ||
486 | goto unmap_and_exit; | 489 | goto unmap_and_exit; |
487 | } | 490 | } |
488 | 491 | ||
@@ -589,10 +592,10 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) | |||
589 | 592 | ||
590 | /* Will truncate 64-bit address to 32 bits, issue warning */ | 593 | /* Will truncate 64-bit address to 32 bits, issue warning */ |
591 | 594 | ||
592 | ACPI_WARNING((AE_INFO, | 595 | ACPI_BIOS_WARNING((AE_INFO, |
593 | "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," | 596 | "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," |
594 | " truncating", | 597 | " truncating", |
595 | ACPI_FORMAT_UINT64(address64))); | 598 | ACPI_FORMAT_UINT64(address64))); |
596 | } | 599 | } |
597 | #endif | 600 | #endif |
598 | return ((acpi_physical_address) (address64)); | 601 | return ((acpi_physical_address) (address64)); |
@@ -603,7 +606,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) | |||
603 | * | 606 | * |
604 | * FUNCTION: acpi_tb_parse_root_table | 607 | * FUNCTION: acpi_tb_parse_root_table |
605 | * | 608 | * |
606 | * PARAMETERS: Rsdp - Pointer to the RSDP | 609 | * PARAMETERS: rsdp - Pointer to the RSDP |
607 | * | 610 | * |
608 | * RETURN: Status | 611 | * RETURN: Status |
609 | * | 612 | * |
@@ -694,8 +697,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) | |||
694 | acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); | 697 | acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); |
695 | 698 | ||
696 | if (length < sizeof(struct acpi_table_header)) { | 699 | if (length < sizeof(struct acpi_table_header)) { |
697 | ACPI_ERROR((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", | 700 | ACPI_BIOS_ERROR((AE_INFO, |
698 | length)); | 701 | "Invalid table length 0x%X in RSDT/XSDT", |
702 | length)); | ||
699 | return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); | 703 | return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); |
700 | } | 704 | } |
701 | 705 | ||
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index abcc6412c244..ea4c6d52605a 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -1,7 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Module Name: tbxface - Public interfaces to the ACPI subsystem | 3 | * Module Name: tbxface - ACPI table oriented external interfaces |
4 | * ACPI table oriented interfaces | ||
5 | * | 4 | * |
6 | *****************************************************************************/ | 5 | *****************************************************************************/ |
7 | 6 | ||
@@ -51,11 +50,6 @@ | |||
51 | #define _COMPONENT ACPI_TABLES | 50 | #define _COMPONENT ACPI_TABLES |
52 | ACPI_MODULE_NAME("tbxface") | 51 | ACPI_MODULE_NAME("tbxface") |
53 | 52 | ||
54 | /* Local prototypes */ | ||
55 | static acpi_status acpi_tb_load_namespace(void); | ||
56 | |||
57 | static int no_auto_ssdt; | ||
58 | |||
59 | /******************************************************************************* | 53 | /******************************************************************************* |
60 | * | 54 | * |
61 | * FUNCTION: acpi_allocate_root_table | 55 | * FUNCTION: acpi_allocate_root_table |
@@ -65,11 +59,10 @@ static int no_auto_ssdt; | |||
65 | * | 59 | * |
66 | * RETURN: Status | 60 | * RETURN: Status |
67 | * | 61 | * |
68 | * DESCRIPTION: Allocate a root table array. Used by i_aSL compiler and | 62 | * DESCRIPTION: Allocate a root table array. Used by iASL compiler and |
69 | * acpi_initialize_tables. | 63 | * acpi_initialize_tables. |
70 | * | 64 | * |
71 | ******************************************************************************/ | 65 | ******************************************************************************/ |
72 | |||
73 | acpi_status acpi_allocate_root_table(u32 initial_table_count) | 66 | acpi_status acpi_allocate_root_table(u32 initial_table_count) |
74 | { | 67 | { |
75 | 68 | ||
@@ -222,52 +215,10 @@ acpi_status acpi_reallocate_root_table(void) | |||
222 | 215 | ||
223 | /******************************************************************************* | 216 | /******************************************************************************* |
224 | * | 217 | * |
225 | * FUNCTION: acpi_load_table | ||
226 | * | ||
227 | * PARAMETERS: table_ptr - pointer to a buffer containing the entire | ||
228 | * table to be loaded | ||
229 | * | ||
230 | * RETURN: Status | ||
231 | * | ||
232 | * DESCRIPTION: This function is called to load a table from the caller's | ||
233 | * buffer. The buffer must contain an entire ACPI Table including | ||
234 | * a valid header. The header fields will be verified, and if it | ||
235 | * is determined that the table is invalid, the call will fail. | ||
236 | * | ||
237 | ******************************************************************************/ | ||
238 | acpi_status acpi_load_table(struct acpi_table_header *table_ptr) | ||
239 | { | ||
240 | acpi_status status; | ||
241 | u32 table_index; | ||
242 | struct acpi_table_desc table_desc; | ||
243 | |||
244 | if (!table_ptr) | ||
245 | return AE_BAD_PARAMETER; | ||
246 | |||
247 | ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc)); | ||
248 | table_desc.pointer = table_ptr; | ||
249 | table_desc.length = table_ptr->length; | ||
250 | table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN; | ||
251 | |||
252 | /* | ||
253 | * Install the new table into the local data structures | ||
254 | */ | ||
255 | status = acpi_tb_add_table(&table_desc, &table_index); | ||
256 | if (ACPI_FAILURE(status)) { | ||
257 | return status; | ||
258 | } | ||
259 | status = acpi_ns_load_table(table_index, acpi_gbl_root_node); | ||
260 | return status; | ||
261 | } | ||
262 | |||
263 | ACPI_EXPORT_SYMBOL(acpi_load_table) | ||
264 | |||
265 | /******************************************************************************* | ||
266 | * | ||
267 | * FUNCTION: acpi_get_table_header | 218 | * FUNCTION: acpi_get_table_header |
268 | * | 219 | * |
269 | * PARAMETERS: Signature - ACPI signature of needed table | 220 | * PARAMETERS: signature - ACPI signature of needed table |
270 | * Instance - Which instance (for SSDTs) | 221 | * instance - Which instance (for SSDTs) |
271 | * out_table_header - The pointer to the table header to fill | 222 | * out_table_header - The pointer to the table header to fill |
272 | * | 223 | * |
273 | * RETURN: Status and pointer to mapped table header | 224 | * RETURN: Status and pointer to mapped table header |
@@ -382,8 +333,8 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table_id) | |||
382 | * | 333 | * |
383 | * FUNCTION: acpi_get_table_with_size | 334 | * FUNCTION: acpi_get_table_with_size |
384 | * | 335 | * |
385 | * PARAMETERS: Signature - ACPI signature of needed table | 336 | * PARAMETERS: signature - ACPI signature of needed table |
386 | * Instance - Which instance (for SSDTs) | 337 | * instance - Which instance (for SSDTs) |
387 | * out_table - Where the pointer to the table is returned | 338 | * out_table - Where the pointer to the table is returned |
388 | * | 339 | * |
389 | * RETURN: Status and pointer to table | 340 | * RETURN: Status and pointer to table |
@@ -453,7 +404,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_table) | |||
453 | * FUNCTION: acpi_get_table_by_index | 404 | * FUNCTION: acpi_get_table_by_index |
454 | * | 405 | * |
455 | * PARAMETERS: table_index - Table index | 406 | * PARAMETERS: table_index - Table index |
456 | * Table - Where the pointer to the table is returned | 407 | * table - Where the pointer to the table is returned |
457 | * | 408 | * |
458 | * RETURN: Status and pointer to the table | 409 | * RETURN: Status and pointer to the table |
459 | * | 410 | * |
@@ -502,157 +453,13 @@ acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table) | |||
502 | 453 | ||
503 | ACPI_EXPORT_SYMBOL(acpi_get_table_by_index) | 454 | ACPI_EXPORT_SYMBOL(acpi_get_table_by_index) |
504 | 455 | ||
505 | /******************************************************************************* | ||
506 | * | ||
507 | * FUNCTION: acpi_tb_load_namespace | ||
508 | * | ||
509 | * PARAMETERS: None | ||
510 | * | ||
511 | * RETURN: Status | ||
512 | * | ||
513 | * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in | ||
514 | * the RSDT/XSDT. | ||
515 | * | ||
516 | ******************************************************************************/ | ||
517 | static acpi_status acpi_tb_load_namespace(void) | ||
518 | { | ||
519 | acpi_status status; | ||
520 | u32 i; | ||
521 | struct acpi_table_header *new_dsdt; | ||
522 | |||
523 | ACPI_FUNCTION_TRACE(tb_load_namespace); | ||
524 | |||
525 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
526 | |||
527 | /* | ||
528 | * Load the namespace. The DSDT is required, but any SSDT and | ||
529 | * PSDT tables are optional. Verify the DSDT. | ||
530 | */ | ||
531 | if (!acpi_gbl_root_table_list.current_table_count || | ||
532 | !ACPI_COMPARE_NAME(& | ||
533 | (acpi_gbl_root_table_list. | ||
534 | tables[ACPI_TABLE_INDEX_DSDT].signature), | ||
535 | ACPI_SIG_DSDT) | ||
536 | || | ||
537 | ACPI_FAILURE(acpi_tb_verify_table | ||
538 | (&acpi_gbl_root_table_list. | ||
539 | tables[ACPI_TABLE_INDEX_DSDT]))) { | ||
540 | status = AE_NO_ACPI_TABLES; | ||
541 | goto unlock_and_exit; | ||
542 | } | ||
543 | |||
544 | /* | ||
545 | * Save the DSDT pointer for simple access. This is the mapped memory | ||
546 | * address. We must take care here because the address of the .Tables | ||
547 | * array can change dynamically as tables are loaded at run-time. Note: | ||
548 | * .Pointer field is not validated until after call to acpi_tb_verify_table. | ||
549 | */ | ||
550 | acpi_gbl_DSDT = | ||
551 | acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].pointer; | ||
552 | |||
553 | /* | ||
554 | * Optionally copy the entire DSDT to local memory (instead of simply | ||
555 | * mapping it.) There are some BIOSs that corrupt or replace the original | ||
556 | * DSDT, creating the need for this option. Default is FALSE, do not copy | ||
557 | * the DSDT. | ||
558 | */ | ||
559 | if (acpi_gbl_copy_dsdt_locally) { | ||
560 | new_dsdt = acpi_tb_copy_dsdt(ACPI_TABLE_INDEX_DSDT); | ||
561 | if (new_dsdt) { | ||
562 | acpi_gbl_DSDT = new_dsdt; | ||
563 | } | ||
564 | } | ||
565 | |||
566 | /* | ||
567 | * Save the original DSDT header for detection of table corruption | ||
568 | * and/or replacement of the DSDT from outside the OS. | ||
569 | */ | ||
570 | ACPI_MEMCPY(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, | ||
571 | sizeof(struct acpi_table_header)); | ||
572 | |||
573 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
574 | |||
575 | /* Load and parse tables */ | ||
576 | |||
577 | status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); | ||
578 | if (ACPI_FAILURE(status)) { | ||
579 | return_ACPI_STATUS(status); | ||
580 | } | ||
581 | |||
582 | /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ | ||
583 | |||
584 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
585 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { | ||
586 | if ((!ACPI_COMPARE_NAME | ||
587 | (&(acpi_gbl_root_table_list.tables[i].signature), | ||
588 | ACPI_SIG_SSDT) | ||
589 | && | ||
590 | !ACPI_COMPARE_NAME(& | ||
591 | (acpi_gbl_root_table_list.tables[i]. | ||
592 | signature), ACPI_SIG_PSDT)) | ||
593 | || | ||
594 | ACPI_FAILURE(acpi_tb_verify_table | ||
595 | (&acpi_gbl_root_table_list.tables[i]))) { | ||
596 | continue; | ||
597 | } | ||
598 | |||
599 | if (no_auto_ssdt) { | ||
600 | printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); | ||
601 | continue; | ||
602 | } | ||
603 | |||
604 | /* Ignore errors while loading tables, get as many as possible */ | ||
605 | |||
606 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
607 | (void)acpi_ns_load_table(i, acpi_gbl_root_node); | ||
608 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
609 | } | ||
610 | |||
611 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); | ||
612 | |||
613 | unlock_and_exit: | ||
614 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
615 | return_ACPI_STATUS(status); | ||
616 | } | ||
617 | |||
618 | /******************************************************************************* | ||
619 | * | ||
620 | * FUNCTION: acpi_load_tables | ||
621 | * | ||
622 | * PARAMETERS: None | ||
623 | * | ||
624 | * RETURN: Status | ||
625 | * | ||
626 | * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT | ||
627 | * | ||
628 | ******************************************************************************/ | ||
629 | |||
630 | acpi_status acpi_load_tables(void) | ||
631 | { | ||
632 | acpi_status status; | ||
633 | |||
634 | ACPI_FUNCTION_TRACE(acpi_load_tables); | ||
635 | |||
636 | /* Load the namespace from the tables */ | ||
637 | |||
638 | status = acpi_tb_load_namespace(); | ||
639 | if (ACPI_FAILURE(status)) { | ||
640 | ACPI_EXCEPTION((AE_INFO, status, | ||
641 | "While loading namespace from ACPI tables")); | ||
642 | } | ||
643 | |||
644 | return_ACPI_STATUS(status); | ||
645 | } | ||
646 | |||
647 | ACPI_EXPORT_SYMBOL(acpi_load_tables) | ||
648 | |||
649 | 456 | ||
650 | /******************************************************************************* | 457 | /******************************************************************************* |
651 | * | 458 | * |
652 | * FUNCTION: acpi_install_table_handler | 459 | * FUNCTION: acpi_install_table_handler |
653 | * | 460 | * |
654 | * PARAMETERS: Handler - Table event handler | 461 | * PARAMETERS: handler - Table event handler |
655 | * Context - Value passed to the handler on each event | 462 | * context - Value passed to the handler on each event |
656 | * | 463 | * |
657 | * RETURN: Status | 464 | * RETURN: Status |
658 | * | 465 | * |
@@ -698,7 +505,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_table_handler) | |||
698 | * | 505 | * |
699 | * FUNCTION: acpi_remove_table_handler | 506 | * FUNCTION: acpi_remove_table_handler |
700 | * | 507 | * |
701 | * PARAMETERS: Handler - Table event handler that was installed | 508 | * PARAMETERS: handler - Table event handler that was installed |
702 | * previously. | 509 | * previously. |
703 | * | 510 | * |
704 | * RETURN: Status | 511 | * RETURN: Status |
@@ -734,15 +541,3 @@ acpi_status acpi_remove_table_handler(acpi_tbl_handler handler) | |||
734 | } | 541 | } |
735 | 542 | ||
736 | ACPI_EXPORT_SYMBOL(acpi_remove_table_handler) | 543 | ACPI_EXPORT_SYMBOL(acpi_remove_table_handler) |
737 | |||
738 | |||
739 | static int __init acpi_no_auto_ssdt_setup(char *s) { | ||
740 | |||
741 | printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); | ||
742 | |||
743 | no_auto_ssdt = 1; | ||
744 | |||
745 | return 1; | ||
746 | } | ||
747 | |||
748 | __setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); | ||
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c new file mode 100644 index 000000000000..f87cc63e69a1 --- /dev/null +++ b/drivers/acpi/acpica/tbxfload.c | |||
@@ -0,0 +1,389 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Module Name: tbxfload - Table load/unload external interfaces | ||
4 | * | ||
5 | *****************************************************************************/ | ||
6 | |||
7 | /* | ||
8 | * Copyright (C) 2000 - 2012, Intel Corp. | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions, and the following disclaimer, | ||
16 | * without modification. | ||
17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer | ||
18 | * substantially similar to the "NO WARRANTY" disclaimer below | ||
19 | * ("Disclaimer") and any redistribution must be conditioned upon | ||
20 | * including a substantially similar Disclaimer requirement for further | ||
21 | * binary redistribution. | ||
22 | * 3. Neither the names of the above-listed copyright holders nor the names | ||
23 | * of any contributors may be used to endorse or promote products derived | ||
24 | * from this software without specific prior written permission. | ||
25 | * | ||
26 | * Alternatively, this software may be distributed under the terms of the | ||
27 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
28 | * Software Foundation. | ||
29 | * | ||
30 | * NO WARRANTY | ||
31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | ||
34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ||
40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
41 | * POSSIBILITY OF SUCH DAMAGES. | ||
42 | */ | ||
43 | |||
44 | #include <linux/export.h> | ||
45 | #include <acpi/acpi.h> | ||
46 | #include "accommon.h" | ||
47 | #include "acnamesp.h" | ||
48 | #include "actables.h" | ||
49 | |||
50 | #define _COMPONENT ACPI_TABLES | ||
51 | ACPI_MODULE_NAME("tbxfload") | ||
52 | |||
53 | /* Local prototypes */ | ||
54 | static acpi_status acpi_tb_load_namespace(void); | ||
55 | |||
56 | static int no_auto_ssdt; | ||
57 | |||
58 | /******************************************************************************* | ||
59 | * | ||
60 | * FUNCTION: acpi_load_tables | ||
61 | * | ||
62 | * PARAMETERS: None | ||
63 | * | ||
64 | * RETURN: Status | ||
65 | * | ||
66 | * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT | ||
67 | * | ||
68 | ******************************************************************************/ | ||
69 | |||
70 | acpi_status acpi_load_tables(void) | ||
71 | { | ||
72 | acpi_status status; | ||
73 | |||
74 | ACPI_FUNCTION_TRACE(acpi_load_tables); | ||
75 | |||
76 | /* Load the namespace from the tables */ | ||
77 | |||
78 | status = acpi_tb_load_namespace(); | ||
79 | if (ACPI_FAILURE(status)) { | ||
80 | ACPI_EXCEPTION((AE_INFO, status, | ||
81 | "While loading namespace from ACPI tables")); | ||
82 | } | ||
83 | |||
84 | return_ACPI_STATUS(status); | ||
85 | } | ||
86 | |||
87 | ACPI_EXPORT_SYMBOL(acpi_load_tables) | ||
88 | |||
89 | /******************************************************************************* | ||
90 | * | ||
91 | * FUNCTION: acpi_tb_load_namespace | ||
92 | * | ||
93 | * PARAMETERS: None | ||
94 | * | ||
95 | * RETURN: Status | ||
96 | * | ||
97 | * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in | ||
98 | * the RSDT/XSDT. | ||
99 | * | ||
100 | ******************************************************************************/ | ||
101 | static acpi_status acpi_tb_load_namespace(void) | ||
102 | { | ||
103 | acpi_status status; | ||
104 | u32 i; | ||
105 | struct acpi_table_header *new_dsdt; | ||
106 | |||
107 | ACPI_FUNCTION_TRACE(tb_load_namespace); | ||
108 | |||
109 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
110 | |||
111 | /* | ||
112 | * Load the namespace. The DSDT is required, but any SSDT and | ||
113 | * PSDT tables are optional. Verify the DSDT. | ||
114 | */ | ||
115 | if (!acpi_gbl_root_table_list.current_table_count || | ||
116 | !ACPI_COMPARE_NAME(& | ||
117 | (acpi_gbl_root_table_list. | ||
118 | tables[ACPI_TABLE_INDEX_DSDT].signature), | ||
119 | ACPI_SIG_DSDT) | ||
120 | || | ||
121 | ACPI_FAILURE(acpi_tb_verify_table | ||
122 | (&acpi_gbl_root_table_list. | ||
123 | tables[ACPI_TABLE_INDEX_DSDT]))) { | ||
124 | status = AE_NO_ACPI_TABLES; | ||
125 | goto unlock_and_exit; | ||
126 | } | ||
127 | |||
128 | /* | ||
129 | * Save the DSDT pointer for simple access. This is the mapped memory | ||
130 | * address. We must take care here because the address of the .Tables | ||
131 | * array can change dynamically as tables are loaded at run-time. Note: | ||
132 | * .Pointer field is not validated until after call to acpi_tb_verify_table. | ||
133 | */ | ||
134 | acpi_gbl_DSDT = | ||
135 | acpi_gbl_root_table_list.tables[ACPI_TABLE_INDEX_DSDT].pointer; | ||
136 | |||
137 | /* | ||
138 | * Optionally copy the entire DSDT to local memory (instead of simply | ||
139 | * mapping it.) There are some BIOSs that corrupt or replace the original | ||
140 | * DSDT, creating the need for this option. Default is FALSE, do not copy | ||
141 | * the DSDT. | ||
142 | */ | ||
143 | if (acpi_gbl_copy_dsdt_locally) { | ||
144 | new_dsdt = acpi_tb_copy_dsdt(ACPI_TABLE_INDEX_DSDT); | ||
145 | if (new_dsdt) { | ||
146 | acpi_gbl_DSDT = new_dsdt; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | /* | ||
151 | * Save the original DSDT header for detection of table corruption | ||
152 | * and/or replacement of the DSDT from outside the OS. | ||
153 | */ | ||
154 | ACPI_MEMCPY(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, | ||
155 | sizeof(struct acpi_table_header)); | ||
156 | |||
157 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
158 | |||
159 | /* Load and parse tables */ | ||
160 | |||
161 | status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node); | ||
162 | if (ACPI_FAILURE(status)) { | ||
163 | return_ACPI_STATUS(status); | ||
164 | } | ||
165 | |||
166 | /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ | ||
167 | |||
168 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
169 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { | ||
170 | if ((!ACPI_COMPARE_NAME | ||
171 | (&(acpi_gbl_root_table_list.tables[i].signature), | ||
172 | ACPI_SIG_SSDT) | ||
173 | && | ||
174 | !ACPI_COMPARE_NAME(& | ||
175 | (acpi_gbl_root_table_list.tables[i]. | ||
176 | signature), ACPI_SIG_PSDT)) | ||
177 | || | ||
178 | ACPI_FAILURE(acpi_tb_verify_table | ||
179 | (&acpi_gbl_root_table_list.tables[i]))) { | ||
180 | continue; | ||
181 | } | ||
182 | |||
183 | if (no_auto_ssdt) { | ||
184 | printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); | ||
185 | continue; | ||
186 | } | ||
187 | |||
188 | /* Ignore errors while loading tables, get as many as possible */ | ||
189 | |||
190 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
191 | (void)acpi_ns_load_table(i, acpi_gbl_root_node); | ||
192 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
193 | } | ||
194 | |||
195 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); | ||
196 | |||
197 | unlock_and_exit: | ||
198 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
199 | return_ACPI_STATUS(status); | ||
200 | } | ||
201 | |||
202 | /******************************************************************************* | ||
203 | * | ||
204 | * FUNCTION: acpi_load_table | ||
205 | * | ||
206 | * PARAMETERS: table - Pointer to a buffer containing the ACPI | ||
207 | * table to be loaded. | ||
208 | * | ||
209 | * RETURN: Status | ||
210 | * | ||
211 | * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must | ||
212 | * be a valid ACPI table with a valid ACPI table header. | ||
213 | * Note1: Mainly intended to support hotplug addition of SSDTs. | ||
214 | * Note2: Does not copy the incoming table. User is reponsible | ||
215 | * to ensure that the table is not deleted or unmapped. | ||
216 | * | ||
217 | ******************************************************************************/ | ||
218 | |||
219 | acpi_status acpi_load_table(struct acpi_table_header *table) | ||
220 | { | ||
221 | acpi_status status; | ||
222 | struct acpi_table_desc table_desc; | ||
223 | u32 table_index; | ||
224 | |||
225 | ACPI_FUNCTION_TRACE(acpi_load_table); | ||
226 | |||
227 | /* Parameter validation */ | ||
228 | |||
229 | if (!table) { | ||
230 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
231 | } | ||
232 | |||
233 | /* Init local table descriptor */ | ||
234 | |||
235 | ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc)); | ||
236 | table_desc.address = ACPI_PTR_TO_PHYSADDR(table); | ||
237 | table_desc.pointer = table; | ||
238 | table_desc.length = table->length; | ||
239 | table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN; | ||
240 | |||
241 | /* Must acquire the interpreter lock during this operation */ | ||
242 | |||
243 | status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); | ||
244 | if (ACPI_FAILURE(status)) { | ||
245 | return_ACPI_STATUS(status); | ||
246 | } | ||
247 | |||
248 | /* Install the table and load it into the namespace */ | ||
249 | |||
250 | ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:")); | ||
251 | status = acpi_tb_add_table(&table_desc, &table_index); | ||
252 | if (ACPI_FAILURE(status)) { | ||
253 | goto unlock_and_exit; | ||
254 | } | ||
255 | |||
256 | status = acpi_ns_load_table(table_index, acpi_gbl_root_node); | ||
257 | |||
258 | /* Invoke table handler if present */ | ||
259 | |||
260 | if (acpi_gbl_table_handler) { | ||
261 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table, | ||
262 | acpi_gbl_table_handler_context); | ||
263 | } | ||
264 | |||
265 | unlock_and_exit: | ||
266 | (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); | ||
267 | return_ACPI_STATUS(status); | ||
268 | } | ||
269 | |||
270 | ACPI_EXPORT_SYMBOL(acpi_load_table) | ||
271 | |||
272 | /******************************************************************************* | ||
273 | * | ||
274 | * FUNCTION: acpi_unload_parent_table | ||
275 | * | ||
276 | * PARAMETERS: object - Handle to any namespace object owned by | ||
277 | * the table to be unloaded | ||
278 | * | ||
279 | * RETURN: Status | ||
280 | * | ||
281 | * DESCRIPTION: Via any namespace object within an SSDT or OEMx table, unloads | ||
282 | * the table and deletes all namespace objects associated with | ||
283 | * that table. Unloading of the DSDT is not allowed. | ||
284 | * Note: Mainly intended to support hotplug removal of SSDTs. | ||
285 | * | ||
286 | ******************************************************************************/ | ||
287 | acpi_status acpi_unload_parent_table(acpi_handle object) | ||
288 | { | ||
289 | struct acpi_namespace_node *node = | ||
290 | ACPI_CAST_PTR(struct acpi_namespace_node, object); | ||
291 | acpi_status status = AE_NOT_EXIST; | ||
292 | acpi_owner_id owner_id; | ||
293 | u32 i; | ||
294 | |||
295 | ACPI_FUNCTION_TRACE(acpi_unload_parent_table); | ||
296 | |||
297 | /* Parameter validation */ | ||
298 | |||
299 | if (!object) { | ||
300 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
301 | } | ||
302 | |||
303 | /* | ||
304 | * The node owner_id is currently the same as the parent table ID. | ||
305 | * However, this could change in the future. | ||
306 | */ | ||
307 | owner_id = node->owner_id; | ||
308 | if (!owner_id) { | ||
309 | |||
310 | /* owner_id==0 means DSDT is the owner. DSDT cannot be unloaded */ | ||
311 | |||
312 | return_ACPI_STATUS(AE_TYPE); | ||
313 | } | ||
314 | |||
315 | /* Must acquire the interpreter lock during this operation */ | ||
316 | |||
317 | status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); | ||
318 | if (ACPI_FAILURE(status)) { | ||
319 | return_ACPI_STATUS(status); | ||
320 | } | ||
321 | |||
322 | /* Find the table in the global table list */ | ||
323 | |||
324 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; i++) { | ||
325 | if (owner_id != acpi_gbl_root_table_list.tables[i].owner_id) { | ||
326 | continue; | ||
327 | } | ||
328 | |||
329 | /* | ||
330 | * Allow unload of SSDT and OEMx tables only. Do not allow unload | ||
331 | * of the DSDT. No other types of tables should get here, since | ||
332 | * only these types can contain AML and thus are the only types | ||
333 | * that can create namespace objects. | ||
334 | */ | ||
335 | if (ACPI_COMPARE_NAME | ||
336 | (acpi_gbl_root_table_list.tables[i].signature.ascii, | ||
337 | ACPI_SIG_DSDT)) { | ||
338 | status = AE_TYPE; | ||
339 | break; | ||
340 | } | ||
341 | |||
342 | /* Ensure the table is actually loaded */ | ||
343 | |||
344 | if (!acpi_tb_is_table_loaded(i)) { | ||
345 | status = AE_NOT_EXIST; | ||
346 | break; | ||
347 | } | ||
348 | |||
349 | /* Invoke table handler if present */ | ||
350 | |||
351 | if (acpi_gbl_table_handler) { | ||
352 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD, | ||
353 | acpi_gbl_root_table_list. | ||
354 | tables[i].pointer, | ||
355 | acpi_gbl_table_handler_context); | ||
356 | } | ||
357 | |||
358 | /* | ||
359 | * Delete all namespace objects owned by this table. Note that | ||
360 | * these objects can appear anywhere in the namespace by virtue | ||
361 | * of the AML "Scope" operator. Thus, we need to track ownership | ||
362 | * by an ID, not simply a position within the hierarchy. | ||
363 | */ | ||
364 | status = acpi_tb_delete_namespace_by_owner(i); | ||
365 | if (ACPI_FAILURE(status)) { | ||
366 | break; | ||
367 | } | ||
368 | |||
369 | status = acpi_tb_release_owner_id(i); | ||
370 | acpi_tb_set_table_loaded_flag(i, FALSE); | ||
371 | break; | ||
372 | } | ||
373 | |||
374 | (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); | ||
375 | return_ACPI_STATUS(status); | ||
376 | } | ||
377 | |||
378 | ACPI_EXPORT_SYMBOL(acpi_unload_parent_table) | ||
379 | |||
380 | static int __init acpi_no_auto_ssdt_setup(char *s) { | ||
381 | |||
382 | printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); | ||
383 | |||
384 | no_auto_ssdt = 1; | ||
385 | |||
386 | return 1; | ||
387 | } | ||
388 | |||
389 | __setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); | ||
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c index 4258f647ca3d..74e720800037 100644 --- a/drivers/acpi/acpica/tbxfroot.c +++ b/drivers/acpi/acpica/tbxfroot.c | |||
@@ -57,7 +57,7 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp); | |||
57 | * | 57 | * |
58 | * FUNCTION: acpi_tb_validate_rsdp | 58 | * FUNCTION: acpi_tb_validate_rsdp |
59 | * | 59 | * |
60 | * PARAMETERS: Rsdp - Pointer to unvalidated RSDP | 60 | * PARAMETERS: rsdp - Pointer to unvalidated RSDP |
61 | * | 61 | * |
62 | * RETURN: Status | 62 | * RETURN: Status |
63 | * | 63 | * |
@@ -107,10 +107,10 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) | |||
107 | * | 107 | * |
108 | * RETURN: Status, RSDP physical address | 108 | * RETURN: Status, RSDP physical address |
109 | * | 109 | * |
110 | * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor | 110 | * DESCRIPTION: Search lower 1Mbyte of memory for the root system descriptor |
111 | * pointer structure. If it is found, set *RSDP to point to it. | 111 | * pointer structure. If it is found, set *RSDP to point to it. |
112 | * | 112 | * |
113 | * NOTE1: The RSDP must be either in the first 1_k of the Extended | 113 | * NOTE1: The RSDP must be either in the first 1K of the Extended |
114 | * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) | 114 | * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) |
115 | * Only a 32-bit physical address is necessary. | 115 | * Only a 32-bit physical address is necessary. |
116 | * | 116 | * |
@@ -152,7 +152,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) | |||
152 | if (physical_address > 0x400) { | 152 | if (physical_address > 0x400) { |
153 | /* | 153 | /* |
154 | * 1b) Search EBDA paragraphs (EBDA is required to be a | 154 | * 1b) Search EBDA paragraphs (EBDA is required to be a |
155 | * minimum of 1_k length) | 155 | * minimum of 1K length) |
156 | */ | 156 | */ |
157 | table_ptr = acpi_os_map_memory((acpi_physical_address) | 157 | table_ptr = acpi_os_map_memory((acpi_physical_address) |
158 | physical_address, | 158 | physical_address, |
@@ -216,7 +216,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) | |||
216 | 216 | ||
217 | /* A valid RSDP was not found */ | 217 | /* A valid RSDP was not found */ |
218 | 218 | ||
219 | ACPI_ERROR((AE_INFO, "A valid RSDP was not found")); | 219 | ACPI_BIOS_ERROR((AE_INFO, "A valid RSDP was not found")); |
220 | return_ACPI_STATUS(AE_NOT_FOUND); | 220 | return_ACPI_STATUS(AE_NOT_FOUND); |
221 | } | 221 | } |
222 | 222 | ||
@@ -225,7 +225,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) | |||
225 | * FUNCTION: acpi_tb_scan_memory_for_rsdp | 225 | * FUNCTION: acpi_tb_scan_memory_for_rsdp |
226 | * | 226 | * |
227 | * PARAMETERS: start_address - Starting pointer for search | 227 | * PARAMETERS: start_address - Starting pointer for search |
228 | * Length - Maximum length to search | 228 | * length - Maximum length to search |
229 | * | 229 | * |
230 | * RETURN: Pointer to the RSDP if found, otherwise NULL. | 230 | * RETURN: Pointer to the RSDP if found, otherwise NULL. |
231 | * | 231 | * |
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c index 67932aebe6dd..64880306133d 100644 --- a/drivers/acpi/acpica/utaddress.c +++ b/drivers/acpi/acpica/utaddress.c | |||
@@ -53,8 +53,8 @@ ACPI_MODULE_NAME("utaddress") | |||
53 | * FUNCTION: acpi_ut_add_address_range | 53 | * FUNCTION: acpi_ut_add_address_range |
54 | * | 54 | * |
55 | * PARAMETERS: space_id - Address space ID | 55 | * PARAMETERS: space_id - Address space ID |
56 | * Address - op_region start address | 56 | * address - op_region start address |
57 | * Length - op_region length | 57 | * length - op_region length |
58 | * region_node - op_region namespace node | 58 | * region_node - op_region namespace node |
59 | * | 59 | * |
60 | * RETURN: Status | 60 | * RETURN: Status |
@@ -186,9 +186,9 @@ acpi_ut_remove_address_range(acpi_adr_space_type space_id, | |||
186 | * FUNCTION: acpi_ut_check_address_range | 186 | * FUNCTION: acpi_ut_check_address_range |
187 | * | 187 | * |
188 | * PARAMETERS: space_id - Address space ID | 188 | * PARAMETERS: space_id - Address space ID |
189 | * Address - Start address | 189 | * address - Start address |
190 | * Length - Length of address range | 190 | * length - Length of address range |
191 | * Warn - TRUE if warning on overlap desired | 191 | * warn - TRUE if warning on overlap desired |
192 | * | 192 | * |
193 | * RETURN: Count of the number of conflicts detected. Zero is always | 193 | * RETURN: Count of the number of conflicts detected. Zero is always |
194 | * returned for Space IDs other than Memory or I/O. | 194 | * returned for Space IDs other than Memory or I/O. |
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c index 9982d2ea66fb..ed29d474095e 100644 --- a/drivers/acpi/acpica/utalloc.c +++ b/drivers/acpi/acpica/utalloc.c | |||
@@ -189,7 +189,7 @@ acpi_status acpi_ut_delete_caches(void) | |||
189 | * | 189 | * |
190 | * FUNCTION: acpi_ut_validate_buffer | 190 | * FUNCTION: acpi_ut_validate_buffer |
191 | * | 191 | * |
192 | * PARAMETERS: Buffer - Buffer descriptor to be validated | 192 | * PARAMETERS: buffer - Buffer descriptor to be validated |
193 | * | 193 | * |
194 | * RETURN: Status | 194 | * RETURN: Status |
195 | * | 195 | * |
@@ -227,7 +227,7 @@ acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer) | |||
227 | * | 227 | * |
228 | * FUNCTION: acpi_ut_initialize_buffer | 228 | * FUNCTION: acpi_ut_initialize_buffer |
229 | * | 229 | * |
230 | * PARAMETERS: Buffer - Buffer to be validated | 230 | * PARAMETERS: buffer - Buffer to be validated |
231 | * required_length - Length needed | 231 | * required_length - Length needed |
232 | * | 232 | * |
233 | * RETURN: Status | 233 | * RETURN: Status |
@@ -308,10 +308,10 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, | |||
308 | * | 308 | * |
309 | * FUNCTION: acpi_ut_allocate | 309 | * FUNCTION: acpi_ut_allocate |
310 | * | 310 | * |
311 | * PARAMETERS: Size - Size of the allocation | 311 | * PARAMETERS: size - Size of the allocation |
312 | * Component - Component type of caller | 312 | * component - Component type of caller |
313 | * Module - Source file name of caller | 313 | * module - Source file name of caller |
314 | * Line - Line number of caller | 314 | * line - Line number of caller |
315 | * | 315 | * |
316 | * RETURN: Address of the allocated memory on success, NULL on failure. | 316 | * RETURN: Address of the allocated memory on success, NULL on failure. |
317 | * | 317 | * |
@@ -352,10 +352,10 @@ void *acpi_ut_allocate(acpi_size size, | |||
352 | * | 352 | * |
353 | * FUNCTION: acpi_ut_allocate_zeroed | 353 | * FUNCTION: acpi_ut_allocate_zeroed |
354 | * | 354 | * |
355 | * PARAMETERS: Size - Size of the allocation | 355 | * PARAMETERS: size - Size of the allocation |
356 | * Component - Component type of caller | 356 | * component - Component type of caller |
357 | * Module - Source file name of caller | 357 | * module - Source file name of caller |
358 | * Line - Line number of caller | 358 | * line - Line number of caller |
359 | * | 359 | * |
360 | * RETURN: Address of the allocated memory on success, NULL on failure. | 360 | * RETURN: Address of the allocated memory on success, NULL on failure. |
361 | * | 361 | * |
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c index 3317c0a406ee..294692ae76e9 100644 --- a/drivers/acpi/acpica/utcopy.c +++ b/drivers/acpi/acpica/utcopy.c | |||
@@ -317,7 +317,7 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type, | |||
317 | * FUNCTION: acpi_ut_copy_ipackage_to_epackage | 317 | * FUNCTION: acpi_ut_copy_ipackage_to_epackage |
318 | * | 318 | * |
319 | * PARAMETERS: internal_object - Pointer to the object we are returning | 319 | * PARAMETERS: internal_object - Pointer to the object we are returning |
320 | * Buffer - Where the object is returned | 320 | * buffer - Where the object is returned |
321 | * space_used - Where the object length is returned | 321 | * space_used - Where the object length is returned |
322 | * | 322 | * |
323 | * RETURN: Status | 323 | * RETURN: Status |
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c index a0998a886318..e810894149ae 100644 --- a/drivers/acpi/acpica/utdebug.c +++ b/drivers/acpi/acpica/utdebug.c | |||
@@ -145,7 +145,7 @@ static const char *acpi_ut_trim_function_name(const char *function_name) | |||
145 | * function_name - Caller's procedure name | 145 | * function_name - Caller's procedure name |
146 | * module_name - Caller's module name | 146 | * module_name - Caller's module name |
147 | * component_id - Caller's component ID | 147 | * component_id - Caller's component ID |
148 | * Format - Printf format field | 148 | * format - Printf format field |
149 | * ... - Optional printf arguments | 149 | * ... - Optional printf arguments |
150 | * | 150 | * |
151 | * RETURN: None | 151 | * RETURN: None |
@@ -217,7 +217,7 @@ ACPI_EXPORT_SYMBOL(acpi_debug_print) | |||
217 | * function_name - Caller's procedure name | 217 | * function_name - Caller's procedure name |
218 | * module_name - Caller's module name | 218 | * module_name - Caller's module name |
219 | * component_id - Caller's component ID | 219 | * component_id - Caller's component ID |
220 | * Format - Printf format field | 220 | * format - Printf format field |
221 | * ... - Optional printf arguments | 221 | * ... - Optional printf arguments |
222 | * | 222 | * |
223 | * RETURN: None | 223 | * RETURN: None |
@@ -286,7 +286,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_trace) | |||
286 | * function_name - Caller's procedure name | 286 | * function_name - Caller's procedure name |
287 | * module_name - Caller's module name | 287 | * module_name - Caller's module name |
288 | * component_id - Caller's component ID | 288 | * component_id - Caller's component ID |
289 | * Pointer - Pointer to display | 289 | * pointer - Pointer to display |
290 | * | 290 | * |
291 | * RETURN: None | 291 | * RETURN: None |
292 | * | 292 | * |
@@ -315,7 +315,7 @@ acpi_ut_trace_ptr(u32 line_number, | |||
315 | * function_name - Caller's procedure name | 315 | * function_name - Caller's procedure name |
316 | * module_name - Caller's module name | 316 | * module_name - Caller's module name |
317 | * component_id - Caller's component ID | 317 | * component_id - Caller's component ID |
318 | * String - Additional string to display | 318 | * string - Additional string to display |
319 | * | 319 | * |
320 | * RETURN: None | 320 | * RETURN: None |
321 | * | 321 | * |
@@ -346,7 +346,7 @@ acpi_ut_trace_str(u32 line_number, | |||
346 | * function_name - Caller's procedure name | 346 | * function_name - Caller's procedure name |
347 | * module_name - Caller's module name | 347 | * module_name - Caller's module name |
348 | * component_id - Caller's component ID | 348 | * component_id - Caller's component ID |
349 | * Integer - Integer to display | 349 | * integer - Integer to display |
350 | * | 350 | * |
351 | * RETURN: None | 351 | * RETURN: None |
352 | * | 352 | * |
@@ -408,7 +408,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_exit) | |||
408 | * function_name - Caller's procedure name | 408 | * function_name - Caller's procedure name |
409 | * module_name - Caller's module name | 409 | * module_name - Caller's module name |
410 | * component_id - Caller's component ID | 410 | * component_id - Caller's component ID |
411 | * Status - Exit status code | 411 | * status - Exit status code |
412 | * | 412 | * |
413 | * RETURN: None | 413 | * RETURN: None |
414 | * | 414 | * |
@@ -449,7 +449,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_status_exit) | |||
449 | * function_name - Caller's procedure name | 449 | * function_name - Caller's procedure name |
450 | * module_name - Caller's module name | 450 | * module_name - Caller's module name |
451 | * component_id - Caller's component ID | 451 | * component_id - Caller's component ID |
452 | * Value - Value to be printed with exit msg | 452 | * value - Value to be printed with exit msg |
453 | * | 453 | * |
454 | * RETURN: None | 454 | * RETURN: None |
455 | * | 455 | * |
@@ -481,7 +481,7 @@ ACPI_EXPORT_SYMBOL(acpi_ut_value_exit) | |||
481 | * function_name - Caller's procedure name | 481 | * function_name - Caller's procedure name |
482 | * module_name - Caller's module name | 482 | * module_name - Caller's module name |
483 | * component_id - Caller's component ID | 483 | * component_id - Caller's component ID |
484 | * Ptr - Pointer to display | 484 | * ptr - Pointer to display |
485 | * | 485 | * |
486 | * RETURN: None | 486 | * RETURN: None |
487 | * | 487 | * |
@@ -508,10 +508,10 @@ acpi_ut_ptr_exit(u32 line_number, | |||
508 | * | 508 | * |
509 | * FUNCTION: acpi_ut_dump_buffer | 509 | * FUNCTION: acpi_ut_dump_buffer |
510 | * | 510 | * |
511 | * PARAMETERS: Buffer - Buffer to dump | 511 | * PARAMETERS: buffer - Buffer to dump |
512 | * Count - Amount to dump, in bytes | 512 | * count - Amount to dump, in bytes |
513 | * Display - BYTE, WORD, DWORD, or QWORD display | 513 | * display - BYTE, WORD, DWORD, or QWORD display |
514 | * component_iD - Caller's component ID | 514 | * component_ID - Caller's component ID |
515 | * | 515 | * |
516 | * RETURN: None | 516 | * RETURN: None |
517 | * | 517 | * |
@@ -625,10 +625,10 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display) | |||
625 | * | 625 | * |
626 | * FUNCTION: acpi_ut_dump_buffer | 626 | * FUNCTION: acpi_ut_dump_buffer |
627 | * | 627 | * |
628 | * PARAMETERS: Buffer - Buffer to dump | 628 | * PARAMETERS: buffer - Buffer to dump |
629 | * Count - Amount to dump, in bytes | 629 | * count - Amount to dump, in bytes |
630 | * Display - BYTE, WORD, DWORD, or QWORD display | 630 | * display - BYTE, WORD, DWORD, or QWORD display |
631 | * component_iD - Caller's component ID | 631 | * component_ID - Caller's component ID |
632 | * | 632 | * |
633 | * RETURN: None | 633 | * RETURN: None |
634 | * | 634 | * |
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c index 684849949bf3..60a158472d82 100644 --- a/drivers/acpi/acpica/utdecode.c +++ b/drivers/acpi/acpica/utdecode.c | |||
@@ -49,41 +49,6 @@ | |||
49 | #define _COMPONENT ACPI_UTILITIES | 49 | #define _COMPONENT ACPI_UTILITIES |
50 | ACPI_MODULE_NAME("utdecode") | 50 | ACPI_MODULE_NAME("utdecode") |
51 | 51 | ||
52 | /******************************************************************************* | ||
53 | * | ||
54 | * FUNCTION: acpi_format_exception | ||
55 | * | ||
56 | * PARAMETERS: Status - The acpi_status code to be formatted | ||
57 | * | ||
58 | * RETURN: A string containing the exception text. A valid pointer is | ||
59 | * always returned. | ||
60 | * | ||
61 | * DESCRIPTION: This function translates an ACPI exception into an ASCII string | ||
62 | * It is here instead of utxface.c so it is always present. | ||
63 | * | ||
64 | ******************************************************************************/ | ||
65 | const char *acpi_format_exception(acpi_status status) | ||
66 | { | ||
67 | const char *exception = NULL; | ||
68 | |||
69 | ACPI_FUNCTION_ENTRY(); | ||
70 | |||
71 | exception = acpi_ut_validate_exception(status); | ||
72 | if (!exception) { | ||
73 | |||
74 | /* Exception code was not recognized */ | ||
75 | |||
76 | ACPI_ERROR((AE_INFO, | ||
77 | "Unknown exception code: 0x%8.8X", status)); | ||
78 | |||
79 | exception = "UNKNOWN_STATUS_CODE"; | ||
80 | } | ||
81 | |||
82 | return (ACPI_CAST_PTR(const char, exception)); | ||
83 | } | ||
84 | |||
85 | ACPI_EXPORT_SYMBOL(acpi_format_exception) | ||
86 | |||
87 | /* | 52 | /* |
88 | * Properties of the ACPI Object Types, both internal and external. | 53 | * Properties of the ACPI Object Types, both internal and external. |
89 | * The table is indexed by values of acpi_object_type | 54 | * The table is indexed by values of acpi_object_type |
@@ -126,8 +91,8 @@ const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES] = { | |||
126 | * | 91 | * |
127 | * FUNCTION: acpi_ut_hex_to_ascii_char | 92 | * FUNCTION: acpi_ut_hex_to_ascii_char |
128 | * | 93 | * |
129 | * PARAMETERS: Integer - Contains the hex digit | 94 | * PARAMETERS: integer - Contains the hex digit |
130 | * Position - bit position of the digit within the | 95 | * position - bit position of the digit within the |
131 | * integer (multiple of 4) | 96 | * integer (multiple of 4) |
132 | * | 97 | * |
133 | * RETURN: The converted Ascii character | 98 | * RETURN: The converted Ascii character |
@@ -164,16 +129,17 @@ char acpi_ut_hex_to_ascii_char(u64 integer, u32 position) | |||
164 | /* Region type decoding */ | 129 | /* Region type decoding */ |
165 | 130 | ||
166 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { | 131 | const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { |
167 | "SystemMemory", | 132 | "SystemMemory", /* 0x00 */ |
168 | "SystemIO", | 133 | "SystemIO", /* 0x01 */ |
169 | "PCI_Config", | 134 | "PCI_Config", /* 0x02 */ |
170 | "EmbeddedControl", | 135 | "EmbeddedControl", /* 0x03 */ |
171 | "SMBus", | 136 | "SMBus", /* 0x04 */ |
172 | "SystemCMOS", | 137 | "SystemCMOS", /* 0x05 */ |
173 | "PCIBARTarget", | 138 | "PCIBARTarget", /* 0x06 */ |
174 | "IPMI", | 139 | "IPMI", /* 0x07 */ |
175 | "GeneralPurposeIo", | 140 | "GeneralPurposeIo", /* 0x08 */ |
176 | "GenericSerialBus" | 141 | "GenericSerialBus", /* 0x09 */ |
142 | "PCC" /* 0x0A */ | ||
177 | }; | 143 | }; |
178 | 144 | ||
179 | char *acpi_ut_get_region_name(u8 space_id) | 145 | char *acpi_ut_get_region_name(u8 space_id) |
@@ -228,7 +194,7 @@ char *acpi_ut_get_event_name(u32 event_id) | |||
228 | * | 194 | * |
229 | * FUNCTION: acpi_ut_get_type_name | 195 | * FUNCTION: acpi_ut_get_type_name |
230 | * | 196 | * |
231 | * PARAMETERS: Type - An ACPI object type | 197 | * PARAMETERS: type - An ACPI object type |
232 | * | 198 | * |
233 | * RETURN: Decoded ACPI object type name | 199 | * RETURN: Decoded ACPI object type name |
234 | * | 200 | * |
@@ -306,7 +272,7 @@ char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc) | |||
306 | * | 272 | * |
307 | * FUNCTION: acpi_ut_get_node_name | 273 | * FUNCTION: acpi_ut_get_node_name |
308 | * | 274 | * |
309 | * PARAMETERS: Object - A namespace node | 275 | * PARAMETERS: object - A namespace node |
310 | * | 276 | * |
311 | * RETURN: ASCII name of the node | 277 | * RETURN: ASCII name of the node |
312 | * | 278 | * |
@@ -351,7 +317,7 @@ char *acpi_ut_get_node_name(void *object) | |||
351 | * | 317 | * |
352 | * FUNCTION: acpi_ut_get_descriptor_name | 318 | * FUNCTION: acpi_ut_get_descriptor_name |
353 | * | 319 | * |
354 | * PARAMETERS: Object - An ACPI object | 320 | * PARAMETERS: object - An ACPI object |
355 | * | 321 | * |
356 | * RETURN: Decoded name of the descriptor type | 322 | * RETURN: Decoded name of the descriptor type |
357 | * | 323 | * |
@@ -401,7 +367,7 @@ char *acpi_ut_get_descriptor_name(void *object) | |||
401 | * | 367 | * |
402 | * FUNCTION: acpi_ut_get_reference_name | 368 | * FUNCTION: acpi_ut_get_reference_name |
403 | * | 369 | * |
404 | * PARAMETERS: Object - An ACPI reference object | 370 | * PARAMETERS: object - An ACPI reference object |
405 | * | 371 | * |
406 | * RETURN: Decoded name of the type of reference | 372 | * RETURN: Decoded name of the type of reference |
407 | * | 373 | * |
@@ -532,7 +498,7 @@ const char *acpi_ut_get_notify_name(u32 notify_value) | |||
532 | * | 498 | * |
533 | * FUNCTION: acpi_ut_valid_object_type | 499 | * FUNCTION: acpi_ut_valid_object_type |
534 | * | 500 | * |
535 | * PARAMETERS: Type - Object type to be validated | 501 | * PARAMETERS: type - Object type to be validated |
536 | * | 502 | * |
537 | * RETURN: TRUE if valid object type, FALSE otherwise | 503 | * RETURN: TRUE if valid object type, FALSE otherwise |
538 | * | 504 | * |
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c index 2a6c3e183697..798105443d0f 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c | |||
@@ -60,7 +60,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action); | |||
60 | * | 60 | * |
61 | * FUNCTION: acpi_ut_delete_internal_obj | 61 | * FUNCTION: acpi_ut_delete_internal_obj |
62 | * | 62 | * |
63 | * PARAMETERS: Object - Object to be deleted | 63 | * PARAMETERS: object - Object to be deleted |
64 | * | 64 | * |
65 | * RETURN: None | 65 | * RETURN: None |
66 | * | 66 | * |
@@ -152,7 +152,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) | |||
152 | case ACPI_TYPE_PROCESSOR: | 152 | case ACPI_TYPE_PROCESSOR: |
153 | case ACPI_TYPE_THERMAL: | 153 | case ACPI_TYPE_THERMAL: |
154 | 154 | ||
155 | /* Walk the notify handler list for this object */ | 155 | /* Walk the address handler list for this object */ |
156 | 156 | ||
157 | handler_desc = object->common_notify.handler; | 157 | handler_desc = object->common_notify.handler; |
158 | while (handler_desc) { | 158 | while (handler_desc) { |
@@ -358,8 +358,8 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list) | |||
358 | * | 358 | * |
359 | * FUNCTION: acpi_ut_update_ref_count | 359 | * FUNCTION: acpi_ut_update_ref_count |
360 | * | 360 | * |
361 | * PARAMETERS: Object - Object whose ref count is to be updated | 361 | * PARAMETERS: object - Object whose ref count is to be updated |
362 | * Action - What to do | 362 | * action - What to do |
363 | * | 363 | * |
364 | * RETURN: New ref count | 364 | * RETURN: New ref count |
365 | * | 365 | * |
@@ -456,9 +456,9 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) | |||
456 | * | 456 | * |
457 | * FUNCTION: acpi_ut_update_object_reference | 457 | * FUNCTION: acpi_ut_update_object_reference |
458 | * | 458 | * |
459 | * PARAMETERS: Object - Increment ref count for this object | 459 | * PARAMETERS: object - Increment ref count for this object |
460 | * and all sub-objects | 460 | * and all sub-objects |
461 | * Action - Either REF_INCREMENT or REF_DECREMENT or | 461 | * action - Either REF_INCREMENT or REF_DECREMENT or |
462 | * REF_FORCE_DELETE | 462 | * REF_FORCE_DELETE |
463 | * | 463 | * |
464 | * RETURN: Status | 464 | * RETURN: Status |
@@ -480,6 +480,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
480 | acpi_status status = AE_OK; | 480 | acpi_status status = AE_OK; |
481 | union acpi_generic_state *state_list = NULL; | 481 | union acpi_generic_state *state_list = NULL; |
482 | union acpi_operand_object *next_object = NULL; | 482 | union acpi_operand_object *next_object = NULL; |
483 | union acpi_operand_object *prev_object; | ||
483 | union acpi_generic_state *state; | 484 | union acpi_generic_state *state; |
484 | u32 i; | 485 | u32 i; |
485 | 486 | ||
@@ -505,12 +506,21 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
505 | case ACPI_TYPE_POWER: | 506 | case ACPI_TYPE_POWER: |
506 | case ACPI_TYPE_THERMAL: | 507 | case ACPI_TYPE_THERMAL: |
507 | 508 | ||
508 | /* Update the notify objects for these types (if present) */ | 509 | /* |
509 | 510 | * Update the notify objects for these types (if present) | |
510 | acpi_ut_update_ref_count(object->common_notify. | 511 | * Two lists, system and device notify handlers. |
511 | system_notify, action); | 512 | */ |
512 | acpi_ut_update_ref_count(object->common_notify. | 513 | for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) { |
513 | device_notify, action); | 514 | prev_object = |
515 | object->common_notify.notify_list[i]; | ||
516 | while (prev_object) { | ||
517 | next_object = | ||
518 | prev_object->notify.next[i]; | ||
519 | acpi_ut_update_ref_count(prev_object, | ||
520 | action); | ||
521 | prev_object = next_object; | ||
522 | } | ||
523 | } | ||
514 | break; | 524 | break; |
515 | 525 | ||
516 | case ACPI_TYPE_PACKAGE: | 526 | case ACPI_TYPE_PACKAGE: |
@@ -630,7 +640,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
630 | * | 640 | * |
631 | * FUNCTION: acpi_ut_add_reference | 641 | * FUNCTION: acpi_ut_add_reference |
632 | * | 642 | * |
633 | * PARAMETERS: Object - Object whose reference count is to be | 643 | * PARAMETERS: object - Object whose reference count is to be |
634 | * incremented | 644 | * incremented |
635 | * | 645 | * |
636 | * RETURN: None | 646 | * RETURN: None |
@@ -664,7 +674,7 @@ void acpi_ut_add_reference(union acpi_operand_object *object) | |||
664 | * | 674 | * |
665 | * FUNCTION: acpi_ut_remove_reference | 675 | * FUNCTION: acpi_ut_remove_reference |
666 | * | 676 | * |
667 | * PARAMETERS: Object - Object whose ref count will be decremented | 677 | * PARAMETERS: object - Object whose ref count will be decremented |
668 | * | 678 | * |
669 | * RETURN: None | 679 | * RETURN: None |
670 | * | 680 | * |
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c index 479f32b33415..a9c65fbea5f4 100644 --- a/drivers/acpi/acpica/uteval.c +++ b/drivers/acpi/acpica/uteval.c | |||
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("uteval") | |||
53 | * FUNCTION: acpi_ut_evaluate_object | 53 | * FUNCTION: acpi_ut_evaluate_object |
54 | * | 54 | * |
55 | * PARAMETERS: prefix_node - Starting node | 55 | * PARAMETERS: prefix_node - Starting node |
56 | * Path - Path to object from starting node | 56 | * path - Path to object from starting node |
57 | * expected_return_types - Bitmap of allowed return types | 57 | * expected_return_types - Bitmap of allowed return types |
58 | * return_desc - Where a return value is stored | 58 | * return_desc - Where a return value is stored |
59 | * | 59 | * |
@@ -187,7 +187,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, | |||
187 | * | 187 | * |
188 | * PARAMETERS: object_name - Object name to be evaluated | 188 | * PARAMETERS: object_name - Object name to be evaluated |
189 | * device_node - Node for the device | 189 | * device_node - Node for the device |
190 | * Value - Where the value is returned | 190 | * value - Where the value is returned |
191 | * | 191 | * |
192 | * RETURN: Status | 192 | * RETURN: Status |
193 | * | 193 | * |
@@ -229,7 +229,7 @@ acpi_ut_evaluate_numeric_object(char *object_name, | |||
229 | * FUNCTION: acpi_ut_execute_STA | 229 | * FUNCTION: acpi_ut_execute_STA |
230 | * | 230 | * |
231 | * PARAMETERS: device_node - Node for the device | 231 | * PARAMETERS: device_node - Node for the device |
232 | * Flags - Where the status flags are returned | 232 | * flags - Where the status flags are returned |
233 | * | 233 | * |
234 | * RETURN: Status | 234 | * RETURN: Status |
235 | * | 235 | * |
diff --git a/drivers/acpi/acpica/utexcep.c b/drivers/acpi/acpica/utexcep.c new file mode 100644 index 000000000000..23b98945f6b7 --- /dev/null +++ b/drivers/acpi/acpica/utexcep.c | |||
@@ -0,0 +1,153 @@ | |||
1 | /******************************************************************************* | ||
2 | * | ||
3 | * Module Name: utexcep - Exception code support | ||
4 | * | ||
5 | ******************************************************************************/ | ||
6 | |||
7 | /* | ||
8 | * Copyright (C) 2000 - 2012, Intel Corp. | ||
9 | * All rights reserved. | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions, and the following disclaimer, | ||
16 | * without modification. | ||
17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer | ||
18 | * substantially similar to the "NO WARRANTY" disclaimer below | ||
19 | * ("Disclaimer") and any redistribution must be conditioned upon | ||
20 | * including a substantially similar Disclaimer requirement for further | ||
21 | * binary redistribution. | ||
22 | * 3. Neither the names of the above-listed copyright holders nor the names | ||
23 | * of any contributors may be used to endorse or promote products derived | ||
24 | * from this software without specific prior written permission. | ||
25 | * | ||
26 | * Alternatively, this software may be distributed under the terms of the | ||
27 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
28 | * Software Foundation. | ||
29 | * | ||
30 | * NO WARRANTY | ||
31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR | ||
34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ||
40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
41 | * POSSIBILITY OF SUCH DAMAGES. | ||
42 | */ | ||
43 | |||
44 | #define ACPI_DEFINE_EXCEPTION_TABLE | ||
45 | #include <linux/export.h> | ||
46 | #include <acpi/acpi.h> | ||
47 | #include "accommon.h" | ||
48 | |||
49 | #define _COMPONENT ACPI_UTILITIES | ||
50 | ACPI_MODULE_NAME("utexcep") | ||
51 | |||
52 | /******************************************************************************* | ||
53 | * | ||
54 | * FUNCTION: acpi_format_exception | ||
55 | * | ||
56 | * PARAMETERS: status - The acpi_status code to be formatted | ||
57 | * | ||
58 | * RETURN: A string containing the exception text. A valid pointer is | ||
59 | * always returned. | ||
60 | * | ||
61 | * DESCRIPTION: This function translates an ACPI exception into an ASCII | ||
62 | * string. Returns "unknown status" string for invalid codes. | ||
63 | * | ||
64 | ******************************************************************************/ | ||
65 | const char *acpi_format_exception(acpi_status status) | ||
66 | { | ||
67 | const char *exception = NULL; | ||
68 | |||
69 | ACPI_FUNCTION_ENTRY(); | ||
70 | |||
71 | exception = acpi_ut_validate_exception(status); | ||
72 | if (!exception) { | ||
73 | |||
74 | /* Exception code was not recognized */ | ||
75 | |||
76 | ACPI_ERROR((AE_INFO, | ||
77 | "Unknown exception code: 0x%8.8X", status)); | ||
78 | |||
79 | exception = "UNKNOWN_STATUS_CODE"; | ||
80 | } | ||
81 | |||
82 | return (ACPI_CAST_PTR(const char, exception)); | ||
83 | } | ||
84 | |||
85 | ACPI_EXPORT_SYMBOL(acpi_format_exception) | ||
86 | |||
87 | /******************************************************************************* | ||
88 | * | ||
89 | * FUNCTION: acpi_ut_validate_exception | ||
90 | * | ||
91 | * PARAMETERS: status - The acpi_status code to be formatted | ||
92 | * | ||
93 | * RETURN: A string containing the exception text. NULL if exception is | ||
94 | * not valid. | ||
95 | * | ||
96 | * DESCRIPTION: This function validates and translates an ACPI exception into | ||
97 | * an ASCII string. | ||
98 | * | ||
99 | ******************************************************************************/ | ||
100 | const char *acpi_ut_validate_exception(acpi_status status) | ||
101 | { | ||
102 | u32 sub_status; | ||
103 | const char *exception = NULL; | ||
104 | |||
105 | ACPI_FUNCTION_ENTRY(); | ||
106 | |||
107 | /* | ||
108 | * Status is composed of two parts, a "type" and an actual code | ||
109 | */ | ||
110 | sub_status = (status & ~AE_CODE_MASK); | ||
111 | |||
112 | switch (status & AE_CODE_MASK) { | ||
113 | case AE_CODE_ENVIRONMENTAL: | ||
114 | |||
115 | if (sub_status <= AE_CODE_ENV_MAX) { | ||
116 | exception = acpi_gbl_exception_names_env[sub_status]; | ||
117 | } | ||
118 | break; | ||
119 | |||
120 | case AE_CODE_PROGRAMMER: | ||
121 | |||
122 | if (sub_status <= AE_CODE_PGM_MAX) { | ||
123 | exception = acpi_gbl_exception_names_pgm[sub_status]; | ||
124 | } | ||
125 | break; | ||
126 | |||
127 | case AE_CODE_ACPI_TABLES: | ||
128 | |||
129 | if (sub_status <= AE_CODE_TBL_MAX) { | ||
130 | exception = acpi_gbl_exception_names_tbl[sub_status]; | ||
131 | } | ||
132 | break; | ||
133 | |||
134 | case AE_CODE_AML: | ||
135 | |||
136 | if (sub_status <= AE_CODE_AML_MAX) { | ||
137 | exception = acpi_gbl_exception_names_aml[sub_status]; | ||
138 | } | ||
139 | break; | ||
140 | |||
141 | case AE_CODE_CONTROL: | ||
142 | |||
143 | if (sub_status <= AE_CODE_CTRL_MAX) { | ||
144 | exception = acpi_gbl_exception_names_ctrl[sub_status]; | ||
145 | } | ||
146 | break; | ||
147 | |||
148 | default: | ||
149 | break; | ||
150 | } | ||
151 | |||
152 | return (ACPI_CAST_PTR(const char, exception)); | ||
153 | } | ||
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index 90f53b42eca9..ed1893155f8b 100644 --- a/drivers/acpi/acpica/utglobal.c +++ b/drivers/acpi/acpica/utglobal.c | |||
@@ -247,8 +247,9 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = | |||
247 | * | 247 | * |
248 | * RETURN: Status | 248 | * RETURN: Status |
249 | * | 249 | * |
250 | * DESCRIPTION: Init library globals. All globals that require specific | 250 | * DESCRIPTION: Initialize ACPICA globals. All globals that require specific |
251 | * initialization should be initialized here! | 251 | * initialization should be initialized here. This allows for |
252 | * a warm restart. | ||
252 | * | 253 | * |
253 | ******************************************************************************/ | 254 | ******************************************************************************/ |
254 | 255 | ||
@@ -284,7 +285,7 @@ acpi_status acpi_ut_init_globals(void) | |||
284 | acpi_gbl_owner_id_mask[i] = 0; | 285 | acpi_gbl_owner_id_mask[i] = 0; |
285 | } | 286 | } |
286 | 287 | ||
287 | /* Last owner_iD is never valid */ | 288 | /* Last owner_ID is never valid */ |
288 | 289 | ||
289 | acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; | 290 | acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; |
290 | 291 | ||
@@ -304,8 +305,8 @@ acpi_status acpi_ut_init_globals(void) | |||
304 | 305 | ||
305 | /* Global handlers */ | 306 | /* Global handlers */ |
306 | 307 | ||
307 | acpi_gbl_system_notify.handler = NULL; | 308 | acpi_gbl_global_notify[0].handler = NULL; |
308 | acpi_gbl_device_notify.handler = NULL; | 309 | acpi_gbl_global_notify[1].handler = NULL; |
309 | acpi_gbl_exception_handler = NULL; | 310 | acpi_gbl_exception_handler = NULL; |
310 | acpi_gbl_init_handler = NULL; | 311 | acpi_gbl_init_handler = NULL; |
311 | acpi_gbl_table_handler = NULL; | 312 | acpi_gbl_table_handler = NULL; |
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c index c92eb1d93785..5d84e1954575 100644 --- a/drivers/acpi/acpica/utids.c +++ b/drivers/acpi/acpica/utids.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Module Name: utids - support for device IDs - HID, UID, CID | 3 | * Module Name: utids - support for device Ids - HID, UID, CID |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
diff --git a/drivers/acpi/acpica/utlock.c b/drivers/acpi/acpica/utlock.c index 155fd786d0f2..b1eb7f17e110 100644 --- a/drivers/acpi/acpica/utlock.c +++ b/drivers/acpi/acpica/utlock.c | |||
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("utlock") | |||
52 | * FUNCTION: acpi_ut_create_rw_lock | 52 | * FUNCTION: acpi_ut_create_rw_lock |
53 | * acpi_ut_delete_rw_lock | 53 | * acpi_ut_delete_rw_lock |
54 | * | 54 | * |
55 | * PARAMETERS: Lock - Pointer to a valid RW lock | 55 | * PARAMETERS: lock - Pointer to a valid RW lock |
56 | * | 56 | * |
57 | * RETURN: Status | 57 | * RETURN: Status |
58 | * | 58 | * |
@@ -89,7 +89,7 @@ void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock) | |||
89 | * FUNCTION: acpi_ut_acquire_read_lock | 89 | * FUNCTION: acpi_ut_acquire_read_lock |
90 | * acpi_ut_release_read_lock | 90 | * acpi_ut_release_read_lock |
91 | * | 91 | * |
92 | * PARAMETERS: Lock - Pointer to a valid RW lock | 92 | * PARAMETERS: lock - Pointer to a valid RW lock |
93 | * | 93 | * |
94 | * RETURN: Status | 94 | * RETURN: Status |
95 | * | 95 | * |
@@ -149,7 +149,7 @@ acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock) | |||
149 | * FUNCTION: acpi_ut_acquire_write_lock | 149 | * FUNCTION: acpi_ut_acquire_write_lock |
150 | * acpi_ut_release_write_lock | 150 | * acpi_ut_release_write_lock |
151 | * | 151 | * |
152 | * PARAMETERS: Lock - Pointer to a valid RW lock | 152 | * PARAMETERS: lock - Pointer to a valid RW lock |
153 | * | 153 | * |
154 | * RETURN: Status | 154 | * RETURN: Status |
155 | * | 155 | * |
diff --git a/drivers/acpi/acpica/utmath.c b/drivers/acpi/acpica/utmath.c index 2491a552b0e6..d88a8aaab2a6 100644 --- a/drivers/acpi/acpica/utmath.c +++ b/drivers/acpi/acpica/utmath.c | |||
@@ -73,8 +73,8 @@ typedef union uint64_overlay { | |||
73 | * | 73 | * |
74 | * FUNCTION: acpi_ut_short_divide | 74 | * FUNCTION: acpi_ut_short_divide |
75 | * | 75 | * |
76 | * PARAMETERS: Dividend - 64-bit dividend | 76 | * PARAMETERS: dividend - 64-bit dividend |
77 | * Divisor - 32-bit divisor | 77 | * divisor - 32-bit divisor |
78 | * out_quotient - Pointer to where the quotient is returned | 78 | * out_quotient - Pointer to where the quotient is returned |
79 | * out_remainder - Pointer to where the remainder is returned | 79 | * out_remainder - Pointer to where the remainder is returned |
80 | * | 80 | * |
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c index 86f19db74e05..33c6cf7ff467 100644 --- a/drivers/acpi/acpica/utmisc.c +++ b/drivers/acpi/acpica/utmisc.c | |||
@@ -50,79 +50,41 @@ | |||
50 | #define _COMPONENT ACPI_UTILITIES | 50 | #define _COMPONENT ACPI_UTILITIES |
51 | ACPI_MODULE_NAME("utmisc") | 51 | ACPI_MODULE_NAME("utmisc") |
52 | 52 | ||
53 | #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP | ||
53 | /******************************************************************************* | 54 | /******************************************************************************* |
54 | * | 55 | * |
55 | * FUNCTION: acpi_ut_validate_exception | 56 | * FUNCTION: ut_convert_backslashes |
56 | * | 57 | * |
57 | * PARAMETERS: Status - The acpi_status code to be formatted | 58 | * PARAMETERS: pathname - File pathname string to be converted |
58 | * | 59 | * |
59 | * RETURN: A string containing the exception text. NULL if exception is | 60 | * RETURN: Modifies the input Pathname |
60 | * not valid. | ||
61 | * | 61 | * |
62 | * DESCRIPTION: This function validates and translates an ACPI exception into | 62 | * DESCRIPTION: Convert all backslashes (0x5C) to forward slashes (0x2F) within |
63 | * an ASCII string. | 63 | * the entire input file pathname string. |
64 | * | 64 | * |
65 | ******************************************************************************/ | 65 | ******************************************************************************/ |
66 | const char *acpi_ut_validate_exception(acpi_status status) | 66 | void ut_convert_backslashes(char *pathname) |
67 | { | 67 | { |
68 | u32 sub_status; | ||
69 | const char *exception = NULL; | ||
70 | 68 | ||
71 | ACPI_FUNCTION_ENTRY(); | 69 | if (!pathname) { |
72 | 70 | return; | |
73 | /* | 71 | } |
74 | * Status is composed of two parts, a "type" and an actual code | ||
75 | */ | ||
76 | sub_status = (status & ~AE_CODE_MASK); | ||
77 | |||
78 | switch (status & AE_CODE_MASK) { | ||
79 | case AE_CODE_ENVIRONMENTAL: | ||
80 | |||
81 | if (sub_status <= AE_CODE_ENV_MAX) { | ||
82 | exception = acpi_gbl_exception_names_env[sub_status]; | ||
83 | } | ||
84 | break; | ||
85 | |||
86 | case AE_CODE_PROGRAMMER: | ||
87 | |||
88 | if (sub_status <= AE_CODE_PGM_MAX) { | ||
89 | exception = acpi_gbl_exception_names_pgm[sub_status]; | ||
90 | } | ||
91 | break; | ||
92 | |||
93 | case AE_CODE_ACPI_TABLES: | ||
94 | |||
95 | if (sub_status <= AE_CODE_TBL_MAX) { | ||
96 | exception = acpi_gbl_exception_names_tbl[sub_status]; | ||
97 | } | ||
98 | break; | ||
99 | |||
100 | case AE_CODE_AML: | ||
101 | |||
102 | if (sub_status <= AE_CODE_AML_MAX) { | ||
103 | exception = acpi_gbl_exception_names_aml[sub_status]; | ||
104 | } | ||
105 | break; | ||
106 | |||
107 | case AE_CODE_CONTROL: | ||
108 | 72 | ||
109 | if (sub_status <= AE_CODE_CTRL_MAX) { | 73 | while (*pathname) { |
110 | exception = acpi_gbl_exception_names_ctrl[sub_status]; | 74 | if (*pathname == '\\') { |
75 | *pathname = '/'; | ||
111 | } | 76 | } |
112 | break; | ||
113 | 77 | ||
114 | default: | 78 | pathname++; |
115 | break; | ||
116 | } | 79 | } |
117 | |||
118 | return (ACPI_CAST_PTR(const char, exception)); | ||
119 | } | 80 | } |
81 | #endif | ||
120 | 82 | ||
121 | /******************************************************************************* | 83 | /******************************************************************************* |
122 | * | 84 | * |
123 | * FUNCTION: acpi_ut_is_pci_root_bridge | 85 | * FUNCTION: acpi_ut_is_pci_root_bridge |
124 | * | 86 | * |
125 | * PARAMETERS: Id - The HID/CID in string format | 87 | * PARAMETERS: id - The HID/CID in string format |
126 | * | 88 | * |
127 | * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge | 89 | * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge |
128 | * | 90 | * |
@@ -150,7 +112,7 @@ u8 acpi_ut_is_pci_root_bridge(char *id) | |||
150 | * | 112 | * |
151 | * FUNCTION: acpi_ut_is_aml_table | 113 | * FUNCTION: acpi_ut_is_aml_table |
152 | * | 114 | * |
153 | * PARAMETERS: Table - An ACPI table | 115 | * PARAMETERS: table - An ACPI table |
154 | * | 116 | * |
155 | * RETURN: TRUE if table contains executable AML; FALSE otherwise | 117 | * RETURN: TRUE if table contains executable AML; FALSE otherwise |
156 | * | 118 | * |
@@ -284,7 +246,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
284 | * | 246 | * |
285 | * FUNCTION: acpi_ut_release_owner_id | 247 | * FUNCTION: acpi_ut_release_owner_id |
286 | * | 248 | * |
287 | * PARAMETERS: owner_id_ptr - Pointer to a previously allocated owner_iD | 249 | * PARAMETERS: owner_id_ptr - Pointer to a previously allocated owner_ID |
288 | * | 250 | * |
289 | * RETURN: None. No error is returned because we are either exiting a | 251 | * RETURN: None. No error is returned because we are either exiting a |
290 | * control method or unloading a table. Either way, we would | 252 | * control method or unloading a table. Either way, we would |
@@ -307,7 +269,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) | |||
307 | 269 | ||
308 | *owner_id_ptr = 0; | 270 | *owner_id_ptr = 0; |
309 | 271 | ||
310 | /* Zero is not a valid owner_iD */ | 272 | /* Zero is not a valid owner_ID */ |
311 | 273 | ||
312 | if (owner_id == 0) { | 274 | if (owner_id == 0) { |
313 | ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%2.2X", owner_id)); | 275 | ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%2.2X", owner_id)); |
@@ -381,7 +343,7 @@ void acpi_ut_strupr(char *src_string) | |||
381 | * | 343 | * |
382 | * FUNCTION: acpi_ut_print_string | 344 | * FUNCTION: acpi_ut_print_string |
383 | * | 345 | * |
384 | * PARAMETERS: String - Null terminated ASCII string | 346 | * PARAMETERS: string - Null terminated ASCII string |
385 | * max_length - Maximum output length | 347 | * max_length - Maximum output length |
386 | * | 348 | * |
387 | * RETURN: None | 349 | * RETURN: None |
@@ -467,7 +429,7 @@ void acpi_ut_print_string(char *string, u8 max_length) | |||
467 | * | 429 | * |
468 | * FUNCTION: acpi_ut_dword_byte_swap | 430 | * FUNCTION: acpi_ut_dword_byte_swap |
469 | * | 431 | * |
470 | * PARAMETERS: Value - Value to be converted | 432 | * PARAMETERS: value - Value to be converted |
471 | * | 433 | * |
472 | * RETURN: u32 integer with bytes swapped | 434 | * RETURN: u32 integer with bytes swapped |
473 | * | 435 | * |
@@ -537,9 +499,9 @@ void acpi_ut_set_integer_width(u8 revision) | |||
537 | * | 499 | * |
538 | * FUNCTION: acpi_ut_display_init_pathname | 500 | * FUNCTION: acpi_ut_display_init_pathname |
539 | * | 501 | * |
540 | * PARAMETERS: Type - Object type of the node | 502 | * PARAMETERS: type - Object type of the node |
541 | * obj_handle - Handle whose pathname will be displayed | 503 | * obj_handle - Handle whose pathname will be displayed |
542 | * Path - Additional path string to be appended. | 504 | * path - Additional path string to be appended. |
543 | * (NULL if no extra path) | 505 | * (NULL if no extra path) |
544 | * | 506 | * |
545 | * RETURN: acpi_status | 507 | * RETURN: acpi_status |
@@ -604,8 +566,8 @@ acpi_ut_display_init_pathname(u8 type, | |||
604 | * | 566 | * |
605 | * FUNCTION: acpi_ut_valid_acpi_char | 567 | * FUNCTION: acpi_ut_valid_acpi_char |
606 | * | 568 | * |
607 | * PARAMETERS: Char - The character to be examined | 569 | * PARAMETERS: char - The character to be examined |
608 | * Position - Byte position (0-3) | 570 | * position - Byte position (0-3) |
609 | * | 571 | * |
610 | * RETURN: TRUE if the character is valid, FALSE otherwise | 572 | * RETURN: TRUE if the character is valid, FALSE otherwise |
611 | * | 573 | * |
@@ -640,7 +602,7 @@ u8 acpi_ut_valid_acpi_char(char character, u32 position) | |||
640 | * | 602 | * |
641 | * FUNCTION: acpi_ut_valid_acpi_name | 603 | * FUNCTION: acpi_ut_valid_acpi_name |
642 | * | 604 | * |
643 | * PARAMETERS: Name - The name to be examined | 605 | * PARAMETERS: name - The name to be examined |
644 | * | 606 | * |
645 | * RETURN: TRUE if the name is valid, FALSE otherwise | 607 | * RETURN: TRUE if the name is valid, FALSE otherwise |
646 | * | 608 | * |
@@ -671,7 +633,7 @@ u8 acpi_ut_valid_acpi_name(u32 name) | |||
671 | * | 633 | * |
672 | * FUNCTION: acpi_ut_repair_name | 634 | * FUNCTION: acpi_ut_repair_name |
673 | * | 635 | * |
674 | * PARAMETERS: Name - The ACPI name to be repaired | 636 | * PARAMETERS: name - The ACPI name to be repaired |
675 | * | 637 | * |
676 | * RETURN: Repaired version of the name | 638 | * RETURN: Repaired version of the name |
677 | * | 639 | * |
@@ -705,8 +667,8 @@ acpi_name acpi_ut_repair_name(char *name) | |||
705 | * | 667 | * |
706 | * FUNCTION: acpi_ut_strtoul64 | 668 | * FUNCTION: acpi_ut_strtoul64 |
707 | * | 669 | * |
708 | * PARAMETERS: String - Null terminated string | 670 | * PARAMETERS: string - Null terminated string |
709 | * Base - Radix of the string: 16 or ACPI_ANY_BASE; | 671 | * base - Radix of the string: 16 or ACPI_ANY_BASE; |
710 | * ACPI_ANY_BASE means 'in behalf of to_integer' | 672 | * ACPI_ANY_BASE means 'in behalf of to_integer' |
711 | * ret_integer - Where the converted integer is returned | 673 | * ret_integer - Where the converted integer is returned |
712 | * | 674 | * |
@@ -755,7 +717,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 * ret_integer) | |||
755 | 717 | ||
756 | if (to_integer_op) { | 718 | if (to_integer_op) { |
757 | /* | 719 | /* |
758 | * Base equal to ACPI_ANY_BASE means 'to_integer operation case'. | 720 | * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. |
759 | * We need to determine if it is decimal or hexadecimal. | 721 | * We need to determine if it is decimal or hexadecimal. |
760 | */ | 722 | */ |
761 | if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { | 723 | if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { |
@@ -878,8 +840,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 * ret_integer) | |||
878 | * | 840 | * |
879 | * FUNCTION: acpi_ut_create_update_state_and_push | 841 | * FUNCTION: acpi_ut_create_update_state_and_push |
880 | * | 842 | * |
881 | * PARAMETERS: Object - Object to be added to the new state | 843 | * PARAMETERS: object - Object to be added to the new state |
882 | * Action - Increment/Decrement | 844 | * action - Increment/Decrement |
883 | * state_list - List the state will be added to | 845 | * state_list - List the state will be added to |
884 | * | 846 | * |
885 | * RETURN: Status | 847 | * RETURN: Status |
@@ -919,7 +881,7 @@ acpi_ut_create_update_state_and_push(union acpi_operand_object *object, | |||
919 | * PARAMETERS: source_object - The package to walk | 881 | * PARAMETERS: source_object - The package to walk |
920 | * target_object - Target object (if package is being copied) | 882 | * target_object - Target object (if package is being copied) |
921 | * walk_callback - Called once for each package element | 883 | * walk_callback - Called once for each package element |
922 | * Context - Passed to the callback function | 884 | * context - Passed to the callback function |
923 | * | 885 | * |
924 | * RETURN: Status | 886 | * RETURN: Status |
925 | * | 887 | * |
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c index 43174df33121..296baa676bc5 100644 --- a/drivers/acpi/acpica/utmutex.c +++ b/drivers/acpi/acpica/utmutex.c | |||
@@ -147,7 +147,7 @@ void acpi_ut_mutex_terminate(void) | |||
147 | * | 147 | * |
148 | * FUNCTION: acpi_ut_create_mutex | 148 | * FUNCTION: acpi_ut_create_mutex |
149 | * | 149 | * |
150 | * PARAMETERS: mutex_iD - ID of the mutex to be created | 150 | * PARAMETERS: mutex_ID - ID of the mutex to be created |
151 | * | 151 | * |
152 | * RETURN: Status | 152 | * RETURN: Status |
153 | * | 153 | * |
@@ -176,7 +176,7 @@ static acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id) | |||
176 | * | 176 | * |
177 | * FUNCTION: acpi_ut_delete_mutex | 177 | * FUNCTION: acpi_ut_delete_mutex |
178 | * | 178 | * |
179 | * PARAMETERS: mutex_iD - ID of the mutex to be deleted | 179 | * PARAMETERS: mutex_ID - ID of the mutex to be deleted |
180 | * | 180 | * |
181 | * RETURN: Status | 181 | * RETURN: Status |
182 | * | 182 | * |
@@ -199,7 +199,7 @@ static void acpi_ut_delete_mutex(acpi_mutex_handle mutex_id) | |||
199 | * | 199 | * |
200 | * FUNCTION: acpi_ut_acquire_mutex | 200 | * FUNCTION: acpi_ut_acquire_mutex |
201 | * | 201 | * |
202 | * PARAMETERS: mutex_iD - ID of the mutex to be acquired | 202 | * PARAMETERS: mutex_ID - ID of the mutex to be acquired |
203 | * | 203 | * |
204 | * RETURN: Status | 204 | * RETURN: Status |
205 | * | 205 | * |
@@ -283,7 +283,7 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) | |||
283 | * | 283 | * |
284 | * FUNCTION: acpi_ut_release_mutex | 284 | * FUNCTION: acpi_ut_release_mutex |
285 | * | 285 | * |
286 | * PARAMETERS: mutex_iD - ID of the mutex to be released | 286 | * PARAMETERS: mutex_ID - ID of the mutex to be released |
287 | * | 287 | * |
288 | * RETURN: Status | 288 | * RETURN: Status |
289 | * | 289 | * |
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index b112744fc9ae..655f0799a391 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c | |||
@@ -69,7 +69,7 @@ acpi_ut_get_element_length(u8 object_type, | |||
69 | * PARAMETERS: module_name - Source file name of caller | 69 | * PARAMETERS: module_name - Source file name of caller |
70 | * line_number - Line number of caller | 70 | * line_number - Line number of caller |
71 | * component_id - Component type of caller | 71 | * component_id - Component type of caller |
72 | * Type - ACPI Type of the new object | 72 | * type - ACPI Type of the new object |
73 | * | 73 | * |
74 | * RETURN: A new internal object, null on failure | 74 | * RETURN: A new internal object, null on failure |
75 | * | 75 | * |
@@ -150,7 +150,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char | |||
150 | * | 150 | * |
151 | * FUNCTION: acpi_ut_create_package_object | 151 | * FUNCTION: acpi_ut_create_package_object |
152 | * | 152 | * |
153 | * PARAMETERS: Count - Number of package elements | 153 | * PARAMETERS: count - Number of package elements |
154 | * | 154 | * |
155 | * RETURN: Pointer to a new Package object, null on failure | 155 | * RETURN: Pointer to a new Package object, null on failure |
156 | * | 156 | * |
@@ -323,11 +323,11 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size) | |||
323 | * | 323 | * |
324 | * FUNCTION: acpi_ut_valid_internal_object | 324 | * FUNCTION: acpi_ut_valid_internal_object |
325 | * | 325 | * |
326 | * PARAMETERS: Object - Object to be validated | 326 | * PARAMETERS: object - Object to be validated |
327 | * | 327 | * |
328 | * RETURN: TRUE if object is valid, FALSE otherwise | 328 | * RETURN: TRUE if object is valid, FALSE otherwise |
329 | * | 329 | * |
330 | * DESCRIPTION: Validate a pointer to be a union acpi_operand_object | 330 | * DESCRIPTION: Validate a pointer to be of type union acpi_operand_object |
331 | * | 331 | * |
332 | ******************************************************************************/ | 332 | ******************************************************************************/ |
333 | 333 | ||
@@ -348,7 +348,7 @@ u8 acpi_ut_valid_internal_object(void *object) | |||
348 | switch (ACPI_GET_DESCRIPTOR_TYPE(object)) { | 348 | switch (ACPI_GET_DESCRIPTOR_TYPE(object)) { |
349 | case ACPI_DESC_TYPE_OPERAND: | 349 | case ACPI_DESC_TYPE_OPERAND: |
350 | 350 | ||
351 | /* The object appears to be a valid union acpi_operand_object */ | 351 | /* The object appears to be a valid union acpi_operand_object */ |
352 | 352 | ||
353 | return (TRUE); | 353 | return (TRUE); |
354 | 354 | ||
@@ -407,7 +407,7 @@ void *acpi_ut_allocate_object_desc_dbg(const char *module_name, | |||
407 | * | 407 | * |
408 | * FUNCTION: acpi_ut_delete_object_desc | 408 | * FUNCTION: acpi_ut_delete_object_desc |
409 | * | 409 | * |
410 | * PARAMETERS: Object - An Acpi internal object to be deleted | 410 | * PARAMETERS: object - An Acpi internal object to be deleted |
411 | * | 411 | * |
412 | * RETURN: None. | 412 | * RETURN: None. |
413 | * | 413 | * |
@@ -419,7 +419,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object) | |||
419 | { | 419 | { |
420 | ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object); | 420 | ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object); |
421 | 421 | ||
422 | /* Object must be a union acpi_operand_object */ | 422 | /* Object must be a union acpi_operand_object */ |
423 | 423 | ||
424 | if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) { | 424 | if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) { |
425 | ACPI_ERROR((AE_INFO, | 425 | ACPI_ERROR((AE_INFO, |
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c index 2360cf70c18c..34ef0bd7e4b4 100644 --- a/drivers/acpi/acpica/utosi.c +++ b/drivers/acpi/acpica/utosi.c | |||
@@ -68,7 +68,7 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = { | |||
68 | {"Windows 2001.1", NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */ | 68 | {"Windows 2001.1", NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */ |
69 | {"Windows 2001 SP2", NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ | 69 | {"Windows 2001 SP2", NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ |
70 | {"Windows 2001.1 SP1", NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ | 70 | {"Windows 2001.1 SP1", NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ |
71 | {"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */ | 71 | {"Windows 2006", NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows vista - Added 03/2006 */ |
72 | {"Windows 2006.1", NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ | 72 | {"Windows 2006.1", NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ |
73 | {"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ | 73 | {"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ |
74 | {"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */ | 74 | {"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */ |
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c index 9d441ea70305..e38bef4980bc 100644 --- a/drivers/acpi/acpica/utresrc.c +++ b/drivers/acpi/acpica/utresrc.c | |||
@@ -356,13 +356,13 @@ static const u8 acpi_gbl_resource_types[] = { | |||
356 | ACPI_SMALL_VARIABLE_LENGTH, /* 06 start_dependent_functions */ | 356 | ACPI_SMALL_VARIABLE_LENGTH, /* 06 start_dependent_functions */ |
357 | ACPI_FIXED_LENGTH, /* 07 end_dependent_functions */ | 357 | ACPI_FIXED_LENGTH, /* 07 end_dependent_functions */ |
358 | ACPI_FIXED_LENGTH, /* 08 IO */ | 358 | ACPI_FIXED_LENGTH, /* 08 IO */ |
359 | ACPI_FIXED_LENGTH, /* 09 fixed_iO */ | 359 | ACPI_FIXED_LENGTH, /* 09 fixed_IO */ |
360 | ACPI_FIXED_LENGTH, /* 0_a fixed_dMA */ | 360 | ACPI_FIXED_LENGTH, /* 0A fixed_DMA */ |
361 | 0, | 361 | 0, |
362 | 0, | 362 | 0, |
363 | 0, | 363 | 0, |
364 | ACPI_VARIABLE_LENGTH, /* 0_e vendor_short */ | 364 | ACPI_VARIABLE_LENGTH, /* 0E vendor_short */ |
365 | ACPI_FIXED_LENGTH, /* 0_f end_tag */ | 365 | ACPI_FIXED_LENGTH, /* 0F end_tag */ |
366 | 366 | ||
367 | /* Large descriptors */ | 367 | /* Large descriptors */ |
368 | 368 | ||
@@ -375,16 +375,16 @@ static const u8 acpi_gbl_resource_types[] = { | |||
375 | ACPI_FIXED_LENGTH, /* 06 memory32_fixed */ | 375 | ACPI_FIXED_LENGTH, /* 06 memory32_fixed */ |
376 | ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ | 376 | ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ |
377 | ACPI_VARIABLE_LENGTH, /* 08 Word* address */ | 377 | ACPI_VARIABLE_LENGTH, /* 08 Word* address */ |
378 | ACPI_VARIABLE_LENGTH, /* 09 extended_iRQ */ | 378 | ACPI_VARIABLE_LENGTH, /* 09 extended_IRQ */ |
379 | ACPI_VARIABLE_LENGTH, /* 0_a Qword* address */ | 379 | ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ |
380 | ACPI_FIXED_LENGTH, /* 0_b Extended* address */ | 380 | ACPI_FIXED_LENGTH, /* 0B Extended* address */ |
381 | ACPI_VARIABLE_LENGTH, /* 0_c Gpio* */ | 381 | ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ |
382 | 0, | 382 | 0, |
383 | ACPI_VARIABLE_LENGTH /* 0_e *serial_bus */ | 383 | ACPI_VARIABLE_LENGTH /* 0E *serial_bus */ |
384 | }; | 384 | }; |
385 | 385 | ||
386 | /* | 386 | /* |
387 | * For the i_aSL compiler/disassembler, we don't want any error messages | 387 | * For the iASL compiler/disassembler, we don't want any error messages |
388 | * because the disassembler uses the resource validation code to determine | 388 | * because the disassembler uses the resource validation code to determine |
389 | * if Buffer objects are actually Resource Templates. | 389 | * if Buffer objects are actually Resource Templates. |
390 | */ | 390 | */ |
@@ -398,11 +398,11 @@ static const u8 acpi_gbl_resource_types[] = { | |||
398 | * | 398 | * |
399 | * FUNCTION: acpi_ut_walk_aml_resources | 399 | * FUNCTION: acpi_ut_walk_aml_resources |
400 | * | 400 | * |
401 | * PARAMETERS: Aml - Pointer to the raw AML resource template | 401 | * PARAMETERS: aml - Pointer to the raw AML resource template |
402 | * aml_length - Length of the entire template | 402 | * aml_length - Length of the entire template |
403 | * user_function - Called once for each descriptor found. If | 403 | * user_function - Called once for each descriptor found. If |
404 | * NULL, a pointer to the end_tag is returned | 404 | * NULL, a pointer to the end_tag is returned |
405 | * Context - Passed to user_function | 405 | * context - Passed to user_function |
406 | * | 406 | * |
407 | * RETURN: Status | 407 | * RETURN: Status |
408 | * | 408 | * |
@@ -513,7 +513,7 @@ acpi_ut_walk_aml_resources(u8 * aml, | |||
513 | * | 513 | * |
514 | * FUNCTION: acpi_ut_validate_resource | 514 | * FUNCTION: acpi_ut_validate_resource |
515 | * | 515 | * |
516 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 516 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
517 | * return_index - Where the resource index is returned. NULL | 517 | * return_index - Where the resource index is returned. NULL |
518 | * if the index is not required. | 518 | * if the index is not required. |
519 | * | 519 | * |
@@ -664,7 +664,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index) | |||
664 | * | 664 | * |
665 | * FUNCTION: acpi_ut_get_resource_type | 665 | * FUNCTION: acpi_ut_get_resource_type |
666 | * | 666 | * |
667 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 667 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
668 | * | 668 | * |
669 | * RETURN: The Resource Type with no extraneous bits (except the | 669 | * RETURN: The Resource Type with no extraneous bits (except the |
670 | * Large/Small descriptor bit -- this is left alone) | 670 | * Large/Small descriptor bit -- this is left alone) |
@@ -698,7 +698,7 @@ u8 acpi_ut_get_resource_type(void *aml) | |||
698 | * | 698 | * |
699 | * FUNCTION: acpi_ut_get_resource_length | 699 | * FUNCTION: acpi_ut_get_resource_length |
700 | * | 700 | * |
701 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 701 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
702 | * | 702 | * |
703 | * RETURN: Byte Length | 703 | * RETURN: Byte Length |
704 | * | 704 | * |
@@ -738,7 +738,7 @@ u16 acpi_ut_get_resource_length(void *aml) | |||
738 | * | 738 | * |
739 | * FUNCTION: acpi_ut_get_resource_header_length | 739 | * FUNCTION: acpi_ut_get_resource_header_length |
740 | * | 740 | * |
741 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 741 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
742 | * | 742 | * |
743 | * RETURN: Length of the AML header (depends on large/small descriptor) | 743 | * RETURN: Length of the AML header (depends on large/small descriptor) |
744 | * | 744 | * |
@@ -763,7 +763,7 @@ u8 acpi_ut_get_resource_header_length(void *aml) | |||
763 | * | 763 | * |
764 | * FUNCTION: acpi_ut_get_descriptor_length | 764 | * FUNCTION: acpi_ut_get_descriptor_length |
765 | * | 765 | * |
766 | * PARAMETERS: Aml - Pointer to the raw AML resource descriptor | 766 | * PARAMETERS: aml - Pointer to the raw AML resource descriptor |
767 | * | 767 | * |
768 | * RETURN: Byte length | 768 | * RETURN: Byte length |
769 | * | 769 | * |
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c index 4267477c2797..a1c988260073 100644 --- a/drivers/acpi/acpica/utstate.c +++ b/drivers/acpi/acpica/utstate.c | |||
@@ -51,8 +51,8 @@ ACPI_MODULE_NAME("utstate") | |||
51 | * | 51 | * |
52 | * FUNCTION: acpi_ut_create_pkg_state_and_push | 52 | * FUNCTION: acpi_ut_create_pkg_state_and_push |
53 | * | 53 | * |
54 | * PARAMETERS: Object - Object to be added to the new state | 54 | * PARAMETERS: object - Object to be added to the new state |
55 | * Action - Increment/Decrement | 55 | * action - Increment/Decrement |
56 | * state_list - List the state will be added to | 56 | * state_list - List the state will be added to |
57 | * | 57 | * |
58 | * RETURN: Status | 58 | * RETURN: Status |
@@ -85,7 +85,7 @@ acpi_ut_create_pkg_state_and_push(void *internal_object, | |||
85 | * FUNCTION: acpi_ut_push_generic_state | 85 | * FUNCTION: acpi_ut_push_generic_state |
86 | * | 86 | * |
87 | * PARAMETERS: list_head - Head of the state stack | 87 | * PARAMETERS: list_head - Head of the state stack |
88 | * State - State object to push | 88 | * state - State object to push |
89 | * | 89 | * |
90 | * RETURN: None | 90 | * RETURN: None |
91 | * | 91 | * |
@@ -214,8 +214,8 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void) | |||
214 | * | 214 | * |
215 | * FUNCTION: acpi_ut_create_update_state | 215 | * FUNCTION: acpi_ut_create_update_state |
216 | * | 216 | * |
217 | * PARAMETERS: Object - Initial Object to be installed in the state | 217 | * PARAMETERS: object - Initial Object to be installed in the state |
218 | * Action - Update action to be performed | 218 | * action - Update action to be performed |
219 | * | 219 | * |
220 | * RETURN: New state object, null on failure | 220 | * RETURN: New state object, null on failure |
221 | * | 221 | * |
@@ -252,8 +252,8 @@ union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object | |||
252 | * | 252 | * |
253 | * FUNCTION: acpi_ut_create_pkg_state | 253 | * FUNCTION: acpi_ut_create_pkg_state |
254 | * | 254 | * |
255 | * PARAMETERS: Object - Initial Object to be installed in the state | 255 | * PARAMETERS: object - Initial Object to be installed in the state |
256 | * Action - Update action to be performed | 256 | * action - Update action to be performed |
257 | * | 257 | * |
258 | * RETURN: New state object, null on failure | 258 | * RETURN: New state object, null on failure |
259 | * | 259 | * |
@@ -325,7 +325,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void) | |||
325 | * | 325 | * |
326 | * FUNCTION: acpi_ut_delete_generic_state | 326 | * FUNCTION: acpi_ut_delete_generic_state |
327 | * | 327 | * |
328 | * PARAMETERS: State - The state object to be deleted | 328 | * PARAMETERS: state - The state object to be deleted |
329 | * | 329 | * |
330 | * RETURN: None | 330 | * RETURN: None |
331 | * | 331 | * |
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c index afa94f51ff0b..534179f1177b 100644 --- a/drivers/acpi/acpica/utxface.c +++ b/drivers/acpi/acpica/utxface.c | |||
@@ -131,7 +131,7 @@ acpi_status __init acpi_initialize_subsystem(void) | |||
131 | * | 131 | * |
132 | * FUNCTION: acpi_enable_subsystem | 132 | * FUNCTION: acpi_enable_subsystem |
133 | * | 133 | * |
134 | * PARAMETERS: Flags - Init/enable Options | 134 | * PARAMETERS: flags - Init/enable Options |
135 | * | 135 | * |
136 | * RETURN: Status | 136 | * RETURN: Status |
137 | * | 137 | * |
@@ -234,7 +234,7 @@ ACPI_EXPORT_SYMBOL(acpi_enable_subsystem) | |||
234 | * | 234 | * |
235 | * FUNCTION: acpi_initialize_objects | 235 | * FUNCTION: acpi_initialize_objects |
236 | * | 236 | * |
237 | * PARAMETERS: Flags - Init/enable Options | 237 | * PARAMETERS: flags - Init/enable Options |
238 | * | 238 | * |
239 | * RETURN: Status | 239 | * RETURN: Status |
240 | * | 240 | * |
@@ -409,7 +409,7 @@ ACPI_EXPORT_SYMBOL(acpi_subsystem_status) | |||
409 | * PARAMETERS: out_buffer - A buffer to receive the resources for the | 409 | * PARAMETERS: out_buffer - A buffer to receive the resources for the |
410 | * device | 410 | * device |
411 | * | 411 | * |
412 | * RETURN: Status - the status of the call | 412 | * RETURN: status - the status of the call |
413 | * | 413 | * |
414 | * DESCRIPTION: This function is called to get information about the current | 414 | * DESCRIPTION: This function is called to get information about the current |
415 | * state of the ACPI subsystem. It will return system information | 415 | * state of the ACPI subsystem. It will return system information |
@@ -480,8 +480,8 @@ ACPI_EXPORT_SYMBOL(acpi_get_system_info) | |||
480 | * | 480 | * |
481 | * FUNCTION: acpi_install_initialization_handler | 481 | * FUNCTION: acpi_install_initialization_handler |
482 | * | 482 | * |
483 | * PARAMETERS: Handler - Callback procedure | 483 | * PARAMETERS: handler - Callback procedure |
484 | * Function - Not (currently) used, see below | 484 | * function - Not (currently) used, see below |
485 | * | 485 | * |
486 | * RETURN: Status | 486 | * RETURN: Status |
487 | * | 487 | * |
@@ -618,7 +618,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_interface) | |||
618 | * | 618 | * |
619 | * FUNCTION: acpi_install_interface_handler | 619 | * FUNCTION: acpi_install_interface_handler |
620 | * | 620 | * |
621 | * PARAMETERS: Handler - The _OSI interface handler to install | 621 | * PARAMETERS: handler - The _OSI interface handler to install |
622 | * NULL means "remove existing handler" | 622 | * NULL means "remove existing handler" |
623 | * | 623 | * |
624 | * RETURN: Status | 624 | * RETURN: Status |
@@ -651,9 +651,9 @@ ACPI_EXPORT_SYMBOL(acpi_install_interface_handler) | |||
651 | * FUNCTION: acpi_check_address_range | 651 | * FUNCTION: acpi_check_address_range |
652 | * | 652 | * |
653 | * PARAMETERS: space_id - Address space ID | 653 | * PARAMETERS: space_id - Address space ID |
654 | * Address - Start address | 654 | * address - Start address |
655 | * Length - Length | 655 | * length - Length |
656 | * Warn - TRUE if warning on overlap desired | 656 | * warn - TRUE if warning on overlap desired |
657 | * | 657 | * |
658 | * RETURN: Count of the number of conflicts detected. | 658 | * RETURN: Count of the number of conflicts detected. |
659 | * | 659 | * |
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c index 52b568af1819..6d63cc39b9ae 100644 --- a/drivers/acpi/acpica/utxferror.c +++ b/drivers/acpi/acpica/utxferror.c | |||
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("utxferror") | |||
53 | * This module is used for the in-kernel ACPICA as well as the ACPICA | 53 | * This module is used for the in-kernel ACPICA as well as the ACPICA |
54 | * tools/applications. | 54 | * tools/applications. |
55 | * | 55 | * |
56 | * For the i_aSL compiler case, the output is redirected to stderr so that | 56 | * For the iASL compiler case, the output is redirected to stderr so that |
57 | * any of the various ACPI errors and warnings do not appear in the output | 57 | * any of the various ACPI errors and warnings do not appear in the output |
58 | * files, for either the compiler or disassembler portions of the tool. | 58 | * files, for either the compiler or disassembler portions of the tool. |
59 | */ | 59 | */ |
@@ -70,7 +70,7 @@ extern FILE *acpi_gbl_output_file; | |||
70 | 70 | ||
71 | #else | 71 | #else |
72 | /* | 72 | /* |
73 | * non-i_aSL case - no redirection, nothing to do | 73 | * non-iASL case - no redirection, nothing to do |
74 | */ | 74 | */ |
75 | #define ACPI_MSG_REDIRECT_BEGIN | 75 | #define ACPI_MSG_REDIRECT_BEGIN |
76 | #define ACPI_MSG_REDIRECT_END | 76 | #define ACPI_MSG_REDIRECT_END |
@@ -82,6 +82,8 @@ extern FILE *acpi_gbl_output_file; | |||
82 | #define ACPI_MSG_EXCEPTION "ACPI Exception: " | 82 | #define ACPI_MSG_EXCEPTION "ACPI Exception: " |
83 | #define ACPI_MSG_WARNING "ACPI Warning: " | 83 | #define ACPI_MSG_WARNING "ACPI Warning: " |
84 | #define ACPI_MSG_INFO "ACPI: " | 84 | #define ACPI_MSG_INFO "ACPI: " |
85 | #define ACPI_MSG_BIOS_ERROR "ACPI BIOS Bug: Error: " | ||
86 | #define ACPI_MSG_BIOS_WARNING "ACPI BIOS Bug: Warning: " | ||
85 | /* | 87 | /* |
86 | * Common message suffix | 88 | * Common message suffix |
87 | */ | 89 | */ |
@@ -93,7 +95,7 @@ extern FILE *acpi_gbl_output_file; | |||
93 | * | 95 | * |
94 | * PARAMETERS: module_name - Caller's module name (for error output) | 96 | * PARAMETERS: module_name - Caller's module name (for error output) |
95 | * line_number - Caller's line number (for error output) | 97 | * line_number - Caller's line number (for error output) |
96 | * Format - Printf format string + additional args | 98 | * format - Printf format string + additional args |
97 | * | 99 | * |
98 | * RETURN: None | 100 | * RETURN: None |
99 | * | 101 | * |
@@ -124,8 +126,8 @@ ACPI_EXPORT_SYMBOL(acpi_error) | |||
124 | * | 126 | * |
125 | * PARAMETERS: module_name - Caller's module name (for error output) | 127 | * PARAMETERS: module_name - Caller's module name (for error output) |
126 | * line_number - Caller's line number (for error output) | 128 | * line_number - Caller's line number (for error output) |
127 | * Status - Status to be formatted | 129 | * status - Status to be formatted |
128 | * Format - Printf format string + additional args | 130 | * format - Printf format string + additional args |
129 | * | 131 | * |
130 | * RETURN: None | 132 | * RETURN: None |
131 | * | 133 | * |
@@ -159,7 +161,7 @@ ACPI_EXPORT_SYMBOL(acpi_exception) | |||
159 | * | 161 | * |
160 | * PARAMETERS: module_name - Caller's module name (for error output) | 162 | * PARAMETERS: module_name - Caller's module name (for error output) |
161 | * line_number - Caller's line number (for error output) | 163 | * line_number - Caller's line number (for error output) |
162 | * Format - Printf format string + additional args | 164 | * format - Printf format string + additional args |
163 | * | 165 | * |
164 | * RETURN: None | 166 | * RETURN: None |
165 | * | 167 | * |
@@ -190,7 +192,7 @@ ACPI_EXPORT_SYMBOL(acpi_warning) | |||
190 | * | 192 | * |
191 | * PARAMETERS: module_name - Caller's module name (for error output) | 193 | * PARAMETERS: module_name - Caller's module name (for error output) |
192 | * line_number - Caller's line number (for error output) | 194 | * line_number - Caller's line number (for error output) |
193 | * Format - Printf format string + additional args | 195 | * format - Printf format string + additional args |
194 | * | 196 | * |
195 | * RETURN: None | 197 | * RETURN: None |
196 | * | 198 | * |
@@ -218,6 +220,72 @@ acpi_info(const char *module_name, u32 line_number, const char *format, ...) | |||
218 | 220 | ||
219 | ACPI_EXPORT_SYMBOL(acpi_info) | 221 | ACPI_EXPORT_SYMBOL(acpi_info) |
220 | 222 | ||
223 | /******************************************************************************* | ||
224 | * | ||
225 | * FUNCTION: acpi_bios_error | ||
226 | * | ||
227 | * PARAMETERS: module_name - Caller's module name (for error output) | ||
228 | * line_number - Caller's line number (for error output) | ||
229 | * format - Printf format string + additional args | ||
230 | * | ||
231 | * RETURN: None | ||
232 | * | ||
233 | * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version | ||
234 | * info | ||
235 | * | ||
236 | ******************************************************************************/ | ||
237 | void ACPI_INTERNAL_VAR_XFACE | ||
238 | acpi_bios_error(const char *module_name, | ||
239 | u32 line_number, const char *format, ...) | ||
240 | { | ||
241 | va_list arg_list; | ||
242 | |||
243 | ACPI_MSG_REDIRECT_BEGIN; | ||
244 | acpi_os_printf(ACPI_MSG_BIOS_ERROR); | ||
245 | |||
246 | va_start(arg_list, format); | ||
247 | acpi_os_vprintf(format, arg_list); | ||
248 | ACPI_MSG_SUFFIX; | ||
249 | va_end(arg_list); | ||
250 | |||
251 | ACPI_MSG_REDIRECT_END; | ||
252 | } | ||
253 | |||
254 | ACPI_EXPORT_SYMBOL(acpi_bios_error) | ||
255 | |||
256 | /******************************************************************************* | ||
257 | * | ||
258 | * FUNCTION: acpi_bios_warning | ||
259 | * | ||
260 | * PARAMETERS: module_name - Caller's module name (for error output) | ||
261 | * line_number - Caller's line number (for error output) | ||
262 | * format - Printf format string + additional args | ||
263 | * | ||
264 | * RETURN: None | ||
265 | * | ||
266 | * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version | ||
267 | * info | ||
268 | * | ||
269 | ******************************************************************************/ | ||
270 | void ACPI_INTERNAL_VAR_XFACE | ||
271 | acpi_bios_warning(const char *module_name, | ||
272 | u32 line_number, const char *format, ...) | ||
273 | { | ||
274 | va_list arg_list; | ||
275 | |||
276 | ACPI_MSG_REDIRECT_BEGIN; | ||
277 | acpi_os_printf(ACPI_MSG_BIOS_WARNING); | ||
278 | |||
279 | va_start(arg_list, format); | ||
280 | acpi_os_vprintf(format, arg_list); | ||
281 | ACPI_MSG_SUFFIX; | ||
282 | va_end(arg_list); | ||
283 | |||
284 | ACPI_MSG_REDIRECT_END; | ||
285 | } | ||
286 | |||
287 | ACPI_EXPORT_SYMBOL(acpi_bios_warning) | ||
288 | |||
221 | /* | 289 | /* |
222 | * The remainder of this module contains internal error functions that may | 290 | * The remainder of this module contains internal error functions that may |
223 | * be configured out. | 291 | * be configured out. |
@@ -271,9 +339,9 @@ acpi_ut_predefined_warning(const char *module_name, | |||
271 | * | 339 | * |
272 | * PARAMETERS: module_name - Caller's module name (for error output) | 340 | * PARAMETERS: module_name - Caller's module name (for error output) |
273 | * line_number - Caller's line number (for error output) | 341 | * line_number - Caller's line number (for error output) |
274 | * Pathname - Full pathname to the node | 342 | * pathname - Full pathname to the node |
275 | * node_flags - From Namespace node for the method/object | 343 | * node_flags - From Namespace node for the method/object |
276 | * Format - Printf format string + additional args | 344 | * format - Printf format string + additional args |
277 | * | 345 | * |
278 | * RETURN: None | 346 | * RETURN: None |
279 | * | 347 | * |
@@ -373,9 +441,9 @@ acpi_ut_namespace_error(const char *module_name, | |||
373 | * | 441 | * |
374 | * PARAMETERS: module_name - Caller's module name (for error output) | 442 | * PARAMETERS: module_name - Caller's module name (for error output) |
375 | * line_number - Caller's line number (for error output) | 443 | * line_number - Caller's line number (for error output) |
376 | * Message - Error message to use on failure | 444 | * message - Error message to use on failure |
377 | * prefix_node - Prefix relative to the path | 445 | * prefix_node - Prefix relative to the path |
378 | * Path - Path to the node (optional) | 446 | * path - Path to the node (optional) |
379 | * method_status - Execution status | 447 | * method_status - Execution status |
380 | * | 448 | * |
381 | * RETURN: None | 449 | * RETURN: None |
diff --git a/drivers/acpi/acpica/utxfmutex.c b/drivers/acpi/acpica/utxfmutex.c index 1427d191d15a..0a40a851b354 100644 --- a/drivers/acpi/acpica/utxfmutex.c +++ b/drivers/acpi/acpica/utxfmutex.c | |||
@@ -58,8 +58,8 @@ acpi_ut_get_mutex_object(acpi_handle handle, | |||
58 | * | 58 | * |
59 | * FUNCTION: acpi_ut_get_mutex_object | 59 | * FUNCTION: acpi_ut_get_mutex_object |
60 | * | 60 | * |
61 | * PARAMETERS: Handle - Mutex or prefix handle (optional) | 61 | * PARAMETERS: handle - Mutex or prefix handle (optional) |
62 | * Pathname - Mutex pathname (optional) | 62 | * pathname - Mutex pathname (optional) |
63 | * ret_obj - Where the mutex object is returned | 63 | * ret_obj - Where the mutex object is returned |
64 | * | 64 | * |
65 | * RETURN: Status | 65 | * RETURN: Status |
@@ -118,9 +118,9 @@ acpi_ut_get_mutex_object(acpi_handle handle, | |||
118 | * | 118 | * |
119 | * FUNCTION: acpi_acquire_mutex | 119 | * FUNCTION: acpi_acquire_mutex |
120 | * | 120 | * |
121 | * PARAMETERS: Handle - Mutex or prefix handle (optional) | 121 | * PARAMETERS: handle - Mutex or prefix handle (optional) |
122 | * Pathname - Mutex pathname (optional) | 122 | * pathname - Mutex pathname (optional) |
123 | * Timeout - Max time to wait for the lock (millisec) | 123 | * timeout - Max time to wait for the lock (millisec) |
124 | * | 124 | * |
125 | * RETURN: Status | 125 | * RETURN: Status |
126 | * | 126 | * |
@@ -155,8 +155,8 @@ acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout) | |||
155 | * | 155 | * |
156 | * FUNCTION: acpi_release_mutex | 156 | * FUNCTION: acpi_release_mutex |
157 | * | 157 | * |
158 | * PARAMETERS: Handle - Mutex or prefix handle (optional) | 158 | * PARAMETERS: handle - Mutex or prefix handle (optional) |
159 | * Pathname - Mutex pathname (optional) | 159 | * pathname - Mutex pathname (optional) |
160 | * | 160 | * |
161 | * RETURN: Status | 161 | * RETURN: Status |
162 | * | 162 | * |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 7dd3f9fb9f3f..5662d64e6733 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -250,6 +250,13 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
250 | else | 250 | else |
251 | val->intval = battery->capacity_now * 1000; | 251 | val->intval = battery->capacity_now * 1000; |
252 | break; | 252 | break; |
253 | case POWER_SUPPLY_PROP_CAPACITY: | ||
254 | if (battery->capacity_now && battery->full_charge_capacity) | ||
255 | val->intval = battery->capacity_now * 100/ | ||
256 | battery->full_charge_capacity; | ||
257 | else | ||
258 | val->intval = 0; | ||
259 | break; | ||
253 | case POWER_SUPPLY_PROP_MODEL_NAME: | 260 | case POWER_SUPPLY_PROP_MODEL_NAME: |
254 | val->strval = battery->model_number; | 261 | val->strval = battery->model_number; |
255 | break; | 262 | break; |
@@ -276,6 +283,7 @@ static enum power_supply_property charge_battery_props[] = { | |||
276 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, | 283 | POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, |
277 | POWER_SUPPLY_PROP_CHARGE_FULL, | 284 | POWER_SUPPLY_PROP_CHARGE_FULL, |
278 | POWER_SUPPLY_PROP_CHARGE_NOW, | 285 | POWER_SUPPLY_PROP_CHARGE_NOW, |
286 | POWER_SUPPLY_PROP_CAPACITY, | ||
279 | POWER_SUPPLY_PROP_MODEL_NAME, | 287 | POWER_SUPPLY_PROP_MODEL_NAME, |
280 | POWER_SUPPLY_PROP_MANUFACTURER, | 288 | POWER_SUPPLY_PROP_MANUFACTURER, |
281 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | 289 | POWER_SUPPLY_PROP_SERIAL_NUMBER, |
@@ -292,6 +300,7 @@ static enum power_supply_property energy_battery_props[] = { | |||
292 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | 300 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, |
293 | POWER_SUPPLY_PROP_ENERGY_FULL, | 301 | POWER_SUPPLY_PROP_ENERGY_FULL, |
294 | POWER_SUPPLY_PROP_ENERGY_NOW, | 302 | POWER_SUPPLY_PROP_ENERGY_NOW, |
303 | POWER_SUPPLY_PROP_CAPACITY, | ||
295 | POWER_SUPPLY_PROP_MODEL_NAME, | 304 | POWER_SUPPLY_PROP_MODEL_NAME, |
296 | POWER_SUPPLY_PROP_MANUFACTURER, | 305 | POWER_SUPPLY_PROP_MANUFACTURER, |
297 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | 306 | POWER_SUPPLY_PROP_SERIAL_NUMBER, |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index adceafda9c17..9628652e080c 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -574,6 +574,10 @@ static void acpi_bus_osc_support(void) | |||
574 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PPC_OST_SUPPORT; | 574 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PPC_OST_SUPPORT; |
575 | #endif | 575 | #endif |
576 | 576 | ||
577 | #ifdef ACPI_HOTPLUG_OST | ||
578 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_HOTPLUG_OST_SUPPORT; | ||
579 | #endif | ||
580 | |||
577 | if (!ghes_disable) | 581 | if (!ghes_disable) |
578 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_APEI_SUPPORT; | 582 | capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_APEI_SUPPORT; |
579 | if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) | 583 | if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) |
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 45cd03b4630e..1f9f7d7d7bc5 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c | |||
@@ -158,9 +158,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) | |||
158 | int result; | 158 | int result; |
159 | int present; | 159 | int present; |
160 | acpi_status status; | 160 | acpi_status status; |
161 | 161 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | |
162 | |||
163 | present = is_device_present(handle); | ||
164 | 162 | ||
165 | switch (type) { | 163 | switch (type) { |
166 | case ACPI_NOTIFY_BUS_CHECK: | 164 | case ACPI_NOTIFY_BUS_CHECK: |
@@ -169,32 +167,47 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context) | |||
169 | printk(KERN_WARNING "Container driver received %s event\n", | 167 | printk(KERN_WARNING "Container driver received %s event\n", |
170 | (type == ACPI_NOTIFY_BUS_CHECK) ? | 168 | (type == ACPI_NOTIFY_BUS_CHECK) ? |
171 | "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); | 169 | "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); |
170 | |||
171 | present = is_device_present(handle); | ||
172 | status = acpi_bus_get_device(handle, &device); | 172 | status = acpi_bus_get_device(handle, &device); |
173 | if (present) { | 173 | if (!present) { |
174 | if (ACPI_FAILURE(status) || !device) { | ||
175 | result = container_device_add(&device, handle); | ||
176 | if (!result) | ||
177 | kobject_uevent(&device->dev.kobj, | ||
178 | KOBJ_ONLINE); | ||
179 | else | ||
180 | printk(KERN_WARNING | ||
181 | "Failed to add container\n"); | ||
182 | } | ||
183 | } else { | ||
184 | if (ACPI_SUCCESS(status)) { | 174 | if (ACPI_SUCCESS(status)) { |
185 | /* device exist and this is a remove request */ | 175 | /* device exist and this is a remove request */ |
176 | device->flags.eject_pending = 1; | ||
186 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); | 177 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); |
178 | return; | ||
187 | } | 179 | } |
180 | break; | ||
181 | } | ||
182 | |||
183 | if (!ACPI_FAILURE(status) || device) | ||
184 | break; | ||
185 | |||
186 | result = container_device_add(&device, handle); | ||
187 | if (result) { | ||
188 | printk(KERN_WARNING "Failed to add container\n"); | ||
189 | break; | ||
188 | } | 190 | } |
191 | |||
192 | kobject_uevent(&device->dev.kobj, KOBJ_ONLINE); | ||
193 | ost_code = ACPI_OST_SC_SUCCESS; | ||
189 | break; | 194 | break; |
195 | |||
190 | case ACPI_NOTIFY_EJECT_REQUEST: | 196 | case ACPI_NOTIFY_EJECT_REQUEST: |
191 | if (!acpi_bus_get_device(handle, &device) && device) { | 197 | if (!acpi_bus_get_device(handle, &device) && device) { |
198 | device->flags.eject_pending = 1; | ||
192 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); | 199 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); |
200 | return; | ||
193 | } | 201 | } |
194 | break; | 202 | break; |
203 | |||
195 | default: | 204 | default: |
196 | break; | 205 | /* non-hotplug event; possibly handled by other handler */ |
206 | return; | ||
197 | } | 207 | } |
208 | |||
209 | /* Inform firmware that the hotplug operation has completed */ | ||
210 | (void) acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL); | ||
198 | return; | 211 | return; |
199 | } | 212 | } |
200 | 213 | ||
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index c3881b2eb8b2..9eaf708f5885 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -891,7 +891,7 @@ static void acpi_os_execute_deferred(struct work_struct *work) | |||
891 | struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); | 891 | struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work); |
892 | 892 | ||
893 | if (dpc->wait) | 893 | if (dpc->wait) |
894 | acpi_os_wait_events_complete(NULL); | 894 | acpi_os_wait_events_complete(); |
895 | 895 | ||
896 | dpc->function(dpc->context); | 896 | dpc->function(dpc->context); |
897 | kfree(dpc); | 897 | kfree(dpc); |
@@ -987,7 +987,7 @@ acpi_status acpi_os_hotplug_execute(acpi_osd_exec_callback function, | |||
987 | return __acpi_os_execute(0, function, context, 1); | 987 | return __acpi_os_execute(0, function, context, 1); |
988 | } | 988 | } |
989 | 989 | ||
990 | void acpi_os_wait_events_complete(void *context) | 990 | void acpi_os_wait_events_complete(void) |
991 | { | 991 | { |
992 | flush_workqueue(kacpid_wq); | 992 | flush_workqueue(kacpid_wq); |
993 | flush_workqueue(kacpi_notify_wq); | 993 | flush_workqueue(kacpi_notify_wq); |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index c850de4c9a14..eff722278ff5 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -189,10 +189,12 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) | |||
189 | * Processor (CPU3, 0x03, 0x00000410, 0x06) {} | 189 | * Processor (CPU3, 0x03, 0x00000410, 0x06) {} |
190 | * } | 190 | * } |
191 | * | 191 | * |
192 | * Ignores apic_id and always return 0 for CPU0's handle. | 192 | * Ignores apic_id and always returns 0 for the processor |
193 | * handle with acpi id 0 if nr_cpu_ids is 1. | ||
194 | * This should be the case if SMP tables are not found. | ||
193 | * Return -1 for other CPU's handle. | 195 | * Return -1 for other CPU's handle. |
194 | */ | 196 | */ |
195 | if (acpi_id == 0) | 197 | if (nr_cpu_ids <= 1 && acpi_id == 0) |
196 | return acpi_id; | 198 | return acpi_id; |
197 | else | 199 | else |
198 | return apic_id; | 200 | return apic_id; |
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 0734086537b8..971c45474703 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -701,9 +701,9 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
701 | { | 701 | { |
702 | struct acpi_processor *pr; | 702 | struct acpi_processor *pr; |
703 | struct acpi_device *device = NULL; | 703 | struct acpi_device *device = NULL; |
704 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | ||
704 | int result; | 705 | int result; |
705 | 706 | ||
706 | |||
707 | switch (event) { | 707 | switch (event) { |
708 | case ACPI_NOTIFY_BUS_CHECK: | 708 | case ACPI_NOTIFY_BUS_CHECK: |
709 | case ACPI_NOTIFY_DEVICE_CHECK: | 709 | case ACPI_NOTIFY_DEVICE_CHECK: |
@@ -715,14 +715,18 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
715 | if (!is_processor_present(handle)) | 715 | if (!is_processor_present(handle)) |
716 | break; | 716 | break; |
717 | 717 | ||
718 | if (acpi_bus_get_device(handle, &device)) { | 718 | if (!acpi_bus_get_device(handle, &device)) |
719 | result = acpi_processor_device_add(handle, &device); | 719 | break; |
720 | if (result) | 720 | |
721 | printk(KERN_ERR PREFIX | 721 | result = acpi_processor_device_add(handle, &device); |
722 | "Unable to add the device\n"); | 722 | if (result) { |
723 | printk(KERN_ERR PREFIX "Unable to add the device\n"); | ||
723 | break; | 724 | break; |
724 | } | 725 | } |
726 | |||
727 | ost_code = ACPI_OST_SC_SUCCESS; | ||
725 | break; | 728 | break; |
729 | |||
726 | case ACPI_NOTIFY_EJECT_REQUEST: | 730 | case ACPI_NOTIFY_EJECT_REQUEST: |
727 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 731 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
728 | "received ACPI_NOTIFY_EJECT_REQUEST\n")); | 732 | "received ACPI_NOTIFY_EJECT_REQUEST\n")); |
@@ -736,15 +740,23 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
736 | if (!pr) { | 740 | if (!pr) { |
737 | printk(KERN_ERR PREFIX | 741 | printk(KERN_ERR PREFIX |
738 | "Driver data is NULL, dropping EJECT\n"); | 742 | "Driver data is NULL, dropping EJECT\n"); |
739 | return; | 743 | break; |
740 | } | 744 | } |
745 | |||
746 | /* REVISIT: update when eject is supported */ | ||
747 | ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; | ||
741 | break; | 748 | break; |
749 | |||
742 | default: | 750 | default: |
743 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 751 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
744 | "Unsupported event [0x%x]\n", event)); | 752 | "Unsupported event [0x%x]\n", event)); |
745 | break; | 753 | |
754 | /* non-hotplug event; possibly handled by other handler */ | ||
755 | return; | ||
746 | } | 756 | } |
747 | 757 | ||
758 | /* Inform firmware that the hotplug operation has completed */ | ||
759 | (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); | ||
748 | return; | 760 | return; |
749 | } | 761 | } |
750 | 762 | ||
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f3decb30223f..9837c9c4f009 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 | ||
@@ -304,16 +313,16 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | |||
304 | pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; | 313 | pr->power.states[ACPI_STATE_C3].address = pr->pblk + 5; |
305 | 314 | ||
306 | /* determine latencies from FADT */ | 315 | /* determine latencies from FADT */ |
307 | pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.C2latency; | 316 | pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.c2_latency; |
308 | pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.C3latency; | 317 | pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.c3_latency; |
309 | 318 | ||
310 | /* | 319 | /* |
311 | * FADT specified C2 latency must be less than or equal to | 320 | * FADT specified C2 latency must be less than or equal to |
312 | * 100 microseconds. | 321 | * 100 microseconds. |
313 | */ | 322 | */ |
314 | if (acpi_gbl_FADT.C2latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { | 323 | if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { |
315 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 324 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
316 | "C2 latency too large [%d]\n", acpi_gbl_FADT.C2latency)); | 325 | "C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency)); |
317 | /* invalidate C2 */ | 326 | /* invalidate C2 */ |
318 | pr->power.states[ACPI_STATE_C2].address = 0; | 327 | pr->power.states[ACPI_STATE_C2].address = 0; |
319 | } | 328 | } |
@@ -322,9 +331,9 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | |||
322 | * FADT supplied C3 latency must be less than or equal to | 331 | * FADT supplied C3 latency must be less than or equal to |
323 | * 1000 microseconds. | 332 | * 1000 microseconds. |
324 | */ | 333 | */ |
325 | if (acpi_gbl_FADT.C3latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { | 334 | if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { |
326 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 335 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
327 | "C3 latency too large [%d]\n", acpi_gbl_FADT.C3latency)); | 336 | "C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency)); |
328 | /* invalidate C3 */ | 337 | /* invalidate C3 */ |
329 | pr->power.states[ACPI_STATE_C3].address = 0; | 338 | pr->power.states[ACPI_STATE_C3].address = 0; |
330 | } | 339 | } |
@@ -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/scan.c b/drivers/acpi/scan.c index c8a1f3b68110..148556a8f0f2 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -83,19 +83,29 @@ acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, cha | |||
83 | } | 83 | } |
84 | static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); | 84 | static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); |
85 | 85 | ||
86 | static void acpi_bus_hot_remove_device(void *context) | 86 | /** |
87 | * acpi_bus_hot_remove_device: hot-remove a device and its children | ||
88 | * @context: struct acpi_eject_event pointer (freed in this func) | ||
89 | * | ||
90 | * Hot-remove a device and its children. This function frees up the | ||
91 | * memory space passed by arg context, so that the caller may call | ||
92 | * this function asynchronously through acpi_os_hotplug_execute(). | ||
93 | */ | ||
94 | void acpi_bus_hot_remove_device(void *context) | ||
87 | { | 95 | { |
96 | struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context; | ||
88 | struct acpi_device *device; | 97 | struct acpi_device *device; |
89 | acpi_handle handle = context; | 98 | acpi_handle handle = ej_event->handle; |
90 | struct acpi_object_list arg_list; | 99 | struct acpi_object_list arg_list; |
91 | union acpi_object arg; | 100 | union acpi_object arg; |
92 | acpi_status status = AE_OK; | 101 | acpi_status status = AE_OK; |
102 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | ||
93 | 103 | ||
94 | if (acpi_bus_get_device(handle, &device)) | 104 | if (acpi_bus_get_device(handle, &device)) |
95 | return; | 105 | goto err_out; |
96 | 106 | ||
97 | if (!device) | 107 | if (!device) |
98 | return; | 108 | goto err_out; |
99 | 109 | ||
100 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 110 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
101 | "Hot-removing device %s...\n", dev_name(&device->dev))); | 111 | "Hot-removing device %s...\n", dev_name(&device->dev))); |
@@ -103,7 +113,7 @@ static void acpi_bus_hot_remove_device(void *context) | |||
103 | if (acpi_bus_trim(device, 1)) { | 113 | if (acpi_bus_trim(device, 1)) { |
104 | printk(KERN_ERR PREFIX | 114 | printk(KERN_ERR PREFIX |
105 | "Removing device failed\n"); | 115 | "Removing device failed\n"); |
106 | return; | 116 | goto err_out; |
107 | } | 117 | } |
108 | 118 | ||
109 | /* power off device */ | 119 | /* power off device */ |
@@ -129,10 +139,21 @@ static void acpi_bus_hot_remove_device(void *context) | |||
129 | * TBD: _EJD support. | 139 | * TBD: _EJD support. |
130 | */ | 140 | */ |
131 | status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL); | 141 | status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL); |
132 | if (ACPI_FAILURE(status)) | 142 | if (ACPI_FAILURE(status)) { |
133 | printk(KERN_WARNING PREFIX | 143 | if (status != AE_NOT_FOUND) |
134 | "Eject device failed\n"); | 144 | printk(KERN_WARNING PREFIX |
145 | "Eject device failed\n"); | ||
146 | goto err_out; | ||
147 | } | ||
148 | |||
149 | kfree(context); | ||
150 | return; | ||
135 | 151 | ||
152 | err_out: | ||
153 | /* Inform firmware the hot-remove operation has completed w/ error */ | ||
154 | (void) acpi_evaluate_hotplug_ost(handle, | ||
155 | ej_event->event, ost_code, NULL); | ||
156 | kfree(context); | ||
136 | return; | 157 | return; |
137 | } | 158 | } |
138 | 159 | ||
@@ -144,6 +165,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, | |||
144 | acpi_status status; | 165 | acpi_status status; |
145 | acpi_object_type type = 0; | 166 | acpi_object_type type = 0; |
146 | struct acpi_device *acpi_device = to_acpi_device(d); | 167 | struct acpi_device *acpi_device = to_acpi_device(d); |
168 | struct acpi_eject_event *ej_event; | ||
147 | 169 | ||
148 | if ((!count) || (buf[0] != '1')) { | 170 | if ((!count) || (buf[0] != '1')) { |
149 | return -EINVAL; | 171 | return -EINVAL; |
@@ -160,7 +182,25 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, | |||
160 | goto err; | 182 | goto err; |
161 | } | 183 | } |
162 | 184 | ||
163 | acpi_os_hotplug_execute(acpi_bus_hot_remove_device, acpi_device->handle); | 185 | ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); |
186 | if (!ej_event) { | ||
187 | ret = -ENOMEM; | ||
188 | goto err; | ||
189 | } | ||
190 | |||
191 | ej_event->handle = acpi_device->handle; | ||
192 | if (acpi_device->flags.eject_pending) { | ||
193 | /* event originated from ACPI eject notification */ | ||
194 | ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; | ||
195 | acpi_device->flags.eject_pending = 0; | ||
196 | } else { | ||
197 | /* event originated from user */ | ||
198 | ej_event->event = ACPI_OST_EC_OSPM_EJECT; | ||
199 | (void) acpi_evaluate_hotplug_ost(ej_event->handle, | ||
200 | ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); | ||
201 | } | ||
202 | |||
203 | acpi_os_hotplug_execute(acpi_bus_hot_remove_device, (void *)ej_event); | ||
164 | err: | 204 | err: |
165 | return ret; | 205 | return ret; |
166 | } | 206 | } |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 88561029cca8..23a53c013f1e 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -143,7 +143,7 @@ void __init acpi_old_suspend_ordering(void) | |||
143 | static int acpi_pm_freeze(void) | 143 | static int acpi_pm_freeze(void) |
144 | { | 144 | { |
145 | acpi_disable_all_gpes(); | 145 | acpi_disable_all_gpes(); |
146 | acpi_os_wait_events_complete(NULL); | 146 | acpi_os_wait_events_complete(); |
147 | acpi_ec_block_transactions(); | 147 | acpi_ec_block_transactions(); |
148 | return 0; | 148 | return 0; |
149 | } | 149 | } |
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/thermal.c b/drivers/acpi/thermal.c index 7dbebea1ec31..8275e7b06962 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -550,8 +550,6 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, | |||
550 | return 0; | 550 | return 0; |
551 | } | 551 | } |
552 | 552 | ||
553 | static const char enabled[] = "kernel"; | ||
554 | static const char disabled[] = "user"; | ||
555 | static int thermal_get_mode(struct thermal_zone_device *thermal, | 553 | static int thermal_get_mode(struct thermal_zone_device *thermal, |
556 | enum thermal_device_mode *mode) | 554 | enum thermal_device_mode *mode) |
557 | { | 555 | { |
@@ -588,8 +586,8 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, | |||
588 | if (enable != tz->tz_enabled) { | 586 | if (enable != tz->tz_enabled) { |
589 | tz->tz_enabled = enable; | 587 | tz->tz_enabled = enable; |
590 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 588 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
591 | "%s ACPI thermal control\n", | 589 | "%s kernel ACPI thermal control\n", |
592 | tz->tz_enabled ? enabled : disabled)); | 590 | tz->tz_enabled ? "Enable" : "Disable")); |
593 | acpi_thermal_check(tz); | 591 | acpi_thermal_check(tz); |
594 | } | 592 | } |
595 | return 0; | 593 | return 0; |
@@ -845,7 +843,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
845 | 843 | ||
846 | if (tz->trips.passive.flags.valid) | 844 | if (tz->trips.passive.flags.valid) |
847 | tz->thermal_zone = | 845 | tz->thermal_zone = |
848 | thermal_zone_device_register("acpitz", trips, tz, | 846 | thermal_zone_device_register("acpitz", trips, 0, tz, |
849 | &acpi_thermal_zone_ops, | 847 | &acpi_thermal_zone_ops, |
850 | tz->trips.passive.tc1, | 848 | tz->trips.passive.tc1, |
851 | tz->trips.passive.tc2, | 849 | tz->trips.passive.tc2, |
@@ -853,7 +851,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
853 | tz->polling_frequency*100); | 851 | tz->polling_frequency*100); |
854 | else | 852 | else |
855 | tz->thermal_zone = | 853 | tz->thermal_zone = |
856 | thermal_zone_device_register("acpitz", trips, tz, | 854 | thermal_zone_device_register("acpitz", trips, 0, tz, |
857 | &acpi_thermal_zone_ops, | 855 | &acpi_thermal_zone_ops, |
858 | 0, 0, 0, | 856 | 0, 0, 0, |
859 | tz->polling_frequency*100); | 857 | tz->polling_frequency*100); |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index adbbc1c80a26..3e87c9c538aa 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -412,3 +412,45 @@ out: | |||
412 | return status; | 412 | return status; |
413 | } | 413 | } |
414 | EXPORT_SYMBOL(acpi_get_physical_device_location); | 414 | EXPORT_SYMBOL(acpi_get_physical_device_location); |
415 | |||
416 | /** | ||
417 | * acpi_evaluate_hotplug_ost: Evaluate _OST for hotplug operations | ||
418 | * @handle: ACPI device handle | ||
419 | * @source_event: source event code | ||
420 | * @status_code: status code | ||
421 | * @status_buf: optional detailed information (NULL if none) | ||
422 | * | ||
423 | * Evaluate _OST for hotplug operations. All ACPI hotplug handlers | ||
424 | * must call this function when evaluating _OST for hotplug operations. | ||
425 | * When the platform does not support _OST, this function has no effect. | ||
426 | */ | ||
427 | acpi_status | ||
428 | acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event, | ||
429 | u32 status_code, struct acpi_buffer *status_buf) | ||
430 | { | ||
431 | #ifdef ACPI_HOTPLUG_OST | ||
432 | union acpi_object params[3] = { | ||
433 | {.type = ACPI_TYPE_INTEGER,}, | ||
434 | {.type = ACPI_TYPE_INTEGER,}, | ||
435 | {.type = ACPI_TYPE_BUFFER,} | ||
436 | }; | ||
437 | struct acpi_object_list arg_list = {3, params}; | ||
438 | acpi_status status; | ||
439 | |||
440 | params[0].integer.value = source_event; | ||
441 | params[1].integer.value = status_code; | ||
442 | if (status_buf != NULL) { | ||
443 | params[2].buffer.pointer = status_buf->pointer; | ||
444 | params[2].buffer.length = status_buf->length; | ||
445 | } else { | ||
446 | params[2].buffer.pointer = NULL; | ||
447 | params[2].buffer.length = 0; | ||
448 | } | ||
449 | |||
450 | status = acpi_evaluate_object(handle, "_OST", &arg_list, NULL); | ||
451 | return status; | ||
452 | #else | ||
453 | return AE_OK; | ||
454 | #endif | ||
455 | } | ||
456 | EXPORT_SYMBOL(acpi_evaluate_hotplug_ost); | ||
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..4b01ab3d2c24 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/wait.h> | 24 | #include <linux/wait.h> |
25 | #include <linux/async.h> | 25 | #include <linux/async.h> |
26 | #include <linux/pm_runtime.h> | 26 | #include <linux/pm_runtime.h> |
27 | #include <scsi/scsi_scan.h> | ||
27 | 28 | ||
28 | #include "base.h" | 29 | #include "base.h" |
29 | #include "power/power.h" | 30 | #include "power/power.h" |
@@ -100,7 +101,7 @@ static void driver_deferred_probe_add(struct device *dev) | |||
100 | mutex_lock(&deferred_probe_mutex); | 101 | mutex_lock(&deferred_probe_mutex); |
101 | if (list_empty(&dev->p->deferred_probe)) { | 102 | if (list_empty(&dev->p->deferred_probe)) { |
102 | dev_dbg(dev, "Added to deferred list\n"); | 103 | dev_dbg(dev, "Added to deferred list\n"); |
103 | list_add(&dev->p->deferred_probe, &deferred_probe_pending_list); | 104 | list_add_tail(&dev->p->deferred_probe, &deferred_probe_pending_list); |
104 | } | 105 | } |
105 | mutex_unlock(&deferred_probe_mutex); | 106 | mutex_unlock(&deferred_probe_mutex); |
106 | } | 107 | } |
@@ -332,6 +333,7 @@ void wait_for_device_probe(void) | |||
332 | /* wait for the known devices to complete their probing */ | 333 | /* wait for the known devices to complete their probing */ |
333 | wait_event(probe_waitqueue, atomic_read(&probe_count) == 0); | 334 | wait_event(probe_waitqueue, atomic_read(&probe_count) == 0); |
334 | async_synchronize_full(); | 335 | async_synchronize_full(); |
336 | scsi_complete_async_scans(); | ||
335 | } | 337 | } |
336 | EXPORT_SYMBOL_GPL(wait_for_device_probe); | 338 | EXPORT_SYMBOL_GPL(wait_for_device_probe); |
337 | 339 | ||
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/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 0bcda488f11c..c89aa01fb1de 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
@@ -246,11 +246,11 @@ struct regmap *regmap_init(struct device *dev, | |||
246 | map->lock = regmap_lock_mutex; | 246 | map->lock = regmap_lock_mutex; |
247 | map->unlock = regmap_unlock_mutex; | 247 | map->unlock = regmap_unlock_mutex; |
248 | } | 248 | } |
249 | map->format.buf_size = (config->reg_bits + config->val_bits) / 8; | ||
250 | map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8); | 249 | map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8); |
251 | map->format.pad_bytes = config->pad_bits / 8; | 250 | map->format.pad_bytes = config->pad_bits / 8; |
252 | map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8); | 251 | map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8); |
253 | map->format.buf_size += map->format.pad_bytes; | 252 | map->format.buf_size = DIV_ROUND_UP(config->reg_bits + |
253 | config->val_bits + config->pad_bits, 8); | ||
254 | map->reg_shift = config->pad_bits % 8; | 254 | map->reg_shift = config->pad_bits % 8; |
255 | if (config->reg_stride) | 255 | if (config->reg_stride) |
256 | map->reg_stride = config->reg_stride; | 256 | map->reg_stride = config->reg_stride; |
@@ -368,7 +368,7 @@ struct regmap *regmap_init(struct device *dev, | |||
368 | 368 | ||
369 | ret = regcache_init(map, config); | 369 | ret = regcache_init(map, config); |
370 | if (ret < 0) | 370 | if (ret < 0) |
371 | goto err_free_workbuf; | 371 | goto err_debugfs; |
372 | 372 | ||
373 | /* Add a devres resource for dev_get_regmap() */ | 373 | /* Add a devres resource for dev_get_regmap() */ |
374 | m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL); | 374 | m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL); |
@@ -383,7 +383,8 @@ struct regmap *regmap_init(struct device *dev, | |||
383 | 383 | ||
384 | err_cache: | 384 | err_cache: |
385 | regcache_exit(map); | 385 | regcache_exit(map); |
386 | err_free_workbuf: | 386 | err_debugfs: |
387 | regmap_debugfs_exit(map); | ||
387 | kfree(map->work_buf); | 388 | kfree(map->work_buf); |
388 | err_map: | 389 | err_map: |
389 | kfree(map); | 390 | kfree(map); |
@@ -471,6 +472,7 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config) | |||
471 | 472 | ||
472 | return ret; | 473 | return ret; |
473 | } | 474 | } |
475 | EXPORT_SYMBOL_GPL(regmap_reinit_cache); | ||
474 | 476 | ||
475 | /** | 477 | /** |
476 | * regmap_exit(): Free a previously allocated register map | 478 | * regmap_exit(): Free a previously allocated register map |
diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c index a058842f14fd..61ce4054b3c3 100644 --- a/drivers/bcma/driver_chipcommon_pmu.c +++ b/drivers/bcma/driver_chipcommon_pmu.c | |||
@@ -139,7 +139,9 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc) | |||
139 | bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7); | 139 | bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7); |
140 | break; | 140 | break; |
141 | case 0x4331: | 141 | case 0x4331: |
142 | /* BCM4331 workaround is SPROM-related, we put it in sprom.c */ | 142 | case 43431: |
143 | /* Ext PA lines must be enabled for tx on BCM4331 */ | ||
144 | bcma_chipco_bcm4331_ext_pa_lines_ctl(cc, true); | ||
143 | break; | 145 | break; |
144 | case 43224: | 146 | case 43224: |
145 | if (bus->chipinfo.rev == 0) { | 147 | if (bus->chipinfo.rev == 0) { |
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index 9a96f14c8f47..c32ebd537abe 100644 --- a/drivers/bcma/driver_pci.c +++ b/drivers/bcma/driver_pci.c | |||
@@ -232,17 +232,19 @@ void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc) | |||
232 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, | 232 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, |
233 | bool enable) | 233 | bool enable) |
234 | { | 234 | { |
235 | struct pci_dev *pdev = pc->core->bus->host_pci; | 235 | struct pci_dev *pdev; |
236 | u32 coremask, tmp; | 236 | u32 coremask, tmp; |
237 | int err = 0; | 237 | int err = 0; |
238 | 238 | ||
239 | if (core->bus->hosttype != BCMA_HOSTTYPE_PCI) { | 239 | if (!pc || core->bus->hosttype != BCMA_HOSTTYPE_PCI) { |
240 | /* This bcma device is not on a PCI host-bus. So the IRQs are | 240 | /* This bcma device is not on a PCI host-bus. So the IRQs are |
241 | * not routed through the PCI core. | 241 | * not routed through the PCI core. |
242 | * So we must not enable routing through the PCI core. */ | 242 | * So we must not enable routing through the PCI core. */ |
243 | goto out; | 243 | goto out; |
244 | } | 244 | } |
245 | 245 | ||
246 | pdev = pc->core->bus->host_pci; | ||
247 | |||
246 | err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); | 248 | err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); |
247 | if (err) | 249 | if (err) |
248 | goto out; | 250 | goto out; |
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c index c7f93359acb0..f16f42d36071 100644 --- a/drivers/bcma/sprom.c +++ b/drivers/bcma/sprom.c | |||
@@ -579,13 +579,13 @@ int bcma_sprom_get(struct bcma_bus *bus) | |||
579 | if (!sprom) | 579 | if (!sprom) |
580 | return -ENOMEM; | 580 | return -ENOMEM; |
581 | 581 | ||
582 | if (bus->chipinfo.id == 0x4331) | 582 | if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) |
583 | bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false); | 583 | bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false); |
584 | 584 | ||
585 | pr_debug("SPROM offset 0x%x\n", offset); | 585 | pr_debug("SPROM offset 0x%x\n", offset); |
586 | bcma_sprom_read(bus, offset, sprom); | 586 | bcma_sprom_read(bus, offset, sprom); |
587 | 587 | ||
588 | if (bus->chipinfo.id == 0x4331) | 588 | if (bus->chipinfo.id == 0x4331 || bus->chipinfo.id == 43431) |
589 | bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true); | 589 | bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true); |
590 | 590 | ||
591 | err = bcma_sprom_valid(sprom); | 591 | err = bcma_sprom_valid(sprom); |
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/loop.c b/drivers/block/loop.c index bbca966f8f66..3bba65510d23 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -1597,14 +1597,12 @@ static int loop_add(struct loop_device **l, int i) | |||
1597 | struct gendisk *disk; | 1597 | struct gendisk *disk; |
1598 | int err; | 1598 | int err; |
1599 | 1599 | ||
1600 | err = -ENOMEM; | ||
1600 | lo = kzalloc(sizeof(*lo), GFP_KERNEL); | 1601 | lo = kzalloc(sizeof(*lo), GFP_KERNEL); |
1601 | if (!lo) { | 1602 | if (!lo) |
1602 | err = -ENOMEM; | ||
1603 | goto out; | 1603 | goto out; |
1604 | } | ||
1605 | 1604 | ||
1606 | err = idr_pre_get(&loop_index_idr, GFP_KERNEL); | 1605 | if (!idr_pre_get(&loop_index_idr, GFP_KERNEL)) |
1607 | if (err < 0) | ||
1608 | goto out_free_dev; | 1606 | goto out_free_dev; |
1609 | 1607 | ||
1610 | if (i >= 0) { | 1608 | if (i >= 0) { |
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/rbd.c b/drivers/block/rbd.c index 65665c9c42c6..8f428a8ab003 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -499,7 +499,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header, | |||
499 | / sizeof (*ondisk)) | 499 | / sizeof (*ondisk)) |
500 | return -EINVAL; | 500 | return -EINVAL; |
501 | header->snapc = kmalloc(sizeof(struct ceph_snap_context) + | 501 | header->snapc = kmalloc(sizeof(struct ceph_snap_context) + |
502 | snap_count * sizeof (*ondisk), | 502 | snap_count * sizeof(u64), |
503 | gfp_flags); | 503 | gfp_flags); |
504 | if (!header->snapc) | 504 | if (!header->snapc) |
505 | return -ENOMEM; | 505 | return -ENOMEM; |
@@ -977,7 +977,7 @@ static void rbd_req_cb(struct ceph_osd_request *req, struct ceph_msg *msg) | |||
977 | op = (void *)(replyhead + 1); | 977 | op = (void *)(replyhead + 1); |
978 | rc = le32_to_cpu(replyhead->result); | 978 | rc = le32_to_cpu(replyhead->result); |
979 | bytes = le64_to_cpu(op->extent.length); | 979 | bytes = le64_to_cpu(op->extent.length); |
980 | read_op = (le32_to_cpu(op->op) == CEPH_OSD_OP_READ); | 980 | read_op = (le16_to_cpu(op->op) == CEPH_OSD_OP_READ); |
981 | 981 | ||
982 | dout("rbd_req_cb bytes=%lld readop=%d rc=%d\n", bytes, read_op, rc); | 982 | dout("rbd_req_cb bytes=%lld readop=%d rc=%d\n", bytes, read_op, rc); |
983 | 983 | ||
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/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c index f518b99f53f5..731c9046cf7b 100644 --- a/drivers/char/hw_random/atmel-rng.c +++ b/drivers/char/hw_random/atmel-rng.c | |||
@@ -34,8 +34,15 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max, | |||
34 | u32 *data = buf; | 34 | u32 *data = buf; |
35 | 35 | ||
36 | /* data ready? */ | 36 | /* data ready? */ |
37 | if (readl(trng->base + TRNG_ODATA) & 1) { | 37 | if (readl(trng->base + TRNG_ISR) & 1) { |
38 | *data = readl(trng->base + TRNG_ODATA); | 38 | *data = readl(trng->base + TRNG_ODATA); |
39 | /* | ||
40 | ensure data ready is only set again AFTER the next data | ||
41 | word is ready in case it got set between checking ISR | ||
42 | and reading ODATA, so we don't risk re-reading the | ||
43 | same word | ||
44 | */ | ||
45 | readl(trng->base + TRNG_ISR); | ||
39 | return 4; | 46 | return 4; |
40 | } else | 47 | } else |
41 | return 0; | 48 | return 0; |
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..0fcec2aae19c 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 |
@@ -345,31 +345,30 @@ static struct frac_rate_tbl gen_rtbl[] = { | |||
345 | /* clock parents */ | 345 | /* clock parents */ |
346 | static const char *vco_parents[] = { "osc_24m_clk", "osc_25m_clk", }; | 346 | static const char *vco_parents[] = { "osc_24m_clk", "osc_25m_clk", }; |
347 | static const char *gpt_parents[] = { "osc_24m_clk", "apb_clk", }; | 347 | static const char *gpt_parents[] = { "osc_24m_clk", "apb_clk", }; |
348 | static const char *uart0_parents[] = { "pll5_clk", "uart_synth_gate_clk", }; | 348 | static const char *uart0_parents[] = { "pll5_clk", "uart_syn_gclk", }; |
349 | static const char *c3_parents[] = { "pll5_clk", "c3_synth_gate_clk", }; | 349 | static const char *c3_parents[] = { "pll5_clk", "c3_syn_gclk", }; |
350 | static const char *gmac_phy_input_parents[] = { "gmii_125m_pad_clk", "pll2_clk", | 350 | static const char *gmac_phy_input_parents[] = { "gmii_pad_clk", "pll2_clk", |
351 | "osc_25m_clk", }; | 351 | "osc_25m_clk", }; |
352 | static const char *gmac_phy_parents[] = { "gmac_phy_input_mux_clk", | 352 | static const char *gmac_phy_parents[] = { "phy_input_mclk", "phy_syn_gclk", }; |
353 | "gmac_phy_synth_gate_clk", }; | ||
354 | static const char *clcd_synth_parents[] = { "vco1div4_clk", "pll2_clk", }; | 353 | static const char *clcd_synth_parents[] = { "vco1div4_clk", "pll2_clk", }; |
355 | static const char *clcd_pixel_parents[] = { "pll5_clk", "clcd_synth_clk", }; | 354 | static const char *clcd_pixel_parents[] = { "pll5_clk", "clcd_syn_clk", }; |
356 | static const char *i2s_src_parents[] = { "vco1div2_clk", "none", "pll3_clk", | 355 | static const char *i2s_src_parents[] = { "vco1div2_clk", "none", "pll3_clk", |
357 | "i2s_src_pad_clk", }; | 356 | "i2s_src_pad_clk", }; |
358 | static const char *i2s_ref_parents[] = { "i2s_src_mux_clk", "i2s_prs1_clk", }; | 357 | static const char *i2s_ref_parents[] = { "i2s_src_mclk", "i2s_prs1_clk", }; |
359 | static const char *gen_synth0_1_parents[] = { "vco1div4_clk", "vco3div2_clk", | 358 | static const char *gen_synth0_1_parents[] = { "vco1div4_clk", "vco3div2_clk", |
360 | "pll3_clk", }; | 359 | "pll3_clk", }; |
361 | static const char *gen_synth2_3_parents[] = { "vco1div4_clk", "vco3div2_clk", | 360 | static const char *gen_synth2_3_parents[] = { "vco1div4_clk", "vco3div2_clk", |
362 | "pll2_clk", }; | 361 | "pll2_clk", }; |
363 | static const char *rmii_phy_parents[] = { "ras_tx50_clk", "none", | 362 | static const char *rmii_phy_parents[] = { "ras_tx50_clk", "none", |
364 | "ras_pll2_clk", "ras_synth0_clk", }; | 363 | "ras_pll2_clk", "ras_syn0_clk", }; |
365 | static const char *smii_rgmii_phy_parents[] = { "none", "ras_tx125_clk", | 364 | static const char *smii_rgmii_phy_parents[] = { "none", "ras_tx125_clk", |
366 | "ras_pll2_clk", "ras_synth0_clk", }; | 365 | "ras_pll2_clk", "ras_syn0_clk", }; |
367 | static const char *uart_parents[] = { "ras_apb_clk", "gen_synth3_clk", }; | 366 | static const char *uart_parents[] = { "ras_apb_clk", "gen_syn3_clk", }; |
368 | static const char *i2c_parents[] = { "ras_apb_clk", "gen_synth1_clk", }; | 367 | static const char *i2c_parents[] = { "ras_apb_clk", "gen_syn1_clk", }; |
369 | static const char *ssp1_parents[] = { "ras_apb_clk", "gen_synth1_clk", | 368 | static const char *ssp1_parents[] = { "ras_apb_clk", "gen_syn1_clk", |
370 | "ras_plclk0_clk", }; | 369 | "ras_plclk0_clk", }; |
371 | static const char *pci_parents[] = { "ras_pll3_clk", "gen_synth2_clk", }; | 370 | static const char *pci_parents[] = { "ras_pll3_clk", "gen_syn2_clk", }; |
372 | static const char *tdm_parents[] = { "ras_pll3_clk", "gen_synth1_clk", }; | 371 | static const char *tdm_parents[] = { "ras_pll3_clk", "gen_syn1_clk", }; |
373 | 372 | ||
374 | void __init spear1310_clk_init(void) | 373 | void __init spear1310_clk_init(void) |
375 | { | 374 | { |
@@ -390,9 +389,9 @@ void __init spear1310_clk_init(void) | |||
390 | 25000000); | 389 | 25000000); |
391 | clk_register_clkdev(clk, "osc_25m_clk", NULL); | 390 | clk_register_clkdev(clk, "osc_25m_clk", NULL); |
392 | 391 | ||
393 | clk = clk_register_fixed_rate(NULL, "gmii_125m_pad_clk", NULL, | 392 | clk = clk_register_fixed_rate(NULL, "gmii_pad_clk", NULL, CLK_IS_ROOT, |
394 | CLK_IS_ROOT, 125000000); | 393 | 125000000); |
395 | clk_register_clkdev(clk, "gmii_125m_pad_clk", NULL); | 394 | clk_register_clkdev(clk, "gmii_pad_clk", NULL); |
396 | 395 | ||
397 | clk = clk_register_fixed_rate(NULL, "i2s_src_pad_clk", NULL, | 396 | clk = clk_register_fixed_rate(NULL, "i2s_src_pad_clk", NULL, |
398 | CLK_IS_ROOT, 12288000); | 397 | CLK_IS_ROOT, 12288000); |
@@ -406,34 +405,34 @@ void __init spear1310_clk_init(void) | |||
406 | 405 | ||
407 | /* clock derived from 24 or 25 MHz osc clk */ | 406 | /* clock derived from 24 or 25 MHz osc clk */ |
408 | /* vco-pll */ | 407 | /* vco-pll */ |
409 | clk = clk_register_mux(NULL, "vco1_mux_clk", vco_parents, | 408 | clk = clk_register_mux(NULL, "vco1_mclk", vco_parents, |
410 | ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG, | 409 | ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG, |
411 | SPEAR1310_PLL1_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0, | 410 | SPEAR1310_PLL1_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0, |
412 | &_lock); | 411 | &_lock); |
413 | clk_register_clkdev(clk, "vco1_mux_clk", NULL); | 412 | clk_register_clkdev(clk, "vco1_mclk", NULL); |
414 | clk = clk_register_vco_pll("vco1_clk", "pll1_clk", NULL, "vco1_mux_clk", | 413 | clk = clk_register_vco_pll("vco1_clk", "pll1_clk", NULL, "vco1_mclk", |
415 | 0, SPEAR1310_PLL1_CTR, SPEAR1310_PLL1_FRQ, pll_rtbl, | 414 | 0, SPEAR1310_PLL1_CTR, SPEAR1310_PLL1_FRQ, pll_rtbl, |
416 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); | 415 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); |
417 | clk_register_clkdev(clk, "vco1_clk", NULL); | 416 | clk_register_clkdev(clk, "vco1_clk", NULL); |
418 | clk_register_clkdev(clk1, "pll1_clk", NULL); | 417 | clk_register_clkdev(clk1, "pll1_clk", NULL); |
419 | 418 | ||
420 | clk = clk_register_mux(NULL, "vco2_mux_clk", vco_parents, | 419 | clk = clk_register_mux(NULL, "vco2_mclk", vco_parents, |
421 | ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG, | 420 | ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG, |
422 | SPEAR1310_PLL2_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0, | 421 | SPEAR1310_PLL2_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0, |
423 | &_lock); | 422 | &_lock); |
424 | clk_register_clkdev(clk, "vco2_mux_clk", NULL); | 423 | clk_register_clkdev(clk, "vco2_mclk", NULL); |
425 | clk = clk_register_vco_pll("vco2_clk", "pll2_clk", NULL, "vco2_mux_clk", | 424 | clk = clk_register_vco_pll("vco2_clk", "pll2_clk", NULL, "vco2_mclk", |
426 | 0, SPEAR1310_PLL2_CTR, SPEAR1310_PLL2_FRQ, pll_rtbl, | 425 | 0, SPEAR1310_PLL2_CTR, SPEAR1310_PLL2_FRQ, pll_rtbl, |
427 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); | 426 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); |
428 | clk_register_clkdev(clk, "vco2_clk", NULL); | 427 | clk_register_clkdev(clk, "vco2_clk", NULL); |
429 | clk_register_clkdev(clk1, "pll2_clk", NULL); | 428 | clk_register_clkdev(clk1, "pll2_clk", NULL); |
430 | 429 | ||
431 | clk = clk_register_mux(NULL, "vco3_mux_clk", vco_parents, | 430 | clk = clk_register_mux(NULL, "vco3_mclk", vco_parents, |
432 | ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG, | 431 | ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG, |
433 | SPEAR1310_PLL3_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0, | 432 | SPEAR1310_PLL3_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0, |
434 | &_lock); | 433 | &_lock); |
435 | clk_register_clkdev(clk, "vco3_mux_clk", NULL); | 434 | clk_register_clkdev(clk, "vco3_mclk", NULL); |
436 | clk = clk_register_vco_pll("vco3_clk", "pll3_clk", NULL, "vco3_mux_clk", | 435 | clk = clk_register_vco_pll("vco3_clk", "pll3_clk", NULL, "vco3_mclk", |
437 | 0, SPEAR1310_PLL3_CTR, SPEAR1310_PLL3_FRQ, pll_rtbl, | 436 | 0, SPEAR1310_PLL3_CTR, SPEAR1310_PLL3_FRQ, pll_rtbl, |
438 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); | 437 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); |
439 | clk_register_clkdev(clk, "vco3_clk", NULL); | 438 | clk_register_clkdev(clk, "vco3_clk", NULL); |
@@ -473,7 +472,7 @@ void __init spear1310_clk_init(void) | |||
473 | /* peripherals */ | 472 | /* peripherals */ |
474 | clk_register_fixed_factor(NULL, "thermal_clk", "osc_24m_clk", 0, 1, | 473 | clk_register_fixed_factor(NULL, "thermal_clk", "osc_24m_clk", 0, 1, |
475 | 128); | 474 | 128); |
476 | clk = clk_register_gate(NULL, "thermal_gate_clk", "thermal_clk", 0, | 475 | clk = clk_register_gate(NULL, "thermal_gclk", "thermal_clk", 0, |
477 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_THSENS_CLK_ENB, 0, | 476 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_THSENS_CLK_ENB, 0, |
478 | &_lock); | 477 | &_lock); |
479 | clk_register_clkdev(clk, NULL, "spear_thermal"); | 478 | clk_register_clkdev(clk, NULL, "spear_thermal"); |
@@ -500,177 +499,176 @@ void __init spear1310_clk_init(void) | |||
500 | clk_register_clkdev(clk, "apb_clk", NULL); | 499 | clk_register_clkdev(clk, "apb_clk", NULL); |
501 | 500 | ||
502 | /* gpt clocks */ | 501 | /* gpt clocks */ |
503 | clk = clk_register_mux(NULL, "gpt0_mux_clk", gpt_parents, | 502 | clk = clk_register_mux(NULL, "gpt0_mclk", gpt_parents, |
504 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, | 503 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, |
505 | SPEAR1310_GPT0_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, | 504 | SPEAR1310_GPT0_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, |
506 | &_lock); | 505 | &_lock); |
507 | clk_register_clkdev(clk, "gpt0_mux_clk", NULL); | 506 | clk_register_clkdev(clk, "gpt0_mclk", NULL); |
508 | clk = clk_register_gate(NULL, "gpt0_clk", "gpt0_mux_clk", 0, | 507 | clk = clk_register_gate(NULL, "gpt0_clk", "gpt0_mclk", 0, |
509 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPT0_CLK_ENB, 0, | 508 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPT0_CLK_ENB, 0, |
510 | &_lock); | 509 | &_lock); |
511 | clk_register_clkdev(clk, NULL, "gpt0"); | 510 | clk_register_clkdev(clk, NULL, "gpt0"); |
512 | 511 | ||
513 | clk = clk_register_mux(NULL, "gpt1_mux_clk", gpt_parents, | 512 | clk = clk_register_mux(NULL, "gpt1_mclk", gpt_parents, |
514 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, | 513 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, |
515 | SPEAR1310_GPT1_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, | 514 | SPEAR1310_GPT1_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, |
516 | &_lock); | 515 | &_lock); |
517 | clk_register_clkdev(clk, "gpt1_mux_clk", NULL); | 516 | clk_register_clkdev(clk, "gpt1_mclk", NULL); |
518 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mux_clk", 0, | 517 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mclk", 0, |
519 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPT1_CLK_ENB, 0, | 518 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPT1_CLK_ENB, 0, |
520 | &_lock); | 519 | &_lock); |
521 | clk_register_clkdev(clk, NULL, "gpt1"); | 520 | clk_register_clkdev(clk, NULL, "gpt1"); |
522 | 521 | ||
523 | clk = clk_register_mux(NULL, "gpt2_mux_clk", gpt_parents, | 522 | clk = clk_register_mux(NULL, "gpt2_mclk", gpt_parents, |
524 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, | 523 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, |
525 | SPEAR1310_GPT2_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, | 524 | SPEAR1310_GPT2_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, |
526 | &_lock); | 525 | &_lock); |
527 | clk_register_clkdev(clk, "gpt2_mux_clk", NULL); | 526 | clk_register_clkdev(clk, "gpt2_mclk", NULL); |
528 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mux_clk", 0, | 527 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mclk", 0, |
529 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_GPT2_CLK_ENB, 0, | 528 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_GPT2_CLK_ENB, 0, |
530 | &_lock); | 529 | &_lock); |
531 | clk_register_clkdev(clk, NULL, "gpt2"); | 530 | clk_register_clkdev(clk, NULL, "gpt2"); |
532 | 531 | ||
533 | clk = clk_register_mux(NULL, "gpt3_mux_clk", gpt_parents, | 532 | clk = clk_register_mux(NULL, "gpt3_mclk", gpt_parents, |
534 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, | 533 | ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG, |
535 | SPEAR1310_GPT3_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, | 534 | SPEAR1310_GPT3_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0, |
536 | &_lock); | 535 | &_lock); |
537 | clk_register_clkdev(clk, "gpt3_mux_clk", NULL); | 536 | clk_register_clkdev(clk, "gpt3_mclk", NULL); |
538 | clk = clk_register_gate(NULL, "gpt3_clk", "gpt3_mux_clk", 0, | 537 | clk = clk_register_gate(NULL, "gpt3_clk", "gpt3_mclk", 0, |
539 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_GPT3_CLK_ENB, 0, | 538 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_GPT3_CLK_ENB, 0, |
540 | &_lock); | 539 | &_lock); |
541 | clk_register_clkdev(clk, NULL, "gpt3"); | 540 | clk_register_clkdev(clk, NULL, "gpt3"); |
542 | 541 | ||
543 | /* others */ | 542 | /* others */ |
544 | clk = clk_register_aux("uart_synth_clk", "uart_synth_gate_clk", | 543 | clk = clk_register_aux("uart_syn_clk", "uart_syn_gclk", "vco1div2_clk", |
545 | "vco1div2_clk", 0, SPEAR1310_UART_CLK_SYNT, NULL, | 544 | 0, SPEAR1310_UART_CLK_SYNT, NULL, aux_rtbl, |
546 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 545 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
547 | clk_register_clkdev(clk, "uart_synth_clk", NULL); | 546 | clk_register_clkdev(clk, "uart_syn_clk", NULL); |
548 | clk_register_clkdev(clk1, "uart_synth_gate_clk", NULL); | 547 | clk_register_clkdev(clk1, "uart_syn_gclk", NULL); |
549 | 548 | ||
550 | clk = clk_register_mux(NULL, "uart0_mux_clk", uart0_parents, | 549 | clk = clk_register_mux(NULL, "uart0_mclk", uart0_parents, |
551 | ARRAY_SIZE(uart0_parents), 0, SPEAR1310_PERIP_CLK_CFG, | 550 | ARRAY_SIZE(uart0_parents), 0, SPEAR1310_PERIP_CLK_CFG, |
552 | SPEAR1310_UART_CLK_SHIFT, SPEAR1310_UART_CLK_MASK, 0, | 551 | SPEAR1310_UART_CLK_SHIFT, SPEAR1310_UART_CLK_MASK, 0, |
553 | &_lock); | 552 | &_lock); |
554 | clk_register_clkdev(clk, "uart0_mux_clk", NULL); | 553 | clk_register_clkdev(clk, "uart0_mclk", NULL); |
555 | 554 | ||
556 | clk = clk_register_gate(NULL, "uart0_clk", "uart0_mux_clk", 0, | 555 | clk = clk_register_gate(NULL, "uart0_clk", "uart0_mclk", 0, |
557 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_UART_CLK_ENB, 0, | 556 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_UART_CLK_ENB, 0, |
558 | &_lock); | 557 | &_lock); |
559 | clk_register_clkdev(clk, NULL, "e0000000.serial"); | 558 | clk_register_clkdev(clk, NULL, "e0000000.serial"); |
560 | 559 | ||
561 | clk = clk_register_aux("sdhci_synth_clk", "sdhci_synth_gate_clk", | 560 | clk = clk_register_aux("sdhci_syn_clk", "sdhci_syn_gclk", |
562 | "vco1div2_clk", 0, SPEAR1310_SDHCI_CLK_SYNT, NULL, | 561 | "vco1div2_clk", 0, SPEAR1310_SDHCI_CLK_SYNT, NULL, |
563 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 562 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
564 | clk_register_clkdev(clk, "sdhci_synth_clk", NULL); | 563 | clk_register_clkdev(clk, "sdhci_syn_clk", NULL); |
565 | clk_register_clkdev(clk1, "sdhci_synth_gate_clk", NULL); | 564 | clk_register_clkdev(clk1, "sdhci_syn_gclk", NULL); |
566 | 565 | ||
567 | clk = clk_register_gate(NULL, "sdhci_clk", "sdhci_synth_gate_clk", 0, | 566 | clk = clk_register_gate(NULL, "sdhci_clk", "sdhci_syn_gclk", 0, |
568 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_SDHCI_CLK_ENB, 0, | 567 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_SDHCI_CLK_ENB, 0, |
569 | &_lock); | 568 | &_lock); |
570 | clk_register_clkdev(clk, NULL, "b3000000.sdhci"); | 569 | clk_register_clkdev(clk, NULL, "b3000000.sdhci"); |
571 | 570 | ||
572 | clk = clk_register_aux("cfxd_synth_clk", "cfxd_synth_gate_clk", | 571 | clk = clk_register_aux("cfxd_syn_clk", "cfxd_syn_gclk", "vco1div2_clk", |
573 | "vco1div2_clk", 0, SPEAR1310_CFXD_CLK_SYNT, NULL, | 572 | 0, SPEAR1310_CFXD_CLK_SYNT, NULL, aux_rtbl, |
574 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 573 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
575 | clk_register_clkdev(clk, "cfxd_synth_clk", NULL); | 574 | clk_register_clkdev(clk, "cfxd_syn_clk", NULL); |
576 | clk_register_clkdev(clk1, "cfxd_synth_gate_clk", NULL); | 575 | clk_register_clkdev(clk1, "cfxd_syn_gclk", NULL); |
577 | 576 | ||
578 | clk = clk_register_gate(NULL, "cfxd_clk", "cfxd_synth_gate_clk", 0, | 577 | clk = clk_register_gate(NULL, "cfxd_clk", "cfxd_syn_gclk", 0, |
579 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_CFXD_CLK_ENB, 0, | 578 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_CFXD_CLK_ENB, 0, |
580 | &_lock); | 579 | &_lock); |
581 | clk_register_clkdev(clk, NULL, "b2800000.cf"); | 580 | clk_register_clkdev(clk, NULL, "b2800000.cf"); |
582 | clk_register_clkdev(clk, NULL, "arasan_xd"); | 581 | clk_register_clkdev(clk, NULL, "arasan_xd"); |
583 | 582 | ||
584 | clk = clk_register_aux("c3_synth_clk", "c3_synth_gate_clk", | 583 | clk = clk_register_aux("c3_syn_clk", "c3_syn_gclk", "vco1div2_clk", |
585 | "vco1div2_clk", 0, SPEAR1310_C3_CLK_SYNT, NULL, | 584 | 0, SPEAR1310_C3_CLK_SYNT, NULL, aux_rtbl, |
586 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 585 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
587 | clk_register_clkdev(clk, "c3_synth_clk", NULL); | 586 | clk_register_clkdev(clk, "c3_syn_clk", NULL); |
588 | clk_register_clkdev(clk1, "c3_synth_gate_clk", NULL); | 587 | clk_register_clkdev(clk1, "c3_syn_gclk", NULL); |
589 | 588 | ||
590 | clk = clk_register_mux(NULL, "c3_mux_clk", c3_parents, | 589 | clk = clk_register_mux(NULL, "c3_mclk", c3_parents, |
591 | ARRAY_SIZE(c3_parents), 0, SPEAR1310_PERIP_CLK_CFG, | 590 | ARRAY_SIZE(c3_parents), 0, SPEAR1310_PERIP_CLK_CFG, |
592 | SPEAR1310_C3_CLK_SHIFT, SPEAR1310_C3_CLK_MASK, 0, | 591 | SPEAR1310_C3_CLK_SHIFT, SPEAR1310_C3_CLK_MASK, 0, |
593 | &_lock); | 592 | &_lock); |
594 | clk_register_clkdev(clk, "c3_mux_clk", NULL); | 593 | clk_register_clkdev(clk, "c3_mclk", NULL); |
595 | 594 | ||
596 | clk = clk_register_gate(NULL, "c3_clk", "c3_mux_clk", 0, | 595 | clk = clk_register_gate(NULL, "c3_clk", "c3_mclk", 0, |
597 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_C3_CLK_ENB, 0, | 596 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_C3_CLK_ENB, 0, |
598 | &_lock); | 597 | &_lock); |
599 | clk_register_clkdev(clk, NULL, "c3"); | 598 | clk_register_clkdev(clk, NULL, "c3"); |
600 | 599 | ||
601 | /* gmac */ | 600 | /* gmac */ |
602 | clk = clk_register_mux(NULL, "gmac_phy_input_mux_clk", | 601 | clk = clk_register_mux(NULL, "phy_input_mclk", gmac_phy_input_parents, |
603 | gmac_phy_input_parents, | ||
604 | ARRAY_SIZE(gmac_phy_input_parents), 0, | 602 | ARRAY_SIZE(gmac_phy_input_parents), 0, |
605 | SPEAR1310_GMAC_CLK_CFG, | 603 | SPEAR1310_GMAC_CLK_CFG, |
606 | SPEAR1310_GMAC_PHY_INPUT_CLK_SHIFT, | 604 | SPEAR1310_GMAC_PHY_INPUT_CLK_SHIFT, |
607 | SPEAR1310_GMAC_PHY_INPUT_CLK_MASK, 0, &_lock); | 605 | SPEAR1310_GMAC_PHY_INPUT_CLK_MASK, 0, &_lock); |
608 | clk_register_clkdev(clk, "gmac_phy_input_mux_clk", NULL); | 606 | clk_register_clkdev(clk, "phy_input_mclk", NULL); |
609 | 607 | ||
610 | clk = clk_register_aux("gmac_phy_synth_clk", "gmac_phy_synth_gate_clk", | 608 | clk = clk_register_aux("phy_syn_clk", "phy_syn_gclk", "phy_input_mclk", |
611 | "gmac_phy_input_mux_clk", 0, SPEAR1310_GMAC_CLK_SYNT, | 609 | 0, SPEAR1310_GMAC_CLK_SYNT, NULL, gmac_rtbl, |
612 | NULL, gmac_rtbl, ARRAY_SIZE(gmac_rtbl), &_lock, &clk1); | 610 | ARRAY_SIZE(gmac_rtbl), &_lock, &clk1); |
613 | clk_register_clkdev(clk, "gmac_phy_synth_clk", NULL); | 611 | clk_register_clkdev(clk, "phy_syn_clk", NULL); |
614 | clk_register_clkdev(clk1, "gmac_phy_synth_gate_clk", NULL); | 612 | clk_register_clkdev(clk1, "phy_syn_gclk", NULL); |
615 | 613 | ||
616 | clk = clk_register_mux(NULL, "gmac_phy_mux_clk", gmac_phy_parents, | 614 | clk = clk_register_mux(NULL, "phy_mclk", gmac_phy_parents, |
617 | ARRAY_SIZE(gmac_phy_parents), 0, | 615 | ARRAY_SIZE(gmac_phy_parents), 0, |
618 | SPEAR1310_PERIP_CLK_CFG, SPEAR1310_GMAC_PHY_CLK_SHIFT, | 616 | SPEAR1310_PERIP_CLK_CFG, SPEAR1310_GMAC_PHY_CLK_SHIFT, |
619 | SPEAR1310_GMAC_PHY_CLK_MASK, 0, &_lock); | 617 | SPEAR1310_GMAC_PHY_CLK_MASK, 0, &_lock); |
620 | clk_register_clkdev(clk, NULL, "stmmacphy.0"); | 618 | clk_register_clkdev(clk, NULL, "stmmacphy.0"); |
621 | 619 | ||
622 | /* clcd */ | 620 | /* clcd */ |
623 | clk = clk_register_mux(NULL, "clcd_synth_mux_clk", clcd_synth_parents, | 621 | clk = clk_register_mux(NULL, "clcd_syn_mclk", clcd_synth_parents, |
624 | ARRAY_SIZE(clcd_synth_parents), 0, | 622 | ARRAY_SIZE(clcd_synth_parents), 0, |
625 | SPEAR1310_CLCD_CLK_SYNT, SPEAR1310_CLCD_SYNT_CLK_SHIFT, | 623 | SPEAR1310_CLCD_CLK_SYNT, SPEAR1310_CLCD_SYNT_CLK_SHIFT, |
626 | SPEAR1310_CLCD_SYNT_CLK_MASK, 0, &_lock); | 624 | SPEAR1310_CLCD_SYNT_CLK_MASK, 0, &_lock); |
627 | clk_register_clkdev(clk, "clcd_synth_mux_clk", NULL); | 625 | clk_register_clkdev(clk, "clcd_syn_mclk", NULL); |
628 | 626 | ||
629 | clk = clk_register_frac("clcd_synth_clk", "clcd_synth_mux_clk", 0, | 627 | clk = clk_register_frac("clcd_syn_clk", "clcd_syn_mclk", 0, |
630 | SPEAR1310_CLCD_CLK_SYNT, clcd_rtbl, | 628 | SPEAR1310_CLCD_CLK_SYNT, clcd_rtbl, |
631 | ARRAY_SIZE(clcd_rtbl), &_lock); | 629 | ARRAY_SIZE(clcd_rtbl), &_lock); |
632 | clk_register_clkdev(clk, "clcd_synth_clk", NULL); | 630 | clk_register_clkdev(clk, "clcd_syn_clk", NULL); |
633 | 631 | ||
634 | clk = clk_register_mux(NULL, "clcd_pixel_mux_clk", clcd_pixel_parents, | 632 | clk = clk_register_mux(NULL, "clcd_pixel_mclk", clcd_pixel_parents, |
635 | ARRAY_SIZE(clcd_pixel_parents), 0, | 633 | ARRAY_SIZE(clcd_pixel_parents), 0, |
636 | SPEAR1310_PERIP_CLK_CFG, SPEAR1310_CLCD_CLK_SHIFT, | 634 | SPEAR1310_PERIP_CLK_CFG, SPEAR1310_CLCD_CLK_SHIFT, |
637 | SPEAR1310_CLCD_CLK_MASK, 0, &_lock); | 635 | SPEAR1310_CLCD_CLK_MASK, 0, &_lock); |
638 | clk_register_clkdev(clk, "clcd_pixel_clk", NULL); | 636 | clk_register_clkdev(clk, "clcd_pixel_clk", NULL); |
639 | 637 | ||
640 | clk = clk_register_gate(NULL, "clcd_clk", "clcd_pixel_mux_clk", 0, | 638 | clk = clk_register_gate(NULL, "clcd_clk", "clcd_pixel_mclk", 0, |
641 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_CLCD_CLK_ENB, 0, | 639 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_CLCD_CLK_ENB, 0, |
642 | &_lock); | 640 | &_lock); |
643 | clk_register_clkdev(clk, "clcd_clk", NULL); | 641 | clk_register_clkdev(clk, "clcd_clk", NULL); |
644 | 642 | ||
645 | /* i2s */ | 643 | /* i2s */ |
646 | clk = clk_register_mux(NULL, "i2s_src_mux_clk", i2s_src_parents, | 644 | clk = clk_register_mux(NULL, "i2s_src_mclk", i2s_src_parents, |
647 | ARRAY_SIZE(i2s_src_parents), 0, SPEAR1310_I2S_CLK_CFG, | 645 | ARRAY_SIZE(i2s_src_parents), 0, SPEAR1310_I2S_CLK_CFG, |
648 | SPEAR1310_I2S_SRC_CLK_SHIFT, SPEAR1310_I2S_SRC_CLK_MASK, | 646 | SPEAR1310_I2S_SRC_CLK_SHIFT, SPEAR1310_I2S_SRC_CLK_MASK, |
649 | 0, &_lock); | 647 | 0, &_lock); |
650 | clk_register_clkdev(clk, "i2s_src_clk", NULL); | 648 | clk_register_clkdev(clk, "i2s_src_clk", NULL); |
651 | 649 | ||
652 | clk = clk_register_aux("i2s_prs1_clk", NULL, "i2s_src_mux_clk", 0, | 650 | clk = clk_register_aux("i2s_prs1_clk", NULL, "i2s_src_mclk", 0, |
653 | SPEAR1310_I2S_CLK_CFG, &i2s_prs1_masks, i2s_prs1_rtbl, | 651 | SPEAR1310_I2S_CLK_CFG, &i2s_prs1_masks, i2s_prs1_rtbl, |
654 | ARRAY_SIZE(i2s_prs1_rtbl), &_lock, NULL); | 652 | ARRAY_SIZE(i2s_prs1_rtbl), &_lock, NULL); |
655 | clk_register_clkdev(clk, "i2s_prs1_clk", NULL); | 653 | clk_register_clkdev(clk, "i2s_prs1_clk", NULL); |
656 | 654 | ||
657 | clk = clk_register_mux(NULL, "i2s_ref_mux_clk", i2s_ref_parents, | 655 | clk = clk_register_mux(NULL, "i2s_ref_mclk", i2s_ref_parents, |
658 | ARRAY_SIZE(i2s_ref_parents), 0, SPEAR1310_I2S_CLK_CFG, | 656 | ARRAY_SIZE(i2s_ref_parents), 0, SPEAR1310_I2S_CLK_CFG, |
659 | SPEAR1310_I2S_REF_SHIFT, SPEAR1310_I2S_REF_SEL_MASK, 0, | 657 | SPEAR1310_I2S_REF_SHIFT, SPEAR1310_I2S_REF_SEL_MASK, 0, |
660 | &_lock); | 658 | &_lock); |
661 | clk_register_clkdev(clk, "i2s_ref_clk", NULL); | 659 | clk_register_clkdev(clk, "i2s_ref_clk", NULL); |
662 | 660 | ||
663 | clk = clk_register_gate(NULL, "i2s_ref_pad_clk", "i2s_ref_mux_clk", 0, | 661 | clk = clk_register_gate(NULL, "i2s_ref_pad_clk", "i2s_ref_mclk", 0, |
664 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_I2S_REF_PAD_CLK_ENB, | 662 | SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_I2S_REF_PAD_CLK_ENB, |
665 | 0, &_lock); | 663 | 0, &_lock); |
666 | clk_register_clkdev(clk, "i2s_ref_pad_clk", NULL); | 664 | clk_register_clkdev(clk, "i2s_ref_pad_clk", NULL); |
667 | 665 | ||
668 | clk = clk_register_aux("i2s_sclk_clk", "i2s_sclk_gate_clk", | 666 | clk = clk_register_aux("i2s_sclk_clk", "i2s_sclk_gclk", |
669 | "i2s_ref_pad_clk", 0, SPEAR1310_I2S_CLK_CFG, | 667 | "i2s_ref_pad_clk", 0, SPEAR1310_I2S_CLK_CFG, |
670 | &i2s_sclk_masks, i2s_sclk_rtbl, | 668 | &i2s_sclk_masks, i2s_sclk_rtbl, |
671 | ARRAY_SIZE(i2s_sclk_rtbl), &_lock, &clk1); | 669 | ARRAY_SIZE(i2s_sclk_rtbl), &_lock, &clk1); |
672 | clk_register_clkdev(clk, "i2s_sclk_clk", NULL); | 670 | clk_register_clkdev(clk, "i2s_sclk_clk", NULL); |
673 | clk_register_clkdev(clk1, "i2s_sclk_gate_clk", NULL); | 671 | clk_register_clkdev(clk1, "i2s_sclk_gclk", NULL); |
674 | 672 | ||
675 | /* clock derived from ahb clk */ | 673 | /* clock derived from ahb clk */ |
676 | clk = clk_register_gate(NULL, "i2c0_clk", "ahb_clk", 0, | 674 | clk = clk_register_gate(NULL, "i2c0_clk", "ahb_clk", 0, |
@@ -747,13 +745,13 @@ void __init spear1310_clk_init(void) | |||
747 | &_lock); | 745 | &_lock); |
748 | clk_register_clkdev(clk, "sysram1_clk", NULL); | 746 | clk_register_clkdev(clk, "sysram1_clk", NULL); |
749 | 747 | ||
750 | clk = clk_register_aux("adc_synth_clk", "adc_synth_gate_clk", "ahb_clk", | 748 | clk = clk_register_aux("adc_syn_clk", "adc_syn_gclk", "ahb_clk", |
751 | 0, SPEAR1310_ADC_CLK_SYNT, NULL, adc_rtbl, | 749 | 0, SPEAR1310_ADC_CLK_SYNT, NULL, adc_rtbl, |
752 | ARRAY_SIZE(adc_rtbl), &_lock, &clk1); | 750 | ARRAY_SIZE(adc_rtbl), &_lock, &clk1); |
753 | clk_register_clkdev(clk, "adc_synth_clk", NULL); | 751 | clk_register_clkdev(clk, "adc_syn_clk", NULL); |
754 | clk_register_clkdev(clk1, "adc_synth_gate_clk", NULL); | 752 | clk_register_clkdev(clk1, "adc_syn_gclk", NULL); |
755 | 753 | ||
756 | clk = clk_register_gate(NULL, "adc_clk", "adc_synth_gate_clk", 0, | 754 | clk = clk_register_gate(NULL, "adc_clk", "adc_syn_gclk", 0, |
757 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_ADC_CLK_ENB, 0, | 755 | SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_ADC_CLK_ENB, 0, |
758 | &_lock); | 756 | &_lock); |
759 | clk_register_clkdev(clk, NULL, "adc_clk"); | 757 | clk_register_clkdev(clk, NULL, "adc_clk"); |
@@ -790,37 +788,37 @@ void __init spear1310_clk_init(void) | |||
790 | clk_register_clkdev(clk, NULL, "e0300000.kbd"); | 788 | clk_register_clkdev(clk, NULL, "e0300000.kbd"); |
791 | 789 | ||
792 | /* RAS clks */ | 790 | /* RAS clks */ |
793 | clk = clk_register_mux(NULL, "gen_synth0_1_mux_clk", | 791 | clk = clk_register_mux(NULL, "gen_syn0_1_mclk", gen_synth0_1_parents, |
794 | gen_synth0_1_parents, ARRAY_SIZE(gen_synth0_1_parents), | 792 | ARRAY_SIZE(gen_synth0_1_parents), 0, SPEAR1310_PLL_CFG, |
795 | 0, SPEAR1310_PLL_CFG, SPEAR1310_RAS_SYNT0_1_CLK_SHIFT, | 793 | SPEAR1310_RAS_SYNT0_1_CLK_SHIFT, |
796 | SPEAR1310_RAS_SYNT_CLK_MASK, 0, &_lock); | 794 | SPEAR1310_RAS_SYNT_CLK_MASK, 0, &_lock); |
797 | clk_register_clkdev(clk, "gen_synth0_1_clk", NULL); | 795 | clk_register_clkdev(clk, "gen_syn0_1_clk", NULL); |
798 | 796 | ||
799 | clk = clk_register_mux(NULL, "gen_synth2_3_mux_clk", | 797 | clk = clk_register_mux(NULL, "gen_syn2_3_mclk", gen_synth2_3_parents, |
800 | gen_synth2_3_parents, ARRAY_SIZE(gen_synth2_3_parents), | 798 | ARRAY_SIZE(gen_synth2_3_parents), 0, SPEAR1310_PLL_CFG, |
801 | 0, SPEAR1310_PLL_CFG, SPEAR1310_RAS_SYNT2_3_CLK_SHIFT, | 799 | SPEAR1310_RAS_SYNT2_3_CLK_SHIFT, |
802 | SPEAR1310_RAS_SYNT_CLK_MASK, 0, &_lock); | 800 | SPEAR1310_RAS_SYNT_CLK_MASK, 0, &_lock); |
803 | clk_register_clkdev(clk, "gen_synth2_3_clk", NULL); | 801 | clk_register_clkdev(clk, "gen_syn2_3_clk", NULL); |
804 | 802 | ||
805 | clk = clk_register_frac("gen_synth0_clk", "gen_synth0_1_clk", 0, | 803 | clk = clk_register_frac("gen_syn0_clk", "gen_syn0_1_clk", 0, |
806 | SPEAR1310_RAS_CLK_SYNT0, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 804 | SPEAR1310_RAS_CLK_SYNT0, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
807 | &_lock); | 805 | &_lock); |
808 | clk_register_clkdev(clk, "gen_synth0_clk", NULL); | 806 | clk_register_clkdev(clk, "gen_syn0_clk", NULL); |
809 | 807 | ||
810 | clk = clk_register_frac("gen_synth1_clk", "gen_synth0_1_clk", 0, | 808 | clk = clk_register_frac("gen_syn1_clk", "gen_syn0_1_clk", 0, |
811 | SPEAR1310_RAS_CLK_SYNT1, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 809 | SPEAR1310_RAS_CLK_SYNT1, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
812 | &_lock); | 810 | &_lock); |
813 | clk_register_clkdev(clk, "gen_synth1_clk", NULL); | 811 | clk_register_clkdev(clk, "gen_syn1_clk", NULL); |
814 | 812 | ||
815 | clk = clk_register_frac("gen_synth2_clk", "gen_synth2_3_clk", 0, | 813 | clk = clk_register_frac("gen_syn2_clk", "gen_syn2_3_clk", 0, |
816 | SPEAR1310_RAS_CLK_SYNT2, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 814 | SPEAR1310_RAS_CLK_SYNT2, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
817 | &_lock); | 815 | &_lock); |
818 | clk_register_clkdev(clk, "gen_synth2_clk", NULL); | 816 | clk_register_clkdev(clk, "gen_syn2_clk", NULL); |
819 | 817 | ||
820 | clk = clk_register_frac("gen_synth3_clk", "gen_synth2_3_clk", 0, | 818 | clk = clk_register_frac("gen_syn3_clk", "gen_syn2_3_clk", 0, |
821 | SPEAR1310_RAS_CLK_SYNT3, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 819 | SPEAR1310_RAS_CLK_SYNT3, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
822 | &_lock); | 820 | &_lock); |
823 | clk_register_clkdev(clk, "gen_synth3_clk", NULL); | 821 | clk_register_clkdev(clk, "gen_syn3_clk", NULL); |
824 | 822 | ||
825 | clk = clk_register_gate(NULL, "ras_osc_24m_clk", "osc_24m_clk", 0, | 823 | clk = clk_register_gate(NULL, "ras_osc_24m_clk", "osc_24m_clk", 0, |
826 | SPEAR1310_RAS_CLK_ENB, SPEAR1310_OSC_24M_CLK_ENB, 0, | 824 | SPEAR1310_RAS_CLK_ENB, SPEAR1310_OSC_24M_CLK_ENB, 0, |
@@ -847,7 +845,7 @@ void __init spear1310_clk_init(void) | |||
847 | &_lock); | 845 | &_lock); |
848 | clk_register_clkdev(clk, "ras_pll3_clk", NULL); | 846 | clk_register_clkdev(clk, "ras_pll3_clk", NULL); |
849 | 847 | ||
850 | clk = clk_register_gate(NULL, "ras_tx125_clk", "gmii_125m_pad_clk", 0, | 848 | clk = clk_register_gate(NULL, "ras_tx125_clk", "gmii_pad_clk", 0, |
851 | SPEAR1310_RAS_CLK_ENB, SPEAR1310_C125M_PAD_CLK_ENB, 0, | 849 | SPEAR1310_RAS_CLK_ENB, SPEAR1310_C125M_PAD_CLK_ENB, 0, |
852 | &_lock); | 850 | &_lock); |
853 | clk_register_clkdev(clk, "ras_tx125_clk", NULL); | 851 | clk_register_clkdev(clk, "ras_tx125_clk", NULL); |
@@ -912,7 +910,7 @@ void __init spear1310_clk_init(void) | |||
912 | &_lock); | 910 | &_lock); |
913 | clk_register_clkdev(clk, NULL, "5c700000.eth"); | 911 | clk_register_clkdev(clk, NULL, "5c700000.eth"); |
914 | 912 | ||
915 | clk = clk_register_mux(NULL, "smii_rgmii_phy_mux_clk", | 913 | clk = clk_register_mux(NULL, "smii_rgmii_phy_mclk", |
916 | smii_rgmii_phy_parents, | 914 | smii_rgmii_phy_parents, |
917 | ARRAY_SIZE(smii_rgmii_phy_parents), 0, | 915 | ARRAY_SIZE(smii_rgmii_phy_parents), 0, |
918 | SPEAR1310_RAS_CTRL_REG1, | 916 | SPEAR1310_RAS_CTRL_REG1, |
@@ -922,184 +920,184 @@ void __init spear1310_clk_init(void) | |||
922 | clk_register_clkdev(clk, NULL, "stmmacphy.2"); | 920 | clk_register_clkdev(clk, NULL, "stmmacphy.2"); |
923 | clk_register_clkdev(clk, NULL, "stmmacphy.4"); | 921 | clk_register_clkdev(clk, NULL, "stmmacphy.4"); |
924 | 922 | ||
925 | clk = clk_register_mux(NULL, "rmii_phy_mux_clk", rmii_phy_parents, | 923 | clk = clk_register_mux(NULL, "rmii_phy_mclk", rmii_phy_parents, |
926 | ARRAY_SIZE(rmii_phy_parents), 0, | 924 | ARRAY_SIZE(rmii_phy_parents), 0, |
927 | SPEAR1310_RAS_CTRL_REG1, SPEAR1310_RMII_PHY_CLK_SHIFT, | 925 | SPEAR1310_RAS_CTRL_REG1, SPEAR1310_RMII_PHY_CLK_SHIFT, |
928 | SPEAR1310_PHY_CLK_MASK, 0, &_lock); | 926 | SPEAR1310_PHY_CLK_MASK, 0, &_lock); |
929 | clk_register_clkdev(clk, NULL, "stmmacphy.3"); | 927 | clk_register_clkdev(clk, NULL, "stmmacphy.3"); |
930 | 928 | ||
931 | clk = clk_register_mux(NULL, "uart1_mux_clk", uart_parents, | 929 | clk = clk_register_mux(NULL, "uart1_mclk", uart_parents, |
932 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 930 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
933 | SPEAR1310_UART1_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, | 931 | SPEAR1310_UART1_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, |
934 | 0, &_lock); | 932 | 0, &_lock); |
935 | clk_register_clkdev(clk, "uart1_mux_clk", NULL); | 933 | clk_register_clkdev(clk, "uart1_mclk", NULL); |
936 | 934 | ||
937 | clk = clk_register_gate(NULL, "uart1_clk", "uart1_mux_clk", 0, | 935 | clk = clk_register_gate(NULL, "uart1_clk", "uart1_mclk", 0, |
938 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART1_CLK_ENB, 0, | 936 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART1_CLK_ENB, 0, |
939 | &_lock); | 937 | &_lock); |
940 | clk_register_clkdev(clk, NULL, "5c800000.serial"); | 938 | clk_register_clkdev(clk, NULL, "5c800000.serial"); |
941 | 939 | ||
942 | clk = clk_register_mux(NULL, "uart2_mux_clk", uart_parents, | 940 | clk = clk_register_mux(NULL, "uart2_mclk", uart_parents, |
943 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 941 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
944 | SPEAR1310_UART2_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, | 942 | SPEAR1310_UART2_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, |
945 | 0, &_lock); | 943 | 0, &_lock); |
946 | clk_register_clkdev(clk, "uart2_mux_clk", NULL); | 944 | clk_register_clkdev(clk, "uart2_mclk", NULL); |
947 | 945 | ||
948 | clk = clk_register_gate(NULL, "uart2_clk", "uart2_mux_clk", 0, | 946 | clk = clk_register_gate(NULL, "uart2_clk", "uart2_mclk", 0, |
949 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART2_CLK_ENB, 0, | 947 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART2_CLK_ENB, 0, |
950 | &_lock); | 948 | &_lock); |
951 | clk_register_clkdev(clk, NULL, "5c900000.serial"); | 949 | clk_register_clkdev(clk, NULL, "5c900000.serial"); |
952 | 950 | ||
953 | clk = clk_register_mux(NULL, "uart3_mux_clk", uart_parents, | 951 | clk = clk_register_mux(NULL, "uart3_mclk", uart_parents, |
954 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 952 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
955 | SPEAR1310_UART3_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, | 953 | SPEAR1310_UART3_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, |
956 | 0, &_lock); | 954 | 0, &_lock); |
957 | clk_register_clkdev(clk, "uart3_mux_clk", NULL); | 955 | clk_register_clkdev(clk, "uart3_mclk", NULL); |
958 | 956 | ||
959 | clk = clk_register_gate(NULL, "uart3_clk", "uart3_mux_clk", 0, | 957 | clk = clk_register_gate(NULL, "uart3_clk", "uart3_mclk", 0, |
960 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART3_CLK_ENB, 0, | 958 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART3_CLK_ENB, 0, |
961 | &_lock); | 959 | &_lock); |
962 | clk_register_clkdev(clk, NULL, "5ca00000.serial"); | 960 | clk_register_clkdev(clk, NULL, "5ca00000.serial"); |
963 | 961 | ||
964 | clk = clk_register_mux(NULL, "uart4_mux_clk", uart_parents, | 962 | clk = clk_register_mux(NULL, "uart4_mclk", uart_parents, |
965 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 963 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
966 | SPEAR1310_UART4_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, | 964 | SPEAR1310_UART4_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, |
967 | 0, &_lock); | 965 | 0, &_lock); |
968 | clk_register_clkdev(clk, "uart4_mux_clk", NULL); | 966 | clk_register_clkdev(clk, "uart4_mclk", NULL); |
969 | 967 | ||
970 | clk = clk_register_gate(NULL, "uart4_clk", "uart4_mux_clk", 0, | 968 | clk = clk_register_gate(NULL, "uart4_clk", "uart4_mclk", 0, |
971 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART4_CLK_ENB, 0, | 969 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART4_CLK_ENB, 0, |
972 | &_lock); | 970 | &_lock); |
973 | clk_register_clkdev(clk, NULL, "5cb00000.serial"); | 971 | clk_register_clkdev(clk, NULL, "5cb00000.serial"); |
974 | 972 | ||
975 | clk = clk_register_mux(NULL, "uart5_mux_clk", uart_parents, | 973 | clk = clk_register_mux(NULL, "uart5_mclk", uart_parents, |
976 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 974 | ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
977 | SPEAR1310_UART5_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, | 975 | SPEAR1310_UART5_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK, |
978 | 0, &_lock); | 976 | 0, &_lock); |
979 | clk_register_clkdev(clk, "uart5_mux_clk", NULL); | 977 | clk_register_clkdev(clk, "uart5_mclk", NULL); |
980 | 978 | ||
981 | clk = clk_register_gate(NULL, "uart5_clk", "uart5_mux_clk", 0, | 979 | clk = clk_register_gate(NULL, "uart5_clk", "uart5_mclk", 0, |
982 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART5_CLK_ENB, 0, | 980 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART5_CLK_ENB, 0, |
983 | &_lock); | 981 | &_lock); |
984 | clk_register_clkdev(clk, NULL, "5cc00000.serial"); | 982 | clk_register_clkdev(clk, NULL, "5cc00000.serial"); |
985 | 983 | ||
986 | clk = clk_register_mux(NULL, "i2c1_mux_clk", i2c_parents, | 984 | clk = clk_register_mux(NULL, "i2c1_mclk", i2c_parents, |
987 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 985 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
988 | SPEAR1310_I2C1_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, | 986 | SPEAR1310_I2C1_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, |
989 | &_lock); | 987 | &_lock); |
990 | clk_register_clkdev(clk, "i2c1_mux_clk", NULL); | 988 | clk_register_clkdev(clk, "i2c1_mclk", NULL); |
991 | 989 | ||
992 | clk = clk_register_gate(NULL, "i2c1_clk", "i2c1_mux_clk", 0, | 990 | clk = clk_register_gate(NULL, "i2c1_clk", "i2c1_mclk", 0, |
993 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C1_CLK_ENB, 0, | 991 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C1_CLK_ENB, 0, |
994 | &_lock); | 992 | &_lock); |
995 | clk_register_clkdev(clk, NULL, "5cd00000.i2c"); | 993 | clk_register_clkdev(clk, NULL, "5cd00000.i2c"); |
996 | 994 | ||
997 | clk = clk_register_mux(NULL, "i2c2_mux_clk", i2c_parents, | 995 | clk = clk_register_mux(NULL, "i2c2_mclk", i2c_parents, |
998 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 996 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
999 | SPEAR1310_I2C2_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, | 997 | SPEAR1310_I2C2_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, |
1000 | &_lock); | 998 | &_lock); |
1001 | clk_register_clkdev(clk, "i2c2_mux_clk", NULL); | 999 | clk_register_clkdev(clk, "i2c2_mclk", NULL); |
1002 | 1000 | ||
1003 | clk = clk_register_gate(NULL, "i2c2_clk", "i2c2_mux_clk", 0, | 1001 | clk = clk_register_gate(NULL, "i2c2_clk", "i2c2_mclk", 0, |
1004 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C2_CLK_ENB, 0, | 1002 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C2_CLK_ENB, 0, |
1005 | &_lock); | 1003 | &_lock); |
1006 | clk_register_clkdev(clk, NULL, "5ce00000.i2c"); | 1004 | clk_register_clkdev(clk, NULL, "5ce00000.i2c"); |
1007 | 1005 | ||
1008 | clk = clk_register_mux(NULL, "i2c3_mux_clk", i2c_parents, | 1006 | clk = clk_register_mux(NULL, "i2c3_mclk", i2c_parents, |
1009 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1007 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1010 | SPEAR1310_I2C3_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, | 1008 | SPEAR1310_I2C3_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, |
1011 | &_lock); | 1009 | &_lock); |
1012 | clk_register_clkdev(clk, "i2c3_mux_clk", NULL); | 1010 | clk_register_clkdev(clk, "i2c3_mclk", NULL); |
1013 | 1011 | ||
1014 | clk = clk_register_gate(NULL, "i2c3_clk", "i2c3_mux_clk", 0, | 1012 | clk = clk_register_gate(NULL, "i2c3_clk", "i2c3_mclk", 0, |
1015 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C3_CLK_ENB, 0, | 1013 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C3_CLK_ENB, 0, |
1016 | &_lock); | 1014 | &_lock); |
1017 | clk_register_clkdev(clk, NULL, "5cf00000.i2c"); | 1015 | clk_register_clkdev(clk, NULL, "5cf00000.i2c"); |
1018 | 1016 | ||
1019 | clk = clk_register_mux(NULL, "i2c4_mux_clk", i2c_parents, | 1017 | clk = clk_register_mux(NULL, "i2c4_mclk", i2c_parents, |
1020 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1018 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1021 | SPEAR1310_I2C4_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, | 1019 | SPEAR1310_I2C4_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, |
1022 | &_lock); | 1020 | &_lock); |
1023 | clk_register_clkdev(clk, "i2c4_mux_clk", NULL); | 1021 | clk_register_clkdev(clk, "i2c4_mclk", NULL); |
1024 | 1022 | ||
1025 | clk = clk_register_gate(NULL, "i2c4_clk", "i2c4_mux_clk", 0, | 1023 | clk = clk_register_gate(NULL, "i2c4_clk", "i2c4_mclk", 0, |
1026 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C4_CLK_ENB, 0, | 1024 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C4_CLK_ENB, 0, |
1027 | &_lock); | 1025 | &_lock); |
1028 | clk_register_clkdev(clk, NULL, "5d000000.i2c"); | 1026 | clk_register_clkdev(clk, NULL, "5d000000.i2c"); |
1029 | 1027 | ||
1030 | clk = clk_register_mux(NULL, "i2c5_mux_clk", i2c_parents, | 1028 | clk = clk_register_mux(NULL, "i2c5_mclk", i2c_parents, |
1031 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1029 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1032 | SPEAR1310_I2C5_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, | 1030 | SPEAR1310_I2C5_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, |
1033 | &_lock); | 1031 | &_lock); |
1034 | clk_register_clkdev(clk, "i2c5_mux_clk", NULL); | 1032 | clk_register_clkdev(clk, "i2c5_mclk", NULL); |
1035 | 1033 | ||
1036 | clk = clk_register_gate(NULL, "i2c5_clk", "i2c5_mux_clk", 0, | 1034 | clk = clk_register_gate(NULL, "i2c5_clk", "i2c5_mclk", 0, |
1037 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C5_CLK_ENB, 0, | 1035 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C5_CLK_ENB, 0, |
1038 | &_lock); | 1036 | &_lock); |
1039 | clk_register_clkdev(clk, NULL, "5d100000.i2c"); | 1037 | clk_register_clkdev(clk, NULL, "5d100000.i2c"); |
1040 | 1038 | ||
1041 | clk = clk_register_mux(NULL, "i2c6_mux_clk", i2c_parents, | 1039 | clk = clk_register_mux(NULL, "i2c6_mclk", i2c_parents, |
1042 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1040 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1043 | SPEAR1310_I2C6_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, | 1041 | SPEAR1310_I2C6_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, |
1044 | &_lock); | 1042 | &_lock); |
1045 | clk_register_clkdev(clk, "i2c6_mux_clk", NULL); | 1043 | clk_register_clkdev(clk, "i2c6_mclk", NULL); |
1046 | 1044 | ||
1047 | clk = clk_register_gate(NULL, "i2c6_clk", "i2c6_mux_clk", 0, | 1045 | clk = clk_register_gate(NULL, "i2c6_clk", "i2c6_mclk", 0, |
1048 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C6_CLK_ENB, 0, | 1046 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C6_CLK_ENB, 0, |
1049 | &_lock); | 1047 | &_lock); |
1050 | clk_register_clkdev(clk, NULL, "5d200000.i2c"); | 1048 | clk_register_clkdev(clk, NULL, "5d200000.i2c"); |
1051 | 1049 | ||
1052 | clk = clk_register_mux(NULL, "i2c7_mux_clk", i2c_parents, | 1050 | clk = clk_register_mux(NULL, "i2c7_mclk", i2c_parents, |
1053 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1051 | ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1054 | SPEAR1310_I2C7_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, | 1052 | SPEAR1310_I2C7_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0, |
1055 | &_lock); | 1053 | &_lock); |
1056 | clk_register_clkdev(clk, "i2c7_mux_clk", NULL); | 1054 | clk_register_clkdev(clk, "i2c7_mclk", NULL); |
1057 | 1055 | ||
1058 | clk = clk_register_gate(NULL, "i2c7_clk", "i2c7_mux_clk", 0, | 1056 | clk = clk_register_gate(NULL, "i2c7_clk", "i2c7_mclk", 0, |
1059 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C7_CLK_ENB, 0, | 1057 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C7_CLK_ENB, 0, |
1060 | &_lock); | 1058 | &_lock); |
1061 | clk_register_clkdev(clk, NULL, "5d300000.i2c"); | 1059 | clk_register_clkdev(clk, NULL, "5d300000.i2c"); |
1062 | 1060 | ||
1063 | clk = clk_register_mux(NULL, "ssp1_mux_clk", ssp1_parents, | 1061 | clk = clk_register_mux(NULL, "ssp1_mclk", ssp1_parents, |
1064 | ARRAY_SIZE(ssp1_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1062 | ARRAY_SIZE(ssp1_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1065 | SPEAR1310_SSP1_CLK_SHIFT, SPEAR1310_SSP1_CLK_MASK, 0, | 1063 | SPEAR1310_SSP1_CLK_SHIFT, SPEAR1310_SSP1_CLK_MASK, 0, |
1066 | &_lock); | 1064 | &_lock); |
1067 | clk_register_clkdev(clk, "ssp1_mux_clk", NULL); | 1065 | clk_register_clkdev(clk, "ssp1_mclk", NULL); |
1068 | 1066 | ||
1069 | clk = clk_register_gate(NULL, "ssp1_clk", "ssp1_mux_clk", 0, | 1067 | clk = clk_register_gate(NULL, "ssp1_clk", "ssp1_mclk", 0, |
1070 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_SSP1_CLK_ENB, 0, | 1068 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_SSP1_CLK_ENB, 0, |
1071 | &_lock); | 1069 | &_lock); |
1072 | clk_register_clkdev(clk, NULL, "5d400000.spi"); | 1070 | clk_register_clkdev(clk, NULL, "5d400000.spi"); |
1073 | 1071 | ||
1074 | clk = clk_register_mux(NULL, "pci_mux_clk", pci_parents, | 1072 | clk = clk_register_mux(NULL, "pci_mclk", pci_parents, |
1075 | ARRAY_SIZE(pci_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1073 | ARRAY_SIZE(pci_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1076 | SPEAR1310_PCI_CLK_SHIFT, SPEAR1310_PCI_CLK_MASK, 0, | 1074 | SPEAR1310_PCI_CLK_SHIFT, SPEAR1310_PCI_CLK_MASK, 0, |
1077 | &_lock); | 1075 | &_lock); |
1078 | clk_register_clkdev(clk, "pci_mux_clk", NULL); | 1076 | clk_register_clkdev(clk, "pci_mclk", NULL); |
1079 | 1077 | ||
1080 | clk = clk_register_gate(NULL, "pci_clk", "pci_mux_clk", 0, | 1078 | clk = clk_register_gate(NULL, "pci_clk", "pci_mclk", 0, |
1081 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_PCI_CLK_ENB, 0, | 1079 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_PCI_CLK_ENB, 0, |
1082 | &_lock); | 1080 | &_lock); |
1083 | clk_register_clkdev(clk, NULL, "pci"); | 1081 | clk_register_clkdev(clk, NULL, "pci"); |
1084 | 1082 | ||
1085 | clk = clk_register_mux(NULL, "tdm1_mux_clk", tdm_parents, | 1083 | clk = clk_register_mux(NULL, "tdm1_mclk", tdm_parents, |
1086 | ARRAY_SIZE(tdm_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1084 | ARRAY_SIZE(tdm_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1087 | SPEAR1310_TDM1_CLK_SHIFT, SPEAR1310_TDM_CLK_MASK, 0, | 1085 | SPEAR1310_TDM1_CLK_SHIFT, SPEAR1310_TDM_CLK_MASK, 0, |
1088 | &_lock); | 1086 | &_lock); |
1089 | clk_register_clkdev(clk, "tdm1_mux_clk", NULL); | 1087 | clk_register_clkdev(clk, "tdm1_mclk", NULL); |
1090 | 1088 | ||
1091 | clk = clk_register_gate(NULL, "tdm1_clk", "tdm1_mux_clk", 0, | 1089 | clk = clk_register_gate(NULL, "tdm1_clk", "tdm1_mclk", 0, |
1092 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_TDM1_CLK_ENB, 0, | 1090 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_TDM1_CLK_ENB, 0, |
1093 | &_lock); | 1091 | &_lock); |
1094 | clk_register_clkdev(clk, NULL, "tdm_hdlc.0"); | 1092 | clk_register_clkdev(clk, NULL, "tdm_hdlc.0"); |
1095 | 1093 | ||
1096 | clk = clk_register_mux(NULL, "tdm2_mux_clk", tdm_parents, | 1094 | clk = clk_register_mux(NULL, "tdm2_mclk", tdm_parents, |
1097 | ARRAY_SIZE(tdm_parents), 0, SPEAR1310_RAS_CTRL_REG0, | 1095 | ARRAY_SIZE(tdm_parents), 0, SPEAR1310_RAS_CTRL_REG0, |
1098 | SPEAR1310_TDM2_CLK_SHIFT, SPEAR1310_TDM_CLK_MASK, 0, | 1096 | SPEAR1310_TDM2_CLK_SHIFT, SPEAR1310_TDM_CLK_MASK, 0, |
1099 | &_lock); | 1097 | &_lock); |
1100 | clk_register_clkdev(clk, "tdm2_mux_clk", NULL); | 1098 | clk_register_clkdev(clk, "tdm2_mclk", NULL); |
1101 | 1099 | ||
1102 | clk = clk_register_gate(NULL, "tdm2_clk", "tdm2_mux_clk", 0, | 1100 | clk = clk_register_gate(NULL, "tdm2_clk", "tdm2_mclk", 0, |
1103 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_TDM2_CLK_ENB, 0, | 1101 | SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_TDM2_CLK_ENB, 0, |
1104 | &_lock); | 1102 | &_lock); |
1105 | clk_register_clkdev(clk, NULL, "tdm_hdlc.1"); | 1103 | clk_register_clkdev(clk, NULL, "tdm_hdlc.1"); |
diff --git a/drivers/clk/spear/spear1340_clock.c b/drivers/clk/spear/spear1340_clock.c index f130919d5bf8..2352cee7f645 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 |
@@ -369,27 +369,25 @@ static struct frac_rate_tbl gen_rtbl[] = { | |||
369 | 369 | ||
370 | /* clock parents */ | 370 | /* clock parents */ |
371 | static const char *vco_parents[] = { "osc_24m_clk", "osc_25m_clk", }; | 371 | static const char *vco_parents[] = { "osc_24m_clk", "osc_25m_clk", }; |
372 | static const char *sys_parents[] = { "none", "pll1_clk", "none", "none", | 372 | static const char *sys_parents[] = { "pll1_clk", "pll1_clk", "pll1_clk", |
373 | "sys_synth_clk", "none", "pll2_clk", "pll3_clk", }; | 373 | "pll1_clk", "sys_synth_clk", "sys_synth_clk", "pll2_clk", "pll3_clk", }; |
374 | static const char *ahb_parents[] = { "cpu_div3_clk", "amba_synth_clk", }; | 374 | static const char *ahb_parents[] = { "cpu_div3_clk", "amba_syn_clk", }; |
375 | static const char *gpt_parents[] = { "osc_24m_clk", "apb_clk", }; | 375 | static const char *gpt_parents[] = { "osc_24m_clk", "apb_clk", }; |
376 | static const char *uart0_parents[] = { "pll5_clk", "osc_24m_clk", | 376 | static const char *uart0_parents[] = { "pll5_clk", "osc_24m_clk", |
377 | "uart0_synth_gate_clk", }; | 377 | "uart0_syn_gclk", }; |
378 | static const char *uart1_parents[] = { "pll5_clk", "osc_24m_clk", | 378 | static const char *uart1_parents[] = { "pll5_clk", "osc_24m_clk", |
379 | "uart1_synth_gate_clk", }; | 379 | "uart1_syn_gclk", }; |
380 | static const char *c3_parents[] = { "pll5_clk", "c3_synth_gate_clk", }; | 380 | static const char *c3_parents[] = { "pll5_clk", "c3_syn_gclk", }; |
381 | static const char *gmac_phy_input_parents[] = { "gmii_125m_pad_clk", "pll2_clk", | 381 | static const char *gmac_phy_input_parents[] = { "gmii_pad_clk", "pll2_clk", |
382 | "osc_25m_clk", }; | 382 | "osc_25m_clk", }; |
383 | static const char *gmac_phy_parents[] = { "gmac_phy_input_mux_clk", | 383 | static const char *gmac_phy_parents[] = { "phy_input_mclk", "phy_syn_gclk", }; |
384 | "gmac_phy_synth_gate_clk", }; | ||
385 | static const char *clcd_synth_parents[] = { "vco1div4_clk", "pll2_clk", }; | 384 | static const char *clcd_synth_parents[] = { "vco1div4_clk", "pll2_clk", }; |
386 | static const char *clcd_pixel_parents[] = { "pll5_clk", "clcd_synth_clk", }; | 385 | static const char *clcd_pixel_parents[] = { "pll5_clk", "clcd_syn_clk", }; |
387 | static const char *i2s_src_parents[] = { "vco1div2_clk", "pll2_clk", "pll3_clk", | 386 | static const char *i2s_src_parents[] = { "vco1div2_clk", "pll2_clk", "pll3_clk", |
388 | "i2s_src_pad_clk", }; | 387 | "i2s_src_pad_clk", }; |
389 | static const char *i2s_ref_parents[] = { "i2s_src_mux_clk", "i2s_prs1_clk", }; | 388 | static const char *i2s_ref_parents[] = { "i2s_src_mclk", "i2s_prs1_clk", }; |
390 | static const char *spdif_out_parents[] = { "i2s_src_pad_clk", "gen_synth2_clk", | 389 | static const char *spdif_out_parents[] = { "i2s_src_pad_clk", "gen_syn2_clk", }; |
391 | }; | 390 | static const char *spdif_in_parents[] = { "pll2_clk", "gen_syn3_clk", }; |
392 | static const char *spdif_in_parents[] = { "pll2_clk", "gen_synth3_clk", }; | ||
393 | 391 | ||
394 | static const char *gen_synth0_1_parents[] = { "vco1div4_clk", "vco3div2_clk", | 392 | static const char *gen_synth0_1_parents[] = { "vco1div4_clk", "vco3div2_clk", |
395 | "pll3_clk", }; | 393 | "pll3_clk", }; |
@@ -415,9 +413,9 @@ void __init spear1340_clk_init(void) | |||
415 | 25000000); | 413 | 25000000); |
416 | clk_register_clkdev(clk, "osc_25m_clk", NULL); | 414 | clk_register_clkdev(clk, "osc_25m_clk", NULL); |
417 | 415 | ||
418 | clk = clk_register_fixed_rate(NULL, "gmii_125m_pad_clk", NULL, | 416 | clk = clk_register_fixed_rate(NULL, "gmii_pad_clk", NULL, CLK_IS_ROOT, |
419 | CLK_IS_ROOT, 125000000); | 417 | 125000000); |
420 | clk_register_clkdev(clk, "gmii_125m_pad_clk", NULL); | 418 | clk_register_clkdev(clk, "gmii_pad_clk", NULL); |
421 | 419 | ||
422 | clk = clk_register_fixed_rate(NULL, "i2s_src_pad_clk", NULL, | 420 | clk = clk_register_fixed_rate(NULL, "i2s_src_pad_clk", NULL, |
423 | CLK_IS_ROOT, 12288000); | 421 | CLK_IS_ROOT, 12288000); |
@@ -431,35 +429,35 @@ void __init spear1340_clk_init(void) | |||
431 | 429 | ||
432 | /* clock derived from 24 or 25 MHz osc clk */ | 430 | /* clock derived from 24 or 25 MHz osc clk */ |
433 | /* vco-pll */ | 431 | /* vco-pll */ |
434 | clk = clk_register_mux(NULL, "vco1_mux_clk", vco_parents, | 432 | clk = clk_register_mux(NULL, "vco1_mclk", vco_parents, |
435 | ARRAY_SIZE(vco_parents), 0, SPEAR1340_PLL_CFG, | 433 | ARRAY_SIZE(vco_parents), 0, SPEAR1340_PLL_CFG, |
436 | SPEAR1340_PLL1_CLK_SHIFT, SPEAR1340_PLL_CLK_MASK, 0, | 434 | SPEAR1340_PLL1_CLK_SHIFT, SPEAR1340_PLL_CLK_MASK, 0, |
437 | &_lock); | 435 | &_lock); |
438 | clk_register_clkdev(clk, "vco1_mux_clk", NULL); | 436 | clk_register_clkdev(clk, "vco1_mclk", NULL); |
439 | clk = clk_register_vco_pll("vco1_clk", "pll1_clk", NULL, "vco1_mux_clk", | 437 | clk = clk_register_vco_pll("vco1_clk", "pll1_clk", NULL, "vco1_mclk", 0, |
440 | 0, SPEAR1340_PLL1_CTR, SPEAR1340_PLL1_FRQ, pll_rtbl, | 438 | SPEAR1340_PLL1_CTR, SPEAR1340_PLL1_FRQ, pll_rtbl, |
441 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); | 439 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); |
442 | clk_register_clkdev(clk, "vco1_clk", NULL); | 440 | clk_register_clkdev(clk, "vco1_clk", NULL); |
443 | clk_register_clkdev(clk1, "pll1_clk", NULL); | 441 | clk_register_clkdev(clk1, "pll1_clk", NULL); |
444 | 442 | ||
445 | clk = clk_register_mux(NULL, "vco2_mux_clk", vco_parents, | 443 | clk = clk_register_mux(NULL, "vco2_mclk", vco_parents, |
446 | ARRAY_SIZE(vco_parents), 0, SPEAR1340_PLL_CFG, | 444 | ARRAY_SIZE(vco_parents), 0, SPEAR1340_PLL_CFG, |
447 | SPEAR1340_PLL2_CLK_SHIFT, SPEAR1340_PLL_CLK_MASK, 0, | 445 | SPEAR1340_PLL2_CLK_SHIFT, SPEAR1340_PLL_CLK_MASK, 0, |
448 | &_lock); | 446 | &_lock); |
449 | clk_register_clkdev(clk, "vco2_mux_clk", NULL); | 447 | clk_register_clkdev(clk, "vco2_mclk", NULL); |
450 | clk = clk_register_vco_pll("vco2_clk", "pll2_clk", NULL, "vco2_mux_clk", | 448 | clk = clk_register_vco_pll("vco2_clk", "pll2_clk", NULL, "vco2_mclk", 0, |
451 | 0, SPEAR1340_PLL2_CTR, SPEAR1340_PLL2_FRQ, pll_rtbl, | 449 | SPEAR1340_PLL2_CTR, SPEAR1340_PLL2_FRQ, pll_rtbl, |
452 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); | 450 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); |
453 | clk_register_clkdev(clk, "vco2_clk", NULL); | 451 | clk_register_clkdev(clk, "vco2_clk", NULL); |
454 | clk_register_clkdev(clk1, "pll2_clk", NULL); | 452 | clk_register_clkdev(clk1, "pll2_clk", NULL); |
455 | 453 | ||
456 | clk = clk_register_mux(NULL, "vco3_mux_clk", vco_parents, | 454 | clk = clk_register_mux(NULL, "vco3_mclk", vco_parents, |
457 | ARRAY_SIZE(vco_parents), 0, SPEAR1340_PLL_CFG, | 455 | ARRAY_SIZE(vco_parents), 0, SPEAR1340_PLL_CFG, |
458 | SPEAR1340_PLL3_CLK_SHIFT, SPEAR1340_PLL_CLK_MASK, 0, | 456 | SPEAR1340_PLL3_CLK_SHIFT, SPEAR1340_PLL_CLK_MASK, 0, |
459 | &_lock); | 457 | &_lock); |
460 | clk_register_clkdev(clk, "vco3_mux_clk", NULL); | 458 | clk_register_clkdev(clk, "vco3_mclk", NULL); |
461 | clk = clk_register_vco_pll("vco3_clk", "pll3_clk", NULL, "vco3_mux_clk", | 459 | clk = clk_register_vco_pll("vco3_clk", "pll3_clk", NULL, "vco3_mclk", 0, |
462 | 0, SPEAR1340_PLL3_CTR, SPEAR1340_PLL3_FRQ, pll_rtbl, | 460 | SPEAR1340_PLL3_CTR, SPEAR1340_PLL3_FRQ, pll_rtbl, |
463 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); | 461 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); |
464 | clk_register_clkdev(clk, "vco3_clk", NULL); | 462 | clk_register_clkdev(clk, "vco3_clk", NULL); |
465 | clk_register_clkdev(clk1, "pll3_clk", NULL); | 463 | clk_register_clkdev(clk1, "pll3_clk", NULL); |
@@ -498,7 +496,7 @@ void __init spear1340_clk_init(void) | |||
498 | /* peripherals */ | 496 | /* peripherals */ |
499 | clk_register_fixed_factor(NULL, "thermal_clk", "osc_24m_clk", 0, 1, | 497 | clk_register_fixed_factor(NULL, "thermal_clk", "osc_24m_clk", 0, 1, |
500 | 128); | 498 | 128); |
501 | clk = clk_register_gate(NULL, "thermal_gate_clk", "thermal_clk", 0, | 499 | clk = clk_register_gate(NULL, "thermal_gclk", "thermal_clk", 0, |
502 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_THSENS_CLK_ENB, 0, | 500 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_THSENS_CLK_ENB, 0, |
503 | &_lock); | 501 | &_lock); |
504 | clk_register_clkdev(clk, NULL, "spear_thermal"); | 502 | clk_register_clkdev(clk, NULL, "spear_thermal"); |
@@ -509,23 +507,23 @@ void __init spear1340_clk_init(void) | |||
509 | clk_register_clkdev(clk, "ddr_clk", NULL); | 507 | clk_register_clkdev(clk, "ddr_clk", NULL); |
510 | 508 | ||
511 | /* clock derived from pll1 clk */ | 509 | /* clock derived from pll1 clk */ |
512 | clk = clk_register_frac("sys_synth_clk", "vco1div2_clk", 0, | 510 | clk = clk_register_frac("sys_syn_clk", "vco1div2_clk", 0, |
513 | SPEAR1340_SYS_CLK_SYNT, sys_synth_rtbl, | 511 | SPEAR1340_SYS_CLK_SYNT, sys_synth_rtbl, |
514 | ARRAY_SIZE(sys_synth_rtbl), &_lock); | 512 | ARRAY_SIZE(sys_synth_rtbl), &_lock); |
515 | clk_register_clkdev(clk, "sys_synth_clk", NULL); | 513 | clk_register_clkdev(clk, "sys_syn_clk", NULL); |
516 | 514 | ||
517 | clk = clk_register_frac("amba_synth_clk", "vco1div2_clk", 0, | 515 | clk = clk_register_frac("amba_syn_clk", "vco1div2_clk", 0, |
518 | SPEAR1340_AMBA_CLK_SYNT, amba_synth_rtbl, | 516 | SPEAR1340_AMBA_CLK_SYNT, amba_synth_rtbl, |
519 | ARRAY_SIZE(amba_synth_rtbl), &_lock); | 517 | ARRAY_SIZE(amba_synth_rtbl), &_lock); |
520 | clk_register_clkdev(clk, "amba_synth_clk", NULL); | 518 | clk_register_clkdev(clk, "amba_syn_clk", NULL); |
521 | 519 | ||
522 | clk = clk_register_mux(NULL, "sys_mux_clk", sys_parents, | 520 | clk = clk_register_mux(NULL, "sys_mclk", sys_parents, |
523 | ARRAY_SIZE(sys_parents), 0, SPEAR1340_SYS_CLK_CTRL, | 521 | ARRAY_SIZE(sys_parents), 0, SPEAR1340_SYS_CLK_CTRL, |
524 | SPEAR1340_SCLK_SRC_SEL_SHIFT, | 522 | SPEAR1340_SCLK_SRC_SEL_SHIFT, |
525 | SPEAR1340_SCLK_SRC_SEL_MASK, 0, &_lock); | 523 | SPEAR1340_SCLK_SRC_SEL_MASK, 0, &_lock); |
526 | clk_register_clkdev(clk, "sys_clk", NULL); | 524 | clk_register_clkdev(clk, "sys_clk", NULL); |
527 | 525 | ||
528 | clk = clk_register_fixed_factor(NULL, "cpu_clk", "sys_mux_clk", 0, 1, | 526 | clk = clk_register_fixed_factor(NULL, "cpu_clk", "sys_mclk", 0, 1, |
529 | 2); | 527 | 2); |
530 | clk_register_clkdev(clk, "cpu_clk", NULL); | 528 | clk_register_clkdev(clk, "cpu_clk", NULL); |
531 | 529 | ||
@@ -548,194 +546,193 @@ void __init spear1340_clk_init(void) | |||
548 | clk_register_clkdev(clk, "apb_clk", NULL); | 546 | clk_register_clkdev(clk, "apb_clk", NULL); |
549 | 547 | ||
550 | /* gpt clocks */ | 548 | /* gpt clocks */ |
551 | clk = clk_register_mux(NULL, "gpt0_mux_clk", gpt_parents, | 549 | clk = clk_register_mux(NULL, "gpt0_mclk", gpt_parents, |
552 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, | 550 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, |
553 | SPEAR1340_GPT0_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, | 551 | SPEAR1340_GPT0_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, |
554 | &_lock); | 552 | &_lock); |
555 | clk_register_clkdev(clk, "gpt0_mux_clk", NULL); | 553 | clk_register_clkdev(clk, "gpt0_mclk", NULL); |
556 | clk = clk_register_gate(NULL, "gpt0_clk", "gpt0_mux_clk", 0, | 554 | clk = clk_register_gate(NULL, "gpt0_clk", "gpt0_mclk", 0, |
557 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_GPT0_CLK_ENB, 0, | 555 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_GPT0_CLK_ENB, 0, |
558 | &_lock); | 556 | &_lock); |
559 | clk_register_clkdev(clk, NULL, "gpt0"); | 557 | clk_register_clkdev(clk, NULL, "gpt0"); |
560 | 558 | ||
561 | clk = clk_register_mux(NULL, "gpt1_mux_clk", gpt_parents, | 559 | clk = clk_register_mux(NULL, "gpt1_mclk", gpt_parents, |
562 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, | 560 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, |
563 | SPEAR1340_GPT1_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, | 561 | SPEAR1340_GPT1_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, |
564 | &_lock); | 562 | &_lock); |
565 | clk_register_clkdev(clk, "gpt1_mux_clk", NULL); | 563 | clk_register_clkdev(clk, "gpt1_mclk", NULL); |
566 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mux_clk", 0, | 564 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mclk", 0, |
567 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_GPT1_CLK_ENB, 0, | 565 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_GPT1_CLK_ENB, 0, |
568 | &_lock); | 566 | &_lock); |
569 | clk_register_clkdev(clk, NULL, "gpt1"); | 567 | clk_register_clkdev(clk, NULL, "gpt1"); |
570 | 568 | ||
571 | clk = clk_register_mux(NULL, "gpt2_mux_clk", gpt_parents, | 569 | clk = clk_register_mux(NULL, "gpt2_mclk", gpt_parents, |
572 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, | 570 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, |
573 | SPEAR1340_GPT2_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, | 571 | SPEAR1340_GPT2_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, |
574 | &_lock); | 572 | &_lock); |
575 | clk_register_clkdev(clk, "gpt2_mux_clk", NULL); | 573 | clk_register_clkdev(clk, "gpt2_mclk", NULL); |
576 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mux_clk", 0, | 574 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mclk", 0, |
577 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_GPT2_CLK_ENB, 0, | 575 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_GPT2_CLK_ENB, 0, |
578 | &_lock); | 576 | &_lock); |
579 | clk_register_clkdev(clk, NULL, "gpt2"); | 577 | clk_register_clkdev(clk, NULL, "gpt2"); |
580 | 578 | ||
581 | clk = clk_register_mux(NULL, "gpt3_mux_clk", gpt_parents, | 579 | clk = clk_register_mux(NULL, "gpt3_mclk", gpt_parents, |
582 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, | 580 | ARRAY_SIZE(gpt_parents), 0, SPEAR1340_PERIP_CLK_CFG, |
583 | SPEAR1340_GPT3_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, | 581 | SPEAR1340_GPT3_CLK_SHIFT, SPEAR1340_GPT_CLK_MASK, 0, |
584 | &_lock); | 582 | &_lock); |
585 | clk_register_clkdev(clk, "gpt3_mux_clk", NULL); | 583 | clk_register_clkdev(clk, "gpt3_mclk", NULL); |
586 | clk = clk_register_gate(NULL, "gpt3_clk", "gpt3_mux_clk", 0, | 584 | clk = clk_register_gate(NULL, "gpt3_clk", "gpt3_mclk", 0, |
587 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_GPT3_CLK_ENB, 0, | 585 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_GPT3_CLK_ENB, 0, |
588 | &_lock); | 586 | &_lock); |
589 | clk_register_clkdev(clk, NULL, "gpt3"); | 587 | clk_register_clkdev(clk, NULL, "gpt3"); |
590 | 588 | ||
591 | /* others */ | 589 | /* others */ |
592 | clk = clk_register_aux("uart0_synth_clk", "uart0_synth_gate_clk", | 590 | clk = clk_register_aux("uart0_syn_clk", "uart0_syn_gclk", |
593 | "vco1div2_clk", 0, SPEAR1340_UART0_CLK_SYNT, NULL, | 591 | "vco1div2_clk", 0, SPEAR1340_UART0_CLK_SYNT, NULL, |
594 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 592 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
595 | clk_register_clkdev(clk, "uart0_synth_clk", NULL); | 593 | clk_register_clkdev(clk, "uart0_syn_clk", NULL); |
596 | clk_register_clkdev(clk1, "uart0_synth_gate_clk", NULL); | 594 | clk_register_clkdev(clk1, "uart0_syn_gclk", NULL); |
597 | 595 | ||
598 | clk = clk_register_mux(NULL, "uart0_mux_clk", uart0_parents, | 596 | clk = clk_register_mux(NULL, "uart0_mclk", uart0_parents, |
599 | ARRAY_SIZE(uart0_parents), 0, SPEAR1340_PERIP_CLK_CFG, | 597 | ARRAY_SIZE(uart0_parents), 0, SPEAR1340_PERIP_CLK_CFG, |
600 | SPEAR1340_UART0_CLK_SHIFT, SPEAR1340_UART_CLK_MASK, 0, | 598 | SPEAR1340_UART0_CLK_SHIFT, SPEAR1340_UART_CLK_MASK, 0, |
601 | &_lock); | 599 | &_lock); |
602 | clk_register_clkdev(clk, "uart0_mux_clk", NULL); | 600 | clk_register_clkdev(clk, "uart0_mclk", NULL); |
603 | 601 | ||
604 | clk = clk_register_gate(NULL, "uart0_clk", "uart0_mux_clk", 0, | 602 | clk = clk_register_gate(NULL, "uart0_clk", "uart0_mclk", 0, |
605 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_UART0_CLK_ENB, 0, | 603 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_UART0_CLK_ENB, 0, |
606 | &_lock); | 604 | &_lock); |
607 | clk_register_clkdev(clk, NULL, "e0000000.serial"); | 605 | clk_register_clkdev(clk, NULL, "e0000000.serial"); |
608 | 606 | ||
609 | clk = clk_register_aux("uart1_synth_clk", "uart1_synth_gate_clk", | 607 | clk = clk_register_aux("uart1_syn_clk", "uart1_syn_gclk", |
610 | "vco1div2_clk", 0, SPEAR1340_UART1_CLK_SYNT, NULL, | 608 | "vco1div2_clk", 0, SPEAR1340_UART1_CLK_SYNT, NULL, |
611 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 609 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
612 | clk_register_clkdev(clk, "uart1_synth_clk", NULL); | 610 | clk_register_clkdev(clk, "uart1_syn_clk", NULL); |
613 | clk_register_clkdev(clk1, "uart1_synth_gate_clk", NULL); | 611 | clk_register_clkdev(clk1, "uart1_syn_gclk", NULL); |
614 | 612 | ||
615 | clk = clk_register_mux(NULL, "uart1_mux_clk", uart1_parents, | 613 | clk = clk_register_mux(NULL, "uart1_mclk", uart1_parents, |
616 | ARRAY_SIZE(uart1_parents), 0, SPEAR1340_PERIP_CLK_CFG, | 614 | ARRAY_SIZE(uart1_parents), 0, SPEAR1340_PERIP_CLK_CFG, |
617 | SPEAR1340_UART1_CLK_SHIFT, SPEAR1340_UART_CLK_MASK, 0, | 615 | SPEAR1340_UART1_CLK_SHIFT, SPEAR1340_UART_CLK_MASK, 0, |
618 | &_lock); | 616 | &_lock); |
619 | clk_register_clkdev(clk, "uart1_mux_clk", NULL); | 617 | clk_register_clkdev(clk, "uart1_mclk", NULL); |
620 | 618 | ||
621 | clk = clk_register_gate(NULL, "uart1_clk", "uart1_mux_clk", 0, | 619 | clk = clk_register_gate(NULL, "uart1_clk", "uart1_mclk", 0, |
622 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_UART1_CLK_ENB, 0, | 620 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_UART1_CLK_ENB, 0, |
623 | &_lock); | 621 | &_lock); |
624 | clk_register_clkdev(clk, NULL, "b4100000.serial"); | 622 | clk_register_clkdev(clk, NULL, "b4100000.serial"); |
625 | 623 | ||
626 | clk = clk_register_aux("sdhci_synth_clk", "sdhci_synth_gate_clk", | 624 | clk = clk_register_aux("sdhci_syn_clk", "sdhci_syn_gclk", |
627 | "vco1div2_clk", 0, SPEAR1340_SDHCI_CLK_SYNT, NULL, | 625 | "vco1div2_clk", 0, SPEAR1340_SDHCI_CLK_SYNT, NULL, |
628 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 626 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
629 | clk_register_clkdev(clk, "sdhci_synth_clk", NULL); | 627 | clk_register_clkdev(clk, "sdhci_syn_clk", NULL); |
630 | clk_register_clkdev(clk1, "sdhci_synth_gate_clk", NULL); | 628 | clk_register_clkdev(clk1, "sdhci_syn_gclk", NULL); |
631 | 629 | ||
632 | clk = clk_register_gate(NULL, "sdhci_clk", "sdhci_synth_gate_clk", 0, | 630 | clk = clk_register_gate(NULL, "sdhci_clk", "sdhci_syn_gclk", 0, |
633 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_SDHCI_CLK_ENB, 0, | 631 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_SDHCI_CLK_ENB, 0, |
634 | &_lock); | 632 | &_lock); |
635 | clk_register_clkdev(clk, NULL, "b3000000.sdhci"); | 633 | clk_register_clkdev(clk, NULL, "b3000000.sdhci"); |
636 | 634 | ||
637 | clk = clk_register_aux("cfxd_synth_clk", "cfxd_synth_gate_clk", | 635 | clk = clk_register_aux("cfxd_syn_clk", "cfxd_syn_gclk", "vco1div2_clk", |
638 | "vco1div2_clk", 0, SPEAR1340_CFXD_CLK_SYNT, NULL, | 636 | 0, SPEAR1340_CFXD_CLK_SYNT, NULL, aux_rtbl, |
639 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 637 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
640 | clk_register_clkdev(clk, "cfxd_synth_clk", NULL); | 638 | clk_register_clkdev(clk, "cfxd_syn_clk", NULL); |
641 | clk_register_clkdev(clk1, "cfxd_synth_gate_clk", NULL); | 639 | clk_register_clkdev(clk1, "cfxd_syn_gclk", NULL); |
642 | 640 | ||
643 | clk = clk_register_gate(NULL, "cfxd_clk", "cfxd_synth_gate_clk", 0, | 641 | clk = clk_register_gate(NULL, "cfxd_clk", "cfxd_syn_gclk", 0, |
644 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_CFXD_CLK_ENB, 0, | 642 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_CFXD_CLK_ENB, 0, |
645 | &_lock); | 643 | &_lock); |
646 | clk_register_clkdev(clk, NULL, "b2800000.cf"); | 644 | clk_register_clkdev(clk, NULL, "b2800000.cf"); |
647 | clk_register_clkdev(clk, NULL, "arasan_xd"); | 645 | clk_register_clkdev(clk, NULL, "arasan_xd"); |
648 | 646 | ||
649 | clk = clk_register_aux("c3_synth_clk", "c3_synth_gate_clk", | 647 | clk = clk_register_aux("c3_syn_clk", "c3_syn_gclk", "vco1div2_clk", 0, |
650 | "vco1div2_clk", 0, SPEAR1340_C3_CLK_SYNT, NULL, | 648 | SPEAR1340_C3_CLK_SYNT, NULL, aux_rtbl, |
651 | aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 649 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
652 | clk_register_clkdev(clk, "c3_synth_clk", NULL); | 650 | clk_register_clkdev(clk, "c3_syn_clk", NULL); |
653 | clk_register_clkdev(clk1, "c3_synth_gate_clk", NULL); | 651 | clk_register_clkdev(clk1, "c3_syn_gclk", NULL); |
654 | 652 | ||
655 | clk = clk_register_mux(NULL, "c3_mux_clk", c3_parents, | 653 | clk = clk_register_mux(NULL, "c3_mclk", c3_parents, |
656 | ARRAY_SIZE(c3_parents), 0, SPEAR1340_PERIP_CLK_CFG, | 654 | ARRAY_SIZE(c3_parents), 0, SPEAR1340_PERIP_CLK_CFG, |
657 | SPEAR1340_C3_CLK_SHIFT, SPEAR1340_C3_CLK_MASK, 0, | 655 | SPEAR1340_C3_CLK_SHIFT, SPEAR1340_C3_CLK_MASK, 0, |
658 | &_lock); | 656 | &_lock); |
659 | clk_register_clkdev(clk, "c3_mux_clk", NULL); | 657 | clk_register_clkdev(clk, "c3_mclk", NULL); |
660 | 658 | ||
661 | clk = clk_register_gate(NULL, "c3_clk", "c3_mux_clk", 0, | 659 | clk = clk_register_gate(NULL, "c3_clk", "c3_mclk", 0, |
662 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_C3_CLK_ENB, 0, | 660 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_C3_CLK_ENB, 0, |
663 | &_lock); | 661 | &_lock); |
664 | clk_register_clkdev(clk, NULL, "c3"); | 662 | clk_register_clkdev(clk, NULL, "c3"); |
665 | 663 | ||
666 | /* gmac */ | 664 | /* gmac */ |
667 | clk = clk_register_mux(NULL, "gmac_phy_input_mux_clk", | 665 | clk = clk_register_mux(NULL, "phy_input_mclk", gmac_phy_input_parents, |
668 | gmac_phy_input_parents, | ||
669 | ARRAY_SIZE(gmac_phy_input_parents), 0, | 666 | ARRAY_SIZE(gmac_phy_input_parents), 0, |
670 | SPEAR1340_GMAC_CLK_CFG, | 667 | SPEAR1340_GMAC_CLK_CFG, |
671 | SPEAR1340_GMAC_PHY_INPUT_CLK_SHIFT, | 668 | SPEAR1340_GMAC_PHY_INPUT_CLK_SHIFT, |
672 | SPEAR1340_GMAC_PHY_INPUT_CLK_MASK, 0, &_lock); | 669 | SPEAR1340_GMAC_PHY_INPUT_CLK_MASK, 0, &_lock); |
673 | clk_register_clkdev(clk, "gmac_phy_input_mux_clk", NULL); | 670 | clk_register_clkdev(clk, "phy_input_mclk", NULL); |
674 | 671 | ||
675 | clk = clk_register_aux("gmac_phy_synth_clk", "gmac_phy_synth_gate_clk", | 672 | clk = clk_register_aux("phy_syn_clk", "phy_syn_gclk", "phy_input_mclk", |
676 | "gmac_phy_input_mux_clk", 0, SPEAR1340_GMAC_CLK_SYNT, | 673 | 0, SPEAR1340_GMAC_CLK_SYNT, NULL, gmac_rtbl, |
677 | NULL, gmac_rtbl, ARRAY_SIZE(gmac_rtbl), &_lock, &clk1); | 674 | ARRAY_SIZE(gmac_rtbl), &_lock, &clk1); |
678 | clk_register_clkdev(clk, "gmac_phy_synth_clk", NULL); | 675 | clk_register_clkdev(clk, "phy_syn_clk", NULL); |
679 | clk_register_clkdev(clk1, "gmac_phy_synth_gate_clk", NULL); | 676 | clk_register_clkdev(clk1, "phy_syn_gclk", NULL); |
680 | 677 | ||
681 | clk = clk_register_mux(NULL, "gmac_phy_mux_clk", gmac_phy_parents, | 678 | clk = clk_register_mux(NULL, "phy_mclk", gmac_phy_parents, |
682 | ARRAY_SIZE(gmac_phy_parents), 0, | 679 | ARRAY_SIZE(gmac_phy_parents), 0, |
683 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_GMAC_PHY_CLK_SHIFT, | 680 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_GMAC_PHY_CLK_SHIFT, |
684 | SPEAR1340_GMAC_PHY_CLK_MASK, 0, &_lock); | 681 | SPEAR1340_GMAC_PHY_CLK_MASK, 0, &_lock); |
685 | clk_register_clkdev(clk, NULL, "stmmacphy.0"); | 682 | clk_register_clkdev(clk, NULL, "stmmacphy.0"); |
686 | 683 | ||
687 | /* clcd */ | 684 | /* clcd */ |
688 | clk = clk_register_mux(NULL, "clcd_synth_mux_clk", clcd_synth_parents, | 685 | clk = clk_register_mux(NULL, "clcd_syn_mclk", clcd_synth_parents, |
689 | ARRAY_SIZE(clcd_synth_parents), 0, | 686 | ARRAY_SIZE(clcd_synth_parents), 0, |
690 | SPEAR1340_CLCD_CLK_SYNT, SPEAR1340_CLCD_SYNT_CLK_SHIFT, | 687 | SPEAR1340_CLCD_CLK_SYNT, SPEAR1340_CLCD_SYNT_CLK_SHIFT, |
691 | SPEAR1340_CLCD_SYNT_CLK_MASK, 0, &_lock); | 688 | SPEAR1340_CLCD_SYNT_CLK_MASK, 0, &_lock); |
692 | clk_register_clkdev(clk, "clcd_synth_mux_clk", NULL); | 689 | clk_register_clkdev(clk, "clcd_syn_mclk", NULL); |
693 | 690 | ||
694 | clk = clk_register_frac("clcd_synth_clk", "clcd_synth_mux_clk", 0, | 691 | clk = clk_register_frac("clcd_syn_clk", "clcd_syn_mclk", 0, |
695 | SPEAR1340_CLCD_CLK_SYNT, clcd_rtbl, | 692 | SPEAR1340_CLCD_CLK_SYNT, clcd_rtbl, |
696 | ARRAY_SIZE(clcd_rtbl), &_lock); | 693 | ARRAY_SIZE(clcd_rtbl), &_lock); |
697 | clk_register_clkdev(clk, "clcd_synth_clk", NULL); | 694 | clk_register_clkdev(clk, "clcd_syn_clk", NULL); |
698 | 695 | ||
699 | clk = clk_register_mux(NULL, "clcd_pixel_mux_clk", clcd_pixel_parents, | 696 | clk = clk_register_mux(NULL, "clcd_pixel_mclk", clcd_pixel_parents, |
700 | ARRAY_SIZE(clcd_pixel_parents), 0, | 697 | ARRAY_SIZE(clcd_pixel_parents), 0, |
701 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_CLCD_CLK_SHIFT, | 698 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_CLCD_CLK_SHIFT, |
702 | SPEAR1340_CLCD_CLK_MASK, 0, &_lock); | 699 | SPEAR1340_CLCD_CLK_MASK, 0, &_lock); |
703 | clk_register_clkdev(clk, "clcd_pixel_clk", NULL); | 700 | clk_register_clkdev(clk, "clcd_pixel_clk", NULL); |
704 | 701 | ||
705 | clk = clk_register_gate(NULL, "clcd_clk", "clcd_pixel_mux_clk", 0, | 702 | clk = clk_register_gate(NULL, "clcd_clk", "clcd_pixel_mclk", 0, |
706 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_CLCD_CLK_ENB, 0, | 703 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_CLCD_CLK_ENB, 0, |
707 | &_lock); | 704 | &_lock); |
708 | clk_register_clkdev(clk, "clcd_clk", NULL); | 705 | clk_register_clkdev(clk, "clcd_clk", NULL); |
709 | 706 | ||
710 | /* i2s */ | 707 | /* i2s */ |
711 | clk = clk_register_mux(NULL, "i2s_src_mux_clk", i2s_src_parents, | 708 | clk = clk_register_mux(NULL, "i2s_src_mclk", i2s_src_parents, |
712 | ARRAY_SIZE(i2s_src_parents), 0, SPEAR1340_I2S_CLK_CFG, | 709 | ARRAY_SIZE(i2s_src_parents), 0, SPEAR1340_I2S_CLK_CFG, |
713 | SPEAR1340_I2S_SRC_CLK_SHIFT, SPEAR1340_I2S_SRC_CLK_MASK, | 710 | SPEAR1340_I2S_SRC_CLK_SHIFT, SPEAR1340_I2S_SRC_CLK_MASK, |
714 | 0, &_lock); | 711 | 0, &_lock); |
715 | clk_register_clkdev(clk, "i2s_src_clk", NULL); | 712 | clk_register_clkdev(clk, "i2s_src_clk", NULL); |
716 | 713 | ||
717 | clk = clk_register_aux("i2s_prs1_clk", NULL, "i2s_src_mux_clk", 0, | 714 | clk = clk_register_aux("i2s_prs1_clk", NULL, "i2s_src_mclk", 0, |
718 | SPEAR1340_I2S_CLK_CFG, &i2s_prs1_masks, i2s_prs1_rtbl, | 715 | SPEAR1340_I2S_CLK_CFG, &i2s_prs1_masks, i2s_prs1_rtbl, |
719 | ARRAY_SIZE(i2s_prs1_rtbl), &_lock, NULL); | 716 | ARRAY_SIZE(i2s_prs1_rtbl), &_lock, NULL); |
720 | clk_register_clkdev(clk, "i2s_prs1_clk", NULL); | 717 | clk_register_clkdev(clk, "i2s_prs1_clk", NULL); |
721 | 718 | ||
722 | clk = clk_register_mux(NULL, "i2s_ref_mux_clk", i2s_ref_parents, | 719 | clk = clk_register_mux(NULL, "i2s_ref_mclk", i2s_ref_parents, |
723 | ARRAY_SIZE(i2s_ref_parents), 0, SPEAR1340_I2S_CLK_CFG, | 720 | ARRAY_SIZE(i2s_ref_parents), 0, SPEAR1340_I2S_CLK_CFG, |
724 | SPEAR1340_I2S_REF_SHIFT, SPEAR1340_I2S_REF_SEL_MASK, 0, | 721 | SPEAR1340_I2S_REF_SHIFT, SPEAR1340_I2S_REF_SEL_MASK, 0, |
725 | &_lock); | 722 | &_lock); |
726 | clk_register_clkdev(clk, "i2s_ref_clk", NULL); | 723 | clk_register_clkdev(clk, "i2s_ref_clk", NULL); |
727 | 724 | ||
728 | clk = clk_register_gate(NULL, "i2s_ref_pad_clk", "i2s_ref_mux_clk", 0, | 725 | clk = clk_register_gate(NULL, "i2s_ref_pad_clk", "i2s_ref_mclk", 0, |
729 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_I2S_REF_PAD_CLK_ENB, | 726 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_I2S_REF_PAD_CLK_ENB, |
730 | 0, &_lock); | 727 | 0, &_lock); |
731 | clk_register_clkdev(clk, "i2s_ref_pad_clk", NULL); | 728 | clk_register_clkdev(clk, "i2s_ref_pad_clk", NULL); |
732 | 729 | ||
733 | clk = clk_register_aux("i2s_sclk_clk", "i2s_sclk_gate_clk", | 730 | clk = clk_register_aux("i2s_sclk_clk", "i2s_sclk_gclk", "i2s_ref_mclk", |
734 | "i2s_ref_mux_clk", 0, SPEAR1340_I2S_CLK_CFG, | 731 | 0, SPEAR1340_I2S_CLK_CFG, &i2s_sclk_masks, |
735 | &i2s_sclk_masks, i2s_sclk_rtbl, | 732 | i2s_sclk_rtbl, ARRAY_SIZE(i2s_sclk_rtbl), &_lock, |
736 | ARRAY_SIZE(i2s_sclk_rtbl), &_lock, &clk1); | 733 | &clk1); |
737 | clk_register_clkdev(clk, "i2s_sclk_clk", NULL); | 734 | clk_register_clkdev(clk, "i2s_sclk_clk", NULL); |
738 | clk_register_clkdev(clk1, "i2s_sclk_gate_clk", NULL); | 735 | clk_register_clkdev(clk1, "i2s_sclk_gclk", NULL); |
739 | 736 | ||
740 | /* clock derived from ahb clk */ | 737 | /* clock derived from ahb clk */ |
741 | clk = clk_register_gate(NULL, "i2c0_clk", "ahb_clk", 0, | 738 | clk = clk_register_gate(NULL, "i2c0_clk", "ahb_clk", 0, |
@@ -744,7 +741,7 @@ void __init spear1340_clk_init(void) | |||
744 | clk_register_clkdev(clk, NULL, "e0280000.i2c"); | 741 | clk_register_clkdev(clk, NULL, "e0280000.i2c"); |
745 | 742 | ||
746 | clk = clk_register_gate(NULL, "i2c1_clk", "ahb_clk", 0, | 743 | clk = clk_register_gate(NULL, "i2c1_clk", "ahb_clk", 0, |
747 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_I2C1_CLK_ENB, 0, | 744 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_I2C1_CLK_ENB, 0, |
748 | &_lock); | 745 | &_lock); |
749 | clk_register_clkdev(clk, NULL, "b4000000.i2c"); | 746 | clk_register_clkdev(clk, NULL, "b4000000.i2c"); |
750 | 747 | ||
@@ -800,13 +797,13 @@ void __init spear1340_clk_init(void) | |||
800 | &_lock); | 797 | &_lock); |
801 | clk_register_clkdev(clk, "sysram1_clk", NULL); | 798 | clk_register_clkdev(clk, "sysram1_clk", NULL); |
802 | 799 | ||
803 | clk = clk_register_aux("adc_synth_clk", "adc_synth_gate_clk", "ahb_clk", | 800 | clk = clk_register_aux("adc_syn_clk", "adc_syn_gclk", "ahb_clk", |
804 | 0, SPEAR1340_ADC_CLK_SYNT, NULL, adc_rtbl, | 801 | 0, SPEAR1340_ADC_CLK_SYNT, NULL, adc_rtbl, |
805 | ARRAY_SIZE(adc_rtbl), &_lock, &clk1); | 802 | ARRAY_SIZE(adc_rtbl), &_lock, &clk1); |
806 | clk_register_clkdev(clk, "adc_synth_clk", NULL); | 803 | clk_register_clkdev(clk, "adc_syn_clk", NULL); |
807 | clk_register_clkdev(clk1, "adc_synth_gate_clk", NULL); | 804 | clk_register_clkdev(clk1, "adc_syn_gclk", NULL); |
808 | 805 | ||
809 | clk = clk_register_gate(NULL, "adc_clk", "adc_synth_gate_clk", 0, | 806 | clk = clk_register_gate(NULL, "adc_clk", "adc_syn_gclk", 0, |
810 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_ADC_CLK_ENB, 0, | 807 | SPEAR1340_PERIP1_CLK_ENB, SPEAR1340_ADC_CLK_ENB, 0, |
811 | &_lock); | 808 | &_lock); |
812 | clk_register_clkdev(clk, NULL, "adc_clk"); | 809 | clk_register_clkdev(clk, NULL, "adc_clk"); |
@@ -843,39 +840,39 @@ void __init spear1340_clk_init(void) | |||
843 | clk_register_clkdev(clk, NULL, "e0300000.kbd"); | 840 | clk_register_clkdev(clk, NULL, "e0300000.kbd"); |
844 | 841 | ||
845 | /* RAS clks */ | 842 | /* RAS clks */ |
846 | clk = clk_register_mux(NULL, "gen_synth0_1_mux_clk", | 843 | clk = clk_register_mux(NULL, "gen_syn0_1_mclk", gen_synth0_1_parents, |
847 | gen_synth0_1_parents, ARRAY_SIZE(gen_synth0_1_parents), | 844 | ARRAY_SIZE(gen_synth0_1_parents), 0, SPEAR1340_PLL_CFG, |
848 | 0, SPEAR1340_PLL_CFG, SPEAR1340_GEN_SYNT0_1_CLK_SHIFT, | 845 | SPEAR1340_GEN_SYNT0_1_CLK_SHIFT, |
849 | SPEAR1340_GEN_SYNT_CLK_MASK, 0, &_lock); | 846 | SPEAR1340_GEN_SYNT_CLK_MASK, 0, &_lock); |
850 | clk_register_clkdev(clk, "gen_synth0_1_clk", NULL); | 847 | clk_register_clkdev(clk, "gen_syn0_1_clk", NULL); |
851 | 848 | ||
852 | clk = clk_register_mux(NULL, "gen_synth2_3_mux_clk", | 849 | clk = clk_register_mux(NULL, "gen_syn2_3_mclk", gen_synth2_3_parents, |
853 | gen_synth2_3_parents, ARRAY_SIZE(gen_synth2_3_parents), | 850 | ARRAY_SIZE(gen_synth2_3_parents), 0, SPEAR1340_PLL_CFG, |
854 | 0, SPEAR1340_PLL_CFG, SPEAR1340_GEN_SYNT2_3_CLK_SHIFT, | 851 | SPEAR1340_GEN_SYNT2_3_CLK_SHIFT, |
855 | SPEAR1340_GEN_SYNT_CLK_MASK, 0, &_lock); | 852 | SPEAR1340_GEN_SYNT_CLK_MASK, 0, &_lock); |
856 | clk_register_clkdev(clk, "gen_synth2_3_clk", NULL); | 853 | clk_register_clkdev(clk, "gen_syn2_3_clk", NULL); |
857 | 854 | ||
858 | clk = clk_register_frac("gen_synth0_clk", "gen_synth0_1_clk", 0, | 855 | clk = clk_register_frac("gen_syn0_clk", "gen_syn0_1_clk", 0, |
859 | SPEAR1340_GEN_CLK_SYNT0, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 856 | SPEAR1340_GEN_CLK_SYNT0, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
860 | &_lock); | 857 | &_lock); |
861 | clk_register_clkdev(clk, "gen_synth0_clk", NULL); | 858 | clk_register_clkdev(clk, "gen_syn0_clk", NULL); |
862 | 859 | ||
863 | clk = clk_register_frac("gen_synth1_clk", "gen_synth0_1_clk", 0, | 860 | clk = clk_register_frac("gen_syn1_clk", "gen_syn0_1_clk", 0, |
864 | SPEAR1340_GEN_CLK_SYNT1, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 861 | SPEAR1340_GEN_CLK_SYNT1, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
865 | &_lock); | 862 | &_lock); |
866 | clk_register_clkdev(clk, "gen_synth1_clk", NULL); | 863 | clk_register_clkdev(clk, "gen_syn1_clk", NULL); |
867 | 864 | ||
868 | clk = clk_register_frac("gen_synth2_clk", "gen_synth2_3_clk", 0, | 865 | clk = clk_register_frac("gen_syn2_clk", "gen_syn2_3_clk", 0, |
869 | SPEAR1340_GEN_CLK_SYNT2, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 866 | SPEAR1340_GEN_CLK_SYNT2, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
870 | &_lock); | 867 | &_lock); |
871 | clk_register_clkdev(clk, "gen_synth2_clk", NULL); | 868 | clk_register_clkdev(clk, "gen_syn2_clk", NULL); |
872 | 869 | ||
873 | clk = clk_register_frac("gen_synth3_clk", "gen_synth2_3_clk", 0, | 870 | clk = clk_register_frac("gen_syn3_clk", "gen_syn2_3_clk", 0, |
874 | SPEAR1340_GEN_CLK_SYNT3, gen_rtbl, ARRAY_SIZE(gen_rtbl), | 871 | SPEAR1340_GEN_CLK_SYNT3, gen_rtbl, ARRAY_SIZE(gen_rtbl), |
875 | &_lock); | 872 | &_lock); |
876 | clk_register_clkdev(clk, "gen_synth3_clk", NULL); | 873 | clk_register_clkdev(clk, "gen_syn3_clk", NULL); |
877 | 874 | ||
878 | clk = clk_register_gate(NULL, "mali_clk", "gen_synth3_clk", 0, | 875 | clk = clk_register_gate(NULL, "mali_clk", "gen_syn3_clk", 0, |
879 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_MALI_CLK_ENB, 0, | 876 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_MALI_CLK_ENB, 0, |
880 | &_lock); | 877 | &_lock); |
881 | clk_register_clkdev(clk, NULL, "mali"); | 878 | clk_register_clkdev(clk, NULL, "mali"); |
@@ -890,74 +887,74 @@ void __init spear1340_clk_init(void) | |||
890 | &_lock); | 887 | &_lock); |
891 | clk_register_clkdev(clk, NULL, "spear_cec.1"); | 888 | clk_register_clkdev(clk, NULL, "spear_cec.1"); |
892 | 889 | ||
893 | clk = clk_register_mux(NULL, "spdif_out_mux_clk", spdif_out_parents, | 890 | clk = clk_register_mux(NULL, "spdif_out_mclk", spdif_out_parents, |
894 | ARRAY_SIZE(spdif_out_parents), 0, | 891 | ARRAY_SIZE(spdif_out_parents), 0, |
895 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_SPDIF_OUT_CLK_SHIFT, | 892 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_SPDIF_OUT_CLK_SHIFT, |
896 | SPEAR1340_SPDIF_CLK_MASK, 0, &_lock); | 893 | SPEAR1340_SPDIF_CLK_MASK, 0, &_lock); |
897 | clk_register_clkdev(clk, "spdif_out_mux_clk", NULL); | 894 | clk_register_clkdev(clk, "spdif_out_mclk", NULL); |
898 | 895 | ||
899 | clk = clk_register_gate(NULL, "spdif_out_clk", "spdif_out_mux_clk", 0, | 896 | clk = clk_register_gate(NULL, "spdif_out_clk", "spdif_out_mclk", 0, |
900 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_SPDIF_OUT_CLK_ENB, | 897 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_SPDIF_OUT_CLK_ENB, |
901 | 0, &_lock); | 898 | 0, &_lock); |
902 | clk_register_clkdev(clk, NULL, "spdif-out"); | 899 | clk_register_clkdev(clk, NULL, "spdif-out"); |
903 | 900 | ||
904 | clk = clk_register_mux(NULL, "spdif_in_mux_clk", spdif_in_parents, | 901 | clk = clk_register_mux(NULL, "spdif_in_mclk", spdif_in_parents, |
905 | ARRAY_SIZE(spdif_in_parents), 0, | 902 | ARRAY_SIZE(spdif_in_parents), 0, |
906 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_SPDIF_IN_CLK_SHIFT, | 903 | SPEAR1340_PERIP_CLK_CFG, SPEAR1340_SPDIF_IN_CLK_SHIFT, |
907 | SPEAR1340_SPDIF_CLK_MASK, 0, &_lock); | 904 | SPEAR1340_SPDIF_CLK_MASK, 0, &_lock); |
908 | clk_register_clkdev(clk, "spdif_in_mux_clk", NULL); | 905 | clk_register_clkdev(clk, "spdif_in_mclk", NULL); |
909 | 906 | ||
910 | clk = clk_register_gate(NULL, "spdif_in_clk", "spdif_in_mux_clk", 0, | 907 | clk = clk_register_gate(NULL, "spdif_in_clk", "spdif_in_mclk", 0, |
911 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_SPDIF_IN_CLK_ENB, 0, | 908 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_SPDIF_IN_CLK_ENB, 0, |
912 | &_lock); | 909 | &_lock); |
913 | clk_register_clkdev(clk, NULL, "spdif-in"); | 910 | clk_register_clkdev(clk, NULL, "spdif-in"); |
914 | 911 | ||
915 | clk = clk_register_gate(NULL, "acp_clk", "acp_mux_clk", 0, | 912 | clk = clk_register_gate(NULL, "acp_clk", "acp_mclk", 0, |
916 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_ACP_CLK_ENB, 0, | 913 | SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_ACP_CLK_ENB, 0, |
917 | &_lock); | 914 | &_lock); |
918 | clk_register_clkdev(clk, NULL, "acp_clk"); | 915 | clk_register_clkdev(clk, NULL, "acp_clk"); |
919 | 916 | ||
920 | clk = clk_register_gate(NULL, "plgpio_clk", "plgpio_mux_clk", 0, | 917 | clk = clk_register_gate(NULL, "plgpio_clk", "plgpio_mclk", 0, |
921 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_PLGPIO_CLK_ENB, 0, | 918 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_PLGPIO_CLK_ENB, 0, |
922 | &_lock); | 919 | &_lock); |
923 | clk_register_clkdev(clk, NULL, "plgpio"); | 920 | clk_register_clkdev(clk, NULL, "plgpio"); |
924 | 921 | ||
925 | clk = clk_register_gate(NULL, "video_dec_clk", "video_dec_mux_clk", 0, | 922 | clk = clk_register_gate(NULL, "video_dec_clk", "video_dec_mclk", 0, |
926 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_DEC_CLK_ENB, | 923 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_DEC_CLK_ENB, |
927 | 0, &_lock); | 924 | 0, &_lock); |
928 | clk_register_clkdev(clk, NULL, "video_dec"); | 925 | clk_register_clkdev(clk, NULL, "video_dec"); |
929 | 926 | ||
930 | clk = clk_register_gate(NULL, "video_enc_clk", "video_enc_mux_clk", 0, | 927 | clk = clk_register_gate(NULL, "video_enc_clk", "video_enc_mclk", 0, |
931 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_ENC_CLK_ENB, | 928 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_ENC_CLK_ENB, |
932 | 0, &_lock); | 929 | 0, &_lock); |
933 | clk_register_clkdev(clk, NULL, "video_enc"); | 930 | clk_register_clkdev(clk, NULL, "video_enc"); |
934 | 931 | ||
935 | clk = clk_register_gate(NULL, "video_in_clk", "video_in_mux_clk", 0, | 932 | clk = clk_register_gate(NULL, "video_in_clk", "video_in_mclk", 0, |
936 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_IN_CLK_ENB, 0, | 933 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_IN_CLK_ENB, 0, |
937 | &_lock); | 934 | &_lock); |
938 | clk_register_clkdev(clk, NULL, "spear_vip"); | 935 | clk_register_clkdev(clk, NULL, "spear_vip"); |
939 | 936 | ||
940 | clk = clk_register_gate(NULL, "cam0_clk", "cam0_mux_clk", 0, | 937 | clk = clk_register_gate(NULL, "cam0_clk", "cam0_mclk", 0, |
941 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM0_CLK_ENB, 0, | 938 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM0_CLK_ENB, 0, |
942 | &_lock); | 939 | &_lock); |
943 | clk_register_clkdev(clk, NULL, "spear_camif.0"); | 940 | clk_register_clkdev(clk, NULL, "spear_camif.0"); |
944 | 941 | ||
945 | clk = clk_register_gate(NULL, "cam1_clk", "cam1_mux_clk", 0, | 942 | clk = clk_register_gate(NULL, "cam1_clk", "cam1_mclk", 0, |
946 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM1_CLK_ENB, 0, | 943 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM1_CLK_ENB, 0, |
947 | &_lock); | 944 | &_lock); |
948 | clk_register_clkdev(clk, NULL, "spear_camif.1"); | 945 | clk_register_clkdev(clk, NULL, "spear_camif.1"); |
949 | 946 | ||
950 | clk = clk_register_gate(NULL, "cam2_clk", "cam2_mux_clk", 0, | 947 | clk = clk_register_gate(NULL, "cam2_clk", "cam2_mclk", 0, |
951 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM2_CLK_ENB, 0, | 948 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM2_CLK_ENB, 0, |
952 | &_lock); | 949 | &_lock); |
953 | clk_register_clkdev(clk, NULL, "spear_camif.2"); | 950 | clk_register_clkdev(clk, NULL, "spear_camif.2"); |
954 | 951 | ||
955 | clk = clk_register_gate(NULL, "cam3_clk", "cam3_mux_clk", 0, | 952 | clk = clk_register_gate(NULL, "cam3_clk", "cam3_mclk", 0, |
956 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM3_CLK_ENB, 0, | 953 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM3_CLK_ENB, 0, |
957 | &_lock); | 954 | &_lock); |
958 | clk_register_clkdev(clk, NULL, "spear_camif.3"); | 955 | clk_register_clkdev(clk, NULL, "spear_camif.3"); |
959 | 956 | ||
960 | clk = clk_register_gate(NULL, "pwm_clk", "pwm_mux_clk", 0, | 957 | clk = clk_register_gate(NULL, "pwm_clk", "pwm_mclk", 0, |
961 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_PWM_CLK_ENB, 0, | 958 | SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_PWM_CLK_ENB, 0, |
962 | &_lock); | 959 | &_lock); |
963 | clk_register_clkdev(clk, NULL, "pwm"); | 960 | clk_register_clkdev(clk, NULL, "pwm"); |
diff --git a/drivers/clk/spear/spear3xx_clock.c b/drivers/clk/spear/spear3xx_clock.c index 440bb3e4c971..c3157454bb3f 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 |
@@ -122,12 +122,12 @@ static struct gpt_rate_tbl gpt_rtbl[] = { | |||
122 | }; | 122 | }; |
123 | 123 | ||
124 | /* clock parents */ | 124 | /* clock parents */ |
125 | static const char *uart0_parents[] = { "pll3_48m_clk", "uart_synth_gate_clk", }; | 125 | static const char *uart0_parents[] = { "pll3_clk", "uart_syn_gclk", }; |
126 | static const char *firda_parents[] = { "pll3_48m_clk", "firda_synth_gate_clk", | 126 | static const char *firda_parents[] = { "pll3_clk", "firda_syn_gclk", |
127 | }; | 127 | }; |
128 | static const char *gpt0_parents[] = { "pll3_48m_clk", "gpt0_synth_clk", }; | 128 | static const char *gpt0_parents[] = { "pll3_clk", "gpt0_syn_clk", }; |
129 | static const char *gpt1_parents[] = { "pll3_48m_clk", "gpt1_synth_clk", }; | 129 | static const char *gpt1_parents[] = { "pll3_clk", "gpt1_syn_clk", }; |
130 | static const char *gpt2_parents[] = { "pll3_48m_clk", "gpt2_synth_clk", }; | 130 | static const char *gpt2_parents[] = { "pll3_clk", "gpt2_syn_clk", }; |
131 | static const char *gen2_3_parents[] = { "pll1_clk", "pll2_clk", }; | 131 | static const char *gen2_3_parents[] = { "pll1_clk", "pll2_clk", }; |
132 | static const char *ddr_parents[] = { "ahb_clk", "ahbmult2_clk", "none", | 132 | static const char *ddr_parents[] = { "ahb_clk", "ahbmult2_clk", "none", |
133 | "pll2_clk", }; | 133 | "pll2_clk", }; |
@@ -137,7 +137,7 @@ static void __init spear300_clk_init(void) | |||
137 | { | 137 | { |
138 | struct clk *clk; | 138 | struct clk *clk; |
139 | 139 | ||
140 | clk = clk_register_fixed_factor(NULL, "clcd_clk", "ras_pll3_48m_clk", 0, | 140 | clk = clk_register_fixed_factor(NULL, "clcd_clk", "ras_pll3_clk", 0, |
141 | 1, 1); | 141 | 1, 1); |
142 | clk_register_clkdev(clk, NULL, "60000000.clcd"); | 142 | clk_register_clkdev(clk, NULL, "60000000.clcd"); |
143 | 143 | ||
@@ -219,15 +219,11 @@ static void __init spear310_clk_init(void) | |||
219 | #define SPEAR320_UARTX_PCLK_VAL_SYNTH1 0x0 | 219 | #define SPEAR320_UARTX_PCLK_VAL_SYNTH1 0x0 |
220 | #define SPEAR320_UARTX_PCLK_VAL_APB 0x1 | 220 | #define SPEAR320_UARTX_PCLK_VAL_APB 0x1 |
221 | 221 | ||
222 | static const char *i2s_ref_parents[] = { "ras_pll2_clk", | 222 | static const char *i2s_ref_parents[] = { "ras_pll2_clk", "ras_syn2_gclk", }; |
223 | "ras_gen2_synth_gate_clk", }; | 223 | static const char *sdhci_parents[] = { "ras_pll3_clk", "ras_syn3_gclk", }; |
224 | static const char *sdhci_parents[] = { "ras_pll3_48m_clk", | ||
225 | "ras_gen3_synth_gate_clk", | ||
226 | }; | ||
227 | static const char *smii0_parents[] = { "smii_125m_pad", "ras_pll2_clk", | 224 | static const char *smii0_parents[] = { "smii_125m_pad", "ras_pll2_clk", |
228 | "ras_gen0_synth_gate_clk", }; | 225 | "ras_syn0_gclk", }; |
229 | static const char *uartx_parents[] = { "ras_gen1_synth_gate_clk", "ras_apb_clk", | 226 | static const char *uartx_parents[] = { "ras_syn1_gclk", "ras_apb_clk", }; |
230 | }; | ||
231 | 227 | ||
232 | static void __init spear320_clk_init(void) | 228 | static void __init spear320_clk_init(void) |
233 | { | 229 | { |
@@ -237,7 +233,7 @@ static void __init spear320_clk_init(void) | |||
237 | CLK_IS_ROOT, 125000000); | 233 | CLK_IS_ROOT, 125000000); |
238 | clk_register_clkdev(clk, "smii_125m_pad", NULL); | 234 | clk_register_clkdev(clk, "smii_125m_pad", NULL); |
239 | 235 | ||
240 | clk = clk_register_fixed_factor(NULL, "clcd_clk", "ras_pll3_48m_clk", 0, | 236 | clk = clk_register_fixed_factor(NULL, "clcd_clk", "ras_pll3_clk", 0, |
241 | 1, 1); | 237 | 1, 1); |
242 | clk_register_clkdev(clk, NULL, "90000000.clcd"); | 238 | clk_register_clkdev(clk, NULL, "90000000.clcd"); |
243 | 239 | ||
@@ -363,9 +359,9 @@ void __init spear3xx_clk_init(void) | |||
363 | clk_register_clkdev(clk, NULL, "fc900000.rtc"); | 359 | clk_register_clkdev(clk, NULL, "fc900000.rtc"); |
364 | 360 | ||
365 | /* clock derived from 24 MHz osc clk */ | 361 | /* clock derived from 24 MHz osc clk */ |
366 | clk = clk_register_fixed_rate(NULL, "pll3_48m_clk", "osc_24m_clk", 0, | 362 | clk = clk_register_fixed_rate(NULL, "pll3_clk", "osc_24m_clk", 0, |
367 | 48000000); | 363 | 48000000); |
368 | clk_register_clkdev(clk, "pll3_48m_clk", NULL); | 364 | clk_register_clkdev(clk, "pll3_clk", NULL); |
369 | 365 | ||
370 | clk = clk_register_fixed_factor(NULL, "wdt_clk", "osc_24m_clk", 0, 1, | 366 | clk = clk_register_fixed_factor(NULL, "wdt_clk", "osc_24m_clk", 0, 1, |
371 | 1); | 367 | 1); |
@@ -392,98 +388,98 @@ void __init spear3xx_clk_init(void) | |||
392 | HCLK_RATIO_MASK, 0, &_lock); | 388 | HCLK_RATIO_MASK, 0, &_lock); |
393 | clk_register_clkdev(clk, "ahb_clk", NULL); | 389 | clk_register_clkdev(clk, "ahb_clk", NULL); |
394 | 390 | ||
395 | clk = clk_register_aux("uart_synth_clk", "uart_synth_gate_clk", | 391 | clk = clk_register_aux("uart_syn_clk", "uart_syn_gclk", "pll1_clk", 0, |
396 | "pll1_clk", 0, UART_CLK_SYNT, NULL, aux_rtbl, | 392 | UART_CLK_SYNT, NULL, aux_rtbl, ARRAY_SIZE(aux_rtbl), |
397 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 393 | &_lock, &clk1); |
398 | clk_register_clkdev(clk, "uart_synth_clk", NULL); | 394 | clk_register_clkdev(clk, "uart_syn_clk", NULL); |
399 | clk_register_clkdev(clk1, "uart_synth_gate_clk", NULL); | 395 | clk_register_clkdev(clk1, "uart_syn_gclk", NULL); |
400 | 396 | ||
401 | clk = clk_register_mux(NULL, "uart0_mux_clk", uart0_parents, | 397 | clk = clk_register_mux(NULL, "uart0_mclk", uart0_parents, |
402 | ARRAY_SIZE(uart0_parents), 0, PERIP_CLK_CFG, | 398 | ARRAY_SIZE(uart0_parents), 0, PERIP_CLK_CFG, |
403 | UART_CLK_SHIFT, UART_CLK_MASK, 0, &_lock); | 399 | UART_CLK_SHIFT, UART_CLK_MASK, 0, &_lock); |
404 | clk_register_clkdev(clk, "uart0_mux_clk", NULL); | 400 | clk_register_clkdev(clk, "uart0_mclk", NULL); |
405 | 401 | ||
406 | clk = clk_register_gate(NULL, "uart0", "uart0_mux_clk", 0, | 402 | clk = clk_register_gate(NULL, "uart0", "uart0_mclk", 0, PERIP1_CLK_ENB, |
407 | PERIP1_CLK_ENB, UART_CLK_ENB, 0, &_lock); | 403 | UART_CLK_ENB, 0, &_lock); |
408 | clk_register_clkdev(clk, NULL, "d0000000.serial"); | 404 | clk_register_clkdev(clk, NULL, "d0000000.serial"); |
409 | 405 | ||
410 | clk = clk_register_aux("firda_synth_clk", "firda_synth_gate_clk", | 406 | clk = clk_register_aux("firda_syn_clk", "firda_syn_gclk", "pll1_clk", 0, |
411 | "pll1_clk", 0, FIRDA_CLK_SYNT, NULL, aux_rtbl, | 407 | FIRDA_CLK_SYNT, NULL, aux_rtbl, ARRAY_SIZE(aux_rtbl), |
412 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 408 | &_lock, &clk1); |
413 | clk_register_clkdev(clk, "firda_synth_clk", NULL); | 409 | clk_register_clkdev(clk, "firda_syn_clk", NULL); |
414 | clk_register_clkdev(clk1, "firda_synth_gate_clk", NULL); | 410 | clk_register_clkdev(clk1, "firda_syn_gclk", NULL); |
415 | 411 | ||
416 | clk = clk_register_mux(NULL, "firda_mux_clk", firda_parents, | 412 | clk = clk_register_mux(NULL, "firda_mclk", firda_parents, |
417 | ARRAY_SIZE(firda_parents), 0, PERIP_CLK_CFG, | 413 | ARRAY_SIZE(firda_parents), 0, PERIP_CLK_CFG, |
418 | FIRDA_CLK_SHIFT, FIRDA_CLK_MASK, 0, &_lock); | 414 | FIRDA_CLK_SHIFT, FIRDA_CLK_MASK, 0, &_lock); |
419 | clk_register_clkdev(clk, "firda_mux_clk", NULL); | 415 | clk_register_clkdev(clk, "firda_mclk", NULL); |
420 | 416 | ||
421 | clk = clk_register_gate(NULL, "firda_clk", "firda_mux_clk", 0, | 417 | clk = clk_register_gate(NULL, "firda_clk", "firda_mclk", 0, |
422 | PERIP1_CLK_ENB, FIRDA_CLK_ENB, 0, &_lock); | 418 | PERIP1_CLK_ENB, FIRDA_CLK_ENB, 0, &_lock); |
423 | clk_register_clkdev(clk, NULL, "firda"); | 419 | clk_register_clkdev(clk, NULL, "firda"); |
424 | 420 | ||
425 | /* gpt clocks */ | 421 | /* gpt clocks */ |
426 | clk_register_gpt("gpt0_synth_clk", "pll1_clk", 0, PRSC0_CLK_CFG, | 422 | clk_register_gpt("gpt0_syn_clk", "pll1_clk", 0, PRSC0_CLK_CFG, gpt_rtbl, |
427 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); | 423 | ARRAY_SIZE(gpt_rtbl), &_lock); |
428 | clk = clk_register_mux(NULL, "gpt0_clk", gpt0_parents, | 424 | clk = clk_register_mux(NULL, "gpt0_clk", gpt0_parents, |
429 | ARRAY_SIZE(gpt0_parents), 0, PERIP_CLK_CFG, | 425 | ARRAY_SIZE(gpt0_parents), 0, PERIP_CLK_CFG, |
430 | GPT0_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); | 426 | GPT0_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); |
431 | clk_register_clkdev(clk, NULL, "gpt0"); | 427 | clk_register_clkdev(clk, NULL, "gpt0"); |
432 | 428 | ||
433 | clk_register_gpt("gpt1_synth_clk", "pll1_clk", 0, PRSC1_CLK_CFG, | 429 | clk_register_gpt("gpt1_syn_clk", "pll1_clk", 0, PRSC1_CLK_CFG, gpt_rtbl, |
434 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); | 430 | ARRAY_SIZE(gpt_rtbl), &_lock); |
435 | clk = clk_register_mux(NULL, "gpt1_mux_clk", gpt1_parents, | 431 | clk = clk_register_mux(NULL, "gpt1_mclk", gpt1_parents, |
436 | ARRAY_SIZE(gpt1_parents), 0, PERIP_CLK_CFG, | 432 | ARRAY_SIZE(gpt1_parents), 0, PERIP_CLK_CFG, |
437 | GPT1_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); | 433 | GPT1_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); |
438 | clk_register_clkdev(clk, "gpt1_mux_clk", NULL); | 434 | clk_register_clkdev(clk, "gpt1_mclk", NULL); |
439 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mux_clk", 0, | 435 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mclk", 0, |
440 | PERIP1_CLK_ENB, GPT1_CLK_ENB, 0, &_lock); | 436 | PERIP1_CLK_ENB, GPT1_CLK_ENB, 0, &_lock); |
441 | clk_register_clkdev(clk, NULL, "gpt1"); | 437 | clk_register_clkdev(clk, NULL, "gpt1"); |
442 | 438 | ||
443 | clk_register_gpt("gpt2_synth_clk", "pll1_clk", 0, PRSC2_CLK_CFG, | 439 | clk_register_gpt("gpt2_syn_clk", "pll1_clk", 0, PRSC2_CLK_CFG, gpt_rtbl, |
444 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); | 440 | ARRAY_SIZE(gpt_rtbl), &_lock); |
445 | clk = clk_register_mux(NULL, "gpt2_mux_clk", gpt2_parents, | 441 | clk = clk_register_mux(NULL, "gpt2_mclk", gpt2_parents, |
446 | ARRAY_SIZE(gpt2_parents), 0, PERIP_CLK_CFG, | 442 | ARRAY_SIZE(gpt2_parents), 0, PERIP_CLK_CFG, |
447 | GPT2_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); | 443 | GPT2_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); |
448 | clk_register_clkdev(clk, "gpt2_mux_clk", NULL); | 444 | clk_register_clkdev(clk, "gpt2_mclk", NULL); |
449 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mux_clk", 0, | 445 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mclk", 0, |
450 | PERIP1_CLK_ENB, GPT2_CLK_ENB, 0, &_lock); | 446 | PERIP1_CLK_ENB, GPT2_CLK_ENB, 0, &_lock); |
451 | clk_register_clkdev(clk, NULL, "gpt2"); | 447 | clk_register_clkdev(clk, NULL, "gpt2"); |
452 | 448 | ||
453 | /* general synths clocks */ | 449 | /* general synths clocks */ |
454 | clk = clk_register_aux("gen0_synth_clk", "gen0_synth_gate_clk", | 450 | clk = clk_register_aux("gen0_syn_clk", "gen0_syn_gclk", "pll1_clk", |
455 | "pll1_clk", 0, GEN0_CLK_SYNT, NULL, aux_rtbl, | 451 | 0, GEN0_CLK_SYNT, NULL, aux_rtbl, ARRAY_SIZE(aux_rtbl), |
456 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 452 | &_lock, &clk1); |
457 | clk_register_clkdev(clk, "gen0_synth_clk", NULL); | 453 | clk_register_clkdev(clk, "gen0_syn_clk", NULL); |
458 | clk_register_clkdev(clk1, "gen0_synth_gate_clk", NULL); | 454 | clk_register_clkdev(clk1, "gen0_syn_gclk", NULL); |
459 | 455 | ||
460 | clk = clk_register_aux("gen1_synth_clk", "gen1_synth_gate_clk", | 456 | clk = clk_register_aux("gen1_syn_clk", "gen1_syn_gclk", "pll1_clk", |
461 | "pll1_clk", 0, GEN1_CLK_SYNT, NULL, aux_rtbl, | 457 | 0, GEN1_CLK_SYNT, NULL, aux_rtbl, ARRAY_SIZE(aux_rtbl), |
462 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 458 | &_lock, &clk1); |
463 | clk_register_clkdev(clk, "gen1_synth_clk", NULL); | 459 | clk_register_clkdev(clk, "gen1_syn_clk", NULL); |
464 | clk_register_clkdev(clk1, "gen1_synth_gate_clk", NULL); | 460 | clk_register_clkdev(clk1, "gen1_syn_gclk", NULL); |
465 | 461 | ||
466 | clk = clk_register_mux(NULL, "gen2_3_parent_clk", gen2_3_parents, | 462 | clk = clk_register_mux(NULL, "gen2_3_par_clk", gen2_3_parents, |
467 | ARRAY_SIZE(gen2_3_parents), 0, CORE_CLK_CFG, | 463 | ARRAY_SIZE(gen2_3_parents), 0, CORE_CLK_CFG, |
468 | GEN_SYNTH2_3_CLK_SHIFT, GEN_SYNTH2_3_CLK_MASK, 0, | 464 | GEN_SYNTH2_3_CLK_SHIFT, GEN_SYNTH2_3_CLK_MASK, 0, |
469 | &_lock); | 465 | &_lock); |
470 | clk_register_clkdev(clk, "gen2_3_parent_clk", NULL); | 466 | clk_register_clkdev(clk, "gen2_3_par_clk", NULL); |
471 | 467 | ||
472 | clk = clk_register_aux("gen2_synth_clk", "gen2_synth_gate_clk", | 468 | clk = clk_register_aux("gen2_syn_clk", "gen2_syn_gclk", |
473 | "gen2_3_parent_clk", 0, GEN2_CLK_SYNT, NULL, aux_rtbl, | 469 | "gen2_3_par_clk", 0, GEN2_CLK_SYNT, NULL, aux_rtbl, |
474 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 470 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
475 | clk_register_clkdev(clk, "gen2_synth_clk", NULL); | 471 | clk_register_clkdev(clk, "gen2_syn_clk", NULL); |
476 | clk_register_clkdev(clk1, "gen2_synth_gate_clk", NULL); | 472 | clk_register_clkdev(clk1, "gen2_syn_gclk", NULL); |
477 | 473 | ||
478 | clk = clk_register_aux("gen3_synth_clk", "gen3_synth_gate_clk", | 474 | clk = clk_register_aux("gen3_syn_clk", "gen3_syn_gclk", |
479 | "gen2_3_parent_clk", 0, GEN3_CLK_SYNT, NULL, aux_rtbl, | 475 | "gen2_3_par_clk", 0, GEN3_CLK_SYNT, NULL, aux_rtbl, |
480 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 476 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); |
481 | clk_register_clkdev(clk, "gen3_synth_clk", NULL); | 477 | clk_register_clkdev(clk, "gen3_syn_clk", NULL); |
482 | clk_register_clkdev(clk1, "gen3_synth_gate_clk", NULL); | 478 | clk_register_clkdev(clk1, "gen3_syn_gclk", NULL); |
483 | 479 | ||
484 | /* clock derived from pll3 clk */ | 480 | /* clock derived from pll3 clk */ |
485 | clk = clk_register_gate(NULL, "usbh_clk", "pll3_48m_clk", 0, | 481 | clk = clk_register_gate(NULL, "usbh_clk", "pll3_clk", 0, PERIP1_CLK_ENB, |
486 | PERIP1_CLK_ENB, USBH_CLK_ENB, 0, &_lock); | 482 | USBH_CLK_ENB, 0, &_lock); |
487 | clk_register_clkdev(clk, "usbh_clk", NULL); | 483 | clk_register_clkdev(clk, "usbh_clk", NULL); |
488 | 484 | ||
489 | clk = clk_register_fixed_factor(NULL, "usbh.0_clk", "usbh_clk", 0, 1, | 485 | clk = clk_register_fixed_factor(NULL, "usbh.0_clk", "usbh_clk", 0, 1, |
@@ -494,8 +490,8 @@ void __init spear3xx_clk_init(void) | |||
494 | 1); | 490 | 1); |
495 | clk_register_clkdev(clk, "usbh.1_clk", NULL); | 491 | clk_register_clkdev(clk, "usbh.1_clk", NULL); |
496 | 492 | ||
497 | clk = clk_register_gate(NULL, "usbd_clk", "pll3_48m_clk", 0, | 493 | clk = clk_register_gate(NULL, "usbd_clk", "pll3_clk", 0, PERIP1_CLK_ENB, |
498 | PERIP1_CLK_ENB, USBD_CLK_ENB, 0, &_lock); | 494 | USBD_CLK_ENB, 0, &_lock); |
499 | clk_register_clkdev(clk, NULL, "designware_udc"); | 495 | clk_register_clkdev(clk, NULL, "designware_udc"); |
500 | 496 | ||
501 | /* clock derived from ahb clk */ | 497 | /* clock derived from ahb clk */ |
@@ -579,29 +575,25 @@ void __init spear3xx_clk_init(void) | |||
579 | RAS_CLK_ENB, RAS_PLL2_CLK_ENB, 0, &_lock); | 575 | RAS_CLK_ENB, RAS_PLL2_CLK_ENB, 0, &_lock); |
580 | clk_register_clkdev(clk, "ras_pll2_clk", NULL); | 576 | clk_register_clkdev(clk, "ras_pll2_clk", NULL); |
581 | 577 | ||
582 | clk = clk_register_gate(NULL, "ras_pll3_48m_clk", "pll3_48m_clk", 0, | 578 | clk = clk_register_gate(NULL, "ras_pll3_clk", "pll3_clk", 0, |
583 | RAS_CLK_ENB, RAS_48M_CLK_ENB, 0, &_lock); | 579 | RAS_CLK_ENB, RAS_48M_CLK_ENB, 0, &_lock); |
584 | clk_register_clkdev(clk, "ras_pll3_48m_clk", NULL); | 580 | clk_register_clkdev(clk, "ras_pll3_clk", NULL); |
585 | 581 | ||
586 | clk = clk_register_gate(NULL, "ras_gen0_synth_gate_clk", | 582 | clk = clk_register_gate(NULL, "ras_syn0_gclk", "gen0_syn_gclk", 0, |
587 | "gen0_synth_gate_clk", 0, RAS_CLK_ENB, | 583 | RAS_CLK_ENB, RAS_SYNT0_CLK_ENB, 0, &_lock); |
588 | RAS_SYNT0_CLK_ENB, 0, &_lock); | 584 | clk_register_clkdev(clk, "ras_syn0_gclk", NULL); |
589 | clk_register_clkdev(clk, "ras_gen0_synth_gate_clk", NULL); | 585 | |
590 | 586 | clk = clk_register_gate(NULL, "ras_syn1_gclk", "gen1_syn_gclk", 0, | |
591 | clk = clk_register_gate(NULL, "ras_gen1_synth_gate_clk", | 587 | RAS_CLK_ENB, RAS_SYNT1_CLK_ENB, 0, &_lock); |
592 | "gen1_synth_gate_clk", 0, RAS_CLK_ENB, | 588 | clk_register_clkdev(clk, "ras_syn1_gclk", NULL); |
593 | RAS_SYNT1_CLK_ENB, 0, &_lock); | 589 | |
594 | clk_register_clkdev(clk, "ras_gen1_synth_gate_clk", NULL); | 590 | clk = clk_register_gate(NULL, "ras_syn2_gclk", "gen2_syn_gclk", 0, |
595 | 591 | RAS_CLK_ENB, RAS_SYNT2_CLK_ENB, 0, &_lock); | |
596 | clk = clk_register_gate(NULL, "ras_gen2_synth_gate_clk", | 592 | clk_register_clkdev(clk, "ras_syn2_gclk", NULL); |
597 | "gen2_synth_gate_clk", 0, RAS_CLK_ENB, | 593 | |
598 | RAS_SYNT2_CLK_ENB, 0, &_lock); | 594 | clk = clk_register_gate(NULL, "ras_syn3_gclk", "gen3_syn_gclk", 0, |
599 | clk_register_clkdev(clk, "ras_gen2_synth_gate_clk", NULL); | 595 | RAS_CLK_ENB, RAS_SYNT3_CLK_ENB, 0, &_lock); |
600 | 596 | clk_register_clkdev(clk, "ras_syn3_gclk", NULL); | |
601 | clk = clk_register_gate(NULL, "ras_gen3_synth_gate_clk", | ||
602 | "gen3_synth_gate_clk", 0, RAS_CLK_ENB, | ||
603 | RAS_SYNT3_CLK_ENB, 0, &_lock); | ||
604 | clk_register_clkdev(clk, "ras_gen3_synth_gate_clk", NULL); | ||
605 | 597 | ||
606 | if (of_machine_is_compatible("st,spear300")) | 598 | if (of_machine_is_compatible("st,spear300")) |
607 | spear300_clk_init(); | 599 | spear300_clk_init(); |
diff --git a/drivers/clk/spear/spear6xx_clock.c b/drivers/clk/spear/spear6xx_clock.c index f9a20b382304..a98d0866f541 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 |
@@ -97,13 +97,12 @@ static struct aux_rate_tbl aux_rtbl[] = { | |||
97 | {.xscale = 1, .yscale = 2, .eq = 1}, /* 166 MHz */ | 97 | {.xscale = 1, .yscale = 2, .eq = 1}, /* 166 MHz */ |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static const char *clcd_parents[] = { "pll3_48m_clk", "clcd_synth_gate_clk", }; | 100 | static const char *clcd_parents[] = { "pll3_clk", "clcd_syn_gclk", }; |
101 | static const char *firda_parents[] = { "pll3_48m_clk", "firda_synth_gate_clk", | 101 | static const char *firda_parents[] = { "pll3_clk", "firda_syn_gclk", }; |
102 | }; | 102 | static const char *uart_parents[] = { "pll3_clk", "uart_syn_gclk", }; |
103 | static const char *uart_parents[] = { "pll3_48m_clk", "uart_synth_gate_clk", }; | 103 | static const char *gpt0_1_parents[] = { "pll3_clk", "gpt0_1_syn_clk", }; |
104 | static const char *gpt0_1_parents[] = { "pll3_48m_clk", "gpt0_1_synth_clk", }; | 104 | static const char *gpt2_parents[] = { "pll3_clk", "gpt2_syn_clk", }; |
105 | static const char *gpt2_parents[] = { "pll3_48m_clk", "gpt2_synth_clk", }; | 105 | static const char *gpt3_parents[] = { "pll3_clk", "gpt3_syn_clk", }; |
106 | static const char *gpt3_parents[] = { "pll3_48m_clk", "gpt3_synth_clk", }; | ||
107 | static const char *ddr_parents[] = { "ahb_clk", "ahbmult2_clk", "none", | 106 | static const char *ddr_parents[] = { "ahb_clk", "ahbmult2_clk", "none", |
108 | "pll2_clk", }; | 107 | "pll2_clk", }; |
109 | 108 | ||
@@ -136,9 +135,9 @@ void __init spear6xx_clk_init(void) | |||
136 | clk_register_clkdev(clk, NULL, "rtc-spear"); | 135 | clk_register_clkdev(clk, NULL, "rtc-spear"); |
137 | 136 | ||
138 | /* clock derived from 30 MHz osc clk */ | 137 | /* clock derived from 30 MHz osc clk */ |
139 | clk = clk_register_fixed_rate(NULL, "pll3_48m_clk", "osc_24m_clk", 0, | 138 | clk = clk_register_fixed_rate(NULL, "pll3_clk", "osc_24m_clk", 0, |
140 | 48000000); | 139 | 48000000); |
141 | clk_register_clkdev(clk, "pll3_48m_clk", NULL); | 140 | clk_register_clkdev(clk, "pll3_clk", NULL); |
142 | 141 | ||
143 | clk = clk_register_vco_pll("vco1_clk", "pll1_clk", NULL, "osc_30m_clk", | 142 | clk = clk_register_vco_pll("vco1_clk", "pll1_clk", NULL, "osc_30m_clk", |
144 | 0, PLL1_CTR, PLL1_FRQ, pll_rtbl, ARRAY_SIZE(pll_rtbl), | 143 | 0, PLL1_CTR, PLL1_FRQ, pll_rtbl, ARRAY_SIZE(pll_rtbl), |
@@ -146,9 +145,9 @@ void __init spear6xx_clk_init(void) | |||
146 | clk_register_clkdev(clk, "vco1_clk", NULL); | 145 | clk_register_clkdev(clk, "vco1_clk", NULL); |
147 | clk_register_clkdev(clk1, "pll1_clk", NULL); | 146 | clk_register_clkdev(clk1, "pll1_clk", NULL); |
148 | 147 | ||
149 | clk = clk_register_vco_pll("vco2_clk", "pll2_clk", NULL, | 148 | clk = clk_register_vco_pll("vco2_clk", "pll2_clk", NULL, "osc_30m_clk", |
150 | "osc_30m_clk", 0, PLL2_CTR, PLL2_FRQ, pll_rtbl, | 149 | 0, PLL2_CTR, PLL2_FRQ, pll_rtbl, ARRAY_SIZE(pll_rtbl), |
151 | ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL); | 150 | &_lock, &clk1, NULL); |
152 | clk_register_clkdev(clk, "vco2_clk", NULL); | 151 | clk_register_clkdev(clk, "vco2_clk", NULL); |
153 | clk_register_clkdev(clk1, "pll2_clk", NULL); | 152 | clk_register_clkdev(clk1, "pll2_clk", NULL); |
154 | 153 | ||
@@ -165,111 +164,111 @@ void __init spear6xx_clk_init(void) | |||
165 | HCLK_RATIO_MASK, 0, &_lock); | 164 | HCLK_RATIO_MASK, 0, &_lock); |
166 | clk_register_clkdev(clk, "ahb_clk", NULL); | 165 | clk_register_clkdev(clk, "ahb_clk", NULL); |
167 | 166 | ||
168 | clk = clk_register_aux("uart_synth_clk", "uart_synth_gate_clk", | 167 | clk = clk_register_aux("uart_syn_clk", "uart_syn_gclk", "pll1_clk", 0, |
169 | "pll1_clk", 0, UART_CLK_SYNT, NULL, aux_rtbl, | 168 | UART_CLK_SYNT, NULL, aux_rtbl, ARRAY_SIZE(aux_rtbl), |
170 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 169 | &_lock, &clk1); |
171 | clk_register_clkdev(clk, "uart_synth_clk", NULL); | 170 | clk_register_clkdev(clk, "uart_syn_clk", NULL); |
172 | clk_register_clkdev(clk1, "uart_synth_gate_clk", NULL); | 171 | clk_register_clkdev(clk1, "uart_syn_gclk", NULL); |
173 | 172 | ||
174 | clk = clk_register_mux(NULL, "uart_mux_clk", uart_parents, | 173 | clk = clk_register_mux(NULL, "uart_mclk", uart_parents, |
175 | ARRAY_SIZE(uart_parents), 0, PERIP_CLK_CFG, | 174 | ARRAY_SIZE(uart_parents), 0, PERIP_CLK_CFG, |
176 | UART_CLK_SHIFT, UART_CLK_MASK, 0, &_lock); | 175 | UART_CLK_SHIFT, UART_CLK_MASK, 0, &_lock); |
177 | clk_register_clkdev(clk, "uart_mux_clk", NULL); | 176 | clk_register_clkdev(clk, "uart_mclk", NULL); |
178 | 177 | ||
179 | clk = clk_register_gate(NULL, "uart0", "uart_mux_clk", 0, | 178 | clk = clk_register_gate(NULL, "uart0", "uart_mclk", 0, PERIP1_CLK_ENB, |
180 | PERIP1_CLK_ENB, UART0_CLK_ENB, 0, &_lock); | 179 | UART0_CLK_ENB, 0, &_lock); |
181 | clk_register_clkdev(clk, NULL, "d0000000.serial"); | 180 | clk_register_clkdev(clk, NULL, "d0000000.serial"); |
182 | 181 | ||
183 | clk = clk_register_gate(NULL, "uart1", "uart_mux_clk", 0, | 182 | clk = clk_register_gate(NULL, "uart1", "uart_mclk", 0, PERIP1_CLK_ENB, |
184 | PERIP1_CLK_ENB, UART1_CLK_ENB, 0, &_lock); | 183 | UART1_CLK_ENB, 0, &_lock); |
185 | clk_register_clkdev(clk, NULL, "d0080000.serial"); | 184 | clk_register_clkdev(clk, NULL, "d0080000.serial"); |
186 | 185 | ||
187 | clk = clk_register_aux("firda_synth_clk", "firda_synth_gate_clk", | 186 | clk = clk_register_aux("firda_syn_clk", "firda_syn_gclk", "pll1_clk", |
188 | "pll1_clk", 0, FIRDA_CLK_SYNT, NULL, aux_rtbl, | 187 | 0, FIRDA_CLK_SYNT, NULL, aux_rtbl, ARRAY_SIZE(aux_rtbl), |
189 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 188 | &_lock, &clk1); |
190 | clk_register_clkdev(clk, "firda_synth_clk", NULL); | 189 | clk_register_clkdev(clk, "firda_syn_clk", NULL); |
191 | clk_register_clkdev(clk1, "firda_synth_gate_clk", NULL); | 190 | clk_register_clkdev(clk1, "firda_syn_gclk", NULL); |
192 | 191 | ||
193 | clk = clk_register_mux(NULL, "firda_mux_clk", firda_parents, | 192 | clk = clk_register_mux(NULL, "firda_mclk", firda_parents, |
194 | ARRAY_SIZE(firda_parents), 0, PERIP_CLK_CFG, | 193 | ARRAY_SIZE(firda_parents), 0, PERIP_CLK_CFG, |
195 | FIRDA_CLK_SHIFT, FIRDA_CLK_MASK, 0, &_lock); | 194 | FIRDA_CLK_SHIFT, FIRDA_CLK_MASK, 0, &_lock); |
196 | clk_register_clkdev(clk, "firda_mux_clk", NULL); | 195 | clk_register_clkdev(clk, "firda_mclk", NULL); |
197 | 196 | ||
198 | clk = clk_register_gate(NULL, "firda_clk", "firda_mux_clk", 0, | 197 | clk = clk_register_gate(NULL, "firda_clk", "firda_mclk", 0, |
199 | PERIP1_CLK_ENB, FIRDA_CLK_ENB, 0, &_lock); | 198 | PERIP1_CLK_ENB, FIRDA_CLK_ENB, 0, &_lock); |
200 | clk_register_clkdev(clk, NULL, "firda"); | 199 | clk_register_clkdev(clk, NULL, "firda"); |
201 | 200 | ||
202 | clk = clk_register_aux("clcd_synth_clk", "clcd_synth_gate_clk", | 201 | clk = clk_register_aux("clcd_syn_clk", "clcd_syn_gclk", "pll1_clk", |
203 | "pll1_clk", 0, CLCD_CLK_SYNT, NULL, aux_rtbl, | 202 | 0, CLCD_CLK_SYNT, NULL, aux_rtbl, ARRAY_SIZE(aux_rtbl), |
204 | ARRAY_SIZE(aux_rtbl), &_lock, &clk1); | 203 | &_lock, &clk1); |
205 | clk_register_clkdev(clk, "clcd_synth_clk", NULL); | 204 | clk_register_clkdev(clk, "clcd_syn_clk", NULL); |
206 | clk_register_clkdev(clk1, "clcd_synth_gate_clk", NULL); | 205 | clk_register_clkdev(clk1, "clcd_syn_gclk", NULL); |
207 | 206 | ||
208 | clk = clk_register_mux(NULL, "clcd_mux_clk", clcd_parents, | 207 | clk = clk_register_mux(NULL, "clcd_mclk", clcd_parents, |
209 | ARRAY_SIZE(clcd_parents), 0, PERIP_CLK_CFG, | 208 | ARRAY_SIZE(clcd_parents), 0, PERIP_CLK_CFG, |
210 | CLCD_CLK_SHIFT, CLCD_CLK_MASK, 0, &_lock); | 209 | CLCD_CLK_SHIFT, CLCD_CLK_MASK, 0, &_lock); |
211 | clk_register_clkdev(clk, "clcd_mux_clk", NULL); | 210 | clk_register_clkdev(clk, "clcd_mclk", NULL); |
212 | 211 | ||
213 | clk = clk_register_gate(NULL, "clcd_clk", "clcd_mux_clk", 0, | 212 | clk = clk_register_gate(NULL, "clcd_clk", "clcd_mclk", 0, |
214 | PERIP1_CLK_ENB, CLCD_CLK_ENB, 0, &_lock); | 213 | PERIP1_CLK_ENB, CLCD_CLK_ENB, 0, &_lock); |
215 | clk_register_clkdev(clk, NULL, "clcd"); | 214 | clk_register_clkdev(clk, NULL, "clcd"); |
216 | 215 | ||
217 | /* gpt clocks */ | 216 | /* gpt clocks */ |
218 | clk = clk_register_gpt("gpt0_1_synth_clk", "pll1_clk", 0, PRSC0_CLK_CFG, | 217 | clk = clk_register_gpt("gpt0_1_syn_clk", "pll1_clk", 0, PRSC0_CLK_CFG, |
219 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); | 218 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); |
220 | clk_register_clkdev(clk, "gpt0_1_synth_clk", NULL); | 219 | clk_register_clkdev(clk, "gpt0_1_syn_clk", NULL); |
221 | 220 | ||
222 | clk = clk_register_mux(NULL, "gpt0_mux_clk", gpt0_1_parents, | 221 | clk = clk_register_mux(NULL, "gpt0_mclk", gpt0_1_parents, |
223 | ARRAY_SIZE(gpt0_1_parents), 0, PERIP_CLK_CFG, | 222 | ARRAY_SIZE(gpt0_1_parents), 0, PERIP_CLK_CFG, |
224 | GPT0_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); | 223 | GPT0_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); |
225 | clk_register_clkdev(clk, NULL, "gpt0"); | 224 | clk_register_clkdev(clk, NULL, "gpt0"); |
226 | 225 | ||
227 | clk = clk_register_mux(NULL, "gpt1_mux_clk", gpt0_1_parents, | 226 | clk = clk_register_mux(NULL, "gpt1_mclk", gpt0_1_parents, |
228 | ARRAY_SIZE(gpt0_1_parents), 0, PERIP_CLK_CFG, | 227 | ARRAY_SIZE(gpt0_1_parents), 0, PERIP_CLK_CFG, |
229 | GPT1_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); | 228 | GPT1_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); |
230 | clk_register_clkdev(clk, "gpt1_mux_clk", NULL); | 229 | clk_register_clkdev(clk, "gpt1_mclk", NULL); |
231 | 230 | ||
232 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mux_clk", 0, | 231 | clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mclk", 0, |
233 | PERIP1_CLK_ENB, GPT1_CLK_ENB, 0, &_lock); | 232 | PERIP1_CLK_ENB, GPT1_CLK_ENB, 0, &_lock); |
234 | clk_register_clkdev(clk, NULL, "gpt1"); | 233 | clk_register_clkdev(clk, NULL, "gpt1"); |
235 | 234 | ||
236 | clk = clk_register_gpt("gpt2_synth_clk", "pll1_clk", 0, PRSC1_CLK_CFG, | 235 | clk = clk_register_gpt("gpt2_syn_clk", "pll1_clk", 0, PRSC1_CLK_CFG, |
237 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); | 236 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); |
238 | clk_register_clkdev(clk, "gpt2_synth_clk", NULL); | 237 | clk_register_clkdev(clk, "gpt2_syn_clk", NULL); |
239 | 238 | ||
240 | clk = clk_register_mux(NULL, "gpt2_mux_clk", gpt2_parents, | 239 | clk = clk_register_mux(NULL, "gpt2_mclk", gpt2_parents, |
241 | ARRAY_SIZE(gpt2_parents), 0, PERIP_CLK_CFG, | 240 | ARRAY_SIZE(gpt2_parents), 0, PERIP_CLK_CFG, |
242 | GPT2_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); | 241 | GPT2_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); |
243 | clk_register_clkdev(clk, "gpt2_mux_clk", NULL); | 242 | clk_register_clkdev(clk, "gpt2_mclk", NULL); |
244 | 243 | ||
245 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mux_clk", 0, | 244 | clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mclk", 0, |
246 | PERIP1_CLK_ENB, GPT2_CLK_ENB, 0, &_lock); | 245 | PERIP1_CLK_ENB, GPT2_CLK_ENB, 0, &_lock); |
247 | clk_register_clkdev(clk, NULL, "gpt2"); | 246 | clk_register_clkdev(clk, NULL, "gpt2"); |
248 | 247 | ||
249 | clk = clk_register_gpt("gpt3_synth_clk", "pll1_clk", 0, PRSC2_CLK_CFG, | 248 | clk = clk_register_gpt("gpt3_syn_clk", "pll1_clk", 0, PRSC2_CLK_CFG, |
250 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); | 249 | gpt_rtbl, ARRAY_SIZE(gpt_rtbl), &_lock); |
251 | clk_register_clkdev(clk, "gpt3_synth_clk", NULL); | 250 | clk_register_clkdev(clk, "gpt3_syn_clk", NULL); |
252 | 251 | ||
253 | clk = clk_register_mux(NULL, "gpt3_mux_clk", gpt3_parents, | 252 | clk = clk_register_mux(NULL, "gpt3_mclk", gpt3_parents, |
254 | ARRAY_SIZE(gpt3_parents), 0, PERIP_CLK_CFG, | 253 | ARRAY_SIZE(gpt3_parents), 0, PERIP_CLK_CFG, |
255 | GPT3_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); | 254 | GPT3_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); |
256 | clk_register_clkdev(clk, "gpt3_mux_clk", NULL); | 255 | clk_register_clkdev(clk, "gpt3_mclk", NULL); |
257 | 256 | ||
258 | clk = clk_register_gate(NULL, "gpt3_clk", "gpt3_mux_clk", 0, | 257 | clk = clk_register_gate(NULL, "gpt3_clk", "gpt3_mclk", 0, |
259 | PERIP1_CLK_ENB, GPT3_CLK_ENB, 0, &_lock); | 258 | PERIP1_CLK_ENB, GPT3_CLK_ENB, 0, &_lock); |
260 | clk_register_clkdev(clk, NULL, "gpt3"); | 259 | clk_register_clkdev(clk, NULL, "gpt3"); |
261 | 260 | ||
262 | /* clock derived from pll3 clk */ | 261 | /* clock derived from pll3 clk */ |
263 | clk = clk_register_gate(NULL, "usbh0_clk", "pll3_48m_clk", 0, | 262 | clk = clk_register_gate(NULL, "usbh0_clk", "pll3_clk", 0, |
264 | PERIP1_CLK_ENB, USBH0_CLK_ENB, 0, &_lock); | 263 | PERIP1_CLK_ENB, USBH0_CLK_ENB, 0, &_lock); |
265 | clk_register_clkdev(clk, NULL, "usbh.0_clk"); | 264 | clk_register_clkdev(clk, NULL, "usbh.0_clk"); |
266 | 265 | ||
267 | clk = clk_register_gate(NULL, "usbh1_clk", "pll3_48m_clk", 0, | 266 | clk = clk_register_gate(NULL, "usbh1_clk", "pll3_clk", 0, |
268 | PERIP1_CLK_ENB, USBH1_CLK_ENB, 0, &_lock); | 267 | PERIP1_CLK_ENB, USBH1_CLK_ENB, 0, &_lock); |
269 | clk_register_clkdev(clk, NULL, "usbh.1_clk"); | 268 | clk_register_clkdev(clk, NULL, "usbh.1_clk"); |
270 | 269 | ||
271 | clk = clk_register_gate(NULL, "usbd_clk", "pll3_48m_clk", 0, | 270 | clk = clk_register_gate(NULL, "usbd_clk", "pll3_clk", 0, PERIP1_CLK_ENB, |
272 | PERIP1_CLK_ENB, USBD_CLK_ENB, 0, &_lock); | 271 | USBD_CLK_ENB, 0, &_lock); |
273 | clk_register_clkdev(clk, NULL, "designware_udc"); | 272 | clk_register_clkdev(clk, NULL, "designware_udc"); |
274 | 273 | ||
275 | /* clock derived from ahb clk */ | 274 | /* clock derived from ahb clk */ |
@@ -278,9 +277,8 @@ void __init spear6xx_clk_init(void) | |||
278 | clk_register_clkdev(clk, "ahbmult2_clk", NULL); | 277 | clk_register_clkdev(clk, "ahbmult2_clk", NULL); |
279 | 278 | ||
280 | clk = clk_register_mux(NULL, "ddr_clk", ddr_parents, | 279 | clk = clk_register_mux(NULL, "ddr_clk", ddr_parents, |
281 | ARRAY_SIZE(ddr_parents), | 280 | ARRAY_SIZE(ddr_parents), 0, PLL_CLK_CFG, MCTR_CLK_SHIFT, |
282 | 0, PLL_CLK_CFG, MCTR_CLK_SHIFT, MCTR_CLK_MASK, 0, | 281 | MCTR_CLK_MASK, 0, &_lock); |
283 | &_lock); | ||
284 | clk_register_clkdev(clk, "ddr_clk", NULL); | 282 | clk_register_clkdev(clk, "ddr_clk", NULL); |
285 | 283 | ||
286 | clk = clk_register_divider(NULL, "apb_clk", "ahb_clk", | 284 | clk = clk_register_divider(NULL, "apb_clk", "ahb_clk", |
@@ -298,7 +296,7 @@ void __init spear6xx_clk_init(void) | |||
298 | 296 | ||
299 | clk = clk_register_gate(NULL, "gmac_clk", "ahb_clk", 0, PERIP1_CLK_ENB, | 297 | clk = clk_register_gate(NULL, "gmac_clk", "ahb_clk", 0, PERIP1_CLK_ENB, |
300 | GMAC_CLK_ENB, 0, &_lock); | 298 | GMAC_CLK_ENB, 0, &_lock); |
301 | clk_register_clkdev(clk, NULL, "gmac"); | 299 | clk_register_clkdev(clk, NULL, "e0800000.ethernet"); |
302 | 300 | ||
303 | clk = clk_register_gate(NULL, "i2c_clk", "ahb_clk", 0, PERIP1_CLK_ENB, | 301 | clk = clk_register_gate(NULL, "i2c_clk", "ahb_clk", 0, PERIP1_CLK_ENB, |
304 | I2C_CLK_ENB, 0, &_lock); | 302 | I2C_CLK_ENB, 0, &_lock); |
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 32fe9ef5cc5c..98b06baafcc6 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c | |||
@@ -48,13 +48,13 @@ struct sh_cmt_priv { | |||
48 | unsigned long next_match_value; | 48 | unsigned long next_match_value; |
49 | unsigned long max_match_value; | 49 | unsigned long max_match_value; |
50 | unsigned long rate; | 50 | unsigned long rate; |
51 | spinlock_t lock; | 51 | raw_spinlock_t lock; |
52 | struct clock_event_device ced; | 52 | struct clock_event_device ced; |
53 | struct clocksource cs; | 53 | struct clocksource cs; |
54 | unsigned long total_cycles; | 54 | unsigned long total_cycles; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | static DEFINE_SPINLOCK(sh_cmt_lock); | 57 | static DEFINE_RAW_SPINLOCK(sh_cmt_lock); |
58 | 58 | ||
59 | #define CMSTR -1 /* shared register */ | 59 | #define CMSTR -1 /* shared register */ |
60 | #define CMCSR 0 /* channel register */ | 60 | #define CMCSR 0 /* channel register */ |
@@ -139,7 +139,7 @@ static void sh_cmt_start_stop_ch(struct sh_cmt_priv *p, int start) | |||
139 | unsigned long flags, value; | 139 | unsigned long flags, value; |
140 | 140 | ||
141 | /* start stop register shared by multiple timer channels */ | 141 | /* start stop register shared by multiple timer channels */ |
142 | spin_lock_irqsave(&sh_cmt_lock, flags); | 142 | raw_spin_lock_irqsave(&sh_cmt_lock, flags); |
143 | value = sh_cmt_read(p, CMSTR); | 143 | value = sh_cmt_read(p, CMSTR); |
144 | 144 | ||
145 | if (start) | 145 | if (start) |
@@ -148,7 +148,7 @@ static void sh_cmt_start_stop_ch(struct sh_cmt_priv *p, int start) | |||
148 | value &= ~(1 << cfg->timer_bit); | 148 | value &= ~(1 << cfg->timer_bit); |
149 | 149 | ||
150 | sh_cmt_write(p, CMSTR, value); | 150 | sh_cmt_write(p, CMSTR, value); |
151 | spin_unlock_irqrestore(&sh_cmt_lock, flags); | 151 | raw_spin_unlock_irqrestore(&sh_cmt_lock, flags); |
152 | } | 152 | } |
153 | 153 | ||
154 | static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate) | 154 | static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate) |
@@ -328,9 +328,9 @@ static void sh_cmt_set_next(struct sh_cmt_priv *p, unsigned long delta) | |||
328 | { | 328 | { |
329 | unsigned long flags; | 329 | unsigned long flags; |
330 | 330 | ||
331 | spin_lock_irqsave(&p->lock, flags); | 331 | raw_spin_lock_irqsave(&p->lock, flags); |
332 | __sh_cmt_set_next(p, delta); | 332 | __sh_cmt_set_next(p, delta); |
333 | spin_unlock_irqrestore(&p->lock, flags); | 333 | raw_spin_unlock_irqrestore(&p->lock, flags); |
334 | } | 334 | } |
335 | 335 | ||
336 | static irqreturn_t sh_cmt_interrupt(int irq, void *dev_id) | 336 | static irqreturn_t sh_cmt_interrupt(int irq, void *dev_id) |
@@ -385,7 +385,7 @@ static int sh_cmt_start(struct sh_cmt_priv *p, unsigned long flag) | |||
385 | int ret = 0; | 385 | int ret = 0; |
386 | unsigned long flags; | 386 | unsigned long flags; |
387 | 387 | ||
388 | spin_lock_irqsave(&p->lock, flags); | 388 | raw_spin_lock_irqsave(&p->lock, flags); |
389 | 389 | ||
390 | if (!(p->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE))) | 390 | if (!(p->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE))) |
391 | ret = sh_cmt_enable(p, &p->rate); | 391 | ret = sh_cmt_enable(p, &p->rate); |
@@ -398,7 +398,7 @@ static int sh_cmt_start(struct sh_cmt_priv *p, unsigned long flag) | |||
398 | if ((flag == FLAG_CLOCKSOURCE) && (!(p->flags & FLAG_CLOCKEVENT))) | 398 | if ((flag == FLAG_CLOCKSOURCE) && (!(p->flags & FLAG_CLOCKEVENT))) |
399 | __sh_cmt_set_next(p, p->max_match_value); | 399 | __sh_cmt_set_next(p, p->max_match_value); |
400 | out: | 400 | out: |
401 | spin_unlock_irqrestore(&p->lock, flags); | 401 | raw_spin_unlock_irqrestore(&p->lock, flags); |
402 | 402 | ||
403 | return ret; | 403 | return ret; |
404 | } | 404 | } |
@@ -408,7 +408,7 @@ static void sh_cmt_stop(struct sh_cmt_priv *p, unsigned long flag) | |||
408 | unsigned long flags; | 408 | unsigned long flags; |
409 | unsigned long f; | 409 | unsigned long f; |
410 | 410 | ||
411 | spin_lock_irqsave(&p->lock, flags); | 411 | raw_spin_lock_irqsave(&p->lock, flags); |
412 | 412 | ||
413 | f = p->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE); | 413 | f = p->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE); |
414 | p->flags &= ~flag; | 414 | p->flags &= ~flag; |
@@ -420,7 +420,7 @@ static void sh_cmt_stop(struct sh_cmt_priv *p, unsigned long flag) | |||
420 | if ((flag == FLAG_CLOCKEVENT) && (p->flags & FLAG_CLOCKSOURCE)) | 420 | if ((flag == FLAG_CLOCKEVENT) && (p->flags & FLAG_CLOCKSOURCE)) |
421 | __sh_cmt_set_next(p, p->max_match_value); | 421 | __sh_cmt_set_next(p, p->max_match_value); |
422 | 422 | ||
423 | spin_unlock_irqrestore(&p->lock, flags); | 423 | raw_spin_unlock_irqrestore(&p->lock, flags); |
424 | } | 424 | } |
425 | 425 | ||
426 | static struct sh_cmt_priv *cs_to_sh_cmt(struct clocksource *cs) | 426 | static struct sh_cmt_priv *cs_to_sh_cmt(struct clocksource *cs) |
@@ -435,13 +435,13 @@ static cycle_t sh_cmt_clocksource_read(struct clocksource *cs) | |||
435 | unsigned long value; | 435 | unsigned long value; |
436 | int has_wrapped; | 436 | int has_wrapped; |
437 | 437 | ||
438 | spin_lock_irqsave(&p->lock, flags); | 438 | raw_spin_lock_irqsave(&p->lock, flags); |
439 | value = p->total_cycles; | 439 | value = p->total_cycles; |
440 | raw = sh_cmt_get_counter(p, &has_wrapped); | 440 | raw = sh_cmt_get_counter(p, &has_wrapped); |
441 | 441 | ||
442 | if (unlikely(has_wrapped)) | 442 | if (unlikely(has_wrapped)) |
443 | raw += p->match_value + 1; | 443 | raw += p->match_value + 1; |
444 | spin_unlock_irqrestore(&p->lock, flags); | 444 | raw_spin_unlock_irqrestore(&p->lock, flags); |
445 | 445 | ||
446 | return value + raw; | 446 | return value + raw; |
447 | } | 447 | } |
@@ -591,7 +591,7 @@ static int sh_cmt_register(struct sh_cmt_priv *p, char *name, | |||
591 | p->max_match_value = (1 << p->width) - 1; | 591 | p->max_match_value = (1 << p->width) - 1; |
592 | 592 | ||
593 | p->match_value = p->max_match_value; | 593 | p->match_value = p->max_match_value; |
594 | spin_lock_init(&p->lock); | 594 | raw_spin_lock_init(&p->lock); |
595 | 595 | ||
596 | if (clockevent_rating) | 596 | if (clockevent_rating) |
597 | sh_cmt_register_clockevent(p, name, clockevent_rating); | 597 | sh_cmt_register_clockevent(p, name, clockevent_rating); |
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index a2172f690418..d9b76ca64a61 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c | |||
@@ -43,7 +43,7 @@ struct sh_mtu2_priv { | |||
43 | struct clock_event_device ced; | 43 | struct clock_event_device ced; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static DEFINE_SPINLOCK(sh_mtu2_lock); | 46 | static DEFINE_RAW_SPINLOCK(sh_mtu2_lock); |
47 | 47 | ||
48 | #define TSTR -1 /* shared register */ | 48 | #define TSTR -1 /* shared register */ |
49 | #define TCR 0 /* channel register */ | 49 | #define TCR 0 /* channel register */ |
@@ -107,7 +107,7 @@ static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start) | |||
107 | unsigned long flags, value; | 107 | unsigned long flags, value; |
108 | 108 | ||
109 | /* start stop register shared by multiple timer channels */ | 109 | /* start stop register shared by multiple timer channels */ |
110 | spin_lock_irqsave(&sh_mtu2_lock, flags); | 110 | raw_spin_lock_irqsave(&sh_mtu2_lock, flags); |
111 | value = sh_mtu2_read(p, TSTR); | 111 | value = sh_mtu2_read(p, TSTR); |
112 | 112 | ||
113 | if (start) | 113 | if (start) |
@@ -116,7 +116,7 @@ static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start) | |||
116 | value &= ~(1 << cfg->timer_bit); | 116 | value &= ~(1 << cfg->timer_bit); |
117 | 117 | ||
118 | sh_mtu2_write(p, TSTR, value); | 118 | sh_mtu2_write(p, TSTR, value); |
119 | spin_unlock_irqrestore(&sh_mtu2_lock, flags); | 119 | raw_spin_unlock_irqrestore(&sh_mtu2_lock, flags); |
120 | } | 120 | } |
121 | 121 | ||
122 | static int sh_mtu2_enable(struct sh_mtu2_priv *p) | 122 | static int sh_mtu2_enable(struct sh_mtu2_priv *p) |
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 97f54b634be4..c1b51d49d106 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c | |||
@@ -45,7 +45,7 @@ struct sh_tmu_priv { | |||
45 | struct clocksource cs; | 45 | struct clocksource cs; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static DEFINE_SPINLOCK(sh_tmu_lock); | 48 | static DEFINE_RAW_SPINLOCK(sh_tmu_lock); |
49 | 49 | ||
50 | #define TSTR -1 /* shared register */ | 50 | #define TSTR -1 /* shared register */ |
51 | #define TCOR 0 /* channel register */ | 51 | #define TCOR 0 /* channel register */ |
@@ -95,7 +95,7 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start) | |||
95 | unsigned long flags, value; | 95 | unsigned long flags, value; |
96 | 96 | ||
97 | /* start stop register shared by multiple timer channels */ | 97 | /* start stop register shared by multiple timer channels */ |
98 | spin_lock_irqsave(&sh_tmu_lock, flags); | 98 | raw_spin_lock_irqsave(&sh_tmu_lock, flags); |
99 | value = sh_tmu_read(p, TSTR); | 99 | value = sh_tmu_read(p, TSTR); |
100 | 100 | ||
101 | if (start) | 101 | if (start) |
@@ -104,7 +104,7 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start) | |||
104 | value &= ~(1 << cfg->timer_bit); | 104 | value &= ~(1 << cfg->timer_bit); |
105 | 105 | ||
106 | sh_tmu_write(p, TSTR, value); | 106 | sh_tmu_write(p, TSTR, value); |
107 | spin_unlock_irqrestore(&sh_tmu_lock, flags); | 107 | raw_spin_unlock_irqrestore(&sh_tmu_lock, flags); |
108 | } | 108 | } |
109 | 109 | ||
110 | static int sh_tmu_enable(struct sh_tmu_priv *p) | 110 | static int sh_tmu_enable(struct sh_tmu_priv *p) |
@@ -245,12 +245,7 @@ static void sh_tmu_clock_event_start(struct sh_tmu_priv *p, int periodic) | |||
245 | 245 | ||
246 | sh_tmu_enable(p); | 246 | sh_tmu_enable(p); |
247 | 247 | ||
248 | /* TODO: calculate good shift from rate and counter bit width */ | 248 | clockevents_config(ced, p->rate); |
249 | |||
250 | ced->shift = 32; | ||
251 | ced->mult = div_sc(p->rate, NSEC_PER_SEC, ced->shift); | ||
252 | ced->max_delta_ns = clockevent_delta2ns(0xffffffff, ced); | ||
253 | ced->min_delta_ns = 5000; | ||
254 | 249 | ||
255 | if (periodic) { | 250 | if (periodic) { |
256 | p->periodic = (p->rate + HZ/2) / HZ; | 251 | p->periodic = (p->rate + HZ/2) / HZ; |
@@ -323,7 +318,8 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p, | |||
323 | ced->set_mode = sh_tmu_clock_event_mode; | 318 | ced->set_mode = sh_tmu_clock_event_mode; |
324 | 319 | ||
325 | dev_info(&p->pdev->dev, "used for clock events\n"); | 320 | dev_info(&p->pdev->dev, "used for clock events\n"); |
326 | clockevents_register_device(ced); | 321 | |
322 | clockevents_config_and_register(ced, 1, 0x300, 0xffffffff); | ||
327 | 323 | ||
328 | ret = setup_irq(p->irqaction.irq, &p->irqaction); | 324 | ret = setup_irq(p->irqaction.irq, &p->irqaction); |
329 | if (ret) { | 325 | if (ret) { |
diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index 78a666d1e5f5..a76b689e553b 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig | |||
@@ -18,3 +18,6 @@ config CPU_IDLE_GOV_MENU | |||
18 | bool | 18 | bool |
19 | depends on CPU_IDLE && NO_HZ | 19 | depends on CPU_IDLE && NO_HZ |
20 | default y | 20 | default y |
21 | |||
22 | config ARCH_NEEDS_CPU_IDLE_COUPLED | ||
23 | def_bool n | ||
diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index 5634f88379df..38c8f69f30cf 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile | |||
@@ -3,3 +3,4 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y += cpuidle.o driver.o governor.o sysfs.o governors/ | 5 | obj-y += cpuidle.o driver.o governor.o sysfs.o governors/ |
6 | obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o | ||
diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c new file mode 100644 index 000000000000..2c9bf2692232 --- /dev/null +++ b/drivers/cpuidle/coupled.c | |||
@@ -0,0 +1,715 @@ | |||
1 | /* | ||
2 | * coupled.c - helper functions to enter the same idle state on multiple cpus | ||
3 | * | ||
4 | * Copyright (c) 2011 Google, Inc. | ||
5 | * | ||
6 | * Author: Colin Cross <ccross@android.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
16 | * more details. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/cpu.h> | ||
21 | #include <linux/cpuidle.h> | ||
22 | #include <linux/mutex.h> | ||
23 | #include <linux/sched.h> | ||
24 | #include <linux/slab.h> | ||
25 | #include <linux/spinlock.h> | ||
26 | |||
27 | #include "cpuidle.h" | ||
28 | |||
29 | /** | ||
30 | * DOC: Coupled cpuidle states | ||
31 | * | ||
32 | * On some ARM SMP SoCs (OMAP4460, Tegra 2, and probably more), the | ||
33 | * cpus cannot be independently powered down, either due to | ||
34 | * sequencing restrictions (on Tegra 2, cpu 0 must be the last to | ||
35 | * power down), or due to HW bugs (on OMAP4460, a cpu powering up | ||
36 | * will corrupt the gic state unless the other cpu runs a work | ||
37 | * around). Each cpu has a power state that it can enter without | ||
38 | * coordinating with the other cpu (usually Wait For Interrupt, or | ||
39 | * WFI), and one or more "coupled" power states that affect blocks | ||
40 | * shared between the cpus (L2 cache, interrupt controller, and | ||
41 | * sometimes the whole SoC). Entering a coupled power state must | ||
42 | * be tightly controlled on both cpus. | ||
43 | * | ||
44 | * This file implements a solution, where each cpu will wait in the | ||
45 | * WFI state until all cpus are ready to enter a coupled state, at | ||
46 | * which point the coupled state function will be called on all | ||
47 | * cpus at approximately the same time. | ||
48 | * | ||
49 | * Once all cpus are ready to enter idle, they are woken by an smp | ||
50 | * cross call. At this point, there is a chance that one of the | ||
51 | * cpus will find work to do, and choose not to enter idle. A | ||
52 | * final pass is needed to guarantee that all cpus will call the | ||
53 | * power state enter function at the same time. During this pass, | ||
54 | * each cpu will increment the ready counter, and continue once the | ||
55 | * ready counter matches the number of online coupled cpus. If any | ||
56 | * cpu exits idle, the other cpus will decrement their counter and | ||
57 | * retry. | ||
58 | * | ||
59 | * requested_state stores the deepest coupled idle state each cpu | ||
60 | * is ready for. It is assumed that the states are indexed from | ||
61 | * shallowest (highest power, lowest exit latency) to deepest | ||
62 | * (lowest power, highest exit latency). The requested_state | ||
63 | * variable is not locked. It is only written from the cpu that | ||
64 | * it stores (or by the on/offlining cpu if that cpu is offline), | ||
65 | * and only read after all the cpus are ready for the coupled idle | ||
66 | * state are are no longer updating it. | ||
67 | * | ||
68 | * Three atomic counters are used. alive_count tracks the number | ||
69 | * of cpus in the coupled set that are currently or soon will be | ||
70 | * online. waiting_count tracks the number of cpus that are in | ||
71 | * the waiting loop, in the ready loop, or in the coupled idle state. | ||
72 | * ready_count tracks the number of cpus that are in the ready loop | ||
73 | * or in the coupled idle state. | ||
74 | * | ||
75 | * To use coupled cpuidle states, a cpuidle driver must: | ||
76 | * | ||
77 | * Set struct cpuidle_device.coupled_cpus to the mask of all | ||
78 | * coupled cpus, usually the same as cpu_possible_mask if all cpus | ||
79 | * are part of the same cluster. The coupled_cpus mask must be | ||
80 | * set in the struct cpuidle_device for each cpu. | ||
81 | * | ||
82 | * Set struct cpuidle_device.safe_state to a state that is not a | ||
83 | * coupled state. This is usually WFI. | ||
84 | * | ||
85 | * Set CPUIDLE_FLAG_COUPLED in struct cpuidle_state.flags for each | ||
86 | * state that affects multiple cpus. | ||
87 | * | ||
88 | * Provide a struct cpuidle_state.enter function for each state | ||
89 | * that affects multiple cpus. This function is guaranteed to be | ||
90 | * called on all cpus at approximately the same time. The driver | ||
91 | * should ensure that the cpus all abort together if any cpu tries | ||
92 | * to abort once the function is called. The function should return | ||
93 | * with interrupts still disabled. | ||
94 | */ | ||
95 | |||
96 | /** | ||
97 | * struct cpuidle_coupled - data for set of cpus that share a coupled idle state | ||
98 | * @coupled_cpus: mask of cpus that are part of the coupled set | ||
99 | * @requested_state: array of requested states for cpus in the coupled set | ||
100 | * @ready_waiting_counts: combined count of cpus in ready or waiting loops | ||
101 | * @online_count: count of cpus that are online | ||
102 | * @refcnt: reference count of cpuidle devices that are using this struct | ||
103 | * @prevent: flag to prevent coupled idle while a cpu is hotplugging | ||
104 | */ | ||
105 | struct cpuidle_coupled { | ||
106 | cpumask_t coupled_cpus; | ||
107 | int requested_state[NR_CPUS]; | ||
108 | atomic_t ready_waiting_counts; | ||
109 | int online_count; | ||
110 | int refcnt; | ||
111 | int prevent; | ||
112 | }; | ||
113 | |||
114 | #define WAITING_BITS 16 | ||
115 | #define MAX_WAITING_CPUS (1 << WAITING_BITS) | ||
116 | #define WAITING_MASK (MAX_WAITING_CPUS - 1) | ||
117 | #define READY_MASK (~WAITING_MASK) | ||
118 | |||
119 | #define CPUIDLE_COUPLED_NOT_IDLE (-1) | ||
120 | |||
121 | static DEFINE_MUTEX(cpuidle_coupled_lock); | ||
122 | static DEFINE_PER_CPU(struct call_single_data, cpuidle_coupled_poke_cb); | ||
123 | |||
124 | /* | ||
125 | * The cpuidle_coupled_poked_mask mask is used to avoid calling | ||
126 | * __smp_call_function_single with the per cpu call_single_data struct already | ||
127 | * in use. This prevents a deadlock where two cpus are waiting for each others | ||
128 | * call_single_data struct to be available | ||
129 | */ | ||
130 | static cpumask_t cpuidle_coupled_poked_mask; | ||
131 | |||
132 | /** | ||
133 | * cpuidle_coupled_parallel_barrier - synchronize all online coupled cpus | ||
134 | * @dev: cpuidle_device of the calling cpu | ||
135 | * @a: atomic variable to hold the barrier | ||
136 | * | ||
137 | * No caller to this function will return from this function until all online | ||
138 | * cpus in the same coupled group have called this function. Once any caller | ||
139 | * has returned from this function, the barrier is immediately available for | ||
140 | * reuse. | ||
141 | * | ||
142 | * The atomic variable a must be initialized to 0 before any cpu calls | ||
143 | * this function, will be reset to 0 before any cpu returns from this function. | ||
144 | * | ||
145 | * Must only be called from within a coupled idle state handler | ||
146 | * (state.enter when state.flags has CPUIDLE_FLAG_COUPLED set). | ||
147 | * | ||
148 | * Provides full smp barrier semantics before and after calling. | ||
149 | */ | ||
150 | void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a) | ||
151 | { | ||
152 | int n = dev->coupled->online_count; | ||
153 | |||
154 | smp_mb__before_atomic_inc(); | ||
155 | atomic_inc(a); | ||
156 | |||
157 | while (atomic_read(a) < n) | ||
158 | cpu_relax(); | ||
159 | |||
160 | if (atomic_inc_return(a) == n * 2) { | ||
161 | atomic_set(a, 0); | ||
162 | return; | ||
163 | } | ||
164 | |||
165 | while (atomic_read(a) > n) | ||
166 | cpu_relax(); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * cpuidle_state_is_coupled - check if a state is part of a coupled set | ||
171 | * @dev: struct cpuidle_device for the current cpu | ||
172 | * @drv: struct cpuidle_driver for the platform | ||
173 | * @state: index of the target state in drv->states | ||
174 | * | ||
175 | * Returns true if the target state is coupled with cpus besides this one | ||
176 | */ | ||
177 | bool cpuidle_state_is_coupled(struct cpuidle_device *dev, | ||
178 | struct cpuidle_driver *drv, int state) | ||
179 | { | ||
180 | return drv->states[state].flags & CPUIDLE_FLAG_COUPLED; | ||
181 | } | ||
182 | |||
183 | /** | ||
184 | * cpuidle_coupled_set_ready - mark a cpu as ready | ||
185 | * @coupled: the struct coupled that contains the current cpu | ||
186 | */ | ||
187 | static inline void cpuidle_coupled_set_ready(struct cpuidle_coupled *coupled) | ||
188 | { | ||
189 | atomic_add(MAX_WAITING_CPUS, &coupled->ready_waiting_counts); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * cpuidle_coupled_set_not_ready - mark a cpu as not ready | ||
194 | * @coupled: the struct coupled that contains the current cpu | ||
195 | * | ||
196 | * Decrements the ready counter, unless the ready (and thus the waiting) counter | ||
197 | * is equal to the number of online cpus. Prevents a race where one cpu | ||
198 | * decrements the waiting counter and then re-increments it just before another | ||
199 | * cpu has decremented its ready counter, leading to the ready counter going | ||
200 | * down from the number of online cpus without going through the coupled idle | ||
201 | * state. | ||
202 | * | ||
203 | * Returns 0 if the counter was decremented successfully, -EINVAL if the ready | ||
204 | * counter was equal to the number of online cpus. | ||
205 | */ | ||
206 | static | ||
207 | inline int cpuidle_coupled_set_not_ready(struct cpuidle_coupled *coupled) | ||
208 | { | ||
209 | int all; | ||
210 | int ret; | ||
211 | |||
212 | all = coupled->online_count || (coupled->online_count << WAITING_BITS); | ||
213 | ret = atomic_add_unless(&coupled->ready_waiting_counts, | ||
214 | -MAX_WAITING_CPUS, all); | ||
215 | |||
216 | return ret ? 0 : -EINVAL; | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * cpuidle_coupled_no_cpus_ready - check if no cpus in a coupled set are ready | ||
221 | * @coupled: the struct coupled that contains the current cpu | ||
222 | * | ||
223 | * Returns true if all of the cpus in a coupled set are out of the ready loop. | ||
224 | */ | ||
225 | static inline int cpuidle_coupled_no_cpus_ready(struct cpuidle_coupled *coupled) | ||
226 | { | ||
227 | int r = atomic_read(&coupled->ready_waiting_counts) >> WAITING_BITS; | ||
228 | return r == 0; | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * cpuidle_coupled_cpus_ready - check if all cpus in a coupled set are ready | ||
233 | * @coupled: the struct coupled that contains the current cpu | ||
234 | * | ||
235 | * Returns true if all cpus coupled to this target state are in the ready loop | ||
236 | */ | ||
237 | static inline bool cpuidle_coupled_cpus_ready(struct cpuidle_coupled *coupled) | ||
238 | { | ||
239 | int r = atomic_read(&coupled->ready_waiting_counts) >> WAITING_BITS; | ||
240 | return r == coupled->online_count; | ||
241 | } | ||
242 | |||
243 | /** | ||
244 | * cpuidle_coupled_cpus_waiting - check if all cpus in a coupled set are waiting | ||
245 | * @coupled: the struct coupled that contains the current cpu | ||
246 | * | ||
247 | * Returns true if all cpus coupled to this target state are in the wait loop | ||
248 | */ | ||
249 | static inline bool cpuidle_coupled_cpus_waiting(struct cpuidle_coupled *coupled) | ||
250 | { | ||
251 | int w = atomic_read(&coupled->ready_waiting_counts) & WAITING_MASK; | ||
252 | return w == coupled->online_count; | ||
253 | } | ||
254 | |||
255 | /** | ||
256 | * cpuidle_coupled_no_cpus_waiting - check if no cpus in coupled set are waiting | ||
257 | * @coupled: the struct coupled that contains the current cpu | ||
258 | * | ||
259 | * Returns true if all of the cpus in a coupled set are out of the waiting loop. | ||
260 | */ | ||
261 | static inline int cpuidle_coupled_no_cpus_waiting(struct cpuidle_coupled *coupled) | ||
262 | { | ||
263 | int w = atomic_read(&coupled->ready_waiting_counts) & WAITING_MASK; | ||
264 | return w == 0; | ||
265 | } | ||
266 | |||
267 | /** | ||
268 | * cpuidle_coupled_get_state - determine the deepest idle state | ||
269 | * @dev: struct cpuidle_device for this cpu | ||
270 | * @coupled: the struct coupled that contains the current cpu | ||
271 | * | ||
272 | * Returns the deepest idle state that all coupled cpus can enter | ||
273 | */ | ||
274 | static inline int cpuidle_coupled_get_state(struct cpuidle_device *dev, | ||
275 | struct cpuidle_coupled *coupled) | ||
276 | { | ||
277 | int i; | ||
278 | int state = INT_MAX; | ||
279 | |||
280 | /* | ||
281 | * Read barrier ensures that read of requested_state is ordered after | ||
282 | * reads of ready_count. Matches the write barriers | ||
283 | * cpuidle_set_state_waiting. | ||
284 | */ | ||
285 | smp_rmb(); | ||
286 | |||
287 | for_each_cpu_mask(i, coupled->coupled_cpus) | ||
288 | if (cpu_online(i) && coupled->requested_state[i] < state) | ||
289 | state = coupled->requested_state[i]; | ||
290 | |||
291 | return state; | ||
292 | } | ||
293 | |||
294 | static void cpuidle_coupled_poked(void *info) | ||
295 | { | ||
296 | int cpu = (unsigned long)info; | ||
297 | cpumask_clear_cpu(cpu, &cpuidle_coupled_poked_mask); | ||
298 | } | ||
299 | |||
300 | /** | ||
301 | * cpuidle_coupled_poke - wake up a cpu that may be waiting | ||
302 | * @cpu: target cpu | ||
303 | * | ||
304 | * Ensures that the target cpu exits it's waiting idle state (if it is in it) | ||
305 | * and will see updates to waiting_count before it re-enters it's waiting idle | ||
306 | * state. | ||
307 | * | ||
308 | * If cpuidle_coupled_poked_mask is already set for the target cpu, that cpu | ||
309 | * either has or will soon have a pending IPI that will wake it out of idle, | ||
310 | * or it is currently processing the IPI and is not in idle. | ||
311 | */ | ||
312 | static void cpuidle_coupled_poke(int cpu) | ||
313 | { | ||
314 | struct call_single_data *csd = &per_cpu(cpuidle_coupled_poke_cb, cpu); | ||
315 | |||
316 | if (!cpumask_test_and_set_cpu(cpu, &cpuidle_coupled_poked_mask)) | ||
317 | __smp_call_function_single(cpu, csd, 0); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * cpuidle_coupled_poke_others - wake up all other cpus that may be waiting | ||
322 | * @dev: struct cpuidle_device for this cpu | ||
323 | * @coupled: the struct coupled that contains the current cpu | ||
324 | * | ||
325 | * Calls cpuidle_coupled_poke on all other online cpus. | ||
326 | */ | ||
327 | static void cpuidle_coupled_poke_others(int this_cpu, | ||
328 | struct cpuidle_coupled *coupled) | ||
329 | { | ||
330 | int cpu; | ||
331 | |||
332 | for_each_cpu_mask(cpu, coupled->coupled_cpus) | ||
333 | if (cpu != this_cpu && cpu_online(cpu)) | ||
334 | cpuidle_coupled_poke(cpu); | ||
335 | } | ||
336 | |||
337 | /** | ||
338 | * cpuidle_coupled_set_waiting - mark this cpu as in the wait loop | ||
339 | * @dev: struct cpuidle_device for this cpu | ||
340 | * @coupled: the struct coupled that contains the current cpu | ||
341 | * @next_state: the index in drv->states of the requested state for this cpu | ||
342 | * | ||
343 | * Updates the requested idle state for the specified cpuidle device, | ||
344 | * poking all coupled cpus out of idle if necessary to let them see the new | ||
345 | * state. | ||
346 | */ | ||
347 | static void cpuidle_coupled_set_waiting(int cpu, | ||
348 | struct cpuidle_coupled *coupled, int next_state) | ||
349 | { | ||
350 | int w; | ||
351 | |||
352 | coupled->requested_state[cpu] = next_state; | ||
353 | |||
354 | /* | ||
355 | * If this is the last cpu to enter the waiting state, poke | ||
356 | * all the other cpus out of their waiting state so they can | ||
357 | * enter a deeper state. This can race with one of the cpus | ||
358 | * exiting the waiting state due to an interrupt and | ||
359 | * decrementing waiting_count, see comment below. | ||
360 | * | ||
361 | * The atomic_inc_return provides a write barrier to order the write | ||
362 | * to requested_state with the later write that increments ready_count. | ||
363 | */ | ||
364 | w = atomic_inc_return(&coupled->ready_waiting_counts) & WAITING_MASK; | ||
365 | if (w == coupled->online_count) | ||
366 | cpuidle_coupled_poke_others(cpu, coupled); | ||
367 | } | ||
368 | |||
369 | /** | ||
370 | * cpuidle_coupled_set_not_waiting - mark this cpu as leaving the wait loop | ||
371 | * @dev: struct cpuidle_device for this cpu | ||
372 | * @coupled: the struct coupled that contains the current cpu | ||
373 | * | ||
374 | * Removes the requested idle state for the specified cpuidle device. | ||
375 | */ | ||
376 | static void cpuidle_coupled_set_not_waiting(int cpu, | ||
377 | struct cpuidle_coupled *coupled) | ||
378 | { | ||
379 | /* | ||
380 | * Decrementing waiting count can race with incrementing it in | ||
381 | * cpuidle_coupled_set_waiting, but that's OK. Worst case, some | ||
382 | * cpus will increment ready_count and then spin until they | ||
383 | * notice that this cpu has cleared it's requested_state. | ||
384 | */ | ||
385 | atomic_dec(&coupled->ready_waiting_counts); | ||
386 | |||
387 | coupled->requested_state[cpu] = CPUIDLE_COUPLED_NOT_IDLE; | ||
388 | } | ||
389 | |||
390 | /** | ||
391 | * cpuidle_coupled_set_done - mark this cpu as leaving the ready loop | ||
392 | * @cpu: the current cpu | ||
393 | * @coupled: the struct coupled that contains the current cpu | ||
394 | * | ||
395 | * Marks this cpu as no longer in the ready and waiting loops. Decrements | ||
396 | * the waiting count first to prevent another cpu looping back in and seeing | ||
397 | * this cpu as waiting just before it exits idle. | ||
398 | */ | ||
399 | static void cpuidle_coupled_set_done(int cpu, struct cpuidle_coupled *coupled) | ||
400 | { | ||
401 | cpuidle_coupled_set_not_waiting(cpu, coupled); | ||
402 | atomic_sub(MAX_WAITING_CPUS, &coupled->ready_waiting_counts); | ||
403 | } | ||
404 | |||
405 | /** | ||
406 | * cpuidle_coupled_clear_pokes - spin until the poke interrupt is processed | ||
407 | * @cpu - this cpu | ||
408 | * | ||
409 | * Turns on interrupts and spins until any outstanding poke interrupts have | ||
410 | * been processed and the poke bit has been cleared. | ||
411 | * | ||
412 | * Other interrupts may also be processed while interrupts are enabled, so | ||
413 | * need_resched() must be tested after turning interrupts off again to make sure | ||
414 | * the interrupt didn't schedule work that should take the cpu out of idle. | ||
415 | * | ||
416 | * Returns 0 if need_resched was false, -EINTR if need_resched was true. | ||
417 | */ | ||
418 | static int cpuidle_coupled_clear_pokes(int cpu) | ||
419 | { | ||
420 | local_irq_enable(); | ||
421 | while (cpumask_test_cpu(cpu, &cpuidle_coupled_poked_mask)) | ||
422 | cpu_relax(); | ||
423 | local_irq_disable(); | ||
424 | |||
425 | return need_resched() ? -EINTR : 0; | ||
426 | } | ||
427 | |||
428 | /** | ||
429 | * cpuidle_enter_state_coupled - attempt to enter a state with coupled cpus | ||
430 | * @dev: struct cpuidle_device for the current cpu | ||
431 | * @drv: struct cpuidle_driver for the platform | ||
432 | * @next_state: index of the requested state in drv->states | ||
433 | * | ||
434 | * Coordinate with coupled cpus to enter the target state. This is a two | ||
435 | * stage process. In the first stage, the cpus are operating independently, | ||
436 | * and may call into cpuidle_enter_state_coupled at completely different times. | ||
437 | * To save as much power as possible, the first cpus to call this function will | ||
438 | * go to an intermediate state (the cpuidle_device's safe state), and wait for | ||
439 | * all the other cpus to call this function. Once all coupled cpus are idle, | ||
440 | * the second stage will start. Each coupled cpu will spin until all cpus have | ||
441 | * guaranteed that they will call the target_state. | ||
442 | * | ||
443 | * This function must be called with interrupts disabled. It may enable | ||
444 | * interrupts while preparing for idle, and it will always return with | ||
445 | * interrupts enabled. | ||
446 | */ | ||
447 | int cpuidle_enter_state_coupled(struct cpuidle_device *dev, | ||
448 | struct cpuidle_driver *drv, int next_state) | ||
449 | { | ||
450 | int entered_state = -1; | ||
451 | struct cpuidle_coupled *coupled = dev->coupled; | ||
452 | |||
453 | if (!coupled) | ||
454 | return -EINVAL; | ||
455 | |||
456 | while (coupled->prevent) { | ||
457 | if (cpuidle_coupled_clear_pokes(dev->cpu)) { | ||
458 | local_irq_enable(); | ||
459 | return entered_state; | ||
460 | } | ||
461 | entered_state = cpuidle_enter_state(dev, drv, | ||
462 | dev->safe_state_index); | ||
463 | } | ||
464 | |||
465 | /* Read barrier ensures online_count is read after prevent is cleared */ | ||
466 | smp_rmb(); | ||
467 | |||
468 | cpuidle_coupled_set_waiting(dev->cpu, coupled, next_state); | ||
469 | |||
470 | retry: | ||
471 | /* | ||
472 | * Wait for all coupled cpus to be idle, using the deepest state | ||
473 | * allowed for a single cpu. | ||
474 | */ | ||
475 | while (!cpuidle_coupled_cpus_waiting(coupled)) { | ||
476 | if (cpuidle_coupled_clear_pokes(dev->cpu)) { | ||
477 | cpuidle_coupled_set_not_waiting(dev->cpu, coupled); | ||
478 | goto out; | ||
479 | } | ||
480 | |||
481 | if (coupled->prevent) { | ||
482 | cpuidle_coupled_set_not_waiting(dev->cpu, coupled); | ||
483 | goto out; | ||
484 | } | ||
485 | |||
486 | entered_state = cpuidle_enter_state(dev, drv, | ||
487 | dev->safe_state_index); | ||
488 | } | ||
489 | |||
490 | if (cpuidle_coupled_clear_pokes(dev->cpu)) { | ||
491 | cpuidle_coupled_set_not_waiting(dev->cpu, coupled); | ||
492 | goto out; | ||
493 | } | ||
494 | |||
495 | /* | ||
496 | * All coupled cpus are probably idle. There is a small chance that | ||
497 | * one of the other cpus just became active. Increment the ready count, | ||
498 | * and spin until all coupled cpus have incremented the counter. Once a | ||
499 | * cpu has incremented the ready counter, it cannot abort idle and must | ||
500 | * spin until either all cpus have incremented the ready counter, or | ||
501 | * another cpu leaves idle and decrements the waiting counter. | ||
502 | */ | ||
503 | |||
504 | cpuidle_coupled_set_ready(coupled); | ||
505 | while (!cpuidle_coupled_cpus_ready(coupled)) { | ||
506 | /* Check if any other cpus bailed out of idle. */ | ||
507 | if (!cpuidle_coupled_cpus_waiting(coupled)) | ||
508 | if (!cpuidle_coupled_set_not_ready(coupled)) | ||
509 | goto retry; | ||
510 | |||
511 | cpu_relax(); | ||
512 | } | ||
513 | |||
514 | /* all cpus have acked the coupled state */ | ||
515 | next_state = cpuidle_coupled_get_state(dev, coupled); | ||
516 | |||
517 | entered_state = cpuidle_enter_state(dev, drv, next_state); | ||
518 | |||
519 | cpuidle_coupled_set_done(dev->cpu, coupled); | ||
520 | |||
521 | out: | ||
522 | /* | ||
523 | * Normal cpuidle states are expected to return with irqs enabled. | ||
524 | * That leads to an inefficiency where a cpu receiving an interrupt | ||
525 | * that brings it out of idle will process that interrupt before | ||
526 | * exiting the idle enter function and decrementing ready_count. All | ||
527 | * other cpus will need to spin waiting for the cpu that is processing | ||
528 | * the interrupt. If the driver returns with interrupts disabled, | ||
529 | * all other cpus will loop back into the safe idle state instead of | ||
530 | * spinning, saving power. | ||
531 | * | ||
532 | * Calling local_irq_enable here allows coupled states to return with | ||
533 | * interrupts disabled, but won't cause problems for drivers that | ||
534 | * exit with interrupts enabled. | ||
535 | */ | ||
536 | local_irq_enable(); | ||
537 | |||
538 | /* | ||
539 | * Wait until all coupled cpus have exited idle. There is no risk that | ||
540 | * a cpu exits and re-enters the ready state because this cpu has | ||
541 | * already decremented its waiting_count. | ||
542 | */ | ||
543 | while (!cpuidle_coupled_no_cpus_ready(coupled)) | ||
544 | cpu_relax(); | ||
545 | |||
546 | return entered_state; | ||
547 | } | ||
548 | |||
549 | static void cpuidle_coupled_update_online_cpus(struct cpuidle_coupled *coupled) | ||
550 | { | ||
551 | cpumask_t cpus; | ||
552 | cpumask_and(&cpus, cpu_online_mask, &coupled->coupled_cpus); | ||
553 | coupled->online_count = cpumask_weight(&cpus); | ||
554 | } | ||
555 | |||
556 | /** | ||
557 | * cpuidle_coupled_register_device - register a coupled cpuidle device | ||
558 | * @dev: struct cpuidle_device for the current cpu | ||
559 | * | ||
560 | * Called from cpuidle_register_device to handle coupled idle init. Finds the | ||
561 | * cpuidle_coupled struct for this set of coupled cpus, or creates one if none | ||
562 | * exists yet. | ||
563 | */ | ||
564 | int cpuidle_coupled_register_device(struct cpuidle_device *dev) | ||
565 | { | ||
566 | int cpu; | ||
567 | struct cpuidle_device *other_dev; | ||
568 | struct call_single_data *csd; | ||
569 | struct cpuidle_coupled *coupled; | ||
570 | |||
571 | if (cpumask_empty(&dev->coupled_cpus)) | ||
572 | return 0; | ||
573 | |||
574 | for_each_cpu_mask(cpu, dev->coupled_cpus) { | ||
575 | other_dev = per_cpu(cpuidle_devices, cpu); | ||
576 | if (other_dev && other_dev->coupled) { | ||
577 | coupled = other_dev->coupled; | ||
578 | goto have_coupled; | ||
579 | } | ||
580 | } | ||
581 | |||
582 | /* No existing coupled info found, create a new one */ | ||
583 | coupled = kzalloc(sizeof(struct cpuidle_coupled), GFP_KERNEL); | ||
584 | if (!coupled) | ||
585 | return -ENOMEM; | ||
586 | |||
587 | coupled->coupled_cpus = dev->coupled_cpus; | ||
588 | |||
589 | have_coupled: | ||
590 | dev->coupled = coupled; | ||
591 | if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, &coupled->coupled_cpus))) | ||
592 | coupled->prevent++; | ||
593 | |||
594 | cpuidle_coupled_update_online_cpus(coupled); | ||
595 | |||
596 | coupled->refcnt++; | ||
597 | |||
598 | csd = &per_cpu(cpuidle_coupled_poke_cb, dev->cpu); | ||
599 | csd->func = cpuidle_coupled_poked; | ||
600 | csd->info = (void *)(unsigned long)dev->cpu; | ||
601 | |||
602 | return 0; | ||
603 | } | ||
604 | |||
605 | /** | ||
606 | * cpuidle_coupled_unregister_device - unregister a coupled cpuidle device | ||
607 | * @dev: struct cpuidle_device for the current cpu | ||
608 | * | ||
609 | * Called from cpuidle_unregister_device to tear down coupled idle. Removes the | ||
610 | * cpu from the coupled idle set, and frees the cpuidle_coupled_info struct if | ||
611 | * this was the last cpu in the set. | ||
612 | */ | ||
613 | void cpuidle_coupled_unregister_device(struct cpuidle_device *dev) | ||
614 | { | ||
615 | struct cpuidle_coupled *coupled = dev->coupled; | ||
616 | |||
617 | if (cpumask_empty(&dev->coupled_cpus)) | ||
618 | return; | ||
619 | |||
620 | if (--coupled->refcnt) | ||
621 | kfree(coupled); | ||
622 | dev->coupled = NULL; | ||
623 | } | ||
624 | |||
625 | /** | ||
626 | * cpuidle_coupled_prevent_idle - prevent cpus from entering a coupled state | ||
627 | * @coupled: the struct coupled that contains the cpu that is changing state | ||
628 | * | ||
629 | * Disables coupled cpuidle on a coupled set of cpus. Used to ensure that | ||
630 | * cpu_online_mask doesn't change while cpus are coordinating coupled idle. | ||
631 | */ | ||
632 | static void cpuidle_coupled_prevent_idle(struct cpuidle_coupled *coupled) | ||
633 | { | ||
634 | int cpu = get_cpu(); | ||
635 | |||
636 | /* Force all cpus out of the waiting loop. */ | ||
637 | coupled->prevent++; | ||
638 | cpuidle_coupled_poke_others(cpu, coupled); | ||
639 | put_cpu(); | ||
640 | while (!cpuidle_coupled_no_cpus_waiting(coupled)) | ||
641 | cpu_relax(); | ||
642 | } | ||
643 | |||
644 | /** | ||
645 | * cpuidle_coupled_allow_idle - allows cpus to enter a coupled state | ||
646 | * @coupled: the struct coupled that contains the cpu that is changing state | ||
647 | * | ||
648 | * Enables coupled cpuidle on a coupled set of cpus. Used to ensure that | ||
649 | * cpu_online_mask doesn't change while cpus are coordinating coupled idle. | ||
650 | */ | ||
651 | static void cpuidle_coupled_allow_idle(struct cpuidle_coupled *coupled) | ||
652 | { | ||
653 | int cpu = get_cpu(); | ||
654 | |||
655 | /* | ||
656 | * Write barrier ensures readers see the new online_count when they | ||
657 | * see prevent == 0. | ||
658 | */ | ||
659 | smp_wmb(); | ||
660 | coupled->prevent--; | ||
661 | /* Force cpus out of the prevent loop. */ | ||
662 | cpuidle_coupled_poke_others(cpu, coupled); | ||
663 | put_cpu(); | ||
664 | } | ||
665 | |||
666 | /** | ||
667 | * cpuidle_coupled_cpu_notify - notifier called during hotplug transitions | ||
668 | * @nb: notifier block | ||
669 | * @action: hotplug transition | ||
670 | * @hcpu: target cpu number | ||
671 | * | ||
672 | * Called when a cpu is brought on or offline using hotplug. Updates the | ||
673 | * coupled cpu set appropriately | ||
674 | */ | ||
675 | static int cpuidle_coupled_cpu_notify(struct notifier_block *nb, | ||
676 | unsigned long action, void *hcpu) | ||
677 | { | ||
678 | int cpu = (unsigned long)hcpu; | ||
679 | struct cpuidle_device *dev; | ||
680 | |||
681 | mutex_lock(&cpuidle_lock); | ||
682 | |||
683 | dev = per_cpu(cpuidle_devices, cpu); | ||
684 | if (!dev->coupled) | ||
685 | goto out; | ||
686 | |||
687 | switch (action & ~CPU_TASKS_FROZEN) { | ||
688 | case CPU_UP_PREPARE: | ||
689 | case CPU_DOWN_PREPARE: | ||
690 | cpuidle_coupled_prevent_idle(dev->coupled); | ||
691 | break; | ||
692 | case CPU_ONLINE: | ||
693 | case CPU_DEAD: | ||
694 | cpuidle_coupled_update_online_cpus(dev->coupled); | ||
695 | /* Fall through */ | ||
696 | case CPU_UP_CANCELED: | ||
697 | case CPU_DOWN_FAILED: | ||
698 | cpuidle_coupled_allow_idle(dev->coupled); | ||
699 | break; | ||
700 | } | ||
701 | |||
702 | out: | ||
703 | mutex_unlock(&cpuidle_lock); | ||
704 | return NOTIFY_OK; | ||
705 | } | ||
706 | |||
707 | static struct notifier_block cpuidle_coupled_cpu_notifier = { | ||
708 | .notifier_call = cpuidle_coupled_cpu_notify, | ||
709 | }; | ||
710 | |||
711 | static int __init cpuidle_coupled_init(void) | ||
712 | { | ||
713 | return register_cpu_notifier(&cpuidle_coupled_cpu_notifier); | ||
714 | } | ||
715 | core_initcall(cpuidle_coupled_init); | ||
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index d90519cec880..bb4e827434ce 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -92,6 +92,34 @@ int cpuidle_play_dead(void) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * cpuidle_enter_state - enter the state and update stats | ||
96 | * @dev: cpuidle device for this cpu | ||
97 | * @drv: cpuidle driver for this cpu | ||
98 | * @next_state: index into drv->states of the state to enter | ||
99 | */ | ||
100 | int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, | ||
101 | int next_state) | ||
102 | { | ||
103 | int entered_state; | ||
104 | |||
105 | entered_state = cpuidle_enter_ops(dev, drv, next_state); | ||
106 | |||
107 | if (entered_state >= 0) { | ||
108 | /* Update cpuidle counters */ | ||
109 | /* This can be moved to within driver enter routine | ||
110 | * but that results in multiple copies of same code. | ||
111 | */ | ||
112 | dev->states_usage[entered_state].time += | ||
113 | (unsigned long long)dev->last_residency; | ||
114 | dev->states_usage[entered_state].usage++; | ||
115 | } else { | ||
116 | dev->last_residency = 0; | ||
117 | } | ||
118 | |||
119 | return entered_state; | ||
120 | } | ||
121 | |||
122 | /** | ||
95 | * cpuidle_idle_call - the main idle loop | 123 | * cpuidle_idle_call - the main idle loop |
96 | * | 124 | * |
97 | * NOTE: no locks or semaphores should be used here | 125 | * NOTE: no locks or semaphores should be used here |
@@ -113,15 +141,6 @@ int cpuidle_idle_call(void) | |||
113 | if (!dev || !dev->enabled) | 141 | if (!dev || !dev->enabled) |
114 | return -EBUSY; | 142 | return -EBUSY; |
115 | 143 | ||
116 | #if 0 | ||
117 | /* shows regressions, re-enable for 2.6.29 */ | ||
118 | /* | ||
119 | * run any timers that can be run now, at this point | ||
120 | * before calculating the idle duration etc. | ||
121 | */ | ||
122 | hrtimer_peek_ahead_timers(); | ||
123 | #endif | ||
124 | |||
125 | /* ask the governor for the next state */ | 144 | /* ask the governor for the next state */ |
126 | next_state = cpuidle_curr_governor->select(drv, dev); | 145 | next_state = cpuidle_curr_governor->select(drv, dev); |
127 | if (need_resched()) { | 146 | if (need_resched()) { |
@@ -132,23 +151,15 @@ int cpuidle_idle_call(void) | |||
132 | trace_power_start_rcuidle(POWER_CSTATE, next_state, dev->cpu); | 151 | trace_power_start_rcuidle(POWER_CSTATE, next_state, dev->cpu); |
133 | trace_cpu_idle_rcuidle(next_state, dev->cpu); | 152 | trace_cpu_idle_rcuidle(next_state, dev->cpu); |
134 | 153 | ||
135 | entered_state = cpuidle_enter_ops(dev, drv, next_state); | 154 | if (cpuidle_state_is_coupled(dev, drv, next_state)) |
155 | entered_state = cpuidle_enter_state_coupled(dev, drv, | ||
156 | next_state); | ||
157 | else | ||
158 | entered_state = cpuidle_enter_state(dev, drv, next_state); | ||
136 | 159 | ||
137 | trace_power_end_rcuidle(dev->cpu); | 160 | trace_power_end_rcuidle(dev->cpu); |
138 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); | 161 | trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); |
139 | 162 | ||
140 | if (entered_state >= 0) { | ||
141 | /* Update cpuidle counters */ | ||
142 | /* This can be moved to within driver enter routine | ||
143 | * but that results in multiple copies of same code. | ||
144 | */ | ||
145 | dev->states_usage[entered_state].time += | ||
146 | (unsigned long long)dev->last_residency; | ||
147 | dev->states_usage[entered_state].usage++; | ||
148 | } else { | ||
149 | dev->last_residency = 0; | ||
150 | } | ||
151 | |||
152 | /* give the governor an opportunity to reflect on the outcome */ | 163 | /* give the governor an opportunity to reflect on the outcome */ |
153 | if (cpuidle_curr_governor->reflect) | 164 | if (cpuidle_curr_governor->reflect) |
154 | cpuidle_curr_governor->reflect(dev, entered_state); | 165 | cpuidle_curr_governor->reflect(dev, entered_state); |
@@ -283,6 +294,9 @@ int cpuidle_enable_device(struct cpuidle_device *dev) | |||
283 | int ret, i; | 294 | int ret, i; |
284 | struct cpuidle_driver *drv = cpuidle_get_driver(); | 295 | struct cpuidle_driver *drv = cpuidle_get_driver(); |
285 | 296 | ||
297 | if (!dev) | ||
298 | return -EINVAL; | ||
299 | |||
286 | if (dev->enabled) | 300 | if (dev->enabled) |
287 | return 0; | 301 | return 0; |
288 | if (!drv || !cpuidle_curr_governor) | 302 | if (!drv || !cpuidle_curr_governor) |
@@ -367,8 +381,6 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) | |||
367 | struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); | 381 | struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); |
368 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); | 382 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); |
369 | 383 | ||
370 | if (!dev) | ||
371 | return -EINVAL; | ||
372 | if (!try_module_get(cpuidle_driver->owner)) | 384 | if (!try_module_get(cpuidle_driver->owner)) |
373 | return -EINVAL; | 385 | return -EINVAL; |
374 | 386 | ||
@@ -376,13 +388,25 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) | |||
376 | 388 | ||
377 | per_cpu(cpuidle_devices, dev->cpu) = dev; | 389 | per_cpu(cpuidle_devices, dev->cpu) = dev; |
378 | list_add(&dev->device_list, &cpuidle_detected_devices); | 390 | list_add(&dev->device_list, &cpuidle_detected_devices); |
379 | if ((ret = cpuidle_add_sysfs(cpu_dev))) { | 391 | ret = cpuidle_add_sysfs(cpu_dev); |
380 | module_put(cpuidle_driver->owner); | 392 | if (ret) |
381 | return ret; | 393 | goto err_sysfs; |
382 | } | 394 | |
395 | ret = cpuidle_coupled_register_device(dev); | ||
396 | if (ret) | ||
397 | goto err_coupled; | ||
383 | 398 | ||
384 | dev->registered = 1; | 399 | dev->registered = 1; |
385 | return 0; | 400 | return 0; |
401 | |||
402 | err_coupled: | ||
403 | cpuidle_remove_sysfs(cpu_dev); | ||
404 | wait_for_completion(&dev->kobj_unregister); | ||
405 | err_sysfs: | ||
406 | list_del(&dev->device_list); | ||
407 | per_cpu(cpuidle_devices, dev->cpu) = NULL; | ||
408 | module_put(cpuidle_driver->owner); | ||
409 | return ret; | ||
386 | } | 410 | } |
387 | 411 | ||
388 | /** | 412 | /** |
@@ -393,6 +417,9 @@ int cpuidle_register_device(struct cpuidle_device *dev) | |||
393 | { | 417 | { |
394 | int ret; | 418 | int ret; |
395 | 419 | ||
420 | if (!dev) | ||
421 | return -EINVAL; | ||
422 | |||
396 | mutex_lock(&cpuidle_lock); | 423 | mutex_lock(&cpuidle_lock); |
397 | 424 | ||
398 | if ((ret = __cpuidle_register_device(dev))) { | 425 | if ((ret = __cpuidle_register_device(dev))) { |
@@ -432,6 +459,8 @@ void cpuidle_unregister_device(struct cpuidle_device *dev) | |||
432 | wait_for_completion(&dev->kobj_unregister); | 459 | wait_for_completion(&dev->kobj_unregister); |
433 | per_cpu(cpuidle_devices, dev->cpu) = NULL; | 460 | per_cpu(cpuidle_devices, dev->cpu) = NULL; |
434 | 461 | ||
462 | cpuidle_coupled_unregister_device(dev); | ||
463 | |||
435 | cpuidle_resume_and_unlock(); | 464 | cpuidle_resume_and_unlock(); |
436 | 465 | ||
437 | module_put(cpuidle_driver->owner); | 466 | module_put(cpuidle_driver->owner); |
diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h index 7db186685c27..76e7f696ad8c 100644 --- a/drivers/cpuidle/cpuidle.h +++ b/drivers/cpuidle/cpuidle.h | |||
@@ -14,6 +14,8 @@ extern struct list_head cpuidle_detected_devices; | |||
14 | extern struct mutex cpuidle_lock; | 14 | extern struct mutex cpuidle_lock; |
15 | extern spinlock_t cpuidle_driver_lock; | 15 | extern spinlock_t cpuidle_driver_lock; |
16 | extern int cpuidle_disabled(void); | 16 | extern int cpuidle_disabled(void); |
17 | extern int cpuidle_enter_state(struct cpuidle_device *dev, | ||
18 | struct cpuidle_driver *drv, int next_state); | ||
17 | 19 | ||
18 | /* idle loop */ | 20 | /* idle loop */ |
19 | extern void cpuidle_install_idle_handler(void); | 21 | extern void cpuidle_install_idle_handler(void); |
@@ -30,4 +32,34 @@ extern void cpuidle_remove_state_sysfs(struct cpuidle_device *device); | |||
30 | extern int cpuidle_add_sysfs(struct device *dev); | 32 | extern int cpuidle_add_sysfs(struct device *dev); |
31 | extern void cpuidle_remove_sysfs(struct device *dev); | 33 | extern void cpuidle_remove_sysfs(struct device *dev); |
32 | 34 | ||
35 | #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED | ||
36 | bool cpuidle_state_is_coupled(struct cpuidle_device *dev, | ||
37 | struct cpuidle_driver *drv, int state); | ||
38 | int cpuidle_enter_state_coupled(struct cpuidle_device *dev, | ||
39 | struct cpuidle_driver *drv, int next_state); | ||
40 | int cpuidle_coupled_register_device(struct cpuidle_device *dev); | ||
41 | void cpuidle_coupled_unregister_device(struct cpuidle_device *dev); | ||
42 | #else | ||
43 | static inline bool cpuidle_state_is_coupled(struct cpuidle_device *dev, | ||
44 | struct cpuidle_driver *drv, int state) | ||
45 | { | ||
46 | return false; | ||
47 | } | ||
48 | |||
49 | static inline int cpuidle_enter_state_coupled(struct cpuidle_device *dev, | ||
50 | struct cpuidle_driver *drv, int next_state) | ||
51 | { | ||
52 | return -1; | ||
53 | } | ||
54 | |||
55 | static inline int cpuidle_coupled_register_device(struct cpuidle_device *dev) | ||
56 | { | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | static inline void cpuidle_coupled_unregister_device(struct cpuidle_device *dev) | ||
61 | { | ||
62 | } | ||
63 | #endif | ||
64 | |||
33 | #endif /* __DRIVER_CPUIDLE_H */ | 65 | #endif /* __DRIVER_CPUIDLE_H */ |
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/edac/edac_mc.c b/drivers/edac/edac_mc.c index 10f375032e96..de5ba86e8b89 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -164,7 +164,7 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems) | |||
164 | else | 164 | else |
165 | return (char *)ptr; | 165 | return (char *)ptr; |
166 | 166 | ||
167 | r = size % align; | 167 | r = (unsigned long)p % align; |
168 | 168 | ||
169 | if (r == 0) | 169 | if (r == 0) |
170 | return (char *)ptr; | 170 | return (char *)ptr; |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index d27778f65a5d..a499c7ed820a 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1814,12 +1814,6 @@ static int i7core_mce_check_error(struct notifier_block *nb, unsigned long val, | |||
1814 | if (mce->bank != 8) | 1814 | if (mce->bank != 8) |
1815 | return NOTIFY_DONE; | 1815 | return NOTIFY_DONE; |
1816 | 1816 | ||
1817 | #ifdef CONFIG_SMP | ||
1818 | /* Only handle if it is the right mc controller */ | ||
1819 | if (mce->socketid != pvt->i7core_dev->socket) | ||
1820 | return NOTIFY_DONE; | ||
1821 | #endif | ||
1822 | |||
1823 | smp_rmb(); | 1817 | smp_rmb(); |
1824 | if ((pvt->mce_out + 1) % MCE_LOG_LEN == pvt->mce_in) { | 1818 | if ((pvt->mce_out + 1) % MCE_LOG_LEN == pvt->mce_in) { |
1825 | smp_wmb(); | 1819 | smp_wmb(); |
@@ -2116,8 +2110,6 @@ static void i7core_unregister_mci(struct i7core_dev *i7core_dev) | |||
2116 | if (pvt->enable_scrub) | 2110 | if (pvt->enable_scrub) |
2117 | disable_sdram_scrub_setting(mci); | 2111 | disable_sdram_scrub_setting(mci); |
2118 | 2112 | ||
2119 | mce_unregister_decode_chain(&i7_mce_dec); | ||
2120 | |||
2121 | /* Disable EDAC polling */ | 2113 | /* Disable EDAC polling */ |
2122 | i7core_pci_ctl_release(pvt); | 2114 | i7core_pci_ctl_release(pvt); |
2123 | 2115 | ||
@@ -2222,8 +2214,6 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev) | |||
2222 | /* DCLK for scrub rate setting */ | 2214 | /* DCLK for scrub rate setting */ |
2223 | pvt->dclk_freq = get_dclk_freq(); | 2215 | pvt->dclk_freq = get_dclk_freq(); |
2224 | 2216 | ||
2225 | mce_register_decode_chain(&i7_mce_dec); | ||
2226 | |||
2227 | return 0; | 2217 | return 0; |
2228 | 2218 | ||
2229 | fail0: | 2219 | fail0: |
@@ -2367,8 +2357,10 @@ static int __init i7core_init(void) | |||
2367 | 2357 | ||
2368 | pci_rc = pci_register_driver(&i7core_driver); | 2358 | pci_rc = pci_register_driver(&i7core_driver); |
2369 | 2359 | ||
2370 | if (pci_rc >= 0) | 2360 | if (pci_rc >= 0) { |
2361 | mce_register_decode_chain(&i7_mce_dec); | ||
2371 | return 0; | 2362 | return 0; |
2363 | } | ||
2372 | 2364 | ||
2373 | i7core_printk(KERN_ERR, "Failed to register device with error %d.\n", | 2365 | i7core_printk(KERN_ERR, "Failed to register device with error %d.\n", |
2374 | pci_rc); | 2366 | pci_rc); |
@@ -2384,6 +2376,7 @@ static void __exit i7core_exit(void) | |||
2384 | { | 2376 | { |
2385 | debugf2("MC: " __FILE__ ": %s()\n", __func__); | 2377 | debugf2("MC: " __FILE__ ": %s()\n", __func__); |
2386 | pci_unregister_driver(&i7core_driver); | 2378 | pci_unregister_driver(&i7core_driver); |
2379 | mce_unregister_decode_chain(&i7_mce_dec); | ||
2387 | } | 2380 | } |
2388 | 2381 | ||
2389 | module_init(i7core_init); | 2382 | module_init(i7core_init); |
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 4c402353ba98..0e374625f6f8 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c | |||
@@ -980,7 +980,8 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op) | |||
980 | layers[1].type = EDAC_MC_LAYER_CHANNEL; | 980 | layers[1].type = EDAC_MC_LAYER_CHANNEL; |
981 | layers[1].size = 1; | 981 | layers[1].size = 1; |
982 | layers[1].is_virt_csrow = false; | 982 | layers[1].is_virt_csrow = false; |
983 | mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), sizeof(*pdata)); | 983 | mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers, |
984 | sizeof(*pdata)); | ||
984 | if (!mci) { | 985 | if (!mci) { |
985 | devres_release_group(&op->dev, mpc85xx_mc_err_probe); | 986 | devres_release_group(&op->dev, mpc85xx_mc_err_probe); |
986 | return -ENOMEM; | 987 | return -ENOMEM; |
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 4adaf4b7da99..36ad17e79d61 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -555,7 +555,7 @@ static int get_dimm_config(struct mem_ctl_info *mci) | |||
555 | pvt->is_close_pg = false; | 555 | pvt->is_close_pg = false; |
556 | } | 556 | } |
557 | 557 | ||
558 | pci_read_config_dword(pvt->pci_ta, RANK_CFG_A, ®); | 558 | pci_read_config_dword(pvt->pci_ddrio, RANK_CFG_A, ®); |
559 | if (IS_RDIMM_ENABLED(reg)) { | 559 | if (IS_RDIMM_ENABLED(reg)) { |
560 | /* FIXME: Can also be LRDIMM */ | 560 | /* FIXME: Can also be LRDIMM */ |
561 | debugf0("Memory is registered\n"); | 561 | debugf0("Memory is registered\n"); |
@@ -1604,8 +1604,6 @@ static void sbridge_unregister_mci(struct sbridge_dev *sbridge_dev) | |||
1604 | debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\n", | 1604 | debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\n", |
1605 | __func__, mci, &sbridge_dev->pdev[0]->dev); | 1605 | __func__, mci, &sbridge_dev->pdev[0]->dev); |
1606 | 1606 | ||
1607 | mce_unregister_decode_chain(&sbridge_mce_dec); | ||
1608 | |||
1609 | /* Remove MC sysfs nodes */ | 1607 | /* Remove MC sysfs nodes */ |
1610 | edac_mc_del_mc(mci->dev); | 1608 | edac_mc_del_mc(mci->dev); |
1611 | 1609 | ||
@@ -1682,7 +1680,6 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev) | |||
1682 | goto fail0; | 1680 | goto fail0; |
1683 | } | 1681 | } |
1684 | 1682 | ||
1685 | mce_register_decode_chain(&sbridge_mce_dec); | ||
1686 | return 0; | 1683 | return 0; |
1687 | 1684 | ||
1688 | fail0: | 1685 | fail0: |
@@ -1811,8 +1808,10 @@ static int __init sbridge_init(void) | |||
1811 | 1808 | ||
1812 | pci_rc = pci_register_driver(&sbridge_driver); | 1809 | pci_rc = pci_register_driver(&sbridge_driver); |
1813 | 1810 | ||
1814 | if (pci_rc >= 0) | 1811 | if (pci_rc >= 0) { |
1812 | mce_register_decode_chain(&sbridge_mce_dec); | ||
1815 | return 0; | 1813 | return 0; |
1814 | } | ||
1816 | 1815 | ||
1817 | sbridge_printk(KERN_ERR, "Failed to register device with error %d.\n", | 1816 | sbridge_printk(KERN_ERR, "Failed to register device with error %d.\n", |
1818 | pci_rc); | 1817 | pci_rc); |
@@ -1828,6 +1827,7 @@ static void __exit sbridge_exit(void) | |||
1828 | { | 1827 | { |
1829 | debugf2("MC: " __FILE__ ": %s()\n", __func__); | 1828 | debugf2("MC: " __FILE__ ": %s()\n", __func__); |
1830 | pci_unregister_driver(&sbridge_driver); | 1829 | pci_unregister_driver(&sbridge_driver); |
1830 | mce_unregister_decode_chain(&sbridge_mce_dec); | ||
1831 | } | 1831 | } |
1832 | 1832 | ||
1833 | module_init(sbridge_init); | 1833 | module_init(sbridge_init); |
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/gpio/Kconfig b/drivers/gpio/Kconfig index c4067d0141f7..542f0c04b695 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -136,7 +136,7 @@ config GPIO_MPC8XXX | |||
136 | 136 | ||
137 | config GPIO_MSM_V1 | 137 | config GPIO_MSM_V1 |
138 | tristate "Qualcomm MSM GPIO v1" | 138 | tristate "Qualcomm MSM GPIO v1" |
139 | depends on GPIOLIB && ARCH_MSM | 139 | depends on GPIOLIB && ARCH_MSM && (ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50) |
140 | help | 140 | help |
141 | Say yes here to support the GPIO interface on ARM v6 based | 141 | Say yes here to support the GPIO interface on ARM v6 based |
142 | Qualcomm MSM chips. Most of the pins on the MSM can be | 142 | Qualcomm MSM chips. Most of the pins on the MSM can be |
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c index 9e9947cb86a3..1077754f8289 100644 --- a/drivers/gpio/devres.c +++ b/drivers/gpio/devres.c | |||
@@ -98,6 +98,7 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio, | |||
98 | 98 | ||
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
101 | EXPORT_SYMBOL(devm_gpio_request_one); | ||
101 | 102 | ||
102 | /** | 103 | /** |
103 | * devm_gpio_free - free an interrupt | 104 | * devm_gpio_free - free an interrupt |
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index c337143b18f8..c89c4c1e668d 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c | |||
@@ -398,10 +398,12 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev) | |||
398 | writel(~0, port->base + GPIO_ISR); | 398 | writel(~0, port->base + GPIO_ISR); |
399 | 399 | ||
400 | if (mxc_gpio_hwtype == IMX21_GPIO) { | 400 | if (mxc_gpio_hwtype == IMX21_GPIO) { |
401 | /* setup one handler for all GPIO interrupts */ | 401 | /* |
402 | if (pdev->id == 0) | 402 | * Setup one handler for all GPIO interrupts. Actually setting |
403 | irq_set_chained_handler(port->irq, | 403 | * the handler is needed only once, but doing it for every port |
404 | mx2_gpio_irq_handler); | 404 | * is more robust and easier. |
405 | */ | ||
406 | irq_set_chained_handler(port->irq, mx2_gpio_irq_handler); | ||
405 | } else { | 407 | } else { |
406 | /* setup one handler for each entry */ | 408 | /* setup one handler for each entry */ |
407 | irq_set_chained_handler(port->irq, mx3_gpio_irq_handler); | 409 | irq_set_chained_handler(port->irq, mx3_gpio_irq_handler); |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index c4ed1722734c..4fbc208c32cf 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -174,12 +174,22 @@ static inline void _gpio_dbck_enable(struct gpio_bank *bank) | |||
174 | if (bank->dbck_enable_mask && !bank->dbck_enabled) { | 174 | if (bank->dbck_enable_mask && !bank->dbck_enabled) { |
175 | clk_enable(bank->dbck); | 175 | clk_enable(bank->dbck); |
176 | bank->dbck_enabled = true; | 176 | bank->dbck_enabled = true; |
177 | |||
178 | __raw_writel(bank->dbck_enable_mask, | ||
179 | bank->base + bank->regs->debounce_en); | ||
177 | } | 180 | } |
178 | } | 181 | } |
179 | 182 | ||
180 | static inline void _gpio_dbck_disable(struct gpio_bank *bank) | 183 | static inline void _gpio_dbck_disable(struct gpio_bank *bank) |
181 | { | 184 | { |
182 | if (bank->dbck_enable_mask && bank->dbck_enabled) { | 185 | if (bank->dbck_enable_mask && bank->dbck_enabled) { |
186 | /* | ||
187 | * Disable debounce before cutting it's clock. If debounce is | ||
188 | * enabled but the clock is not, GPIO module seems to be unable | ||
189 | * to detect events and generate interrupts at least on OMAP3. | ||
190 | */ | ||
191 | __raw_writel(0, bank->base + bank->regs->debounce_en); | ||
192 | |||
183 | clk_disable(bank->dbck); | 193 | clk_disable(bank->dbck); |
184 | bank->dbck_enabled = false; | 194 | bank->dbck_enabled = false; |
185 | } | 195 | } |
@@ -1081,7 +1091,6 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) | |||
1081 | bank->is_mpuio = pdata->is_mpuio; | 1091 | bank->is_mpuio = pdata->is_mpuio; |
1082 | bank->non_wakeup_gpios = pdata->non_wakeup_gpios; | 1092 | bank->non_wakeup_gpios = pdata->non_wakeup_gpios; |
1083 | bank->loses_context = pdata->loses_context; | 1093 | bank->loses_context = pdata->loses_context; |
1084 | bank->get_context_loss_count = pdata->get_context_loss_count; | ||
1085 | bank->regs = pdata->regs; | 1094 | bank->regs = pdata->regs; |
1086 | #ifdef CONFIG_OF_GPIO | 1095 | #ifdef CONFIG_OF_GPIO |
1087 | bank->chip.of_node = of_node_get(node); | 1096 | bank->chip.of_node = of_node_get(node); |
@@ -1135,6 +1144,9 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) | |||
1135 | omap_gpio_chip_init(bank); | 1144 | omap_gpio_chip_init(bank); |
1136 | omap_gpio_show_rev(bank); | 1145 | omap_gpio_show_rev(bank); |
1137 | 1146 | ||
1147 | if (bank->loses_context) | ||
1148 | bank->get_context_loss_count = pdata->get_context_loss_count; | ||
1149 | |||
1138 | pm_runtime_put(bank->dev); | 1150 | pm_runtime_put(bank->dev); |
1139 | 1151 | ||
1140 | list_add_tail(&bank->node, &omap_gpio_list); | 1152 | list_add_tail(&bank->node, &omap_gpio_list); |
diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c index 38416be8ba11..6064fb376e11 100644 --- a/drivers/gpio/gpio-sta2x11.c +++ b/drivers/gpio/gpio-sta2x11.c | |||
@@ -383,8 +383,9 @@ static int __devinit gsta_probe(struct platform_device *dev) | |||
383 | } | 383 | } |
384 | spin_lock_init(&chip->lock); | 384 | spin_lock_init(&chip->lock); |
385 | gsta_gpio_setup(chip); | 385 | gsta_gpio_setup(chip); |
386 | for (i = 0; i < GSTA_NR_GPIO; i++) | 386 | if (gpio_pdata) |
387 | gsta_set_config(chip, i, gpio_pdata->pinconfig[i]); | 387 | for (i = 0; i < GSTA_NR_GPIO; i++) |
388 | gsta_set_config(chip, i, gpio_pdata->pinconfig[i]); | ||
388 | 389 | ||
389 | /* 384 was used in previous code: be compatible for other drivers */ | 390 | /* 384 was used in previous code: be compatible for other drivers */ |
390 | err = irq_alloc_descs(-1, 384, GSTA_NR_GPIO, NUMA_NO_NODE); | 391 | err = irq_alloc_descs(-1, 384, GSTA_NR_GPIO, NUMA_NO_NODE); |
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c index c1ad2884f2ed..11f29c82253c 100644 --- a/drivers/gpio/gpio-tps65910.c +++ b/drivers/gpio/gpio-tps65910.c | |||
@@ -149,6 +149,9 @@ static int __devinit tps65910_gpio_probe(struct platform_device *pdev) | |||
149 | tps65910_gpio->gpio_chip.set = tps65910_gpio_set; | 149 | tps65910_gpio->gpio_chip.set = tps65910_gpio_set; |
150 | tps65910_gpio->gpio_chip.get = tps65910_gpio_get; | 150 | tps65910_gpio->gpio_chip.get = tps65910_gpio_get; |
151 | tps65910_gpio->gpio_chip.dev = &pdev->dev; | 151 | tps65910_gpio->gpio_chip.dev = &pdev->dev; |
152 | #ifdef CONFIG_OF_GPIO | ||
153 | tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node; | ||
154 | #endif | ||
152 | if (pdata && pdata->gpio_base) | 155 | if (pdata && pdata->gpio_base) |
153 | tps65910_gpio->gpio_chip.base = pdata->gpio_base; | 156 | tps65910_gpio->gpio_chip.base = pdata->gpio_base; |
154 | else | 157 | else |
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c index 92ea5350dfe9..aa61ad2fcaaa 100644 --- a/drivers/gpio/gpio-wm8994.c +++ b/drivers/gpio/gpio-wm8994.c | |||
@@ -89,8 +89,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip, | |||
89 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); | 89 | struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); |
90 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; | 90 | struct wm8994 *wm8994 = wm8994_gpio->wm8994; |
91 | 91 | ||
92 | if (value) | ||
93 | value = WM8994_GPN_LVL; | ||
94 | |||
92 | return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, | 95 | return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, |
93 | WM8994_GPN_DIR, 0); | 96 | WM8994_GPN_DIR | WM8994_GPN_LVL, value); |
94 | } | 97 | } |
95 | 98 | ||
96 | static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 99 | static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |
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/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c index 9764045428ce..b7e7b49d8f62 100644 --- a/drivers/gpu/drm/gma500/cdv_device.c +++ b/drivers/gpu/drm/gma500/cdv_device.c | |||
@@ -78,21 +78,6 @@ static int cdv_backlight_combination_mode(struct drm_device *dev) | |||
78 | return REG_READ(BLC_PWM_CTL2) & PWM_LEGACY_MODE; | 78 | return REG_READ(BLC_PWM_CTL2) & PWM_LEGACY_MODE; |
79 | } | 79 | } |
80 | 80 | ||
81 | static int cdv_get_brightness(struct backlight_device *bd) | ||
82 | { | ||
83 | struct drm_device *dev = bl_get_data(bd); | ||
84 | u32 val = REG_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | ||
85 | |||
86 | if (cdv_backlight_combination_mode(dev)) { | ||
87 | u8 lbpc; | ||
88 | |||
89 | val &= ~1; | ||
90 | pci_read_config_byte(dev->pdev, 0xF4, &lbpc); | ||
91 | val *= lbpc; | ||
92 | } | ||
93 | return val; | ||
94 | } | ||
95 | |||
96 | static u32 cdv_get_max_backlight(struct drm_device *dev) | 81 | static u32 cdv_get_max_backlight(struct drm_device *dev) |
97 | { | 82 | { |
98 | u32 max = REG_READ(BLC_PWM_CTL); | 83 | u32 max = REG_READ(BLC_PWM_CTL); |
@@ -110,6 +95,22 @@ static u32 cdv_get_max_backlight(struct drm_device *dev) | |||
110 | return max; | 95 | return max; |
111 | } | 96 | } |
112 | 97 | ||
98 | static int cdv_get_brightness(struct backlight_device *bd) | ||
99 | { | ||
100 | struct drm_device *dev = bl_get_data(bd); | ||
101 | u32 val = REG_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | ||
102 | |||
103 | if (cdv_backlight_combination_mode(dev)) { | ||
104 | u8 lbpc; | ||
105 | |||
106 | val &= ~1; | ||
107 | pci_read_config_byte(dev->pdev, 0xF4, &lbpc); | ||
108 | val *= lbpc; | ||
109 | } | ||
110 | return (val * 100)/cdv_get_max_backlight(dev); | ||
111 | |||
112 | } | ||
113 | |||
113 | static int cdv_set_brightness(struct backlight_device *bd) | 114 | static int cdv_set_brightness(struct backlight_device *bd) |
114 | { | 115 | { |
115 | struct drm_device *dev = bl_get_data(bd); | 116 | struct drm_device *dev = bl_get_data(bd); |
@@ -120,6 +121,9 @@ static int cdv_set_brightness(struct backlight_device *bd) | |||
120 | if (level < 1) | 121 | if (level < 1) |
121 | level = 1; | 122 | level = 1; |
122 | 123 | ||
124 | level *= cdv_get_max_backlight(dev); | ||
125 | level /= 100; | ||
126 | |||
123 | if (cdv_backlight_combination_mode(dev)) { | 127 | if (cdv_backlight_combination_mode(dev)) { |
124 | u32 max = cdv_get_max_backlight(dev); | 128 | u32 max = cdv_get_max_backlight(dev); |
125 | u8 lbpc; | 129 | u8 lbpc; |
@@ -157,7 +161,6 @@ static int cdv_backlight_init(struct drm_device *dev) | |||
157 | 161 | ||
158 | cdv_backlight_device->props.brightness = | 162 | cdv_backlight_device->props.brightness = |
159 | cdv_get_brightness(cdv_backlight_device); | 163 | cdv_get_brightness(cdv_backlight_device); |
160 | cdv_backlight_device->props.max_brightness = cdv_get_max_backlight(dev); | ||
161 | backlight_update_status(cdv_backlight_device); | 164 | backlight_update_status(cdv_backlight_device); |
162 | dev_priv->backlight_device = cdv_backlight_device; | 165 | dev_priv->backlight_device = cdv_backlight_device; |
163 | return 0; | 166 | return 0; |
diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/opregion.c index 4f186eca3a30..c430bd424681 100644 --- a/drivers/gpu/drm/gma500/opregion.c +++ b/drivers/gpu/drm/gma500/opregion.c | |||
@@ -144,6 +144,8 @@ struct opregion_asle { | |||
144 | 144 | ||
145 | #define ASLE_CBLV_VALID (1<<31) | 145 | #define ASLE_CBLV_VALID (1<<31) |
146 | 146 | ||
147 | static struct psb_intel_opregion *system_opregion; | ||
148 | |||
147 | static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) | 149 | static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) |
148 | { | 150 | { |
149 | struct drm_psb_private *dev_priv = dev->dev_private; | 151 | struct drm_psb_private *dev_priv = dev->dev_private; |
@@ -205,7 +207,7 @@ void psb_intel_opregion_enable_asle(struct drm_device *dev) | |||
205 | struct drm_psb_private *dev_priv = dev->dev_private; | 207 | struct drm_psb_private *dev_priv = dev->dev_private; |
206 | struct opregion_asle *asle = dev_priv->opregion.asle; | 208 | struct opregion_asle *asle = dev_priv->opregion.asle; |
207 | 209 | ||
208 | if (asle) { | 210 | if (asle && system_opregion ) { |
209 | /* Don't do this on Medfield or other non PC like devices, they | 211 | /* Don't do this on Medfield or other non PC like devices, they |
210 | use the bit for something different altogether */ | 212 | use the bit for something different altogether */ |
211 | psb_enable_pipestat(dev_priv, 0, PIPE_LEGACY_BLC_EVENT_ENABLE); | 213 | psb_enable_pipestat(dev_priv, 0, PIPE_LEGACY_BLC_EVENT_ENABLE); |
@@ -221,7 +223,6 @@ void psb_intel_opregion_enable_asle(struct drm_device *dev) | |||
221 | #define ACPI_EV_LID (1<<1) | 223 | #define ACPI_EV_LID (1<<1) |
222 | #define ACPI_EV_DOCK (1<<2) | 224 | #define ACPI_EV_DOCK (1<<2) |
223 | 225 | ||
224 | static struct psb_intel_opregion *system_opregion; | ||
225 | 226 | ||
226 | static int psb_intel_opregion_video_event(struct notifier_block *nb, | 227 | static int psb_intel_opregion_video_event(struct notifier_block *nb, |
227 | unsigned long val, void *data) | 228 | unsigned long val, void *data) |
@@ -266,9 +267,6 @@ void psb_intel_opregion_init(struct drm_device *dev) | |||
266 | system_opregion = opregion; | 267 | system_opregion = opregion; |
267 | register_acpi_notifier(&psb_intel_opregion_notifier); | 268 | register_acpi_notifier(&psb_intel_opregion_notifier); |
268 | } | 269 | } |
269 | |||
270 | if (opregion->asle) | ||
271 | psb_intel_opregion_enable_asle(dev); | ||
272 | } | 270 | } |
273 | 271 | ||
274 | void psb_intel_opregion_fini(struct drm_device *dev) | 272 | void psb_intel_opregion_fini(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/gma500/opregion.h b/drivers/gpu/drm/gma500/opregion.h index 72dc6b921265..4a90f8b0e16c 100644 --- a/drivers/gpu/drm/gma500/opregion.h +++ b/drivers/gpu/drm/gma500/opregion.h | |||
@@ -27,6 +27,7 @@ extern void psb_intel_opregion_asle_intr(struct drm_device *dev); | |||
27 | extern void psb_intel_opregion_init(struct drm_device *dev); | 27 | extern void psb_intel_opregion_init(struct drm_device *dev); |
28 | extern void psb_intel_opregion_fini(struct drm_device *dev); | 28 | extern void psb_intel_opregion_fini(struct drm_device *dev); |
29 | extern int psb_intel_opregion_setup(struct drm_device *dev); | 29 | extern int psb_intel_opregion_setup(struct drm_device *dev); |
30 | extern void psb_intel_opregion_enable_asle(struct drm_device *dev); | ||
30 | 31 | ||
31 | #else | 32 | #else |
32 | 33 | ||
@@ -46,4 +47,8 @@ extern inline int psb_intel_opregion_setup(struct drm_device *dev) | |||
46 | { | 47 | { |
47 | return 0; | 48 | return 0; |
48 | } | 49 | } |
50 | |||
51 | extern inline void psb_intel_opregion_enable_asle(struct drm_device *dev) | ||
52 | { | ||
53 | } | ||
49 | #endif | 54 | #endif |
diff --git a/drivers/gpu/drm/gma500/psb_device.c b/drivers/gpu/drm/gma500/psb_device.c index eff039bf92d4..5971bc82b765 100644 --- a/drivers/gpu/drm/gma500/psb_device.c +++ b/drivers/gpu/drm/gma500/psb_device.c | |||
@@ -144,6 +144,10 @@ static int psb_backlight_init(struct drm_device *dev) | |||
144 | psb_backlight_device->props.max_brightness = 100; | 144 | psb_backlight_device->props.max_brightness = 100; |
145 | backlight_update_status(psb_backlight_device); | 145 | backlight_update_status(psb_backlight_device); |
146 | dev_priv->backlight_device = psb_backlight_device; | 146 | dev_priv->backlight_device = psb_backlight_device; |
147 | |||
148 | /* This must occur after the backlight is properly initialised */ | ||
149 | psb_lid_timer_init(dev_priv); | ||
150 | |||
147 | return 0; | 151 | return 0; |
148 | } | 152 | } |
149 | 153 | ||
@@ -354,13 +358,6 @@ static int psb_chip_setup(struct drm_device *dev) | |||
354 | return 0; | 358 | return 0; |
355 | } | 359 | } |
356 | 360 | ||
357 | /* Not exactly an erratum more an irritation */ | ||
358 | static void psb_chip_errata(struct drm_device *dev) | ||
359 | { | ||
360 | struct drm_psb_private *dev_priv = dev->dev_private; | ||
361 | psb_lid_timer_init(dev_priv); | ||
362 | } | ||
363 | |||
364 | static void psb_chip_teardown(struct drm_device *dev) | 361 | static void psb_chip_teardown(struct drm_device *dev) |
365 | { | 362 | { |
366 | struct drm_psb_private *dev_priv = dev->dev_private; | 363 | struct drm_psb_private *dev_priv = dev->dev_private; |
@@ -379,7 +376,6 @@ const struct psb_ops psb_chip_ops = { | |||
379 | .sgx_offset = PSB_SGX_OFFSET, | 376 | .sgx_offset = PSB_SGX_OFFSET, |
380 | .chip_setup = psb_chip_setup, | 377 | .chip_setup = psb_chip_setup, |
381 | .chip_teardown = psb_chip_teardown, | 378 | .chip_teardown = psb_chip_teardown, |
382 | .errata = psb_chip_errata, | ||
383 | 379 | ||
384 | .crtc_helper = &psb_intel_helper_funcs, | 380 | .crtc_helper = &psb_intel_helper_funcs, |
385 | .crtc_funcs = &psb_intel_crtc_funcs, | 381 | .crtc_funcs = &psb_intel_crtc_funcs, |
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index caba6e08693c..a8858a907f47 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c | |||
@@ -374,6 +374,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) | |||
374 | 374 | ||
375 | if (ret) | 375 | if (ret) |
376 | return ret; | 376 | return ret; |
377 | psb_intel_opregion_enable_asle(dev); | ||
377 | #if 0 | 378 | #if 0 |
378 | /*enable runtime pm at last*/ | 379 | /*enable runtime pm at last*/ |
379 | pm_runtime_enable(&dev->pdev->dev); | 380 | pm_runtime_enable(&dev->pdev->dev); |
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 e0aa064def31..a8538ac0299d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6558,7 +6558,7 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
6558 | if (I915_READ(HDMIC) & PORT_DETECTED) | 6558 | if (I915_READ(HDMIC) & PORT_DETECTED) |
6559 | intel_hdmi_init(dev, HDMIC); | 6559 | intel_hdmi_init(dev, HDMIC); |
6560 | 6560 | ||
6561 | if (I915_READ(HDMID) & PORT_DETECTED) | 6561 | if (!dpd_is_edp && I915_READ(HDMID) & PORT_DETECTED) |
6562 | intel_hdmi_init(dev, HDMID); | 6562 | intel_hdmi_init(dev, HDMID); |
6563 | 6563 | ||
6564 | if (I915_READ(PCH_DP_C) & DP_DETECTED) | 6564 | if (I915_READ(PCH_DP_C) & DP_DETECTED) |
@@ -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/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 296cfc201a81..c0449324143c 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "drm.h" | 32 | #include "drm.h" |
33 | #include "drm_crtc.h" | 33 | #include "drm_crtc.h" |
34 | #include "drm_crtc_helper.h" | 34 | #include "drm_crtc_helper.h" |
35 | #include "drm_edid.h" | ||
35 | #include "intel_drv.h" | 36 | #include "intel_drv.h" |
36 | #include "i915_drm.h" | 37 | #include "i915_drm.h" |
37 | #include "i915_drv.h" | 38 | #include "i915_drv.h" |
@@ -67,6 +68,8 @@ struct intel_dp { | |||
67 | struct drm_display_mode *panel_fixed_mode; /* for eDP */ | 68 | struct drm_display_mode *panel_fixed_mode; /* for eDP */ |
68 | struct delayed_work panel_vdd_work; | 69 | struct delayed_work panel_vdd_work; |
69 | bool want_panel_vdd; | 70 | bool want_panel_vdd; |
71 | struct edid *edid; /* cached EDID for eDP */ | ||
72 | int edid_mode_count; | ||
70 | }; | 73 | }; |
71 | 74 | ||
72 | /** | 75 | /** |
@@ -371,7 +374,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
371 | int recv_bytes; | 374 | int recv_bytes; |
372 | uint32_t status; | 375 | uint32_t status; |
373 | uint32_t aux_clock_divider; | 376 | uint32_t aux_clock_divider; |
374 | int try, precharge = 5; | 377 | int try, precharge; |
375 | 378 | ||
376 | intel_dp_check_edp(intel_dp); | 379 | intel_dp_check_edp(intel_dp); |
377 | /* The clock divider is based off the hrawclk, | 380 | /* The clock divider is based off the hrawclk, |
@@ -391,6 +394,11 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
391 | else | 394 | else |
392 | aux_clock_divider = intel_hrawclk(dev) / 2; | 395 | aux_clock_divider = intel_hrawclk(dev) / 2; |
393 | 396 | ||
397 | if (IS_GEN6(dev)) | ||
398 | precharge = 3; | ||
399 | else | ||
400 | precharge = 5; | ||
401 | |||
394 | /* Try to wait for any previous AUX channel activity */ | 402 | /* Try to wait for any previous AUX channel activity */ |
395 | for (try = 0; try < 3; try++) { | 403 | for (try = 0; try < 3; try++) { |
396 | status = I915_READ(ch_ctl); | 404 | status = I915_READ(ch_ctl); |
@@ -1973,6 +1981,8 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) | |||
1973 | if (!(intel_dp->dpcd[DP_DOWN_STREAM_PORT_COUNT] & DP_OUI_SUPPORT)) | 1981 | if (!(intel_dp->dpcd[DP_DOWN_STREAM_PORT_COUNT] & DP_OUI_SUPPORT)) |
1974 | return; | 1982 | return; |
1975 | 1983 | ||
1984 | ironlake_edp_panel_vdd_on(intel_dp); | ||
1985 | |||
1976 | if (intel_dp_aux_native_read_retry(intel_dp, DP_SINK_OUI, buf, 3)) | 1986 | if (intel_dp_aux_native_read_retry(intel_dp, DP_SINK_OUI, buf, 3)) |
1977 | DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n", | 1987 | DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n", |
1978 | buf[0], buf[1], buf[2]); | 1988 | buf[0], buf[1], buf[2]); |
@@ -1980,6 +1990,8 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) | |||
1980 | if (intel_dp_aux_native_read_retry(intel_dp, DP_BRANCH_OUI, buf, 3)) | 1990 | if (intel_dp_aux_native_read_retry(intel_dp, DP_BRANCH_OUI, buf, 3)) |
1981 | DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n", | 1991 | DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n", |
1982 | buf[0], buf[1], buf[2]); | 1992 | buf[0], buf[1], buf[2]); |
1993 | |||
1994 | ironlake_edp_panel_vdd_off(intel_dp, false); | ||
1983 | } | 1995 | } |
1984 | 1996 | ||
1985 | static bool | 1997 | static bool |
@@ -2116,10 +2128,22 @@ intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) | |||
2116 | { | 2128 | { |
2117 | struct intel_dp *intel_dp = intel_attached_dp(connector); | 2129 | struct intel_dp *intel_dp = intel_attached_dp(connector); |
2118 | struct edid *edid; | 2130 | struct edid *edid; |
2131 | int size; | ||
2132 | |||
2133 | if (is_edp(intel_dp)) { | ||
2134 | if (!intel_dp->edid) | ||
2135 | return NULL; | ||
2136 | |||
2137 | size = (intel_dp->edid->extensions + 1) * EDID_LENGTH; | ||
2138 | edid = kmalloc(size, GFP_KERNEL); | ||
2139 | if (!edid) | ||
2140 | return NULL; | ||
2141 | |||
2142 | memcpy(edid, intel_dp->edid, size); | ||
2143 | return edid; | ||
2144 | } | ||
2119 | 2145 | ||
2120 | ironlake_edp_panel_vdd_on(intel_dp); | ||
2121 | edid = drm_get_edid(connector, adapter); | 2146 | edid = drm_get_edid(connector, adapter); |
2122 | ironlake_edp_panel_vdd_off(intel_dp, false); | ||
2123 | return edid; | 2147 | return edid; |
2124 | } | 2148 | } |
2125 | 2149 | ||
@@ -2129,9 +2153,17 @@ intel_dp_get_edid_modes(struct drm_connector *connector, struct i2c_adapter *ada | |||
2129 | struct intel_dp *intel_dp = intel_attached_dp(connector); | 2153 | struct intel_dp *intel_dp = intel_attached_dp(connector); |
2130 | int ret; | 2154 | int ret; |
2131 | 2155 | ||
2132 | ironlake_edp_panel_vdd_on(intel_dp); | 2156 | if (is_edp(intel_dp)) { |
2157 | drm_mode_connector_update_edid_property(connector, | ||
2158 | intel_dp->edid); | ||
2159 | ret = drm_add_edid_modes(connector, intel_dp->edid); | ||
2160 | drm_edid_to_eld(connector, | ||
2161 | intel_dp->edid); | ||
2162 | connector->display_info.raw_edid = NULL; | ||
2163 | return intel_dp->edid_mode_count; | ||
2164 | } | ||
2165 | |||
2133 | ret = intel_ddc_get_modes(connector, adapter); | 2166 | ret = intel_ddc_get_modes(connector, adapter); |
2134 | ironlake_edp_panel_vdd_off(intel_dp, false); | ||
2135 | return ret; | 2167 | return ret; |
2136 | } | 2168 | } |
2137 | 2169 | ||
@@ -2321,6 +2353,7 @@ static void intel_dp_encoder_destroy(struct drm_encoder *encoder) | |||
2321 | i2c_del_adapter(&intel_dp->adapter); | 2353 | i2c_del_adapter(&intel_dp->adapter); |
2322 | drm_encoder_cleanup(encoder); | 2354 | drm_encoder_cleanup(encoder); |
2323 | if (is_edp(intel_dp)) { | 2355 | if (is_edp(intel_dp)) { |
2356 | kfree(intel_dp->edid); | ||
2324 | cancel_delayed_work_sync(&intel_dp->panel_vdd_work); | 2357 | cancel_delayed_work_sync(&intel_dp->panel_vdd_work); |
2325 | ironlake_panel_vdd_off_sync(intel_dp); | 2358 | ironlake_panel_vdd_off_sync(intel_dp); |
2326 | } | 2359 | } |
@@ -2504,11 +2537,14 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
2504 | break; | 2537 | break; |
2505 | } | 2538 | } |
2506 | 2539 | ||
2540 | intel_dp_i2c_init(intel_dp, intel_connector, name); | ||
2541 | |||
2507 | /* Cache some DPCD data in the eDP case */ | 2542 | /* Cache some DPCD data in the eDP case */ |
2508 | if (is_edp(intel_dp)) { | 2543 | if (is_edp(intel_dp)) { |
2509 | bool ret; | 2544 | bool ret; |
2510 | struct edp_power_seq cur, vbt; | 2545 | struct edp_power_seq cur, vbt; |
2511 | u32 pp_on, pp_off, pp_div; | 2546 | u32 pp_on, pp_off, pp_div; |
2547 | struct edid *edid; | ||
2512 | 2548 | ||
2513 | pp_on = I915_READ(PCH_PP_ON_DELAYS); | 2549 | pp_on = I915_READ(PCH_PP_ON_DELAYS); |
2514 | pp_off = I915_READ(PCH_PP_OFF_DELAYS); | 2550 | pp_off = I915_READ(PCH_PP_OFF_DELAYS); |
@@ -2576,9 +2612,19 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
2576 | intel_dp_destroy(&intel_connector->base); | 2612 | intel_dp_destroy(&intel_connector->base); |
2577 | return; | 2613 | return; |
2578 | } | 2614 | } |
2579 | } | ||
2580 | 2615 | ||
2581 | intel_dp_i2c_init(intel_dp, intel_connector, name); | 2616 | ironlake_edp_panel_vdd_on(intel_dp); |
2617 | edid = drm_get_edid(connector, &intel_dp->adapter); | ||
2618 | if (edid) { | ||
2619 | drm_mode_connector_update_edid_property(connector, | ||
2620 | edid); | ||
2621 | intel_dp->edid_mode_count = | ||
2622 | drm_add_edid_modes(connector, edid); | ||
2623 | drm_edid_to_eld(connector, edid); | ||
2624 | intel_dp->edid = edid; | ||
2625 | } | ||
2626 | ironlake_edp_panel_vdd_off(intel_dp, false); | ||
2627 | } | ||
2582 | 2628 | ||
2583 | intel_encoder->hot_plug = intel_dp_hot_plug; | 2629 | intel_encoder->hot_plug = intel_dp_hot_plug; |
2584 | 2630 | ||
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/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index e7b1ec5ae8c6..486ccdf4aacd 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -1926,7 +1926,9 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, | |||
1926 | 1926 | ||
1927 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) { | 1927 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) { |
1928 | r600_hdmi_enable(encoder); | 1928 | r600_hdmi_enable(encoder); |
1929 | if (ASIC_IS_DCE4(rdev)) | 1929 | if (ASIC_IS_DCE6(rdev)) |
1930 | ; /* TODO (use pointers instead of if-s?) */ | ||
1931 | else if (ASIC_IS_DCE4(rdev)) | ||
1930 | evergreen_hdmi_setmode(encoder, adjusted_mode); | 1932 | evergreen_hdmi_setmode(encoder, adjusted_mode); |
1931 | else | 1933 | else |
1932 | r600_hdmi_setmode(encoder, adjusted_mode); | 1934 | r600_hdmi_setmode(encoder, adjusted_mode); |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 01550d05e273..7fb3d2e0434c 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -1932,6 +1932,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
1932 | smx_dc_ctl0 |= NUMBER_OF_SETS(rdev->config.evergreen.sx_num_of_sets); | 1932 | smx_dc_ctl0 |= NUMBER_OF_SETS(rdev->config.evergreen.sx_num_of_sets); |
1933 | WREG32(SMX_DC_CTL0, smx_dc_ctl0); | 1933 | WREG32(SMX_DC_CTL0, smx_dc_ctl0); |
1934 | 1934 | ||
1935 | if (rdev->family <= CHIP_SUMO2) | ||
1936 | WREG32(SMX_SAR_CTL0, 0x00010000); | ||
1937 | |||
1935 | WREG32(SX_EXPORT_BUFFER_SIZES, (COLOR_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_size / 4) - 1) | | 1938 | WREG32(SX_EXPORT_BUFFER_SIZES, (COLOR_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_size / 4) - 1) | |
1936 | POSITION_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_pos_size / 4) - 1) | | 1939 | POSITION_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_pos_size / 4) - 1) | |
1937 | SMX_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_smx_size / 4) - 1))); | 1940 | SMX_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_smx_size / 4) - 1))); |
diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 4e7dd2b4843d..c16554122ccd 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c | |||
@@ -52,6 +52,7 @@ struct evergreen_cs_track { | |||
52 | u32 cb_color_view[12]; | 52 | u32 cb_color_view[12]; |
53 | u32 cb_color_pitch[12]; | 53 | u32 cb_color_pitch[12]; |
54 | u32 cb_color_slice[12]; | 54 | u32 cb_color_slice[12]; |
55 | u32 cb_color_slice_idx[12]; | ||
55 | u32 cb_color_attrib[12]; | 56 | u32 cb_color_attrib[12]; |
56 | u32 cb_color_cmask_slice[8];/* unused */ | 57 | u32 cb_color_cmask_slice[8];/* unused */ |
57 | u32 cb_color_fmask_slice[8];/* unused */ | 58 | u32 cb_color_fmask_slice[8];/* unused */ |
@@ -127,12 +128,14 @@ static void evergreen_cs_track_init(struct evergreen_cs_track *track) | |||
127 | track->cb_color_info[i] = 0; | 128 | track->cb_color_info[i] = 0; |
128 | track->cb_color_view[i] = 0xFFFFFFFF; | 129 | track->cb_color_view[i] = 0xFFFFFFFF; |
129 | track->cb_color_pitch[i] = 0; | 130 | track->cb_color_pitch[i] = 0; |
130 | track->cb_color_slice[i] = 0; | 131 | track->cb_color_slice[i] = 0xfffffff; |
132 | track->cb_color_slice_idx[i] = 0; | ||
131 | } | 133 | } |
132 | track->cb_target_mask = 0xFFFFFFFF; | 134 | track->cb_target_mask = 0xFFFFFFFF; |
133 | track->cb_shader_mask = 0xFFFFFFFF; | 135 | track->cb_shader_mask = 0xFFFFFFFF; |
134 | track->cb_dirty = true; | 136 | track->cb_dirty = true; |
135 | 137 | ||
138 | track->db_depth_slice = 0xffffffff; | ||
136 | track->db_depth_view = 0xFFFFC000; | 139 | track->db_depth_view = 0xFFFFC000; |
137 | track->db_depth_size = 0xFFFFFFFF; | 140 | track->db_depth_size = 0xFFFFFFFF; |
138 | track->db_depth_control = 0xFFFFFFFF; | 141 | track->db_depth_control = 0xFFFFFFFF; |
@@ -250,10 +253,9 @@ static int evergreen_surface_check_2d(struct radeon_cs_parser *p, | |||
250 | { | 253 | { |
251 | struct evergreen_cs_track *track = p->track; | 254 | struct evergreen_cs_track *track = p->track; |
252 | unsigned palign, halign, tileb, slice_pt; | 255 | unsigned palign, halign, tileb, slice_pt; |
256 | unsigned mtile_pr, mtile_ps, mtileb; | ||
253 | 257 | ||
254 | tileb = 64 * surf->bpe * surf->nsamples; | 258 | tileb = 64 * surf->bpe * surf->nsamples; |
255 | palign = track->group_size / (8 * surf->bpe * surf->nsamples); | ||
256 | palign = MAX(8, palign); | ||
257 | slice_pt = 1; | 259 | slice_pt = 1; |
258 | if (tileb > surf->tsplit) { | 260 | if (tileb > surf->tsplit) { |
259 | slice_pt = tileb / surf->tsplit; | 261 | slice_pt = tileb / surf->tsplit; |
@@ -262,7 +264,10 @@ static int evergreen_surface_check_2d(struct radeon_cs_parser *p, | |||
262 | /* macro tile width & height */ | 264 | /* macro tile width & height */ |
263 | palign = (8 * surf->bankw * track->npipes) * surf->mtilea; | 265 | palign = (8 * surf->bankw * track->npipes) * surf->mtilea; |
264 | halign = (8 * surf->bankh * surf->nbanks) / surf->mtilea; | 266 | halign = (8 * surf->bankh * surf->nbanks) / surf->mtilea; |
265 | surf->layer_size = surf->nbx * surf->nby * surf->bpe * slice_pt; | 267 | mtileb = (palign / 8) * (halign / 8) * tileb;; |
268 | mtile_pr = surf->nbx / palign; | ||
269 | mtile_ps = (mtile_pr * surf->nby) / halign; | ||
270 | surf->layer_size = mtile_ps * mtileb * slice_pt; | ||
266 | surf->base_align = (palign / 8) * (halign / 8) * tileb; | 271 | surf->base_align = (palign / 8) * (halign / 8) * tileb; |
267 | surf->palign = palign; | 272 | surf->palign = palign; |
268 | surf->halign = halign; | 273 | surf->halign = halign; |
@@ -434,6 +439,39 @@ static int evergreen_cs_track_validate_cb(struct radeon_cs_parser *p, unsigned i | |||
434 | 439 | ||
435 | offset += surf.layer_size * mslice; | 440 | offset += surf.layer_size * mslice; |
436 | if (offset > radeon_bo_size(track->cb_color_bo[id])) { | 441 | if (offset > radeon_bo_size(track->cb_color_bo[id])) { |
442 | /* old ddx are broken they allocate bo with w*h*bpp but | ||
443 | * program slice with ALIGN(h, 8), catch this and patch | ||
444 | * command stream. | ||
445 | */ | ||
446 | if (!surf.mode) { | ||
447 | volatile u32 *ib = p->ib.ptr; | ||
448 | unsigned long tmp, nby, bsize, size, min = 0; | ||
449 | |||
450 | /* find the height the ddx wants */ | ||
451 | if (surf.nby > 8) { | ||
452 | min = surf.nby - 8; | ||
453 | } | ||
454 | bsize = radeon_bo_size(track->cb_color_bo[id]); | ||
455 | tmp = track->cb_color_bo_offset[id] << 8; | ||
456 | for (nby = surf.nby; nby > min; nby--) { | ||
457 | size = nby * surf.nbx * surf.bpe * surf.nsamples; | ||
458 | if ((tmp + size * mslice) <= bsize) { | ||
459 | break; | ||
460 | } | ||
461 | } | ||
462 | if (nby > min) { | ||
463 | surf.nby = nby; | ||
464 | slice = ((nby * surf.nbx) / 64) - 1; | ||
465 | if (!evergreen_surface_check(p, &surf, "cb")) { | ||
466 | /* check if this one works */ | ||
467 | tmp += surf.layer_size * mslice; | ||
468 | if (tmp <= bsize) { | ||
469 | ib[track->cb_color_slice_idx[id]] = slice; | ||
470 | goto old_ddx_ok; | ||
471 | } | ||
472 | } | ||
473 | } | ||
474 | } | ||
437 | dev_warn(p->dev, "%s:%d cb[%d] bo too small (layer size %d, " | 475 | dev_warn(p->dev, "%s:%d cb[%d] bo too small (layer size %d, " |
438 | "offset %d, max layer %d, bo size %ld, slice %d)\n", | 476 | "offset %d, max layer %d, bo size %ld, slice %d)\n", |
439 | __func__, __LINE__, id, surf.layer_size, | 477 | __func__, __LINE__, id, surf.layer_size, |
@@ -446,6 +484,7 @@ static int evergreen_cs_track_validate_cb(struct radeon_cs_parser *p, unsigned i | |||
446 | surf.tsplit, surf.mtilea); | 484 | surf.tsplit, surf.mtilea); |
447 | return -EINVAL; | 485 | return -EINVAL; |
448 | } | 486 | } |
487 | old_ddx_ok: | ||
449 | 488 | ||
450 | return 0; | 489 | return 0; |
451 | } | 490 | } |
@@ -1532,6 +1571,7 @@ static int evergreen_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx) | |||
1532 | case CB_COLOR7_SLICE: | 1571 | case CB_COLOR7_SLICE: |
1533 | tmp = (reg - CB_COLOR0_SLICE) / 0x3c; | 1572 | tmp = (reg - CB_COLOR0_SLICE) / 0x3c; |
1534 | track->cb_color_slice[tmp] = radeon_get_ib_value(p, idx); | 1573 | track->cb_color_slice[tmp] = radeon_get_ib_value(p, idx); |
1574 | track->cb_color_slice_idx[tmp] = idx; | ||
1535 | track->cb_dirty = true; | 1575 | track->cb_dirty = true; |
1536 | break; | 1576 | break; |
1537 | case CB_COLOR8_SLICE: | 1577 | case CB_COLOR8_SLICE: |
@@ -1540,6 +1580,7 @@ static int evergreen_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx) | |||
1540 | case CB_COLOR11_SLICE: | 1580 | case CB_COLOR11_SLICE: |
1541 | tmp = ((reg - CB_COLOR8_SLICE) / 0x1c) + 8; | 1581 | tmp = ((reg - CB_COLOR8_SLICE) / 0x1c) + 8; |
1542 | track->cb_color_slice[tmp] = radeon_get_ib_value(p, idx); | 1582 | track->cb_color_slice[tmp] = radeon_get_ib_value(p, idx); |
1583 | track->cb_color_slice_idx[tmp] = idx; | ||
1543 | track->cb_dirty = true; | 1584 | track->cb_dirty = true; |
1544 | break; | 1585 | break; |
1545 | case CB_COLOR0_ATTRIB: | 1586 | case CB_COLOR0_ATTRIB: |
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index a51f880985f8..65c54160028b 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c | |||
@@ -156,9 +156,6 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode | |||
156 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 156 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
157 | uint32_t offset; | 157 | uint32_t offset; |
158 | 158 | ||
159 | if (ASIC_IS_DCE5(rdev)) | ||
160 | return; | ||
161 | |||
162 | /* Silent, r600_hdmi_enable will raise WARN for us */ | 159 | /* Silent, r600_hdmi_enable will raise WARN for us */ |
163 | if (!dig->afmt->enabled) | 160 | if (!dig->afmt->enabled) |
164 | return; | 161 | return; |
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 2773039b4902..b50b15c70498 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h | |||
@@ -503,6 +503,7 @@ | |||
503 | #define SCRATCH_UMSK 0x8540 | 503 | #define SCRATCH_UMSK 0x8540 |
504 | #define SCRATCH_ADDR 0x8544 | 504 | #define SCRATCH_ADDR 0x8544 |
505 | 505 | ||
506 | #define SMX_SAR_CTL0 0xA008 | ||
506 | #define SMX_DC_CTL0 0xA020 | 507 | #define SMX_DC_CTL0 0xA020 |
507 | #define USE_HASH_FUNCTION (1 << 0) | 508 | #define USE_HASH_FUNCTION (1 << 0) |
508 | #define NUMBER_OF_SETS(x) ((x) << 1) | 509 | #define NUMBER_OF_SETS(x) ((x) << 1) |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 3186522a4458..b7bf18e40215 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -1303,6 +1303,10 @@ static int cayman_startup(struct radeon_device *rdev) | |||
1303 | if (r) | 1303 | if (r) |
1304 | return r; | 1304 | return r; |
1305 | 1305 | ||
1306 | r = r600_audio_init(rdev); | ||
1307 | if (r) | ||
1308 | return r; | ||
1309 | |||
1306 | return 0; | 1310 | return 0; |
1307 | } | 1311 | } |
1308 | 1312 | ||
@@ -1329,6 +1333,7 @@ int cayman_resume(struct radeon_device *rdev) | |||
1329 | 1333 | ||
1330 | int cayman_suspend(struct radeon_device *rdev) | 1334 | int cayman_suspend(struct radeon_device *rdev) |
1331 | { | 1335 | { |
1336 | r600_audio_fini(rdev); | ||
1332 | /* FIXME: we should wait for ring to be empty */ | 1337 | /* FIXME: we should wait for ring to be empty */ |
1333 | radeon_ib_pool_suspend(rdev); | 1338 | radeon_ib_pool_suspend(rdev); |
1334 | radeon_vm_manager_suspend(rdev); | 1339 | radeon_vm_manager_suspend(rdev); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index f30dc95f83b1..bff627293812 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1839,6 +1839,7 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
1839 | WREG32(PA_CL_ENHANCE, (CLIP_VTX_REORDER_ENA | | 1839 | WREG32(PA_CL_ENHANCE, (CLIP_VTX_REORDER_ENA | |
1840 | NUM_CLIP_SEQ(3))); | 1840 | NUM_CLIP_SEQ(3))); |
1841 | WREG32(PA_SC_ENHANCE, FORCE_EOV_MAX_CLK_CNT(4095)); | 1841 | WREG32(PA_SC_ENHANCE, FORCE_EOV_MAX_CLK_CNT(4095)); |
1842 | WREG32(VC_ENHANCE, 0); | ||
1842 | } | 1843 | } |
1843 | 1844 | ||
1844 | 1845 | ||
diff --git a/drivers/gpu/drm/radeon/r600_audio.c b/drivers/gpu/drm/radeon/r600_audio.c index 7479a5c503e4..79b55916cf90 100644 --- a/drivers/gpu/drm/radeon/r600_audio.c +++ b/drivers/gpu/drm/radeon/r600_audio.c | |||
@@ -57,7 +57,7 @@ static bool radeon_dig_encoder(struct drm_encoder *encoder) | |||
57 | */ | 57 | */ |
58 | static int r600_audio_chipset_supported(struct radeon_device *rdev) | 58 | static int r600_audio_chipset_supported(struct radeon_device *rdev) |
59 | { | 59 | { |
60 | return (rdev->family >= CHIP_R600 && !ASIC_IS_DCE5(rdev)) | 60 | return (rdev->family >= CHIP_R600 && !ASIC_IS_DCE6(rdev)) |
61 | || rdev->family == CHIP_RS600 | 61 | || rdev->family == CHIP_RS600 |
62 | || rdev->family == CHIP_RS690 | 62 | || rdev->family == CHIP_RS690 |
63 | || rdev->family == CHIP_RS740; | 63 | || rdev->family == CHIP_RS740; |
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 0133f5f09bd6..ca87f7afaf23 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
@@ -2079,6 +2079,48 @@ static int r600_packet3_check(struct radeon_cs_parser *p, | |||
2079 | return -EINVAL; | 2079 | return -EINVAL; |
2080 | } | 2080 | } |
2081 | break; | 2081 | break; |
2082 | case PACKET3_STRMOUT_BASE_UPDATE: | ||
2083 | if (p->family < CHIP_RV770) { | ||
2084 | DRM_ERROR("STRMOUT_BASE_UPDATE only supported on 7xx\n"); | ||
2085 | return -EINVAL; | ||
2086 | } | ||
2087 | if (pkt->count != 1) { | ||
2088 | DRM_ERROR("bad STRMOUT_BASE_UPDATE packet count\n"); | ||
2089 | return -EINVAL; | ||
2090 | } | ||
2091 | if (idx_value > 3) { | ||
2092 | DRM_ERROR("bad STRMOUT_BASE_UPDATE index\n"); | ||
2093 | return -EINVAL; | ||
2094 | } | ||
2095 | { | ||
2096 | u64 offset; | ||
2097 | |||
2098 | r = r600_cs_packet_next_reloc(p, &reloc); | ||
2099 | if (r) { | ||
2100 | DRM_ERROR("bad STRMOUT_BASE_UPDATE reloc\n"); | ||
2101 | return -EINVAL; | ||
2102 | } | ||
2103 | |||
2104 | if (reloc->robj != track->vgt_strmout_bo[idx_value]) { | ||
2105 | DRM_ERROR("bad STRMOUT_BASE_UPDATE, bo does not match\n"); | ||
2106 | return -EINVAL; | ||
2107 | } | ||
2108 | |||
2109 | offset = radeon_get_ib_value(p, idx+1) << 8; | ||
2110 | if (offset != track->vgt_strmout_bo_offset[idx_value]) { | ||
2111 | DRM_ERROR("bad STRMOUT_BASE_UPDATE, bo offset does not match: 0x%llx, 0x%x\n", | ||
2112 | offset, track->vgt_strmout_bo_offset[idx_value]); | ||
2113 | return -EINVAL; | ||
2114 | } | ||
2115 | |||
2116 | if ((offset + 4) > radeon_bo_size(reloc->robj)) { | ||
2117 | DRM_ERROR("bad STRMOUT_BASE_UPDATE bo too small: 0x%llx, 0x%lx\n", | ||
2118 | offset + 4, radeon_bo_size(reloc->robj)); | ||
2119 | return -EINVAL; | ||
2120 | } | ||
2121 | ib[idx+1] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff); | ||
2122 | } | ||
2123 | break; | ||
2082 | case PACKET3_SURFACE_BASE_UPDATE: | 2124 | case PACKET3_SURFACE_BASE_UPDATE: |
2083 | if (p->family >= CHIP_RV770 || p->family == CHIP_R600) { | 2125 | if (p->family >= CHIP_RV770 || p->family == CHIP_R600) { |
2084 | DRM_ERROR("bad SURFACE_BASE_UPDATE\n"); | 2126 | DRM_ERROR("bad SURFACE_BASE_UPDATE\n"); |
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index 969c27529dfe..82a0a4c919c0 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -322,9 +322,6 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod | |||
322 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 322 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
323 | uint32_t offset; | 323 | uint32_t offset; |
324 | 324 | ||
325 | if (ASIC_IS_DCE5(rdev)) | ||
326 | return; | ||
327 | |||
328 | /* Silent, r600_hdmi_enable will raise WARN for us */ | 325 | /* Silent, r600_hdmi_enable will raise WARN for us */ |
329 | if (!dig->afmt->enabled) | 326 | if (!dig->afmt->enabled) |
330 | return; | 327 | return; |
@@ -483,7 +480,7 @@ void r600_hdmi_enable(struct drm_encoder *encoder) | |||
483 | uint32_t offset; | 480 | uint32_t offset; |
484 | u32 hdmi; | 481 | u32 hdmi; |
485 | 482 | ||
486 | if (ASIC_IS_DCE5(rdev)) | 483 | if (ASIC_IS_DCE6(rdev)) |
487 | return; | 484 | return; |
488 | 485 | ||
489 | /* Silent, r600_hdmi_enable will raise WARN for us */ | 486 | /* Silent, r600_hdmi_enable will raise WARN for us */ |
@@ -543,7 +540,7 @@ void r600_hdmi_disable(struct drm_encoder *encoder) | |||
543 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 540 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
544 | uint32_t offset; | 541 | uint32_t offset; |
545 | 542 | ||
546 | if (ASIC_IS_DCE5(rdev)) | 543 | if (ASIC_IS_DCE6(rdev)) |
547 | return; | 544 | return; |
548 | 545 | ||
549 | /* Called for ATOM_ENCODER_MODE_HDMI only */ | 546 | /* Called for ATOM_ENCODER_MODE_HDMI only */ |
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h index a0dbf1fe6a40..025fd5b6c08c 100644 --- a/drivers/gpu/drm/radeon/r600d.h +++ b/drivers/gpu/drm/radeon/r600d.h | |||
@@ -485,6 +485,7 @@ | |||
485 | #define TC_L2_SIZE(x) ((x)<<5) | 485 | #define TC_L2_SIZE(x) ((x)<<5) |
486 | #define L2_DISABLE_LATE_HIT (1<<9) | 486 | #define L2_DISABLE_LATE_HIT (1<<9) |
487 | 487 | ||
488 | #define VC_ENHANCE 0x9714 | ||
488 | 489 | ||
489 | #define VGT_CACHE_INVALIDATION 0x88C4 | 490 | #define VGT_CACHE_INVALIDATION 0x88C4 |
490 | #define CACHE_INVALIDATION(x) ((x)<<0) | 491 | #define CACHE_INVALIDATION(x) ((x)<<0) |
@@ -1163,6 +1164,7 @@ | |||
1163 | #define PACKET3_SET_CTL_CONST 0x6F | 1164 | #define PACKET3_SET_CTL_CONST 0x6F |
1164 | #define PACKET3_SET_CTL_CONST_OFFSET 0x0003cff0 | 1165 | #define PACKET3_SET_CTL_CONST_OFFSET 0x0003cff0 |
1165 | #define PACKET3_SET_CTL_CONST_END 0x0003e200 | 1166 | #define PACKET3_SET_CTL_CONST_END 0x0003e200 |
1167 | #define PACKET3_STRMOUT_BASE_UPDATE 0x72 /* r7xx */ | ||
1166 | #define PACKET3_SURFACE_BASE_UPDATE 0x73 | 1168 | #define PACKET3_SURFACE_BASE_UPDATE 0x73 |
1167 | 1169 | ||
1168 | 1170 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index f0bb2b543b13..2c4d53fd20c5 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -57,9 +57,11 @@ | |||
57 | * 2.13.0 - virtual memory support, streamout | 57 | * 2.13.0 - virtual memory support, streamout |
58 | * 2.14.0 - add evergreen tiling informations | 58 | * 2.14.0 - add evergreen tiling informations |
59 | * 2.15.0 - add max_pipes query | 59 | * 2.15.0 - add max_pipes query |
60 | * 2.16.0 - fix evergreen 2D tiled surface calculation | ||
61 | * 2.17.0 - add STRMOUT_BASE_UPDATE for r7xx | ||
60 | */ | 62 | */ |
61 | #define KMS_DRIVER_MAJOR 2 | 63 | #define KMS_DRIVER_MAJOR 2 |
62 | #define KMS_DRIVER_MINOR 15 | 64 | #define KMS_DRIVER_MINOR 17 |
63 | #define KMS_DRIVER_PATCHLEVEL 0 | 65 | #define KMS_DRIVER_PATCHLEVEL 0 |
64 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); | 66 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); |
65 | int radeon_driver_unload_kms(struct drm_device *dev); | 67 | int radeon_driver_unload_kms(struct drm_device *dev); |
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/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 08825548ee69..5b37e283ec38 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -801,9 +801,13 @@ static void radeon_dynpm_idle_work_handler(struct work_struct *work) | |||
801 | int i; | 801 | int i; |
802 | 802 | ||
803 | for (i = 0; i < RADEON_NUM_RINGS; ++i) { | 803 | for (i = 0; i < RADEON_NUM_RINGS; ++i) { |
804 | not_processed += radeon_fence_count_emitted(rdev, i); | 804 | struct radeon_ring *ring = &rdev->ring[i]; |
805 | if (not_processed >= 3) | 805 | |
806 | break; | 806 | if (ring->ready) { |
807 | not_processed += radeon_fence_count_emitted(rdev, i); | ||
808 | if (not_processed >= 3) | ||
809 | break; | ||
810 | } | ||
807 | } | 811 | } |
808 | 812 | ||
809 | if (not_processed >= 3) { /* should upclock */ | 813 | if (not_processed >= 3) { /* should upclock */ |
diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c index 8ddab4c76710..6bef46ace831 100644 --- a/drivers/gpu/drm/radeon/radeon_prime.c +++ b/drivers/gpu/drm/radeon/radeon_prime.c | |||
@@ -169,11 +169,17 @@ struct dma_buf *radeon_gem_prime_export(struct drm_device *dev, | |||
169 | struct radeon_bo *bo = gem_to_radeon_bo(obj); | 169 | struct radeon_bo *bo = gem_to_radeon_bo(obj); |
170 | int ret = 0; | 170 | int ret = 0; |
171 | 171 | ||
172 | ret = radeon_bo_reserve(bo, false); | ||
173 | if (unlikely(ret != 0)) | ||
174 | return ERR_PTR(ret); | ||
175 | |||
172 | /* pin buffer into GTT */ | 176 | /* pin buffer into GTT */ |
173 | ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL); | 177 | ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL); |
174 | if (ret) | 178 | if (ret) { |
179 | radeon_bo_unreserve(bo); | ||
175 | return ERR_PTR(ret); | 180 | return ERR_PTR(ret); |
176 | 181 | } | |
182 | radeon_bo_unreserve(bo); | ||
177 | return dma_buf_export(bo, &radeon_dmabuf_ops, obj->size, flags); | 183 | return dma_buf_export(bo, &radeon_dmabuf_ops, obj->size, flags); |
178 | } | 184 | } |
179 | 185 | ||
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 4ad0281fdc37..b4f51c569c36 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -616,6 +616,9 @@ static void rv770_gpu_init(struct radeon_device *rdev) | |||
616 | ACK_FLUSH_CTL(3) | | 616 | ACK_FLUSH_CTL(3) | |
617 | SYNC_FLUSH_CTL)); | 617 | SYNC_FLUSH_CTL)); |
618 | 618 | ||
619 | if (rdev->family != CHIP_RV770) | ||
620 | WREG32(SMX_SAR_CTL0, 0x00003f3f); | ||
621 | |||
619 | db_debug3 = RREG32(DB_DEBUG3); | 622 | db_debug3 = RREG32(DB_DEBUG3); |
620 | db_debug3 &= ~DB_CLK_OFF_DELAY(0x1f); | 623 | db_debug3 &= ~DB_CLK_OFF_DELAY(0x1f); |
621 | switch (rdev->family) { | 624 | switch (rdev->family) { |
@@ -792,7 +795,7 @@ static void rv770_gpu_init(struct radeon_device *rdev) | |||
792 | 795 | ||
793 | WREG32(PA_CL_ENHANCE, (CLIP_VTX_REORDER_ENA | | 796 | WREG32(PA_CL_ENHANCE, (CLIP_VTX_REORDER_ENA | |
794 | NUM_CLIP_SEQ(3))); | 797 | NUM_CLIP_SEQ(3))); |
795 | 798 | WREG32(VC_ENHANCE, 0); | |
796 | } | 799 | } |
797 | 800 | ||
798 | void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | 801 | void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) |
diff --git a/drivers/gpu/drm/radeon/rv770d.h b/drivers/gpu/drm/radeon/rv770d.h index fdc089896011..b0adfc595d75 100644 --- a/drivers/gpu/drm/radeon/rv770d.h +++ b/drivers/gpu/drm/radeon/rv770d.h | |||
@@ -211,6 +211,7 @@ | |||
211 | #define SCRATCH_UMSK 0x8540 | 211 | #define SCRATCH_UMSK 0x8540 |
212 | #define SCRATCH_ADDR 0x8544 | 212 | #define SCRATCH_ADDR 0x8544 |
213 | 213 | ||
214 | #define SMX_SAR_CTL0 0xA008 | ||
214 | #define SMX_DC_CTL0 0xA020 | 215 | #define SMX_DC_CTL0 0xA020 |
215 | #define USE_HASH_FUNCTION (1 << 0) | 216 | #define USE_HASH_FUNCTION (1 << 0) |
216 | #define CACHE_DEPTH(x) ((x) << 1) | 217 | #define CACHE_DEPTH(x) ((x) << 1) |
@@ -310,6 +311,8 @@ | |||
310 | #define TCP_CNTL 0x9610 | 311 | #define TCP_CNTL 0x9610 |
311 | #define TCP_CHAN_STEER 0x9614 | 312 | #define TCP_CHAN_STEER 0x9614 |
312 | 313 | ||
314 | #define VC_ENHANCE 0x9714 | ||
315 | |||
313 | #define VGT_CACHE_INVALIDATION 0x88C4 | 316 | #define VGT_CACHE_INVALIDATION 0x88C4 |
314 | #define CACHE_INVALIDATION(x) ((x)<<0) | 317 | #define CACHE_INVALIDATION(x) ((x)<<0) |
315 | #define VC_ONLY 0 | 318 | #define VC_ONLY 0 |
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/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c index 30d98d14b5c5..dd14cd1a0033 100644 --- a/drivers/gpu/drm/sis/sis_drv.c +++ b/drivers/gpu/drm/sis/sis_drv.c | |||
@@ -47,9 +47,9 @@ static int sis_driver_load(struct drm_device *dev, unsigned long chipset) | |||
47 | if (dev_priv == NULL) | 47 | if (dev_priv == NULL) |
48 | return -ENOMEM; | 48 | return -ENOMEM; |
49 | 49 | ||
50 | idr_init(&dev_priv->object_idr); | ||
50 | dev->dev_private = (void *)dev_priv; | 51 | dev->dev_private = (void *)dev_priv; |
51 | dev_priv->chipset = chipset; | 52 | dev_priv->chipset = chipset; |
52 | idr_init(&dev->object_name_idr); | ||
53 | 53 | ||
54 | return 0; | 54 | return 0; |
55 | } | 55 | } |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index b67cfcaa661f..36f4b28c1b90 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1204,6 +1204,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev, | |||
1204 | (*destroy)(bo); | 1204 | (*destroy)(bo); |
1205 | else | 1205 | else |
1206 | kfree(bo); | 1206 | kfree(bo); |
1207 | ttm_mem_global_free(mem_glob, acc_size); | ||
1207 | return -EINVAL; | 1208 | return -EINVAL; |
1208 | } | 1209 | } |
1209 | bo->destroy = destroy; | 1210 | bo->destroy = destroy; |
@@ -1307,22 +1308,14 @@ int ttm_bo_create(struct ttm_bo_device *bdev, | |||
1307 | struct ttm_buffer_object **p_bo) | 1308 | struct ttm_buffer_object **p_bo) |
1308 | { | 1309 | { |
1309 | struct ttm_buffer_object *bo; | 1310 | struct ttm_buffer_object *bo; |
1310 | struct ttm_mem_global *mem_glob = bdev->glob->mem_glob; | ||
1311 | size_t acc_size; | 1311 | size_t acc_size; |
1312 | int ret; | 1312 | int ret; |
1313 | 1313 | ||
1314 | acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object)); | ||
1315 | ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false); | ||
1316 | if (unlikely(ret != 0)) | ||
1317 | return ret; | ||
1318 | |||
1319 | bo = kzalloc(sizeof(*bo), GFP_KERNEL); | 1314 | bo = kzalloc(sizeof(*bo), GFP_KERNEL); |
1320 | 1315 | if (unlikely(bo == NULL)) | |
1321 | if (unlikely(bo == NULL)) { | ||
1322 | ttm_mem_global_free(mem_glob, acc_size); | ||
1323 | return -ENOMEM; | 1316 | return -ENOMEM; |
1324 | } | ||
1325 | 1317 | ||
1318 | acc_size = ttm_bo_acc_size(bdev, size, sizeof(struct ttm_buffer_object)); | ||
1326 | ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, | 1319 | ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, |
1327 | buffer_start, interruptible, | 1320 | buffer_start, interruptible, |
1328 | persistent_swap_storage, acc_size, NULL, NULL); | 1321 | persistent_swap_storage, acc_size, NULL, NULL); |
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c index 4d02c46a9420..6e52069894b3 100644 --- a/drivers/gpu/drm/udl/udl_drv.c +++ b/drivers/gpu/drm/udl/udl_drv.c | |||
@@ -13,8 +13,21 @@ | |||
13 | 13 | ||
14 | static struct drm_driver driver; | 14 | static struct drm_driver driver; |
15 | 15 | ||
16 | /* | ||
17 | * There are many DisplayLink-based graphics products, all with unique PIDs. | ||
18 | * So we match on DisplayLink's VID + Vendor-Defined Interface Class (0xff) | ||
19 | * We also require a match on SubClass (0x00) and Protocol (0x00), | ||
20 | * which is compatible with all known USB 2.0 era graphics chips and firmware, | ||
21 | * but allows DisplayLink to increment those for any future incompatible chips | ||
22 | */ | ||
16 | static struct usb_device_id id_table[] = { | 23 | static struct usb_device_id id_table[] = { |
17 | {.idVendor = 0x17e9, .match_flags = USB_DEVICE_ID_MATCH_VENDOR,}, | 24 | {.idVendor = 0x17e9, .bInterfaceClass = 0xff, |
25 | .bInterfaceSubClass = 0x00, | ||
26 | .bInterfaceProtocol = 0x00, | ||
27 | .match_flags = USB_DEVICE_ID_MATCH_VENDOR | | ||
28 | USB_DEVICE_ID_MATCH_INT_CLASS | | ||
29 | USB_DEVICE_ID_MATCH_INT_SUBCLASS | | ||
30 | USB_DEVICE_ID_MATCH_INT_PROTOCOL,}, | ||
18 | {}, | 31 | {}, |
19 | }; | 32 | }; |
20 | MODULE_DEVICE_TABLE(usb, id_table); | 33 | MODULE_DEVICE_TABLE(usb, id_table); |
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/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c index 1f182254e81e..c126182ac07e 100644 --- a/drivers/gpu/drm/via/via_map.c +++ b/drivers/gpu/drm/via/via_map.c | |||
@@ -100,12 +100,11 @@ int via_driver_load(struct drm_device *dev, unsigned long chipset) | |||
100 | if (dev_priv == NULL) | 100 | if (dev_priv == NULL) |
101 | return -ENOMEM; | 101 | return -ENOMEM; |
102 | 102 | ||
103 | idr_init(&dev_priv->object_idr); | ||
103 | dev->dev_private = (void *)dev_priv; | 104 | dev->dev_private = (void *)dev_priv; |
104 | 105 | ||
105 | dev_priv->chipset = chipset; | 106 | dev_priv->chipset = chipset; |
106 | 107 | ||
107 | idr_init(&dev->object_name_idr); | ||
108 | |||
109 | pci_set_master(dev->pdev); | 108 | pci_set_master(dev->pdev); |
110 | 109 | ||
111 | ret = drm_vblank_init(dev, 1); | 110 | ret = drm_vblank_init(dev, 1); |
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 38f9534ac513..5b3c7d135dc9 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c | |||
@@ -190,6 +190,19 @@ find_active_client(struct list_head *head) | |||
190 | return NULL; | 190 | return NULL; |
191 | } | 191 | } |
192 | 192 | ||
193 | int vga_switcheroo_get_client_state(struct pci_dev *pdev) | ||
194 | { | ||
195 | struct vga_switcheroo_client *client; | ||
196 | |||
197 | client = find_client_from_pci(&vgasr_priv.clients, pdev); | ||
198 | if (!client) | ||
199 | return VGA_SWITCHEROO_NOT_FOUND; | ||
200 | if (!vgasr_priv.active) | ||
201 | return VGA_SWITCHEROO_INIT; | ||
202 | return client->pwr_state; | ||
203 | } | ||
204 | EXPORT_SYMBOL(vga_switcheroo_get_client_state); | ||
205 | |||
193 | void vga_switcheroo_unregister_client(struct pci_dev *pdev) | 206 | void vga_switcheroo_unregister_client(struct pci_dev *pdev) |
194 | { | 207 | { |
195 | struct vga_switcheroo_client *client; | 208 | struct vga_switcheroo_client *client; |
@@ -291,8 +304,6 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client) | |||
291 | vga_switchon(new_client); | 304 | vga_switchon(new_client); |
292 | 305 | ||
293 | vga_set_default_device(new_client->pdev); | 306 | vga_set_default_device(new_client->pdev); |
294 | set_audio_state(new_client->id, VGA_SWITCHEROO_ON); | ||
295 | |||
296 | return 0; | 307 | return 0; |
297 | } | 308 | } |
298 | 309 | ||
@@ -308,6 +319,8 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client) | |||
308 | 319 | ||
309 | active->active = false; | 320 | active->active = false; |
310 | 321 | ||
322 | set_audio_state(active->id, VGA_SWITCHEROO_OFF); | ||
323 | |||
311 | if (new_client->fb_info) { | 324 | if (new_client->fb_info) { |
312 | struct fb_event event; | 325 | struct fb_event event; |
313 | event.info = new_client->fb_info; | 326 | event.info = new_client->fb_info; |
@@ -321,11 +334,11 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client) | |||
321 | if (new_client->ops->reprobe) | 334 | if (new_client->ops->reprobe) |
322 | new_client->ops->reprobe(new_client->pdev); | 335 | new_client->ops->reprobe(new_client->pdev); |
323 | 336 | ||
324 | set_audio_state(active->id, VGA_SWITCHEROO_OFF); | ||
325 | |||
326 | if (active->pwr_state == VGA_SWITCHEROO_ON) | 337 | if (active->pwr_state == VGA_SWITCHEROO_ON) |
327 | vga_switchoff(active); | 338 | vga_switchoff(active); |
328 | 339 | ||
340 | set_audio_state(new_client->id, VGA_SWITCHEROO_ON); | ||
341 | |||
329 | new_client->active = true; | 342 | new_client->active = true; |
330 | return 0; | 343 | return 0; |
331 | } | 344 | } |
@@ -371,8 +384,9 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, | |||
371 | /* pwr off the device not in use */ | 384 | /* pwr off the device not in use */ |
372 | if (strncmp(usercmd, "OFF", 3) == 0) { | 385 | if (strncmp(usercmd, "OFF", 3) == 0) { |
373 | list_for_each_entry(client, &vgasr_priv.clients, list) { | 386 | list_for_each_entry(client, &vgasr_priv.clients, list) { |
374 | if (client->active) | 387 | if (client->active || client_is_audio(client)) |
375 | continue; | 388 | continue; |
389 | set_audio_state(client->id, VGA_SWITCHEROO_OFF); | ||
376 | if (client->pwr_state == VGA_SWITCHEROO_ON) | 390 | if (client->pwr_state == VGA_SWITCHEROO_ON) |
377 | vga_switchoff(client); | 391 | vga_switchoff(client); |
378 | } | 392 | } |
@@ -381,10 +395,11 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, | |||
381 | /* pwr on the device not in use */ | 395 | /* pwr on the device not in use */ |
382 | if (strncmp(usercmd, "ON", 2) == 0) { | 396 | if (strncmp(usercmd, "ON", 2) == 0) { |
383 | list_for_each_entry(client, &vgasr_priv.clients, list) { | 397 | list_for_each_entry(client, &vgasr_priv.clients, list) { |
384 | if (client->active) | 398 | if (client->active || client_is_audio(client)) |
385 | continue; | 399 | continue; |
386 | if (client->pwr_state == VGA_SWITCHEROO_OFF) | 400 | if (client->pwr_state == VGA_SWITCHEROO_OFF) |
387 | vga_switchon(client); | 401 | vga_switchon(client); |
402 | set_audio_state(client->id, VGA_SWITCHEROO_ON); | ||
388 | } | 403 | } |
389 | goto out; | 404 | goto out; |
390 | } | 405 | } |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 034c80a10f1f..3fda8c87f02c 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 |
@@ -393,6 +386,7 @@ config HID_MULTITOUCH | |||
393 | - Unitec Panels | 386 | - Unitec Panels |
394 | - XAT optical touch panels | 387 | - XAT optical touch panels |
395 | - Xiroku optical touch panels | 388 | - Xiroku optical touch panels |
389 | - Zytronic touch panels | ||
396 | 390 | ||
397 | If unsure, say N. | 391 | If unsure, say N. |
398 | 392 | ||
@@ -662,4 +656,8 @@ config HID_ZYDACRON | |||
662 | 656 | ||
663 | endmenu | 657 | endmenu |
664 | 658 | ||
665 | endif # HID_SUPPORT | 659 | endif # HID |
660 | |||
661 | source "drivers/hid/usbhid/Kconfig" | ||
662 | |||
663 | endmenu | ||
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index fa10f847f7db..585344b6d338 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -517,6 +517,12 @@ static const struct hid_device_id apple_devices[] = { | |||
517 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | 517 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, |
518 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), | 518 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), |
519 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | 519 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
520 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), | ||
521 | .driver_data = APPLE_HAS_FN }, | ||
522 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), | ||
523 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | ||
524 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), | ||
525 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | ||
520 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), | 526 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), |
521 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | 527 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
522 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), | 528 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8e3a6b261477..4c87276c8ddb 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1503,6 +1503,9 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1503 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, | 1503 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, |
1504 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, | 1504 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, |
1505 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, | 1505 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, |
1506 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) }, | ||
1507 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) }, | ||
1508 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) }, | ||
1506 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, | 1509 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, |
1507 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, | 1510 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, |
1508 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, | 1511 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, |
@@ -1880,6 +1883,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1880 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)}, | 1883 | { 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)}, | 1884 | { 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) }, | 1885 | { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) }, |
1886 | { 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) }, | 1887 | { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, |
1884 | { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, | 1888 | { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, |
1885 | { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, | 1889 | { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, |
@@ -1994,6 +1998,7 @@ static const struct hid_device_id hid_ignore_list[] = { | |||
1994 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MCT) }, | 1998 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MCT) }, |
1995 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) }, | 1999 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) }, |
1996 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) }, | 2000 | { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) }, |
2001 | { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_BEATPAD) }, | ||
1997 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) }, | 2002 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) }, |
1998 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) }, | 2003 | { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) }, |
1999 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) }, | 2004 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) }, |
@@ -2088,6 +2093,9 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { | |||
2088 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, | 2093 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, |
2089 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, | 2094 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, |
2090 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, | 2095 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, |
2096 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) }, | ||
2097 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) }, | ||
2098 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) }, | ||
2091 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, | 2099 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, |
2092 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, | 2100 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, |
2093 | { } | 2101 | { } |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 9373f535dfe9..32039235cfee 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -125,6 +125,9 @@ | |||
125 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c | 125 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c |
126 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d | 126 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d |
127 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e | 127 | #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e |
128 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 | ||
129 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 | ||
130 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 | ||
128 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 | 131 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239 |
129 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a | 132 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a |
130 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b | 133 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b |
@@ -160,6 +163,9 @@ | |||
160 | #define USB_VENDOR_ID_AVERMEDIA 0x07ca | 163 | #define USB_VENDOR_ID_AVERMEDIA 0x07ca |
161 | #define USB_DEVICE_ID_AVER_FM_MR800 0xb800 | 164 | #define USB_DEVICE_ID_AVER_FM_MR800 0xb800 |
162 | 165 | ||
166 | #define USB_VENDOR_ID_AXENTIA 0x12cf | ||
167 | #define USB_DEVICE_ID_AXENTIA_FM_RADIO 0x7111 | ||
168 | |||
163 | #define USB_VENDOR_ID_BAANTO 0x2453 | 169 | #define USB_VENDOR_ID_BAANTO 0x2453 |
164 | #define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100 | 170 | #define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100 |
165 | 171 | ||
@@ -515,6 +521,9 @@ | |||
515 | #define USB_DEVICE_ID_CRYSTALTOUCH 0x0006 | 521 | #define USB_DEVICE_ID_CRYSTALTOUCH 0x0006 |
516 | #define USB_DEVICE_ID_CRYSTALTOUCH_DUAL 0x0007 | 522 | #define USB_DEVICE_ID_CRYSTALTOUCH_DUAL 0x0007 |
517 | 523 | ||
524 | #define USB_VENDOR_ID_MADCATZ 0x0738 | ||
525 | #define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540 | ||
526 | |||
518 | #define USB_VENDOR_ID_MCC 0x09db | 527 | #define USB_VENDOR_ID_MCC 0x09db |
519 | #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 | 528 | #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 |
520 | #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a | 529 | #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a |
@@ -650,6 +659,9 @@ | |||
650 | #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 | 659 | #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 |
651 | #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600 | 660 | #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600 |
652 | 661 | ||
662 | #define USB_VENDOR_ID_SENNHEISER 0x1395 | ||
663 | #define USB_DEVICE_ID_SENNHEISER_BTD500USB 0x002c | ||
664 | |||
653 | #define USB_VENDOR_ID_SIGMA_MICRO 0x1c4f | 665 | #define USB_VENDOR_ID_SIGMA_MICRO 0x1c4f |
654 | #define USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD 0x0002 | 666 | #define USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD 0x0002 |
655 | 667 | ||
@@ -799,6 +811,9 @@ | |||
799 | #define USB_VENDOR_ID_ZYDACRON 0x13EC | 811 | #define USB_VENDOR_ID_ZYDACRON 0x13EC |
800 | #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 | 812 | #define USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL 0x0006 |
801 | 813 | ||
814 | #define USB_VENDOR_ID_ZYTRONIC 0x14c8 | ||
815 | #define USB_DEVICE_ID_ZYTRONIC_ZXY100 0x0005 | ||
816 | |||
802 | #define USB_VENDOR_ID_PRIMAX 0x0461 | 817 | #define USB_VENDOR_ID_PRIMAX 0x0461 |
803 | #define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05 | 818 | #define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05 |
804 | 819 | ||
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 132b0019365e..5301006f6c15 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -301,6 +301,9 @@ static const struct hid_device_id hid_battery_quirks[] = { | |||
301 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, | 301 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, |
302 | USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI), | 302 | USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI), |
303 | HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE }, | 303 | HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE }, |
304 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, | ||
305 | USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI), | ||
306 | HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE }, | ||
304 | {} | 307 | {} |
305 | }; | 308 | }; |
306 | 309 | ||
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/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 6e3332a99976..76479246d4ee 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
@@ -1048,6 +1048,11 @@ static const struct hid_device_id mt_devices[] = { | |||
1048 | MT_USB_DEVICE(USB_VENDOR_ID_XIROKU, | 1048 | MT_USB_DEVICE(USB_VENDOR_ID_XIROKU, |
1049 | USB_DEVICE_ID_XIROKU_CSR2) }, | 1049 | USB_DEVICE_ID_XIROKU_CSR2) }, |
1050 | 1050 | ||
1051 | /* Zytronic panels */ | ||
1052 | { .driver_data = MT_CLS_SERIAL, | ||
1053 | MT_USB_DEVICE(USB_VENDOR_ID_ZYTRONIC, | ||
1054 | USB_DEVICE_ID_ZYTRONIC_ZXY100) }, | ||
1055 | |||
1051 | /* Generic MT device */ | 1056 | /* Generic MT device */ |
1052 | { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) }, | 1057 | { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) }, |
1053 | { } | 1058 | { } |
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/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 0597ee604f6e..903eef3d3e10 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -76,6 +76,7 @@ static const struct hid_blacklist { | |||
76 | { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET }, | 76 | { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET }, |
77 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NOGET }, | 77 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NOGET }, |
78 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET }, | 78 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET }, |
79 | { USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET }, | ||
79 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, | 80 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, |
80 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET }, | 81 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET }, |
81 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET }, | 82 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET }, |
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 b9d512331ed4..637c51c11b44 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -191,6 +191,24 @@ static ssize_t show_temp(struct device *dev, | |||
191 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; | 191 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; |
192 | } | 192 | } |
193 | 193 | ||
194 | struct tjmax { | ||
195 | char const *id; | ||
196 | int tjmax; | ||
197 | }; | ||
198 | |||
199 | static struct tjmax __cpuinitconst tjmax_table[] = { | ||
200 | { "CPU D410", 100000 }, | ||
201 | { "CPU D425", 100000 }, | ||
202 | { "CPU D510", 100000 }, | ||
203 | { "CPU D525", 100000 }, | ||
204 | { "CPU N450", 100000 }, | ||
205 | { "CPU N455", 100000 }, | ||
206 | { "CPU N470", 100000 }, | ||
207 | { "CPU N475", 100000 }, | ||
208 | { "CPU 230", 100000 }, | ||
209 | { "CPU 330", 125000 }, | ||
210 | }; | ||
211 | |||
194 | static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | 212 | static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, |
195 | struct device *dev) | 213 | struct device *dev) |
196 | { | 214 | { |
@@ -202,6 +220,13 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | |||
202 | int err; | 220 | int err; |
203 | u32 eax, edx; | 221 | u32 eax, edx; |
204 | struct pci_dev *host_bridge; | 222 | struct pci_dev *host_bridge; |
223 | int i; | ||
224 | |||
225 | /* explicit tjmax table entries override heuristics */ | ||
226 | for (i = 0; i < ARRAY_SIZE(tjmax_table); i++) { | ||
227 | if (strstr(c->x86_model_id, tjmax_table[i].id)) | ||
228 | return tjmax_table[i].tjmax; | ||
229 | } | ||
205 | 230 | ||
206 | /* Early chips have no MSR for TjMax */ | 231 | /* Early chips have no MSR for TjMax */ |
207 | 232 | ||
@@ -210,7 +235,8 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | |||
210 | 235 | ||
211 | /* Atom CPUs */ | 236 | /* Atom CPUs */ |
212 | 237 | ||
213 | if (c->x86_model == 0x1c) { | 238 | if (c->x86_model == 0x1c || c->x86_model == 0x26 |
239 | || c->x86_model == 0x27) { | ||
214 | usemsr_ee = 0; | 240 | usemsr_ee = 0; |
215 | 241 | ||
216 | host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); | 242 | host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); |
@@ -223,6 +249,9 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | |||
223 | tjmax = 90000; | 249 | tjmax = 90000; |
224 | 250 | ||
225 | pci_dev_put(host_bridge); | 251 | pci_dev_put(host_bridge); |
252 | } else if (c->x86_model == 0x36) { | ||
253 | usemsr_ee = 0; | ||
254 | tjmax = 100000; | ||
226 | } | 255 | } |
227 | 256 | ||
228 | if (c->x86_model > 0xe && usemsr_ee) { | 257 | if (c->x86_model > 0xe && usemsr_ee) { |
@@ -664,7 +693,7 @@ static void __cpuinit get_core_online(unsigned int cpu) | |||
664 | * sensors. We check this bit only, all the early CPUs | 693 | * sensors. We check this bit only, all the early CPUs |
665 | * without thermal sensors will be filtered out. | 694 | * without thermal sensors will be filtered out. |
666 | */ | 695 | */ |
667 | if (!cpu_has(c, X86_FEATURE_DTS)) | 696 | if (!cpu_has(c, X86_FEATURE_DTHERM)) |
668 | return; | 697 | return; |
669 | 698 | ||
670 | if (!pdev) { | 699 | if (!pdev) { |
@@ -765,14 +794,14 @@ static struct notifier_block coretemp_cpu_notifier __refdata = { | |||
765 | }; | 794 | }; |
766 | 795 | ||
767 | static const struct x86_cpu_id coretemp_ids[] = { | 796 | static const struct x86_cpu_id coretemp_ids[] = { |
768 | { 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 }, |
769 | {} | 798 | {} |
770 | }; | 799 | }; |
771 | MODULE_DEVICE_TABLE(x86cpu, coretemp_ids); | 800 | MODULE_DEVICE_TABLE(x86cpu, coretemp_ids); |
772 | 801 | ||
773 | static int __init coretemp_init(void) | 802 | static int __init coretemp_init(void) |
774 | { | 803 | { |
775 | int i, err = -ENODEV; | 804 | int i, err; |
776 | 805 | ||
777 | /* | 806 | /* |
778 | * CPUID.06H.EAX[0] indicates whether the CPU has thermal | 807 | * CPUID.06H.EAX[0] indicates whether the CPU has thermal |
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/it87.c b/drivers/hwmon/it87.c index e7701d99f8e8..f1de3979181f 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -2341,7 +2341,7 @@ static void __devinit it87_init_device(struct platform_device *pdev) | |||
2341 | 2341 | ||
2342 | /* Start monitoring */ | 2342 | /* Start monitoring */ |
2343 | it87_write_value(data, IT87_REG_CONFIG, | 2343 | it87_write_value(data, IT87_REG_CONFIG, |
2344 | (it87_read_value(data, IT87_REG_CONFIG) & 0x36) | 2344 | (it87_read_value(data, IT87_REG_CONFIG) & 0x3e) |
2345 | | (update_vbat ? 0x41 : 0x01)); | 2345 | | (update_vbat ? 0x41 : 0x01)); |
2346 | } | 2346 | } |
2347 | 2347 | ||
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/ide/icside.c b/drivers/ide/icside.c index 8716066a2f2b..bcb507b0cfd4 100644 --- a/drivers/ide/icside.c +++ b/drivers/ide/icside.c | |||
@@ -236,7 +236,7 @@ static const struct ide_port_ops icside_v6_no_dma_port_ops = { | |||
236 | */ | 236 | */ |
237 | static void icside_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) | 237 | static void icside_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) |
238 | { | 238 | { |
239 | unsigned long cycle_time; | 239 | unsigned long cycle_time = 0; |
240 | int use_dma_info = 0; | 240 | int use_dma_info = 0; |
241 | const u8 xfer_mode = drive->dma_mode; | 241 | const u8 xfer_mode = drive->dma_mode; |
242 | 242 | ||
@@ -271,9 +271,9 @@ static void icside_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) | |||
271 | 271 | ||
272 | ide_set_drivedata(drive, (void *)cycle_time); | 272 | ide_set_drivedata(drive, (void *)cycle_time); |
273 | 273 | ||
274 | printk("%s: %s selected (peak %dMB/s)\n", drive->name, | 274 | printk(KERN_INFO "%s: %s selected (peak %luMB/s)\n", |
275 | ide_xfer_verbose(xfer_mode), | 275 | drive->name, ide_xfer_verbose(xfer_mode), |
276 | 2000 / (unsigned long)ide_get_drivedata(drive)); | 276 | 2000 / (cycle_time ? cycle_time : (unsigned long) -1)); |
277 | } | 277 | } |
278 | 278 | ||
279 | static const struct ide_port_ops icside_v6_port_ops = { | 279 | static const struct ide_port_ops icside_v6_port_ops = { |
@@ -375,8 +375,6 @@ static const struct ide_dma_ops icside_v6_dma_ops = { | |||
375 | .dma_test_irq = icside_dma_test_irq, | 375 | .dma_test_irq = icside_dma_test_irq, |
376 | .dma_lost_irq = ide_dma_lost_irq, | 376 | .dma_lost_irq = ide_dma_lost_irq, |
377 | }; | 377 | }; |
378 | #else | ||
379 | #define icside_v6_dma_ops NULL | ||
380 | #endif | 378 | #endif |
381 | 379 | ||
382 | static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d) | 380 | static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d) |
@@ -456,7 +454,6 @@ err_free: | |||
456 | static const struct ide_port_info icside_v6_port_info __initdata = { | 454 | static const struct ide_port_info icside_v6_port_info __initdata = { |
457 | .init_dma = icside_dma_off_init, | 455 | .init_dma = icside_dma_off_init, |
458 | .port_ops = &icside_v6_no_dma_port_ops, | 456 | .port_ops = &icside_v6_no_dma_port_ops, |
459 | .dma_ops = &icside_v6_dma_ops, | ||
460 | .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO, | 457 | .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO, |
461 | .mwdma_mask = ATA_MWDMA2, | 458 | .mwdma_mask = ATA_MWDMA2, |
462 | .swdma_mask = ATA_SWDMA2, | 459 | .swdma_mask = ATA_SWDMA2, |
@@ -518,11 +515,13 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) | |||
518 | 515 | ||
519 | ecard_set_drvdata(ec, state); | 516 | ecard_set_drvdata(ec, state); |
520 | 517 | ||
518 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS | ||
521 | if (ec->dma != NO_DMA && !request_dma(ec->dma, DRV_NAME)) { | 519 | if (ec->dma != NO_DMA && !request_dma(ec->dma, DRV_NAME)) { |
522 | d.init_dma = icside_dma_init; | 520 | d.init_dma = icside_dma_init; |
523 | d.port_ops = &icside_v6_port_ops; | 521 | d.port_ops = &icside_v6_port_ops; |
524 | } else | 522 | d.dma_ops = &icside_v6_dma_ops; |
525 | d.dma_ops = NULL; | 523 | } |
524 | #endif | ||
526 | 525 | ||
527 | ret = ide_host_register(host, &d, hws); | 526 | ret = ide_host_register(host, &d, hws); |
528 | if (ret) | 527 | if (ret) |
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c index 28e344ea514c..f1e922e2479a 100644 --- a/drivers/ide/ide-cs.c +++ b/drivers/ide/ide-cs.c | |||
@@ -167,7 +167,8 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev, void *priv_data) | |||
167 | { | 167 | { |
168 | int *is_kme = priv_data; | 168 | int *is_kme = priv_data; |
169 | 169 | ||
170 | if (!(pdev->resource[0]->flags & IO_DATA_PATH_WIDTH_8)) { | 170 | if ((pdev->resource[0]->flags & IO_DATA_PATH_WIDTH) |
171 | != IO_DATA_PATH_WIDTH_8) { | ||
171 | pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; | 172 | pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
172 | pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; | 173 | pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
173 | } | 174 | } |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index d0f59c3f87ef..a759a4c4bb0a 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -169,6 +169,38 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
169 | .enter = &intel_idle }, | 169 | .enter = &intel_idle }, |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = { | ||
173 | { /* MWAIT C0 */ }, | ||
174 | { /* MWAIT C1 */ | ||
175 | .name = "C1-IVB", | ||
176 | .desc = "MWAIT 0x00", | ||
177 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
178 | .exit_latency = 1, | ||
179 | .target_residency = 1, | ||
180 | .enter = &intel_idle }, | ||
181 | { /* MWAIT C2 */ | ||
182 | .name = "C3-IVB", | ||
183 | .desc = "MWAIT 0x10", | ||
184 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
185 | .exit_latency = 59, | ||
186 | .target_residency = 156, | ||
187 | .enter = &intel_idle }, | ||
188 | { /* MWAIT C3 */ | ||
189 | .name = "C6-IVB", | ||
190 | .desc = "MWAIT 0x20", | ||
191 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
192 | .exit_latency = 80, | ||
193 | .target_residency = 300, | ||
194 | .enter = &intel_idle }, | ||
195 | { /* MWAIT C4 */ | ||
196 | .name = "C7-IVB", | ||
197 | .desc = "MWAIT 0x30", | ||
198 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, | ||
199 | .exit_latency = 87, | ||
200 | .target_residency = 300, | ||
201 | .enter = &intel_idle }, | ||
202 | }; | ||
203 | |||
172 | static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { | 204 | static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { |
173 | { /* MWAIT C0 */ }, | 205 | { /* MWAIT C0 */ }, |
174 | { /* MWAIT C1 */ | 206 | { /* MWAIT C1 */ |
@@ -347,6 +379,10 @@ static const struct idle_cpu idle_cpu_snb = { | |||
347 | .state_table = snb_cstates, | 379 | .state_table = snb_cstates, |
348 | }; | 380 | }; |
349 | 381 | ||
382 | static const struct idle_cpu idle_cpu_ivb = { | ||
383 | .state_table = ivb_cstates, | ||
384 | }; | ||
385 | |||
350 | #define ICPU(model, cpu) \ | 386 | #define ICPU(model, cpu) \ |
351 | { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu } | 387 | { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu } |
352 | 388 | ||
@@ -362,6 +398,7 @@ static const struct x86_cpu_id intel_idle_ids[] = { | |||
362 | ICPU(0x2f, idle_cpu_nehalem), | 398 | ICPU(0x2f, idle_cpu_nehalem), |
363 | ICPU(0x2a, idle_cpu_snb), | 399 | ICPU(0x2a, idle_cpu_snb), |
364 | ICPU(0x2d, idle_cpu_snb), | 400 | ICPU(0x2d, idle_cpu_snb), |
401 | ICPU(0x3a, idle_cpu_ivb), | ||
365 | {} | 402 | {} |
366 | }; | 403 | }; |
367 | MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids); | 404 | MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids); |
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/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 5c1bc995e560..f10221f40803 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -123,7 +123,7 @@ static void ipoib_ud_skb_put_frags(struct ipoib_dev_priv *priv, | |||
123 | 123 | ||
124 | skb_frag_size_set(frag, size); | 124 | skb_frag_size_set(frag, size); |
125 | skb->data_len += size; | 125 | skb->data_len += size; |
126 | skb->truesize += size; | 126 | skb->truesize += PAGE_SIZE; |
127 | } else | 127 | } else |
128 | skb_put(skb, length); | 128 | skb_put(skb, length); |
129 | 129 | ||
@@ -156,14 +156,18 @@ static struct sk_buff *ipoib_alloc_rx_skb(struct net_device *dev, int id) | |||
156 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 156 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
157 | struct sk_buff *skb; | 157 | struct sk_buff *skb; |
158 | int buf_size; | 158 | int buf_size; |
159 | int tailroom; | ||
159 | u64 *mapping; | 160 | u64 *mapping; |
160 | 161 | ||
161 | if (ipoib_ud_need_sg(priv->max_ib_mtu)) | 162 | if (ipoib_ud_need_sg(priv->max_ib_mtu)) { |
162 | buf_size = IPOIB_UD_HEAD_SIZE; | 163 | buf_size = IPOIB_UD_HEAD_SIZE; |
163 | else | 164 | tailroom = 128; /* reserve some tailroom for IP/TCP headers */ |
165 | } else { | ||
164 | buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); | 166 | buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); |
167 | tailroom = 0; | ||
168 | } | ||
165 | 169 | ||
166 | skb = dev_alloc_skb(buf_size + 4); | 170 | skb = dev_alloc_skb(buf_size + tailroom + 4); |
167 | if (unlikely(!skb)) | 171 | if (unlikely(!skb)) |
168 | return NULL; | 172 | return NULL; |
169 | 173 | ||
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/joystick/xpad.c b/drivers/input/joystick/xpad.c index ee16fb67b7ae..83811e45d633 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
@@ -142,6 +142,7 @@ static const struct xpad_device { | |||
142 | { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX }, | 142 | { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX }, |
143 | { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, | 143 | { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, |
144 | { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX }, | 144 | { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX }, |
145 | { 0x0d2f, 0x0002, "Andamiro Pump It Up pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, | ||
145 | { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX }, | 146 | { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX }, |
146 | { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX }, | 147 | { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX }, |
147 | { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX }, | 148 | { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX }, |
@@ -164,6 +165,7 @@ static const struct xpad_device { | |||
164 | { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, | 165 | { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, |
165 | { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, | 166 | { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, |
166 | { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, | 167 | { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, |
168 | { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, | ||
167 | { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, | 169 | { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, |
168 | { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } | 170 | { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } |
169 | }; | 171 | }; |
@@ -238,12 +240,14 @@ static struct usb_device_id xpad_table [] = { | |||
238 | XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ | 240 | XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ |
239 | XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ | 241 | XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ |
240 | XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ | 242 | XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ |
243 | { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */ | ||
241 | XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ | 244 | XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ |
242 | XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ | 245 | XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ |
243 | XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ | 246 | XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ |
244 | XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */ | 247 | XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */ |
245 | XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ | 248 | XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ |
246 | XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ | 249 | XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ |
250 | XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ | ||
247 | { } | 251 | { } |
248 | }; | 252 | }; |
249 | 253 | ||
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/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 2cf681d98c0d..d528c23e194f 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -79,6 +79,10 @@ | |||
79 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252 | 79 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252 |
80 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253 | 80 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253 |
81 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254 | 81 | #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254 |
82 | /* MacbookPro10,1 (unibody, June 2012) */ | ||
83 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 | ||
84 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 | ||
85 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 | ||
82 | 86 | ||
83 | #define BCM5974_DEVICE(prod) { \ | 87 | #define BCM5974_DEVICE(prod) { \ |
84 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ | 88 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ |
@@ -128,6 +132,10 @@ static const struct usb_device_id bcm5974_table[] = { | |||
128 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), | 132 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), |
129 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), | 133 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), |
130 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), | 134 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), |
135 | /* MacbookPro10,1 */ | ||
136 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), | ||
137 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), | ||
138 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), | ||
131 | /* Terminating entry */ | 139 | /* Terminating entry */ |
132 | {} | 140 | {} |
133 | }; | 141 | }; |
@@ -354,6 +362,18 @@ static const struct bcm5974_config bcm5974_config_table[] = { | |||
354 | { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, | 362 | { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, |
355 | { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } | 363 | { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } |
356 | }, | 364 | }, |
365 | { | ||
366 | USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI, | ||
367 | USB_DEVICE_ID_APPLE_WELLSPRING7_ISO, | ||
368 | USB_DEVICE_ID_APPLE_WELLSPRING7_JIS, | ||
369 | HAS_INTEGRATED_BUTTON, | ||
370 | 0x84, sizeof(struct bt_data), | ||
371 | 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, | ||
372 | { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, | ||
373 | { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, | ||
374 | { DIM_X, DIM_X / SN_COORD, -4750, 5280 }, | ||
375 | { DIM_Y, DIM_Y / SN_COORD, -150, 6730 } | ||
376 | }, | ||
357 | {} | 377 | {} |
358 | }; | 378 | }; |
359 | 379 | ||
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/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c index 1a0ae4445ff2..5f21f629b7ae 100644 --- a/drivers/isdn/mISDN/stack.c +++ b/drivers/isdn/mISDN/stack.c | |||
@@ -135,8 +135,8 @@ send_layer2(struct mISDNstack *st, struct sk_buff *skb) | |||
135 | skb = NULL; | 135 | skb = NULL; |
136 | else if (*debug & DEBUG_SEND_ERR) | 136 | else if (*debug & DEBUG_SEND_ERR) |
137 | printk(KERN_DEBUG | 137 | printk(KERN_DEBUG |
138 | "%s ch%d mgr prim(%x) addr(%x) err %d\n", | 138 | "%s mgr prim(%x) err %d\n", |
139 | __func__, ch->nr, hh->prim, ch->addr, ret); | 139 | __func__, hh->prim, ret); |
140 | } | 140 | } |
141 | out: | 141 | out: |
142 | mutex_unlock(&st->lmutex); | 142 | mutex_unlock(&st->lmutex); |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 04cb8c88d74b..12b2b55c519e 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -379,7 +379,7 @@ config LEDS_NETXBIG | |||
379 | 379 | ||
380 | config LEDS_ASIC3 | 380 | config LEDS_ASIC3 |
381 | bool "LED support for the HTC ASIC3" | 381 | bool "LED support for the HTC ASIC3" |
382 | depends on LEDS_CLASS | 382 | depends on LEDS_CLASS=y |
383 | depends on MFD_ASIC3 | 383 | depends on MFD_ASIC3 |
384 | default y | 384 | default y |
385 | help | 385 | help |
@@ -390,7 +390,7 @@ config LEDS_ASIC3 | |||
390 | 390 | ||
391 | config LEDS_RENESAS_TPU | 391 | config LEDS_RENESAS_TPU |
392 | bool "LED support for Renesas TPU" | 392 | bool "LED support for Renesas TPU" |
393 | depends on LEDS_CLASS && HAVE_CLK && GENERIC_GPIO | 393 | depends on LEDS_CLASS=y && HAVE_CLK && GENERIC_GPIO |
394 | help | 394 | help |
395 | This option enables build of the LED TPU platform driver, | 395 | This option enables build of the LED TPU platform driver, |
396 | suitable to drive any TPU channel on newer Renesas SoCs. | 396 | suitable to drive any TPU channel on newer Renesas SoCs. |
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 8ee92c81aec2..e663e6f413e9 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -29,7 +29,7 @@ static void led_update_brightness(struct led_classdev *led_cdev) | |||
29 | led_cdev->brightness = led_cdev->brightness_get(led_cdev); | 29 | led_cdev->brightness = led_cdev->brightness_get(led_cdev); |
30 | } | 30 | } |
31 | 31 | ||
32 | static ssize_t led_brightness_show(struct device *dev, | 32 | static ssize_t led_brightness_show(struct device *dev, |
33 | struct device_attribute *attr, char *buf) | 33 | struct device_attribute *attr, char *buf) |
34 | { | 34 | { |
35 | struct led_classdev *led_cdev = dev_get_drvdata(dev); | 35 | struct led_classdev *led_cdev = dev_get_drvdata(dev); |
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index d6860043f6f9..d65353d8d3fc 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/led-core.c | |||
@@ -44,13 +44,6 @@ static void led_set_software_blink(struct led_classdev *led_cdev, | |||
44 | if (!led_cdev->blink_brightness) | 44 | if (!led_cdev->blink_brightness) |
45 | led_cdev->blink_brightness = led_cdev->max_brightness; | 45 | led_cdev->blink_brightness = led_cdev->max_brightness; |
46 | 46 | ||
47 | if (led_get_trigger_data(led_cdev) && | ||
48 | delay_on == led_cdev->blink_delay_on && | ||
49 | delay_off == led_cdev->blink_delay_off) | ||
50 | return; | ||
51 | |||
52 | led_stop_software_blink(led_cdev); | ||
53 | |||
54 | led_cdev->blink_delay_on = delay_on; | 47 | led_cdev->blink_delay_on = delay_on; |
55 | led_cdev->blink_delay_off = delay_off; | 48 | led_cdev->blink_delay_off = delay_off; |
56 | 49 | ||
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-raid1.c b/drivers/md/dm-raid1.c index d039de8322f0..b58b7a33914a 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -1084,6 +1084,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1084 | ti->split_io = dm_rh_get_region_size(ms->rh); | 1084 | ti->split_io = dm_rh_get_region_size(ms->rh); |
1085 | ti->num_flush_requests = 1; | 1085 | ti->num_flush_requests = 1; |
1086 | ti->num_discard_requests = 1; | 1086 | ti->num_discard_requests = 1; |
1087 | ti->discard_zeroes_data_unsupported = 1; | ||
1087 | 1088 | ||
1088 | ms->kmirrord_wq = alloc_workqueue("kmirrord", | 1089 | ms->kmirrord_wq = alloc_workqueue("kmirrord", |
1089 | WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); | 1090 | WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); |
@@ -1214,7 +1215,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, | |||
1214 | * We need to dec pending if this was a write. | 1215 | * We need to dec pending if this was a write. |
1215 | */ | 1216 | */ |
1216 | if (rw == WRITE) { | 1217 | if (rw == WRITE) { |
1217 | if (!(bio->bi_rw & REQ_FLUSH)) | 1218 | if (!(bio->bi_rw & (REQ_FLUSH | REQ_DISCARD))) |
1218 | dm_rh_dec(ms->rh, map_context->ll); | 1219 | dm_rh_dec(ms->rh, map_context->ll); |
1219 | return error; | 1220 | return error; |
1220 | } | 1221 | } |
diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c index 7771ed212182..69732e03eb34 100644 --- a/drivers/md/dm-region-hash.c +++ b/drivers/md/dm-region-hash.c | |||
@@ -404,6 +404,9 @@ void dm_rh_mark_nosync(struct dm_region_hash *rh, struct bio *bio) | |||
404 | return; | 404 | return; |
405 | } | 405 | } |
406 | 406 | ||
407 | if (bio->bi_rw & REQ_DISCARD) | ||
408 | return; | ||
409 | |||
407 | /* We must inform the log that the sync count has changed. */ | 410 | /* We must inform the log that the sync count has changed. */ |
408 | log->type->set_region_sync(log, region, 0); | 411 | log->type->set_region_sync(log, region, 0); |
409 | 412 | ||
@@ -524,7 +527,7 @@ void dm_rh_inc_pending(struct dm_region_hash *rh, struct bio_list *bios) | |||
524 | struct bio *bio; | 527 | struct bio *bio; |
525 | 528 | ||
526 | for (bio = bios->head; bio; bio = bio->bi_next) { | 529 | for (bio = bios->head; bio; bio = bio->bi_next) { |
527 | if (bio->bi_rw & REQ_FLUSH) | 530 | if (bio->bi_rw & (REQ_FLUSH | REQ_DISCARD)) |
528 | continue; | 531 | continue; |
529 | rh_inc(rh, dm_rh_bio_to_region(rh, bio)); | 532 | rh_inc(rh, dm_rh_bio_to_region(rh, bio)); |
530 | } | 533 | } |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 37fdaf81bd1f..68694da0d21d 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -1245,7 +1245,10 @@ static void process_discard(struct thin_c *tc, struct bio *bio) | |||
1245 | 1245 | ||
1246 | cell_release_singleton(cell, bio); | 1246 | cell_release_singleton(cell, bio); |
1247 | cell_release_singleton(cell2, bio); | 1247 | cell_release_singleton(cell2, bio); |
1248 | remap_and_issue(tc, bio, lookup_result.block); | 1248 | if ((!lookup_result.shared) && pool->pf.discard_passdown) |
1249 | remap_and_issue(tc, bio, lookup_result.block); | ||
1250 | else | ||
1251 | bio_endio(bio, 0); | ||
1249 | } | 1252 | } |
1250 | break; | 1253 | break; |
1251 | 1254 | ||
@@ -2292,6 +2295,13 @@ static int process_reserve_metadata_snap_mesg(unsigned argc, char **argv, struct | |||
2292 | if (r) | 2295 | if (r) |
2293 | return r; | 2296 | return r; |
2294 | 2297 | ||
2298 | r = dm_pool_commit_metadata(pool->pmd); | ||
2299 | if (r) { | ||
2300 | DMERR("%s: dm_pool_commit_metadata() failed, error = %d", | ||
2301 | __func__, r); | ||
2302 | return r; | ||
2303 | } | ||
2304 | |||
2295 | r = dm_pool_reserve_metadata_snap(pool->pmd); | 2305 | r = dm_pool_reserve_metadata_snap(pool->pmd); |
2296 | if (r) | 2306 | if (r) |
2297 | DMWARN("reserve_metadata_snap message failed."); | 2307 | DMWARN("reserve_metadata_snap message failed."); |
@@ -2621,6 +2631,7 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
2621 | if (tc->pool->pf.discard_enabled) { | 2631 | if (tc->pool->pf.discard_enabled) { |
2622 | ti->discards_supported = 1; | 2632 | ti->discards_supported = 1; |
2623 | ti->num_discard_requests = 1; | 2633 | ti->num_discard_requests = 1; |
2634 | ti->discard_zeroes_data_unsupported = 1; | ||
2624 | } | 2635 | } |
2625 | 2636 | ||
2626 | dm_put(pool_md); | 2637 | dm_put(pool_md); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 1c2f9048e1ae..d5ab4493c8be 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2931,6 +2931,7 @@ offset_store(struct md_rdev *rdev, const char *buf, size_t len) | |||
2931 | * can be sane */ | 2931 | * can be sane */ |
2932 | return -EBUSY; | 2932 | return -EBUSY; |
2933 | rdev->data_offset = offset; | 2933 | rdev->data_offset = offset; |
2934 | rdev->new_data_offset = offset; | ||
2934 | return len; | 2935 | return len; |
2935 | } | 2936 | } |
2936 | 2937 | ||
@@ -3926,8 +3927,8 @@ array_state_show(struct mddev *mddev, char *page) | |||
3926 | return sprintf(page, "%s\n", array_states[st]); | 3927 | return sprintf(page, "%s\n", array_states[st]); |
3927 | } | 3928 | } |
3928 | 3929 | ||
3929 | static int do_md_stop(struct mddev * mddev, int ro, int is_open); | 3930 | static int do_md_stop(struct mddev * mddev, int ro, struct block_device *bdev); |
3930 | static int md_set_readonly(struct mddev * mddev, int is_open); | 3931 | static int md_set_readonly(struct mddev * mddev, struct block_device *bdev); |
3931 | static int do_md_run(struct mddev * mddev); | 3932 | static int do_md_run(struct mddev * mddev); |
3932 | static int restart_array(struct mddev *mddev); | 3933 | static int restart_array(struct mddev *mddev); |
3933 | 3934 | ||
@@ -3943,14 +3944,14 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len) | |||
3943 | /* stopping an active array */ | 3944 | /* stopping an active array */ |
3944 | if (atomic_read(&mddev->openers) > 0) | 3945 | if (atomic_read(&mddev->openers) > 0) |
3945 | return -EBUSY; | 3946 | return -EBUSY; |
3946 | err = do_md_stop(mddev, 0, 0); | 3947 | err = do_md_stop(mddev, 0, NULL); |
3947 | break; | 3948 | break; |
3948 | case inactive: | 3949 | case inactive: |
3949 | /* stopping an active array */ | 3950 | /* stopping an active array */ |
3950 | if (mddev->pers) { | 3951 | if (mddev->pers) { |
3951 | if (atomic_read(&mddev->openers) > 0) | 3952 | if (atomic_read(&mddev->openers) > 0) |
3952 | return -EBUSY; | 3953 | return -EBUSY; |
3953 | err = do_md_stop(mddev, 2, 0); | 3954 | err = do_md_stop(mddev, 2, NULL); |
3954 | } else | 3955 | } else |
3955 | err = 0; /* already inactive */ | 3956 | err = 0; /* already inactive */ |
3956 | break; | 3957 | break; |
@@ -3958,7 +3959,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len) | |||
3958 | break; /* not supported yet */ | 3959 | break; /* not supported yet */ |
3959 | case readonly: | 3960 | case readonly: |
3960 | if (mddev->pers) | 3961 | if (mddev->pers) |
3961 | err = md_set_readonly(mddev, 0); | 3962 | err = md_set_readonly(mddev, NULL); |
3962 | else { | 3963 | else { |
3963 | mddev->ro = 1; | 3964 | mddev->ro = 1; |
3964 | set_disk_ro(mddev->gendisk, 1); | 3965 | set_disk_ro(mddev->gendisk, 1); |
@@ -3968,7 +3969,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len) | |||
3968 | case read_auto: | 3969 | case read_auto: |
3969 | if (mddev->pers) { | 3970 | if (mddev->pers) { |
3970 | if (mddev->ro == 0) | 3971 | if (mddev->ro == 0) |
3971 | err = md_set_readonly(mddev, 0); | 3972 | err = md_set_readonly(mddev, NULL); |
3972 | else if (mddev->ro == 1) | 3973 | else if (mddev->ro == 1) |
3973 | err = restart_array(mddev); | 3974 | err = restart_array(mddev); |
3974 | if (err == 0) { | 3975 | if (err == 0) { |
@@ -5351,15 +5352,17 @@ void md_stop(struct mddev *mddev) | |||
5351 | } | 5352 | } |
5352 | EXPORT_SYMBOL_GPL(md_stop); | 5353 | EXPORT_SYMBOL_GPL(md_stop); |
5353 | 5354 | ||
5354 | static int md_set_readonly(struct mddev *mddev, int is_open) | 5355 | static int md_set_readonly(struct mddev *mddev, struct block_device *bdev) |
5355 | { | 5356 | { |
5356 | int err = 0; | 5357 | int err = 0; |
5357 | mutex_lock(&mddev->open_mutex); | 5358 | mutex_lock(&mddev->open_mutex); |
5358 | if (atomic_read(&mddev->openers) > is_open) { | 5359 | if (atomic_read(&mddev->openers) > !!bdev) { |
5359 | printk("md: %s still in use.\n",mdname(mddev)); | 5360 | printk("md: %s still in use.\n",mdname(mddev)); |
5360 | err = -EBUSY; | 5361 | err = -EBUSY; |
5361 | goto out; | 5362 | goto out; |
5362 | } | 5363 | } |
5364 | if (bdev) | ||
5365 | sync_blockdev(bdev); | ||
5363 | if (mddev->pers) { | 5366 | if (mddev->pers) { |
5364 | __md_stop_writes(mddev); | 5367 | __md_stop_writes(mddev); |
5365 | 5368 | ||
@@ -5381,18 +5384,26 @@ out: | |||
5381 | * 0 - completely stop and dis-assemble array | 5384 | * 0 - completely stop and dis-assemble array |
5382 | * 2 - stop but do not disassemble array | 5385 | * 2 - stop but do not disassemble array |
5383 | */ | 5386 | */ |
5384 | static int do_md_stop(struct mddev * mddev, int mode, int is_open) | 5387 | static int do_md_stop(struct mddev * mddev, int mode, |
5388 | struct block_device *bdev) | ||
5385 | { | 5389 | { |
5386 | struct gendisk *disk = mddev->gendisk; | 5390 | struct gendisk *disk = mddev->gendisk; |
5387 | struct md_rdev *rdev; | 5391 | struct md_rdev *rdev; |
5388 | 5392 | ||
5389 | mutex_lock(&mddev->open_mutex); | 5393 | mutex_lock(&mddev->open_mutex); |
5390 | if (atomic_read(&mddev->openers) > is_open || | 5394 | if (atomic_read(&mddev->openers) > !!bdev || |
5391 | mddev->sysfs_active) { | 5395 | mddev->sysfs_active) { |
5392 | printk("md: %s still in use.\n",mdname(mddev)); | 5396 | printk("md: %s still in use.\n",mdname(mddev)); |
5393 | mutex_unlock(&mddev->open_mutex); | 5397 | mutex_unlock(&mddev->open_mutex); |
5394 | return -EBUSY; | 5398 | return -EBUSY; |
5395 | } | 5399 | } |
5400 | if (bdev) | ||
5401 | /* It is possible IO was issued on some other | ||
5402 | * open file which was closed before we took ->open_mutex. | ||
5403 | * As that was not the last close __blkdev_put will not | ||
5404 | * have called sync_blockdev, so we must. | ||
5405 | */ | ||
5406 | sync_blockdev(bdev); | ||
5396 | 5407 | ||
5397 | if (mddev->pers) { | 5408 | if (mddev->pers) { |
5398 | if (mddev->ro) | 5409 | if (mddev->ro) |
@@ -5466,7 +5477,7 @@ static void autorun_array(struct mddev *mddev) | |||
5466 | err = do_md_run(mddev); | 5477 | err = do_md_run(mddev); |
5467 | if (err) { | 5478 | if (err) { |
5468 | printk(KERN_WARNING "md: do_md_run() returned %d\n", err); | 5479 | printk(KERN_WARNING "md: do_md_run() returned %d\n", err); |
5469 | do_md_stop(mddev, 0, 0); | 5480 | do_md_stop(mddev, 0, NULL); |
5470 | } | 5481 | } |
5471 | } | 5482 | } |
5472 | 5483 | ||
@@ -5784,8 +5795,7 @@ static int add_new_disk(struct mddev * mddev, mdu_disk_info_t *info) | |||
5784 | super_types[mddev->major_version]. | 5795 | super_types[mddev->major_version]. |
5785 | validate_super(mddev, rdev); | 5796 | validate_super(mddev, rdev); |
5786 | if ((info->state & (1<<MD_DISK_SYNC)) && | 5797 | if ((info->state & (1<<MD_DISK_SYNC)) && |
5787 | (!test_bit(In_sync, &rdev->flags) || | 5798 | rdev->raid_disk != info->raid_disk) { |
5788 | rdev->raid_disk != info->raid_disk)) { | ||
5789 | /* This was a hot-add request, but events doesn't | 5799 | /* This was a hot-add request, but events doesn't |
5790 | * match, so reject it. | 5800 | * match, so reject it. |
5791 | */ | 5801 | */ |
@@ -6482,11 +6492,11 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode, | |||
6482 | goto done_unlock; | 6492 | goto done_unlock; |
6483 | 6493 | ||
6484 | case STOP_ARRAY: | 6494 | case STOP_ARRAY: |
6485 | err = do_md_stop(mddev, 0, 1); | 6495 | err = do_md_stop(mddev, 0, bdev); |
6486 | goto done_unlock; | 6496 | goto done_unlock; |
6487 | 6497 | ||
6488 | case STOP_ARRAY_RO: | 6498 | case STOP_ARRAY_RO: |
6489 | err = md_set_readonly(mddev, 1); | 6499 | err = md_set_readonly(mddev, bdev); |
6490 | goto done_unlock; | 6500 | goto done_unlock; |
6491 | 6501 | ||
6492 | case BLKROSET: | 6502 | case BLKROSET: |
@@ -6751,7 +6761,7 @@ struct md_thread *md_register_thread(void (*run) (struct mddev *), struct mddev | |||
6751 | thread->tsk = kthread_run(md_thread, thread, | 6761 | thread->tsk = kthread_run(md_thread, thread, |
6752 | "%s_%s", | 6762 | "%s_%s", |
6753 | mdname(thread->mddev), | 6763 | mdname(thread->mddev), |
6754 | name ?: mddev->pers->name); | 6764 | name); |
6755 | if (IS_ERR(thread->tsk)) { | 6765 | if (IS_ERR(thread->tsk)) { |
6756 | kfree(thread); | 6766 | kfree(thread); |
6757 | return NULL; | 6767 | return NULL; |
@@ -7298,6 +7308,7 @@ void md_do_sync(struct mddev *mddev) | |||
7298 | int skipped = 0; | 7308 | int skipped = 0; |
7299 | struct md_rdev *rdev; | 7309 | struct md_rdev *rdev; |
7300 | char *desc; | 7310 | char *desc; |
7311 | struct blk_plug plug; | ||
7301 | 7312 | ||
7302 | /* just incase thread restarts... */ | 7313 | /* just incase thread restarts... */ |
7303 | if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) | 7314 | if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) |
@@ -7447,6 +7458,7 @@ void md_do_sync(struct mddev *mddev) | |||
7447 | } | 7458 | } |
7448 | mddev->curr_resync_completed = j; | 7459 | mddev->curr_resync_completed = j; |
7449 | 7460 | ||
7461 | blk_start_plug(&plug); | ||
7450 | while (j < max_sectors) { | 7462 | while (j < max_sectors) { |
7451 | sector_t sectors; | 7463 | sector_t sectors; |
7452 | 7464 | ||
@@ -7552,6 +7564,7 @@ void md_do_sync(struct mddev *mddev) | |||
7552 | * this also signals 'finished resyncing' to md_stop | 7564 | * this also signals 'finished resyncing' to md_stop |
7553 | */ | 7565 | */ |
7554 | out: | 7566 | out: |
7567 | blk_finish_plug(&plug); | ||
7555 | wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); | 7568 | wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); |
7556 | 7569 | ||
7557 | /* tell personality that we are finished */ | 7570 | /* 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..cacd008d6864 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) |
@@ -1821,8 +1818,14 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) | |||
1821 | 1818 | ||
1822 | if (atomic_dec_and_test(&r1_bio->remaining)) { | 1819 | if (atomic_dec_and_test(&r1_bio->remaining)) { |
1823 | /* if we're here, all write(s) have completed, so clean up */ | 1820 | /* if we're here, all write(s) have completed, so clean up */ |
1824 | md_done_sync(mddev, r1_bio->sectors, 1); | 1821 | int s = r1_bio->sectors; |
1825 | put_buf(r1_bio); | 1822 | if (test_bit(R1BIO_MadeGood, &r1_bio->state) || |
1823 | test_bit(R1BIO_WriteError, &r1_bio->state)) | ||
1824 | reschedule_retry(r1_bio); | ||
1825 | else { | ||
1826 | put_buf(r1_bio); | ||
1827 | md_done_sync(mddev, s, 1); | ||
1828 | } | ||
1826 | } | 1829 | } |
1827 | } | 1830 | } |
1828 | 1831 | ||
@@ -2488,9 +2491,10 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp | |||
2488 | */ | 2491 | */ |
2489 | if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { | 2492 | if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { |
2490 | atomic_set(&r1_bio->remaining, read_targets); | 2493 | atomic_set(&r1_bio->remaining, read_targets); |
2491 | for (i = 0; i < conf->raid_disks * 2; i++) { | 2494 | for (i = 0; i < conf->raid_disks * 2 && read_targets; i++) { |
2492 | bio = r1_bio->bios[i]; | 2495 | bio = r1_bio->bios[i]; |
2493 | if (bio->bi_end_io == end_sync_read) { | 2496 | if (bio->bi_end_io == end_sync_read) { |
2497 | read_targets--; | ||
2494 | md_sync_acct(bio->bi_bdev, nr_sectors); | 2498 | md_sync_acct(bio->bi_bdev, nr_sectors); |
2495 | generic_make_request(bio); | 2499 | generic_make_request(bio); |
2496 | } | 2500 | } |
@@ -2621,7 +2625,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) | |||
2621 | goto abort; | 2625 | goto abort; |
2622 | } | 2626 | } |
2623 | err = -ENOMEM; | 2627 | err = -ENOMEM; |
2624 | conf->thread = md_register_thread(raid1d, mddev, NULL); | 2628 | conf->thread = md_register_thread(raid1d, mddev, "raid1"); |
2625 | if (!conf->thread) { | 2629 | if (!conf->thread) { |
2626 | printk(KERN_ERR | 2630 | printk(KERN_ERR |
2627 | "md/raid1:%s: couldn't allocate thread\n", | 2631 | "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/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 00a67326c193..39eab73b01ae 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -243,6 +243,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
243 | if (minor == MAX_DVB_MINORS) { | 243 | if (minor == MAX_DVB_MINORS) { |
244 | kfree(dvbdevfops); | 244 | kfree(dvbdevfops); |
245 | kfree(dvbdev); | 245 | kfree(dvbdev); |
246 | up_write(&minor_rwsem); | ||
246 | mutex_unlock(&dvbdev_register_lock); | 247 | mutex_unlock(&dvbdev_register_lock); |
247 | return -EINVAL; | 248 | return -EINVAL; |
248 | } | 249 | } |
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/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 342c2c8c1ddf..54ee34872d14 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
@@ -232,7 +232,7 @@ MODULE_PARM_DESC(invert, "Invert the signal from the IR receiver"); | |||
232 | 232 | ||
233 | static bool txandrx; /* default = 0 */ | 233 | static bool txandrx; /* default = 0 */ |
234 | module_param(txandrx, bool, 0444); | 234 | module_param(txandrx, bool, 0444); |
235 | MODULE_PARM_DESC(invert, "Allow simultaneous TX and RX"); | 235 | MODULE_PARM_DESC(txandrx, "Allow simultaneous TX and RX"); |
236 | 236 | ||
237 | static unsigned int wake_sc = 0x800F040C; | 237 | static unsigned int wake_sc = 0x800F040C; |
238 | module_param(wake_sc, uint, 0644); | 238 | module_param(wake_sc, uint, 0644); |
@@ -1032,6 +1032,8 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1032 | data->dev->tx_ir = wbcir_tx; | 1032 | data->dev->tx_ir = wbcir_tx; |
1033 | data->dev->priv = data; | 1033 | data->dev->priv = data; |
1034 | data->dev->dev.parent = &device->dev; | 1034 | data->dev->dev.parent = &device->dev; |
1035 | data->dev->timeout = MS_TO_NS(100); | ||
1036 | data->dev->allowed_protos = RC_TYPE_ALL; | ||
1035 | 1037 | ||
1036 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | 1038 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { |
1037 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | 1039 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", |
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/cx231xx/cx231xx-audio.c b/drivers/media/video/cx231xx/cx231xx-audio.c index 068f78dc5d13..b4c99c7270cf 100644 --- a/drivers/media/video/cx231xx/cx231xx-audio.c +++ b/drivers/media/video/cx231xx/cx231xx-audio.c | |||
@@ -307,7 +307,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev) | |||
307 | urb->context = dev; | 307 | urb->context = dev; |
308 | urb->pipe = usb_rcvisocpipe(dev->udev, | 308 | urb->pipe = usb_rcvisocpipe(dev->udev, |
309 | dev->adev.end_point_addr); | 309 | dev->adev.end_point_addr); |
310 | urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; | 310 | urb->transfer_flags = URB_ISO_ASAP; |
311 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; | 311 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; |
312 | urb->interval = 1; | 312 | urb->interval = 1; |
313 | urb->complete = cx231xx_audio_isocirq; | 313 | urb->complete = cx231xx_audio_isocirq; |
@@ -368,7 +368,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev) | |||
368 | urb->context = dev; | 368 | urb->context = dev; |
369 | urb->pipe = usb_rcvbulkpipe(dev->udev, | 369 | urb->pipe = usb_rcvbulkpipe(dev->udev, |
370 | dev->adev.end_point_addr); | 370 | dev->adev.end_point_addr); |
371 | urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 371 | urb->transfer_flags = 0; |
372 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; | 372 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; |
373 | urb->complete = cx231xx_audio_bulkirq; | 373 | urb->complete = cx231xx_audio_bulkirq; |
374 | urb->transfer_buffer_length = sb_size; | 374 | urb->transfer_buffer_length = sb_size; |
diff --git a/drivers/media/video/cx231xx/cx231xx-vbi.c b/drivers/media/video/cx231xx/cx231xx-vbi.c index 3d15314e1f88..ac7db52f404f 100644 --- a/drivers/media/video/cx231xx/cx231xx-vbi.c +++ b/drivers/media/video/cx231xx/cx231xx-vbi.c | |||
@@ -448,7 +448,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets, | |||
448 | return -ENOMEM; | 448 | return -ENOMEM; |
449 | } | 449 | } |
450 | dev->vbi_mode.bulk_ctl.urb[i] = urb; | 450 | dev->vbi_mode.bulk_ctl.urb[i] = urb; |
451 | urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 451 | urb->transfer_flags = 0; |
452 | 452 | ||
453 | dev->vbi_mode.bulk_ctl.transfer_buffer[i] = | 453 | dev->vbi_mode.bulk_ctl.transfer_buffer[i] = |
454 | kzalloc(sb_size, GFP_KERNEL); | 454 | kzalloc(sb_size, GFP_KERNEL); |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 13739e002a63..080e11157e5f 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -127,22 +127,37 @@ struct cx23885_board cx23885_boards[] = { | |||
127 | }, | 127 | }, |
128 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { | 128 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { |
129 | .name = "Hauppauge WinTV-HVR1250", | 129 | .name = "Hauppauge WinTV-HVR1250", |
130 | .porta = CX23885_ANALOG_VIDEO, | ||
130 | .portc = CX23885_MPEG_DVB, | 131 | .portc = CX23885_MPEG_DVB, |
132 | #ifdef MT2131_NO_ANALOG_SUPPORT_YET | ||
133 | .tuner_type = TUNER_PHILIPS_TDA8290, | ||
134 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
135 | .tuner_bus = 1, | ||
136 | #endif | ||
137 | .force_bff = 1, | ||
131 | .input = {{ | 138 | .input = {{ |
139 | #ifdef MT2131_NO_ANALOG_SUPPORT_YET | ||
132 | .type = CX23885_VMUX_TELEVISION, | 140 | .type = CX23885_VMUX_TELEVISION, |
133 | .vmux = 0, | 141 | .vmux = CX25840_VIN7_CH3 | |
142 | CX25840_VIN5_CH2 | | ||
143 | CX25840_VIN2_CH1, | ||
144 | .amux = CX25840_AUDIO8, | ||
134 | .gpio0 = 0xff00, | 145 | .gpio0 = 0xff00, |
135 | }, { | 146 | }, { |
136 | .type = CX23885_VMUX_DEBUG, | 147 | #endif |
137 | .vmux = 0, | ||
138 | .gpio0 = 0xff01, | ||
139 | }, { | ||
140 | .type = CX23885_VMUX_COMPOSITE1, | 148 | .type = CX23885_VMUX_COMPOSITE1, |
141 | .vmux = 1, | 149 | .vmux = CX25840_VIN7_CH3 | |
150 | CX25840_VIN4_CH2 | | ||
151 | CX25840_VIN6_CH1, | ||
152 | .amux = CX25840_AUDIO7, | ||
142 | .gpio0 = 0xff02, | 153 | .gpio0 = 0xff02, |
143 | }, { | 154 | }, { |
144 | .type = CX23885_VMUX_SVIDEO, | 155 | .type = CX23885_VMUX_SVIDEO, |
145 | .vmux = 2, | 156 | .vmux = CX25840_VIN7_CH3 | |
157 | CX25840_VIN4_CH2 | | ||
158 | CX25840_VIN8_CH1 | | ||
159 | CX25840_SVIDEO_ON, | ||
160 | .amux = CX25840_AUDIO7, | ||
146 | .gpio0 = 0xff02, | 161 | .gpio0 = 0xff02, |
147 | } }, | 162 | } }, |
148 | }, | 163 | }, |
@@ -267,7 +282,55 @@ struct cx23885_board cx23885_boards[] = { | |||
267 | }, | 282 | }, |
268 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { | 283 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { |
269 | .name = "Hauppauge WinTV-HVR1255", | 284 | .name = "Hauppauge WinTV-HVR1255", |
285 | .porta = CX23885_ANALOG_VIDEO, | ||
286 | .portc = CX23885_MPEG_DVB, | ||
287 | .tuner_type = TUNER_ABSENT, | ||
288 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
289 | .force_bff = 1, | ||
290 | .input = {{ | ||
291 | .type = CX23885_VMUX_TELEVISION, | ||
292 | .vmux = CX25840_VIN7_CH3 | | ||
293 | CX25840_VIN5_CH2 | | ||
294 | CX25840_VIN2_CH1 | | ||
295 | CX25840_DIF_ON, | ||
296 | .amux = CX25840_AUDIO8, | ||
297 | }, { | ||
298 | .type = CX23885_VMUX_COMPOSITE1, | ||
299 | .vmux = CX25840_VIN7_CH3 | | ||
300 | CX25840_VIN4_CH2 | | ||
301 | CX25840_VIN6_CH1, | ||
302 | .amux = CX25840_AUDIO7, | ||
303 | }, { | ||
304 | .type = CX23885_VMUX_SVIDEO, | ||
305 | .vmux = CX25840_VIN7_CH3 | | ||
306 | CX25840_VIN4_CH2 | | ||
307 | CX25840_VIN8_CH1 | | ||
308 | CX25840_SVIDEO_ON, | ||
309 | .amux = CX25840_AUDIO7, | ||
310 | } }, | ||
311 | }, | ||
312 | [CX23885_BOARD_HAUPPAUGE_HVR1255_22111] = { | ||
313 | .name = "Hauppauge WinTV-HVR1255", | ||
314 | .porta = CX23885_ANALOG_VIDEO, | ||
270 | .portc = CX23885_MPEG_DVB, | 315 | .portc = CX23885_MPEG_DVB, |
316 | .tuner_type = TUNER_ABSENT, | ||
317 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
318 | .force_bff = 1, | ||
319 | .input = {{ | ||
320 | .type = CX23885_VMUX_TELEVISION, | ||
321 | .vmux = CX25840_VIN7_CH3 | | ||
322 | CX25840_VIN5_CH2 | | ||
323 | CX25840_VIN2_CH1 | | ||
324 | CX25840_DIF_ON, | ||
325 | .amux = CX25840_AUDIO8, | ||
326 | }, { | ||
327 | .type = CX23885_VMUX_SVIDEO, | ||
328 | .vmux = CX25840_VIN7_CH3 | | ||
329 | CX25840_VIN4_CH2 | | ||
330 | CX25840_VIN8_CH1 | | ||
331 | CX25840_SVIDEO_ON, | ||
332 | .amux = CX25840_AUDIO7, | ||
333 | } }, | ||
271 | }, | 334 | }, |
272 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { | 335 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { |
273 | .name = "Hauppauge WinTV-HVR1210", | 336 | .name = "Hauppauge WinTV-HVR1210", |
@@ -624,7 +687,7 @@ struct cx23885_subid cx23885_subids[] = { | |||
624 | }, { | 687 | }, { |
625 | .subvendor = 0x0070, | 688 | .subvendor = 0x0070, |
626 | .subdevice = 0x2259, | 689 | .subdevice = 0x2259, |
627 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255, | 690 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255_22111, |
628 | }, { | 691 | }, { |
629 | .subvendor = 0x0070, | 692 | .subvendor = 0x0070, |
630 | .subdevice = 0x2291, | 693 | .subdevice = 0x2291, |
@@ -900,7 +963,7 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg) | |||
900 | struct cx23885_dev *dev = port->dev; | 963 | struct cx23885_dev *dev = port->dev; |
901 | u32 bitmask = 0; | 964 | u32 bitmask = 0; |
902 | 965 | ||
903 | if (command == XC2028_RESET_CLK) | 966 | if ((command == XC2028_RESET_CLK) || (command == XC2028_I2C_FLUSH)) |
904 | return 0; | 967 | return 0; |
905 | 968 | ||
906 | if (command != 0) { | 969 | if (command != 0) { |
@@ -1130,6 +1193,7 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) | |||
1130 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1193 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1131 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1194 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1132 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1195 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1196 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1133 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1197 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1134 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ | 1198 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ |
1135 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ | 1199 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ |
@@ -1267,6 +1331,7 @@ int cx23885_ir_init(struct cx23885_dev *dev) | |||
1267 | case CX23885_BOARD_HAUPPAUGE_HVR1400: | 1331 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
1268 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1332 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1269 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1333 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1334 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1270 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1335 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1271 | /* FIXME: Implement me */ | 1336 | /* FIXME: Implement me */ |
1272 | break; | 1337 | break; |
@@ -1424,6 +1489,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1424 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1489 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1425 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1490 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1426 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1491 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1492 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1427 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1493 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1428 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1494 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
1429 | case CX23885_BOARD_HAUPPAUGE_HVR1290: | 1495 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
@@ -1511,6 +1577,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1511 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1577 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1512 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1578 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
1513 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1579 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
1580 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1514 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1581 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1515 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: | 1582 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
1516 | case CX23885_BOARD_HAUPPAUGE_HVR1290: | 1583 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
@@ -1526,10 +1593,10 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1526 | */ | 1593 | */ |
1527 | switch (dev->board) { | 1594 | switch (dev->board) { |
1528 | case CX23885_BOARD_TEVII_S470: | 1595 | case CX23885_BOARD_TEVII_S470: |
1529 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | ||
1530 | /* Currently only enabled for the integrated IR controller */ | 1596 | /* Currently only enabled for the integrated IR controller */ |
1531 | if (!enable_885_ir) | 1597 | if (!enable_885_ir) |
1532 | break; | 1598 | break; |
1599 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | ||
1533 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 1600 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
1534 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: | 1601 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
1535 | case CX23885_BOARD_HAUPPAUGE_HVR1700: | 1602 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
@@ -1539,6 +1606,8 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1539 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: | 1606 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
1540 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: | 1607 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
1541 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: | 1608 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
1609 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | ||
1610 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1542 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1611 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1543 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1612 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
1544 | case CX23885_BOARD_MYGICA_X8506: | 1613 | case CX23885_BOARD_MYGICA_X8506: |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index a80a92c47455..cd542684ba02 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -712,6 +712,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
712 | } | 712 | } |
713 | break; | 713 | break; |
714 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 714 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
715 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
715 | i2c_bus = &dev->i2c_bus[0]; | 716 | i2c_bus = &dev->i2c_bus[0]; |
716 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, | 717 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, |
717 | &hcw_s5h1411_config, | 718 | &hcw_s5h1411_config, |
@@ -721,6 +722,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
721 | 0x60, &dev->i2c_bus[1].i2c_adap, | 722 | 0x60, &dev->i2c_bus[1].i2c_adap, |
722 | &hauppauge_tda18271_config); | 723 | &hauppauge_tda18271_config); |
723 | } | 724 | } |
725 | |||
726 | tda18271_attach(&dev->ts1.analog_fe, | ||
727 | 0x60, &dev->i2c_bus[1].i2c_adap, | ||
728 | &hauppauge_tda18271_config); | ||
729 | |||
724 | break; | 730 | break; |
725 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 731 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
726 | i2c_bus = &dev->i2c_bus[0]; | 732 | i2c_bus = &dev->i2c_bus[0]; |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index c654bdc7ccb2..22f8e7fbd665 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -505,6 +505,9 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) | |||
505 | 505 | ||
506 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1800) || | 506 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1800) || |
507 | (dev->board == CX23885_BOARD_MPX885) || | 507 | (dev->board == CX23885_BOARD_MPX885) || |
508 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1250) || | ||
509 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255) || | ||
510 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111) || | ||
508 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850)) { | 511 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850)) { |
509 | /* Configure audio routing */ | 512 | /* Configure audio routing */ |
510 | v4l2_subdev_call(dev->sd_cx25840, audio, s_routing, | 513 | v4l2_subdev_call(dev->sd_cx25840, audio, s_routing, |
@@ -1578,7 +1581,9 @@ static int cx23885_set_freq_via_ops(struct cx23885_dev *dev, | |||
1578 | 1581 | ||
1579 | fe = vfe->dvb.frontend; | 1582 | fe = vfe->dvb.frontend; |
1580 | 1583 | ||
1581 | if (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) | 1584 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) || |
1585 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255) || | ||
1586 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111)) | ||
1582 | fe = &dev->ts1.analog_fe; | 1587 | fe = &dev->ts1.analog_fe; |
1583 | 1588 | ||
1584 | if (fe && fe->ops.tuner_ops.set_analog_params) { | 1589 | if (fe && fe->ops.tuner_ops.set_analog_params) { |
@@ -1608,6 +1613,8 @@ int cx23885_set_frequency(struct file *file, void *priv, | |||
1608 | int ret; | 1613 | int ret; |
1609 | 1614 | ||
1610 | switch (dev->board) { | 1615 | switch (dev->board) { |
1616 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | ||
1617 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
1611 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1618 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
1612 | ret = cx23885_set_freq_via_ops(dev, f); | 1619 | ret = cx23885_set_freq_via_ops(dev, f); |
1613 | break; | 1620 | break; |
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h index d884784a1c85..13c37ec07ae7 100644 --- a/drivers/media/video/cx23885/cx23885.h +++ b/drivers/media/video/cx23885/cx23885.h | |||
@@ -90,6 +90,7 @@ | |||
90 | #define CX23885_BOARD_MYGICA_X8507 33 | 90 | #define CX23885_BOARD_MYGICA_X8507 33 |
91 | #define CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL 34 | 91 | #define CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL 34 |
92 | #define CX23885_BOARD_TEVII_S471 35 | 92 | #define CX23885_BOARD_TEVII_S471 35 |
93 | #define CX23885_BOARD_HAUPPAUGE_HVR1255_22111 36 | ||
93 | 94 | ||
94 | #define GPIO_0 0x00000001 | 95 | #define GPIO_0 0x00000001 |
95 | #define GPIO_1 0x00000002 | 96 | #define GPIO_1 0x00000002 |
diff --git a/drivers/media/video/cx25821/cx25821-core.c b/drivers/media/video/cx25821/cx25821-core.c index 83c1aa6b2e6c..f11f6f07e915 100644 --- a/drivers/media/video/cx25821/cx25821-core.c +++ b/drivers/media/video/cx25821/cx25821-core.c | |||
@@ -904,9 +904,6 @@ static int cx25821_dev_setup(struct cx25821_dev *dev) | |||
904 | list_add_tail(&dev->devlist, &cx25821_devlist); | 904 | list_add_tail(&dev->devlist, &cx25821_devlist); |
905 | mutex_unlock(&cx25821_devlist_mutex); | 905 | mutex_unlock(&cx25821_devlist_mutex); |
906 | 906 | ||
907 | strcpy(cx25821_boards[UNKNOWN_BOARD].name, "unknown"); | ||
908 | strcpy(cx25821_boards[CX25821_BOARD].name, "cx25821"); | ||
909 | |||
910 | if (dev->pci->device != 0x8210) { | 907 | if (dev->pci->device != 0x8210) { |
911 | pr_info("%s(): Exiting. Incorrect Hardware device = 0x%02x\n", | 908 | pr_info("%s(): Exiting. Incorrect Hardware device = 0x%02x\n", |
912 | __func__, dev->pci->device); | 909 | __func__, dev->pci->device); |
diff --git a/drivers/media/video/cx25821/cx25821.h b/drivers/media/video/cx25821/cx25821.h index b9aa801b00a7..029f2934a6d8 100644 --- a/drivers/media/video/cx25821/cx25821.h +++ b/drivers/media/video/cx25821/cx25821.h | |||
@@ -187,7 +187,7 @@ enum port { | |||
187 | }; | 187 | }; |
188 | 188 | ||
189 | struct cx25821_board { | 189 | struct cx25821_board { |
190 | char *name; | 190 | const char *name; |
191 | enum port porta; | 191 | enum port porta; |
192 | enum port portb; | 192 | enum port portb; |
193 | enum port portc; | 193 | enum port portc; |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index fc1ff69cffd0..d8eac3e30a7e 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -84,7 +84,7 @@ MODULE_PARM_DESC(debug, "Debugging messages [0=Off (default) 1=On]"); | |||
84 | 84 | ||
85 | 85 | ||
86 | /* ----------------------------------------------------------------------- */ | 86 | /* ----------------------------------------------------------------------- */ |
87 | static void cx23885_std_setup(struct i2c_client *client); | 87 | static void cx23888_std_setup(struct i2c_client *client); |
88 | 88 | ||
89 | int cx25840_write(struct i2c_client *client, u16 addr, u8 value) | 89 | int cx25840_write(struct i2c_client *client, u16 addr, u8 value) |
90 | { | 90 | { |
@@ -638,10 +638,13 @@ static void cx23885_initialize(struct i2c_client *client) | |||
638 | finish_wait(&state->fw_wait, &wait); | 638 | finish_wait(&state->fw_wait, &wait); |
639 | destroy_workqueue(q); | 639 | destroy_workqueue(q); |
640 | 640 | ||
641 | /* Call the cx23885 specific std setup func, we no longer rely on | 641 | /* Call the cx23888 specific std setup func, we no longer rely on |
642 | * the generic cx24840 func. | 642 | * the generic cx24840 func. |
643 | */ | 643 | */ |
644 | cx23885_std_setup(client); | 644 | if (is_cx23888(state)) |
645 | cx23888_std_setup(client); | ||
646 | else | ||
647 | cx25840_std_setup(client); | ||
645 | 648 | ||
646 | /* (re)set input */ | 649 | /* (re)set input */ |
647 | set_input(client, state->vid_input, state->aud_input); | 650 | set_input(client, state->vid_input, state->aud_input); |
@@ -1103,9 +1106,23 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
1103 | 1106 | ||
1104 | cx25840_write4(client, 0x410, 0xffff0dbf); | 1107 | cx25840_write4(client, 0x410, 0xffff0dbf); |
1105 | cx25840_write4(client, 0x414, 0x00137d03); | 1108 | cx25840_write4(client, 0x414, 0x00137d03); |
1106 | cx25840_write4(client, 0x418, 0x01008080); | 1109 | |
1110 | /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is | ||
1111 | CHROMA_CTRL */ | ||
1112 | if (is_cx23888(state)) | ||
1113 | cx25840_write4(client, 0x418, 0x01008080); | ||
1114 | else | ||
1115 | cx25840_write4(client, 0x418, 0x01000000); | ||
1116 | |||
1107 | cx25840_write4(client, 0x41c, 0x00000000); | 1117 | cx25840_write4(client, 0x41c, 0x00000000); |
1108 | cx25840_write4(client, 0x420, 0x001c3e0f); | 1118 | |
1119 | /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is | ||
1120 | CRUSH_CTRL */ | ||
1121 | if (is_cx23888(state)) | ||
1122 | cx25840_write4(client, 0x420, 0x001c3e0f); | ||
1123 | else | ||
1124 | cx25840_write4(client, 0x420, 0x001c8282); | ||
1125 | |||
1109 | cx25840_write4(client, 0x42c, 0x42600000); | 1126 | cx25840_write4(client, 0x42c, 0x42600000); |
1110 | cx25840_write4(client, 0x430, 0x0000039b); | 1127 | cx25840_write4(client, 0x430, 0x0000039b); |
1111 | cx25840_write4(client, 0x438, 0x00000000); | 1128 | cx25840_write4(client, 0x438, 0x00000000); |
@@ -1233,7 +1250,7 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
1233 | cx25840_write4(client, 0x8d0, 0x1f063870); | 1250 | cx25840_write4(client, 0x8d0, 0x1f063870); |
1234 | } | 1251 | } |
1235 | 1252 | ||
1236 | if (is_cx2388x(state)) { | 1253 | if (is_cx23888(state)) { |
1237 | /* HVR1850 */ | 1254 | /* HVR1850 */ |
1238 | /* AUD_IO_CTRL - I2S Input, Parallel1*/ | 1255 | /* AUD_IO_CTRL - I2S Input, Parallel1*/ |
1239 | /* - Channel 1 src - Parallel1 (Merlin out) */ | 1256 | /* - Channel 1 src - Parallel1 (Merlin out) */ |
@@ -1298,8 +1315,8 @@ static int set_v4lstd(struct i2c_client *client) | |||
1298 | } | 1315 | } |
1299 | cx25840_and_or(client, 0x400, ~0xf, fmt); | 1316 | cx25840_and_or(client, 0x400, ~0xf, fmt); |
1300 | cx25840_and_or(client, 0x403, ~0x3, pal_m); | 1317 | cx25840_and_or(client, 0x403, ~0x3, pal_m); |
1301 | if (is_cx2388x(state)) | 1318 | if (is_cx23888(state)) |
1302 | cx23885_std_setup(client); | 1319 | cx23888_std_setup(client); |
1303 | else | 1320 | else |
1304 | cx25840_std_setup(client); | 1321 | cx25840_std_setup(client); |
1305 | if (!is_cx2583x(state)) | 1322 | if (!is_cx2583x(state)) |
@@ -1312,6 +1329,7 @@ static int set_v4lstd(struct i2c_client *client) | |||
1312 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | 1329 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) |
1313 | { | 1330 | { |
1314 | struct v4l2_subdev *sd = to_sd(ctrl); | 1331 | struct v4l2_subdev *sd = to_sd(ctrl); |
1332 | struct cx25840_state *state = to_state(sd); | ||
1315 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1333 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1316 | 1334 | ||
1317 | switch (ctrl->id) { | 1335 | switch (ctrl->id) { |
@@ -1324,12 +1342,20 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | |||
1324 | break; | 1342 | break; |
1325 | 1343 | ||
1326 | case V4L2_CID_SATURATION: | 1344 | case V4L2_CID_SATURATION: |
1327 | cx25840_write(client, 0x420, ctrl->val << 1); | 1345 | if (is_cx23888(state)) { |
1328 | cx25840_write(client, 0x421, ctrl->val << 1); | 1346 | cx25840_write(client, 0x418, ctrl->val << 1); |
1347 | cx25840_write(client, 0x419, ctrl->val << 1); | ||
1348 | } else { | ||
1349 | cx25840_write(client, 0x420, ctrl->val << 1); | ||
1350 | cx25840_write(client, 0x421, ctrl->val << 1); | ||
1351 | } | ||
1329 | break; | 1352 | break; |
1330 | 1353 | ||
1331 | case V4L2_CID_HUE: | 1354 | case V4L2_CID_HUE: |
1332 | cx25840_write(client, 0x422, ctrl->val); | 1355 | if (is_cx23888(state)) |
1356 | cx25840_write(client, 0x41a, ctrl->val); | ||
1357 | else | ||
1358 | cx25840_write(client, 0x422, ctrl->val); | ||
1333 | break; | 1359 | break; |
1334 | 1360 | ||
1335 | default: | 1361 | default: |
@@ -1354,11 +1380,21 @@ static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt | |||
1354 | fmt->field = V4L2_FIELD_INTERLACED; | 1380 | fmt->field = V4L2_FIELD_INTERLACED; |
1355 | fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; | 1381 | fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; |
1356 | 1382 | ||
1357 | Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; | 1383 | if (is_cx23888(state)) { |
1358 | Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; | 1384 | Vsrc = (cx25840_read(client, 0x42a) & 0x3f) << 4; |
1385 | Vsrc |= (cx25840_read(client, 0x429) & 0xf0) >> 4; | ||
1386 | } else { | ||
1387 | Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; | ||
1388 | Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; | ||
1389 | } | ||
1359 | 1390 | ||
1360 | Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; | 1391 | if (is_cx23888(state)) { |
1361 | Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; | 1392 | Hsrc = (cx25840_read(client, 0x426) & 0x3f) << 4; |
1393 | Hsrc |= (cx25840_read(client, 0x425) & 0xf0) >> 4; | ||
1394 | } else { | ||
1395 | Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; | ||
1396 | Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; | ||
1397 | } | ||
1362 | 1398 | ||
1363 | Vlines = fmt->height + (is_50Hz ? 4 : 7); | 1399 | Vlines = fmt->height + (is_50Hz ? 4 : 7); |
1364 | 1400 | ||
@@ -1782,8 +1818,8 @@ static int cx25840_s_video_routing(struct v4l2_subdev *sd, | |||
1782 | struct cx25840_state *state = to_state(sd); | 1818 | struct cx25840_state *state = to_state(sd); |
1783 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1819 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1784 | 1820 | ||
1785 | if (is_cx2388x(state)) | 1821 | if (is_cx23888(state)) |
1786 | cx23885_std_setup(client); | 1822 | cx23888_std_setup(client); |
1787 | 1823 | ||
1788 | return set_input(client, input, state->aud_input); | 1824 | return set_input(client, input, state->aud_input); |
1789 | } | 1825 | } |
@@ -1794,8 +1830,8 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd, | |||
1794 | struct cx25840_state *state = to_state(sd); | 1830 | struct cx25840_state *state = to_state(sd); |
1795 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1831 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1796 | 1832 | ||
1797 | if (is_cx2388x(state)) | 1833 | if (is_cx23888(state)) |
1798 | cx23885_std_setup(client); | 1834 | cx23888_std_setup(client); |
1799 | return set_input(client, state->vid_input, input); | 1835 | return set_input(client, state->vid_input, input); |
1800 | } | 1836 | } |
1801 | 1837 | ||
@@ -4939,7 +4975,7 @@ void cx23885_dif_setup(struct i2c_client *client, u32 ifHz) | |||
4939 | } | 4975 | } |
4940 | } | 4976 | } |
4941 | 4977 | ||
4942 | static void cx23885_std_setup(struct i2c_client *client) | 4978 | static void cx23888_std_setup(struct i2c_client *client) |
4943 | { | 4979 | { |
4944 | struct cx25840_state *state = to_state(i2c_get_clientdata(client)); | 4980 | struct cx25840_state *state = to_state(i2c_get_clientdata(client)); |
4945 | v4l2_std_id std = state->std; | 4981 | v4l2_std_id std = state->std; |
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..862c6575c557 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, |
@@ -2892,7 +2893,7 @@ static void request_module_async(struct work_struct *work) | |||
2892 | 2893 | ||
2893 | if (dev->board.has_dvb) | 2894 | if (dev->board.has_dvb) |
2894 | request_module("em28xx-dvb"); | 2895 | request_module("em28xx-dvb"); |
2895 | if (dev->board.has_ir_i2c && !disable_ir) | 2896 | if (dev->board.ir_codes && !disable_ir) |
2896 | request_module("em28xx-rc"); | 2897 | request_module("em28xx-rc"); |
2897 | } | 2898 | } |
2898 | 2899 | ||
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..637bde8aca28 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
@@ -83,6 +83,7 @@ | |||
83 | #define CSICR1_INV_DATA (1 << 3) | 83 | #define CSICR1_INV_DATA (1 << 3) |
84 | #define CSICR1_INV_PCLK (1 << 2) | 84 | #define CSICR1_INV_PCLK (1 << 2) |
85 | #define CSICR1_REDGE (1 << 1) | 85 | #define CSICR1_REDGE (1 << 1) |
86 | #define CSICR1_FMT_MASK (CSICR1_PACK_DIR | CSICR1_SWAP16_EN) | ||
86 | 87 | ||
87 | #define SHIFT_STATFF_LEVEL 22 | 88 | #define SHIFT_STATFF_LEVEL 22 |
88 | #define SHIFT_RXFF_LEVEL 19 | 89 | #define SHIFT_RXFF_LEVEL 19 |
@@ -230,6 +231,7 @@ struct mx2_prp_cfg { | |||
230 | u32 src_pixel; | 231 | u32 src_pixel; |
231 | u32 ch1_pixel; | 232 | u32 ch1_pixel; |
232 | u32 irq_flags; | 233 | u32 irq_flags; |
234 | u32 csicr1; | ||
233 | }; | 235 | }; |
234 | 236 | ||
235 | /* prp resizing parameters */ | 237 | /* prp resizing parameters */ |
@@ -330,6 +332,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { | |||
330 | .ch1_pixel = 0x2ca00565, /* RGB565 */ | 332 | .ch1_pixel = 0x2ca00565, /* RGB565 */ |
331 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH1WERR | | 333 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH1WERR | |
332 | PRP_INTR_CH1FC | PRP_INTR_LBOVF, | 334 | PRP_INTR_CH1FC | PRP_INTR_LBOVF, |
335 | .csicr1 = 0, | ||
333 | } | 336 | } |
334 | }, | 337 | }, |
335 | { | 338 | { |
@@ -343,6 +346,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { | |||
343 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | | 346 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | |
344 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | | 347 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | |
345 | PRP_INTR_CH2OVF, | 348 | PRP_INTR_CH2OVF, |
349 | .csicr1 = CSICR1_PACK_DIR, | ||
346 | } | 350 | } |
347 | }, | 351 | }, |
348 | { | 352 | { |
@@ -356,6 +360,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { | |||
356 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | | 360 | .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR | |
357 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | | 361 | PRP_INTR_CH2FC | PRP_INTR_LBOVF | |
358 | PRP_INTR_CH2OVF, | 362 | PRP_INTR_CH2OVF, |
363 | .csicr1 = CSICR1_SWAP16_EN, | ||
359 | } | 364 | } |
360 | }, | 365 | }, |
361 | }; | 366 | }; |
@@ -984,7 +989,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); | 989 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
985 | struct mx2_camera_dev *pcdev = ici->priv; | 990 | struct mx2_camera_dev *pcdev = ici->priv; |
986 | struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; | 991 | struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; |
987 | const struct soc_camera_format_xlate *xlate; | ||
988 | unsigned long common_flags; | 992 | unsigned long common_flags; |
989 | int ret; | 993 | int ret; |
990 | int bytesperline; | 994 | int bytesperline; |
@@ -1029,24 +1033,7 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd) | |||
1029 | return ret; | 1033 | return ret; |
1030 | } | 1034 | } |
1031 | 1035 | ||
1032 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | 1036 | csicr1 = (csicr1 & ~CSICR1_FMT_MASK) | pcdev->emma_prp->cfg.csicr1; |
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 | 1037 | ||
1051 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) | 1038 | if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) |
1052 | csicr1 |= CSICR1_REDGE; | 1039 | csicr1 |= CSICR1_REDGE; |
@@ -1155,18 +1142,6 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, | |||
1155 | } | 1142 | } |
1156 | } | 1143 | } |
1157 | 1144 | ||
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 */ | 1145 | /* Generic pass-trough */ |
1171 | formats++; | 1146 | formats++; |
1172 | if (xlate) { | 1147 | if (xlate) { |
diff --git a/drivers/media/video/omap3isp/isppreview.c b/drivers/media/video/omap3isp/isppreview.c index 8a4935ecc655..dd91da26f1b0 100644 --- a/drivers/media/video/omap3isp/isppreview.c +++ b/drivers/media/video/omap3isp/isppreview.c | |||
@@ -888,12 +888,12 @@ static const struct preview_update update_attrs[] = { | |||
888 | preview_config_contrast, | 888 | preview_config_contrast, |
889 | NULL, | 889 | NULL, |
890 | offsetof(struct prev_params, contrast), | 890 | offsetof(struct prev_params, contrast), |
891 | 0, true, | 891 | 0, 0, true, |
892 | }, /* OMAP3ISP_PREV_BRIGHTNESS */ { | 892 | }, /* OMAP3ISP_PREV_BRIGHTNESS */ { |
893 | preview_config_brightness, | 893 | preview_config_brightness, |
894 | NULL, | 894 | NULL, |
895 | offsetof(struct prev_params, brightness), | 895 | offsetof(struct prev_params, brightness), |
896 | 0, true, | 896 | 0, 0, true, |
897 | }, | 897 | }, |
898 | }; | 898 | }; |
899 | 899 | ||
@@ -1102,7 +1102,7 @@ static void preview_config_input_size(struct isp_prev_device *prev, u32 active) | |||
1102 | unsigned int elv = prev->crop.top + prev->crop.height - 1; | 1102 | unsigned int elv = prev->crop.top + prev->crop.height - 1; |
1103 | u32 features; | 1103 | u32 features; |
1104 | 1104 | ||
1105 | if (format->code == V4L2_MBUS_FMT_Y10_1X10) { | 1105 | if (format->code != V4L2_MBUS_FMT_Y10_1X10) { |
1106 | sph -= 2; | 1106 | sph -= 2; |
1107 | eph += 2; | 1107 | eph += 2; |
1108 | slv -= 2; | 1108 | slv -= 2; |
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c index af2d9086d7e8..b4c679b3fb0f 100644 --- a/drivers/media/video/pms.c +++ b/drivers/media/video/pms.c | |||
@@ -26,9 +26,11 @@ | |||
26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
31 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
33 | #include <linux/slab.h> | ||
32 | #include <linux/uaccess.h> | 34 | #include <linux/uaccess.h> |
33 | #include <linux/isa.h> | 35 | #include <linux/isa.h> |
34 | #include <asm/io.h> | 36 | #include <asm/io.h> |
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index 354574591908..725812aa0c30 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c | |||
@@ -350,7 +350,8 @@ static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, | |||
350 | if (pixm) | 350 | if (pixm) |
351 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); | 351 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); |
352 | else | 352 | else |
353 | sizes[i] = size; | 353 | sizes[i] = max_t(u32, size, frame->payload[i]); |
354 | |||
354 | allocators[i] = ctx->fimc_dev->alloc_ctx; | 355 | allocators[i] = ctx->fimc_dev->alloc_ctx; |
355 | } | 356 | } |
356 | 357 | ||
@@ -479,37 +480,39 @@ static int fimc_capture_set_default_format(struct fimc_dev *fimc); | |||
479 | static int fimc_capture_open(struct file *file) | 480 | static int fimc_capture_open(struct file *file) |
480 | { | 481 | { |
481 | struct fimc_dev *fimc = video_drvdata(file); | 482 | struct fimc_dev *fimc = video_drvdata(file); |
482 | int ret = v4l2_fh_open(file); | 483 | int ret; |
483 | |||
484 | if (ret) | ||
485 | return ret; | ||
486 | 484 | ||
487 | dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state); | 485 | dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state); |
488 | 486 | ||
489 | /* Return if the corresponding video mem2mem node is already opened. */ | ||
490 | if (fimc_m2m_active(fimc)) | 487 | if (fimc_m2m_active(fimc)) |
491 | return -EBUSY; | 488 | return -EBUSY; |
492 | 489 | ||
493 | set_bit(ST_CAPT_BUSY, &fimc->state); | 490 | set_bit(ST_CAPT_BUSY, &fimc->state); |
494 | pm_runtime_get_sync(&fimc->pdev->dev); | 491 | ret = pm_runtime_get_sync(&fimc->pdev->dev); |
492 | if (ret < 0) | ||
493 | return ret; | ||
495 | 494 | ||
496 | if (++fimc->vid_cap.refcnt == 1) { | 495 | ret = v4l2_fh_open(file); |
497 | ret = fimc_pipeline_initialize(&fimc->pipeline, | 496 | if (ret) |
498 | &fimc->vid_cap.vfd->entity, true); | 497 | return ret; |
499 | if (ret < 0) { | ||
500 | dev_err(&fimc->pdev->dev, | ||
501 | "Video pipeline initialization failed\n"); | ||
502 | pm_runtime_put_sync(&fimc->pdev->dev); | ||
503 | fimc->vid_cap.refcnt--; | ||
504 | v4l2_fh_release(file); | ||
505 | clear_bit(ST_CAPT_BUSY, &fimc->state); | ||
506 | return ret; | ||
507 | } | ||
508 | ret = fimc_capture_ctrls_create(fimc); | ||
509 | 498 | ||
510 | if (!ret && !fimc->vid_cap.user_subdev_api) | 499 | if (++fimc->vid_cap.refcnt != 1) |
511 | ret = fimc_capture_set_default_format(fimc); | 500 | return 0; |
501 | |||
502 | ret = fimc_pipeline_initialize(&fimc->pipeline, | ||
503 | &fimc->vid_cap.vfd->entity, true); | ||
504 | if (ret < 0) { | ||
505 | clear_bit(ST_CAPT_BUSY, &fimc->state); | ||
506 | pm_runtime_put_sync(&fimc->pdev->dev); | ||
507 | fimc->vid_cap.refcnt--; | ||
508 | v4l2_fh_release(file); | ||
509 | return ret; | ||
512 | } | 510 | } |
511 | ret = fimc_capture_ctrls_create(fimc); | ||
512 | |||
513 | if (!ret && !fimc->vid_cap.user_subdev_api) | ||
514 | ret = fimc_capture_set_default_format(fimc); | ||
515 | |||
513 | return ret; | 516 | return ret; |
514 | } | 517 | } |
515 | 518 | ||
@@ -818,9 +821,6 @@ static int fimc_cap_g_fmt_mplane(struct file *file, void *fh, | |||
818 | struct fimc_dev *fimc = video_drvdata(file); | 821 | struct fimc_dev *fimc = video_drvdata(file); |
819 | struct fimc_ctx *ctx = fimc->vid_cap.ctx; | 822 | struct fimc_ctx *ctx = fimc->vid_cap.ctx; |
820 | 823 | ||
821 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
822 | return -EINVAL; | ||
823 | |||
824 | return fimc_fill_format(&ctx->d_frame, f); | 824 | return fimc_fill_format(&ctx->d_frame, f); |
825 | } | 825 | } |
826 | 826 | ||
@@ -833,9 +833,6 @@ static int fimc_cap_try_fmt_mplane(struct file *file, void *fh, | |||
833 | struct v4l2_mbus_framefmt mf; | 833 | struct v4l2_mbus_framefmt mf; |
834 | struct fimc_fmt *ffmt = NULL; | 834 | struct fimc_fmt *ffmt = NULL; |
835 | 835 | ||
836 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
837 | return -EINVAL; | ||
838 | |||
839 | if (pix->pixelformat == V4L2_PIX_FMT_JPEG) { | 836 | if (pix->pixelformat == V4L2_PIX_FMT_JPEG) { |
840 | fimc_capture_try_format(ctx, &pix->width, &pix->height, | 837 | fimc_capture_try_format(ctx, &pix->width, &pix->height, |
841 | NULL, &pix->pixelformat, | 838 | NULL, &pix->pixelformat, |
@@ -887,8 +884,6 @@ static int fimc_capture_set_format(struct fimc_dev *fimc, struct v4l2_format *f) | |||
887 | struct fimc_fmt *s_fmt = NULL; | 884 | struct fimc_fmt *s_fmt = NULL; |
888 | int ret, i; | 885 | int ret, i; |
889 | 886 | ||
890 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
891 | return -EINVAL; | ||
892 | if (vb2_is_busy(&fimc->vid_cap.vbq)) | 887 | if (vb2_is_busy(&fimc->vid_cap.vbq)) |
893 | return -EBUSY; | 888 | return -EBUSY; |
894 | 889 | ||
@@ -924,10 +919,10 @@ static int fimc_capture_set_format(struct fimc_dev *fimc, struct v4l2_format *f) | |||
924 | pix->width = mf->width; | 919 | pix->width = mf->width; |
925 | pix->height = mf->height; | 920 | pix->height = mf->height; |
926 | } | 921 | } |
922 | |||
927 | fimc_adjust_mplane_format(ff->fmt, pix->width, pix->height, pix); | 923 | fimc_adjust_mplane_format(ff->fmt, pix->width, pix->height, pix); |
928 | for (i = 0; i < ff->fmt->colplanes; i++) | 924 | for (i = 0; i < ff->fmt->colplanes; i++) |
929 | ff->payload[i] = | 925 | ff->payload[i] = pix->plane_fmt[i].sizeimage; |
930 | (pix->width * pix->height * ff->fmt->depth[i]) / 8; | ||
931 | 926 | ||
932 | set_frame_bounds(ff, pix->width, pix->height); | 927 | set_frame_bounds(ff, pix->width, pix->height); |
933 | /* Reset the composition rectangle if not yet configured */ | 928 | /* Reset the composition rectangle if not yet configured */ |
@@ -1045,18 +1040,22 @@ static int fimc_cap_streamon(struct file *file, void *priv, | |||
1045 | { | 1040 | { |
1046 | struct fimc_dev *fimc = video_drvdata(file); | 1041 | struct fimc_dev *fimc = video_drvdata(file); |
1047 | struct fimc_pipeline *p = &fimc->pipeline; | 1042 | struct fimc_pipeline *p = &fimc->pipeline; |
1043 | struct v4l2_subdev *sd = p->subdevs[IDX_SENSOR]; | ||
1048 | int ret; | 1044 | int ret; |
1049 | 1045 | ||
1050 | if (fimc_capture_active(fimc)) | 1046 | if (fimc_capture_active(fimc)) |
1051 | return -EBUSY; | 1047 | return -EBUSY; |
1052 | 1048 | ||
1053 | media_entity_pipeline_start(&p->subdevs[IDX_SENSOR]->entity, | 1049 | ret = media_entity_pipeline_start(&sd->entity, p->m_pipeline); |
1054 | p->m_pipeline); | 1050 | if (ret < 0) |
1051 | return ret; | ||
1055 | 1052 | ||
1056 | if (fimc->vid_cap.user_subdev_api) { | 1053 | if (fimc->vid_cap.user_subdev_api) { |
1057 | ret = fimc_pipeline_validate(fimc); | 1054 | ret = fimc_pipeline_validate(fimc); |
1058 | if (ret) | 1055 | if (ret < 0) { |
1056 | media_entity_pipeline_stop(&sd->entity); | ||
1059 | return ret; | 1057 | return ret; |
1058 | } | ||
1060 | } | 1059 | } |
1061 | return vb2_streamon(&fimc->vid_cap.vbq, type); | 1060 | return vb2_streamon(&fimc->vid_cap.vbq, type); |
1062 | } | 1061 | } |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index fedcd561ba27..a4646ca1d56f 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
@@ -153,7 +153,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
153 | .colplanes = 2, | 153 | .colplanes = 2, |
154 | .flags = FMT_FLAGS_M2M, | 154 | .flags = FMT_FLAGS_M2M, |
155 | }, { | 155 | }, { |
156 | .name = "YUV 4:2:0 non-contiguous 2-planar, Y/CbCr", | 156 | .name = "YUV 4:2:0 non-contig. 2p, Y/CbCr", |
157 | .fourcc = V4L2_PIX_FMT_NV12M, | 157 | .fourcc = V4L2_PIX_FMT_NV12M, |
158 | .color = FIMC_FMT_YCBCR420, | 158 | .color = FIMC_FMT_YCBCR420, |
159 | .depth = { 8, 4 }, | 159 | .depth = { 8, 4 }, |
@@ -161,7 +161,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
161 | .colplanes = 2, | 161 | .colplanes = 2, |
162 | .flags = FMT_FLAGS_M2M, | 162 | .flags = FMT_FLAGS_M2M, |
163 | }, { | 163 | }, { |
164 | .name = "YUV 4:2:0 non-contiguous 3-planar, Y/Cb/Cr", | 164 | .name = "YUV 4:2:0 non-contig. 3p, Y/Cb/Cr", |
165 | .fourcc = V4L2_PIX_FMT_YUV420M, | 165 | .fourcc = V4L2_PIX_FMT_YUV420M, |
166 | .color = FIMC_FMT_YCBCR420, | 166 | .color = FIMC_FMT_YCBCR420, |
167 | .depth = { 8, 2, 2 }, | 167 | .depth = { 8, 2, 2 }, |
@@ -169,7 +169,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
169 | .colplanes = 3, | 169 | .colplanes = 3, |
170 | .flags = FMT_FLAGS_M2M, | 170 | .flags = FMT_FLAGS_M2M, |
171 | }, { | 171 | }, { |
172 | .name = "YUV 4:2:0 non-contiguous 2-planar, Y/CbCr, tiled", | 172 | .name = "YUV 4:2:0 non-contig. 2p, tiled", |
173 | .fourcc = V4L2_PIX_FMT_NV12MT, | 173 | .fourcc = V4L2_PIX_FMT_NV12MT, |
174 | .color = FIMC_FMT_YCBCR420, | 174 | .color = FIMC_FMT_YCBCR420, |
175 | .depth = { 8, 4 }, | 175 | .depth = { 8, 4 }, |
@@ -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 | ||
@@ -641,7 +641,7 @@ void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active) | |||
641 | if (!ctrls->ready) | 641 | if (!ctrls->ready) |
642 | return; | 642 | return; |
643 | 643 | ||
644 | mutex_lock(&ctrls->handler.lock); | 644 | mutex_lock(ctrls->handler.lock); |
645 | v4l2_ctrl_activate(ctrls->rotate, active); | 645 | v4l2_ctrl_activate(ctrls->rotate, active); |
646 | v4l2_ctrl_activate(ctrls->hflip, active); | 646 | v4l2_ctrl_activate(ctrls->hflip, active); |
647 | v4l2_ctrl_activate(ctrls->vflip, active); | 647 | v4l2_ctrl_activate(ctrls->vflip, active); |
@@ -660,7 +660,7 @@ void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active) | |||
660 | ctx->hflip = 0; | 660 | ctx->hflip = 0; |
661 | ctx->vflip = 0; | 661 | ctx->vflip = 0; |
662 | } | 662 | } |
663 | mutex_unlock(&ctrls->handler.lock); | 663 | mutex_unlock(ctrls->handler.lock); |
664 | } | 664 | } |
665 | 665 | ||
666 | /* Update maximum value of the alpha color control */ | 666 | /* Update maximum value of the alpha color control */ |
@@ -741,8 +741,8 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | |||
741 | pix->width = width; | 741 | pix->width = width; |
742 | 742 | ||
743 | for (i = 0; i < pix->num_planes; ++i) { | 743 | for (i = 0; i < pix->num_planes; ++i) { |
744 | u32 bpl = pix->plane_fmt[i].bytesperline; | 744 | struct v4l2_plane_pix_format *plane_fmt = &pix->plane_fmt[i]; |
745 | u32 *sizeimage = &pix->plane_fmt[i].sizeimage; | 745 | u32 bpl = plane_fmt->bytesperline; |
746 | 746 | ||
747 | if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width)) | 747 | if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width)) |
748 | bpl = pix->width; /* Planar */ | 748 | bpl = pix->width; /* Planar */ |
@@ -754,8 +754,9 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | |||
754 | if (i == 0) /* Same bytesperline for each plane. */ | 754 | if (i == 0) /* Same bytesperline for each plane. */ |
755 | bytesperline = bpl; | 755 | bytesperline = bpl; |
756 | 756 | ||
757 | pix->plane_fmt[i].bytesperline = bytesperline; | 757 | plane_fmt->bytesperline = bytesperline; |
758 | *sizeimage = (pix->width * pix->height * fmt->depth[i]) / 8; | 758 | plane_fmt->sizeimage = max((pix->width * pix->height * |
759 | fmt->depth[i]) / 8, plane_fmt->sizeimage); | ||
759 | } | 760 | } |
760 | } | 761 | } |
761 | 762 | ||
diff --git a/drivers/media/video/s5p-fimc/fimc-lite.c b/drivers/media/video/s5p-fimc/fimc-lite.c index 400d701aef04..74ff310db30c 100644 --- a/drivers/media/video/s5p-fimc/fimc-lite.c +++ b/drivers/media/video/s5p-fimc/fimc-lite.c | |||
@@ -451,34 +451,44 @@ static void fimc_lite_clear_event_counters(struct fimc_lite *fimc) | |||
451 | static int fimc_lite_open(struct file *file) | 451 | static int fimc_lite_open(struct file *file) |
452 | { | 452 | { |
453 | struct fimc_lite *fimc = video_drvdata(file); | 453 | struct fimc_lite *fimc = video_drvdata(file); |
454 | int ret = v4l2_fh_open(file); | 454 | int ret; |
455 | 455 | ||
456 | if (ret) | 456 | if (mutex_lock_interruptible(&fimc->lock)) |
457 | return ret; | 457 | return -ERESTARTSYS; |
458 | 458 | ||
459 | set_bit(ST_FLITE_IN_USE, &fimc->state); | 459 | set_bit(ST_FLITE_IN_USE, &fimc->state); |
460 | pm_runtime_get_sync(&fimc->pdev->dev); | 460 | ret = pm_runtime_get_sync(&fimc->pdev->dev); |
461 | if (ret < 0) | ||
462 | goto done; | ||
461 | 463 | ||
462 | if (++fimc->ref_count != 1 || fimc->out_path != FIMC_IO_DMA) | 464 | ret = v4l2_fh_open(file); |
463 | return ret; | 465 | if (ret < 0) |
466 | goto done; | ||
464 | 467 | ||
465 | ret = fimc_pipeline_initialize(&fimc->pipeline, &fimc->vfd->entity, | 468 | if (++fimc->ref_count == 1 && fimc->out_path == FIMC_IO_DMA) { |
466 | true); | 469 | ret = fimc_pipeline_initialize(&fimc->pipeline, |
467 | if (ret < 0) { | 470 | &fimc->vfd->entity, true); |
468 | v4l2_err(fimc->vfd, "Video pipeline initialization failed\n"); | 471 | if (ret < 0) { |
469 | pm_runtime_put_sync(&fimc->pdev->dev); | 472 | pm_runtime_put_sync(&fimc->pdev->dev); |
470 | fimc->ref_count--; | 473 | fimc->ref_count--; |
471 | v4l2_fh_release(file); | 474 | v4l2_fh_release(file); |
472 | clear_bit(ST_FLITE_IN_USE, &fimc->state); | 475 | clear_bit(ST_FLITE_IN_USE, &fimc->state); |
473 | } | 476 | } |
474 | 477 | ||
475 | fimc_lite_clear_event_counters(fimc); | 478 | fimc_lite_clear_event_counters(fimc); |
479 | } | ||
480 | done: | ||
481 | mutex_unlock(&fimc->lock); | ||
476 | return ret; | 482 | return ret; |
477 | } | 483 | } |
478 | 484 | ||
479 | static int fimc_lite_close(struct file *file) | 485 | static int fimc_lite_close(struct file *file) |
480 | { | 486 | { |
481 | struct fimc_lite *fimc = video_drvdata(file); | 487 | struct fimc_lite *fimc = video_drvdata(file); |
488 | int ret; | ||
489 | |||
490 | if (mutex_lock_interruptible(&fimc->lock)) | ||
491 | return -ERESTARTSYS; | ||
482 | 492 | ||
483 | if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) { | 493 | if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) { |
484 | clear_bit(ST_FLITE_IN_USE, &fimc->state); | 494 | clear_bit(ST_FLITE_IN_USE, &fimc->state); |
@@ -492,20 +502,39 @@ static int fimc_lite_close(struct file *file) | |||
492 | if (fimc->ref_count == 0) | 502 | if (fimc->ref_count == 0) |
493 | vb2_queue_release(&fimc->vb_queue); | 503 | vb2_queue_release(&fimc->vb_queue); |
494 | 504 | ||
495 | return v4l2_fh_release(file); | 505 | ret = v4l2_fh_release(file); |
506 | |||
507 | mutex_unlock(&fimc->lock); | ||
508 | return ret; | ||
496 | } | 509 | } |
497 | 510 | ||
498 | static unsigned int fimc_lite_poll(struct file *file, | 511 | static unsigned int fimc_lite_poll(struct file *file, |
499 | struct poll_table_struct *wait) | 512 | struct poll_table_struct *wait) |
500 | { | 513 | { |
501 | struct fimc_lite *fimc = video_drvdata(file); | 514 | struct fimc_lite *fimc = video_drvdata(file); |
502 | return vb2_poll(&fimc->vb_queue, file, wait); | 515 | int ret; |
516 | |||
517 | if (mutex_lock_interruptible(&fimc->lock)) | ||
518 | return POLL_ERR; | ||
519 | |||
520 | ret = vb2_poll(&fimc->vb_queue, file, wait); | ||
521 | mutex_unlock(&fimc->lock); | ||
522 | |||
523 | return ret; | ||
503 | } | 524 | } |
504 | 525 | ||
505 | static int fimc_lite_mmap(struct file *file, struct vm_area_struct *vma) | 526 | static int fimc_lite_mmap(struct file *file, struct vm_area_struct *vma) |
506 | { | 527 | { |
507 | struct fimc_lite *fimc = video_drvdata(file); | 528 | struct fimc_lite *fimc = video_drvdata(file); |
508 | return vb2_mmap(&fimc->vb_queue, vma); | 529 | int ret; |
530 | |||
531 | if (mutex_lock_interruptible(&fimc->lock)) | ||
532 | return -ERESTARTSYS; | ||
533 | |||
534 | ret = vb2_mmap(&fimc->vb_queue, vma); | ||
535 | mutex_unlock(&fimc->lock); | ||
536 | |||
537 | return ret; | ||
509 | } | 538 | } |
510 | 539 | ||
511 | static const struct v4l2_file_operations fimc_lite_fops = { | 540 | static const struct v4l2_file_operations fimc_lite_fops = { |
@@ -762,7 +791,9 @@ static int fimc_lite_streamon(struct file *file, void *priv, | |||
762 | if (fimc_lite_active(fimc)) | 791 | if (fimc_lite_active(fimc)) |
763 | return -EBUSY; | 792 | return -EBUSY; |
764 | 793 | ||
765 | media_entity_pipeline_start(&sensor->entity, p->m_pipeline); | 794 | ret = media_entity_pipeline_start(&sensor->entity, p->m_pipeline); |
795 | if (ret < 0) | ||
796 | return ret; | ||
766 | 797 | ||
767 | ret = fimc_pipeline_validate(fimc); | 798 | ret = fimc_pipeline_validate(fimc); |
768 | if (ret) { | 799 | if (ret) { |
@@ -1508,7 +1539,7 @@ static int fimc_lite_suspend(struct device *dev) | |||
1508 | return 0; | 1539 | return 0; |
1509 | 1540 | ||
1510 | ret = fimc_lite_stop_capture(fimc, suspend); | 1541 | ret = fimc_lite_stop_capture(fimc, suspend); |
1511 | if (ret) | 1542 | if (ret < 0 || !fimc_lite_active(fimc)) |
1512 | return ret; | 1543 | return ret; |
1513 | 1544 | ||
1514 | return fimc_pipeline_shutdown(&fimc->pipeline); | 1545 | return fimc_pipeline_shutdown(&fimc->pipeline); |
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.c b/drivers/media/video/s5p-fimc/fimc-mdevice.c index 6753c45631b8..52cef4865423 100644 --- a/drivers/media/video/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/video/s5p-fimc/fimc-mdevice.c | |||
@@ -193,9 +193,13 @@ int __fimc_pipeline_shutdown(struct fimc_pipeline *p) | |||
193 | 193 | ||
194 | int fimc_pipeline_shutdown(struct fimc_pipeline *p) | 194 | int fimc_pipeline_shutdown(struct fimc_pipeline *p) |
195 | { | 195 | { |
196 | struct media_entity *me = &p->subdevs[IDX_SENSOR]->entity; | 196 | struct media_entity *me; |
197 | int ret; | 197 | int ret; |
198 | 198 | ||
199 | if (!p || !p->subdevs[IDX_SENSOR]) | ||
200 | return -EINVAL; | ||
201 | |||
202 | me = &p->subdevs[IDX_SENSOR]->entity; | ||
199 | mutex_lock(&me->parent->graph_mutex); | 203 | mutex_lock(&me->parent->graph_mutex); |
200 | ret = __fimc_pipeline_shutdown(p); | 204 | ret = __fimc_pipeline_shutdown(p); |
201 | mutex_unlock(&me->parent->graph_mutex); | 205 | mutex_unlock(&me->parent->graph_mutex); |
@@ -498,12 +502,12 @@ static void fimc_md_unregister_entities(struct fimc_md *fmd) | |||
498 | * @source: the source entity to create links to all fimc entities from | 502 | * @source: the source entity to create links to all fimc entities from |
499 | * @sensor: sensor subdev linked to FIMC[fimc_id] entity, may be null | 503 | * @sensor: sensor subdev linked to FIMC[fimc_id] entity, may be null |
500 | * @pad: the source entity pad index | 504 | * @pad: the source entity pad index |
501 | * @fimc_id: index of the fimc device for which link should be enabled | 505 | * @link_mask: bitmask of the fimc devices for which link should be enabled |
502 | */ | 506 | */ |
503 | static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | 507 | static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, |
504 | struct media_entity *source, | 508 | struct media_entity *source, |
505 | struct v4l2_subdev *sensor, | 509 | struct v4l2_subdev *sensor, |
506 | int pad, int fimc_id) | 510 | int pad, int link_mask) |
507 | { | 511 | { |
508 | struct fimc_sensor_info *s_info; | 512 | struct fimc_sensor_info *s_info; |
509 | struct media_entity *sink; | 513 | struct media_entity *sink; |
@@ -520,7 +524,7 @@ static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | |||
520 | if (!fmd->fimc[i]->variant->has_cam_if) | 524 | if (!fmd->fimc[i]->variant->has_cam_if) |
521 | continue; | 525 | continue; |
522 | 526 | ||
523 | flags = (i == fimc_id) ? MEDIA_LNK_FL_ENABLED : 0; | 527 | flags = ((1 << i) & link_mask) ? MEDIA_LNK_FL_ENABLED : 0; |
524 | 528 | ||
525 | sink = &fmd->fimc[i]->vid_cap.subdev.entity; | 529 | sink = &fmd->fimc[i]->vid_cap.subdev.entity; |
526 | ret = media_entity_create_link(source, pad, sink, | 530 | ret = media_entity_create_link(source, pad, sink, |
@@ -552,7 +556,10 @@ static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | |||
552 | if (!fmd->fimc_lite[i]) | 556 | if (!fmd->fimc_lite[i]) |
553 | continue; | 557 | continue; |
554 | 558 | ||
555 | flags = (i == fimc_id) ? MEDIA_LNK_FL_ENABLED : 0; | 559 | if (link_mask & (1 << (i + FIMC_MAX_DEVS))) |
560 | flags = MEDIA_LNK_FL_ENABLED; | ||
561 | else | ||
562 | flags = 0; | ||
556 | 563 | ||
557 | sink = &fmd->fimc_lite[i]->subdev.entity; | 564 | sink = &fmd->fimc_lite[i]->subdev.entity; |
558 | ret = media_entity_create_link(source, pad, sink, | 565 | ret = media_entity_create_link(source, pad, sink, |
@@ -614,9 +621,8 @@ static int fimc_md_create_links(struct fimc_md *fmd) | |||
614 | struct s5p_fimc_isp_info *pdata; | 621 | struct s5p_fimc_isp_info *pdata; |
615 | struct fimc_sensor_info *s_info; | 622 | struct fimc_sensor_info *s_info; |
616 | struct media_entity *source, *sink; | 623 | struct media_entity *source, *sink; |
617 | int i, pad, fimc_id = 0; | 624 | int i, pad, fimc_id = 0, ret = 0; |
618 | int ret = 0; | 625 | u32 flags, link_mask = 0; |
619 | u32 flags; | ||
620 | 626 | ||
621 | for (i = 0; i < fmd->num_sensors; i++) { | 627 | for (i = 0; i < fmd->num_sensors; i++) { |
622 | if (fmd->sensor[i].subdev == NULL) | 628 | if (fmd->sensor[i].subdev == NULL) |
@@ -668,19 +674,20 @@ static int fimc_md_create_links(struct fimc_md *fmd) | |||
668 | if (source == NULL) | 674 | if (source == NULL) |
669 | continue; | 675 | continue; |
670 | 676 | ||
677 | link_mask = 1 << fimc_id++; | ||
671 | ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, | 678 | ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, |
672 | pad, fimc_id++); | 679 | pad, link_mask); |
673 | } | 680 | } |
674 | 681 | ||
675 | fimc_id = 0; | ||
676 | for (i = 0; i < ARRAY_SIZE(fmd->csis); i++) { | 682 | for (i = 0; i < ARRAY_SIZE(fmd->csis); i++) { |
677 | if (fmd->csis[i].sd == NULL) | 683 | if (fmd->csis[i].sd == NULL) |
678 | continue; | 684 | continue; |
679 | source = &fmd->csis[i].sd->entity; | 685 | source = &fmd->csis[i].sd->entity; |
680 | pad = CSIS_PAD_SOURCE; | 686 | pad = CSIS_PAD_SOURCE; |
681 | 687 | ||
688 | link_mask = 1 << fimc_id++; | ||
682 | ret = __fimc_md_create_fimc_sink_links(fmd, source, NULL, | 689 | ret = __fimc_md_create_fimc_sink_links(fmd, source, NULL, |
683 | pad, fimc_id++); | 690 | pad, link_mask); |
684 | } | 691 | } |
685 | 692 | ||
686 | /* Create immutable links between each FIMC's subdev and video node */ | 693 | /* Create immutable links between each FIMC's subdev and video node */ |
@@ -734,8 +741,8 @@ static void fimc_md_put_clocks(struct fimc_md *fmd) | |||
734 | } | 741 | } |
735 | 742 | ||
736 | static int __fimc_md_set_camclk(struct fimc_md *fmd, | 743 | static int __fimc_md_set_camclk(struct fimc_md *fmd, |
737 | struct fimc_sensor_info *s_info, | 744 | struct fimc_sensor_info *s_info, |
738 | bool on) | 745 | bool on) |
739 | { | 746 | { |
740 | struct s5p_fimc_isp_info *pdata = s_info->pdata; | 747 | struct s5p_fimc_isp_info *pdata = s_info->pdata; |
741 | struct fimc_camclk_info *camclk; | 748 | struct fimc_camclk_info *camclk; |
@@ -744,12 +751,10 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
744 | if (WARN_ON(pdata->clk_id >= FIMC_MAX_CAMCLKS) || fmd == NULL) | 751 | if (WARN_ON(pdata->clk_id >= FIMC_MAX_CAMCLKS) || fmd == NULL) |
745 | return -EINVAL; | 752 | return -EINVAL; |
746 | 753 | ||
747 | if (s_info->clk_on == on) | ||
748 | return 0; | ||
749 | camclk = &fmd->camclk[pdata->clk_id]; | 754 | camclk = &fmd->camclk[pdata->clk_id]; |
750 | 755 | ||
751 | dbg("camclk %d, f: %lu, clk: %p, on: %d", | 756 | dbg("camclk %d, f: %lu, use_count: %d, on: %d", |
752 | pdata->clk_id, pdata->clk_frequency, camclk, on); | 757 | pdata->clk_id, pdata->clk_frequency, camclk->use_count, on); |
753 | 758 | ||
754 | if (on) { | 759 | if (on) { |
755 | if (camclk->use_count > 0 && | 760 | if (camclk->use_count > 0 && |
@@ -760,11 +765,9 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
760 | clk_set_rate(camclk->clock, pdata->clk_frequency); | 765 | clk_set_rate(camclk->clock, pdata->clk_frequency); |
761 | camclk->frequency = pdata->clk_frequency; | 766 | camclk->frequency = pdata->clk_frequency; |
762 | ret = clk_enable(camclk->clock); | 767 | ret = clk_enable(camclk->clock); |
768 | dbg("Enabled camclk %d: f: %lu", pdata->clk_id, | ||
769 | clk_get_rate(camclk->clock)); | ||
763 | } | 770 | } |
764 | s_info->clk_on = 1; | ||
765 | dbg("Enabled camclk %d: f: %lu", pdata->clk_id, | ||
766 | clk_get_rate(camclk->clock)); | ||
767 | |||
768 | return ret; | 771 | return ret; |
769 | } | 772 | } |
770 | 773 | ||
@@ -773,7 +776,6 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
773 | 776 | ||
774 | if (--camclk->use_count == 0) { | 777 | if (--camclk->use_count == 0) { |
775 | clk_disable(camclk->clock); | 778 | clk_disable(camclk->clock); |
776 | s_info->clk_on = 0; | ||
777 | dbg("Disabled camclk %d", pdata->clk_id); | 779 | dbg("Disabled camclk %d", pdata->clk_id); |
778 | } | 780 | } |
779 | return ret; | 781 | return ret; |
@@ -789,8 +791,6 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
789 | * devices to which sensors can be attached, either directly or through | 791 | * devices to which sensors can be attached, either directly or through |
790 | * the MIPI CSI receiver. The clock is allowed here to be used by | 792 | * the MIPI CSI receiver. The clock is allowed here to be used by |
791 | * multiple sensors concurrently if they use same frequency. | 793 | * multiple sensors concurrently if they use same frequency. |
792 | * The per sensor subdev clk_on attribute helps to synchronize accesses | ||
793 | * to the sclk_cam clocks from the video and media device nodes. | ||
794 | * This function should only be called when the graph mutex is held. | 794 | * This function should only be called when the graph mutex is held. |
795 | */ | 795 | */ |
796 | int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on) | 796 | int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on) |
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.h b/drivers/media/video/s5p-fimc/fimc-mdevice.h index 3b8a3492a176..1f5dbaff5442 100644 --- a/drivers/media/video/s5p-fimc/fimc-mdevice.h +++ b/drivers/media/video/s5p-fimc/fimc-mdevice.h | |||
@@ -47,7 +47,6 @@ struct fimc_camclk_info { | |||
47 | * @pdata: sensor's atrributes passed as media device's platform data | 47 | * @pdata: sensor's atrributes passed as media device's platform data |
48 | * @subdev: image sensor v4l2 subdev | 48 | * @subdev: image sensor v4l2 subdev |
49 | * @host: fimc device the sensor is currently linked to | 49 | * @host: fimc device the sensor is currently linked to |
50 | * @clk_on: sclk_cam clock's state associated with this subdev | ||
51 | * | 50 | * |
52 | * This data structure applies to image sensor and the writeback subdevs. | 51 | * This data structure applies to image sensor and the writeback subdevs. |
53 | */ | 52 | */ |
@@ -55,7 +54,6 @@ struct fimc_sensor_info { | |||
55 | struct s5p_fimc_isp_info *pdata; | 54 | struct s5p_fimc_isp_info *pdata; |
56 | struct v4l2_subdev *subdev; | 55 | struct v4l2_subdev *subdev; |
57 | struct fimc_dev *host; | 56 | struct fimc_dev *host; |
58 | bool clk_on; | ||
59 | }; | 57 | }; |
60 | 58 | ||
61 | /** | 59 | /** |
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..feea867f318c 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; |
@@ -996,6 +996,7 @@ int s5p_mfc_dec_ctrls_setup(struct s5p_mfc_ctx *ctx) | |||
996 | 996 | ||
997 | for (i = 0; i < NUM_CTRLS; i++) { | 997 | for (i = 0; i < NUM_CTRLS; i++) { |
998 | if (IS_MFC51_PRIV(controls[i].id)) { | 998 | if (IS_MFC51_PRIV(controls[i].id)) { |
999 | memset(&cfg, 0, sizeof(struct v4l2_ctrl_config)); | ||
999 | cfg.ops = &s5p_mfc_dec_ctrl_ops; | 1000 | cfg.ops = &s5p_mfc_dec_ctrl_ops; |
1000 | cfg.id = controls[i].id; | 1001 | cfg.id = controls[i].id; |
1001 | cfg.min = controls[i].minimum; | 1002 | cfg.min = controls[i].minimum; |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c index acedb2004be3..158b78989b89 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; |
@@ -1777,6 +1773,7 @@ int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx) | |||
1777 | } | 1773 | } |
1778 | for (i = 0; i < NUM_CTRLS; i++) { | 1774 | for (i = 0; i < NUM_CTRLS; i++) { |
1779 | if (IS_MFC51_PRIV(controls[i].id)) { | 1775 | if (IS_MFC51_PRIV(controls[i].id)) { |
1776 | memset(&cfg, 0, sizeof(struct v4l2_ctrl_config)); | ||
1780 | cfg.ops = &s5p_mfc_enc_ctrl_ops; | 1777 | cfg.ops = &s5p_mfc_enc_ctrl_ops; |
1781 | cfg.id = controls[i].id; | 1778 | cfg.id = controls[i].id; |
1782 | cfg.min = controls[i].minimum; | 1779 | cfg.min = controls[i].minimum; |
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..9cf5bda35fbe 100644 --- a/drivers/media/video/smiapp/smiapp-core.c +++ b/drivers/media/video/smiapp/smiapp-core.c | |||
@@ -31,7 +31,9 @@ | |||
31 | #include <linux/device.h> | 31 | #include <linux/device.h> |
32 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
34 | #include <linux/slab.h> | ||
34 | #include <linux/regulator/consumer.h> | 35 | #include <linux/regulator/consumer.h> |
36 | #include <linux/slab.h> | ||
35 | #include <linux/v4l2-mediabus.h> | 37 | #include <linux/v4l2-mediabus.h> |
36 | #include <media/v4l2-device.h> | 38 | #include <media/v4l2-device.h> |
37 | 39 | ||
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..0cbada18f6f5 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,9 @@ 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); | ||
684 | SET_VALID_IOCTL(ops, VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap); | ||
682 | /* yes, really vidioc_subscribe_event */ | 685 | /* yes, really vidioc_subscribe_event */ |
683 | SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event); | 686 | SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event); |
684 | SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event); | 687 | 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/Kconfig b/drivers/mfd/Kconfig index e129c820df7d..92144ed1ad46 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -286,6 +286,7 @@ config TWL6040_CORE | |||
286 | depends on I2C=y && GENERIC_HARDIRQS | 286 | depends on I2C=y && GENERIC_HARDIRQS |
287 | select MFD_CORE | 287 | select MFD_CORE |
288 | select REGMAP_I2C | 288 | select REGMAP_I2C |
289 | select IRQ_DOMAIN | ||
289 | default n | 290 | default n |
290 | help | 291 | help |
291 | Say yes here if you want support for Texas Instruments TWL6040 audio | 292 | Say yes here if you want support for Texas Instruments TWL6040 audio |
diff --git a/drivers/mfd/ab5500-core.h b/drivers/mfd/ab5500-core.h deleted file mode 100644 index 63b30b17e4f3..000000000000 --- a/drivers/mfd/ab5500-core.h +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 ST-Ericsson | ||
3 | * License terms: GNU General Public License (GPL) version 2 | ||
4 | * Shared definitions and data structures for the AB5500 MFD driver | ||
5 | */ | ||
6 | |||
7 | /* Read/write operation values. */ | ||
8 | #define AB5500_PERM_RD (0x01) | ||
9 | #define AB5500_PERM_WR (0x02) | ||
10 | |||
11 | /* Read/write permissions. */ | ||
12 | #define AB5500_PERM_RO (AB5500_PERM_RD) | ||
13 | #define AB5500_PERM_RW (AB5500_PERM_RD | AB5500_PERM_WR) | ||
14 | |||
15 | #define AB5500_MASK_BASE (0x60) | ||
16 | #define AB5500_MASK_END (0x79) | ||
17 | #define AB5500_CHIP_ID (0x20) | ||
18 | |||
19 | /** | ||
20 | * struct ab5500_reg_range | ||
21 | * @first: the first address of the range | ||
22 | * @last: the last address of the range | ||
23 | * @perm: access permissions for the range | ||
24 | */ | ||
25 | struct ab5500_reg_range { | ||
26 | u8 first; | ||
27 | u8 last; | ||
28 | u8 perm; | ||
29 | }; | ||
30 | |||
31 | /** | ||
32 | * struct ab5500_i2c_ranges | ||
33 | * @count: the number of ranges in the list | ||
34 | * @range: the list of register ranges | ||
35 | */ | ||
36 | struct ab5500_i2c_ranges { | ||
37 | u8 nranges; | ||
38 | u8 bankid; | ||
39 | const struct ab5500_reg_range *range; | ||
40 | }; | ||
41 | |||
42 | /** | ||
43 | * struct ab5500_i2c_banks | ||
44 | * @count: the number of ranges in the list | ||
45 | * @range: the list of register ranges | ||
46 | */ | ||
47 | struct ab5500_i2c_banks { | ||
48 | u8 nbanks; | ||
49 | const struct ab5500_i2c_ranges *bank; | ||
50 | }; | ||
51 | |||
52 | /** | ||
53 | * struct ab5500_bank | ||
54 | * @slave_addr: I2C slave_addr found in AB5500 specification | ||
55 | * @name: Documentation name of the bank. For reference | ||
56 | */ | ||
57 | struct ab5500_bank { | ||
58 | u8 slave_addr; | ||
59 | const char *name; | ||
60 | }; | ||
61 | |||
62 | static const struct ab5500_bank bankinfo[AB5500_NUM_BANKS] = { | ||
63 | [AB5500_BANK_VIT_IO_I2C_CLK_TST_OTP] = { | ||
64 | AB5500_ADDR_VIT_IO_I2C_CLK_TST_OTP, "VIT_IO_I2C_CLK_TST_OTP"}, | ||
65 | [AB5500_BANK_VDDDIG_IO_I2C_CLK_TST] = { | ||
66 | AB5500_ADDR_VDDDIG_IO_I2C_CLK_TST, "VDDDIG_IO_I2C_CLK_TST"}, | ||
67 | [AB5500_BANK_VDENC] = {AB5500_ADDR_VDENC, "VDENC"}, | ||
68 | [AB5500_BANK_SIM_USBSIM] = {AB5500_ADDR_SIM_USBSIM, "SIM_USBSIM"}, | ||
69 | [AB5500_BANK_LED] = {AB5500_ADDR_LED, "LED"}, | ||
70 | [AB5500_BANK_ADC] = {AB5500_ADDR_ADC, "ADC"}, | ||
71 | [AB5500_BANK_RTC] = {AB5500_ADDR_RTC, "RTC"}, | ||
72 | [AB5500_BANK_STARTUP] = {AB5500_ADDR_STARTUP, "STARTUP"}, | ||
73 | [AB5500_BANK_DBI_ECI] = {AB5500_ADDR_DBI_ECI, "DBI-ECI"}, | ||
74 | [AB5500_BANK_CHG] = {AB5500_ADDR_CHG, "CHG"}, | ||
75 | [AB5500_BANK_FG_BATTCOM_ACC] = { | ||
76 | AB5500_ADDR_FG_BATTCOM_ACC, "FG_BATCOM_ACC"}, | ||
77 | [AB5500_BANK_USB] = {AB5500_ADDR_USB, "USB"}, | ||
78 | [AB5500_BANK_IT] = {AB5500_ADDR_IT, "IT"}, | ||
79 | [AB5500_BANK_VIBRA] = {AB5500_ADDR_VIBRA, "VIBRA"}, | ||
80 | [AB5500_BANK_AUDIO_HEADSETUSB] = { | ||
81 | AB5500_ADDR_AUDIO_HEADSETUSB, "AUDIO_HEADSETUSB"}, | ||
82 | }; | ||
83 | |||
84 | int ab5500_get_register_interruptible_raw(struct ab5500 *ab, u8 bank, u8 reg, | ||
85 | u8 *value); | ||
86 | int ab5500_mask_and_set_register_interruptible_raw(struct ab5500 *ab, u8 bank, | ||
87 | u8 reg, u8 bitmask, u8 bitvalues); | ||
diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index 3fcdab3eb8eb..03df422feb76 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c | |||
@@ -49,10 +49,72 @@ static struct regmap_config mc13xxx_regmap_spi_config = { | |||
49 | .reg_bits = 7, | 49 | .reg_bits = 7, |
50 | .pad_bits = 1, | 50 | .pad_bits = 1, |
51 | .val_bits = 24, | 51 | .val_bits = 24, |
52 | .write_flag_mask = 0x80, | ||
52 | 53 | ||
53 | .max_register = MC13XXX_NUMREGS, | 54 | .max_register = MC13XXX_NUMREGS, |
54 | 55 | ||
55 | .cache_type = REGCACHE_NONE, | 56 | .cache_type = REGCACHE_NONE, |
57 | .use_single_rw = 1, | ||
58 | }; | ||
59 | |||
60 | static int mc13xxx_spi_read(void *context, const void *reg, size_t reg_size, | ||
61 | void *val, size_t val_size) | ||
62 | { | ||
63 | unsigned char w[4] = { *((unsigned char *) reg), 0, 0, 0}; | ||
64 | unsigned char r[4]; | ||
65 | unsigned char *p = val; | ||
66 | struct device *dev = context; | ||
67 | struct spi_device *spi = to_spi_device(dev); | ||
68 | struct spi_transfer t = { | ||
69 | .tx_buf = w, | ||
70 | .rx_buf = r, | ||
71 | .len = 4, | ||
72 | }; | ||
73 | |||
74 | struct spi_message m; | ||
75 | int ret; | ||
76 | |||
77 | if (val_size != 3 || reg_size != 1) | ||
78 | return -ENOTSUPP; | ||
79 | |||
80 | spi_message_init(&m); | ||
81 | spi_message_add_tail(&t, &m); | ||
82 | ret = spi_sync(spi, &m); | ||
83 | |||
84 | memcpy(p, &r[1], 3); | ||
85 | |||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | static int mc13xxx_spi_write(void *context, const void *data, size_t count) | ||
90 | { | ||
91 | struct device *dev = context; | ||
92 | struct spi_device *spi = to_spi_device(dev); | ||
93 | |||
94 | if (count != 4) | ||
95 | return -ENOTSUPP; | ||
96 | |||
97 | return spi_write(spi, data, count); | ||
98 | } | ||
99 | |||
100 | /* | ||
101 | * We cannot use regmap-spi generic bus implementation here. | ||
102 | * The MC13783 chip will get corrupted if CS signal is deasserted | ||
103 | * and on i.Mx31 SoC (the target SoC for MC13783 PMIC) the SPI controller | ||
104 | * has the following errata (DSPhl22960): | ||
105 | * "The CSPI negates SS when the FIFO becomes empty with | ||
106 | * SSCTL= 0. Software cannot guarantee that the FIFO will not | ||
107 | * drain because of higher priority interrupts and the | ||
108 | * non-realtime characteristics of the operating system. As a | ||
109 | * result, the SS will negate before all of the data has been | ||
110 | * transferred to/from the peripheral." | ||
111 | * We workaround this by accessing the SPI controller with a | ||
112 | * single transfert. | ||
113 | */ | ||
114 | |||
115 | static struct regmap_bus regmap_mc13xxx_bus = { | ||
116 | .write = mc13xxx_spi_write, | ||
117 | .read = mc13xxx_spi_read, | ||
56 | }; | 118 | }; |
57 | 119 | ||
58 | static int mc13xxx_spi_probe(struct spi_device *spi) | 120 | static int mc13xxx_spi_probe(struct spi_device *spi) |
@@ -73,12 +135,13 @@ static int mc13xxx_spi_probe(struct spi_device *spi) | |||
73 | 135 | ||
74 | dev_set_drvdata(&spi->dev, mc13xxx); | 136 | dev_set_drvdata(&spi->dev, mc13xxx); |
75 | spi->mode = SPI_MODE_0 | SPI_CS_HIGH; | 137 | spi->mode = SPI_MODE_0 | SPI_CS_HIGH; |
76 | spi->bits_per_word = 32; | ||
77 | 138 | ||
78 | mc13xxx->dev = &spi->dev; | 139 | mc13xxx->dev = &spi->dev; |
79 | mutex_init(&mc13xxx->lock); | 140 | mutex_init(&mc13xxx->lock); |
80 | 141 | ||
81 | mc13xxx->regmap = regmap_init_spi(spi, &mc13xxx_regmap_spi_config); | 142 | mc13xxx->regmap = regmap_init(&spi->dev, ®map_mc13xxx_bus, &spi->dev, |
143 | &mc13xxx_regmap_spi_config); | ||
144 | |||
82 | if (IS_ERR(mc13xxx->regmap)) { | 145 | if (IS_ERR(mc13xxx->regmap)) { |
83 | ret = PTR_ERR(mc13xxx->regmap); | 146 | ret = PTR_ERR(mc13xxx->regmap); |
84 | dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n", | 147 | dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n", |
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 7e96bb229724..41088ecbb2a9 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/clk.h> | 25 | #include <linux/clk.h> |
26 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/gpio.h> | ||
28 | #include <plat/cpu.h> | 29 | #include <plat/cpu.h> |
29 | #include <plat/usb.h> | 30 | #include <plat/usb.h> |
30 | #include <linux/pm_runtime.h> | 31 | #include <linux/pm_runtime.h> |
@@ -500,8 +501,21 @@ static void omap_usbhs_init(struct device *dev) | |||
500 | dev_dbg(dev, "starting TI HSUSB Controller\n"); | 501 | dev_dbg(dev, "starting TI HSUSB Controller\n"); |
501 | 502 | ||
502 | pm_runtime_get_sync(dev); | 503 | pm_runtime_get_sync(dev); |
503 | spin_lock_irqsave(&omap->lock, flags); | ||
504 | 504 | ||
505 | if (pdata->ehci_data->phy_reset) { | ||
506 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
507 | gpio_request_one(pdata->ehci_data->reset_gpio_port[0], | ||
508 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | ||
509 | |||
510 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
511 | gpio_request_one(pdata->ehci_data->reset_gpio_port[1], | ||
512 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | ||
513 | |||
514 | /* Hold the PHY in RESET for enough time till DIR is high */ | ||
515 | udelay(10); | ||
516 | } | ||
517 | |||
518 | spin_lock_irqsave(&omap->lock, flags); | ||
505 | omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); | 519 | omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); |
506 | dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev); | 520 | dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev); |
507 | 521 | ||
@@ -581,9 +595,39 @@ static void omap_usbhs_init(struct device *dev) | |||
581 | } | 595 | } |
582 | 596 | ||
583 | spin_unlock_irqrestore(&omap->lock, flags); | 597 | spin_unlock_irqrestore(&omap->lock, flags); |
598 | |||
599 | if (pdata->ehci_data->phy_reset) { | ||
600 | /* Hold the PHY in RESET for enough time till | ||
601 | * PHY is settled and ready | ||
602 | */ | ||
603 | udelay(10); | ||
604 | |||
605 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
606 | gpio_set_value_cansleep | ||
607 | (pdata->ehci_data->reset_gpio_port[0], 1); | ||
608 | |||
609 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
610 | gpio_set_value_cansleep | ||
611 | (pdata->ehci_data->reset_gpio_port[1], 1); | ||
612 | } | ||
613 | |||
584 | pm_runtime_put_sync(dev); | 614 | pm_runtime_put_sync(dev); |
585 | } | 615 | } |
586 | 616 | ||
617 | static void omap_usbhs_deinit(struct device *dev) | ||
618 | { | ||
619 | struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); | ||
620 | struct usbhs_omap_platform_data *pdata = &omap->platdata; | ||
621 | |||
622 | if (pdata->ehci_data->phy_reset) { | ||
623 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
624 | gpio_free(pdata->ehci_data->reset_gpio_port[0]); | ||
625 | |||
626 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
627 | gpio_free(pdata->ehci_data->reset_gpio_port[1]); | ||
628 | } | ||
629 | } | ||
630 | |||
587 | 631 | ||
588 | /** | 632 | /** |
589 | * usbhs_omap_probe - initialize TI-based HCDs | 633 | * usbhs_omap_probe - initialize TI-based HCDs |
@@ -767,6 +811,7 @@ static int __devinit usbhs_omap_probe(struct platform_device *pdev) | |||
767 | goto end_probe; | 811 | goto end_probe; |
768 | 812 | ||
769 | err_alloc: | 813 | err_alloc: |
814 | omap_usbhs_deinit(&pdev->dev); | ||
770 | iounmap(omap->tll_base); | 815 | iounmap(omap->tll_base); |
771 | 816 | ||
772 | err_tll: | 817 | err_tll: |
@@ -818,6 +863,7 @@ static int __devexit usbhs_omap_remove(struct platform_device *pdev) | |||
818 | { | 863 | { |
819 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); | 864 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); |
820 | 865 | ||
866 | omap_usbhs_deinit(&pdev->dev); | ||
821 | iounmap(omap->tll_base); | 867 | iounmap(omap->tll_base); |
822 | iounmap(omap->uhh_base); | 868 | iounmap(omap->uhh_base); |
823 | clk_put(omap->init_60m_fclk); | 869 | clk_put(omap->init_60m_fclk); |
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 00c0aba7eba0..c4a69f193a1d 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c | |||
@@ -356,7 +356,14 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c, | |||
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | ret = regmap_add_irq_chip(palmas->regmap[1], palmas->irq, | 359 | /* Change IRQ into clear on read mode for efficiency */ |
360 | slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE); | ||
361 | addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL); | ||
362 | reg = PALMAS_INT_CTRL_INT_CLEAR; | ||
363 | |||
364 | regmap_write(palmas->regmap[slave], addr, reg); | ||
365 | |||
366 | ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq, | ||
360 | IRQF_ONESHOT | IRQF_TRIGGER_LOW, -1, &palmas_irq_chip, | 367 | IRQF_ONESHOT | IRQF_TRIGGER_LOW, -1, &palmas_irq_chip, |
361 | &palmas->irq_data); | 368 | &palmas->irq_data); |
362 | if (ret < 0) | 369 | if (ret < 0) |
@@ -441,6 +448,9 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c, | |||
441 | goto err; | 448 | goto err; |
442 | } | 449 | } |
443 | 450 | ||
451 | children[PALMAS_PMIC_ID].platform_data = pdata->pmic_pdata; | ||
452 | children[PALMAS_PMIC_ID].pdata_size = sizeof(*pdata->pmic_pdata); | ||
453 | |||
444 | ret = mfd_add_devices(palmas->dev, -1, | 454 | ret = mfd_add_devices(palmas->dev, -1, |
445 | children, ARRAY_SIZE(palmas_children), | 455 | children, ARRAY_SIZE(palmas_children), |
446 | NULL, regmap_irq_chip_get_base(palmas->irq_data)); | 456 | NULL, regmap_irq_chip_get_base(palmas->irq_data)); |
@@ -472,6 +482,7 @@ static const struct i2c_device_id palmas_i2c_id[] = { | |||
472 | { "twl6035", }, | 482 | { "twl6035", }, |
473 | { "twl6037", }, | 483 | { "twl6037", }, |
474 | { "tps65913", }, | 484 | { "tps65913", }, |
485 | { /* end */ } | ||
475 | }; | 486 | }; |
476 | MODULE_DEVICE_TABLE(i2c, palmas_i2c_id); | 487 | MODULE_DEVICE_TABLE(i2c, palmas_i2c_id); |
477 | 488 | ||
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..783fcd7365bc 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) |
@@ -1145,7 +1147,7 @@ static int mei_pci_resume(struct device *device) | |||
1145 | err = request_threaded_irq(pdev->irq, | 1147 | err = request_threaded_irq(pdev->irq, |
1146 | NULL, | 1148 | NULL, |
1147 | mei_interrupt_thread_handler, | 1149 | mei_interrupt_thread_handler, |
1148 | 0, mei_driver_name, dev); | 1150 | IRQF_ONESHOT, mei_driver_name, dev); |
1149 | else | 1151 | else |
1150 | err = request_threaded_irq(pdev->irq, | 1152 | err = request_threaded_irq(pdev->irq, |
1151 | mei_interrupt_quick_handler, | 1153 | mei_interrupt_quick_handler, |
@@ -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/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index 17bbacb1b4b1..87b251ab6ec5 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c | |||
@@ -452,9 +452,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part, | |||
452 | 452 | ||
453 | if (msg->activate_gru_mq_desc_gpa != | 453 | if (msg->activate_gru_mq_desc_gpa != |
454 | part_uv->activate_gru_mq_desc_gpa) { | 454 | part_uv->activate_gru_mq_desc_gpa) { |
455 | spin_lock_irqsave(&part_uv->flags_lock, irq_flags); | 455 | spin_lock(&part_uv->flags_lock); |
456 | part_uv->flags &= ~XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV; | 456 | part_uv->flags &= ~XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV; |
457 | spin_unlock_irqrestore(&part_uv->flags_lock, irq_flags); | 457 | spin_unlock(&part_uv->flags_lock); |
458 | part_uv->activate_gru_mq_desc_gpa = | 458 | part_uv->activate_gru_mq_desc_gpa = |
459 | msg->activate_gru_mq_desc_gpa; | 459 | msg->activate_gru_mq_desc_gpa; |
460 | } | 460 | } |
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/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c index f13e38deceac..8f5dc08d6598 100644 --- a/drivers/mmc/core/cd-gpio.c +++ b/drivers/mmc/core/cd-gpio.c | |||
@@ -50,8 +50,8 @@ int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio) | |||
50 | goto egpioreq; | 50 | goto egpioreq; |
51 | 51 | ||
52 | ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt, | 52 | ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt, |
53 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 53 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | |
54 | cd->label, host); | 54 | IRQF_ONESHOT, cd->label, host); |
55 | if (ret < 0) | 55 | if (ret < 0) |
56 | goto eirqreq; | 56 | goto eirqreq; |
57 | 57 | ||
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 2d4a4b746750..4f4489aa6bae 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -717,10 +717,6 @@ static int mmc_select_powerclass(struct mmc_card *card, | |||
717 | card->ext_csd.generic_cmd6_time); | 717 | card->ext_csd.generic_cmd6_time); |
718 | } | 718 | } |
719 | 719 | ||
720 | if (err) | ||
721 | pr_err("%s: power class selection for ext_csd_bus_width %d" | ||
722 | " failed\n", mmc_hostname(card->host), bus_width); | ||
723 | |||
724 | return err; | 720 | return err; |
725 | } | 721 | } |
726 | 722 | ||
@@ -1104,7 +1100,9 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
1104 | EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4; | 1100 | EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4; |
1105 | err = mmc_select_powerclass(card, ext_csd_bits, ext_csd); | 1101 | err = mmc_select_powerclass(card, ext_csd_bits, ext_csd); |
1106 | if (err) | 1102 | if (err) |
1107 | goto err; | 1103 | pr_warning("%s: power class selection to bus width %d" |
1104 | " failed\n", mmc_hostname(card->host), | ||
1105 | 1 << bus_width); | ||
1108 | } | 1106 | } |
1109 | 1107 | ||
1110 | /* | 1108 | /* |
@@ -1136,7 +1134,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
1136 | err = mmc_select_powerclass(card, ext_csd_bits[idx][0], | 1134 | err = mmc_select_powerclass(card, ext_csd_bits[idx][0], |
1137 | ext_csd); | 1135 | ext_csd); |
1138 | if (err) | 1136 | if (err) |
1139 | goto err; | 1137 | pr_warning("%s: power class selection to " |
1138 | "bus width %d failed\n", | ||
1139 | mmc_hostname(card->host), | ||
1140 | 1 << bus_width); | ||
1140 | 1141 | ||
1141 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, | 1142 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, |
1142 | EXT_CSD_BUS_WIDTH, | 1143 | EXT_CSD_BUS_WIDTH, |
@@ -1164,7 +1165,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
1164 | err = mmc_select_powerclass(card, ext_csd_bits[idx][1], | 1165 | err = mmc_select_powerclass(card, ext_csd_bits[idx][1], |
1165 | ext_csd); | 1166 | ext_csd); |
1166 | if (err) | 1167 | if (err) |
1167 | goto err; | 1168 | pr_warning("%s: power class selection to " |
1169 | "bus width %d ddr %d failed\n", | ||
1170 | mmc_hostname(card->host), | ||
1171 | 1 << bus_width, ddr); | ||
1168 | 1172 | ||
1169 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, | 1173 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, |
1170 | EXT_CSD_BUS_WIDTH, | 1174 | EXT_CSD_BUS_WIDTH, |
@@ -1326,7 +1330,7 @@ static int mmc_suspend(struct mmc_host *host) | |||
1326 | if (!err) | 1330 | if (!err) |
1327 | mmc_card_set_sleep(host->card); | 1331 | mmc_card_set_sleep(host->card); |
1328 | } else if (!mmc_host_is_spi(host)) | 1332 | } else if (!mmc_host_is_spi(host)) |
1329 | mmc_deselect_cards(host); | 1333 | err = mmc_deselect_cards(host); |
1330 | host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200); | 1334 | host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200); |
1331 | mmc_release_host(host); | 1335 | mmc_release_host(host); |
1332 | 1336 | ||
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index c272c6868ecf..b2b43f624b9e 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -1075,16 +1075,18 @@ static void mmc_sd_detect(struct mmc_host *host) | |||
1075 | */ | 1075 | */ |
1076 | static int mmc_sd_suspend(struct mmc_host *host) | 1076 | static int mmc_sd_suspend(struct mmc_host *host) |
1077 | { | 1077 | { |
1078 | int err = 0; | ||
1079 | |||
1078 | BUG_ON(!host); | 1080 | BUG_ON(!host); |
1079 | BUG_ON(!host->card); | 1081 | BUG_ON(!host->card); |
1080 | 1082 | ||
1081 | mmc_claim_host(host); | 1083 | mmc_claim_host(host); |
1082 | if (!mmc_host_is_spi(host)) | 1084 | if (!mmc_host_is_spi(host)) |
1083 | mmc_deselect_cards(host); | 1085 | err = mmc_deselect_cards(host); |
1084 | host->card->state &= ~MMC_STATE_HIGHSPEED; | 1086 | host->card->state &= ~MMC_STATE_HIGHSPEED; |
1085 | mmc_release_host(host); | 1087 | mmc_release_host(host); |
1086 | 1088 | ||
1087 | return 0; | 1089 | return err; |
1088 | } | 1090 | } |
1089 | 1091 | ||
1090 | /* | 1092 | /* |
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 13d0e95380ab..41c5fd8848f4 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -218,6 +218,12 @@ static int sdio_enable_wide(struct mmc_card *card) | |||
218 | if (ret) | 218 | if (ret) |
219 | return ret; | 219 | return ret; |
220 | 220 | ||
221 | if ((ctrl & SDIO_BUS_WIDTH_MASK) == SDIO_BUS_WIDTH_RESERVED) | ||
222 | pr_warning("%s: SDIO_CCCR_IF is invalid: 0x%02x\n", | ||
223 | mmc_hostname(card->host), ctrl); | ||
224 | |||
225 | /* set as 4-bit bus width */ | ||
226 | ctrl &= ~SDIO_BUS_WIDTH_MASK; | ||
221 | ctrl |= SDIO_BUS_WIDTH_4BIT; | 227 | ctrl |= SDIO_BUS_WIDTH_4BIT; |
222 | 228 | ||
223 | ret = mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_IF, ctrl, NULL); | 229 | ret = mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_IF, ctrl, NULL); |
diff --git a/drivers/mmc/host/atmel-mci-regs.h b/drivers/mmc/host/atmel-mci-regs.h index 787aba1682bb..ab56f7db5315 100644 --- a/drivers/mmc/host/atmel-mci-regs.h +++ b/drivers/mmc/host/atmel-mci-regs.h | |||
@@ -140,4 +140,18 @@ | |||
140 | #define atmci_writel(port,reg,value) \ | 140 | #define atmci_writel(port,reg,value) \ |
141 | __raw_writel((value), (port)->regs + reg) | 141 | __raw_writel((value), (port)->regs + reg) |
142 | 142 | ||
143 | /* | ||
144 | * Fix sconfig's burst size according to atmel MCI. We need to convert them as: | ||
145 | * 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3. | ||
146 | * | ||
147 | * This can be done by finding most significant bit set. | ||
148 | */ | ||
149 | static inline unsigned int atmci_convert_chksize(unsigned int maxburst) | ||
150 | { | ||
151 | if (maxburst > 1) | ||
152 | return fls(maxburst) - 2; | ||
153 | else | ||
154 | return 0; | ||
155 | } | ||
156 | |||
143 | #endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */ | 157 | #endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */ |
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 420aca642b14..f2c115e06438 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -910,6 +910,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) | |||
910 | enum dma_data_direction direction; | 910 | enum dma_data_direction direction; |
911 | enum dma_transfer_direction slave_dirn; | 911 | enum dma_transfer_direction slave_dirn; |
912 | unsigned int sglen; | 912 | unsigned int sglen; |
913 | u32 maxburst; | ||
913 | u32 iflags; | 914 | u32 iflags; |
914 | 915 | ||
915 | data->error = -EINPROGRESS; | 916 | data->error = -EINPROGRESS; |
@@ -943,17 +944,18 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) | |||
943 | if (!chan) | 944 | if (!chan) |
944 | return -ENODEV; | 945 | return -ENODEV; |
945 | 946 | ||
946 | if (host->caps.has_dma) | ||
947 | atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(3) | ATMCI_DMAEN); | ||
948 | |||
949 | if (data->flags & MMC_DATA_READ) { | 947 | if (data->flags & MMC_DATA_READ) { |
950 | direction = DMA_FROM_DEVICE; | 948 | direction = DMA_FROM_DEVICE; |
951 | host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM; | 949 | host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM; |
950 | maxburst = atmci_convert_chksize(host->dma_conf.src_maxburst); | ||
952 | } else { | 951 | } else { |
953 | direction = DMA_TO_DEVICE; | 952 | direction = DMA_TO_DEVICE; |
954 | host->dma_conf.direction = slave_dirn = DMA_MEM_TO_DEV; | 953 | host->dma_conf.direction = slave_dirn = DMA_MEM_TO_DEV; |
954 | maxburst = atmci_convert_chksize(host->dma_conf.dst_maxburst); | ||
955 | } | 955 | } |
956 | 956 | ||
957 | atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(maxburst) | ATMCI_DMAEN); | ||
958 | |||
957 | sglen = dma_map_sg(chan->device->dev, data->sg, | 959 | sglen = dma_map_sg(chan->device->dev, data->sg, |
958 | data->sg_len, direction); | 960 | data->sg_len, direction); |
959 | 961 | ||
@@ -2314,6 +2316,8 @@ static int __init atmci_probe(struct platform_device *pdev) | |||
2314 | 2316 | ||
2315 | platform_set_drvdata(pdev, host); | 2317 | platform_set_drvdata(pdev, host); |
2316 | 2318 | ||
2319 | setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host); | ||
2320 | |||
2317 | /* We need at least one slot to succeed */ | 2321 | /* We need at least one slot to succeed */ |
2318 | nr_slots = 0; | 2322 | nr_slots = 0; |
2319 | ret = -ENODEV; | 2323 | ret = -ENODEV; |
@@ -2352,8 +2356,6 @@ static int __init atmci_probe(struct platform_device *pdev) | |||
2352 | } | 2356 | } |
2353 | } | 2357 | } |
2354 | 2358 | ||
2355 | setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host); | ||
2356 | |||
2357 | dev_info(&pdev->dev, | 2359 | dev_info(&pdev->dev, |
2358 | "Atmel MCI controller at 0x%08lx irq %d, %u slots\n", | 2360 | "Atmel MCI controller at 0x%08lx irq %d, %u slots\n", |
2359 | host->mapbase, irq, nr_slots); | 2361 | host->mapbase, irq, nr_slots); |
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 9bbf45f8c538..1ca5e72ceb65 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -418,6 +418,8 @@ static int dw_mci_idmac_init(struct dw_mci *host) | |||
418 | p->des3 = host->sg_dma; | 418 | p->des3 = host->sg_dma; |
419 | p->des0 = IDMAC_DES0_ER; | 419 | p->des0 = IDMAC_DES0_ER; |
420 | 420 | ||
421 | mci_writel(host, BMOD, SDMMC_IDMAC_SWRESET); | ||
422 | |||
421 | /* Mask out interrupts - get Tx & Rx complete only */ | 423 | /* Mask out interrupts - get Tx & Rx complete only */ |
422 | mci_writel(host, IDINTEN, SDMMC_IDMAC_INT_NI | SDMMC_IDMAC_INT_RI | | 424 | mci_writel(host, IDINTEN, SDMMC_IDMAC_INT_NI | SDMMC_IDMAC_INT_RI | |
423 | SDMMC_IDMAC_INT_TI); | 425 | SDMMC_IDMAC_INT_TI); |
@@ -615,14 +617,15 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot) | |||
615 | u32 div; | 617 | u32 div; |
616 | 618 | ||
617 | if (slot->clock != host->current_speed) { | 619 | if (slot->clock != host->current_speed) { |
618 | if (host->bus_hz % slot->clock) | 620 | div = host->bus_hz / slot->clock; |
621 | if (host->bus_hz % slot->clock && host->bus_hz > slot->clock) | ||
619 | /* | 622 | /* |
620 | * move the + 1 after the divide to prevent | 623 | * move the + 1 after the divide to prevent |
621 | * over-clocking the card. | 624 | * over-clocking the card. |
622 | */ | 625 | */ |
623 | div = ((host->bus_hz / slot->clock) >> 1) + 1; | 626 | div += 1; |
624 | else | 627 | |
625 | div = (host->bus_hz / slot->clock) >> 1; | 628 | div = (host->bus_hz != slot->clock) ? DIV_ROUND_UP(div, 2) : 0; |
626 | 629 | ||
627 | dev_info(&slot->mmc->class_dev, | 630 | dev_info(&slot->mmc->class_dev, |
628 | "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ" | 631 | "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ" |
@@ -939,8 +942,8 @@ static void dw_mci_command_complete(struct dw_mci *host, struct mmc_command *cmd | |||
939 | mdelay(20); | 942 | mdelay(20); |
940 | 943 | ||
941 | if (cmd->data) { | 944 | if (cmd->data) { |
942 | host->data = NULL; | ||
943 | dw_mci_stop_dma(host); | 945 | dw_mci_stop_dma(host); |
946 | host->data = NULL; | ||
944 | } | 947 | } |
945 | } | 948 | } |
946 | } | 949 | } |
@@ -1623,7 +1626,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) | |||
1623 | if (pending & (SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI)) { | 1626 | if (pending & (SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI)) { |
1624 | mci_writel(host, IDSTS, SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI); | 1627 | mci_writel(host, IDSTS, SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI); |
1625 | mci_writel(host, IDSTS, SDMMC_IDMAC_INT_NI); | 1628 | mci_writel(host, IDSTS, SDMMC_IDMAC_INT_NI); |
1626 | set_bit(EVENT_DATA_COMPLETE, &host->pending_events); | ||
1627 | host->dma_ops->complete(host); | 1629 | host->dma_ops->complete(host); |
1628 | } | 1630 | } |
1629 | #endif | 1631 | #endif |
@@ -1725,7 +1727,8 @@ static void dw_mci_work_routine_card(struct work_struct *work) | |||
1725 | 1727 | ||
1726 | #ifdef CONFIG_MMC_DW_IDMAC | 1728 | #ifdef CONFIG_MMC_DW_IDMAC |
1727 | ctrl = mci_readl(host, BMOD); | 1729 | ctrl = mci_readl(host, BMOD); |
1728 | ctrl |= 0x01; /* Software reset of DMA */ | 1730 | /* Software reset of DMA */ |
1731 | ctrl |= SDMMC_IDMAC_SWRESET; | ||
1729 | mci_writel(host, BMOD, ctrl); | 1732 | mci_writel(host, BMOD, ctrl); |
1730 | #endif | 1733 | #endif |
1731 | 1734 | ||
@@ -1950,10 +1953,6 @@ int dw_mci_probe(struct dw_mci *host) | |||
1950 | spin_lock_init(&host->lock); | 1953 | spin_lock_init(&host->lock); |
1951 | INIT_LIST_HEAD(&host->queue); | 1954 | INIT_LIST_HEAD(&host->queue); |
1952 | 1955 | ||
1953 | |||
1954 | host->dma_ops = host->pdata->dma_ops; | ||
1955 | dw_mci_init_dma(host); | ||
1956 | |||
1957 | /* | 1956 | /* |
1958 | * Get the host data width - this assumes that HCON has been set with | 1957 | * Get the host data width - this assumes that HCON has been set with |
1959 | * the correct values. | 1958 | * the correct values. |
@@ -1981,10 +1980,11 @@ int dw_mci_probe(struct dw_mci *host) | |||
1981 | } | 1980 | } |
1982 | 1981 | ||
1983 | /* Reset all blocks */ | 1982 | /* Reset all blocks */ |
1984 | if (!mci_wait_reset(&host->dev, host)) { | 1983 | if (!mci_wait_reset(&host->dev, host)) |
1985 | ret = -ENODEV; | 1984 | return -ENODEV; |
1986 | goto err_dmaunmap; | 1985 | |
1987 | } | 1986 | host->dma_ops = host->pdata->dma_ops; |
1987 | dw_mci_init_dma(host); | ||
1988 | 1988 | ||
1989 | /* Clear the interrupts for the host controller */ | 1989 | /* Clear the interrupts for the host controller */ |
1990 | mci_writel(host, RINTSTS, 0xFFFFFFFF); | 1990 | mci_writel(host, RINTSTS, 0xFFFFFFFF); |
@@ -2170,14 +2170,14 @@ int dw_mci_resume(struct dw_mci *host) | |||
2170 | if (host->vmmc) | 2170 | if (host->vmmc) |
2171 | regulator_enable(host->vmmc); | 2171 | regulator_enable(host->vmmc); |
2172 | 2172 | ||
2173 | if (host->dma_ops->init) | ||
2174 | host->dma_ops->init(host); | ||
2175 | |||
2176 | if (!mci_wait_reset(&host->dev, host)) { | 2173 | if (!mci_wait_reset(&host->dev, host)) { |
2177 | ret = -ENODEV; | 2174 | ret = -ENODEV; |
2178 | return ret; | 2175 | return ret; |
2179 | } | 2176 | } |
2180 | 2177 | ||
2178 | if (host->dma_ops->init) | ||
2179 | host->dma_ops->init(host); | ||
2180 | |||
2181 | /* Restore the old value at FIFOTH register */ | 2181 | /* Restore the old value at FIFOTH register */ |
2182 | mci_writel(host, FIFOTH, host->fifoth_val); | 2182 | mci_writel(host, FIFOTH, host->fifoth_val); |
2183 | 2183 | ||
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/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 34a90266ab11..277161d279b8 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c | |||
@@ -894,8 +894,8 @@ static struct platform_driver mxs_mmc_driver = { | |||
894 | .owner = THIS_MODULE, | 894 | .owner = THIS_MODULE, |
895 | #ifdef CONFIG_PM | 895 | #ifdef CONFIG_PM |
896 | .pm = &mxs_mmc_pm_ops, | 896 | .pm = &mxs_mmc_pm_ops, |
897 | .of_match_table = mxs_mmc_dt_ids, | ||
898 | #endif | 897 | #endif |
898 | .of_match_table = mxs_mmc_dt_ids, | ||
899 | }, | 899 | }, |
900 | }; | 900 | }; |
901 | 901 | ||
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 552196c764d4..3e8dcf8d2e05 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -1300,7 +1300,7 @@ static const struct mmc_host_ops mmc_omap_ops = { | |||
1300 | .set_ios = mmc_omap_set_ios, | 1300 | .set_ios = mmc_omap_set_ios, |
1301 | }; | 1301 | }; |
1302 | 1302 | ||
1303 | static int __init mmc_omap_new_slot(struct mmc_omap_host *host, int id) | 1303 | static int __devinit mmc_omap_new_slot(struct mmc_omap_host *host, int id) |
1304 | { | 1304 | { |
1305 | struct mmc_omap_slot *slot = NULL; | 1305 | struct mmc_omap_slot *slot = NULL; |
1306 | struct mmc_host *mmc; | 1306 | struct mmc_host *mmc; |
@@ -1485,24 +1485,26 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) | |||
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | host->nr_slots = pdata->nr_slots; | 1487 | host->nr_slots = pdata->nr_slots; |
1488 | host->reg_shift = (cpu_is_omap7xx() ? 1 : 2); | ||
1489 | |||
1490 | host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0); | ||
1491 | if (!host->mmc_omap_wq) | ||
1492 | goto err_plat_cleanup; | ||
1493 | |||
1488 | for (i = 0; i < pdata->nr_slots; i++) { | 1494 | for (i = 0; i < pdata->nr_slots; i++) { |
1489 | ret = mmc_omap_new_slot(host, i); | 1495 | ret = mmc_omap_new_slot(host, i); |
1490 | if (ret < 0) { | 1496 | if (ret < 0) { |
1491 | while (--i >= 0) | 1497 | while (--i >= 0) |
1492 | mmc_omap_remove_slot(host->slots[i]); | 1498 | mmc_omap_remove_slot(host->slots[i]); |
1493 | 1499 | ||
1494 | goto err_plat_cleanup; | 1500 | goto err_destroy_wq; |
1495 | } | 1501 | } |
1496 | } | 1502 | } |
1497 | 1503 | ||
1498 | host->reg_shift = (cpu_is_omap7xx() ? 1 : 2); | ||
1499 | |||
1500 | host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0); | ||
1501 | if (!host->mmc_omap_wq) | ||
1502 | goto err_plat_cleanup; | ||
1503 | |||
1504 | return 0; | 1504 | return 0; |
1505 | 1505 | ||
1506 | err_destroy_wq: | ||
1507 | destroy_workqueue(host->mmc_omap_wq); | ||
1506 | err_plat_cleanup: | 1508 | err_plat_cleanup: |
1507 | if (pdata->cleanup) | 1509 | if (pdata->cleanup) |
1508 | pdata->cleanup(&pdev->dev); | 1510 | pdata->cleanup(&pdev->dev); |
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-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 55a164fcaa15..a50c205ea208 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -404,7 +404,7 @@ static void sdhci_s3c_setup_card_detect_gpio(struct sdhci_s3c *sc) | |||
404 | if (sc->ext_cd_irq && | 404 | if (sc->ext_cd_irq && |
405 | request_threaded_irq(sc->ext_cd_irq, NULL, | 405 | request_threaded_irq(sc->ext_cd_irq, NULL, |
406 | sdhci_s3c_gpio_card_detect_thread, | 406 | sdhci_s3c_gpio_card_detect_thread, |
407 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 407 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
408 | dev_name(dev), sc) == 0) { | 408 | dev_name(dev), sc) == 0) { |
409 | int status = gpio_get_value(sc->ext_cd_gpio); | 409 | int status = gpio_get_value(sc->ext_cd_gpio); |
410 | if (pdata->ext_cd_gpio_invert) | 410 | if (pdata->ext_cd_gpio_invert) |
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/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index e626732aff77..f4b8b4db3a9a 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -680,8 +680,8 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) | |||
680 | } | 680 | } |
681 | 681 | ||
682 | if (count >= 0xF) { | 682 | if (count >= 0xF) { |
683 | pr_warning("%s: Too large timeout 0x%x requested for CMD%d!\n", | 683 | DBG("%s: Too large timeout 0x%x requested for CMD%d!\n", |
684 | mmc_hostname(host->mmc), count, cmd->opcode); | 684 | mmc_hostname(host->mmc), count, cmd->opcode); |
685 | count = 0xE; | 685 | count = 0xE; |
686 | } | 686 | } |
687 | 687 | ||
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/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index a05b7b444d4f..a6cad5caba78 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -920,12 +920,12 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, | |||
920 | */ | 920 | */ |
921 | memset(chip->oob_poi, ~0, mtd->oobsize); | 921 | memset(chip->oob_poi, ~0, mtd->oobsize); |
922 | chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; | 922 | chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; |
923 | |||
924 | read_page_swap_end(this, buf, mtd->writesize, | ||
925 | this->payload_virt, this->payload_phys, | ||
926 | nfc_geo->payload_size, | ||
927 | payload_virt, payload_phys); | ||
928 | } | 923 | } |
924 | |||
925 | read_page_swap_end(this, buf, mtd->writesize, | ||
926 | this->payload_virt, this->payload_phys, | ||
927 | nfc_geo->payload_size, | ||
928 | payload_virt, payload_phys); | ||
929 | exit_nfc: | 929 | exit_nfc: |
930 | return ret; | 930 | return ret; |
931 | } | 931 | } |
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index c58e6a93f445..6acc790c2fbb 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -273,6 +273,26 @@ static struct nand_ecclayout nandv2_hw_eccoob_4k = { | |||
273 | 273 | ||
274 | static const char *part_probes[] = { "RedBoot", "cmdlinepart", "ofpart", NULL }; | 274 | static const char *part_probes[] = { "RedBoot", "cmdlinepart", "ofpart", NULL }; |
275 | 275 | ||
276 | static void memcpy32_fromio(void *trg, const void __iomem *src, size_t size) | ||
277 | { | ||
278 | int i; | ||
279 | u32 *t = trg; | ||
280 | const __iomem u32 *s = src; | ||
281 | |||
282 | for (i = 0; i < (size >> 2); i++) | ||
283 | *t++ = __raw_readl(s++); | ||
284 | } | ||
285 | |||
286 | static void memcpy32_toio(void __iomem *trg, const void *src, int size) | ||
287 | { | ||
288 | int i; | ||
289 | u32 __iomem *t = trg; | ||
290 | const u32 *s = src; | ||
291 | |||
292 | for (i = 0; i < (size >> 2); i++) | ||
293 | __raw_writel(*s++, t++); | ||
294 | } | ||
295 | |||
276 | static int check_int_v3(struct mxc_nand_host *host) | 296 | static int check_int_v3(struct mxc_nand_host *host) |
277 | { | 297 | { |
278 | uint32_t tmp; | 298 | uint32_t tmp; |
@@ -519,7 +539,7 @@ static void send_read_id_v3(struct mxc_nand_host *host) | |||
519 | 539 | ||
520 | wait_op_done(host, true); | 540 | wait_op_done(host, true); |
521 | 541 | ||
522 | memcpy_fromio(host->data_buf, host->main_area0, 16); | 542 | memcpy32_fromio(host->data_buf, host->main_area0, 16); |
523 | } | 543 | } |
524 | 544 | ||
525 | /* Request the NANDFC to perform a read of the NAND device ID. */ | 545 | /* Request the NANDFC to perform a read of the NAND device ID. */ |
@@ -535,7 +555,7 @@ static void send_read_id_v1_v2(struct mxc_nand_host *host) | |||
535 | /* Wait for operation to complete */ | 555 | /* Wait for operation to complete */ |
536 | wait_op_done(host, true); | 556 | wait_op_done(host, true); |
537 | 557 | ||
538 | memcpy_fromio(host->data_buf, host->main_area0, 16); | 558 | memcpy32_fromio(host->data_buf, host->main_area0, 16); |
539 | 559 | ||
540 | if (this->options & NAND_BUSWIDTH_16) { | 560 | if (this->options & NAND_BUSWIDTH_16) { |
541 | /* compress the ID info */ | 561 | /* compress the ID info */ |
@@ -797,16 +817,16 @@ static void copy_spare(struct mtd_info *mtd, bool bfrom) | |||
797 | 817 | ||
798 | if (bfrom) { | 818 | if (bfrom) { |
799 | for (i = 0; i < n - 1; i++) | 819 | for (i = 0; i < n - 1; i++) |
800 | memcpy_fromio(d + i * j, s + i * t, j); | 820 | memcpy32_fromio(d + i * j, s + i * t, j); |
801 | 821 | ||
802 | /* the last section */ | 822 | /* the last section */ |
803 | memcpy_fromio(d + i * j, s + i * t, mtd->oobsize - i * j); | 823 | memcpy32_fromio(d + i * j, s + i * t, mtd->oobsize - i * j); |
804 | } else { | 824 | } else { |
805 | for (i = 0; i < n - 1; i++) | 825 | for (i = 0; i < n - 1; i++) |
806 | memcpy_toio(&s[i * t], &d[i * j], j); | 826 | memcpy32_toio(&s[i * t], &d[i * j], j); |
807 | 827 | ||
808 | /* the last section */ | 828 | /* the last section */ |
809 | memcpy_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j); | 829 | memcpy32_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j); |
810 | } | 830 | } |
811 | } | 831 | } |
812 | 832 | ||
@@ -1070,7 +1090,8 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
1070 | 1090 | ||
1071 | host->devtype_data->send_page(mtd, NFC_OUTPUT); | 1091 | host->devtype_data->send_page(mtd, NFC_OUTPUT); |
1072 | 1092 | ||
1073 | memcpy_fromio(host->data_buf, host->main_area0, mtd->writesize); | 1093 | memcpy32_fromio(host->data_buf, host->main_area0, |
1094 | mtd->writesize); | ||
1074 | copy_spare(mtd, true); | 1095 | copy_spare(mtd, true); |
1075 | break; | 1096 | break; |
1076 | 1097 | ||
@@ -1086,7 +1107,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, | |||
1086 | break; | 1107 | break; |
1087 | 1108 | ||
1088 | case NAND_CMD_PAGEPROG: | 1109 | case NAND_CMD_PAGEPROG: |
1089 | memcpy_toio(host->main_area0, host->data_buf, mtd->writesize); | 1110 | memcpy32_toio(host->main_area0, host->data_buf, mtd->writesize); |
1090 | copy_spare(mtd, false); | 1111 | copy_spare(mtd, false); |
1091 | host->devtype_data->send_page(mtd, NFC_INPUT); | 1112 | host->devtype_data->send_page(mtd, NFC_INPUT); |
1092 | host->devtype_data->send_cmd(host, command, true); | 1113 | host->devtype_data->send_cmd(host, command, true); |
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/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 6cc8fbfabb8e..cf0cd3146817 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
30 | #include <linux/vmalloc.h> | 30 | #include <linux/vmalloc.h> |
31 | #include <asm/div64.h> | 31 | #include <linux/math64.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/errno.h> | 33 | #include <linux/errno.h> |
34 | #include <linux/string.h> | 34 | #include <linux/string.h> |
@@ -546,12 +546,6 @@ static char *get_partition_name(int i) | |||
546 | return kstrdup(buf, GFP_KERNEL); | 546 | return kstrdup(buf, GFP_KERNEL); |
547 | } | 547 | } |
548 | 548 | ||
549 | static uint64_t divide(uint64_t n, uint32_t d) | ||
550 | { | ||
551 | do_div(n, d); | ||
552 | return n; | ||
553 | } | ||
554 | |||
555 | /* | 549 | /* |
556 | * Initialize the nandsim structure. | 550 | * Initialize the nandsim structure. |
557 | * | 551 | * |
@@ -580,7 +574,7 @@ static int init_nandsim(struct mtd_info *mtd) | |||
580 | ns->geom.oobsz = mtd->oobsize; | 574 | ns->geom.oobsz = mtd->oobsize; |
581 | ns->geom.secsz = mtd->erasesize; | 575 | ns->geom.secsz = mtd->erasesize; |
582 | ns->geom.pgszoob = ns->geom.pgsz + ns->geom.oobsz; | 576 | ns->geom.pgszoob = ns->geom.pgsz + ns->geom.oobsz; |
583 | ns->geom.pgnum = divide(ns->geom.totsz, ns->geom.pgsz); | 577 | ns->geom.pgnum = div_u64(ns->geom.totsz, ns->geom.pgsz); |
584 | ns->geom.totszoob = ns->geom.totsz + (uint64_t)ns->geom.pgnum * ns->geom.oobsz; | 578 | ns->geom.totszoob = ns->geom.totsz + (uint64_t)ns->geom.pgnum * ns->geom.oobsz; |
585 | ns->geom.secshift = ffs(ns->geom.secsz) - 1; | 579 | ns->geom.secshift = ffs(ns->geom.secsz) - 1; |
586 | ns->geom.pgshift = chip->page_shift; | 580 | ns->geom.pgshift = chip->page_shift; |
@@ -921,7 +915,7 @@ static int setup_wear_reporting(struct mtd_info *mtd) | |||
921 | 915 | ||
922 | if (!rptwear) | 916 | if (!rptwear) |
923 | return 0; | 917 | return 0; |
924 | wear_eb_count = divide(mtd->size, mtd->erasesize); | 918 | wear_eb_count = div_u64(mtd->size, mtd->erasesize); |
925 | mem = wear_eb_count * sizeof(unsigned long); | 919 | mem = wear_eb_count * sizeof(unsigned long); |
926 | if (mem / sizeof(unsigned long) != wear_eb_count) { | 920 | if (mem / sizeof(unsigned long) != wear_eb_count) { |
927 | NS_ERR("Too many erase blocks for wear reporting\n"); | 921 | NS_ERR("Too many erase blocks for wear reporting\n"); |
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_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 3680aa251dea..2cf084eb9d52 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "bonding.h" | 6 | #include "bonding.h" |
7 | #include "bond_alb.h" | 7 | #include "bond_alb.h" |
8 | 8 | ||
9 | #ifdef CONFIG_DEBUG_FS | 9 | #if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS) |
10 | 10 | ||
11 | #include <linux/debugfs.h> | 11 | #include <linux/debugfs.h> |
12 | #include <linux/seq_file.h> | 12 | #include <linux/seq_file.h> |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2ee8cf9e8a3b..2ee76993f052 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -76,6 +76,7 @@ | |||
76 | #include <net/route.h> | 76 | #include <net/route.h> |
77 | #include <net/net_namespace.h> | 77 | #include <net/net_namespace.h> |
78 | #include <net/netns/generic.h> | 78 | #include <net/netns/generic.h> |
79 | #include <net/pkt_sched.h> | ||
79 | #include "bonding.h" | 80 | #include "bonding.h" |
80 | #include "bond_3ad.h" | 81 | #include "bond_3ad.h" |
81 | #include "bond_alb.h" | 82 | #include "bond_alb.h" |
@@ -381,8 +382,6 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) | |||
381 | return next; | 382 | return next; |
382 | } | 383 | } |
383 | 384 | ||
384 | #define bond_queue_mapping(skb) (*(u16 *)((skb)->cb)) | ||
385 | |||
386 | /** | 385 | /** |
387 | * bond_dev_queue_xmit - Prepare skb for xmit. | 386 | * bond_dev_queue_xmit - Prepare skb for xmit. |
388 | * | 387 | * |
@@ -395,7 +394,9 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, | |||
395 | { | 394 | { |
396 | skb->dev = slave_dev; | 395 | skb->dev = slave_dev; |
397 | 396 | ||
398 | skb->queue_mapping = bond_queue_mapping(skb); | 397 | BUILD_BUG_ON(sizeof(skb->queue_mapping) != |
398 | sizeof(qdisc_skb_cb(skb)->bond_queue_mapping)); | ||
399 | skb->queue_mapping = qdisc_skb_cb(skb)->bond_queue_mapping; | ||
399 | 400 | ||
400 | if (unlikely(netpoll_tx_running(slave_dev))) | 401 | if (unlikely(netpoll_tx_running(slave_dev))) |
401 | bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); | 402 | bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); |
@@ -3226,6 +3227,12 @@ static int bond_master_netdev_event(unsigned long event, | |||
3226 | switch (event) { | 3227 | switch (event) { |
3227 | case NETDEV_CHANGENAME: | 3228 | case NETDEV_CHANGENAME: |
3228 | return bond_event_changename(event_bond); | 3229 | return bond_event_changename(event_bond); |
3230 | case NETDEV_UNREGISTER: | ||
3231 | bond_remove_proc_entry(event_bond); | ||
3232 | break; | ||
3233 | case NETDEV_REGISTER: | ||
3234 | bond_create_proc_entry(event_bond); | ||
3235 | break; | ||
3229 | default: | 3236 | default: |
3230 | break; | 3237 | break; |
3231 | } | 3238 | } |
@@ -4171,7 +4178,7 @@ static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
4171 | /* | 4178 | /* |
4172 | * Save the original txq to restore before passing to the driver | 4179 | * Save the original txq to restore before passing to the driver |
4173 | */ | 4180 | */ |
4174 | bond_queue_mapping(skb) = skb->queue_mapping; | 4181 | qdisc_skb_cb(skb)->bond_queue_mapping = skb->queue_mapping; |
4175 | 4182 | ||
4176 | if (unlikely(txq >= dev->real_num_tx_queues)) { | 4183 | if (unlikely(txq >= dev->real_num_tx_queues)) { |
4177 | do { | 4184 | do { |
@@ -4410,8 +4417,6 @@ static void bond_uninit(struct net_device *bond_dev) | |||
4410 | 4417 | ||
4411 | bond_work_cancel_all(bond); | 4418 | bond_work_cancel_all(bond); |
4412 | 4419 | ||
4413 | bond_remove_proc_entry(bond); | ||
4414 | |||
4415 | bond_debug_unregister(bond); | 4420 | bond_debug_unregister(bond); |
4416 | 4421 | ||
4417 | __hw_addr_flush(&bond->mc_list); | 4422 | __hw_addr_flush(&bond->mc_list); |
@@ -4813,7 +4818,6 @@ static int bond_init(struct net_device *bond_dev) | |||
4813 | 4818 | ||
4814 | bond_set_lockdep_class(bond_dev); | 4819 | bond_set_lockdep_class(bond_dev); |
4815 | 4820 | ||
4816 | bond_create_proc_entry(bond); | ||
4817 | list_add_tail(&bond->bond_list, &bn->dev_list); | 4821 | list_add_tail(&bond->bond_list, &bn->dev_list); |
4818 | 4822 | ||
4819 | bond_prepare_sysfs_group(bond); | 4823 | bond_prepare_sysfs_group(bond); |
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/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index aef42f045320..485bedb8278c 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1082,8 +1082,12 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1082 | } | 1082 | } |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | pr_info("%s: Unable to set %.*s as primary slave.\n", | 1085 | strncpy(bond->params.primary, ifname, IFNAMSIZ); |
1086 | bond->dev->name, (int)strlen(buf) - 1, buf); | 1086 | bond->params.primary[IFNAMSIZ - 1] = 0; |
1087 | |||
1088 | pr_info("%s: Recording %s as primary, " | ||
1089 | "but it has not been enslaved to %s yet.\n", | ||
1090 | bond->dev->name, ifname, bond->dev->name); | ||
1087 | out: | 1091 | out: |
1088 | write_unlock_bh(&bond->curr_slave_lock); | 1092 | write_unlock_bh(&bond->curr_slave_lock); |
1089 | read_unlock(&bond->lock); | 1093 | read_unlock(&bond->lock); |
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 536bda072a16..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); |
@@ -686,7 +686,7 @@ static int c_can_get_berr_counter(const struct net_device *dev, | |||
686 | * | 686 | * |
687 | * We iterate from priv->tx_echo to priv->tx_next and check if the | 687 | * We iterate from priv->tx_echo to priv->tx_next and check if the |
688 | * packet has been transmitted, echo it back to the CAN framework. | 688 | * packet has been transmitted, echo it back to the CAN framework. |
689 | * If we discover a not yet transmitted package, stop looking for more. | 689 | * If we discover a not yet transmitted packet, stop looking for more. |
690 | */ | 690 | */ |
691 | static void c_can_do_tx(struct net_device *dev) | 691 | static void c_can_do_tx(struct net_device *dev) |
692 | { | 692 | { |
@@ -698,7 +698,7 @@ static void c_can_do_tx(struct net_device *dev) | |||
698 | for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) { | 698 | for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) { |
699 | msg_obj_no = get_tx_echo_msg_obj(priv); | 699 | msg_obj_no = get_tx_echo_msg_obj(priv); |
700 | val = c_can_read_reg32(priv, &priv->regs->txrqst1); | 700 | val = c_can_read_reg32(priv, &priv->regs->txrqst1); |
701 | if (!(val & (1 << msg_obj_no))) { | 701 | if (!(val & (1 << (msg_obj_no - 1)))) { |
702 | can_get_echo_skb(dev, | 702 | can_get_echo_skb(dev, |
703 | msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST); | 703 | msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST); |
704 | stats->tx_bytes += priv->read_reg(priv, | 704 | stats->tx_bytes += priv->read_reg(priv, |
@@ -706,6 +706,8 @@ static void c_can_do_tx(struct net_device *dev) | |||
706 | & IF_MCONT_DLC_MASK; | 706 | & IF_MCONT_DLC_MASK; |
707 | stats->tx_packets++; | 707 | stats->tx_packets++; |
708 | c_can_inval_msg_object(dev, 0, msg_obj_no); | 708 | c_can_inval_msg_object(dev, 0, msg_obj_no); |
709 | } else { | ||
710 | break; | ||
709 | } | 711 | } |
710 | } | 712 | } |
711 | 713 | ||
@@ -950,7 +952,7 @@ static int c_can_poll(struct napi_struct *napi, int quota) | |||
950 | struct net_device *dev = napi->dev; | 952 | struct net_device *dev = napi->dev; |
951 | struct c_can_priv *priv = netdev_priv(dev); | 953 | struct c_can_priv *priv = netdev_priv(dev); |
952 | 954 | ||
953 | irqstatus = priv->read_reg(priv, &priv->regs->interrupt); | 955 | irqstatus = priv->irqstatus; |
954 | if (!irqstatus) | 956 | if (!irqstatus) |
955 | goto end; | 957 | goto end; |
956 | 958 | ||
@@ -1028,12 +1030,11 @@ end: | |||
1028 | 1030 | ||
1029 | static irqreturn_t c_can_isr(int irq, void *dev_id) | 1031 | static irqreturn_t c_can_isr(int irq, void *dev_id) |
1030 | { | 1032 | { |
1031 | u16 irqstatus; | ||
1032 | struct net_device *dev = (struct net_device *)dev_id; | 1033 | struct net_device *dev = (struct net_device *)dev_id; |
1033 | struct c_can_priv *priv = netdev_priv(dev); | 1034 | struct c_can_priv *priv = netdev_priv(dev); |
1034 | 1035 | ||
1035 | irqstatus = priv->read_reg(priv, &priv->regs->interrupt); | 1036 | priv->irqstatus = priv->read_reg(priv, &priv->regs->interrupt); |
1036 | if (!irqstatus) | 1037 | if (!priv->irqstatus) |
1037 | return IRQ_NONE; | 1038 | return IRQ_NONE; |
1038 | 1039 | ||
1039 | /* disable all interrupts and schedule the NAPI */ | 1040 | /* disable all interrupts and schedule the NAPI */ |
@@ -1063,10 +1064,11 @@ static int c_can_open(struct net_device *dev) | |||
1063 | goto exit_irq_fail; | 1064 | goto exit_irq_fail; |
1064 | } | 1065 | } |
1065 | 1066 | ||
1067 | napi_enable(&priv->napi); | ||
1068 | |||
1066 | /* start the c_can controller */ | 1069 | /* start the c_can controller */ |
1067 | c_can_start(dev); | 1070 | c_can_start(dev); |
1068 | 1071 | ||
1069 | napi_enable(&priv->napi); | ||
1070 | netif_start_queue(dev); | 1072 | netif_start_queue(dev); |
1071 | 1073 | ||
1072 | return 0; | 1074 | return 0; |
diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h index 9b7fbef3d09a..5f32d34af507 100644 --- a/drivers/net/can/c_can/c_can.h +++ b/drivers/net/can/c_can/c_can.h | |||
@@ -76,6 +76,7 @@ struct c_can_priv { | |||
76 | unsigned int tx_next; | 76 | unsigned int tx_next; |
77 | unsigned int tx_echo; | 77 | unsigned int tx_echo; |
78 | void *priv; /* for board-specific data */ | 78 | void *priv; /* for board-specific data */ |
79 | u16 irqstatus; | ||
79 | }; | 80 | }; |
80 | 81 | ||
81 | struct net_device *alloc_c_can_dev(void); | 82 | struct net_device *alloc_c_can_dev(void); |
diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c index 53115eee8075..688371cda37a 100644 --- a/drivers/net/can/cc770/cc770_platform.c +++ b/drivers/net/can/cc770/cc770_platform.c | |||
@@ -154,7 +154,7 @@ static int __devinit cc770_get_platform_data(struct platform_device *pdev, | |||
154 | struct cc770_platform_data *pdata = pdev->dev.platform_data; | 154 | struct cc770_platform_data *pdata = pdev->dev.platform_data; |
155 | 155 | ||
156 | priv->can.clock.freq = pdata->osc_freq; | 156 | priv->can.clock.freq = pdata->osc_freq; |
157 | if (priv->cpu_interface | CPUIF_DSC) | 157 | if (priv->cpu_interface & CPUIF_DSC) |
158 | priv->can.clock.freq /= 2; | 158 | priv->can.clock.freq /= 2; |
159 | priv->clkout = pdata->cor; | 159 | priv->clkout = pdata->cor; |
160 | priv->bus_config = pdata->bcr; | 160 | priv->bus_config = pdata->bcr; |
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/dummy.c b/drivers/net/dummy.c index 442d91a2747b..bab0158f1cc3 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -187,8 +187,10 @@ static int __init dummy_init_module(void) | |||
187 | rtnl_lock(); | 187 | rtnl_lock(); |
188 | err = __rtnl_link_register(&dummy_link_ops); | 188 | err = __rtnl_link_register(&dummy_link_ops); |
189 | 189 | ||
190 | for (i = 0; i < numdummies && !err; i++) | 190 | for (i = 0; i < numdummies && !err; i++) { |
191 | err = dummy_init_one(); | 191 | err = dummy_init_one(); |
192 | cond_resched(); | ||
193 | } | ||
192 | if (err < 0) | 194 | if (err < 0) |
193 | __rtnl_link_unregister(&dummy_link_ops); | 195 | __rtnl_link_unregister(&dummy_link_ops); |
194 | rtnl_unlock(); | 196 | rtnl_unlock(); |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 9cc15701101b..1f78b63d5efe 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -261,7 +261,6 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter) | |||
261 | if ((phy_data & BMSR_LSTATUS) == 0) { | 261 | if ((phy_data & BMSR_LSTATUS) == 0) { |
262 | /* link down */ | 262 | /* link down */ |
263 | netif_carrier_off(netdev); | 263 | netif_carrier_off(netdev); |
264 | netif_stop_queue(netdev); | ||
265 | hw->hibernate = true; | 264 | hw->hibernate = true; |
266 | if (atl1c_reset_mac(hw) != 0) | 265 | if (atl1c_reset_mac(hw) != 0) |
267 | if (netif_msg_hw(adapter)) | 266 | if (netif_msg_hw(adapter)) |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 46b8b7d81633..d09c6b583d17 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
@@ -656,7 +656,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
656 | dma_unmap_single(bp->sdev->dma_dev, mapping, | 656 | dma_unmap_single(bp->sdev->dma_dev, mapping, |
657 | RX_PKT_BUF_SZ, DMA_FROM_DEVICE); | 657 | RX_PKT_BUF_SZ, DMA_FROM_DEVICE); |
658 | dev_kfree_skb_any(skb); | 658 | dev_kfree_skb_any(skb); |
659 | skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA); | 659 | skb = alloc_skb(RX_PKT_BUF_SZ, GFP_ATOMIC | GFP_DMA); |
660 | if (skb == NULL) | 660 | if (skb == NULL) |
661 | return -ENOMEM; | 661 | return -ENOMEM; |
662 | mapping = dma_map_single(bp->sdev->dma_dev, skb->data, | 662 | mapping = dma_map_single(bp->sdev->dma_dev, skb->data, |
@@ -967,7 +967,7 @@ static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
967 | dma_unmap_single(bp->sdev->dma_dev, mapping, len, | 967 | dma_unmap_single(bp->sdev->dma_dev, mapping, len, |
968 | DMA_TO_DEVICE); | 968 | DMA_TO_DEVICE); |
969 | 969 | ||
970 | bounce_skb = __netdev_alloc_skb(dev, len, GFP_ATOMIC | GFP_DMA); | 970 | bounce_skb = alloc_skb(len, GFP_ATOMIC | GFP_DMA); |
971 | if (!bounce_skb) | 971 | if (!bounce_skb) |
972 | goto err_out; | 972 | goto err_out; |
973 | 973 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index ac7b74488531..1fa4927a45b1 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c | |||
@@ -5372,7 +5372,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp) | |||
5372 | int k, last; | 5372 | int k, last; |
5373 | 5373 | ||
5374 | if (skb == NULL) { | 5374 | if (skb == NULL) { |
5375 | j++; | 5375 | j = NEXT_TX_BD(j); |
5376 | continue; | 5376 | continue; |
5377 | } | 5377 | } |
5378 | 5378 | ||
@@ -5384,8 +5384,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp) | |||
5384 | tx_buf->skb = NULL; | 5384 | tx_buf->skb = NULL; |
5385 | 5385 | ||
5386 | last = tx_buf->nr_frags; | 5386 | last = tx_buf->nr_frags; |
5387 | j++; | 5387 | j = NEXT_TX_BD(j); |
5388 | for (k = 0; k < last; k++, j++) { | 5388 | for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) { |
5389 | tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; | 5389 | tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; |
5390 | dma_unmap_page(&bp->pdev->dev, | 5390 | dma_unmap_page(&bp->pdev->dev, |
5391 | dma_unmap_addr(tx_buf, mapping), | 5391 | dma_unmap_addr(tx_buf, mapping), |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index e30e2a2f354c..7de824184979 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -747,21 +747,6 @@ struct bnx2x_fastpath { | |||
747 | 747 | ||
748 | #define ETH_RX_ERROR_FALGS ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG | 748 | #define ETH_RX_ERROR_FALGS ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG |
749 | 749 | ||
750 | #define BNX2X_IP_CSUM_ERR(cqe) \ | ||
751 | (!((cqe)->fast_path_cqe.status_flags & \ | ||
752 | ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG) && \ | ||
753 | ((cqe)->fast_path_cqe.type_error_flags & \ | ||
754 | ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG)) | ||
755 | |||
756 | #define BNX2X_L4_CSUM_ERR(cqe) \ | ||
757 | (!((cqe)->fast_path_cqe.status_flags & \ | ||
758 | ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG) && \ | ||
759 | ((cqe)->fast_path_cqe.type_error_flags & \ | ||
760 | ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG)) | ||
761 | |||
762 | #define BNX2X_RX_CSUM_OK(cqe) \ | ||
763 | (!(BNX2X_L4_CSUM_ERR(cqe) || BNX2X_IP_CSUM_ERR(cqe))) | ||
764 | |||
765 | #define BNX2X_PRS_FLAG_OVERETH_IPV4(flags) \ | 750 | #define BNX2X_PRS_FLAG_OVERETH_IPV4(flags) \ |
766 | (((le16_to_cpu(flags) & \ | 751 | (((le16_to_cpu(flags) & \ |
767 | PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) >> \ | 752 | PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) >> \ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index ad0743bf4bde..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); |
@@ -617,6 +617,25 @@ static int bnx2x_alloc_rx_data(struct bnx2x *bp, | |||
617 | return 0; | 617 | return 0; |
618 | } | 618 | } |
619 | 619 | ||
620 | static void bnx2x_csum_validate(struct sk_buff *skb, union eth_rx_cqe *cqe, | ||
621 | struct bnx2x_fastpath *fp) | ||
622 | { | ||
623 | /* Do nothing if no IP/L4 csum validation was done */ | ||
624 | |||
625 | if (cqe->fast_path_cqe.status_flags & | ||
626 | (ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG | | ||
627 | ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG)) | ||
628 | return; | ||
629 | |||
630 | /* If both IP/L4 validation were done, check if an error was found. */ | ||
631 | |||
632 | if (cqe->fast_path_cqe.type_error_flags & | ||
633 | (ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG | | ||
634 | ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG)) | ||
635 | fp->eth_q_stats.hw_csum_err++; | ||
636 | else | ||
637 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
638 | } | ||
620 | 639 | ||
621 | int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) | 640 | int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) |
622 | { | 641 | { |
@@ -806,13 +825,9 @@ reuse_rx: | |||
806 | 825 | ||
807 | skb_checksum_none_assert(skb); | 826 | skb_checksum_none_assert(skb); |
808 | 827 | ||
809 | if (bp->dev->features & NETIF_F_RXCSUM) { | 828 | if (bp->dev->features & NETIF_F_RXCSUM) |
829 | bnx2x_csum_validate(skb, cqe, fp); | ||
810 | 830 | ||
811 | if (likely(BNX2X_RX_CSUM_OK(cqe))) | ||
812 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
813 | else | ||
814 | fp->eth_q_stats.hw_csum_err++; | ||
815 | } | ||
816 | 831 | ||
817 | skb_record_rx_queue(skb, fp->rx_queue); | 832 | skb_record_rx_queue(skb, fp->rx_queue); |
818 | 833 | ||
@@ -2501,8 +2516,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget) | |||
2501 | /* we split the first BD into headers and data BDs | 2516 | /* we split the first BD into headers and data BDs |
2502 | * to ease the pain of our fellow microcode engineers | 2517 | * to ease the pain of our fellow microcode engineers |
2503 | * we use one mapping for both BDs | 2518 | * we use one mapping for both BDs |
2504 | * So far this has only been observed to happen | ||
2505 | * in Other Operating Systems(TM) | ||
2506 | */ | 2519 | */ |
2507 | static noinline u16 bnx2x_tx_split(struct bnx2x *bp, | 2520 | static noinline u16 bnx2x_tx_split(struct bnx2x *bp, |
2508 | struct bnx2x_fp_txdata *txdata, | 2521 | struct bnx2x_fp_txdata *txdata, |
@@ -3156,7 +3169,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3156 | 3169 | ||
3157 | txdata->tx_bd_prod += nbd; | 3170 | txdata->tx_bd_prod += nbd; |
3158 | 3171 | ||
3159 | if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 3)) { | 3172 | if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 4)) { |
3160 | netif_tx_stop_queue(txq); | 3173 | netif_tx_stop_queue(txq); |
3161 | 3174 | ||
3162 | /* 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 |
@@ -3165,7 +3178,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3165 | smp_mb(); | 3178 | smp_mb(); |
3166 | 3179 | ||
3167 | fp->eth_q_stats.driver_xoff++; | 3180 | fp->eth_q_stats.driver_xoff++; |
3168 | if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3) | 3181 | if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4) |
3169 | netif_tx_wake_queue(txq); | 3182 | netif_tx_wake_queue(txq); |
3170 | } | 3183 | } |
3171 | 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/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index c95e7b5e2b85..2c89d17cbb29 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -534,7 +534,8 @@ int cnic_unregister_driver(int ulp_type) | |||
534 | } | 534 | } |
535 | 535 | ||
536 | if (atomic_read(&ulp_ops->ref_count) != 0) | 536 | if (atomic_read(&ulp_ops->ref_count) != 0) |
537 | netdev_warn(dev->netdev, "Failed waiting for ref count to go to zero\n"); | 537 | pr_warn("%s: Failed waiting for ref count to go to zero\n", |
538 | __func__); | ||
538 | return 0; | 539 | return 0; |
539 | 540 | ||
540 | out_unlock: | 541 | out_unlock: |
@@ -1053,12 +1054,13 @@ static int cnic_init_uio(struct cnic_dev *dev) | |||
1053 | 1054 | ||
1054 | uinfo = &udev->cnic_uinfo; | 1055 | uinfo = &udev->cnic_uinfo; |
1055 | 1056 | ||
1056 | uinfo->mem[0].addr = dev->netdev->base_addr; | 1057 | uinfo->mem[0].addr = pci_resource_start(dev->pcidev, 0); |
1057 | uinfo->mem[0].internal_addr = dev->regview; | 1058 | uinfo->mem[0].internal_addr = dev->regview; |
1058 | uinfo->mem[0].size = dev->netdev->mem_end - dev->netdev->mem_start; | ||
1059 | uinfo->mem[0].memtype = UIO_MEM_PHYS; | 1059 | uinfo->mem[0].memtype = UIO_MEM_PHYS; |
1060 | 1060 | ||
1061 | if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) { | 1061 | if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) { |
1062 | uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID + | ||
1063 | TX_MAX_TSS_RINGS + 1); | ||
1062 | uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & | 1064 | uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & |
1063 | PAGE_MASK; | 1065 | PAGE_MASK; |
1064 | if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) | 1066 | if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) |
@@ -1068,6 +1070,8 @@ static int cnic_init_uio(struct cnic_dev *dev) | |||
1068 | 1070 | ||
1069 | uinfo->name = "bnx2_cnic"; | 1071 | uinfo->name = "bnx2_cnic"; |
1070 | } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) { | 1072 | } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) { |
1073 | uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0); | ||
1074 | |||
1071 | uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & | 1075 | uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & |
1072 | PAGE_MASK; | 1076 | PAGE_MASK; |
1073 | uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); | 1077 | uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index edeeb516807a..e47ff8be1d7b 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -14275,7 +14275,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
14275 | } | 14275 | } |
14276 | } | 14276 | } |
14277 | 14277 | ||
14278 | if (tg3_flag(tp, 5755_PLUS)) | 14278 | if (tg3_flag(tp, 5755_PLUS) || |
14279 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | ||
14279 | tg3_flag_set(tp, SHORT_DMA_BUG); | 14280 | tg3_flag_set(tp, SHORT_DMA_BUG); |
14280 | 14281 | ||
14281 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | 14282 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) |
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 08efd308d78a..501dfa9c88ec 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -736,6 +736,8 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, | |||
736 | 736 | ||
737 | copied = make_tx_wrbs(adapter, txq, skb, wrb_cnt, dummy_wrb); | 737 | copied = make_tx_wrbs(adapter, txq, skb, wrb_cnt, dummy_wrb); |
738 | if (copied) { | 738 | if (copied) { |
739 | int gso_segs = skb_shinfo(skb)->gso_segs; | ||
740 | |||
739 | /* record the sent skb in the sent_skb table */ | 741 | /* record the sent skb in the sent_skb table */ |
740 | BUG_ON(txo->sent_skb_list[start]); | 742 | BUG_ON(txo->sent_skb_list[start]); |
741 | txo->sent_skb_list[start] = skb; | 743 | txo->sent_skb_list[start] = skb; |
@@ -753,8 +755,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, | |||
753 | 755 | ||
754 | be_txq_notify(adapter, txq->id, wrb_cnt); | 756 | be_txq_notify(adapter, txq->id, wrb_cnt); |
755 | 757 | ||
756 | be_tx_stats_update(txo, wrb_cnt, copied, | 758 | be_tx_stats_update(txo, wrb_cnt, copied, gso_segs, stopped); |
757 | skb_shinfo(skb)->gso_segs, stopped); | ||
758 | } else { | 759 | } else { |
759 | txq->head = start; | 760 | txq->head = start; |
760 | dev_kfree_skb_any(skb); | 761 | dev_kfree_skb_any(skb); |
@@ -3236,7 +3237,7 @@ static void be_netdev_init(struct net_device *netdev) | |||
3236 | 3237 | ||
3237 | netdev->flags |= IFF_MULTICAST; | 3238 | netdev->flags |= IFF_MULTICAST; |
3238 | 3239 | ||
3239 | netif_set_gso_max_size(netdev, 65535); | 3240 | netif_set_gso_max_size(netdev, 65535 - ETH_HLEN); |
3240 | 3241 | ||
3241 | netdev->netdev_ops = &be_netdev_ops; | 3242 | netdev->netdev_ops = &be_netdev_ops; |
3242 | 3243 | ||
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 0741aded9eb0..ab1d80ff0791 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 | } |
@@ -2065,10 +2063,9 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2065 | return NETDEV_TX_OK; | 2063 | return NETDEV_TX_OK; |
2066 | } | 2064 | } |
2067 | 2065 | ||
2068 | /* Steal sock reference for processing TX time stamps */ | 2066 | if (skb->sk) |
2069 | swap(skb_new->sk, skb->sk); | 2067 | skb_set_owner_w(skb_new, skb->sk); |
2070 | swap(skb_new->destructor, skb->destructor); | 2068 | consume_skb(skb); |
2071 | kfree_skb(skb); | ||
2072 | skb = skb_new; | 2069 | skb = skb_new; |
2073 | } | 2070 | } |
2074 | 2071 | ||
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/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c index 36db4df09aed..1f063dcd8f85 100644 --- a/drivers/net/ethernet/intel/e1000e/82571.c +++ b/drivers/net/ethernet/intel/e1000e/82571.c | |||
@@ -1572,6 +1572,9 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) | |||
1572 | ctrl = er32(CTRL); | 1572 | ctrl = er32(CTRL); |
1573 | status = er32(STATUS); | 1573 | status = er32(STATUS); |
1574 | rxcw = er32(RXCW); | 1574 | rxcw = er32(RXCW); |
1575 | /* SYNCH bit and IV bit are sticky */ | ||
1576 | udelay(10); | ||
1577 | rxcw = er32(RXCW); | ||
1575 | 1578 | ||
1576 | if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { | 1579 | if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { |
1577 | 1580 | ||
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/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index d863075df7a4..905e2147d918 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c | |||
@@ -258,7 +258,8 @@ static int e1000_set_settings(struct net_device *netdev, | |||
258 | * When SoL/IDER sessions are active, autoneg/speed/duplex | 258 | * When SoL/IDER sessions are active, autoneg/speed/duplex |
259 | * cannot be changed | 259 | * cannot be changed |
260 | */ | 260 | */ |
261 | if (hw->phy.ops.check_reset_block(hw)) { | 261 | if (hw->phy.ops.check_reset_block && |
262 | hw->phy.ops.check_reset_block(hw)) { | ||
262 | e_err("Cannot change link characteristics when SoL/IDER is active.\n"); | 263 | e_err("Cannot change link characteristics when SoL/IDER is active.\n"); |
263 | return -EINVAL; | 264 | return -EINVAL; |
264 | } | 265 | } |
@@ -1615,7 +1616,8 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) | |||
1615 | * PHY loopback cannot be performed if SoL/IDER | 1616 | * PHY loopback cannot be performed if SoL/IDER |
1616 | * sessions are active | 1617 | * sessions are active |
1617 | */ | 1618 | */ |
1618 | if (hw->phy.ops.check_reset_block(hw)) { | 1619 | if (hw->phy.ops.check_reset_block && |
1620 | hw->phy.ops.check_reset_block(hw)) { | ||
1619 | e_err("Cannot do PHY loopback test when SoL/IDER is active.\n"); | 1621 | e_err("Cannot do PHY loopback test when SoL/IDER is active.\n"); |
1620 | *data = 0; | 1622 | *data = 0; |
1621 | goto out; | 1623 | goto out; |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 238ab2f8a5e7..e3a7b07df629 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
@@ -325,24 +325,46 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) | |||
325 | **/ | 325 | **/ |
326 | static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) | 326 | static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) |
327 | { | 327 | { |
328 | u16 phy_reg; | 328 | u16 phy_reg = 0; |
329 | u32 phy_id; | 329 | u32 phy_id = 0; |
330 | s32 ret_val; | ||
331 | u16 retry_count; | ||
332 | |||
333 | for (retry_count = 0; retry_count < 2; retry_count++) { | ||
334 | ret_val = e1e_rphy_locked(hw, PHY_ID1, &phy_reg); | ||
335 | if (ret_val || (phy_reg == 0xFFFF)) | ||
336 | continue; | ||
337 | phy_id = (u32)(phy_reg << 16); | ||
330 | 338 | ||
331 | e1e_rphy_locked(hw, PHY_ID1, &phy_reg); | 339 | ret_val = e1e_rphy_locked(hw, PHY_ID2, &phy_reg); |
332 | phy_id = (u32)(phy_reg << 16); | 340 | if (ret_val || (phy_reg == 0xFFFF)) { |
333 | e1e_rphy_locked(hw, PHY_ID2, &phy_reg); | 341 | phy_id = 0; |
334 | phy_id |= (u32)(phy_reg & PHY_REVISION_MASK); | 342 | continue; |
343 | } | ||
344 | phy_id |= (u32)(phy_reg & PHY_REVISION_MASK); | ||
345 | break; | ||
346 | } | ||
335 | 347 | ||
336 | if (hw->phy.id) { | 348 | if (hw->phy.id) { |
337 | if (hw->phy.id == phy_id) | 349 | if (hw->phy.id == phy_id) |
338 | return true; | 350 | return true; |
339 | } else { | 351 | } else if (phy_id) { |
340 | if ((phy_id != 0) && (phy_id != PHY_REVISION_MASK)) | 352 | hw->phy.id = phy_id; |
341 | hw->phy.id = phy_id; | 353 | hw->phy.revision = (u32)(phy_reg & ~PHY_REVISION_MASK); |
342 | return true; | 354 | return true; |
343 | } | 355 | } |
344 | 356 | ||
345 | return false; | 357 | /* |
358 | * In case the PHY needs to be in mdio slow mode, | ||
359 | * set slow mode and try to get the PHY id again. | ||
360 | */ | ||
361 | hw->phy.ops.release(hw); | ||
362 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
363 | if (!ret_val) | ||
364 | ret_val = e1000e_get_phy_id(hw); | ||
365 | hw->phy.ops.acquire(hw); | ||
366 | |||
367 | return !ret_val; | ||
346 | } | 368 | } |
347 | 369 | ||
348 | /** | 370 | /** |
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c index 026e8b3ab52e..a13439928488 100644 --- a/drivers/net/ethernet/intel/e1000e/mac.c +++ b/drivers/net/ethernet/intel/e1000e/mac.c | |||
@@ -709,7 +709,7 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw) | |||
709 | * In the case of the phy reset being blocked, we already have a link. | 709 | * In the case of the phy reset being blocked, we already have a link. |
710 | * We do not need to set it up again. | 710 | * We do not need to set it up again. |
711 | */ | 711 | */ |
712 | if (hw->phy.ops.check_reset_block(hw)) | 712 | if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw)) |
713 | return 0; | 713 | return 0; |
714 | 714 | ||
715 | /* | 715 | /* |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index a4b0435b00dc..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; |
@@ -6237,7 +6190,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
6237 | adapter->hw.phy.ms_type = e1000_ms_hw_default; | 6190 | adapter->hw.phy.ms_type = e1000_ms_hw_default; |
6238 | } | 6191 | } |
6239 | 6192 | ||
6240 | if (hw->phy.ops.check_reset_block(hw)) | 6193 | if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw)) |
6241 | e_info("PHY reset is blocked due to SOL/IDER session.\n"); | 6194 | e_info("PHY reset is blocked due to SOL/IDER session.\n"); |
6242 | 6195 | ||
6243 | /* Set initial default active device features */ | 6196 | /* Set initial default active device features */ |
@@ -6404,7 +6357,7 @@ err_register: | |||
6404 | if (!(adapter->flags & FLAG_HAS_AMT)) | 6357 | if (!(adapter->flags & FLAG_HAS_AMT)) |
6405 | e1000e_release_hw_control(adapter); | 6358 | e1000e_release_hw_control(adapter); |
6406 | err_eeprom: | 6359 | err_eeprom: |
6407 | if (!hw->phy.ops.check_reset_block(hw)) | 6360 | if (hw->phy.ops.check_reset_block && !hw->phy.ops.check_reset_block(hw)) |
6408 | e1000_phy_hw_reset(&adapter->hw); | 6361 | e1000_phy_hw_reset(&adapter->hw); |
6409 | err_hw_init: | 6362 | err_hw_init: |
6410 | kfree(adapter->tx_ring); | 6363 | kfree(adapter->tx_ring); |
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c index 0334d013bc3c..b860d4f7ea2a 100644 --- a/drivers/net/ethernet/intel/e1000e/phy.c +++ b/drivers/net/ethernet/intel/e1000e/phy.c | |||
@@ -2155,9 +2155,11 @@ s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw) | |||
2155 | s32 ret_val; | 2155 | s32 ret_val; |
2156 | u32 ctrl; | 2156 | u32 ctrl; |
2157 | 2157 | ||
2158 | ret_val = phy->ops.check_reset_block(hw); | 2158 | if (phy->ops.check_reset_block) { |
2159 | if (ret_val) | 2159 | ret_val = phy->ops.check_reset_block(hw); |
2160 | return 0; | 2160 | if (ret_val) |
2161 | return 0; | ||
2162 | } | ||
2161 | 2163 | ||
2162 | ret_val = phy->ops.acquire(hw); | 2164 | ret_val = phy->ops.acquire(hw); |
2163 | if (ret_val) | 2165 | if (ret_val) |
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 bf20457ea23a..e242104ab471 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++; |
@@ -1390,6 +1390,8 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring, | |||
1390 | union ixgbe_adv_rx_desc *rx_desc, | 1390 | union ixgbe_adv_rx_desc *rx_desc, |
1391 | struct sk_buff *skb) | 1391 | struct sk_buff *skb) |
1392 | { | 1392 | { |
1393 | struct net_device *dev = rx_ring->netdev; | ||
1394 | |||
1393 | ixgbe_update_rsc_stats(rx_ring, skb); | 1395 | ixgbe_update_rsc_stats(rx_ring, skb); |
1394 | 1396 | ||
1395 | ixgbe_rx_hash(rx_ring, rx_desc, skb); | 1397 | ixgbe_rx_hash(rx_ring, rx_desc, skb); |
@@ -1401,14 +1403,15 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring, | |||
1401 | ixgbe_ptp_rx_hwtstamp(rx_ring->q_vector, skb); | 1403 | ixgbe_ptp_rx_hwtstamp(rx_ring->q_vector, skb); |
1402 | #endif | 1404 | #endif |
1403 | 1405 | ||
1404 | if (ixgbe_test_staterr(rx_desc, IXGBE_RXD_STAT_VP)) { | 1406 | if ((dev->features & NETIF_F_HW_VLAN_RX) && |
1407 | ixgbe_test_staterr(rx_desc, IXGBE_RXD_STAT_VP)) { | ||
1405 | u16 vid = le16_to_cpu(rx_desc->wb.upper.vlan); | 1408 | u16 vid = le16_to_cpu(rx_desc->wb.upper.vlan); |
1406 | __vlan_hwaccel_put_tag(skb, vid); | 1409 | __vlan_hwaccel_put_tag(skb, vid); |
1407 | } | 1410 | } |
1408 | 1411 | ||
1409 | skb_record_rx_queue(skb, rx_ring->queue_index); | 1412 | skb_record_rx_queue(skb, rx_ring->queue_index); |
1410 | 1413 | ||
1411 | skb->protocol = eth_type_trans(skb, rx_ring->netdev); | 1414 | skb->protocol = eth_type_trans(skb, dev); |
1412 | } | 1415 | } |
1413 | 1416 | ||
1414 | static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector, | 1417 | static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector, |
@@ -1546,6 +1549,12 @@ static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring, | |||
1546 | skb->truesize -= ixgbe_rx_bufsz(rx_ring); | 1549 | skb->truesize -= ixgbe_rx_bufsz(rx_ring); |
1547 | } | 1550 | } |
1548 | 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 | ||
1549 | /* if skb_pad returns an error the skb was freed */ | 1558 | /* if skb_pad returns an error the skb was freed */ |
1550 | if (unlikely(skb->len < 60)) { | 1559 | if (unlikely(skb->len < 60)) { |
1551 | int pad_len = 60 - skb->len; | 1560 | int pad_len = 60 - skb->len; |
@@ -1772,7 +1781,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1772 | 1781 | ||
1773 | #ifdef IXGBE_FCOE | 1782 | #ifdef IXGBE_FCOE |
1774 | /* 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 */ |
1775 | if (ixgbe_rx_is_fcoe(adapter, rx_desc)) { | 1784 | if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) { |
1776 | ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); | 1785 | ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); |
1777 | if (!ddp_bytes) { | 1786 | if (!ddp_bytes) { |
1778 | dev_kfree_skb_any(skb); | 1787 | dev_kfree_skb_any(skb); |
@@ -3607,10 +3616,6 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter) | |||
3607 | if (hw->mac.type == ixgbe_mac_82598EB) | 3616 | if (hw->mac.type == ixgbe_mac_82598EB) |
3608 | netif_set_gso_max_size(adapter->netdev, 32768); | 3617 | netif_set_gso_max_size(adapter->netdev, 32768); |
3609 | 3618 | ||
3610 | |||
3611 | /* Enable VLAN tag insert/strip */ | ||
3612 | adapter->netdev->features |= NETIF_F_HW_VLAN_RX; | ||
3613 | |||
3614 | hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true); | 3619 | hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true); |
3615 | 3620 | ||
3616 | #ifdef IXGBE_FCOE | 3621 | #ifdef IXGBE_FCOE |
@@ -6642,6 +6647,11 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc) | |||
6642 | return -EINVAL; | 6647 | return -EINVAL; |
6643 | } | 6648 | } |
6644 | 6649 | ||
6650 | if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { | ||
6651 | e_err(drv, "Enable failed, SR-IOV enabled\n"); | ||
6652 | return -EINVAL; | ||
6653 | } | ||
6654 | |||
6645 | /* Hardware supports up to 8 traffic classes */ | 6655 | /* Hardware supports up to 8 traffic classes */ |
6646 | if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || | 6656 | if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || |
6647 | (hw->mac.type == ixgbe_mac_82598EB && | 6657 | (hw->mac.type == ixgbe_mac_82598EB && |
@@ -6701,11 +6711,6 @@ static netdev_features_t ixgbe_fix_features(struct net_device *netdev, | |||
6701 | { | 6711 | { |
6702 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 6712 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
6703 | 6713 | ||
6704 | #ifdef CONFIG_DCB | ||
6705 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) | ||
6706 | features &= ~NETIF_F_HW_VLAN_RX; | ||
6707 | #endif | ||
6708 | |||
6709 | /* return error if RXHASH is being enabled when RSS is not supported */ | 6714 | /* return error if RXHASH is being enabled when RSS is not supported */ |
6710 | if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) | 6715 | if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) |
6711 | features &= ~NETIF_F_RXHASH; | 6716 | features &= ~NETIF_F_RXHASH; |
@@ -6718,7 +6723,6 @@ static netdev_features_t ixgbe_fix_features(struct net_device *netdev, | |||
6718 | if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) | 6723 | if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) |
6719 | features &= ~NETIF_F_LRO; | 6724 | features &= ~NETIF_F_LRO; |
6720 | 6725 | ||
6721 | |||
6722 | return features; | 6726 | return features; |
6723 | } | 6727 | } |
6724 | 6728 | ||
@@ -6766,6 +6770,11 @@ static int ixgbe_set_features(struct net_device *netdev, | |||
6766 | need_reset = true; | 6770 | need_reset = true; |
6767 | } | 6771 | } |
6768 | 6772 | ||
6773 | if (features & NETIF_F_HW_VLAN_RX) | ||
6774 | ixgbe_vlan_strip_enable(adapter); | ||
6775 | else | ||
6776 | ixgbe_vlan_strip_disable(adapter); | ||
6777 | |||
6769 | if (changed & NETIF_F_RXALL) | 6778 | if (changed & NETIF_F_RXALL) |
6770 | need_reset = true; | 6779 | need_reset = true; |
6771 | 6780 | ||
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/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index f69ec4288b10..41e32257a4e8 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -201,6 +201,9 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter, | |||
201 | unsigned int i, eop, count = 0; | 201 | unsigned int i, eop, count = 0; |
202 | unsigned int total_bytes = 0, total_packets = 0; | 202 | unsigned int total_bytes = 0, total_packets = 0; |
203 | 203 | ||
204 | if (test_bit(__IXGBEVF_DOWN, &adapter->state)) | ||
205 | return true; | ||
206 | |||
204 | i = tx_ring->next_to_clean; | 207 | i = tx_ring->next_to_clean; |
205 | eop = tx_ring->tx_buffer_info[i].next_to_watch; | 208 | eop = tx_ring->tx_buffer_info[i].next_to_watch; |
206 | eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); | 209 | eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); |
@@ -969,8 +972,6 @@ static irqreturn_t ixgbevf_msix_clean_tx(int irq, void *data) | |||
969 | r_idx = find_first_bit(q_vector->txr_idx, adapter->num_tx_queues); | 972 | r_idx = find_first_bit(q_vector->txr_idx, adapter->num_tx_queues); |
970 | for (i = 0; i < q_vector->txr_count; i++) { | 973 | for (i = 0; i < q_vector->txr_count; i++) { |
971 | tx_ring = &(adapter->tx_ring[r_idx]); | 974 | tx_ring = &(adapter->tx_ring[r_idx]); |
972 | tx_ring->total_bytes = 0; | ||
973 | tx_ring->total_packets = 0; | ||
974 | ixgbevf_clean_tx_irq(adapter, tx_ring); | 975 | ixgbevf_clean_tx_irq(adapter, tx_ring); |
975 | r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, | 976 | r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, |
976 | r_idx + 1); | 977 | r_idx + 1); |
@@ -994,16 +995,6 @@ static irqreturn_t ixgbevf_msix_clean_rx(int irq, void *data) | |||
994 | struct ixgbe_hw *hw = &adapter->hw; | 995 | struct ixgbe_hw *hw = &adapter->hw; |
995 | struct ixgbevf_ring *rx_ring; | 996 | struct ixgbevf_ring *rx_ring; |
996 | int r_idx; | 997 | int r_idx; |
997 | int i; | ||
998 | |||
999 | r_idx = find_first_bit(q_vector->rxr_idx, adapter->num_rx_queues); | ||
1000 | for (i = 0; i < q_vector->rxr_count; i++) { | ||
1001 | rx_ring = &(adapter->rx_ring[r_idx]); | ||
1002 | rx_ring->total_bytes = 0; | ||
1003 | rx_ring->total_packets = 0; | ||
1004 | r_idx = find_next_bit(q_vector->rxr_idx, adapter->num_rx_queues, | ||
1005 | r_idx + 1); | ||
1006 | } | ||
1007 | 998 | ||
1008 | if (!q_vector->rxr_count) | 999 | if (!q_vector->rxr_count) |
1009 | return IRQ_HANDLED; | 1000 | return IRQ_HANDLED; |
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 04d901d0ff63..f0f06b2bc28b 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
@@ -436,7 +436,9 @@ struct mv643xx_eth_private { | |||
436 | /* | 436 | /* |
437 | * Hardware-specific parameters. | 437 | * Hardware-specific parameters. |
438 | */ | 438 | */ |
439 | #if defined(CONFIG_HAVE_CLK) | ||
439 | struct clk *clk; | 440 | struct clk *clk; |
441 | #endif | ||
440 | unsigned int t_clk; | 442 | unsigned int t_clk; |
441 | }; | 443 | }; |
442 | 444 | ||
@@ -2895,17 +2897,17 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2895 | mp->dev = dev; | 2897 | mp->dev = dev; |
2896 | 2898 | ||
2897 | /* | 2899 | /* |
2898 | * Get the clk rate, if there is one, otherwise use the default. | 2900 | * Start with a default rate, and if there is a clock, allow |
2901 | * it to override the default. | ||
2899 | */ | 2902 | */ |
2903 | mp->t_clk = 133000000; | ||
2904 | #if defined(CONFIG_HAVE_CLK) | ||
2900 | mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0")); | 2905 | mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0")); |
2901 | if (!IS_ERR(mp->clk)) { | 2906 | if (!IS_ERR(mp->clk)) { |
2902 | clk_prepare_enable(mp->clk); | 2907 | clk_prepare_enable(mp->clk); |
2903 | mp->t_clk = clk_get_rate(mp->clk); | 2908 | mp->t_clk = clk_get_rate(mp->clk); |
2904 | } else { | ||
2905 | mp->t_clk = 133000000; | ||
2906 | printk(KERN_WARNING "Unable to get clock"); | ||
2907 | } | 2909 | } |
2908 | 2910 | #endif | |
2909 | set_params(mp, pd); | 2911 | set_params(mp, pd); |
2910 | netif_set_real_num_tx_queues(dev, mp->txq_count); | 2912 | netif_set_real_num_tx_queues(dev, mp->txq_count); |
2911 | netif_set_real_num_rx_queues(dev, mp->rxq_count); | 2913 | netif_set_real_num_rx_queues(dev, mp->rxq_count); |
@@ -2995,10 +2997,13 @@ static int mv643xx_eth_remove(struct platform_device *pdev) | |||
2995 | phy_detach(mp->phy); | 2997 | phy_detach(mp->phy); |
2996 | cancel_work_sync(&mp->tx_timeout_task); | 2998 | cancel_work_sync(&mp->tx_timeout_task); |
2997 | 2999 | ||
3000 | #if defined(CONFIG_HAVE_CLK) | ||
2998 | if (!IS_ERR(mp->clk)) { | 3001 | if (!IS_ERR(mp->clk)) { |
2999 | clk_disable_unprepare(mp->clk); | 3002 | clk_disable_unprepare(mp->clk); |
3000 | clk_put(mp->clk); | 3003 | clk_put(mp->clk); |
3001 | } | 3004 | } |
3005 | #endif | ||
3006 | |||
3002 | free_netdev(mp->dev); | 3007 | free_netdev(mp->dev); |
3003 | 3008 | ||
3004 | platform_set_drvdata(pdev, NULL); | 3009 | platform_set_drvdata(pdev, NULL); |
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index cace36f2ab92..28a54451a3e5 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c | |||
@@ -4381,10 +4381,12 @@ static int sky2_set_features(struct net_device *dev, netdev_features_t features) | |||
4381 | struct sky2_port *sky2 = netdev_priv(dev); | 4381 | struct sky2_port *sky2 = netdev_priv(dev); |
4382 | netdev_features_t changed = dev->features ^ features; | 4382 | netdev_features_t changed = dev->features ^ features; |
4383 | 4383 | ||
4384 | if (changed & NETIF_F_RXCSUM) { | 4384 | if ((changed & NETIF_F_RXCSUM) && |
4385 | bool on = features & NETIF_F_RXCSUM; | 4385 | !(sky2->hw->flags & SKY2_HW_NEW_LE)) { |
4386 | sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR), | 4386 | sky2_write32(sky2->hw, |
4387 | on ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); | 4387 | Q_ADDR(rxqaddr[sky2->port], Q_CSR), |
4388 | (features & NETIF_F_RXCSUM) | ||
4389 | ? BMU_ENA_RX_CHKSUM : BMU_DIS_RX_CHKSUM); | ||
4388 | } | 4390 | } |
4389 | 4391 | ||
4390 | if (changed & NETIF_F_RXHASH) | 4392 | if (changed & NETIF_F_RXHASH) |
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/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 8d2666fcffd7..083d6715335c 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c | |||
@@ -946,16 +946,16 @@ static void __lpc_handle_xmit(struct net_device *ndev) | |||
946 | /* Update stats */ | 946 | /* Update stats */ |
947 | ndev->stats.tx_packets++; | 947 | ndev->stats.tx_packets++; |
948 | ndev->stats.tx_bytes += skb->len; | 948 | ndev->stats.tx_bytes += skb->len; |
949 | |||
950 | /* Free buffer */ | ||
951 | dev_kfree_skb_irq(skb); | ||
952 | } | 949 | } |
950 | dev_kfree_skb_irq(skb); | ||
953 | 951 | ||
954 | txcidx = readl(LPC_ENET_TXCONSUMEINDEX(pldat->net_base)); | 952 | txcidx = readl(LPC_ENET_TXCONSUMEINDEX(pldat->net_base)); |
955 | } | 953 | } |
956 | 954 | ||
957 | if (netif_queue_stopped(ndev)) | 955 | if (pldat->num_used_tx_buffs <= ENET_TX_DESC/2) { |
958 | netif_wake_queue(ndev); | 956 | if (netif_queue_stopped(ndev)) |
957 | netif_wake_queue(ndev); | ||
958 | } | ||
959 | } | 959 | } |
960 | 960 | ||
961 | static int __lpc_handle_recv(struct net_device *ndev, int budget) | 961 | static int __lpc_handle_recv(struct net_device *ndev, int budget) |
@@ -1320,6 +1320,7 @@ static const struct net_device_ops lpc_netdev_ops = { | |||
1320 | .ndo_set_rx_mode = lpc_eth_set_multicast_list, | 1320 | .ndo_set_rx_mode = lpc_eth_set_multicast_list, |
1321 | .ndo_do_ioctl = lpc_eth_ioctl, | 1321 | .ndo_do_ioctl = lpc_eth_ioctl, |
1322 | .ndo_set_mac_address = lpc_set_mac_address, | 1322 | .ndo_set_mac_address = lpc_set_mac_address, |
1323 | .ndo_change_mtu = eth_change_mtu, | ||
1323 | }; | 1324 | }; |
1324 | 1325 | ||
1325 | static int lpc_eth_drv_probe(struct platform_device *pdev) | 1326 | static int lpc_eth_drv_probe(struct platform_device *pdev) |
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 9757ce3543a0..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: |
@@ -5889,11 +5890,7 @@ static void rtl_slow_event_work(struct rtl8169_private *tp) | |||
5889 | if (status & LinkChg) | 5890 | if (status & LinkChg) |
5890 | __rtl8169_check_link_status(dev, tp, tp->mmio_addr, true); | 5891 | __rtl8169_check_link_status(dev, tp, tp->mmio_addr, true); |
5891 | 5892 | ||
5892 | napi_disable(&tp->napi); | 5893 | rtl_irq_enable_all(tp); |
5893 | rtl_irq_disable(tp); | ||
5894 | |||
5895 | napi_enable(&tp->napi); | ||
5896 | napi_schedule(&tp->napi); | ||
5897 | } | 5894 | } |
5898 | 5895 | ||
5899 | static void rtl_task(struct work_struct *work) | 5896 | static void rtl_task(struct work_struct *work) |
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/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 036428348faa..9f448279e12a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig | |||
@@ -13,7 +13,7 @@ config STMMAC_ETH | |||
13 | if STMMAC_ETH | 13 | if STMMAC_ETH |
14 | 14 | ||
15 | config STMMAC_PLATFORM | 15 | config STMMAC_PLATFORM |
16 | tristate "STMMAC platform bus support" | 16 | bool "STMMAC Platform bus support" |
17 | depends on STMMAC_ETH | 17 | depends on STMMAC_ETH |
18 | default y | 18 | default y |
19 | ---help--- | 19 | ---help--- |
@@ -26,7 +26,7 @@ config STMMAC_PLATFORM | |||
26 | If unsure, say N. | 26 | If unsure, say N. |
27 | 27 | ||
28 | config STMMAC_PCI | 28 | config STMMAC_PCI |
29 | tristate "STMMAC support on PCI bus (EXPERIMENTAL)" | 29 | bool "STMMAC PCI bus support (EXPERIMENTAL)" |
30 | depends on STMMAC_ETH && PCI && EXPERIMENTAL | 30 | depends on STMMAC_ETH && PCI && EXPERIMENTAL |
31 | ---help--- | 31 | ---help--- |
32 | This is to select the Synopsys DWMAC available on PCI devices, | 32 | This is to select the Synopsys DWMAC available on PCI devices, |
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c index fb8377da1687..4b785e10f2ed 100644 --- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c +++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c | |||
@@ -51,7 +51,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) | |||
51 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; | 51 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
52 | priv->hw->desc->prepare_tx_desc(desc, 1, bmax, | 52 | priv->hw->desc->prepare_tx_desc(desc, 1, bmax, |
53 | csum); | 53 | csum); |
54 | 54 | wmb(); | |
55 | entry = (++priv->cur_tx) % txsize; | 55 | entry = (++priv->cur_tx) % txsize; |
56 | desc = priv->dma_tx + entry; | 56 | desc = priv->dma_tx + entry; |
57 | 57 | ||
@@ -59,6 +59,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) | |||
59 | len, DMA_TO_DEVICE); | 59 | len, DMA_TO_DEVICE); |
60 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; | 60 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
61 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum); | 61 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum); |
62 | wmb(); | ||
62 | priv->hw->desc->set_tx_owner(desc); | 63 | priv->hw->desc->set_tx_owner(desc); |
63 | priv->tx_skbuff[entry] = NULL; | 64 | priv->tx_skbuff[entry] = NULL; |
64 | } else { | 65 | } else { |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 6b5d060ee9de..dc20c56efc9d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
27 | #include <linux/stmmac.h> | 27 | #include <linux/stmmac.h> |
28 | #include <linux/phy.h> | 28 | #include <linux/phy.h> |
29 | #include <linux/pci.h> | ||
29 | #include "common.h" | 30 | #include "common.h" |
30 | #ifdef CONFIG_STMMAC_TIMER | 31 | #ifdef CONFIG_STMMAC_TIMER |
31 | #include "stmmac_timer.h" | 32 | #include "stmmac_timer.h" |
@@ -95,7 +96,6 @@ extern int stmmac_mdio_register(struct net_device *ndev); | |||
95 | extern void stmmac_set_ethtool_ops(struct net_device *netdev); | 96 | extern void stmmac_set_ethtool_ops(struct net_device *netdev); |
96 | extern const struct stmmac_desc_ops enh_desc_ops; | 97 | extern const struct stmmac_desc_ops enh_desc_ops; |
97 | extern const struct stmmac_desc_ops ndesc_ops; | 98 | extern const struct stmmac_desc_ops ndesc_ops; |
98 | |||
99 | int stmmac_freeze(struct net_device *ndev); | 99 | int stmmac_freeze(struct net_device *ndev); |
100 | int stmmac_restore(struct net_device *ndev); | 100 | int stmmac_restore(struct net_device *ndev); |
101 | int stmmac_resume(struct net_device *ndev); | 101 | int stmmac_resume(struct net_device *ndev); |
@@ -109,7 +109,7 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
109 | static inline int stmmac_clk_enable(struct stmmac_priv *priv) | 109 | static inline int stmmac_clk_enable(struct stmmac_priv *priv) |
110 | { | 110 | { |
111 | if (!IS_ERR(priv->stmmac_clk)) | 111 | if (!IS_ERR(priv->stmmac_clk)) |
112 | return clk_enable(priv->stmmac_clk); | 112 | return clk_prepare_enable(priv->stmmac_clk); |
113 | 113 | ||
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
@@ -119,7 +119,7 @@ static inline void stmmac_clk_disable(struct stmmac_priv *priv) | |||
119 | if (IS_ERR(priv->stmmac_clk)) | 119 | if (IS_ERR(priv->stmmac_clk)) |
120 | return; | 120 | return; |
121 | 121 | ||
122 | clk_disable(priv->stmmac_clk); | 122 | clk_disable_unprepare(priv->stmmac_clk); |
123 | } | 123 | } |
124 | static inline int stmmac_clk_get(struct stmmac_priv *priv) | 124 | static inline int stmmac_clk_get(struct stmmac_priv *priv) |
125 | { | 125 | { |
@@ -143,3 +143,60 @@ static inline int stmmac_clk_get(struct stmmac_priv *priv) | |||
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | #endif /* CONFIG_HAVE_CLK */ | 145 | #endif /* CONFIG_HAVE_CLK */ |
146 | |||
147 | |||
148 | #ifdef CONFIG_STMMAC_PLATFORM | ||
149 | extern struct platform_driver stmmac_pltfr_driver; | ||
150 | static inline int stmmac_register_platform(void) | ||
151 | { | ||
152 | int err; | ||
153 | |||
154 | err = platform_driver_register(&stmmac_pltfr_driver); | ||
155 | if (err) | ||
156 | pr_err("stmmac: failed to register the platform driver\n"); | ||
157 | |||
158 | return err; | ||
159 | } | ||
160 | static inline void stmmac_unregister_platform(void) | ||
161 | { | ||
162 | platform_driver_register(&stmmac_pltfr_driver); | ||
163 | } | ||
164 | #else | ||
165 | static inline int stmmac_register_platform(void) | ||
166 | { | ||
167 | pr_debug("stmmac: do not register the platf driver\n"); | ||
168 | |||
169 | return -EINVAL; | ||
170 | } | ||
171 | static inline void stmmac_unregister_platform(void) | ||
172 | { | ||
173 | } | ||
174 | #endif /* CONFIG_STMMAC_PLATFORM */ | ||
175 | |||
176 | #ifdef CONFIG_STMMAC_PCI | ||
177 | extern struct pci_driver stmmac_pci_driver; | ||
178 | static inline int stmmac_register_pci(void) | ||
179 | { | ||
180 | int err; | ||
181 | |||
182 | err = pci_register_driver(&stmmac_pci_driver); | ||
183 | if (err) | ||
184 | pr_err("stmmac: failed to register the PCI driver\n"); | ||
185 | |||
186 | return err; | ||
187 | } | ||
188 | static inline void stmmac_unregister_pci(void) | ||
189 | { | ||
190 | pci_unregister_driver(&stmmac_pci_driver); | ||
191 | } | ||
192 | #else | ||
193 | static inline int stmmac_register_pci(void) | ||
194 | { | ||
195 | pr_debug("stmmac: do not register the PCI driver\n"); | ||
196 | |||
197 | return -EINVAL; | ||
198 | } | ||
199 | static inline void stmmac_unregister_pci(void) | ||
200 | { | ||
201 | } | ||
202 | #endif /* CONFIG_STMMAC_PCI */ | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 70966330f44e..ea3003edde18 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -833,8 +833,9 @@ static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) | |||
833 | 833 | ||
834 | /** | 834 | /** |
835 | * stmmac_selec_desc_mode | 835 | * stmmac_selec_desc_mode |
836 | * @dev : device pointer | 836 | * @priv : private structure |
837 | * Description: select the Enhanced/Alternate or Normal descriptors */ | 837 | * Description: select the Enhanced/Alternate or Normal descriptors |
838 | */ | ||
838 | static void stmmac_selec_desc_mode(struct stmmac_priv *priv) | 839 | static void stmmac_selec_desc_mode(struct stmmac_priv *priv) |
839 | { | 840 | { |
840 | if (priv->plat->enh_desc) { | 841 | if (priv->plat->enh_desc) { |
@@ -1211,6 +1212,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1211 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); | 1212 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); |
1212 | wmb(); | 1213 | wmb(); |
1213 | priv->hw->desc->set_tx_owner(desc); | 1214 | priv->hw->desc->set_tx_owner(desc); |
1215 | wmb(); | ||
1214 | } | 1216 | } |
1215 | 1217 | ||
1216 | /* Interrupt on completition only for the latest segment */ | 1218 | /* Interrupt on completition only for the latest segment */ |
@@ -1226,6 +1228,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1226 | 1228 | ||
1227 | /* To avoid raise condition */ | 1229 | /* To avoid raise condition */ |
1228 | priv->hw->desc->set_tx_owner(first); | 1230 | priv->hw->desc->set_tx_owner(first); |
1231 | wmb(); | ||
1229 | 1232 | ||
1230 | priv->cur_tx++; | 1233 | priv->cur_tx++; |
1231 | 1234 | ||
@@ -1289,6 +1292,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv) | |||
1289 | } | 1292 | } |
1290 | wmb(); | 1293 | wmb(); |
1291 | priv->hw->desc->set_rx_owner(p + entry); | 1294 | priv->hw->desc->set_rx_owner(p + entry); |
1295 | wmb(); | ||
1292 | } | 1296 | } |
1293 | } | 1297 | } |
1294 | 1298 | ||
@@ -1861,6 +1865,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv) | |||
1861 | /** | 1865 | /** |
1862 | * stmmac_dvr_probe | 1866 | * stmmac_dvr_probe |
1863 | * @device: device pointer | 1867 | * @device: device pointer |
1868 | * @plat_dat: platform data pointer | ||
1869 | * @addr: iobase memory address | ||
1864 | * Description: this is the main probe function used to | 1870 | * Description: this is the main probe function used to |
1865 | * call the alloc_etherdev, allocate the priv structure. | 1871 | * call the alloc_etherdev, allocate the priv structure. |
1866 | */ | 1872 | */ |
@@ -2090,6 +2096,34 @@ int stmmac_restore(struct net_device *ndev) | |||
2090 | } | 2096 | } |
2091 | #endif /* CONFIG_PM */ | 2097 | #endif /* CONFIG_PM */ |
2092 | 2098 | ||
2099 | /* Driver can be configured w/ and w/ both PCI and Platf drivers | ||
2100 | * depending on the configuration selected. | ||
2101 | */ | ||
2102 | static int __init stmmac_init(void) | ||
2103 | { | ||
2104 | int err_plt = 0; | ||
2105 | int err_pci = 0; | ||
2106 | |||
2107 | err_plt = stmmac_register_platform(); | ||
2108 | err_pci = stmmac_register_pci(); | ||
2109 | |||
2110 | if ((err_pci) && (err_plt)) { | ||
2111 | pr_err("stmmac: driver registration failed\n"); | ||
2112 | return -EINVAL; | ||
2113 | } | ||
2114 | |||
2115 | return 0; | ||
2116 | } | ||
2117 | |||
2118 | static void __exit stmmac_exit(void) | ||
2119 | { | ||
2120 | stmmac_unregister_platform(); | ||
2121 | stmmac_unregister_pci(); | ||
2122 | } | ||
2123 | |||
2124 | module_init(stmmac_init); | ||
2125 | module_exit(stmmac_exit); | ||
2126 | |||
2093 | #ifndef MODULE | 2127 | #ifndef MODULE |
2094 | static int __init stmmac_cmdline_opt(char *str) | 2128 | static int __init stmmac_cmdline_opt(char *str) |
2095 | { | 2129 | { |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 58fab5303e9c..cf826e6b6aa1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | |||
@@ -179,7 +179,7 @@ static DEFINE_PCI_DEVICE_TABLE(stmmac_id_table) = { | |||
179 | 179 | ||
180 | MODULE_DEVICE_TABLE(pci, stmmac_id_table); | 180 | MODULE_DEVICE_TABLE(pci, stmmac_id_table); |
181 | 181 | ||
182 | static struct pci_driver stmmac_driver = { | 182 | struct pci_driver stmmac_pci_driver = { |
183 | .name = STMMAC_RESOURCE_NAME, | 183 | .name = STMMAC_RESOURCE_NAME, |
184 | .id_table = stmmac_id_table, | 184 | .id_table = stmmac_id_table, |
185 | .probe = stmmac_pci_probe, | 185 | .probe = stmmac_pci_probe, |
@@ -190,33 +190,6 @@ static struct pci_driver stmmac_driver = { | |||
190 | #endif | 190 | #endif |
191 | }; | 191 | }; |
192 | 192 | ||
193 | /** | ||
194 | * stmmac_init_module - Entry point for the driver | ||
195 | * Description: This function is the entry point for the driver. | ||
196 | */ | ||
197 | static int __init stmmac_init_module(void) | ||
198 | { | ||
199 | int ret; | ||
200 | |||
201 | ret = pci_register_driver(&stmmac_driver); | ||
202 | if (ret < 0) | ||
203 | pr_err("%s: ERROR: driver registration failed\n", __func__); | ||
204 | |||
205 | return ret; | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * stmmac_cleanup_module - Cleanup routine for the driver | ||
210 | * Description: This function is the cleanup routine for the driver. | ||
211 | */ | ||
212 | static void __exit stmmac_cleanup_module(void) | ||
213 | { | ||
214 | pci_unregister_driver(&stmmac_driver); | ||
215 | } | ||
216 | |||
217 | module_init(stmmac_init_module); | ||
218 | module_exit(stmmac_cleanup_module); | ||
219 | |||
220 | MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet PCI driver"); | 193 | MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet PCI driver"); |
221 | MODULE_AUTHOR("Rayagond Kokatanur <rayagond.kokatanur@vayavyalabs.com>"); | 194 | MODULE_AUTHOR("Rayagond Kokatanur <rayagond.kokatanur@vayavyalabs.com>"); |
222 | MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>"); | 195 | MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>"); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 3dd8f0803808..680d2b8dfe27 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -255,7 +255,7 @@ static const struct of_device_id stmmac_dt_ids[] = { | |||
255 | }; | 255 | }; |
256 | MODULE_DEVICE_TABLE(of, stmmac_dt_ids); | 256 | MODULE_DEVICE_TABLE(of, stmmac_dt_ids); |
257 | 257 | ||
258 | static struct platform_driver stmmac_driver = { | 258 | struct platform_driver stmmac_pltfr_driver = { |
259 | .probe = stmmac_pltfr_probe, | 259 | .probe = stmmac_pltfr_probe, |
260 | .remove = stmmac_pltfr_remove, | 260 | .remove = stmmac_pltfr_remove, |
261 | .driver = { | 261 | .driver = { |
@@ -266,8 +266,6 @@ static struct platform_driver stmmac_driver = { | |||
266 | }, | 266 | }, |
267 | }; | 267 | }; |
268 | 268 | ||
269 | module_platform_driver(stmmac_driver); | ||
270 | |||
271 | MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet PLATFORM driver"); | 269 | MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet PLATFORM driver"); |
272 | MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>"); | 270 | MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>"); |
273 | MODULE_LICENSE("GPL"); | 271 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 703c8cce2a2c..8c726b7004d3 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c | |||
@@ -3598,7 +3598,6 @@ static int release_tx_packet(struct niu *np, struct tx_ring_info *rp, int idx) | |||
3598 | static void niu_tx_work(struct niu *np, struct tx_ring_info *rp) | 3598 | static void niu_tx_work(struct niu *np, struct tx_ring_info *rp) |
3599 | { | 3599 | { |
3600 | struct netdev_queue *txq; | 3600 | struct netdev_queue *txq; |
3601 | unsigned int tx_bytes; | ||
3602 | u16 pkt_cnt, tmp; | 3601 | u16 pkt_cnt, tmp; |
3603 | int cons, index; | 3602 | int cons, index; |
3604 | u64 cs; | 3603 | u64 cs; |
@@ -3621,18 +3620,12 @@ static void niu_tx_work(struct niu *np, struct tx_ring_info *rp) | |||
3621 | netif_printk(np, tx_done, KERN_DEBUG, np->dev, | 3620 | netif_printk(np, tx_done, KERN_DEBUG, np->dev, |
3622 | "%s() pkt_cnt[%u] cons[%d]\n", __func__, pkt_cnt, cons); | 3621 | "%s() pkt_cnt[%u] cons[%d]\n", __func__, pkt_cnt, cons); |
3623 | 3622 | ||
3624 | tx_bytes = 0; | 3623 | while (pkt_cnt--) |
3625 | tmp = pkt_cnt; | ||
3626 | while (tmp--) { | ||
3627 | tx_bytes += rp->tx_buffs[cons].skb->len; | ||
3628 | cons = release_tx_packet(np, rp, cons); | 3624 | cons = release_tx_packet(np, rp, cons); |
3629 | } | ||
3630 | 3625 | ||
3631 | rp->cons = cons; | 3626 | rp->cons = cons; |
3632 | smp_mb(); | 3627 | smp_mb(); |
3633 | 3628 | ||
3634 | netdev_tx_completed_queue(txq, pkt_cnt, tx_bytes); | ||
3635 | |||
3636 | out: | 3629 | out: |
3637 | if (unlikely(netif_tx_queue_stopped(txq) && | 3630 | if (unlikely(netif_tx_queue_stopped(txq) && |
3638 | (niu_tx_avail(rp) > NIU_TX_WAKEUP_THRESH(rp)))) { | 3631 | (niu_tx_avail(rp) > NIU_TX_WAKEUP_THRESH(rp)))) { |
@@ -4333,7 +4326,6 @@ static void niu_free_channels(struct niu *np) | |||
4333 | struct tx_ring_info *rp = &np->tx_rings[i]; | 4326 | struct tx_ring_info *rp = &np->tx_rings[i]; |
4334 | 4327 | ||
4335 | niu_free_tx_ring_info(np, rp); | 4328 | niu_free_tx_ring_info(np, rp); |
4336 | netdev_tx_reset_queue(netdev_get_tx_queue(np->dev, i)); | ||
4337 | } | 4329 | } |
4338 | kfree(np->tx_rings); | 4330 | kfree(np->tx_rings); |
4339 | np->tx_rings = NULL; | 4331 | np->tx_rings = NULL; |
@@ -6739,8 +6731,6 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb, | |||
6739 | prod = NEXT_TX(rp, prod); | 6731 | prod = NEXT_TX(rp, prod); |
6740 | } | 6732 | } |
6741 | 6733 | ||
6742 | netdev_tx_sent_queue(txq, skb->len); | ||
6743 | |||
6744 | if (prod < rp->prod) | 6734 | if (prod < rp->prod) |
6745 | rp->wrap_bit ^= TX_RING_KICK_WRAP; | 6735 | rp->wrap_bit ^= TX_RING_KICK_WRAP; |
6746 | rp->prod = prod; | 6736 | rp->prod = prod; |
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/ethernet/tile/Kconfig b/drivers/net/ethernet/tile/Kconfig index 2d9218f86bca..098b1c42b393 100644 --- a/drivers/net/ethernet/tile/Kconfig +++ b/drivers/net/ethernet/tile/Kconfig | |||
@@ -7,6 +7,8 @@ config TILE_NET | |||
7 | depends on TILE | 7 | depends on TILE |
8 | default y | 8 | default y |
9 | select CRC32 | 9 | select CRC32 |
10 | select TILE_GXIO_MPIPE if TILEGX | ||
11 | select HIGH_RES_TIMERS if TILEGX | ||
10 | ---help--- | 12 | ---help--- |
11 | This is a standard Linux network device driver for the | 13 | This is a standard Linux network device driver for the |
12 | on-chip Tilera Gigabit Ethernet and XAUI interfaces. | 14 | on-chip Tilera Gigabit Ethernet and XAUI interfaces. |
diff --git a/drivers/net/ethernet/tile/Makefile b/drivers/net/ethernet/tile/Makefile index f634f142cab4..0ef9eefd3211 100644 --- a/drivers/net/ethernet/tile/Makefile +++ b/drivers/net/ethernet/tile/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_TILE_NET) += tile_net.o | 5 | obj-$(CONFIG_TILE_NET) += tile_net.o |
6 | ifdef CONFIG_TILEGX | 6 | ifdef CONFIG_TILEGX |
7 | tile_net-objs := tilegx.o mpipe.o iorpc_mpipe.o dma_queue.o | 7 | tile_net-y := tilegx.o |
8 | else | 8 | else |
9 | tile_net-objs := tilepro.o | 9 | tile_net-y := tilepro.o |
10 | endif | 10 | endif |
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c new file mode 100644 index 000000000000..83b4b388ad49 --- /dev/null +++ b/drivers/net/ethernet/tile/tilegx.c | |||
@@ -0,0 +1,1898 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Tilera Corporation. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | |||
15 | #include <linux/module.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/moduleparam.h> | ||
18 | #include <linux/sched.h> | ||
19 | #include <linux/kernel.h> /* printk() */ | ||
20 | #include <linux/slab.h> /* kmalloc() */ | ||
21 | #include <linux/errno.h> /* error codes */ | ||
22 | #include <linux/types.h> /* size_t */ | ||
23 | #include <linux/interrupt.h> | ||
24 | #include <linux/in.h> | ||
25 | #include <linux/irq.h> | ||
26 | #include <linux/netdevice.h> /* struct device, and other headers */ | ||
27 | #include <linux/etherdevice.h> /* eth_type_trans */ | ||
28 | #include <linux/skbuff.h> | ||
29 | #include <linux/ioctl.h> | ||
30 | #include <linux/cdev.h> | ||
31 | #include <linux/hugetlb.h> | ||
32 | #include <linux/in6.h> | ||
33 | #include <linux/timer.h> | ||
34 | #include <linux/hrtimer.h> | ||
35 | #include <linux/ktime.h> | ||
36 | #include <linux/io.h> | ||
37 | #include <linux/ctype.h> | ||
38 | #include <linux/ip.h> | ||
39 | #include <linux/tcp.h> | ||
40 | |||
41 | #include <asm/checksum.h> | ||
42 | #include <asm/homecache.h> | ||
43 | #include <gxio/mpipe.h> | ||
44 | #include <arch/sim.h> | ||
45 | |||
46 | /* Default transmit lockup timeout period, in jiffies. */ | ||
47 | #define TILE_NET_TIMEOUT (5 * HZ) | ||
48 | |||
49 | /* The maximum number of distinct channels (idesc.channel is 5 bits). */ | ||
50 | #define TILE_NET_CHANNELS 32 | ||
51 | |||
52 | /* Maximum number of idescs to handle per "poll". */ | ||
53 | #define TILE_NET_BATCH 128 | ||
54 | |||
55 | /* Maximum number of packets to handle per "poll". */ | ||
56 | #define TILE_NET_WEIGHT 64 | ||
57 | |||
58 | /* Number of entries in each iqueue. */ | ||
59 | #define IQUEUE_ENTRIES 512 | ||
60 | |||
61 | /* Number of entries in each equeue. */ | ||
62 | #define EQUEUE_ENTRIES 2048 | ||
63 | |||
64 | /* Total header bytes per equeue slot. Must be big enough for 2 bytes | ||
65 | * of NET_IP_ALIGN alignment, plus 14 bytes (?) of L2 header, plus up to | ||
66 | * 60 bytes of actual TCP header. We round up to align to cache lines. | ||
67 | */ | ||
68 | #define HEADER_BYTES 128 | ||
69 | |||
70 | /* Maximum completions per cpu per device (must be a power of two). | ||
71 | * ISSUE: What is the right number here? If this is too small, then | ||
72 | * egress might block waiting for free space in a completions array. | ||
73 | * ISSUE: At the least, allocate these only for initialized echannels. | ||
74 | */ | ||
75 | #define TILE_NET_MAX_COMPS 64 | ||
76 | |||
77 | #define MAX_FRAGS (MAX_SKB_FRAGS + 1) | ||
78 | |||
79 | /* Size of completions data to allocate. | ||
80 | * ISSUE: Probably more than needed since we don't use all the channels. | ||
81 | */ | ||
82 | #define COMPS_SIZE (TILE_NET_CHANNELS * sizeof(struct tile_net_comps)) | ||
83 | |||
84 | /* Size of NotifRing data to allocate. */ | ||
85 | #define NOTIF_RING_SIZE (IQUEUE_ENTRIES * sizeof(gxio_mpipe_idesc_t)) | ||
86 | |||
87 | /* Timeout to wake the per-device TX timer after we stop the queue. | ||
88 | * We don't want the timeout too short (adds overhead, and might end | ||
89 | * up causing stop/wake/stop/wake cycles) or too long (affects performance). | ||
90 | * For the 10 Gb NIC, 30 usec means roughly 30+ 1500-byte packets. | ||
91 | */ | ||
92 | #define TX_TIMER_DELAY_USEC 30 | ||
93 | |||
94 | /* Timeout to wake the per-cpu egress timer to free completions. */ | ||
95 | #define EGRESS_TIMER_DELAY_USEC 1000 | ||
96 | |||
97 | MODULE_AUTHOR("Tilera Corporation"); | ||
98 | MODULE_LICENSE("GPL"); | ||
99 | |||
100 | /* A "packet fragment" (a chunk of memory). */ | ||
101 | struct frag { | ||
102 | void *buf; | ||
103 | size_t length; | ||
104 | }; | ||
105 | |||
106 | /* A single completion. */ | ||
107 | struct tile_net_comp { | ||
108 | /* The "complete_count" when the completion will be complete. */ | ||
109 | s64 when; | ||
110 | /* The buffer to be freed when the completion is complete. */ | ||
111 | struct sk_buff *skb; | ||
112 | }; | ||
113 | |||
114 | /* The completions for a given cpu and echannel. */ | ||
115 | struct tile_net_comps { | ||
116 | /* The completions. */ | ||
117 | struct tile_net_comp comp_queue[TILE_NET_MAX_COMPS]; | ||
118 | /* The number of completions used. */ | ||
119 | unsigned long comp_next; | ||
120 | /* The number of completions freed. */ | ||
121 | unsigned long comp_last; | ||
122 | }; | ||
123 | |||
124 | /* The transmit wake timer for a given cpu and echannel. */ | ||
125 | struct tile_net_tx_wake { | ||
126 | struct hrtimer timer; | ||
127 | struct net_device *dev; | ||
128 | }; | ||
129 | |||
130 | /* Info for a specific cpu. */ | ||
131 | struct tile_net_info { | ||
132 | /* The NAPI struct. */ | ||
133 | struct napi_struct napi; | ||
134 | /* Packet queue. */ | ||
135 | gxio_mpipe_iqueue_t iqueue; | ||
136 | /* Our cpu. */ | ||
137 | int my_cpu; | ||
138 | /* True if iqueue is valid. */ | ||
139 | bool has_iqueue; | ||
140 | /* NAPI flags. */ | ||
141 | bool napi_added; | ||
142 | bool napi_enabled; | ||
143 | /* Number of small sk_buffs which must still be provided. */ | ||
144 | unsigned int num_needed_small_buffers; | ||
145 | /* Number of large sk_buffs which must still be provided. */ | ||
146 | unsigned int num_needed_large_buffers; | ||
147 | /* A timer for handling egress completions. */ | ||
148 | struct hrtimer egress_timer; | ||
149 | /* True if "egress_timer" is scheduled. */ | ||
150 | bool egress_timer_scheduled; | ||
151 | /* Comps for each egress channel. */ | ||
152 | struct tile_net_comps *comps_for_echannel[TILE_NET_CHANNELS]; | ||
153 | /* Transmit wake timer for each egress channel. */ | ||
154 | struct tile_net_tx_wake tx_wake[TILE_NET_CHANNELS]; | ||
155 | }; | ||
156 | |||
157 | /* Info for egress on a particular egress channel. */ | ||
158 | struct tile_net_egress { | ||
159 | /* The "equeue". */ | ||
160 | gxio_mpipe_equeue_t *equeue; | ||
161 | /* The headers for TSO. */ | ||
162 | unsigned char *headers; | ||
163 | }; | ||
164 | |||
165 | /* Info for a specific device. */ | ||
166 | struct tile_net_priv { | ||
167 | /* Our network device. */ | ||
168 | struct net_device *dev; | ||
169 | /* The primary link. */ | ||
170 | gxio_mpipe_link_t link; | ||
171 | /* The primary channel, if open, else -1. */ | ||
172 | int channel; | ||
173 | /* The "loopify" egress link, if needed. */ | ||
174 | gxio_mpipe_link_t loopify_link; | ||
175 | /* The "loopify" egress channel, if open, else -1. */ | ||
176 | int loopify_channel; | ||
177 | /* The egress channel (channel or loopify_channel). */ | ||
178 | int echannel; | ||
179 | /* Total stats. */ | ||
180 | struct net_device_stats stats; | ||
181 | }; | ||
182 | |||
183 | /* Egress info, indexed by "priv->echannel" (lazily created as needed). */ | ||
184 | static struct tile_net_egress egress_for_echannel[TILE_NET_CHANNELS]; | ||
185 | |||
186 | /* Devices currently associated with each channel. | ||
187 | * NOTE: The array entry can become NULL after ifconfig down, but | ||
188 | * we do not free the underlying net_device structures, so it is | ||
189 | * safe to use a pointer after reading it from this array. | ||
190 | */ | ||
191 | static struct net_device *tile_net_devs_for_channel[TILE_NET_CHANNELS]; | ||
192 | |||
193 | /* A mutex for "tile_net_devs_for_channel". */ | ||
194 | static DEFINE_MUTEX(tile_net_devs_for_channel_mutex); | ||
195 | |||
196 | /* The per-cpu info. */ | ||
197 | static DEFINE_PER_CPU(struct tile_net_info, per_cpu_info); | ||
198 | |||
199 | /* The "context" for all devices. */ | ||
200 | static gxio_mpipe_context_t context; | ||
201 | |||
202 | /* Buffer sizes and mpipe enum codes for buffer stacks. | ||
203 | * See arch/tile/include/gxio/mpipe.h for the set of possible values. | ||
204 | */ | ||
205 | #define BUFFER_SIZE_SMALL_ENUM GXIO_MPIPE_BUFFER_SIZE_128 | ||
206 | #define BUFFER_SIZE_SMALL 128 | ||
207 | #define BUFFER_SIZE_LARGE_ENUM GXIO_MPIPE_BUFFER_SIZE_1664 | ||
208 | #define BUFFER_SIZE_LARGE 1664 | ||
209 | |||
210 | /* The small/large "buffer stacks". */ | ||
211 | static int small_buffer_stack = -1; | ||
212 | static int large_buffer_stack = -1; | ||
213 | |||
214 | /* Amount of memory allocated for each buffer stack. */ | ||
215 | static size_t buffer_stack_size; | ||
216 | |||
217 | /* The actual memory allocated for the buffer stacks. */ | ||
218 | static void *small_buffer_stack_va; | ||
219 | static void *large_buffer_stack_va; | ||
220 | |||
221 | /* The buckets. */ | ||
222 | static int first_bucket = -1; | ||
223 | static int num_buckets = 1; | ||
224 | |||
225 | /* The ingress irq. */ | ||
226 | static int ingress_irq = -1; | ||
227 | |||
228 | /* Text value of tile_net.cpus if passed as a module parameter. */ | ||
229 | static char *network_cpus_string; | ||
230 | |||
231 | /* The actual cpus in "network_cpus". */ | ||
232 | static struct cpumask network_cpus_map; | ||
233 | |||
234 | /* If "loopify=LINK" was specified, this is "LINK". */ | ||
235 | static char *loopify_link_name; | ||
236 | |||
237 | /* If "tile_net.custom" was specified, this is non-NULL. */ | ||
238 | static char *custom_str; | ||
239 | |||
240 | /* The "tile_net.cpus" argument specifies the cpus that are dedicated | ||
241 | * to handle ingress packets. | ||
242 | * | ||
243 | * The parameter should be in the form "tile_net.cpus=m-n[,x-y]", where | ||
244 | * m, n, x, y are integer numbers that represent the cpus that can be | ||
245 | * neither a dedicated cpu nor a dataplane cpu. | ||
246 | */ | ||
247 | static bool network_cpus_init(void) | ||
248 | { | ||
249 | char buf[1024]; | ||
250 | int rc; | ||
251 | |||
252 | if (network_cpus_string == NULL) | ||
253 | return false; | ||
254 | |||
255 | rc = cpulist_parse_crop(network_cpus_string, &network_cpus_map); | ||
256 | if (rc != 0) { | ||
257 | pr_warn("tile_net.cpus=%s: malformed cpu list\n", | ||
258 | network_cpus_string); | ||
259 | return false; | ||
260 | } | ||
261 | |||
262 | /* Remove dedicated cpus. */ | ||
263 | cpumask_and(&network_cpus_map, &network_cpus_map, cpu_possible_mask); | ||
264 | |||
265 | if (cpumask_empty(&network_cpus_map)) { | ||
266 | pr_warn("Ignoring empty tile_net.cpus='%s'.\n", | ||
267 | network_cpus_string); | ||
268 | return false; | ||
269 | } | ||
270 | |||
271 | cpulist_scnprintf(buf, sizeof(buf), &network_cpus_map); | ||
272 | pr_info("Linux network CPUs: %s\n", buf); | ||
273 | return true; | ||
274 | } | ||
275 | |||
276 | module_param_named(cpus, network_cpus_string, charp, 0444); | ||
277 | MODULE_PARM_DESC(cpus, "cpulist of cores that handle network interrupts"); | ||
278 | |||
279 | /* The "tile_net.loopify=LINK" argument causes the named device to | ||
280 | * actually use "loop0" for ingress, and "loop1" for egress. This | ||
281 | * allows an app to sit between the actual link and linux, passing | ||
282 | * (some) packets along to linux, and forwarding (some) packets sent | ||
283 | * out by linux. | ||
284 | */ | ||
285 | module_param_named(loopify, loopify_link_name, charp, 0444); | ||
286 | MODULE_PARM_DESC(loopify, "name the device to use loop0/1 for ingress/egress"); | ||
287 | |||
288 | /* The "tile_net.custom" argument causes us to ignore the "conventional" | ||
289 | * classifier metadata, in particular, the "l2_offset". | ||
290 | */ | ||
291 | module_param_named(custom, custom_str, charp, 0444); | ||
292 | MODULE_PARM_DESC(custom, "indicates a (heavily) customized classifier"); | ||
293 | |||
294 | /* Atomically update a statistics field. | ||
295 | * Note that on TILE-Gx, this operation is fire-and-forget on the | ||
296 | * issuing core (single-cycle dispatch) and takes only a few cycles | ||
297 | * longer than a regular store when the request reaches the home cache. | ||
298 | * No expensive bus management overhead is required. | ||
299 | */ | ||
300 | static void tile_net_stats_add(unsigned long value, unsigned long *field) | ||
301 | { | ||
302 | BUILD_BUG_ON(sizeof(atomic_long_t) != sizeof(unsigned long)); | ||
303 | atomic_long_add(value, (atomic_long_t *)field); | ||
304 | } | ||
305 | |||
306 | /* Allocate and push a buffer. */ | ||
307 | static bool tile_net_provide_buffer(bool small) | ||
308 | { | ||
309 | int stack = small ? small_buffer_stack : large_buffer_stack; | ||
310 | const unsigned long buffer_alignment = 128; | ||
311 | struct sk_buff *skb; | ||
312 | int len; | ||
313 | |||
314 | len = sizeof(struct sk_buff **) + buffer_alignment; | ||
315 | len += (small ? BUFFER_SIZE_SMALL : BUFFER_SIZE_LARGE); | ||
316 | skb = dev_alloc_skb(len); | ||
317 | if (skb == NULL) | ||
318 | return false; | ||
319 | |||
320 | /* Make room for a back-pointer to 'skb' and guarantee alignment. */ | ||
321 | skb_reserve(skb, sizeof(struct sk_buff **)); | ||
322 | skb_reserve(skb, -(long)skb->data & (buffer_alignment - 1)); | ||
323 | |||
324 | /* Save a back-pointer to 'skb'. */ | ||
325 | *(struct sk_buff **)(skb->data - sizeof(struct sk_buff **)) = skb; | ||
326 | |||
327 | /* Make sure "skb" and the back-pointer have been flushed. */ | ||
328 | wmb(); | ||
329 | |||
330 | gxio_mpipe_push_buffer(&context, stack, | ||
331 | (void *)va_to_tile_io_addr(skb->data)); | ||
332 | |||
333 | return true; | ||
334 | } | ||
335 | |||
336 | /* Convert a raw mpipe buffer to its matching skb pointer. */ | ||
337 | static struct sk_buff *mpipe_buf_to_skb(void *va) | ||
338 | { | ||
339 | /* Acquire the associated "skb". */ | ||
340 | struct sk_buff **skb_ptr = va - sizeof(*skb_ptr); | ||
341 | struct sk_buff *skb = *skb_ptr; | ||
342 | |||
343 | /* Paranoia. */ | ||
344 | if (skb->data != va) { | ||
345 | /* Panic here since there's a reasonable chance | ||
346 | * that corrupt buffers means generic memory | ||
347 | * corruption, with unpredictable system effects. | ||
348 | */ | ||
349 | panic("Corrupt linux buffer! va=%p, skb=%p, skb->data=%p", | ||
350 | va, skb, skb->data); | ||
351 | } | ||
352 | |||
353 | return skb; | ||
354 | } | ||
355 | |||
356 | static void tile_net_pop_all_buffers(int stack) | ||
357 | { | ||
358 | for (;;) { | ||
359 | tile_io_addr_t addr = | ||
360 | (tile_io_addr_t)gxio_mpipe_pop_buffer(&context, stack); | ||
361 | if (addr == 0) | ||
362 | break; | ||
363 | dev_kfree_skb_irq(mpipe_buf_to_skb(tile_io_addr_to_va(addr))); | ||
364 | } | ||
365 | } | ||
366 | |||
367 | /* Provide linux buffers to mPIPE. */ | ||
368 | static void tile_net_provide_needed_buffers(void) | ||
369 | { | ||
370 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
371 | |||
372 | while (info->num_needed_small_buffers != 0) { | ||
373 | if (!tile_net_provide_buffer(true)) | ||
374 | goto oops; | ||
375 | info->num_needed_small_buffers--; | ||
376 | } | ||
377 | |||
378 | while (info->num_needed_large_buffers != 0) { | ||
379 | if (!tile_net_provide_buffer(false)) | ||
380 | goto oops; | ||
381 | info->num_needed_large_buffers--; | ||
382 | } | ||
383 | |||
384 | return; | ||
385 | |||
386 | oops: | ||
387 | /* Add a description to the page allocation failure dump. */ | ||
388 | pr_notice("Tile %d still needs some buffers\n", info->my_cpu); | ||
389 | } | ||
390 | |||
391 | static inline bool filter_packet(struct net_device *dev, void *buf) | ||
392 | { | ||
393 | /* Filter packets received before we're up. */ | ||
394 | if (dev == NULL || !(dev->flags & IFF_UP)) | ||
395 | return true; | ||
396 | |||
397 | /* Filter out packets that aren't for us. */ | ||
398 | if (!(dev->flags & IFF_PROMISC) && | ||
399 | !is_multicast_ether_addr(buf) && | ||
400 | compare_ether_addr(dev->dev_addr, buf) != 0) | ||
401 | return true; | ||
402 | |||
403 | return false; | ||
404 | } | ||
405 | |||
406 | static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb, | ||
407 | gxio_mpipe_idesc_t *idesc, unsigned long len) | ||
408 | { | ||
409 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
410 | struct tile_net_priv *priv = netdev_priv(dev); | ||
411 | |||
412 | /* Encode the actual packet length. */ | ||
413 | skb_put(skb, len); | ||
414 | |||
415 | skb->protocol = eth_type_trans(skb, dev); | ||
416 | |||
417 | /* Acknowledge "good" hardware checksums. */ | ||
418 | if (idesc->cs && idesc->csum_seed_val == 0xFFFF) | ||
419 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
420 | |||
421 | netif_receive_skb(skb); | ||
422 | |||
423 | /* Update stats. */ | ||
424 | tile_net_stats_add(1, &priv->stats.rx_packets); | ||
425 | tile_net_stats_add(len, &priv->stats.rx_bytes); | ||
426 | |||
427 | /* Need a new buffer. */ | ||
428 | if (idesc->size == BUFFER_SIZE_SMALL_ENUM) | ||
429 | info->num_needed_small_buffers++; | ||
430 | else | ||
431 | info->num_needed_large_buffers++; | ||
432 | } | ||
433 | |||
434 | /* Handle a packet. Return true if "processed", false if "filtered". */ | ||
435 | static bool tile_net_handle_packet(gxio_mpipe_idesc_t *idesc) | ||
436 | { | ||
437 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
438 | struct net_device *dev = tile_net_devs_for_channel[idesc->channel]; | ||
439 | uint8_t l2_offset; | ||
440 | void *va; | ||
441 | void *buf; | ||
442 | unsigned long len; | ||
443 | bool filter; | ||
444 | |||
445 | /* Drop packets for which no buffer was available. | ||
446 | * NOTE: This happens under heavy load. | ||
447 | */ | ||
448 | if (idesc->be) { | ||
449 | struct tile_net_priv *priv = netdev_priv(dev); | ||
450 | tile_net_stats_add(1, &priv->stats.rx_dropped); | ||
451 | gxio_mpipe_iqueue_consume(&info->iqueue, idesc); | ||
452 | if (net_ratelimit()) | ||
453 | pr_info("Dropping packet (insufficient buffers).\n"); | ||
454 | return false; | ||
455 | } | ||
456 | |||
457 | /* Get the "l2_offset", if allowed. */ | ||
458 | l2_offset = custom_str ? 0 : gxio_mpipe_idesc_get_l2_offset(idesc); | ||
459 | |||
460 | /* Get the raw buffer VA (includes "headroom"). */ | ||
461 | va = tile_io_addr_to_va((unsigned long)(long)idesc->va); | ||
462 | |||
463 | /* Get the actual packet start/length. */ | ||
464 | buf = va + l2_offset; | ||
465 | len = idesc->l2_size - l2_offset; | ||
466 | |||
467 | /* Point "va" at the raw buffer. */ | ||
468 | va -= NET_IP_ALIGN; | ||
469 | |||
470 | filter = filter_packet(dev, buf); | ||
471 | if (filter) { | ||
472 | gxio_mpipe_iqueue_drop(&info->iqueue, idesc); | ||
473 | } else { | ||
474 | struct sk_buff *skb = mpipe_buf_to_skb(va); | ||
475 | |||
476 | /* Skip headroom, and any custom header. */ | ||
477 | skb_reserve(skb, NET_IP_ALIGN + l2_offset); | ||
478 | |||
479 | tile_net_receive_skb(dev, skb, idesc, len); | ||
480 | } | ||
481 | |||
482 | gxio_mpipe_iqueue_consume(&info->iqueue, idesc); | ||
483 | return !filter; | ||
484 | } | ||
485 | |||
486 | /* Handle some packets for the current CPU. | ||
487 | * | ||
488 | * This function handles up to TILE_NET_BATCH idescs per call. | ||
489 | * | ||
490 | * ISSUE: Since we do not provide new buffers until this function is | ||
491 | * complete, we must initially provide enough buffers for each network | ||
492 | * cpu to fill its iqueue and also its batched idescs. | ||
493 | * | ||
494 | * ISSUE: The "rotting packet" race condition occurs if a packet | ||
495 | * arrives after the queue appears to be empty, and before the | ||
496 | * hypervisor interrupt is re-enabled. | ||
497 | */ | ||
498 | static int tile_net_poll(struct napi_struct *napi, int budget) | ||
499 | { | ||
500 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
501 | unsigned int work = 0; | ||
502 | gxio_mpipe_idesc_t *idesc; | ||
503 | int i, n; | ||
504 | |||
505 | /* Process packets. */ | ||
506 | while ((n = gxio_mpipe_iqueue_try_peek(&info->iqueue, &idesc)) > 0) { | ||
507 | for (i = 0; i < n; i++) { | ||
508 | if (i == TILE_NET_BATCH) | ||
509 | goto done; | ||
510 | if (tile_net_handle_packet(idesc + i)) { | ||
511 | if (++work >= budget) | ||
512 | goto done; | ||
513 | } | ||
514 | } | ||
515 | } | ||
516 | |||
517 | /* There are no packets left. */ | ||
518 | napi_complete(&info->napi); | ||
519 | |||
520 | /* Re-enable hypervisor interrupts. */ | ||
521 | gxio_mpipe_enable_notif_ring_interrupt(&context, info->iqueue.ring); | ||
522 | |||
523 | /* HACK: Avoid the "rotting packet" problem. */ | ||
524 | if (gxio_mpipe_iqueue_try_peek(&info->iqueue, &idesc) > 0) | ||
525 | napi_schedule(&info->napi); | ||
526 | |||
527 | /* ISSUE: Handle completions? */ | ||
528 | |||
529 | done: | ||
530 | tile_net_provide_needed_buffers(); | ||
531 | |||
532 | return work; | ||
533 | } | ||
534 | |||
535 | /* Handle an ingress interrupt on the current cpu. */ | ||
536 | static irqreturn_t tile_net_handle_ingress_irq(int irq, void *unused) | ||
537 | { | ||
538 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
539 | napi_schedule(&info->napi); | ||
540 | return IRQ_HANDLED; | ||
541 | } | ||
542 | |||
543 | /* Free some completions. This must be called with interrupts blocked. */ | ||
544 | static int tile_net_free_comps(gxio_mpipe_equeue_t *equeue, | ||
545 | struct tile_net_comps *comps, | ||
546 | int limit, bool force_update) | ||
547 | { | ||
548 | int n = 0; | ||
549 | while (comps->comp_last < comps->comp_next) { | ||
550 | unsigned int cid = comps->comp_last % TILE_NET_MAX_COMPS; | ||
551 | struct tile_net_comp *comp = &comps->comp_queue[cid]; | ||
552 | if (!gxio_mpipe_equeue_is_complete(equeue, comp->when, | ||
553 | force_update || n == 0)) | ||
554 | break; | ||
555 | dev_kfree_skb_irq(comp->skb); | ||
556 | comps->comp_last++; | ||
557 | if (++n == limit) | ||
558 | break; | ||
559 | } | ||
560 | return n; | ||
561 | } | ||
562 | |||
563 | /* Add a completion. This must be called with interrupts blocked. | ||
564 | * tile_net_equeue_try_reserve() will have ensured a free completion entry. | ||
565 | */ | ||
566 | static void add_comp(gxio_mpipe_equeue_t *equeue, | ||
567 | struct tile_net_comps *comps, | ||
568 | uint64_t when, struct sk_buff *skb) | ||
569 | { | ||
570 | int cid = comps->comp_next % TILE_NET_MAX_COMPS; | ||
571 | comps->comp_queue[cid].when = when; | ||
572 | comps->comp_queue[cid].skb = skb; | ||
573 | comps->comp_next++; | ||
574 | } | ||
575 | |||
576 | static void tile_net_schedule_tx_wake_timer(struct net_device *dev) | ||
577 | { | ||
578 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
579 | struct tile_net_priv *priv = netdev_priv(dev); | ||
580 | |||
581 | hrtimer_start(&info->tx_wake[priv->echannel].timer, | ||
582 | ktime_set(0, TX_TIMER_DELAY_USEC * 1000UL), | ||
583 | HRTIMER_MODE_REL_PINNED); | ||
584 | } | ||
585 | |||
586 | static enum hrtimer_restart tile_net_handle_tx_wake_timer(struct hrtimer *t) | ||
587 | { | ||
588 | struct tile_net_tx_wake *tx_wake = | ||
589 | container_of(t, struct tile_net_tx_wake, timer); | ||
590 | netif_wake_subqueue(tx_wake->dev, smp_processor_id()); | ||
591 | return HRTIMER_NORESTART; | ||
592 | } | ||
593 | |||
594 | /* Make sure the egress timer is scheduled. */ | ||
595 | static void tile_net_schedule_egress_timer(void) | ||
596 | { | ||
597 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
598 | |||
599 | if (!info->egress_timer_scheduled) { | ||
600 | hrtimer_start(&info->egress_timer, | ||
601 | ktime_set(0, EGRESS_TIMER_DELAY_USEC * 1000UL), | ||
602 | HRTIMER_MODE_REL_PINNED); | ||
603 | info->egress_timer_scheduled = true; | ||
604 | } | ||
605 | } | ||
606 | |||
607 | /* The "function" for "info->egress_timer". | ||
608 | * | ||
609 | * This timer will reschedule itself as long as there are any pending | ||
610 | * completions expected for this tile. | ||
611 | */ | ||
612 | static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t) | ||
613 | { | ||
614 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
615 | unsigned long irqflags; | ||
616 | bool pending = false; | ||
617 | int i; | ||
618 | |||
619 | local_irq_save(irqflags); | ||
620 | |||
621 | /* The timer is no longer scheduled. */ | ||
622 | info->egress_timer_scheduled = false; | ||
623 | |||
624 | /* Free all possible comps for this tile. */ | ||
625 | for (i = 0; i < TILE_NET_CHANNELS; i++) { | ||
626 | struct tile_net_egress *egress = &egress_for_echannel[i]; | ||
627 | struct tile_net_comps *comps = info->comps_for_echannel[i]; | ||
628 | if (comps->comp_last >= comps->comp_next) | ||
629 | continue; | ||
630 | tile_net_free_comps(egress->equeue, comps, -1, true); | ||
631 | pending = pending || (comps->comp_last < comps->comp_next); | ||
632 | } | ||
633 | |||
634 | /* Reschedule timer if needed. */ | ||
635 | if (pending) | ||
636 | tile_net_schedule_egress_timer(); | ||
637 | |||
638 | local_irq_restore(irqflags); | ||
639 | |||
640 | return HRTIMER_NORESTART; | ||
641 | } | ||
642 | |||
643 | /* Helper function for "tile_net_update()". | ||
644 | * "dev" (i.e. arg) is the device being brought up or down, | ||
645 | * or NULL if all devices are now down. | ||
646 | */ | ||
647 | static void tile_net_update_cpu(void *arg) | ||
648 | { | ||
649 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
650 | struct net_device *dev = arg; | ||
651 | |||
652 | if (!info->has_iqueue) | ||
653 | return; | ||
654 | |||
655 | if (dev != NULL) { | ||
656 | if (!info->napi_added) { | ||
657 | netif_napi_add(dev, &info->napi, | ||
658 | tile_net_poll, TILE_NET_WEIGHT); | ||
659 | info->napi_added = true; | ||
660 | } | ||
661 | if (!info->napi_enabled) { | ||
662 | napi_enable(&info->napi); | ||
663 | info->napi_enabled = true; | ||
664 | } | ||
665 | enable_percpu_irq(ingress_irq, 0); | ||
666 | } else { | ||
667 | disable_percpu_irq(ingress_irq); | ||
668 | if (info->napi_enabled) { | ||
669 | napi_disable(&info->napi); | ||
670 | info->napi_enabled = false; | ||
671 | } | ||
672 | /* FIXME: Drain the iqueue. */ | ||
673 | } | ||
674 | } | ||
675 | |||
676 | /* Helper function for tile_net_open() and tile_net_stop(). | ||
677 | * Always called under tile_net_devs_for_channel_mutex. | ||
678 | */ | ||
679 | static int tile_net_update(struct net_device *dev) | ||
680 | { | ||
681 | static gxio_mpipe_rules_t rules; /* too big to fit on the stack */ | ||
682 | bool saw_channel = false; | ||
683 | int channel; | ||
684 | int rc; | ||
685 | int cpu; | ||
686 | |||
687 | gxio_mpipe_rules_init(&rules, &context); | ||
688 | |||
689 | for (channel = 0; channel < TILE_NET_CHANNELS; channel++) { | ||
690 | if (tile_net_devs_for_channel[channel] == NULL) | ||
691 | continue; | ||
692 | if (!saw_channel) { | ||
693 | saw_channel = true; | ||
694 | gxio_mpipe_rules_begin(&rules, first_bucket, | ||
695 | num_buckets, NULL); | ||
696 | gxio_mpipe_rules_set_headroom(&rules, NET_IP_ALIGN); | ||
697 | } | ||
698 | gxio_mpipe_rules_add_channel(&rules, channel); | ||
699 | } | ||
700 | |||
701 | /* NOTE: This can fail if there is no classifier. | ||
702 | * ISSUE: Can anything else cause it to fail? | ||
703 | */ | ||
704 | rc = gxio_mpipe_rules_commit(&rules); | ||
705 | if (rc != 0) { | ||
706 | netdev_warn(dev, "gxio_mpipe_rules_commit failed: %d\n", rc); | ||
707 | return -EIO; | ||
708 | } | ||
709 | |||
710 | /* Update all cpus, sequentially (to protect "netif_napi_add()"). */ | ||
711 | for_each_online_cpu(cpu) | ||
712 | smp_call_function_single(cpu, tile_net_update_cpu, | ||
713 | (saw_channel ? dev : NULL), 1); | ||
714 | |||
715 | /* HACK: Allow packets to flow in the simulator. */ | ||
716 | if (saw_channel) | ||
717 | sim_enable_mpipe_links(0, -1); | ||
718 | |||
719 | return 0; | ||
720 | } | ||
721 | |||
722 | /* Allocate and initialize mpipe buffer stacks, and register them in | ||
723 | * the mPIPE TLBs, for both small and large packet sizes. | ||
724 | * This routine supports tile_net_init_mpipe(), below. | ||
725 | */ | ||
726 | static int init_buffer_stacks(struct net_device *dev, int num_buffers) | ||
727 | { | ||
728 | pte_t hash_pte = pte_set_home((pte_t) { 0 }, PAGE_HOME_HASH); | ||
729 | int rc; | ||
730 | |||
731 | /* Compute stack bytes; we round up to 64KB and then use | ||
732 | * alloc_pages() so we get the required 64KB alignment as well. | ||
733 | */ | ||
734 | buffer_stack_size = | ||
735 | ALIGN(gxio_mpipe_calc_buffer_stack_bytes(num_buffers), | ||
736 | 64 * 1024); | ||
737 | |||
738 | /* Allocate two buffer stack indices. */ | ||
739 | rc = gxio_mpipe_alloc_buffer_stacks(&context, 2, 0, 0); | ||
740 | if (rc < 0) { | ||
741 | netdev_err(dev, "gxio_mpipe_alloc_buffer_stacks failed: %d\n", | ||
742 | rc); | ||
743 | return rc; | ||
744 | } | ||
745 | small_buffer_stack = rc; | ||
746 | large_buffer_stack = rc + 1; | ||
747 | |||
748 | /* Allocate the small memory stack. */ | ||
749 | small_buffer_stack_va = | ||
750 | alloc_pages_exact(buffer_stack_size, GFP_KERNEL); | ||
751 | if (small_buffer_stack_va == NULL) { | ||
752 | netdev_err(dev, | ||
753 | "Could not alloc %zd bytes for buffer stacks\n", | ||
754 | buffer_stack_size); | ||
755 | return -ENOMEM; | ||
756 | } | ||
757 | rc = gxio_mpipe_init_buffer_stack(&context, small_buffer_stack, | ||
758 | BUFFER_SIZE_SMALL_ENUM, | ||
759 | small_buffer_stack_va, | ||
760 | buffer_stack_size, 0); | ||
761 | if (rc != 0) { | ||
762 | netdev_err(dev, "gxio_mpipe_init_buffer_stack: %d\n", rc); | ||
763 | return rc; | ||
764 | } | ||
765 | rc = gxio_mpipe_register_client_memory(&context, small_buffer_stack, | ||
766 | hash_pte, 0); | ||
767 | if (rc != 0) { | ||
768 | netdev_err(dev, | ||
769 | "gxio_mpipe_register_buffer_memory failed: %d\n", | ||
770 | rc); | ||
771 | return rc; | ||
772 | } | ||
773 | |||
774 | /* Allocate the large buffer stack. */ | ||
775 | large_buffer_stack_va = | ||
776 | alloc_pages_exact(buffer_stack_size, GFP_KERNEL); | ||
777 | if (large_buffer_stack_va == NULL) { | ||
778 | netdev_err(dev, | ||
779 | "Could not alloc %zd bytes for buffer stacks\n", | ||
780 | buffer_stack_size); | ||
781 | return -ENOMEM; | ||
782 | } | ||
783 | rc = gxio_mpipe_init_buffer_stack(&context, large_buffer_stack, | ||
784 | BUFFER_SIZE_LARGE_ENUM, | ||
785 | large_buffer_stack_va, | ||
786 | buffer_stack_size, 0); | ||
787 | if (rc != 0) { | ||
788 | netdev_err(dev, "gxio_mpipe_init_buffer_stack failed: %d\n", | ||
789 | rc); | ||
790 | return rc; | ||
791 | } | ||
792 | rc = gxio_mpipe_register_client_memory(&context, large_buffer_stack, | ||
793 | hash_pte, 0); | ||
794 | if (rc != 0) { | ||
795 | netdev_err(dev, | ||
796 | "gxio_mpipe_register_buffer_memory failed: %d\n", | ||
797 | rc); | ||
798 | return rc; | ||
799 | } | ||
800 | |||
801 | return 0; | ||
802 | } | ||
803 | |||
804 | /* Allocate per-cpu resources (memory for completions and idescs). | ||
805 | * This routine supports tile_net_init_mpipe(), below. | ||
806 | */ | ||
807 | static int alloc_percpu_mpipe_resources(struct net_device *dev, | ||
808 | int cpu, int ring) | ||
809 | { | ||
810 | struct tile_net_info *info = &per_cpu(per_cpu_info, cpu); | ||
811 | int order, i, rc; | ||
812 | struct page *page; | ||
813 | void *addr; | ||
814 | |||
815 | /* Allocate the "comps". */ | ||
816 | order = get_order(COMPS_SIZE); | ||
817 | page = homecache_alloc_pages(GFP_KERNEL, order, cpu); | ||
818 | if (page == NULL) { | ||
819 | netdev_err(dev, "Failed to alloc %zd bytes comps memory\n", | ||
820 | COMPS_SIZE); | ||
821 | return -ENOMEM; | ||
822 | } | ||
823 | addr = pfn_to_kaddr(page_to_pfn(page)); | ||
824 | memset(addr, 0, COMPS_SIZE); | ||
825 | for (i = 0; i < TILE_NET_CHANNELS; i++) | ||
826 | info->comps_for_echannel[i] = | ||
827 | addr + i * sizeof(struct tile_net_comps); | ||
828 | |||
829 | /* If this is a network cpu, create an iqueue. */ | ||
830 | if (cpu_isset(cpu, network_cpus_map)) { | ||
831 | order = get_order(NOTIF_RING_SIZE); | ||
832 | page = homecache_alloc_pages(GFP_KERNEL, order, cpu); | ||
833 | if (page == NULL) { | ||
834 | netdev_err(dev, | ||
835 | "Failed to alloc %zd bytes iqueue memory\n", | ||
836 | NOTIF_RING_SIZE); | ||
837 | return -ENOMEM; | ||
838 | } | ||
839 | addr = pfn_to_kaddr(page_to_pfn(page)); | ||
840 | rc = gxio_mpipe_iqueue_init(&info->iqueue, &context, ring++, | ||
841 | addr, NOTIF_RING_SIZE, 0); | ||
842 | if (rc < 0) { | ||
843 | netdev_err(dev, | ||
844 | "gxio_mpipe_iqueue_init failed: %d\n", rc); | ||
845 | return rc; | ||
846 | } | ||
847 | info->has_iqueue = true; | ||
848 | } | ||
849 | |||
850 | return ring; | ||
851 | } | ||
852 | |||
853 | /* Initialize NotifGroup and buckets. | ||
854 | * This routine supports tile_net_init_mpipe(), below. | ||
855 | */ | ||
856 | static int init_notif_group_and_buckets(struct net_device *dev, | ||
857 | int ring, int network_cpus_count) | ||
858 | { | ||
859 | int group, rc; | ||
860 | |||
861 | /* Allocate one NotifGroup. */ | ||
862 | rc = gxio_mpipe_alloc_notif_groups(&context, 1, 0, 0); | ||
863 | if (rc < 0) { | ||
864 | netdev_err(dev, "gxio_mpipe_alloc_notif_groups failed: %d\n", | ||
865 | rc); | ||
866 | return rc; | ||
867 | } | ||
868 | group = rc; | ||
869 | |||
870 | /* Initialize global num_buckets value. */ | ||
871 | if (network_cpus_count > 4) | ||
872 | num_buckets = 256; | ||
873 | else if (network_cpus_count > 1) | ||
874 | num_buckets = 16; | ||
875 | |||
876 | /* Allocate some buckets, and set global first_bucket value. */ | ||
877 | rc = gxio_mpipe_alloc_buckets(&context, num_buckets, 0, 0); | ||
878 | if (rc < 0) { | ||
879 | netdev_err(dev, "gxio_mpipe_alloc_buckets failed: %d\n", rc); | ||
880 | return rc; | ||
881 | } | ||
882 | first_bucket = rc; | ||
883 | |||
884 | /* Init group and buckets. */ | ||
885 | rc = gxio_mpipe_init_notif_group_and_buckets( | ||
886 | &context, group, ring, network_cpus_count, | ||
887 | first_bucket, num_buckets, | ||
888 | GXIO_MPIPE_BUCKET_STICKY_FLOW_LOCALITY); | ||
889 | if (rc != 0) { | ||
890 | netdev_err( | ||
891 | dev, | ||
892 | "gxio_mpipe_init_notif_group_and_buckets failed: %d\n", | ||
893 | rc); | ||
894 | return rc; | ||
895 | } | ||
896 | |||
897 | return 0; | ||
898 | } | ||
899 | |||
900 | /* Create an irq and register it, then activate the irq and request | ||
901 | * interrupts on all cores. Note that "ingress_irq" being initialized | ||
902 | * is how we know not to call tile_net_init_mpipe() again. | ||
903 | * This routine supports tile_net_init_mpipe(), below. | ||
904 | */ | ||
905 | static int tile_net_setup_interrupts(struct net_device *dev) | ||
906 | { | ||
907 | int cpu, rc; | ||
908 | |||
909 | rc = create_irq(); | ||
910 | if (rc < 0) { | ||
911 | netdev_err(dev, "create_irq failed: %d\n", rc); | ||
912 | return rc; | ||
913 | } | ||
914 | ingress_irq = rc; | ||
915 | tile_irq_activate(ingress_irq, TILE_IRQ_PERCPU); | ||
916 | rc = request_irq(ingress_irq, tile_net_handle_ingress_irq, | ||
917 | 0, NULL, NULL); | ||
918 | if (rc != 0) { | ||
919 | netdev_err(dev, "request_irq failed: %d\n", rc); | ||
920 | destroy_irq(ingress_irq); | ||
921 | ingress_irq = -1; | ||
922 | return rc; | ||
923 | } | ||
924 | |||
925 | for_each_online_cpu(cpu) { | ||
926 | struct tile_net_info *info = &per_cpu(per_cpu_info, cpu); | ||
927 | if (info->has_iqueue) { | ||
928 | gxio_mpipe_request_notif_ring_interrupt( | ||
929 | &context, cpu_x(cpu), cpu_y(cpu), | ||
930 | 1, ingress_irq, info->iqueue.ring); | ||
931 | } | ||
932 | } | ||
933 | |||
934 | return 0; | ||
935 | } | ||
936 | |||
937 | /* Undo any state set up partially by a failed call to tile_net_init_mpipe. */ | ||
938 | static void tile_net_init_mpipe_fail(void) | ||
939 | { | ||
940 | int cpu; | ||
941 | |||
942 | /* Do cleanups that require the mpipe context first. */ | ||
943 | if (small_buffer_stack >= 0) | ||
944 | tile_net_pop_all_buffers(small_buffer_stack); | ||
945 | if (large_buffer_stack >= 0) | ||
946 | tile_net_pop_all_buffers(large_buffer_stack); | ||
947 | |||
948 | /* Destroy mpipe context so the hardware no longer owns any memory. */ | ||
949 | gxio_mpipe_destroy(&context); | ||
950 | |||
951 | for_each_online_cpu(cpu) { | ||
952 | struct tile_net_info *info = &per_cpu(per_cpu_info, cpu); | ||
953 | free_pages((unsigned long)(info->comps_for_echannel[0]), | ||
954 | get_order(COMPS_SIZE)); | ||
955 | info->comps_for_echannel[0] = NULL; | ||
956 | free_pages((unsigned long)(info->iqueue.idescs), | ||
957 | get_order(NOTIF_RING_SIZE)); | ||
958 | info->iqueue.idescs = NULL; | ||
959 | } | ||
960 | |||
961 | if (small_buffer_stack_va) | ||
962 | free_pages_exact(small_buffer_stack_va, buffer_stack_size); | ||
963 | if (large_buffer_stack_va) | ||
964 | free_pages_exact(large_buffer_stack_va, buffer_stack_size); | ||
965 | |||
966 | small_buffer_stack_va = NULL; | ||
967 | large_buffer_stack_va = NULL; | ||
968 | large_buffer_stack = -1; | ||
969 | small_buffer_stack = -1; | ||
970 | first_bucket = -1; | ||
971 | } | ||
972 | |||
973 | /* The first time any tilegx network device is opened, we initialize | ||
974 | * the global mpipe state. If this step fails, we fail to open the | ||
975 | * device, but if it succeeds, we never need to do it again, and since | ||
976 | * tile_net can't be unloaded, we never undo it. | ||
977 | * | ||
978 | * Note that some resources in this path (buffer stack indices, | ||
979 | * bindings from init_buffer_stack, etc.) are hypervisor resources | ||
980 | * that are freed implicitly by gxio_mpipe_destroy(). | ||
981 | */ | ||
982 | static int tile_net_init_mpipe(struct net_device *dev) | ||
983 | { | ||
984 | int i, num_buffers, rc; | ||
985 | int cpu; | ||
986 | int first_ring, ring; | ||
987 | int network_cpus_count = cpus_weight(network_cpus_map); | ||
988 | |||
989 | if (!hash_default) { | ||
990 | netdev_err(dev, "Networking requires hash_default!\n"); | ||
991 | return -EIO; | ||
992 | } | ||
993 | |||
994 | rc = gxio_mpipe_init(&context, 0); | ||
995 | if (rc != 0) { | ||
996 | netdev_err(dev, "gxio_mpipe_init failed: %d\n", rc); | ||
997 | return -EIO; | ||
998 | } | ||
999 | |||
1000 | /* Set up the buffer stacks. */ | ||
1001 | num_buffers = | ||
1002 | network_cpus_count * (IQUEUE_ENTRIES + TILE_NET_BATCH); | ||
1003 | rc = init_buffer_stacks(dev, num_buffers); | ||
1004 | if (rc != 0) | ||
1005 | goto fail; | ||
1006 | |||
1007 | /* Provide initial buffers. */ | ||
1008 | rc = -ENOMEM; | ||
1009 | for (i = 0; i < num_buffers; i++) { | ||
1010 | if (!tile_net_provide_buffer(true)) { | ||
1011 | netdev_err(dev, "Cannot allocate initial sk_bufs!\n"); | ||
1012 | goto fail; | ||
1013 | } | ||
1014 | } | ||
1015 | for (i = 0; i < num_buffers; i++) { | ||
1016 | if (!tile_net_provide_buffer(false)) { | ||
1017 | netdev_err(dev, "Cannot allocate initial sk_bufs!\n"); | ||
1018 | goto fail; | ||
1019 | } | ||
1020 | } | ||
1021 | |||
1022 | /* Allocate one NotifRing for each network cpu. */ | ||
1023 | rc = gxio_mpipe_alloc_notif_rings(&context, network_cpus_count, 0, 0); | ||
1024 | if (rc < 0) { | ||
1025 | netdev_err(dev, "gxio_mpipe_alloc_notif_rings failed %d\n", | ||
1026 | rc); | ||
1027 | goto fail; | ||
1028 | } | ||
1029 | |||
1030 | /* Init NotifRings per-cpu. */ | ||
1031 | first_ring = rc; | ||
1032 | ring = first_ring; | ||
1033 | for_each_online_cpu(cpu) { | ||
1034 | rc = alloc_percpu_mpipe_resources(dev, cpu, ring); | ||
1035 | if (rc < 0) | ||
1036 | goto fail; | ||
1037 | ring = rc; | ||
1038 | } | ||
1039 | |||
1040 | /* Initialize NotifGroup and buckets. */ | ||
1041 | rc = init_notif_group_and_buckets(dev, first_ring, network_cpus_count); | ||
1042 | if (rc != 0) | ||
1043 | goto fail; | ||
1044 | |||
1045 | /* Create and enable interrupts. */ | ||
1046 | rc = tile_net_setup_interrupts(dev); | ||
1047 | if (rc != 0) | ||
1048 | goto fail; | ||
1049 | |||
1050 | return 0; | ||
1051 | |||
1052 | fail: | ||
1053 | tile_net_init_mpipe_fail(); | ||
1054 | return rc; | ||
1055 | } | ||
1056 | |||
1057 | /* Create persistent egress info for a given egress channel. | ||
1058 | * Note that this may be shared between, say, "gbe0" and "xgbe0". | ||
1059 | * ISSUE: Defer header allocation until TSO is actually needed? | ||
1060 | */ | ||
1061 | static int tile_net_init_egress(struct net_device *dev, int echannel) | ||
1062 | { | ||
1063 | struct page *headers_page, *edescs_page, *equeue_page; | ||
1064 | gxio_mpipe_edesc_t *edescs; | ||
1065 | gxio_mpipe_equeue_t *equeue; | ||
1066 | unsigned char *headers; | ||
1067 | int headers_order, edescs_order, equeue_order; | ||
1068 | size_t edescs_size; | ||
1069 | int edma; | ||
1070 | int rc = -ENOMEM; | ||
1071 | |||
1072 | /* Only initialize once. */ | ||
1073 | if (egress_for_echannel[echannel].equeue != NULL) | ||
1074 | return 0; | ||
1075 | |||
1076 | /* Allocate memory for the "headers". */ | ||
1077 | headers_order = get_order(EQUEUE_ENTRIES * HEADER_BYTES); | ||
1078 | headers_page = alloc_pages(GFP_KERNEL, headers_order); | ||
1079 | if (headers_page == NULL) { | ||
1080 | netdev_warn(dev, | ||
1081 | "Could not alloc %zd bytes for TSO headers.\n", | ||
1082 | PAGE_SIZE << headers_order); | ||
1083 | goto fail; | ||
1084 | } | ||
1085 | headers = pfn_to_kaddr(page_to_pfn(headers_page)); | ||
1086 | |||
1087 | /* Allocate memory for the "edescs". */ | ||
1088 | edescs_size = EQUEUE_ENTRIES * sizeof(*edescs); | ||
1089 | edescs_order = get_order(edescs_size); | ||
1090 | edescs_page = alloc_pages(GFP_KERNEL, edescs_order); | ||
1091 | if (edescs_page == NULL) { | ||
1092 | netdev_warn(dev, | ||
1093 | "Could not alloc %zd bytes for eDMA ring.\n", | ||
1094 | edescs_size); | ||
1095 | goto fail_headers; | ||
1096 | } | ||
1097 | edescs = pfn_to_kaddr(page_to_pfn(edescs_page)); | ||
1098 | |||
1099 | /* Allocate memory for the "equeue". */ | ||
1100 | equeue_order = get_order(sizeof(*equeue)); | ||
1101 | equeue_page = alloc_pages(GFP_KERNEL, equeue_order); | ||
1102 | if (equeue_page == NULL) { | ||
1103 | netdev_warn(dev, | ||
1104 | "Could not alloc %zd bytes for equeue info.\n", | ||
1105 | PAGE_SIZE << equeue_order); | ||
1106 | goto fail_edescs; | ||
1107 | } | ||
1108 | equeue = pfn_to_kaddr(page_to_pfn(equeue_page)); | ||
1109 | |||
1110 | /* Allocate an edma ring. Note that in practice this can't | ||
1111 | * fail, which is good, because we will leak an edma ring if so. | ||
1112 | */ | ||
1113 | rc = gxio_mpipe_alloc_edma_rings(&context, 1, 0, 0); | ||
1114 | if (rc < 0) { | ||
1115 | netdev_warn(dev, "gxio_mpipe_alloc_edma_rings failed: %d\n", | ||
1116 | rc); | ||
1117 | goto fail_equeue; | ||
1118 | } | ||
1119 | edma = rc; | ||
1120 | |||
1121 | /* Initialize the equeue. */ | ||
1122 | rc = gxio_mpipe_equeue_init(equeue, &context, edma, echannel, | ||
1123 | edescs, edescs_size, 0); | ||
1124 | if (rc != 0) { | ||
1125 | netdev_err(dev, "gxio_mpipe_equeue_init failed: %d\n", rc); | ||
1126 | goto fail_equeue; | ||
1127 | } | ||
1128 | |||
1129 | /* Done. */ | ||
1130 | egress_for_echannel[echannel].equeue = equeue; | ||
1131 | egress_for_echannel[echannel].headers = headers; | ||
1132 | return 0; | ||
1133 | |||
1134 | fail_equeue: | ||
1135 | __free_pages(equeue_page, equeue_order); | ||
1136 | |||
1137 | fail_edescs: | ||
1138 | __free_pages(edescs_page, edescs_order); | ||
1139 | |||
1140 | fail_headers: | ||
1141 | __free_pages(headers_page, headers_order); | ||
1142 | |||
1143 | fail: | ||
1144 | return rc; | ||
1145 | } | ||
1146 | |||
1147 | /* Return channel number for a newly-opened link. */ | ||
1148 | static int tile_net_link_open(struct net_device *dev, gxio_mpipe_link_t *link, | ||
1149 | const char *link_name) | ||
1150 | { | ||
1151 | int rc = gxio_mpipe_link_open(link, &context, link_name, 0); | ||
1152 | if (rc < 0) { | ||
1153 | netdev_err(dev, "Failed to open '%s'\n", link_name); | ||
1154 | return rc; | ||
1155 | } | ||
1156 | rc = gxio_mpipe_link_channel(link); | ||
1157 | if (rc < 0 || rc >= TILE_NET_CHANNELS) { | ||
1158 | netdev_err(dev, "gxio_mpipe_link_channel bad value: %d\n", rc); | ||
1159 | gxio_mpipe_link_close(link); | ||
1160 | return -EINVAL; | ||
1161 | } | ||
1162 | return rc; | ||
1163 | } | ||
1164 | |||
1165 | /* Help the kernel activate the given network interface. */ | ||
1166 | static int tile_net_open(struct net_device *dev) | ||
1167 | { | ||
1168 | struct tile_net_priv *priv = netdev_priv(dev); | ||
1169 | int cpu, rc; | ||
1170 | |||
1171 | mutex_lock(&tile_net_devs_for_channel_mutex); | ||
1172 | |||
1173 | /* Do one-time initialization the first time any device is opened. */ | ||
1174 | if (ingress_irq < 0) { | ||
1175 | rc = tile_net_init_mpipe(dev); | ||
1176 | if (rc != 0) | ||
1177 | goto fail; | ||
1178 | } | ||
1179 | |||
1180 | /* Determine if this is the "loopify" device. */ | ||
1181 | if (unlikely((loopify_link_name != NULL) && | ||
1182 | !strcmp(dev->name, loopify_link_name))) { | ||
1183 | rc = tile_net_link_open(dev, &priv->link, "loop0"); | ||
1184 | if (rc < 0) | ||
1185 | goto fail; | ||
1186 | priv->channel = rc; | ||
1187 | rc = tile_net_link_open(dev, &priv->loopify_link, "loop1"); | ||
1188 | if (rc < 0) | ||
1189 | goto fail; | ||
1190 | priv->loopify_channel = rc; | ||
1191 | priv->echannel = rc; | ||
1192 | } else { | ||
1193 | rc = tile_net_link_open(dev, &priv->link, dev->name); | ||
1194 | if (rc < 0) | ||
1195 | goto fail; | ||
1196 | priv->channel = rc; | ||
1197 | priv->echannel = rc; | ||
1198 | } | ||
1199 | |||
1200 | /* Initialize egress info (if needed). Once ever, per echannel. */ | ||
1201 | rc = tile_net_init_egress(dev, priv->echannel); | ||
1202 | if (rc != 0) | ||
1203 | goto fail; | ||
1204 | |||
1205 | tile_net_devs_for_channel[priv->channel] = dev; | ||
1206 | |||
1207 | rc = tile_net_update(dev); | ||
1208 | if (rc != 0) | ||
1209 | goto fail; | ||
1210 | |||
1211 | mutex_unlock(&tile_net_devs_for_channel_mutex); | ||
1212 | |||
1213 | /* Initialize the transmit wake timer for this device for each cpu. */ | ||
1214 | for_each_online_cpu(cpu) { | ||
1215 | struct tile_net_info *info = &per_cpu(per_cpu_info, cpu); | ||
1216 | struct tile_net_tx_wake *tx_wake = | ||
1217 | &info->tx_wake[priv->echannel]; | ||
1218 | |||
1219 | hrtimer_init(&tx_wake->timer, CLOCK_MONOTONIC, | ||
1220 | HRTIMER_MODE_REL); | ||
1221 | tx_wake->timer.function = tile_net_handle_tx_wake_timer; | ||
1222 | tx_wake->dev = dev; | ||
1223 | } | ||
1224 | |||
1225 | for_each_online_cpu(cpu) | ||
1226 | netif_start_subqueue(dev, cpu); | ||
1227 | netif_carrier_on(dev); | ||
1228 | return 0; | ||
1229 | |||
1230 | fail: | ||
1231 | if (priv->loopify_channel >= 0) { | ||
1232 | if (gxio_mpipe_link_close(&priv->loopify_link) != 0) | ||
1233 | netdev_warn(dev, "Failed to close loopify link!\n"); | ||
1234 | priv->loopify_channel = -1; | ||
1235 | } | ||
1236 | if (priv->channel >= 0) { | ||
1237 | if (gxio_mpipe_link_close(&priv->link) != 0) | ||
1238 | netdev_warn(dev, "Failed to close link!\n"); | ||
1239 | priv->channel = -1; | ||
1240 | } | ||
1241 | priv->echannel = -1; | ||
1242 | tile_net_devs_for_channel[priv->channel] = NULL; | ||
1243 | mutex_unlock(&tile_net_devs_for_channel_mutex); | ||
1244 | |||
1245 | /* Don't return raw gxio error codes to generic Linux. */ | ||
1246 | return (rc > -512) ? rc : -EIO; | ||
1247 | } | ||
1248 | |||
1249 | /* Help the kernel deactivate the given network interface. */ | ||
1250 | static int tile_net_stop(struct net_device *dev) | ||
1251 | { | ||
1252 | struct tile_net_priv *priv = netdev_priv(dev); | ||
1253 | int cpu; | ||
1254 | |||
1255 | for_each_online_cpu(cpu) { | ||
1256 | struct tile_net_info *info = &per_cpu(per_cpu_info, cpu); | ||
1257 | struct tile_net_tx_wake *tx_wake = | ||
1258 | &info->tx_wake[priv->echannel]; | ||
1259 | |||
1260 | hrtimer_cancel(&tx_wake->timer); | ||
1261 | netif_stop_subqueue(dev, cpu); | ||
1262 | } | ||
1263 | |||
1264 | mutex_lock(&tile_net_devs_for_channel_mutex); | ||
1265 | tile_net_devs_for_channel[priv->channel] = NULL; | ||
1266 | (void)tile_net_update(dev); | ||
1267 | if (priv->loopify_channel >= 0) { | ||
1268 | if (gxio_mpipe_link_close(&priv->loopify_link) != 0) | ||
1269 | netdev_warn(dev, "Failed to close loopify link!\n"); | ||
1270 | priv->loopify_channel = -1; | ||
1271 | } | ||
1272 | if (priv->channel >= 0) { | ||
1273 | if (gxio_mpipe_link_close(&priv->link) != 0) | ||
1274 | netdev_warn(dev, "Failed to close link!\n"); | ||
1275 | priv->channel = -1; | ||
1276 | } | ||
1277 | priv->echannel = -1; | ||
1278 | mutex_unlock(&tile_net_devs_for_channel_mutex); | ||
1279 | |||
1280 | return 0; | ||
1281 | } | ||
1282 | |||
1283 | /* Determine the VA for a fragment. */ | ||
1284 | static inline void *tile_net_frag_buf(skb_frag_t *f) | ||
1285 | { | ||
1286 | unsigned long pfn = page_to_pfn(skb_frag_page(f)); | ||
1287 | return pfn_to_kaddr(pfn) + f->page_offset; | ||
1288 | } | ||
1289 | |||
1290 | /* Acquire a completion entry and an egress slot, or if we can't, | ||
1291 | * stop the queue and schedule the tx_wake timer. | ||
1292 | */ | ||
1293 | static s64 tile_net_equeue_try_reserve(struct net_device *dev, | ||
1294 | struct tile_net_comps *comps, | ||
1295 | gxio_mpipe_equeue_t *equeue, | ||
1296 | int num_edescs) | ||
1297 | { | ||
1298 | /* Try to acquire a completion entry. */ | ||
1299 | if (comps->comp_next - comps->comp_last < TILE_NET_MAX_COMPS - 1 || | ||
1300 | tile_net_free_comps(equeue, comps, 32, false) != 0) { | ||
1301 | |||
1302 | /* Try to acquire an egress slot. */ | ||
1303 | s64 slot = gxio_mpipe_equeue_try_reserve(equeue, num_edescs); | ||
1304 | if (slot >= 0) | ||
1305 | return slot; | ||
1306 | |||
1307 | /* Freeing some completions gives the equeue time to drain. */ | ||
1308 | tile_net_free_comps(equeue, comps, TILE_NET_MAX_COMPS, false); | ||
1309 | |||
1310 | slot = gxio_mpipe_equeue_try_reserve(equeue, num_edescs); | ||
1311 | if (slot >= 0) | ||
1312 | return slot; | ||
1313 | } | ||
1314 | |||
1315 | /* Still nothing; give up and stop the queue for a short while. */ | ||
1316 | netif_stop_subqueue(dev, smp_processor_id()); | ||
1317 | tile_net_schedule_tx_wake_timer(dev); | ||
1318 | return -1; | ||
1319 | } | ||
1320 | |||
1321 | /* Determine how many edesc's are needed for TSO. | ||
1322 | * | ||
1323 | * Sometimes, if "sendfile()" requires copying, we will be called with | ||
1324 | * "data" containing the header and payload, with "frags" being empty. | ||
1325 | * Sometimes, for example when using NFS over TCP, a single segment can | ||
1326 | * span 3 fragments. This requires special care. | ||
1327 | */ | ||
1328 | static int tso_count_edescs(struct sk_buff *skb) | ||
1329 | { | ||
1330 | struct skb_shared_info *sh = skb_shinfo(skb); | ||
1331 | unsigned int data_len = skb->data_len; | ||
1332 | unsigned int p_len = sh->gso_size; | ||
1333 | long f_id = -1; /* id of the current fragment */ | ||
1334 | long f_size = -1; /* size of the current fragment */ | ||
1335 | long f_used = -1; /* bytes used from the current fragment */ | ||
1336 | long n; /* size of the current piece of payload */ | ||
1337 | int num_edescs = 0; | ||
1338 | int segment; | ||
1339 | |||
1340 | for (segment = 0; segment < sh->gso_segs; segment++) { | ||
1341 | |||
1342 | unsigned int p_used = 0; | ||
1343 | |||
1344 | /* One edesc for header and for each piece of the payload. */ | ||
1345 | for (num_edescs++; p_used < p_len; num_edescs++) { | ||
1346 | |||
1347 | /* Advance as needed. */ | ||
1348 | while (f_used >= f_size) { | ||
1349 | f_id++; | ||
1350 | f_size = sh->frags[f_id].size; | ||
1351 | f_used = 0; | ||
1352 | } | ||
1353 | |||
1354 | /* Use bytes from the current fragment. */ | ||
1355 | n = p_len - p_used; | ||
1356 | if (n > f_size - f_used) | ||
1357 | n = f_size - f_used; | ||
1358 | f_used += n; | ||
1359 | p_used += n; | ||
1360 | } | ||
1361 | |||
1362 | /* The last segment may be less than gso_size. */ | ||
1363 | data_len -= p_len; | ||
1364 | if (data_len < p_len) | ||
1365 | p_len = data_len; | ||
1366 | } | ||
1367 | |||
1368 | return num_edescs; | ||
1369 | } | ||
1370 | |||
1371 | /* Prepare modified copies of the skbuff headers. | ||
1372 | * FIXME: add support for IPv6. | ||
1373 | */ | ||
1374 | static void tso_headers_prepare(struct sk_buff *skb, unsigned char *headers, | ||
1375 | s64 slot) | ||
1376 | { | ||
1377 | struct skb_shared_info *sh = skb_shinfo(skb); | ||
1378 | struct iphdr *ih; | ||
1379 | struct tcphdr *th; | ||
1380 | unsigned int data_len = skb->data_len; | ||
1381 | unsigned char *data = skb->data; | ||
1382 | unsigned int ih_off, th_off, sh_len, p_len; | ||
1383 | unsigned int isum_seed, tsum_seed, id, seq; | ||
1384 | long f_id = -1; /* id of the current fragment */ | ||
1385 | long f_size = -1; /* size of the current fragment */ | ||
1386 | long f_used = -1; /* bytes used from the current fragment */ | ||
1387 | long n; /* size of the current piece of payload */ | ||
1388 | int segment; | ||
1389 | |||
1390 | /* Locate original headers and compute various lengths. */ | ||
1391 | ih = ip_hdr(skb); | ||
1392 | th = tcp_hdr(skb); | ||
1393 | ih_off = skb_network_offset(skb); | ||
1394 | th_off = skb_transport_offset(skb); | ||
1395 | sh_len = th_off + tcp_hdrlen(skb); | ||
1396 | p_len = sh->gso_size; | ||
1397 | |||
1398 | /* Set up seed values for IP and TCP csum and initialize id and seq. */ | ||
1399 | isum_seed = ((0xFFFF - ih->check) + | ||
1400 | (0xFFFF - ih->tot_len) + | ||
1401 | (0xFFFF - ih->id)); | ||
1402 | tsum_seed = th->check + (0xFFFF ^ htons(skb->len)); | ||
1403 | id = ntohs(ih->id); | ||
1404 | seq = ntohl(th->seq); | ||
1405 | |||
1406 | /* Prepare all the headers. */ | ||
1407 | for (segment = 0; segment < sh->gso_segs; segment++) { | ||
1408 | unsigned char *buf; | ||
1409 | unsigned int p_used = 0; | ||
1410 | |||
1411 | /* Copy to the header memory for this segment. */ | ||
1412 | buf = headers + (slot % EQUEUE_ENTRIES) * HEADER_BYTES + | ||
1413 | NET_IP_ALIGN; | ||
1414 | memcpy(buf, data, sh_len); | ||
1415 | |||
1416 | /* Update copied ip header. */ | ||
1417 | ih = (struct iphdr *)(buf + ih_off); | ||
1418 | ih->tot_len = htons(sh_len + p_len - ih_off); | ||
1419 | ih->id = htons(id); | ||
1420 | ih->check = csum_long(isum_seed + ih->tot_len + | ||
1421 | ih->id) ^ 0xffff; | ||
1422 | |||
1423 | /* Update copied tcp header. */ | ||
1424 | th = (struct tcphdr *)(buf + th_off); | ||
1425 | th->seq = htonl(seq); | ||
1426 | th->check = csum_long(tsum_seed + htons(sh_len + p_len)); | ||
1427 | if (segment != sh->gso_segs - 1) { | ||
1428 | th->fin = 0; | ||
1429 | th->psh = 0; | ||
1430 | } | ||
1431 | |||
1432 | /* Skip past the header. */ | ||
1433 | slot++; | ||
1434 | |||
1435 | /* Skip past the payload. */ | ||
1436 | while (p_used < p_len) { | ||
1437 | |||
1438 | /* Advance as needed. */ | ||
1439 | while (f_used >= f_size) { | ||
1440 | f_id++; | ||
1441 | f_size = sh->frags[f_id].size; | ||
1442 | f_used = 0; | ||
1443 | } | ||
1444 | |||
1445 | /* Use bytes from the current fragment. */ | ||
1446 | n = p_len - p_used; | ||
1447 | if (n > f_size - f_used) | ||
1448 | n = f_size - f_used; | ||
1449 | f_used += n; | ||
1450 | p_used += n; | ||
1451 | |||
1452 | slot++; | ||
1453 | } | ||
1454 | |||
1455 | id++; | ||
1456 | seq += p_len; | ||
1457 | |||
1458 | /* The last segment may be less than gso_size. */ | ||
1459 | data_len -= p_len; | ||
1460 | if (data_len < p_len) | ||
1461 | p_len = data_len; | ||
1462 | } | ||
1463 | |||
1464 | /* Flush the headers so they are ready for hardware DMA. */ | ||
1465 | wmb(); | ||
1466 | } | ||
1467 | |||
1468 | /* Pass all the data to mpipe for egress. */ | ||
1469 | static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue, | ||
1470 | struct sk_buff *skb, unsigned char *headers, s64 slot) | ||
1471 | { | ||
1472 | struct tile_net_priv *priv = netdev_priv(dev); | ||
1473 | struct skb_shared_info *sh = skb_shinfo(skb); | ||
1474 | unsigned int data_len = skb->data_len; | ||
1475 | unsigned int p_len = sh->gso_size; | ||
1476 | gxio_mpipe_edesc_t edesc_head = { { 0 } }; | ||
1477 | gxio_mpipe_edesc_t edesc_body = { { 0 } }; | ||
1478 | long f_id = -1; /* id of the current fragment */ | ||
1479 | long f_size = -1; /* size of the current fragment */ | ||
1480 | long f_used = -1; /* bytes used from the current fragment */ | ||
1481 | long n; /* size of the current piece of payload */ | ||
1482 | unsigned long tx_packets = 0, tx_bytes = 0; | ||
1483 | unsigned int csum_start, sh_len; | ||
1484 | int segment; | ||
1485 | |||
1486 | /* Prepare to egress the headers: set up header edesc. */ | ||
1487 | csum_start = skb_checksum_start_offset(skb); | ||
1488 | sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb); | ||
1489 | edesc_head.csum = 1; | ||
1490 | edesc_head.csum_start = csum_start; | ||
1491 | edesc_head.csum_dest = csum_start + skb->csum_offset; | ||
1492 | edesc_head.xfer_size = sh_len; | ||
1493 | |||
1494 | /* This is only used to specify the TLB. */ | ||
1495 | edesc_head.stack_idx = large_buffer_stack; | ||
1496 | edesc_body.stack_idx = large_buffer_stack; | ||
1497 | |||
1498 | /* Egress all the edescs. */ | ||
1499 | for (segment = 0; segment < sh->gso_segs; segment++) { | ||
1500 | void *va; | ||
1501 | unsigned char *buf; | ||
1502 | unsigned int p_used = 0; | ||
1503 | |||
1504 | /* Egress the header. */ | ||
1505 | buf = headers + (slot % EQUEUE_ENTRIES) * HEADER_BYTES + | ||
1506 | NET_IP_ALIGN; | ||
1507 | edesc_head.va = va_to_tile_io_addr(buf); | ||
1508 | gxio_mpipe_equeue_put_at(equeue, edesc_head, slot); | ||
1509 | slot++; | ||
1510 | |||
1511 | /* Egress the payload. */ | ||
1512 | while (p_used < p_len) { | ||
1513 | |||
1514 | /* Advance as needed. */ | ||
1515 | while (f_used >= f_size) { | ||
1516 | f_id++; | ||
1517 | f_size = sh->frags[f_id].size; | ||
1518 | f_used = 0; | ||
1519 | } | ||
1520 | |||
1521 | va = tile_net_frag_buf(&sh->frags[f_id]) + f_used; | ||
1522 | |||
1523 | /* Use bytes from the current fragment. */ | ||
1524 | n = p_len - p_used; | ||
1525 | if (n > f_size - f_used) | ||
1526 | n = f_size - f_used; | ||
1527 | f_used += n; | ||
1528 | p_used += n; | ||
1529 | |||
1530 | /* Egress a piece of the payload. */ | ||
1531 | edesc_body.va = va_to_tile_io_addr(va); | ||
1532 | edesc_body.xfer_size = n; | ||
1533 | edesc_body.bound = !(p_used < p_len); | ||
1534 | gxio_mpipe_equeue_put_at(equeue, edesc_body, slot); | ||
1535 | slot++; | ||
1536 | } | ||
1537 | |||
1538 | tx_packets++; | ||
1539 | tx_bytes += sh_len + p_len; | ||
1540 | |||
1541 | /* The last segment may be less than gso_size. */ | ||
1542 | data_len -= p_len; | ||
1543 | if (data_len < p_len) | ||
1544 | p_len = data_len; | ||
1545 | } | ||
1546 | |||
1547 | /* Update stats. */ | ||
1548 | tile_net_stats_add(tx_packets, &priv->stats.tx_packets); | ||
1549 | tile_net_stats_add(tx_bytes, &priv->stats.tx_bytes); | ||
1550 | } | ||
1551 | |||
1552 | /* Do "TSO" handling for egress. | ||
1553 | * | ||
1554 | * Normally drivers set NETIF_F_TSO only to support hardware TSO; | ||
1555 | * otherwise the stack uses scatter-gather to implement GSO in software. | ||
1556 | * On our testing, enabling GSO support (via NETIF_F_SG) drops network | ||
1557 | * performance down to around 7.5 Gbps on the 10G interfaces, although | ||
1558 | * also dropping cpu utilization way down, to under 8%. But | ||
1559 | * implementing "TSO" in the driver brings performance back up to line | ||
1560 | * rate, while dropping cpu usage even further, to less than 4%. In | ||
1561 | * practice, profiling of GSO shows that skb_segment() is what causes | ||
1562 | * the performance overheads; we benefit in the driver from using | ||
1563 | * preallocated memory to duplicate the TCP/IP headers. | ||
1564 | */ | ||
1565 | static int tile_net_tx_tso(struct sk_buff *skb, struct net_device *dev) | ||
1566 | { | ||
1567 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
1568 | struct tile_net_priv *priv = netdev_priv(dev); | ||
1569 | int channel = priv->echannel; | ||
1570 | struct tile_net_egress *egress = &egress_for_echannel[channel]; | ||
1571 | struct tile_net_comps *comps = info->comps_for_echannel[channel]; | ||
1572 | gxio_mpipe_equeue_t *equeue = egress->equeue; | ||
1573 | unsigned long irqflags; | ||
1574 | int num_edescs; | ||
1575 | s64 slot; | ||
1576 | |||
1577 | /* Determine how many mpipe edesc's are needed. */ | ||
1578 | num_edescs = tso_count_edescs(skb); | ||
1579 | |||
1580 | local_irq_save(irqflags); | ||
1581 | |||
1582 | /* Try to acquire a completion entry and an egress slot. */ | ||
1583 | slot = tile_net_equeue_try_reserve(dev, comps, equeue, num_edescs); | ||
1584 | if (slot < 0) { | ||
1585 | local_irq_restore(irqflags); | ||
1586 | return NETDEV_TX_BUSY; | ||
1587 | } | ||
1588 | |||
1589 | /* Set up copies of header data properly. */ | ||
1590 | tso_headers_prepare(skb, egress->headers, slot); | ||
1591 | |||
1592 | /* Actually pass the data to the network hardware. */ | ||
1593 | tso_egress(dev, equeue, skb, egress->headers, slot); | ||
1594 | |||
1595 | /* Add a completion record. */ | ||
1596 | add_comp(equeue, comps, slot + num_edescs - 1, skb); | ||
1597 | |||
1598 | local_irq_restore(irqflags); | ||
1599 | |||
1600 | /* Make sure the egress timer is scheduled. */ | ||
1601 | tile_net_schedule_egress_timer(); | ||
1602 | |||
1603 | return NETDEV_TX_OK; | ||
1604 | } | ||
1605 | |||
1606 | /* Analyze the body and frags for a transmit request. */ | ||
1607 | static unsigned int tile_net_tx_frags(struct frag *frags, | ||
1608 | struct sk_buff *skb, | ||
1609 | void *b_data, unsigned int b_len) | ||
1610 | { | ||
1611 | unsigned int i, n = 0; | ||
1612 | |||
1613 | struct skb_shared_info *sh = skb_shinfo(skb); | ||
1614 | |||
1615 | if (b_len != 0) { | ||
1616 | frags[n].buf = b_data; | ||
1617 | frags[n++].length = b_len; | ||
1618 | } | ||
1619 | |||
1620 | for (i = 0; i < sh->nr_frags; i++) { | ||
1621 | skb_frag_t *f = &sh->frags[i]; | ||
1622 | frags[n].buf = tile_net_frag_buf(f); | ||
1623 | frags[n++].length = skb_frag_size(f); | ||
1624 | } | ||
1625 | |||
1626 | return n; | ||
1627 | } | ||
1628 | |||
1629 | /* Help the kernel transmit a packet. */ | ||
1630 | static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) | ||
1631 | { | ||
1632 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
1633 | struct tile_net_priv *priv = netdev_priv(dev); | ||
1634 | struct tile_net_egress *egress = &egress_for_echannel[priv->echannel]; | ||
1635 | gxio_mpipe_equeue_t *equeue = egress->equeue; | ||
1636 | struct tile_net_comps *comps = | ||
1637 | info->comps_for_echannel[priv->echannel]; | ||
1638 | unsigned int len = skb->len; | ||
1639 | unsigned char *data = skb->data; | ||
1640 | unsigned int num_edescs; | ||
1641 | struct frag frags[MAX_FRAGS]; | ||
1642 | gxio_mpipe_edesc_t edescs[MAX_FRAGS]; | ||
1643 | unsigned long irqflags; | ||
1644 | gxio_mpipe_edesc_t edesc = { { 0 } }; | ||
1645 | unsigned int i; | ||
1646 | s64 slot; | ||
1647 | |||
1648 | if (skb_is_gso(skb)) | ||
1649 | return tile_net_tx_tso(skb, dev); | ||
1650 | |||
1651 | num_edescs = tile_net_tx_frags(frags, skb, data, skb_headlen(skb)); | ||
1652 | |||
1653 | /* This is only used to specify the TLB. */ | ||
1654 | edesc.stack_idx = large_buffer_stack; | ||
1655 | |||
1656 | /* Prepare the edescs. */ | ||
1657 | for (i = 0; i < num_edescs; i++) { | ||
1658 | edesc.xfer_size = frags[i].length; | ||
1659 | edesc.va = va_to_tile_io_addr(frags[i].buf); | ||
1660 | edescs[i] = edesc; | ||
1661 | } | ||
1662 | |||
1663 | /* Mark the final edesc. */ | ||
1664 | edescs[num_edescs - 1].bound = 1; | ||
1665 | |||
1666 | /* Add checksum info to the initial edesc, if needed. */ | ||
1667 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | ||
1668 | unsigned int csum_start = skb_checksum_start_offset(skb); | ||
1669 | edescs[0].csum = 1; | ||
1670 | edescs[0].csum_start = csum_start; | ||
1671 | edescs[0].csum_dest = csum_start + skb->csum_offset; | ||
1672 | } | ||
1673 | |||
1674 | local_irq_save(irqflags); | ||
1675 | |||
1676 | /* Try to acquire a completion entry and an egress slot. */ | ||
1677 | slot = tile_net_equeue_try_reserve(dev, comps, equeue, num_edescs); | ||
1678 | if (slot < 0) { | ||
1679 | local_irq_restore(irqflags); | ||
1680 | return NETDEV_TX_BUSY; | ||
1681 | } | ||
1682 | |||
1683 | for (i = 0; i < num_edescs; i++) | ||
1684 | gxio_mpipe_equeue_put_at(equeue, edescs[i], slot++); | ||
1685 | |||
1686 | /* Add a completion record. */ | ||
1687 | add_comp(equeue, comps, slot - 1, skb); | ||
1688 | |||
1689 | /* NOTE: Use ETH_ZLEN for short packets (e.g. 42 < 60). */ | ||
1690 | tile_net_stats_add(1, &priv->stats.tx_packets); | ||
1691 | tile_net_stats_add(max_t(unsigned int, len, ETH_ZLEN), | ||
1692 | &priv->stats.tx_bytes); | ||
1693 | |||
1694 | local_irq_restore(irqflags); | ||
1695 | |||
1696 | /* Make sure the egress timer is scheduled. */ | ||
1697 | tile_net_schedule_egress_timer(); | ||
1698 | |||
1699 | return NETDEV_TX_OK; | ||
1700 | } | ||
1701 | |||
1702 | /* Return subqueue id on this core (one per core). */ | ||
1703 | static u16 tile_net_select_queue(struct net_device *dev, struct sk_buff *skb) | ||
1704 | { | ||
1705 | return smp_processor_id(); | ||
1706 | } | ||
1707 | |||
1708 | /* Deal with a transmit timeout. */ | ||
1709 | static void tile_net_tx_timeout(struct net_device *dev) | ||
1710 | { | ||
1711 | int cpu; | ||
1712 | |||
1713 | for_each_online_cpu(cpu) | ||
1714 | netif_wake_subqueue(dev, cpu); | ||
1715 | } | ||
1716 | |||
1717 | /* Ioctl commands. */ | ||
1718 | static int tile_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | ||
1719 | { | ||
1720 | return -EOPNOTSUPP; | ||
1721 | } | ||
1722 | |||
1723 | /* Get system network statistics for device. */ | ||
1724 | static struct net_device_stats *tile_net_get_stats(struct net_device *dev) | ||
1725 | { | ||
1726 | struct tile_net_priv *priv = netdev_priv(dev); | ||
1727 | return &priv->stats; | ||
1728 | } | ||
1729 | |||
1730 | /* Change the MTU. */ | ||
1731 | static int tile_net_change_mtu(struct net_device *dev, int new_mtu) | ||
1732 | { | ||
1733 | if ((new_mtu < 68) || (new_mtu > 1500)) | ||
1734 | return -EINVAL; | ||
1735 | dev->mtu = new_mtu; | ||
1736 | return 0; | ||
1737 | } | ||
1738 | |||
1739 | /* Change the Ethernet address of the NIC. | ||
1740 | * | ||
1741 | * The hypervisor driver does not support changing MAC address. However, | ||
1742 | * the hardware does not do anything with the MAC address, so the address | ||
1743 | * which gets used on outgoing packets, and which is accepted on incoming | ||
1744 | * packets, is completely up to us. | ||
1745 | * | ||
1746 | * Returns 0 on success, negative on failure. | ||
1747 | */ | ||
1748 | static int tile_net_set_mac_address(struct net_device *dev, void *p) | ||
1749 | { | ||
1750 | struct sockaddr *addr = p; | ||
1751 | |||
1752 | if (!is_valid_ether_addr(addr->sa_data)) | ||
1753 | return -EINVAL; | ||
1754 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); | ||
1755 | return 0; | ||
1756 | } | ||
1757 | |||
1758 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1759 | /* Polling 'interrupt' - used by things like netconsole to send skbs | ||
1760 | * without having to re-enable interrupts. It's not called while | ||
1761 | * the interrupt routine is executing. | ||
1762 | */ | ||
1763 | static void tile_net_netpoll(struct net_device *dev) | ||
1764 | { | ||
1765 | disable_percpu_irq(ingress_irq); | ||
1766 | tile_net_handle_ingress_irq(ingress_irq, NULL); | ||
1767 | enable_percpu_irq(ingress_irq, 0); | ||
1768 | } | ||
1769 | #endif | ||
1770 | |||
1771 | static const struct net_device_ops tile_net_ops = { | ||
1772 | .ndo_open = tile_net_open, | ||
1773 | .ndo_stop = tile_net_stop, | ||
1774 | .ndo_start_xmit = tile_net_tx, | ||
1775 | .ndo_select_queue = tile_net_select_queue, | ||
1776 | .ndo_do_ioctl = tile_net_ioctl, | ||
1777 | .ndo_get_stats = tile_net_get_stats, | ||
1778 | .ndo_change_mtu = tile_net_change_mtu, | ||
1779 | .ndo_tx_timeout = tile_net_tx_timeout, | ||
1780 | .ndo_set_mac_address = tile_net_set_mac_address, | ||
1781 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1782 | .ndo_poll_controller = tile_net_netpoll, | ||
1783 | #endif | ||
1784 | }; | ||
1785 | |||
1786 | /* The setup function. | ||
1787 | * | ||
1788 | * This uses ether_setup() to assign various fields in dev, including | ||
1789 | * setting IFF_BROADCAST and IFF_MULTICAST, then sets some extra fields. | ||
1790 | */ | ||
1791 | static void tile_net_setup(struct net_device *dev) | ||
1792 | { | ||
1793 | ether_setup(dev); | ||
1794 | dev->netdev_ops = &tile_net_ops; | ||
1795 | dev->watchdog_timeo = TILE_NET_TIMEOUT; | ||
1796 | dev->features |= NETIF_F_LLTX; | ||
1797 | dev->features |= NETIF_F_HW_CSUM; | ||
1798 | dev->features |= NETIF_F_SG; | ||
1799 | dev->features |= NETIF_F_TSO; | ||
1800 | dev->mtu = 1500; | ||
1801 | } | ||
1802 | |||
1803 | /* Allocate the device structure, register the device, and obtain the | ||
1804 | * MAC address from the hypervisor. | ||
1805 | */ | ||
1806 | static void tile_net_dev_init(const char *name, const uint8_t *mac) | ||
1807 | { | ||
1808 | int ret; | ||
1809 | int i; | ||
1810 | int nz_addr = 0; | ||
1811 | struct net_device *dev; | ||
1812 | struct tile_net_priv *priv; | ||
1813 | |||
1814 | /* HACK: Ignore "loop" links. */ | ||
1815 | if (strncmp(name, "loop", 4) == 0) | ||
1816 | return; | ||
1817 | |||
1818 | /* Allocate the device structure. Normally, "name" is a | ||
1819 | * template, instantiated by register_netdev(), but not for us. | ||
1820 | */ | ||
1821 | dev = alloc_netdev_mqs(sizeof(*priv), name, tile_net_setup, | ||
1822 | NR_CPUS, 1); | ||
1823 | if (!dev) { | ||
1824 | pr_err("alloc_netdev_mqs(%s) failed\n", name); | ||
1825 | return; | ||
1826 | } | ||
1827 | |||
1828 | /* Initialize "priv". */ | ||
1829 | priv = netdev_priv(dev); | ||
1830 | memset(priv, 0, sizeof(*priv)); | ||
1831 | priv->dev = dev; | ||
1832 | priv->channel = -1; | ||
1833 | priv->loopify_channel = -1; | ||
1834 | priv->echannel = -1; | ||
1835 | |||
1836 | /* Get the MAC address and set it in the device struct; this must | ||
1837 | * be done before the device is opened. If the MAC is all zeroes, | ||
1838 | * we use a random address, since we're probably on the simulator. | ||
1839 | */ | ||
1840 | for (i = 0; i < 6; i++) | ||
1841 | nz_addr |= mac[i]; | ||
1842 | |||
1843 | if (nz_addr) { | ||
1844 | memcpy(dev->dev_addr, mac, 6); | ||
1845 | dev->addr_len = 6; | ||
1846 | } else { | ||
1847 | random_ether_addr(dev->dev_addr); | ||
1848 | } | ||
1849 | |||
1850 | /* Register the network device. */ | ||
1851 | ret = register_netdev(dev); | ||
1852 | if (ret) { | ||
1853 | netdev_err(dev, "register_netdev failed %d\n", ret); | ||
1854 | free_netdev(dev); | ||
1855 | return; | ||
1856 | } | ||
1857 | } | ||
1858 | |||
1859 | /* Per-cpu module initialization. */ | ||
1860 | static void tile_net_init_module_percpu(void *unused) | ||
1861 | { | ||
1862 | struct tile_net_info *info = &__get_cpu_var(per_cpu_info); | ||
1863 | int my_cpu = smp_processor_id(); | ||
1864 | |||
1865 | info->has_iqueue = false; | ||
1866 | |||
1867 | info->my_cpu = my_cpu; | ||
1868 | |||
1869 | /* Initialize the egress timer. */ | ||
1870 | hrtimer_init(&info->egress_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); | ||
1871 | info->egress_timer.function = tile_net_handle_egress_timer; | ||
1872 | } | ||
1873 | |||
1874 | /* Module initialization. */ | ||
1875 | static int __init tile_net_init_module(void) | ||
1876 | { | ||
1877 | int i; | ||
1878 | char name[GXIO_MPIPE_LINK_NAME_LEN]; | ||
1879 | uint8_t mac[6]; | ||
1880 | |||
1881 | pr_info("Tilera Network Driver\n"); | ||
1882 | |||
1883 | mutex_init(&tile_net_devs_for_channel_mutex); | ||
1884 | |||
1885 | /* Initialize each CPU. */ | ||
1886 | on_each_cpu(tile_net_init_module_percpu, NULL, 1); | ||
1887 | |||
1888 | /* Find out what devices we have, and initialize them. */ | ||
1889 | for (i = 0; gxio_mpipe_link_enumerate_mac(i, name, mac) >= 0; i++) | ||
1890 | tile_net_dev_init(name, mac); | ||
1891 | |||
1892 | if (!network_cpus_init()) | ||
1893 | network_cpus_map = *cpu_online_mask; | ||
1894 | |||
1895 | return 0; | ||
1896 | } | ||
1897 | |||
1898 | module_init(tile_net_init_module); | ||
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 4ffcd57b011b..2857ab078aac 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h | |||
@@ -478,6 +478,7 @@ struct netvsc_device { | |||
478 | u32 nvsp_version; | 478 | u32 nvsp_version; |
479 | 479 | ||
480 | atomic_t num_outstanding_sends; | 480 | atomic_t num_outstanding_sends; |
481 | wait_queue_head_t wait_drain; | ||
481 | bool start_remove; | 482 | bool start_remove; |
482 | bool destroy; | 483 | bool destroy; |
483 | /* | 484 | /* |
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 8b919471472f..0c569831db5a 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
@@ -42,6 +42,7 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device) | |||
42 | if (!net_device) | 42 | if (!net_device) |
43 | return NULL; | 43 | return NULL; |
44 | 44 | ||
45 | init_waitqueue_head(&net_device->wait_drain); | ||
45 | net_device->start_remove = false; | 46 | net_device->start_remove = false; |
46 | net_device->destroy = false; | 47 | net_device->destroy = false; |
47 | net_device->dev = device; | 48 | net_device->dev = device; |
@@ -387,12 +388,8 @@ int netvsc_device_remove(struct hv_device *device) | |||
387 | spin_unlock_irqrestore(&device->channel->inbound_lock, flags); | 388 | spin_unlock_irqrestore(&device->channel->inbound_lock, flags); |
388 | 389 | ||
389 | /* Wait for all send completions */ | 390 | /* Wait for all send completions */ |
390 | while (atomic_read(&net_device->num_outstanding_sends)) { | 391 | wait_event(net_device->wait_drain, |
391 | dev_info(&device->device, | 392 | atomic_read(&net_device->num_outstanding_sends) == 0); |
392 | "waiting for %d requests to complete...\n", | ||
393 | atomic_read(&net_device->num_outstanding_sends)); | ||
394 | udelay(100); | ||
395 | } | ||
396 | 393 | ||
397 | netvsc_disconnect_vsp(net_device); | 394 | netvsc_disconnect_vsp(net_device); |
398 | 395 | ||
@@ -486,6 +483,9 @@ static void netvsc_send_completion(struct hv_device *device, | |||
486 | num_outstanding_sends = | 483 | num_outstanding_sends = |
487 | atomic_dec_return(&net_device->num_outstanding_sends); | 484 | atomic_dec_return(&net_device->num_outstanding_sends); |
488 | 485 | ||
486 | if (net_device->destroy && num_outstanding_sends == 0) | ||
487 | wake_up(&net_device->wait_drain); | ||
488 | |||
489 | if (netif_queue_stopped(ndev) && !net_device->start_remove && | 489 | if (netif_queue_stopped(ndev) && !net_device->start_remove && |
490 | (hv_ringbuf_avail_percent(&device->channel->outbound) | 490 | (hv_ringbuf_avail_percent(&device->channel->outbound) |
491 | > RING_AVAIL_PERCENT_HIWATER || | 491 | > RING_AVAIL_PERCENT_HIWATER || |
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index 5ac46f5226f3..47f8e8939266 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c | |||
@@ -41,6 +41,8 @@ MODULE_LICENSE("GPL"); | |||
41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ | 41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ |
42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ | 42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ |
43 | #define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */ | 43 | #define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */ |
44 | #define IP101A_G_IRQ_PIN_USED (1<<15) /* INTR pin used */ | ||
45 | #define IP101A_G_IRQ_DEFAULT IP101A_G_IRQ_PIN_USED | ||
44 | 46 | ||
45 | static int ip175c_config_init(struct phy_device *phydev) | 47 | static int ip175c_config_init(struct phy_device *phydev) |
46 | { | 48 | { |
@@ -136,6 +138,11 @@ static int ip1001_config_init(struct phy_device *phydev) | |||
136 | if (c < 0) | 138 | if (c < 0) |
137 | return c; | 139 | return c; |
138 | 140 | ||
141 | /* INTR pin used: speed/link/duplex will cause an interrupt */ | ||
142 | c = phy_write(phydev, IP101A_G_IRQ_CONF_STATUS, IP101A_G_IRQ_DEFAULT); | ||
143 | if (c < 0) | ||
144 | return c; | ||
145 | |||
139 | if (phydev->interface == PHY_INTERFACE_MODE_RGMII) { | 146 | if (phydev->interface == PHY_INTERFACE_MODE_RGMII) { |
140 | /* Additional delay (2ns) used to adjust RX clock phase | 147 | /* Additional delay (2ns) used to adjust RX clock phase |
141 | * at RGMII interface */ | 148 | * at RGMII interface */ |
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c index 39ea0674dcde..5c120189ec86 100644 --- a/drivers/net/phy/mdio-mux.c +++ b/drivers/net/phy/mdio-mux.c | |||
@@ -46,7 +46,13 @@ static int mdio_mux_read(struct mii_bus *bus, int phy_id, int regnum) | |||
46 | struct mdio_mux_parent_bus *pb = cb->parent; | 46 | struct mdio_mux_parent_bus *pb = cb->parent; |
47 | int r; | 47 | int r; |
48 | 48 | ||
49 | mutex_lock(&pb->mii_bus->mdio_lock); | 49 | /* In theory multiple mdio_mux could be stacked, thus creating |
50 | * more than a single level of nesting. But in practice, | ||
51 | * SINGLE_DEPTH_NESTING will cover the vast majority of use | ||
52 | * cases. We use it, instead of trying to handle the general | ||
53 | * case. | ||
54 | */ | ||
55 | mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING); | ||
50 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); | 56 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); |
51 | if (r) | 57 | if (r) |
52 | goto out; | 58 | goto out; |
@@ -71,7 +77,7 @@ static int mdio_mux_write(struct mii_bus *bus, int phy_id, | |||
71 | 77 | ||
72 | int r; | 78 | int r; |
73 | 79 | ||
74 | mutex_lock(&pb->mii_bus->mdio_lock); | 80 | mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING); |
75 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); | 81 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); |
76 | if (r) | 82 | if (r) |
77 | goto out; | 83 | goto out; |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 683ef1ce5519..5061608f408c 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -96,7 +96,7 @@ static int of_mdio_bus_match(struct device *dev, void *mdio_bus_np) | |||
96 | } | 96 | } |
97 | /** | 97 | /** |
98 | * of_mdio_find_bus - Given an mii_bus node, find the mii_bus. | 98 | * of_mdio_find_bus - Given an mii_bus node, find the mii_bus. |
99 | * @mdio_np: Pointer to the mii_bus. | 99 | * @mdio_bus_np: Pointer to the mii_bus. |
100 | * | 100 | * |
101 | * Returns a pointer to the mii_bus, or NULL if none found. | 101 | * Returns a pointer to the mii_bus, or NULL if none found. |
102 | * | 102 | * |
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..a051cedd64bd 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,24 @@ 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_int2 = { | ||
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(2), /* interface whitelist bitmap */ | ||
356 | }; | ||
357 | |||
358 | static const struct driver_info qmi_wwan_force_int3 = { | ||
359 | .description = "Qualcomm WWAN/QMI device", | ||
360 | .flags = FLAG_WWAN, | ||
361 | .bind = qmi_wwan_bind_shared, | ||
362 | .unbind = qmi_wwan_unbind_shared, | ||
363 | .manage_power = qmi_wwan_manage_power, | ||
364 | .data = BIT(3), /* interface whitelist bitmap */ | ||
365 | }; | ||
366 | |||
368 | static const struct driver_info qmi_wwan_force_int4 = { | 367 | static const struct driver_info qmi_wwan_force_int4 = { |
369 | .description = "Qualcomm WWAN/QMI device", | 368 | .description = "Qualcomm WWAN/QMI device", |
370 | .flags = FLAG_WWAN, | 369 | .flags = FLAG_WWAN, |
@@ -390,16 +389,23 @@ static const struct driver_info qmi_wwan_force_int4 = { | |||
390 | static const struct driver_info qmi_wwan_sierra = { | 389 | static const struct driver_info qmi_wwan_sierra = { |
391 | .description = "Sierra Wireless wwan/QMI device", | 390 | .description = "Sierra Wireless wwan/QMI device", |
392 | .flags = FLAG_WWAN, | 391 | .flags = FLAG_WWAN, |
393 | .bind = qmi_wwan_bind_gobi, | 392 | .bind = qmi_wwan_bind_shared, |
394 | .unbind = qmi_wwan_unbind_shared, | 393 | .unbind = qmi_wwan_unbind_shared, |
395 | .manage_power = qmi_wwan_manage_power, | 394 | .manage_power = qmi_wwan_manage_power, |
396 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ | 395 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ |
397 | }; | 396 | }; |
398 | 397 | ||
399 | #define HUAWEI_VENDOR_ID 0x12D1 | 398 | #define HUAWEI_VENDOR_ID 0x12D1 |
399 | |||
400 | /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */ | ||
401 | #define QMI_GOBI1K_DEVICE(vend, prod) \ | ||
402 | USB_DEVICE(vend, prod), \ | ||
403 | .driver_info = (unsigned long)&qmi_wwan_force_int3 | ||
404 | |||
405 | /* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */ | ||
400 | #define QMI_GOBI_DEVICE(vend, prod) \ | 406 | #define QMI_GOBI_DEVICE(vend, prod) \ |
401 | USB_DEVICE(vend, prod), \ | 407 | USB_DEVICE(vend, prod), \ |
402 | .driver_info = (unsigned long)&qmi_wwan_gobi | 408 | .driver_info = (unsigned long)&qmi_wwan_force_int0 |
403 | 409 | ||
404 | static const struct usb_device_id products[] = { | 410 | static const struct usb_device_id products[] = { |
405 | { /* Huawei E392, E398 and possibly others sharing both device id and more... */ | 411 | { /* Huawei E392, E398 and possibly others sharing both device id and more... */ |
@@ -501,6 +507,15 @@ static const struct usb_device_id products[] = { | |||
501 | .bInterfaceProtocol = 0xff, | 507 | .bInterfaceProtocol = 0xff, |
502 | .driver_info = (unsigned long)&qmi_wwan_force_int4, | 508 | .driver_info = (unsigned long)&qmi_wwan_force_int4, |
503 | }, | 509 | }, |
510 | { /* ZTE MF60 */ | ||
511 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | ||
512 | .idVendor = 0x19d2, | ||
513 | .idProduct = 0x1402, | ||
514 | .bInterfaceClass = 0xff, | ||
515 | .bInterfaceSubClass = 0xff, | ||
516 | .bInterfaceProtocol = 0xff, | ||
517 | .driver_info = (unsigned long)&qmi_wwan_force_int2, | ||
518 | }, | ||
504 | { /* Sierra Wireless MC77xx in QMI mode */ | 519 | { /* Sierra Wireless MC77xx in QMI mode */ |
505 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | 520 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, |
506 | .idVendor = 0x1199, | 521 | .idVendor = 0x1199, |
@@ -510,20 +525,24 @@ static const struct usb_device_id products[] = { | |||
510 | .bInterfaceProtocol = 0xff, | 525 | .bInterfaceProtocol = 0xff, |
511 | .driver_info = (unsigned long)&qmi_wwan_sierra, | 526 | .driver_info = (unsigned long)&qmi_wwan_sierra, |
512 | }, | 527 | }, |
513 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 528 | |
514 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 529 | /* Gobi 1000 devices */ |
515 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | 530 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
516 | {QMI_GOBI_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ | 531 | {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
517 | {QMI_GOBI_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ | 532 | {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ |
518 | {QMI_GOBI_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ | 533 | {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ |
519 | {QMI_GOBI_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ | 534 | {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ |
520 | {QMI_GOBI_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ | 535 | {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ |
521 | {QMI_GOBI_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ | 536 | {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ |
522 | {QMI_GOBI_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ | 537 | {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ |
523 | {QMI_GOBI_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ | 538 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ |
524 | {QMI_GOBI_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ | 539 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ |
525 | {QMI_GOBI_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | 540 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ |
526 | {QMI_GOBI_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ | 541 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ |
542 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | ||
543 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ | ||
544 | |||
545 | /* Gobi 2000 and 3000 devices */ | ||
527 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 546 | {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
528 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ | 547 | {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ |
529 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | 548 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 3faef5670d1f..d75d1f56becf 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -946,7 +946,7 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
946 | } | 946 | } |
947 | 947 | ||
948 | static const u8 sierra_net_ifnum_list[] = { 7, 10, 11 }; | 948 | static const u8 sierra_net_ifnum_list[] = { 7, 10, 11 }; |
949 | static const struct sierra_net_info_data sierra_net_info_data_68A3 = { | 949 | static const struct sierra_net_info_data sierra_net_info_data_direct_ip = { |
950 | .rx_urb_size = 8 * 1024, | 950 | .rx_urb_size = 8 * 1024, |
951 | .whitelist = { | 951 | .whitelist = { |
952 | .infolen = ARRAY_SIZE(sierra_net_ifnum_list), | 952 | .infolen = ARRAY_SIZE(sierra_net_ifnum_list), |
@@ -954,7 +954,7 @@ static const struct sierra_net_info_data sierra_net_info_data_68A3 = { | |||
954 | } | 954 | } |
955 | }; | 955 | }; |
956 | 956 | ||
957 | static const struct driver_info sierra_net_info_68A3 = { | 957 | static const struct driver_info sierra_net_info_direct_ip = { |
958 | .description = "Sierra Wireless USB-to-WWAN Modem", | 958 | .description = "Sierra Wireless USB-to-WWAN Modem", |
959 | .flags = FLAG_WWAN | FLAG_SEND_ZLP, | 959 | .flags = FLAG_WWAN | FLAG_SEND_ZLP, |
960 | .bind = sierra_net_bind, | 960 | .bind = sierra_net_bind, |
@@ -962,12 +962,18 @@ static const struct driver_info sierra_net_info_68A3 = { | |||
962 | .status = sierra_net_status, | 962 | .status = sierra_net_status, |
963 | .rx_fixup = sierra_net_rx_fixup, | 963 | .rx_fixup = sierra_net_rx_fixup, |
964 | .tx_fixup = sierra_net_tx_fixup, | 964 | .tx_fixup = sierra_net_tx_fixup, |
965 | .data = (unsigned long)&sierra_net_info_data_68A3, | 965 | .data = (unsigned long)&sierra_net_info_data_direct_ip, |
966 | }; | 966 | }; |
967 | 967 | ||
968 | static const struct usb_device_id products[] = { | 968 | static const struct usb_device_id products[] = { |
969 | {USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless USB-to-WWAN modem */ | 969 | {USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless USB-to-WWAN modem */ |
970 | .driver_info = (unsigned long) &sierra_net_info_68A3}, | 970 | .driver_info = (unsigned long) &sierra_net_info_direct_ip}, |
971 | {USB_DEVICE(0x0F3D, 0x68A3), /* AT&T Direct IP modem */ | ||
972 | .driver_info = (unsigned long) &sierra_net_info_direct_ip}, | ||
973 | {USB_DEVICE(0x1199, 0x68AA), /* Sierra Wireless Direct IP LTE modem */ | ||
974 | .driver_info = (unsigned long) &sierra_net_info_direct_ip}, | ||
975 | {USB_DEVICE(0x0F3D, 0x68AA), /* AT&T Direct IP LTE modem */ | ||
976 | .driver_info = (unsigned long) &sierra_net_info_direct_ip}, | ||
971 | 977 | ||
972 | {}, /* last item */ | 978 | {}, /* last item */ |
973 | }; | 979 | }; |
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/virtio_net.c b/drivers/net/virtio_net.c index 5214b1eceb95..f18149ae2588 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -42,7 +42,8 @@ module_param(gso, bool, 0444); | |||
42 | #define VIRTNET_DRIVER_VERSION "1.0.0" | 42 | #define VIRTNET_DRIVER_VERSION "1.0.0" |
43 | 43 | ||
44 | struct virtnet_stats { | 44 | struct virtnet_stats { |
45 | struct u64_stats_sync syncp; | 45 | struct u64_stats_sync tx_syncp; |
46 | struct u64_stats_sync rx_syncp; | ||
46 | u64 tx_bytes; | 47 | u64 tx_bytes; |
47 | u64 tx_packets; | 48 | u64 tx_packets; |
48 | 49 | ||
@@ -300,10 +301,10 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len) | |||
300 | 301 | ||
301 | hdr = skb_vnet_hdr(skb); | 302 | hdr = skb_vnet_hdr(skb); |
302 | 303 | ||
303 | u64_stats_update_begin(&stats->syncp); | 304 | u64_stats_update_begin(&stats->rx_syncp); |
304 | stats->rx_bytes += skb->len; | 305 | stats->rx_bytes += skb->len; |
305 | stats->rx_packets++; | 306 | stats->rx_packets++; |
306 | u64_stats_update_end(&stats->syncp); | 307 | u64_stats_update_end(&stats->rx_syncp); |
307 | 308 | ||
308 | if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { | 309 | if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { |
309 | pr_debug("Needs csum!\n"); | 310 | pr_debug("Needs csum!\n"); |
@@ -565,10 +566,10 @@ static unsigned int free_old_xmit_skbs(struct virtnet_info *vi) | |||
565 | while ((skb = virtqueue_get_buf(vi->svq, &len)) != NULL) { | 566 | while ((skb = virtqueue_get_buf(vi->svq, &len)) != NULL) { |
566 | pr_debug("Sent skb %p\n", skb); | 567 | pr_debug("Sent skb %p\n", skb); |
567 | 568 | ||
568 | u64_stats_update_begin(&stats->syncp); | 569 | u64_stats_update_begin(&stats->tx_syncp); |
569 | stats->tx_bytes += skb->len; | 570 | stats->tx_bytes += skb->len; |
570 | stats->tx_packets++; | 571 | stats->tx_packets++; |
571 | u64_stats_update_end(&stats->syncp); | 572 | u64_stats_update_end(&stats->tx_syncp); |
572 | 573 | ||
573 | tot_sgs += skb_vnet_hdr(skb)->num_sg; | 574 | tot_sgs += skb_vnet_hdr(skb)->num_sg; |
574 | dev_kfree_skb_any(skb); | 575 | dev_kfree_skb_any(skb); |
@@ -703,12 +704,16 @@ static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev, | |||
703 | u64 tpackets, tbytes, rpackets, rbytes; | 704 | u64 tpackets, tbytes, rpackets, rbytes; |
704 | 705 | ||
705 | do { | 706 | do { |
706 | start = u64_stats_fetch_begin(&stats->syncp); | 707 | start = u64_stats_fetch_begin(&stats->tx_syncp); |
707 | tpackets = stats->tx_packets; | 708 | tpackets = stats->tx_packets; |
708 | tbytes = stats->tx_bytes; | 709 | tbytes = stats->tx_bytes; |
710 | } while (u64_stats_fetch_retry(&stats->tx_syncp, start)); | ||
711 | |||
712 | do { | ||
713 | start = u64_stats_fetch_begin(&stats->rx_syncp); | ||
709 | rpackets = stats->rx_packets; | 714 | rpackets = stats->rx_packets; |
710 | rbytes = stats->rx_bytes; | 715 | rbytes = stats->rx_bytes; |
711 | } while (u64_stats_fetch_retry(&stats->syncp, start)); | 716 | } while (u64_stats_fetch_retry(&stats->rx_syncp, start)); |
712 | 717 | ||
713 | tot->rx_packets += rpackets; | 718 | tot->rx_packets += rpackets; |
714 | tot->tx_packets += tpackets; | 719 | tot->tx_packets += tpackets; |
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/b43.h b/drivers/net/wireless/b43/b43.h index 67c13af6f206..c06b6cb5c91e 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -877,6 +877,10 @@ struct b43_wl { | |||
877 | * from the mac80211 subsystem. */ | 877 | * from the mac80211 subsystem. */ |
878 | u16 mac80211_initially_registered_queues; | 878 | u16 mac80211_initially_registered_queues; |
879 | 879 | ||
880 | /* Set this if we call ieee80211_register_hw() and check if we call | ||
881 | * ieee80211_unregister_hw(). */ | ||
882 | bool hw_registred; | ||
883 | |||
880 | /* We can only have one operating interface (802.11 core) | 884 | /* We can only have one operating interface (802.11 core) |
881 | * at a time. General information about this interface follows. | 885 | * at a time. General information about this interface follows. |
882 | */ | 886 | */ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 5a39b226b2e3..1b988f26bdf1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -2437,6 +2437,7 @@ start_ieee80211: | |||
2437 | err = ieee80211_register_hw(wl->hw); | 2437 | err = ieee80211_register_hw(wl->hw); |
2438 | if (err) | 2438 | if (err) |
2439 | goto err_one_core_detach; | 2439 | goto err_one_core_detach; |
2440 | wl->hw_registred = true; | ||
2440 | b43_leds_register(wl->current_dev); | 2441 | b43_leds_register(wl->current_dev); |
2441 | goto out; | 2442 | goto out; |
2442 | 2443 | ||
@@ -3766,7 +3767,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan) | |||
3766 | if (prev_status >= B43_STAT_STARTED) { | 3767 | if (prev_status >= B43_STAT_STARTED) { |
3767 | err = b43_wireless_core_start(up_dev); | 3768 | err = b43_wireless_core_start(up_dev); |
3768 | if (err) { | 3769 | if (err) { |
3769 | b43err(wl, "Fatal: Coult not start device for " | 3770 | b43err(wl, "Fatal: Could not start device for " |
3770 | "selected %s-GHz band\n", | 3771 | "selected %s-GHz band\n", |
3771 | band_to_string(chan->band)); | 3772 | band_to_string(chan->band)); |
3772 | b43_wireless_core_exit(up_dev); | 3773 | b43_wireless_core_exit(up_dev); |
@@ -5299,6 +5300,7 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev) | |||
5299 | 5300 | ||
5300 | hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1; | 5301 | hw->queues = modparam_qos ? B43_QOS_QUEUE_NUM : 1; |
5301 | wl->mac80211_initially_registered_queues = hw->queues; | 5302 | wl->mac80211_initially_registered_queues = hw->queues; |
5303 | wl->hw_registred = false; | ||
5302 | hw->max_rates = 2; | 5304 | hw->max_rates = 2; |
5303 | SET_IEEE80211_DEV(hw, dev->dev); | 5305 | SET_IEEE80211_DEV(hw, dev->dev); |
5304 | if (is_valid_ether_addr(sprom->et1mac)) | 5306 | if (is_valid_ether_addr(sprom->et1mac)) |
@@ -5370,12 +5372,15 @@ static void b43_bcma_remove(struct bcma_device *core) | |||
5370 | * as the ieee80211 unreg will destroy the workqueue. */ | 5372 | * as the ieee80211 unreg will destroy the workqueue. */ |
5371 | cancel_work_sync(&wldev->restart_work); | 5373 | cancel_work_sync(&wldev->restart_work); |
5372 | 5374 | ||
5373 | /* Restore the queues count before unregistering, because firmware detect | 5375 | B43_WARN_ON(!wl); |
5374 | * might have modified it. Restoring is important, so the networking | 5376 | if (wl->current_dev == wldev && wl->hw_registred) { |
5375 | * stack can properly free resources. */ | 5377 | /* Restore the queues count before unregistering, because firmware detect |
5376 | wl->hw->queues = wl->mac80211_initially_registered_queues; | 5378 | * might have modified it. Restoring is important, so the networking |
5377 | b43_leds_stop(wldev); | 5379 | * stack can properly free resources. */ |
5378 | ieee80211_unregister_hw(wl->hw); | 5380 | wl->hw->queues = wl->mac80211_initially_registered_queues; |
5381 | b43_leds_stop(wldev); | ||
5382 | ieee80211_unregister_hw(wl->hw); | ||
5383 | } | ||
5379 | 5384 | ||
5380 | b43_one_core_detach(wldev->dev); | 5385 | b43_one_core_detach(wldev->dev); |
5381 | 5386 | ||
@@ -5446,7 +5451,7 @@ static void b43_ssb_remove(struct ssb_device *sdev) | |||
5446 | cancel_work_sync(&wldev->restart_work); | 5451 | cancel_work_sync(&wldev->restart_work); |
5447 | 5452 | ||
5448 | B43_WARN_ON(!wl); | 5453 | B43_WARN_ON(!wl); |
5449 | if (wl->current_dev == wldev) { | 5454 | if (wl->current_dev == wldev && wl->hw_registred) { |
5450 | /* Restore the queues count before unregistering, because firmware detect | 5455 | /* Restore the queues count before unregistering, because firmware detect |
5451 | * might have modified it. Restoring is important, so the networking | 5456 | * might have modified it. Restoring is important, so the networking |
5452 | * stack can properly free resources. */ | 5457 | * stack can properly free resources. */ |
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index f1f8bd09bd87..c8baf020c20f 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
@@ -1072,7 +1072,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1072 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); | 1072 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); |
1073 | /* create a bounce buffer in zone_dma on mapping failure. */ | 1073 | /* create a bounce buffer in zone_dma on mapping failure. */ |
1074 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { | 1074 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { |
1075 | bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); | 1075 | bounce_skb = alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); |
1076 | if (!bounce_skb) { | 1076 | if (!bounce_skb) { |
1077 | ring->current_slot = old_top_slot; | 1077 | ring->current_slot = old_top_slot; |
1078 | ring->used_slots = old_used_slots; | 1078 | ring->used_slots = old_used_slots; |
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/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c index e2480d196276..8e7e6928c936 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | |||
@@ -89,9 +89,9 @@ int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev) | |||
89 | data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1; | 89 | data |= 1 << SDIO_FUNC_1 | 1 << SDIO_FUNC_2 | 1; |
90 | brcmf_sdio_regwb(sdiodev, SDIO_CCCR_IENx, data, &ret); | 90 | brcmf_sdio_regwb(sdiodev, SDIO_CCCR_IENx, data, &ret); |
91 | 91 | ||
92 | /* redirect, configure ane enable io for interrupt signal */ | 92 | /* redirect, configure and enable io for interrupt signal */ |
93 | data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE; | 93 | data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE; |
94 | if (sdiodev->irq_flags | IRQF_TRIGGER_HIGH) | 94 | if (sdiodev->irq_flags & IRQF_TRIGGER_HIGH) |
95 | data |= SDIO_SEPINT_ACT_HI; | 95 | data |= SDIO_SEPINT_ACT_HI; |
96 | brcmf_sdio_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret); | 96 | brcmf_sdio_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret); |
97 | 97 | ||
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 9cfae0c08707..95aa8e1683ec 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -1903,14 +1903,6 @@ static void ipw2100_down(struct ipw2100_priv *priv) | |||
1903 | netif_stop_queue(priv->net_dev); | 1903 | netif_stop_queue(priv->net_dev); |
1904 | } | 1904 | } |
1905 | 1905 | ||
1906 | /* Called by register_netdev() */ | ||
1907 | static int ipw2100_net_init(struct net_device *dev) | ||
1908 | { | ||
1909 | struct ipw2100_priv *priv = libipw_priv(dev); | ||
1910 | |||
1911 | return ipw2100_up(priv, 1); | ||
1912 | } | ||
1913 | |||
1914 | static int ipw2100_wdev_init(struct net_device *dev) | 1906 | static int ipw2100_wdev_init(struct net_device *dev) |
1915 | { | 1907 | { |
1916 | struct ipw2100_priv *priv = libipw_priv(dev); | 1908 | struct ipw2100_priv *priv = libipw_priv(dev); |
@@ -6087,7 +6079,6 @@ static const struct net_device_ops ipw2100_netdev_ops = { | |||
6087 | .ndo_stop = ipw2100_close, | 6079 | .ndo_stop = ipw2100_close, |
6088 | .ndo_start_xmit = libipw_xmit, | 6080 | .ndo_start_xmit = libipw_xmit, |
6089 | .ndo_change_mtu = libipw_change_mtu, | 6081 | .ndo_change_mtu = libipw_change_mtu, |
6090 | .ndo_init = ipw2100_net_init, | ||
6091 | .ndo_tx_timeout = ipw2100_tx_timeout, | 6082 | .ndo_tx_timeout = ipw2100_tx_timeout, |
6092 | .ndo_set_mac_address = ipw2100_set_address, | 6083 | .ndo_set_mac_address = ipw2100_set_address, |
6093 | .ndo_validate_addr = eth_validate_addr, | 6084 | .ndo_validate_addr = eth_validate_addr, |
@@ -6329,6 +6320,10 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6329 | printk(KERN_INFO DRV_NAME | 6320 | printk(KERN_INFO DRV_NAME |
6330 | ": Detected Intel PRO/Wireless 2100 Network Connection\n"); | 6321 | ": Detected Intel PRO/Wireless 2100 Network Connection\n"); |
6331 | 6322 | ||
6323 | err = ipw2100_up(priv, 1); | ||
6324 | if (err) | ||
6325 | goto fail; | ||
6326 | |||
6332 | err = ipw2100_wdev_init(dev); | 6327 | err = ipw2100_wdev_init(dev); |
6333 | if (err) | 6328 | if (err) |
6334 | goto fail; | 6329 | goto fail; |
@@ -6338,12 +6333,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
6338 | * network device we would call ipw2100_up. This introduced a race | 6333 | * network device we would call ipw2100_up. This introduced a race |
6339 | * condition with newer hotplug configurations (network was coming | 6334 | * condition with newer hotplug configurations (network was coming |
6340 | * up and making calls before the device was initialized). | 6335 | * up and making calls before the device was initialized). |
6341 | * | 6336 | */ |
6342 | * If we called ipw2100_up before we registered the device, then the | ||
6343 | * device name wasn't registered. So, we instead use the net_dev->init | ||
6344 | * member to call a function that then just turns and calls ipw2100_up. | ||
6345 | * net_dev->init is called after name allocation but before the | ||
6346 | * notifier chain is called */ | ||
6347 | err = register_netdev(dev); | 6337 | err = register_netdev(dev); |
6348 | if (err) { | 6338 | if (err) { |
6349 | printk(KERN_WARNING DRV_NAME | 6339 | printk(KERN_WARNING DRV_NAME |
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index 509301a5e7e2..ff5d689e13f3 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -3405,7 +3405,7 @@ il4965_remove_dynamic_key(struct il_priv *il, | |||
3405 | return 0; | 3405 | return 0; |
3406 | } | 3406 | } |
3407 | 3407 | ||
3408 | if (il->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) { | 3408 | if (il->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_INVALID) { |
3409 | IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx, | 3409 | IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx, |
3410 | key_flags); | 3410 | key_flags); |
3411 | spin_unlock_irqrestore(&il->sta_lock, flags); | 3411 | spin_unlock_irqrestore(&il->sta_lock, flags); |
@@ -3420,7 +3420,7 @@ il4965_remove_dynamic_key(struct il_priv *il, | |||
3420 | memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo)); | 3420 | memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo)); |
3421 | il->stations[sta_id].sta.key.key_flags = | 3421 | il->stations[sta_id].sta.key.key_flags = |
3422 | STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; | 3422 | STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; |
3423 | il->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET; | 3423 | il->stations[sta_id].sta.key.key_offset = keyconf->hw_key_idx; |
3424 | il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 3424 | il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
3425 | il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 3425 | il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
3426 | 3426 | ||
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index cbf2dc18341f..5d4807c2b56d 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -4767,14 +4767,12 @@ il_bg_watchdog(unsigned long data) | |||
4767 | return; | 4767 | return; |
4768 | 4768 | ||
4769 | /* monitor and check for other stuck queues */ | 4769 | /* monitor and check for other stuck queues */ |
4770 | if (il_is_any_associated(il)) { | 4770 | for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) { |
4771 | for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) { | 4771 | /* skip as we already checked the command queue */ |
4772 | /* skip as we already checked the command queue */ | 4772 | if (cnt == il->cmd_queue) |
4773 | if (cnt == il->cmd_queue) | 4773 | continue; |
4774 | continue; | 4774 | if (il_check_stuck_queue(il, cnt)) |
4775 | if (il_check_stuck_queue(il, cnt)) | 4775 | return; |
4776 | return; | ||
4777 | } | ||
4778 | } | 4776 | } |
4779 | 4777 | ||
4780 | mod_timer(&il->watchdog, | 4778 | mod_timer(&il->watchdog, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 19f7ee84ae89..e5e8ada4aaf6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -35,17 +35,20 @@ | |||
35 | #define IWL6000_UCODE_API_MAX 6 | 35 | #define IWL6000_UCODE_API_MAX 6 |
36 | #define IWL6050_UCODE_API_MAX 5 | 36 | #define IWL6050_UCODE_API_MAX 5 |
37 | #define IWL6000G2_UCODE_API_MAX 6 | 37 | #define IWL6000G2_UCODE_API_MAX 6 |
38 | #define IWL6035_UCODE_API_MAX 6 | ||
38 | 39 | ||
39 | /* Oldest version we won't warn about */ | 40 | /* Oldest version we won't warn about */ |
40 | #define IWL6000_UCODE_API_OK 4 | 41 | #define IWL6000_UCODE_API_OK 4 |
41 | #define IWL6000G2_UCODE_API_OK 5 | 42 | #define IWL6000G2_UCODE_API_OK 5 |
42 | #define IWL6050_UCODE_API_OK 5 | 43 | #define IWL6050_UCODE_API_OK 5 |
43 | #define IWL6000G2B_UCODE_API_OK 6 | 44 | #define IWL6000G2B_UCODE_API_OK 6 |
45 | #define IWL6035_UCODE_API_OK 6 | ||
44 | 46 | ||
45 | /* Lowest firmware API version supported */ | 47 | /* Lowest firmware API version supported */ |
46 | #define IWL6000_UCODE_API_MIN 4 | 48 | #define IWL6000_UCODE_API_MIN 4 |
47 | #define IWL6050_UCODE_API_MIN 4 | 49 | #define IWL6050_UCODE_API_MIN 4 |
48 | #define IWL6000G2_UCODE_API_MIN 4 | 50 | #define IWL6000G2_UCODE_API_MIN 5 |
51 | #define IWL6035_UCODE_API_MIN 6 | ||
49 | 52 | ||
50 | /* EEPROM versions */ | 53 | /* EEPROM versions */ |
51 | #define EEPROM_6000_TX_POWER_VERSION (4) | 54 | #define EEPROM_6000_TX_POWER_VERSION (4) |
@@ -227,9 +230,25 @@ const struct iwl_cfg iwl6030_2bg_cfg = { | |||
227 | IWL_DEVICE_6030, | 230 | IWL_DEVICE_6030, |
228 | }; | 231 | }; |
229 | 232 | ||
233 | #define IWL_DEVICE_6035 \ | ||
234 | .fw_name_pre = IWL6030_FW_PRE, \ | ||
235 | .ucode_api_max = IWL6035_UCODE_API_MAX, \ | ||
236 | .ucode_api_ok = IWL6035_UCODE_API_OK, \ | ||
237 | .ucode_api_min = IWL6035_UCODE_API_MIN, \ | ||
238 | .device_family = IWL_DEVICE_FAMILY_6030, \ | ||
239 | .max_inst_size = IWL60_RTC_INST_SIZE, \ | ||
240 | .max_data_size = IWL60_RTC_DATA_SIZE, \ | ||
241 | .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \ | ||
242 | .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ | ||
243 | .base_params = &iwl6000_g2_base_params, \ | ||
244 | .bt_params = &iwl6000_bt_params, \ | ||
245 | .need_temp_offset_calib = true, \ | ||
246 | .led_mode = IWL_LED_RF_STATE, \ | ||
247 | .adv_pm = true | ||
248 | |||
230 | const struct iwl_cfg iwl6035_2agn_cfg = { | 249 | const struct iwl_cfg iwl6035_2agn_cfg = { |
231 | .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN", | 250 | .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN", |
232 | IWL_DEVICE_6030, | 251 | IWL_DEVICE_6035, |
233 | .ht_params = &iwl6000_ht_params, | 252 | .ht_params = &iwl6000_ht_params, |
234 | }; | 253 | }; |
235 | 254 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c index aea07aab3c9e..eb6a8eaf42fc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c | |||
@@ -1267,7 +1267,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv, | |||
1267 | key_flags |= STA_KEY_MULTICAST_MSK; | 1267 | key_flags |= STA_KEY_MULTICAST_MSK; |
1268 | 1268 | ||
1269 | sta_cmd.key.key_flags = key_flags; | 1269 | sta_cmd.key.key_flags = key_flags; |
1270 | sta_cmd.key.key_offset = WEP_INVALID_OFFSET; | 1270 | sta_cmd.key.key_offset = keyconf->hw_key_idx; |
1271 | sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; | 1271 | sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK; |
1272 | sta_cmd.mode = STA_CONTROL_MODIFY_MSK; | 1272 | sta_cmd.mode = STA_CONTROL_MODIFY_MSK; |
1273 | 1273 | ||
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-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index d742900969ea..fac67a526a30 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c | |||
@@ -861,13 +861,18 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
861 | 861 | ||
862 | /* We have our copies now, allow OS release its copies */ | 862 | /* We have our copies now, allow OS release its copies */ |
863 | release_firmware(ucode_raw); | 863 | release_firmware(ucode_raw); |
864 | complete(&drv->request_firmware_complete); | ||
865 | 864 | ||
866 | drv->op_mode = iwl_dvm_ops.start(drv->trans, drv->cfg, &drv->fw); | 865 | drv->op_mode = iwl_dvm_ops.start(drv->trans, drv->cfg, &drv->fw); |
867 | 866 | ||
868 | if (!drv->op_mode) | 867 | if (!drv->op_mode) |
869 | goto out_free_fw; | 868 | goto out_unbind; |
870 | 869 | ||
870 | /* | ||
871 | * Complete the firmware request last so that | ||
872 | * a driver unbind (stop) doesn't run while we | ||
873 | * are doing the start() above. | ||
874 | */ | ||
875 | complete(&drv->request_firmware_complete); | ||
871 | return; | 876 | return; |
872 | 877 | ||
873 | try_again: | 878 | try_again: |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 50c58911e718..b8e2b223ac36 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -568,28 +568,28 @@ static int iwl_find_otp_image(struct iwl_trans *trans, | |||
568 | * iwl_get_max_txpower_avg - get the highest tx power from all chains. | 568 | * iwl_get_max_txpower_avg - get the highest tx power from all chains. |
569 | * find the highest tx power from all chains for the channel | 569 | * find the highest tx power from all chains for the channel |
570 | */ | 570 | */ |
571 | static s8 iwl_get_max_txpower_avg(const struct iwl_cfg *cfg, | 571 | static s8 iwl_get_max_txpower_avg(struct iwl_priv *priv, |
572 | struct iwl_eeprom_enhanced_txpwr *enhanced_txpower, | 572 | struct iwl_eeprom_enhanced_txpwr *enhanced_txpower, |
573 | int element, s8 *max_txpower_in_half_dbm) | 573 | int element, s8 *max_txpower_in_half_dbm) |
574 | { | 574 | { |
575 | s8 max_txpower_avg = 0; /* (dBm) */ | 575 | s8 max_txpower_avg = 0; /* (dBm) */ |
576 | 576 | ||
577 | /* Take the highest tx power from any valid chains */ | 577 | /* Take the highest tx power from any valid chains */ |
578 | if ((cfg->valid_tx_ant & ANT_A) && | 578 | if ((priv->hw_params.valid_tx_ant & ANT_A) && |
579 | (enhanced_txpower[element].chain_a_max > max_txpower_avg)) | 579 | (enhanced_txpower[element].chain_a_max > max_txpower_avg)) |
580 | max_txpower_avg = enhanced_txpower[element].chain_a_max; | 580 | max_txpower_avg = enhanced_txpower[element].chain_a_max; |
581 | if ((cfg->valid_tx_ant & ANT_B) && | 581 | if ((priv->hw_params.valid_tx_ant & ANT_B) && |
582 | (enhanced_txpower[element].chain_b_max > max_txpower_avg)) | 582 | (enhanced_txpower[element].chain_b_max > max_txpower_avg)) |
583 | max_txpower_avg = enhanced_txpower[element].chain_b_max; | 583 | max_txpower_avg = enhanced_txpower[element].chain_b_max; |
584 | if ((cfg->valid_tx_ant & ANT_C) && | 584 | if ((priv->hw_params.valid_tx_ant & ANT_C) && |
585 | (enhanced_txpower[element].chain_c_max > max_txpower_avg)) | 585 | (enhanced_txpower[element].chain_c_max > max_txpower_avg)) |
586 | max_txpower_avg = enhanced_txpower[element].chain_c_max; | 586 | max_txpower_avg = enhanced_txpower[element].chain_c_max; |
587 | if (((cfg->valid_tx_ant == ANT_AB) | | 587 | if (((priv->hw_params.valid_tx_ant == ANT_AB) | |
588 | (cfg->valid_tx_ant == ANT_BC) | | 588 | (priv->hw_params.valid_tx_ant == ANT_BC) | |
589 | (cfg->valid_tx_ant == ANT_AC)) && | 589 | (priv->hw_params.valid_tx_ant == ANT_AC)) && |
590 | (enhanced_txpower[element].mimo2_max > max_txpower_avg)) | 590 | (enhanced_txpower[element].mimo2_max > max_txpower_avg)) |
591 | max_txpower_avg = enhanced_txpower[element].mimo2_max; | 591 | max_txpower_avg = enhanced_txpower[element].mimo2_max; |
592 | if ((cfg->valid_tx_ant == ANT_ABC) && | 592 | if ((priv->hw_params.valid_tx_ant == ANT_ABC) && |
593 | (enhanced_txpower[element].mimo3_max > max_txpower_avg)) | 593 | (enhanced_txpower[element].mimo3_max > max_txpower_avg)) |
594 | max_txpower_avg = enhanced_txpower[element].mimo3_max; | 594 | max_txpower_avg = enhanced_txpower[element].mimo3_max; |
595 | 595 | ||
@@ -691,7 +691,7 @@ static void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
691 | ((txp->delta_20_in_40 & 0xf0) >> 4), | 691 | ((txp->delta_20_in_40 & 0xf0) >> 4), |
692 | (txp->delta_20_in_40 & 0x0f)); | 692 | (txp->delta_20_in_40 & 0x0f)); |
693 | 693 | ||
694 | max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx, | 694 | max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx, |
695 | &max_txp_avg_halfdbm); | 695 | &max_txp_avg_halfdbm); |
696 | 696 | ||
697 | /* | 697 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index ab2f4d7500a4..013680332f07 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -199,6 +199,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, | |||
199 | WIPHY_FLAG_DISABLE_BEACON_HINTS | | 199 | WIPHY_FLAG_DISABLE_BEACON_HINTS | |
200 | WIPHY_FLAG_IBSS_RSN; | 200 | WIPHY_FLAG_IBSS_RSN; |
201 | 201 | ||
202 | #ifdef CONFIG_PM_SLEEP | ||
202 | if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len && | 203 | if (priv->fw->img[IWL_UCODE_WOWLAN].sec[0].len && |
203 | priv->trans->ops->wowlan_suspend && | 204 | priv->trans->ops->wowlan_suspend && |
204 | device_can_wakeup(priv->trans->dev)) { | 205 | device_can_wakeup(priv->trans->dev)) { |
@@ -217,6 +218,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, | |||
217 | hw->wiphy->wowlan.pattern_max_len = | 218 | hw->wiphy->wowlan.pattern_max_len = |
218 | IWLAGN_WOWLAN_MAX_PATTERN_LEN; | 219 | IWLAGN_WOWLAN_MAX_PATTERN_LEN; |
219 | } | 220 | } |
221 | #endif | ||
220 | 222 | ||
221 | if (iwlwifi_mod_params.power_save) | 223 | if (iwlwifi_mod_params.power_save) |
222 | hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; | 224 | hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; |
@@ -249,6 +251,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, | |||
249 | ret = ieee80211_register_hw(priv->hw); | 251 | ret = ieee80211_register_hw(priv->hw); |
250 | if (ret) { | 252 | if (ret) { |
251 | IWL_ERR(priv, "Failed to register hw (error %d)\n", ret); | 253 | IWL_ERR(priv, "Failed to register hw (error %d)\n", ret); |
254 | iwl_leds_exit(priv); | ||
252 | return ret; | 255 | return ret; |
253 | } | 256 | } |
254 | priv->mac80211_registered = 1; | 257 | priv->mac80211_registered = 1; |
@@ -793,6 +796,18 @@ int iwlagn_mac_sta_state(struct ieee80211_hw *hw, | |||
793 | switch (op) { | 796 | switch (op) { |
794 | case ADD: | 797 | case ADD: |
795 | 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); | ||
796 | break; | 811 | break; |
797 | case REMOVE: | 812 | case REMOVE: |
798 | ret = iwlagn_mac_sta_remove(hw, vif, sta); | 813 | ret = iwlagn_mac_sta_remove(hw, vif, sta); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h index 3b1069290fa9..dfd54662e3e6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-prph.h +++ b/drivers/net/wireless/iwlwifi/iwl-prph.h | |||
@@ -224,6 +224,7 @@ | |||
224 | #define SCD_TXFACT (SCD_BASE + 0x10) | 224 | #define SCD_TXFACT (SCD_BASE + 0x10) |
225 | #define SCD_ACTIVE (SCD_BASE + 0x14) | 225 | #define SCD_ACTIVE (SCD_BASE + 0x14) |
226 | #define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) | 226 | #define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) |
227 | #define SCD_CHAINEXT_EN (SCD_BASE + 0x244) | ||
227 | #define SCD_AGGR_SEL (SCD_BASE + 0x248) | 228 | #define SCD_AGGR_SEL (SCD_BASE + 0x248) |
228 | #define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) | 229 | #define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) |
229 | 230 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index ec6fb395b84d..79c6b91417f9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1058,6 +1058,11 @@ static void iwl_tx_start(struct iwl_trans *trans) | |||
1058 | iwl_write_prph(trans, SCD_DRAM_BASE_ADDR, | 1058 | iwl_write_prph(trans, SCD_DRAM_BASE_ADDR, |
1059 | trans_pcie->scd_bc_tbls.dma >> 10); | 1059 | trans_pcie->scd_bc_tbls.dma >> 10); |
1060 | 1060 | ||
1061 | /* The chain extension of the SCD doesn't work well. This feature is | ||
1062 | * enabled by default by the HW, so we need to disable it manually. | ||
1063 | */ | ||
1064 | iwl_write_prph(trans, SCD_CHAINEXT_EN, 0); | ||
1065 | |||
1061 | /* Enable DMA channel */ | 1066 | /* Enable DMA channel */ |
1062 | for (chan = 0; chan < FH_TCSR_CHNL_NUM ; chan++) | 1067 | for (chan = 0; chan < FH_TCSR_CHNL_NUM ; chan++) |
1063 | iwl_write_direct32(trans, FH_TCSR_CHNL_TX_CONFIG_REG(chan), | 1068 | iwl_write_direct32(trans, FH_TCSR_CHNL_TX_CONFIG_REG(chan), |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index fb787df01666..a0b7cfd34685 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -1555,6 +1555,7 @@ static int hwsim_tx_info_frame_received_nl(struct sk_buff *skb_2, | |||
1555 | hdr = (struct ieee80211_hdr *) skb->data; | 1555 | hdr = (struct ieee80211_hdr *) skb->data; |
1556 | mac80211_hwsim_monitor_ack(data2->hw, hdr->addr2); | 1556 | mac80211_hwsim_monitor_ack(data2->hw, hdr->addr2); |
1557 | } | 1557 | } |
1558 | txi->flags |= IEEE80211_TX_STAT_ACK; | ||
1558 | } | 1559 | } |
1559 | ieee80211_tx_status_irqsafe(data2->hw, skb); | 1560 | ieee80211_tx_status_irqsafe(data2->hw, skb); |
1560 | return 0; | 1561 | return 0; |
@@ -1721,6 +1722,24 @@ static void hwsim_exit_netlink(void) | |||
1721 | "unregister family %i\n", ret); | 1722 | "unregister family %i\n", ret); |
1722 | } | 1723 | } |
1723 | 1724 | ||
1725 | static const struct ieee80211_iface_limit hwsim_if_limits[] = { | ||
1726 | { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) }, | ||
1727 | { .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) | | ||
1728 | BIT(NL80211_IFTYPE_P2P_CLIENT) | | ||
1729 | #ifdef CONFIG_MAC80211_MESH | ||
1730 | BIT(NL80211_IFTYPE_MESH_POINT) | | ||
1731 | #endif | ||
1732 | BIT(NL80211_IFTYPE_AP) | | ||
1733 | BIT(NL80211_IFTYPE_P2P_GO) }, | ||
1734 | }; | ||
1735 | |||
1736 | static const struct ieee80211_iface_combination hwsim_if_comb = { | ||
1737 | .limits = hwsim_if_limits, | ||
1738 | .n_limits = ARRAY_SIZE(hwsim_if_limits), | ||
1739 | .max_interfaces = 2048, | ||
1740 | .num_different_channels = 1, | ||
1741 | }; | ||
1742 | |||
1724 | static int __init init_mac80211_hwsim(void) | 1743 | static int __init init_mac80211_hwsim(void) |
1725 | { | 1744 | { |
1726 | int i, err = 0; | 1745 | int i, err = 0; |
@@ -1782,6 +1801,9 @@ static int __init init_mac80211_hwsim(void) | |||
1782 | hw->wiphy->n_addresses = 2; | 1801 | hw->wiphy->n_addresses = 2; |
1783 | hw->wiphy->addresses = data->addresses; | 1802 | hw->wiphy->addresses = data->addresses; |
1784 | 1803 | ||
1804 | hw->wiphy->iface_combinations = &hwsim_if_comb; | ||
1805 | hw->wiphy->n_iface_combinations = 1; | ||
1806 | |||
1785 | if (fake_hw_scan) { | 1807 | if (fake_hw_scan) { |
1786 | hw->wiphy->max_scan_ssids = 255; | 1808 | hw->wiphy->max_scan_ssids = 255; |
1787 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; | 1809 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; |
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 87671446e24b..5c7fd185373c 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -948,6 +948,20 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
948 | bss_cfg->ssid.ssid_len = params->ssid_len; | 948 | bss_cfg->ssid.ssid_len = params->ssid_len; |
949 | } | 949 | } |
950 | 950 | ||
951 | switch (params->hidden_ssid) { | ||
952 | case NL80211_HIDDEN_SSID_NOT_IN_USE: | ||
953 | bss_cfg->bcast_ssid_ctl = 1; | ||
954 | break; | ||
955 | case NL80211_HIDDEN_SSID_ZERO_LEN: | ||
956 | bss_cfg->bcast_ssid_ctl = 0; | ||
957 | break; | ||
958 | case NL80211_HIDDEN_SSID_ZERO_CONTENTS: | ||
959 | /* firmware doesn't support this type of hidden SSID */ | ||
960 | default: | ||
961 | kfree(bss_cfg); | ||
962 | return -EINVAL; | ||
963 | } | ||
964 | |||
951 | if (mwifiex_set_secure_params(priv, bss_cfg, params)) { | 965 | if (mwifiex_set_secure_params(priv, bss_cfg, params)) { |
952 | kfree(bss_cfg); | 966 | kfree(bss_cfg); |
953 | wiphy_err(wiphy, "Failed to parse secuirty parameters!\n"); | 967 | wiphy_err(wiphy, "Failed to parse secuirty parameters!\n"); |
@@ -1471,7 +1485,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1471 | struct wireless_dev *wdev; | 1485 | struct wireless_dev *wdev; |
1472 | 1486 | ||
1473 | if (!adapter) | 1487 | if (!adapter) |
1474 | return NULL; | 1488 | return ERR_PTR(-EFAULT); |
1475 | 1489 | ||
1476 | switch (type) { | 1490 | switch (type) { |
1477 | case NL80211_IFTYPE_UNSPECIFIED: | 1491 | case NL80211_IFTYPE_UNSPECIFIED: |
@@ -1481,12 +1495,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1481 | if (priv->bss_mode) { | 1495 | if (priv->bss_mode) { |
1482 | wiphy_err(wiphy, | 1496 | wiphy_err(wiphy, |
1483 | "cannot create multiple sta/adhoc ifaces\n"); | 1497 | "cannot create multiple sta/adhoc ifaces\n"); |
1484 | return NULL; | 1498 | return ERR_PTR(-EINVAL); |
1485 | } | 1499 | } |
1486 | 1500 | ||
1487 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1501 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
1488 | if (!wdev) | 1502 | if (!wdev) |
1489 | return NULL; | 1503 | return ERR_PTR(-ENOMEM); |
1490 | 1504 | ||
1491 | wdev->wiphy = wiphy; | 1505 | wdev->wiphy = wiphy; |
1492 | priv->wdev = wdev; | 1506 | priv->wdev = wdev; |
@@ -1509,12 +1523,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1509 | 1523 | ||
1510 | if (priv->bss_mode) { | 1524 | if (priv->bss_mode) { |
1511 | wiphy_err(wiphy, "Can't create multiple AP interfaces"); | 1525 | wiphy_err(wiphy, "Can't create multiple AP interfaces"); |
1512 | return NULL; | 1526 | return ERR_PTR(-EINVAL); |
1513 | } | 1527 | } |
1514 | 1528 | ||
1515 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); | 1529 | wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); |
1516 | if (!wdev) | 1530 | if (!wdev) |
1517 | return NULL; | 1531 | return ERR_PTR(-ENOMEM); |
1518 | 1532 | ||
1519 | priv->wdev = wdev; | 1533 | priv->wdev = wdev; |
1520 | wdev->wiphy = wiphy; | 1534 | wdev->wiphy = wiphy; |
@@ -1531,14 +1545,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1531 | break; | 1545 | break; |
1532 | default: | 1546 | default: |
1533 | wiphy_err(wiphy, "type not supported\n"); | 1547 | wiphy_err(wiphy, "type not supported\n"); |
1534 | return NULL; | 1548 | return ERR_PTR(-EINVAL); |
1535 | } | 1549 | } |
1536 | 1550 | ||
1537 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, | 1551 | dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, |
1538 | ether_setup, 1); | 1552 | ether_setup, 1); |
1539 | if (!dev) { | 1553 | if (!dev) { |
1540 | wiphy_err(wiphy, "no memory available for netdevice\n"); | 1554 | wiphy_err(wiphy, "no memory available for netdevice\n"); |
1541 | goto error; | 1555 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
1556 | return ERR_PTR(-ENOMEM); | ||
1542 | } | 1557 | } |
1543 | 1558 | ||
1544 | mwifiex_init_priv_params(priv, dev); | 1559 | mwifiex_init_priv_params(priv, dev); |
@@ -1569,7 +1584,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1569 | /* Register network device */ | 1584 | /* Register network device */ |
1570 | if (register_netdevice(dev)) { | 1585 | if (register_netdevice(dev)) { |
1571 | wiphy_err(wiphy, "cannot register virtual network device\n"); | 1586 | wiphy_err(wiphy, "cannot register virtual network device\n"); |
1572 | goto error; | 1587 | free_netdev(dev); |
1588 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | ||
1589 | return ERR_PTR(-EFAULT); | ||
1573 | } | 1590 | } |
1574 | 1591 | ||
1575 | sema_init(&priv->async_sem, 1); | 1592 | sema_init(&priv->async_sem, 1); |
@@ -1581,12 +1598,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1581 | mwifiex_dev_debugfs_init(priv); | 1598 | mwifiex_dev_debugfs_init(priv); |
1582 | #endif | 1599 | #endif |
1583 | return dev; | 1600 | return dev; |
1584 | error: | ||
1585 | if (dev && (dev->reg_state == NETREG_UNREGISTERED)) | ||
1586 | free_netdev(dev); | ||
1587 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | ||
1588 | |||
1589 | return NULL; | ||
1590 | } | 1601 | } |
1591 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); | 1602 | EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); |
1592 | 1603 | ||
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 9f674bbebe65..561452a5c818 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -122,6 +122,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { | |||
122 | #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42) | 122 | #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42) |
123 | #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44) | 123 | #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44) |
124 | #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45) | 124 | #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45) |
125 | #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48) | ||
125 | #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51) | 126 | #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51) |
126 | #define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60) | 127 | #define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60) |
127 | #define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64) | 128 | #define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64) |
@@ -1209,6 +1210,11 @@ struct host_cmd_tlv_ssid { | |||
1209 | u8 ssid[0]; | 1210 | u8 ssid[0]; |
1210 | } __packed; | 1211 | } __packed; |
1211 | 1212 | ||
1213 | struct host_cmd_tlv_bcast_ssid { | ||
1214 | struct host_cmd_tlv tlv; | ||
1215 | u8 bcast_ctl; | ||
1216 | } __packed; | ||
1217 | |||
1212 | struct host_cmd_tlv_beacon_period { | 1218 | struct host_cmd_tlv_beacon_period { |
1213 | struct host_cmd_tlv tlv; | 1219 | struct host_cmd_tlv tlv; |
1214 | __le16 period; | 1220 | __le16 period; |
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 76dfbc42a732..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; |
@@ -132,6 +143,7 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) | |||
132 | struct host_cmd_tlv_dtim_period *dtim_period; | 143 | struct host_cmd_tlv_dtim_period *dtim_period; |
133 | struct host_cmd_tlv_beacon_period *beacon_period; | 144 | struct host_cmd_tlv_beacon_period *beacon_period; |
134 | struct host_cmd_tlv_ssid *ssid; | 145 | struct host_cmd_tlv_ssid *ssid; |
146 | struct host_cmd_tlv_bcast_ssid *bcast_ssid; | ||
135 | struct host_cmd_tlv_channel_band *chan_band; | 147 | struct host_cmd_tlv_channel_band *chan_band; |
136 | struct host_cmd_tlv_frag_threshold *frag_threshold; | 148 | struct host_cmd_tlv_frag_threshold *frag_threshold; |
137 | struct host_cmd_tlv_rts_threshold *rts_threshold; | 149 | struct host_cmd_tlv_rts_threshold *rts_threshold; |
@@ -153,6 +165,14 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) | |||
153 | cmd_size += sizeof(struct host_cmd_tlv) + | 165 | cmd_size += sizeof(struct host_cmd_tlv) + |
154 | bss_cfg->ssid.ssid_len; | 166 | bss_cfg->ssid.ssid_len; |
155 | tlv += sizeof(struct host_cmd_tlv) + bss_cfg->ssid.ssid_len; | 167 | tlv += sizeof(struct host_cmd_tlv) + bss_cfg->ssid.ssid_len; |
168 | |||
169 | bcast_ssid = (struct host_cmd_tlv_bcast_ssid *)tlv; | ||
170 | bcast_ssid->tlv.type = cpu_to_le16(TLV_TYPE_UAP_BCAST_SSID); | ||
171 | bcast_ssid->tlv.len = | ||
172 | cpu_to_le16(sizeof(bcast_ssid->bcast_ctl)); | ||
173 | bcast_ssid->bcast_ctl = bss_cfg->bcast_ssid_ctl; | ||
174 | cmd_size += sizeof(struct host_cmd_tlv_bcast_ssid); | ||
175 | tlv += sizeof(struct host_cmd_tlv_bcast_ssid); | ||
156 | } | 176 | } |
157 | if (bss_cfg->channel && bss_cfg->channel <= MAX_CHANNEL_BAND_BG) { | 177 | if (bss_cfg->channel && bss_cfg->channel <= MAX_CHANNEL_BAND_BG) { |
158 | chan_band = (struct host_cmd_tlv_channel_band *)tlv; | 178 | chan_band = (struct host_cmd_tlv_channel_band *)tlv; |
@@ -416,6 +436,7 @@ int mwifiex_uap_set_channel(struct mwifiex_private *priv, int channel) | |||
416 | if (!bss_cfg) | 436 | if (!bss_cfg) |
417 | return -ENOMEM; | 437 | return -ENOMEM; |
418 | 438 | ||
439 | mwifiex_set_sys_config_invalid_data(bss_cfg); | ||
419 | bss_cfg->band_cfg = BAND_CONFIG_MANUAL; | 440 | bss_cfg->band_cfg = BAND_CONFIG_MANUAL; |
420 | bss_cfg->channel = channel; | 441 | bss_cfg->channel = channel; |
421 | 442 | ||
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/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index ca36cccaba31..8f754025b06e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -396,8 +396,7 @@ struct rt2x00_intf { | |||
396 | * for hardware which doesn't support hardware | 396 | * for hardware which doesn't support hardware |
397 | * sequence counting. | 397 | * sequence counting. |
398 | */ | 398 | */ |
399 | spinlock_t seqlock; | 399 | atomic_t seqno; |
400 | u16 seqno; | ||
401 | }; | 400 | }; |
402 | 401 | ||
403 | static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) | 402 | static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index b49773ef72f2..dd24b2663b5e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -277,7 +277,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
277 | else | 277 | else |
278 | rt2x00dev->intf_sta_count++; | 278 | rt2x00dev->intf_sta_count++; |
279 | 279 | ||
280 | spin_lock_init(&intf->seqlock); | ||
281 | mutex_init(&intf->beacon_skb_mutex); | 280 | mutex_init(&intf->beacon_skb_mutex); |
282 | intf->beacon = entry; | 281 | intf->beacon = entry; |
283 | 282 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 4c662eccf53c..2fd830103415 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -207,6 +207,7 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev, | |||
207 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 207 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
208 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 208 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
209 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | 209 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); |
210 | u16 seqno; | ||
210 | 211 | ||
211 | if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) | 212 | if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) |
212 | return; | 213 | return; |
@@ -238,15 +239,13 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev, | |||
238 | * sequence counting per-frame, since those will override the | 239 | * sequence counting per-frame, since those will override the |
239 | * sequence counter given by mac80211. | 240 | * sequence counter given by mac80211. |
240 | */ | 241 | */ |
241 | spin_lock(&intf->seqlock); | ||
242 | |||
243 | if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) | 242 | if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) |
244 | intf->seqno += 0x10; | 243 | seqno = atomic_add_return(0x10, &intf->seqno); |
245 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | 244 | else |
246 | hdr->seq_ctrl |= cpu_to_le16(intf->seqno); | 245 | seqno = atomic_read(&intf->seqno); |
247 | |||
248 | spin_unlock(&intf->seqlock); | ||
249 | 246 | ||
247 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
248 | hdr->seq_ctrl |= cpu_to_le16(seqno); | ||
250 | } | 249 | } |
251 | 250 | ||
252 | static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev, | 251 | static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index d357d1ed92f6..74ecc33fdd90 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -436,8 +436,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue) | |||
436 | case QID_RX: | 436 | case QID_RX: |
437 | if (!rt2x00queue_full(queue)) | 437 | if (!rt2x00queue_full(queue)) |
438 | rt2x00queue_for_each_entry(queue, | 438 | rt2x00queue_for_each_entry(queue, |
439 | Q_INDEX_DONE, | ||
440 | Q_INDEX, | 439 | Q_INDEX, |
440 | Q_INDEX_DONE, | ||
441 | NULL, | 441 | NULL, |
442 | rt2x00usb_kick_rx_entry); | 442 | rt2x00usb_kick_rx_entry); |
443 | break; | 443 | break; |
diff --git a/drivers/net/wireless/rtl818x/rtl8187/leds.c b/drivers/net/wireless/rtl818x/rtl8187/leds.c index 2e0de2f5f0f9..c2d5b495c179 100644 --- a/drivers/net/wireless/rtl818x/rtl8187/leds.c +++ b/drivers/net/wireless/rtl818x/rtl8187/leds.c | |||
@@ -117,7 +117,7 @@ static void rtl8187_led_brightness_set(struct led_classdev *led_dev, | |||
117 | radio_on = true; | 117 | radio_on = true; |
118 | } else if (radio_on) { | 118 | } else if (radio_on) { |
119 | radio_on = false; | 119 | radio_on = false; |
120 | cancel_delayed_work_sync(&priv->led_on); | 120 | cancel_delayed_work(&priv->led_on); |
121 | ieee80211_queue_delayed_work(hw, &priv->led_off, 0); | 121 | ieee80211_queue_delayed_work(hw, &priv->led_off, 0); |
122 | } | 122 | } |
123 | } else if (radio_on) { | 123 | } else if (radio_on) { |
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/platform.c b/drivers/of/platform.c index 343ad29e211c..e44f8c2d239d 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -317,10 +317,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l | |||
317 | for(; lookup->compatible != NULL; lookup++) { | 317 | for(; lookup->compatible != NULL; lookup++) { |
318 | if (!of_device_is_compatible(np, lookup->compatible)) | 318 | if (!of_device_is_compatible(np, lookup->compatible)) |
319 | continue; | 319 | continue; |
320 | if (of_address_to_resource(np, 0, &res)) | 320 | if (!of_address_to_resource(np, 0, &res)) |
321 | continue; | 321 | if (res.start != lookup->phys_addr) |
322 | if (res.start != lookup->phys_addr) | 322 | continue; |
323 | continue; | ||
324 | pr_debug("%s: devname=%s\n", np->full_name, lookup->name); | 323 | pr_debug("%s: devname=%s\n", np->full_name, lookup->name); |
325 | return lookup; | 324 | return lookup; |
326 | } | 325 | } |
@@ -462,4 +461,5 @@ int of_platform_populate(struct device_node *root, | |||
462 | of_node_put(root); | 461 | of_node_put(root); |
463 | return rc; | 462 | return rc; |
464 | } | 463 | } |
464 | EXPORT_SYMBOL_GPL(of_platform_populate); | ||
465 | #endif /* CONFIG_OF_ADDRESS */ | 465 | #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/pci/pci-driver.c b/drivers/pci/pci-driver.c index bf0cee629b60..099f46cd8e87 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -748,6 +748,18 @@ static int pci_pm_suspend_noirq(struct device *dev) | |||
748 | 748 | ||
749 | pci_pm_set_unknown_state(pci_dev); | 749 | pci_pm_set_unknown_state(pci_dev); |
750 | 750 | ||
751 | /* | ||
752 | * Some BIOSes from ASUS have a bug: If a USB EHCI host controller's | ||
753 | * PCI COMMAND register isn't 0, the BIOS assumes that the controller | ||
754 | * hasn't been quiesced and tries to turn it off. If the controller | ||
755 | * is already in D3, this can hang or cause memory corruption. | ||
756 | * | ||
757 | * Since the value of the COMMAND register doesn't matter once the | ||
758 | * device has been suspended, we can safely set it to 0 here. | ||
759 | */ | ||
760 | if (pci_dev->class == PCI_CLASS_SERIAL_USB_EHCI) | ||
761 | pci_write_config_word(pci_dev, PCI_COMMAND, 0); | ||
762 | |||
751 | return 0; | 763 | return 0; |
752 | } | 764 | } |
753 | 765 | ||
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index c3b331b74fa0..0cc053af70bd 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -61,7 +61,7 @@ static LIST_HEAD(pinctrl_maps); | |||
61 | list_for_each_entry(_maps_node_, &pinctrl_maps, node) \ | 61 | list_for_each_entry(_maps_node_, &pinctrl_maps, node) \ |
62 | for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \ | 62 | for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \ |
63 | _i_ < _maps_node_->num_maps; \ | 63 | _i_ < _maps_node_->num_maps; \ |
64 | i++, _map_ = &_maps_node_->maps[_i_]) | 64 | _i_++, _map_ = &_maps_node_->maps[_i_]) |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * pinctrl_provide_dummies() - indicate if pinctrl provides dummy state support | 67 | * pinctrl_provide_dummies() - indicate if pinctrl provides dummy state support |
diff --git a/drivers/pinctrl/pinctrl-imx.c b/drivers/pinctrl/pinctrl-imx.c index f6e7c670906c..90c837f469a6 100644 --- a/drivers/pinctrl/pinctrl-imx.c +++ b/drivers/pinctrl/pinctrl-imx.c | |||
@@ -27,16 +27,16 @@ | |||
27 | #include "core.h" | 27 | #include "core.h" |
28 | #include "pinctrl-imx.h" | 28 | #include "pinctrl-imx.h" |
29 | 29 | ||
30 | #define IMX_PMX_DUMP(info, p, m, c, n) \ | 30 | #define IMX_PMX_DUMP(info, p, m, c, n) \ |
31 | { \ | 31 | { \ |
32 | int i, j; \ | 32 | int i, j; \ |
33 | printk("Format: Pin Mux Config\n"); \ | 33 | printk(KERN_DEBUG "Format: Pin Mux Config\n"); \ |
34 | for (i = 0; i < n; i++) { \ | 34 | for (i = 0; i < n; i++) { \ |
35 | j = p[i]; \ | 35 | j = p[i]; \ |
36 | printk("%s %d 0x%lx\n", \ | 36 | printk(KERN_DEBUG "%s %d 0x%lx\n", \ |
37 | info->pins[j].name, \ | 37 | info->pins[j].name, \ |
38 | m[i], c[i]); \ | 38 | m[i], c[i]); \ |
39 | } \ | 39 | } \ |
40 | } | 40 | } |
41 | 41 | ||
42 | /* The bits in CONFIG cell defined in binding doc*/ | 42 | /* The bits in CONFIG cell defined in binding doc*/ |
@@ -173,8 +173,10 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
173 | 173 | ||
174 | /* create mux map */ | 174 | /* create mux map */ |
175 | parent = of_get_parent(np); | 175 | parent = of_get_parent(np); |
176 | if (!parent) | 176 | if (!parent) { |
177 | kfree(new_map); | ||
177 | return -EINVAL; | 178 | return -EINVAL; |
179 | } | ||
178 | new_map[0].type = PIN_MAP_TYPE_MUX_GROUP; | 180 | new_map[0].type = PIN_MAP_TYPE_MUX_GROUP; |
179 | new_map[0].data.mux.function = parent->name; | 181 | new_map[0].data.mux.function = parent->name; |
180 | new_map[0].data.mux.group = np->name; | 182 | new_map[0].data.mux.group = np->name; |
@@ -193,7 +195,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
193 | } | 195 | } |
194 | 196 | ||
195 | dev_dbg(pctldev->dev, "maps: function %s group %s num %d\n", | 197 | dev_dbg(pctldev->dev, "maps: function %s group %s num %d\n", |
196 | new_map->data.mux.function, new_map->data.mux.group, map_num); | 198 | (*map)->data.mux.function, (*map)->data.mux.group, map_num); |
197 | 199 | ||
198 | return 0; | 200 | return 0; |
199 | } | 201 | } |
@@ -201,10 +203,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
201 | static void imx_dt_free_map(struct pinctrl_dev *pctldev, | 203 | static void imx_dt_free_map(struct pinctrl_dev *pctldev, |
202 | struct pinctrl_map *map, unsigned num_maps) | 204 | struct pinctrl_map *map, unsigned num_maps) |
203 | { | 205 | { |
204 | int i; | 206 | kfree(map); |
205 | |||
206 | for (i = 0; i < num_maps; i++) | ||
207 | kfree(map); | ||
208 | } | 207 | } |
209 | 208 | ||
210 | static struct pinctrl_ops imx_pctrl_ops = { | 209 | static struct pinctrl_ops imx_pctrl_ops = { |
@@ -478,6 +477,7 @@ static int __devinit imx_pinctrl_parse_groups(struct device_node *np, | |||
478 | #ifdef DEBUG | 477 | #ifdef DEBUG |
479 | IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins); | 478 | IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins); |
480 | #endif | 479 | #endif |
480 | |||
481 | return 0; | 481 | return 0; |
482 | } | 482 | } |
483 | 483 | ||
diff --git a/drivers/pinctrl/pinctrl-imx6q.c b/drivers/pinctrl/pinctrl-imx6q.c index 7737d4d71a3c..e9bf71fbedca 100644 --- a/drivers/pinctrl/pinctrl-imx6q.c +++ b/drivers/pinctrl/pinctrl-imx6q.c | |||
@@ -1950,6 +1950,8 @@ static struct imx_pin_reg imx6q_pin_regs[] = { | |||
1950 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 5, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__GPIO_1_12 */ | 1950 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 5, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__GPIO_1_12 */ |
1951 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 6, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__SJC_DONE */ | 1951 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 6, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__SJC_DONE */ |
1952 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 7, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__ANATOP_TESTO_3 */ | 1952 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 7, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__ANATOP_TESTO_3 */ |
1953 | IMX_PIN_REG(MX6Q_PAD_ENET_RX_ER, 0x04EC, 0x01D8, 0, 0x0000, 0), /* MX6Q_PAD_ENET_RX_ER__ANATOP_USBOTG_ID */ | ||
1954 | IMX_PIN_REG(MX6Q_PAD_GPIO_1, 0x05F4, 0x0224, 3, 0x0000, 0), /* MX6Q_PAD_GPIO_1__ANATOP_USBOTG_ID */ | ||
1953 | }; | 1955 | }; |
1954 | 1956 | ||
1955 | /* Pad names for the pinmux subsystem */ | 1957 | /* Pad names for the pinmux subsystem */ |
diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c index 556e45a213eb..4ba4636b6a4a 100644 --- a/drivers/pinctrl/pinctrl-mxs.c +++ b/drivers/pinctrl/pinctrl-mxs.c | |||
@@ -107,8 +107,10 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
107 | 107 | ||
108 | /* Compose group name */ | 108 | /* Compose group name */ |
109 | group = kzalloc(length, GFP_KERNEL); | 109 | group = kzalloc(length, GFP_KERNEL); |
110 | if (!group) | 110 | if (!group) { |
111 | return -ENOMEM; | 111 | ret = -ENOMEM; |
112 | goto free; | ||
113 | } | ||
112 | snprintf(group, length, "%s.%d", np->name, reg); | 114 | snprintf(group, length, "%s.%d", np->name, reg); |
113 | new_map[i].data.mux.group = group; | 115 | new_map[i].data.mux.group = group; |
114 | i++; | 116 | i++; |
@@ -118,7 +120,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
118 | pconfig = kmemdup(&config, sizeof(config), GFP_KERNEL); | 120 | pconfig = kmemdup(&config, sizeof(config), GFP_KERNEL); |
119 | if (!pconfig) { | 121 | if (!pconfig) { |
120 | ret = -ENOMEM; | 122 | ret = -ENOMEM; |
121 | goto free; | 123 | goto free_group; |
122 | } | 124 | } |
123 | 125 | ||
124 | new_map[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; | 126 | new_map[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; |
@@ -133,6 +135,9 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
133 | 135 | ||
134 | return 0; | 136 | return 0; |
135 | 137 | ||
138 | free_group: | ||
139 | if (!purecfg) | ||
140 | kfree(group); | ||
136 | free: | 141 | free: |
137 | kfree(new_map); | 142 | kfree(new_map); |
138 | return ret; | 143 | return ret; |
@@ -511,6 +516,7 @@ int __devinit mxs_pinctrl_probe(struct platform_device *pdev, | |||
511 | return 0; | 516 | return 0; |
512 | 517 | ||
513 | err: | 518 | err: |
519 | platform_set_drvdata(pdev, NULL); | ||
514 | iounmap(d->base); | 520 | iounmap(d->base); |
515 | return ret; | 521 | return ret; |
516 | } | 522 | } |
@@ -520,6 +526,7 @@ int __devexit mxs_pinctrl_remove(struct platform_device *pdev) | |||
520 | { | 526 | { |
521 | struct mxs_pinctrl_data *d = platform_get_drvdata(pdev); | 527 | struct mxs_pinctrl_data *d = platform_get_drvdata(pdev); |
522 | 528 | ||
529 | platform_set_drvdata(pdev, NULL); | ||
523 | pinctrl_unregister(d->pctl); | 530 | pinctrl_unregister(d->pctl); |
524 | iounmap(d->base); | 531 | iounmap(d->base); |
525 | 532 | ||
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index b26395d16347..3e7e47d6b385 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -673,7 +673,7 @@ static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip, | |||
673 | * wakeup is anyhow controlled by the RIMSC and FIMSC registers. | 673 | * wakeup is anyhow controlled by the RIMSC and FIMSC registers. |
674 | */ | 674 | */ |
675 | if (nmk_chip->sleepmode && on) { | 675 | if (nmk_chip->sleepmode && on) { |
676 | __nmk_gpio_set_slpm(nmk_chip, gpio % nmk_chip->chip.base, | 676 | __nmk_gpio_set_slpm(nmk_chip, gpio % NMK_GPIO_PER_CHIP, |
677 | NMK_GPIO_SLPM_WAKEUP_ENABLE); | 677 | NMK_GPIO_SLPM_WAKEUP_ENABLE); |
678 | } | 678 | } |
679 | 679 | ||
@@ -1246,6 +1246,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) | |||
1246 | ret = PTR_ERR(clk); | 1246 | ret = PTR_ERR(clk); |
1247 | goto out_unmap; | 1247 | goto out_unmap; |
1248 | } | 1248 | } |
1249 | clk_prepare(clk); | ||
1249 | 1250 | ||
1250 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); | 1251 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); |
1251 | if (!nmk_chip) { | 1252 | if (!nmk_chip) { |
@@ -1437,7 +1438,27 @@ static int nmk_pmx_enable(struct pinctrl_dev *pctldev, unsigned function, | |||
1437 | 1438 | ||
1438 | 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); |
1439 | 1440 | ||
1440 | /* 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 | */ | ||
1441 | glitch = (g->altsetting == NMK_GPIO_ALT_C); | 1462 | glitch = (g->altsetting == NMK_GPIO_ALT_C); |
1442 | 1463 | ||
1443 | if (glitch) { | 1464 | if (glitch) { |
diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c index ba15b1a29e52..e9f8e7d11001 100644 --- a/drivers/pinctrl/pinctrl-sirf.c +++ b/drivers/pinctrl/pinctrl-sirf.c | |||
@@ -1184,7 +1184,7 @@ out_no_gpio_remap: | |||
1184 | return ret; | 1184 | return ret; |
1185 | } | 1185 | } |
1186 | 1186 | ||
1187 | static const struct of_device_id pinmux_ids[] = { | 1187 | static const struct of_device_id pinmux_ids[] __devinitconst = { |
1188 | { .compatible = "sirf,prima2-gpio-pinmux" }, | 1188 | { .compatible = "sirf,prima2-gpio-pinmux" }, |
1189 | {} | 1189 | {} |
1190 | }; | 1190 | }; |
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/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 2fd9d36acd15..39abb150bdd4 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c | |||
@@ -660,7 +660,7 @@ static int acerhdf_register_thermal(void) | |||
660 | if (IS_ERR(cl_dev)) | 660 | if (IS_ERR(cl_dev)) |
661 | return -EINVAL; | 661 | return -EINVAL; |
662 | 662 | ||
663 | thz_dev = thermal_zone_device_register("acerhdf", 1, NULL, | 663 | thz_dev = thermal_zone_device_register("acerhdf", 1, 0, NULL, |
664 | &acerhdf_dev_ops, 0, 0, 0, | 664 | &acerhdf_dev_ops, 0, 0, 0, |
665 | (kernelmode) ? interval*1000 : 0); | 665 | (kernelmode) ? interval*1000 : 0); |
666 | if (IS_ERR(thz_dev)) | 666 | if (IS_ERR(thz_dev)) |
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 4f20f8dd3d7c..17f6dfd8dbfb 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c | |||
@@ -694,10 +694,10 @@ MODULE_DEVICE_TABLE(acpi, ideapad_device_ids); | |||
694 | static int __devinit ideapad_acpi_add(struct acpi_device *adevice) | 694 | static int __devinit ideapad_acpi_add(struct acpi_device *adevice) |
695 | { | 695 | { |
696 | int ret, i; | 696 | int ret, i; |
697 | unsigned long cfg; | 697 | int cfg; |
698 | struct ideapad_private *priv; | 698 | struct ideapad_private *priv; |
699 | 699 | ||
700 | if (read_method_int(adevice->handle, "_CFG", (int *)&cfg)) | 700 | if (read_method_int(adevice->handle, "_CFG", &cfg)) |
701 | return -ENODEV; | 701 | return -ENODEV; |
702 | 702 | ||
703 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 703 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
@@ -721,7 +721,7 @@ static int __devinit ideapad_acpi_add(struct acpi_device *adevice) | |||
721 | goto input_failed; | 721 | goto input_failed; |
722 | 722 | ||
723 | for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) { | 723 | for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) { |
724 | if (test_bit(ideapad_rfk_data[i].cfgbit, &cfg)) | 724 | if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) |
725 | ideapad_register_rfkill(adevice, i); | 725 | ideapad_register_rfkill(adevice, i); |
726 | else | 726 | else |
727 | priv->rfk[i] = NULL; | 727 | priv->rfk[i] = NULL; |
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 0ffdb3cde2bb..9af4257d4901 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -72,6 +72,7 @@ | |||
72 | #include <linux/string.h> | 72 | #include <linux/string.h> |
73 | #include <linux/tick.h> | 73 | #include <linux/tick.h> |
74 | #include <linux/timer.h> | 74 | #include <linux/timer.h> |
75 | #include <linux/dmi.h> | ||
75 | #include <drm/i915_drm.h> | 76 | #include <drm/i915_drm.h> |
76 | #include <asm/msr.h> | 77 | #include <asm/msr.h> |
77 | #include <asm/processor.h> | 78 | #include <asm/processor.h> |
@@ -1485,6 +1486,24 @@ static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = { | |||
1485 | 1486 | ||
1486 | MODULE_DEVICE_TABLE(pci, ips_id_table); | 1487 | MODULE_DEVICE_TABLE(pci, ips_id_table); |
1487 | 1488 | ||
1489 | static int ips_blacklist_callback(const struct dmi_system_id *id) | ||
1490 | { | ||
1491 | pr_info("Blacklisted intel_ips for %s\n", id->ident); | ||
1492 | return 1; | ||
1493 | } | ||
1494 | |||
1495 | static const struct dmi_system_id ips_blacklist[] = { | ||
1496 | { | ||
1497 | .callback = ips_blacklist_callback, | ||
1498 | .ident = "HP ProBook", | ||
1499 | .matches = { | ||
1500 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
1501 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook"), | ||
1502 | }, | ||
1503 | }, | ||
1504 | { } /* terminating entry */ | ||
1505 | }; | ||
1506 | |||
1488 | static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | 1507 | static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) |
1489 | { | 1508 | { |
1490 | u64 platform_info; | 1509 | u64 platform_info; |
@@ -1494,6 +1513,9 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1494 | u16 htshi, trc, trc_required_mask; | 1513 | u16 htshi, trc, trc_required_mask; |
1495 | u8 tse; | 1514 | u8 tse; |
1496 | 1515 | ||
1516 | if (dmi_check_system(ips_blacklist)) | ||
1517 | return -ENODEV; | ||
1518 | |||
1497 | ips = kzalloc(sizeof(struct ips_driver), GFP_KERNEL); | 1519 | ips = kzalloc(sizeof(struct ips_driver), GFP_KERNEL); |
1498 | if (!ips) | 1520 | if (!ips) |
1499 | return -ENOMEM; | 1521 | return -ENOMEM; |
diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c index 5ae9cd9c7e6e..2b2c212ad37d 100644 --- a/drivers/platform/x86/intel_mid_thermal.c +++ b/drivers/platform/x86/intel_mid_thermal.c | |||
@@ -499,7 +499,7 @@ static int mid_thermal_probe(struct platform_device *pdev) | |||
499 | goto err; | 499 | goto err; |
500 | } | 500 | } |
501 | pinfo->tzd[i] = thermal_zone_device_register(name[i], | 501 | pinfo->tzd[i] = thermal_zone_device_register(name[i], |
502 | 0, td_info, &tzd_ops, 0, 0, 0, 0); | 502 | 0, 0, td_info, &tzd_ops, 0, 0, 0, 0); |
503 | if (IS_ERR(pinfo->tzd[i])) { | 503 | if (IS_ERR(pinfo->tzd[i])) { |
504 | kfree(td_info); | 504 | kfree(td_info); |
505 | ret = PTR_ERR(pinfo->tzd[i]); | 505 | ret = PTR_ERR(pinfo->tzd[i]); |
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 210d4ae547c2..d456ff0c73b7 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -973,7 +973,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
973 | struct device_attribute *attr, | 973 | struct device_attribute *attr, |
974 | const char *buffer, size_t count) | 974 | const char *buffer, size_t count) |
975 | { | 975 | { |
976 | unsigned long value = 0; | 976 | int value; |
977 | int ret = 0; | 977 | int ret = 0; |
978 | struct sony_nc_value *item = | 978 | struct sony_nc_value *item = |
979 | container_of(attr, struct sony_nc_value, devattr); | 979 | container_of(attr, struct sony_nc_value, devattr); |
@@ -984,7 +984,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
984 | if (count > 31) | 984 | if (count > 31) |
985 | return -EINVAL; | 985 | return -EINVAL; |
986 | 986 | ||
987 | if (kstrtoul(buffer, 10, &value)) | 987 | if (kstrtoint(buffer, 10, &value)) |
988 | return -EINVAL; | 988 | return -EINVAL; |
989 | 989 | ||
990 | if (item->validate) | 990 | if (item->validate) |
@@ -994,7 +994,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
994 | return value; | 994 | return value; |
995 | 995 | ||
996 | ret = sony_nc_int_call(sony_nc_acpi_handle, *item->acpiset, | 996 | ret = sony_nc_int_call(sony_nc_acpi_handle, *item->acpiset, |
997 | (int *)&value, NULL); | 997 | &value, NULL); |
998 | if (ret < 0) | 998 | if (ret < 0) |
999 | return -EIO; | 999 | return -EIO; |
1000 | 1000 | ||
@@ -1010,6 +1010,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
1010 | struct sony_backlight_props { | 1010 | struct sony_backlight_props { |
1011 | struct backlight_device *dev; | 1011 | struct backlight_device *dev; |
1012 | int handle; | 1012 | int handle; |
1013 | int cmd_base; | ||
1013 | u8 offset; | 1014 | u8 offset; |
1014 | u8 maxlvl; | 1015 | u8 maxlvl; |
1015 | }; | 1016 | }; |
@@ -1037,7 +1038,7 @@ static int sony_nc_get_brightness_ng(struct backlight_device *bd) | |||
1037 | struct sony_backlight_props *sdev = | 1038 | struct sony_backlight_props *sdev = |
1038 | (struct sony_backlight_props *)bl_get_data(bd); | 1039 | (struct sony_backlight_props *)bl_get_data(bd); |
1039 | 1040 | ||
1040 | sony_call_snc_handle(sdev->handle, 0x0200, &result); | 1041 | sony_call_snc_handle(sdev->handle, sdev->cmd_base + 0x100, &result); |
1041 | 1042 | ||
1042 | return (result & 0xff) - sdev->offset; | 1043 | return (result & 0xff) - sdev->offset; |
1043 | } | 1044 | } |
@@ -1049,7 +1050,8 @@ static int sony_nc_update_status_ng(struct backlight_device *bd) | |||
1049 | (struct sony_backlight_props *)bl_get_data(bd); | 1050 | (struct sony_backlight_props *)bl_get_data(bd); |
1050 | 1051 | ||
1051 | value = bd->props.brightness + sdev->offset; | 1052 | value = bd->props.brightness + sdev->offset; |
1052 | if (sony_call_snc_handle(sdev->handle, 0x0100 | (value << 16), &result)) | 1053 | if (sony_call_snc_handle(sdev->handle, sdev->cmd_base | (value << 0x10), |
1054 | &result)) | ||
1053 | return -EIO; | 1055 | return -EIO; |
1054 | 1056 | ||
1055 | return value; | 1057 | return value; |
@@ -1172,6 +1174,11 @@ static int sony_nc_hotkeys_decode(u32 event, unsigned int handle) | |||
1172 | /* | 1174 | /* |
1173 | * ACPI callbacks | 1175 | * ACPI callbacks |
1174 | */ | 1176 | */ |
1177 | enum event_types { | ||
1178 | HOTKEY = 1, | ||
1179 | KILLSWITCH, | ||
1180 | GFX_SWITCH | ||
1181 | }; | ||
1175 | static void sony_nc_notify(struct acpi_device *device, u32 event) | 1182 | static void sony_nc_notify(struct acpi_device *device, u32 event) |
1176 | { | 1183 | { |
1177 | u32 real_ev = event; | 1184 | u32 real_ev = event; |
@@ -1196,7 +1203,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
1196 | /* hotkey event */ | 1203 | /* hotkey event */ |
1197 | case 0x0100: | 1204 | case 0x0100: |
1198 | case 0x0127: | 1205 | case 0x0127: |
1199 | ev_type = 1; | 1206 | ev_type = HOTKEY; |
1200 | real_ev = sony_nc_hotkeys_decode(event, handle); | 1207 | real_ev = sony_nc_hotkeys_decode(event, handle); |
1201 | 1208 | ||
1202 | if (real_ev > 0) | 1209 | if (real_ev > 0) |
@@ -1216,7 +1223,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
1216 | * update the rfkill device status when the | 1223 | * update the rfkill device status when the |
1217 | * switch is moved. | 1224 | * switch is moved. |
1218 | */ | 1225 | */ |
1219 | ev_type = 2; | 1226 | ev_type = KILLSWITCH; |
1220 | sony_call_snc_handle(handle, 0x0100, &result); | 1227 | sony_call_snc_handle(handle, 0x0100, &result); |
1221 | real_ev = result & 0x03; | 1228 | real_ev = result & 0x03; |
1222 | 1229 | ||
@@ -1226,6 +1233,24 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
1226 | 1233 | ||
1227 | break; | 1234 | break; |
1228 | 1235 | ||
1236 | case 0x0128: | ||
1237 | case 0x0146: | ||
1238 | /* Hybrid GFX switching */ | ||
1239 | sony_call_snc_handle(handle, 0x0000, &result); | ||
1240 | dprintk("GFX switch event received (reason: %s)\n", | ||
1241 | (result & 0x01) ? | ||
1242 | "switch change" : "unknown"); | ||
1243 | |||
1244 | /* verify the switch state | ||
1245 | * 1: discrete GFX | ||
1246 | * 0: integrated GFX | ||
1247 | */ | ||
1248 | sony_call_snc_handle(handle, 0x0100, &result); | ||
1249 | |||
1250 | ev_type = GFX_SWITCH; | ||
1251 | real_ev = result & 0xff; | ||
1252 | break; | ||
1253 | |||
1229 | default: | 1254 | default: |
1230 | dprintk("Unknown event 0x%x for handle 0x%x\n", | 1255 | dprintk("Unknown event 0x%x for handle 0x%x\n", |
1231 | event, handle); | 1256 | event, handle); |
@@ -1238,7 +1263,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
1238 | 1263 | ||
1239 | } else { | 1264 | } else { |
1240 | /* old style event */ | 1265 | /* old style event */ |
1241 | ev_type = 1; | 1266 | ev_type = HOTKEY; |
1242 | sony_laptop_report_input_event(real_ev); | 1267 | sony_laptop_report_input_event(real_ev); |
1243 | } | 1268 | } |
1244 | 1269 | ||
@@ -1893,32 +1918,33 @@ static ssize_t sony_nc_battery_care_limit_store(struct device *dev, | |||
1893 | * bits 4,5: store the limit into the EC | 1918 | * bits 4,5: store the limit into the EC |
1894 | * bits 6,7: store the limit into the battery | 1919 | * bits 6,7: store the limit into the battery |
1895 | */ | 1920 | */ |
1921 | cmd = 0; | ||
1896 | 1922 | ||
1897 | /* | 1923 | if (value > 0) { |
1898 | * handle 0x0115 should allow storing on battery too; | 1924 | if (value <= 50) |
1899 | * handle 0x0136 same as 0x0115 + health status; | 1925 | cmd = 0x20; |
1900 | * handle 0x013f, same as 0x0136 but no storing on the battery | ||
1901 | * | ||
1902 | * Store only inside the EC for now, regardless the handle number | ||
1903 | */ | ||
1904 | if (value == 0) | ||
1905 | /* disable limits */ | ||
1906 | cmd = 0x0; | ||
1907 | 1926 | ||
1908 | else if (value <= 50) | 1927 | else if (value <= 80) |
1909 | cmd = 0x21; | 1928 | cmd = 0x10; |
1910 | 1929 | ||
1911 | else if (value <= 80) | 1930 | else if (value <= 100) |
1912 | cmd = 0x11; | 1931 | cmd = 0x30; |
1913 | 1932 | ||
1914 | else if (value <= 100) | 1933 | else |
1915 | cmd = 0x31; | 1934 | return -EINVAL; |
1916 | 1935 | ||
1917 | else | 1936 | /* |
1918 | return -EINVAL; | 1937 | * handle 0x0115 should allow storing on battery too; |
1938 | * handle 0x0136 same as 0x0115 + health status; | ||
1939 | * handle 0x013f, same as 0x0136 but no storing on the battery | ||
1940 | */ | ||
1941 | if (bcare_ctl->handle != 0x013f) | ||
1942 | cmd = cmd | (cmd << 2); | ||
1919 | 1943 | ||
1920 | if (sony_call_snc_handle(bcare_ctl->handle, (cmd << 0x10) | 0x0100, | 1944 | cmd = (cmd | 0x1) << 0x10; |
1921 | &result)) | 1945 | } |
1946 | |||
1947 | if (sony_call_snc_handle(bcare_ctl->handle, cmd | 0x0100, &result)) | ||
1922 | return -EIO; | 1948 | return -EIO; |
1923 | 1949 | ||
1924 | return count; | 1950 | return count; |
@@ -2113,7 +2139,7 @@ static ssize_t sony_nc_thermal_mode_show(struct device *dev, | |||
2113 | struct device_attribute *attr, char *buffer) | 2139 | struct device_attribute *attr, char *buffer) |
2114 | { | 2140 | { |
2115 | ssize_t count = 0; | 2141 | ssize_t count = 0; |
2116 | unsigned int mode = sony_nc_thermal_mode_get(); | 2142 | int mode = sony_nc_thermal_mode_get(); |
2117 | 2143 | ||
2118 | if (mode < 0) | 2144 | if (mode < 0) |
2119 | return mode; | 2145 | return mode; |
@@ -2472,6 +2498,7 @@ static void sony_nc_backlight_ng_read_limits(int handle, | |||
2472 | { | 2498 | { |
2473 | u64 offset; | 2499 | u64 offset; |
2474 | int i; | 2500 | int i; |
2501 | int lvl_table_len = 0; | ||
2475 | u8 min = 0xff, max = 0x00; | 2502 | u8 min = 0xff, max = 0x00; |
2476 | unsigned char buffer[32] = { 0 }; | 2503 | unsigned char buffer[32] = { 0 }; |
2477 | 2504 | ||
@@ -2480,8 +2507,6 @@ static void sony_nc_backlight_ng_read_limits(int handle, | |||
2480 | props->maxlvl = 0xff; | 2507 | props->maxlvl = 0xff; |
2481 | 2508 | ||
2482 | offset = sony_find_snc_handle(handle); | 2509 | offset = sony_find_snc_handle(handle); |
2483 | if (offset < 0) | ||
2484 | return; | ||
2485 | 2510 | ||
2486 | /* try to read the boundaries from ACPI tables, if we fail the above | 2511 | /* try to read the boundaries from ACPI tables, if we fail the above |
2487 | * defaults should be reasonable | 2512 | * defaults should be reasonable |
@@ -2491,11 +2516,21 @@ static void sony_nc_backlight_ng_read_limits(int handle, | |||
2491 | if (i < 0) | 2516 | if (i < 0) |
2492 | return; | 2517 | return; |
2493 | 2518 | ||
2519 | switch (handle) { | ||
2520 | case 0x012f: | ||
2521 | case 0x0137: | ||
2522 | lvl_table_len = 9; | ||
2523 | break; | ||
2524 | case 0x143: | ||
2525 | lvl_table_len = 16; | ||
2526 | break; | ||
2527 | } | ||
2528 | |||
2494 | /* the buffer lists brightness levels available, brightness levels are | 2529 | /* the buffer lists brightness levels available, brightness levels are |
2495 | * from position 0 to 8 in the array, other values are used by ALS | 2530 | * from position 0 to 8 in the array, other values are used by ALS |
2496 | * control. | 2531 | * control. |
2497 | */ | 2532 | */ |
2498 | for (i = 0; i < 9 && i < ARRAY_SIZE(buffer); i++) { | 2533 | for (i = 0; i < lvl_table_len && i < ARRAY_SIZE(buffer); i++) { |
2499 | 2534 | ||
2500 | dprintk("Brightness level: %d\n", buffer[i]); | 2535 | dprintk("Brightness level: %d\n", buffer[i]); |
2501 | 2536 | ||
@@ -2520,16 +2555,24 @@ static void sony_nc_backlight_setup(void) | |||
2520 | const struct backlight_ops *ops = NULL; | 2555 | const struct backlight_ops *ops = NULL; |
2521 | struct backlight_properties props; | 2556 | struct backlight_properties props; |
2522 | 2557 | ||
2523 | if (sony_find_snc_handle(0x12f) != -1) { | 2558 | if (sony_find_snc_handle(0x12f) >= 0) { |
2524 | ops = &sony_backlight_ng_ops; | 2559 | ops = &sony_backlight_ng_ops; |
2560 | sony_bl_props.cmd_base = 0x0100; | ||
2525 | sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); | 2561 | sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); |
2526 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | 2562 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; |
2527 | 2563 | ||
2528 | } else if (sony_find_snc_handle(0x137) != -1) { | 2564 | } else if (sony_find_snc_handle(0x137) >= 0) { |
2529 | ops = &sony_backlight_ng_ops; | 2565 | ops = &sony_backlight_ng_ops; |
2566 | sony_bl_props.cmd_base = 0x0100; | ||
2530 | sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); | 2567 | sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); |
2531 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | 2568 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; |
2532 | 2569 | ||
2570 | } else if (sony_find_snc_handle(0x143) >= 0) { | ||
2571 | ops = &sony_backlight_ng_ops; | ||
2572 | sony_bl_props.cmd_base = 0x3000; | ||
2573 | sony_nc_backlight_ng_read_limits(0x143, &sony_bl_props); | ||
2574 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | ||
2575 | |||
2533 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", | 2576 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", |
2534 | &unused))) { | 2577 | &unused))) { |
2535 | ops = &sony_backlight_ops; | 2578 | ops = &sony_backlight_ops; |
@@ -2597,6 +2640,12 @@ static int sony_nc_add(struct acpi_device *device) | |||
2597 | } | 2640 | } |
2598 | } | 2641 | } |
2599 | 2642 | ||
2643 | result = sony_laptop_setup_input(device); | ||
2644 | if (result) { | ||
2645 | pr_err("Unable to create input devices\n"); | ||
2646 | goto outplatform; | ||
2647 | } | ||
2648 | |||
2600 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "ECON", | 2649 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "ECON", |
2601 | &handle))) { | 2650 | &handle))) { |
2602 | int arg = 1; | 2651 | int arg = 1; |
@@ -2614,12 +2663,6 @@ static int sony_nc_add(struct acpi_device *device) | |||
2614 | } | 2663 | } |
2615 | 2664 | ||
2616 | /* setup input devices and helper fifo */ | 2665 | /* setup input devices and helper fifo */ |
2617 | result = sony_laptop_setup_input(device); | ||
2618 | if (result) { | ||
2619 | pr_err("Unable to create input devices\n"); | ||
2620 | goto outsnc; | ||
2621 | } | ||
2622 | |||
2623 | if (acpi_video_backlight_support()) { | 2666 | if (acpi_video_backlight_support()) { |
2624 | pr_info("brightness ignored, must be controlled by ACPI video driver\n"); | 2667 | pr_info("brightness ignored, must be controlled by ACPI video driver\n"); |
2625 | } else { | 2668 | } else { |
@@ -2667,22 +2710,21 @@ static int sony_nc_add(struct acpi_device *device) | |||
2667 | 2710 | ||
2668 | return 0; | 2711 | return 0; |
2669 | 2712 | ||
2670 | out_sysfs: | 2713 | out_sysfs: |
2671 | for (item = sony_nc_values; item->name; ++item) { | 2714 | for (item = sony_nc_values; item->name; ++item) { |
2672 | device_remove_file(&sony_pf_device->dev, &item->devattr); | 2715 | device_remove_file(&sony_pf_device->dev, &item->devattr); |
2673 | } | 2716 | } |
2674 | sony_nc_backlight_cleanup(); | 2717 | sony_nc_backlight_cleanup(); |
2675 | |||
2676 | sony_laptop_remove_input(); | ||
2677 | |||
2678 | outsnc: | ||
2679 | sony_nc_function_cleanup(sony_pf_device); | 2718 | sony_nc_function_cleanup(sony_pf_device); |
2680 | sony_nc_handles_cleanup(sony_pf_device); | 2719 | sony_nc_handles_cleanup(sony_pf_device); |
2681 | 2720 | ||
2682 | outpresent: | 2721 | outplatform: |
2722 | sony_laptop_remove_input(); | ||
2723 | |||
2724 | outpresent: | ||
2683 | sony_pf_remove(); | 2725 | sony_pf_remove(); |
2684 | 2726 | ||
2685 | outwalk: | 2727 | outwalk: |
2686 | sony_nc_rfkill_cleanup(); | 2728 | sony_nc_rfkill_cleanup(); |
2687 | return result; | 2729 | return result; |
2688 | } | 2730 | } |
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index e1b8c54ace5a..a739f5ca936a 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
@@ -794,17 +794,17 @@ static __devinit int ab8500_regulator_register(struct platform_device *pdev, | |||
794 | } | 794 | } |
795 | 795 | ||
796 | static struct of_regulator_match ab8500_regulator_matches[] = { | 796 | static struct of_regulator_match ab8500_regulator_matches[] = { |
797 | { .name = "LDO-AUX1", .driver_data = (void *) AB8500_LDO_AUX1, }, | 797 | { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB8500_LDO_AUX1, }, |
798 | { .name = "LDO-AUX2", .driver_data = (void *) AB8500_LDO_AUX2, }, | 798 | { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB8500_LDO_AUX2, }, |
799 | { .name = "LDO-AUX3", .driver_data = (void *) AB8500_LDO_AUX3, }, | 799 | { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB8500_LDO_AUX3, }, |
800 | { .name = "LDO-INTCORE", .driver_data = (void *) AB8500_LDO_INTCORE, }, | 800 | { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB8500_LDO_INTCORE, }, |
801 | { .name = "LDO-TVOUT", .driver_data = (void *) AB8500_LDO_TVOUT, }, | 801 | { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8500_LDO_TVOUT, }, |
802 | { .name = "LDO-USB", .driver_data = (void *) AB8500_LDO_USB, }, | 802 | { .name = "ab8500_ldo_usb", .driver_data = (void *) AB8500_LDO_USB, }, |
803 | { .name = "LDO-AUDIO", .driver_data = (void *) AB8500_LDO_AUDIO, }, | 803 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8500_LDO_AUDIO, }, |
804 | { .name = "LDO-ANAMIC1", .driver_data = (void *) AB8500_LDO_ANAMIC1, }, | 804 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8500_LDO_ANAMIC1, }, |
805 | { .name = "LDO-ANAMIC2", .driver_data = (void *) AB8500_LDO_ANAMIC2, }, | 805 | { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8500_LDO_ANAMIC2, }, |
806 | { .name = "LDO-DMIC", .driver_data = (void *) AB8500_LDO_DMIC, }, | 806 | { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8500_LDO_DMIC, }, |
807 | { .name = "LDO-ANA", .driver_data = (void *) AB8500_LDO_ANA, }, | 807 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8500_LDO_ANA, }, |
808 | }; | 808 | }; |
809 | 809 | ||
810 | static __devinit int | 810 | static __devinit int |
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 3660bace123c..e82e7eaac0f1 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c | |||
@@ -224,7 +224,7 @@ static struct platform_driver anatop_regulator_driver = { | |||
224 | .of_match_table = of_anatop_regulator_match_tbl, | 224 | .of_match_table = of_anatop_regulator_match_tbl, |
225 | }, | 225 | }, |
226 | .probe = anatop_regulator_probe, | 226 | .probe = anatop_regulator_probe, |
227 | .remove = anatop_regulator_remove, | 227 | .remove = __devexit_p(anatop_regulator_remove), |
228 | }; | 228 | }; |
229 | 229 | ||
230 | static int __init anatop_regulator_init(void) | 230 | static int __init anatop_regulator_init(void) |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 7584a74eec8a..8b4b3829d9e7 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2050,6 +2050,9 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev, | |||
2050 | return -EINVAL; | 2050 | return -EINVAL; |
2051 | } | 2051 | } |
2052 | 2052 | ||
2053 | if (min_uV < rdev->desc->min_uV) | ||
2054 | min_uV = rdev->desc->min_uV; | ||
2055 | |||
2053 | ret = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step); | 2056 | ret = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step); |
2054 | if (ret < 0) | 2057 | if (ret < 0) |
2055 | return ret; | 2058 | return ret; |
@@ -2516,9 +2519,12 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load) | |||
2516 | { | 2519 | { |
2517 | struct regulator_dev *rdev = regulator->rdev; | 2520 | struct regulator_dev *rdev = regulator->rdev; |
2518 | struct regulator *consumer; | 2521 | struct regulator *consumer; |
2519 | int ret, output_uV, input_uV, total_uA_load = 0; | 2522 | int ret, output_uV, input_uV = 0, total_uA_load = 0; |
2520 | unsigned int mode; | 2523 | unsigned int mode; |
2521 | 2524 | ||
2525 | if (rdev->supply) | ||
2526 | input_uV = regulator_get_voltage(rdev->supply); | ||
2527 | |||
2522 | mutex_lock(&rdev->mutex); | 2528 | mutex_lock(&rdev->mutex); |
2523 | 2529 | ||
2524 | /* | 2530 | /* |
@@ -2551,10 +2557,7 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load) | |||
2551 | goto out; | 2557 | goto out; |
2552 | } | 2558 | } |
2553 | 2559 | ||
2554 | /* get input voltage */ | 2560 | /* No supply? Use constraint voltage */ |
2555 | input_uV = 0; | ||
2556 | if (rdev->supply) | ||
2557 | input_uV = regulator_get_voltage(rdev->supply); | ||
2558 | if (input_uV <= 0) | 2561 | if (input_uV <= 0) |
2559 | input_uV = rdev->constraints->input_uV; | 2562 | input_uV = rdev->constraints->input_uV; |
2560 | if (input_uV <= 0) { | 2563 | if (input_uV <= 0) { |
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c index 968f97f3cb3d..9dbb491b6efa 100644 --- a/drivers/regulator/db8500-prcmu.c +++ b/drivers/regulator/db8500-prcmu.c | |||
@@ -452,26 +452,26 @@ static __devinit int db8500_regulator_register(struct platform_device *pdev, | |||
452 | } | 452 | } |
453 | 453 | ||
454 | static struct of_regulator_match db8500_regulator_matches[] = { | 454 | static struct of_regulator_match db8500_regulator_matches[] = { |
455 | { .name = "db8500-vape", .driver_data = (void *) DB8500_REGULATOR_VAPE, }, | 455 | { .name = "db8500_vape", .driver_data = (void *) DB8500_REGULATOR_VAPE, }, |
456 | { .name = "db8500-varm", .driver_data = (void *) DB8500_REGULATOR_VARM, }, | 456 | { .name = "db8500_varm", .driver_data = (void *) DB8500_REGULATOR_VARM, }, |
457 | { .name = "db8500-vmodem", .driver_data = (void *) DB8500_REGULATOR_VMODEM, }, | 457 | { .name = "db8500_vmodem", .driver_data = (void *) DB8500_REGULATOR_VMODEM, }, |
458 | { .name = "db8500-vpll", .driver_data = (void *) DB8500_REGULATOR_VPLL, }, | 458 | { .name = "db8500_vpll", .driver_data = (void *) DB8500_REGULATOR_VPLL, }, |
459 | { .name = "db8500-vsmps1", .driver_data = (void *) DB8500_REGULATOR_VSMPS1, }, | 459 | { .name = "db8500_vsmps1", .driver_data = (void *) DB8500_REGULATOR_VSMPS1, }, |
460 | { .name = "db8500-vsmps2", .driver_data = (void *) DB8500_REGULATOR_VSMPS2, }, | 460 | { .name = "db8500_vsmps2", .driver_data = (void *) DB8500_REGULATOR_VSMPS2, }, |
461 | { .name = "db8500-vsmps3", .driver_data = (void *) DB8500_REGULATOR_VSMPS3, }, | 461 | { .name = "db8500_vsmps3", .driver_data = (void *) DB8500_REGULATOR_VSMPS3, }, |
462 | { .name = "db8500-vrf1", .driver_data = (void *) DB8500_REGULATOR_VRF1, }, | 462 | { .name = "db8500_vrf1", .driver_data = (void *) DB8500_REGULATOR_VRF1, }, |
463 | { .name = "db8500-sva-mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSP, }, | 463 | { .name = "db8500_sva_mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSP, }, |
464 | { .name = "db8500-sva-mmdsp-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSPRET, }, | 464 | { .name = "db8500_sva_mmdsp_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSPRET, }, |
465 | { .name = "db8500-sva-pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAPIPE, }, | 465 | { .name = "db8500_sva_pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAPIPE, }, |
466 | { .name = "db8500-sia-mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSP, }, | 466 | { .name = "db8500_sia_mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSP, }, |
467 | { .name = "db8500-sia-mmdsp-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSPRET, }, | 467 | { .name = "db8500_sia_mmdsp_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSPRET, }, |
468 | { .name = "db8500-sia-pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAPIPE, }, | 468 | { .name = "db8500_sia_pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAPIPE, }, |
469 | { .name = "db8500-sga", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SGA, }, | 469 | { .name = "db8500_sga", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SGA, }, |
470 | { .name = "db8500-b2r2-mcde", .driver_data = (void *) DB8500_REGULATOR_SWITCH_B2R2_MCDE, }, | 470 | { .name = "db8500_b2r2_mcde", .driver_data = (void *) DB8500_REGULATOR_SWITCH_B2R2_MCDE, }, |
471 | { .name = "db8500-esram12", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12, }, | 471 | { .name = "db8500_esram12", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12, }, |
472 | { .name = "db8500-esram12-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12RET, }, | 472 | { .name = "db8500_esram12_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12RET, }, |
473 | { .name = "db8500-esram34", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34, }, | 473 | { .name = "db8500_esram34", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34, }, |
474 | { .name = "db8500-esram34-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34RET, }, | 474 | { .name = "db8500_esram34_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34RET, }, |
475 | }; | 475 | }; |
476 | 476 | ||
477 | static __devinit int | 477 | static __devinit int |
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 9997d7aaca84..242851a4c1a6 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c | |||
@@ -101,16 +101,20 @@ static int gpio_regulator_get_value(struct regulator_dev *dev) | |||
101 | } | 101 | } |
102 | 102 | ||
103 | static int gpio_regulator_set_value(struct regulator_dev *dev, | 103 | static int gpio_regulator_set_value(struct regulator_dev *dev, |
104 | int min, int max) | 104 | int min, int max, unsigned *selector) |
105 | { | 105 | { |
106 | struct gpio_regulator_data *data = rdev_get_drvdata(dev); | 106 | struct gpio_regulator_data *data = rdev_get_drvdata(dev); |
107 | int ptr, target, state, best_val = INT_MAX; | 107 | int ptr, target = 0, state, best_val = INT_MAX; |
108 | 108 | ||
109 | for (ptr = 0; ptr < data->nr_states; ptr++) | 109 | for (ptr = 0; ptr < data->nr_states; ptr++) |
110 | if (data->states[ptr].value < best_val && | 110 | if (data->states[ptr].value < best_val && |
111 | data->states[ptr].value >= min && | 111 | data->states[ptr].value >= min && |
112 | data->states[ptr].value <= max) | 112 | data->states[ptr].value <= max) { |
113 | target = data->states[ptr].gpios; | 113 | target = data->states[ptr].gpios; |
114 | best_val = data->states[ptr].value; | ||
115 | if (selector) | ||
116 | *selector = ptr; | ||
117 | } | ||
114 | 118 | ||
115 | if (best_val == INT_MAX) | 119 | if (best_val == INT_MAX) |
116 | return -EINVAL; | 120 | return -EINVAL; |
@@ -128,7 +132,7 @@ static int gpio_regulator_set_voltage(struct regulator_dev *dev, | |||
128 | int min_uV, int max_uV, | 132 | int min_uV, int max_uV, |
129 | unsigned *selector) | 133 | unsigned *selector) |
130 | { | 134 | { |
131 | return gpio_regulator_set_value(dev, min_uV, max_uV); | 135 | return gpio_regulator_set_value(dev, min_uV, max_uV, selector); |
132 | } | 136 | } |
133 | 137 | ||
134 | static int gpio_regulator_list_voltage(struct regulator_dev *dev, | 138 | static int gpio_regulator_list_voltage(struct regulator_dev *dev, |
@@ -145,7 +149,7 @@ static int gpio_regulator_list_voltage(struct regulator_dev *dev, | |||
145 | static int gpio_regulator_set_current_limit(struct regulator_dev *dev, | 149 | static int gpio_regulator_set_current_limit(struct regulator_dev *dev, |
146 | int min_uA, int max_uA) | 150 | int min_uA, int max_uA) |
147 | { | 151 | { |
148 | return gpio_regulator_set_value(dev, min_uA, max_uA); | 152 | return gpio_regulator_set_value(dev, min_uA, max_uA, NULL); |
149 | } | 153 | } |
150 | 154 | ||
151 | static struct regulator_ops gpio_regulator_voltage_ops = { | 155 | static struct regulator_ops gpio_regulator_voltage_ops = { |
@@ -286,7 +290,7 @@ static int __devinit gpio_regulator_probe(struct platform_device *pdev) | |||
286 | 290 | ||
287 | cfg.dev = &pdev->dev; | 291 | cfg.dev = &pdev->dev; |
288 | cfg.init_data = config->init_data; | 292 | cfg.init_data = config->init_data; |
289 | cfg.driver_data = &drvdata; | 293 | cfg.driver_data = drvdata; |
290 | 294 | ||
291 | drvdata->dev = regulator_register(&drvdata->desc, &cfg); | 295 | drvdata->dev = regulator_register(&drvdata->desc, &cfg); |
292 | if (IS_ERR(drvdata->dev)) { | 296 | if (IS_ERR(drvdata->dev)) { |
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index 1f4bb80457b3..9d540cd02dab 100644 --- a/drivers/regulator/max8649.c +++ b/drivers/regulator/max8649.c | |||
@@ -259,6 +259,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client, | |||
259 | config.dev = &client->dev; | 259 | config.dev = &client->dev; |
260 | config.init_data = pdata->regulator; | 260 | config.init_data = pdata->regulator; |
261 | config.driver_data = info; | 261 | config.driver_data = info; |
262 | config.regmap = info->regmap; | ||
262 | 263 | ||
263 | info->regulator = regulator_register(&dcdc_desc, &config); | 264 | info->regulator = regulator_register(&dcdc_desc, &config); |
264 | if (IS_ERR(info->regulator)) { | 265 | if (IS_ERR(info->regulator)) { |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index c4435f608df7..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) |
@@ -775,9 +778,6 @@ static __devinit int palmas_probe(struct platform_device *pdev) | |||
775 | err_unregister_regulator: | 778 | err_unregister_regulator: |
776 | while (--id >= 0) | 779 | while (--id >= 0) |
777 | regulator_unregister(pmic->rdev[id]); | 780 | regulator_unregister(pmic->rdev[id]); |
778 | kfree(pmic->rdev); | ||
779 | kfree(pmic->desc); | ||
780 | kfree(pmic); | ||
781 | return ret; | 781 | return ret; |
782 | } | 782 | } |
783 | 783 | ||
@@ -788,10 +788,6 @@ static int __devexit palmas_remove(struct platform_device *pdev) | |||
788 | 788 | ||
789 | for (id = 0; id < PALMAS_NUM_REGS; id++) | 789 | for (id = 0; id < PALMAS_NUM_REGS; id++) |
790 | regulator_unregister(pmic->rdev[id]); | 790 | regulator_unregister(pmic->rdev[id]); |
791 | |||
792 | kfree(pmic->rdev); | ||
793 | kfree(pmic->desc); | ||
794 | kfree(pmic); | ||
795 | return 0; | 791 | return 0; |
796 | } | 792 | } |
797 | 793 | ||
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 290d6fc01029..9caadb482178 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c | |||
@@ -451,7 +451,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev, | |||
451 | 451 | ||
452 | desc = reg_voltage_map[reg_id]; | 452 | desc = reg_voltage_map[reg_id]; |
453 | 453 | ||
454 | if (old_sel < new_sel) | 454 | if ((old_sel < new_sel) && s5m8767->ramp_delay) |
455 | return DIV_ROUND_UP(desc->step * (new_sel - old_sel), | 455 | return DIV_ROUND_UP(desc->step * (new_sel - old_sel), |
456 | s5m8767->ramp_delay * 1000); | 456 | s5m8767->ramp_delay * 1000); |
457 | return 0; | 457 | return 0; |
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/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 69425c4e86f3..de138e30d3e6 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c | |||
@@ -182,7 +182,7 @@ static int __devinit omap_rproc_probe(struct platform_device *pdev) | |||
182 | 182 | ||
183 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | 183 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); |
184 | if (ret) { | 184 | if (ret) { |
185 | dev_err(pdev->dev.parent, "dma_set_coherent_mask: %d\n", ret); | 185 | dev_err(&pdev->dev, "dma_set_coherent_mask: %d\n", ret); |
186 | return ret; | 186 | return ret; |
187 | } | 187 | } |
188 | 188 | ||
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 8ea7bccc7100..66324ee4678f 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
@@ -247,7 +247,7 @@ rproc_load_segments(struct rproc *rproc, const u8 *elf_data, size_t len) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | if (offset + filesz > len) { | 249 | if (offset + filesz > len) { |
250 | dev_err(dev, "truncated fw: need 0x%x avail 0x%x\n", | 250 | dev_err(dev, "truncated fw: need 0x%x avail 0x%zx\n", |
251 | offset + filesz, len); | 251 | offset + filesz, len); |
252 | ret = -EINVAL; | 252 | ret = -EINVAL; |
253 | break; | 253 | break; |
@@ -934,7 +934,7 @@ static void rproc_resource_cleanup(struct rproc *rproc) | |||
934 | unmapped = iommu_unmap(rproc->domain, entry->da, entry->len); | 934 | unmapped = iommu_unmap(rproc->domain, entry->da, entry->len); |
935 | if (unmapped != entry->len) { | 935 | if (unmapped != entry->len) { |
936 | /* nothing much to do besides complaining */ | 936 | /* nothing much to do besides complaining */ |
937 | dev_err(dev, "failed to unmap %u/%u\n", entry->len, | 937 | dev_err(dev, "failed to unmap %u/%zu\n", entry->len, |
938 | unmapped); | 938 | unmapped); |
939 | } | 939 | } |
940 | 940 | ||
@@ -1020,7 +1020,7 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) | |||
1020 | 1020 | ||
1021 | ehdr = (struct elf32_hdr *)fw->data; | 1021 | ehdr = (struct elf32_hdr *)fw->data; |
1022 | 1022 | ||
1023 | dev_info(dev, "Booting fw image %s, size %d\n", name, fw->size); | 1023 | dev_info(dev, "Booting fw image %s, size %zd\n", name, fw->size); |
1024 | 1024 | ||
1025 | /* | 1025 | /* |
1026 | * if enabling an IOMMU isn't relevant for this rproc, this is | 1026 | * if enabling an IOMMU isn't relevant for this rproc, this is |
@@ -1041,8 +1041,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) | |||
1041 | 1041 | ||
1042 | /* look for the resource table */ | 1042 | /* look for the resource table */ |
1043 | table = rproc_find_rsc_table(rproc, fw->data, fw->size, &tablesz); | 1043 | table = rproc_find_rsc_table(rproc, fw->data, fw->size, &tablesz); |
1044 | if (!table) | 1044 | if (!table) { |
1045 | ret = -EINVAL; | ||
1045 | goto clean_up; | 1046 | goto clean_up; |
1047 | } | ||
1046 | 1048 | ||
1047 | /* handle fw resources which are required to boot rproc */ | 1049 | /* handle fw resources which are required to boot rproc */ |
1048 | ret = rproc_handle_boot_rsc(rproc, table, tablesz); | 1050 | ret = rproc_handle_boot_rsc(rproc, table, tablesz); |
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 75506ec2840e..f56c8ba3a861 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 */ |
@@ -1040,7 +1085,7 @@ static int __init rpmsg_init(void) | |||
1040 | 1085 | ||
1041 | return ret; | 1086 | return ret; |
1042 | } | 1087 | } |
1043 | module_init(rpmsg_init); | 1088 | subsys_initcall(rpmsg_init); |
1044 | 1089 | ||
1045 | static void __exit rpmsg_fini(void) | 1090 | static void __exit rpmsg_fini(void) |
1046 | { | 1091 | { |
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index 4bcf9ca2818a..370889d0489b 100644 --- a/drivers/rtc/rtc-ab8500.c +++ b/drivers/rtc/rtc-ab8500.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mfd/abx500.h> | 17 | #include <linux/mfd/abx500.h> |
18 | #include <linux/mfd/abx500/ab8500.h> | 18 | #include <linux/mfd/abx500/ab8500.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/of.h> | ||
20 | 21 | ||
21 | #define AB8500_RTC_SOFF_STAT_REG 0x00 | 22 | #define AB8500_RTC_SOFF_STAT_REG 0x00 |
22 | #define AB8500_RTC_CC_CONF_REG 0x01 | 23 | #define AB8500_RTC_CC_CONF_REG 0x01 |
@@ -422,7 +423,7 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev) | |||
422 | } | 423 | } |
423 | 424 | ||
424 | err = request_threaded_irq(irq, NULL, rtc_alarm_handler, | 425 | err = request_threaded_irq(irq, NULL, rtc_alarm_handler, |
425 | IRQF_NO_SUSPEND, "ab8500-rtc", rtc); | 426 | IRQF_NO_SUSPEND | IRQF_ONESHOT, "ab8500-rtc", rtc); |
426 | if (err < 0) { | 427 | if (err < 0) { |
427 | rtc_device_unregister(rtc); | 428 | rtc_device_unregister(rtc); |
428 | return err; | 429 | return err; |
@@ -430,7 +431,6 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev) | |||
430 | 431 | ||
431 | platform_set_drvdata(pdev, rtc); | 432 | platform_set_drvdata(pdev, rtc); |
432 | 433 | ||
433 | |||
434 | err = ab8500_sysfs_rtc_register(&pdev->dev); | 434 | err = ab8500_sysfs_rtc_register(&pdev->dev); |
435 | if (err) { | 435 | if (err) { |
436 | dev_err(&pdev->dev, "sysfs RTC failed to register\n"); | 436 | dev_err(&pdev->dev, "sysfs RTC failed to register\n"); |
@@ -454,10 +454,16 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev) | |||
454 | return 0; | 454 | return 0; |
455 | } | 455 | } |
456 | 456 | ||
457 | static const struct of_device_id ab8500_rtc_match[] = { | ||
458 | { .compatible = "stericsson,ab8500-rtc", }, | ||
459 | {} | ||
460 | }; | ||
461 | |||
457 | static struct platform_driver ab8500_rtc_driver = { | 462 | static struct platform_driver ab8500_rtc_driver = { |
458 | .driver = { | 463 | .driver = { |
459 | .name = "ab8500-rtc", | 464 | .name = "ab8500-rtc", |
460 | .owner = THIS_MODULE, | 465 | .owner = THIS_MODULE, |
466 | .of_match_table = ab8500_rtc_match, | ||
461 | }, | 467 | }, |
462 | .probe = ab8500_rtc_probe, | 468 | .probe = ab8500_rtc_probe, |
463 | .remove = __devexit_p(ab8500_rtc_remove), | 469 | .remove = __devexit_p(ab8500_rtc_remove), |
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index 5e1d64ee5228..e3e50d69baf8 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c | |||
@@ -202,10 +202,11 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) | |||
202 | struct platform_device *pdev = dev_id; | 202 | struct platform_device *pdev = dev_id; |
203 | struct rtc_plat_data *pdata = platform_get_drvdata(pdev); | 203 | struct rtc_plat_data *pdata = platform_get_drvdata(pdev); |
204 | void __iomem *ioaddr = pdata->ioaddr; | 204 | void __iomem *ioaddr = pdata->ioaddr; |
205 | unsigned long flags; | ||
205 | u32 status; | 206 | u32 status; |
206 | u32 events = 0; | 207 | u32 events = 0; |
207 | 208 | ||
208 | spin_lock_irq(&pdata->rtc->irq_lock); | 209 | spin_lock_irqsave(&pdata->rtc->irq_lock, flags); |
209 | status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR); | 210 | status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR); |
210 | /* clear interrupt sources */ | 211 | /* clear interrupt sources */ |
211 | writew(status, ioaddr + RTC_RTCISR); | 212 | writew(status, ioaddr + RTC_RTCISR); |
@@ -224,7 +225,7 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) | |||
224 | events |= (RTC_PF | RTC_IRQF); | 225 | events |= (RTC_PF | RTC_IRQF); |
225 | 226 | ||
226 | rtc_update_irq(pdata->rtc, 1, events); | 227 | rtc_update_irq(pdata->rtc, 1, events); |
227 | spin_unlock_irq(&pdata->rtc->irq_lock); | 228 | spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags); |
228 | 229 | ||
229 | return IRQ_HANDLED; | 230 | return IRQ_HANDLED; |
230 | } | 231 | } |
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index 1f76320e545b..e2785479113c 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c | |||
@@ -458,12 +458,12 @@ static int __devexit spear_rtc_remove(struct platform_device *pdev) | |||
458 | clk_disable(config->clk); | 458 | clk_disable(config->clk); |
459 | clk_put(config->clk); | 459 | clk_put(config->clk); |
460 | iounmap(config->ioaddr); | 460 | iounmap(config->ioaddr); |
461 | kfree(config); | ||
462 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 461 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
463 | if (res) | 462 | if (res) |
464 | release_mem_region(res->start, resource_size(res)); | 463 | release_mem_region(res->start, resource_size(res)); |
465 | platform_set_drvdata(pdev, NULL); | 464 | platform_set_drvdata(pdev, NULL); |
466 | rtc_device_unregister(config->rtc); | 465 | rtc_device_unregister(config->rtc); |
466 | kfree(config); | ||
467 | 467 | ||
468 | return 0; | 468 | return 0; |
469 | } | 469 | } |
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index 258abeabf624..c5d06fe83bba 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c | |||
@@ -510,7 +510,7 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) | |||
510 | } | 510 | } |
511 | 511 | ||
512 | ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, | 512 | ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, |
513 | IRQF_TRIGGER_RISING, | 513 | IRQF_TRIGGER_RISING | IRQF_ONESHOT, |
514 | dev_name(&rtc->dev), rtc); | 514 | dev_name(&rtc->dev), rtc); |
515 | if (ret < 0) { | 515 | if (ret < 0) { |
516 | dev_err(&pdev->dev, "IRQ is not free.\n"); | 516 | dev_err(&pdev->dev, "IRQ is not free.\n"); |
diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c index 532d212b6b2c..393e7ce8e95a 100644 --- a/drivers/scsi/aic94xx/aic94xx_task.c +++ b/drivers/scsi/aic94xx/aic94xx_task.c | |||
@@ -201,7 +201,7 @@ static void asd_get_response_tasklet(struct asd_ascb *ascb, | |||
201 | 201 | ||
202 | if (SAS_STATUS_BUF_SIZE >= sizeof(*resp)) { | 202 | if (SAS_STATUS_BUF_SIZE >= sizeof(*resp)) { |
203 | resp->frame_len = le16_to_cpu(*(__le16 *)(r+6)); | 203 | resp->frame_len = le16_to_cpu(*(__le16 *)(r+6)); |
204 | memcpy(&resp->ending_fis[0], r+16, 24); | 204 | memcpy(&resp->ending_fis[0], r+16, ATA_RESP_FIS_SIZE); |
205 | ts->buf_valid_size = sizeof(*resp); | 205 | ts->buf_valid_size = sizeof(*resp); |
206 | } | 206 | } |
207 | } | 207 | } |
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h index 0c53c28dc3d3..7e77cf620291 100644 --- a/drivers/scsi/bnx2i/bnx2i.h +++ b/drivers/scsi/bnx2i/bnx2i.h | |||
@@ -350,6 +350,7 @@ struct bnx2i_hba { | |||
350 | struct pci_dev *pcidev; | 350 | struct pci_dev *pcidev; |
351 | struct net_device *netdev; | 351 | struct net_device *netdev; |
352 | void __iomem *regview; | 352 | void __iomem *regview; |
353 | resource_size_t reg_base; | ||
353 | 354 | ||
354 | u32 age; | 355 | u32 age; |
355 | unsigned long cnic_dev_type; | 356 | unsigned long cnic_dev_type; |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index ece47e502282..86a12b48e477 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -2724,7 +2724,6 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) | |||
2724 | goto arm_cq; | 2724 | goto arm_cq; |
2725 | } | 2725 | } |
2726 | 2726 | ||
2727 | reg_base = ep->hba->netdev->base_addr; | ||
2728 | if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) && | 2727 | if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) && |
2729 | (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) { | 2728 | (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) { |
2730 | config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2); | 2729 | config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2); |
@@ -2740,7 +2739,7 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) | |||
2740 | /* 5709 device in normal node and 5706/5708 devices */ | 2739 | /* 5709 device in normal node and 5706/5708 devices */ |
2741 | reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num); | 2740 | reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num); |
2742 | 2741 | ||
2743 | ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, | 2742 | ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off, |
2744 | MB_KERNEL_CTX_SIZE); | 2743 | MB_KERNEL_CTX_SIZE); |
2745 | if (!ep->qp.ctx_base) | 2744 | if (!ep->qp.ctx_base) |
2746 | return -ENOMEM; | 2745 | return -ENOMEM; |
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index f8d516b53161..621538b8b544 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c | |||
@@ -811,13 +811,13 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic) | |||
811 | bnx2i_identify_device(hba); | 811 | bnx2i_identify_device(hba); |
812 | bnx2i_setup_host_queue_size(hba, shost); | 812 | bnx2i_setup_host_queue_size(hba, shost); |
813 | 813 | ||
814 | hba->reg_base = pci_resource_start(hba->pcidev, 0); | ||
814 | if (test_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type)) { | 815 | if (test_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type)) { |
815 | hba->regview = ioremap_nocache(hba->netdev->base_addr, | 816 | hba->regview = pci_iomap(hba->pcidev, 0, BNX2_MQ_CONFIG2); |
816 | BNX2_MQ_CONFIG2); | ||
817 | if (!hba->regview) | 817 | if (!hba->regview) |
818 | goto ioreg_map_err; | 818 | goto ioreg_map_err; |
819 | } else if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) { | 819 | } else if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) { |
820 | hba->regview = ioremap_nocache(hba->netdev->base_addr, 4096); | 820 | hba->regview = pci_iomap(hba->pcidev, 0, 4096); |
821 | if (!hba->regview) | 821 | if (!hba->regview) |
822 | goto ioreg_map_err; | 822 | goto ioreg_map_err; |
823 | } | 823 | } |
@@ -884,7 +884,7 @@ cid_que_err: | |||
884 | bnx2i_free_mp_bdt(hba); | 884 | bnx2i_free_mp_bdt(hba); |
885 | mp_bdt_mem_err: | 885 | mp_bdt_mem_err: |
886 | if (hba->regview) { | 886 | if (hba->regview) { |
887 | iounmap(hba->regview); | 887 | pci_iounmap(hba->pcidev, hba->regview); |
888 | hba->regview = NULL; | 888 | hba->regview = NULL; |
889 | } | 889 | } |
890 | ioreg_map_err: | 890 | ioreg_map_err: |
@@ -910,7 +910,7 @@ void bnx2i_free_hba(struct bnx2i_hba *hba) | |||
910 | pci_dev_put(hba->pcidev); | 910 | pci_dev_put(hba->pcidev); |
911 | 911 | ||
912 | if (hba->regview) { | 912 | if (hba->regview) { |
913 | iounmap(hba->regview); | 913 | pci_iounmap(hba->pcidev, hba->regview); |
914 | hba->regview = NULL; | 914 | hba->regview = NULL; |
915 | } | 915 | } |
916 | bnx2i_free_mp_bdt(hba); | 916 | bnx2i_free_mp_bdt(hba); |
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 441d88ad99a7..d109cc3a17b6 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -139,12 +139,12 @@ static void sas_ata_task_done(struct sas_task *task) | |||
139 | if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD || | 139 | if (stat->stat == SAS_PROTO_RESPONSE || stat->stat == SAM_STAT_GOOD || |
140 | ((stat->stat == SAM_STAT_CHECK_CONDITION && | 140 | ((stat->stat == SAM_STAT_CHECK_CONDITION && |
141 | dev->sata_dev.command_set == ATAPI_COMMAND_SET))) { | 141 | dev->sata_dev.command_set == ATAPI_COMMAND_SET))) { |
142 | ata_tf_from_fis(resp->ending_fis, &dev->sata_dev.tf); | 142 | memcpy(dev->sata_dev.fis, resp->ending_fis, ATA_RESP_FIS_SIZE); |
143 | 143 | ||
144 | if (!link->sactive) { | 144 | if (!link->sactive) { |
145 | qc->err_mask |= ac_err_mask(dev->sata_dev.tf.command); | 145 | qc->err_mask |= ac_err_mask(dev->sata_dev.fis[2]); |
146 | } else { | 146 | } else { |
147 | link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.tf.command); | 147 | link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.fis[2]); |
148 | if (unlikely(link->eh_info.err_mask)) | 148 | if (unlikely(link->eh_info.err_mask)) |
149 | qc->flags |= ATA_QCFLAG_FAILED; | 149 | qc->flags |= ATA_QCFLAG_FAILED; |
150 | } | 150 | } |
@@ -161,8 +161,8 @@ static void sas_ata_task_done(struct sas_task *task) | |||
161 | qc->flags |= ATA_QCFLAG_FAILED; | 161 | qc->flags |= ATA_QCFLAG_FAILED; |
162 | } | 162 | } |
163 | 163 | ||
164 | dev->sata_dev.tf.feature = 0x04; /* status err */ | 164 | dev->sata_dev.fis[3] = 0x04; /* status err */ |
165 | dev->sata_dev.tf.command = ATA_ERR; | 165 | dev->sata_dev.fis[2] = ATA_ERR; |
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
@@ -269,7 +269,7 @@ static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc) | |||
269 | { | 269 | { |
270 | struct domain_device *dev = qc->ap->private_data; | 270 | struct domain_device *dev = qc->ap->private_data; |
271 | 271 | ||
272 | memcpy(&qc->result_tf, &dev->sata_dev.tf, sizeof(qc->result_tf)); | 272 | ata_tf_from_fis(dev->sata_dev.fis, &qc->result_tf); |
273 | return true; | 273 | return true; |
274 | } | 274 | } |
275 | 275 | ||
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 6102ef2cb2d8..9d46fcbe7755 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -1792,7 +1792,7 @@ static inline void _base_writeq(__u64 b, volatile void __iomem *addr, | |||
1792 | static inline u8 | 1792 | static inline u8 |
1793 | _base_get_msix_index(struct MPT2SAS_ADAPTER *ioc) | 1793 | _base_get_msix_index(struct MPT2SAS_ADAPTER *ioc) |
1794 | { | 1794 | { |
1795 | return ioc->cpu_msix_table[smp_processor_id()]; | 1795 | return ioc->cpu_msix_table[raw_smp_processor_id()]; |
1796 | } | 1796 | } |
1797 | 1797 | ||
1798 | /** | 1798 | /** |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 04f80ebf09eb..77759c78cc21 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/version.h> | ||
30 | #include <linux/blkdev.h> | 29 | #include <linux/blkdev.h> |
31 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
32 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
@@ -2477,11 +2476,9 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, uint32_t handle, | |||
2477 | } | 2476 | } |
2478 | 2477 | ||
2479 | cmd = qlt_ctio_to_cmd(vha, handle, ctio); | 2478 | cmd = qlt_ctio_to_cmd(vha, handle, ctio); |
2480 | if (cmd == NULL) { | 2479 | if (cmd == NULL) |
2481 | if (status != CTIO_SUCCESS) | ||
2482 | qlt_term_ctio_exchange(vha, ctio, NULL, status); | ||
2483 | return; | 2480 | return; |
2484 | } | 2481 | |
2485 | se_cmd = &cmd->se_cmd; | 2482 | se_cmd = &cmd->se_cmd; |
2486 | tfo = se_cmd->se_tfo; | 2483 | tfo = se_cmd->se_tfo; |
2487 | 2484 | ||
@@ -2727,10 +2724,12 @@ static void qlt_do_work(struct work_struct *work) | |||
2727 | out_term: | 2724 | out_term: |
2728 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf020, "Terminating work cmd %p", cmd); | 2725 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf020, "Terminating work cmd %p", cmd); |
2729 | /* | 2726 | /* |
2730 | * cmd has not sent to target yet, so pass NULL as the second argument | 2727 | * cmd has not sent to target yet, so pass NULL as the second |
2728 | * argument to qlt_send_term_exchange() and free the memory here. | ||
2731 | */ | 2729 | */ |
2732 | spin_lock_irqsave(&ha->hardware_lock, flags); | 2730 | spin_lock_irqsave(&ha->hardware_lock, flags); |
2733 | qlt_send_term_exchange(vha, NULL, &cmd->atio, 1); | 2731 | qlt_send_term_exchange(vha, NULL, &cmd->atio, 1); |
2732 | kmem_cache_free(qla_tgt_cmd_cachep, cmd); | ||
2734 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 2733 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
2735 | if (sess) | 2734 | if (sess) |
2736 | ha->tgt.tgt_ops->put_sess(sess); | 2735 | ha->tgt.tgt_ops->put_sess(sess); |
@@ -3961,7 +3960,7 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
3961 | { | 3960 | { |
3962 | struct qla_hw_data *ha = vha->hw; | 3961 | struct qla_hw_data *ha = vha->hw; |
3963 | struct qla_tgt *tgt = ha->tgt.qla_tgt; | 3962 | struct qla_tgt *tgt = ha->tgt.qla_tgt; |
3964 | int reason_code; | 3963 | int login_code; |
3965 | 3964 | ||
3966 | ql_dbg(ql_dbg_tgt, vha, 0xe039, | 3965 | ql_dbg(ql_dbg_tgt, vha, 0xe039, |
3967 | "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", |
@@ -4004,9 +4003,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4004 | { | 4003 | { |
4005 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b, | 4004 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b, |
4006 | "qla_target(%d): Async LOOP_UP occured " | 4005 | "qla_target(%d): Async LOOP_UP occured " |
4007 | "(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, |
4008 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4007 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4009 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4008 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4010 | if (tgt->link_reinit_iocb_pending) { | 4009 | if (tgt->link_reinit_iocb_pending) { |
4011 | qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb, | 4010 | qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb, |
4012 | 0, 0, 0, 0, 0, 0); | 4011 | 0, 0, 0, 0, 0, 0); |
@@ -4021,23 +4020,24 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4021 | case MBA_RSCN_UPDATE: | 4020 | case MBA_RSCN_UPDATE: |
4022 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c, | 4021 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c, |
4023 | "qla_target(%d): Async event %#x occured " | 4022 | "qla_target(%d): Async event %#x occured " |
4024 | "(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, |
4025 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4024 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4026 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4025 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4027 | break; | 4026 | break; |
4028 | 4027 | ||
4029 | case MBA_PORT_UPDATE: | 4028 | case MBA_PORT_UPDATE: |
4030 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d, | 4029 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d, |
4031 | "qla_target(%d): Port update async event %#x " | 4030 | "qla_target(%d): Port update async event %#x " |
4032 | "occured: updating the ports database (m[1]=%x, m[2]=%x, " | 4031 | "occured: updating the ports database (m[0]=%x, m[1]=%x, " |
4033 | "m[3]=%x, m[4]=%x)", vha->vp_idx, code, | 4032 | "m[2]=%x, m[3]=%x)", vha->vp_idx, code, |
4034 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4033 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4035 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4034 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4036 | reason_code = le16_to_cpu(mailbox[2]); | 4035 | |
4037 | if (reason_code == 0x4) | 4036 | login_code = le16_to_cpu(mailbox[2]); |
4037 | if (login_code == 0x4) | ||
4038 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e, | 4038 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e, |
4039 | "Async MB 2: Got PLOGI Complete\n"); | 4039 | "Async MB 2: Got PLOGI Complete\n"); |
4040 | else if (reason_code == 0x7) | 4040 | else if (login_code == 0x7) |
4041 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f, | 4041 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f, |
4042 | "Async MB 2: Port Logged Out\n"); | 4042 | "Async MB 2: Port Logged Out\n"); |
4043 | break; | 4043 | break; |
@@ -4045,9 +4045,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4045 | default: | 4045 | default: |
4046 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040, | 4046 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040, |
4047 | "qla_target(%d): Async event %#x occured: " | 4047 | "qla_target(%d): Async event %#x occured: " |
4048 | "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, |
4049 | code, le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4049 | code, le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4050 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4050 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4051 | break; | 4051 | break; |
4052 | } | 4052 | } |
4053 | 4053 | ||
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index 9ec19bc2f0fe..9f9ef1644fd9 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h | |||
@@ -919,7 +919,6 @@ struct qla_tgt_srr_ctio { | |||
919 | #define QLA_TGT_XMIT_STATUS 2 | 919 | #define QLA_TGT_XMIT_STATUS 2 |
920 | #define QLA_TGT_XMIT_ALL (QLA_TGT_XMIT_STATUS|QLA_TGT_XMIT_DATA) | 920 | #define QLA_TGT_XMIT_ALL (QLA_TGT_XMIT_STATUS|QLA_TGT_XMIT_DATA) |
921 | 921 | ||
922 | #include <linux/version.h> | ||
923 | 922 | ||
924 | extern struct qla_tgt_data qla_target; | 923 | extern struct qla_tgt_data qla_target; |
925 | /* | 924 | /* |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 436598f57404..6e64314dbbb3 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -137,13 +137,15 @@ static char *tcm_qla2xxx_get_fabric_name(void) | |||
137 | */ | 137 | */ |
138 | static int tcm_qla2xxx_npiv_extract_wwn(const char *ns, u64 *nm) | 138 | static int tcm_qla2xxx_npiv_extract_wwn(const char *ns, u64 *nm) |
139 | { | 139 | { |
140 | unsigned int i, j, value; | 140 | unsigned int i, j; |
141 | u8 wwn[8]; | 141 | u8 wwn[8]; |
142 | 142 | ||
143 | memset(wwn, 0, sizeof(wwn)); | 143 | memset(wwn, 0, sizeof(wwn)); |
144 | 144 | ||
145 | /* Validate and store the new name */ | 145 | /* Validate and store the new name */ |
146 | for (i = 0, j = 0; i < 16; i++) { | 146 | for (i = 0, j = 0; i < 16; i++) { |
147 | int value; | ||
148 | |||
147 | value = hex_to_bin(*ns++); | 149 | value = hex_to_bin(*ns++); |
148 | if (value >= 0) | 150 | if (value >= 0) |
149 | j = (j << 4) | value; | 151 | j = (j << 4) | value; |
@@ -652,8 +654,8 @@ static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) | |||
652 | /* | 654 | /* |
653 | * Called from qla_target.c:qlt_issue_task_mgmt() | 655 | * Called from qla_target.c:qlt_issue_task_mgmt() |
654 | */ | 656 | */ |
655 | int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun, | 657 | static int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun, |
656 | uint8_t tmr_func, uint32_t tag) | 658 | uint8_t tmr_func, uint32_t tag) |
657 | { | 659 | { |
658 | struct qla_tgt_sess *sess = mcmd->sess; | 660 | struct qla_tgt_sess *sess = mcmd->sess; |
659 | struct se_cmd *se_cmd = &mcmd->se_cmd; | 661 | struct se_cmd *se_cmd = &mcmd->se_cmd; |
@@ -762,65 +764,8 @@ static u16 tcm_qla2xxx_set_fabric_sense_len(struct se_cmd *se_cmd, | |||
762 | struct target_fabric_configfs *tcm_qla2xxx_fabric_configfs; | 764 | struct target_fabric_configfs *tcm_qla2xxx_fabric_configfs; |
763 | struct target_fabric_configfs *tcm_qla2xxx_npiv_fabric_configfs; | 765 | struct target_fabric_configfs *tcm_qla2xxx_npiv_fabric_configfs; |
764 | 766 | ||
765 | static int tcm_qla2xxx_setup_nacl_from_rport( | 767 | static void tcm_qla2xxx_clear_sess_lookup(struct tcm_qla2xxx_lport *, |
766 | struct se_portal_group *se_tpg, | 768 | struct tcm_qla2xxx_nacl *, struct qla_tgt_sess *); |
767 | struct se_node_acl *se_nacl, | ||
768 | struct tcm_qla2xxx_lport *lport, | ||
769 | struct tcm_qla2xxx_nacl *nacl, | ||
770 | u64 rport_wwnn) | ||
771 | { | ||
772 | struct scsi_qla_host *vha = lport->qla_vha; | ||
773 | struct Scsi_Host *sh = vha->host; | ||
774 | struct fc_host_attrs *fc_host = shost_to_fc_host(sh); | ||
775 | struct fc_rport *rport; | ||
776 | unsigned long flags; | ||
777 | void *node; | ||
778 | int rc; | ||
779 | |||
780 | /* | ||
781 | * Scan the existing rports, and create a session for the | ||
782 | * explict NodeACL is an matching rport->node_name already | ||
783 | * exists. | ||
784 | */ | ||
785 | spin_lock_irqsave(sh->host_lock, flags); | ||
786 | list_for_each_entry(rport, &fc_host->rports, peers) { | ||
787 | if (rport_wwnn != rport->node_name) | ||
788 | continue; | ||
789 | |||
790 | pr_debug("Located existing rport_wwpn and rport->node_name: 0x%016LX, port_id: 0x%04x\n", | ||
791 | rport->node_name, rport->port_id); | ||
792 | nacl->nport_id = rport->port_id; | ||
793 | |||
794 | spin_unlock_irqrestore(sh->host_lock, flags); | ||
795 | |||
796 | spin_lock_irqsave(&vha->hw->hardware_lock, flags); | ||
797 | node = btree_lookup32(&lport->lport_fcport_map, rport->port_id); | ||
798 | if (node) { | ||
799 | rc = btree_update32(&lport->lport_fcport_map, | ||
800 | rport->port_id, se_nacl); | ||
801 | } else { | ||
802 | rc = btree_insert32(&lport->lport_fcport_map, | ||
803 | rport->port_id, se_nacl, | ||
804 | GFP_ATOMIC); | ||
805 | } | ||
806 | spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); | ||
807 | |||
808 | if (rc) { | ||
809 | pr_err("Unable to insert se_nacl into fcport_map"); | ||
810 | WARN_ON(rc > 0); | ||
811 | return rc; | ||
812 | } | ||
813 | |||
814 | pr_debug("Inserted into fcport_map: %p for WWNN: 0x%016LX, port_id: 0x%08x\n", | ||
815 | se_nacl, rport_wwnn, nacl->nport_id); | ||
816 | |||
817 | return 1; | ||
818 | } | ||
819 | spin_unlock_irqrestore(sh->host_lock, flags); | ||
820 | |||
821 | return 0; | ||
822 | } | ||
823 | |||
824 | /* | 769 | /* |
825 | * Expected to be called with struct qla_hw_data->hardware_lock held | 770 | * Expected to be called with struct qla_hw_data->hardware_lock held |
826 | */ | 771 | */ |
@@ -842,11 +787,40 @@ static void tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess) | |||
842 | 787 | ||
843 | pr_debug("Removed from fcport_map: %p for WWNN: 0x%016LX, port_id: 0x%06x\n", | 788 | pr_debug("Removed from fcport_map: %p for WWNN: 0x%016LX, port_id: 0x%06x\n", |
844 | se_nacl, nacl->nport_wwnn, nacl->nport_id); | 789 | se_nacl, nacl->nport_wwnn, nacl->nport_id); |
790 | /* | ||
791 | * Now clear the se_nacl and session pointers from our HW lport lookup | ||
792 | * table mapping for this initiator's fabric S_ID and LOOP_ID entries. | ||
793 | * | ||
794 | * This is done ahead of callbacks into tcm_qla2xxx_free_session() -> | ||
795 | * target_wait_for_sess_cmds() before the session waits for outstanding | ||
796 | * I/O to complete, to avoid a race between session shutdown execution | ||
797 | * and incoming ATIOs or TMRs picking up a stale se_node_act reference. | ||
798 | */ | ||
799 | tcm_qla2xxx_clear_sess_lookup(lport, nacl, sess); | ||
800 | } | ||
801 | |||
802 | static void tcm_qla2xxx_release_session(struct kref *kref) | ||
803 | { | ||
804 | struct se_session *se_sess = container_of(kref, | ||
805 | struct se_session, sess_kref); | ||
806 | |||
807 | qlt_unreg_sess(se_sess->fabric_sess_ptr); | ||
808 | } | ||
809 | |||
810 | static void tcm_qla2xxx_put_session(struct se_session *se_sess) | ||
811 | { | ||
812 | struct qla_tgt_sess *sess = se_sess->fabric_sess_ptr; | ||
813 | struct qla_hw_data *ha = sess->vha->hw; | ||
814 | unsigned long flags; | ||
815 | |||
816 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
817 | kref_put(&se_sess->sess_kref, tcm_qla2xxx_release_session); | ||
818 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
845 | } | 819 | } |
846 | 820 | ||
847 | static void tcm_qla2xxx_put_sess(struct qla_tgt_sess *sess) | 821 | static void tcm_qla2xxx_put_sess(struct qla_tgt_sess *sess) |
848 | { | 822 | { |
849 | target_put_session(sess->se_sess); | 823 | tcm_qla2xxx_put_session(sess->se_sess); |
850 | } | 824 | } |
851 | 825 | ||
852 | static void tcm_qla2xxx_shutdown_sess(struct qla_tgt_sess *sess) | 826 | static void tcm_qla2xxx_shutdown_sess(struct qla_tgt_sess *sess) |
@@ -859,14 +833,10 @@ static struct se_node_acl *tcm_qla2xxx_make_nodeacl( | |||
859 | struct config_group *group, | 833 | struct config_group *group, |
860 | const char *name) | 834 | const char *name) |
861 | { | 835 | { |
862 | struct se_wwn *se_wwn = se_tpg->se_tpg_wwn; | ||
863 | struct tcm_qla2xxx_lport *lport = container_of(se_wwn, | ||
864 | struct tcm_qla2xxx_lport, lport_wwn); | ||
865 | struct se_node_acl *se_nacl, *se_nacl_new; | 836 | struct se_node_acl *se_nacl, *se_nacl_new; |
866 | struct tcm_qla2xxx_nacl *nacl; | 837 | struct tcm_qla2xxx_nacl *nacl; |
867 | u64 wwnn; | 838 | u64 wwnn; |
868 | u32 qla2xxx_nexus_depth; | 839 | u32 qla2xxx_nexus_depth; |
869 | int rc; | ||
870 | 840 | ||
871 | if (tcm_qla2xxx_parse_wwn(name, &wwnn, 1) < 0) | 841 | if (tcm_qla2xxx_parse_wwn(name, &wwnn, 1) < 0) |
872 | return ERR_PTR(-EINVAL); | 842 | return ERR_PTR(-EINVAL); |
@@ -893,16 +863,6 @@ static struct se_node_acl *tcm_qla2xxx_make_nodeacl( | |||
893 | nacl = container_of(se_nacl, struct tcm_qla2xxx_nacl, se_node_acl); | 863 | nacl = container_of(se_nacl, struct tcm_qla2xxx_nacl, se_node_acl); |
894 | nacl->nport_wwnn = wwnn; | 864 | nacl->nport_wwnn = wwnn; |
895 | tcm_qla2xxx_format_wwn(&nacl->nport_name[0], TCM_QLA2XXX_NAMELEN, wwnn); | 865 | tcm_qla2xxx_format_wwn(&nacl->nport_name[0], TCM_QLA2XXX_NAMELEN, wwnn); |
896 | /* | ||
897 | * Setup a se_nacl handle based on an a matching struct fc_rport setup | ||
898 | * via drivers/scsi/qla2xxx/qla_init.c:qla2x00_reg_remote_port() | ||
899 | */ | ||
900 | rc = tcm_qla2xxx_setup_nacl_from_rport(se_tpg, se_nacl, lport, | ||
901 | nacl, wwnn); | ||
902 | if (rc < 0) { | ||
903 | tcm_qla2xxx_release_fabric_acl(se_tpg, se_nacl_new); | ||
904 | return ERR_PTR(rc); | ||
905 | } | ||
906 | 866 | ||
907 | return se_nacl; | 867 | return se_nacl; |
908 | } | 868 | } |
@@ -1390,6 +1350,25 @@ static void tcm_qla2xxx_set_sess_by_loop_id( | |||
1390 | nacl->qla_tgt_sess, new_se_nacl, new_se_nacl->initiatorname); | 1350 | nacl->qla_tgt_sess, new_se_nacl, new_se_nacl->initiatorname); |
1391 | } | 1351 | } |
1392 | 1352 | ||
1353 | /* | ||
1354 | * Should always be called with qla_hw_data->hardware_lock held. | ||
1355 | */ | ||
1356 | static void tcm_qla2xxx_clear_sess_lookup(struct tcm_qla2xxx_lport *lport, | ||
1357 | struct tcm_qla2xxx_nacl *nacl, struct qla_tgt_sess *sess) | ||
1358 | { | ||
1359 | struct se_session *se_sess = sess->se_sess; | ||
1360 | unsigned char be_sid[3]; | ||
1361 | |||
1362 | be_sid[0] = sess->s_id.b.domain; | ||
1363 | be_sid[1] = sess->s_id.b.area; | ||
1364 | be_sid[2] = sess->s_id.b.al_pa; | ||
1365 | |||
1366 | tcm_qla2xxx_set_sess_by_s_id(lport, NULL, nacl, se_sess, | ||
1367 | sess, be_sid); | ||
1368 | tcm_qla2xxx_set_sess_by_loop_id(lport, NULL, nacl, se_sess, | ||
1369 | sess, sess->loop_id); | ||
1370 | } | ||
1371 | |||
1393 | static void tcm_qla2xxx_free_session(struct qla_tgt_sess *sess) | 1372 | static void tcm_qla2xxx_free_session(struct qla_tgt_sess *sess) |
1394 | { | 1373 | { |
1395 | struct qla_tgt *tgt = sess->tgt; | 1374 | struct qla_tgt *tgt = sess->tgt; |
@@ -1398,8 +1377,6 @@ static void tcm_qla2xxx_free_session(struct qla_tgt_sess *sess) | |||
1398 | struct se_node_acl *se_nacl; | 1377 | struct se_node_acl *se_nacl; |
1399 | struct tcm_qla2xxx_lport *lport; | 1378 | struct tcm_qla2xxx_lport *lport; |
1400 | struct tcm_qla2xxx_nacl *nacl; | 1379 | struct tcm_qla2xxx_nacl *nacl; |
1401 | unsigned char be_sid[3]; | ||
1402 | unsigned long flags; | ||
1403 | 1380 | ||
1404 | BUG_ON(in_interrupt()); | 1381 | BUG_ON(in_interrupt()); |
1405 | 1382 | ||
@@ -1419,21 +1396,6 @@ static void tcm_qla2xxx_free_session(struct qla_tgt_sess *sess) | |||
1419 | return; | 1396 | return; |
1420 | } | 1397 | } |
1421 | target_wait_for_sess_cmds(se_sess, 0); | 1398 | target_wait_for_sess_cmds(se_sess, 0); |
1422 | /* | ||
1423 | * And now clear the se_nacl and session pointers from our HW lport | ||
1424 | * mappings for fabric S_ID and LOOP_ID. | ||
1425 | */ | ||
1426 | memset(&be_sid, 0, 3); | ||
1427 | be_sid[0] = sess->s_id.b.domain; | ||
1428 | be_sid[1] = sess->s_id.b.area; | ||
1429 | be_sid[2] = sess->s_id.b.al_pa; | ||
1430 | |||
1431 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
1432 | tcm_qla2xxx_set_sess_by_s_id(lport, NULL, nacl, se_sess, | ||
1433 | sess, be_sid); | ||
1434 | tcm_qla2xxx_set_sess_by_loop_id(lport, NULL, nacl, se_sess, | ||
1435 | sess, sess->loop_id); | ||
1436 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
1437 | 1399 | ||
1438 | transport_deregister_session_configfs(sess->se_sess); | 1400 | transport_deregister_session_configfs(sess->se_sess); |
1439 | transport_deregister_session(sess->se_sess); | 1401 | transport_deregister_session(sess->se_sess); |
@@ -1731,6 +1693,7 @@ static struct target_core_fabric_ops tcm_qla2xxx_ops = { | |||
1731 | .new_cmd_map = NULL, | 1693 | .new_cmd_map = NULL, |
1732 | .check_stop_free = tcm_qla2xxx_check_stop_free, | 1694 | .check_stop_free = tcm_qla2xxx_check_stop_free, |
1733 | .release_cmd = tcm_qla2xxx_release_cmd, | 1695 | .release_cmd = tcm_qla2xxx_release_cmd, |
1696 | .put_session = tcm_qla2xxx_put_session, | ||
1734 | .shutdown_session = tcm_qla2xxx_shutdown_session, | 1697 | .shutdown_session = tcm_qla2xxx_shutdown_session, |
1735 | .close_session = tcm_qla2xxx_close_session, | 1698 | .close_session = tcm_qla2xxx_close_session, |
1736 | .sess_get_index = tcm_qla2xxx_sess_get_index, | 1699 | .sess_get_index = tcm_qla2xxx_sess_get_index, |
@@ -1779,6 +1742,7 @@ static struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { | |||
1779 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, | 1742 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, |
1780 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, | 1743 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, |
1781 | .release_cmd = tcm_qla2xxx_release_cmd, | 1744 | .release_cmd = tcm_qla2xxx_release_cmd, |
1745 | .put_session = tcm_qla2xxx_put_session, | ||
1782 | .shutdown_session = tcm_qla2xxx_shutdown_session, | 1746 | .shutdown_session = tcm_qla2xxx_shutdown_session, |
1783 | .close_session = tcm_qla2xxx_close_session, | 1747 | .close_session = tcm_qla2xxx_close_session, |
1784 | .sess_get_index = tcm_qla2xxx_sess_get_index, | 1748 | .sess_get_index = tcm_qla2xxx_sess_get_index, |
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 61c82a345f82..bbbc9c918d4c 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -90,11 +90,9 @@ unsigned int scsi_logging_level; | |||
90 | EXPORT_SYMBOL(scsi_logging_level); | 90 | EXPORT_SYMBOL(scsi_logging_level); |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | #if IS_ENABLED(CONFIG_PM) || IS_ENABLED(CONFIG_BLK_DEV_SD) | 93 | /* sd, scsi core and power management need to coordinate flushing async actions */ |
94 | /* sd and scsi_pm need to coordinate flushing async actions */ | ||
95 | LIST_HEAD(scsi_sd_probe_domain); | 94 | LIST_HEAD(scsi_sd_probe_domain); |
96 | EXPORT_SYMBOL(scsi_sd_probe_domain); | 95 | EXPORT_SYMBOL(scsi_sd_probe_domain); |
97 | #endif | ||
98 | 96 | ||
99 | /* NB: These are exposed through /proc/scsi/scsi and form part of the ABI. | 97 | /* NB: These are exposed through /proc/scsi/scsi and form part of the ABI. |
100 | * You may not alter any existing entry (although adding new ones is | 98 | * You may not alter any existing entry (although adding new ones is |
diff --git a/drivers/scsi/scsi_wait_scan.c b/drivers/scsi/scsi_wait_scan.c index ae7814874618..072734538876 100644 --- a/drivers/scsi/scsi_wait_scan.c +++ b/drivers/scsi/scsi_wait_scan.c | |||
@@ -22,11 +22,6 @@ static int __init wait_scan_init(void) | |||
22 | * and might not yet have reached the scsi async scanning | 22 | * and might not yet have reached the scsi async scanning |
23 | */ | 23 | */ |
24 | wait_for_device_probe(); | 24 | wait_for_device_probe(); |
25 | /* | ||
26 | * and then we wait for the actual asynchronous scsi scan | ||
27 | * to finish. | ||
28 | */ | ||
29 | scsi_complete_async_scans(); | ||
30 | return 0; | 25 | return 0; |
31 | } | 26 | } |
32 | 27 | ||
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/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/target_core_alua.c b/drivers/target/target_core_alua.c index e624b836469c..91799973081a 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c | |||
@@ -374,8 +374,9 @@ int target_emulate_set_target_port_groups(struct se_cmd *cmd) | |||
374 | 374 | ||
375 | out: | 375 | out: |
376 | transport_kunmap_data_sg(cmd); | 376 | transport_kunmap_data_sg(cmd); |
377 | target_complete_cmd(cmd, GOOD); | 377 | if (!rc) |
378 | return 0; | 378 | target_complete_cmd(cmd, GOOD); |
379 | return rc; | ||
379 | } | 380 | } |
380 | 381 | ||
381 | static inline int core_alua_state_nonoptimized( | 382 | static inline int core_alua_state_nonoptimized( |
diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c index 9888693a18fe..664f6e775d0e 100644 --- a/drivers/target/target_core_cdb.c +++ b/drivers/target/target_core_cdb.c | |||
@@ -1095,7 +1095,7 @@ int target_emulate_write_same(struct se_cmd *cmd) | |||
1095 | if (num_blocks != 0) | 1095 | if (num_blocks != 0) |
1096 | range = num_blocks; | 1096 | range = num_blocks; |
1097 | else | 1097 | else |
1098 | range = (dev->transport->get_blocks(dev) - lba); | 1098 | range = (dev->transport->get_blocks(dev) - lba) + 1; |
1099 | 1099 | ||
1100 | pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n", | 1100 | pr_debug("WRITE_SAME UNMAP: LBA: %llu Range: %llu\n", |
1101 | (unsigned long long)lba, (unsigned long long)range); | 1101 | (unsigned long long)lba, (unsigned long long)range); |
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 85564998500a..a1bcd927a9e6 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
@@ -2031,7 +2031,7 @@ static int __core_scsi3_write_aptpl_to_file( | |||
2031 | if (IS_ERR(file) || !file || !file->f_dentry) { | 2031 | if (IS_ERR(file) || !file || !file->f_dentry) { |
2032 | pr_err("filp_open(%s) for APTPL metadata" | 2032 | pr_err("filp_open(%s) for APTPL metadata" |
2033 | " failed\n", path); | 2033 | " failed\n", path); |
2034 | return (PTR_ERR(file) < 0 ? PTR_ERR(file) : -ENOENT); | 2034 | return IS_ERR(file) ? PTR_ERR(file) : -ENOENT; |
2035 | } | 2035 | } |
2036 | 2036 | ||
2037 | iov[0].iov_base = &buf[0]; | 2037 | iov[0].iov_base = &buf[0]; |
@@ -3818,7 +3818,7 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd) | |||
3818 | " SPC-2 reservation is held, returning" | 3818 | " SPC-2 reservation is held, returning" |
3819 | " RESERVATION_CONFLICT\n"); | 3819 | " RESERVATION_CONFLICT\n"); |
3820 | cmd->scsi_sense_reason = TCM_RESERVATION_CONFLICT; | 3820 | cmd->scsi_sense_reason = TCM_RESERVATION_CONFLICT; |
3821 | ret = EINVAL; | 3821 | ret = -EINVAL; |
3822 | goto out; | 3822 | goto out; |
3823 | } | 3823 | } |
3824 | 3824 | ||
@@ -3828,7 +3828,8 @@ int target_scsi3_emulate_pr_out(struct se_cmd *cmd) | |||
3828 | */ | 3828 | */ |
3829 | if (!cmd->se_sess) { | 3829 | if (!cmd->se_sess) { |
3830 | cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | 3830 | cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; |
3831 | return -EINVAL; | 3831 | ret = -EINVAL; |
3832 | goto out; | ||
3832 | } | 3833 | } |
3833 | 3834 | ||
3834 | if (cmd->data_length < 24) { | 3835 | if (cmd->data_length < 24) { |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index b05fdc0c05d3..634d0f31a28c 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -315,7 +315,7 @@ void transport_register_session( | |||
315 | } | 315 | } |
316 | EXPORT_SYMBOL(transport_register_session); | 316 | EXPORT_SYMBOL(transport_register_session); |
317 | 317 | ||
318 | static void target_release_session(struct kref *kref) | 318 | void target_release_session(struct kref *kref) |
319 | { | 319 | { |
320 | struct se_session *se_sess = container_of(kref, | 320 | struct se_session *se_sess = container_of(kref, |
321 | struct se_session, sess_kref); | 321 | struct se_session, sess_kref); |
@@ -332,6 +332,12 @@ EXPORT_SYMBOL(target_get_session); | |||
332 | 332 | ||
333 | void target_put_session(struct se_session *se_sess) | 333 | void target_put_session(struct se_session *se_sess) |
334 | { | 334 | { |
335 | struct se_portal_group *tpg = se_sess->se_tpg; | ||
336 | |||
337 | if (tpg->se_tpg_tfo->put_session != NULL) { | ||
338 | tpg->se_tpg_tfo->put_session(se_sess); | ||
339 | return; | ||
340 | } | ||
335 | kref_put(&se_sess->sess_kref, target_release_session); | 341 | kref_put(&se_sess->sess_kref, target_release_session); |
336 | } | 342 | } |
337 | EXPORT_SYMBOL(target_put_session); | 343 | EXPORT_SYMBOL(target_put_session); |
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index f03fb9730f5b..5b65f33939a8 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c | |||
@@ -230,6 +230,8 @@ u32 ft_get_task_tag(struct se_cmd *se_cmd) | |||
230 | { | 230 | { |
231 | struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); | 231 | struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); |
232 | 232 | ||
233 | if (cmd->aborted) | ||
234 | return ~0; | ||
233 | return fc_seq_exch(cmd->seq)->rxid; | 235 | return fc_seq_exch(cmd->seq)->rxid; |
234 | } | 236 | } |
235 | 237 | ||
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/thermal/Kconfig b/drivers/thermal/Kconfig index 514a691abea0..3ab2bd540b54 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig | |||
@@ -23,6 +23,7 @@ config SPEAR_THERMAL | |||
23 | bool "SPEAr thermal sensor driver" | 23 | bool "SPEAr thermal sensor driver" |
24 | depends on THERMAL | 24 | depends on THERMAL |
25 | depends on PLAT_SPEAR | 25 | depends on PLAT_SPEAR |
26 | depends on OF | ||
26 | help | 27 | help |
27 | Enable this to plug the SPEAr thermal sensor driver into the Linux | 28 | Enable this to plug the SPEAr thermal sensor driver into the Linux |
28 | thermal framework | 29 | thermal framework |
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index c2e32df3b164..5f8ee39f2000 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c | |||
@@ -20,9 +20,9 @@ | |||
20 | #include <linux/err.h> | 20 | #include <linux/err.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/of.h> | ||
23 | #include <linux/module.h> | 24 | #include <linux/module.h> |
24 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
25 | #include <linux/platform_data/spear_thermal.h> | ||
26 | #include <linux/thermal.h> | 26 | #include <linux/thermal.h> |
27 | 27 | ||
28 | #define MD_FACTOR 1000 | 28 | #define MD_FACTOR 1000 |
@@ -103,21 +103,20 @@ static int spear_thermal_probe(struct platform_device *pdev) | |||
103 | { | 103 | { |
104 | struct thermal_zone_device *spear_thermal = NULL; | 104 | struct thermal_zone_device *spear_thermal = NULL; |
105 | struct spear_thermal_dev *stdev; | 105 | struct spear_thermal_dev *stdev; |
106 | struct spear_thermal_pdata *pdata; | 106 | struct device_node *np = pdev->dev.of_node; |
107 | int ret = 0; | ||
108 | struct resource *stres = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 107 | struct resource *stres = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
108 | int ret = 0, val; | ||
109 | |||
110 | if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { | ||
111 | dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); | ||
112 | return -EINVAL; | ||
113 | } | ||
109 | 114 | ||
110 | if (!stres) { | 115 | if (!stres) { |
111 | dev_err(&pdev->dev, "memory resource missing\n"); | 116 | dev_err(&pdev->dev, "memory resource missing\n"); |
112 | return -ENODEV; | 117 | return -ENODEV; |
113 | } | 118 | } |
114 | 119 | ||
115 | pdata = dev_get_platdata(&pdev->dev); | ||
116 | if (!pdata) { | ||
117 | dev_err(&pdev->dev, "platform data is NULL\n"); | ||
118 | return -EINVAL; | ||
119 | } | ||
120 | |||
121 | stdev = devm_kzalloc(&pdev->dev, sizeof(*stdev), GFP_KERNEL); | 120 | stdev = devm_kzalloc(&pdev->dev, sizeof(*stdev), GFP_KERNEL); |
122 | if (!stdev) { | 121 | if (!stdev) { |
123 | dev_err(&pdev->dev, "kzalloc fail\n"); | 122 | dev_err(&pdev->dev, "kzalloc fail\n"); |
@@ -144,10 +143,10 @@ static int spear_thermal_probe(struct platform_device *pdev) | |||
144 | goto put_clk; | 143 | goto put_clk; |
145 | } | 144 | } |
146 | 145 | ||
147 | stdev->flags = pdata->thermal_flags; | 146 | stdev->flags = val; |
148 | writel_relaxed(stdev->flags, stdev->thermal_base); | 147 | writel_relaxed(stdev->flags, stdev->thermal_base); |
149 | 148 | ||
150 | spear_thermal = thermal_zone_device_register("spear_thermal", 0, | 149 | spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0, |
151 | stdev, &ops, 0, 0, 0, 0); | 150 | stdev, &ops, 0, 0, 0, 0); |
152 | if (IS_ERR(spear_thermal)) { | 151 | if (IS_ERR(spear_thermal)) { |
153 | dev_err(&pdev->dev, "thermal zone device is NULL\n"); | 152 | dev_err(&pdev->dev, "thermal zone device is NULL\n"); |
@@ -189,6 +188,12 @@ static int spear_thermal_exit(struct platform_device *pdev) | |||
189 | return 0; | 188 | return 0; |
190 | } | 189 | } |
191 | 190 | ||
191 | static const struct of_device_id spear_thermal_id_table[] = { | ||
192 | { .compatible = "st,thermal-spear1340" }, | ||
193 | {} | ||
194 | }; | ||
195 | MODULE_DEVICE_TABLE(of, spear_thermal_id_table); | ||
196 | |||
192 | static struct platform_driver spear_thermal_driver = { | 197 | static struct platform_driver spear_thermal_driver = { |
193 | .probe = spear_thermal_probe, | 198 | .probe = spear_thermal_probe, |
194 | .remove = spear_thermal_exit, | 199 | .remove = spear_thermal_exit, |
@@ -196,6 +201,7 @@ static struct platform_driver spear_thermal_driver = { | |||
196 | .name = "spear_thermal", | 201 | .name = "spear_thermal", |
197 | .owner = THIS_MODULE, | 202 | .owner = THIS_MODULE, |
198 | .pm = &spear_thermal_pm_ops, | 203 | .pm = &spear_thermal_pm_ops, |
204 | .of_match_table = of_match_ptr(spear_thermal_id_table), | ||
199 | }, | 205 | }, |
200 | }; | 206 | }; |
201 | 207 | ||
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 022bacb71a7e..2d7a9fe8f365 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -196,6 +196,28 @@ trip_point_type_show(struct device *dev, struct device_attribute *attr, | |||
196 | } | 196 | } |
197 | 197 | ||
198 | static ssize_t | 198 | static ssize_t |
199 | trip_point_temp_store(struct device *dev, struct device_attribute *attr, | ||
200 | const char *buf, size_t count) | ||
201 | { | ||
202 | struct thermal_zone_device *tz = to_thermal_zone(dev); | ||
203 | int trip, ret; | ||
204 | unsigned long temperature; | ||
205 | |||
206 | if (!tz->ops->set_trip_temp) | ||
207 | return -EPERM; | ||
208 | |||
209 | if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip)) | ||
210 | return -EINVAL; | ||
211 | |||
212 | if (kstrtoul(buf, 10, &temperature)) | ||
213 | return -EINVAL; | ||
214 | |||
215 | ret = tz->ops->set_trip_temp(tz, trip, temperature); | ||
216 | |||
217 | return ret ? ret : count; | ||
218 | } | ||
219 | |||
220 | static ssize_t | ||
199 | trip_point_temp_show(struct device *dev, struct device_attribute *attr, | 221 | trip_point_temp_show(struct device *dev, struct device_attribute *attr, |
200 | char *buf) | 222 | char *buf) |
201 | { | 223 | { |
@@ -218,6 +240,52 @@ trip_point_temp_show(struct device *dev, struct device_attribute *attr, | |||
218 | } | 240 | } |
219 | 241 | ||
220 | static ssize_t | 242 | static ssize_t |
243 | trip_point_hyst_store(struct device *dev, struct device_attribute *attr, | ||
244 | const char *buf, size_t count) | ||
245 | { | ||
246 | struct thermal_zone_device *tz = to_thermal_zone(dev); | ||
247 | int trip, ret; | ||
248 | unsigned long temperature; | ||
249 | |||
250 | if (!tz->ops->set_trip_hyst) | ||
251 | return -EPERM; | ||
252 | |||
253 | if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip)) | ||
254 | return -EINVAL; | ||
255 | |||
256 | if (kstrtoul(buf, 10, &temperature)) | ||
257 | return -EINVAL; | ||
258 | |||
259 | /* | ||
260 | * We are not doing any check on the 'temperature' value | ||
261 | * here. The driver implementing 'set_trip_hyst' has to | ||
262 | * take care of this. | ||
263 | */ | ||
264 | ret = tz->ops->set_trip_hyst(tz, trip, temperature); | ||
265 | |||
266 | return ret ? ret : count; | ||
267 | } | ||
268 | |||
269 | static ssize_t | ||
270 | trip_point_hyst_show(struct device *dev, struct device_attribute *attr, | ||
271 | char *buf) | ||
272 | { | ||
273 | struct thermal_zone_device *tz = to_thermal_zone(dev); | ||
274 | int trip, ret; | ||
275 | unsigned long temperature; | ||
276 | |||
277 | if (!tz->ops->get_trip_hyst) | ||
278 | return -EPERM; | ||
279 | |||
280 | if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip)) | ||
281 | return -EINVAL; | ||
282 | |||
283 | ret = tz->ops->get_trip_hyst(tz, trip, &temperature); | ||
284 | |||
285 | return ret ? ret : sprintf(buf, "%ld\n", temperature); | ||
286 | } | ||
287 | |||
288 | static ssize_t | ||
221 | passive_store(struct device *dev, struct device_attribute *attr, | 289 | passive_store(struct device *dev, struct device_attribute *attr, |
222 | const char *buf, size_t count) | 290 | const char *buf, size_t count) |
223 | { | 291 | { |
@@ -283,33 +351,6 @@ static DEVICE_ATTR(temp, 0444, temp_show, NULL); | |||
283 | static DEVICE_ATTR(mode, 0644, mode_show, mode_store); | 351 | static DEVICE_ATTR(mode, 0644, mode_show, mode_store); |
284 | static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); | 352 | static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); |
285 | 353 | ||
286 | static struct device_attribute trip_point_attrs[] = { | ||
287 | __ATTR(trip_point_0_type, 0444, trip_point_type_show, NULL), | ||
288 | __ATTR(trip_point_0_temp, 0444, trip_point_temp_show, NULL), | ||
289 | __ATTR(trip_point_1_type, 0444, trip_point_type_show, NULL), | ||
290 | __ATTR(trip_point_1_temp, 0444, trip_point_temp_show, NULL), | ||
291 | __ATTR(trip_point_2_type, 0444, trip_point_type_show, NULL), | ||
292 | __ATTR(trip_point_2_temp, 0444, trip_point_temp_show, NULL), | ||
293 | __ATTR(trip_point_3_type, 0444, trip_point_type_show, NULL), | ||
294 | __ATTR(trip_point_3_temp, 0444, trip_point_temp_show, NULL), | ||
295 | __ATTR(trip_point_4_type, 0444, trip_point_type_show, NULL), | ||
296 | __ATTR(trip_point_4_temp, 0444, trip_point_temp_show, NULL), | ||
297 | __ATTR(trip_point_5_type, 0444, trip_point_type_show, NULL), | ||
298 | __ATTR(trip_point_5_temp, 0444, trip_point_temp_show, NULL), | ||
299 | __ATTR(trip_point_6_type, 0444, trip_point_type_show, NULL), | ||
300 | __ATTR(trip_point_6_temp, 0444, trip_point_temp_show, NULL), | ||
301 | __ATTR(trip_point_7_type, 0444, trip_point_type_show, NULL), | ||
302 | __ATTR(trip_point_7_temp, 0444, trip_point_temp_show, NULL), | ||
303 | __ATTR(trip_point_8_type, 0444, trip_point_type_show, NULL), | ||
304 | __ATTR(trip_point_8_temp, 0444, trip_point_temp_show, NULL), | ||
305 | __ATTR(trip_point_9_type, 0444, trip_point_type_show, NULL), | ||
306 | __ATTR(trip_point_9_temp, 0444, trip_point_temp_show, NULL), | ||
307 | __ATTR(trip_point_10_type, 0444, trip_point_type_show, NULL), | ||
308 | __ATTR(trip_point_10_temp, 0444, trip_point_temp_show, NULL), | ||
309 | __ATTR(trip_point_11_type, 0444, trip_point_type_show, NULL), | ||
310 | __ATTR(trip_point_11_temp, 0444, trip_point_temp_show, NULL), | ||
311 | }; | ||
312 | |||
313 | /* sys I/F for cooling device */ | 354 | /* sys I/F for cooling device */ |
314 | #define to_cooling_device(_dev) \ | 355 | #define to_cooling_device(_dev) \ |
315 | container_of(_dev, struct thermal_cooling_device, device) | 356 | container_of(_dev, struct thermal_cooling_device, device) |
@@ -1089,9 +1130,113 @@ leave: | |||
1089 | EXPORT_SYMBOL(thermal_zone_device_update); | 1130 | EXPORT_SYMBOL(thermal_zone_device_update); |
1090 | 1131 | ||
1091 | /** | 1132 | /** |
1133 | * create_trip_attrs - create attributes for trip points | ||
1134 | * @tz: the thermal zone device | ||
1135 | * @mask: Writeable trip point bitmap. | ||
1136 | */ | ||
1137 | static int create_trip_attrs(struct thermal_zone_device *tz, int mask) | ||
1138 | { | ||
1139 | int indx; | ||
1140 | int size = sizeof(struct thermal_attr) * tz->trips; | ||
1141 | |||
1142 | tz->trip_type_attrs = kzalloc(size, GFP_KERNEL); | ||
1143 | if (!tz->trip_type_attrs) | ||
1144 | return -ENOMEM; | ||
1145 | |||
1146 | tz->trip_temp_attrs = kzalloc(size, GFP_KERNEL); | ||
1147 | if (!tz->trip_temp_attrs) { | ||
1148 | kfree(tz->trip_type_attrs); | ||
1149 | return -ENOMEM; | ||
1150 | } | ||
1151 | |||
1152 | if (tz->ops->get_trip_hyst) { | ||
1153 | tz->trip_hyst_attrs = kzalloc(size, GFP_KERNEL); | ||
1154 | if (!tz->trip_hyst_attrs) { | ||
1155 | kfree(tz->trip_type_attrs); | ||
1156 | kfree(tz->trip_temp_attrs); | ||
1157 | return -ENOMEM; | ||
1158 | } | ||
1159 | } | ||
1160 | |||
1161 | |||
1162 | for (indx = 0; indx < tz->trips; indx++) { | ||
1163 | /* create trip type attribute */ | ||
1164 | snprintf(tz->trip_type_attrs[indx].name, THERMAL_NAME_LENGTH, | ||
1165 | "trip_point_%d_type", indx); | ||
1166 | |||
1167 | sysfs_attr_init(&tz->trip_type_attrs[indx].attr.attr); | ||
1168 | tz->trip_type_attrs[indx].attr.attr.name = | ||
1169 | tz->trip_type_attrs[indx].name; | ||
1170 | tz->trip_type_attrs[indx].attr.attr.mode = S_IRUGO; | ||
1171 | tz->trip_type_attrs[indx].attr.show = trip_point_type_show; | ||
1172 | |||
1173 | device_create_file(&tz->device, | ||
1174 | &tz->trip_type_attrs[indx].attr); | ||
1175 | |||
1176 | /* create trip temp attribute */ | ||
1177 | snprintf(tz->trip_temp_attrs[indx].name, THERMAL_NAME_LENGTH, | ||
1178 | "trip_point_%d_temp", indx); | ||
1179 | |||
1180 | sysfs_attr_init(&tz->trip_temp_attrs[indx].attr.attr); | ||
1181 | tz->trip_temp_attrs[indx].attr.attr.name = | ||
1182 | tz->trip_temp_attrs[indx].name; | ||
1183 | tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO; | ||
1184 | tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show; | ||
1185 | if (mask & (1 << indx)) { | ||
1186 | tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR; | ||
1187 | tz->trip_temp_attrs[indx].attr.store = | ||
1188 | trip_point_temp_store; | ||
1189 | } | ||
1190 | |||
1191 | device_create_file(&tz->device, | ||
1192 | &tz->trip_temp_attrs[indx].attr); | ||
1193 | |||
1194 | /* create Optional trip hyst attribute */ | ||
1195 | if (!tz->ops->get_trip_hyst) | ||
1196 | continue; | ||
1197 | snprintf(tz->trip_hyst_attrs[indx].name, THERMAL_NAME_LENGTH, | ||
1198 | "trip_point_%d_hyst", indx); | ||
1199 | |||
1200 | sysfs_attr_init(&tz->trip_hyst_attrs[indx].attr.attr); | ||
1201 | tz->trip_hyst_attrs[indx].attr.attr.name = | ||
1202 | tz->trip_hyst_attrs[indx].name; | ||
1203 | tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO; | ||
1204 | tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show; | ||
1205 | if (tz->ops->set_trip_hyst) { | ||
1206 | tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR; | ||
1207 | tz->trip_hyst_attrs[indx].attr.store = | ||
1208 | trip_point_hyst_store; | ||
1209 | } | ||
1210 | |||
1211 | device_create_file(&tz->device, | ||
1212 | &tz->trip_hyst_attrs[indx].attr); | ||
1213 | } | ||
1214 | return 0; | ||
1215 | } | ||
1216 | |||
1217 | static void remove_trip_attrs(struct thermal_zone_device *tz) | ||
1218 | { | ||
1219 | int indx; | ||
1220 | |||
1221 | for (indx = 0; indx < tz->trips; indx++) { | ||
1222 | device_remove_file(&tz->device, | ||
1223 | &tz->trip_type_attrs[indx].attr); | ||
1224 | device_remove_file(&tz->device, | ||
1225 | &tz->trip_temp_attrs[indx].attr); | ||
1226 | if (tz->ops->get_trip_hyst) | ||
1227 | device_remove_file(&tz->device, | ||
1228 | &tz->trip_hyst_attrs[indx].attr); | ||
1229 | } | ||
1230 | kfree(tz->trip_type_attrs); | ||
1231 | kfree(tz->trip_temp_attrs); | ||
1232 | kfree(tz->trip_hyst_attrs); | ||
1233 | } | ||
1234 | |||
1235 | /** | ||
1092 | * thermal_zone_device_register - register a new thermal zone device | 1236 | * thermal_zone_device_register - register a new thermal zone device |
1093 | * @type: the thermal zone device type | 1237 | * @type: the thermal zone device type |
1094 | * @trips: the number of trip points the thermal zone support | 1238 | * @trips: the number of trip points the thermal zone support |
1239 | * @mask: a bit string indicating the writeablility of trip points | ||
1095 | * @devdata: private device data | 1240 | * @devdata: private device data |
1096 | * @ops: standard thermal zone device callbacks | 1241 | * @ops: standard thermal zone device callbacks |
1097 | * @tc1: thermal coefficient 1 for passive calculations | 1242 | * @tc1: thermal coefficient 1 for passive calculations |
@@ -1107,7 +1252,7 @@ EXPORT_SYMBOL(thermal_zone_device_update); | |||
1107 | * section 11.1.5.1 of the ACPI specification 3.0. | 1252 | * section 11.1.5.1 of the ACPI specification 3.0. |
1108 | */ | 1253 | */ |
1109 | struct thermal_zone_device *thermal_zone_device_register(char *type, | 1254 | struct thermal_zone_device *thermal_zone_device_register(char *type, |
1110 | int trips, void *devdata, | 1255 | int trips, int mask, void *devdata, |
1111 | const struct thermal_zone_device_ops *ops, | 1256 | const struct thermal_zone_device_ops *ops, |
1112 | int tc1, int tc2, int passive_delay, int polling_delay) | 1257 | int tc1, int tc2, int passive_delay, int polling_delay) |
1113 | { | 1258 | { |
@@ -1121,7 +1266,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, | |||
1121 | if (strlen(type) >= THERMAL_NAME_LENGTH) | 1266 | if (strlen(type) >= THERMAL_NAME_LENGTH) |
1122 | return ERR_PTR(-EINVAL); | 1267 | return ERR_PTR(-EINVAL); |
1123 | 1268 | ||
1124 | if (trips > THERMAL_MAX_TRIPS || trips < 0) | 1269 | if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips) |
1125 | return ERR_PTR(-EINVAL); | 1270 | return ERR_PTR(-EINVAL); |
1126 | 1271 | ||
1127 | if (!ops || !ops->get_temp) | 1272 | if (!ops || !ops->get_temp) |
@@ -1175,15 +1320,11 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, | |||
1175 | goto unregister; | 1320 | goto unregister; |
1176 | } | 1321 | } |
1177 | 1322 | ||
1323 | result = create_trip_attrs(tz, mask); | ||
1324 | if (result) | ||
1325 | goto unregister; | ||
1326 | |||
1178 | for (count = 0; count < trips; count++) { | 1327 | for (count = 0; count < trips; count++) { |
1179 | result = device_create_file(&tz->device, | ||
1180 | &trip_point_attrs[count * 2]); | ||
1181 | if (result) | ||
1182 | break; | ||
1183 | result = device_create_file(&tz->device, | ||
1184 | &trip_point_attrs[count * 2 + 1]); | ||
1185 | if (result) | ||
1186 | goto unregister; | ||
1187 | tz->ops->get_trip_type(tz, count, &trip_type); | 1328 | tz->ops->get_trip_type(tz, count, &trip_type); |
1188 | if (trip_type == THERMAL_TRIP_PASSIVE) | 1329 | if (trip_type == THERMAL_TRIP_PASSIVE) |
1189 | passive = 1; | 1330 | passive = 1; |
@@ -1232,7 +1373,6 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) | |||
1232 | { | 1373 | { |
1233 | struct thermal_cooling_device *cdev; | 1374 | struct thermal_cooling_device *cdev; |
1234 | struct thermal_zone_device *pos = NULL; | 1375 | struct thermal_zone_device *pos = NULL; |
1235 | int count; | ||
1236 | 1376 | ||
1237 | if (!tz) | 1377 | if (!tz) |
1238 | return; | 1378 | return; |
@@ -1259,13 +1399,8 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) | |||
1259 | device_remove_file(&tz->device, &dev_attr_temp); | 1399 | device_remove_file(&tz->device, &dev_attr_temp); |
1260 | if (tz->ops->get_mode) | 1400 | if (tz->ops->get_mode) |
1261 | device_remove_file(&tz->device, &dev_attr_mode); | 1401 | device_remove_file(&tz->device, &dev_attr_mode); |
1402 | remove_trip_attrs(tz); | ||
1262 | 1403 | ||
1263 | for (count = 0; count < tz->trips; count++) { | ||
1264 | device_remove_file(&tz->device, | ||
1265 | &trip_point_attrs[count * 2]); | ||
1266 | device_remove_file(&tz->device, | ||
1267 | &trip_point_attrs[count * 2 + 1]); | ||
1268 | } | ||
1269 | thermal_remove_hwmon_sysfs(tz); | 1404 | thermal_remove_hwmon_sysfs(tz); |
1270 | release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); | 1405 | release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); |
1271 | idr_destroy(&tz->idr); | 1406 | idr_destroy(&tz->idr); |
diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index ced26c8ccd57..0d2ea0c224c3 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c | |||
@@ -401,7 +401,7 @@ out: | |||
401 | } | 401 | } |
402 | 402 | ||
403 | #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL_RAW | 403 | #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL_RAW |
404 | void __init udbg_init_debug_opal(void) | 404 | void __init udbg_init_debug_opal_raw(void) |
405 | { | 405 | { |
406 | u32 index = CONFIG_PPC_EARLY_DEBUG_OPAL_VTERMNO; | 406 | u32 index = CONFIG_PPC_EARLY_DEBUG_OPAL_VTERMNO; |
407 | hvc_opal_privs[index] = &hvc_opal_boot_priv; | 407 | hvc_opal_privs[index] = &hvc_opal_boot_priv; |
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index d3d91dae065c..944eaeb8e0cf 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c | |||
@@ -214,24 +214,24 @@ static int xen_hvm_console_init(void) | |||
214 | /* already configured */ | 214 | /* already configured */ |
215 | if (info->intf != NULL) | 215 | if (info->intf != NULL) |
216 | return 0; | 216 | return 0; |
217 | 217 | /* | |
218 | * If the toolstack (or the hypervisor) hasn't set these values, the | ||
219 | * default value is 0. Even though mfn = 0 and evtchn = 0 are | ||
220 | * theoretically correct values, in practice they never are and they | ||
221 | * mean that a legacy toolstack hasn't initialized the pv console correctly. | ||
222 | */ | ||
218 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v); | 223 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v); |
219 | if (r < 0) { | 224 | if (r < 0 || v == 0) |
220 | kfree(info); | 225 | goto err; |
221 | return -ENODEV; | ||
222 | } | ||
223 | info->evtchn = v; | 226 | info->evtchn = v; |
224 | hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); | 227 | v = 0; |
225 | if (r < 0) { | 228 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); |
226 | kfree(info); | 229 | if (r < 0 || v == 0) |
227 | return -ENODEV; | 230 | goto err; |
228 | } | ||
229 | mfn = v; | 231 | mfn = v; |
230 | info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); | 232 | info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); |
231 | if (info->intf == NULL) { | 233 | if (info->intf == NULL) |
232 | kfree(info); | 234 | goto err; |
233 | return -ENODEV; | ||
234 | } | ||
235 | info->vtermno = HVC_COOKIE; | 235 | info->vtermno = HVC_COOKIE; |
236 | 236 | ||
237 | spin_lock(&xencons_lock); | 237 | spin_lock(&xencons_lock); |
@@ -239,6 +239,9 @@ static int xen_hvm_console_init(void) | |||
239 | spin_unlock(&xencons_lock); | 239 | spin_unlock(&xencons_lock); |
240 | 240 | ||
241 | return 0; | 241 | return 0; |
242 | err: | ||
243 | kfree(info); | ||
244 | return -ENODEV; | ||
242 | } | 245 | } |
243 | 246 | ||
244 | static int xen_pv_console_init(void) | 247 | static int xen_pv_console_init(void) |
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/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 4604153b7954..1bd9163bc118 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -2179,6 +2179,16 @@ static int __devinit sci_init_single(struct platform_device *dev, | |||
2179 | return 0; | 2179 | return 0; |
2180 | } | 2180 | } |
2181 | 2181 | ||
2182 | static void sci_cleanup_single(struct sci_port *port) | ||
2183 | { | ||
2184 | sci_free_gpios(port); | ||
2185 | |||
2186 | clk_put(port->iclk); | ||
2187 | clk_put(port->fclk); | ||
2188 | |||
2189 | pm_runtime_disable(port->port.dev); | ||
2190 | } | ||
2191 | |||
2182 | #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE | 2192 | #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE |
2183 | static void serial_console_putchar(struct uart_port *port, int ch) | 2193 | static void serial_console_putchar(struct uart_port *port, int ch) |
2184 | { | 2194 | { |
@@ -2360,14 +2370,10 @@ static int sci_remove(struct platform_device *dev) | |||
2360 | cpufreq_unregister_notifier(&port->freq_transition, | 2370 | cpufreq_unregister_notifier(&port->freq_transition, |
2361 | CPUFREQ_TRANSITION_NOTIFIER); | 2371 | CPUFREQ_TRANSITION_NOTIFIER); |
2362 | 2372 | ||
2363 | sci_free_gpios(port); | ||
2364 | |||
2365 | uart_remove_one_port(&sci_uart_driver, &port->port); | 2373 | uart_remove_one_port(&sci_uart_driver, &port->port); |
2366 | 2374 | ||
2367 | clk_put(port->iclk); | 2375 | sci_cleanup_single(port); |
2368 | clk_put(port->fclk); | ||
2369 | 2376 | ||
2370 | pm_runtime_disable(&dev->dev); | ||
2371 | return 0; | 2377 | return 0; |
2372 | } | 2378 | } |
2373 | 2379 | ||
@@ -2385,14 +2391,20 @@ static int __devinit sci_probe_single(struct platform_device *dev, | |||
2385 | index+1, SCI_NPORTS); | 2391 | index+1, SCI_NPORTS); |
2386 | dev_notice(&dev->dev, "Consider bumping " | 2392 | dev_notice(&dev->dev, "Consider bumping " |
2387 | "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n"); | 2393 | "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n"); |
2388 | return 0; | 2394 | return -EINVAL; |
2389 | } | 2395 | } |
2390 | 2396 | ||
2391 | ret = sci_init_single(dev, sciport, index, p); | 2397 | ret = sci_init_single(dev, sciport, index, p); |
2392 | if (ret) | 2398 | if (ret) |
2393 | return ret; | 2399 | return ret; |
2394 | 2400 | ||
2395 | return uart_add_one_port(&sci_uart_driver, &sciport->port); | 2401 | ret = uart_add_one_port(&sci_uart_driver, &sciport->port); |
2402 | if (ret) { | ||
2403 | sci_cleanup_single(sciport); | ||
2404 | return ret; | ||
2405 | } | ||
2406 | |||
2407 | return 0; | ||
2396 | } | 2408 | } |
2397 | 2409 | ||
2398 | static int __devinit sci_probe(struct platform_device *dev) | 2410 | static int __devinit sci_probe(struct platform_device *dev) |
@@ -2413,24 +2425,22 @@ static int __devinit sci_probe(struct platform_device *dev) | |||
2413 | 2425 | ||
2414 | ret = sci_probe_single(dev, dev->id, p, sp); | 2426 | ret = sci_probe_single(dev, dev->id, p, sp); |
2415 | if (ret) | 2427 | if (ret) |
2416 | goto err_unreg; | 2428 | return ret; |
2417 | 2429 | ||
2418 | sp->freq_transition.notifier_call = sci_notifier; | 2430 | sp->freq_transition.notifier_call = sci_notifier; |
2419 | 2431 | ||
2420 | ret = cpufreq_register_notifier(&sp->freq_transition, | 2432 | ret = cpufreq_register_notifier(&sp->freq_transition, |
2421 | CPUFREQ_TRANSITION_NOTIFIER); | 2433 | CPUFREQ_TRANSITION_NOTIFIER); |
2422 | if (unlikely(ret < 0)) | 2434 | if (unlikely(ret < 0)) { |
2423 | goto err_unreg; | 2435 | sci_cleanup_single(sp); |
2436 | return ret; | ||
2437 | } | ||
2424 | 2438 | ||
2425 | #ifdef CONFIG_SH_STANDARD_BIOS | 2439 | #ifdef CONFIG_SH_STANDARD_BIOS |
2426 | sh_bios_gdb_detach(); | 2440 | sh_bios_gdb_detach(); |
2427 | #endif | 2441 | #endif |
2428 | 2442 | ||
2429 | return 0; | 2443 | return 0; |
2430 | |||
2431 | err_unreg: | ||
2432 | sci_remove(dev); | ||
2433 | return ret; | ||
2434 | } | 2444 | } |
2435 | 2445 | ||
2436 | static int sci_suspend(struct device *dev) | 2446 | static int sci_suspend(struct device *dev) |
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/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index f2a120eea9d4..36a2a0b7b82c 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -567,6 +567,14 @@ static int acm_port_activate(struct tty_port *port, struct tty_struct *tty) | |||
567 | 567 | ||
568 | usb_autopm_put_interface(acm->control); | 568 | usb_autopm_put_interface(acm->control); |
569 | 569 | ||
570 | /* | ||
571 | * Unthrottle device in case the TTY was closed while throttled. | ||
572 | */ | ||
573 | spin_lock_irq(&acm->read_lock); | ||
574 | acm->throttled = 0; | ||
575 | acm->throttle_req = 0; | ||
576 | spin_unlock_irq(&acm->read_lock); | ||
577 | |||
570 | if (acm_submit_read_urbs(acm, GFP_KERNEL)) | 578 | if (acm_submit_read_urbs(acm, GFP_KERNEL)) |
571 | goto error_submit_read_urbs; | 579 | goto error_submit_read_urbs; |
572 | 580 | ||
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index ea8b304f0e85..ee469274a3fe 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -55,6 +55,15 @@ static const struct usb_device_id wdm_ids[] = { | |||
55 | .bInterfaceSubClass = 1, | 55 | .bInterfaceSubClass = 1, |
56 | .bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */ | 56 | .bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */ |
57 | }, | 57 | }, |
58 | { | ||
59 | /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */ | ||
60 | .match_flags = USB_DEVICE_ID_MATCH_VENDOR | | ||
61 | USB_DEVICE_ID_MATCH_INT_INFO, | ||
62 | .idVendor = HUAWEI_VENDOR_ID, | ||
63 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | ||
64 | .bInterfaceSubClass = 1, | ||
65 | .bInterfaceProtocol = 57, /* NOTE: CDC ECM control interface! */ | ||
66 | }, | ||
58 | { } | 67 | { } |
59 | }; | 68 | }; |
60 | 69 | ||
@@ -491,6 +500,8 @@ retry: | |||
491 | goto retry; | 500 | goto retry; |
492 | } | 501 | } |
493 | if (!desc->reslength) { /* zero length read */ | 502 | if (!desc->reslength) { /* zero length read */ |
503 | dev_dbg(&desc->intf->dev, "%s: zero length - clearing WDM_READ\n", __func__); | ||
504 | clear_bit(WDM_READ, &desc->flags); | ||
494 | spin_unlock_irq(&desc->iuspin); | 505 | spin_unlock_irq(&desc->iuspin); |
495 | goto retry; | 506 | goto retry; |
496 | } | 507 | } |
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 57ed9e400c06..622b4a48e732 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -493,15 +493,6 @@ static int hcd_pci_suspend_noirq(struct device *dev) | |||
493 | 493 | ||
494 | pci_save_state(pci_dev); | 494 | pci_save_state(pci_dev); |
495 | 495 | ||
496 | /* | ||
497 | * Some systems crash if an EHCI controller is in D3 during | ||
498 | * a sleep transition. We have to leave such controllers in D0. | ||
499 | */ | ||
500 | if (hcd->broken_pci_sleep) { | ||
501 | dev_dbg(dev, "Staying in PCI D0\n"); | ||
502 | return retval; | ||
503 | } | ||
504 | |||
505 | /* If the root hub is dead rather than suspended, disallow remote | 496 | /* If the root hub is dead rather than suspended, disallow remote |
506 | * wakeup. usb_hc_died() should ensure that both hosts are marked as | 497 | * wakeup. usb_hc_died() should ensure that both hosts are marked as |
507 | * dying, so we only need to check the primary roothub. | 498 | * dying, so we only need to check the primary roothub. |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 04fb834c3fa1..8fb484984c86 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2324,12 +2324,16 @@ static unsigned hub_is_wusb(struct usb_hub *hub) | |||
2324 | static int hub_port_reset(struct usb_hub *hub, int port1, | 2324 | static int hub_port_reset(struct usb_hub *hub, int port1, |
2325 | struct usb_device *udev, unsigned int delay, bool warm); | 2325 | struct usb_device *udev, unsigned int delay, bool warm); |
2326 | 2326 | ||
2327 | /* Is a USB 3.0 port in the Inactive state? */ | 2327 | /* Is a USB 3.0 port in the Inactive or Complinance Mode state? |
2328 | static bool hub_port_inactive(struct usb_hub *hub, u16 portstatus) | 2328 | * Port worm reset is required to recover |
2329 | */ | ||
2330 | static bool hub_port_warm_reset_required(struct usb_hub *hub, u16 portstatus) | ||
2329 | { | 2331 | { |
2330 | return hub_is_superspeed(hub->hdev) && | 2332 | return hub_is_superspeed(hub->hdev) && |
2331 | (portstatus & USB_PORT_STAT_LINK_STATE) == | 2333 | (((portstatus & USB_PORT_STAT_LINK_STATE) == |
2332 | USB_SS_PORT_LS_SS_INACTIVE; | 2334 | USB_SS_PORT_LS_SS_INACTIVE) || |
2335 | ((portstatus & USB_PORT_STAT_LINK_STATE) == | ||
2336 | USB_SS_PORT_LS_COMP_MOD)) ; | ||
2333 | } | 2337 | } |
2334 | 2338 | ||
2335 | static int hub_port_wait_reset(struct usb_hub *hub, int port1, | 2339 | static int hub_port_wait_reset(struct usb_hub *hub, int port1, |
@@ -2365,7 +2369,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
2365 | * | 2369 | * |
2366 | * See https://bugzilla.kernel.org/show_bug.cgi?id=41752 | 2370 | * See https://bugzilla.kernel.org/show_bug.cgi?id=41752 |
2367 | */ | 2371 | */ |
2368 | if (hub_port_inactive(hub, portstatus)) { | 2372 | if (hub_port_warm_reset_required(hub, portstatus)) { |
2369 | int ret; | 2373 | int ret; |
2370 | 2374 | ||
2371 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) | 2375 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) |
@@ -3379,7 +3383,7 @@ int usb_disable_lpm(struct usb_device *udev) | |||
3379 | return 0; | 3383 | return 0; |
3380 | 3384 | ||
3381 | udev->lpm_disable_count++; | 3385 | udev->lpm_disable_count++; |
3382 | if ((udev->u1_params.timeout == 0 && udev->u1_params.timeout == 0)) | 3386 | if ((udev->u1_params.timeout == 0 && udev->u2_params.timeout == 0)) |
3383 | return 0; | 3387 | return 0; |
3384 | 3388 | ||
3385 | /* If LPM is enabled, attempt to disable it. */ | 3389 | /* If LPM is enabled, attempt to disable it. */ |
@@ -4408,9 +4412,7 @@ static void hub_events(void) | |||
4408 | /* Warm reset a USB3 protocol port if it's in | 4412 | /* Warm reset a USB3 protocol port if it's in |
4409 | * SS.Inactive state. | 4413 | * SS.Inactive state. |
4410 | */ | 4414 | */ |
4411 | if (hub_is_superspeed(hub->hdev) && | 4415 | if (hub_port_warm_reset_required(hub, portstatus)) { |
4412 | (portstatus & USB_PORT_STAT_LINK_STATE) | ||
4413 | == USB_SS_PORT_LS_SS_INACTIVE) { | ||
4414 | dev_dbg(hub_dev, "warm reset port %d\n", i); | 4416 | dev_dbg(hub_dev, "warm reset port %d\n", i); |
4415 | hub_port_reset(hub, i, NULL, | 4417 | hub_port_reset(hub, i, NULL, |
4416 | HUB_BH_RESET_TIME, true); | 4418 | HUB_BH_RESET_TIME, true); |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index b548cf1dbc62..bdd1c6749d88 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1838,7 +1838,6 @@ free_interfaces: | |||
1838 | intfc = cp->intf_cache[i]; | 1838 | intfc = cp->intf_cache[i]; |
1839 | intf->altsetting = intfc->altsetting; | 1839 | intf->altsetting = intfc->altsetting; |
1840 | intf->num_altsetting = intfc->num_altsetting; | 1840 | intf->num_altsetting = intfc->num_altsetting; |
1841 | intf->intf_assoc = find_iad(dev, cp, i); | ||
1842 | kref_get(&intfc->ref); | 1841 | kref_get(&intfc->ref); |
1843 | 1842 | ||
1844 | alt = usb_altnum_to_altsetting(intf, 0); | 1843 | alt = usb_altnum_to_altsetting(intf, 0); |
@@ -1851,6 +1850,8 @@ free_interfaces: | |||
1851 | if (!alt) | 1850 | if (!alt) |
1852 | alt = &intf->altsetting[0]; | 1851 | alt = &intf->altsetting[0]; |
1853 | 1852 | ||
1853 | intf->intf_assoc = | ||
1854 | find_iad(dev, cp, alt->desc.bInterfaceNumber); | ||
1854 | intf->cur_altsetting = alt; | 1855 | intf->cur_altsetting = alt; |
1855 | usb_enable_interface(dev, intf, true); | 1856 | usb_enable_interface(dev, intf, true); |
1856 | intf->dev.parent = &dev->dev; | 1857 | intf->dev.parent = &dev->dev; |
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/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index e23bf7984aaf..9a9bced813ed 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -599,12 +599,6 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
599 | 599 | ||
600 | spin_lock_irqsave(&ep->udc->lock, flags); | 600 | spin_lock_irqsave(&ep->udc->lock, flags); |
601 | 601 | ||
602 | if (ep->ep.desc) { | ||
603 | spin_unlock_irqrestore(&ep->udc->lock, flags); | ||
604 | DBG(DBG_ERR, "ep%d already enabled\n", ep->index); | ||
605 | return -EBUSY; | ||
606 | } | ||
607 | |||
608 | ep->ep.desc = desc; | 602 | ep->ep.desc = desc; |
609 | ep->ep.maxpacket = maxpacket; | 603 | ep->ep.maxpacket = maxpacket; |
610 | 604 | ||
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 51881f3bd07a..b09452d6f33a 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
@@ -1596,7 +1596,7 @@ static int qe_ep_enable(struct usb_ep *_ep, | |||
1596 | ep = container_of(_ep, struct qe_ep, ep); | 1596 | ep = container_of(_ep, struct qe_ep, ep); |
1597 | 1597 | ||
1598 | /* catch various bogus parameters */ | 1598 | /* catch various bogus parameters */ |
1599 | if (!_ep || !desc || ep->ep.desc || _ep->name == ep_name[0] || | 1599 | if (!_ep || !desc || _ep->name == ep_name[0] || |
1600 | (desc->bDescriptorType != USB_DT_ENDPOINT)) | 1600 | (desc->bDescriptorType != USB_DT_ENDPOINT)) |
1601 | return -EINVAL; | 1601 | return -EINVAL; |
1602 | 1602 | ||
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/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 28316858208b..bc6f9bb9994a 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c | |||
@@ -567,7 +567,7 @@ static int fsl_ep_enable(struct usb_ep *_ep, | |||
567 | ep = container_of(_ep, struct fsl_ep, ep); | 567 | ep = container_of(_ep, struct fsl_ep, ep); |
568 | 568 | ||
569 | /* catch various bogus parameters */ | 569 | /* catch various bogus parameters */ |
570 | if (!_ep || !desc || ep->ep.desc | 570 | if (!_ep || !desc |
571 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) | 571 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) |
572 | return -EINVAL; | 572 | return -EINVAL; |
573 | 573 | ||
@@ -2575,7 +2575,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev) | |||
2575 | /* for ep0: the desc defined here; | 2575 | /* for ep0: the desc defined here; |
2576 | * for other eps, gadget layer called ep_enable with defined desc | 2576 | * for other eps, gadget layer called ep_enable with defined desc |
2577 | */ | 2577 | */ |
2578 | udc_controller->eps[0].desc = &fsl_ep0_desc; | 2578 | udc_controller->eps[0].ep.desc = &fsl_ep0_desc; |
2579 | udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD; | 2579 | udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD; |
2580 | 2580 | ||
2581 | /* setup the udc->eps[] for non-control endpoints and link | 2581 | /* setup the udc->eps[] for non-control endpoints and link |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index 5cd7b7e7ddb4..f61a967f7082 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h | |||
@@ -568,10 +568,10 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length) | |||
568 | /* | 568 | /* |
569 | * ### internal used help routines. | 569 | * ### internal used help routines. |
570 | */ | 570 | */ |
571 | #define ep_index(EP) ((EP)->desc->bEndpointAddress&0xF) | 571 | #define ep_index(EP) ((EP)->ep.desc->bEndpointAddress&0xF) |
572 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) | 572 | #define ep_maxpacket(EP) ((EP)->ep.maxpacket) |
573 | #define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ | 573 | #define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ |
574 | USB_DIR_IN ):((EP)->desc->bEndpointAddress \ | 574 | USB_DIR_IN) : ((EP)->ep.desc->bEndpointAddress \ |
575 | & USB_DIR_IN)==USB_DIR_IN) | 575 | & USB_DIR_IN)==USB_DIR_IN) |
576 | #define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \ | 576 | #define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \ |
577 | &udc->eps[pipe]) | 577 | &udc->eps[pipe]) |
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index b241e6c6a7f2..3d28fb976c78 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -102,7 +102,7 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
102 | unsigned long flags; | 102 | unsigned long flags; |
103 | 103 | ||
104 | ep = container_of(_ep, struct goku_ep, ep); | 104 | ep = container_of(_ep, struct goku_ep, ep); |
105 | if (!_ep || !desc || ep->ep.desc | 105 | if (!_ep || !desc |
106 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 106 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
107 | return -EINVAL; | 107 | return -EINVAL; |
108 | dev = ep->dev; | 108 | dev = ep->dev; |
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/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index dbcd1329495e..117a4bba1b8c 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c | |||
@@ -464,7 +464,7 @@ static int mv_ep_enable(struct usb_ep *_ep, | |||
464 | ep = container_of(_ep, struct mv_ep, ep); | 464 | ep = container_of(_ep, struct mv_ep, ep); |
465 | udc = ep->udc; | 465 | udc = ep->udc; |
466 | 466 | ||
467 | if (!_ep || !desc || ep->ep.desc | 467 | if (!_ep || !desc |
468 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 468 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
469 | return -EINVAL; | 469 | return -EINVAL; |
470 | 470 | ||
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 7ba32469c5bd..a460e8c204f4 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -153,7 +153,7 @@ static int omap_ep_enable(struct usb_ep *_ep, | |||
153 | u16 maxp; | 153 | u16 maxp; |
154 | 154 | ||
155 | /* catch various bogus parameters */ | 155 | /* catch various bogus parameters */ |
156 | if (!_ep || !desc || ep->ep.desc | 156 | if (!_ep || !desc |
157 | || desc->bDescriptorType != USB_DT_ENDPOINT | 157 | || desc->bDescriptorType != USB_DT_ENDPOINT |
158 | || ep->bEndpointAddress != desc->bEndpointAddress | 158 | || ep->bEndpointAddress != desc->bEndpointAddress |
159 | || ep->maxpacket < usb_endpoint_maxp(desc)) { | 159 | || ep->maxpacket < usb_endpoint_maxp(desc)) { |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index d7c8cb3bf759..f7ff9e8e746a 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -218,7 +218,7 @@ static int pxa25x_ep_enable (struct usb_ep *_ep, | |||
218 | struct pxa25x_udc *dev; | 218 | struct pxa25x_udc *dev; |
219 | 219 | ||
220 | ep = container_of (_ep, struct pxa25x_ep, ep); | 220 | ep = container_of (_ep, struct pxa25x_ep, ep); |
221 | if (!_ep || !desc || ep->ep.desc || _ep->name == ep0name | 221 | if (!_ep || !desc || _ep->name == ep0name |
222 | || desc->bDescriptorType != USB_DT_ENDPOINT | 222 | || desc->bDescriptorType != USB_DT_ENDPOINT |
223 | || ep->bEndpointAddress != desc->bEndpointAddress | 223 | || ep->bEndpointAddress != desc->bEndpointAddress |
224 | || ep->fifo_size < usb_endpoint_maxp (desc)) { | 224 | || ep->fifo_size < usb_endpoint_maxp (desc)) { |
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index 36c6836eeb0f..236b271871a0 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -760,7 +760,7 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep, | |||
760 | u32 ecr = 0; | 760 | u32 ecr = 0; |
761 | 761 | ||
762 | hsep = our_ep(_ep); | 762 | hsep = our_ep(_ep); |
763 | if (!_ep || !desc || hsep->ep.desc || _ep->name == ep0name | 763 | if (!_ep || !desc || _ep->name == ep0name |
764 | || desc->bDescriptorType != USB_DT_ENDPOINT | 764 | || desc->bDescriptorType != USB_DT_ENDPOINT |
765 | || hsep->bEndpointAddress != desc->bEndpointAddress | 765 | || hsep->bEndpointAddress != desc->bEndpointAddress |
766 | || ep_maxpacket(hsep) < usb_endpoint_maxp(desc)) | 766 | || ep_maxpacket(hsep) < usb_endpoint_maxp(desc)) |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 3de71d37d75e..f2e51f50e528 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -1062,7 +1062,7 @@ static int s3c2410_udc_ep_enable(struct usb_ep *_ep, | |||
1062 | 1062 | ||
1063 | ep = to_s3c2410_ep(_ep); | 1063 | ep = to_s3c2410_ep(_ep); |
1064 | 1064 | ||
1065 | if (!_ep || !desc || ep->ep.desc | 1065 | if (!_ep || !desc |
1066 | || _ep->name == ep0name | 1066 | || _ep->name == ep0name |
1067 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 1067 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
1068 | return -EINVAL; | 1068 | return -EINVAL; |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index b100f5f9f4b6..800be38c78b4 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -671,7 +671,9 @@ static int ehci_init(struct usb_hcd *hcd) | |||
671 | hw = ehci->async->hw; | 671 | hw = ehci->async->hw; |
672 | hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); | 672 | hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); |
673 | hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); | 673 | hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); |
674 | #if defined(CONFIG_PPC_PS3) | ||
674 | hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */ | 675 | hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */ |
676 | #endif | ||
675 | hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); | 677 | hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); |
676 | hw->hw_qtd_next = EHCI_LIST_END(ehci); | 678 | hw->hw_qtd_next = EHCI_LIST_END(ehci); |
677 | ehci->async->qh_state = QH_STATE_LINKED; | 679 | ehci->async->qh_state = QH_STATE_LINKED; |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index a44294d13494..c30435499a02 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/regulator/consumer.h> | 43 | #include <linux/regulator/consumer.h> |
44 | #include <linux/pm_runtime.h> | 44 | #include <linux/pm_runtime.h> |
45 | #include <linux/gpio.h> | 45 | #include <linux/gpio.h> |
46 | #include <linux/clk.h> | ||
46 | 47 | ||
47 | /* EHCI Register Set */ | 48 | /* EHCI Register Set */ |
48 | #define EHCI_INSNREG04 (0xA0) | 49 | #define EHCI_INSNREG04 (0xA0) |
@@ -55,6 +56,15 @@ | |||
55 | #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 | 56 | #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 |
56 | #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 | 57 | #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 |
57 | 58 | ||
59 | /* Errata i693 */ | ||
60 | static struct clk *utmi_p1_fck; | ||
61 | static struct clk *utmi_p2_fck; | ||
62 | static struct clk *xclk60mhsp1_ck; | ||
63 | static struct clk *xclk60mhsp2_ck; | ||
64 | static struct clk *usbhost_p1_fck; | ||
65 | static struct clk *usbhost_p2_fck; | ||
66 | static struct clk *init_60m_fclk; | ||
67 | |||
58 | /*-------------------------------------------------------------------------*/ | 68 | /*-------------------------------------------------------------------------*/ |
59 | 69 | ||
60 | static const struct hc_driver ehci_omap_hc_driver; | 70 | static const struct hc_driver ehci_omap_hc_driver; |
@@ -70,6 +80,41 @@ static inline u32 ehci_read(void __iomem *base, u32 reg) | |||
70 | return __raw_readl(base + reg); | 80 | return __raw_readl(base + reg); |
71 | } | 81 | } |
72 | 82 | ||
83 | /* Erratum i693 workaround sequence */ | ||
84 | static void omap_ehci_erratum_i693(struct ehci_hcd *ehci) | ||
85 | { | ||
86 | int ret = 0; | ||
87 | |||
88 | /* Switch to the internal 60 MHz clock */ | ||
89 | ret = clk_set_parent(utmi_p1_fck, init_60m_fclk); | ||
90 | if (ret != 0) | ||
91 | ehci_err(ehci, "init_60m_fclk set parent" | ||
92 | "failed error:%d\n", ret); | ||
93 | |||
94 | ret = clk_set_parent(utmi_p2_fck, init_60m_fclk); | ||
95 | if (ret != 0) | ||
96 | ehci_err(ehci, "init_60m_fclk set parent" | ||
97 | "failed error:%d\n", ret); | ||
98 | |||
99 | clk_enable(usbhost_p1_fck); | ||
100 | clk_enable(usbhost_p2_fck); | ||
101 | |||
102 | /* Wait 1ms and switch back to the external clock */ | ||
103 | mdelay(1); | ||
104 | ret = clk_set_parent(utmi_p1_fck, xclk60mhsp1_ck); | ||
105 | if (ret != 0) | ||
106 | ehci_err(ehci, "xclk60mhsp1_ck set parent" | ||
107 | "failed error:%d\n", ret); | ||
108 | |||
109 | ret = clk_set_parent(utmi_p2_fck, xclk60mhsp2_ck); | ||
110 | if (ret != 0) | ||
111 | ehci_err(ehci, "xclk60mhsp2_ck set parent" | ||
112 | "failed error:%d\n", ret); | ||
113 | |||
114 | clk_disable(usbhost_p1_fck); | ||
115 | clk_disable(usbhost_p2_fck); | ||
116 | } | ||
117 | |||
73 | static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | 118 | static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) |
74 | { | 119 | { |
75 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); | 120 | struct usb_hcd *hcd = dev_get_drvdata(&pdev->dev); |
@@ -100,6 +145,50 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | |||
100 | } | 145 | } |
101 | } | 146 | } |
102 | 147 | ||
148 | static int omap_ehci_hub_control( | ||
149 | struct usb_hcd *hcd, | ||
150 | u16 typeReq, | ||
151 | u16 wValue, | ||
152 | u16 wIndex, | ||
153 | char *buf, | ||
154 | u16 wLength | ||
155 | ) | ||
156 | { | ||
157 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
158 | u32 __iomem *status_reg = &ehci->regs->port_status[ | ||
159 | (wIndex & 0xff) - 1]; | ||
160 | u32 temp; | ||
161 | unsigned long flags; | ||
162 | int retval = 0; | ||
163 | |||
164 | spin_lock_irqsave(&ehci->lock, flags); | ||
165 | |||
166 | if (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_SUSPEND) { | ||
167 | temp = ehci_readl(ehci, status_reg); | ||
168 | if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) { | ||
169 | retval = -EPIPE; | ||
170 | goto done; | ||
171 | } | ||
172 | |||
173 | temp &= ~PORT_WKCONN_E; | ||
174 | temp |= PORT_WKDISC_E | PORT_WKOC_E; | ||
175 | ehci_writel(ehci, temp | PORT_SUSPEND, status_reg); | ||
176 | |||
177 | omap_ehci_erratum_i693(ehci); | ||
178 | |||
179 | set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports); | ||
180 | goto done; | ||
181 | } | ||
182 | |||
183 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
184 | |||
185 | /* Handle the hub control events here */ | ||
186 | return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength); | ||
187 | done: | ||
188 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
189 | return retval; | ||
190 | } | ||
191 | |||
103 | static void disable_put_regulator( | 192 | static void disable_put_regulator( |
104 | struct ehci_hcd_omap_platform_data *pdata) | 193 | struct ehci_hcd_omap_platform_data *pdata) |
105 | { | 194 | { |
@@ -192,14 +281,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
192 | } | 281 | } |
193 | } | 282 | } |
194 | 283 | ||
284 | /* Hold PHYs in reset while initializing EHCI controller */ | ||
195 | if (pdata->phy_reset) { | 285 | if (pdata->phy_reset) { |
196 | if (gpio_is_valid(pdata->reset_gpio_port[0])) | 286 | if (gpio_is_valid(pdata->reset_gpio_port[0])) |
197 | gpio_request_one(pdata->reset_gpio_port[0], | 287 | gpio_set_value_cansleep(pdata->reset_gpio_port[0], 0); |
198 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | ||
199 | 288 | ||
200 | if (gpio_is_valid(pdata->reset_gpio_port[1])) | 289 | if (gpio_is_valid(pdata->reset_gpio_port[1])) |
201 | gpio_request_one(pdata->reset_gpio_port[1], | 290 | gpio_set_value_cansleep(pdata->reset_gpio_port[1], 0); |
202 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | ||
203 | 291 | ||
204 | /* Hold the PHY in RESET for enough time till DIR is high */ | 292 | /* Hold the PHY in RESET for enough time till DIR is high */ |
205 | udelay(10); | 293 | udelay(10); |
@@ -241,6 +329,11 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
241 | omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params); | 329 | omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params); |
242 | 330 | ||
243 | ehci_reset(omap_ehci); | 331 | ehci_reset(omap_ehci); |
332 | ret = usb_add_hcd(hcd, irq, IRQF_SHARED); | ||
333 | if (ret) { | ||
334 | dev_err(dev, "failed to add hcd with err %d\n", ret); | ||
335 | goto err_add_hcd; | ||
336 | } | ||
244 | 337 | ||
245 | if (pdata->phy_reset) { | 338 | if (pdata->phy_reset) { |
246 | /* Hold the PHY in RESET for enough time till | 339 | /* Hold the PHY in RESET for enough time till |
@@ -255,17 +348,79 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
255 | gpio_set_value_cansleep(pdata->reset_gpio_port[1], 1); | 348 | gpio_set_value_cansleep(pdata->reset_gpio_port[1], 1); |
256 | } | 349 | } |
257 | 350 | ||
258 | ret = usb_add_hcd(hcd, irq, IRQF_SHARED); | 351 | /* root ports should always stay powered */ |
259 | if (ret) { | 352 | ehci_port_power(omap_ehci, 1); |
260 | dev_err(dev, "failed to add hcd with err %d\n", ret); | 353 | |
354 | /* get clocks */ | ||
355 | utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk"); | ||
356 | if (IS_ERR(utmi_p1_fck)) { | ||
357 | ret = PTR_ERR(utmi_p1_fck); | ||
358 | dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret); | ||
261 | goto err_add_hcd; | 359 | goto err_add_hcd; |
262 | } | 360 | } |
263 | 361 | ||
264 | /* root ports should always stay powered */ | 362 | xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck"); |
265 | ehci_port_power(omap_ehci, 1); | 363 | if (IS_ERR(xclk60mhsp1_ck)) { |
364 | ret = PTR_ERR(xclk60mhsp1_ck); | ||
365 | dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret); | ||
366 | goto err_utmi_p1_fck; | ||
367 | } | ||
368 | |||
369 | utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk"); | ||
370 | if (IS_ERR(utmi_p2_fck)) { | ||
371 | ret = PTR_ERR(utmi_p2_fck); | ||
372 | dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret); | ||
373 | goto err_xclk60mhsp1_ck; | ||
374 | } | ||
375 | |||
376 | xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck"); | ||
377 | if (IS_ERR(xclk60mhsp2_ck)) { | ||
378 | ret = PTR_ERR(xclk60mhsp2_ck); | ||
379 | dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret); | ||
380 | goto err_utmi_p2_fck; | ||
381 | } | ||
382 | |||
383 | usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk"); | ||
384 | if (IS_ERR(usbhost_p1_fck)) { | ||
385 | ret = PTR_ERR(usbhost_p1_fck); | ||
386 | dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret); | ||
387 | goto err_xclk60mhsp2_ck; | ||
388 | } | ||
389 | |||
390 | usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk"); | ||
391 | if (IS_ERR(usbhost_p2_fck)) { | ||
392 | ret = PTR_ERR(usbhost_p2_fck); | ||
393 | dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret); | ||
394 | goto err_usbhost_p1_fck; | ||
395 | } | ||
396 | |||
397 | init_60m_fclk = clk_get(dev, "init_60m_fclk"); | ||
398 | if (IS_ERR(init_60m_fclk)) { | ||
399 | ret = PTR_ERR(init_60m_fclk); | ||
400 | dev_err(dev, "init_60m_fclk failed error:%d\n", ret); | ||
401 | goto err_usbhost_p2_fck; | ||
402 | } | ||
266 | 403 | ||
267 | return 0; | 404 | return 0; |
268 | 405 | ||
406 | err_usbhost_p2_fck: | ||
407 | clk_put(usbhost_p2_fck); | ||
408 | |||
409 | err_usbhost_p1_fck: | ||
410 | clk_put(usbhost_p1_fck); | ||
411 | |||
412 | err_xclk60mhsp2_ck: | ||
413 | clk_put(xclk60mhsp2_ck); | ||
414 | |||
415 | err_utmi_p2_fck: | ||
416 | clk_put(utmi_p2_fck); | ||
417 | |||
418 | err_xclk60mhsp1_ck: | ||
419 | clk_put(xclk60mhsp1_ck); | ||
420 | |||
421 | err_utmi_p1_fck: | ||
422 | clk_put(utmi_p1_fck); | ||
423 | |||
269 | err_add_hcd: | 424 | err_add_hcd: |
270 | disable_put_regulator(pdata); | 425 | disable_put_regulator(pdata); |
271 | pm_runtime_put_sync(dev); | 426 | pm_runtime_put_sync(dev); |
@@ -294,6 +449,15 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
294 | disable_put_regulator(dev->platform_data); | 449 | disable_put_regulator(dev->platform_data); |
295 | iounmap(hcd->regs); | 450 | iounmap(hcd->regs); |
296 | usb_put_hcd(hcd); | 451 | usb_put_hcd(hcd); |
452 | |||
453 | clk_put(utmi_p1_fck); | ||
454 | clk_put(utmi_p2_fck); | ||
455 | clk_put(xclk60mhsp1_ck); | ||
456 | clk_put(xclk60mhsp2_ck); | ||
457 | clk_put(usbhost_p1_fck); | ||
458 | clk_put(usbhost_p2_fck); | ||
459 | clk_put(init_60m_fclk); | ||
460 | |||
297 | pm_runtime_put_sync(dev); | 461 | pm_runtime_put_sync(dev); |
298 | pm_runtime_disable(dev); | 462 | pm_runtime_disable(dev); |
299 | 463 | ||
@@ -364,7 +528,7 @@ static const struct hc_driver ehci_omap_hc_driver = { | |||
364 | * root hub support | 528 | * root hub support |
365 | */ | 529 | */ |
366 | .hub_status_data = ehci_hub_status_data, | 530 | .hub_status_data = ehci_hub_status_data, |
367 | .hub_control = ehci_hub_control, | 531 | .hub_control = omap_ehci_hub_control, |
368 | .bus_suspend = ehci_bus_suspend, | 532 | .bus_suspend = ehci_bus_suspend, |
369 | .bus_resume = ehci_bus_resume, | 533 | .bus_resume = ehci_bus_resume, |
370 | 534 | ||
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index bc94d7bf072d..123481793a47 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -144,14 +144,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
144 | hcd->has_tt = 1; | 144 | hcd->has_tt = 1; |
145 | tdi_reset(ehci); | 145 | tdi_reset(ehci); |
146 | } | 146 | } |
147 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) { | ||
148 | /* EHCI #1 or #2 on 6 Series/C200 Series chipset */ | ||
149 | if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) { | ||
150 | ehci_info(ehci, "broken D3 during system sleep on ASUS\n"); | ||
151 | hcd->broken_pci_sleep = 1; | ||
152 | device_set_wakeup_capable(&pdev->dev, false); | ||
153 | } | ||
154 | } | ||
155 | break; | 147 | break; |
156 | case PCI_VENDOR_ID_TDI: | 148 | case PCI_VENDOR_ID_TDI: |
157 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { | 149 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { |
diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c index ca819cdd0c5e..e7cb3925abf8 100644 --- a/drivers/usb/host/ehci-sh.c +++ b/drivers/usb/host/ehci-sh.c | |||
@@ -126,8 +126,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) | |||
126 | goto fail_create_hcd; | 126 | goto fail_create_hcd; |
127 | } | 127 | } |
128 | 128 | ||
129 | if (pdev->dev.platform_data != NULL) | 129 | pdata = pdev->dev.platform_data; |
130 | pdata = pdev->dev.platform_data; | ||
131 | 130 | ||
132 | /* initialize hcd */ | 131 | /* initialize hcd */ |
133 | hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev, | 132 | hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev, |
diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index 9c2cc4633894..e9713d589e30 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c | |||
@@ -270,14 +270,12 @@ static int ehci_hcd_xilinx_of_remove(struct platform_device *op) | |||
270 | * | 270 | * |
271 | * Properly shutdown the hcd, call driver's shutdown routine. | 271 | * Properly shutdown the hcd, call driver's shutdown routine. |
272 | */ | 272 | */ |
273 | static int ehci_hcd_xilinx_of_shutdown(struct platform_device *op) | 273 | static void ehci_hcd_xilinx_of_shutdown(struct platform_device *op) |
274 | { | 274 | { |
275 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); | 275 | struct usb_hcd *hcd = dev_get_drvdata(&op->dev); |
276 | 276 | ||
277 | if (hcd->driver->shutdown) | 277 | if (hcd->driver->shutdown) |
278 | hcd->driver->shutdown(hcd); | 278 | hcd->driver->shutdown(hcd); |
279 | |||
280 | return 0; | ||
281 | } | 279 | } |
282 | 280 | ||
283 | 281 | ||
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 836772dfabd3..2f3619eefefa 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -317,7 +317,7 @@ static int ohci_bus_resume (struct usb_hcd *hcd) | |||
317 | } | 317 | } |
318 | 318 | ||
319 | /* Carry out the final steps of resuming the controller device */ | 319 | /* Carry out the final steps of resuming the controller device */ |
320 | static void ohci_finish_controller_resume(struct usb_hcd *hcd) | 320 | static void __maybe_unused ohci_finish_controller_resume(struct usb_hcd *hcd) |
321 | { | 321 | { |
322 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | 322 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
323 | int port; | 323 | int port; |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 2732ef660c5c..7b01094d7993 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
@@ -462,6 +462,42 @@ void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, | |||
462 | } | 462 | } |
463 | } | 463 | } |
464 | 464 | ||
465 | /* Updates Link Status for super Speed port */ | ||
466 | static void xhci_hub_report_link_state(u32 *status, u32 status_reg) | ||
467 | { | ||
468 | u32 pls = status_reg & PORT_PLS_MASK; | ||
469 | |||
470 | /* resume state is a xHCI internal state. | ||
471 | * Do not report it to usb core. | ||
472 | */ | ||
473 | if (pls == XDEV_RESUME) | ||
474 | return; | ||
475 | |||
476 | /* When the CAS bit is set then warm reset | ||
477 | * should be performed on port | ||
478 | */ | ||
479 | if (status_reg & PORT_CAS) { | ||
480 | /* The CAS bit can be set while the port is | ||
481 | * in any link state. | ||
482 | * Only roothubs have CAS bit, so we | ||
483 | * pretend to be in compliance mode | ||
484 | * unless we're already in compliance | ||
485 | * or the inactive state. | ||
486 | */ | ||
487 | if (pls != USB_SS_PORT_LS_COMP_MOD && | ||
488 | pls != USB_SS_PORT_LS_SS_INACTIVE) { | ||
489 | pls = USB_SS_PORT_LS_COMP_MOD; | ||
490 | } | ||
491 | /* Return also connection bit - | ||
492 | * hub state machine resets port | ||
493 | * when this bit is set. | ||
494 | */ | ||
495 | pls |= USB_PORT_STAT_CONNECTION; | ||
496 | } | ||
497 | /* update status field */ | ||
498 | *status |= pls; | ||
499 | } | ||
500 | |||
465 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | 501 | int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, |
466 | u16 wIndex, char *buf, u16 wLength) | 502 | u16 wIndex, char *buf, u16 wLength) |
467 | { | 503 | { |
@@ -606,13 +642,9 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
606 | else | 642 | else |
607 | status |= USB_PORT_STAT_POWER; | 643 | status |= USB_PORT_STAT_POWER; |
608 | } | 644 | } |
609 | /* Port Link State */ | 645 | /* Update Port Link State for super speed ports*/ |
610 | if (hcd->speed == HCD_USB3) { | 646 | if (hcd->speed == HCD_USB3) { |
611 | /* resume state is a xHCI internal state. | 647 | xhci_hub_report_link_state(&status, temp); |
612 | * Do not report it to usb core. | ||
613 | */ | ||
614 | if ((temp & PORT_PLS_MASK) != XDEV_RESUME) | ||
615 | status |= (temp & PORT_PLS_MASK); | ||
616 | } | 648 | } |
617 | if (bus_state->port_c_suspend & (1 << wIndex)) | 649 | if (bus_state->port_c_suspend & (1 << wIndex)) |
618 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; | 650 | status |= 1 << USB_PORT_FEAT_C_SUSPEND; |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index ec4338eec826..77689bd64cac 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -793,10 +793,9 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci, | |||
793 | struct xhci_virt_device *virt_dev, | 793 | struct xhci_virt_device *virt_dev, |
794 | int slot_id) | 794 | int slot_id) |
795 | { | 795 | { |
796 | struct list_head *tt; | ||
797 | struct list_head *tt_list_head; | 796 | struct list_head *tt_list_head; |
798 | struct list_head *tt_next; | 797 | struct xhci_tt_bw_info *tt_info, *next; |
799 | struct xhci_tt_bw_info *tt_info; | 798 | bool slot_found = false; |
800 | 799 | ||
801 | /* If the device never made it past the Set Address stage, | 800 | /* If the device never made it past the Set Address stage, |
802 | * it may not have the real_port set correctly. | 801 | * it may not have the real_port set correctly. |
@@ -808,34 +807,16 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci, | |||
808 | } | 807 | } |
809 | 808 | ||
810 | tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts); | 809 | tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts); |
811 | if (list_empty(tt_list_head)) | 810 | list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) { |
812 | return; | 811 | /* Multi-TT hubs will have more than one entry */ |
813 | 812 | if (tt_info->slot_id == slot_id) { | |
814 | list_for_each(tt, tt_list_head) { | 813 | slot_found = true; |
815 | tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list); | 814 | list_del(&tt_info->tt_list); |
816 | if (tt_info->slot_id == slot_id) | 815 | kfree(tt_info); |
816 | } else if (slot_found) { | ||
817 | break; | 817 | break; |
818 | } | ||
818 | } | 819 | } |
819 | /* Cautionary measure in case the hub was disconnected before we | ||
820 | * stored the TT information. | ||
821 | */ | ||
822 | if (tt_info->slot_id != slot_id) | ||
823 | return; | ||
824 | |||
825 | tt_next = tt->next; | ||
826 | tt_info = list_entry(tt, struct xhci_tt_bw_info, | ||
827 | tt_list); | ||
828 | /* Multi-TT hubs will have more than one entry */ | ||
829 | do { | ||
830 | list_del(tt); | ||
831 | kfree(tt_info); | ||
832 | tt = tt_next; | ||
833 | if (list_empty(tt_list_head)) | ||
834 | break; | ||
835 | tt_next = tt->next; | ||
836 | tt_info = list_entry(tt, struct xhci_tt_bw_info, | ||
837 | tt_list); | ||
838 | } while (tt_info->slot_id == slot_id); | ||
839 | } | 820 | } |
840 | 821 | ||
841 | int xhci_alloc_tt_info(struct xhci_hcd *xhci, | 822 | int xhci_alloc_tt_info(struct xhci_hcd *xhci, |
@@ -1791,17 +1772,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1791 | { | 1772 | { |
1792 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); | 1773 | struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); |
1793 | struct dev_info *dev_info, *next; | 1774 | struct dev_info *dev_info, *next; |
1794 | struct list_head *tt_list_head; | ||
1795 | struct list_head *tt; | ||
1796 | struct list_head *endpoints; | ||
1797 | struct list_head *ep, *q; | ||
1798 | struct xhci_tt_bw_info *tt_info; | ||
1799 | struct xhci_interval_bw_table *bwt; | ||
1800 | struct xhci_virt_ep *virt_ep; | ||
1801 | |||
1802 | unsigned long flags; | 1775 | unsigned long flags; |
1803 | int size; | 1776 | int size; |
1804 | int i; | 1777 | int i, j, num_ports; |
1805 | 1778 | ||
1806 | /* Free the Event Ring Segment Table and the actual Event Ring */ | 1779 | /* Free the Event Ring Segment Table and the actual Event Ring */ |
1807 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); | 1780 | size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); |
@@ -1860,21 +1833,22 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1860 | } | 1833 | } |
1861 | spin_unlock_irqrestore(&xhci->lock, flags); | 1834 | spin_unlock_irqrestore(&xhci->lock, flags); |
1862 | 1835 | ||
1863 | bwt = &xhci->rh_bw->bw_table; | 1836 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
1864 | for (i = 0; i < XHCI_MAX_INTERVAL; i++) { | 1837 | for (i = 0; i < num_ports; i++) { |
1865 | endpoints = &bwt->interval_bw[i].endpoints; | 1838 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; |
1866 | list_for_each_safe(ep, q, endpoints) { | 1839 | for (j = 0; j < XHCI_MAX_INTERVAL; j++) { |
1867 | virt_ep = list_entry(ep, struct xhci_virt_ep, bw_endpoint_list); | 1840 | struct list_head *ep = &bwt->interval_bw[j].endpoints; |
1868 | list_del(&virt_ep->bw_endpoint_list); | 1841 | while (!list_empty(ep)) |
1869 | kfree(virt_ep); | 1842 | list_del_init(ep->next); |
1870 | } | 1843 | } |
1871 | } | 1844 | } |
1872 | 1845 | ||
1873 | tt_list_head = &xhci->rh_bw->tts; | 1846 | for (i = 0; i < num_ports; i++) { |
1874 | list_for_each_safe(tt, q, tt_list_head) { | 1847 | struct xhci_tt_bw_info *tt, *n; |
1875 | tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list); | 1848 | list_for_each_entry_safe(tt, n, &xhci->rh_bw[i].tts, tt_list) { |
1876 | list_del(tt); | 1849 | list_del(&tt->tt_list); |
1877 | kfree(tt_info); | 1850 | kfree(tt); |
1851 | } | ||
1878 | } | 1852 | } |
1879 | 1853 | ||
1880 | xhci->num_usb2_ports = 0; | 1854 | xhci->num_usb2_ports = 0; |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 23b4aefd1036..8275645889da 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -885,6 +885,17 @@ static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci, | |||
885 | num_trbs_free_temp = ep_ring->num_trbs_free; | 885 | num_trbs_free_temp = ep_ring->num_trbs_free; |
886 | dequeue_temp = ep_ring->dequeue; | 886 | dequeue_temp = ep_ring->dequeue; |
887 | 887 | ||
888 | /* If we get two back-to-back stalls, and the first stalled transfer | ||
889 | * ends just before a link TRB, the dequeue pointer will be left on | ||
890 | * the link TRB by the code in the while loop. So we have to update | ||
891 | * the dequeue pointer one segment further, or we'll jump off | ||
892 | * the segment into la-la-land. | ||
893 | */ | ||
894 | if (last_trb(xhci, ep_ring, ep_ring->deq_seg, ep_ring->dequeue)) { | ||
895 | ep_ring->deq_seg = ep_ring->deq_seg->next; | ||
896 | ep_ring->dequeue = ep_ring->deq_seg->trbs; | ||
897 | } | ||
898 | |||
888 | while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) { | 899 | while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) { |
889 | /* We have more usable TRBs */ | 900 | /* We have more usable TRBs */ |
890 | ep_ring->num_trbs_free++; | 901 | ep_ring->num_trbs_free++; |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index afdc73ee84a6..a979cd0dbe0f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -795,8 +795,8 @@ int xhci_suspend(struct xhci_hcd *xhci) | |||
795 | command = xhci_readl(xhci, &xhci->op_regs->command); | 795 | command = xhci_readl(xhci, &xhci->op_regs->command); |
796 | command |= CMD_CSS; | 796 | command |= CMD_CSS; |
797 | xhci_writel(xhci, command, &xhci->op_regs->command); | 797 | xhci_writel(xhci, command, &xhci->op_regs->command); |
798 | if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10*100)) { | 798 | if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10 * 1000)) { |
799 | xhci_warn(xhci, "WARN: xHC CMD_CSS timeout\n"); | 799 | xhci_warn(xhci, "WARN: xHC save state timeout\n"); |
800 | spin_unlock_irq(&xhci->lock); | 800 | spin_unlock_irq(&xhci->lock); |
801 | return -ETIMEDOUT; | 801 | return -ETIMEDOUT; |
802 | } | 802 | } |
@@ -848,8 +848,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
848 | command |= CMD_CRS; | 848 | command |= CMD_CRS; |
849 | xhci_writel(xhci, command, &xhci->op_regs->command); | 849 | xhci_writel(xhci, command, &xhci->op_regs->command); |
850 | if (handshake(xhci, &xhci->op_regs->status, | 850 | if (handshake(xhci, &xhci->op_regs->status, |
851 | STS_RESTORE, 0, 10*100)) { | 851 | STS_RESTORE, 0, 10 * 1000)) { |
852 | xhci_dbg(xhci, "WARN: xHC CMD_CSS timeout\n"); | 852 | xhci_warn(xhci, "WARN: xHC restore state timeout\n"); |
853 | spin_unlock_irq(&xhci->lock); | 853 | spin_unlock_irq(&xhci->lock); |
854 | return -ETIMEDOUT; | 854 | return -ETIMEDOUT; |
855 | } | 855 | } |
@@ -3906,7 +3906,7 @@ static u16 xhci_get_timeout_no_hub_lpm(struct usb_device *udev, | |||
3906 | default: | 3906 | default: |
3907 | dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n", | 3907 | dev_warn(&udev->dev, "%s: Can't get timeout for non-U1 or U2 state.\n", |
3908 | __func__); | 3908 | __func__); |
3909 | return -EINVAL; | 3909 | return USB3_LPM_DISABLED; |
3910 | } | 3910 | } |
3911 | 3911 | ||
3912 | if (sel <= max_sel_pel && pel <= max_sel_pel) | 3912 | if (sel <= max_sel_pel && pel <= max_sel_pel) |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index de3d6e3e57be..55c0785810c9 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -341,7 +341,11 @@ struct xhci_op_regs { | |||
341 | #define PORT_PLC (1 << 22) | 341 | #define PORT_PLC (1 << 22) |
342 | /* port configure error change - port failed to configure its link partner */ | 342 | /* port configure error change - port failed to configure its link partner */ |
343 | #define PORT_CEC (1 << 23) | 343 | #define PORT_CEC (1 << 23) |
344 | /* bit 24 reserved */ | 344 | /* Cold Attach Status - xHC can set this bit to report device attached during |
345 | * Sx state. Warm port reset should be perfomed to clear this bit and move port | ||
346 | * to connected state. | ||
347 | */ | ||
348 | #define PORT_CAS (1 << 24) | ||
345 | /* wake on connect (enable) */ | 349 | /* wake on connect (enable) */ |
346 | #define PORT_WKCONN_E (1 << 25) | 350 | #define PORT_WKCONN_E (1 << 25) |
347 | /* wake on disconnect (enable) */ | 351 | /* wake on disconnect (enable) */ |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 768b4b55c816..9d63ba4d10d6 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | 35 | ||
36 | #include <mach/cputype.h> | 36 | #include <mach/cputype.h> |
37 | #include <mach/hardware.h> | ||
37 | 38 | ||
38 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
39 | 40 | ||
diff --git a/drivers/usb/musb/davinci.h b/drivers/usb/musb/davinci.h index 046c84433cad..371baa0ee509 100644 --- a/drivers/usb/musb/davinci.h +++ b/drivers/usb/musb/davinci.h | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | /* Integrated highspeed/otg PHY */ | 17 | /* Integrated highspeed/otg PHY */ |
18 | #define USBPHY_CTL_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x34) | 18 | #define USBPHY_CTL_PADDR 0x01c40034 |
19 | #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */ | 19 | #define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */ |
20 | #define USBPHY_PHYCLKGD BIT(8) | 20 | #define USBPHY_PHYCLKGD BIT(8) |
21 | #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */ | 21 | #define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */ |
@@ -27,7 +27,7 @@ | |||
27 | #define USBPHY_OTGPDWN BIT(1) | 27 | #define USBPHY_OTGPDWN BIT(1) |
28 | #define USBPHY_PHYPDWN BIT(0) | 28 | #define USBPHY_PHYPDWN BIT(0) |
29 | 29 | ||
30 | #define DM355_DEEPSLEEP_PADDR (DAVINCI_SYSTEM_MODULE_BASE + 0x48) | 30 | #define DM355_DEEPSLEEP_PADDR 0x01c40048 |
31 | #define DRVVBUS_FORCE BIT(2) | 31 | #define DRVVBUS_FORCE BIT(2) |
32 | #define DRVVBUS_OVERRIDE BIT(1) | 32 | #define DRVVBUS_OVERRIDE BIT(1) |
33 | 33 | ||
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index f42c29b11f71..95918dacc99a 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1232,6 +1232,7 @@ static int musb_gadget_disable(struct usb_ep *ep) | |||
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | musb_ep->desc = NULL; | 1234 | musb_ep->desc = NULL; |
1235 | musb_ep->end_point.desc = NULL; | ||
1235 | 1236 | ||
1236 | /* abort all pending DMA and requests */ | 1237 | /* abort all pending DMA and requests */ |
1237 | nuke(musb_ep, -ESHUTDOWN); | 1238 | nuke(musb_ep, -ESHUTDOWN); |
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 1b1926200ba7..1e71079ce33b 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -82,6 +82,7 @@ static const struct usb_device_id id_table[] = { | |||
82 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ | 82 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ |
83 | { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */ | 83 | { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */ |
84 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ | 84 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ |
85 | { USB_DEVICE(0x10C4, 0x80C4) }, /* Cygnal Integrated Products, Inc., Optris infrared thermometer */ | ||
85 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 86 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
86 | { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */ | 87 | { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */ |
87 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ | 88 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ |
@@ -92,6 +93,7 @@ static const struct usb_device_id id_table[] = { | |||
92 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ | 93 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ |
93 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ | 94 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ |
94 | { 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 */ | ||
95 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ | 97 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ |
96 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ | 98 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ |
97 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ | 99 | { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ |
@@ -133,7 +135,13 @@ static const struct usb_device_id id_table[] = { | |||
133 | { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ | 135 | { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ |
134 | { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ | 136 | { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ |
135 | { 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 */ | ||
136 | { 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 */ | ||
137 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ | 145 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ |
138 | { 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 */ |
139 | { 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 */ |
@@ -145,7 +153,11 @@ static const struct usb_device_id id_table[] = { | |||
145 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | 153 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
146 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 154 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
147 | { 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 */ | ||
148 | { 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 */ | ||
149 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ | 161 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ |
150 | { } /* Terminating Entry */ | 162 | { } /* Terminating Entry */ |
151 | }; | 163 | }; |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 8c084ea34e26..bc912e5a3beb 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -737,6 +737,7 @@ static struct usb_device_id id_table_combined [] = { | |||
737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 737 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | 738 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, |
739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, | 739 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, |
740 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_RTS01_PID) }, | ||
740 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 741 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
741 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 742 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
742 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 743 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index f3c7c78ede33..5661c7e2d415 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -784,6 +784,7 @@ | |||
784 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | 784 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ |
785 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | 785 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ |
786 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ | 786 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ |
787 | #define RTSYSTEMS_RTS01_PID 0x9e57 /* USB-RTS01 Radio Cable */ | ||
787 | 788 | ||
788 | 789 | ||
789 | /* | 790 | /* |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 105a6d898ca4..9b026bf7afef 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -39,13 +39,6 @@ MODULE_PARM_DESC(product, "User specified USB idProduct"); | |||
39 | 39 | ||
40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ | 40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ |
41 | 41 | ||
42 | /* we want to look at all devices, as the vendor/product id can change | ||
43 | * depending on the command line argument */ | ||
44 | static const struct usb_device_id generic_serial_ids[] = { | ||
45 | {.driver_info = 42}, | ||
46 | {} | ||
47 | }; | ||
48 | |||
49 | /* All of the device info needed for the Generic Serial Converter */ | 42 | /* All of the device info needed for the Generic Serial Converter */ |
50 | struct usb_serial_driver usb_serial_generic_device = { | 43 | struct usb_serial_driver usb_serial_generic_device = { |
51 | .driver = { | 44 | .driver = { |
@@ -79,7 +72,8 @@ int usb_serial_generic_register(int _debug) | |||
79 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; | 72 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; |
80 | 73 | ||
81 | /* register our generic driver with ourselves */ | 74 | /* register our generic driver with ourselves */ |
82 | retval = usb_serial_register_drivers(serial_drivers, "usbserial_generic", generic_serial_ids); | 75 | retval = usb_serial_register_drivers(serial_drivers, |
76 | "usbserial_generic", generic_device_ids); | ||
83 | #endif | 77 | #endif |
84 | return retval; | 78 | return retval; |
85 | } | 79 | } |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index d0ec1aa52719..a71fa0aa0406 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -309,13 +309,16 @@ static int mct_u232_set_modem_ctrl(struct usb_serial *serial, | |||
309 | MCT_U232_SET_REQUEST_TYPE, | 309 | MCT_U232_SET_REQUEST_TYPE, |
310 | 0, 0, buf, MCT_U232_SET_MODEM_CTRL_SIZE, | 310 | 0, 0, buf, MCT_U232_SET_MODEM_CTRL_SIZE, |
311 | WDR_TIMEOUT); | 311 | WDR_TIMEOUT); |
312 | if (rc < 0) | 312 | kfree(buf); |
313 | dev_err(&serial->dev->dev, | 313 | |
314 | "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); | ||
315 | dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr); | 314 | dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr); |
316 | 315 | ||
317 | kfree(buf); | 316 | if (rc < 0) { |
318 | return rc; | 317 | dev_err(&serial->dev->dev, |
318 | "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); | ||
319 | return rc; | ||
320 | } | ||
321 | return 0; | ||
319 | } /* mct_u232_set_modem_ctrl */ | 322 | } /* mct_u232_set_modem_ctrl */ |
320 | 323 | ||
321 | static int mct_u232_get_modem_stat(struct usb_serial *serial, | 324 | static int mct_u232_get_modem_stat(struct usb_serial *serial, |
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c index 81423f7361db..d47eb06fe463 100644 --- a/drivers/usb/serial/metro-usb.c +++ b/drivers/usb/serial/metro-usb.c | |||
@@ -222,14 +222,6 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
222 | metro_priv->throttled = 0; | 222 | metro_priv->throttled = 0; |
223 | spin_unlock_irqrestore(&metro_priv->lock, flags); | 223 | spin_unlock_irqrestore(&metro_priv->lock, flags); |
224 | 224 | ||
225 | /* | ||
226 | * Force low_latency on so that our tty_push actually forces the data | ||
227 | * through, otherwise it is scheduled, and with high data rates (like | ||
228 | * with OHCI) data can get lost. | ||
229 | */ | ||
230 | if (tty) | ||
231 | tty->low_latency = 1; | ||
232 | |||
233 | /* Clear the urb pipe. */ | 225 | /* Clear the urb pipe. */ |
234 | usb_clear_halt(serial->dev, port->interrupt_in_urb->pipe); | 226 | usb_clear_halt(serial->dev, port->interrupt_in_urb->pipe); |
235 | 227 | ||
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 29160f8b5101..57eca2448424 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -190,7 +190,7 @@ | |||
190 | 190 | ||
191 | static int device_type; | 191 | static int device_type; |
192 | 192 | ||
193 | static const struct usb_device_id id_table[] __devinitconst = { | 193 | static const struct usb_device_id id_table[] = { |
194 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, | 194 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, |
195 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 195 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
196 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, | 196 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 1aae9028cd0b..417ab1b0aa30 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -47,6 +47,7 @@ | |||
47 | /* Function prototypes */ | 47 | /* Function prototypes */ |
48 | static int option_probe(struct usb_serial *serial, | 48 | static int option_probe(struct usb_serial *serial, |
49 | const struct usb_device_id *id); | 49 | const struct usb_device_id *id); |
50 | static void option_release(struct usb_serial *serial); | ||
50 | static int option_send_setup(struct usb_serial_port *port); | 51 | static int option_send_setup(struct usb_serial_port *port); |
51 | static void option_instat_callback(struct urb *urb); | 52 | static void option_instat_callback(struct urb *urb); |
52 | 53 | ||
@@ -150,6 +151,7 @@ static void option_instat_callback(struct urb *urb); | |||
150 | #define HUAWEI_PRODUCT_E14AC 0x14AC | 151 | #define HUAWEI_PRODUCT_E14AC 0x14AC |
151 | #define HUAWEI_PRODUCT_K3806 0x14AE | 152 | #define HUAWEI_PRODUCT_K3806 0x14AE |
152 | #define HUAWEI_PRODUCT_K4605 0x14C6 | 153 | #define HUAWEI_PRODUCT_K4605 0x14C6 |
154 | #define HUAWEI_PRODUCT_K5005 0x14C8 | ||
153 | #define HUAWEI_PRODUCT_K3770 0x14C9 | 155 | #define HUAWEI_PRODUCT_K3770 0x14C9 |
154 | #define HUAWEI_PRODUCT_K3771 0x14CA | 156 | #define HUAWEI_PRODUCT_K3771 0x14CA |
155 | #define HUAWEI_PRODUCT_K4510 0x14CB | 157 | #define HUAWEI_PRODUCT_K4510 0x14CB |
@@ -234,6 +236,7 @@ static void option_instat_callback(struct urb *urb); | |||
234 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 | 236 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 |
235 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 | 237 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 |
236 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | 238 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 |
239 | #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 | ||
237 | 240 | ||
238 | /* AMOI PRODUCTS */ | 241 | /* AMOI PRODUCTS */ |
239 | #define AMOI_VENDOR_ID 0x1614 | 242 | #define AMOI_VENDOR_ID 0x1614 |
@@ -425,7 +428,7 @@ static void option_instat_callback(struct urb *urb); | |||
425 | #define SAMSUNG_VENDOR_ID 0x04e8 | 428 | #define SAMSUNG_VENDOR_ID 0x04e8 |
426 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 | 429 | #define SAMSUNG_PRODUCT_GT_B3730 0x6889 |
427 | 430 | ||
428 | /* YUGA products www.yuga-info.com*/ | 431 | /* YUGA products www.yuga-info.com gavin.kx@qq.com */ |
429 | #define YUGA_VENDOR_ID 0x257A | 432 | #define YUGA_VENDOR_ID 0x257A |
430 | #define YUGA_PRODUCT_CEM600 0x1601 | 433 | #define YUGA_PRODUCT_CEM600 0x1601 |
431 | #define YUGA_PRODUCT_CEM610 0x1602 | 434 | #define YUGA_PRODUCT_CEM610 0x1602 |
@@ -442,6 +445,8 @@ static void option_instat_callback(struct urb *urb); | |||
442 | #define YUGA_PRODUCT_CEU516 0x160C | 445 | #define YUGA_PRODUCT_CEU516 0x160C |
443 | #define YUGA_PRODUCT_CEU528 0x160D | 446 | #define YUGA_PRODUCT_CEU528 0x160D |
444 | #define YUGA_PRODUCT_CEU526 0x160F | 447 | #define YUGA_PRODUCT_CEU526 0x160F |
448 | #define YUGA_PRODUCT_CEU881 0x161F | ||
449 | #define YUGA_PRODUCT_CEU882 0x162F | ||
445 | 450 | ||
446 | #define YUGA_PRODUCT_CWM600 0x2601 | 451 | #define YUGA_PRODUCT_CWM600 0x2601 |
447 | #define YUGA_PRODUCT_CWM610 0x2602 | 452 | #define YUGA_PRODUCT_CWM610 0x2602 |
@@ -457,23 +462,26 @@ static void option_instat_callback(struct urb *urb); | |||
457 | #define YUGA_PRODUCT_CWU518 0x260B | 462 | #define YUGA_PRODUCT_CWU518 0x260B |
458 | #define YUGA_PRODUCT_CWU516 0x260C | 463 | #define YUGA_PRODUCT_CWU516 0x260C |
459 | #define YUGA_PRODUCT_CWU528 0x260D | 464 | #define YUGA_PRODUCT_CWU528 0x260D |
465 | #define YUGA_PRODUCT_CWU581 0x260E | ||
460 | #define YUGA_PRODUCT_CWU526 0x260F | 466 | #define YUGA_PRODUCT_CWU526 0x260F |
461 | 467 | #define YUGA_PRODUCT_CWU582 0x261F | |
462 | #define YUGA_PRODUCT_CLM600 0x2601 | 468 | #define YUGA_PRODUCT_CWU583 0x262F |
463 | #define YUGA_PRODUCT_CLM610 0x2602 | 469 | |
464 | #define YUGA_PRODUCT_CLM500 0x2603 | 470 | #define YUGA_PRODUCT_CLM600 0x3601 |
465 | #define YUGA_PRODUCT_CLM510 0x2604 | 471 | #define YUGA_PRODUCT_CLM610 0x3602 |
466 | #define YUGA_PRODUCT_CLM800 0x2605 | 472 | #define YUGA_PRODUCT_CLM500 0x3603 |
467 | #define YUGA_PRODUCT_CLM900 0x2606 | 473 | #define YUGA_PRODUCT_CLM510 0x3604 |
468 | 474 | #define YUGA_PRODUCT_CLM800 0x3605 | |
469 | #define YUGA_PRODUCT_CLU718 0x2607 | 475 | #define YUGA_PRODUCT_CLM900 0x3606 |
470 | #define YUGA_PRODUCT_CLU716 0x2608 | 476 | |
471 | #define YUGA_PRODUCT_CLU728 0x2609 | 477 | #define YUGA_PRODUCT_CLU718 0x3607 |
472 | #define YUGA_PRODUCT_CLU726 0x260A | 478 | #define YUGA_PRODUCT_CLU716 0x3608 |
473 | #define YUGA_PRODUCT_CLU518 0x260B | 479 | #define YUGA_PRODUCT_CLU728 0x3609 |
474 | #define YUGA_PRODUCT_CLU516 0x260C | 480 | #define YUGA_PRODUCT_CLU726 0x360A |
475 | #define YUGA_PRODUCT_CLU528 0x260D | 481 | #define YUGA_PRODUCT_CLU518 0x360B |
476 | #define YUGA_PRODUCT_CLU526 0x260F | 482 | #define YUGA_PRODUCT_CLU516 0x360C |
483 | #define YUGA_PRODUCT_CLU528 0x360D | ||
484 | #define YUGA_PRODUCT_CLU526 0x360F | ||
477 | 485 | ||
478 | /* Viettel products */ | 486 | /* Viettel products */ |
479 | #define VIETTEL_VENDOR_ID 0x2262 | 487 | #define VIETTEL_VENDOR_ID 0x2262 |
@@ -489,6 +497,19 @@ static void option_instat_callback(struct urb *urb); | |||
489 | 497 | ||
490 | /* MediaTek products */ | 498 | /* MediaTek products */ |
491 | #define MEDIATEK_VENDOR_ID 0x0e8d | 499 | #define MEDIATEK_VENDOR_ID 0x0e8d |
500 | #define MEDIATEK_PRODUCT_DC_1COM 0x00a0 | ||
501 | #define MEDIATEK_PRODUCT_DC_4COM 0x00a5 | ||
502 | #define MEDIATEK_PRODUCT_DC_5COM 0x00a4 | ||
503 | #define MEDIATEK_PRODUCT_7208_1COM 0x7101 | ||
504 | #define MEDIATEK_PRODUCT_7208_2COM 0x7102 | ||
505 | #define MEDIATEK_PRODUCT_FP_1COM 0x0003 | ||
506 | #define MEDIATEK_PRODUCT_FP_2COM 0x0023 | ||
507 | #define MEDIATEK_PRODUCT_FPDC_1COM 0x0043 | ||
508 | #define MEDIATEK_PRODUCT_FPDC_2COM 0x0033 | ||
509 | |||
510 | /* Cellient products */ | ||
511 | #define CELLIENT_VENDOR_ID 0x2692 | ||
512 | #define CELLIENT_PRODUCT_MEN200 0x9005 | ||
492 | 513 | ||
493 | /* some devices interfaces need special handling due to a number of reasons */ | 514 | /* some devices interfaces need special handling due to a number of reasons */ |
494 | enum option_blacklist_reason { | 515 | enum option_blacklist_reason { |
@@ -542,6 +563,10 @@ static const struct option_blacklist_info net_intf1_blacklist = { | |||
542 | .reserved = BIT(1), | 563 | .reserved = BIT(1), |
543 | }; | 564 | }; |
544 | 565 | ||
566 | static const struct option_blacklist_info net_intf2_blacklist = { | ||
567 | .reserved = BIT(2), | ||
568 | }; | ||
569 | |||
545 | static const struct option_blacklist_info net_intf3_blacklist = { | 570 | static const struct option_blacklist_info net_intf3_blacklist = { |
546 | .reserved = BIT(3), | 571 | .reserved = BIT(3), |
547 | }; | 572 | }; |
@@ -666,6 +691,11 @@ static const struct usb_device_id option_ids[] = { | |||
666 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, | 691 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3806, 0xff, 0xff, 0xff) }, |
667 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), | 692 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), |
668 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 693 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
694 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x31) }, | ||
695 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0x01, 0x32) }, | ||
696 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x31) }, | ||
697 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x32) }, | ||
698 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K5005, 0xff, 0x01, 0x33) }, | ||
669 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) }, | 699 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x31) }, |
670 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) }, | 700 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3770, 0xff, 0x02, 0x32) }, |
671 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) }, | 701 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3771, 0xff, 0x02, 0x31) }, |
@@ -722,6 +752,8 @@ static const struct usb_device_id option_ids[] = { | |||
722 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, | 752 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, |
723 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, | 753 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, |
724 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, | 754 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, |
755 | /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ | ||
756 | { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, | ||
725 | 757 | ||
726 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 758 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
727 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 759 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
@@ -1080,6 +1112,8 @@ static const struct usb_device_id option_ids[] = { | |||
1080 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, | 1112 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, |
1081 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, | 1113 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, |
1082 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, | 1114 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, |
1115 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff), | ||
1116 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, | ||
1083 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, | 1117 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, |
1084 | 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, | 1118 | 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, |
1085 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, | 1119 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, |
@@ -1209,6 +1243,11 @@ static const struct usb_device_id option_ids[] = { | |||
1209 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) }, | 1243 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU516) }, |
1210 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, | 1244 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU528) }, |
1211 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, | 1245 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CLU526) }, |
1246 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU881) }, | ||
1247 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEU882) }, | ||
1248 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU581) }, | ||
1249 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU582) }, | ||
1250 | { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU583) }, | ||
1212 | { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, | 1251 | { USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) }, |
1213 | { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, | 1252 | { USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) }, |
1214 | { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */ | 1253 | { USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */ |
@@ -1216,6 +1255,18 @@ static const struct usb_device_id option_ids[] = { | |||
1216 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, | 1255 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, |
1217 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, | 1256 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, |
1218 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ | 1257 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ |
1258 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_1COM, 0x0a, 0x00, 0x00) }, | ||
1259 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x02, 0x01) }, | ||
1260 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_5COM, 0xff, 0x00, 0x00) }, | ||
1261 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x02, 0x01) }, | ||
1262 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM, 0xff, 0x00, 0x00) }, | ||
1263 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_1COM, 0x02, 0x00, 0x00) }, | ||
1264 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7208_2COM, 0x02, 0x02, 0x01) }, | ||
1265 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_1COM, 0x0a, 0x00, 0x00) }, | ||
1266 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) }, | ||
1267 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) }, | ||
1268 | { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) }, | ||
1269 | { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, | ||
1219 | { } /* Terminating entry */ | 1270 | { } /* Terminating entry */ |
1220 | }; | 1271 | }; |
1221 | MODULE_DEVICE_TABLE(usb, option_ids); | 1272 | MODULE_DEVICE_TABLE(usb, option_ids); |
@@ -1245,7 +1296,7 @@ static struct usb_serial_driver option_1port_device = { | |||
1245 | .ioctl = usb_wwan_ioctl, | 1296 | .ioctl = usb_wwan_ioctl, |
1246 | .attach = usb_wwan_startup, | 1297 | .attach = usb_wwan_startup, |
1247 | .disconnect = usb_wwan_disconnect, | 1298 | .disconnect = usb_wwan_disconnect, |
1248 | .release = usb_wwan_release, | 1299 | .release = option_release, |
1249 | .read_int_callback = option_instat_callback, | 1300 | .read_int_callback = option_instat_callback, |
1250 | #ifdef CONFIG_PM | 1301 | #ifdef CONFIG_PM |
1251 | .suspend = usb_wwan_suspend, | 1302 | .suspend = usb_wwan_suspend, |
@@ -1259,35 +1310,6 @@ static struct usb_serial_driver * const serial_drivers[] = { | |||
1259 | 1310 | ||
1260 | static bool debug; | 1311 | static bool debug; |
1261 | 1312 | ||
1262 | /* per port private data */ | ||
1263 | |||
1264 | #define N_IN_URB 4 | ||
1265 | #define N_OUT_URB 4 | ||
1266 | #define IN_BUFLEN 4096 | ||
1267 | #define OUT_BUFLEN 4096 | ||
1268 | |||
1269 | struct option_port_private { | ||
1270 | /* Input endpoints and buffer for this port */ | ||
1271 | struct urb *in_urbs[N_IN_URB]; | ||
1272 | u8 *in_buffer[N_IN_URB]; | ||
1273 | /* Output endpoints and buffer for this port */ | ||
1274 | struct urb *out_urbs[N_OUT_URB]; | ||
1275 | u8 *out_buffer[N_OUT_URB]; | ||
1276 | unsigned long out_busy; /* Bit vector of URBs in use */ | ||
1277 | int opened; | ||
1278 | struct usb_anchor delayed; | ||
1279 | |||
1280 | /* Settings for the port */ | ||
1281 | int rts_state; /* Handshaking pins (outputs) */ | ||
1282 | int dtr_state; | ||
1283 | int cts_state; /* Handshaking pins (inputs) */ | ||
1284 | int dsr_state; | ||
1285 | int dcd_state; | ||
1286 | int ri_state; | ||
1287 | |||
1288 | unsigned long tx_start_time[N_OUT_URB]; | ||
1289 | }; | ||
1290 | |||
1291 | module_usb_serial_driver(serial_drivers, option_ids); | 1313 | module_usb_serial_driver(serial_drivers, option_ids); |
1292 | 1314 | ||
1293 | static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, | 1315 | static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, |
@@ -1356,12 +1378,22 @@ static int option_probe(struct usb_serial *serial, | |||
1356 | return 0; | 1378 | return 0; |
1357 | } | 1379 | } |
1358 | 1380 | ||
1381 | static void option_release(struct usb_serial *serial) | ||
1382 | { | ||
1383 | struct usb_wwan_intf_private *priv = usb_get_serial_data(serial); | ||
1384 | |||
1385 | usb_wwan_release(serial); | ||
1386 | |||
1387 | kfree(priv); | ||
1388 | } | ||
1389 | |||
1359 | static void option_instat_callback(struct urb *urb) | 1390 | static void option_instat_callback(struct urb *urb) |
1360 | { | 1391 | { |
1361 | int err; | 1392 | int err; |
1362 | int status = urb->status; | 1393 | int status = urb->status; |
1363 | struct usb_serial_port *port = urb->context; | 1394 | struct usb_serial_port *port = urb->context; |
1364 | struct option_port_private *portdata = usb_get_serial_port_data(port); | 1395 | struct usb_wwan_port_private *portdata = |
1396 | usb_get_serial_port_data(port); | ||
1365 | 1397 | ||
1366 | dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); | 1398 | dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); |
1367 | 1399 | ||
@@ -1421,7 +1453,7 @@ static int option_send_setup(struct usb_serial_port *port) | |||
1421 | struct usb_serial *serial = port->serial; | 1453 | struct usb_serial *serial = port->serial; |
1422 | struct usb_wwan_intf_private *intfdata = | 1454 | struct usb_wwan_intf_private *intfdata = |
1423 | (struct usb_wwan_intf_private *) serial->private; | 1455 | (struct usb_wwan_intf_private *) serial->private; |
1424 | struct option_port_private *portdata; | 1456 | struct usb_wwan_port_private *portdata; |
1425 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; | 1457 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; |
1426 | int val = 0; | 1458 | int val = 0; |
1427 | 1459 | ||
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 0d5fe59ebb9e..996015c5f1ac 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -105,7 +105,13 @@ static const struct usb_device_id id_table[] = { | |||
105 | {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */ | 105 | {USB_DEVICE(0x1410, 0xa021)}, /* Novatel Gobi 3000 Composite */ |
106 | {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */ | 106 | {USB_DEVICE(0x413c, 0x8193)}, /* Dell Gobi 3000 QDL */ |
107 | {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ | 107 | {USB_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */ |
108 | {USB_DEVICE(0x1199, 0x9010)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
109 | {USB_DEVICE(0x1199, 0x9012)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
108 | {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ | 110 | {USB_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ |
111 | {USB_DEVICE(0x1199, 0x9014)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
112 | {USB_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ | ||
113 | {USB_DEVICE(0x1199, 0x9018)}, /* Sierra Wireless Gobi 3000 QDL */ | ||
114 | {USB_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ | ||
109 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ | 115 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ |
110 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ | 116 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ |
111 | { } /* Terminating entry */ | 117 | { } /* Terminating entry */ |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ba54a0a8235c..d423d36acc04 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -294,6 +294,10 @@ static const struct usb_device_id id_table[] = { | |||
294 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ | 294 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ |
295 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | 295 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
296 | }, | 296 | }, |
297 | /* AT&T Direct IP LTE modems */ | ||
298 | { USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF), | ||
299 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | ||
300 | }, | ||
297 | { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ | 301 | { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ |
298 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | 302 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
299 | }, | 303 | }, |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 6a1b609a0d94..27483f91a4a3 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -659,12 +659,14 @@ exit: | |||
659 | static struct usb_serial_driver *search_serial_device( | 659 | static struct usb_serial_driver *search_serial_device( |
660 | struct usb_interface *iface) | 660 | struct usb_interface *iface) |
661 | { | 661 | { |
662 | const struct usb_device_id *id; | 662 | const struct usb_device_id *id = NULL; |
663 | struct usb_serial_driver *drv; | 663 | struct usb_serial_driver *drv; |
664 | struct usb_driver *driver = to_usb_driver(iface->dev.driver); | ||
664 | 665 | ||
665 | /* Check if the usb id matches a known device */ | 666 | /* Check if the usb id matches a known device */ |
666 | list_for_each_entry(drv, &usb_serial_driver_list, driver_list) { | 667 | list_for_each_entry(drv, &usb_serial_driver_list, driver_list) { |
667 | id = get_iface_id(drv, iface); | 668 | if (drv->usb_driver == driver) |
669 | id = get_iface_id(drv, iface); | ||
668 | if (id) | 670 | if (id) |
669 | return drv; | 671 | return drv; |
670 | } | 672 | } |
@@ -755,7 +757,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
755 | 757 | ||
756 | if (retval) { | 758 | if (retval) { |
757 | dbg("sub driver rejected device"); | 759 | dbg("sub driver rejected device"); |
758 | kfree(serial); | 760 | usb_serial_put(serial); |
759 | module_put(type->driver.owner); | 761 | module_put(type->driver.owner); |
760 | return retval; | 762 | return retval; |
761 | } | 763 | } |
@@ -827,7 +829,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
827 | */ | 829 | */ |
828 | if (num_bulk_in == 0 || num_bulk_out == 0) { | 830 | if (num_bulk_in == 0 || num_bulk_out == 0) { |
829 | dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); | 831 | dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); |
830 | kfree(serial); | 832 | usb_serial_put(serial); |
831 | module_put(type->driver.owner); | 833 | module_put(type->driver.owner); |
832 | return -ENODEV; | 834 | return -ENODEV; |
833 | } | 835 | } |
@@ -841,7 +843,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
841 | if (num_ports == 0) { | 843 | if (num_ports == 0) { |
842 | dev_err(&interface->dev, | 844 | dev_err(&interface->dev, |
843 | "Generic device with no bulk out, not allowed.\n"); | 845 | "Generic device with no bulk out, not allowed.\n"); |
844 | kfree(serial); | 846 | usb_serial_put(serial); |
845 | module_put(type->driver.owner); | 847 | module_put(type->driver.owner); |
846 | return -EIO; | 848 | return -EIO; |
847 | } | 849 | } |
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/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/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index fa2b03750316..2979292650d6 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig | |||
@@ -88,7 +88,7 @@ config LCD_PLATFORM | |||
88 | 88 | ||
89 | config LCD_TOSA | 89 | config LCD_TOSA |
90 | tristate "Sharp SL-6000 LCD Driver" | 90 | tristate "Sharp SL-6000 LCD Driver" |
91 | depends on SPI && MACH_TOSA | 91 | depends on I2C && SPI && MACH_TOSA |
92 | help | 92 | help |
93 | If you have an Sharp SL-6000 Zaurus say Y to enable a driver | 93 | If you have an Sharp SL-6000 Zaurus say Y to enable a driver |
94 | for its LCD. | 94 | for its LCD. |
diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c index 6c9399341bcf..9327cd1b3143 100644 --- a/drivers/video/backlight/ili9320.c +++ b/drivers/video/backlight/ili9320.c | |||
@@ -263,7 +263,7 @@ int __devinit ili9320_probe_spi(struct spi_device *spi, | |||
263 | 263 | ||
264 | EXPORT_SYMBOL_GPL(ili9320_probe_spi); | 264 | EXPORT_SYMBOL_GPL(ili9320_probe_spi); |
265 | 265 | ||
266 | int __devexit ili9320_remove(struct ili9320 *ili) | 266 | int ili9320_remove(struct ili9320 *ili) |
267 | { | 267 | { |
268 | ili9320_power(ili, FB_BLANK_POWERDOWN); | 268 | ili9320_power(ili, FB_BLANK_POWERDOWN); |
269 | 269 | ||
diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c index 33ea874c87d2..9bdd4b0c18c8 100644 --- a/drivers/video/bfin_adv7393fb.c +++ b/drivers/video/bfin_adv7393fb.c | |||
@@ -353,18 +353,16 @@ adv7393_read_proc(char *page, char **start, off_t off, | |||
353 | 353 | ||
354 | static int | 354 | static int |
355 | adv7393_write_proc(struct file *file, const char __user * buffer, | 355 | adv7393_write_proc(struct file *file, const char __user * buffer, |
356 | unsigned long count, void *data) | 356 | size_t count, void *data) |
357 | { | 357 | { |
358 | struct adv7393fb_device *fbdev = data; | 358 | struct adv7393fb_device *fbdev = data; |
359 | char line[8]; | ||
360 | unsigned int val; | 359 | unsigned int val; |
361 | int ret; | 360 | int ret; |
362 | 361 | ||
363 | ret = copy_from_user(line, buffer, count); | 362 | ret = kstrtouint_from_user(buffer, count, 0, &val); |
364 | if (ret) | 363 | if (ret) |
365 | return -EFAULT; | 364 | return -EFAULT; |
366 | 365 | ||
367 | val = simple_strtoul(line, NULL, 0); | ||
368 | adv7393_write(fbdev->client, val >> 8, val & 0xff); | 366 | adv7393_write(fbdev->client, val >> 8, val & 0xff); |
369 | 367 | ||
370 | return count; | 368 | return count; |
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c index 377dde3d5bfc..c95b417d0d41 100644 --- a/drivers/video/broadsheetfb.c +++ b/drivers/video/broadsheetfb.c | |||
@@ -1211,7 +1211,7 @@ static int __devexit broadsheetfb_remove(struct platform_device *dev) | |||
1211 | 1211 | ||
1212 | static struct platform_driver broadsheetfb_driver = { | 1212 | static struct platform_driver broadsheetfb_driver = { |
1213 | .probe = broadsheetfb_probe, | 1213 | .probe = broadsheetfb_probe, |
1214 | .remove = broadsheetfb_remove, | 1214 | .remove = __devexit_p(broadsheetfb_remove), |
1215 | .driver = { | 1215 | .driver = { |
1216 | .owner = THIS_MODULE, | 1216 | .owner = THIS_MODULE, |
1217 | .name = "broadsheetfb", | 1217 | .name = "broadsheetfb", |
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index c2d11fef114b..e2c96d01d8f5 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig | |||
@@ -224,5 +224,19 @@ config FONT_10x18 | |||
224 | big letters. It fits between the sun 12x22 and the normal 8x16 font. | 224 | big letters. It fits between the sun 12x22 and the normal 8x16 font. |
225 | If other fonts are too big or too small for you, say Y, otherwise say N. | 225 | If other fonts are too big or too small for you, say Y, otherwise say N. |
226 | 226 | ||
227 | config FONT_AUTOSELECT | ||
228 | def_bool y | ||
229 | depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON | ||
230 | depends on !FONT_8x8 | ||
231 | depends on !FONT_6x11 | ||
232 | depends on !FONT_7x14 | ||
233 | depends on !FONT_PEARL_8x8 | ||
234 | depends on !FONT_ACORN_8x8 | ||
235 | depends on !FONT_MINI_4x6 | ||
236 | depends on !FONT_SUN8x16 | ||
237 | depends on !FONT_SUN12x22 | ||
238 | depends on !FONT_10x18 | ||
239 | select FONT_8x16 | ||
240 | |||
227 | endmenu | 241 | endmenu |
228 | 242 | ||
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c index ab0a8e527333..85e4f44bfa61 100644 --- a/drivers/video/mbx/mbxfb.c +++ b/drivers/video/mbx/mbxfb.c | |||
@@ -1045,7 +1045,7 @@ static int __devexit mbxfb_remove(struct platform_device *dev) | |||
1045 | 1045 | ||
1046 | static struct platform_driver mbxfb_driver = { | 1046 | static struct platform_driver mbxfb_driver = { |
1047 | .probe = mbxfb_probe, | 1047 | .probe = mbxfb_probe, |
1048 | .remove = mbxfb_remove, | 1048 | .remove = __devexit_p(mbxfb_remove), |
1049 | .suspend = mbxfb_suspend, | 1049 | .suspend = mbxfb_suspend, |
1050 | .resume = mbxfb_resume, | 1050 | .resume = mbxfb_resume, |
1051 | .driver = { | 1051 | .driver = { |
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 2ce9992f403b..901576eb5a84 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -526,7 +526,7 @@ static ssize_t taal_num_errors_show(struct device *dev, | |||
526 | { | 526 | { |
527 | struct omap_dss_device *dssdev = to_dss_device(dev); | 527 | struct omap_dss_device *dssdev = to_dss_device(dev); |
528 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | 528 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); |
529 | u8 errors; | 529 | u8 errors = 0; |
530 | int r; | 530 | int r; |
531 | 531 | ||
532 | mutex_lock(&td->lock); | 532 | mutex_lock(&td->lock); |
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 72ded9cd2cb0..58bd9c27369d 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/device.h> | 33 | #include <linux/device.h> |
34 | #include <linux/regulator/consumer.h> | 34 | #include <linux/regulator/consumer.h> |
35 | #include <linux/suspend.h> | ||
35 | 36 | ||
36 | #include <video/omapdss.h> | 37 | #include <video/omapdss.h> |
37 | 38 | ||
@@ -194,14 +195,35 @@ static inline int dss_initialize_debugfs(void) | |||
194 | static inline void dss_uninitialize_debugfs(void) | 195 | static inline void dss_uninitialize_debugfs(void) |
195 | { | 196 | { |
196 | } | 197 | } |
197 | static inline int dss_debugfs_create_file(const char *name, | 198 | int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) |
198 | void (*write)(struct seq_file *)) | ||
199 | { | 199 | { |
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ | 202 | #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ |
203 | 203 | ||
204 | /* PLATFORM DEVICE */ | 204 | /* PLATFORM DEVICE */ |
205 | static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void *d) | ||
206 | { | ||
207 | DSSDBG("pm notif %lu\n", v); | ||
208 | |||
209 | switch (v) { | ||
210 | case PM_SUSPEND_PREPARE: | ||
211 | DSSDBG("suspending displays\n"); | ||
212 | return dss_suspend_all_devices(); | ||
213 | |||
214 | case PM_POST_SUSPEND: | ||
215 | DSSDBG("resuming displays\n"); | ||
216 | return dss_resume_all_devices(); | ||
217 | |||
218 | default: | ||
219 | return 0; | ||
220 | } | ||
221 | } | ||
222 | |||
223 | static struct notifier_block omap_dss_pm_notif_block = { | ||
224 | .notifier_call = omap_dss_pm_notif, | ||
225 | }; | ||
226 | |||
205 | static int __init omap_dss_probe(struct platform_device *pdev) | 227 | static int __init omap_dss_probe(struct platform_device *pdev) |
206 | { | 228 | { |
207 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 229 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
@@ -225,6 +247,8 @@ static int __init omap_dss_probe(struct platform_device *pdev) | |||
225 | else if (pdata->default_device) | 247 | else if (pdata->default_device) |
226 | core.default_display_name = pdata->default_device->name; | 248 | core.default_display_name = pdata->default_device->name; |
227 | 249 | ||
250 | register_pm_notifier(&omap_dss_pm_notif_block); | ||
251 | |||
228 | return 0; | 252 | return 0; |
229 | 253 | ||
230 | err_debugfs: | 254 | err_debugfs: |
@@ -234,6 +258,8 @@ err_debugfs: | |||
234 | 258 | ||
235 | static int omap_dss_remove(struct platform_device *pdev) | 259 | static int omap_dss_remove(struct platform_device *pdev) |
236 | { | 260 | { |
261 | unregister_pm_notifier(&omap_dss_pm_notif_block); | ||
262 | |||
237 | dss_uninitialize_debugfs(); | 263 | dss_uninitialize_debugfs(); |
238 | 264 | ||
239 | dss_uninit_overlays(pdev); | 265 | dss_uninit_overlays(pdev); |
@@ -248,25 +274,9 @@ static void omap_dss_shutdown(struct platform_device *pdev) | |||
248 | dss_disable_all_devices(); | 274 | dss_disable_all_devices(); |
249 | } | 275 | } |
250 | 276 | ||
251 | static int omap_dss_suspend(struct platform_device *pdev, pm_message_t state) | ||
252 | { | ||
253 | DSSDBG("suspend %d\n", state.event); | ||
254 | |||
255 | return dss_suspend_all_devices(); | ||
256 | } | ||
257 | |||
258 | static int omap_dss_resume(struct platform_device *pdev) | ||
259 | { | ||
260 | DSSDBG("resume\n"); | ||
261 | |||
262 | return dss_resume_all_devices(); | ||
263 | } | ||
264 | |||
265 | static struct platform_driver omap_dss_driver = { | 277 | static struct platform_driver omap_dss_driver = { |
266 | .remove = omap_dss_remove, | 278 | .remove = omap_dss_remove, |
267 | .shutdown = omap_dss_shutdown, | 279 | .shutdown = omap_dss_shutdown, |
268 | .suspend = omap_dss_suspend, | ||
269 | .resume = omap_dss_resume, | ||
270 | .driver = { | 280 | .driver = { |
271 | .name = "omapdss", | 281 | .name = "omapdss", |
272 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 4749ac356469..397d4eee11bb 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -384,7 +384,7 @@ void dispc_runtime_put(void) | |||
384 | DSSDBG("dispc_runtime_put\n"); | 384 | DSSDBG("dispc_runtime_put\n"); |
385 | 385 | ||
386 | r = pm_runtime_put_sync(&dispc.pdev->dev); | 386 | r = pm_runtime_put_sync(&dispc.pdev->dev); |
387 | WARN_ON(r < 0); | 387 | WARN_ON(r < 0 && r != -ENOSYS); |
388 | } | 388 | } |
389 | 389 | ||
390 | static inline bool dispc_mgr_is_lcd(enum omap_channel channel) | 390 | static inline bool dispc_mgr_is_lcd(enum omap_channel channel) |
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index ec363d8390ed..14ce8cc079e3 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -1075,7 +1075,7 @@ void dsi_runtime_put(struct platform_device *dsidev) | |||
1075 | DSSDBG("dsi_runtime_put\n"); | 1075 | DSSDBG("dsi_runtime_put\n"); |
1076 | 1076 | ||
1077 | r = pm_runtime_put_sync(&dsi->pdev->dev); | 1077 | r = pm_runtime_put_sync(&dsi->pdev->dev); |
1078 | WARN_ON(r < 0); | 1078 | WARN_ON(r < 0 && r != -ENOSYS); |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | /* source clock for DSI PLL. this could also be PCLKFREE */ | 1081 | /* source clock for DSI PLL. this could also be PCLKFREE */ |
@@ -3724,7 +3724,7 @@ static int dsi_compute_interleave_lp(int blank, int enter_hs, int exit_hs, | |||
3724 | /* CLKIN4DDR = 16 * TXBYTECLKHS */ | 3724 | /* CLKIN4DDR = 16 * TXBYTECLKHS */ |
3725 | tlp_avail = thsbyte_clk * (blank - trans_lp); | 3725 | tlp_avail = thsbyte_clk * (blank - trans_lp); |
3726 | 3726 | ||
3727 | ttxclkesc = tdsi_fclk / lp_clk_div; | 3727 | ttxclkesc = tdsi_fclk * lp_clk_div; |
3728 | 3728 | ||
3729 | lp_inter = ((tlp_avail - 8 * thsbyte_clk - 5 * tdsi_fclk) / ttxclkesc - | 3729 | lp_inter = ((tlp_avail - 8 * thsbyte_clk - 5 * tdsi_fclk) / ttxclkesc - |
3730 | 26) / 16; | 3730 | 26) / 16; |
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 6ea1ff149f6f..d2b57197b292 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
@@ -731,7 +731,7 @@ static void dss_runtime_put(void) | |||
731 | DSSDBG("dss_runtime_put\n"); | 731 | DSSDBG("dss_runtime_put\n"); |
732 | 732 | ||
733 | r = pm_runtime_put_sync(&dss.pdev->dev); | 733 | r = pm_runtime_put_sync(&dss.pdev->dev); |
734 | WARN_ON(r < 0); | 734 | WARN_ON(r < 0 && r != -ENOSYS && r != -EBUSY); |
735 | } | 735 | } |
736 | 736 | ||
737 | /* DEBUGFS */ | 737 | /* DEBUGFS */ |
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 8195c7166d20..26a2430a7028 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -138,7 +138,7 @@ static void hdmi_runtime_put(void) | |||
138 | DSSDBG("hdmi_runtime_put\n"); | 138 | DSSDBG("hdmi_runtime_put\n"); |
139 | 139 | ||
140 | r = pm_runtime_put_sync(&hdmi.pdev->dev); | 140 | r = pm_runtime_put_sync(&hdmi.pdev->dev); |
141 | WARN_ON(r < 0); | 141 | WARN_ON(r < 0 && r != -ENOSYS); |
142 | } | 142 | } |
143 | 143 | ||
144 | static int __init hdmi_init_display(struct omap_dss_device *dssdev) | 144 | static int __init hdmi_init_display(struct omap_dss_device *dssdev) |
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 3d8c206e90e5..7985fa12b9b4 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
@@ -141,7 +141,7 @@ static void rfbi_runtime_put(void) | |||
141 | DSSDBG("rfbi_runtime_put\n"); | 141 | DSSDBG("rfbi_runtime_put\n"); |
142 | 142 | ||
143 | r = pm_runtime_put_sync(&rfbi.pdev->dev); | 143 | r = pm_runtime_put_sync(&rfbi.pdev->dev); |
144 | WARN_ON(r < 0); | 144 | WARN_ON(r < 0 && r != -ENOSYS); |
145 | } | 145 | } |
146 | 146 | ||
147 | void rfbi_bus_lock(void) | 147 | void rfbi_bus_lock(void) |
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 2b8973931ff4..3907c8b6ecbc 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c | |||
@@ -402,7 +402,7 @@ static void venc_runtime_put(void) | |||
402 | DSSDBG("venc_runtime_put\n"); | 402 | DSSDBG("venc_runtime_put\n"); |
403 | 403 | ||
404 | r = pm_runtime_put_sync(&venc.pdev->dev); | 404 | r = pm_runtime_put_sync(&venc.pdev->dev); |
405 | WARN_ON(r < 0); | 405 | WARN_ON(r < 0 && r != -ENOSYS); |
406 | } | 406 | } |
407 | 407 | ||
408 | static const struct venc_config *venc_timings_to_config( | 408 | static const struct venc_config *venc_timings_to_config( |
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 5f9d8e69029e..ea7b661e7229 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
@@ -361,7 +361,7 @@ static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk) | |||
361 | result = (unsigned int)tmp / 1000; | 361 | result = (unsigned int)tmp / 1000; |
362 | 362 | ||
363 | dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", | 363 | dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", |
364 | pixclk, clk, result, clk / result); | 364 | pixclk, clk, result, result ? clk / result : clk); |
365 | 365 | ||
366 | return result; | 366 | return result; |
367 | } | 367 | } |
@@ -1348,8 +1348,14 @@ static void s3c_fb_clear_win(struct s3c_fb *sfb, int win) | |||
1348 | writel(0, regs + VIDOSD_A(win, sfb->variant)); | 1348 | writel(0, regs + VIDOSD_A(win, sfb->variant)); |
1349 | writel(0, regs + VIDOSD_B(win, sfb->variant)); | 1349 | writel(0, regs + VIDOSD_B(win, sfb->variant)); |
1350 | writel(0, regs + VIDOSD_C(win, sfb->variant)); | 1350 | writel(0, regs + VIDOSD_C(win, sfb->variant)); |
1351 | reg = readl(regs + SHADOWCON); | 1351 | |
1352 | writel(reg & ~SHADOWCON_WINx_PROTECT(win), regs + SHADOWCON); | 1352 | if (sfb->variant.has_shadowcon) { |
1353 | reg = readl(sfb->regs + SHADOWCON); | ||
1354 | reg &= ~(SHADOWCON_WINx_PROTECT(win) | | ||
1355 | SHADOWCON_CHx_ENABLE(win) | | ||
1356 | SHADOWCON_CHx_LOCAL_ENABLE(win)); | ||
1357 | writel(reg, sfb->regs + SHADOWCON); | ||
1358 | } | ||
1353 | } | 1359 | } |
1354 | 1360 | ||
1355 | static int __devinit s3c_fb_probe(struct platform_device *pdev) | 1361 | static int __devinit s3c_fb_probe(struct platform_device *pdev) |
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index cee7803a0a1c..f3d3b9ce4751 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -1351,7 +1351,7 @@ static void savagefb_set_par_int(struct savagefb_par *par, struct savage_reg *r | |||
1351 | /* following part not present in X11 driver */ | 1351 | /* following part not present in X11 driver */ |
1352 | cr67 = vga_in8(0x3d5, par) & 0xf; | 1352 | cr67 = vga_in8(0x3d5, par) & 0xf; |
1353 | vga_out8(0x3d5, 0x50 | cr67, par); | 1353 | vga_out8(0x3d5, 0x50 | cr67, par); |
1354 | udelay(10000); | 1354 | mdelay(10); |
1355 | vga_out8(0x3d4, 0x67, par); | 1355 | vga_out8(0x3d4, 0x67, par); |
1356 | /* end of part */ | 1356 | /* end of part */ |
1357 | vga_out8(0x3d5, reg->CR67 & ~0x0c, par); | 1357 | vga_out8(0x3d5, reg->CR67 & ~0x0c, par); |
@@ -1904,11 +1904,11 @@ static int savage_init_hw(struct savagefb_par *par) | |||
1904 | vga_out8(0x3d4, 0x66, par); | 1904 | vga_out8(0x3d4, 0x66, par); |
1905 | cr66 = vga_in8(0x3d5, par); | 1905 | cr66 = vga_in8(0x3d5, par); |
1906 | vga_out8(0x3d5, cr66 | 0x02, par); | 1906 | vga_out8(0x3d5, cr66 | 0x02, par); |
1907 | udelay(10000); | 1907 | mdelay(10); |
1908 | 1908 | ||
1909 | vga_out8(0x3d4, 0x66, par); | 1909 | vga_out8(0x3d4, 0x66, par); |
1910 | vga_out8(0x3d5, cr66 & ~0x02, par); /* clear reset flag */ | 1910 | vga_out8(0x3d5, cr66 & ~0x02, par); /* clear reset flag */ |
1911 | udelay(10000); | 1911 | mdelay(10); |
1912 | 1912 | ||
1913 | 1913 | ||
1914 | /* | 1914 | /* |
@@ -1918,11 +1918,11 @@ static int savage_init_hw(struct savagefb_par *par) | |||
1918 | vga_out8(0x3d4, 0x3f, par); | 1918 | vga_out8(0x3d4, 0x3f, par); |
1919 | cr3f = vga_in8(0x3d5, par); | 1919 | cr3f = vga_in8(0x3d5, par); |
1920 | vga_out8(0x3d5, cr3f | 0x08, par); | 1920 | vga_out8(0x3d5, cr3f | 0x08, par); |
1921 | udelay(10000); | 1921 | mdelay(10); |
1922 | 1922 | ||
1923 | vga_out8(0x3d4, 0x3f, par); | 1923 | vga_out8(0x3d4, 0x3f, par); |
1924 | vga_out8(0x3d5, cr3f & ~0x08, par); /* clear reset flags */ | 1924 | vga_out8(0x3d5, cr3f & ~0x08, par); /* clear reset flags */ |
1925 | udelay(10000); | 1925 | mdelay(10); |
1926 | 1926 | ||
1927 | /* Savage ramdac speeds */ | 1927 | /* Savage ramdac speeds */ |
1928 | par->numClocks = 4; | 1928 | par->numClocks = 4; |
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: |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 6908e4ce2a0d..7595581d032c 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -827,6 +827,9 @@ int bind_evtchn_to_irq(unsigned int evtchn) | |||
827 | handle_edge_irq, "event"); | 827 | handle_edge_irq, "event"); |
828 | 828 | ||
829 | xen_irq_info_evtchn_init(irq, evtchn); | 829 | xen_irq_info_evtchn_init(irq, evtchn); |
830 | } else { | ||
831 | struct irq_info *info = info_for_irq(irq); | ||
832 | WARN_ON(info == NULL || info->type != IRQT_EVTCHN); | ||
830 | } | 833 | } |
831 | 834 | ||
832 | out: | 835 | out: |
@@ -862,6 +865,9 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu) | |||
862 | xen_irq_info_ipi_init(cpu, irq, evtchn, ipi); | 865 | xen_irq_info_ipi_init(cpu, irq, evtchn, ipi); |
863 | 866 | ||
864 | bind_evtchn_to_cpu(evtchn, cpu); | 867 | bind_evtchn_to_cpu(evtchn, cpu); |
868 | } else { | ||
869 | struct irq_info *info = info_for_irq(irq); | ||
870 | WARN_ON(info == NULL || info->type != IRQT_IPI); | ||
865 | } | 871 | } |
866 | 872 | ||
867 | out: | 873 | out: |
@@ -939,6 +945,9 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu) | |||
939 | xen_irq_info_virq_init(cpu, irq, evtchn, virq); | 945 | xen_irq_info_virq_init(cpu, irq, evtchn, virq); |
940 | 946 | ||
941 | bind_evtchn_to_cpu(evtchn, cpu); | 947 | bind_evtchn_to_cpu(evtchn, cpu); |
948 | } else { | ||
949 | struct irq_info *info = info_for_irq(irq); | ||
950 | WARN_ON(info == NULL || info->type != IRQT_VIRQ); | ||
942 | } | 951 | } |
943 | 952 | ||
944 | out: | 953 | out: |
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index b84bf0b6cc34..18fff88254eb 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c | |||
@@ -59,7 +59,7 @@ static int xen_add_device(struct device *dev) | |||
59 | 59 | ||
60 | #ifdef CONFIG_ACPI | 60 | #ifdef CONFIG_ACPI |
61 | handle = DEVICE_ACPI_HANDLE(&pci_dev->dev); | 61 | handle = DEVICE_ACPI_HANDLE(&pci_dev->dev); |
62 | if (!handle) | 62 | if (!handle && pci_dev->bus->bridge) |
63 | handle = DEVICE_ACPI_HANDLE(pci_dev->bus->bridge); | 63 | handle = DEVICE_ACPI_HANDLE(pci_dev->bus->bridge); |
64 | #ifdef CONFIG_PCI_IOV | 64 | #ifdef CONFIG_PCI_IOV |
65 | if (!handle && pci_dev->is_virtfn) | 65 | if (!handle && pci_dev->is_virtfn) |