diff options
Diffstat (limited to 'drivers')
110 files changed, 1065 insertions, 829 deletions
diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index d2fc94161848..26038c2a2a71 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c | |||
@@ -301,16 +301,20 @@ static int bay_add(acpi_handle handle, int id) | |||
301 | */ | 301 | */ |
302 | pdev->dev.uevent_suppress = 0; | 302 | pdev->dev.uevent_suppress = 0; |
303 | 303 | ||
304 | if (acpi_bay_add_fs(new_bay)) { | ||
305 | platform_device_unregister(new_bay->pdev); | ||
306 | goto bay_add_err; | ||
307 | } | ||
308 | |||
309 | /* register for events on this device */ | 304 | /* register for events on this device */ |
310 | status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, | 305 | status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, |
311 | bay_notify, new_bay); | 306 | bay_notify, new_bay); |
312 | if (ACPI_FAILURE(status)) { | 307 | if (ACPI_FAILURE(status)) { |
313 | printk(KERN_ERR PREFIX "Error installing bay notify handler\n"); | 308 | printk(KERN_INFO PREFIX "Error installing bay notify handler\n"); |
309 | platform_device_unregister(new_bay->pdev); | ||
310 | goto bay_add_err; | ||
311 | } | ||
312 | |||
313 | if (acpi_bay_add_fs(new_bay)) { | ||
314 | acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY, | ||
315 | bay_notify); | ||
316 | platform_device_unregister(new_bay->pdev); | ||
317 | goto bay_add_err; | ||
314 | } | 318 | } |
315 | 319 | ||
316 | /* if we are on a dock station, we should register for dock | 320 | /* if we are on a dock station, we should register for dock |
diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c index c78078315be9..f988a5e7d2b4 100644 --- a/drivers/acpi/dispatcher/dsfield.c +++ b/drivers/acpi/dispatcher/dsfield.c | |||
@@ -450,10 +450,6 @@ acpi_ds_init_field_objects(union acpi_parse_object *op, | |||
450 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 450 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
451 | } | 451 | } |
452 | 452 | ||
453 | if (!arg) { | ||
454 | return_ACPI_STATUS(AE_AML_NO_OPERAND); | ||
455 | } | ||
456 | |||
457 | /* Creating new namespace node(s), should not already exist */ | 453 | /* Creating new namespace node(s), should not already exist */ |
458 | 454 | ||
459 | flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | | 455 | flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | |
@@ -467,6 +463,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op, | |||
467 | 463 | ||
468 | /* | 464 | /* |
469 | * Walk the list of entries in the field_list | 465 | * Walk the list of entries in the field_list |
466 | * Note: field_list can be of zero length. In this case, Arg will be NULL. | ||
470 | */ | 467 | */ |
471 | while (arg) { | 468 | while (arg) { |
472 | /* | 469 | /* |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index fa44fb96fc34..96c542f7fded 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -834,7 +834,7 @@ static int dock_add(acpi_handle handle) | |||
834 | goto dock_add_err; | 834 | goto dock_add_err; |
835 | } | 835 | } |
836 | 836 | ||
837 | printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_DESCRIPTION); | 837 | printk(KERN_INFO PREFIX "%s\n", ACPI_DOCK_DRIVER_DESCRIPTION); |
838 | 838 | ||
839 | return 0; | 839 | return 0; |
840 | 840 | ||
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 0924992187e8..5622aee996b2 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -194,7 +194,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll) | |||
194 | while (time_before(jiffies, delay)) { | 194 | while (time_before(jiffies, delay)) { |
195 | if (acpi_ec_check_status(ec, event)) | 195 | if (acpi_ec_check_status(ec, event)) |
196 | return 0; | 196 | return 0; |
197 | udelay(ACPI_EC_UDELAY); | 197 | msleep(1); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n", | 200 | pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n", |
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index 24da921d13e3..39d742190584 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c | |||
@@ -375,9 +375,15 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
375 | goto cleanup; | 375 | goto cleanup; |
376 | } | 376 | } |
377 | 377 | ||
378 | /* | ||
379 | * Add the table to the namespace. | ||
380 | * | ||
381 | * Note: We load the table objects relative to the root of the namespace. | ||
382 | * This appears to go against the ACPI specification, but we do it for | ||
383 | * compatibility with other ACPI implementations. | ||
384 | */ | ||
378 | status = | 385 | status = |
379 | acpi_ex_add_table(table_index, walk_state->scope_info->scope.node, | 386 | acpi_ex_add_table(table_index, acpi_gbl_root_node, &ddb_handle); |
380 | &ddb_handle); | ||
381 | if (ACPI_FAILURE(status)) { | 387 | if (ACPI_FAILURE(status)) { |
382 | 388 | ||
383 | /* On error, table_ptr was deallocated above */ | 389 | /* On error, table_ptr was deallocated above */ |
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 06f8634fe58b..2808dc60fd67 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -272,6 +272,12 @@ static u32 rtc_handler(void *context) | |||
272 | static inline void rtc_wake_setup(void) | 272 | static inline void rtc_wake_setup(void) |
273 | { | 273 | { |
274 | acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); | 274 | acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); |
275 | /* | ||
276 | * After the RTC handler is installed, the Fixed_RTC event should | ||
277 | * be disabled. Only when the RTC alarm is set will it be enabled. | ||
278 | */ | ||
279 | acpi_clear_event(ACPI_EVENT_RTC); | ||
280 | acpi_disable_event(ACPI_EVENT_RTC, 0); | ||
275 | } | 281 | } |
276 | 282 | ||
277 | static void rtc_wake_on(struct device *dev) | 283 | static void rtc_wake_on(struct device *dev) |
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index d9937e05ec6a..dba3cfbe8cba 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -223,15 +223,17 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) | |||
223 | break; | 223 | break; |
224 | } | 224 | } |
225 | 225 | ||
226 | /* Set the system indicators to show the desired sleep state. */ | 226 | /* |
227 | 227 | * Set the system indicators to show the desired sleep state. | |
228 | * _SST is an optional method (return no error if not found) | ||
229 | */ | ||
228 | status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); | 230 | status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); |
229 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | 231 | if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { |
230 | ACPI_EXCEPTION((AE_INFO, status, | 232 | ACPI_EXCEPTION((AE_INFO, status, |
231 | "While executing method _SST")); | 233 | "While executing method _SST")); |
232 | } | 234 | } |
233 | 235 | ||
234 | return_ACPI_STATUS(status); | 236 | return_ACPI_STATUS(AE_OK); |
235 | } | 237 | } |
236 | 238 | ||
237 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) | 239 | ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) |
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 5d59cb33b1a5..658e5f3abae0 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c | |||
@@ -140,19 +140,42 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header) | |||
140 | } | 140 | } |
141 | } | 141 | } |
142 | 142 | ||
143 | /* | ||
144 | * A lot of BIOS fill in 10 (= no distance) everywhere. This messes | ||
145 | * up the NUMA heuristics which wants the local node to have a smaller | ||
146 | * distance than the others. | ||
147 | * Do some quick checks here and only use the SLIT if it passes. | ||
148 | */ | ||
149 | static __init int slit_valid(struct acpi_table_slit *slit) | ||
150 | { | ||
151 | int i, j; | ||
152 | int d = slit->locality_count; | ||
153 | for (i = 0; i < d; i++) { | ||
154 | for (j = 0; j < d; j++) { | ||
155 | u8 val = slit->entry[d*i + j]; | ||
156 | if (i == j) { | ||
157 | if (val != LOCAL_DISTANCE) | ||
158 | return 0; | ||
159 | } else if (val <= LOCAL_DISTANCE) | ||
160 | return 0; | ||
161 | } | ||
162 | } | ||
163 | return 1; | ||
164 | } | ||
165 | |||
143 | static int __init acpi_parse_slit(struct acpi_table_header *table) | 166 | static int __init acpi_parse_slit(struct acpi_table_header *table) |
144 | { | 167 | { |
145 | struct acpi_table_slit *slit; | 168 | struct acpi_table_slit *slit; |
146 | u32 localities; | ||
147 | 169 | ||
148 | if (!table) | 170 | if (!table) |
149 | return -EINVAL; | 171 | return -EINVAL; |
150 | 172 | ||
151 | slit = (struct acpi_table_slit *)table; | 173 | slit = (struct acpi_table_slit *)table; |
152 | 174 | ||
153 | /* downcast just for %llu vs %lu for i386/ia64 */ | 175 | if (!slit_valid(slit)) { |
154 | localities = (u32) slit->locality_count; | 176 | printk(KERN_INFO "ACPI: SLIT table looks invalid. Not used.\n"); |
155 | 177 | return -EINVAL; | |
178 | } | ||
156 | acpi_numa_slit_init(slit); | 179 | acpi_numa_slit_init(slit); |
157 | 180 | ||
158 | return 0; | 181 | return 0; |
diff --git a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c index f1e8bf65e24e..e94463778845 100644 --- a/drivers/acpi/parser/psargs.c +++ b/drivers/acpi/parser/psargs.c | |||
@@ -268,7 +268,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, | |||
268 | */ | 268 | */ |
269 | if (ACPI_SUCCESS(status) && | 269 | if (ACPI_SUCCESS(status) && |
270 | possible_method_call && (node->type == ACPI_TYPE_METHOD)) { | 270 | possible_method_call && (node->type == ACPI_TYPE_METHOD)) { |
271 | if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) { | 271 | if (walk_state->opcode == AML_UNLOAD_OP) { |
272 | /* | 272 | /* |
273 | * acpi_ps_get_next_namestring has increased the AML pointer, | 273 | * acpi_ps_get_next_namestring has increased the AML pointer, |
274 | * so we need to restore the saved AML pointer for method call. | 274 | * so we need to restore the saved AML pointer for method call. |
@@ -691,7 +691,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, | |||
691 | 691 | ||
692 | /* To support super_name arg of Unload */ | 692 | /* To support super_name arg of Unload */ |
693 | 693 | ||
694 | if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) { | 694 | if (walk_state->opcode == AML_UNLOAD_OP) { |
695 | status = | 695 | status = |
696 | acpi_ps_get_next_namepath(walk_state, | 696 | acpi_ps_get_next_namepath(walk_state, |
697 | parser_state, arg, | 697 | parser_state, arg, |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 386e5aa48834..9dd0fa93b9e1 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -86,7 +86,6 @@ static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); | |||
86 | static void acpi_processor_notify(acpi_handle handle, u32 event, void *data); | 86 | static void acpi_processor_notify(acpi_handle handle, u32 event, void *data); |
87 | static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); | 87 | static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); |
88 | static int acpi_processor_handle_eject(struct acpi_processor *pr); | 88 | static int acpi_processor_handle_eject(struct acpi_processor *pr); |
89 | extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | ||
90 | 89 | ||
91 | 90 | ||
92 | static const struct acpi_device_id processor_device_ids[] = { | 91 | static const struct acpi_device_id processor_device_ids[] = { |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 2dd2c1f3a01c..556ee1585192 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -1669,6 +1669,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1669 | return -EINVAL; | 1669 | return -EINVAL; |
1670 | } | 1670 | } |
1671 | 1671 | ||
1672 | dev->cpu = pr->id; | ||
1672 | for (i = 0; i < CPUIDLE_STATE_MAX; i++) { | 1673 | for (i = 0; i < CPUIDLE_STATE_MAX; i++) { |
1673 | dev->states[i].name[0] = '\0'; | 1674 | dev->states[i].name[0] = '\0'; |
1674 | dev->states[i].desc[0] = '\0'; | 1675 | dev->states[i].desc[0] = '\0'; |
@@ -1738,7 +1739,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1738 | 1739 | ||
1739 | int acpi_processor_cst_has_changed(struct acpi_processor *pr) | 1740 | int acpi_processor_cst_has_changed(struct acpi_processor *pr) |
1740 | { | 1741 | { |
1741 | int ret; | 1742 | int ret = 0; |
1742 | 1743 | ||
1743 | if (boot_option_idle_override) | 1744 | if (boot_option_idle_override) |
1744 | return 0; | 1745 | return 0; |
@@ -1756,8 +1757,10 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) | |||
1756 | cpuidle_pause_and_lock(); | 1757 | cpuidle_pause_and_lock(); |
1757 | cpuidle_disable_device(&pr->power.dev); | 1758 | cpuidle_disable_device(&pr->power.dev); |
1758 | acpi_processor_get_power_info(pr); | 1759 | acpi_processor_get_power_info(pr); |
1759 | acpi_processor_setup_cpuidle(pr); | 1760 | if (pr->flags.power) { |
1760 | ret = cpuidle_enable_device(&pr->power.dev); | 1761 | acpi_processor_setup_cpuidle(pr); |
1762 | ret = cpuidle_enable_device(&pr->power.dev); | ||
1763 | } | ||
1761 | cpuidle_resume_and_unlock(); | 1764 | cpuidle_resume_and_unlock(); |
1762 | 1765 | ||
1763 | return ret; | 1766 | return ret; |
@@ -1813,7 +1816,6 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, | |||
1813 | if (pr->flags.power) { | 1816 | if (pr->flags.power) { |
1814 | #ifdef CONFIG_CPU_IDLE | 1817 | #ifdef CONFIG_CPU_IDLE |
1815 | acpi_processor_setup_cpuidle(pr); | 1818 | acpi_processor_setup_cpuidle(pr); |
1816 | pr->power.dev.cpu = pr->id; | ||
1817 | if (cpuidle_register_device(&pr->power.dev)) | 1819 | if (cpuidle_register_device(&pr->power.dev)) |
1818 | return -EIO; | 1820 | return -EIO; |
1819 | #endif | 1821 | #endif |
@@ -1850,8 +1852,7 @@ int acpi_processor_power_exit(struct acpi_processor *pr, | |||
1850 | return 0; | 1852 | return 0; |
1851 | 1853 | ||
1852 | #ifdef CONFIG_CPU_IDLE | 1854 | #ifdef CONFIG_CPU_IDLE |
1853 | if (pr->flags.power) | 1855 | cpuidle_unregister_device(&pr->power.dev); |
1854 | cpuidle_unregister_device(&pr->power.dev); | ||
1855 | #endif | 1856 | #endif |
1856 | pr->flags.power_setup_done = 0; | 1857 | pr->flags.power_setup_done = 0; |
1857 | 1858 | ||
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 8a5fe8710513..224c57c03381 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c | |||
@@ -495,6 +495,12 @@ static int __init acpi_sleep_proc_init(void) | |||
495 | acpi_root_dir, &acpi_system_alarm_fops); | 495 | acpi_root_dir, &acpi_system_alarm_fops); |
496 | 496 | ||
497 | acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); | 497 | acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); |
498 | /* | ||
499 | * Disable the RTC event after installing RTC handler. | ||
500 | * Only when RTC alarm is set will it be enabled. | ||
501 | */ | ||
502 | acpi_clear_event(ACPI_EVENT_RTC); | ||
503 | acpi_disable_event(ACPI_EVENT_RTC, 0); | ||
498 | #endif /* HAVE_ACPI_LEGACY_ALARM */ | 504 | #endif /* HAVE_ACPI_LEGACY_ALARM */ |
499 | 505 | ||
500 | /* 'wakeup device' [R/W] */ | 506 | /* 'wakeup device' [R/W] */ |
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index 769f24855eb6..5bd2dec9a7ac 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c | |||
@@ -77,7 +77,6 @@ static ssize_t acpi_table_show(struct kobject *kobj, | |||
77 | container_of(bin_attr, struct acpi_table_attr, attr); | 77 | container_of(bin_attr, struct acpi_table_attr, attr); |
78 | struct acpi_table_header *table_header = NULL; | 78 | struct acpi_table_header *table_header = NULL; |
79 | acpi_status status; | 79 | acpi_status status; |
80 | ssize_t ret_count = count; | ||
81 | 80 | ||
82 | status = | 81 | status = |
83 | acpi_get_table(table_attr->name, table_attr->instance, | 82 | acpi_get_table(table_attr->name, table_attr->instance, |
@@ -85,18 +84,8 @@ static ssize_t acpi_table_show(struct kobject *kobj, | |||
85 | if (ACPI_FAILURE(status)) | 84 | if (ACPI_FAILURE(status)) |
86 | return -ENODEV; | 85 | return -ENODEV; |
87 | 86 | ||
88 | if (offset >= table_header->length) { | 87 | return memory_read_from_buffer(buf, count, &offset, |
89 | ret_count = 0; | 88 | table_header, table_header->length); |
90 | goto end; | ||
91 | } | ||
92 | |||
93 | if (offset + ret_count > table_header->length) | ||
94 | ret_count = table_header->length - offset; | ||
95 | |||
96 | memcpy(buf, ((char *)table_header) + offset, ret_count); | ||
97 | |||
98 | end: | ||
99 | return ret_count; | ||
100 | } | 89 | } |
101 | 90 | ||
102 | static void acpi_table_attr_init(struct acpi_table_attr *table_attr, | 91 | static void acpi_table_attr_init(struct acpi_table_attr *table_attr, |
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c index 402f93e1ff20..5336ce88f89f 100644 --- a/drivers/acpi/tables/tbinstal.c +++ b/drivers/acpi/tables/tbinstal.c | |||
@@ -123,24 +123,13 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | /* The table must be either an SSDT or a PSDT or an OEMx */ | 126 | /* |
127 | 127 | * Originally, we checked the table signature for "SSDT" or "PSDT" here. | |
128 | if (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT)&& | 128 | * Next, we added support for OEMx tables, signature "OEM". |
129 | !ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)&& | 129 | * Valid tables were encountered with a null signature, so we've just |
130 | strncmp(table_desc->pointer->signature, "OEM", 3)) { | 130 | * given up on validating the signature, since it seems to be a waste |
131 | /* Check for a printable name */ | 131 | * of code. The original code was removed (05/2008). |
132 | if (acpi_ut_valid_acpi_name( | 132 | */ |
133 | *(u32 *) table_desc->pointer->signature)) { | ||
134 | ACPI_ERROR((AE_INFO, "Table has invalid signature " | ||
135 | "[%4.4s], must be SSDT or PSDT", | ||
136 | table_desc->pointer->signature)); | ||
137 | } else { | ||
138 | ACPI_ERROR((AE_INFO, "Table has invalid signature " | ||
139 | "(0x%8.8X), must be SSDT or PSDT", | ||
140 | *(u32 *) table_desc->pointer->signature)); | ||
141 | } | ||
142 | return_ACPI_STATUS(AE_BAD_SIGNATURE); | ||
143 | } | ||
144 | 133 | ||
145 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 134 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
146 | 135 | ||
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c index fb57b93c2495..0e319604d3e7 100644 --- a/drivers/acpi/tables/tbxface.c +++ b/drivers/acpi/tables/tbxface.c | |||
@@ -540,7 +540,7 @@ static acpi_status acpi_tb_load_namespace(void) | |||
540 | acpi_tb_print_table_header(0, table); | 540 | acpi_tb_print_table_header(0, table); |
541 | 541 | ||
542 | if (no_auto_ssdt == 0) { | 542 | if (no_auto_ssdt == 0) { |
543 | printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\""); | 543 | printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\"\n"); |
544 | } | 544 | } |
545 | } | 545 | } |
546 | 546 | ||
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 504385b1f211..84c795fb9b1e 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -364,10 +364,17 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) | |||
364 | if (flag & ACPI_TRIPS_CRITICAL) { | 364 | if (flag & ACPI_TRIPS_CRITICAL) { |
365 | status = acpi_evaluate_integer(tz->device->handle, | 365 | status = acpi_evaluate_integer(tz->device->handle, |
366 | "_CRT", NULL, &tz->trips.critical.temperature); | 366 | "_CRT", NULL, &tz->trips.critical.temperature); |
367 | if (ACPI_FAILURE(status)) { | 367 | /* |
368 | * Treat freezing temperatures as invalid as well; some | ||
369 | * BIOSes return really low values and cause reboots at startup. | ||
370 | * Below zero (Celcius) values clearly aren't right for sure.. | ||
371 | * ... so lets discard those as invalid. | ||
372 | */ | ||
373 | if (ACPI_FAILURE(status) || | ||
374 | tz->trips.critical.temperature <= 2732) { | ||
368 | tz->trips.critical.flags.valid = 0; | 375 | tz->trips.critical.flags.valid = 0; |
369 | ACPI_EXCEPTION((AE_INFO, status, | 376 | ACPI_EXCEPTION((AE_INFO, status, |
370 | "No critical threshold")); | 377 | "No or invalid critical threshold")); |
371 | return -ENODEV; | 378 | return -ENODEV; |
372 | } else { | 379 | } else { |
373 | tz->trips.critical.flags.valid = 1; | 380 | tz->trips.critical.flags.valid = 1; |
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index e4ba7192cd15..1f057b71db1a 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
@@ -1048,6 +1048,7 @@ acpi_ut_exception(char *module_name, | |||
1048 | va_start(args, format); | 1048 | va_start(args, format); |
1049 | acpi_os_vprintf(format, args); | 1049 | acpi_os_vprintf(format, args); |
1050 | acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); | 1050 | acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); |
1051 | va_end(args); | ||
1051 | } | 1052 | } |
1052 | 1053 | ||
1053 | EXPORT_SYMBOL(acpi_ut_exception); | 1054 | EXPORT_SYMBOL(acpi_ut_exception); |
@@ -1063,7 +1064,6 @@ acpi_ut_warning(char *module_name, u32 line_number, char *format, ...) | |||
1063 | acpi_os_vprintf(format, args); | 1064 | acpi_os_vprintf(format, args); |
1064 | acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); | 1065 | acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); |
1065 | va_end(args); | 1066 | va_end(args); |
1066 | va_end(args); | ||
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | void ACPI_INTERNAL_VAR_XFACE | 1069 | void ACPI_INTERNAL_VAR_XFACE |
diff --git a/drivers/atm/eni.h b/drivers/atm/eni.h index d04fefb0841f..e4c9525e60b3 100644 --- a/drivers/atm/eni.h +++ b/drivers/atm/eni.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #include "midway.h" | 18 | #include "midway.h" |
19 | 19 | ||
20 | 20 | ||
21 | #define KERNEL_OFFSET 0xC0000000 /* kernel 0x0 is at phys 0xC0000000 */ | ||
22 | #define DEV_LABEL "eni" | 21 | #define DEV_LABEL "eni" |
23 | 22 | ||
24 | #define UBR_BUFFER (128*1024) /* UBR buffer size */ | 23 | #define UBR_BUFFER (128*1024) /* UBR buffer size */ |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 422cfcad486d..ee0a51a3a41d 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -762,6 +762,7 @@ static void device_remove_class_symlinks(struct device *dev) | |||
762 | /** | 762 | /** |
763 | * dev_set_name - set a device name | 763 | * dev_set_name - set a device name |
764 | * @dev: device | 764 | * @dev: device |
765 | * @fmt: format string for the device's name | ||
765 | */ | 766 | */ |
766 | int dev_set_name(struct device *dev, const char *fmt, ...) | 767 | int dev_set_name(struct device *dev, const char *fmt, ...) |
767 | { | 768 | { |
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 595a925c62a9..d307bf26af58 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -118,8 +118,8 @@ config COMPUTONE | |||
118 | order to become a dial-in server. If you have a card like that, say | 118 | order to become a dial-in server. If you have a card like that, say |
119 | Y here and read <file:Documentation/computone.txt>. | 119 | Y here and read <file:Documentation/computone.txt>. |
120 | 120 | ||
121 | To compile this driver as modules, choose M here: the | 121 | To compile this driver as module, choose M here: the |
122 | modules will be called ip2 and ip2main. | 122 | module will be called ip2. |
123 | 123 | ||
124 | config ROCKETPORT | 124 | config ROCKETPORT |
125 | tristate "Comtrol RocketPort support" | 125 | tristate "Comtrol RocketPort support" |
diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c index fa9d3c945f31..ba6340ae98af 100644 --- a/drivers/char/pcmcia/ipwireless/hardware.c +++ b/drivers/char/pcmcia/ipwireless/hardware.c | |||
@@ -251,10 +251,11 @@ struct ipw_hardware { | |||
251 | int init_loops; | 251 | int init_loops; |
252 | struct timer_list setup_timer; | 252 | struct timer_list setup_timer; |
253 | 253 | ||
254 | /* Flag if hw is ready to send next packet */ | ||
254 | int tx_ready; | 255 | int tx_ready; |
255 | struct list_head tx_queue[NL_NUM_OF_PRIORITIES]; | 256 | /* Count of pending packets to be sent */ |
256 | /* True if any packets are queued for transmission */ | ||
257 | int tx_queued; | 257 | int tx_queued; |
258 | struct list_head tx_queue[NL_NUM_OF_PRIORITIES]; | ||
258 | 259 | ||
259 | int rx_bytes_queued; | 260 | int rx_bytes_queued; |
260 | struct list_head rx_queue; | 261 | struct list_head rx_queue; |
@@ -404,6 +405,8 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data, | |||
404 | 405 | ||
405 | spin_lock_irqsave(&hw->spinlock, flags); | 406 | spin_lock_irqsave(&hw->spinlock, flags); |
406 | 407 | ||
408 | hw->tx_ready = 0; | ||
409 | |||
407 | if (hw->hw_version == HW_VERSION_1) { | 410 | if (hw->hw_version == HW_VERSION_1) { |
408 | outw((unsigned short) length, hw->base_port + IODWR); | 411 | outw((unsigned short) length, hw->base_port + IODWR); |
409 | 412 | ||
@@ -492,6 +495,7 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet) | |||
492 | 495 | ||
493 | spin_lock_irqsave(&hw->spinlock, flags); | 496 | spin_lock_irqsave(&hw->spinlock, flags); |
494 | list_add(&packet->queue, &hw->tx_queue[0]); | 497 | list_add(&packet->queue, &hw->tx_queue[0]); |
498 | hw->tx_queued++; | ||
495 | spin_unlock_irqrestore(&hw->spinlock, flags); | 499 | spin_unlock_irqrestore(&hw->spinlock, flags); |
496 | } else { | 500 | } else { |
497 | if (packet->packet_callback) | 501 | if (packet->packet_callback) |
@@ -949,12 +953,10 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) | |||
949 | unsigned long flags; | 953 | unsigned long flags; |
950 | 954 | ||
951 | spin_lock_irqsave(&hw->spinlock, flags); | 955 | spin_lock_irqsave(&hw->spinlock, flags); |
952 | if (hw->tx_queued && hw->tx_ready != 0) { | 956 | if (hw->tx_queued && hw->tx_ready) { |
953 | int priority; | 957 | int priority; |
954 | struct ipw_tx_packet *packet = NULL; | 958 | struct ipw_tx_packet *packet = NULL; |
955 | 959 | ||
956 | hw->tx_ready--; | ||
957 | |||
958 | /* Pick a packet */ | 960 | /* Pick a packet */ |
959 | for (priority = 0; priority < priority_limit; priority++) { | 961 | for (priority = 0; priority < priority_limit; priority++) { |
960 | if (!list_empty(&hw->tx_queue[priority])) { | 962 | if (!list_empty(&hw->tx_queue[priority])) { |
@@ -963,6 +965,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) | |||
963 | struct ipw_tx_packet, | 965 | struct ipw_tx_packet, |
964 | queue); | 966 | queue); |
965 | 967 | ||
968 | hw->tx_queued--; | ||
966 | list_del(&packet->queue); | 969 | list_del(&packet->queue); |
967 | 970 | ||
968 | break; | 971 | break; |
@@ -973,6 +976,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit) | |||
973 | spin_unlock_irqrestore(&hw->spinlock, flags); | 976 | spin_unlock_irqrestore(&hw->spinlock, flags); |
974 | return 0; | 977 | return 0; |
975 | } | 978 | } |
979 | |||
976 | spin_unlock_irqrestore(&hw->spinlock, flags); | 980 | spin_unlock_irqrestore(&hw->spinlock, flags); |
977 | 981 | ||
978 | /* Send */ | 982 | /* Send */ |
@@ -1063,7 +1067,7 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq, | |||
1063 | if (irqn & IR_TXINTR) { | 1067 | if (irqn & IR_TXINTR) { |
1064 | ack |= IR_TXINTR; | 1068 | ack |= IR_TXINTR; |
1065 | spin_lock_irqsave(&hw->spinlock, flags); | 1069 | spin_lock_irqsave(&hw->spinlock, flags); |
1066 | hw->tx_ready++; | 1070 | hw->tx_ready = 1; |
1067 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1071 | spin_unlock_irqrestore(&hw->spinlock, flags); |
1068 | } | 1072 | } |
1069 | /* Received data */ | 1073 | /* Received data */ |
@@ -1170,7 +1174,7 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq, | |||
1170 | if (memrxdone & MEMRX_RX_DONE) { | 1174 | if (memrxdone & MEMRX_RX_DONE) { |
1171 | writew(0, &hw->memory_info_regs->memreg_rx_done); | 1175 | writew(0, &hw->memory_info_regs->memreg_rx_done); |
1172 | spin_lock_irqsave(&hw->spinlock, flags); | 1176 | spin_lock_irqsave(&hw->spinlock, flags); |
1173 | hw->tx_ready++; | 1177 | hw->tx_ready = 1; |
1174 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1178 | spin_unlock_irqrestore(&hw->spinlock, flags); |
1175 | tx = 1; | 1179 | tx = 1; |
1176 | } | 1180 | } |
@@ -1234,7 +1238,7 @@ static void send_packet(struct ipw_hardware *hw, int priority, | |||
1234 | 1238 | ||
1235 | spin_lock_irqsave(&hw->spinlock, flags); | 1239 | spin_lock_irqsave(&hw->spinlock, flags); |
1236 | list_add_tail(&packet->queue, &hw->tx_queue[priority]); | 1240 | list_add_tail(&packet->queue, &hw->tx_queue[priority]); |
1237 | hw->tx_queued = 1; | 1241 | hw->tx_queued++; |
1238 | spin_unlock_irqrestore(&hw->spinlock, flags); | 1242 | spin_unlock_irqrestore(&hw->spinlock, flags); |
1239 | 1243 | ||
1240 | flush_packets_to_hw(hw); | 1244 | flush_packets_to_hw(hw); |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index fa1ffbf2c621..935f1c207a1f 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -434,7 +434,7 @@ static void update_attr(struct vc_data *vc) | |||
434 | vc->vc_blink, vc->vc_underline, | 434 | vc->vc_blink, vc->vc_underline, |
435 | vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic); | 435 | vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic); |
436 | vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' '; | 436 | vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' '; |
437 | vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, false, false) << 8) | ' '; | 437 | vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, vc->vc_decscnm, false) << 8) | ' '; |
438 | } | 438 | } |
439 | 439 | ||
440 | /* Note: inverting the screen twice should revert to the original state */ | 440 | /* Note: inverting the screen twice should revert to the original state */ |
@@ -909,7 +909,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) | |||
909 | 909 | ||
910 | if (vc->vc_tty) { | 910 | if (vc->vc_tty) { |
911 | struct winsize ws, *cws = &vc->vc_tty->winsize; | 911 | struct winsize ws, *cws = &vc->vc_tty->winsize; |
912 | unsigned long flags; | 912 | struct pid *pgrp = NULL; |
913 | 913 | ||
914 | memset(&ws, 0, sizeof(ws)); | 914 | memset(&ws, 0, sizeof(ws)); |
915 | ws.ws_row = vc->vc_rows; | 915 | ws.ws_row = vc->vc_rows; |
@@ -917,11 +917,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) | |||
917 | ws.ws_ypixel = vc->vc_scan_lines; | 917 | ws.ws_ypixel = vc->vc_scan_lines; |
918 | 918 | ||
919 | mutex_lock(&vc->vc_tty->termios_mutex); | 919 | mutex_lock(&vc->vc_tty->termios_mutex); |
920 | spin_lock_irqsave(&vc->vc_tty->ctrl_lock, flags); | 920 | spin_lock_irq(&vc->vc_tty->ctrl_lock); |
921 | if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) && | 921 | if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col)) |
922 | vc->vc_tty->pgrp) | 922 | pgrp = get_pid(vc->vc_tty->pgrp); |
923 | spin_unlock_irq(&vc->vc_tty->ctrl_lock); | ||
924 | if (pgrp) { | ||
923 | kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1); | 925 | kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1); |
924 | spin_unlock_irqrestore(&vc->vc_tty->ctrl_lock, flags); | 926 | put_pid(pgrp); |
927 | } | ||
925 | *cws = ws; | 928 | *cws = ws; |
926 | mutex_unlock(&vc->vc_tty->termios_mutex); | 929 | mutex_unlock(&vc->vc_tty->termios_mutex); |
927 | } | 930 | } |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 86f0a2430624..1d41496ed2f8 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -412,7 +412,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy, | |||
412 | int ret; | 412 | int ret; |
413 | 413 | ||
414 | mutex_unlock(&cpufreq_governor_mutex); | 414 | mutex_unlock(&cpufreq_governor_mutex); |
415 | ret = request_module(name); | 415 | ret = request_module("%s", name); |
416 | mutex_lock(&cpufreq_governor_mutex); | 416 | mutex_lock(&cpufreq_governor_mutex); |
417 | 417 | ||
418 | if (ret == 0) | 418 | if (ret == 0) |
@@ -625,7 +625,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy, | |||
625 | unsigned int freq = 0; | 625 | unsigned int freq = 0; |
626 | unsigned int ret; | 626 | unsigned int ret; |
627 | 627 | ||
628 | if (!policy->governor->store_setspeed) | 628 | if (!policy->governor || !policy->governor->store_setspeed) |
629 | return -EINVAL; | 629 | return -EINVAL; |
630 | 630 | ||
631 | ret = sscanf(buf, "%u", &freq); | 631 | ret = sscanf(buf, "%u", &freq); |
@@ -639,7 +639,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy, | |||
639 | 639 | ||
640 | static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf) | 640 | static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf) |
641 | { | 641 | { |
642 | if (!policy->governor->show_setspeed) | 642 | if (!policy->governor || !policy->governor->show_setspeed) |
643 | return sprintf(buf, "<unsupported>\n"); | 643 | return sprintf(buf, "<unsupported>\n"); |
644 | 644 | ||
645 | return policy->governor->show_setspeed(policy, buf); | 645 | return policy->governor->show_setspeed(policy, buf); |
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index fc555a90bb21..23554b676d6e 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -38,6 +38,8 @@ static void cpuidle_kick_cpus(void) | |||
38 | static void cpuidle_kick_cpus(void) {} | 38 | static void cpuidle_kick_cpus(void) {} |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | static int __cpuidle_register_device(struct cpuidle_device *dev); | ||
42 | |||
41 | /** | 43 | /** |
42 | * cpuidle_idle_call - the main idle loop | 44 | * cpuidle_idle_call - the main idle loop |
43 | * | 45 | * |
@@ -138,6 +140,12 @@ int cpuidle_enable_device(struct cpuidle_device *dev) | |||
138 | if (!dev->state_count) | 140 | if (!dev->state_count) |
139 | return -EINVAL; | 141 | return -EINVAL; |
140 | 142 | ||
143 | if (dev->registered == 0) { | ||
144 | ret = __cpuidle_register_device(dev); | ||
145 | if (ret) | ||
146 | return ret; | ||
147 | } | ||
148 | |||
141 | if ((ret = cpuidle_add_state_sysfs(dev))) | 149 | if ((ret = cpuidle_add_state_sysfs(dev))) |
142 | return ret; | 150 | return ret; |
143 | 151 | ||
@@ -232,10 +240,13 @@ static void poll_idle_init(struct cpuidle_device *dev) {} | |||
232 | #endif /* CONFIG_ARCH_HAS_CPU_RELAX */ | 240 | #endif /* CONFIG_ARCH_HAS_CPU_RELAX */ |
233 | 241 | ||
234 | /** | 242 | /** |
235 | * cpuidle_register_device - registers a CPU's idle PM feature | 243 | * __cpuidle_register_device - internal register function called before register |
244 | * and enable routines | ||
236 | * @dev: the cpu | 245 | * @dev: the cpu |
246 | * | ||
247 | * cpuidle_lock mutex must be held before this is called | ||
237 | */ | 248 | */ |
238 | int cpuidle_register_device(struct cpuidle_device *dev) | 249 | static int __cpuidle_register_device(struct cpuidle_device *dev) |
239 | { | 250 | { |
240 | int ret; | 251 | int ret; |
241 | struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); | 252 | struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); |
@@ -247,18 +258,34 @@ int cpuidle_register_device(struct cpuidle_device *dev) | |||
247 | 258 | ||
248 | init_completion(&dev->kobj_unregister); | 259 | init_completion(&dev->kobj_unregister); |
249 | 260 | ||
250 | mutex_lock(&cpuidle_lock); | ||
251 | |||
252 | poll_idle_init(dev); | 261 | poll_idle_init(dev); |
253 | 262 | ||
254 | per_cpu(cpuidle_devices, dev->cpu) = dev; | 263 | per_cpu(cpuidle_devices, dev->cpu) = dev; |
255 | list_add(&dev->device_list, &cpuidle_detected_devices); | 264 | list_add(&dev->device_list, &cpuidle_detected_devices); |
256 | if ((ret = cpuidle_add_sysfs(sys_dev))) { | 265 | if ((ret = cpuidle_add_sysfs(sys_dev))) { |
257 | mutex_unlock(&cpuidle_lock); | ||
258 | module_put(cpuidle_curr_driver->owner); | 266 | module_put(cpuidle_curr_driver->owner); |
259 | return ret; | 267 | return ret; |
260 | } | 268 | } |
261 | 269 | ||
270 | dev->registered = 1; | ||
271 | return 0; | ||
272 | } | ||
273 | |||
274 | /** | ||
275 | * cpuidle_register_device - registers a CPU's idle PM feature | ||
276 | * @dev: the cpu | ||
277 | */ | ||
278 | int cpuidle_register_device(struct cpuidle_device *dev) | ||
279 | { | ||
280 | int ret; | ||
281 | |||
282 | mutex_lock(&cpuidle_lock); | ||
283 | |||
284 | if ((ret = __cpuidle_register_device(dev))) { | ||
285 | mutex_unlock(&cpuidle_lock); | ||
286 | return ret; | ||
287 | } | ||
288 | |||
262 | cpuidle_enable_device(dev); | 289 | cpuidle_enable_device(dev); |
263 | cpuidle_install_idle_handler(); | 290 | cpuidle_install_idle_handler(); |
264 | 291 | ||
@@ -278,6 +305,9 @@ void cpuidle_unregister_device(struct cpuidle_device *dev) | |||
278 | { | 305 | { |
279 | struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); | 306 | struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); |
280 | 307 | ||
308 | if (dev->registered == 0) | ||
309 | return; | ||
310 | |||
281 | cpuidle_pause_and_lock(); | 311 | cpuidle_pause_and_lock(); |
282 | 312 | ||
283 | cpuidle_disable_device(dev); | 313 | cpuidle_disable_device(dev); |
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index 744011989044..9e4f59dc7f1e 100644 --- a/drivers/firmware/edd.c +++ b/drivers/firmware/edd.c | |||
@@ -753,7 +753,7 @@ edd_init(void) | |||
753 | 753 | ||
754 | if (!edd_num_devices()) { | 754 | if (!edd_num_devices()) { |
755 | printk(KERN_INFO "EDD information not available.\n"); | 755 | printk(KERN_INFO "EDD information not available.\n"); |
756 | return 1; | 756 | return -ENODEV; |
757 | } | 757 | } |
758 | 758 | ||
759 | edd_kset = kset_create_and_add("edd", NULL, firmware_kobj); | 759 | edd_kset = kset_create_and_add("edd", NULL, firmware_kobj); |
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index 88e89653daaf..26df06f840eb 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c | |||
@@ -522,6 +522,7 @@ static struct dmi_system_id __initdata hdaps_whitelist[] = { | |||
522 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"), | 522 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"), |
523 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"), | 523 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"), |
524 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60"), | 524 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60"), |
525 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61"), | ||
525 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"), | 526 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"), |
526 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X41"), | 527 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X41"), |
527 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60"), | 528 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60"), |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index b4f3aefa12b6..1607536ff5fb 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -1028,6 +1028,7 @@ endif | |||
1028 | 1028 | ||
1029 | config BLK_DEV_HD_ONLY | 1029 | config BLK_DEV_HD_ONLY |
1030 | bool "Old hard disk (MFM/RLL/IDE) driver" | 1030 | bool "Old hard disk (MFM/RLL/IDE) driver" |
1031 | depends on !ARM || ARCH_RPC || ARCH_SHARK || BROKEN | ||
1031 | help | 1032 | help |
1032 | There are two drivers for MFM/RLL/IDE hard disks. Most people use | 1033 | There are two drivers for MFM/RLL/IDE hard disks. Most people use |
1033 | the newer enhanced driver, but this old one is still around for two | 1034 | the newer enhanced driver, but this old one is still around for two |
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c index 713cef20622e..8e8c28104b45 100644 --- a/drivers/ide/arm/bast-ide.c +++ b/drivers/ide/arm/bast-ide.c | |||
@@ -42,6 +42,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq) | |||
42 | 42 | ||
43 | hw.io_ports.ctl_addr = aux + (6 * 0x20); | 43 | hw.io_ports.ctl_addr = aux + (6 * 0x20); |
44 | hw.irq = irq; | 44 | hw.irq = irq; |
45 | hw.chipset = ide_generic; | ||
45 | 46 | ||
46 | hwif = ide_find_port(); | 47 | hwif = ide_find_port(); |
47 | if (hwif == NULL) | 48 | if (hwif == NULL) |
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c index 4263ffd4ab20..2f311da4c963 100644 --- a/drivers/ide/arm/ide_arm.c +++ b/drivers/ide/arm/ide_arm.c | |||
@@ -49,6 +49,7 @@ static int __init ide_arm_init(void) | |||
49 | memset(&hw, 0, sizeof(hw)); | 49 | memset(&hw, 0, sizeof(hw)); |
50 | ide_std_init_ports(&hw, base, ctl); | 50 | ide_std_init_ports(&hw, base, ctl); |
51 | hw.irq = IDE_ARM_IRQ; | 51 | hw.irq = IDE_ARM_IRQ; |
52 | hw.chipset = ide_generic; | ||
52 | 53 | ||
53 | hwif = ide_find_port(); | 54 | hwif = ide_find_port(); |
54 | if (hwif) { | 55 | if (hwif) { |
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c index 96378ebfb31f..d024ac8fad14 100644 --- a/drivers/ide/arm/palm_bk3710.c +++ b/drivers/ide/arm/palm_bk3710.c | |||
@@ -409,9 +409,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
409 | 409 | ||
410 | ide_device_add(idx, &palm_bk3710_port_info); | 410 | ide_device_add(idx, &palm_bk3710_port_info); |
411 | 411 | ||
412 | if (!hwif->present) | ||
413 | goto out; | ||
414 | |||
415 | return 0; | 412 | return 0; |
416 | out: | 413 | out: |
417 | printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n"); | 414 | printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n"); |
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index a6073e248f45..9134488ac043 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c | |||
@@ -125,6 +125,7 @@ static int __init ide_generic_init(void) | |||
125 | memset(&hw, 0, sizeof(hw)); | 125 | memset(&hw, 0, sizeof(hw)); |
126 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); | 126 | ide_std_init_ports(&hw, io_addr, io_addr + 0x206); |
127 | hw.irq = ide_default_irq(io_addr); | 127 | hw.irq = ide_default_irq(io_addr); |
128 | hw.chipset = ide_generic; | ||
128 | ide_init_port_hw(hwif, &hw); | 129 | ide_init_port_hw(hwif, &hw); |
129 | 130 | ||
130 | idx[i] = i; | 131 | idx[i] = i; |
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index 6a8953f68e9f..adbd01784162 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c | |||
@@ -55,6 +55,7 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
55 | memset(&hw, 0, sizeof(hw)); | 55 | memset(&hw, 0, sizeof(hw)); |
56 | ide_std_init_ports(&hw, base, ctl); | 56 | ide_std_init_ports(&hw, base, ctl); |
57 | hw.irq = pnp_irq(dev, 0); | 57 | hw.irq = pnp_irq(dev, 0); |
58 | hw.chipset = ide_generic; | ||
58 | 59 | ||
59 | hwif = ide_find_port(); | 60 | hwif = ide_find_port(); |
60 | if (hwif) { | 61 | if (hwif) { |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 655ec7ef568a..380fa0c8cc84 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1333,8 +1333,7 @@ static void ide_port_init_devices(ide_hwif_t *hwif) | |||
1333 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, | 1333 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, |
1334 | const struct ide_port_info *d) | 1334 | const struct ide_port_info *d) |
1335 | { | 1335 | { |
1336 | if (d->chipset != ide_etrax100) | 1336 | hwif->channel = port; |
1337 | hwif->channel = port; | ||
1338 | 1337 | ||
1339 | if (d->chipset) | 1338 | if (d->chipset) |
1340 | hwif->chipset = d->chipset; | 1339 | hwif->chipset = d->chipset; |
@@ -1519,7 +1518,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) | |||
1519 | continue; | 1518 | continue; |
1520 | } | 1519 | } |
1521 | 1520 | ||
1522 | if (d->chipset != ide_etrax100 && (i & 1) && mate) { | 1521 | if ((i & 1) && mate) { |
1523 | hwif->mate = mate; | 1522 | hwif->mate = mate; |
1524 | mate->mate = hwif; | 1523 | mate->mate = hwif; |
1525 | } | 1524 | } |
@@ -1665,6 +1664,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no, | |||
1665 | 1664 | ||
1666 | ide_std_init_ports(hw, base, ctl); | 1665 | ide_std_init_ports(hw, base, ctl); |
1667 | hw->irq = irq; | 1666 | hw->irq = irq; |
1667 | hw->chipset = d->chipset; | ||
1668 | 1668 | ||
1669 | hwif = ide_find_port_slot(d); | 1669 | hwif = ide_find_port_slot(d); |
1670 | if (hwif) { | 1670 | if (hwif) { |
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 8d6ad812a014..55ec7f798772 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
@@ -63,7 +63,6 @@ static int proc_ide_read_imodel | |||
63 | case ide_pmac: name = "mac-io"; break; | 63 | case ide_pmac: name = "mac-io"; break; |
64 | case ide_au1xxx: name = "au1xxx"; break; | 64 | case ide_au1xxx: name = "au1xxx"; break; |
65 | case ide_palm3710: name = "palm3710"; break; | 65 | case ide_palm3710: name = "palm3710"; break; |
66 | case ide_etrax100: name = "etrax100"; break; | ||
67 | case ide_acorn: name = "acorn"; break; | 66 | case ide_acorn: name = "acorn"; break; |
68 | default: name = "(unknown)"; break; | 67 | default: name = "(unknown)"; break; |
69 | } | 68 | } |
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c index 5c730e4dd735..9a1d27ef3f8a 100644 --- a/drivers/ide/legacy/buddha.c +++ b/drivers/ide/legacy/buddha.c | |||
@@ -138,6 +138,8 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base, | |||
138 | 138 | ||
139 | hw->irq = IRQ_AMIGA_PORTS; | 139 | hw->irq = IRQ_AMIGA_PORTS; |
140 | hw->ack_intr = ack_intr; | 140 | hw->ack_intr = ack_intr; |
141 | |||
142 | hw->chipset = ide_generic; | ||
141 | } | 143 | } |
142 | 144 | ||
143 | /* | 145 | /* |
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index 9e449a0c623f..af11028b4794 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c | |||
@@ -81,6 +81,8 @@ static void __init falconide_setup_ports(hw_regs_t *hw) | |||
81 | 81 | ||
82 | hw->irq = IRQ_MFP_IDE; | 82 | hw->irq = IRQ_MFP_IDE; |
83 | hw->ack_intr = NULL; | 83 | hw->ack_intr = NULL; |
84 | |||
85 | hw->chipset = ide_generic; | ||
84 | } | 86 | } |
85 | 87 | ||
86 | /* | 88 | /* |
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index a9c2593a898c..fed7d812761c 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/ide.h> | 16 | #include <linux/ide.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/zorro.h> | 18 | #include <linux/zorro.h> |
19 | #include <linux/module.h> | ||
19 | 20 | ||
20 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
21 | #include <asm/amigahw.h> | 22 | #include <asm/amigahw.h> |
@@ -62,7 +63,10 @@ | |||
62 | GAYLE_NUM_HWIFS-1) | 63 | GAYLE_NUM_HWIFS-1) |
63 | #define GAYLE_HAS_CONTROL_REG (!ide_doubler) | 64 | #define GAYLE_HAS_CONTROL_REG (!ide_doubler) |
64 | #define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000) | 65 | #define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000) |
66 | |||
65 | int ide_doubler = 0; /* support IDE doublers? */ | 67 | int ide_doubler = 0; /* support IDE doublers? */ |
68 | EXPORT_SYMBOL_GPL(ide_doubler); | ||
69 | |||
66 | module_param_named(doubler, ide_doubler, bool, 0); | 70 | module_param_named(doubler, ide_doubler, bool, 0); |
67 | MODULE_PARM_DESC(doubler, "enable support for IDE doublers"); | 71 | MODULE_PARM_DESC(doubler, "enable support for IDE doublers"); |
68 | #endif /* CONFIG_BLK_DEV_IDEDOUBLER */ | 72 | #endif /* CONFIG_BLK_DEV_IDEDOUBLER */ |
@@ -112,6 +116,8 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base, | |||
112 | 116 | ||
113 | hw->irq = IRQ_AMIGA_PORTS; | 117 | hw->irq = IRQ_AMIGA_PORTS; |
114 | hw->ack_intr = ack_intr; | 118 | hw->ack_intr = ack_intr; |
119 | |||
120 | hw->chipset = ide_generic; | ||
115 | } | 121 | } |
116 | 122 | ||
117 | /* | 123 | /* |
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index caa2632dd08e..2e84290d0bcc 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c | |||
@@ -78,6 +78,8 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base, | |||
78 | 78 | ||
79 | hw->irq = irq; | 79 | hw->irq = irq; |
80 | hw->ack_intr = ack_intr; | 80 | hw->ack_intr = ack_intr; |
81 | |||
82 | hw->chipset = ide_generic; | ||
81 | } | 83 | } |
82 | 84 | ||
83 | static const char *mac_ide_name[] = | 85 | static const char *mac_ide_name[] = |
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c index 6f535d00e638..8ff6e2d20834 100644 --- a/drivers/ide/legacy/q40ide.c +++ b/drivers/ide/legacy/q40ide.c | |||
@@ -70,6 +70,8 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base, | |||
70 | 70 | ||
71 | hw->irq = irq; | 71 | hw->irq = irq; |
72 | hw->ack_intr = ack_intr; | 72 | hw->ack_intr = ack_intr; |
73 | |||
74 | hw->chipset = ide_generic; | ||
73 | } | 75 | } |
74 | 76 | ||
75 | static void q40ide_input_data(ide_drive_t *drive, struct request *rq, | 77 | static void q40ide_input_data(ide_drive_t *drive, struct request *rq, |
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index aaf38109eaec..b38a1980dcd5 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
@@ -747,9 +747,11 @@ static int __init cmd640x_init(void) | |||
747 | 747 | ||
748 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); | 748 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); |
749 | hw[0].irq = 14; | 749 | hw[0].irq = 14; |
750 | hw[0].chipset = ide_cmd640; | ||
750 | 751 | ||
751 | ide_std_init_ports(&hw[1], 0x170, 0x376); | 752 | ide_std_init_ports(&hw[1], 0x170, 0x376); |
752 | hw[1].irq = 15; | 753 | hw[1].irq = 15; |
754 | hw[1].chipset = ide_cmd640; | ||
753 | 755 | ||
754 | printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x" | 756 | printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x" |
755 | "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr); | 757 | "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr); |
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c index b9e457996d0e..af0f30051d5a 100644 --- a/drivers/ide/pci/delkin_cb.c +++ b/drivers/ide/pci/delkin_cb.c | |||
@@ -47,13 +47,18 @@ static const struct ide_port_ops delkin_cb_port_ops = { | |||
47 | .quirkproc = ide_undecoded_slave, | 47 | .quirkproc = ide_undecoded_slave, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static const struct ide_port_info delkin_cb_port_info = { | ||
51 | .port_ops = &delkin_cb_port_ops, | ||
52 | .host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS | | ||
53 | IDE_HFLAG_NO_DMA, | ||
54 | }; | ||
55 | |||
50 | static int __devinit | 56 | static int __devinit |
51 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | 57 | delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) |
52 | { | 58 | { |
53 | unsigned long base; | 59 | unsigned long base; |
54 | hw_regs_t hw; | 60 | hw_regs_t hw; |
55 | ide_hwif_t *hwif = NULL; | 61 | ide_hwif_t *hwif = NULL; |
56 | ide_drive_t *drive; | ||
57 | int i, rc; | 62 | int i, rc; |
58 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 63 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
59 | 64 | ||
@@ -79,6 +84,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
79 | memset(&hw, 0, sizeof(hw)); | 84 | memset(&hw, 0, sizeof(hw)); |
80 | ide_std_init_ports(&hw, base + 0x10, base + 0x1e); | 85 | ide_std_init_ports(&hw, base + 0x10, base + 0x1e); |
81 | hw.irq = dev->irq; | 86 | hw.irq = dev->irq; |
87 | hw.dev = &dev->dev; | ||
82 | hw.chipset = ide_pci; /* this enables IRQ sharing */ | 88 | hw.chipset = ide_pci; /* this enables IRQ sharing */ |
83 | 89 | ||
84 | hwif = ide_find_port(); | 90 | hwif = ide_find_port(); |
@@ -89,26 +95,16 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
89 | 95 | ||
90 | ide_init_port_data(hwif, i); | 96 | ide_init_port_data(hwif, i); |
91 | ide_init_port_hw(hwif, &hw); | 97 | ide_init_port_hw(hwif, &hw); |
92 | hwif->port_ops = &delkin_cb_port_ops; | ||
93 | 98 | ||
94 | idx[0] = i; | 99 | idx[0] = i; |
95 | 100 | ||
96 | ide_device_add(idx, NULL); | 101 | ide_device_add(idx, &delkin_cb_port_info); |
97 | |||
98 | if (!hwif->present) | ||
99 | goto out_disable; | ||
100 | 102 | ||
101 | pci_set_drvdata(dev, hwif); | 103 | pci_set_drvdata(dev, hwif); |
102 | hwif->dev = &dev->dev; | 104 | |
103 | drive = &hwif->drives[0]; | ||
104 | if (drive->present) { | ||
105 | drive->io_32bit = 1; | ||
106 | drive->unmask = 1; | ||
107 | } | ||
108 | return 0; | 105 | return 0; |
109 | 106 | ||
110 | out_disable: | 107 | out_disable: |
111 | printk(KERN_ERR "delkin_cb: no IDE devices found\n"); | ||
112 | pci_release_regions(dev); | 108 | pci_release_regions(dev); |
113 | pci_disable_device(dev); | 109 | pci_disable_device(dev); |
114 | return -ENODEV; | 110 | return -ENODEV; |
@@ -139,14 +135,12 @@ static struct pci_driver driver = { | |||
139 | .remove = delkin_cb_remove, | 135 | .remove = delkin_cb_remove, |
140 | }; | 136 | }; |
141 | 137 | ||
142 | static int | 138 | static int __init delkin_cb_init(void) |
143 | delkin_cb_init (void) | ||
144 | { | 139 | { |
145 | return pci_register_driver(&driver); | 140 | return pci_register_driver(&driver); |
146 | } | 141 | } |
147 | 142 | ||
148 | static void | 143 | static void __exit delkin_cb_exit(void) |
149 | delkin_cb_exit (void) | ||
150 | { | 144 | { |
151 | pci_unregister_driver(&driver); | 145 | pci_unregister_driver(&driver); |
152 | } | 146 | } |
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 4b0b85d8faf5..e127eb25ab63 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
@@ -569,6 +569,11 @@ static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_devi | |||
569 | { | 569 | { |
570 | struct ide_port_info d = sis5513_chipset; | 570 | struct ide_port_info d = sis5513_chipset; |
571 | u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; | 571 | u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; |
572 | int rc; | ||
573 | |||
574 | rc = pci_enable_device(dev); | ||
575 | if (rc) | ||
576 | return rc; | ||
572 | 577 | ||
573 | if (sis_find_family(dev) == 0) | 578 | if (sis_find_family(dev) == 0) |
574 | return -ENOTSUPP; | 579 | return -ENOTSUPP; |
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c index f0e638dcc3ab..236f9c38e519 100644 --- a/drivers/ide/ppc/mpc8xx.c +++ b/drivers/ide/ppc/mpc8xx.c | |||
@@ -303,6 +303,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | |||
303 | pcmp->pcmc_per = 0x100000 >> (16 * _slot_); | 303 | pcmp->pcmc_per = 0x100000 >> (16 * _slot_); |
304 | #endif /* CONFIG_IDE_8xx_PCCARD */ | 304 | #endif /* CONFIG_IDE_8xx_PCCARD */ |
305 | 305 | ||
306 | hw->chipset = ide_generic; | ||
307 | |||
306 | return 0; | 308 | return 0; |
307 | } | 309 | } |
308 | #endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ | 310 | #endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ |
@@ -377,6 +379,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | |||
377 | ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |= | 379 | ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |= |
378 | (0x80000000 >> ioport_dsc[data_port].irq); | 380 | (0x80000000 >> ioport_dsc[data_port].irq); |
379 | 381 | ||
382 | hw->chipset = ide_generic; | ||
383 | |||
380 | return 0; | 384 | return 0; |
381 | } | 385 | } |
382 | #endif /* CONFIG_IDE_8xx_DIRECT */ | 386 | #endif /* CONFIG_IDE_8xx_DIRECT */ |
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index fe78f7d25099..a1768dbb0720 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c | |||
@@ -150,7 +150,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, | |||
150 | ret = 0; | 150 | ret = 0; |
151 | while (npages) { | 151 | while (npages) { |
152 | ret = get_user_pages(current, current->mm, cur_base, | 152 | ret = get_user_pages(current, current->mm, cur_base, |
153 | min_t(int, npages, | 153 | min_t(unsigned long, npages, |
154 | PAGE_SIZE / sizeof (struct page *)), | 154 | PAGE_SIZE / sizeof (struct page *)), |
155 | 1, !umem->writable, page_list, vma_list); | 155 | 1, !umem->writable, page_list, vma_list); |
156 | 156 | ||
diff --git a/drivers/infiniband/hw/amso1100/c2_rnic.c b/drivers/infiniband/hw/amso1100/c2_rnic.c index 9a054c6941a4..b1441aeb60c2 100644 --- a/drivers/infiniband/hw/amso1100/c2_rnic.c +++ b/drivers/infiniband/hw/amso1100/c2_rnic.c | |||
@@ -455,8 +455,7 @@ int __devinit c2_rnic_init(struct c2_dev *c2dev) | |||
455 | IB_DEVICE_CURR_QP_STATE_MOD | | 455 | IB_DEVICE_CURR_QP_STATE_MOD | |
456 | IB_DEVICE_SYS_IMAGE_GUID | | 456 | IB_DEVICE_SYS_IMAGE_GUID | |
457 | IB_DEVICE_ZERO_STAG | | 457 | IB_DEVICE_ZERO_STAG | |
458 | IB_DEVICE_MEM_WINDOW | | 458 | IB_DEVICE_MEM_WINDOW); |
459 | IB_DEVICE_SEND_W_INV); | ||
460 | 459 | ||
461 | /* Allocate the qptr_array */ | 460 | /* Allocate the qptr_array */ |
462 | c2dev->qptr_array = vmalloc(C2_MAX_CQS * sizeof(void *)); | 461 | c2dev->qptr_array = vmalloc(C2_MAX_CQS * sizeof(void *)); |
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c index bbe0436f4f75..f093b0033daf 100644 --- a/drivers/infiniband/hw/ehca/ehca_reqs.c +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c | |||
@@ -421,8 +421,10 @@ int ehca_post_send(struct ib_qp *qp, | |||
421 | int ret = 0; | 421 | int ret = 0; |
422 | unsigned long flags; | 422 | unsigned long flags; |
423 | 423 | ||
424 | if (unlikely(my_qp->state != IB_QPS_RTS)) { | 424 | /* Reject WR if QP is in RESET, INIT or RTR state */ |
425 | ehca_err(qp->device, "QP not in RTS state qpn=%x", qp->qp_num); | 425 | if (unlikely(my_qp->state < IB_QPS_RTS)) { |
426 | ehca_err(qp->device, "Invalid QP state qp_state=%d qpn=%x", | ||
427 | my_qp->state, qp->qp_num); | ||
426 | return -EINVAL; | 428 | return -EINVAL; |
427 | } | 429 | } |
428 | 430 | ||
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index 59a8b254b97f..0bd8bcb184a1 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -232,6 +232,11 @@ struct ipath_sdma_desc { | |||
232 | #define IPATH_SDMA_TXREQ_S_ABORTED 2 | 232 | #define IPATH_SDMA_TXREQ_S_ABORTED 2 |
233 | #define IPATH_SDMA_TXREQ_S_SHUTDOWN 3 | 233 | #define IPATH_SDMA_TXREQ_S_SHUTDOWN 3 |
234 | 234 | ||
235 | #define IPATH_SDMA_STATUS_SCORE_BOARD_DRAIN_IN_PROG (1ull << 63) | ||
236 | #define IPATH_SDMA_STATUS_ABORT_IN_PROG (1ull << 62) | ||
237 | #define IPATH_SDMA_STATUS_INTERNAL_SDMA_ENABLE (1ull << 61) | ||
238 | #define IPATH_SDMA_STATUS_SCB_EMPTY (1ull << 30) | ||
239 | |||
235 | /* max dwords in small buffer packet */ | 240 | /* max dwords in small buffer packet */ |
236 | #define IPATH_SMALLBUF_DWORDS (dd->ipath_piosize2k >> 2) | 241 | #define IPATH_SMALLBUF_DWORDS (dd->ipath_piosize2k >> 2) |
237 | 242 | ||
diff --git a/drivers/infiniband/hw/ipath/ipath_mad.c b/drivers/infiniband/hw/ipath/ipath_mad.c index 1ff46ae7dd99..5f9315d77a43 100644 --- a/drivers/infiniband/hw/ipath/ipath_mad.c +++ b/drivers/infiniband/hw/ipath/ipath_mad.c | |||
@@ -1492,6 +1492,10 @@ static int process_subn(struct ib_device *ibdev, int mad_flags, | |||
1492 | goto bail; | 1492 | goto bail; |
1493 | } | 1493 | } |
1494 | 1494 | ||
1495 | case IB_MGMT_METHOD_TRAP: | ||
1496 | case IB_MGMT_METHOD_REPORT: | ||
1497 | case IB_MGMT_METHOD_REPORT_RESP: | ||
1498 | case IB_MGMT_METHOD_TRAP_REPRESS: | ||
1495 | case IB_MGMT_METHOD_GET_RESP: | 1499 | case IB_MGMT_METHOD_GET_RESP: |
1496 | /* | 1500 | /* |
1497 | * The ib_mad module will call us to process responses | 1501 | * The ib_mad module will call us to process responses |
diff --git a/drivers/infiniband/hw/ipath/ipath_sdma.c b/drivers/infiniband/hw/ipath/ipath_sdma.c index 0a8c1b8091a2..eaba03273e4f 100644 --- a/drivers/infiniband/hw/ipath/ipath_sdma.c +++ b/drivers/infiniband/hw/ipath/ipath_sdma.c | |||
@@ -263,14 +263,10 @@ static void sdma_abort_task(unsigned long opaque) | |||
263 | hwstatus = ipath_read_kreg64(dd, | 263 | hwstatus = ipath_read_kreg64(dd, |
264 | dd->ipath_kregs->kr_senddmastatus); | 264 | dd->ipath_kregs->kr_senddmastatus); |
265 | 265 | ||
266 | if (/* ScoreBoardDrainInProg */ | 266 | if ((hwstatus & (IPATH_SDMA_STATUS_SCORE_BOARD_DRAIN_IN_PROG | |
267 | test_bit(63, &hwstatus) || | 267 | IPATH_SDMA_STATUS_ABORT_IN_PROG | |
268 | /* AbortInProg */ | 268 | IPATH_SDMA_STATUS_INTERNAL_SDMA_ENABLE)) || |
269 | test_bit(62, &hwstatus) || | 269 | !(hwstatus & IPATH_SDMA_STATUS_SCB_EMPTY)) { |
270 | /* InternalSDmaEnable */ | ||
271 | test_bit(61, &hwstatus) || | ||
272 | /* ScbEmpty */ | ||
273 | !test_bit(30, &hwstatus)) { | ||
274 | if (dd->ipath_sdma_reset_wait > 0) { | 270 | if (dd->ipath_sdma_reset_wait > 0) { |
275 | /* not done shutting down sdma */ | 271 | /* not done shutting down sdma */ |
276 | --dd->ipath_sdma_reset_wait; | 272 | --dd->ipath_sdma_reset_wait; |
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index e0ec540042bf..7779165b2c2c 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c | |||
@@ -1494,7 +1494,8 @@ static int ipath_query_device(struct ib_device *ibdev, | |||
1494 | 1494 | ||
1495 | props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR | | 1495 | props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR | |
1496 | IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT | | 1496 | IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT | |
1497 | IB_DEVICE_SYS_IMAGE_GUID; | 1497 | IB_DEVICE_SYS_IMAGE_GUID | IB_DEVICE_RC_RNR_NAK_GEN | |
1498 | IB_DEVICE_PORT_ACTIVE_EVENT | IB_DEVICE_SRQ_RESIZE; | ||
1498 | props->page_size_cap = PAGE_SIZE; | 1499 | props->page_size_cap = PAGE_SIZE; |
1499 | props->vendor_id = dev->dd->ipath_vendorid; | 1500 | props->vendor_id = dev->dd->ipath_vendorid; |
1500 | props->vendor_part_id = dev->dd->ipath_deviceid; | 1501 | props->vendor_part_id = dev->dd->ipath_deviceid; |
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c index 5fcbdccd7a53..16a874bb1561 100644 --- a/drivers/isdn/hardware/eicon/divasmain.c +++ b/drivers/isdn/hardware/eicon/divasmain.c | |||
@@ -806,7 +806,6 @@ static int DIVA_INIT_FUNCTION divas_init(void) | |||
806 | 806 | ||
807 | if (!create_divas_proc()) { | 807 | if (!create_divas_proc()) { |
808 | #ifdef MODULE | 808 | #ifdef MODULE |
809 | remove_divas_proc(); | ||
810 | divas_unregister_chrdev(); | 809 | divas_unregister_chrdev(); |
811 | divasfunc_exit(); | 810 | divasfunc_exit(); |
812 | #endif | 811 | #endif |
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c index fae895828a17..040827288ec9 100644 --- a/drivers/isdn/hardware/eicon/divasproc.c +++ b/drivers/isdn/hardware/eicon/divasproc.c | |||
@@ -125,8 +125,8 @@ static const struct file_operations divas_fops = { | |||
125 | 125 | ||
126 | int create_divas_proc(void) | 126 | int create_divas_proc(void) |
127 | { | 127 | { |
128 | proc_create(divas_proc_name, S_IFREG | S_IRUGO, proc_net_eicon, | 128 | divas_proc_entry = proc_create(divas_proc_name, S_IFREG | S_IRUGO, |
129 | &divas_fops); | 129 | proc_net_eicon, &divas_fops); |
130 | if (!divas_proc_entry) | 130 | if (!divas_proc_entry) |
131 | return (0); | 131 | return (0); |
132 | 132 | ||
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index 15906d005b05..484299b031f8 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c | |||
@@ -207,30 +207,17 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t | |||
207 | /* read conf file -> output card info data */ | 207 | /* read conf file -> output card info data */ |
208 | /*******************************************/ | 208 | /*******************************************/ |
209 | static ssize_t | 209 | static ssize_t |
210 | hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off) | 210 | hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t *off) |
211 | { | 211 | { |
212 | char *cp; | 212 | char *cp; |
213 | int i; | ||
214 | 213 | ||
215 | if (file->f_mode & FMODE_READ) { | 214 | if (!(file->f_mode & FMODE_READ)) |
216 | if (!(cp = file->private_data)) | 215 | return -EPERM; /* no permission to read */ |
217 | return (-EFAULT); /* should never happen */ | 216 | |
218 | i = strlen(cp); /* get total string length */ | 217 | if (!(cp = file->private_data)) |
219 | if (*off < i) { | 218 | return -EFAULT; /* should never happen */ |
220 | /* still bytes to transfer */ | 219 | |
221 | cp += *off; /* point to desired data offset */ | 220 | return simple_read_from_buffer(buf, count, off, cp, strlen(cp)); |
222 | i -= *off; /* remaining length */ | ||
223 | if (i > count) | ||
224 | i = count; /* limit length to transfer */ | ||
225 | if (copy_to_user(buf, cp, i)) | ||
226 | return (-EFAULT); /* copy error */ | ||
227 | *off += i; /* adjust offset */ | ||
228 | } else | ||
229 | return (0); | ||
230 | } else | ||
231 | return (-EPERM); /* no permission to read */ | ||
232 | |||
233 | return (i); | ||
234 | } /* hysdn_conf_read */ | 221 | } /* hysdn_conf_read */ |
235 | 222 | ||
236 | /******************/ | 223 | /******************/ |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 51c19f86ff99..7cf512a34ccf 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -276,6 +276,7 @@ static mddev_t * mddev_find(dev_t unit) | |||
276 | atomic_set(&new->active, 1); | 276 | atomic_set(&new->active, 1); |
277 | spin_lock_init(&new->write_lock); | 277 | spin_lock_init(&new->write_lock); |
278 | init_waitqueue_head(&new->sb_wait); | 278 | init_waitqueue_head(&new->sb_wait); |
279 | init_waitqueue_head(&new->recovery_wait); | ||
279 | new->reshape_position = MaxSector; | 280 | new->reshape_position = MaxSector; |
280 | new->resync_max = MaxSector; | 281 | new->resync_max = MaxSector; |
281 | new->level = LEVEL_NONE; | 282 | new->level = LEVEL_NONE; |
@@ -5665,7 +5666,6 @@ void md_do_sync(mddev_t *mddev) | |||
5665 | window/2,(unsigned long long) max_sectors/2); | 5666 | window/2,(unsigned long long) max_sectors/2); |
5666 | 5667 | ||
5667 | atomic_set(&mddev->recovery_active, 0); | 5668 | atomic_set(&mddev->recovery_active, 0); |
5668 | init_waitqueue_head(&mddev->recovery_wait); | ||
5669 | last_check = 0; | 5669 | last_check = 0; |
5670 | 5670 | ||
5671 | if (j>2) { | 5671 | if (j>2) { |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 425958a76b84..c37e256b1176 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -2002,6 +2002,7 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh, | |||
2002 | * have quiesced. | 2002 | * have quiesced. |
2003 | */ | 2003 | */ |
2004 | if ((s->uptodate == disks - 1) && | 2004 | if ((s->uptodate == disks - 1) && |
2005 | (s->failed && disk_idx == s->failed_num) && | ||
2005 | !test_bit(STRIPE_OP_CHECK, &sh->ops.pending)) { | 2006 | !test_bit(STRIPE_OP_CHECK, &sh->ops.pending)) { |
2006 | set_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending); | 2007 | set_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending); |
2007 | set_bit(R5_Wantcompute, &dev->flags); | 2008 | set_bit(R5_Wantcompute, &dev->flags); |
@@ -2087,7 +2088,9 @@ static void handle_issuing_new_read_requests6(struct stripe_head *sh, | |||
2087 | /* we would like to get this block, possibly | 2088 | /* we would like to get this block, possibly |
2088 | * by computing it, but we might not be able to | 2089 | * by computing it, but we might not be able to |
2089 | */ | 2090 | */ |
2090 | if (s->uptodate == disks-1) { | 2091 | if ((s->uptodate == disks - 1) && |
2092 | (s->failed && (i == r6s->failed_num[0] || | ||
2093 | i == r6s->failed_num[1]))) { | ||
2091 | pr_debug("Computing stripe %llu block %d\n", | 2094 | pr_debug("Computing stripe %llu block %d\n", |
2092 | (unsigned long long)sh->sector, i); | 2095 | (unsigned long long)sh->sector, i); |
2093 | compute_block_1(sh, i, 0); | 2096 | compute_block_1(sh, i, 0); |
@@ -2645,6 +2648,7 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2645 | struct r5dev *dev; | 2648 | struct r5dev *dev; |
2646 | unsigned long pending = 0; | 2649 | unsigned long pending = 0; |
2647 | mdk_rdev_t *blocked_rdev = NULL; | 2650 | mdk_rdev_t *blocked_rdev = NULL; |
2651 | int prexor; | ||
2648 | 2652 | ||
2649 | memset(&s, 0, sizeof(s)); | 2653 | memset(&s, 0, sizeof(s)); |
2650 | pr_debug("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d " | 2654 | pr_debug("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d " |
@@ -2774,9 +2778,11 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2774 | /* leave prexor set until postxor is done, allows us to distinguish | 2778 | /* leave prexor set until postxor is done, allows us to distinguish |
2775 | * a rmw from a rcw during biodrain | 2779 | * a rmw from a rcw during biodrain |
2776 | */ | 2780 | */ |
2781 | prexor = 0; | ||
2777 | if (test_bit(STRIPE_OP_PREXOR, &sh->ops.complete) && | 2782 | if (test_bit(STRIPE_OP_PREXOR, &sh->ops.complete) && |
2778 | test_bit(STRIPE_OP_POSTXOR, &sh->ops.complete)) { | 2783 | test_bit(STRIPE_OP_POSTXOR, &sh->ops.complete)) { |
2779 | 2784 | ||
2785 | prexor = 1; | ||
2780 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.complete); | 2786 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.complete); |
2781 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.ack); | 2787 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.ack); |
2782 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.pending); | 2788 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.pending); |
@@ -2810,6 +2816,8 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2810 | if (!test_and_set_bit( | 2816 | if (!test_and_set_bit( |
2811 | STRIPE_OP_IO, &sh->ops.pending)) | 2817 | STRIPE_OP_IO, &sh->ops.pending)) |
2812 | sh->ops.count++; | 2818 | sh->ops.count++; |
2819 | if (prexor) | ||
2820 | continue; | ||
2813 | if (!test_bit(R5_Insync, &dev->flags) || | 2821 | if (!test_bit(R5_Insync, &dev->flags) || |
2814 | (i == sh->pd_idx && s.failed == 0)) | 2822 | (i == sh->pd_idx && s.failed == 0)) |
2815 | set_bit(STRIPE_INSYNC, &sh->state); | 2823 | set_bit(STRIPE_INSYNC, &sh->state); |
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c index e2e7c05a147b..6d14e8fe1537 100644 --- a/drivers/misc/fujitsu-laptop.c +++ b/drivers/misc/fujitsu-laptop.c | |||
@@ -352,3 +352,9 @@ MODULE_AUTHOR("Jonathan Woithe"); | |||
352 | MODULE_DESCRIPTION("Fujitsu laptop extras support"); | 352 | MODULE_DESCRIPTION("Fujitsu laptop extras support"); |
353 | MODULE_VERSION(FUJITSU_DRIVER_VERSION); | 353 | MODULE_VERSION(FUJITSU_DRIVER_VERSION); |
354 | MODULE_LICENSE("GPL"); | 354 | MODULE_LICENSE("GPL"); |
355 | |||
356 | static struct pnp_device_id pnp_ids[] = { | ||
357 | { .id = "FUJ02bf" }, | ||
358 | { .id = "" } | ||
359 | }; | ||
360 | MODULE_DEVICE_TABLE(pnp, pnp_ids); | ||
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index a0ce0b2fa03e..b5969298f3d3 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -1293,7 +1293,7 @@ static void tpacpi_input_send_radiosw(void) | |||
1293 | mutex_lock(&tpacpi_inputdev_send_mutex); | 1293 | mutex_lock(&tpacpi_inputdev_send_mutex); |
1294 | 1294 | ||
1295 | input_report_switch(tpacpi_inputdev, | 1295 | input_report_switch(tpacpi_inputdev, |
1296 | SW_RADIO, !!wlsw); | 1296 | SW_RFKILL_ALL, !!wlsw); |
1297 | input_sync(tpacpi_inputdev); | 1297 | input_sync(tpacpi_inputdev); |
1298 | 1298 | ||
1299 | mutex_unlock(&tpacpi_inputdev_send_mutex); | 1299 | mutex_unlock(&tpacpi_inputdev_send_mutex); |
@@ -1921,6 +1921,29 @@ static struct attribute *hotkey_mask_attributes[] __initdata = { | |||
1921 | &dev_attr_hotkey_wakeup_hotunplug_complete.attr, | 1921 | &dev_attr_hotkey_wakeup_hotunplug_complete.attr, |
1922 | }; | 1922 | }; |
1923 | 1923 | ||
1924 | static void hotkey_exit(void) | ||
1925 | { | ||
1926 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL | ||
1927 | hotkey_poll_stop_sync(); | ||
1928 | #endif | ||
1929 | |||
1930 | if (hotkey_dev_attributes) | ||
1931 | delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj); | ||
1932 | |||
1933 | kfree(hotkey_keycode_map); | ||
1934 | |||
1935 | if (tp_features.hotkey) { | ||
1936 | dbg_printk(TPACPI_DBG_EXIT, | ||
1937 | "restoring original hot key mask\n"); | ||
1938 | /* no short-circuit boolean operator below! */ | ||
1939 | if ((hotkey_mask_set(hotkey_orig_mask) | | ||
1940 | hotkey_status_set(hotkey_orig_status)) != 0) | ||
1941 | printk(TPACPI_ERR | ||
1942 | "failed to restore hot key mask " | ||
1943 | "to BIOS defaults\n"); | ||
1944 | } | ||
1945 | } | ||
1946 | |||
1924 | static int __init hotkey_init(struct ibm_init_struct *iibm) | 1947 | static int __init hotkey_init(struct ibm_init_struct *iibm) |
1925 | { | 1948 | { |
1926 | /* Requirements for changing the default keymaps: | 1949 | /* Requirements for changing the default keymaps: |
@@ -2060,226 +2083,220 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
2060 | vdbg_printk(TPACPI_DBG_INIT, "hotkeys are %s\n", | 2083 | vdbg_printk(TPACPI_DBG_INIT, "hotkeys are %s\n", |
2061 | str_supported(tp_features.hotkey)); | 2084 | str_supported(tp_features.hotkey)); |
2062 | 2085 | ||
2063 | if (tp_features.hotkey) { | 2086 | if (!tp_features.hotkey) |
2064 | hotkey_dev_attributes = create_attr_set(13, NULL); | 2087 | return 1; |
2065 | if (!hotkey_dev_attributes) | ||
2066 | return -ENOMEM; | ||
2067 | res = add_many_to_attr_set(hotkey_dev_attributes, | ||
2068 | hotkey_attributes, | ||
2069 | ARRAY_SIZE(hotkey_attributes)); | ||
2070 | if (res) | ||
2071 | return res; | ||
2072 | 2088 | ||
2073 | /* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p, | 2089 | hotkey_dev_attributes = create_attr_set(13, NULL); |
2074 | A30, R30, R31, T20-22, X20-21, X22-24. Detected by checking | 2090 | if (!hotkey_dev_attributes) |
2075 | for HKEY interface version 0x100 */ | 2091 | return -ENOMEM; |
2076 | if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) { | 2092 | res = add_many_to_attr_set(hotkey_dev_attributes, |
2077 | if ((hkeyv >> 8) != 1) { | 2093 | hotkey_attributes, |
2078 | printk(TPACPI_ERR "unknown version of the " | 2094 | ARRAY_SIZE(hotkey_attributes)); |
2079 | "HKEY interface: 0x%x\n", hkeyv); | 2095 | if (res) |
2080 | printk(TPACPI_ERR "please report this to %s\n", | 2096 | goto err_exit; |
2081 | TPACPI_MAIL); | 2097 | |
2082 | } else { | 2098 | /* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p, |
2083 | /* | 2099 | A30, R30, R31, T20-22, X20-21, X22-24. Detected by checking |
2084 | * MHKV 0x100 in A31, R40, R40e, | 2100 | for HKEY interface version 0x100 */ |
2085 | * T4x, X31, and later | 2101 | if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) { |
2086 | */ | 2102 | if ((hkeyv >> 8) != 1) { |
2087 | tp_features.hotkey_mask = 1; | 2103 | printk(TPACPI_ERR "unknown version of the " |
2088 | } | 2104 | "HKEY interface: 0x%x\n", hkeyv); |
2105 | printk(TPACPI_ERR "please report this to %s\n", | ||
2106 | TPACPI_MAIL); | ||
2107 | } else { | ||
2108 | /* | ||
2109 | * MHKV 0x100 in A31, R40, R40e, | ||
2110 | * T4x, X31, and later | ||
2111 | */ | ||
2112 | tp_features.hotkey_mask = 1; | ||
2089 | } | 2113 | } |
2114 | } | ||
2090 | 2115 | ||
2091 | vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n", | 2116 | vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n", |
2092 | str_supported(tp_features.hotkey_mask)); | 2117 | str_supported(tp_features.hotkey_mask)); |
2093 | 2118 | ||
2094 | if (tp_features.hotkey_mask) { | 2119 | if (tp_features.hotkey_mask) { |
2095 | if (!acpi_evalf(hkey_handle, &hotkey_all_mask, | 2120 | if (!acpi_evalf(hkey_handle, &hotkey_all_mask, |
2096 | "MHKA", "qd")) { | 2121 | "MHKA", "qd")) { |
2097 | printk(TPACPI_ERR | 2122 | printk(TPACPI_ERR |
2098 | "missing MHKA handler, " | 2123 | "missing MHKA handler, " |
2099 | "please report this to %s\n", | 2124 | "please report this to %s\n", |
2100 | TPACPI_MAIL); | 2125 | TPACPI_MAIL); |
2101 | /* FN+F12, FN+F4, FN+F3 */ | 2126 | /* FN+F12, FN+F4, FN+F3 */ |
2102 | hotkey_all_mask = 0x080cU; | 2127 | hotkey_all_mask = 0x080cU; |
2103 | } | ||
2104 | } | 2128 | } |
2129 | } | ||
2105 | 2130 | ||
2106 | /* hotkey_source_mask *must* be zero for | 2131 | /* hotkey_source_mask *must* be zero for |
2107 | * the first hotkey_mask_get */ | 2132 | * the first hotkey_mask_get */ |
2108 | res = hotkey_status_get(&hotkey_orig_status); | 2133 | res = hotkey_status_get(&hotkey_orig_status); |
2109 | if (!res && tp_features.hotkey_mask) { | 2134 | if (res) |
2110 | res = hotkey_mask_get(); | 2135 | goto err_exit; |
2111 | hotkey_orig_mask = hotkey_mask; | 2136 | |
2112 | if (!res) { | 2137 | if (tp_features.hotkey_mask) { |
2113 | res = add_many_to_attr_set( | 2138 | res = hotkey_mask_get(); |
2114 | hotkey_dev_attributes, | 2139 | if (res) |
2115 | hotkey_mask_attributes, | 2140 | goto err_exit; |
2116 | ARRAY_SIZE(hotkey_mask_attributes)); | 2141 | |
2117 | } | 2142 | hotkey_orig_mask = hotkey_mask; |
2118 | } | 2143 | res = add_many_to_attr_set( |
2144 | hotkey_dev_attributes, | ||
2145 | hotkey_mask_attributes, | ||
2146 | ARRAY_SIZE(hotkey_mask_attributes)); | ||
2147 | if (res) | ||
2148 | goto err_exit; | ||
2149 | } | ||
2119 | 2150 | ||
2120 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL | 2151 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL |
2121 | if (tp_features.hotkey_mask) { | 2152 | if (tp_features.hotkey_mask) { |
2122 | hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK | 2153 | hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK |
2123 | & ~hotkey_all_mask; | 2154 | & ~hotkey_all_mask; |
2124 | } else { | 2155 | } else { |
2125 | hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK; | 2156 | hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK; |
2126 | } | 2157 | } |
2127 | 2158 | ||
2128 | vdbg_printk(TPACPI_DBG_INIT, | 2159 | vdbg_printk(TPACPI_DBG_INIT, |
2129 | "hotkey source mask 0x%08x, polling freq %d\n", | 2160 | "hotkey source mask 0x%08x, polling freq %d\n", |
2130 | hotkey_source_mask, hotkey_poll_freq); | 2161 | hotkey_source_mask, hotkey_poll_freq); |
2131 | #endif | 2162 | #endif |
2132 | 2163 | ||
2133 | /* Not all thinkpads have a hardware radio switch */ | 2164 | /* Not all thinkpads have a hardware radio switch */ |
2134 | if (!res && acpi_evalf(hkey_handle, &status, "WLSW", "qd")) { | 2165 | if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) { |
2135 | tp_features.hotkey_wlsw = 1; | 2166 | tp_features.hotkey_wlsw = 1; |
2136 | printk(TPACPI_INFO | 2167 | printk(TPACPI_INFO |
2137 | "radio switch found; radios are %s\n", | 2168 | "radio switch found; radios are %s\n", |
2138 | enabled(status, 0)); | 2169 | enabled(status, 0)); |
2139 | res = add_to_attr_set(hotkey_dev_attributes, | 2170 | res = add_to_attr_set(hotkey_dev_attributes, |
2140 | &dev_attr_hotkey_radio_sw.attr); | 2171 | &dev_attr_hotkey_radio_sw.attr); |
2141 | } | 2172 | } |
2142 | 2173 | ||
2143 | /* For X41t, X60t, X61t Tablets... */ | 2174 | /* For X41t, X60t, X61t Tablets... */ |
2144 | if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) { | 2175 | if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) { |
2145 | tp_features.hotkey_tablet = 1; | 2176 | tp_features.hotkey_tablet = 1; |
2146 | printk(TPACPI_INFO | 2177 | printk(TPACPI_INFO |
2147 | "possible tablet mode switch found; " | 2178 | "possible tablet mode switch found; " |
2148 | "ThinkPad in %s mode\n", | 2179 | "ThinkPad in %s mode\n", |
2149 | (status & TP_HOTKEY_TABLET_MASK)? | 2180 | (status & TP_HOTKEY_TABLET_MASK)? |
2150 | "tablet" : "laptop"); | 2181 | "tablet" : "laptop"); |
2151 | res = add_to_attr_set(hotkey_dev_attributes, | 2182 | res = add_to_attr_set(hotkey_dev_attributes, |
2152 | &dev_attr_hotkey_tablet_mode.attr); | 2183 | &dev_attr_hotkey_tablet_mode.attr); |
2153 | } | 2184 | } |
2154 | 2185 | ||
2155 | if (!res) | 2186 | if (!res) |
2156 | res = register_attr_set_with_sysfs( | 2187 | res = register_attr_set_with_sysfs( |
2157 | hotkey_dev_attributes, | 2188 | hotkey_dev_attributes, |
2158 | &tpacpi_pdev->dev.kobj); | 2189 | &tpacpi_pdev->dev.kobj); |
2159 | if (res) | 2190 | if (res) |
2160 | return res; | 2191 | goto err_exit; |
2161 | 2192 | ||
2162 | /* Set up key map */ | 2193 | /* Set up key map */ |
2163 | 2194 | ||
2164 | hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE, | 2195 | hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE, |
2165 | GFP_KERNEL); | 2196 | GFP_KERNEL); |
2166 | if (!hotkey_keycode_map) { | 2197 | if (!hotkey_keycode_map) { |
2167 | printk(TPACPI_ERR | 2198 | printk(TPACPI_ERR |
2168 | "failed to allocate memory for key map\n"); | 2199 | "failed to allocate memory for key map\n"); |
2169 | return -ENOMEM; | 2200 | res = -ENOMEM; |
2170 | } | 2201 | goto err_exit; |
2202 | } | ||
2171 | 2203 | ||
2172 | if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) { | 2204 | if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) { |
2173 | dbg_printk(TPACPI_DBG_INIT, | 2205 | dbg_printk(TPACPI_DBG_INIT, |
2174 | "using Lenovo default hot key map\n"); | 2206 | "using Lenovo default hot key map\n"); |
2175 | memcpy(hotkey_keycode_map, &lenovo_keycode_map, | 2207 | memcpy(hotkey_keycode_map, &lenovo_keycode_map, |
2176 | TPACPI_HOTKEY_MAP_SIZE); | 2208 | TPACPI_HOTKEY_MAP_SIZE); |
2209 | } else { | ||
2210 | dbg_printk(TPACPI_DBG_INIT, | ||
2211 | "using IBM default hot key map\n"); | ||
2212 | memcpy(hotkey_keycode_map, &ibm_keycode_map, | ||
2213 | TPACPI_HOTKEY_MAP_SIZE); | ||
2214 | } | ||
2215 | |||
2216 | set_bit(EV_KEY, tpacpi_inputdev->evbit); | ||
2217 | set_bit(EV_MSC, tpacpi_inputdev->evbit); | ||
2218 | set_bit(MSC_SCAN, tpacpi_inputdev->mscbit); | ||
2219 | tpacpi_inputdev->keycodesize = TPACPI_HOTKEY_MAP_TYPESIZE; | ||
2220 | tpacpi_inputdev->keycodemax = TPACPI_HOTKEY_MAP_LEN; | ||
2221 | tpacpi_inputdev->keycode = hotkey_keycode_map; | ||
2222 | for (i = 0; i < TPACPI_HOTKEY_MAP_LEN; i++) { | ||
2223 | if (hotkey_keycode_map[i] != KEY_RESERVED) { | ||
2224 | set_bit(hotkey_keycode_map[i], | ||
2225 | tpacpi_inputdev->keybit); | ||
2177 | } else { | 2226 | } else { |
2178 | dbg_printk(TPACPI_DBG_INIT, | 2227 | if (i < sizeof(hotkey_reserved_mask)*8) |
2179 | "using IBM default hot key map\n"); | 2228 | hotkey_reserved_mask |= 1 << i; |
2180 | memcpy(hotkey_keycode_map, &ibm_keycode_map, | ||
2181 | TPACPI_HOTKEY_MAP_SIZE); | ||
2182 | } | ||
2183 | |||
2184 | set_bit(EV_KEY, tpacpi_inputdev->evbit); | ||
2185 | set_bit(EV_MSC, tpacpi_inputdev->evbit); | ||
2186 | set_bit(MSC_SCAN, tpacpi_inputdev->mscbit); | ||
2187 | tpacpi_inputdev->keycodesize = TPACPI_HOTKEY_MAP_TYPESIZE; | ||
2188 | tpacpi_inputdev->keycodemax = TPACPI_HOTKEY_MAP_LEN; | ||
2189 | tpacpi_inputdev->keycode = hotkey_keycode_map; | ||
2190 | for (i = 0; i < TPACPI_HOTKEY_MAP_LEN; i++) { | ||
2191 | if (hotkey_keycode_map[i] != KEY_RESERVED) { | ||
2192 | set_bit(hotkey_keycode_map[i], | ||
2193 | tpacpi_inputdev->keybit); | ||
2194 | } else { | ||
2195 | if (i < sizeof(hotkey_reserved_mask)*8) | ||
2196 | hotkey_reserved_mask |= 1 << i; | ||
2197 | } | ||
2198 | } | ||
2199 | |||
2200 | if (tp_features.hotkey_wlsw) { | ||
2201 | set_bit(EV_SW, tpacpi_inputdev->evbit); | ||
2202 | set_bit(SW_RADIO, tpacpi_inputdev->swbit); | ||
2203 | } | ||
2204 | if (tp_features.hotkey_tablet) { | ||
2205 | set_bit(EV_SW, tpacpi_inputdev->evbit); | ||
2206 | set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit); | ||
2207 | } | 2229 | } |
2230 | } | ||
2208 | 2231 | ||
2209 | /* Do not issue duplicate brightness change events to | 2232 | if (tp_features.hotkey_wlsw) { |
2210 | * userspace */ | 2233 | set_bit(EV_SW, tpacpi_inputdev->evbit); |
2211 | if (!tp_features.bright_acpimode) | 2234 | set_bit(SW_RFKILL_ALL, tpacpi_inputdev->swbit); |
2212 | /* update bright_acpimode... */ | 2235 | } |
2213 | tpacpi_check_std_acpi_brightness_support(); | 2236 | if (tp_features.hotkey_tablet) { |
2214 | 2237 | set_bit(EV_SW, tpacpi_inputdev->evbit); | |
2215 | if (tp_features.bright_acpimode) { | 2238 | set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit); |
2216 | printk(TPACPI_INFO | 2239 | } |
2217 | "This ThinkPad has standard ACPI backlight " | ||
2218 | "brightness control, supported by the ACPI " | ||
2219 | "video driver\n"); | ||
2220 | printk(TPACPI_NOTICE | ||
2221 | "Disabling thinkpad-acpi brightness events " | ||
2222 | "by default...\n"); | ||
2223 | |||
2224 | /* The hotkey_reserved_mask change below is not | ||
2225 | * necessary while the keys are at KEY_RESERVED in the | ||
2226 | * default map, but better safe than sorry, leave it | ||
2227 | * here as a marker of what we have to do, especially | ||
2228 | * when we finally become able to set this at runtime | ||
2229 | * on response to X.org requests */ | ||
2230 | hotkey_reserved_mask |= | ||
2231 | (1 << TP_ACPI_HOTKEYSCAN_FNHOME) | ||
2232 | | (1 << TP_ACPI_HOTKEYSCAN_FNEND); | ||
2233 | } | ||
2234 | 2240 | ||
2235 | dbg_printk(TPACPI_DBG_INIT, | 2241 | /* Do not issue duplicate brightness change events to |
2236 | "enabling hot key handling\n"); | 2242 | * userspace */ |
2237 | res = hotkey_status_set(1); | 2243 | if (!tp_features.bright_acpimode) |
2238 | if (res) | 2244 | /* update bright_acpimode... */ |
2239 | return res; | 2245 | tpacpi_check_std_acpi_brightness_support(); |
2240 | res = hotkey_mask_set(((hotkey_all_mask | hotkey_source_mask) | ||
2241 | & ~hotkey_reserved_mask) | ||
2242 | | hotkey_orig_mask); | ||
2243 | if (res < 0 && res != -ENXIO) | ||
2244 | return res; | ||
2245 | 2246 | ||
2246 | dbg_printk(TPACPI_DBG_INIT, | 2247 | if (tp_features.bright_acpimode) { |
2247 | "legacy hot key reporting over procfs %s\n", | 2248 | printk(TPACPI_INFO |
2248 | (hotkey_report_mode < 2) ? | 2249 | "This ThinkPad has standard ACPI backlight " |
2249 | "enabled" : "disabled"); | 2250 | "brightness control, supported by the ACPI " |
2251 | "video driver\n"); | ||
2252 | printk(TPACPI_NOTICE | ||
2253 | "Disabling thinkpad-acpi brightness events " | ||
2254 | "by default...\n"); | ||
2255 | |||
2256 | /* The hotkey_reserved_mask change below is not | ||
2257 | * necessary while the keys are at KEY_RESERVED in the | ||
2258 | * default map, but better safe than sorry, leave it | ||
2259 | * here as a marker of what we have to do, especially | ||
2260 | * when we finally become able to set this at runtime | ||
2261 | * on response to X.org requests */ | ||
2262 | hotkey_reserved_mask |= | ||
2263 | (1 << TP_ACPI_HOTKEYSCAN_FNHOME) | ||
2264 | | (1 << TP_ACPI_HOTKEYSCAN_FNEND); | ||
2265 | } | ||
2266 | |||
2267 | dbg_printk(TPACPI_DBG_INIT, "enabling hot key handling\n"); | ||
2268 | res = hotkey_status_set(1); | ||
2269 | if (res) { | ||
2270 | hotkey_exit(); | ||
2271 | return res; | ||
2272 | } | ||
2273 | res = hotkey_mask_set(((hotkey_all_mask | hotkey_source_mask) | ||
2274 | & ~hotkey_reserved_mask) | ||
2275 | | hotkey_orig_mask); | ||
2276 | if (res < 0 && res != -ENXIO) { | ||
2277 | hotkey_exit(); | ||
2278 | return res; | ||
2279 | } | ||
2250 | 2280 | ||
2251 | tpacpi_inputdev->open = &hotkey_inputdev_open; | 2281 | dbg_printk(TPACPI_DBG_INIT, |
2252 | tpacpi_inputdev->close = &hotkey_inputdev_close; | 2282 | "legacy hot key reporting over procfs %s\n", |
2283 | (hotkey_report_mode < 2) ? | ||
2284 | "enabled" : "disabled"); | ||
2253 | 2285 | ||
2254 | hotkey_poll_setup_safe(1); | 2286 | tpacpi_inputdev->open = &hotkey_inputdev_open; |
2255 | tpacpi_input_send_radiosw(); | 2287 | tpacpi_inputdev->close = &hotkey_inputdev_close; |
2256 | tpacpi_input_send_tabletsw(); | ||
2257 | } | ||
2258 | 2288 | ||
2259 | return (tp_features.hotkey)? 0 : 1; | 2289 | hotkey_poll_setup_safe(1); |
2260 | } | 2290 | tpacpi_input_send_radiosw(); |
2291 | tpacpi_input_send_tabletsw(); | ||
2261 | 2292 | ||
2262 | static void hotkey_exit(void) | 2293 | return 0; |
2263 | { | ||
2264 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL | ||
2265 | hotkey_poll_stop_sync(); | ||
2266 | #endif | ||
2267 | 2294 | ||
2268 | if (tp_features.hotkey) { | 2295 | err_exit: |
2269 | dbg_printk(TPACPI_DBG_EXIT, | 2296 | delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj); |
2270 | "restoring original hot key mask\n"); | 2297 | hotkey_dev_attributes = NULL; |
2271 | /* no short-circuit boolean operator below! */ | ||
2272 | if ((hotkey_mask_set(hotkey_orig_mask) | | ||
2273 | hotkey_status_set(hotkey_orig_status)) != 0) | ||
2274 | printk(TPACPI_ERR | ||
2275 | "failed to restore hot key mask " | ||
2276 | "to BIOS defaults\n"); | ||
2277 | } | ||
2278 | 2298 | ||
2279 | if (hotkey_dev_attributes) { | 2299 | return (res < 0)? res : 1; |
2280 | delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj); | ||
2281 | hotkey_dev_attributes = NULL; | ||
2282 | } | ||
2283 | } | 2300 | } |
2284 | 2301 | ||
2285 | static void hotkey_notify(struct ibm_struct *ibm, u32 event) | 2302 | static void hotkey_notify(struct ibm_struct *ibm, u32 event) |
@@ -3319,7 +3336,7 @@ static struct tpacpi_led_classdev tpacpi_led_thinklight = { | |||
3319 | 3336 | ||
3320 | static int __init light_init(struct ibm_init_struct *iibm) | 3337 | static int __init light_init(struct ibm_init_struct *iibm) |
3321 | { | 3338 | { |
3322 | int rc = 0; | 3339 | int rc; |
3323 | 3340 | ||
3324 | vdbg_printk(TPACPI_DBG_INIT, "initializing light subdriver\n"); | 3341 | vdbg_printk(TPACPI_DBG_INIT, "initializing light subdriver\n"); |
3325 | 3342 | ||
@@ -3337,20 +3354,23 @@ static int __init light_init(struct ibm_init_struct *iibm) | |||
3337 | tp_features.light_status = | 3354 | tp_features.light_status = |
3338 | acpi_evalf(ec_handle, NULL, "KBLT", "qv"); | 3355 | acpi_evalf(ec_handle, NULL, "KBLT", "qv"); |
3339 | 3356 | ||
3340 | vdbg_printk(TPACPI_DBG_INIT, "light is %s\n", | 3357 | vdbg_printk(TPACPI_DBG_INIT, "light is %s, light status is %s\n", |
3341 | str_supported(tp_features.light)); | 3358 | str_supported(tp_features.light), |
3359 | str_supported(tp_features.light_status)); | ||
3342 | 3360 | ||
3343 | if (tp_features.light) { | 3361 | if (!tp_features.light) |
3344 | rc = led_classdev_register(&tpacpi_pdev->dev, | 3362 | return 1; |
3345 | &tpacpi_led_thinklight.led_classdev); | 3363 | |
3346 | } | 3364 | rc = led_classdev_register(&tpacpi_pdev->dev, |
3365 | &tpacpi_led_thinklight.led_classdev); | ||
3347 | 3366 | ||
3348 | if (rc < 0) { | 3367 | if (rc < 0) { |
3349 | tp_features.light = 0; | 3368 | tp_features.light = 0; |
3350 | tp_features.light_status = 0; | 3369 | tp_features.light_status = 0; |
3351 | } else { | 3370 | } else { |
3352 | rc = (tp_features.light)? 0 : 1; | 3371 | rc = 0; |
3353 | } | 3372 | } |
3373 | |||
3354 | return rc; | 3374 | return rc; |
3355 | } | 3375 | } |
3356 | 3376 | ||
@@ -3833,7 +3853,7 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = { | |||
3833 | "tpacpi::standby", | 3853 | "tpacpi::standby", |
3834 | }; | 3854 | }; |
3835 | 3855 | ||
3836 | static int led_get_status(unsigned int led) | 3856 | static int led_get_status(const unsigned int led) |
3837 | { | 3857 | { |
3838 | int status; | 3858 | int status; |
3839 | enum led_status_t led_s; | 3859 | enum led_status_t led_s; |
@@ -3857,41 +3877,42 @@ static int led_get_status(unsigned int led) | |||
3857 | /* not reached */ | 3877 | /* not reached */ |
3858 | } | 3878 | } |
3859 | 3879 | ||
3860 | static int led_set_status(unsigned int led, enum led_status_t ledstatus) | 3880 | static int led_set_status(const unsigned int led, |
3881 | const enum led_status_t ledstatus) | ||
3861 | { | 3882 | { |
3862 | /* off, on, blink. Index is led_status_t */ | 3883 | /* off, on, blink. Index is led_status_t */ |
3863 | static const int led_sled_arg1[] = { 0, 1, 3 }; | 3884 | static const unsigned int led_sled_arg1[] = { 0, 1, 3 }; |
3864 | static const int led_exp_hlbl[] = { 0, 0, 1 }; /* led# * */ | 3885 | static const unsigned int led_led_arg1[] = { 0, 0x80, 0xc0 }; |
3865 | static const int led_exp_hlcl[] = { 0, 1, 1 }; /* led# * */ | ||
3866 | static const int led_led_arg1[] = { 0, 0x80, 0xc0 }; | ||
3867 | 3886 | ||
3868 | int rc = 0; | 3887 | int rc = 0; |
3869 | 3888 | ||
3870 | switch (led_supported) { | 3889 | switch (led_supported) { |
3871 | case TPACPI_LED_570: | 3890 | case TPACPI_LED_570: |
3872 | /* 570 */ | 3891 | /* 570 */ |
3873 | led = 1 << led; | 3892 | if (led > 7) |
3874 | if (!acpi_evalf(led_handle, NULL, NULL, "vdd", | 3893 | return -EINVAL; |
3875 | led, led_sled_arg1[ledstatus])) | 3894 | if (!acpi_evalf(led_handle, NULL, NULL, "vdd", |
3876 | rc = -EIO; | 3895 | (1 << led), led_sled_arg1[ledstatus])) |
3877 | break; | 3896 | rc = -EIO; |
3897 | break; | ||
3878 | case TPACPI_LED_OLD: | 3898 | case TPACPI_LED_OLD: |
3879 | /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20 */ | 3899 | /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20 */ |
3880 | led = 1 << led; | 3900 | if (led > 7) |
3881 | rc = ec_write(TPACPI_LED_EC_HLMS, led); | 3901 | return -EINVAL; |
3882 | if (rc >= 0) | 3902 | rc = ec_write(TPACPI_LED_EC_HLMS, (1 << led)); |
3883 | rc = ec_write(TPACPI_LED_EC_HLBL, | 3903 | if (rc >= 0) |
3884 | led * led_exp_hlbl[ledstatus]); | 3904 | rc = ec_write(TPACPI_LED_EC_HLBL, |
3885 | if (rc >= 0) | 3905 | (ledstatus == TPACPI_LED_BLINK) << led); |
3886 | rc = ec_write(TPACPI_LED_EC_HLCL, | 3906 | if (rc >= 0) |
3887 | led * led_exp_hlcl[ledstatus]); | 3907 | rc = ec_write(TPACPI_LED_EC_HLCL, |
3888 | break; | 3908 | (ledstatus != TPACPI_LED_OFF) << led); |
3909 | break; | ||
3889 | case TPACPI_LED_NEW: | 3910 | case TPACPI_LED_NEW: |
3890 | /* all others */ | 3911 | /* all others */ |
3891 | if (!acpi_evalf(led_handle, NULL, NULL, "vdd", | 3912 | if (!acpi_evalf(led_handle, NULL, NULL, "vdd", |
3892 | led, led_led_arg1[ledstatus])) | 3913 | led, led_led_arg1[ledstatus])) |
3893 | rc = -EIO; | 3914 | rc = -EIO; |
3894 | break; | 3915 | break; |
3895 | default: | 3916 | default: |
3896 | rc = -ENXIO; | 3917 | rc = -ENXIO; |
3897 | } | 3918 | } |
@@ -3978,7 +3999,6 @@ static void led_exit(void) | |||
3978 | } | 3999 | } |
3979 | 4000 | ||
3980 | kfree(tpacpi_leds); | 4001 | kfree(tpacpi_leds); |
3981 | tpacpi_leds = NULL; | ||
3982 | } | 4002 | } |
3983 | 4003 | ||
3984 | static int __init led_init(struct ibm_init_struct *iibm) | 4004 | static int __init led_init(struct ibm_init_struct *iibm) |
@@ -4802,7 +4822,6 @@ static void brightness_exit(void) | |||
4802 | vdbg_printk(TPACPI_DBG_EXIT, | 4822 | vdbg_printk(TPACPI_DBG_EXIT, |
4803 | "calling backlight_device_unregister()\n"); | 4823 | "calling backlight_device_unregister()\n"); |
4804 | backlight_device_unregister(ibm_backlight_device); | 4824 | backlight_device_unregister(ibm_backlight_device); |
4805 | ibm_backlight_device = NULL; | ||
4806 | } | 4825 | } |
4807 | } | 4826 | } |
4808 | 4827 | ||
@@ -5764,11 +5783,16 @@ static int __init fan_init(struct ibm_init_struct *iibm) | |||
5764 | fan_control_access_mode != TPACPI_FAN_WR_NONE) { | 5783 | fan_control_access_mode != TPACPI_FAN_WR_NONE) { |
5765 | rc = sysfs_create_group(&tpacpi_sensors_pdev->dev.kobj, | 5784 | rc = sysfs_create_group(&tpacpi_sensors_pdev->dev.kobj, |
5766 | &fan_attr_group); | 5785 | &fan_attr_group); |
5767 | if (!(rc < 0)) | ||
5768 | rc = driver_create_file(&tpacpi_hwmon_pdriver.driver, | ||
5769 | &driver_attr_fan_watchdog); | ||
5770 | if (rc < 0) | 5786 | if (rc < 0) |
5771 | return rc; | 5787 | return rc; |
5788 | |||
5789 | rc = driver_create_file(&tpacpi_hwmon_pdriver.driver, | ||
5790 | &driver_attr_fan_watchdog); | ||
5791 | if (rc < 0) { | ||
5792 | sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj, | ||
5793 | &fan_attr_group); | ||
5794 | return rc; | ||
5795 | } | ||
5772 | return 0; | 5796 | return 0; |
5773 | } else | 5797 | } else |
5774 | return 1; | 5798 | return 1; |
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 25efd331ef28..b402269301f6 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -346,8 +346,10 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
346 | mutex_lock(&flash->lock); | 346 | mutex_lock(&flash->lock); |
347 | 347 | ||
348 | /* Wait until finished previous write command. */ | 348 | /* Wait until finished previous write command. */ |
349 | if (wait_till_ready(flash)) | 349 | if (wait_till_ready(flash)) { |
350 | mutex_unlock(&flash->lock); | ||
350 | return 1; | 351 | return 1; |
352 | } | ||
351 | 353 | ||
352 | write_enable(flash); | 354 | write_enable(flash); |
353 | 355 | ||
diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c index 47474903263c..c5030f94f04e 100644 --- a/drivers/mtd/redboot.c +++ b/drivers/mtd/redboot.c | |||
@@ -295,5 +295,5 @@ module_init(redboot_parser_init); | |||
295 | module_exit(redboot_parser_exit); | 295 | module_exit(redboot_parser_exit); |
296 | 296 | ||
297 | MODULE_LICENSE("GPL"); | 297 | MODULE_LICENSE("GPL"); |
298 | MODULE_AUTHOR("Red Hat, Inc. - David Woodhouse <dwmw2@cambridge.redhat.com>"); | 298 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); |
299 | MODULE_DESCRIPTION("Parsing code for RedBoot Flash Image System (FIS) tables"); | 299 | MODULE_DESCRIPTION("Parsing code for RedBoot Flash Image System (FIS) tables"); |
diff --git a/drivers/net/7990.c b/drivers/net/7990.c index 750a46f4bc58..ad6b8a5b6574 100644 --- a/drivers/net/7990.c +++ b/drivers/net/7990.c | |||
@@ -506,6 +506,7 @@ int lance_open (struct net_device *dev) | |||
506 | 506 | ||
507 | return res; | 507 | return res; |
508 | } | 508 | } |
509 | EXPORT_SYMBOL_GPL(lance_open); | ||
509 | 510 | ||
510 | int lance_close (struct net_device *dev) | 511 | int lance_close (struct net_device *dev) |
511 | { | 512 | { |
@@ -521,6 +522,7 @@ int lance_close (struct net_device *dev) | |||
521 | 522 | ||
522 | return 0; | 523 | return 0; |
523 | } | 524 | } |
525 | EXPORT_SYMBOL_GPL(lance_close); | ||
524 | 526 | ||
525 | void lance_tx_timeout(struct net_device *dev) | 527 | void lance_tx_timeout(struct net_device *dev) |
526 | { | 528 | { |
@@ -529,7 +531,7 @@ void lance_tx_timeout(struct net_device *dev) | |||
529 | dev->trans_start = jiffies; | 531 | dev->trans_start = jiffies; |
530 | netif_wake_queue (dev); | 532 | netif_wake_queue (dev); |
531 | } | 533 | } |
532 | 534 | EXPORT_SYMBOL_GPL(lance_tx_timeout); | |
533 | 535 | ||
534 | int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | 536 | int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) |
535 | { | 537 | { |
@@ -586,6 +588,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
586 | 588 | ||
587 | return 0; | 589 | return 0; |
588 | } | 590 | } |
591 | EXPORT_SYMBOL_GPL(lance_start_xmit); | ||
589 | 592 | ||
590 | /* taken from the depca driver via a2065.c */ | 593 | /* taken from the depca driver via a2065.c */ |
591 | static void lance_load_multicast (struct net_device *dev) | 594 | static void lance_load_multicast (struct net_device *dev) |
@@ -654,6 +657,7 @@ void lance_set_multicast (struct net_device *dev) | |||
654 | if (!stopped) | 657 | if (!stopped) |
655 | netif_start_queue (dev); | 658 | netif_start_queue (dev); |
656 | } | 659 | } |
660 | EXPORT_SYMBOL_GPL(lance_set_multicast); | ||
657 | 661 | ||
658 | #ifdef CONFIG_NET_POLL_CONTROLLER | 662 | #ifdef CONFIG_NET_POLL_CONTROLLER |
659 | void lance_poll(struct net_device *dev) | 663 | void lance_poll(struct net_device *dev) |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index dd0ec9ebc939..f4182cfffe9d 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2426,7 +2426,7 @@ config CHELSIO_T3 | |||
2426 | 2426 | ||
2427 | config EHEA | 2427 | config EHEA |
2428 | tristate "eHEA Ethernet support" | 2428 | tristate "eHEA Ethernet support" |
2429 | depends on IBMEBUS && INET && SPARSEMEM && MEMORY_HOTPLUG | 2429 | depends on IBMEBUS && INET && SPARSEMEM |
2430 | select INET_LRO | 2430 | select INET_LRO |
2431 | ---help--- | 2431 | ---help--- |
2432 | This driver supports the IBM pSeries eHEA ethernet adapter. | 2432 | This driver supports the IBM pSeries eHEA ethernet adapter. |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 6ddc911e7d15..99e0b4cdc56f 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -637,22 +637,6 @@ static s32 atl1_phy_leave_power_saving(struct atl1_hw *hw) | |||
637 | } | 637 | } |
638 | 638 | ||
639 | /* | 639 | /* |
640 | * Force the PHY into power saving mode using vendor magic. | ||
641 | */ | ||
642 | #ifdef CONFIG_PM | ||
643 | static void atl1_phy_enter_power_saving(struct atl1_hw *hw) | ||
644 | { | ||
645 | atl1_write_phy_reg(hw, MII_DBG_ADDR, 0); | ||
646 | atl1_write_phy_reg(hw, MII_DBG_DATA, 0x124E); | ||
647 | atl1_write_phy_reg(hw, MII_DBG_ADDR, 2); | ||
648 | atl1_write_phy_reg(hw, MII_DBG_DATA, 0x3000); | ||
649 | atl1_write_phy_reg(hw, MII_DBG_ADDR, 3); | ||
650 | atl1_write_phy_reg(hw, MII_DBG_DATA, 0); | ||
651 | |||
652 | } | ||
653 | #endif | ||
654 | |||
655 | /* | ||
656 | * Resets the PHY and make all config validate | 640 | * Resets the PHY and make all config validate |
657 | * hw - Struct containing variables accessed by shared code | 641 | * hw - Struct containing variables accessed by shared code |
658 | * | 642 | * |
@@ -2860,7 +2844,6 @@ disable_wol: | |||
2860 | ctrl |= PCIE_PHYMISC_FORCE_RCV_DET; | 2844 | ctrl |= PCIE_PHYMISC_FORCE_RCV_DET; |
2861 | iowrite32(ctrl, hw->hw_addr + REG_PCIE_PHYMISC); | 2845 | iowrite32(ctrl, hw->hw_addr + REG_PCIE_PHYMISC); |
2862 | ioread32(hw->hw_addr + REG_PCIE_PHYMISC); | 2846 | ioread32(hw->hw_addr + REG_PCIE_PHYMISC); |
2863 | atl1_phy_enter_power_saving(hw); | ||
2864 | hw->phy_configured = false; | 2847 | hw->phy_configured = false; |
2865 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); | 2848 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); |
2866 | exit: | 2849 | exit: |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 287a61918739..faae01dc1c4b 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) | |||
1766 | mutex_lock(&ehea_bcmc_regs.lock); | 1766 | mutex_lock(&ehea_bcmc_regs.lock); |
1767 | 1767 | ||
1768 | /* Deregister old MAC in pHYP */ | 1768 | /* Deregister old MAC in pHYP */ |
1769 | ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC); | 1769 | if (port->state == EHEA_PORT_UP) { |
1770 | if (ret) | 1770 | ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC); |
1771 | goto out_upregs; | 1771 | if (ret) |
1772 | goto out_upregs; | ||
1773 | } | ||
1772 | 1774 | ||
1773 | port->mac_addr = cb0->port_mac_addr << 16; | 1775 | port->mac_addr = cb0->port_mac_addr << 16; |
1774 | 1776 | ||
1775 | /* Register new MAC in pHYP */ | 1777 | /* Register new MAC in pHYP */ |
1776 | ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); | 1778 | if (port->state == EHEA_PORT_UP) { |
1777 | if (ret) | 1779 | ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); |
1778 | goto out_upregs; | 1780 | if (ret) |
1781 | goto out_upregs; | ||
1782 | } | ||
1779 | 1783 | ||
1780 | ret = 0; | 1784 | ret = 0; |
1781 | 1785 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 9eca97fb0a54..2cb244763292 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -3273,6 +3273,20 @@ static void nv_link_irq(struct net_device *dev) | |||
3273 | dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name); | 3273 | dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name); |
3274 | } | 3274 | } |
3275 | 3275 | ||
3276 | static void nv_msi_workaround(struct fe_priv *np) | ||
3277 | { | ||
3278 | |||
3279 | /* Need to toggle the msi irq mask within the ethernet device, | ||
3280 | * otherwise, future interrupts will not be detected. | ||
3281 | */ | ||
3282 | if (np->msi_flags & NV_MSI_ENABLED) { | ||
3283 | u8 __iomem *base = np->base; | ||
3284 | |||
3285 | writel(0, base + NvRegMSIIrqMask); | ||
3286 | writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask); | ||
3287 | } | ||
3288 | } | ||
3289 | |||
3276 | static irqreturn_t nv_nic_irq(int foo, void *data) | 3290 | static irqreturn_t nv_nic_irq(int foo, void *data) |
3277 | { | 3291 | { |
3278 | struct net_device *dev = (struct net_device *) data; | 3292 | struct net_device *dev = (struct net_device *) data; |
@@ -3295,6 +3309,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data) | |||
3295 | if (!(events & np->irqmask)) | 3309 | if (!(events & np->irqmask)) |
3296 | break; | 3310 | break; |
3297 | 3311 | ||
3312 | nv_msi_workaround(np); | ||
3313 | |||
3298 | spin_lock(&np->lock); | 3314 | spin_lock(&np->lock); |
3299 | nv_tx_done(dev); | 3315 | nv_tx_done(dev); |
3300 | spin_unlock(&np->lock); | 3316 | spin_unlock(&np->lock); |
@@ -3410,6 +3426,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data) | |||
3410 | if (!(events & np->irqmask)) | 3426 | if (!(events & np->irqmask)) |
3411 | break; | 3427 | break; |
3412 | 3428 | ||
3429 | nv_msi_workaround(np); | ||
3430 | |||
3413 | spin_lock(&np->lock); | 3431 | spin_lock(&np->lock); |
3414 | nv_tx_done_optimized(dev, TX_WORK_PER_LOOP); | 3432 | nv_tx_done_optimized(dev, TX_WORK_PER_LOOP); |
3415 | spin_unlock(&np->lock); | 3433 | spin_unlock(&np->lock); |
@@ -3750,6 +3768,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data) | |||
3750 | if (!(events & NVREG_IRQ_TIMER)) | 3768 | if (!(events & NVREG_IRQ_TIMER)) |
3751 | return IRQ_RETVAL(0); | 3769 | return IRQ_RETVAL(0); |
3752 | 3770 | ||
3771 | nv_msi_workaround(np); | ||
3772 | |||
3753 | spin_lock(&np->lock); | 3773 | spin_lock(&np->lock); |
3754 | np->intr_test = 1; | 3774 | np->intr_test = 1; |
3755 | spin_unlock(&np->lock); | 3775 | spin_unlock(&np->lock); |
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig index ce816ba9c40d..e6317557a531 100644 --- a/drivers/net/irda/Kconfig +++ b/drivers/net/irda/Kconfig | |||
@@ -329,6 +329,7 @@ config PXA_FICP | |||
329 | config MCS_FIR | 329 | config MCS_FIR |
330 | tristate "MosChip MCS7780 IrDA-USB dongle" | 330 | tristate "MosChip MCS7780 IrDA-USB dongle" |
331 | depends on IRDA && USB && EXPERIMENTAL | 331 | depends on IRDA && USB && EXPERIMENTAL |
332 | select CRC32 | ||
332 | help | 333 | help |
333 | Say Y or M here if you want to build support for the MosChip | 334 | Say Y or M here if you want to build support for the MosChip |
334 | MCS7780 IrDA-USB bridge device driver. | 335 | MCS7780 IrDA-USB bridge device driver. |
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index 6321b059ce13..2f38e847e2cd 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -58,8 +58,8 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw); | |||
58 | 58 | ||
59 | static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw) | 59 | static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw) |
60 | { | 60 | { |
61 | hw->mac.num_rx_queues = IXGBE_82598_MAX_TX_QUEUES; | 61 | hw->mac.num_rx_queues = IXGBE_82598_MAX_RX_QUEUES; |
62 | hw->mac.num_tx_queues = IXGBE_82598_MAX_RX_QUEUES; | 62 | hw->mac.num_tx_queues = IXGBE_82598_MAX_TX_QUEUES; |
63 | hw->mac.num_rx_addrs = IXGBE_82598_RAR_ENTRIES; | 63 | hw->mac.num_rx_addrs = IXGBE_82598_RAR_ENTRIES; |
64 | 64 | ||
65 | /* PHY ops are filled in by default properly for Fiber only */ | 65 | /* PHY ops are filled in by default properly for Fiber only */ |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 58a26a47af29..bafb69b6f7cb 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -341,12 +341,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) | |||
341 | struct pppox_sock *relay_po; | 341 | struct pppox_sock *relay_po; |
342 | 342 | ||
343 | if (sk->sk_state & PPPOX_BOUND) { | 343 | if (sk->sk_state & PPPOX_BOUND) { |
344 | struct pppoe_hdr *ph = pppoe_hdr(skb); | ||
345 | int len = ntohs(ph->length); | ||
346 | skb_pull_rcsum(skb, sizeof(struct pppoe_hdr)); | ||
347 | if (pskb_trim_rcsum(skb, len)) | ||
348 | goto abort_kfree; | ||
349 | |||
350 | ppp_input(&po->chan, skb); | 344 | ppp_input(&po->chan, skb); |
351 | } else if (sk->sk_state & PPPOX_RELAY) { | 345 | } else if (sk->sk_state & PPPOX_RELAY) { |
352 | relay_po = get_item_by_addr(&po->pppoe_relay); | 346 | relay_po = get_item_by_addr(&po->pppoe_relay); |
@@ -357,7 +351,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) | |||
357 | if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0) | 351 | if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0) |
358 | goto abort_put; | 352 | goto abort_put; |
359 | 353 | ||
360 | skb_pull(skb, sizeof(struct pppoe_hdr)); | ||
361 | if (!__pppoe_xmit(sk_pppox(relay_po), skb)) | 354 | if (!__pppoe_xmit(sk_pppox(relay_po), skb)) |
362 | goto abort_put; | 355 | goto abort_put; |
363 | } else { | 356 | } else { |
@@ -388,6 +381,7 @@ static int pppoe_rcv(struct sk_buff *skb, | |||
388 | { | 381 | { |
389 | struct pppoe_hdr *ph; | 382 | struct pppoe_hdr *ph; |
390 | struct pppox_sock *po; | 383 | struct pppox_sock *po; |
384 | int len; | ||
391 | 385 | ||
392 | if (!(skb = skb_share_check(skb, GFP_ATOMIC))) | 386 | if (!(skb = skb_share_check(skb, GFP_ATOMIC))) |
393 | goto out; | 387 | goto out; |
@@ -399,10 +393,21 @@ static int pppoe_rcv(struct sk_buff *skb, | |||
399 | goto drop; | 393 | goto drop; |
400 | 394 | ||
401 | ph = pppoe_hdr(skb); | 395 | ph = pppoe_hdr(skb); |
396 | len = ntohs(ph->length); | ||
397 | |||
398 | skb_pull_rcsum(skb, sizeof(*ph)); | ||
399 | if (skb->len < len) | ||
400 | goto drop; | ||
402 | 401 | ||
403 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); | 402 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); |
404 | if (po != NULL) | 403 | if (!po) |
405 | return sk_receive_skb(sk_pppox(po), skb, 0); | 404 | goto drop; |
405 | |||
406 | if (pskb_trim_rcsum(skb, len)) | ||
407 | goto drop; | ||
408 | |||
409 | return sk_receive_skb(sk_pppox(po), skb, 0); | ||
410 | |||
406 | drop: | 411 | drop: |
407 | kfree_skb(skb); | 412 | kfree_skb(skb); |
408 | out: | 413 | out: |
@@ -427,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb, | |||
427 | if (dev_net(dev) != &init_net) | 432 | if (dev_net(dev) != &init_net) |
428 | goto abort; | 433 | goto abort; |
429 | 434 | ||
430 | if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) | ||
431 | goto abort; | ||
432 | |||
433 | if (!(skb = skb_share_check(skb, GFP_ATOMIC))) | 435 | if (!(skb = skb_share_check(skb, GFP_ATOMIC))) |
434 | goto out; | 436 | goto out; |
435 | 437 | ||
438 | if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) | ||
439 | goto abort; | ||
440 | |||
436 | ph = pppoe_hdr(skb); | 441 | ph = pppoe_hdr(skb); |
437 | if (ph->code != PADT_CODE) | 442 | if (ph->code != PADT_CODE) |
438 | goto abort; | 443 | goto abort; |
@@ -937,12 +942,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
937 | m->msg_namelen = 0; | 942 | m->msg_namelen = 0; |
938 | 943 | ||
939 | if (skb) { | 944 | if (skb) { |
940 | struct pppoe_hdr *ph = pppoe_hdr(skb); | 945 | total_len = min(total_len, skb->len); |
941 | const int len = ntohs(ph->length); | 946 | error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len); |
942 | |||
943 | error = memcpy_toiovec(m->msg_iov, (unsigned char *) &ph->tag[0], len); | ||
944 | if (error == 0) | 947 | if (error == 0) |
945 | error = len; | 948 | error = total_len; |
946 | } | 949 | } |
947 | 950 | ||
948 | kfree_skb(skb); | 951 | kfree_skb(skb); |
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c index 70cfdb46aa27..f9298827a76c 100644 --- a/drivers/net/pppol2tp.c +++ b/drivers/net/pppol2tp.c | |||
@@ -783,14 +783,18 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
783 | err = 0; | 783 | err = 0; |
784 | skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, | 784 | skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, |
785 | flags & MSG_DONTWAIT, &err); | 785 | flags & MSG_DONTWAIT, &err); |
786 | if (skb) { | 786 | if (!skb) |
787 | err = memcpy_toiovec(msg->msg_iov, (unsigned char *) skb->data, | 787 | goto end; |
788 | skb->len); | 788 | |
789 | if (err < 0) | 789 | if (len > skb->len) |
790 | goto do_skb_free; | 790 | len = skb->len; |
791 | err = skb->len; | 791 | else if (len < skb->len) |
792 | } | 792 | msg->msg_flags |= MSG_TRUNC; |
793 | do_skb_free: | 793 | |
794 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len); | ||
795 | if (likely(err == 0)) | ||
796 | err = len; | ||
797 | |||
794 | kfree_skb(skb); | 798 | kfree_skb(skb); |
795 | end: | 799 | end: |
796 | return err; | 800 | return err; |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index d3f749c72d41..790db89db345 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -733,8 +733,10 @@ void falcon_fini_rx(struct efx_rx_queue *rx_queue) | |||
733 | continue; | 733 | continue; |
734 | break; | 734 | break; |
735 | } | 735 | } |
736 | if (rc) | 736 | if (rc) { |
737 | EFX_ERR(efx, "failed to flush rx queue %d\n", rx_queue->queue); | 737 | EFX_ERR(efx, "failed to flush rx queue %d\n", rx_queue->queue); |
738 | efx_schedule_reset(efx, RESET_TYPE_INVISIBLE); | ||
739 | } | ||
738 | 740 | ||
739 | /* Remove RX descriptor ring from card */ | 741 | /* Remove RX descriptor ring from card */ |
740 | EFX_ZERO_OWORD(rx_desc_ptr); | 742 | EFX_ZERO_OWORD(rx_desc_ptr); |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 3bb60530d4d7..62436b3a18c6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -4404,7 +4404,9 @@ static int sky2_resume(struct pci_dev *pdev) | |||
4404 | if (err) { | 4404 | if (err) { |
4405 | printk(KERN_ERR PFX "%s: could not up: %d\n", | 4405 | printk(KERN_ERR PFX "%s: could not up: %d\n", |
4406 | dev->name, err); | 4406 | dev->name, err); |
4407 | rtnl_lock(); | ||
4407 | dev_close(dev); | 4408 | dev_close(dev); |
4409 | rtnl_unlock(); | ||
4408 | goto out; | 4410 | goto out; |
4409 | } | 4411 | } |
4410 | } | 4412 | } |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 69e97a1cb1c4..8606818653f8 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -93,14 +93,14 @@ | |||
93 | #define SMC_insw(a, r, p, l) insw ((unsigned long *)((a) + (r)), p, l) | 93 | #define SMC_insw(a, r, p, l) insw ((unsigned long *)((a) + (r)), p, l) |
94 | # endif | 94 | # endif |
95 | /* check if the mac in reg is valid */ | 95 | /* check if the mac in reg is valid */ |
96 | #define SMC_GET_MAC_ADDR(addr) \ | 96 | #define SMC_GET_MAC_ADDR(lp, addr) \ |
97 | do { \ | 97 | do { \ |
98 | unsigned int __v; \ | 98 | unsigned int __v; \ |
99 | __v = SMC_inw(ioaddr, ADDR0_REG); \ | 99 | __v = SMC_inw(ioaddr, ADDR0_REG(lp)); \ |
100 | addr[0] = __v; addr[1] = __v >> 8; \ | 100 | addr[0] = __v; addr[1] = __v >> 8; \ |
101 | __v = SMC_inw(ioaddr, ADDR1_REG); \ | 101 | __v = SMC_inw(ioaddr, ADDR1_REG(lp)); \ |
102 | addr[2] = __v; addr[3] = __v >> 8; \ | 102 | addr[2] = __v; addr[3] = __v >> 8; \ |
103 | __v = SMC_inw(ioaddr, ADDR2_REG); \ | 103 | __v = SMC_inw(ioaddr, ADDR2_REG(lp)); \ |
104 | addr[4] = __v; addr[5] = __v >> 8; \ | 104 | addr[4] = __v; addr[5] = __v >> 8; \ |
105 | if (*(u32 *)(&addr[0]) == 0xFFFFFFFF) { \ | 105 | if (*(u32 *)(&addr[0]) == 0xFFFFFFFF) { \ |
106 | random_ether_addr(addr); \ | 106 | random_ether_addr(addr); \ |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 07b3f77e7626..cc4bde852542 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -64,8 +64,8 @@ | |||
64 | 64 | ||
65 | #define DRV_MODULE_NAME "tg3" | 65 | #define DRV_MODULE_NAME "tg3" |
66 | #define PFX DRV_MODULE_NAME ": " | 66 | #define PFX DRV_MODULE_NAME ": " |
67 | #define DRV_MODULE_VERSION "3.92" | 67 | #define DRV_MODULE_VERSION "3.92.1" |
68 | #define DRV_MODULE_RELDATE "May 2, 2008" | 68 | #define DRV_MODULE_RELDATE "June 9, 2008" |
69 | 69 | ||
70 | #define TG3_DEF_MAC_MODE 0 | 70 | #define TG3_DEF_MAC_MODE 0 |
71 | #define TG3_DEF_RX_MODE 0 | 71 | #define TG3_DEF_RX_MODE 0 |
@@ -1295,6 +1295,21 @@ static void tg3_frob_aux_power(struct tg3 *tp) | |||
1295 | GRC_LCLCTRL_GPIO_OUTPUT0 | | 1295 | GRC_LCLCTRL_GPIO_OUTPUT0 | |
1296 | GRC_LCLCTRL_GPIO_OUTPUT1), | 1296 | GRC_LCLCTRL_GPIO_OUTPUT1), |
1297 | 100); | 1297 | 100); |
1298 | } else if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761) { | ||
1299 | /* The 5761 non-e device swaps GPIO 0 and GPIO 2. */ | ||
1300 | u32 grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | | ||
1301 | GRC_LCLCTRL_GPIO_OE1 | | ||
1302 | GRC_LCLCTRL_GPIO_OE2 | | ||
1303 | GRC_LCLCTRL_GPIO_OUTPUT0 | | ||
1304 | GRC_LCLCTRL_GPIO_OUTPUT1 | | ||
1305 | tp->grc_local_ctrl; | ||
1306 | tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100); | ||
1307 | |||
1308 | grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT2; | ||
1309 | tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100); | ||
1310 | |||
1311 | grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT0; | ||
1312 | tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100); | ||
1298 | } else { | 1313 | } else { |
1299 | u32 no_gpio2; | 1314 | u32 no_gpio2; |
1300 | u32 grc_local_ctrl = 0; | 1315 | u32 grc_local_ctrl = 0; |
@@ -3168,8 +3183,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset) | |||
3168 | err |= tg3_readphy(tp, MII_BMCR, &bmcr); | 3183 | err |= tg3_readphy(tp, MII_BMCR, &bmcr); |
3169 | 3184 | ||
3170 | if ((tp->link_config.autoneg == AUTONEG_ENABLE) && !force_reset && | 3185 | if ((tp->link_config.autoneg == AUTONEG_ENABLE) && !force_reset && |
3171 | (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT) && | 3186 | (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) { |
3172 | tp->link_config.flowctrl == tp->link_config.active_flowctrl) { | ||
3173 | /* do nothing, just check for link up at the end */ | 3187 | /* do nothing, just check for link up at the end */ |
3174 | } else if (tp->link_config.autoneg == AUTONEG_ENABLE) { | 3188 | } else if (tp->link_config.autoneg == AUTONEG_ENABLE) { |
3175 | u32 adv, new_adv; | 3189 | u32 adv, new_adv; |
@@ -8599,7 +8613,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
8599 | (cmd->speed == SPEED_1000)) | 8613 | (cmd->speed == SPEED_1000)) |
8600 | return -EINVAL; | 8614 | return -EINVAL; |
8601 | else if ((cmd->speed == SPEED_1000) && | 8615 | else if ((cmd->speed == SPEED_1000) && |
8602 | (tp->tg3_flags2 & TG3_FLAG_10_100_ONLY)) | 8616 | (tp->tg3_flags & TG3_FLAG_10_100_ONLY)) |
8603 | return -EINVAL; | 8617 | return -EINVAL; |
8604 | 8618 | ||
8605 | tg3_full_lock(tp, 0); | 8619 | tg3_full_lock(tp, 0); |
@@ -11768,6 +11782,15 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
11768 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) | 11782 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) |
11769 | tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL; | 11783 | tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL; |
11770 | 11784 | ||
11785 | if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761) { | ||
11786 | /* Turn off the debug UART. */ | ||
11787 | tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL; | ||
11788 | if (tp->tg3_flags2 & TG3_FLG2_IS_NIC) | ||
11789 | /* Keep VMain power. */ | ||
11790 | tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE0 | | ||
11791 | GRC_LCLCTRL_GPIO_OUTPUT0; | ||
11792 | } | ||
11793 | |||
11771 | /* Force the chip into D0. */ | 11794 | /* Force the chip into D0. */ |
11772 | err = tg3_set_power_state(tp, PCI_D0); | 11795 | err = tg3_set_power_state(tp, PCI_D0); |
11773 | if (err) { | 11796 | if (err) { |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 5450eac9e263..4452306d5328 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -44,11 +44,15 @@ struct virtnet_info | |||
44 | /* The skb we couldn't send because buffers were full. */ | 44 | /* The skb we couldn't send because buffers were full. */ |
45 | struct sk_buff *last_xmit_skb; | 45 | struct sk_buff *last_xmit_skb; |
46 | 46 | ||
47 | /* If we need to free in a timer, this is it. */ | ||
48 | struct timer_list xmit_free_timer; | ||
49 | |||
47 | /* Number of input buffers, and max we've ever had. */ | 50 | /* Number of input buffers, and max we've ever had. */ |
48 | unsigned int num, max; | 51 | unsigned int num, max; |
49 | 52 | ||
50 | /* For cleaning up after transmission. */ | 53 | /* For cleaning up after transmission. */ |
51 | struct tasklet_struct tasklet; | 54 | struct tasklet_struct tasklet; |
55 | bool free_in_tasklet; | ||
52 | 56 | ||
53 | /* Receive & send queues. */ | 57 | /* Receive & send queues. */ |
54 | struct sk_buff_head recv; | 58 | struct sk_buff_head recv; |
@@ -72,7 +76,7 @@ static void skb_xmit_done(struct virtqueue *svq) | |||
72 | /* Suppress further interrupts. */ | 76 | /* Suppress further interrupts. */ |
73 | svq->vq_ops->disable_cb(svq); | 77 | svq->vq_ops->disable_cb(svq); |
74 | 78 | ||
75 | /* We were waiting for more output buffers. */ | 79 | /* We were probably waiting for more output buffers. */ |
76 | netif_wake_queue(vi->dev); | 80 | netif_wake_queue(vi->dev); |
77 | 81 | ||
78 | /* Make sure we re-xmit last_xmit_skb: if there are no more packets | 82 | /* Make sure we re-xmit last_xmit_skb: if there are no more packets |
@@ -94,9 +98,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb, | |||
94 | BUG_ON(len > MAX_PACKET_LEN); | 98 | BUG_ON(len > MAX_PACKET_LEN); |
95 | 99 | ||
96 | skb_trim(skb, len); | 100 | skb_trim(skb, len); |
97 | skb->protocol = eth_type_trans(skb, dev); | 101 | |
98 | pr_debug("Receiving skb proto 0x%04x len %i type %i\n", | ||
99 | ntohs(skb->protocol), skb->len, skb->pkt_type); | ||
100 | dev->stats.rx_bytes += skb->len; | 102 | dev->stats.rx_bytes += skb->len; |
101 | dev->stats.rx_packets++; | 103 | dev->stats.rx_packets++; |
102 | 104 | ||
@@ -106,6 +108,10 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb, | |||
106 | goto frame_err; | 108 | goto frame_err; |
107 | } | 109 | } |
108 | 110 | ||
111 | skb->protocol = eth_type_trans(skb, dev); | ||
112 | pr_debug("Receiving skb proto 0x%04x len %i type %i\n", | ||
113 | ntohs(skb->protocol), skb->len, skb->pkt_type); | ||
114 | |||
109 | if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { | 115 | if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { |
110 | pr_debug("GSO!\n"); | 116 | pr_debug("GSO!\n"); |
111 | switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { | 117 | switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { |
@@ -238,9 +244,25 @@ static void free_old_xmit_skbs(struct virtnet_info *vi) | |||
238 | } | 244 | } |
239 | } | 245 | } |
240 | 246 | ||
247 | /* If the virtio transport doesn't always notify us when all in-flight packets | ||
248 | * are consumed, we fall back to using this function on a timer to free them. */ | ||
249 | static void xmit_free(unsigned long data) | ||
250 | { | ||
251 | struct virtnet_info *vi = (void *)data; | ||
252 | |||
253 | netif_tx_lock(vi->dev); | ||
254 | |||
255 | free_old_xmit_skbs(vi); | ||
256 | |||
257 | if (!skb_queue_empty(&vi->send)) | ||
258 | mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10)); | ||
259 | |||
260 | netif_tx_unlock(vi->dev); | ||
261 | } | ||
262 | |||
241 | static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) | 263 | static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) |
242 | { | 264 | { |
243 | int num; | 265 | int num, err; |
244 | struct scatterlist sg[2+MAX_SKB_FRAGS]; | 266 | struct scatterlist sg[2+MAX_SKB_FRAGS]; |
245 | struct virtio_net_hdr *hdr; | 267 | struct virtio_net_hdr *hdr; |
246 | const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; | 268 | const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; |
@@ -283,7 +305,11 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) | |||
283 | vnet_hdr_to_sg(sg, skb); | 305 | vnet_hdr_to_sg(sg, skb); |
284 | num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; | 306 | num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; |
285 | 307 | ||
286 | return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); | 308 | err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); |
309 | if (!err && !vi->free_in_tasklet) | ||
310 | mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10)); | ||
311 | |||
312 | return err; | ||
287 | } | 313 | } |
288 | 314 | ||
289 | static void xmit_tasklet(unsigned long data) | 315 | static void xmit_tasklet(unsigned long data) |
@@ -295,6 +321,8 @@ static void xmit_tasklet(unsigned long data) | |||
295 | vi->svq->vq_ops->kick(vi->svq); | 321 | vi->svq->vq_ops->kick(vi->svq); |
296 | vi->last_xmit_skb = NULL; | 322 | vi->last_xmit_skb = NULL; |
297 | } | 323 | } |
324 | if (vi->free_in_tasklet) | ||
325 | free_old_xmit_skbs(vi); | ||
298 | netif_tx_unlock_bh(vi->dev); | 326 | netif_tx_unlock_bh(vi->dev); |
299 | } | 327 | } |
300 | 328 | ||
@@ -435,6 +463,10 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
435 | vi->vdev = vdev; | 463 | vi->vdev = vdev; |
436 | vdev->priv = vi; | 464 | vdev->priv = vi; |
437 | 465 | ||
466 | /* If they give us a callback when all buffers are done, we don't need | ||
467 | * the timer. */ | ||
468 | vi->free_in_tasklet = virtio_has_feature(vdev,VIRTIO_F_NOTIFY_ON_EMPTY); | ||
469 | |||
438 | /* We expect two virtqueues, receive then send. */ | 470 | /* We expect two virtqueues, receive then send. */ |
439 | vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done); | 471 | vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done); |
440 | if (IS_ERR(vi->rvq)) { | 472 | if (IS_ERR(vi->rvq)) { |
@@ -454,6 +486,9 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
454 | 486 | ||
455 | tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi); | 487 | tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi); |
456 | 488 | ||
489 | if (!vi->free_in_tasklet) | ||
490 | setup_timer(&vi->xmit_free_timer, xmit_free, (unsigned long)vi); | ||
491 | |||
457 | err = register_netdev(dev); | 492 | err = register_netdev(dev); |
458 | if (err) { | 493 | if (err) { |
459 | pr_debug("virtio_net: registering device failed\n"); | 494 | pr_debug("virtio_net: registering device failed\n"); |
@@ -491,6 +526,9 @@ static void virtnet_remove(struct virtio_device *vdev) | |||
491 | /* Stop all the virtqueues. */ | 526 | /* Stop all the virtqueues. */ |
492 | vdev->config->reset(vdev); | 527 | vdev->config->reset(vdev); |
493 | 528 | ||
529 | if (!vi->free_in_tasklet) | ||
530 | del_timer_sync(&vi->xmit_free_timer); | ||
531 | |||
494 | /* Free our skbs in send and recv queues, if any. */ | 532 | /* Free our skbs in send and recv queues, if any. */ |
495 | while ((skb = __skb_dequeue(&vi->recv)) != NULL) { | 533 | while ((skb = __skb_dequeue(&vi->recv)) != NULL) { |
496 | kfree_skb(skb); | 534 | kfree_skb(skb); |
@@ -514,7 +552,7 @@ static struct virtio_device_id id_table[] = { | |||
514 | static unsigned int features[] = { | 552 | static unsigned int features[] = { |
515 | VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC, | 553 | VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC, |
516 | VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, | 554 | VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, |
517 | VIRTIO_NET_F_HOST_ECN, | 555 | VIRTIO_NET_F_HOST_ECN, VIRTIO_F_NOTIFY_ON_EMPTY, |
518 | }; | 556 | }; |
519 | 557 | ||
520 | static struct virtio_driver virtio_net = { | 558 | static struct virtio_driver virtio_net = { |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 729336774828..6e704608947c 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -1753,6 +1753,8 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) | |||
1753 | 1753 | ||
1754 | if (priv->workqueue) { | 1754 | if (priv->workqueue) { |
1755 | cancel_delayed_work(&priv->request_scan); | 1755 | cancel_delayed_work(&priv->request_scan); |
1756 | cancel_delayed_work(&priv->request_direct_scan); | ||
1757 | cancel_delayed_work(&priv->request_passive_scan); | ||
1756 | cancel_delayed_work(&priv->scan_event); | 1758 | cancel_delayed_work(&priv->scan_event); |
1757 | } | 1759 | } |
1758 | queue_work(priv->workqueue, &priv->down); | 1760 | queue_work(priv->workqueue, &priv->down); |
@@ -2005,6 +2007,8 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) | |||
2005 | wake_up_interruptible(&priv->wait_command_queue); | 2007 | wake_up_interruptible(&priv->wait_command_queue); |
2006 | priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); | 2008 | priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); |
2007 | cancel_delayed_work(&priv->request_scan); | 2009 | cancel_delayed_work(&priv->request_scan); |
2010 | cancel_delayed_work(&priv->request_direct_scan); | ||
2011 | cancel_delayed_work(&priv->request_passive_scan); | ||
2008 | cancel_delayed_work(&priv->scan_event); | 2012 | cancel_delayed_work(&priv->scan_event); |
2009 | schedule_work(&priv->link_down); | 2013 | schedule_work(&priv->link_down); |
2010 | queue_delayed_work(priv->workqueue, &priv->rf_kill, 2 * HZ); | 2014 | queue_delayed_work(priv->workqueue, &priv->rf_kill, 2 * HZ); |
@@ -4712,6 +4716,12 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4712 | priv->status &= ~STATUS_SCAN_FORCED; | 4716 | priv->status &= ~STATUS_SCAN_FORCED; |
4713 | #endif /* CONFIG_IPW2200_MONITOR */ | 4717 | #endif /* CONFIG_IPW2200_MONITOR */ |
4714 | 4718 | ||
4719 | /* Do queued direct scans first */ | ||
4720 | if (priv->status & STATUS_DIRECT_SCAN_PENDING) { | ||
4721 | queue_delayed_work(priv->workqueue, | ||
4722 | &priv->request_direct_scan, 0); | ||
4723 | } | ||
4724 | |||
4715 | if (!(priv->status & (STATUS_ASSOCIATED | | 4725 | if (!(priv->status & (STATUS_ASSOCIATED | |
4716 | STATUS_ASSOCIATING | | 4726 | STATUS_ASSOCIATING | |
4717 | STATUS_ROAMING | | 4727 | STATUS_ROAMING | |
@@ -6267,7 +6277,7 @@ static void ipw_add_scan_channels(struct ipw_priv *priv, | |||
6267 | } | 6277 | } |
6268 | } | 6278 | } |
6269 | 6279 | ||
6270 | static int ipw_request_scan_helper(struct ipw_priv *priv, int type) | 6280 | static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct) |
6271 | { | 6281 | { |
6272 | struct ipw_scan_request_ext scan; | 6282 | struct ipw_scan_request_ext scan; |
6273 | int err = 0, scan_type; | 6283 | int err = 0, scan_type; |
@@ -6278,22 +6288,31 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type) | |||
6278 | 6288 | ||
6279 | mutex_lock(&priv->mutex); | 6289 | mutex_lock(&priv->mutex); |
6280 | 6290 | ||
6291 | if (direct && (priv->direct_scan_ssid_len == 0)) { | ||
6292 | IPW_DEBUG_HC("Direct scan requested but no SSID to scan for\n"); | ||
6293 | priv->status &= ~STATUS_DIRECT_SCAN_PENDING; | ||
6294 | goto done; | ||
6295 | } | ||
6296 | |||
6281 | if (priv->status & STATUS_SCANNING) { | 6297 | if (priv->status & STATUS_SCANNING) { |
6282 | IPW_DEBUG_HC("Concurrent scan requested. Ignoring.\n"); | 6298 | IPW_DEBUG_HC("Concurrent scan requested. Queuing.\n"); |
6283 | priv->status |= STATUS_SCAN_PENDING; | 6299 | priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING : |
6300 | STATUS_SCAN_PENDING; | ||
6284 | goto done; | 6301 | goto done; |
6285 | } | 6302 | } |
6286 | 6303 | ||
6287 | if (!(priv->status & STATUS_SCAN_FORCED) && | 6304 | if (!(priv->status & STATUS_SCAN_FORCED) && |
6288 | priv->status & STATUS_SCAN_ABORTING) { | 6305 | priv->status & STATUS_SCAN_ABORTING) { |
6289 | IPW_DEBUG_HC("Scan request while abort pending. Queuing.\n"); | 6306 | IPW_DEBUG_HC("Scan request while abort pending. Queuing.\n"); |
6290 | priv->status |= STATUS_SCAN_PENDING; | 6307 | priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING : |
6308 | STATUS_SCAN_PENDING; | ||
6291 | goto done; | 6309 | goto done; |
6292 | } | 6310 | } |
6293 | 6311 | ||
6294 | if (priv->status & STATUS_RF_KILL_MASK) { | 6312 | if (priv->status & STATUS_RF_KILL_MASK) { |
6295 | IPW_DEBUG_HC("Aborting scan due to RF Kill activation\n"); | 6313 | IPW_DEBUG_HC("Queuing scan due to RF Kill activation\n"); |
6296 | priv->status |= STATUS_SCAN_PENDING; | 6314 | priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING : |
6315 | STATUS_SCAN_PENDING; | ||
6297 | goto done; | 6316 | goto done; |
6298 | } | 6317 | } |
6299 | 6318 | ||
@@ -6321,6 +6340,7 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type) | |||
6321 | cpu_to_le16(20); | 6340 | cpu_to_le16(20); |
6322 | 6341 | ||
6323 | scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120); | 6342 | scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120); |
6343 | scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20); | ||
6324 | 6344 | ||
6325 | #ifdef CONFIG_IPW2200_MONITOR | 6345 | #ifdef CONFIG_IPW2200_MONITOR |
6326 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { | 6346 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { |
@@ -6360,13 +6380,23 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type) | |||
6360 | cpu_to_le16(2000); | 6380 | cpu_to_le16(2000); |
6361 | } else { | 6381 | } else { |
6362 | #endif /* CONFIG_IPW2200_MONITOR */ | 6382 | #endif /* CONFIG_IPW2200_MONITOR */ |
6363 | /* If we are roaming, then make this a directed scan for the | 6383 | /* Honor direct scans first, otherwise if we are roaming make |
6364 | * current network. Otherwise, ensure that every other scan | 6384 | * this a direct scan for the current network. Finally, |
6365 | * is a fast channel hop scan */ | 6385 | * ensure that every other scan is a fast channel hop scan */ |
6366 | if ((priv->status & STATUS_ROAMING) | 6386 | if (direct) { |
6367 | || (!(priv->status & STATUS_ASSOCIATED) | 6387 | err = ipw_send_ssid(priv, priv->direct_scan_ssid, |
6368 | && (priv->config & CFG_STATIC_ESSID) | 6388 | priv->direct_scan_ssid_len); |
6369 | && (le32_to_cpu(scan.full_scan_index) % 2))) { | 6389 | if (err) { |
6390 | IPW_DEBUG_HC("Attempt to send SSID command " | ||
6391 | "failed\n"); | ||
6392 | goto done; | ||
6393 | } | ||
6394 | |||
6395 | scan_type = IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN; | ||
6396 | } else if ((priv->status & STATUS_ROAMING) | ||
6397 | || (!(priv->status & STATUS_ASSOCIATED) | ||
6398 | && (priv->config & CFG_STATIC_ESSID) | ||
6399 | && (le32_to_cpu(scan.full_scan_index) % 2))) { | ||
6370 | err = ipw_send_ssid(priv, priv->essid, priv->essid_len); | 6400 | err = ipw_send_ssid(priv, priv->essid, priv->essid_len); |
6371 | if (err) { | 6401 | if (err) { |
6372 | IPW_DEBUG_HC("Attempt to send SSID command " | 6402 | IPW_DEBUG_HC("Attempt to send SSID command " |
@@ -6391,7 +6421,12 @@ send_request: | |||
6391 | } | 6421 | } |
6392 | 6422 | ||
6393 | priv->status |= STATUS_SCANNING; | 6423 | priv->status |= STATUS_SCANNING; |
6394 | priv->status &= ~STATUS_SCAN_PENDING; | 6424 | if (direct) { |
6425 | priv->status &= ~STATUS_DIRECT_SCAN_PENDING; | ||
6426 | priv->direct_scan_ssid_len = 0; | ||
6427 | } else | ||
6428 | priv->status &= ~STATUS_SCAN_PENDING; | ||
6429 | |||
6395 | queue_delayed_work(priv->workqueue, &priv->scan_check, | 6430 | queue_delayed_work(priv->workqueue, &priv->scan_check, |
6396 | IPW_SCAN_CHECK_WATCHDOG); | 6431 | IPW_SCAN_CHECK_WATCHDOG); |
6397 | done: | 6432 | done: |
@@ -6402,15 +6437,22 @@ done: | |||
6402 | static void ipw_request_passive_scan(struct work_struct *work) | 6437 | static void ipw_request_passive_scan(struct work_struct *work) |
6403 | { | 6438 | { |
6404 | struct ipw_priv *priv = | 6439 | struct ipw_priv *priv = |
6405 | container_of(work, struct ipw_priv, request_passive_scan); | 6440 | container_of(work, struct ipw_priv, request_passive_scan.work); |
6406 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE); | 6441 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE, 0); |
6407 | } | 6442 | } |
6408 | 6443 | ||
6409 | static void ipw_request_scan(struct work_struct *work) | 6444 | static void ipw_request_scan(struct work_struct *work) |
6410 | { | 6445 | { |
6411 | struct ipw_priv *priv = | 6446 | struct ipw_priv *priv = |
6412 | container_of(work, struct ipw_priv, request_scan.work); | 6447 | container_of(work, struct ipw_priv, request_scan.work); |
6413 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE); | 6448 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE, 0); |
6449 | } | ||
6450 | |||
6451 | static void ipw_request_direct_scan(struct work_struct *work) | ||
6452 | { | ||
6453 | struct ipw_priv *priv = | ||
6454 | container_of(work, struct ipw_priv, request_direct_scan.work); | ||
6455 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE, 1); | ||
6414 | } | 6456 | } |
6415 | 6457 | ||
6416 | static void ipw_bg_abort_scan(struct work_struct *work) | 6458 | static void ipw_bg_abort_scan(struct work_struct *work) |
@@ -9477,99 +9519,38 @@ static int ipw_wx_get_retry(struct net_device *dev, | |||
9477 | return 0; | 9519 | return 0; |
9478 | } | 9520 | } |
9479 | 9521 | ||
9480 | static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid, | ||
9481 | int essid_len) | ||
9482 | { | ||
9483 | struct ipw_scan_request_ext scan; | ||
9484 | int err = 0, scan_type; | ||
9485 | |||
9486 | if (!(priv->status & STATUS_INIT) || | ||
9487 | (priv->status & STATUS_EXIT_PENDING)) | ||
9488 | return 0; | ||
9489 | |||
9490 | mutex_lock(&priv->mutex); | ||
9491 | |||
9492 | if (priv->status & STATUS_RF_KILL_MASK) { | ||
9493 | IPW_DEBUG_HC("Aborting scan due to RF kill activation\n"); | ||
9494 | priv->status |= STATUS_SCAN_PENDING; | ||
9495 | goto done; | ||
9496 | } | ||
9497 | |||
9498 | IPW_DEBUG_HC("starting request direct scan!\n"); | ||
9499 | |||
9500 | if (priv->status & (STATUS_SCANNING | STATUS_SCAN_ABORTING)) { | ||
9501 | /* We should not sleep here; otherwise we will block most | ||
9502 | * of the system (for instance, we hold rtnl_lock when we | ||
9503 | * get here). | ||
9504 | */ | ||
9505 | err = -EAGAIN; | ||
9506 | goto done; | ||
9507 | } | ||
9508 | memset(&scan, 0, sizeof(scan)); | ||
9509 | |||
9510 | if (priv->config & CFG_SPEED_SCAN) | ||
9511 | scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] = | ||
9512 | cpu_to_le16(30); | ||
9513 | else | ||
9514 | scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] = | ||
9515 | cpu_to_le16(20); | ||
9516 | |||
9517 | scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN] = | ||
9518 | cpu_to_le16(20); | ||
9519 | scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120); | ||
9520 | scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20); | ||
9521 | |||
9522 | scan.full_scan_index = cpu_to_le32(ieee80211_get_scans(priv->ieee)); | ||
9523 | |||
9524 | err = ipw_send_ssid(priv, essid, essid_len); | ||
9525 | if (err) { | ||
9526 | IPW_DEBUG_HC("Attempt to send SSID command failed\n"); | ||
9527 | goto done; | ||
9528 | } | ||
9529 | scan_type = IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN; | ||
9530 | |||
9531 | ipw_add_scan_channels(priv, &scan, scan_type); | ||
9532 | |||
9533 | err = ipw_send_scan_request_ext(priv, &scan); | ||
9534 | if (err) { | ||
9535 | IPW_DEBUG_HC("Sending scan command failed: %08X\n", err); | ||
9536 | goto done; | ||
9537 | } | ||
9538 | |||
9539 | priv->status |= STATUS_SCANNING; | ||
9540 | |||
9541 | done: | ||
9542 | mutex_unlock(&priv->mutex); | ||
9543 | return err; | ||
9544 | } | ||
9545 | |||
9546 | static int ipw_wx_set_scan(struct net_device *dev, | 9522 | static int ipw_wx_set_scan(struct net_device *dev, |
9547 | struct iw_request_info *info, | 9523 | struct iw_request_info *info, |
9548 | union iwreq_data *wrqu, char *extra) | 9524 | union iwreq_data *wrqu, char *extra) |
9549 | { | 9525 | { |
9550 | struct ipw_priv *priv = ieee80211_priv(dev); | 9526 | struct ipw_priv *priv = ieee80211_priv(dev); |
9551 | struct iw_scan_req *req = (struct iw_scan_req *)extra; | 9527 | struct iw_scan_req *req = (struct iw_scan_req *)extra; |
9528 | struct delayed_work *work = NULL; | ||
9552 | 9529 | ||
9553 | mutex_lock(&priv->mutex); | 9530 | mutex_lock(&priv->mutex); |
9531 | |||
9554 | priv->user_requested_scan = 1; | 9532 | priv->user_requested_scan = 1; |
9555 | mutex_unlock(&priv->mutex); | ||
9556 | 9533 | ||
9557 | if (wrqu->data.length == sizeof(struct iw_scan_req)) { | 9534 | if (wrqu->data.length == sizeof(struct iw_scan_req)) { |
9558 | if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { | 9535 | if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { |
9559 | ipw_request_direct_scan(priv, req->essid, | 9536 | int len = min((int)req->essid_len, |
9560 | req->essid_len); | 9537 | (int)sizeof(priv->direct_scan_ssid)); |
9561 | return 0; | 9538 | memcpy(priv->direct_scan_ssid, req->essid, len); |
9562 | } | 9539 | priv->direct_scan_ssid_len = len; |
9563 | if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { | 9540 | work = &priv->request_direct_scan; |
9564 | queue_work(priv->workqueue, | 9541 | } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { |
9565 | &priv->request_passive_scan); | 9542 | work = &priv->request_passive_scan; |
9566 | return 0; | ||
9567 | } | 9543 | } |
9544 | } else { | ||
9545 | /* Normal active broadcast scan */ | ||
9546 | work = &priv->request_scan; | ||
9568 | } | 9547 | } |
9569 | 9548 | ||
9549 | mutex_unlock(&priv->mutex); | ||
9550 | |||
9570 | IPW_DEBUG_WX("Start scan\n"); | 9551 | IPW_DEBUG_WX("Start scan\n"); |
9571 | 9552 | ||
9572 | queue_delayed_work(priv->workqueue, &priv->request_scan, 0); | 9553 | queue_delayed_work(priv->workqueue, work, 0); |
9573 | 9554 | ||
9574 | return 0; | 9555 | return 0; |
9575 | } | 9556 | } |
@@ -10731,6 +10712,8 @@ static void ipw_link_up(struct ipw_priv *priv) | |||
10731 | } | 10712 | } |
10732 | 10713 | ||
10733 | cancel_delayed_work(&priv->request_scan); | 10714 | cancel_delayed_work(&priv->request_scan); |
10715 | cancel_delayed_work(&priv->request_direct_scan); | ||
10716 | cancel_delayed_work(&priv->request_passive_scan); | ||
10734 | cancel_delayed_work(&priv->scan_event); | 10717 | cancel_delayed_work(&priv->scan_event); |
10735 | ipw_reset_stats(priv); | 10718 | ipw_reset_stats(priv); |
10736 | /* Ensure the rate is updated immediately */ | 10719 | /* Ensure the rate is updated immediately */ |
@@ -10761,6 +10744,8 @@ static void ipw_link_down(struct ipw_priv *priv) | |||
10761 | 10744 | ||
10762 | /* Cancel any queued work ... */ | 10745 | /* Cancel any queued work ... */ |
10763 | cancel_delayed_work(&priv->request_scan); | 10746 | cancel_delayed_work(&priv->request_scan); |
10747 | cancel_delayed_work(&priv->request_direct_scan); | ||
10748 | cancel_delayed_work(&priv->request_passive_scan); | ||
10764 | cancel_delayed_work(&priv->adhoc_check); | 10749 | cancel_delayed_work(&priv->adhoc_check); |
10765 | cancel_delayed_work(&priv->gather_stats); | 10750 | cancel_delayed_work(&priv->gather_stats); |
10766 | 10751 | ||
@@ -10800,8 +10785,9 @@ static int __devinit ipw_setup_deferred_work(struct ipw_priv *priv) | |||
10800 | INIT_WORK(&priv->up, ipw_bg_up); | 10785 | INIT_WORK(&priv->up, ipw_bg_up); |
10801 | INIT_WORK(&priv->down, ipw_bg_down); | 10786 | INIT_WORK(&priv->down, ipw_bg_down); |
10802 | INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan); | 10787 | INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan); |
10788 | INIT_DELAYED_WORK(&priv->request_direct_scan, ipw_request_direct_scan); | ||
10789 | INIT_DELAYED_WORK(&priv->request_passive_scan, ipw_request_passive_scan); | ||
10803 | INIT_DELAYED_WORK(&priv->scan_event, ipw_scan_event); | 10790 | INIT_DELAYED_WORK(&priv->scan_event, ipw_scan_event); |
10804 | INIT_WORK(&priv->request_passive_scan, ipw_request_passive_scan); | ||
10805 | INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats); | 10791 | INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats); |
10806 | INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan); | 10792 | INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan); |
10807 | INIT_WORK(&priv->roam, ipw_bg_roam); | 10793 | INIT_WORK(&priv->roam, ipw_bg_roam); |
@@ -11835,6 +11821,8 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev) | |||
11835 | cancel_delayed_work(&priv->adhoc_check); | 11821 | cancel_delayed_work(&priv->adhoc_check); |
11836 | cancel_delayed_work(&priv->gather_stats); | 11822 | cancel_delayed_work(&priv->gather_stats); |
11837 | cancel_delayed_work(&priv->request_scan); | 11823 | cancel_delayed_work(&priv->request_scan); |
11824 | cancel_delayed_work(&priv->request_direct_scan); | ||
11825 | cancel_delayed_work(&priv->request_passive_scan); | ||
11838 | cancel_delayed_work(&priv->scan_event); | 11826 | cancel_delayed_work(&priv->scan_event); |
11839 | cancel_delayed_work(&priv->rf_kill); | 11827 | cancel_delayed_work(&priv->rf_kill); |
11840 | cancel_delayed_work(&priv->scan_check); | 11828 | cancel_delayed_work(&priv->scan_check); |
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index cd3295b66dd6..d4ab28b73b32 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h | |||
@@ -1037,6 +1037,7 @@ struct ipw_cmd { /* XXX */ | |||
1037 | #define STATUS_DISASSOC_PENDING (1<<12) | 1037 | #define STATUS_DISASSOC_PENDING (1<<12) |
1038 | #define STATUS_STATE_PENDING (1<<13) | 1038 | #define STATUS_STATE_PENDING (1<<13) |
1039 | 1039 | ||
1040 | #define STATUS_DIRECT_SCAN_PENDING (1<<19) | ||
1040 | #define STATUS_SCAN_PENDING (1<<20) | 1041 | #define STATUS_SCAN_PENDING (1<<20) |
1041 | #define STATUS_SCANNING (1<<21) | 1042 | #define STATUS_SCANNING (1<<21) |
1042 | #define STATUS_SCAN_ABORTING (1<<22) | 1043 | #define STATUS_SCAN_ABORTING (1<<22) |
@@ -1292,6 +1293,8 @@ struct ipw_priv { | |||
1292 | struct iw_public_data wireless_data; | 1293 | struct iw_public_data wireless_data; |
1293 | 1294 | ||
1294 | int user_requested_scan; | 1295 | int user_requested_scan; |
1296 | u8 direct_scan_ssid[IW_ESSID_MAX_SIZE]; | ||
1297 | u8 direct_scan_ssid_len; | ||
1295 | 1298 | ||
1296 | struct workqueue_struct *workqueue; | 1299 | struct workqueue_struct *workqueue; |
1297 | 1300 | ||
@@ -1301,8 +1304,9 @@ struct ipw_priv { | |||
1301 | struct work_struct system_config; | 1304 | struct work_struct system_config; |
1302 | struct work_struct rx_replenish; | 1305 | struct work_struct rx_replenish; |
1303 | struct delayed_work request_scan; | 1306 | struct delayed_work request_scan; |
1307 | struct delayed_work request_direct_scan; | ||
1308 | struct delayed_work request_passive_scan; | ||
1304 | struct delayed_work scan_event; | 1309 | struct delayed_work scan_event; |
1305 | struct work_struct request_passive_scan; | ||
1306 | struct work_struct adapter_restart; | 1310 | struct work_struct adapter_restart; |
1307 | struct delayed_work rf_kill; | 1311 | struct delayed_work rf_kill; |
1308 | struct work_struct up; | 1312 | struct work_struct up; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c index d200d08fb086..8b1528e52d43 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c | |||
@@ -229,14 +229,15 @@ static int iwl3945_led_register_led(struct iwl3945_priv *priv, | |||
229 | led->led_dev.brightness_set = iwl3945_led_brightness_set; | 229 | led->led_dev.brightness_set = iwl3945_led_brightness_set; |
230 | led->led_dev.default_trigger = trigger; | 230 | led->led_dev.default_trigger = trigger; |
231 | 231 | ||
232 | led->priv = priv; | ||
233 | led->type = type; | ||
234 | |||
232 | ret = led_classdev_register(device, &led->led_dev); | 235 | ret = led_classdev_register(device, &led->led_dev); |
233 | if (ret) { | 236 | if (ret) { |
234 | IWL_ERROR("Error: failed to register led handler.\n"); | 237 | IWL_ERROR("Error: failed to register led handler.\n"); |
235 | return ret; | 238 | return ret; |
236 | } | 239 | } |
237 | 240 | ||
238 | led->priv = priv; | ||
239 | led->type = type; | ||
240 | led->registered = 1; | 241 | led->registered = 1; |
241 | 242 | ||
242 | if (set_led && led->led_on) | 243 | if (set_led && led->led_on) |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 6328b9593877..8124fd9b1353 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1842,6 +1842,9 @@ static void lbs_send_confirmsleep(struct lbs_private *priv) | |||
1842 | 1842 | ||
1843 | spin_lock_irqsave(&priv->driver_lock, flags); | 1843 | spin_lock_irqsave(&priv->driver_lock, flags); |
1844 | 1844 | ||
1845 | /* We don't get a response on the sleep-confirmation */ | ||
1846 | priv->dnld_sent = DNLD_RES_RECEIVED; | ||
1847 | |||
1845 | /* If nothing to do, go back to sleep (?) */ | 1848 | /* If nothing to do, go back to sleep (?) */ |
1846 | if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx]) | 1849 | if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx]) |
1847 | priv->psstate = PS_STATE_SLEEP; | 1850 | priv->psstate = PS_STATE_SLEEP; |
@@ -1904,12 +1907,12 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv) | |||
1904 | 1907 | ||
1905 | lbs_deb_enter(LBS_DEB_HOST); | 1908 | lbs_deb_enter(LBS_DEB_HOST); |
1906 | 1909 | ||
1910 | spin_lock_irqsave(&priv->driver_lock, flags); | ||
1907 | if (priv->dnld_sent) { | 1911 | if (priv->dnld_sent) { |
1908 | allowed = 0; | 1912 | allowed = 0; |
1909 | lbs_deb_host("dnld_sent was set\n"); | 1913 | lbs_deb_host("dnld_sent was set\n"); |
1910 | } | 1914 | } |
1911 | 1915 | ||
1912 | spin_lock_irqsave(&priv->driver_lock, flags); | ||
1913 | /* In-progress command? */ | 1916 | /* In-progress command? */ |
1914 | if (priv->cur_cmd) { | 1917 | if (priv->cur_cmd) { |
1915 | allowed = 0; | 1918 | allowed = 0; |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index e1f066068590..acfc4bfcc262 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -732,8 +732,8 @@ static int lbs_thread(void *data) | |||
732 | lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n", | 732 | lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n", |
733 | priv->currenttxskb, priv->dnld_sent); | 733 | priv->currenttxskb, priv->dnld_sent); |
734 | 734 | ||
735 | spin_lock_irq(&priv->driver_lock); | ||
736 | /* Process any pending command response */ | 735 | /* Process any pending command response */ |
736 | spin_lock_irq(&priv->driver_lock); | ||
737 | resp_idx = priv->resp_idx; | 737 | resp_idx = priv->resp_idx; |
738 | if (priv->resp_len[resp_idx]) { | 738 | if (priv->resp_len[resp_idx]) { |
739 | spin_unlock_irq(&priv->driver_lock); | 739 | spin_unlock_irq(&priv->driver_lock); |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 6424e5a2c83d..418606ac1c3b 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -719,7 +719,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length) | |||
719 | fc = le16_to_cpu(*((__le16 *) buffer)); | 719 | fc = le16_to_cpu(*((__le16 *) buffer)); |
720 | 720 | ||
721 | is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && | 721 | is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && |
722 | ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_QOS_DATA); | 722 | (fc & IEEE80211_STYPE_QOS_DATA); |
723 | is_4addr = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == | 723 | is_4addr = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == |
724 | (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); | 724 | (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); |
725 | need_padding = is_qos ^ is_4addr; | 725 | need_padding = is_qos ^ is_4addr; |
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c index 715a44471617..b2ccdcbeb896 100644 --- a/drivers/of/of_i2c.c +++ b/drivers/of/of_i2c.c | |||
@@ -21,7 +21,6 @@ struct i2c_driver_device { | |||
21 | }; | 21 | }; |
22 | 22 | ||
23 | static struct i2c_driver_device i2c_devices[] = { | 23 | static struct i2c_driver_device i2c_devices[] = { |
24 | { "dallas,ds1374", "rtc-ds1374" }, | ||
25 | }; | 24 | }; |
26 | 25 | ||
27 | static int of_find_i2c_driver(struct device_node *node, | 26 | static int of_find_i2c_driver(struct device_node *node, |
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 0201c8adfda7..46c791adb894 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -50,15 +50,17 @@ static int irq_flags(int triggering, int polarity, int shareable) | |||
50 | flags = IORESOURCE_IRQ_HIGHEDGE; | 50 | flags = IORESOURCE_IRQ_HIGHEDGE; |
51 | } | 51 | } |
52 | 52 | ||
53 | if (shareable) | 53 | if (shareable == ACPI_SHARED) |
54 | flags |= IORESOURCE_IRQ_SHAREABLE; | 54 | flags |= IORESOURCE_IRQ_SHAREABLE; |
55 | 55 | ||
56 | return flags; | 56 | return flags; |
57 | } | 57 | } |
58 | 58 | ||
59 | static void decode_irq_flags(int flag, int *triggering, int *polarity) | 59 | static void decode_irq_flags(struct pnp_dev *dev, int flags, int *triggering, |
60 | int *polarity, int *shareable) | ||
60 | { | 61 | { |
61 | switch (flag) { | 62 | switch (flags & (IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_HIGHLEVEL | |
63 | IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE)) { | ||
62 | case IORESOURCE_IRQ_LOWLEVEL: | 64 | case IORESOURCE_IRQ_LOWLEVEL: |
63 | *triggering = ACPI_LEVEL_SENSITIVE; | 65 | *triggering = ACPI_LEVEL_SENSITIVE; |
64 | *polarity = ACPI_ACTIVE_LOW; | 66 | *polarity = ACPI_ACTIVE_LOW; |
@@ -75,7 +77,18 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity) | |||
75 | *triggering = ACPI_EDGE_SENSITIVE; | 77 | *triggering = ACPI_EDGE_SENSITIVE; |
76 | *polarity = ACPI_ACTIVE_HIGH; | 78 | *polarity = ACPI_ACTIVE_HIGH; |
77 | break; | 79 | break; |
80 | default: | ||
81 | dev_err(&dev->dev, "can't encode invalid IRQ mode %#x\n", | ||
82 | flags); | ||
83 | *triggering = ACPI_EDGE_SENSITIVE; | ||
84 | *polarity = ACPI_ACTIVE_HIGH; | ||
85 | break; | ||
78 | } | 86 | } |
87 | |||
88 | if (flags & IORESOURCE_IRQ_SHAREABLE) | ||
89 | *shareable = ACPI_SHARED; | ||
90 | else | ||
91 | *shareable = ACPI_EXCLUSIVE; | ||
79 | } | 92 | } |
80 | 93 | ||
81 | static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev, | 94 | static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev, |
@@ -742,6 +755,9 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data) | |||
742 | if (pnpacpi_supported_resource(res)) { | 755 | if (pnpacpi_supported_resource(res)) { |
743 | (*resource)->type = res->type; | 756 | (*resource)->type = res->type; |
744 | (*resource)->length = sizeof(struct acpi_resource); | 757 | (*resource)->length = sizeof(struct acpi_resource); |
758 | if (res->type == ACPI_RESOURCE_TYPE_IRQ) | ||
759 | (*resource)->data.irq.descriptor_length = | ||
760 | res->data.irq.descriptor_length; | ||
745 | (*resource)++; | 761 | (*resource)++; |
746 | } | 762 | } |
747 | 763 | ||
@@ -788,22 +804,21 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev, | |||
788 | struct resource *p) | 804 | struct resource *p) |
789 | { | 805 | { |
790 | struct acpi_resource_irq *irq = &resource->data.irq; | 806 | struct acpi_resource_irq *irq = &resource->data.irq; |
791 | int triggering, polarity; | 807 | int triggering, polarity, shareable; |
792 | 808 | ||
793 | decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity); | 809 | decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable); |
794 | irq->triggering = triggering; | 810 | irq->triggering = triggering; |
795 | irq->polarity = polarity; | 811 | irq->polarity = polarity; |
796 | if (triggering == ACPI_EDGE_SENSITIVE) | 812 | irq->sharable = shareable; |
797 | irq->sharable = ACPI_EXCLUSIVE; | ||
798 | else | ||
799 | irq->sharable = ACPI_SHARED; | ||
800 | irq->interrupt_count = 1; | 813 | irq->interrupt_count = 1; |
801 | irq->interrupts[0] = p->start; | 814 | irq->interrupts[0] = p->start; |
802 | 815 | ||
803 | dev_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start, | 816 | dev_dbg(&dev->dev, " encode irq %d %s %s %s (%d-byte descriptor)\n", |
817 | (int) p->start, | ||
804 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", | 818 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", |
805 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", | 819 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", |
806 | irq->sharable == ACPI_SHARED ? "shared" : "exclusive"); | 820 | irq->sharable == ACPI_SHARED ? "shared" : "exclusive", |
821 | irq->descriptor_length); | ||
807 | } | 822 | } |
808 | 823 | ||
809 | static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, | 824 | static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, |
@@ -811,16 +826,13 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, | |||
811 | struct resource *p) | 826 | struct resource *p) |
812 | { | 827 | { |
813 | struct acpi_resource_extended_irq *extended_irq = &resource->data.extended_irq; | 828 | struct acpi_resource_extended_irq *extended_irq = &resource->data.extended_irq; |
814 | int triggering, polarity; | 829 | int triggering, polarity, shareable; |
815 | 830 | ||
816 | decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity); | 831 | decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable); |
817 | extended_irq->producer_consumer = ACPI_CONSUMER; | 832 | extended_irq->producer_consumer = ACPI_CONSUMER; |
818 | extended_irq->triggering = triggering; | 833 | extended_irq->triggering = triggering; |
819 | extended_irq->polarity = polarity; | 834 | extended_irq->polarity = polarity; |
820 | if (triggering == ACPI_EDGE_SENSITIVE) | 835 | extended_irq->sharable = shareable; |
821 | extended_irq->sharable = ACPI_EXCLUSIVE; | ||
822 | else | ||
823 | extended_irq->sharable = ACPI_SHARED; | ||
824 | extended_irq->interrupt_count = 1; | 836 | extended_irq->interrupt_count = 1; |
825 | extended_irq->interrupts[0] = p->start; | 837 | extended_irq->interrupts[0] = p->start; |
826 | 838 | ||
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index c444d6b10c58..49215da5249b 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c | |||
@@ -201,7 +201,7 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
201 | 201 | ||
202 | dev_dbg(dev, "uevent\n"); | 202 | dev_dbg(dev, "uevent\n"); |
203 | 203 | ||
204 | if (!psy) { | 204 | if (!psy || !psy->dev) { |
205 | dev_dbg(dev, "No power supply yet\n"); | 205 | dev_dbg(dev, "No power supply yet\n"); |
206 | return ret; | 206 | return ret; |
207 | } | 207 | } |
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 6cc2c0330230..60f8afc7a56e 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -534,4 +534,12 @@ config RTC_DRV_RS5C313 | |||
534 | help | 534 | help |
535 | If you say yes here you get support for the Ricoh RS5C313 RTC chips. | 535 | If you say yes here you get support for the Ricoh RS5C313 RTC chips. |
536 | 536 | ||
537 | config RTC_DRV_PPC | ||
538 | tristate "PowerPC machine dependent RTC support" | ||
539 | depends on PPC_MERGE | ||
540 | help | ||
541 | The PowerPC kernel has machine-specific functions for accessing | ||
542 | the RTC. This exposes that functionality through the generic RTC | ||
543 | class. | ||
544 | |||
537 | endif # RTC_CLASS | 545 | endif # RTC_CLASS |
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 872f1218ff9f..ebe871cf16c1 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile | |||
@@ -54,3 +54,4 @@ obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o | |||
54 | obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o | 54 | obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o |
55 | obj-$(CONFIG_RTC_DRV_VR41XX) += rtc-vr41xx.o | 55 | obj-$(CONFIG_RTC_DRV_VR41XX) += rtc-vr41xx.o |
56 | obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o | 56 | obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o |
57 | obj-$(CONFIG_RTC_DRV_PPC) += rtc-ppc.o | ||
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index fa2d2f8b3f4d..640acd20fdde 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #define DS1374_REG_TCR 0x09 /* Trickle Charge */ | 42 | #define DS1374_REG_TCR 0x09 /* Trickle Charge */ |
43 | 43 | ||
44 | static const struct i2c_device_id ds1374_id[] = { | 44 | static const struct i2c_device_id ds1374_id[] = { |
45 | { "rtc-ds1374", 0 }, | 45 | { "ds1374", 0 }, |
46 | { } | 46 | { } |
47 | }; | 47 | }; |
48 | MODULE_DEVICE_TABLE(i2c, ds1374_id); | 48 | MODULE_DEVICE_TABLE(i2c, ds1374_id); |
diff --git a/drivers/rtc/rtc-ppc.c b/drivers/rtc/rtc-ppc.c new file mode 100644 index 000000000000..c8e97e25ef7e --- /dev/null +++ b/drivers/rtc/rtc-ppc.c | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * RTC driver for ppc_md RTC functions | ||
3 | * | ||
4 | * © 2007 Red Hat, Inc. | ||
5 | * | ||
6 | * Author: David Woodhouse <dwmw2@infradead.org> | ||
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 version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/err.h> | ||
16 | #include <linux/rtc.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <asm/machdep.h> | ||
19 | |||
20 | static int ppc_rtc_read_time(struct device *dev, struct rtc_time *tm) | ||
21 | { | ||
22 | ppc_md.get_rtc_time(tm); | ||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | static int ppc_rtc_set_time(struct device *dev, struct rtc_time *tm) | ||
27 | { | ||
28 | return ppc_md.set_rtc_time(tm); | ||
29 | } | ||
30 | |||
31 | static const struct rtc_class_ops ppc_rtc_ops = { | ||
32 | .set_time = ppc_rtc_set_time, | ||
33 | .read_time = ppc_rtc_read_time, | ||
34 | }; | ||
35 | |||
36 | static struct rtc_device *rtc; | ||
37 | static struct platform_device *ppc_rtc_pdev; | ||
38 | |||
39 | static int __init ppc_rtc_init(void) | ||
40 | { | ||
41 | if (!ppc_md.get_rtc_time || !ppc_md.set_rtc_time) | ||
42 | return -ENODEV; | ||
43 | |||
44 | ppc_rtc_pdev = platform_device_register_simple("ppc-rtc", 0, NULL, 0); | ||
45 | if (IS_ERR(ppc_rtc_pdev)) | ||
46 | return PTR_ERR(ppc_rtc_pdev); | ||
47 | |||
48 | rtc = rtc_device_register("ppc_md", &ppc_rtc_pdev->dev, | ||
49 | &ppc_rtc_ops, THIS_MODULE); | ||
50 | if (IS_ERR(rtc)) { | ||
51 | platform_device_unregister(ppc_rtc_pdev); | ||
52 | return PTR_ERR(rtc); | ||
53 | } | ||
54 | |||
55 | return 0; | ||
56 | } | ||
57 | |||
58 | static void __exit ppc_rtc_exit(void) | ||
59 | { | ||
60 | rtc_device_unregister(rtc); | ||
61 | platform_device_unregister(ppc_rtc_pdev); | ||
62 | } | ||
63 | |||
64 | module_init(ppc_rtc_init); | ||
65 | module_exit(ppc_rtc_exit); | ||
66 | |||
67 | MODULE_LICENSE("GPL"); | ||
68 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); | ||
69 | MODULE_DESCRIPTION("Generic RTC class driver for PowerPC"); | ||
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index 62576af36f47..3e577f655b18 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c | |||
@@ -773,6 +773,7 @@ sclp_vt220_con_init(void) | |||
773 | { | 773 | { |
774 | int rc; | 774 | int rc; |
775 | 775 | ||
776 | INIT_LIST_HEAD(&sclp_vt220_register.list); | ||
776 | if (!CONSOLE_IS_SCLP) | 777 | if (!CONSOLE_IS_SCLP) |
777 | return 0; | 778 | return 0; |
778 | rc = __sclp_vt220_init(); | 779 | rc = __sclp_vt220_init(); |
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index 8246ef3ab095..42ce7915fc5d 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c | |||
@@ -1598,7 +1598,7 @@ tape_3590_setup_device(struct tape_device *device) | |||
1598 | rc = tape_3590_read_dev_chars(device, rdc_data); | 1598 | rc = tape_3590_read_dev_chars(device, rdc_data); |
1599 | if (rc) { | 1599 | if (rc) { |
1600 | DBF_LH(3, "Read device characteristics failed!\n"); | 1600 | DBF_LH(3, "Read device characteristics failed!\n"); |
1601 | goto fail_kmalloc; | 1601 | goto fail_rdc_data; |
1602 | } | 1602 | } |
1603 | rc = tape_std_assign(device); | 1603 | rc = tape_std_assign(device); |
1604 | if (rc) | 1604 | if (rc) |
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index a4a5f2efea48..0bfcbbe375c4 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c | |||
@@ -97,8 +97,8 @@ static int pure_hex(char **cp, unsigned int *val, int min_digit, | |||
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | 99 | ||
100 | static int parse_busid(char *str, int *cssid, int *ssid, int *devno, | 100 | static int parse_busid(char *str, unsigned int *cssid, unsigned int *ssid, |
101 | int msgtrigger) | 101 | unsigned int *devno, int msgtrigger) |
102 | { | 102 | { |
103 | char *str_work; | 103 | char *str_work; |
104 | int val, rc, ret; | 104 | int val, rc, ret; |
@@ -148,7 +148,7 @@ out: | |||
148 | static int blacklist_parse_parameters(char *str, range_action action, | 148 | static int blacklist_parse_parameters(char *str, range_action action, |
149 | int msgtrigger) | 149 | int msgtrigger) |
150 | { | 150 | { |
151 | int from_cssid, to_cssid, from_ssid, to_ssid, from, to; | 151 | unsigned int from_cssid, to_cssid, from_ssid, to_ssid, from, to; |
152 | int rc, totalrc; | 152 | int rc, totalrc; |
153 | char *parm; | 153 | char *parm; |
154 | range_action ra; | 154 | range_action ra; |
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 82c6a2d45128..b32d7eb3d81a 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -576,12 +576,14 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid) | |||
576 | err = -ENODEV; | 576 | err = -ENODEV; |
577 | goto out; | 577 | goto out; |
578 | } | 578 | } |
579 | if (cio_is_console(sch->schid)) | 579 | if (cio_is_console(sch->schid)) { |
580 | sch->opm = 0xff; | 580 | sch->opm = 0xff; |
581 | else | 581 | sch->isc = 1; |
582 | } else { | ||
582 | sch->opm = chp_get_sch_opm(sch); | 583 | sch->opm = chp_get_sch_opm(sch); |
584 | sch->isc = 3; | ||
585 | } | ||
583 | sch->lpm = sch->schib.pmcw.pam & sch->opm; | 586 | sch->lpm = sch->schib.pmcw.pam & sch->opm; |
584 | sch->isc = 3; | ||
585 | 587 | ||
586 | CIO_MSG_EVENT(6, "Detected device %04x on subchannel 0.%x.%04X " | 588 | CIO_MSG_EVENT(6, "Detected device %04x on subchannel 0.%x.%04X " |
587 | "- PIM = %02X, PAM = %02X, POM = %02X\n", | 589 | "- PIM = %02X, PAM = %02X, POM = %02X\n", |
@@ -704,9 +706,9 @@ void wait_cons_dev(void) | |||
704 | if (!console_subchannel_in_use) | 706 | if (!console_subchannel_in_use) |
705 | return; | 707 | return; |
706 | 708 | ||
707 | /* disable all but isc 7 (console device) */ | 709 | /* disable all but isc 1 (console device) */ |
708 | __ctl_store (save_cr6, 6, 6); | 710 | __ctl_store (save_cr6, 6, 6); |
709 | cr6 = 0x01000000; | 711 | cr6 = 0x40000000; |
710 | __ctl_load (cr6, 6, 6); | 712 | __ctl_load (cr6, 6, 6); |
711 | 713 | ||
712 | do { | 714 | do { |
@@ -788,11 +790,11 @@ cio_probe_console(void) | |||
788 | } | 790 | } |
789 | 791 | ||
790 | /* | 792 | /* |
791 | * enable console I/O-interrupt subclass 7 | 793 | * enable console I/O-interrupt subclass 1 |
792 | */ | 794 | */ |
793 | ctl_set_bit(6, 24); | 795 | ctl_set_bit(6, 30); |
794 | console_subchannel.isc = 7; | 796 | console_subchannel.isc = 1; |
795 | console_subchannel.schib.pmcw.isc = 7; | 797 | console_subchannel.schib.pmcw.isc = 1; |
796 | console_subchannel.schib.pmcw.intparm = | 798 | console_subchannel.schib.pmcw.intparm = |
797 | (u32)(addr_t)&console_subchannel; | 799 | (u32)(addr_t)&console_subchannel; |
798 | ret = cio_modify(&console_subchannel); | 800 | ret = cio_modify(&console_subchannel); |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 436bf1f6d4a6..9a71dae223e8 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -290,9 +290,6 @@ int qeth_set_large_send(struct qeth_card *card, | |||
290 | card->dev->features |= NETIF_F_TSO | NETIF_F_SG | | 290 | card->dev->features |= NETIF_F_TSO | NETIF_F_SG | |
291 | NETIF_F_HW_CSUM; | 291 | NETIF_F_HW_CSUM; |
292 | } else { | 292 | } else { |
293 | PRINT_WARN("TSO not supported on %s. " | ||
294 | "large_send set to 'no'.\n", | ||
295 | card->dev->name); | ||
296 | card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | | 293 | card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | |
297 | NETIF_F_HW_CSUM); | 294 | NETIF_F_HW_CSUM); |
298 | card->options.large_send = QETH_LARGE_SEND_NO; | 295 | card->options.large_send = QETH_LARGE_SEND_NO; |
@@ -1407,12 +1404,6 @@ static void qeth_init_func_level(struct qeth_card *card) | |||
1407 | } | 1404 | } |
1408 | } | 1405 | } |
1409 | 1406 | ||
1410 | static inline __u16 qeth_raw_devno_from_bus_id(char *id) | ||
1411 | { | ||
1412 | id += (strlen(id) - 4); | ||
1413 | return (__u16) simple_strtoul(id, &id, 16); | ||
1414 | } | ||
1415 | |||
1416 | static int qeth_idx_activate_get_answer(struct qeth_channel *channel, | 1407 | static int qeth_idx_activate_get_answer(struct qeth_channel *channel, |
1417 | void (*idx_reply_cb)(struct qeth_channel *, | 1408 | void (*idx_reply_cb)(struct qeth_channel *, |
1418 | struct qeth_cmd_buffer *)) | 1409 | struct qeth_cmd_buffer *)) |
@@ -1439,7 +1430,7 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel, | |||
1439 | spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); | 1430 | spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); |
1440 | 1431 | ||
1441 | if (rc) { | 1432 | if (rc) { |
1442 | PRINT_ERR("Error2 in activating channel rc=%d\n", rc); | 1433 | QETH_DBF_MESSAGE(2, "Error2 in activating channel rc=%d\n", rc); |
1443 | QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); | 1434 | QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); |
1444 | atomic_set(&channel->irq_pending, 0); | 1435 | atomic_set(&channel->irq_pending, 0); |
1445 | wake_up(&card->wait_q); | 1436 | wake_up(&card->wait_q); |
@@ -1468,6 +1459,7 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel, | |||
1468 | __u16 temp; | 1459 | __u16 temp; |
1469 | __u8 tmp; | 1460 | __u8 tmp; |
1470 | int rc; | 1461 | int rc; |
1462 | struct ccw_dev_id temp_devid; | ||
1471 | 1463 | ||
1472 | card = CARD_FROM_CDEV(channel->ccwdev); | 1464 | card = CARD_FROM_CDEV(channel->ccwdev); |
1473 | 1465 | ||
@@ -1494,8 +1486,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel, | |||
1494 | &card->token.issuer_rm_w, QETH_MPC_TOKEN_LENGTH); | 1486 | &card->token.issuer_rm_w, QETH_MPC_TOKEN_LENGTH); |
1495 | memcpy(QETH_IDX_ACT_FUNC_LEVEL(iob->data), | 1487 | memcpy(QETH_IDX_ACT_FUNC_LEVEL(iob->data), |
1496 | &card->info.func_level, sizeof(__u16)); | 1488 | &card->info.func_level, sizeof(__u16)); |
1497 | temp = qeth_raw_devno_from_bus_id(CARD_DDEV_ID(card)); | 1489 | ccw_device_get_id(CARD_DDEV(card), &temp_devid); |
1498 | memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp, 2); | 1490 | memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp_devid.devno, 2); |
1499 | temp = (card->info.cula << 8) + card->info.unit_addr2; | 1491 | temp = (card->info.cula << 8) + card->info.unit_addr2; |
1500 | memcpy(QETH_IDX_ACT_QDIO_DEV_REALADDR(iob->data), &temp, 2); | 1492 | memcpy(QETH_IDX_ACT_QDIO_DEV_REALADDR(iob->data), &temp, 2); |
1501 | 1493 | ||
@@ -1508,7 +1500,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel, | |||
1508 | spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); | 1500 | spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); |
1509 | 1501 | ||
1510 | if (rc) { | 1502 | if (rc) { |
1511 | PRINT_ERR("Error1 in activating channel. rc=%d\n", rc); | 1503 | QETH_DBF_MESSAGE(2, "Error1 in activating channel. rc=%d\n", |
1504 | rc); | ||
1512 | QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); | 1505 | QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); |
1513 | atomic_set(&channel->irq_pending, 0); | 1506 | atomic_set(&channel->irq_pending, 0); |
1514 | wake_up(&card->wait_q); | 1507 | wake_up(&card->wait_q); |
@@ -1658,7 +1651,6 @@ int qeth_send_control_data(struct qeth_card *card, int len, | |||
1658 | 1651 | ||
1659 | reply = qeth_alloc_reply(card); | 1652 | reply = qeth_alloc_reply(card); |
1660 | if (!reply) { | 1653 | if (!reply) { |
1661 | PRINT_WARN("Could not alloc qeth_reply!\n"); | ||
1662 | return -ENOMEM; | 1654 | return -ENOMEM; |
1663 | } | 1655 | } |
1664 | reply->callback = reply_cb; | 1656 | reply->callback = reply_cb; |
@@ -2612,15 +2604,9 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index) | |||
2612 | if (newcount < count) { | 2604 | if (newcount < count) { |
2613 | /* we are in memory shortage so we switch back to | 2605 | /* we are in memory shortage so we switch back to |
2614 | traditional skb allocation and drop packages */ | 2606 | traditional skb allocation and drop packages */ |
2615 | if (!atomic_read(&card->force_alloc_skb) && | ||
2616 | net_ratelimit()) | ||
2617 | PRINT_WARN("Switch to alloc skb\n"); | ||
2618 | atomic_set(&card->force_alloc_skb, 3); | 2607 | atomic_set(&card->force_alloc_skb, 3); |
2619 | count = newcount; | 2608 | count = newcount; |
2620 | } else { | 2609 | } else { |
2621 | if ((atomic_read(&card->force_alloc_skb) == 1) && | ||
2622 | net_ratelimit()) | ||
2623 | PRINT_WARN("Switch to sg\n"); | ||
2624 | atomic_add_unless(&card->force_alloc_skb, -1, 0); | 2610 | atomic_add_unless(&card->force_alloc_skb, -1, 0); |
2625 | } | 2611 | } |
2626 | 2612 | ||
@@ -3034,7 +3020,7 @@ int qeth_get_elements_no(struct qeth_card *card, void *hdr, | |||
3034 | elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) | 3020 | elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) |
3035 | + skb->len) >> PAGE_SHIFT); | 3021 | + skb->len) >> PAGE_SHIFT); |
3036 | if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) { | 3022 | if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) { |
3037 | PRINT_ERR("Invalid size of IP packet " | 3023 | QETH_DBF_MESSAGE(2, "Invalid size of IP packet " |
3038 | "(Number=%d / Length=%d). Discarded.\n", | 3024 | "(Number=%d / Length=%d). Discarded.\n", |
3039 | (elements_needed+elems), skb->len); | 3025 | (elements_needed+elems), skb->len); |
3040 | return 0; | 3026 | return 0; |
@@ -3247,8 +3233,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue, | |||
3247 | * free buffers) to handle eddp context */ | 3233 | * free buffers) to handle eddp context */ |
3248 | if (qeth_eddp_check_buffers_for_context(queue, ctx) | 3234 | if (qeth_eddp_check_buffers_for_context(queue, ctx) |
3249 | < 0) { | 3235 | < 0) { |
3250 | if (net_ratelimit()) | ||
3251 | PRINT_WARN("eddp tx_dropped 1\n"); | ||
3252 | rc = -EBUSY; | 3236 | rc = -EBUSY; |
3253 | goto out; | 3237 | goto out; |
3254 | } | 3238 | } |
@@ -3260,7 +3244,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue, | |||
3260 | tmp = qeth_eddp_fill_buffer(queue, ctx, | 3244 | tmp = qeth_eddp_fill_buffer(queue, ctx, |
3261 | queue->next_buf_to_fill); | 3245 | queue->next_buf_to_fill); |
3262 | if (tmp < 0) { | 3246 | if (tmp < 0) { |
3263 | PRINT_ERR("eddp tx_dropped 2\n"); | ||
3264 | rc = -EBUSY; | 3247 | rc = -EBUSY; |
3265 | goto out; | 3248 | goto out; |
3266 | } | 3249 | } |
@@ -3602,8 +3585,6 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata) | |||
3602 | 3585 | ||
3603 | if ((!qeth_adp_supported(card, IPA_SETADP_SET_SNMP_CONTROL)) && | 3586 | if ((!qeth_adp_supported(card, IPA_SETADP_SET_SNMP_CONTROL)) && |
3604 | (!card->options.layer2)) { | 3587 | (!card->options.layer2)) { |
3605 | PRINT_WARN("SNMP Query MIBS not supported " | ||
3606 | "on %s!\n", QETH_CARD_IFNAME(card)); | ||
3607 | return -EOPNOTSUPP; | 3588 | return -EOPNOTSUPP; |
3608 | } | 3589 | } |
3609 | /* skip 4 bytes (data_len struct member) to get req_len */ | 3590 | /* skip 4 bytes (data_len struct member) to get req_len */ |
@@ -3634,7 +3615,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata) | |||
3634 | rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len, | 3615 | rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len, |
3635 | qeth_snmp_command_cb, (void *)&qinfo); | 3616 | qeth_snmp_command_cb, (void *)&qinfo); |
3636 | if (rc) | 3617 | if (rc) |
3637 | PRINT_WARN("SNMP command failed on %s: (0x%x)\n", | 3618 | QETH_DBF_MESSAGE(2, "SNMP command failed on %s: (0x%x)\n", |
3638 | QETH_CARD_IFNAME(card), rc); | 3619 | QETH_CARD_IFNAME(card), rc); |
3639 | else { | 3620 | else { |
3640 | if (copy_to_user(udata, qinfo.udata, qinfo.udata_len)) | 3621 | if (copy_to_user(udata, qinfo.udata, qinfo.udata_len)) |
@@ -3807,8 +3788,8 @@ retry: | |||
3807 | if (mpno) | 3788 | if (mpno) |
3808 | mpno = min(mpno - 1, QETH_MAX_PORTNO); | 3789 | mpno = min(mpno - 1, QETH_MAX_PORTNO); |
3809 | if (card->info.portno > mpno) { | 3790 | if (card->info.portno > mpno) { |
3810 | PRINT_ERR("Device %s does not offer port number %d \n.", | 3791 | QETH_DBF_MESSAGE(2, "Device %s does not offer port number %d" |
3811 | CARD_BUS_ID(card), card->info.portno); | 3792 | "\n.", CARD_BUS_ID(card), card->info.portno); |
3812 | rc = -ENODEV; | 3793 | rc = -ENODEV; |
3813 | goto out; | 3794 | goto out; |
3814 | } | 3795 | } |
@@ -3985,8 +3966,6 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card, | |||
3985 | return skb; | 3966 | return skb; |
3986 | no_mem: | 3967 | no_mem: |
3987 | if (net_ratelimit()) { | 3968 | if (net_ratelimit()) { |
3988 | PRINT_WARN("No memory for packet received on %s.\n", | ||
3989 | QETH_CARD_IFNAME(card)); | ||
3990 | QETH_DBF_TEXT(TRACE, 2, "noskbmem"); | 3969 | QETH_DBF_TEXT(TRACE, 2, "noskbmem"); |
3991 | QETH_DBF_TEXT_(TRACE, 2, "%s", CARD_BUS_ID(card)); | 3970 | QETH_DBF_TEXT_(TRACE, 2, "%s", CARD_BUS_ID(card)); |
3992 | } | 3971 | } |
@@ -4004,15 +3983,17 @@ static void qeth_unregister_dbf_views(void) | |||
4004 | } | 3983 | } |
4005 | } | 3984 | } |
4006 | 3985 | ||
4007 | void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...) | 3986 | void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *fmt, ...) |
4008 | { | 3987 | { |
4009 | char dbf_txt_buf[32]; | 3988 | char dbf_txt_buf[32]; |
3989 | va_list args; | ||
4010 | 3990 | ||
4011 | if (level > (qeth_dbf[dbf_nix].id)->level) | 3991 | if (level > (qeth_dbf[dbf_nix].id)->level) |
4012 | return; | 3992 | return; |
4013 | snprintf(dbf_txt_buf, sizeof(dbf_txt_buf), text); | 3993 | va_start(args, fmt); |
3994 | vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); | ||
3995 | va_end(args); | ||
4014 | debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf); | 3996 | debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf); |
4015 | |||
4016 | } | 3997 | } |
4017 | EXPORT_SYMBOL_GPL(qeth_dbf_longtext); | 3998 | EXPORT_SYMBOL_GPL(qeth_dbf_longtext); |
4018 | 3999 | ||
diff --git a/drivers/s390/net/qeth_core_offl.c b/drivers/s390/net/qeth_core_offl.c index 822df8362856..452874e89740 100644 --- a/drivers/s390/net/qeth_core_offl.c +++ b/drivers/s390/net/qeth_core_offl.c | |||
@@ -122,8 +122,8 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, | |||
122 | if (element == 0) | 122 | if (element == 0) |
123 | return -EBUSY; | 123 | return -EBUSY; |
124 | else { | 124 | else { |
125 | PRINT_WARN("could only partially fill eddp " | 125 | QETH_DBF_MESSAGE(2, "could only partially fill" |
126 | "buffer!\n"); | 126 | "eddp buffer!\n"); |
127 | goto out; | 127 | goto out; |
128 | } | 128 | } |
129 | } | 129 | } |
@@ -143,8 +143,6 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, | |||
143 | if (must_refcnt) { | 143 | if (must_refcnt) { |
144 | must_refcnt = 0; | 144 | must_refcnt = 0; |
145 | if (qeth_eddp_buf_ref_context(buf, ctx)) { | 145 | if (qeth_eddp_buf_ref_context(buf, ctx)) { |
146 | PRINT_WARN("no memory to create eddp context " | ||
147 | "reference\n"); | ||
148 | goto out_check; | 146 | goto out_check; |
149 | } | 147 | } |
150 | } | 148 | } |
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index 08a50f057284..c26e842ad905 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c | |||
@@ -129,7 +129,6 @@ static ssize_t qeth_dev_portno_store(struct device *dev, | |||
129 | 129 | ||
130 | portno = simple_strtoul(buf, &tmp, 16); | 130 | portno = simple_strtoul(buf, &tmp, 16); |
131 | if (portno > QETH_MAX_PORTNO) { | 131 | if (portno > QETH_MAX_PORTNO) { |
132 | PRINT_WARN("portno 0x%X is out of range\n", portno); | ||
133 | return -EINVAL; | 132 | return -EINVAL; |
134 | } | 133 | } |
135 | 134 | ||
@@ -223,8 +222,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev, | |||
223 | * if though we have to permit priority queueing | 222 | * if though we have to permit priority queueing |
224 | */ | 223 | */ |
225 | if (card->qdio.no_out_queues == 1) { | 224 | if (card->qdio.no_out_queues == 1) { |
226 | PRINT_WARN("Priority queueing disabled due " | ||
227 | "to hardware limitations!\n"); | ||
228 | card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT; | 225 | card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT; |
229 | return -EPERM; | 226 | return -EPERM; |
230 | } | 227 | } |
@@ -250,7 +247,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev, | |||
250 | card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; | 247 | card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; |
251 | card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; | 248 | card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; |
252 | } else { | 249 | } else { |
253 | PRINT_WARN("Unknown queueing type '%s'\n", tmp); | ||
254 | return -EINVAL; | 250 | return -EINVAL; |
255 | } | 251 | } |
256 | return count; | 252 | return count; |
@@ -291,9 +287,6 @@ static ssize_t qeth_dev_bufcnt_store(struct device *dev, | |||
291 | ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt); | 287 | ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt); |
292 | if (old_cnt != cnt) { | 288 | if (old_cnt != cnt) { |
293 | rc = qeth_realloc_buffer_pool(card, cnt); | 289 | rc = qeth_realloc_buffer_pool(card, cnt); |
294 | if (rc) | ||
295 | PRINT_WARN("Error (%d) while setting " | ||
296 | "buffer count.\n", rc); | ||
297 | } | 290 | } |
298 | return count; | 291 | return count; |
299 | } | 292 | } |
@@ -355,7 +348,6 @@ static ssize_t qeth_dev_performance_stats_store(struct device *dev, | |||
355 | card->perf_stats.initial_rx_packets = card->stats.rx_packets; | 348 | card->perf_stats.initial_rx_packets = card->stats.rx_packets; |
356 | card->perf_stats.initial_tx_packets = card->stats.tx_packets; | 349 | card->perf_stats.initial_tx_packets = card->stats.tx_packets; |
357 | } else { | 350 | } else { |
358 | PRINT_WARN("performance_stats: write 0 or 1 to this file!\n"); | ||
359 | return -EINVAL; | 351 | return -EINVAL; |
360 | } | 352 | } |
361 | return count; | 353 | return count; |
@@ -399,7 +391,6 @@ static ssize_t qeth_dev_layer2_store(struct device *dev, | |||
399 | newdis = QETH_DISCIPLINE_LAYER2; | 391 | newdis = QETH_DISCIPLINE_LAYER2; |
400 | break; | 392 | break; |
401 | default: | 393 | default: |
402 | PRINT_WARN("layer2: write 0 or 1 to this file!\n"); | ||
403 | return -EINVAL; | 394 | return -EINVAL; |
404 | } | 395 | } |
405 | 396 | ||
@@ -463,7 +454,6 @@ static ssize_t qeth_dev_large_send_store(struct device *dev, | |||
463 | } else if (!strcmp(tmp, "TSO")) { | 454 | } else if (!strcmp(tmp, "TSO")) { |
464 | type = QETH_LARGE_SEND_TSO; | 455 | type = QETH_LARGE_SEND_TSO; |
465 | } else { | 456 | } else { |
466 | PRINT_WARN("large_send: invalid mode %s!\n", tmp); | ||
467 | return -EINVAL; | 457 | return -EINVAL; |
468 | } | 458 | } |
469 | if (card->options.large_send == type) | 459 | if (card->options.large_send == type) |
@@ -503,8 +493,6 @@ static ssize_t qeth_dev_blkt_store(struct qeth_card *card, | |||
503 | if (i <= max_value) { | 493 | if (i <= max_value) { |
504 | *value = i; | 494 | *value = i; |
505 | } else { | 495 | } else { |
506 | PRINT_WARN("blkt total time: write values between" | ||
507 | " 0 and %d to this file!\n", max_value); | ||
508 | return -EINVAL; | 496 | return -EINVAL; |
509 | } | 497 | } |
510 | return count; | 498 | return count; |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 86ec50ddae13..f682f7b14480 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -101,19 +101,16 @@ static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no) | |||
101 | { | 101 | { |
102 | struct qeth_card *card; | 102 | struct qeth_card *card; |
103 | struct net_device *ndev; | 103 | struct net_device *ndev; |
104 | unsigned char *readno; | 104 | __u16 temp_dev_no; |
105 | __u16 temp_dev_no, card_dev_no; | ||
106 | char *endp; | ||
107 | unsigned long flags; | 105 | unsigned long flags; |
106 | struct ccw_dev_id read_devid; | ||
108 | 107 | ||
109 | ndev = NULL; | 108 | ndev = NULL; |
110 | memcpy(&temp_dev_no, read_dev_no, 2); | 109 | memcpy(&temp_dev_no, read_dev_no, 2); |
111 | read_lock_irqsave(&qeth_core_card_list.rwlock, flags); | 110 | read_lock_irqsave(&qeth_core_card_list.rwlock, flags); |
112 | list_for_each_entry(card, &qeth_core_card_list.list, list) { | 111 | list_for_each_entry(card, &qeth_core_card_list.list, list) { |
113 | readno = CARD_RDEV_ID(card); | 112 | ccw_device_get_id(CARD_RDEV(card), &read_devid); |
114 | readno += (strlen(readno) - 4); | 113 | if (read_devid.devno == temp_dev_no) { |
115 | card_dev_no = simple_strtoul(readno, &endp, 16); | ||
116 | if (card_dev_no == temp_dev_no) { | ||
117 | ndev = card->dev; | 114 | ndev = card->dev; |
118 | break; | 115 | break; |
119 | } | 116 | } |
@@ -134,14 +131,14 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card, | |||
134 | mac = &cmd->data.setdelmac.mac[0]; | 131 | mac = &cmd->data.setdelmac.mac[0]; |
135 | /* MAC already registered, needed in couple/uncouple case */ | 132 | /* MAC already registered, needed in couple/uncouple case */ |
136 | if (cmd->hdr.return_code == 0x2005) { | 133 | if (cmd->hdr.return_code == 0x2005) { |
137 | PRINT_WARN("Group MAC %02x:%02x:%02x:%02x:%02x:%02x " \ | 134 | QETH_DBF_MESSAGE(2, "Group MAC %02x:%02x:%02x:%02x:%02x:%02x " |
138 | "already existing on %s \n", | 135 | "already existing on %s \n", |
139 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], | 136 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], |
140 | QETH_CARD_IFNAME(card)); | 137 | QETH_CARD_IFNAME(card)); |
141 | cmd->hdr.return_code = 0; | 138 | cmd->hdr.return_code = 0; |
142 | } | 139 | } |
143 | if (cmd->hdr.return_code) | 140 | if (cmd->hdr.return_code) |
144 | PRINT_ERR("Could not set group MAC " \ | 141 | QETH_DBF_MESSAGE(2, "Could not set group MAC " |
145 | "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", | 142 | "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", |
146 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], | 143 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], |
147 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); | 144 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); |
@@ -166,7 +163,7 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card, | |||
166 | cmd = (struct qeth_ipa_cmd *) data; | 163 | cmd = (struct qeth_ipa_cmd *) data; |
167 | mac = &cmd->data.setdelmac.mac[0]; | 164 | mac = &cmd->data.setdelmac.mac[0]; |
168 | if (cmd->hdr.return_code) | 165 | if (cmd->hdr.return_code) |
169 | PRINT_ERR("Could not delete group MAC " \ | 166 | QETH_DBF_MESSAGE(2, "Could not delete group MAC " |
170 | "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", | 167 | "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", |
171 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], | 168 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], |
172 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); | 169 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); |
@@ -186,10 +183,8 @@ static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac) | |||
186 | 183 | ||
187 | mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC); | 184 | mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC); |
188 | 185 | ||
189 | if (!mc) { | 186 | if (!mc) |
190 | PRINT_ERR("no mem vor mc mac address\n"); | ||
191 | return; | 187 | return; |
192 | } | ||
193 | 188 | ||
194 | memcpy(mc->mc_addr, mac, OSA_ADDR_LEN); | 189 | memcpy(mc->mc_addr, mac, OSA_ADDR_LEN); |
195 | mc->mc_addrlen = OSA_ADDR_LEN; | 190 | mc->mc_addrlen = OSA_ADDR_LEN; |
@@ -280,7 +275,7 @@ static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card, | |||
280 | QETH_DBF_TEXT(TRACE, 2, "L2sdvcb"); | 275 | QETH_DBF_TEXT(TRACE, 2, "L2sdvcb"); |
281 | cmd = (struct qeth_ipa_cmd *) data; | 276 | cmd = (struct qeth_ipa_cmd *) data; |
282 | if (cmd->hdr.return_code) { | 277 | if (cmd->hdr.return_code) { |
283 | PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " | 278 | QETH_DBF_MESSAGE(2, "Error in processing VLAN %i on %s: 0x%x. " |
284 | "Continuing\n", cmd->data.setdelvlan.vlan_id, | 279 | "Continuing\n", cmd->data.setdelvlan.vlan_id, |
285 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); | 280 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); |
286 | QETH_DBF_TEXT_(TRACE, 2, "L2VL%4x", cmd->hdr.command); | 281 | QETH_DBF_TEXT_(TRACE, 2, "L2VL%4x", cmd->hdr.command); |
@@ -333,8 +328,6 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
333 | spin_lock_bh(&card->vlanlock); | 328 | spin_lock_bh(&card->vlanlock); |
334 | list_add_tail(&id->list, &card->vid_list); | 329 | list_add_tail(&id->list, &card->vid_list); |
335 | spin_unlock_bh(&card->vlanlock); | 330 | spin_unlock_bh(&card->vlanlock); |
336 | } else { | ||
337 | PRINT_ERR("no memory for vid\n"); | ||
338 | } | 331 | } |
339 | } | 332 | } |
340 | 333 | ||
@@ -550,16 +543,15 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card) | |||
550 | 543 | ||
551 | rc = qeth_query_setadapterparms(card); | 544 | rc = qeth_query_setadapterparms(card); |
552 | if (rc) { | 545 | if (rc) { |
553 | PRINT_WARN("could not query adapter parameters on device %s: " | 546 | QETH_DBF_MESSAGE(2, "could not query adapter parameters on " |
554 | "x%x\n", CARD_BUS_ID(card), rc); | 547 | "device %s: x%x\n", CARD_BUS_ID(card), rc); |
555 | } | 548 | } |
556 | 549 | ||
557 | if (card->info.guestlan) { | 550 | if (card->info.guestlan) { |
558 | rc = qeth_setadpparms_change_macaddr(card); | 551 | rc = qeth_setadpparms_change_macaddr(card); |
559 | if (rc) { | 552 | if (rc) { |
560 | PRINT_WARN("couldn't get MAC address on " | 553 | QETH_DBF_MESSAGE(2, "couldn't get MAC address on " |
561 | "device %s: x%x\n", | 554 | "device %s: x%x\n", CARD_BUS_ID(card), rc); |
562 | CARD_BUS_ID(card), rc); | ||
563 | QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); | 555 | QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); |
564 | return rc; | 556 | return rc; |
565 | } | 557 | } |
@@ -585,8 +577,6 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) | |||
585 | } | 577 | } |
586 | 578 | ||
587 | if (card->info.type == QETH_CARD_TYPE_OSN) { | 579 | if (card->info.type == QETH_CARD_TYPE_OSN) { |
588 | PRINT_WARN("Setting MAC address on %s is not supported.\n", | ||
589 | dev->name); | ||
590 | QETH_DBF_TEXT(TRACE, 3, "setmcOSN"); | 580 | QETH_DBF_TEXT(TRACE, 3, "setmcOSN"); |
591 | return -EOPNOTSUPP; | 581 | return -EOPNOTSUPP; |
592 | } | 582 | } |
@@ -666,7 +656,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
666 | ctx = qeth_eddp_create_context(card, new_skb, hdr, | 656 | ctx = qeth_eddp_create_context(card, new_skb, hdr, |
667 | skb->sk->sk_protocol); | 657 | skb->sk->sk_protocol); |
668 | if (ctx == NULL) { | 658 | if (ctx == NULL) { |
669 | PRINT_WARN("could not create eddp context\n"); | 659 | QETH_DBF_MESSAGE(2, "could not create eddp context\n"); |
670 | goto tx_drop; | 660 | goto tx_drop; |
671 | } | 661 | } |
672 | } else { | 662 | } else { |
@@ -731,6 +721,7 @@ tx_drop: | |||
731 | if ((new_skb != skb) && new_skb) | 721 | if ((new_skb != skb) && new_skb) |
732 | dev_kfree_skb_any(new_skb); | 722 | dev_kfree_skb_any(new_skb); |
733 | dev_kfree_skb_any(skb); | 723 | dev_kfree_skb_any(skb); |
724 | netif_wake_queue(dev); | ||
734 | return NETDEV_TX_OK; | 725 | return NETDEV_TX_OK; |
735 | } | 726 | } |
736 | 727 | ||
@@ -1155,7 +1146,7 @@ static int qeth_osn_send_control_data(struct qeth_card *card, int len, | |||
1155 | (addr_t) iob, 0, 0); | 1146 | (addr_t) iob, 0, 0); |
1156 | spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags); | 1147 | spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags); |
1157 | if (rc) { | 1148 | if (rc) { |
1158 | PRINT_WARN("qeth_osn_send_control_data: " | 1149 | QETH_DBF_MESSAGE(2, "qeth_osn_send_control_data: " |
1159 | "ccw_device_start rc = %i\n", rc); | 1150 | "ccw_device_start rc = %i\n", rc); |
1160 | QETH_DBF_TEXT_(TRACE, 2, " err%d", rc); | 1151 | QETH_DBF_TEXT_(TRACE, 2, " err%d", rc); |
1161 | qeth_release_buffer(iob->channel, iob); | 1152 | qeth_release_buffer(iob->channel, iob); |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 94a8ead64ed4..999552c83bbe 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -311,7 +311,6 @@ static struct qeth_ipaddr *qeth_l3_get_addr_buffer( | |||
311 | 311 | ||
312 | addr = kzalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC); | 312 | addr = kzalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC); |
313 | if (addr == NULL) { | 313 | if (addr == NULL) { |
314 | PRINT_WARN("Not enough memory to add address\n"); | ||
315 | return NULL; | 314 | return NULL; |
316 | } | 315 | } |
317 | addr->type = QETH_IP_TYPE_NORMAL; | 316 | addr->type = QETH_IP_TYPE_NORMAL; |
@@ -649,15 +648,6 @@ static void qeth_l3_correct_routing_type(struct qeth_card *card, | |||
649 | } | 648 | } |
650 | } | 649 | } |
651 | out_inval: | 650 | out_inval: |
652 | PRINT_WARN("Routing type '%s' not supported for interface %s.\n" | ||
653 | "Router status set to 'no router'.\n", | ||
654 | ((*type == PRIMARY_ROUTER)? "primary router" : | ||
655 | (*type == SECONDARY_ROUTER)? "secondary router" : | ||
656 | (*type == PRIMARY_CONNECTOR)? "primary connector" : | ||
657 | (*type == SECONDARY_CONNECTOR)? "secondary connector" : | ||
658 | (*type == MULTICAST_ROUTER)? "multicast router" : | ||
659 | "unknown"), | ||
660 | card->dev->name); | ||
661 | *type = NO_ROUTER; | 651 | *type = NO_ROUTER; |
662 | } | 652 | } |
663 | 653 | ||
@@ -674,9 +664,9 @@ int qeth_l3_setrouting_v4(struct qeth_card *card) | |||
674 | QETH_PROT_IPV4); | 664 | QETH_PROT_IPV4); |
675 | if (rc) { | 665 | if (rc) { |
676 | card->options.route4.type = NO_ROUTER; | 666 | card->options.route4.type = NO_ROUTER; |
677 | PRINT_WARN("Error (0x%04x) while setting routing type on %s. " | 667 | QETH_DBF_MESSAGE(2, "Error (0x%04x) while setting routing type" |
678 | "Type set to 'no router'.\n", | 668 | " on %s. Type set to 'no router'.\n", rc, |
679 | rc, QETH_CARD_IFNAME(card)); | 669 | QETH_CARD_IFNAME(card)); |
680 | } | 670 | } |
681 | return rc; | 671 | return rc; |
682 | } | 672 | } |
@@ -697,9 +687,9 @@ int qeth_l3_setrouting_v6(struct qeth_card *card) | |||
697 | QETH_PROT_IPV6); | 687 | QETH_PROT_IPV6); |
698 | if (rc) { | 688 | if (rc) { |
699 | card->options.route6.type = NO_ROUTER; | 689 | card->options.route6.type = NO_ROUTER; |
700 | PRINT_WARN("Error (0x%04x) while setting routing type on %s. " | 690 | QETH_DBF_MESSAGE(2, "Error (0x%04x) while setting routing type" |
701 | "Type set to 'no router'.\n", | 691 | " on %s. Type set to 'no router'.\n", rc, |
702 | rc, QETH_CARD_IFNAME(card)); | 692 | QETH_CARD_IFNAME(card)); |
703 | } | 693 | } |
704 | #endif | 694 | #endif |
705 | return rc; | 695 | return rc; |
@@ -737,7 +727,6 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card, | |||
737 | if (!memcmp(ipatoe->addr, new->addr, | 727 | if (!memcmp(ipatoe->addr, new->addr, |
738 | (ipatoe->proto == QETH_PROT_IPV4)? 4:16) && | 728 | (ipatoe->proto == QETH_PROT_IPV4)? 4:16) && |
739 | (ipatoe->mask_bits == new->mask_bits)) { | 729 | (ipatoe->mask_bits == new->mask_bits)) { |
740 | PRINT_WARN("ipato entry already exists!\n"); | ||
741 | rc = -EEXIST; | 730 | rc = -EEXIST; |
742 | break; | 731 | break; |
743 | } | 732 | } |
@@ -802,7 +791,6 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto, | |||
802 | rc = -EEXIST; | 791 | rc = -EEXIST; |
803 | spin_unlock_irqrestore(&card->ip_lock, flags); | 792 | spin_unlock_irqrestore(&card->ip_lock, flags); |
804 | if (rc) { | 793 | if (rc) { |
805 | PRINT_WARN("Cannot add VIPA. Address already exists!\n"); | ||
806 | return rc; | 794 | return rc; |
807 | } | 795 | } |
808 | if (!qeth_l3_add_ip(card, ipaddr)) | 796 | if (!qeth_l3_add_ip(card, ipaddr)) |
@@ -867,7 +855,6 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto, | |||
867 | rc = -EEXIST; | 855 | rc = -EEXIST; |
868 | spin_unlock_irqrestore(&card->ip_lock, flags); | 856 | spin_unlock_irqrestore(&card->ip_lock, flags); |
869 | if (rc) { | 857 | if (rc) { |
870 | PRINT_WARN("Cannot add RXIP. Address already exists!\n"); | ||
871 | return rc; | 858 | return rc; |
872 | } | 859 | } |
873 | if (!qeth_l3_add_ip(card, ipaddr)) | 860 | if (!qeth_l3_add_ip(card, ipaddr)) |
@@ -1020,23 +1007,23 @@ static int qeth_l3_setadapter_hstr(struct qeth_card *card) | |||
1020 | IPA_SETADP_SET_BROADCAST_MODE, | 1007 | IPA_SETADP_SET_BROADCAST_MODE, |
1021 | card->options.broadcast_mode); | 1008 | card->options.broadcast_mode); |
1022 | if (rc) | 1009 | if (rc) |
1023 | PRINT_WARN("couldn't set broadcast mode on " | 1010 | QETH_DBF_MESSAGE(2, "couldn't set broadcast mode on " |
1024 | "device %s: x%x\n", | 1011 | "device %s: x%x\n", |
1025 | CARD_BUS_ID(card), rc); | 1012 | CARD_BUS_ID(card), rc); |
1026 | rc = qeth_l3_send_setadp_mode(card, | 1013 | rc = qeth_l3_send_setadp_mode(card, |
1027 | IPA_SETADP_ALTER_MAC_ADDRESS, | 1014 | IPA_SETADP_ALTER_MAC_ADDRESS, |
1028 | card->options.macaddr_mode); | 1015 | card->options.macaddr_mode); |
1029 | if (rc) | 1016 | if (rc) |
1030 | PRINT_WARN("couldn't set macaddr mode on " | 1017 | QETH_DBF_MESSAGE(2, "couldn't set macaddr mode on " |
1031 | "device %s: x%x\n", CARD_BUS_ID(card), rc); | 1018 | "device %s: x%x\n", CARD_BUS_ID(card), rc); |
1032 | return rc; | 1019 | return rc; |
1033 | } | 1020 | } |
1034 | if (card->options.broadcast_mode == QETH_TR_BROADCAST_LOCAL) | 1021 | if (card->options.broadcast_mode == QETH_TR_BROADCAST_LOCAL) |
1035 | PRINT_WARN("set adapter parameters not available " | 1022 | QETH_DBF_MESSAGE(2, "set adapter parameters not available " |
1036 | "to set broadcast mode, using ALLRINGS " | 1023 | "to set broadcast mode, using ALLRINGS " |
1037 | "on device %s:\n", CARD_BUS_ID(card)); | 1024 | "on device %s:\n", CARD_BUS_ID(card)); |
1038 | if (card->options.macaddr_mode == QETH_TR_MACADDR_CANONICAL) | 1025 | if (card->options.macaddr_mode == QETH_TR_MACADDR_CANONICAL) |
1039 | PRINT_WARN("set adapter parameters not available " | 1026 | QETH_DBF_MESSAGE(2, "set adapter parameters not available " |
1040 | "to set macaddr mode, using NONCANONICAL " | 1027 | "to set macaddr mode, using NONCANONICAL " |
1041 | "on device %s:\n", CARD_BUS_ID(card)); | 1028 | "on device %s:\n", CARD_BUS_ID(card)); |
1042 | return 0; | 1029 | return 0; |
@@ -2070,7 +2057,7 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev) | |||
2070 | card = netdev_priv(dev); | 2057 | card = netdev_priv(dev); |
2071 | else if (rc == QETH_VLAN_CARD) | 2058 | else if (rc == QETH_VLAN_CARD) |
2072 | card = netdev_priv(vlan_dev_info(dev)->real_dev); | 2059 | card = netdev_priv(vlan_dev_info(dev)->real_dev); |
2073 | if (card->options.layer2) | 2060 | if (card && card->options.layer2) |
2074 | card = NULL; | 2061 | card = NULL; |
2075 | QETH_DBF_TEXT_(TRACE, 4, "%d", rc); | 2062 | QETH_DBF_TEXT_(TRACE, 4, "%d", rc); |
2076 | return card ; | 2063 | return card ; |
@@ -2182,8 +2169,6 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries) | |||
2182 | if (card->info.guestlan) | 2169 | if (card->info.guestlan) |
2183 | return -EOPNOTSUPP; | 2170 | return -EOPNOTSUPP; |
2184 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { | 2171 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { |
2185 | PRINT_WARN("ARP processing not supported " | ||
2186 | "on %s!\n", QETH_CARD_IFNAME(card)); | ||
2187 | return -EOPNOTSUPP; | 2172 | return -EOPNOTSUPP; |
2188 | } | 2173 | } |
2189 | rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, | 2174 | rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, |
@@ -2191,8 +2176,8 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries) | |||
2191 | no_entries); | 2176 | no_entries); |
2192 | if (rc) { | 2177 | if (rc) { |
2193 | tmp = rc; | 2178 | tmp = rc; |
2194 | PRINT_WARN("Could not set number of ARP entries on %s: " | 2179 | QETH_DBF_MESSAGE(2, "Could not set number of ARP entries on " |
2195 | "%s (0x%x/%d)\n", QETH_CARD_IFNAME(card), | 2180 | "%s: %s (0x%x/%d)\n", QETH_CARD_IFNAME(card), |
2196 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); | 2181 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); |
2197 | } | 2182 | } |
2198 | return rc; | 2183 | return rc; |
@@ -2260,9 +2245,6 @@ static int qeth_l3_arp_query_cb(struct qeth_card *card, | |||
2260 | qdata->no_entries * uentry_size){ | 2245 | qdata->no_entries * uentry_size){ |
2261 | QETH_DBF_TEXT_(TRACE, 4, "qaer3%i", -ENOMEM); | 2246 | QETH_DBF_TEXT_(TRACE, 4, "qaer3%i", -ENOMEM); |
2262 | cmd->hdr.return_code = -ENOMEM; | 2247 | cmd->hdr.return_code = -ENOMEM; |
2263 | PRINT_WARN("query ARP user space buffer is too small for " | ||
2264 | "the returned number of ARP entries. " | ||
2265 | "Aborting query!\n"); | ||
2266 | goto out_error; | 2248 | goto out_error; |
2267 | } | 2249 | } |
2268 | QETH_DBF_TEXT_(TRACE, 4, "anore%i", | 2250 | QETH_DBF_TEXT_(TRACE, 4, "anore%i", |
@@ -2324,8 +2306,6 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata) | |||
2324 | 2306 | ||
2325 | if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/ | 2307 | if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/ |
2326 | IPA_ARP_PROCESSING)) { | 2308 | IPA_ARP_PROCESSING)) { |
2327 | PRINT_WARN("ARP processing not supported " | ||
2328 | "on %s!\n", QETH_CARD_IFNAME(card)); | ||
2329 | return -EOPNOTSUPP; | 2309 | return -EOPNOTSUPP; |
2330 | } | 2310 | } |
2331 | /* get size of userspace buffer and mask_bits -> 6 bytes */ | 2311 | /* get size of userspace buffer and mask_bits -> 6 bytes */ |
@@ -2344,7 +2324,7 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata) | |||
2344 | qeth_l3_arp_query_cb, (void *)&qinfo); | 2324 | qeth_l3_arp_query_cb, (void *)&qinfo); |
2345 | if (rc) { | 2325 | if (rc) { |
2346 | tmp = rc; | 2326 | tmp = rc; |
2347 | PRINT_WARN("Error while querying ARP cache on %s: %s " | 2327 | QETH_DBF_MESSAGE(2, "Error while querying ARP cache on %s: %s " |
2348 | "(0x%x/%d)\n", QETH_CARD_IFNAME(card), | 2328 | "(0x%x/%d)\n", QETH_CARD_IFNAME(card), |
2349 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); | 2329 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); |
2350 | if (copy_to_user(udata, qinfo.udata, 4)) | 2330 | if (copy_to_user(udata, qinfo.udata, 4)) |
@@ -2375,8 +2355,6 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card, | |||
2375 | if (card->info.guestlan) | 2355 | if (card->info.guestlan) |
2376 | return -EOPNOTSUPP; | 2356 | return -EOPNOTSUPP; |
2377 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { | 2357 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { |
2378 | PRINT_WARN("ARP processing not supported " | ||
2379 | "on %s!\n", QETH_CARD_IFNAME(card)); | ||
2380 | return -EOPNOTSUPP; | 2358 | return -EOPNOTSUPP; |
2381 | } | 2359 | } |
2382 | 2360 | ||
@@ -2391,10 +2369,9 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card, | |||
2391 | if (rc) { | 2369 | if (rc) { |
2392 | tmp = rc; | 2370 | tmp = rc; |
2393 | qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf); | 2371 | qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf); |
2394 | PRINT_WARN("Could not add ARP entry for address %s on %s: " | 2372 | QETH_DBF_MESSAGE(2, "Could not add ARP entry for address %s " |
2395 | "%s (0x%x/%d)\n", | 2373 | "on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card), |
2396 | buf, QETH_CARD_IFNAME(card), | 2374 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); |
2397 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); | ||
2398 | } | 2375 | } |
2399 | return rc; | 2376 | return rc; |
2400 | } | 2377 | } |
@@ -2417,8 +2394,6 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card, | |||
2417 | if (card->info.guestlan) | 2394 | if (card->info.guestlan) |
2418 | return -EOPNOTSUPP; | 2395 | return -EOPNOTSUPP; |
2419 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { | 2396 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { |
2420 | PRINT_WARN("ARP processing not supported " | ||
2421 | "on %s!\n", QETH_CARD_IFNAME(card)); | ||
2422 | return -EOPNOTSUPP; | 2397 | return -EOPNOTSUPP; |
2423 | } | 2398 | } |
2424 | memcpy(buf, entry, 12); | 2399 | memcpy(buf, entry, 12); |
@@ -2433,10 +2408,9 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card, | |||
2433 | tmp = rc; | 2408 | tmp = rc; |
2434 | memset(buf, 0, 16); | 2409 | memset(buf, 0, 16); |
2435 | qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf); | 2410 | qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf); |
2436 | PRINT_WARN("Could not delete ARP entry for address %s on %s: " | 2411 | QETH_DBF_MESSAGE(2, "Could not delete ARP entry for address %s" |
2437 | "%s (0x%x/%d)\n", | 2412 | " on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card), |
2438 | buf, QETH_CARD_IFNAME(card), | 2413 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); |
2439 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); | ||
2440 | } | 2414 | } |
2441 | return rc; | 2415 | return rc; |
2442 | } | 2416 | } |
@@ -2456,16 +2430,14 @@ static int qeth_l3_arp_flush_cache(struct qeth_card *card) | |||
2456 | if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD)) | 2430 | if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD)) |
2457 | return -EOPNOTSUPP; | 2431 | return -EOPNOTSUPP; |
2458 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { | 2432 | if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { |
2459 | PRINT_WARN("ARP processing not supported " | ||
2460 | "on %s!\n", QETH_CARD_IFNAME(card)); | ||
2461 | return -EOPNOTSUPP; | 2433 | return -EOPNOTSUPP; |
2462 | } | 2434 | } |
2463 | rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, | 2435 | rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, |
2464 | IPA_CMD_ASS_ARP_FLUSH_CACHE, 0); | 2436 | IPA_CMD_ASS_ARP_FLUSH_CACHE, 0); |
2465 | if (rc) { | 2437 | if (rc) { |
2466 | tmp = rc; | 2438 | tmp = rc; |
2467 | PRINT_WARN("Could not flush ARP cache on %s: %s (0x%x/%d)\n", | 2439 | QETH_DBF_MESSAGE(2, "Could not flush ARP cache on %s: %s " |
2468 | QETH_CARD_IFNAME(card), | 2440 | "(0x%x/%d)\n", QETH_CARD_IFNAME(card), |
2469 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); | 2441 | qeth_l3_arp_get_error_cause(&rc), tmp, tmp); |
2470 | } | 2442 | } |
2471 | return rc; | 2443 | return rc; |
@@ -2724,7 +2696,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2724 | ctx = qeth_eddp_create_context(card, new_skb, hdr, | 2696 | ctx = qeth_eddp_create_context(card, new_skb, hdr, |
2725 | skb->sk->sk_protocol); | 2697 | skb->sk->sk_protocol); |
2726 | if (ctx == NULL) { | 2698 | if (ctx == NULL) { |
2727 | PRINT_WARN("could not create eddp context\n"); | 2699 | QETH_DBF_MESSAGE(2, "could not create eddp context\n"); |
2728 | goto tx_drop; | 2700 | goto tx_drop; |
2729 | } | 2701 | } |
2730 | } else { | 2702 | } else { |
@@ -2792,6 +2764,7 @@ tx_drop: | |||
2792 | if ((new_skb != skb) && new_skb) | 2764 | if ((new_skb != skb) && new_skb) |
2793 | dev_kfree_skb_any(new_skb); | 2765 | dev_kfree_skb_any(new_skb); |
2794 | dev_kfree_skb_any(skb); | 2766 | dev_kfree_skb_any(skb); |
2767 | netif_wake_queue(dev); | ||
2795 | return NETDEV_TX_OK; | 2768 | return NETDEV_TX_OK; |
2796 | } | 2769 | } |
2797 | 2770 | ||
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index 08f51fd902c4..ac1993708ae9 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c | |||
@@ -85,7 +85,6 @@ static ssize_t qeth_l3_dev_route_store(struct qeth_card *card, | |||
85 | } else if (!strcmp(tmp, "multicast_router")) { | 85 | } else if (!strcmp(tmp, "multicast_router")) { |
86 | route->type = MULTICAST_ROUTER; | 86 | route->type = MULTICAST_ROUTER; |
87 | } else { | 87 | } else { |
88 | PRINT_WARN("Invalid routing type '%s'.\n", tmp); | ||
89 | return -EINVAL; | 88 | return -EINVAL; |
90 | } | 89 | } |
91 | if (((card->state == CARD_STATE_SOFTSETUP) || | 90 | if (((card->state == CARD_STATE_SOFTSETUP) || |
@@ -137,9 +136,6 @@ static ssize_t qeth_l3_dev_route6_store(struct device *dev, | |||
137 | return -EINVAL; | 136 | return -EINVAL; |
138 | 137 | ||
139 | if (!qeth_is_supported(card, IPA_IPV6)) { | 138 | if (!qeth_is_supported(card, IPA_IPV6)) { |
140 | PRINT_WARN("IPv6 not supported for interface %s.\n" | ||
141 | "Routing status no changed.\n", | ||
142 | QETH_CARD_IFNAME(card)); | ||
143 | return -ENOTSUPP; | 139 | return -ENOTSUPP; |
144 | } | 140 | } |
145 | 141 | ||
@@ -179,7 +175,6 @@ static ssize_t qeth_l3_dev_fake_broadcast_store(struct device *dev, | |||
179 | if ((i == 0) || (i == 1)) | 175 | if ((i == 0) || (i == 1)) |
180 | card->options.fake_broadcast = i; | 176 | card->options.fake_broadcast = i; |
181 | else { | 177 | else { |
182 | PRINT_WARN("fake_broadcast: write 0 or 1 to this file!\n"); | ||
183 | return -EINVAL; | 178 | return -EINVAL; |
184 | } | 179 | } |
185 | return count; | 180 | return count; |
@@ -220,7 +215,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev, | |||
220 | 215 | ||
221 | if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) || | 216 | if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) || |
222 | (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) { | 217 | (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) { |
223 | PRINT_WARN("Device is not a tokenring device!\n"); | ||
224 | return -EINVAL; | 218 | return -EINVAL; |
225 | } | 219 | } |
226 | 220 | ||
@@ -233,8 +227,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev, | |||
233 | card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS; | 227 | card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS; |
234 | return count; | 228 | return count; |
235 | } else { | 229 | } else { |
236 | PRINT_WARN("broadcast_mode: invalid mode %s!\n", | ||
237 | tmp); | ||
238 | return -EINVAL; | 230 | return -EINVAL; |
239 | } | 231 | } |
240 | return count; | 232 | return count; |
@@ -275,7 +267,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev, | |||
275 | 267 | ||
276 | if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) || | 268 | if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) || |
277 | (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) { | 269 | (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) { |
278 | PRINT_WARN("Device is not a tokenring device!\n"); | ||
279 | return -EINVAL; | 270 | return -EINVAL; |
280 | } | 271 | } |
281 | 272 | ||
@@ -285,7 +276,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev, | |||
285 | QETH_TR_MACADDR_CANONICAL : | 276 | QETH_TR_MACADDR_CANONICAL : |
286 | QETH_TR_MACADDR_NONCANONICAL; | 277 | QETH_TR_MACADDR_NONCANONICAL; |
287 | else { | 278 | else { |
288 | PRINT_WARN("canonical_macaddr: write 0 or 1 to this file!\n"); | ||
289 | return -EINVAL; | 279 | return -EINVAL; |
290 | } | 280 | } |
291 | return count; | 281 | return count; |
@@ -327,7 +317,6 @@ static ssize_t qeth_l3_dev_checksum_store(struct device *dev, | |||
327 | else if (!strcmp(tmp, "no_checksumming")) | 317 | else if (!strcmp(tmp, "no_checksumming")) |
328 | card->options.checksum_type = NO_CHECKSUMMING; | 318 | card->options.checksum_type = NO_CHECKSUMMING; |
329 | else { | 319 | else { |
330 | PRINT_WARN("Unknown checksumming type '%s'\n", tmp); | ||
331 | return -EINVAL; | 320 | return -EINVAL; |
332 | } | 321 | } |
333 | return count; | 322 | return count; |
@@ -382,8 +371,6 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev, | |||
382 | } else if (!strcmp(tmp, "0")) { | 371 | } else if (!strcmp(tmp, "0")) { |
383 | card->ipato.enabled = 0; | 372 | card->ipato.enabled = 0; |
384 | } else { | 373 | } else { |
385 | PRINT_WARN("ipato_enable: write 0, 1 or 'toggle' to " | ||
386 | "this file\n"); | ||
387 | return -EINVAL; | 374 | return -EINVAL; |
388 | } | 375 | } |
389 | return count; | 376 | return count; |
@@ -422,8 +409,6 @@ static ssize_t qeth_l3_dev_ipato_invert4_store(struct device *dev, | |||
422 | } else if (!strcmp(tmp, "0")) { | 409 | } else if (!strcmp(tmp, "0")) { |
423 | card->ipato.invert4 = 0; | 410 | card->ipato.invert4 = 0; |
424 | } else { | 411 | } else { |
425 | PRINT_WARN("ipato_invert4: write 0, 1 or 'toggle' to " | ||
426 | "this file\n"); | ||
427 | return -EINVAL; | 412 | return -EINVAL; |
428 | } | 413 | } |
429 | return count; | 414 | return count; |
@@ -486,13 +471,10 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto, | |||
486 | /* get address string */ | 471 | /* get address string */ |
487 | end = strchr(start, '/'); | 472 | end = strchr(start, '/'); |
488 | if (!end || (end - start >= 40)) { | 473 | if (!end || (end - start >= 40)) { |
489 | PRINT_WARN("Invalid format for ipato_addx/delx. " | ||
490 | "Use <ip addr>/<mask bits>\n"); | ||
491 | return -EINVAL; | 474 | return -EINVAL; |
492 | } | 475 | } |
493 | strncpy(buffer, start, end - start); | 476 | strncpy(buffer, start, end - start); |
494 | if (qeth_l3_string_to_ipaddr(buffer, proto, addr)) { | 477 | if (qeth_l3_string_to_ipaddr(buffer, proto, addr)) { |
495 | PRINT_WARN("Invalid IP address format!\n"); | ||
496 | return -EINVAL; | 478 | return -EINVAL; |
497 | } | 479 | } |
498 | start = end + 1; | 480 | start = end + 1; |
@@ -500,7 +482,6 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto, | |||
500 | if (!strlen(start) || | 482 | if (!strlen(start) || |
501 | (tmp == start) || | 483 | (tmp == start) || |
502 | (*mask_bits > ((proto == QETH_PROT_IPV4) ? 32 : 128))) { | 484 | (*mask_bits > ((proto == QETH_PROT_IPV4) ? 32 : 128))) { |
503 | PRINT_WARN("Invalid mask bits for ipato_addx/delx !\n"); | ||
504 | return -EINVAL; | 485 | return -EINVAL; |
505 | } | 486 | } |
506 | return 0; | 487 | return 0; |
@@ -520,7 +501,6 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count, | |||
520 | 501 | ||
521 | ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL); | 502 | ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL); |
522 | if (!ipatoe) { | 503 | if (!ipatoe) { |
523 | PRINT_WARN("No memory to allocate ipato entry\n"); | ||
524 | return -ENOMEM; | 504 | return -ENOMEM; |
525 | } | 505 | } |
526 | ipatoe->proto = proto; | 506 | ipatoe->proto = proto; |
@@ -609,8 +589,6 @@ static ssize_t qeth_l3_dev_ipato_invert6_store(struct device *dev, | |||
609 | } else if (!strcmp(tmp, "0")) { | 589 | } else if (!strcmp(tmp, "0")) { |
610 | card->ipato.invert6 = 0; | 590 | card->ipato.invert6 = 0; |
611 | } else { | 591 | } else { |
612 | PRINT_WARN("ipato_invert6: write 0, 1 or 'toggle' to " | ||
613 | "this file\n"); | ||
614 | return -EINVAL; | 592 | return -EINVAL; |
615 | } | 593 | } |
616 | return count; | 594 | return count; |
@@ -724,7 +702,6 @@ static int qeth_l3_parse_vipae(const char *buf, enum qeth_prot_versions proto, | |||
724 | u8 *addr) | 702 | u8 *addr) |
725 | { | 703 | { |
726 | if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { | 704 | if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { |
727 | PRINT_WARN("Invalid IP address format!\n"); | ||
728 | return -EINVAL; | 705 | return -EINVAL; |
729 | } | 706 | } |
730 | return 0; | 707 | return 0; |
@@ -891,7 +868,6 @@ static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto, | |||
891 | u8 *addr) | 868 | u8 *addr) |
892 | { | 869 | { |
893 | if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { | 870 | if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { |
894 | PRINT_WARN("Invalid IP address format!\n"); | ||
895 | return -EINVAL; | 871 | return -EINVAL; |
896 | } | 872 | } |
897 | return 0; | 873 | return 0; |
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c index 5080f343ad74..5bfbe7659830 100644 --- a/drivers/s390/s390mach.c +++ b/drivers/s390/s390mach.c | |||
@@ -207,6 +207,7 @@ s390_handle_mcck(void) | |||
207 | do_exit(SIGSEGV); | 207 | do_exit(SIGSEGV); |
208 | } | 208 | } |
209 | } | 209 | } |
210 | EXPORT_SYMBOL_GPL(s390_handle_mcck); | ||
210 | 211 | ||
211 | /* | 212 | /* |
212 | * returns 0 if all registers could be validated | 213 | * returns 0 if all registers could be validated |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index c065a704a93a..42be8b01a40f 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -1318,7 +1318,7 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud, | |||
1318 | * If the baud rate generator isn't running, the port wasn't | 1318 | * If the baud rate generator isn't running, the port wasn't |
1319 | * initialized by the boot loader. | 1319 | * initialized by the boot loader. |
1320 | */ | 1320 | */ |
1321 | quot = UART_GET_BRGR(port); | 1321 | quot = UART_GET_BRGR(port) & ATMEL_US_CD; |
1322 | if (!quot) | 1322 | if (!quot) |
1323 | return; | 1323 | return; |
1324 | 1324 | ||
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index d6b4ead693b7..f20952c43cb8 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -530,11 +530,7 @@ static unsigned int bfin_serial_get_mctrl(struct uart_port *port) | |||
530 | if (uart->cts_pin < 0) | 530 | if (uart->cts_pin < 0) |
531 | return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; | 531 | return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; |
532 | 532 | ||
533 | # ifdef BF54x | 533 | if (UART_GET_CTS(uart)) |
534 | if (UART_GET_MSR(uart) & CTS) | ||
535 | # else | ||
536 | if (gpio_get_value(uart->cts_pin)) | ||
537 | # endif | ||
538 | return TIOCM_DSR | TIOCM_CAR; | 534 | return TIOCM_DSR | TIOCM_CAR; |
539 | else | 535 | else |
540 | #endif | 536 | #endif |
@@ -549,17 +545,9 @@ static void bfin_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
549 | return; | 545 | return; |
550 | 546 | ||
551 | if (mctrl & TIOCM_RTS) | 547 | if (mctrl & TIOCM_RTS) |
552 | # ifdef BF54x | 548 | UART_CLEAR_RTS(uart); |
553 | UART_PUT_MCR(uart, UART_GET_MCR(uart) & ~MRTS); | ||
554 | # else | ||
555 | gpio_set_value(uart->rts_pin, 0); | ||
556 | # endif | ||
557 | else | 549 | else |
558 | # ifdef BF54x | 550 | UART_SET_RTS(uart); |
559 | UART_PUT_MCR(uart, UART_GET_MCR(uart) | MRTS); | ||
560 | # else | ||
561 | gpio_set_value(uart->rts_pin, 1); | ||
562 | # endif | ||
563 | #endif | 551 | #endif |
564 | } | 552 | } |
565 | 553 | ||
@@ -752,11 +740,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
752 | 740 | ||
753 | /* Disable UART */ | 741 | /* Disable UART */ |
754 | ier = UART_GET_IER(uart); | 742 | ier = UART_GET_IER(uart); |
755 | #ifdef CONFIG_BF54x | 743 | UART_DISABLE_INTS(uart); |
756 | UART_CLEAR_IER(uart, 0xF); | ||
757 | #else | ||
758 | UART_PUT_IER(uart, 0); | ||
759 | #endif | ||
760 | 744 | ||
761 | /* Set DLAB in LCR to Access DLL and DLH */ | 745 | /* Set DLAB in LCR to Access DLL and DLH */ |
762 | UART_SET_DLAB(uart); | 746 | UART_SET_DLAB(uart); |
@@ -771,11 +755,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
771 | UART_PUT_LCR(uart, lcr); | 755 | UART_PUT_LCR(uart, lcr); |
772 | 756 | ||
773 | /* Enable UART */ | 757 | /* Enable UART */ |
774 | #ifdef CONFIG_BF54x | 758 | UART_ENABLE_INTS(uart, ier); |
775 | UART_SET_IER(uart, ier); | ||
776 | #else | ||
777 | UART_PUT_IER(uart, ier); | ||
778 | #endif | ||
779 | 759 | ||
780 | val = UART_GET_GCTL(uart); | 760 | val = UART_GET_GCTL(uart); |
781 | val |= UCEN; | 761 | val |= UCEN; |
@@ -833,15 +813,15 @@ bfin_serial_verify_port(struct uart_port *port, struct serial_struct *ser) | |||
833 | * Enable the IrDA function if tty->ldisc.num is N_IRDA. | 813 | * Enable the IrDA function if tty->ldisc.num is N_IRDA. |
834 | * In other cases, disable IrDA function. | 814 | * In other cases, disable IrDA function. |
835 | */ | 815 | */ |
836 | static void bfin_set_ldisc(struct tty_struct *tty) | 816 | static void bfin_serial_set_ldisc(struct uart_port *port) |
837 | { | 817 | { |
838 | int line = tty->index; | 818 | int line = port->line; |
839 | unsigned short val; | 819 | unsigned short val; |
840 | 820 | ||
841 | if (line >= tty->driver->num) | 821 | if (line >= port->info->tty->driver->num) |
842 | return; | 822 | return; |
843 | 823 | ||
844 | switch (tty->ldisc.num) { | 824 | switch (port->info->tty->ldisc.num) { |
845 | case N_IRDA: | 825 | case N_IRDA: |
846 | val = UART_GET_GCTL(&bfin_serial_ports[line]); | 826 | val = UART_GET_GCTL(&bfin_serial_ports[line]); |
847 | val |= (IREN | RPOLC); | 827 | val |= (IREN | RPOLC); |
@@ -866,6 +846,7 @@ static struct uart_ops bfin_serial_pops = { | |||
866 | .startup = bfin_serial_startup, | 846 | .startup = bfin_serial_startup, |
867 | .shutdown = bfin_serial_shutdown, | 847 | .shutdown = bfin_serial_shutdown, |
868 | .set_termios = bfin_serial_set_termios, | 848 | .set_termios = bfin_serial_set_termios, |
849 | .set_ldisc = bfin_serial_set_ldisc, | ||
869 | .type = bfin_serial_type, | 850 | .type = bfin_serial_type, |
870 | .release_port = bfin_serial_release_port, | 851 | .release_port = bfin_serial_release_port, |
871 | .request_port = bfin_serial_request_port, | 852 | .request_port = bfin_serial_request_port, |
@@ -1206,7 +1187,6 @@ static int __init bfin_serial_init(void) | |||
1206 | 1187 | ||
1207 | ret = uart_register_driver(&bfin_serial_reg); | 1188 | ret = uart_register_driver(&bfin_serial_reg); |
1208 | if (ret == 0) { | 1189 | if (ret == 0) { |
1209 | bfin_serial_reg.tty_driver->set_ldisc = bfin_set_ldisc; | ||
1210 | ret = platform_driver_register(&bfin_serial_driver); | 1190 | ret = platform_driver_register(&bfin_serial_driver); |
1211 | if (ret) { | 1191 | if (ret) { |
1212 | pr_debug("uart register failed\n"); | 1192 | pr_debug("uart register failed\n"); |
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c index 2d6c08b3dbcf..f8e1447a022a 100644 --- a/drivers/serial/sb1250-duart.c +++ b/drivers/serial/sb1250-duart.c | |||
@@ -924,7 +924,7 @@ console_initcall(sbd_serial_console_init); | |||
924 | 924 | ||
925 | static struct uart_driver sbd_reg = { | 925 | static struct uart_driver sbd_reg = { |
926 | .owner = THIS_MODULE, | 926 | .owner = THIS_MODULE, |
927 | .driver_name = "serial", | 927 | .driver_name = "sb1250_duart", |
928 | .dev_name = "duart", | 928 | .dev_name = "duart", |
929 | .major = TTY_MAJOR, | 929 | .major = TTY_MAJOR, |
930 | .minor = SB1250_DUART_MINOR_BASE, | 930 | .minor = SB1250_DUART_MINOR_BASE, |
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c index 01917c433f17..566a8b42e05a 100644 --- a/drivers/serial/ucc_uart.c +++ b/drivers/serial/ucc_uart.c | |||
@@ -195,7 +195,7 @@ struct uart_qe_port { | |||
195 | 195 | ||
196 | static struct uart_driver ucc_uart_driver = { | 196 | static struct uart_driver ucc_uart_driver = { |
197 | .owner = THIS_MODULE, | 197 | .owner = THIS_MODULE, |
198 | .driver_name = "serial", | 198 | .driver_name = "ucc_uart", |
199 | .dev_name = "ttyQE", | 199 | .dev_name = "ttyQE", |
200 | .major = SERIAL_QE_MAJOR, | 200 | .major = SERIAL_QE_MAJOR, |
201 | .minor = SERIAL_QE_MINOR, | 201 | .minor = SERIAL_QE_MINOR, |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 41620c0fb046..799337f7fde1 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/ioctl.h> | 25 | #include <linux/ioctl.h> |
26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/err.h> | ||
28 | #include <linux/list.h> | 29 | #include <linux/list.h> |
29 | #include <linux/errno.h> | 30 | #include <linux/errno.h> |
30 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
@@ -67,11 +68,12 @@ static unsigned long minors[N_SPI_MINORS / BITS_PER_LONG]; | |||
67 | | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP) | 68 | | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP) |
68 | 69 | ||
69 | struct spidev_data { | 70 | struct spidev_data { |
70 | struct device dev; | 71 | dev_t devt; |
71 | spinlock_t spi_lock; | 72 | spinlock_t spi_lock; |
72 | struct spi_device *spi; | 73 | struct spi_device *spi; |
73 | struct list_head device_entry; | 74 | struct list_head device_entry; |
74 | 75 | ||
76 | /* buffer is NULL unless this device is open (users > 0) */ | ||
75 | struct mutex buf_lock; | 77 | struct mutex buf_lock; |
76 | unsigned users; | 78 | unsigned users; |
77 | u8 *buffer; | 79 | u8 *buffer; |
@@ -467,7 +469,7 @@ static int spidev_open(struct inode *inode, struct file *filp) | |||
467 | mutex_lock(&device_list_lock); | 469 | mutex_lock(&device_list_lock); |
468 | 470 | ||
469 | list_for_each_entry(spidev, &device_list, device_entry) { | 471 | list_for_each_entry(spidev, &device_list, device_entry) { |
470 | if (spidev->dev.devt == inode->i_rdev) { | 472 | if (spidev->devt == inode->i_rdev) { |
471 | status = 0; | 473 | status = 0; |
472 | break; | 474 | break; |
473 | } | 475 | } |
@@ -500,10 +502,22 @@ static int spidev_release(struct inode *inode, struct file *filp) | |||
500 | mutex_lock(&device_list_lock); | 502 | mutex_lock(&device_list_lock); |
501 | spidev = filp->private_data; | 503 | spidev = filp->private_data; |
502 | filp->private_data = NULL; | 504 | filp->private_data = NULL; |
505 | |||
506 | /* last close? */ | ||
503 | spidev->users--; | 507 | spidev->users--; |
504 | if (!spidev->users) { | 508 | if (!spidev->users) { |
509 | int dofree; | ||
510 | |||
505 | kfree(spidev->buffer); | 511 | kfree(spidev->buffer); |
506 | spidev->buffer = NULL; | 512 | spidev->buffer = NULL; |
513 | |||
514 | /* ... after we unbound from the underlying device? */ | ||
515 | spin_lock_irq(&spidev->spi_lock); | ||
516 | dofree = (spidev->spi == NULL); | ||
517 | spin_unlock_irq(&spidev->spi_lock); | ||
518 | |||
519 | if (dofree) | ||
520 | kfree(spidev); | ||
507 | } | 521 | } |
508 | mutex_unlock(&device_list_lock); | 522 | mutex_unlock(&device_list_lock); |
509 | 523 | ||
@@ -530,19 +544,7 @@ static struct file_operations spidev_fops = { | |||
530 | * It also simplifies memory management. | 544 | * It also simplifies memory management. |
531 | */ | 545 | */ |
532 | 546 | ||
533 | static void spidev_classdev_release(struct device *dev) | 547 | static struct class *spidev_class; |
534 | { | ||
535 | struct spidev_data *spidev; | ||
536 | |||
537 | spidev = container_of(dev, struct spidev_data, dev); | ||
538 | kfree(spidev); | ||
539 | } | ||
540 | |||
541 | static struct class spidev_class = { | ||
542 | .name = "spidev", | ||
543 | .owner = THIS_MODULE, | ||
544 | .dev_release = spidev_classdev_release, | ||
545 | }; | ||
546 | 548 | ||
547 | /*-------------------------------------------------------------------------*/ | 549 | /*-------------------------------------------------------------------------*/ |
548 | 550 | ||
@@ -570,20 +572,20 @@ static int spidev_probe(struct spi_device *spi) | |||
570 | mutex_lock(&device_list_lock); | 572 | mutex_lock(&device_list_lock); |
571 | minor = find_first_zero_bit(minors, N_SPI_MINORS); | 573 | minor = find_first_zero_bit(minors, N_SPI_MINORS); |
572 | if (minor < N_SPI_MINORS) { | 574 | if (minor < N_SPI_MINORS) { |
573 | spidev->dev.parent = &spi->dev; | 575 | struct device *dev; |
574 | spidev->dev.class = &spidev_class; | 576 | |
575 | spidev->dev.devt = MKDEV(SPIDEV_MAJOR, minor); | 577 | spidev->devt = MKDEV(SPIDEV_MAJOR, minor); |
576 | snprintf(spidev->dev.bus_id, sizeof spidev->dev.bus_id, | 578 | dev = device_create(spidev_class, &spi->dev, spidev->devt, |
577 | "spidev%d.%d", | 579 | "spidev%d.%d", |
578 | spi->master->bus_num, spi->chip_select); | 580 | spi->master->bus_num, spi->chip_select); |
579 | status = device_register(&spidev->dev); | 581 | status = IS_ERR(dev) ? PTR_ERR(dev) : 0; |
580 | } else { | 582 | } else { |
581 | dev_dbg(&spi->dev, "no minor number available!\n"); | 583 | dev_dbg(&spi->dev, "no minor number available!\n"); |
582 | status = -ENODEV; | 584 | status = -ENODEV; |
583 | } | 585 | } |
584 | if (status == 0) { | 586 | if (status == 0) { |
585 | set_bit(minor, minors); | 587 | set_bit(minor, minors); |
586 | dev_set_drvdata(&spi->dev, spidev); | 588 | spi_set_drvdata(spi, spidev); |
587 | list_add(&spidev->device_entry, &device_list); | 589 | list_add(&spidev->device_entry, &device_list); |
588 | } | 590 | } |
589 | mutex_unlock(&device_list_lock); | 591 | mutex_unlock(&device_list_lock); |
@@ -596,19 +598,21 @@ static int spidev_probe(struct spi_device *spi) | |||
596 | 598 | ||
597 | static int spidev_remove(struct spi_device *spi) | 599 | static int spidev_remove(struct spi_device *spi) |
598 | { | 600 | { |
599 | struct spidev_data *spidev = dev_get_drvdata(&spi->dev); | 601 | struct spidev_data *spidev = spi_get_drvdata(spi); |
600 | 602 | ||
601 | /* make sure ops on existing fds can abort cleanly */ | 603 | /* make sure ops on existing fds can abort cleanly */ |
602 | spin_lock_irq(&spidev->spi_lock); | 604 | spin_lock_irq(&spidev->spi_lock); |
603 | spidev->spi = NULL; | 605 | spidev->spi = NULL; |
606 | spi_set_drvdata(spi, NULL); | ||
604 | spin_unlock_irq(&spidev->spi_lock); | 607 | spin_unlock_irq(&spidev->spi_lock); |
605 | 608 | ||
606 | /* prevent new opens */ | 609 | /* prevent new opens */ |
607 | mutex_lock(&device_list_lock); | 610 | mutex_lock(&device_list_lock); |
608 | list_del(&spidev->device_entry); | 611 | list_del(&spidev->device_entry); |
609 | dev_set_drvdata(&spi->dev, NULL); | 612 | device_destroy(spidev_class, spidev->devt); |
610 | clear_bit(MINOR(spidev->dev.devt), minors); | 613 | clear_bit(MINOR(spidev->devt), minors); |
611 | device_unregister(&spidev->dev); | 614 | if (spidev->users == 0) |
615 | kfree(spidev); | ||
612 | mutex_unlock(&device_list_lock); | 616 | mutex_unlock(&device_list_lock); |
613 | 617 | ||
614 | return 0; | 618 | return 0; |
@@ -644,15 +648,15 @@ static int __init spidev_init(void) | |||
644 | if (status < 0) | 648 | if (status < 0) |
645 | return status; | 649 | return status; |
646 | 650 | ||
647 | status = class_register(&spidev_class); | 651 | spidev_class = class_create(THIS_MODULE, "spidev"); |
648 | if (status < 0) { | 652 | if (IS_ERR(spidev_class)) { |
649 | unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name); | 653 | unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name); |
650 | return status; | 654 | return PTR_ERR(spidev_class); |
651 | } | 655 | } |
652 | 656 | ||
653 | status = spi_register_driver(&spidev_spi); | 657 | status = spi_register_driver(&spidev_spi); |
654 | if (status < 0) { | 658 | if (status < 0) { |
655 | class_unregister(&spidev_class); | 659 | class_destroy(spidev_class); |
656 | unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name); | 660 | unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name); |
657 | } | 661 | } |
658 | return status; | 662 | return status; |
@@ -662,7 +666,7 @@ module_init(spidev_init); | |||
662 | static void __exit spidev_exit(void) | 666 | static void __exit spidev_exit(void) |
663 | { | 667 | { |
664 | spi_unregister_driver(&spidev_spi); | 668 | spi_unregister_driver(&spidev_spi); |
665 | class_unregister(&spidev_class); | 669 | class_destroy(spidev_class); |
666 | unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name); | 670 | unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name); |
667 | } | 671 | } |
668 | module_exit(spidev_exit); | 672 | module_exit(spidev_exit); |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 8eb4da332f56..94789be54ca3 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -644,6 +644,48 @@ static void hub_stop(struct usb_hub *hub) | |||
644 | 644 | ||
645 | #ifdef CONFIG_PM | 645 | #ifdef CONFIG_PM |
646 | 646 | ||
647 | /* Try to identify which devices need USB-PERSIST handling */ | ||
648 | static int persistent_device(struct usb_device *udev) | ||
649 | { | ||
650 | int i; | ||
651 | int retval; | ||
652 | struct usb_host_config *actconfig; | ||
653 | |||
654 | /* Explicitly not marked persistent? */ | ||
655 | if (!udev->persist_enabled) | ||
656 | return 0; | ||
657 | |||
658 | /* No active config? */ | ||
659 | actconfig = udev->actconfig; | ||
660 | if (!actconfig) | ||
661 | return 0; | ||
662 | |||
663 | /* FIXME! We should check whether it's open here or not! */ | ||
664 | |||
665 | /* | ||
666 | * Check that all the interface drivers have a | ||
667 | * 'reset_resume' entrypoint | ||
668 | */ | ||
669 | retval = 0; | ||
670 | for (i = 0; i < actconfig->desc.bNumInterfaces; i++) { | ||
671 | struct usb_interface *intf; | ||
672 | struct usb_driver *driver; | ||
673 | |||
674 | intf = actconfig->interface[i]; | ||
675 | if (!intf->dev.driver) | ||
676 | continue; | ||
677 | driver = to_usb_driver(intf->dev.driver); | ||
678 | if (!driver->reset_resume) | ||
679 | return 0; | ||
680 | /* | ||
681 | * We have at least one driver, and that one | ||
682 | * has a reset_resume method. | ||
683 | */ | ||
684 | retval = 1; | ||
685 | } | ||
686 | return retval; | ||
687 | } | ||
688 | |||
647 | static void hub_restart(struct usb_hub *hub, int type) | 689 | static void hub_restart(struct usb_hub *hub, int type) |
648 | { | 690 | { |
649 | struct usb_device *hdev = hub->hdev; | 691 | struct usb_device *hdev = hub->hdev; |
@@ -689,8 +731,8 @@ static void hub_restart(struct usb_hub *hub, int type) | |||
689 | * turn off the various status changes to prevent | 731 | * turn off the various status changes to prevent |
690 | * khubd from disconnecting it later. | 732 | * khubd from disconnecting it later. |
691 | */ | 733 | */ |
692 | if (udev->persist_enabled && status == 0 && | 734 | if (status == 0 && !(portstatus & USB_PORT_STAT_ENABLE) && |
693 | !(portstatus & USB_PORT_STAT_ENABLE)) { | 735 | persistent_device(udev)) { |
694 | if (portchange & USB_PORT_STAT_C_ENABLE) | 736 | if (portchange & USB_PORT_STAT_C_ENABLE) |
695 | clear_port_feature(hub->hdev, port1, | 737 | clear_port_feature(hub->hdev, port1, |
696 | USB_PORT_FEAT_C_ENABLE); | 738 | USB_PORT_FEAT_C_ENABLE); |
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 1ef6df395e0c..228797e54f9c 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -300,8 +300,8 @@ config USB_R8A66597_HCD | |||
300 | module will be called r8a66597-hcd. | 300 | module will be called r8a66597-hcd. |
301 | 301 | ||
302 | config SUPERH_ON_CHIP_R8A66597 | 302 | config SUPERH_ON_CHIP_R8A66597 |
303 | boolean "Enable SuperH on-chip USB like the R8A66597" | 303 | boolean "Enable SuperH on-chip R8A66597 USB" |
304 | depends on USB_R8A66597_HCD && CPU_SUBTYPE_SH7366 | 304 | depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723) |
305 | help | 305 | help |
306 | Renesas SuperH processor has USB like the R8A66597. | 306 | This driver enables support for the on-chip R8A66597 in the |
307 | This driver supported processor is SH7366. | 307 | SH7366 and SH7723 processors. |
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index c9cec8738261..65aa5ecf569a 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c | |||
@@ -2207,14 +2207,14 @@ struct usb_hcd *isp1760_register(u64 res_start, u64 res_len, int irq, | |||
2207 | goto err_put; | 2207 | goto err_put; |
2208 | } | 2208 | } |
2209 | 2209 | ||
2210 | ret = usb_add_hcd(hcd, irq, irqflags); | ||
2211 | if (ret) | ||
2212 | goto err_unmap; | ||
2213 | |||
2214 | hcd->irq = irq; | 2210 | hcd->irq = irq; |
2215 | hcd->rsrc_start = res_start; | 2211 | hcd->rsrc_start = res_start; |
2216 | hcd->rsrc_len = res_len; | 2212 | hcd->rsrc_len = res_len; |
2217 | 2213 | ||
2214 | ret = usb_add_hcd(hcd, irq, irqflags); | ||
2215 | if (ret) | ||
2216 | goto err_unmap; | ||
2217 | |||
2218 | return hcd; | 2218 | return hcd; |
2219 | 2219 | ||
2220 | err_unmap: | 2220 | err_unmap: |
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig index eb6c06979f3b..001789c9a11a 100644 --- a/drivers/usb/misc/Kconfig +++ b/drivers/usb/misc/Kconfig | |||
@@ -272,6 +272,7 @@ config USB_TEST | |||
272 | config USB_ISIGHTFW | 272 | config USB_ISIGHTFW |
273 | tristate "iSight firmware loading support" | 273 | tristate "iSight firmware loading support" |
274 | depends on USB | 274 | depends on USB |
275 | select FW_LOADER | ||
275 | help | 276 | help |
276 | This driver loads firmware for USB Apple iSight cameras, allowing | 277 | This driver loads firmware for USB Apple iSight cameras, allowing |
277 | them to be driven by the USB video class driver available at | 278 | them to be driven by the USB video class driver available at |
diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c index 390e04885536..9f30aa1f8a5d 100644 --- a/drivers/usb/misc/isight_firmware.c +++ b/drivers/usb/misc/isight_firmware.c | |||
@@ -39,9 +39,12 @@ static int isight_firmware_load(struct usb_interface *intf, | |||
39 | struct usb_device *dev = interface_to_usbdev(intf); | 39 | struct usb_device *dev = interface_to_usbdev(intf); |
40 | int llen, len, req, ret = 0; | 40 | int llen, len, req, ret = 0; |
41 | const struct firmware *firmware; | 41 | const struct firmware *firmware; |
42 | unsigned char *buf; | 42 | unsigned char *buf = kmalloc(50, GFP_KERNEL); |
43 | unsigned char data[4]; | 43 | unsigned char data[4]; |
44 | char *ptr; | 44 | u8 *ptr; |
45 | |||
46 | if (!buf) | ||
47 | return -ENOMEM; | ||
45 | 48 | ||
46 | if (request_firmware(&firmware, "isight.fw", &dev->dev) != 0) { | 49 | if (request_firmware(&firmware, "isight.fw", &dev->dev) != 0) { |
47 | printk(KERN_ERR "Unable to load isight firmware\n"); | 50 | printk(KERN_ERR "Unable to load isight firmware\n"); |
@@ -59,7 +62,7 @@ static int isight_firmware_load(struct usb_interface *intf, | |||
59 | goto out; | 62 | goto out; |
60 | } | 63 | } |
61 | 64 | ||
62 | while (1) { | 65 | while (ptr+4 <= firmware->data+firmware->size) { |
63 | memcpy(data, ptr, 4); | 66 | memcpy(data, ptr, 4); |
64 | len = (data[0] << 8 | data[1]); | 67 | len = (data[0] << 8 | data[1]); |
65 | req = (data[2] << 8 | data[3]); | 68 | req = (data[2] << 8 | data[3]); |
@@ -71,10 +74,14 @@ static int isight_firmware_load(struct usb_interface *intf, | |||
71 | continue; | 74 | continue; |
72 | 75 | ||
73 | for (; len > 0; req += 50) { | 76 | for (; len > 0; req += 50) { |
74 | llen = len > 50 ? 50 : len; | 77 | llen = min(len, 50); |
75 | len -= llen; | 78 | len -= llen; |
76 | 79 | if (ptr+llen > firmware->data+firmware->size) { | |
77 | buf = kmalloc(llen, GFP_KERNEL); | 80 | printk(KERN_ERR |
81 | "Malformed isight firmware"); | ||
82 | ret = -ENODEV; | ||
83 | goto out; | ||
84 | } | ||
78 | memcpy(buf, ptr, llen); | 85 | memcpy(buf, ptr, llen); |
79 | 86 | ||
80 | ptr += llen; | 87 | ptr += llen; |
@@ -89,16 +96,18 @@ static int isight_firmware_load(struct usb_interface *intf, | |||
89 | goto out; | 96 | goto out; |
90 | } | 97 | } |
91 | 98 | ||
92 | kfree(buf); | ||
93 | } | 99 | } |
94 | } | 100 | } |
101 | |||
95 | if (usb_control_msg | 102 | if (usb_control_msg |
96 | (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1, | 103 | (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1, |
97 | 300) != 1) { | 104 | 300) != 1) { |
98 | printk(KERN_ERR "isight firmware loading completion failed\n"); | 105 | printk(KERN_ERR "isight firmware loading completion failed\n"); |
99 | ret = -ENODEV; | 106 | ret = -ENODEV; |
100 | } | 107 | } |
108 | |||
101 | out: | 109 | out: |
110 | kfree(buf); | ||
102 | release_firmware(firmware); | 111 | release_firmware(firmware); |
103 | return ret; | 112 | return ret; |
104 | } | 113 | } |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 5fa8b76673cb..97aff8db10bf 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -2275,9 +2275,7 @@ static int fbcon_switch(struct vc_data *vc) | |||
2275 | * in fb_set_var() | 2275 | * in fb_set_var() |
2276 | */ | 2276 | */ |
2277 | info->var.activate = var.activate; | 2277 | info->var.activate = var.activate; |
2278 | var.yoffset = info->var.yoffset; | 2278 | var.vmode |= info->var.vmode & ~FB_VMODE_MASK; |
2279 | var.xoffset = info->var.xoffset; | ||
2280 | var.vmode = info->var.vmode; | ||
2281 | fb_set_var(info, &var); | 2279 | fb_set_var(info, &var); |
2282 | ops->var = info->var; | 2280 | ops->var = info->var; |
2283 | 2281 | ||
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index b50bb03cb5ab..0a2785361ca3 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -1320,7 +1320,7 @@ static void free_irq_local(int irq) | |||
1320 | * Power management hooks. Note that we won't be called from IRQ context, | 1320 | * Power management hooks. Note that we won't be called from IRQ context, |
1321 | * unlike the blank functions above, so we may sleep. | 1321 | * unlike the blank functions above, so we may sleep. |
1322 | */ | 1322 | */ |
1323 | static int fsl_diu_suspend(struct of_device *dev, pm_message_t state) | 1323 | static int fsl_diu_suspend(struct of_device *ofdev, pm_message_t state) |
1324 | { | 1324 | { |
1325 | struct fsl_diu_data *machine_data; | 1325 | struct fsl_diu_data *machine_data; |
1326 | 1326 | ||
@@ -1330,7 +1330,7 @@ static int fsl_diu_suspend(struct of_device *dev, pm_message_t state) | |||
1330 | return 0; | 1330 | return 0; |
1331 | } | 1331 | } |
1332 | 1332 | ||
1333 | static int fsl_diu_resume(struct of_device *dev) | 1333 | static int fsl_diu_resume(struct of_device *ofdev) |
1334 | { | 1334 | { |
1335 | struct fsl_diu_data *machine_data; | 1335 | struct fsl_diu_data *machine_data; |
1336 | 1336 | ||
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index 473562191586..d3c3af53a290 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | const char *fb_mode_option; | 30 | const char *fb_mode_option; |
31 | EXPORT_SYMBOL_GPL(fb_mode_option); | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * Standard video mode definitions (taken from XFree86) | 34 | * Standard video mode definitions (taken from XFree86) |
@@ -590,6 +591,7 @@ done: | |||
590 | "", (margins) ? " with margins" : "", (interlace) ? | 591 | "", (margins) ? " with margins" : "", (interlace) ? |
591 | " interlaced" : ""); | 592 | " interlaced" : ""); |
592 | 593 | ||
594 | memset(&cvt_mode, 0, sizeof(cvt_mode)); | ||
593 | cvt_mode.xres = xres; | 595 | cvt_mode.xres = xres; |
594 | cvt_mode.yres = yres; | 596 | cvt_mode.yres = yres; |
595 | cvt_mode.refresh = (refresh) ? refresh : 60; | 597 | cvt_mode.refresh = (refresh) ? refresh : 60; |