diff options
Diffstat (limited to 'drivers')
172 files changed, 1633 insertions, 1121 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 7c49e103cf8f..e2ce4a9c1c92 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -7,6 +7,7 @@ menu "ACPI (Advanced Configuration and Power Interface) Support" | |||
7 | depends on !X86_VISWS | 7 | depends on !X86_VISWS |
8 | depends on !IA64_HP_SIM | 8 | depends on !IA64_HP_SIM |
9 | depends on IA64 || X86 | 9 | depends on IA64 || X86 |
10 | depends on PM | ||
10 | 11 | ||
11 | config ACPI | 12 | config ACPI |
12 | bool "ACPI Support" | 13 | bool "ACPI Support" |
@@ -243,6 +244,17 @@ config ACPI_IBM_DOCK | |||
243 | 244 | ||
244 | If you are not sure, say N here. | 245 | If you are not sure, say N here. |
245 | 246 | ||
247 | config ACPI_IBM_BAY | ||
248 | bool "Legacy Removable Bay Support" | ||
249 | depends on ACPI_IBM | ||
250 | default y | ||
251 | ---help--- | ||
252 | Allows the ibm_acpi driver to handle removable bays. It will allow | ||
253 | disabling the device in the bay, and also generate notifications when | ||
254 | the bay lever is ejected or inserted. | ||
255 | |||
256 | If you are not sure, say Y here. | ||
257 | |||
246 | config ACPI_TOSHIBA | 258 | config ACPI_TOSHIBA |
247 | tristate "Toshiba Laptop Extras" | 259 | tristate "Toshiba Laptop Extras" |
248 | depends on X86 | 260 | depends on X86 |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index f289fd41e77d..3ec110ce00c8 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
@@ -79,11 +79,17 @@ static int __init blacklist_by_year(void) | |||
79 | { | 79 | { |
80 | int year = dmi_get_year(DMI_BIOS_DATE); | 80 | int year = dmi_get_year(DMI_BIOS_DATE); |
81 | /* Doesn't exist? Likely an old system */ | 81 | /* Doesn't exist? Likely an old system */ |
82 | if (year == -1) | 82 | if (year == -1) { |
83 | printk(KERN_ERR PREFIX "no DMI BIOS year, " | ||
84 | "acpi=force is required to enable ACPI\n" ); | ||
83 | return 1; | 85 | return 1; |
86 | } | ||
84 | /* 0? Likely a buggy new BIOS */ | 87 | /* 0? Likely a buggy new BIOS */ |
85 | if (year == 0) | 88 | if (year == 0) { |
89 | printk(KERN_ERR PREFIX "DMI BIOS year==0, " | ||
90 | "assuming ACPI-capable machine\n" ); | ||
86 | return 0; | 91 | return 0; |
92 | } | ||
87 | if (year < CONFIG_ACPI_BLACKLIST_YEAR) { | 93 | if (year < CONFIG_ACPI_BLACKLIST_YEAR) { |
88 | printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), " | 94 | printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), " |
89 | "acpi=force is required to enable ACPI\n", | 95 | "acpi=force is required to enable ACPI\n", |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index ab6888373795..a802962ff2b4 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -100,6 +100,7 @@ static struct acpi_ec { | |||
100 | unsigned long global_lock; | 100 | unsigned long global_lock; |
101 | struct mutex lock; | 101 | struct mutex lock; |
102 | atomic_t query_pending; | 102 | atomic_t query_pending; |
103 | atomic_t event_count; | ||
103 | atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort */ | 104 | atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort */ |
104 | wait_queue_head_t wait; | 105 | wait_queue_head_t wait; |
105 | } *ec_ecdt; | 106 | } *ec_ecdt; |
@@ -131,10 +132,12 @@ static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) | |||
131 | outb(data, ec->data_addr); | 132 | outb(data, ec->data_addr); |
132 | } | 133 | } |
133 | 134 | ||
134 | static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event) | 135 | static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event, |
136 | unsigned old_count) | ||
135 | { | 137 | { |
136 | u8 status = acpi_ec_read_status(ec); | 138 | u8 status = acpi_ec_read_status(ec); |
137 | 139 | if (old_count == atomic_read(&ec->event_count)) | |
140 | return 0; | ||
138 | if (event == ACPI_EC_EVENT_OBF_1) { | 141 | if (event == ACPI_EC_EVENT_OBF_1) { |
139 | if (status & ACPI_EC_FLAG_OBF) | 142 | if (status & ACPI_EC_FLAG_OBF) |
140 | return 1; | 143 | return 1; |
@@ -146,19 +149,19 @@ static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event) | |||
146 | return 0; | 149 | return 0; |
147 | } | 150 | } |
148 | 151 | ||
149 | static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event) | 152 | static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, unsigned count) |
150 | { | 153 | { |
151 | if (acpi_ec_mode == EC_POLL) { | 154 | if (acpi_ec_mode == EC_POLL) { |
152 | unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY); | 155 | unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY); |
153 | while (time_before(jiffies, delay)) { | 156 | while (time_before(jiffies, delay)) { |
154 | if (acpi_ec_check_status(ec, event)) | 157 | if (acpi_ec_check_status(ec, event, 0)) |
155 | return 0; | 158 | return 0; |
156 | } | 159 | } |
157 | } else { | 160 | } else { |
158 | if (wait_event_timeout(ec->wait, | 161 | if (wait_event_timeout(ec->wait, |
159 | acpi_ec_check_status(ec, event), | 162 | acpi_ec_check_status(ec, event, count), |
160 | msecs_to_jiffies(ACPI_EC_DELAY)) || | 163 | msecs_to_jiffies(ACPI_EC_DELAY)) || |
161 | acpi_ec_check_status(ec, event)) { | 164 | acpi_ec_check_status(ec, event, 0)) { |
162 | return 0; | 165 | return 0; |
163 | } else { | 166 | } else { |
164 | printk(KERN_ERR PREFIX "acpi_ec_wait timeout," | 167 | printk(KERN_ERR PREFIX "acpi_ec_wait timeout," |
@@ -225,21 +228,22 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command, | |||
225 | u8 * rdata, unsigned rdata_len) | 228 | u8 * rdata, unsigned rdata_len) |
226 | { | 229 | { |
227 | int result = 0; | 230 | int result = 0; |
228 | 231 | unsigned count = atomic_read(&ec->event_count); | |
229 | acpi_ec_write_cmd(ec, command); | 232 | acpi_ec_write_cmd(ec, command); |
230 | 233 | ||
231 | for (; wdata_len > 0; --wdata_len) { | 234 | for (; wdata_len > 0; --wdata_len) { |
232 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0); | 235 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count); |
233 | if (result) { | 236 | if (result) { |
234 | printk(KERN_ERR PREFIX | 237 | printk(KERN_ERR PREFIX |
235 | "write_cmd timeout, command = %d\n", command); | 238 | "write_cmd timeout, command = %d\n", command); |
236 | goto end; | 239 | goto end; |
237 | } | 240 | } |
241 | count = atomic_read(&ec->event_count); | ||
238 | acpi_ec_write_data(ec, *(wdata++)); | 242 | acpi_ec_write_data(ec, *(wdata++)); |
239 | } | 243 | } |
240 | 244 | ||
241 | if (!rdata_len) { | 245 | if (!rdata_len) { |
242 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0); | 246 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count); |
243 | if (result) { | 247 | if (result) { |
244 | printk(KERN_ERR PREFIX | 248 | printk(KERN_ERR PREFIX |
245 | "finish-write timeout, command = %d\n", command); | 249 | "finish-write timeout, command = %d\n", command); |
@@ -250,13 +254,13 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command, | |||
250 | } | 254 | } |
251 | 255 | ||
252 | for (; rdata_len > 0; --rdata_len) { | 256 | for (; rdata_len > 0; --rdata_len) { |
253 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1); | 257 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, count); |
254 | if (result) { | 258 | if (result) { |
255 | printk(KERN_ERR PREFIX "read timeout, command = %d\n", | 259 | printk(KERN_ERR PREFIX "read timeout, command = %d\n", |
256 | command); | 260 | command); |
257 | goto end; | 261 | goto end; |
258 | } | 262 | } |
259 | 263 | count = atomic_read(&ec->event_count); | |
260 | *(rdata++) = acpi_ec_read_data(ec); | 264 | *(rdata++) = acpi_ec_read_data(ec); |
261 | } | 265 | } |
262 | end: | 266 | end: |
@@ -288,7 +292,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, | |||
288 | /* Make sure GPE is enabled before doing transaction */ | 292 | /* Make sure GPE is enabled before doing transaction */ |
289 | acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); | 293 | acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); |
290 | 294 | ||
291 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0); | 295 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0); |
292 | if (status) { | 296 | if (status) { |
293 | printk(KERN_DEBUG PREFIX | 297 | printk(KERN_DEBUG PREFIX |
294 | "input buffer is not empty, aborting transaction\n"); | 298 | "input buffer is not empty, aborting transaction\n"); |
@@ -369,8 +373,8 @@ int ec_write(u8 addr, u8 val) | |||
369 | EXPORT_SYMBOL(ec_write); | 373 | EXPORT_SYMBOL(ec_write); |
370 | 374 | ||
371 | int ec_transaction(u8 command, | 375 | int ec_transaction(u8 command, |
372 | const u8 * wdata, unsigned wdata_len, | 376 | const u8 * wdata, unsigned wdata_len, |
373 | u8 * rdata, unsigned rdata_len) | 377 | u8 * rdata, unsigned rdata_len) |
374 | { | 378 | { |
375 | struct acpi_ec *ec; | 379 | struct acpi_ec *ec; |
376 | 380 | ||
@@ -435,7 +439,7 @@ static u32 acpi_ec_gpe_handler(void *data) | |||
435 | acpi_status status = AE_OK; | 439 | acpi_status status = AE_OK; |
436 | u8 value; | 440 | u8 value; |
437 | struct acpi_ec *ec = (struct acpi_ec *)data; | 441 | struct acpi_ec *ec = (struct acpi_ec *)data; |
438 | 442 | atomic_inc(&ec->event_count); | |
439 | if (acpi_ec_mode == EC_INTR) { | 443 | if (acpi_ec_mode == EC_INTR) { |
440 | wake_up(&ec->wait); | 444 | wake_up(&ec->wait); |
441 | } | 445 | } |
@@ -633,6 +637,7 @@ static int acpi_ec_add(struct acpi_device *device) | |||
633 | ec->uid = -1; | 637 | ec->uid = -1; |
634 | mutex_init(&ec->lock); | 638 | mutex_init(&ec->lock); |
635 | atomic_set(&ec->query_pending, 0); | 639 | atomic_set(&ec->query_pending, 0); |
640 | atomic_set(&ec->event_count, 1); | ||
636 | if (acpi_ec_mode == EC_INTR) { | 641 | if (acpi_ec_mode == EC_INTR) { |
637 | atomic_set(&ec->leaving_burst, 1); | 642 | atomic_set(&ec->leaving_burst, 1); |
638 | init_waitqueue_head(&ec->wait); | 643 | init_waitqueue_head(&ec->wait); |
@@ -807,6 +812,7 @@ acpi_fake_ecdt_callback(acpi_handle handle, | |||
807 | acpi_status status; | 812 | acpi_status status; |
808 | 813 | ||
809 | mutex_init(&ec_ecdt->lock); | 814 | mutex_init(&ec_ecdt->lock); |
815 | atomic_set(&ec_ecdt->event_count, 1); | ||
810 | if (acpi_ec_mode == EC_INTR) { | 816 | if (acpi_ec_mode == EC_INTR) { |
811 | init_waitqueue_head(&ec_ecdt->wait); | 817 | init_waitqueue_head(&ec_ecdt->wait); |
812 | } | 818 | } |
@@ -888,6 +894,7 @@ static int __init acpi_ec_get_real_ecdt(void) | |||
888 | return -ENOMEM; | 894 | return -ENOMEM; |
889 | 895 | ||
890 | mutex_init(&ec_ecdt->lock); | 896 | mutex_init(&ec_ecdt->lock); |
897 | atomic_set(&ec_ecdt->event_count, 1); | ||
891 | if (acpi_ec_mode == EC_INTR) { | 898 | if (acpi_ec_mode == EC_INTR) { |
892 | init_waitqueue_head(&ec_ecdt->wait); | 899 | init_waitqueue_head(&ec_ecdt->wait); |
893 | } | 900 | } |
@@ -1016,8 +1023,7 @@ static int __init acpi_ec_set_intr_mode(char *str) | |||
1016 | acpi_ec_mode = EC_POLL; | 1023 | acpi_ec_mode = EC_POLL; |
1017 | } | 1024 | } |
1018 | acpi_ec_driver.ops.add = acpi_ec_add; | 1025 | acpi_ec_driver.ops.add = acpi_ec_add; |
1019 | printk(KERN_NOTICE PREFIX "%s mode.\n", | 1026 | printk(KERN_NOTICE PREFIX "%s mode.\n", intr ? "interrupt" : "polling"); |
1020 | intr ? "interrupt" : "polling"); | ||
1021 | 1027 | ||
1022 | return 1; | 1028 | return 1; |
1023 | } | 1029 | } |
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index d572700197f3..cae786ca8600 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c | |||
@@ -196,11 +196,15 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
196 | notify_info->notify.value = (u16) notify_value; | 196 | notify_info->notify.value = (u16) notify_value; |
197 | notify_info->notify.handler_obj = handler_obj; | 197 | notify_info->notify.handler_obj = handler_obj; |
198 | 198 | ||
199 | acpi_ex_relinquish_interpreter(); | 199 | acpi_ex_exit_interpreter(); |
200 | 200 | ||
201 | acpi_ev_notify_dispatch(notify_info); | 201 | acpi_ev_notify_dispatch(notify_info); |
202 | 202 | ||
203 | acpi_ex_reacquire_interpreter(); | 203 | status = acpi_ex_enter_interpreter(); |
204 | if (ACPI_FAILURE(status)) { | ||
205 | return_ACPI_STATUS(status); | ||
206 | } | ||
207 | |||
204 | } | 208 | } |
205 | 209 | ||
206 | if (!handler_obj) { | 210 | if (!handler_obj) { |
@@ -423,6 +427,8 @@ static acpi_status acpi_ev_remove_global_lock_handler(void) | |||
423 | * the global lock appear as a standard mutex on the OS side. | 427 | * the global lock appear as a standard mutex on the OS side. |
424 | * | 428 | * |
425 | *****************************************************************************/ | 429 | *****************************************************************************/ |
430 | static acpi_thread_id acpi_ev_global_lock_thread_id; | ||
431 | static int acpi_ev_global_lock_acquired; | ||
426 | 432 | ||
427 | acpi_status acpi_ev_acquire_global_lock(u16 timeout) | 433 | acpi_status acpi_ev_acquire_global_lock(u16 timeout) |
428 | { | 434 | { |
@@ -435,11 +441,24 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout) | |||
435 | * Only one thread can acquire the GL at a time, the global_lock_mutex | 441 | * Only one thread can acquire the GL at a time, the global_lock_mutex |
436 | * enforces this. This interface releases the interpreter if we must wait. | 442 | * enforces this. This interface releases the interpreter if we must wait. |
437 | */ | 443 | */ |
438 | status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, timeout); | 444 | status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, 0); |
445 | if (status == AE_TIME) { | ||
446 | if (acpi_ev_global_lock_thread_id == acpi_os_get_thread_id()) { | ||
447 | acpi_ev_global_lock_acquired++; | ||
448 | return AE_OK; | ||
449 | } | ||
450 | } | ||
451 | |||
452 | if (ACPI_FAILURE(status)) { | ||
453 | status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, timeout); | ||
454 | } | ||
439 | if (ACPI_FAILURE(status)) { | 455 | if (ACPI_FAILURE(status)) { |
440 | return_ACPI_STATUS(status); | 456 | return_ACPI_STATUS(status); |
441 | } | 457 | } |
442 | 458 | ||
459 | acpi_ev_global_lock_thread_id = acpi_os_get_thread_id(); | ||
460 | acpi_ev_global_lock_acquired++; | ||
461 | |||
443 | /* | 462 | /* |
444 | * Make sure that a global lock actually exists. If not, just treat | 463 | * Make sure that a global lock actually exists. If not, just treat |
445 | * the lock as a standard mutex. | 464 | * the lock as a standard mutex. |
@@ -506,6 +525,11 @@ acpi_status acpi_ev_release_global_lock(void) | |||
506 | return_ACPI_STATUS(AE_NOT_ACQUIRED); | 525 | return_ACPI_STATUS(AE_NOT_ACQUIRED); |
507 | } | 526 | } |
508 | 527 | ||
528 | acpi_ev_global_lock_acquired--; | ||
529 | if (acpi_ev_global_lock_acquired > 0) { | ||
530 | return AE_OK; | ||
531 | } | ||
532 | |||
509 | if (acpi_gbl_global_lock_present) { | 533 | if (acpi_gbl_global_lock_present) { |
510 | 534 | ||
511 | /* Allow any thread to release the lock */ | 535 | /* Allow any thread to release the lock */ |
@@ -529,7 +553,8 @@ acpi_status acpi_ev_release_global_lock(void) | |||
529 | acpi_gbl_global_lock_acquired = FALSE; | 553 | acpi_gbl_global_lock_acquired = FALSE; |
530 | 554 | ||
531 | /* Release the local GL mutex */ | 555 | /* Release the local GL mutex */ |
532 | 556 | acpi_ev_global_lock_thread_id = NULL; | |
557 | acpi_ev_global_lock_acquired = 0; | ||
533 | acpi_os_release_mutex(acpi_gbl_global_lock_mutex); | 558 | acpi_os_release_mutex(acpi_gbl_global_lock_mutex); |
534 | return_ACPI_STATUS(status); | 559 | return_ACPI_STATUS(status); |
535 | } | 560 | } |
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c index e99f0c435a47..96b0e8431748 100644 --- a/drivers/acpi/events/evregion.c +++ b/drivers/acpi/events/evregion.c | |||
@@ -291,6 +291,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
291 | u32 bit_width, acpi_integer * value) | 291 | u32 bit_width, acpi_integer * value) |
292 | { | 292 | { |
293 | acpi_status status; | 293 | acpi_status status; |
294 | acpi_status status2; | ||
294 | acpi_adr_space_handler handler; | 295 | acpi_adr_space_handler handler; |
295 | acpi_adr_space_setup region_setup; | 296 | acpi_adr_space_setup region_setup; |
296 | union acpi_operand_object *handler_desc; | 297 | union acpi_operand_object *handler_desc; |
@@ -344,7 +345,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
344 | * setup will potentially execute control methods | 345 | * setup will potentially execute control methods |
345 | * (e.g., _REG method for this region) | 346 | * (e.g., _REG method for this region) |
346 | */ | 347 | */ |
347 | acpi_ex_relinquish_interpreter(); | 348 | acpi_ex_exit_interpreter(); |
348 | 349 | ||
349 | status = region_setup(region_obj, ACPI_REGION_ACTIVATE, | 350 | status = region_setup(region_obj, ACPI_REGION_ACTIVATE, |
350 | handler_desc->address_space.context, | 351 | handler_desc->address_space.context, |
@@ -352,7 +353,10 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
352 | 353 | ||
353 | /* Re-enter the interpreter */ | 354 | /* Re-enter the interpreter */ |
354 | 355 | ||
355 | acpi_ex_reacquire_interpreter(); | 356 | status2 = acpi_ex_enter_interpreter(); |
357 | if (ACPI_FAILURE(status2)) { | ||
358 | return_ACPI_STATUS(status2); | ||
359 | } | ||
356 | 360 | ||
357 | /* Check for failure of the Region Setup */ | 361 | /* Check for failure of the Region Setup */ |
358 | 362 | ||
@@ -405,7 +409,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
405 | * exit the interpreter because the handler *might* block -- we don't | 409 | * exit the interpreter because the handler *might* block -- we don't |
406 | * know what it will do, so we can't hold the lock on the intepreter. | 410 | * know what it will do, so we can't hold the lock on the intepreter. |
407 | */ | 411 | */ |
408 | acpi_ex_relinquish_interpreter(); | 412 | acpi_ex_exit_interpreter(); |
409 | } | 413 | } |
410 | 414 | ||
411 | /* Call the handler */ | 415 | /* Call the handler */ |
@@ -426,7 +430,10 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
426 | * We just returned from a non-default handler, we must re-enter the | 430 | * We just returned from a non-default handler, we must re-enter the |
427 | * interpreter | 431 | * interpreter |
428 | */ | 432 | */ |
429 | acpi_ex_reacquire_interpreter(); | 433 | status2 = acpi_ex_enter_interpreter(); |
434 | if (ACPI_FAILURE(status2)) { | ||
435 | return_ACPI_STATUS(status2); | ||
436 | } | ||
430 | } | 437 | } |
431 | 438 | ||
432 | return_ACPI_STATUS(status); | 439 | return_ACPI_STATUS(status); |
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c index 685a103a3587..a3379bafa676 100644 --- a/drivers/acpi/events/evxface.c +++ b/drivers/acpi/events/evxface.c | |||
@@ -768,9 +768,11 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle) | |||
768 | return (AE_BAD_PARAMETER); | 768 | return (AE_BAD_PARAMETER); |
769 | } | 769 | } |
770 | 770 | ||
771 | /* Must lock interpreter to prevent race conditions */ | 771 | status = acpi_ex_enter_interpreter(); |
772 | if (ACPI_FAILURE(status)) { | ||
773 | return (status); | ||
774 | } | ||
772 | 775 | ||
773 | acpi_ex_enter_interpreter(); | ||
774 | status = acpi_ev_acquire_global_lock(timeout); | 776 | status = acpi_ev_acquire_global_lock(timeout); |
775 | acpi_ex_exit_interpreter(); | 777 | acpi_ex_exit_interpreter(); |
776 | 778 | ||
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c index 7c38528a7e83..ae97812681a3 100644 --- a/drivers/acpi/executer/excreate.c +++ b/drivers/acpi/executer/excreate.c | |||
@@ -583,7 +583,10 @@ acpi_ex_create_method(u8 * aml_start, | |||
583 | * Get the sync_level. If method is serialized, a mutex will be | 583 | * Get the sync_level. If method is serialized, a mutex will be |
584 | * created for this method when it is parsed. | 584 | * created for this method when it is parsed. |
585 | */ | 585 | */ |
586 | if (method_flags & AML_METHOD_SERIALIZED) { | 586 | if (acpi_gbl_all_methods_serialized) { |
587 | obj_desc->method.sync_level = 0; | ||
588 | obj_desc->method.method_flags |= AML_METHOD_SERIALIZED; | ||
589 | } else if (method_flags & AML_METHOD_SERIALIZED) { | ||
587 | /* | 590 | /* |
588 | * ACPI 1.0: sync_level = 0 | 591 | * ACPI 1.0: sync_level = 0 |
589 | * ACPI 2.0: sync_level = sync_level in method declaration | 592 | * ACPI 2.0: sync_level = sync_level in method declaration |
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c index 9460baff3032..b2edf620ba89 100644 --- a/drivers/acpi/executer/exsystem.c +++ b/drivers/acpi/executer/exsystem.c | |||
@@ -66,6 +66,7 @@ ACPI_MODULE_NAME("exsystem") | |||
66 | acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) | 66 | acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) |
67 | { | 67 | { |
68 | acpi_status status; | 68 | acpi_status status; |
69 | acpi_status status2; | ||
69 | 70 | ||
70 | ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); | 71 | ACPI_FUNCTION_TRACE(ex_system_wait_semaphore); |
71 | 72 | ||
@@ -78,7 +79,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) | |||
78 | 79 | ||
79 | /* We must wait, so unlock the interpreter */ | 80 | /* We must wait, so unlock the interpreter */ |
80 | 81 | ||
81 | acpi_ex_relinquish_interpreter(); | 82 | acpi_ex_exit_interpreter(); |
82 | 83 | ||
83 | status = acpi_os_wait_semaphore(semaphore, 1, timeout); | 84 | status = acpi_os_wait_semaphore(semaphore, 1, timeout); |
84 | 85 | ||
@@ -88,7 +89,13 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) | |||
88 | 89 | ||
89 | /* Reacquire the interpreter */ | 90 | /* Reacquire the interpreter */ |
90 | 91 | ||
91 | acpi_ex_reacquire_interpreter(); | 92 | status2 = acpi_ex_enter_interpreter(); |
93 | if (ACPI_FAILURE(status2)) { | ||
94 | |||
95 | /* Report fatal error, could not acquire interpreter */ | ||
96 | |||
97 | return_ACPI_STATUS(status2); | ||
98 | } | ||
92 | } | 99 | } |
93 | 100 | ||
94 | return_ACPI_STATUS(status); | 101 | return_ACPI_STATUS(status); |
@@ -112,6 +119,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) | |||
112 | acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) | 119 | acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) |
113 | { | 120 | { |
114 | acpi_status status; | 121 | acpi_status status; |
122 | acpi_status status2; | ||
115 | 123 | ||
116 | ACPI_FUNCTION_TRACE(ex_system_wait_mutex); | 124 | ACPI_FUNCTION_TRACE(ex_system_wait_mutex); |
117 | 125 | ||
@@ -124,7 +132,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) | |||
124 | 132 | ||
125 | /* We must wait, so unlock the interpreter */ | 133 | /* We must wait, so unlock the interpreter */ |
126 | 134 | ||
127 | acpi_ex_relinquish_interpreter(); | 135 | acpi_ex_exit_interpreter(); |
128 | 136 | ||
129 | status = acpi_os_acquire_mutex(mutex, timeout); | 137 | status = acpi_os_acquire_mutex(mutex, timeout); |
130 | 138 | ||
@@ -134,7 +142,13 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) | |||
134 | 142 | ||
135 | /* Reacquire the interpreter */ | 143 | /* Reacquire the interpreter */ |
136 | 144 | ||
137 | acpi_ex_reacquire_interpreter(); | 145 | status2 = acpi_ex_enter_interpreter(); |
146 | if (ACPI_FAILURE(status2)) { | ||
147 | |||
148 | /* Report fatal error, could not acquire interpreter */ | ||
149 | |||
150 | return_ACPI_STATUS(status2); | ||
151 | } | ||
138 | } | 152 | } |
139 | 153 | ||
140 | return_ACPI_STATUS(status); | 154 | return_ACPI_STATUS(status); |
@@ -195,18 +209,20 @@ acpi_status acpi_ex_system_do_stall(u32 how_long) | |||
195 | 209 | ||
196 | acpi_status acpi_ex_system_do_suspend(acpi_integer how_long) | 210 | acpi_status acpi_ex_system_do_suspend(acpi_integer how_long) |
197 | { | 211 | { |
212 | acpi_status status; | ||
213 | |||
198 | ACPI_FUNCTION_ENTRY(); | 214 | ACPI_FUNCTION_ENTRY(); |
199 | 215 | ||
200 | /* Since this thread will sleep, we must release the interpreter */ | 216 | /* Since this thread will sleep, we must release the interpreter */ |
201 | 217 | ||
202 | acpi_ex_relinquish_interpreter(); | 218 | acpi_ex_exit_interpreter(); |
203 | 219 | ||
204 | acpi_os_sleep(how_long); | 220 | acpi_os_sleep(how_long); |
205 | 221 | ||
206 | /* And now we must get the interpreter again */ | 222 | /* And now we must get the interpreter again */ |
207 | 223 | ||
208 | acpi_ex_reacquire_interpreter(); | 224 | status = acpi_ex_enter_interpreter(); |
209 | return (AE_OK); | 225 | return (status); |
210 | } | 226 | } |
211 | 227 | ||
212 | /******************************************************************************* | 228 | /******************************************************************************* |
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c index 6b0aeccbb69b..aea461f3a48c 100644 --- a/drivers/acpi/executer/exutils.c +++ b/drivers/acpi/executer/exutils.c | |||
@@ -76,15 +76,14 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base); | |||
76 | * | 76 | * |
77 | * PARAMETERS: None | 77 | * PARAMETERS: None |
78 | * | 78 | * |
79 | * RETURN: None | 79 | * RETURN: Status |
80 | * | 80 | * |
81 | * DESCRIPTION: Enter the interpreter execution region. Failure to enter | 81 | * DESCRIPTION: Enter the interpreter execution region. Failure to enter |
82 | * the interpreter region is a fatal system error. Used in | 82 | * the interpreter region is a fatal system error |
83 | * conjunction with exit_interpreter. | ||
84 | * | 83 | * |
85 | ******************************************************************************/ | 84 | ******************************************************************************/ |
86 | 85 | ||
87 | void acpi_ex_enter_interpreter(void) | 86 | acpi_status acpi_ex_enter_interpreter(void) |
88 | { | 87 | { |
89 | acpi_status status; | 88 | acpi_status status; |
90 | 89 | ||
@@ -92,42 +91,10 @@ void acpi_ex_enter_interpreter(void) | |||
92 | 91 | ||
93 | status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); | 92 | status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); |
94 | if (ACPI_FAILURE(status)) { | 93 | if (ACPI_FAILURE(status)) { |
95 | ACPI_ERROR((AE_INFO, | 94 | ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex")); |
96 | "Could not acquire AML Interpreter mutex")); | ||
97 | } | 95 | } |
98 | 96 | ||
99 | return_VOID; | 97 | return_ACPI_STATUS(status); |
100 | } | ||
101 | |||
102 | /******************************************************************************* | ||
103 | * | ||
104 | * FUNCTION: acpi_ex_reacquire_interpreter | ||
105 | * | ||
106 | * PARAMETERS: None | ||
107 | * | ||
108 | * RETURN: None | ||
109 | * | ||
110 | * DESCRIPTION: Reacquire the interpreter execution region from within the | ||
111 | * interpreter code. Failure to enter the interpreter region is a | ||
112 | * fatal system error. Used in conjuction with | ||
113 | * relinquish_interpreter | ||
114 | * | ||
115 | ******************************************************************************/ | ||
116 | |||
117 | void acpi_ex_reacquire_interpreter(void) | ||
118 | { | ||
119 | ACPI_FUNCTION_TRACE(ex_reacquire_interpreter); | ||
120 | |||
121 | /* | ||
122 | * If the global serialized flag is set, do not release the interpreter, | ||
123 | * since it was not actually released by acpi_ex_relinquish_interpreter. | ||
124 | * This forces the interpreter to be single threaded. | ||
125 | */ | ||
126 | if (!acpi_gbl_all_methods_serialized) { | ||
127 | acpi_ex_enter_interpreter(); | ||
128 | } | ||
129 | |||
130 | return_VOID; | ||
131 | } | 98 | } |
132 | 99 | ||
133 | /******************************************************************************* | 100 | /******************************************************************************* |
@@ -138,9 +105,17 @@ void acpi_ex_reacquire_interpreter(void) | |||
138 | * | 105 | * |
139 | * RETURN: None | 106 | * RETURN: None |
140 | * | 107 | * |
141 | * DESCRIPTION: Exit the interpreter execution region. This is the top level | 108 | * DESCRIPTION: Exit the interpreter execution region |
142 | * routine used to exit the interpreter when all processing has | 109 | * |
143 | * been completed. | 110 | * Cases where the interpreter is unlocked: |
111 | * 1) Completion of the execution of a control method | ||
112 | * 2) Method blocked on a Sleep() AML opcode | ||
113 | * 3) Method blocked on an Acquire() AML opcode | ||
114 | * 4) Method blocked on a Wait() AML opcode | ||
115 | * 5) Method blocked to acquire the global lock | ||
116 | * 6) Method blocked to execute a serialized control method that is | ||
117 | * already executing | ||
118 | * 7) About to invoke a user-installed opregion handler | ||
144 | * | 119 | * |
145 | ******************************************************************************/ | 120 | ******************************************************************************/ |
146 | 121 | ||
@@ -152,46 +127,7 @@ void acpi_ex_exit_interpreter(void) | |||
152 | 127 | ||
153 | status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); | 128 | status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); |
154 | if (ACPI_FAILURE(status)) { | 129 | if (ACPI_FAILURE(status)) { |
155 | ACPI_ERROR((AE_INFO, | 130 | ACPI_ERROR((AE_INFO, "Could not release interpreter mutex")); |
156 | "Could not release AML Interpreter mutex")); | ||
157 | } | ||
158 | |||
159 | return_VOID; | ||
160 | } | ||
161 | |||
162 | /******************************************************************************* | ||
163 | * | ||
164 | * FUNCTION: acpi_ex_relinquish_interpreter | ||
165 | * | ||
166 | * PARAMETERS: None | ||
167 | * | ||
168 | * RETURN: None | ||
169 | * | ||
170 | * DESCRIPTION: Exit the interpreter execution region, from within the | ||
171 | * interpreter - before attempting an operation that will possibly | ||
172 | * block the running thread. | ||
173 | * | ||
174 | * Cases where the interpreter is unlocked internally | ||
175 | * 1) Method to be blocked on a Sleep() AML opcode | ||
176 | * 2) Method to be blocked on an Acquire() AML opcode | ||
177 | * 3) Method to be blocked on a Wait() AML opcode | ||
178 | * 4) Method to be blocked to acquire the global lock | ||
179 | * 5) Method to be blocked waiting to execute a serialized control method | ||
180 | * that is currently executing | ||
181 | * 6) About to invoke a user-installed opregion handler | ||
182 | * | ||
183 | ******************************************************************************/ | ||
184 | |||
185 | void acpi_ex_relinquish_interpreter(void) | ||
186 | { | ||
187 | ACPI_FUNCTION_TRACE(ex_relinquish_interpreter); | ||
188 | |||
189 | /* | ||
190 | * If the global serialized flag is set, do not release the interpreter. | ||
191 | * This forces the interpreter to be single threaded. | ||
192 | */ | ||
193 | if (!acpi_gbl_all_methods_serialized) { | ||
194 | acpi_ex_exit_interpreter(); | ||
195 | } | 131 | } |
196 | 132 | ||
197 | return_VOID; | 133 | return_VOID; |
@@ -205,8 +141,8 @@ void acpi_ex_relinquish_interpreter(void) | |||
205 | * | 141 | * |
206 | * RETURN: none | 142 | * RETURN: none |
207 | * | 143 | * |
208 | * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is | 144 | * DESCRIPTION: Truncate a number to 32-bits if the currently executing method |
209 | * 32-bit, as determined by the revision of the DSDT. | 145 | * belongs to a 32-bit ACPI table. |
210 | * | 146 | * |
211 | ******************************************************************************/ | 147 | ******************************************************************************/ |
212 | 148 | ||
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index 8fa93125fd4c..c84b1faba28c 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -300,6 +300,11 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
300 | /* | 300 | /* |
301 | * 2) Enable all wakeup GPEs | 301 | * 2) Enable all wakeup GPEs |
302 | */ | 302 | */ |
303 | status = acpi_hw_disable_all_gpes(); | ||
304 | if (ACPI_FAILURE(status)) { | ||
305 | return_ACPI_STATUS(status); | ||
306 | } | ||
307 | |||
303 | acpi_gbl_system_awake_and_running = FALSE; | 308 | acpi_gbl_system_awake_and_running = FALSE; |
304 | 309 | ||
305 | status = acpi_hw_enable_all_wakeup_gpes(); | 310 | status = acpi_hw_enable_all_wakeup_gpes(); |
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index 4cc534e36e81..dc1096608f43 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c | |||
@@ -86,6 +86,7 @@ | |||
86 | 86 | ||
87 | #include <linux/proc_fs.h> | 87 | #include <linux/proc_fs.h> |
88 | #include <linux/backlight.h> | 88 | #include <linux/backlight.h> |
89 | #include <linux/fb.h> | ||
89 | #include <asm/uaccess.h> | 90 | #include <asm/uaccess.h> |
90 | 91 | ||
91 | #include <linux/dmi.h> | 92 | #include <linux/dmi.h> |
@@ -157,6 +158,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ | |||
157 | "\\_SB.PCI.ISA.SLCE", /* 570 */ | 158 | "\\_SB.PCI.ISA.SLCE", /* 570 */ |
158 | ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ | 159 | ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ |
159 | #endif | 160 | #endif |
161 | #ifdef CONFIG_ACPI_IBM_BAY | ||
160 | IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ | 162 | IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ |
161 | "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ | 163 | "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ |
162 | "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ | 164 | "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ |
@@ -174,6 +176,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */ | |||
174 | IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ | 176 | IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ |
175 | "_EJ0", /* 770x */ | 177 | "_EJ0", /* 770x */ |
176 | ); /* all others */ | 178 | ); /* all others */ |
179 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
177 | 180 | ||
178 | /* don't list other alternatives as we install a notify handler on the 570 */ | 181 | /* don't list other alternatives as we install a notify handler on the 570 */ |
179 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ | 182 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ |
@@ -1044,6 +1047,7 @@ static int light_write(char *buf) | |||
1044 | return 0; | 1047 | return 0; |
1045 | } | 1048 | } |
1046 | 1049 | ||
1050 | #if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY) | ||
1047 | static int _sta(acpi_handle handle) | 1051 | static int _sta(acpi_handle handle) |
1048 | { | 1052 | { |
1049 | int status; | 1053 | int status; |
@@ -1053,6 +1057,7 @@ static int _sta(acpi_handle handle) | |||
1053 | 1057 | ||
1054 | return status; | 1058 | return status; |
1055 | } | 1059 | } |
1060 | #endif | ||
1056 | 1061 | ||
1057 | #ifdef CONFIG_ACPI_IBM_DOCK | 1062 | #ifdef CONFIG_ACPI_IBM_DOCK |
1058 | #define dock_docked() (_sta(dock_handle) & 1) | 1063 | #define dock_docked() (_sta(dock_handle) & 1) |
@@ -1119,6 +1124,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event) | |||
1119 | } | 1124 | } |
1120 | #endif | 1125 | #endif |
1121 | 1126 | ||
1127 | #ifdef CONFIG_ACPI_IBM_BAY | ||
1122 | static int bay_status_supported; | 1128 | static int bay_status_supported; |
1123 | static int bay_status2_supported; | 1129 | static int bay_status2_supported; |
1124 | static int bay_eject_supported; | 1130 | static int bay_eject_supported; |
@@ -1194,6 +1200,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event) | |||
1194 | { | 1200 | { |
1195 | acpi_bus_generate_event(ibm->device, event, 0); | 1201 | acpi_bus_generate_event(ibm->device, event, 0); |
1196 | } | 1202 | } |
1203 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
1197 | 1204 | ||
1198 | static int cmos_read(char *p) | 1205 | static int cmos_read(char *p) |
1199 | { | 1206 | { |
@@ -1701,7 +1708,10 @@ static int brightness_write(char *buf) | |||
1701 | 1708 | ||
1702 | static int brightness_update_status(struct backlight_device *bd) | 1709 | static int brightness_update_status(struct backlight_device *bd) |
1703 | { | 1710 | { |
1704 | return brightness_set(bd->props.brightness); | 1711 | return brightness_set( |
1712 | (bd->props.fb_blank == FB_BLANK_UNBLANK && | ||
1713 | bd->props.power == FB_BLANK_UNBLANK) ? | ||
1714 | bd->props.brightness : 0); | ||
1705 | } | 1715 | } |
1706 | 1716 | ||
1707 | static struct backlight_ops ibm_backlight_data = { | 1717 | static struct backlight_ops ibm_backlight_data = { |
@@ -1711,6 +1721,12 @@ static struct backlight_ops ibm_backlight_data = { | |||
1711 | 1721 | ||
1712 | static int brightness_init(void) | 1722 | static int brightness_init(void) |
1713 | { | 1723 | { |
1724 | int b; | ||
1725 | |||
1726 | b = brightness_get(NULL); | ||
1727 | if (b < 0) | ||
1728 | return b; | ||
1729 | |||
1714 | ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, | 1730 | ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, |
1715 | &ibm_backlight_data); | 1731 | &ibm_backlight_data); |
1716 | if (IS_ERR(ibm_backlight_device)) { | 1732 | if (IS_ERR(ibm_backlight_device)) { |
@@ -1718,7 +1734,9 @@ static int brightness_init(void) | |||
1718 | return PTR_ERR(ibm_backlight_device); | 1734 | return PTR_ERR(ibm_backlight_device); |
1719 | } | 1735 | } |
1720 | 1736 | ||
1721 | ibm_backlight_device->props.max_brightness = 7; | 1737 | ibm_backlight_device->props.max_brightness = 7; |
1738 | ibm_backlight_device->props.brightness = b; | ||
1739 | backlight_update_status(ibm_backlight_device); | ||
1722 | 1740 | ||
1723 | return 0; | 1741 | return 0; |
1724 | } | 1742 | } |
@@ -2353,6 +2371,7 @@ static struct ibm_struct ibms[] = { | |||
2353 | .type = ACPI_SYSTEM_NOTIFY, | 2371 | .type = ACPI_SYSTEM_NOTIFY, |
2354 | }, | 2372 | }, |
2355 | #endif | 2373 | #endif |
2374 | #ifdef CONFIG_ACPI_IBM_BAY | ||
2356 | { | 2375 | { |
2357 | .name = "bay", | 2376 | .name = "bay", |
2358 | .init = bay_init, | 2377 | .init = bay_init, |
@@ -2362,6 +2381,7 @@ static struct ibm_struct ibms[] = { | |||
2362 | .handle = &bay_handle, | 2381 | .handle = &bay_handle, |
2363 | .type = ACPI_SYSTEM_NOTIFY, | 2382 | .type = ACPI_SYSTEM_NOTIFY, |
2364 | }, | 2383 | }, |
2384 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
2365 | { | 2385 | { |
2366 | .name = "cmos", | 2386 | .name = "cmos", |
2367 | .read = cmos_read, | 2387 | .read = cmos_read, |
@@ -2487,7 +2507,7 @@ static int __init setup_notify(struct ibm_struct *ibm) | |||
2487 | ret = acpi_bus_get_device(*ibm->handle, &ibm->device); | 2507 | ret = acpi_bus_get_device(*ibm->handle, &ibm->device); |
2488 | if (ret < 0) { | 2508 | if (ret < 0) { |
2489 | printk(IBM_ERR "%s device not present\n", ibm->name); | 2509 | printk(IBM_ERR "%s device not present\n", ibm->name); |
2490 | return 0; | 2510 | return -ENODEV; |
2491 | } | 2511 | } |
2492 | 2512 | ||
2493 | acpi_driver_data(ibm->device) = ibm; | 2513 | acpi_driver_data(ibm->device) = ibm; |
@@ -2496,8 +2516,13 @@ static int __init setup_notify(struct ibm_struct *ibm) | |||
2496 | status = acpi_install_notify_handler(*ibm->handle, ibm->type, | 2516 | status = acpi_install_notify_handler(*ibm->handle, ibm->type, |
2497 | dispatch_notify, ibm); | 2517 | dispatch_notify, ibm); |
2498 | if (ACPI_FAILURE(status)) { | 2518 | if (ACPI_FAILURE(status)) { |
2499 | printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n", | 2519 | if (status == AE_ALREADY_EXISTS) { |
2500 | ibm->name, status); | 2520 | printk(IBM_NOTICE "another device driver is already handling %s events\n", |
2521 | ibm->name); | ||
2522 | } else { | ||
2523 | printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n", | ||
2524 | ibm->name, status); | ||
2525 | } | ||
2501 | return -ENODEV; | 2526 | return -ENODEV; |
2502 | } | 2527 | } |
2503 | ibm->notify_installed = 1; | 2528 | ibm->notify_installed = 1; |
@@ -2533,6 +2558,8 @@ static int __init register_driver(struct ibm_struct *ibm) | |||
2533 | return ret; | 2558 | return ret; |
2534 | } | 2559 | } |
2535 | 2560 | ||
2561 | static void ibm_exit(struct ibm_struct *ibm); | ||
2562 | |||
2536 | static int __init ibm_init(struct ibm_struct *ibm) | 2563 | static int __init ibm_init(struct ibm_struct *ibm) |
2537 | { | 2564 | { |
2538 | int ret; | 2565 | int ret; |
@@ -2574,6 +2601,12 @@ static int __init ibm_init(struct ibm_struct *ibm) | |||
2574 | 2601 | ||
2575 | if (ibm->notify) { | 2602 | if (ibm->notify) { |
2576 | ret = setup_notify(ibm); | 2603 | ret = setup_notify(ibm); |
2604 | if (ret == -ENODEV) { | ||
2605 | printk(IBM_NOTICE "disabling subdriver %s\n", | ||
2606 | ibm->name); | ||
2607 | ibm_exit(ibm); | ||
2608 | return 0; | ||
2609 | } | ||
2577 | if (ret < 0) | 2610 | if (ret < 0) |
2578 | return ret; | 2611 | return ret; |
2579 | } | 2612 | } |
@@ -2647,7 +2680,9 @@ IBM_PARAM(light); | |||
2647 | #ifdef CONFIG_ACPI_IBM_DOCK | 2680 | #ifdef CONFIG_ACPI_IBM_DOCK |
2648 | IBM_PARAM(dock); | 2681 | IBM_PARAM(dock); |
2649 | #endif | 2682 | #endif |
2683 | #ifdef CONFIG_ACPI_IBM_BAY | ||
2650 | IBM_PARAM(bay); | 2684 | IBM_PARAM(bay); |
2685 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
2651 | IBM_PARAM(cmos); | 2686 | IBM_PARAM(cmos); |
2652 | IBM_PARAM(led); | 2687 | IBM_PARAM(led); |
2653 | IBM_PARAM(beep); | 2688 | IBM_PARAM(beep); |
@@ -2723,12 +2758,14 @@ static int __init acpi_ibm_init(void) | |||
2723 | IBM_HANDLE_INIT(dock); | 2758 | IBM_HANDLE_INIT(dock); |
2724 | #endif | 2759 | #endif |
2725 | IBM_HANDLE_INIT(pci); | 2760 | IBM_HANDLE_INIT(pci); |
2761 | #ifdef CONFIG_ACPI_IBM_BAY | ||
2726 | IBM_HANDLE_INIT(bay); | 2762 | IBM_HANDLE_INIT(bay); |
2727 | if (bay_handle) | 2763 | if (bay_handle) |
2728 | IBM_HANDLE_INIT(bay_ej); | 2764 | IBM_HANDLE_INIT(bay_ej); |
2729 | IBM_HANDLE_INIT(bay2); | 2765 | IBM_HANDLE_INIT(bay2); |
2730 | if (bay2_handle) | 2766 | if (bay2_handle) |
2731 | IBM_HANDLE_INIT(bay2_ej); | 2767 | IBM_HANDLE_INIT(bay2_ej); |
2768 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
2732 | IBM_HANDLE_INIT(beep); | 2769 | IBM_HANDLE_INIT(beep); |
2733 | IBM_HANDLE_INIT(ecrd); | 2770 | IBM_HANDLE_INIT(ecrd); |
2734 | IBM_HANDLE_INIT(ecwr); | 2771 | IBM_HANDLE_INIT(ecwr); |
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c index aa6370c67ec1..26fd0dd6953d 100644 --- a/drivers/acpi/namespace/nseval.c +++ b/drivers/acpi/namespace/nseval.c | |||
@@ -154,7 +154,11 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info) | |||
154 | * Execute the method via the interpreter. The interpreter is locked | 154 | * Execute the method via the interpreter. The interpreter is locked |
155 | * here before calling into the AML parser | 155 | * here before calling into the AML parser |
156 | */ | 156 | */ |
157 | acpi_ex_enter_interpreter(); | 157 | status = acpi_ex_enter_interpreter(); |
158 | if (ACPI_FAILURE(status)) { | ||
159 | return_ACPI_STATUS(status); | ||
160 | } | ||
161 | |||
158 | status = acpi_ps_execute_method(info); | 162 | status = acpi_ps_execute_method(info); |
159 | acpi_ex_exit_interpreter(); | 163 | acpi_ex_exit_interpreter(); |
160 | } else { | 164 | } else { |
@@ -178,7 +182,10 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info) | |||
178 | * resolution, we must lock it because we could access an opregion. | 182 | * resolution, we must lock it because we could access an opregion. |
179 | * The opregion access code assumes that the interpreter is locked. | 183 | * The opregion access code assumes that the interpreter is locked. |
180 | */ | 184 | */ |
181 | acpi_ex_enter_interpreter(); | 185 | status = acpi_ex_enter_interpreter(); |
186 | if (ACPI_FAILURE(status)) { | ||
187 | return_ACPI_STATUS(status); | ||
188 | } | ||
182 | 189 | ||
183 | /* Function has a strange interface */ | 190 | /* Function has a strange interface */ |
184 | 191 | ||
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c index 33db2241044e..c4ab615f77fe 100644 --- a/drivers/acpi/namespace/nsinit.c +++ b/drivers/acpi/namespace/nsinit.c | |||
@@ -214,7 +214,7 @@ acpi_ns_init_one_object(acpi_handle obj_handle, | |||
214 | u32 level, void *context, void **return_value) | 214 | u32 level, void *context, void **return_value) |
215 | { | 215 | { |
216 | acpi_object_type type; | 216 | acpi_object_type type; |
217 | acpi_status status = AE_OK; | 217 | acpi_status status; |
218 | struct acpi_init_walk_info *info = | 218 | struct acpi_init_walk_info *info = |
219 | (struct acpi_init_walk_info *)context; | 219 | (struct acpi_init_walk_info *)context; |
220 | struct acpi_namespace_node *node = | 220 | struct acpi_namespace_node *node = |
@@ -268,7 +268,10 @@ acpi_ns_init_one_object(acpi_handle obj_handle, | |||
268 | /* | 268 | /* |
269 | * Must lock the interpreter before executing AML code | 269 | * Must lock the interpreter before executing AML code |
270 | */ | 270 | */ |
271 | acpi_ex_enter_interpreter(); | 271 | status = acpi_ex_enter_interpreter(); |
272 | if (ACPI_FAILURE(status)) { | ||
273 | return (status); | ||
274 | } | ||
272 | 275 | ||
273 | /* | 276 | /* |
274 | * Each of these types can contain executable AML code within the | 277 | * Each of these types can contain executable AML code within the |
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c index 7ac6ace50059..8904d0fae6a2 100644 --- a/drivers/acpi/namespace/nsxfeval.c +++ b/drivers/acpi/namespace/nsxfeval.c | |||
@@ -170,6 +170,7 @@ acpi_evaluate_object(acpi_handle handle, | |||
170 | struct acpi_buffer *return_buffer) | 170 | struct acpi_buffer *return_buffer) |
171 | { | 171 | { |
172 | acpi_status status; | 172 | acpi_status status; |
173 | acpi_status status2; | ||
173 | struct acpi_evaluate_info *info; | 174 | struct acpi_evaluate_info *info; |
174 | acpi_size buffer_space_needed; | 175 | acpi_size buffer_space_needed; |
175 | u32 i; | 176 | u32 i; |
@@ -328,12 +329,14 @@ acpi_evaluate_object(acpi_handle handle, | |||
328 | * Delete the internal return object. NOTE: Interpreter must be | 329 | * Delete the internal return object. NOTE: Interpreter must be |
329 | * locked to avoid race condition. | 330 | * locked to avoid race condition. |
330 | */ | 331 | */ |
331 | acpi_ex_enter_interpreter(); | 332 | status2 = acpi_ex_enter_interpreter(); |
333 | if (ACPI_SUCCESS(status2)) { | ||
332 | 334 | ||
333 | /* Remove one reference on the return object (should delete it) */ | 335 | /* Remove one reference on the return object (should delete it) */ |
334 | 336 | ||
335 | acpi_ut_remove_reference(info->return_object); | 337 | acpi_ut_remove_reference(info->return_object); |
336 | acpi_ex_exit_interpreter(); | 338 | acpi_ex_exit_interpreter(); |
339 | } | ||
337 | } | 340 | } |
338 | 341 | ||
339 | cleanup: | 342 | cleanup: |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 1ef338545dfe..4ffecd179702 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -436,8 +436,6 @@ int acpi_power_transition(struct acpi_device *device, int state) | |||
436 | cl = &device->power.states[device->power.state].resources; | 436 | cl = &device->power.states[device->power.state].resources; |
437 | tl = &device->power.states[state].resources; | 437 | tl = &device->power.states[state].resources; |
438 | 438 | ||
439 | device->power.state = ACPI_STATE_UNKNOWN; | ||
440 | |||
441 | if (!cl->count && !tl->count) { | 439 | if (!cl->count && !tl->count) { |
442 | result = -ENODEV; | 440 | result = -ENODEV; |
443 | goto end; | 441 | goto end; |
@@ -468,12 +466,15 @@ int acpi_power_transition(struct acpi_device *device, int state) | |||
468 | goto end; | 466 | goto end; |
469 | } | 467 | } |
470 | 468 | ||
471 | /* We shouldn't change the state till all above operations succeed */ | 469 | end: |
472 | device->power.state = state; | 470 | if (result) { |
473 | end: | 471 | device->power.state = ACPI_STATE_UNKNOWN; |
474 | if (result) | ||
475 | printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", | 472 | printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", |
476 | device->pnp.bus_id, state); | 473 | device->pnp.bus_id, state); |
474 | } else { | ||
475 | /* We shouldn't change the state till all above operations succeed */ | ||
476 | device->power.state = state; | ||
477 | } | ||
477 | 478 | ||
478 | return result; | 479 | return result; |
479 | } | 480 | } |
@@ -687,13 +688,6 @@ static int acpi_power_resume(struct acpi_device *device) | |||
687 | return result; | 688 | return result; |
688 | 689 | ||
689 | mutex_lock(&resource->resource_lock); | 690 | mutex_lock(&resource->resource_lock); |
690 | if ((resource->state == ACPI_POWER_RESOURCE_STATE_ON) && | ||
691 | list_empty(&resource->reference)) { | ||
692 | mutex_unlock(&resource->resource_lock); | ||
693 | result = acpi_power_off_device(device->handle, NULL); | ||
694 | return result; | ||
695 | } | ||
696 | |||
697 | if ((resource->state == ACPI_POWER_RESOURCE_STATE_OFF) && | 691 | if ((resource->state == ACPI_POWER_RESOURCE_STATE_OFF) && |
698 | !list_empty(&resource->reference)) { | 692 | !list_empty(&resource->reference)) { |
699 | ref = container_of(resource->reference.next, struct acpi_power_reference, node); | 693 | ref = container_of(resource->reference.next, struct acpi_power_reference, node); |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 60773005b8af..562124ed785e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -89,6 +89,12 @@ module_param(nocst, uint, 0000); | |||
89 | static unsigned int bm_history __read_mostly = | 89 | static unsigned int bm_history __read_mostly = |
90 | (HZ >= 800 ? 0xFFFFFFFF : ((1U << (HZ / 25)) - 1)); | 90 | (HZ >= 800 ? 0xFFFFFFFF : ((1U << (HZ / 25)) - 1)); |
91 | module_param(bm_history, uint, 0644); | 91 | module_param(bm_history, uint, 0644); |
92 | |||
93 | static unsigned use_ipi = 2; | ||
94 | module_param(use_ipi, uint, 0644); | ||
95 | MODULE_PARM_DESC(use_ipi, "IPI (vs. LAPIC) irqs for not waking up from C2/C3" | ||
96 | " machines. 0=apic, 1=ipi, 2=auto\n"); | ||
97 | |||
92 | /* -------------------------------------------------------------------------- | 98 | /* -------------------------------------------------------------------------- |
93 | Power Management | 99 | Power Management |
94 | -------------------------------------------------------------------------- */ | 100 | -------------------------------------------------------------------------- */ |
@@ -260,9 +266,8 @@ static void acpi_cstate_enter(struct acpi_processor_cx *cstate) | |||
260 | 266 | ||
261 | /* | 267 | /* |
262 | * Some BIOS implementations switch to C3 in the published C2 state. | 268 | * Some BIOS implementations switch to C3 in the published C2 state. |
263 | * This seems to be a common problem on AMD boxen, but other vendors | 269 | * This seems to be a common problem on AMD boxen and Intel Dothan/Banias |
264 | * are affected too. We pick the most conservative approach: we assume | 270 | * Pentium M machines. |
265 | * that the local APIC stops in both C2 and C3. | ||
266 | */ | 271 | */ |
267 | static void acpi_timer_check_state(int state, struct acpi_processor *pr, | 272 | static void acpi_timer_check_state(int state, struct acpi_processor *pr, |
268 | struct acpi_processor_cx *cx) | 273 | struct acpi_processor_cx *cx) |
@@ -276,8 +281,17 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr, | |||
276 | if (pwr->timer_broadcast_on_state < state) | 281 | if (pwr->timer_broadcast_on_state < state) |
277 | return; | 282 | return; |
278 | 283 | ||
279 | if (cx->type >= ACPI_STATE_C2) | 284 | if (cx->type >= ACPI_STATE_C2) { |
280 | pr->power.timer_broadcast_on_state = state; | 285 | if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) |
286 | pr->power.timer_broadcast_on_state = state; | ||
287 | else if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && | ||
288 | boot_cpu_data.x86 == 6) && | ||
289 | (boot_cpu_data.x86_model == 13 || | ||
290 | boot_cpu_data.x86_model == 9)) | ||
291 | { | ||
292 | pr->power.timer_broadcast_on_state = state; | ||
293 | } | ||
294 | } | ||
281 | } | 295 | } |
282 | 296 | ||
283 | static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) | 297 | static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) |
@@ -292,10 +306,16 @@ static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) | |||
292 | #else | 306 | #else |
293 | cpumask_t mask = cpumask_of_cpu(pr->id); | 307 | cpumask_t mask = cpumask_of_cpu(pr->id); |
294 | 308 | ||
295 | if (pr->power.timer_broadcast_on_state < INT_MAX) | 309 | if (use_ipi == 0) |
296 | on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1); | 310 | on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1); |
297 | else | 311 | else if (use_ipi == 1) |
298 | on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1); | 312 | on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1); |
313 | else { | ||
314 | if (pr->power.timer_broadcast_on_state < INT_MAX) | ||
315 | on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1); | ||
316 | else | ||
317 | on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1); | ||
318 | } | ||
299 | #endif | 319 | #endif |
300 | } | 320 | } |
301 | 321 | ||
@@ -1013,13 +1033,13 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
1013 | 1033 | ||
1014 | case ACPI_STATE_C2: | 1034 | case ACPI_STATE_C2: |
1015 | acpi_processor_power_verify_c2(cx); | 1035 | acpi_processor_power_verify_c2(cx); |
1016 | if (cx->valid) | 1036 | if (cx->valid && use_ipi != 0 && use_ipi != 1) |
1017 | acpi_timer_check_state(i, pr, cx); | 1037 | acpi_timer_check_state(i, pr, cx); |
1018 | break; | 1038 | break; |
1019 | 1039 | ||
1020 | case ACPI_STATE_C3: | 1040 | case ACPI_STATE_C3: |
1021 | acpi_processor_power_verify_c3(pr, cx); | 1041 | acpi_processor_power_verify_c3(pr, cx); |
1022 | if (cx->valid) | 1042 | if (cx->valid && use_ipi != 0 && use_ipi != 1) |
1023 | acpi_timer_check_state(i, pr, cx); | 1043 | acpi_timer_check_state(i, pr, cx); |
1024 | break; | 1044 | break; |
1025 | } | 1045 | } |
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c index 1358c06a969c..cc48ab05676c 100644 --- a/drivers/acpi/resources/rscreate.c +++ b/drivers/acpi/resources/rscreate.c | |||
@@ -191,6 +191,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
191 | user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); | 191 | user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); |
192 | 192 | ||
193 | for (index = 0; index < number_of_elements; index++) { | 193 | for (index = 0; index < number_of_elements; index++) { |
194 | int source_name_index = 2; | ||
195 | int source_index_index = 3; | ||
196 | |||
194 | /* | 197 | /* |
195 | * Point user_prt past this current structure | 198 | * Point user_prt past this current structure |
196 | * | 199 | * |
@@ -261,10 +264,28 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
261 | } | 264 | } |
262 | 265 | ||
263 | /* | 266 | /* |
267 | * If BIOS erroneously reversed the _PRT source_name and source_index, | ||
268 | * then reverse them back. | ||
269 | */ | ||
270 | if (ACPI_GET_OBJECT_TYPE (sub_object_list[3]) != ACPI_TYPE_INTEGER) { | ||
271 | if (acpi_gbl_enable_interpreter_slack) { | ||
272 | source_name_index = 3; | ||
273 | source_index_index = 2; | ||
274 | printk(KERN_WARNING "ACPI: Handling Garbled _PRT entry\n"); | ||
275 | } else { | ||
276 | ACPI_ERROR((AE_INFO, | ||
277 | "(PRT[%X].source_index) Need Integer, found %s", | ||
278 | index, | ||
279 | acpi_ut_get_object_type_name(sub_object_list[3]))); | ||
280 | return_ACPI_STATUS(AE_BAD_DATA); | ||
281 | } | ||
282 | } | ||
283 | |||
284 | /* | ||
264 | * 3) Third subobject: Dereference the PRT.source_name | 285 | * 3) Third subobject: Dereference the PRT.source_name |
265 | * The name may be unresolved (slack mode), so allow a null object | 286 | * The name may be unresolved (slack mode), so allow a null object |
266 | */ | 287 | */ |
267 | obj_desc = sub_object_list[2]; | 288 | obj_desc = sub_object_list[source_name_index]; |
268 | if (obj_desc) { | 289 | if (obj_desc) { |
269 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 290 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { |
270 | case ACPI_TYPE_LOCAL_REFERENCE: | 291 | case ACPI_TYPE_LOCAL_REFERENCE: |
@@ -339,7 +360,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
339 | 360 | ||
340 | /* 4) Fourth subobject: Dereference the PRT.source_index */ | 361 | /* 4) Fourth subobject: Dereference the PRT.source_index */ |
341 | 362 | ||
342 | obj_desc = sub_object_list[3]; | 363 | obj_desc = sub_object_list[source_index_index]; |
343 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 364 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { |
344 | user_prt->source_index = (u32) obj_desc->integer.value; | 365 | user_prt->source_index = (u32) obj_desc->integer.value; |
345 | } else { | 366 | } else { |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 849e2c361804..96792a6cc164 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -42,7 +42,9 @@ static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" }; | |||
42 | 42 | ||
43 | static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; | 43 | static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; |
44 | 44 | ||
45 | void acpi_table_print_madt_entry(struct acpi_subtable_header * header) | 45 | static int acpi_apic_instance __initdata = 2; |
46 | |||
47 | void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | ||
46 | { | 48 | { |
47 | if (!header) | 49 | if (!header) |
48 | return; | 50 | return; |
@@ -183,8 +185,10 @@ acpi_table_parse_entries(char *id, | |||
183 | if (!handler) | 185 | if (!handler) |
184 | return -EINVAL; | 186 | return -EINVAL; |
185 | 187 | ||
186 | /* Locate the table (if exists). There should only be one. */ | 188 | if (strncmp(id, ACPI_SIG_MADT, 4) == 0) |
187 | acpi_get_table(id, 0, &table_header); | 189 | acpi_get_table(id, acpi_apic_instance, &table_header); |
190 | else | ||
191 | acpi_get_table(id, 0, &table_header); | ||
188 | 192 | ||
189 | if (!table_header) { | 193 | if (!table_header) { |
190 | printk(KERN_WARNING PREFIX "%4.4s not present\n", id); | 194 | printk(KERN_WARNING PREFIX "%4.4s not present\n", id); |
@@ -237,10 +241,15 @@ acpi_table_parse_madt(enum acpi_madt_type id, | |||
237 | int __init acpi_table_parse(char *id, acpi_table_handler handler) | 241 | int __init acpi_table_parse(char *id, acpi_table_handler handler) |
238 | { | 242 | { |
239 | struct acpi_table_header *table = NULL; | 243 | struct acpi_table_header *table = NULL; |
244 | |||
240 | if (!handler) | 245 | if (!handler) |
241 | return -EINVAL; | 246 | return -EINVAL; |
242 | 247 | ||
243 | acpi_get_table(id, 0, &table); | 248 | if (strncmp(id, ACPI_SIG_MADT, 4) == 0) |
249 | acpi_get_table(id, acpi_apic_instance, &table); | ||
250 | else | ||
251 | acpi_get_table(id, 0, &table); | ||
252 | |||
244 | if (table) { | 253 | if (table) { |
245 | handler(table); | 254 | handler(table); |
246 | return 0; | 255 | return 0; |
@@ -248,6 +257,31 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) | |||
248 | return 1; | 257 | return 1; |
249 | } | 258 | } |
250 | 259 | ||
260 | /* | ||
261 | * The BIOS is supposed to supply a single APIC/MADT, | ||
262 | * but some report two. Provide a knob to use either. | ||
263 | * (don't you wish instance 0 and 1 were not the same?) | ||
264 | */ | ||
265 | static void __init check_multiple_madt(void) | ||
266 | { | ||
267 | struct acpi_table_header *table = NULL; | ||
268 | |||
269 | acpi_get_table(ACPI_SIG_MADT, 2, &table); | ||
270 | if (table) { | ||
271 | printk(KERN_WARNING PREFIX | ||
272 | "BIOS bug: multiple APIC/MADT found," | ||
273 | " using %d\n", acpi_apic_instance); | ||
274 | printk(KERN_WARNING PREFIX | ||
275 | "If \"acpi_apic_instance=%d\" works better, " | ||
276 | "notify linux-acpi@vger.kernel.org\n", | ||
277 | acpi_apic_instance ? 0 : 2); | ||
278 | |||
279 | } else | ||
280 | acpi_apic_instance = 0; | ||
281 | |||
282 | return; | ||
283 | } | ||
284 | |||
251 | /* | 285 | /* |
252 | * acpi_table_init() | 286 | * acpi_table_init() |
253 | * | 287 | * |
@@ -257,9 +291,22 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) | |||
257 | * result: sdt_entry[] is initialized | 291 | * result: sdt_entry[] is initialized |
258 | */ | 292 | */ |
259 | 293 | ||
260 | |||
261 | int __init acpi_table_init(void) | 294 | int __init acpi_table_init(void) |
262 | { | 295 | { |
263 | acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); | 296 | acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); |
297 | check_multiple_madt(); | ||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | static int __init acpi_parse_apic_instance(char *str) | ||
302 | { | ||
303 | |||
304 | acpi_apic_instance = simple_strtoul(str, NULL, 0); | ||
305 | |||
306 | printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n", | ||
307 | acpi_apic_instance); | ||
308 | |||
264 | return 0; | 309 | return 0; |
265 | } | 310 | } |
311 | |||
312 | early_param("acpi_apic_instance", acpi_parse_apic_instance); | ||
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 0771b434feb2..00d25b347255 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -102,9 +102,9 @@ struct acpi_video_bus_cap { | |||
102 | 102 | ||
103 | struct acpi_video_device_attrib { | 103 | struct acpi_video_device_attrib { |
104 | u32 display_index:4; /* A zero-based instance of the Display */ | 104 | u32 display_index:4; /* A zero-based instance of the Display */ |
105 | u32 display_port_attachment:4; /*This field differenates displays type */ | 105 | u32 display_port_attachment:4; /*This field differentiates the display type */ |
106 | u32 display_type:4; /*Describe the specific type in use */ | 106 | u32 display_type:4; /*Describe the specific type in use */ |
107 | u32 vendor_specific:4; /*Chipset Vendor Specifi */ | 107 | u32 vendor_specific:4; /*Chipset Vendor Specific */ |
108 | u32 bios_can_detect:1; /*BIOS can detect the device */ | 108 | u32 bios_can_detect:1; /*BIOS can detect the device */ |
109 | u32 depend_on_vga:1; /*Non-VGA output device whose power is related to | 109 | u32 depend_on_vga:1; /*Non-VGA output device whose power is related to |
110 | the VGA device. */ | 110 | the VGA device. */ |
@@ -484,16 +484,16 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video, | |||
484 | * 0. The system BIOS should NOT automatically switch(toggle) | 484 | * 0. The system BIOS should NOT automatically switch(toggle) |
485 | * the active display output. | 485 | * the active display output. |
486 | * 1. The system BIOS should automatically switch (toggle) the | 486 | * 1. The system BIOS should automatically switch (toggle) the |
487 | * active display output. No swich event. | 487 | * active display output. No switch event. |
488 | * 2. The _DGS value should be locked. | 488 | * 2. The _DGS value should be locked. |
489 | * 3. The system BIOS should not automatically switch (toggle) the | 489 | * 3. The system BIOS should not automatically switch (toggle) the |
490 | * active display output, but instead generate the display switch | 490 | * active display output, but instead generate the display switch |
491 | * event notify code. | 491 | * event notify code. |
492 | * lcd_flag : | 492 | * lcd_flag : |
493 | * 0. The system BIOS should automatically control the brightness level | 493 | * 0. The system BIOS should automatically control the brightness level |
494 | * of the LCD, when the power changes from AC to DC | 494 | * of the LCD when the power changes from AC to DC |
495 | * 1. The system BIOS should NOT automatically control the brightness | 495 | * 1. The system BIOS should NOT automatically control the brightness |
496 | * level of the LCD, when the power changes from AC to DC. | 496 | * level of the LCD when the power changes from AC to DC. |
497 | * Return Value: | 497 | * Return Value: |
498 | * -1 wrong arg. | 498 | * -1 wrong arg. |
499 | */ | 499 | */ |
@@ -525,7 +525,7 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) | |||
525 | * Return Value: | 525 | * Return Value: |
526 | * None | 526 | * None |
527 | * | 527 | * |
528 | * Find out all required AML method defined under the output | 528 | * Find out all required AML methods defined under the output |
529 | * device. | 529 | * device. |
530 | */ | 530 | */ |
531 | 531 | ||
@@ -636,7 +636,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
636 | * Return Value: | 636 | * Return Value: |
637 | * None | 637 | * None |
638 | * | 638 | * |
639 | * Find out all required AML method defined under the video bus device. | 639 | * Find out all required AML methods defined under the video bus device. |
640 | */ | 640 | */ |
641 | 641 | ||
642 | static void acpi_video_bus_find_cap(struct acpi_video_bus *video) | 642 | static void acpi_video_bus_find_cap(struct acpi_video_bus *video) |
@@ -681,19 +681,19 @@ static int acpi_video_bus_check(struct acpi_video_bus *video) | |||
681 | * to check well known required nodes. | 681 | * to check well known required nodes. |
682 | */ | 682 | */ |
683 | 683 | ||
684 | /* Does this device able to support video switching ? */ | 684 | /* Does this device support video switching? */ |
685 | if (video->cap._DOS) { | 685 | if (video->cap._DOS) { |
686 | video->flags.multihead = 1; | 686 | video->flags.multihead = 1; |
687 | status = 0; | 687 | status = 0; |
688 | } | 688 | } |
689 | 689 | ||
690 | /* Does this device able to retrieve a retrieve a video ROM ? */ | 690 | /* Does this device support retrieving a video ROM? */ |
691 | if (video->cap._ROM) { | 691 | if (video->cap._ROM) { |
692 | video->flags.rom = 1; | 692 | video->flags.rom = 1; |
693 | status = 0; | 693 | status = 0; |
694 | } | 694 | } |
695 | 695 | ||
696 | /* Does this device able to configure which video device to POST ? */ | 696 | /* Does this device support configuring which video device to POST? */ |
697 | if (video->cap._GPD && video->cap._SPD && video->cap._VPO) { | 697 | if (video->cap._GPD && video->cap._SPD && video->cap._VPO) { |
698 | video->flags.post = 1; | 698 | video->flags.post = 1; |
699 | status = 0; | 699 | status = 0; |
@@ -860,7 +860,7 @@ acpi_video_device_write_brightness(struct file *file, | |||
860 | if (level > 100) | 860 | if (level > 100) |
861 | return -EFAULT; | 861 | return -EFAULT; |
862 | 862 | ||
863 | /* validate though the list of available levels */ | 863 | /* validate through the list of available levels */ |
864 | for (i = 0; i < dev->brightness->count; i++) | 864 | for (i = 0; i < dev->brightness->count; i++) |
865 | if (level == dev->brightness->levels[i]) { | 865 | if (level == dev->brightness->levels[i]) { |
866 | if (ACPI_SUCCESS | 866 | if (ACPI_SUCCESS |
@@ -1065,10 +1065,10 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) | |||
1065 | printk(KERN_WARNING PREFIX | 1065 | printk(KERN_WARNING PREFIX |
1066 | "The motherboard VGA device is not listed as a possible POST device.\n"); | 1066 | "The motherboard VGA device is not listed as a possible POST device.\n"); |
1067 | printk(KERN_WARNING PREFIX | 1067 | printk(KERN_WARNING PREFIX |
1068 | "This indicate a BIOS bug. Please contact the manufacturer.\n"); | 1068 | "This indicates a BIOS bug. Please contact the manufacturer.\n"); |
1069 | } | 1069 | } |
1070 | printk("%lx\n", options); | 1070 | printk("%lx\n", options); |
1071 | seq_printf(seq, "can POST: <intgrated video>"); | 1071 | seq_printf(seq, "can POST: <integrated video>"); |
1072 | if (options & 2) | 1072 | if (options & 2) |
1073 | seq_printf(seq, " <PCI video>"); | 1073 | seq_printf(seq, " <PCI video>"); |
1074 | if (options & 4) | 1074 | if (options & 4) |
@@ -1102,7 +1102,7 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) | |||
1102 | seq_printf(seq, "<not supported>\n"); | 1102 | seq_printf(seq, "<not supported>\n"); |
1103 | goto end; | 1103 | goto end; |
1104 | } | 1104 | } |
1105 | seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]); | 1105 | seq_printf(seq, "device POSTed is <%s>\n", device_decode[id & 3]); |
1106 | 1106 | ||
1107 | end: | 1107 | end: |
1108 | return 0; | 1108 | return 0; |
@@ -1156,7 +1156,7 @@ acpi_video_bus_write_POST(struct file *file, | |||
1156 | if (opt > 3) | 1156 | if (opt > 3) |
1157 | return -EFAULT; | 1157 | return -EFAULT; |
1158 | 1158 | ||
1159 | /* just in case an OEM 'forget' the motherboard... */ | 1159 | /* just in case an OEM 'forgot' the motherboard... */ |
1160 | options |= 1; | 1160 | options |= 1; |
1161 | 1161 | ||
1162 | if (options & (1ul << opt)) { | 1162 | if (options & (1ul << opt)) { |
@@ -1527,13 +1527,13 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) | |||
1527 | /* | 1527 | /* |
1528 | * Arg: | 1528 | * Arg: |
1529 | * video : video bus device | 1529 | * video : video bus device |
1530 | * event : Nontify Event | 1530 | * event : notify event |
1531 | * | 1531 | * |
1532 | * Return: | 1532 | * Return: |
1533 | * < 0 : error | 1533 | * < 0 : error |
1534 | * | 1534 | * |
1535 | * 1. Find out the current active output device. | 1535 | * 1. Find out the current active output device. |
1536 | * 2. Identify the next output device to switch | 1536 | * 2. Identify the next output device to switch to. |
1537 | * 3. call _DSS to do actual switch. | 1537 | * 3. call _DSS to do actual switch. |
1538 | */ | 1538 | */ |
1539 | 1539 | ||
@@ -1723,12 +1723,12 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) | |||
1723 | device = video->device; | 1723 | device = video->device; |
1724 | 1724 | ||
1725 | switch (event) { | 1725 | switch (event) { |
1726 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, | 1726 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, |
1727 | * most likely via hotkey. */ | 1727 | * most likely via hotkey. */ |
1728 | acpi_bus_generate_event(device, event, 0); | 1728 | acpi_bus_generate_event(device, event, 0); |
1729 | break; | 1729 | break; |
1730 | 1730 | ||
1731 | case ACPI_VIDEO_NOTIFY_PROBE: /* User plug or remove a video | 1731 | case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video |
1732 | * connector. */ | 1732 | * connector. */ |
1733 | acpi_video_device_enumerate(video); | 1733 | acpi_video_device_enumerate(video); |
1734 | acpi_video_device_rebind(video); | 1734 | acpi_video_device_rebind(video); |
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index d16b5b0c8b76..7bdbe5a914d0 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -564,7 +564,7 @@ config PATA_IXP4XX_CF | |||
564 | 564 | ||
565 | config PATA_SCC | 565 | config PATA_SCC |
566 | tristate "Toshiba's Cell Reference Set IDE support" | 566 | tristate "Toshiba's Cell Reference Set IDE support" |
567 | depends on PCI && PPC_IBM_CELL_BLADE | 567 | depends on PCI && PPC_CELLEB |
568 | help | 568 | help |
569 | This option enables support for the built-in IDE controller on | 569 | This option enables support for the built-in IDE controller on |
570 | Toshiba Cell Reference Board. | 570 | Toshiba Cell Reference Board. |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index dc42ba1b46f7..b952c584338f 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -93,7 +93,7 @@ | |||
93 | #include <linux/libata.h> | 93 | #include <linux/libata.h> |
94 | 94 | ||
95 | #define DRV_NAME "ata_piix" | 95 | #define DRV_NAME "ata_piix" |
96 | #define DRV_VERSION "2.10" | 96 | #define DRV_VERSION "2.10ac1" |
97 | 97 | ||
98 | enum { | 98 | enum { |
99 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ | 99 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ |
@@ -667,14 +667,9 @@ static int ich_pata_prereset(struct ata_port *ap) | |||
667 | { | 667 | { |
668 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 668 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
669 | 669 | ||
670 | if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no])) { | 670 | if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no])) |
671 | ata_port_printk(ap, KERN_INFO, "port disabled. ignoring.\n"); | 671 | return -ENOENT; |
672 | ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; | ||
673 | return 0; | ||
674 | } | ||
675 | |||
676 | ich_pata_cbl_detect(ap); | 672 | ich_pata_cbl_detect(ap); |
677 | |||
678 | return ata_std_prereset(ap); | 673 | return ata_std_prereset(ap); |
679 | } | 674 | } |
680 | 675 | ||
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index d14a48e75f1b..c428a56e6f31 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -34,6 +34,13 @@ struct taskfile_array { | |||
34 | u8 tfa[REGS_PER_GTF]; /* regs. 0x1f1 - 0x1f7 */ | 34 | u8 tfa[REGS_PER_GTF]; /* regs. 0x1f1 - 0x1f7 */ |
35 | }; | 35 | }; |
36 | 36 | ||
37 | /* | ||
38 | * Helper - belongs in the PCI layer somewhere eventually | ||
39 | */ | ||
40 | static int is_pci_dev(struct device *dev) | ||
41 | { | ||
42 | return (dev->bus == &pci_bus_type); | ||
43 | } | ||
37 | 44 | ||
38 | /** | 45 | /** |
39 | * sata_get_dev_handle - finds acpi_handle and PCI device.function | 46 | * sata_get_dev_handle - finds acpi_handle and PCI device.function |
@@ -53,6 +60,9 @@ static int sata_get_dev_handle(struct device *dev, acpi_handle *handle, | |||
53 | struct pci_dev *pci_dev; | 60 | struct pci_dev *pci_dev; |
54 | acpi_integer addr; | 61 | acpi_integer addr; |
55 | 62 | ||
63 | if (!is_pci_dev(dev)) | ||
64 | return -ENODEV; | ||
65 | |||
56 | pci_dev = to_pci_dev(dev); /* NOTE: PCI-specific */ | 66 | pci_dev = to_pci_dev(dev); /* NOTE: PCI-specific */ |
57 | /* Please refer to the ACPI spec for the syntax of _ADR. */ | 67 | /* Please refer to the ACPI spec for the syntax of _ADR. */ |
58 | addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn); | 68 | addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn); |
@@ -84,7 +94,12 @@ static int pata_get_dev_handle(struct device *dev, acpi_handle *handle, | |||
84 | acpi_status status; | 94 | acpi_status status; |
85 | struct acpi_device_info *dinfo = NULL; | 95 | struct acpi_device_info *dinfo = NULL; |
86 | int ret = -ENODEV; | 96 | int ret = -ENODEV; |
87 | struct pci_dev *pdev = to_pci_dev(dev); | 97 | struct pci_dev *pdev; |
98 | |||
99 | if (!is_pci_dev(dev)) | ||
100 | return -ENODEV; | ||
101 | |||
102 | pdev = to_pci_dev(dev); | ||
88 | 103 | ||
89 | bus = pdev->bus->number; | 104 | bus = pdev->bus->number; |
90 | devnum = PCI_SLOT(pdev->devfn); | 105 | devnum = PCI_SLOT(pdev->devfn); |
@@ -561,6 +576,13 @@ int ata_acpi_exec_tfs(struct ata_port *ap) | |||
561 | 576 | ||
562 | if (noacpi) | 577 | if (noacpi) |
563 | return 0; | 578 | return 0; |
579 | /* | ||
580 | * TBD - implement PATA support. For now, | ||
581 | * we should not run GTF on PATA devices since some | ||
582 | * PATA require execution of GTM/STM before GTF. | ||
583 | */ | ||
584 | if (!(ap->cbl == ATA_CBL_SATA)) | ||
585 | return 0; | ||
564 | 586 | ||
565 | for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { | 587 | for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { |
566 | if (!ata_dev_enabled(&ap->device[ix])) | 588 | if (!ata_dev_enabled(&ap->device[ix])) |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index dc362fa01ca4..bf327d473ce9 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -826,7 +826,7 @@ static u64 ata_id_n_sectors(const u16 *id) | |||
826 | /** | 826 | /** |
827 | * ata_id_to_dma_mode - Identify DMA mode from id block | 827 | * ata_id_to_dma_mode - Identify DMA mode from id block |
828 | * @dev: device to identify | 828 | * @dev: device to identify |
829 | * @mode: mode to assume if we cannot tell | 829 | * @unknown: mode to assume if we cannot tell |
830 | * | 830 | * |
831 | * Set up the timing values for the device based upon the identify | 831 | * Set up the timing values for the device based upon the identify |
832 | * reported values for the DMA mode. This function is used by drivers | 832 | * reported values for the DMA mode. This function is used by drivers |
@@ -3455,7 +3455,8 @@ static void ata_dev_xfermask(struct ata_device *dev) | |||
3455 | "device is on DMA blacklist, disabling DMA\n"); | 3455 | "device is on DMA blacklist, disabling DMA\n"); |
3456 | } | 3456 | } |
3457 | 3457 | ||
3458 | if ((host->flags & ATA_HOST_SIMPLEX) && host->simplex_claimed != ap) { | 3458 | if ((host->flags & ATA_HOST_SIMPLEX) && |
3459 | host->simplex_claimed && host->simplex_claimed != ap) { | ||
3459 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); | 3460 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); |
3460 | ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " | 3461 | ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " |
3461 | "other device, disabling DMA\n"); | 3462 | "other device, disabling DMA\n"); |
@@ -5684,18 +5685,22 @@ static void ata_host_release(struct device *gendev, void *res) | |||
5684 | for (i = 0; i < host->n_ports; i++) { | 5685 | for (i = 0; i < host->n_ports; i++) { |
5685 | struct ata_port *ap = host->ports[i]; | 5686 | struct ata_port *ap = host->ports[i]; |
5686 | 5687 | ||
5687 | if (!ap) | 5688 | if (ap && ap->ops->port_stop) |
5688 | continue; | ||
5689 | |||
5690 | if (ap->ops->port_stop) | ||
5691 | ap->ops->port_stop(ap); | 5689 | ap->ops->port_stop(ap); |
5692 | |||
5693 | scsi_host_put(ap->scsi_host); | ||
5694 | } | 5690 | } |
5695 | 5691 | ||
5696 | if (host->ops->host_stop) | 5692 | if (host->ops->host_stop) |
5697 | host->ops->host_stop(host); | 5693 | host->ops->host_stop(host); |
5698 | 5694 | ||
5695 | for (i = 0; i < host->n_ports; i++) { | ||
5696 | struct ata_port *ap = host->ports[i]; | ||
5697 | |||
5698 | if (ap) | ||
5699 | scsi_host_put(ap->scsi_host); | ||
5700 | |||
5701 | host->ports[i] = NULL; | ||
5702 | } | ||
5703 | |||
5699 | dev_set_drvdata(gendev, NULL); | 5704 | dev_set_drvdata(gendev, NULL); |
5700 | } | 5705 | } |
5701 | 5706 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 7349c3dbf774..361953a50203 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1625,8 +1625,14 @@ static int ata_eh_reset(struct ata_port *ap, int classify, | |||
1625 | rc = prereset(ap); | 1625 | rc = prereset(ap); |
1626 | if (rc) { | 1626 | if (rc) { |
1627 | if (rc == -ENOENT) { | 1627 | if (rc == -ENOENT) { |
1628 | ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n"); | 1628 | ata_port_printk(ap, KERN_DEBUG, |
1629 | "port disabled. ignoring.\n"); | ||
1629 | ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; | 1630 | ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; |
1631 | |||
1632 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1633 | classes[i] = ATA_DEV_NONE; | ||
1634 | |||
1635 | rc = 0; | ||
1630 | } else | 1636 | } else |
1631 | ata_port_printk(ap, KERN_ERR, | 1637 | ata_port_printk(ap, KERN_ERR, |
1632 | "prereset failed (errno=%d)\n", rc); | 1638 | "prereset failed (errno=%d)\n", rc); |
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index 7ef834250a43..55cc293e7487 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c | |||
@@ -208,7 +208,7 @@ static struct ata_port_operations cs5520_port_ops = { | |||
208 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 208 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
209 | { | 209 | { |
210 | u8 pcicfg; | 210 | u8 pcicfg; |
211 | void *iomap[5]; | 211 | void __iomem *iomap[5]; |
212 | static struct ata_probe_ent probe[2]; | 212 | static struct ata_probe_ent probe[2]; |
213 | int ports = 0; | 213 | int ports = 0; |
214 | 214 | ||
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index 9a0523b5c947..c6f0e1927551 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -193,7 +193,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | |||
193 | 193 | ||
194 | irq = platform_get_irq(pdev, 0); | 194 | irq = platform_get_irq(pdev, 0); |
195 | if (irq) | 195 | if (irq) |
196 | set_irq_type(irq, IRQT_HIGH); | 196 | set_irq_type(irq, IRQT_RISING); |
197 | 197 | ||
198 | /* Setup expansion bus chip selects */ | 198 | /* Setup expansion bus chip selects */ |
199 | *data->cs0_cfg = data->cs0_bits; | 199 | *data->cs0_cfg = data->cs0_bits; |
@@ -232,7 +232,6 @@ static __devexit int ixp4xx_pata_remove(struct platform_device *dev) | |||
232 | struct ata_host *host = platform_get_drvdata(dev); | 232 | struct ata_host *host = platform_get_drvdata(dev); |
233 | 233 | ||
234 | ata_host_detach(host); | 234 | ata_host_detach(host); |
235 | platform_set_drvdata(dev, NULL); | ||
236 | 235 | ||
237 | return 0; | 236 | return 0; |
238 | } | 237 | } |
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index f5d88729ca79..882c36eaf293 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
@@ -329,7 +329,7 @@ mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv) | |||
329 | ae->dev = dev; | 329 | ae->dev = dev; |
330 | ae->irq = priv->ata_irq; | 330 | ae->irq = priv->ata_irq; |
331 | 331 | ||
332 | aio->cmd_addr = 0; /* Don't have a classic reg block */ | 332 | aio->cmd_addr = NULL; /* Don't have a classic reg block */ |
333 | aio->altstatus_addr = &priv->ata_regs->tf_control; | 333 | aio->altstatus_addr = &priv->ata_regs->tf_control; |
334 | aio->ctl_addr = &priv->ata_regs->tf_control; | 334 | aio->ctl_addr = &priv->ata_regs->tf_control; |
335 | aio->data_addr = &priv->ata_regs->tf_data; | 335 | aio->data_addr = &priv->ata_regs->tf_data; |
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index 3193a603d1a1..1e21688bfcf2 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -672,10 +672,6 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
672 | if (rc) | 672 | if (rc) |
673 | return rc; | 673 | return rc; |
674 | 674 | ||
675 | rc = pci_request_regions(pdev, DRV_NAME); | ||
676 | if (rc) | ||
677 | return rc; | ||
678 | |||
679 | rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); | 675 | rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); |
680 | if (rc) | 676 | if (rc) |
681 | return rc; | 677 | return rc; |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 388d07fab5f7..9d9670a9b117 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -874,8 +874,14 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
874 | 874 | ||
875 | if (status & (NV_ADMA_STAT_DONE | | 875 | if (status & (NV_ADMA_STAT_DONE | |
876 | NV_ADMA_STAT_CPBERR)) { | 876 | NV_ADMA_STAT_CPBERR)) { |
877 | u32 check_commands = notifier | notifier_error; | 877 | u32 check_commands; |
878 | int pos, error = 0; | 878 | int pos, error = 0; |
879 | |||
880 | if(ata_tag_valid(ap->active_tag)) | ||
881 | check_commands = 1 << ap->active_tag; | ||
882 | else | ||
883 | check_commands = ap->sactive; | ||
884 | |||
879 | /** Check CPBs for completed commands */ | 885 | /** Check CPBs for completed commands */ |
880 | while ((pos = ffs(check_commands)) && !error) { | 886 | while ((pos = ffs(check_commands)) && !error) { |
881 | pos--; | 887 | pos--; |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 75d961599651..5614df8c1ce2 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -346,6 +346,7 @@ static const struct pci_device_id sil24_pci_tbl[] = { | |||
346 | { PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 }, | 346 | { PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 }, |
347 | { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 }, | 347 | { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 }, |
348 | { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 }, | 348 | { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 }, |
349 | { PCI_VDEVICE(CMD, 0x0242), BID_SIL3132 }, | ||
349 | { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 }, | 350 | { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 }, |
350 | { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 }, | 351 | { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 }, |
351 | 352 | ||
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c index 1879e0cd56aa..a787f0d4a5ba 100644 --- a/drivers/ata/sata_sis.c +++ b/drivers/ata/sata_sis.c | |||
@@ -354,7 +354,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
354 | return -ENOMEM; | 354 | return -ENOMEM; |
355 | 355 | ||
356 | if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) { | 356 | if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) { |
357 | void *mmio; | 357 | void __iomem *mmio; |
358 | 358 | ||
359 | mmio = pcim_iomap(pdev, SIS_SCR_PCI_BAR, 0); | 359 | mmio = pcim_iomap(pdev, SIS_SCR_PCI_BAR, 0); |
360 | if (!mmio) | 360 | if (!mmio) |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 0d7091e2077f..2ad2527cf5b3 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
@@ -1177,7 +1177,7 @@ static void __devinit eprom_get_esi(struct atm_dev *dev) | |||
1177 | /*--------------------------------- entries ---------------------------------*/ | 1177 | /*--------------------------------- entries ---------------------------------*/ |
1178 | 1178 | ||
1179 | 1179 | ||
1180 | static int __init zatm_init(struct atm_dev *dev) | 1180 | static int __devinit zatm_init(struct atm_dev *dev) |
1181 | { | 1181 | { |
1182 | struct zatm_dev *zatm_dev; | 1182 | struct zatm_dev *zatm_dev; |
1183 | struct pci_dev *pci_dev; | 1183 | struct pci_dev *pci_dev; |
@@ -1256,7 +1256,7 @@ static int __init zatm_init(struct atm_dev *dev) | |||
1256 | } | 1256 | } |
1257 | 1257 | ||
1258 | 1258 | ||
1259 | static int __init zatm_start(struct atm_dev *dev) | 1259 | static int __devinit zatm_start(struct atm_dev *dev) |
1260 | { | 1260 | { |
1261 | struct zatm_dev *zatm_dev = ZATM_DEV(dev); | 1261 | struct zatm_dev *zatm_dev = ZATM_DEV(dev); |
1262 | struct pci_dev *pdev = zatm_dev->pci_dev; | 1262 | struct pci_dev *pdev = zatm_dev->pci_dev; |
diff --git a/drivers/base/core.c b/drivers/base/core.c index cf2a398aaaa1..ad0f4a2f25c4 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -407,6 +407,35 @@ void device_remove_bin_file(struct device *dev, struct bin_attribute *attr) | |||
407 | } | 407 | } |
408 | EXPORT_SYMBOL_GPL(device_remove_bin_file); | 408 | EXPORT_SYMBOL_GPL(device_remove_bin_file); |
409 | 409 | ||
410 | /** | ||
411 | * device_schedule_callback - helper to schedule a callback for a device | ||
412 | * @dev: device. | ||
413 | * @func: callback function to invoke later. | ||
414 | * | ||
415 | * Attribute methods must not unregister themselves or their parent device | ||
416 | * (which would amount to the same thing). Attempts to do so will deadlock, | ||
417 | * since unregistration is mutually exclusive with driver callbacks. | ||
418 | * | ||
419 | * Instead methods can call this routine, which will attempt to allocate | ||
420 | * and schedule a workqueue request to call back @func with @dev as its | ||
421 | * argument in the workqueue's process context. @dev will be pinned until | ||
422 | * @func returns. | ||
423 | * | ||
424 | * Returns 0 if the request was submitted, -ENOMEM if storage could not | ||
425 | * be allocated. | ||
426 | * | ||
427 | * NOTE: This routine won't work if CONFIG_SYSFS isn't set! It uses an | ||
428 | * underlying sysfs routine (since it is intended for use by attribute | ||
429 | * methods), and if sysfs isn't available you'll get nothing but -ENOSYS. | ||
430 | */ | ||
431 | int device_schedule_callback(struct device *dev, | ||
432 | void (*func)(struct device *)) | ||
433 | { | ||
434 | return sysfs_schedule_callback(&dev->kobj, | ||
435 | (void (*)(void *)) func, dev); | ||
436 | } | ||
437 | EXPORT_SYMBOL_GPL(device_schedule_callback); | ||
438 | |||
410 | static void klist_children_get(struct klist_node *n) | 439 | static void klist_children_get(struct klist_node *n) |
411 | { | 440 | { |
412 | struct device *dev = container_of(n, struct device, knode_parent); | 441 | struct device *dev = container_of(n, struct device, knode_parent); |
@@ -584,17 +613,17 @@ int device_add(struct device *dev) | |||
584 | if (dev->kobj.parent != &dev->class->subsys.kset.kobj) | 613 | if (dev->kobj.parent != &dev->class->subsys.kset.kobj) |
585 | sysfs_create_link(&dev->class->subsys.kset.kobj, | 614 | sysfs_create_link(&dev->class->subsys.kset.kobj, |
586 | &dev->kobj, dev->bus_id); | 615 | &dev->kobj, dev->bus_id); |
587 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
588 | if (parent) { | 616 | if (parent) { |
589 | sysfs_create_link(&dev->kobj, &dev->parent->kobj, | 617 | sysfs_create_link(&dev->kobj, &dev->parent->kobj, |
590 | "device"); | 618 | "device"); |
619 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
591 | class_name = make_class_name(dev->class->name, | 620 | class_name = make_class_name(dev->class->name, |
592 | &dev->kobj); | 621 | &dev->kobj); |
593 | if (class_name) | 622 | if (class_name) |
594 | sysfs_create_link(&dev->parent->kobj, | 623 | sysfs_create_link(&dev->parent->kobj, |
595 | &dev->kobj, class_name); | 624 | &dev->kobj, class_name); |
596 | } | ||
597 | #endif | 625 | #endif |
626 | } | ||
598 | } | 627 | } |
599 | 628 | ||
600 | if ((error = device_add_attrs(dev))) | 629 | if ((error = device_add_attrs(dev))) |
@@ -651,17 +680,17 @@ int device_add(struct device *dev) | |||
651 | if (dev->kobj.parent != &dev->class->subsys.kset.kobj) | 680 | if (dev->kobj.parent != &dev->class->subsys.kset.kobj) |
652 | sysfs_remove_link(&dev->class->subsys.kset.kobj, | 681 | sysfs_remove_link(&dev->class->subsys.kset.kobj, |
653 | dev->bus_id); | 682 | dev->bus_id); |
654 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
655 | if (parent) { | 683 | if (parent) { |
684 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
656 | char *class_name = make_class_name(dev->class->name, | 685 | char *class_name = make_class_name(dev->class->name, |
657 | &dev->kobj); | 686 | &dev->kobj); |
658 | if (class_name) | 687 | if (class_name) |
659 | sysfs_remove_link(&dev->parent->kobj, | 688 | sysfs_remove_link(&dev->parent->kobj, |
660 | class_name); | 689 | class_name); |
661 | kfree(class_name); | 690 | kfree(class_name); |
691 | #endif | ||
662 | sysfs_remove_link(&dev->kobj, "device"); | 692 | sysfs_remove_link(&dev->kobj, "device"); |
663 | } | 693 | } |
664 | #endif | ||
665 | 694 | ||
666 | down(&dev->class->sem); | 695 | down(&dev->class->sem); |
667 | /* notify any interfaces that the device is now gone */ | 696 | /* notify any interfaces that the device is now gone */ |
@@ -761,17 +790,17 @@ void device_del(struct device * dev) | |||
761 | if (dev->kobj.parent != &dev->class->subsys.kset.kobj) | 790 | if (dev->kobj.parent != &dev->class->subsys.kset.kobj) |
762 | sysfs_remove_link(&dev->class->subsys.kset.kobj, | 791 | sysfs_remove_link(&dev->class->subsys.kset.kobj, |
763 | dev->bus_id); | 792 | dev->bus_id); |
764 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
765 | if (parent) { | 793 | if (parent) { |
794 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
766 | char *class_name = make_class_name(dev->class->name, | 795 | char *class_name = make_class_name(dev->class->name, |
767 | &dev->kobj); | 796 | &dev->kobj); |
768 | if (class_name) | 797 | if (class_name) |
769 | sysfs_remove_link(&dev->parent->kobj, | 798 | sysfs_remove_link(&dev->parent->kobj, |
770 | class_name); | 799 | class_name); |
771 | kfree(class_name); | 800 | kfree(class_name); |
801 | #endif | ||
772 | sysfs_remove_link(&dev->kobj, "device"); | 802 | sysfs_remove_link(&dev->kobj, "device"); |
773 | } | 803 | } |
774 | #endif | ||
775 | 804 | ||
776 | down(&dev->class->sem); | 805 | down(&dev->class->sem); |
777 | /* notify any interfaces that the device is now gone */ | 806 | /* notify any interfaces that the device is now gone */ |
@@ -787,6 +816,13 @@ void device_del(struct device * dev) | |||
787 | device_remove_attrs(dev); | 816 | device_remove_attrs(dev); |
788 | bus_remove_device(dev); | 817 | bus_remove_device(dev); |
789 | 818 | ||
819 | /* | ||
820 | * Some platform devices are driven without driver attached | ||
821 | * and managed resources may have been acquired. Make sure | ||
822 | * all resources are released. | ||
823 | */ | ||
824 | devres_release_all(dev); | ||
825 | |||
790 | /* Notify the platform of the removal, in case they | 826 | /* Notify the platform of the removal, in case they |
791 | * need to do anything... | 827 | * need to do anything... |
792 | */ | 828 | */ |
@@ -1058,14 +1094,14 @@ int device_rename(struct device *dev, char *new_name) | |||
1058 | 1094 | ||
1059 | return error; | 1095 | return error; |
1060 | } | 1096 | } |
1061 | 1097 | EXPORT_SYMBOL_GPL(device_rename); | |
1062 | 1098 | ||
1063 | static int device_move_class_links(struct device *dev, | 1099 | static int device_move_class_links(struct device *dev, |
1064 | struct device *old_parent, | 1100 | struct device *old_parent, |
1065 | struct device *new_parent) | 1101 | struct device *new_parent) |
1066 | { | 1102 | { |
1103 | int error = 0; | ||
1067 | #ifdef CONFIG_SYSFS_DEPRECATED | 1104 | #ifdef CONFIG_SYSFS_DEPRECATED |
1068 | int error; | ||
1069 | char *class_name; | 1105 | char *class_name; |
1070 | 1106 | ||
1071 | class_name = make_class_name(dev->class->name, &dev->kobj); | 1107 | class_name = make_class_name(dev->class->name, &dev->kobj); |
@@ -1093,7 +1129,12 @@ out: | |||
1093 | kfree(class_name); | 1129 | kfree(class_name); |
1094 | return error; | 1130 | return error; |
1095 | #else | 1131 | #else |
1096 | return 0; | 1132 | if (old_parent) |
1133 | sysfs_remove_link(&dev->kobj, "device"); | ||
1134 | if (new_parent) | ||
1135 | error = sysfs_create_link(&dev->kobj, &new_parent->kobj, | ||
1136 | "device"); | ||
1137 | return error; | ||
1097 | #endif | 1138 | #endif |
1098 | } | 1139 | } |
1099 | 1140 | ||
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 0c716ee905d7..072e18e6d76d 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1439,7 +1439,7 @@ static int rebuild_lun_table(ctlr_info_t *h, struct gendisk *del_disk) | |||
1439 | 1439 | ||
1440 | if (return_code == IO_OK) { | 1440 | if (return_code == IO_OK) { |
1441 | listlength = | 1441 | listlength = |
1442 | be32_to_cpu(*(__u32 *) ld_buff->LUNListLength); | 1442 | be32_to_cpu(*(__be32 *) ld_buff->LUNListLength); |
1443 | } else { /* reading number of logical volumes failed */ | 1443 | } else { /* reading number of logical volumes failed */ |
1444 | printk(KERN_WARNING "cciss: report logical volume" | 1444 | printk(KERN_WARNING "cciss: report logical volume" |
1445 | " command failed\n"); | 1445 | " command failed\n"); |
@@ -1961,8 +1961,8 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1961 | ctlr, buf, sizeof(ReadCapdata_struct), | 1961 | ctlr, buf, sizeof(ReadCapdata_struct), |
1962 | 1, logvol, 0, NULL, TYPE_CMD); | 1962 | 1, logvol, 0, NULL, TYPE_CMD); |
1963 | if (return_code == IO_OK) { | 1963 | if (return_code == IO_OK) { |
1964 | *total_size = be32_to_cpu(*(__u32 *) buf->total_size); | 1964 | *total_size = be32_to_cpu(*(__be32 *) buf->total_size); |
1965 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 1965 | *block_size = be32_to_cpu(*(__be32 *) buf->block_size); |
1966 | } else { /* read capacity command failed */ | 1966 | } else { /* read capacity command failed */ |
1967 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 1967 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
1968 | *total_size = 0; | 1968 | *total_size = 0; |
@@ -1997,8 +1997,8 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1997 | 1, logvol, 0, NULL, TYPE_CMD); | 1997 | 1, logvol, 0, NULL, TYPE_CMD); |
1998 | } | 1998 | } |
1999 | if (return_code == IO_OK) { | 1999 | if (return_code == IO_OK) { |
2000 | *total_size = be64_to_cpu(*(__u64 *) buf->total_size); | 2000 | *total_size = be64_to_cpu(*(__be64 *) buf->total_size); |
2001 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 2001 | *block_size = be32_to_cpu(*(__be32 *) buf->block_size); |
2002 | } else { /* read capacity command failed */ | 2002 | } else { /* read capacity command failed */ |
2003 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 2003 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
2004 | *total_size = 0; | 2004 | *total_size = 0; |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 99e2c8ce1cc4..31e01488eb51 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -663,11 +663,11 @@ static enum action pd_identify(struct pd_unit *disk) | |||
663 | return Fail; | 663 | return Fail; |
664 | pi_read_block(disk->pi, pd_scratch, 512); | 664 | pi_read_block(disk->pi, pd_scratch, 512); |
665 | disk->can_lba = pd_scratch[99] & 2; | 665 | disk->can_lba = pd_scratch[99] & 2; |
666 | disk->sectors = le16_to_cpu(*(u16 *) (pd_scratch + 12)); | 666 | disk->sectors = le16_to_cpu(*(__le16 *) (pd_scratch + 12)); |
667 | disk->heads = le16_to_cpu(*(u16 *) (pd_scratch + 6)); | 667 | disk->heads = le16_to_cpu(*(__le16 *) (pd_scratch + 6)); |
668 | disk->cylinders = le16_to_cpu(*(u16 *) (pd_scratch + 2)); | 668 | disk->cylinders = le16_to_cpu(*(__le16 *) (pd_scratch + 2)); |
669 | if (disk->can_lba) | 669 | if (disk->can_lba) |
670 | disk->capacity = le32_to_cpu(*(u32 *) (pd_scratch + 120)); | 670 | disk->capacity = le32_to_cpu(*(__le32 *) (pd_scratch + 120)); |
671 | else | 671 | else |
672 | disk->capacity = disk->sectors * disk->heads * disk->cylinders; | 672 | disk->capacity = disk->sectors * disk->heads * disk->cylinders; |
673 | 673 | ||
diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c index 5f4fdcf7c96e..1f0962616ee5 100644 --- a/drivers/char/lcd.c +++ b/drivers/char/lcd.c | |||
@@ -11,9 +11,6 @@ | |||
11 | * March 2001: Ported from 2.0.34 by Liam Davies | 11 | * March 2001: Ported from 2.0.34 by Liam Davies |
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | |||
15 | #define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */ | ||
16 | |||
17 | #include <linux/types.h> | 14 | #include <linux/types.h> |
18 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
19 | #include <linux/miscdevice.h> | 16 | #include <linux/miscdevice.h> |
@@ -32,8 +29,6 @@ | |||
32 | 29 | ||
33 | #include "lcd.h" | 30 | #include "lcd.h" |
34 | 31 | ||
35 | static DEFINE_SPINLOCK(lcd_lock); | ||
36 | |||
37 | static int lcd_ioctl(struct inode *inode, struct file *file, | 32 | static int lcd_ioctl(struct inode *inode, struct file *file, |
38 | unsigned int cmd, unsigned long arg); | 33 | unsigned int cmd, unsigned long arg); |
39 | 34 | ||
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e45326856680..7a32df594907 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -1376,6 +1376,8 @@ static void do_tty_hangup(struct work_struct *work) | |||
1376 | read_unlock(&tasklist_lock); | 1376 | read_unlock(&tasklist_lock); |
1377 | 1377 | ||
1378 | tty->flags = 0; | 1378 | tty->flags = 0; |
1379 | put_pid(tty->session); | ||
1380 | put_pid(tty->pgrp); | ||
1379 | tty->session = NULL; | 1381 | tty->session = NULL; |
1380 | tty->pgrp = NULL; | 1382 | tty->pgrp = NULL; |
1381 | tty->ctrl_status = 0; | 1383 | tty->ctrl_status = 0; |
@@ -3841,6 +3843,9 @@ static struct pid *__proc_set_tty(struct task_struct *tsk, struct tty_struct *tt | |||
3841 | { | 3843 | { |
3842 | struct pid *old_pgrp; | 3844 | struct pid *old_pgrp; |
3843 | if (tty) { | 3845 | if (tty) { |
3846 | /* We should not have a session or pgrp to here but.... */ | ||
3847 | put_pid(tty->session); | ||
3848 | put_pid(tty->pgrp); | ||
3844 | tty->session = get_pid(task_session(tsk)); | 3849 | tty->session = get_pid(task_session(tsk)); |
3845 | tty->pgrp = get_pid(task_pgrp(tsk)); | 3850 | tty->pgrp = get_pid(task_pgrp(tsk)); |
3846 | } | 3851 | } |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index c3f8e383933b..1bbb45b937fd 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -724,6 +724,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ | |||
724 | return -ENOMEM; | 724 | return -ENOMEM; |
725 | memset(vc, 0, sizeof(*vc)); | 725 | memset(vc, 0, sizeof(*vc)); |
726 | vc_cons[currcons].d = vc; | 726 | vc_cons[currcons].d = vc; |
727 | INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); | ||
727 | visual_init(vc, currcons, 1); | 728 | visual_init(vc, currcons, 1); |
728 | if (!*vc->vc_uni_pagedir_loc) | 729 | if (!*vc->vc_uni_pagedir_loc) |
729 | con_set_default_unimap(vc); | 730 | con_set_default_unimap(vc); |
@@ -2185,10 +2186,28 @@ static void console_callback(struct work_struct *ignored) | |||
2185 | release_console_sem(); | 2186 | release_console_sem(); |
2186 | } | 2187 | } |
2187 | 2188 | ||
2188 | void set_console(int nr) | 2189 | int set_console(int nr) |
2189 | { | 2190 | { |
2191 | struct vc_data *vc = vc_cons[fg_console].d; | ||
2192 | |||
2193 | if (!vc_cons_allocated(nr) || vt_dont_switch || | ||
2194 | (vc->vt_mode.mode == VT_AUTO && vc->vc_mode == KD_GRAPHICS)) { | ||
2195 | |||
2196 | /* | ||
2197 | * Console switch will fail in console_callback() or | ||
2198 | * change_console() so there is no point scheduling | ||
2199 | * the callback | ||
2200 | * | ||
2201 | * Existing set_console() users don't check the return | ||
2202 | * value so this shouldn't break anything | ||
2203 | */ | ||
2204 | return -EINVAL; | ||
2205 | } | ||
2206 | |||
2190 | want_console = nr; | 2207 | want_console = nr; |
2191 | schedule_console_callback(); | 2208 | schedule_console_callback(); |
2209 | |||
2210 | return 0; | ||
2192 | } | 2211 | } |
2193 | 2212 | ||
2194 | struct tty_driver *console_driver; | 2213 | struct tty_driver *console_driver; |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 3a5d301e783b..1fa2da8f4fbe 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <linux/kbd_diacr.h> | 34 | #include <linux/kbd_diacr.h> |
35 | #include <linux/selection.h> | 35 | #include <linux/selection.h> |
36 | 36 | ||
37 | static char vt_dont_switch; | 37 | char vt_dont_switch; |
38 | extern struct tty_driver *console_driver; | 38 | extern struct tty_driver *console_driver; |
39 | 39 | ||
40 | #define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) | 40 | #define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) |
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig index ea09d0c974ea..e812aa129e28 100644 --- a/drivers/char/watchdog/Kconfig +++ b/drivers/char/watchdog/Kconfig | |||
@@ -301,6 +301,7 @@ config I6300ESB_WDT | |||
301 | config I8XX_TCO | 301 | config I8XX_TCO |
302 | tristate "Intel i8xx TCO Timer/Watchdog" | 302 | tristate "Intel i8xx TCO Timer/Watchdog" |
303 | depends on WATCHDOG && (X86 || IA64) && PCI | 303 | depends on WATCHDOG && (X86 || IA64) && PCI |
304 | default n | ||
304 | ---help--- | 305 | ---help--- |
305 | Hardware driver for the TCO timer built into the Intel 82801 | 306 | Hardware driver for the TCO timer built into the Intel 82801 |
306 | I/O Controller Hub family. The TCO (Total Cost of Ownership) | 307 | I/O Controller Hub family. The TCO (Total Cost of Ownership) |
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index 4a328ba0d262..76c7fa37fa6c 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c | |||
@@ -314,21 +314,21 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
314 | { | 314 | { |
315 | void __user *argp = (void __user *)arg; | 315 | void __user *argp = (void __user *)arg; |
316 | int __user *p = argp; | 316 | int __user *p = argp; |
317 | switch(cmd){ | 317 | switch (cmd) { |
318 | case WDIOC_GETSUPPORT: | 318 | case WDIOC_GETSUPPORT: |
319 | if (copy_to_user(argp, &zf_info, sizeof(zf_info))) | 319 | if (copy_to_user(argp, &zf_info, sizeof(zf_info))) |
320 | return -EFAULT; | 320 | return -EFAULT; |
321 | break; | 321 | break; |
322 | 322 | ||
323 | case WDIOC_GETSTATUS: | 323 | case WDIOC_GETSTATUS: |
324 | return put_user(0, p); | 324 | return put_user(0, p); |
325 | 325 | ||
326 | case WDIOC_KEEPALIVE: | 326 | case WDIOC_KEEPALIVE: |
327 | zf_ping(0); | 327 | zf_ping(0); |
328 | break; | 328 | break; |
329 | 329 | ||
330 | default: | 330 | default: |
331 | return -ENOTTY; | 331 | return -ENOTTY; |
332 | } | 332 | } |
333 | 333 | ||
334 | return 0; | 334 | return 0; |
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 15278044295c..322ee2984e3d 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -176,6 +176,7 @@ void dma_chan_cleanup(struct kref *kref) | |||
176 | chan->client = NULL; | 176 | chan->client = NULL; |
177 | kref_put(&chan->device->refcount, dma_async_device_cleanup); | 177 | kref_put(&chan->device->refcount, dma_async_device_cleanup); |
178 | } | 178 | } |
179 | EXPORT_SYMBOL(dma_chan_cleanup); | ||
179 | 180 | ||
180 | static void dma_chan_free_rcu(struct rcu_head *rcu) | 181 | static void dma_chan_free_rcu(struct rcu_head *rcu) |
181 | { | 182 | { |
@@ -261,6 +262,7 @@ struct dma_client *dma_async_client_register(dma_event_callback event_callback) | |||
261 | 262 | ||
262 | return client; | 263 | return client; |
263 | } | 264 | } |
265 | EXPORT_SYMBOL(dma_async_client_register); | ||
264 | 266 | ||
265 | /** | 267 | /** |
266 | * dma_async_client_unregister - unregister a client and free the &dma_client | 268 | * dma_async_client_unregister - unregister a client and free the &dma_client |
@@ -287,6 +289,7 @@ void dma_async_client_unregister(struct dma_client *client) | |||
287 | kfree(client); | 289 | kfree(client); |
288 | dma_chans_rebalance(); | 290 | dma_chans_rebalance(); |
289 | } | 291 | } |
292 | EXPORT_SYMBOL(dma_async_client_unregister); | ||
290 | 293 | ||
291 | /** | 294 | /** |
292 | * dma_async_client_chan_request - request DMA channels | 295 | * dma_async_client_chan_request - request DMA channels |
@@ -304,6 +307,7 @@ void dma_async_client_chan_request(struct dma_client *client, | |||
304 | client->chans_desired = number; | 307 | client->chans_desired = number; |
305 | dma_chans_rebalance(); | 308 | dma_chans_rebalance(); |
306 | } | 309 | } |
310 | EXPORT_SYMBOL(dma_async_client_chan_request); | ||
307 | 311 | ||
308 | /** | 312 | /** |
309 | * dma_async_device_register - registers DMA devices found | 313 | * dma_async_device_register - registers DMA devices found |
@@ -346,6 +350,7 @@ int dma_async_device_register(struct dma_device *device) | |||
346 | 350 | ||
347 | return 0; | 351 | return 0; |
348 | } | 352 | } |
353 | EXPORT_SYMBOL(dma_async_device_register); | ||
349 | 354 | ||
350 | /** | 355 | /** |
351 | * dma_async_device_cleanup - function called when all references are released | 356 | * dma_async_device_cleanup - function called when all references are released |
@@ -390,23 +395,12 @@ void dma_async_device_unregister(struct dma_device *device) | |||
390 | kref_put(&device->refcount, dma_async_device_cleanup); | 395 | kref_put(&device->refcount, dma_async_device_cleanup); |
391 | wait_for_completion(&device->done); | 396 | wait_for_completion(&device->done); |
392 | } | 397 | } |
398 | EXPORT_SYMBOL(dma_async_device_unregister); | ||
393 | 399 | ||
394 | static int __init dma_bus_init(void) | 400 | static int __init dma_bus_init(void) |
395 | { | 401 | { |
396 | mutex_init(&dma_list_mutex); | 402 | mutex_init(&dma_list_mutex); |
397 | return class_register(&dma_devclass); | 403 | return class_register(&dma_devclass); |
398 | } | 404 | } |
399 | |||
400 | subsys_initcall(dma_bus_init); | 405 | subsys_initcall(dma_bus_init); |
401 | 406 | ||
402 | EXPORT_SYMBOL(dma_async_client_register); | ||
403 | EXPORT_SYMBOL(dma_async_client_unregister); | ||
404 | EXPORT_SYMBOL(dma_async_client_chan_request); | ||
405 | EXPORT_SYMBOL(dma_async_memcpy_buf_to_buf); | ||
406 | EXPORT_SYMBOL(dma_async_memcpy_buf_to_pg); | ||
407 | EXPORT_SYMBOL(dma_async_memcpy_pg_to_pg); | ||
408 | EXPORT_SYMBOL(dma_async_memcpy_complete); | ||
409 | EXPORT_SYMBOL(dma_async_memcpy_issue_pending); | ||
410 | EXPORT_SYMBOL(dma_async_device_register); | ||
411 | EXPORT_SYMBOL(dma_async_device_unregister); | ||
412 | EXPORT_SYMBOL(dma_chan_cleanup); | ||
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index f4ee1afe488f..67f3347afcf3 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/byteorder.h> | 26 | #include <asm/byteorder.h> |
27 | #include <linux/input.h> | 27 | #include <linux/input.h> |
28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
29 | #include <linux/vmalloc.h> | ||
29 | 30 | ||
30 | #include <linux/hid.h> | 31 | #include <linux/hid.h> |
31 | #include <linux/hiddev.h> | 32 | #include <linux/hiddev.h> |
@@ -654,12 +655,13 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
654 | memcpy(device->rdesc, start, size); | 655 | memcpy(device->rdesc, start, size); |
655 | device->rsize = size; | 656 | device->rsize = size; |
656 | 657 | ||
657 | if (!(parser = kzalloc(sizeof(struct hid_parser), GFP_KERNEL))) { | 658 | if (!(parser = vmalloc(sizeof(struct hid_parser)))) { |
658 | kfree(device->rdesc); | 659 | kfree(device->rdesc); |
659 | kfree(device->collection); | 660 | kfree(device->collection); |
660 | kfree(device); | 661 | kfree(device); |
661 | return NULL; | 662 | return NULL; |
662 | } | 663 | } |
664 | memset(parser, 0, sizeof(struct hid_parser)); | ||
663 | parser->device = device; | 665 | parser->device = device; |
664 | 666 | ||
665 | end = start + size; | 667 | end = start + size; |
@@ -668,7 +670,7 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
668 | if (item.format != HID_ITEM_FORMAT_SHORT) { | 670 | if (item.format != HID_ITEM_FORMAT_SHORT) { |
669 | dbg("unexpected long global item"); | 671 | dbg("unexpected long global item"); |
670 | hid_free_device(device); | 672 | hid_free_device(device); |
671 | kfree(parser); | 673 | vfree(parser); |
672 | return NULL; | 674 | return NULL; |
673 | } | 675 | } |
674 | 676 | ||
@@ -676,7 +678,7 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
676 | dbg("item %u %u %u %u parsing failed\n", | 678 | dbg("item %u %u %u %u parsing failed\n", |
677 | item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); | 679 | item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); |
678 | hid_free_device(device); | 680 | hid_free_device(device); |
679 | kfree(parser); | 681 | vfree(parser); |
680 | return NULL; | 682 | return NULL; |
681 | } | 683 | } |
682 | 684 | ||
@@ -684,23 +686,23 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
684 | if (parser->collection_stack_ptr) { | 686 | if (parser->collection_stack_ptr) { |
685 | dbg("unbalanced collection at end of report description"); | 687 | dbg("unbalanced collection at end of report description"); |
686 | hid_free_device(device); | 688 | hid_free_device(device); |
687 | kfree(parser); | 689 | vfree(parser); |
688 | return NULL; | 690 | return NULL; |
689 | } | 691 | } |
690 | if (parser->local.delimiter_depth) { | 692 | if (parser->local.delimiter_depth) { |
691 | dbg("unbalanced delimiter at end of report description"); | 693 | dbg("unbalanced delimiter at end of report description"); |
692 | hid_free_device(device); | 694 | hid_free_device(device); |
693 | kfree(parser); | 695 | vfree(parser); |
694 | return NULL; | 696 | return NULL; |
695 | } | 697 | } |
696 | kfree(parser); | 698 | vfree(parser); |
697 | return device; | 699 | return device; |
698 | } | 700 | } |
699 | } | 701 | } |
700 | 702 | ||
701 | dbg("item fetching failed at offset %d\n", (int)(end - start)); | 703 | dbg("item fetching failed at offset %d\n", (int)(end - start)); |
702 | hid_free_device(device); | 704 | hid_free_device(device); |
703 | kfree(parser); | 705 | vfree(parser); |
704 | return NULL; | 706 | return NULL; |
705 | } | 707 | } |
706 | EXPORT_SYMBOL_GPL(hid_parse_report); | 708 | EXPORT_SYMBOL_GPL(hid_parse_report); |
@@ -753,8 +755,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) | |||
753 | 755 | ||
754 | report += offset >> 3; /* adjust byte index */ | 756 | report += offset >> 3; /* adjust byte index */ |
755 | offset &= 7; /* now only need bit offset into one byte */ | 757 | offset &= 7; /* now only need bit offset into one byte */ |
756 | x = get_unaligned((u64 *) report); | 758 | x = le64_to_cpu(get_unaligned((__le64 *) report)); |
757 | x = le64_to_cpu(x); | ||
758 | x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */ | 759 | x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */ |
759 | return (u32) x; | 760 | return (u32) x; |
760 | } | 761 | } |
@@ -769,7 +770,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) | |||
769 | */ | 770 | */ |
770 | static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) | 771 | static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) |
771 | { | 772 | { |
772 | u64 x; | 773 | __le64 x; |
773 | u64 m = (1ULL << n) - 1; | 774 | u64 m = (1ULL << n) - 1; |
774 | 775 | ||
775 | WARN_ON(n > 32); | 776 | WARN_ON(n > 32); |
@@ -780,10 +781,10 @@ static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u3 | |||
780 | report += offset >> 3; | 781 | report += offset >> 3; |
781 | offset &= 7; | 782 | offset &= 7; |
782 | 783 | ||
783 | x = get_unaligned((u64 *)report); | 784 | x = get_unaligned((__le64 *)report); |
784 | x &= cpu_to_le64(~(m << offset)); | 785 | x &= cpu_to_le64(~(m << offset)); |
785 | x |= cpu_to_le64(((u64) value) << offset); | 786 | x |= cpu_to_le64(((u64) value) << offset); |
786 | put_unaligned(x, (u64 *) report); | 787 | put_unaligned(x, (__le64 *) report); |
787 | } | 788 | } |
788 | 789 | ||
789 | /* | 790 | /* |
@@ -873,10 +874,6 @@ static void hid_output_field(struct hid_field *field, __u8 *data) | |||
873 | unsigned size = field->report_size; | 874 | unsigned size = field->report_size; |
874 | unsigned n; | 875 | unsigned n; |
875 | 876 | ||
876 | /* make sure the unused bits in the last byte are zeros */ | ||
877 | if (count > 0 && size > 0) | ||
878 | data[(offset+count*size-1)/8] = 0; | ||
879 | |||
880 | for (n = 0; n < count; n++) { | 877 | for (n = 0; n < count; n++) { |
881 | if (field->logical_minimum < 0) /* signed values */ | 878 | if (field->logical_minimum < 0) /* signed values */ |
882 | implement(data, offset + n * size, size, s32ton(field->value[n], size)); | 879 | implement(data, offset + n * size, size, s32ton(field->value[n], size)); |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index c3d4856fb618..6d105a1d41b1 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -527,6 +527,7 @@ config SENSORS_W83792D | |||
527 | config SENSORS_W83793 | 527 | config SENSORS_W83793 |
528 | tristate "Winbond W83793" | 528 | tristate "Winbond W83793" |
529 | depends on HWMON && I2C && EXPERIMENTAL | 529 | depends on HWMON && I2C && EXPERIMENTAL |
530 | select HWMON_VID | ||
530 | help | 531 | help |
531 | If you say yes here you get support for the Winbond W83793 | 532 | If you say yes here you get support for the Winbond W83793 |
532 | hardware monitoring chip. | 533 | hardware monitoring chip. |
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index e15f9e37716a..0c70f8293341 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c | |||
@@ -254,7 +254,8 @@ static s32 amd8111_access(struct i2c_adapter * adap, u16 addr, | |||
254 | break; | 254 | break; |
255 | 255 | ||
256 | case I2C_SMBUS_BLOCK_PROC_CALL: | 256 | case I2C_SMBUS_BLOCK_PROC_CALL: |
257 | len = min_t(u8, data->block[0], 31); | 257 | len = min_t(u8, data->block[0], |
258 | I2C_SMBUS_BLOCK_MAX - 1); | ||
258 | amd_ec_write(smbus, AMD_SMB_CMD, command); | 259 | amd_ec_write(smbus, AMD_SMB_CMD, command); |
259 | amd_ec_write(smbus, AMD_SMB_BCNT, len); | 260 | amd_ec_write(smbus, AMD_SMB_BCNT, len); |
260 | for (i = 0; i < len; i++) | 261 | for (i = 0; i < len; i++) |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 6569a36985bd..a320e7d82c1f 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -97,6 +97,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write, | |||
97 | int command, int hwpec); | 97 | int command, int hwpec); |
98 | 98 | ||
99 | static unsigned long i801_smba; | 99 | static unsigned long i801_smba; |
100 | static unsigned char i801_original_hstcfg; | ||
100 | static struct pci_driver i801_driver; | 101 | static struct pci_driver i801_driver; |
101 | static struct pci_dev *I801_dev; | 102 | static struct pci_dev *I801_dev; |
102 | static int isich4; | 103 | static int isich4; |
@@ -510,6 +511,7 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id | |||
510 | } | 511 | } |
511 | 512 | ||
512 | pci_read_config_byte(I801_dev, SMBHSTCFG, &temp); | 513 | pci_read_config_byte(I801_dev, SMBHSTCFG, &temp); |
514 | i801_original_hstcfg = temp; | ||
513 | temp &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ | 515 | temp &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ |
514 | if (!(temp & SMBHSTCFG_HST_EN)) { | 516 | if (!(temp & SMBHSTCFG_HST_EN)) { |
515 | dev_info(&dev->dev, "Enabling SMBus device\n"); | 517 | dev_info(&dev->dev, "Enabling SMBus device\n"); |
@@ -543,6 +545,7 @@ exit: | |||
543 | static void __devexit i801_remove(struct pci_dev *dev) | 545 | static void __devexit i801_remove(struct pci_dev *dev) |
544 | { | 546 | { |
545 | i2c_del_adapter(&i801_adapter); | 547 | i2c_del_adapter(&i801_adapter); |
548 | pci_write_config_byte(I801_dev, SMBHSTCFG, i801_original_hstcfg); | ||
546 | pci_release_region(dev, SMBBAR); | 549 | pci_release_region(dev, SMBBAR); |
547 | /* | 550 | /* |
548 | * do not call pci_disable_device(dev) since it can cause hard hangs on | 551 | * do not call pci_disable_device(dev) since it can cause hard hangs on |
@@ -550,11 +553,33 @@ static void __devexit i801_remove(struct pci_dev *dev) | |||
550 | */ | 553 | */ |
551 | } | 554 | } |
552 | 555 | ||
556 | #ifdef CONFIG_PM | ||
557 | static int i801_suspend(struct pci_dev *dev, pm_message_t mesg) | ||
558 | { | ||
559 | pci_save_state(dev); | ||
560 | pci_write_config_byte(dev, SMBHSTCFG, i801_original_hstcfg); | ||
561 | pci_set_power_state(dev, pci_choose_state(dev, mesg)); | ||
562 | return 0; | ||
563 | } | ||
564 | |||
565 | static int i801_resume(struct pci_dev *dev) | ||
566 | { | ||
567 | pci_set_power_state(dev, PCI_D0); | ||
568 | pci_restore_state(dev); | ||
569 | return pci_enable_device(dev); | ||
570 | } | ||
571 | #else | ||
572 | #define i801_suspend NULL | ||
573 | #define i801_resume NULL | ||
574 | #endif | ||
575 | |||
553 | static struct pci_driver i801_driver = { | 576 | static struct pci_driver i801_driver = { |
554 | .name = "i801_smbus", | 577 | .name = "i801_smbus", |
555 | .id_table = i801_ids, | 578 | .id_table = i801_ids, |
556 | .probe = i801_probe, | 579 | .probe = i801_probe, |
557 | .remove = __devexit_p(i801_remove), | 580 | .remove = __devexit_p(i801_remove), |
581 | .suspend = i801_suspend, | ||
582 | .resume = i801_resume, | ||
558 | }; | 583 | }; |
559 | 584 | ||
560 | static int __init i2c_i801_init(void) | 585 | static int __init i2c_i801_init(void) |
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c index 15edf40828b4..8a2ff0c114d9 100644 --- a/drivers/i2c/chips/ds1374.c +++ b/drivers/i2c/chips/ds1374.c | |||
@@ -207,6 +207,10 @@ static int ds1374_probe(struct i2c_adapter *adap, int addr, int kind) | |||
207 | client->driver = &ds1374_driver; | 207 | client->driver = &ds1374_driver; |
208 | 208 | ||
209 | ds1374_workqueue = create_singlethread_workqueue("ds1374"); | 209 | ds1374_workqueue = create_singlethread_workqueue("ds1374"); |
210 | if (!ds1374_workqueue) { | ||
211 | kfree(client); | ||
212 | return -ENOMEM; /* most expected reason */ | ||
213 | } | ||
210 | 214 | ||
211 | if ((rc = i2c_attach_client(client)) != 0) { | 215 | if ((rc = i2c_attach_client(client)) != 0) { |
212 | kfree(client); | 216 | kfree(client); |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 5d134bb75ba1..8f1fd017679b 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -434,24 +434,8 @@ config BLK_DEV_IDEDMA_FORCED | |||
434 | 434 | ||
435 | Generally say N here. | 435 | Generally say N here. |
436 | 436 | ||
437 | config IDEDMA_PCI_AUTO | ||
438 | bool "Use PCI DMA by default when available" | ||
439 | ---help--- | ||
440 | Prior to kernel version 2.1.112, Linux used to automatically use | ||
441 | DMA for IDE drives and chipsets which support it. Due to concerns | ||
442 | about a couple of cases where buggy hardware may have caused damage, | ||
443 | the default is now to NOT use DMA automatically. To revert to the | ||
444 | previous behaviour, say Y to this question. | ||
445 | |||
446 | If you suspect your hardware is at all flakey, say N here. | ||
447 | Do NOT email the IDE kernel people regarding this issue! | ||
448 | |||
449 | It is normally safe to answer Y to this question unless your | ||
450 | motherboard uses a VIA VP2 chipset, in which case you should say N. | ||
451 | |||
452 | config IDEDMA_ONLYDISK | 437 | config IDEDMA_ONLYDISK |
453 | bool "Enable DMA only for disks " | 438 | bool "Enable DMA only for disks " |
454 | depends on IDEDMA_PCI_AUTO | ||
455 | help | 439 | help |
456 | This is used if you know your ATAPI Devices are going to fail DMA | 440 | This is used if you know your ATAPI Devices are going to fail DMA |
457 | Transfers. | 441 | Transfers. |
@@ -769,6 +753,14 @@ config BLK_DEV_TC86C001 | |||
769 | help | 753 | help |
770 | This driver adds support for Toshiba TC86C001 GOKU-S chip. | 754 | This driver adds support for Toshiba TC86C001 GOKU-S chip. |
771 | 755 | ||
756 | config BLK_DEV_CELLEB | ||
757 | tristate "Toshiba's Cell Reference Set IDE support" | ||
758 | depends on PPC_CELLEB | ||
759 | help | ||
760 | This driver provides support for the built-in IDE controller on | ||
761 | Toshiba Cell Reference Board. | ||
762 | If unsure, say Y. | ||
763 | |||
772 | endif | 764 | endif |
773 | 765 | ||
774 | config BLK_DEV_IDE_PMAC | 766 | config BLK_DEV_IDE_PMAC |
@@ -800,14 +792,6 @@ config BLK_DEV_IDEDMA_PMAC | |||
800 | to transfer data to and from memory. Saying Y is safe and improves | 792 | to transfer data to and from memory. Saying Y is safe and improves |
801 | performance. | 793 | performance. |
802 | 794 | ||
803 | config BLK_DEV_IDE_CELLEB | ||
804 | bool "Toshiba's Cell Reference Set IDE support" | ||
805 | depends on PPC_CELLEB | ||
806 | help | ||
807 | This driver provides support for the built-in IDE controller on | ||
808 | Toshiba Cell Reference Board. | ||
809 | If unsure, say Y. | ||
810 | |||
811 | config BLK_DEV_IDE_SWARM | 795 | config BLK_DEV_IDE_SWARM |
812 | tristate "IDE for Sibyte evaluation boards" | 796 | tristate "IDE for Sibyte evaluation boards" |
813 | depends on SIBYTE_SB1xxx_SOC | 797 | depends on SIBYTE_SB1xxx_SOC |
@@ -851,19 +835,6 @@ config BLK_DEV_IDEDMA_ICS | |||
851 | Say Y here if you want to add DMA (Direct Memory Access) support to | 835 | Say Y here if you want to add DMA (Direct Memory Access) support to |
852 | the ICS IDE driver. | 836 | the ICS IDE driver. |
853 | 837 | ||
854 | config IDEDMA_ICS_AUTO | ||
855 | bool "Use ICS DMA by default" | ||
856 | depends on BLK_DEV_IDEDMA_ICS | ||
857 | help | ||
858 | Prior to kernel version 2.1.112, Linux used to automatically use | ||
859 | DMA for IDE drives and chipsets which support it. Due to concerns | ||
860 | about a couple of cases where buggy hardware may have caused damage, | ||
861 | the default is now to NOT use DMA automatically. To revert to the | ||
862 | previous behaviour, say Y to this question. | ||
863 | |||
864 | If you suspect your hardware is at all flakey, say N here. | ||
865 | Do NOT email the IDE kernel people regarding this issue! | ||
866 | |||
867 | config BLK_DEV_IDE_RAPIDE | 838 | config BLK_DEV_IDE_RAPIDE |
868 | tristate "RapIDE interface support" | 839 | tristate "RapIDE interface support" |
869 | depends on ARM && ARCH_ACORN | 840 | depends on ARM && ARCH_ACORN |
@@ -1086,9 +1057,6 @@ config IDEDMA_IVB | |||
1086 | 1057 | ||
1087 | It is normally safe to answer Y; however, the default is N. | 1058 | It is normally safe to answer Y; however, the default is N. |
1088 | 1059 | ||
1089 | config IDEDMA_AUTO | ||
1090 | def_bool IDEDMA_PCI_AUTO || IDEDMA_ICS_AUTO | ||
1091 | |||
1092 | endif | 1060 | endif |
1093 | 1061 | ||
1094 | config BLK_DEV_HD_ONLY | 1062 | config BLK_DEV_HD_ONLY |
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index 28feedfbd21d..d9f029e8ff74 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile | |||
@@ -37,7 +37,6 @@ ide-core-$(CONFIG_BLK_DEV_Q40IDE) += legacy/q40ide.o | |||
37 | # built-in only drivers from ppc/ | 37 | # built-in only drivers from ppc/ |
38 | ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ppc/mpc8xx.o | 38 | ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ppc/mpc8xx.o |
39 | ide-core-$(CONFIG_BLK_DEV_IDE_PMAC) += ppc/pmac.o | 39 | ide-core-$(CONFIG_BLK_DEV_IDE_PMAC) += ppc/pmac.o |
40 | ide-core-$(CONFIG_BLK_DEV_IDE_CELLEB) += ppc/scc_pata.o | ||
41 | 40 | ||
42 | # built-in only drivers from h8300/ | 41 | # built-in only drivers from h8300/ |
43 | ide-core-$(CONFIG_H8300) += h8300/ide-h8300.o | 42 | ide-core-$(CONFIG_H8300) += h8300/ide-h8300.o |
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 40e5c66b81ce..e2953fc1fafb 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -196,11 +196,6 @@ static void icside_maskproc(ide_drive_t *drive, int mask) | |||
196 | } | 196 | } |
197 | 197 | ||
198 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS | 198 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS |
199 | |||
200 | #ifndef CONFIG_IDEDMA_ICS_AUTO | ||
201 | #warning CONFIG_IDEDMA_ICS_AUTO=n support is obsolete, and will be removed soon. | ||
202 | #endif | ||
203 | |||
204 | /* | 199 | /* |
205 | * SG-DMA support. | 200 | * SG-DMA support. |
206 | * | 201 | * |
@@ -474,12 +469,6 @@ static int icside_dma_lostirq(ide_drive_t *drive) | |||
474 | 469 | ||
475 | static void icside_dma_init(ide_hwif_t *hwif) | 470 | static void icside_dma_init(ide_hwif_t *hwif) |
476 | { | 471 | { |
477 | int autodma = 0; | ||
478 | |||
479 | #ifdef CONFIG_IDEDMA_ICS_AUTO | ||
480 | autodma = 1; | ||
481 | #endif | ||
482 | |||
483 | printk(" %s: SG-DMA", hwif->name); | 472 | printk(" %s: SG-DMA", hwif->name); |
484 | 473 | ||
485 | hwif->atapi_dma = 1; | 474 | hwif->atapi_dma = 1; |
@@ -489,7 +478,7 @@ static void icside_dma_init(ide_hwif_t *hwif) | |||
489 | hwif->dmatable_cpu = NULL; | 478 | hwif->dmatable_cpu = NULL; |
490 | hwif->dmatable_dma = 0; | 479 | hwif->dmatable_dma = 0; |
491 | hwif->speedproc = icside_set_speed; | 480 | hwif->speedproc = icside_set_speed; |
492 | hwif->autodma = autodma; | 481 | hwif->autodma = 1; |
493 | 482 | ||
494 | hwif->ide_dma_check = icside_dma_check; | 483 | hwif->ide_dma_check = icside_dma_check; |
495 | hwif->dma_host_off = icside_dma_host_off; | 484 | hwif->dma_host_off = icside_dma_host_off; |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 08e7cd043bcc..fd213088b06b 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -767,7 +767,7 @@ int ide_set_dma(ide_drive_t *drive) | |||
767 | switch(rc) { | 767 | switch(rc) { |
768 | case -1: /* DMA needs to be disabled */ | 768 | case -1: /* DMA needs to be disabled */ |
769 | hwif->dma_off_quietly(drive); | 769 | hwif->dma_off_quietly(drive); |
770 | return 0; | 770 | return -1; |
771 | case 0: /* DMA needs to be enabled */ | 771 | case 0: /* DMA needs to be enabled */ |
772 | return hwif->ide_dma_on(drive); | 772 | return hwif->ide_dma_on(drive); |
773 | case 1: /* DMA setting cannot be changed */ | 773 | case 1: /* DMA setting cannot be changed */ |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index dfbd74458522..695610f0e3e4 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -177,11 +177,7 @@ DECLARE_MUTEX(ide_cfg_sem); | |||
177 | static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ | 177 | static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ |
178 | #endif | 178 | #endif |
179 | 179 | ||
180 | #ifdef CONFIG_IDEDMA_AUTO | ||
181 | int noautodma = 0; | 180 | int noautodma = 0; |
182 | #else | ||
183 | int noautodma = 1; | ||
184 | #endif | ||
185 | 181 | ||
186 | EXPORT_SYMBOL(noautodma); | 182 | EXPORT_SYMBOL(noautodma); |
187 | 183 | ||
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index b2dc028dc8ca..d54d9fe92a7d 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -639,6 +639,7 @@ static int au_ide_probe(struct device *dev) | |||
639 | _auide_hwif *ahwif = &auide_hwif; | 639 | _auide_hwif *ahwif = &auide_hwif; |
640 | ide_hwif_t *hwif; | 640 | ide_hwif_t *hwif; |
641 | struct resource *res; | 641 | struct resource *res; |
642 | hw_regs_t *hw; | ||
642 | int ret = 0; | 643 | int ret = 0; |
643 | 644 | ||
644 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) | 645 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) |
@@ -681,7 +682,7 @@ static int au_ide_probe(struct device *dev) | |||
681 | /* FIXME: This might possibly break PCMCIA IDE devices */ | 682 | /* FIXME: This might possibly break PCMCIA IDE devices */ |
682 | 683 | ||
683 | hwif = &ide_hwifs[pdev->id]; | 684 | hwif = &ide_hwifs[pdev->id]; |
684 | hw_regs_t *hw = &hwif->hw; | 685 | hw = &hwif->hw; |
685 | hwif->irq = hw->irq = ahwif->irq; | 686 | hwif->irq = hw->irq = ahwif->irq; |
686 | hwif->chipset = ide_au1xxx; | 687 | hwif->chipset = ide_au1xxx; |
687 | 688 | ||
diff --git a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile index 6591ff4753cb..95d1ea8f1f14 100644 --- a/drivers/ide/pci/Makefile +++ b/drivers/ide/pci/Makefile | |||
@@ -3,6 +3,7 @@ obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o | |||
3 | obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o | 3 | obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o |
4 | obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o | 4 | obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o |
5 | obj-$(CONFIG_BLK_DEV_ATIIXP) += atiixp.o | 5 | obj-$(CONFIG_BLK_DEV_ATIIXP) += atiixp.o |
6 | obj-$(CONFIG_BLK_DEV_CELLEB) += scc_pata.o | ||
6 | obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o | 7 | obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o |
7 | obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o | 8 | obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o |
8 | obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o | 9 | obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o |
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index b0d4825c56a9..561197f7b5bb 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 | 1 | /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 |
2 | * | 2 | * |
3 | * linux/drivers/ide/pci/cmd64x.c Version 1.41 Feb 3, 2007 | 3 | * linux/drivers/ide/pci/cmd64x.c Version 1.42 Feb 8, 2007 |
4 | * | 4 | * |
5 | * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. | 5 | * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. |
6 | * Note, this driver is not used at all on other systems because | 6 | * Note, this driver is not used at all on other systems because |
@@ -189,6 +189,11 @@ static int cmd64x_get_info (char *buffer, char **addr, off_t offset, int count) | |||
189 | 189 | ||
190 | #endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ | 190 | #endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ |
191 | 191 | ||
192 | static u8 quantize_timing(int timing, int quant) | ||
193 | { | ||
194 | return (timing + quant - 1) / quant; | ||
195 | } | ||
196 | |||
192 | /* | 197 | /* |
193 | * This routine writes the prepared setup/active/recovery counts | 198 | * This routine writes the prepared setup/active/recovery counts |
194 | * for a drive into the cmd646 chipset registers to active them. | 199 | * for a drive into the cmd646 chipset registers to active them. |
@@ -268,47 +273,37 @@ static void program_drive_counts (ide_drive_t *drive, int setup_count, int activ | |||
268 | */ | 273 | */ |
269 | static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) | 274 | static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) |
270 | { | 275 | { |
271 | int setup_time, active_time, recovery_time; | 276 | int setup_time, active_time, cycle_time; |
272 | int clock_time, pio_mode, cycle_time; | 277 | u8 cycle_count, setup_count, active_count, recovery_count; |
273 | u8 recovery_count2, cycle_count; | 278 | u8 pio_mode; |
274 | int setup_count, active_count, recovery_count; | 279 | int clock_time = 1000 / system_bus_clock(); |
275 | int bus_speed = system_bus_clock(); | 280 | ide_pio_data_t pio; |
276 | ide_pio_data_t d; | ||
277 | 281 | ||
278 | pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &d); | 282 | pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &pio); |
279 | cycle_time = d.cycle_time; | 283 | cycle_time = pio.cycle_time; |
280 | 284 | ||
281 | /* | ||
282 | * I copied all this complicated stuff from cmd640.c and made a few | ||
283 | * minor changes. For now I am just going to pray that it is correct. | ||
284 | */ | ||
285 | setup_time = ide_pio_timings[pio_mode].setup_time; | 285 | setup_time = ide_pio_timings[pio_mode].setup_time; |
286 | active_time = ide_pio_timings[pio_mode].active_time; | 286 | active_time = ide_pio_timings[pio_mode].active_time; |
287 | recovery_time = cycle_time - (setup_time + active_time); | ||
288 | clock_time = 1000 / bus_speed; | ||
289 | cycle_count = (cycle_time + clock_time - 1) / clock_time; | ||
290 | |||
291 | setup_count = (setup_time + clock_time - 1) / clock_time; | ||
292 | 287 | ||
293 | active_count = (active_time + clock_time - 1) / clock_time; | 288 | setup_count = quantize_timing( setup_time, clock_time); |
289 | cycle_count = quantize_timing( cycle_time, clock_time); | ||
290 | active_count = quantize_timing(active_time, clock_time); | ||
294 | 291 | ||
295 | recovery_count = (recovery_time + clock_time - 1) / clock_time; | 292 | recovery_count = cycle_count - active_count; |
296 | recovery_count2 = cycle_count - (setup_count + active_count); | 293 | /* program_drive_counts() takes care of zero recovery cycles */ |
297 | if (recovery_count2 > recovery_count) | ||
298 | recovery_count = recovery_count2; | ||
299 | if (recovery_count > 16) { | 294 | if (recovery_count > 16) { |
300 | active_count += recovery_count - 16; | 295 | active_count += recovery_count - 16; |
301 | recovery_count = 16; | 296 | recovery_count = 16; |
302 | } | 297 | } |
303 | if (active_count > 16) | 298 | if (active_count > 16) |
304 | active_count = 16; /* maximum allowed by cmd646 */ | 299 | active_count = 16; /* maximum allowed by cmd64x */ |
305 | 300 | ||
306 | program_drive_counts (drive, setup_count, active_count, recovery_count); | 301 | program_drive_counts (drive, setup_count, active_count, recovery_count); |
307 | 302 | ||
308 | cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " | 303 | cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " |
309 | "clocks=%d/%d/%d\n", | 304 | "clocks=%d/%d/%d\n", |
310 | drive->name, mode_wanted, pio_mode, cycle_time, | 305 | drive->name, mode_wanted, pio_mode, cycle_time, |
311 | d.overridden ? " (overriding vendor mode)" : "", | 306 | pio.overridden ? " (overriding vendor mode)" : "", |
312 | setup_count, active_count, recovery_count); | 307 | setup_count, active_count, recovery_count); |
313 | 308 | ||
314 | return pio_mode; | 309 | return pio_mode; |
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index 53f25500c22b..be4fc96c29e0 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c | |||
@@ -240,12 +240,31 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi | |||
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |
242 | 242 | ||
243 | /* If libata is configured, jmicron PCI quirk will configure it such | ||
244 | * that the SATA ports are in AHCI function while the PATA ports are | ||
245 | * in a separate IDE function. In such cases, match device class and | ||
246 | * attach only to IDE. If libata isn't configured, keep the old | ||
247 | * behavior for backward compatibility. | ||
248 | */ | ||
249 | #if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE) | ||
250 | #define JMB_CLASS PCI_CLASS_STORAGE_IDE << 8 | ||
251 | #define JMB_CLASS_MASK 0xffff00 | ||
252 | #else | ||
253 | #define JMB_CLASS 0 | ||
254 | #define JMB_CLASS_MASK 0 | ||
255 | #endif | ||
256 | |||
243 | static struct pci_device_id jmicron_pci_tbl[] = { | 257 | static struct pci_device_id jmicron_pci_tbl[] = { |
244 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 258 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, |
245 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, | 259 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 0}, |
246 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, | 260 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, |
247 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, | 261 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 1}, |
248 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, | 262 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, |
263 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 2}, | ||
264 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, | ||
265 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 3}, | ||
266 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, | ||
267 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 4}, | ||
249 | { 0, }, | 268 | { 0, }, |
250 | }; | 269 | }; |
251 | 270 | ||
diff --git a/drivers/ide/ppc/scc_pata.c b/drivers/ide/pci/scc_pata.c index f84bf791f72e..f84bf791f72e 100644 --- a/drivers/ide/ppc/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c | |||
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index a52c80fe7d3e..118fb3205ca8 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -505,11 +505,6 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi | |||
505 | } | 505 | } |
506 | } | 506 | } |
507 | } | 507 | } |
508 | |||
509 | #ifndef CONFIG_IDEDMA_PCI_AUTO | ||
510 | #warning CONFIG_IDEDMA_PCI_AUTO=n support is obsolete, and will be removed soon. | ||
511 | #endif | ||
512 | |||
513 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/ | 508 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/ |
514 | 509 | ||
515 | /** | 510 | /** |
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index d441815a3e0c..fde92ce45153 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -1821,7 +1821,7 @@ static int cma_alloc_port(struct idr *ps, struct rdma_id_private *id_priv, | |||
1821 | struct rdma_bind_list *bind_list; | 1821 | struct rdma_bind_list *bind_list; |
1822 | int port, ret; | 1822 | int port, ret; |
1823 | 1823 | ||
1824 | bind_list = kmalloc(sizeof *bind_list, GFP_KERNEL); | 1824 | bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL); |
1825 | if (!bind_list) | 1825 | if (!bind_list) |
1826 | return -ENOMEM; | 1826 | return -ENOMEM; |
1827 | 1827 | ||
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index b516b93b8550..c859134c1daa 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -266,7 +266,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, | |||
266 | mutex_lock(&ctx->file->mut); | 266 | mutex_lock(&ctx->file->mut); |
267 | if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { | 267 | if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { |
268 | if (!ctx->backlog) { | 268 | if (!ctx->backlog) { |
269 | ret = -EDQUOT; | 269 | ret = -ENOMEM; |
270 | kfree(uevent); | 270 | kfree(uevent); |
271 | goto out; | 271 | goto out; |
272 | } | 272 | } |
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c index d737c738d876..818cf1aee8c7 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.c +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/sched.h> | 36 | #include <linux/sched.h> |
37 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
38 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
39 | #include <linux/dma-mapping.h> | ||
39 | 40 | ||
40 | #include "cxio_resource.h" | 41 | #include "cxio_resource.h" |
41 | #include "cxio_hal.h" | 42 | #include "cxio_hal.h" |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index b21fde8b659d..d0ed1d35ca3e 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -305,8 +305,7 @@ static int status2errno(int status) | |||
305 | */ | 305 | */ |
306 | static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp) | 306 | static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp) |
307 | { | 307 | { |
308 | if (skb) { | 308 | if (skb && !skb_is_nonlinear(skb) && !skb_cloned(skb)) { |
309 | BUG_ON(skb_cloned(skb)); | ||
310 | skb_trim(skb, 0); | 309 | skb_trim(skb, 0); |
311 | skb_get(skb); | 310 | skb_get(skb); |
312 | } else { | 311 | } else { |
@@ -1415,6 +1414,7 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1415 | wake_up(&ep->com.waitq); | 1414 | wake_up(&ep->com.waitq); |
1416 | break; | 1415 | break; |
1417 | case FPDU_MODE: | 1416 | case FPDU_MODE: |
1417 | start_ep_timer(ep); | ||
1418 | __state_set(&ep->com, CLOSING); | 1418 | __state_set(&ep->com, CLOSING); |
1419 | attrs.next_state = IWCH_QP_STATE_CLOSING; | 1419 | attrs.next_state = IWCH_QP_STATE_CLOSING; |
1420 | iwch_modify_qp(ep->com.qp->rhp, ep->com.qp, | 1420 | iwch_modify_qp(ep->com.qp->rhp, ep->com.qp, |
@@ -1425,7 +1425,6 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1425 | disconnect = 0; | 1425 | disconnect = 0; |
1426 | break; | 1426 | break; |
1427 | case CLOSING: | 1427 | case CLOSING: |
1428 | start_ep_timer(ep); | ||
1429 | __state_set(&ep->com, MORIBUND); | 1428 | __state_set(&ep->com, MORIBUND); |
1430 | disconnect = 0; | 1429 | disconnect = 0; |
1431 | break; | 1430 | break; |
@@ -1487,8 +1486,10 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1487 | case CONNECTING: | 1486 | case CONNECTING: |
1488 | break; | 1487 | break; |
1489 | case MPA_REQ_WAIT: | 1488 | case MPA_REQ_WAIT: |
1489 | stop_ep_timer(ep); | ||
1490 | break; | 1490 | break; |
1491 | case MPA_REQ_SENT: | 1491 | case MPA_REQ_SENT: |
1492 | stop_ep_timer(ep); | ||
1492 | connect_reply_upcall(ep, -ECONNRESET); | 1493 | connect_reply_upcall(ep, -ECONNRESET); |
1493 | break; | 1494 | break; |
1494 | case MPA_REP_SENT: | 1495 | case MPA_REP_SENT: |
@@ -1507,9 +1508,10 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1507 | get_ep(&ep->com); | 1508 | get_ep(&ep->com); |
1508 | break; | 1509 | break; |
1509 | case MORIBUND: | 1510 | case MORIBUND: |
1511 | case CLOSING: | ||
1510 | stop_ep_timer(ep); | 1512 | stop_ep_timer(ep); |
1513 | /*FALLTHROUGH*/ | ||
1511 | case FPDU_MODE: | 1514 | case FPDU_MODE: |
1512 | case CLOSING: | ||
1513 | if (ep->com.cm_id && ep->com.qp) { | 1515 | if (ep->com.cm_id && ep->com.qp) { |
1514 | attrs.next_state = IWCH_QP_STATE_ERROR; | 1516 | attrs.next_state = IWCH_QP_STATE_ERROR; |
1515 | ret = iwch_modify_qp(ep->com.qp->rhp, | 1517 | ret = iwch_modify_qp(ep->com.qp->rhp, |
@@ -1570,7 +1572,6 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1570 | spin_lock_irqsave(&ep->com.lock, flags); | 1572 | spin_lock_irqsave(&ep->com.lock, flags); |
1571 | switch (ep->com.state) { | 1573 | switch (ep->com.state) { |
1572 | case CLOSING: | 1574 | case CLOSING: |
1573 | start_ep_timer(ep); | ||
1574 | __state_set(&ep->com, MORIBUND); | 1575 | __state_set(&ep->com, MORIBUND); |
1575 | break; | 1576 | break; |
1576 | case MORIBUND: | 1577 | case MORIBUND: |
@@ -1586,6 +1587,8 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1586 | __state_set(&ep->com, DEAD); | 1587 | __state_set(&ep->com, DEAD); |
1587 | release = 1; | 1588 | release = 1; |
1588 | break; | 1589 | break; |
1590 | case ABORTING: | ||
1591 | break; | ||
1589 | case DEAD: | 1592 | case DEAD: |
1590 | default: | 1593 | default: |
1591 | BUG_ON(1); | 1594 | BUG_ON(1); |
@@ -1659,6 +1662,7 @@ static void ep_timeout(unsigned long arg) | |||
1659 | break; | 1662 | break; |
1660 | case MPA_REQ_WAIT: | 1663 | case MPA_REQ_WAIT: |
1661 | break; | 1664 | break; |
1665 | case CLOSING: | ||
1662 | case MORIBUND: | 1666 | case MORIBUND: |
1663 | if (ep->com.cm_id && ep->com.qp) { | 1667 | if (ep->com.cm_id && ep->com.qp) { |
1664 | attrs.next_state = IWCH_QP_STATE_ERROR; | 1668 | attrs.next_state = IWCH_QP_STATE_ERROR; |
@@ -1687,12 +1691,11 @@ int iwch_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len) | |||
1687 | return -ECONNRESET; | 1691 | return -ECONNRESET; |
1688 | } | 1692 | } |
1689 | BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); | 1693 | BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); |
1690 | state_set(&ep->com, CLOSING); | ||
1691 | if (mpa_rev == 0) | 1694 | if (mpa_rev == 0) |
1692 | abort_connection(ep, NULL, GFP_KERNEL); | 1695 | abort_connection(ep, NULL, GFP_KERNEL); |
1693 | else { | 1696 | else { |
1694 | err = send_mpa_reject(ep, pdata, pdata_len); | 1697 | err = send_mpa_reject(ep, pdata, pdata_len); |
1695 | err = send_halfclose(ep, GFP_KERNEL); | 1698 | err = iwch_ep_disconnect(ep, 0, GFP_KERNEL); |
1696 | } | 1699 | } |
1697 | return 0; | 1700 | return 0; |
1698 | } | 1701 | } |
@@ -1957,11 +1960,11 @@ int iwch_ep_disconnect(struct iwch_ep *ep, int abrupt, gfp_t gfp) | |||
1957 | case MPA_REQ_RCVD: | 1960 | case MPA_REQ_RCVD: |
1958 | case MPA_REP_SENT: | 1961 | case MPA_REP_SENT: |
1959 | case FPDU_MODE: | 1962 | case FPDU_MODE: |
1963 | start_ep_timer(ep); | ||
1960 | ep->com.state = CLOSING; | 1964 | ep->com.state = CLOSING; |
1961 | close = 1; | 1965 | close = 1; |
1962 | break; | 1966 | break; |
1963 | case CLOSING: | 1967 | case CLOSING: |
1964 | start_ep_timer(ep); | ||
1965 | ep->com.state = MORIBUND; | 1968 | ep->com.state = MORIBUND; |
1966 | close = 1; | 1969 | close = 1; |
1967 | break; | 1970 | break; |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_ev.c b/drivers/infiniband/hw/cxgb3/iwch_ev.c index 54362afbf72f..b40676662a8a 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_ev.c +++ b/drivers/infiniband/hw/cxgb3/iwch_ev.c | |||
@@ -47,12 +47,6 @@ static void post_qp_event(struct iwch_dev *rnicp, struct iwch_cq *chp, | |||
47 | struct iwch_qp_attributes attrs; | 47 | struct iwch_qp_attributes attrs; |
48 | struct iwch_qp *qhp; | 48 | struct iwch_qp *qhp; |
49 | 49 | ||
50 | printk(KERN_ERR "%s - AE qpid 0x%x opcode %d status 0x%x " | ||
51 | "type %d wrid.hi 0x%x wrid.lo 0x%x \n", __FUNCTION__, | ||
52 | CQE_QPID(rsp_msg->cqe), CQE_OPCODE(rsp_msg->cqe), | ||
53 | CQE_STATUS(rsp_msg->cqe), CQE_TYPE(rsp_msg->cqe), | ||
54 | CQE_WRID_HI(rsp_msg->cqe), CQE_WRID_LOW(rsp_msg->cqe)); | ||
55 | |||
56 | spin_lock(&rnicp->lock); | 50 | spin_lock(&rnicp->lock); |
57 | qhp = get_qhp(rnicp, CQE_QPID(rsp_msg->cqe)); | 51 | qhp = get_qhp(rnicp, CQE_QPID(rsp_msg->cqe)); |
58 | 52 | ||
@@ -73,6 +67,12 @@ static void post_qp_event(struct iwch_dev *rnicp, struct iwch_cq *chp, | |||
73 | return; | 67 | return; |
74 | } | 68 | } |
75 | 69 | ||
70 | printk(KERN_ERR "%s - AE qpid 0x%x opcode %d status 0x%x " | ||
71 | "type %d wrid.hi 0x%x wrid.lo 0x%x \n", __FUNCTION__, | ||
72 | CQE_QPID(rsp_msg->cqe), CQE_OPCODE(rsp_msg->cqe), | ||
73 | CQE_STATUS(rsp_msg->cqe), CQE_TYPE(rsp_msg->cqe), | ||
74 | CQE_WRID_HI(rsp_msg->cqe), CQE_WRID_LOW(rsp_msg->cqe)); | ||
75 | |||
76 | atomic_inc(&qhp->refcnt); | 76 | atomic_inc(&qhp->refcnt); |
77 | spin_unlock(&rnicp->lock); | 77 | spin_unlock(&rnicp->lock); |
78 | 78 | ||
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 9947a144a929..24e0df04f7db 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c | |||
@@ -331,6 +331,7 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) | |||
331 | int ret = 0; | 331 | int ret = 0; |
332 | struct iwch_mm_entry *mm; | 332 | struct iwch_mm_entry *mm; |
333 | struct iwch_ucontext *ucontext; | 333 | struct iwch_ucontext *ucontext; |
334 | u64 addr; | ||
334 | 335 | ||
335 | PDBG("%s pgoff 0x%lx key 0x%x len %d\n", __FUNCTION__, vma->vm_pgoff, | 336 | PDBG("%s pgoff 0x%lx key 0x%x len %d\n", __FUNCTION__, vma->vm_pgoff, |
336 | key, len); | 337 | key, len); |
@@ -345,10 +346,11 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) | |||
345 | mm = remove_mmap(ucontext, key, len); | 346 | mm = remove_mmap(ucontext, key, len); |
346 | if (!mm) | 347 | if (!mm) |
347 | return -EINVAL; | 348 | return -EINVAL; |
349 | addr = mm->addr; | ||
348 | kfree(mm); | 350 | kfree(mm); |
349 | 351 | ||
350 | if ((mm->addr >= rdev_p->rnic_info.udbell_physbase) && | 352 | if ((addr >= rdev_p->rnic_info.udbell_physbase) && |
351 | (mm->addr < (rdev_p->rnic_info.udbell_physbase + | 353 | (addr < (rdev_p->rnic_info.udbell_physbase + |
352 | rdev_p->rnic_info.udbell_len))) { | 354 | rdev_p->rnic_info.udbell_len))) { |
353 | 355 | ||
354 | /* | 356 | /* |
@@ -362,7 +364,7 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) | |||
362 | vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; | 364 | vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND; |
363 | vma->vm_flags &= ~VM_MAYREAD; | 365 | vma->vm_flags &= ~VM_MAYREAD; |
364 | ret = io_remap_pfn_range(vma, vma->vm_start, | 366 | ret = io_remap_pfn_range(vma, vma->vm_start, |
365 | mm->addr >> PAGE_SHIFT, | 367 | addr >> PAGE_SHIFT, |
366 | len, vma->vm_page_prot); | 368 | len, vma->vm_page_prot); |
367 | } else { | 369 | } else { |
368 | 370 | ||
@@ -370,7 +372,7 @@ static int iwch_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) | |||
370 | * Map WQ or CQ contig dma memory... | 372 | * Map WQ or CQ contig dma memory... |
371 | */ | 373 | */ |
372 | ret = remap_pfn_range(vma, vma->vm_start, | 374 | ret = remap_pfn_range(vma, vma->vm_start, |
373 | mm->addr >> PAGE_SHIFT, | 375 | addr >> PAGE_SHIFT, |
374 | len, vma->vm_page_prot); | 376 | len, vma->vm_page_prot); |
375 | } | 377 | } |
376 | 378 | ||
@@ -463,9 +465,6 @@ static struct ib_mr *iwch_register_phys_mem(struct ib_pd *pd, | |||
463 | php = to_iwch_pd(pd); | 465 | php = to_iwch_pd(pd); |
464 | rhp = php->rhp; | 466 | rhp = php->rhp; |
465 | 467 | ||
466 | acc = iwch_convert_access(acc); | ||
467 | |||
468 | |||
469 | mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); | 468 | mhp = kzalloc(sizeof(*mhp), GFP_KERNEL); |
470 | if (!mhp) | 469 | if (!mhp) |
471 | return ERR_PTR(-ENOMEM); | 470 | return ERR_PTR(-ENOMEM); |
@@ -491,12 +490,7 @@ static struct ib_mr *iwch_register_phys_mem(struct ib_pd *pd, | |||
491 | mhp->attr.pdid = php->pdid; | 490 | mhp->attr.pdid = php->pdid; |
492 | mhp->attr.zbva = 0; | 491 | mhp->attr.zbva = 0; |
493 | 492 | ||
494 | /* NOTE: TPT perms are backwards from BIND WR perms! */ | 493 | mhp->attr.perms = iwch_ib_to_tpt_access(acc); |
495 | mhp->attr.perms = (acc & 0x1) << 3; | ||
496 | mhp->attr.perms |= (acc & 0x2) << 1; | ||
497 | mhp->attr.perms |= (acc & 0x4) >> 1; | ||
498 | mhp->attr.perms |= (acc & 0x8) >> 3; | ||
499 | |||
500 | mhp->attr.va_fbo = *iova_start; | 494 | mhp->attr.va_fbo = *iova_start; |
501 | mhp->attr.page_size = shift - 12; | 495 | mhp->attr.page_size = shift - 12; |
502 | 496 | ||
@@ -525,7 +519,6 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr, | |||
525 | struct iwch_mr mh, *mhp; | 519 | struct iwch_mr mh, *mhp; |
526 | struct iwch_pd *php; | 520 | struct iwch_pd *php; |
527 | struct iwch_dev *rhp; | 521 | struct iwch_dev *rhp; |
528 | int new_acc; | ||
529 | __be64 *page_list = NULL; | 522 | __be64 *page_list = NULL; |
530 | int shift = 0; | 523 | int shift = 0; |
531 | u64 total_size; | 524 | u64 total_size; |
@@ -546,19 +539,20 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr, | |||
546 | if (rhp != php->rhp) | 539 | if (rhp != php->rhp) |
547 | return -EINVAL; | 540 | return -EINVAL; |
548 | 541 | ||
549 | new_acc = mhp->attr.perms; | ||
550 | |||
551 | memcpy(&mh, mhp, sizeof *mhp); | 542 | memcpy(&mh, mhp, sizeof *mhp); |
552 | 543 | ||
553 | if (mr_rereg_mask & IB_MR_REREG_PD) | 544 | if (mr_rereg_mask & IB_MR_REREG_PD) |
554 | php = to_iwch_pd(pd); | 545 | php = to_iwch_pd(pd); |
555 | if (mr_rereg_mask & IB_MR_REREG_ACCESS) | 546 | if (mr_rereg_mask & IB_MR_REREG_ACCESS) |
556 | mh.attr.perms = iwch_convert_access(acc); | 547 | mh.attr.perms = iwch_ib_to_tpt_access(acc); |
557 | if (mr_rereg_mask & IB_MR_REREG_TRANS) | 548 | if (mr_rereg_mask & IB_MR_REREG_TRANS) { |
558 | ret = build_phys_page_list(buffer_list, num_phys_buf, | 549 | ret = build_phys_page_list(buffer_list, num_phys_buf, |
559 | iova_start, | 550 | iova_start, |
560 | &total_size, &npages, | 551 | &total_size, &npages, |
561 | &shift, &page_list); | 552 | &shift, &page_list); |
553 | if (ret) | ||
554 | return ret; | ||
555 | } | ||
562 | 556 | ||
563 | ret = iwch_reregister_mem(rhp, php, &mh, shift, page_list, npages); | 557 | ret = iwch_reregister_mem(rhp, php, &mh, shift, page_list, npages); |
564 | kfree(page_list); | 558 | kfree(page_list); |
@@ -568,7 +562,7 @@ static int iwch_reregister_phys_mem(struct ib_mr *mr, | |||
568 | if (mr_rereg_mask & IB_MR_REREG_PD) | 562 | if (mr_rereg_mask & IB_MR_REREG_PD) |
569 | mhp->attr.pdid = php->pdid; | 563 | mhp->attr.pdid = php->pdid; |
570 | if (mr_rereg_mask & IB_MR_REREG_ACCESS) | 564 | if (mr_rereg_mask & IB_MR_REREG_ACCESS) |
571 | mhp->attr.perms = acc; | 565 | mhp->attr.perms = iwch_ib_to_tpt_access(acc); |
572 | if (mr_rereg_mask & IB_MR_REREG_TRANS) { | 566 | if (mr_rereg_mask & IB_MR_REREG_TRANS) { |
573 | mhp->attr.zbva = 0; | 567 | mhp->attr.zbva = 0; |
574 | mhp->attr.va_fbo = *iova_start; | 568 | mhp->attr.va_fbo = *iova_start; |
@@ -613,8 +607,6 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, struct ib_umem *region, | |||
613 | goto err; | 607 | goto err; |
614 | } | 608 | } |
615 | 609 | ||
616 | acc = iwch_convert_access(acc); | ||
617 | |||
618 | i = n = 0; | 610 | i = n = 0; |
619 | 611 | ||
620 | list_for_each_entry(chunk, ®ion->chunk_list, list) | 612 | list_for_each_entry(chunk, ®ion->chunk_list, list) |
@@ -630,10 +622,7 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, struct ib_umem *region, | |||
630 | mhp->rhp = rhp; | 622 | mhp->rhp = rhp; |
631 | mhp->attr.pdid = php->pdid; | 623 | mhp->attr.pdid = php->pdid; |
632 | mhp->attr.zbva = 0; | 624 | mhp->attr.zbva = 0; |
633 | mhp->attr.perms = (acc & 0x1) << 3; | 625 | mhp->attr.perms = iwch_ib_to_tpt_access(acc); |
634 | mhp->attr.perms |= (acc & 0x2) << 1; | ||
635 | mhp->attr.perms |= (acc & 0x4) >> 1; | ||
636 | mhp->attr.perms |= (acc & 0x8) >> 3; | ||
637 | mhp->attr.va_fbo = region->virt_base; | 626 | mhp->attr.va_fbo = region->virt_base; |
638 | mhp->attr.page_size = shift - 12; | 627 | mhp->attr.page_size = shift - 12; |
639 | mhp->attr.len = (u32) region->length; | 628 | mhp->attr.len = (u32) region->length; |
@@ -736,10 +725,8 @@ static int iwch_destroy_qp(struct ib_qp *ib_qp) | |||
736 | qhp = to_iwch_qp(ib_qp); | 725 | qhp = to_iwch_qp(ib_qp); |
737 | rhp = qhp->rhp; | 726 | rhp = qhp->rhp; |
738 | 727 | ||
739 | if (qhp->attr.state == IWCH_QP_STATE_RTS) { | 728 | attrs.next_state = IWCH_QP_STATE_ERROR; |
740 | attrs.next_state = IWCH_QP_STATE_ERROR; | 729 | iwch_modify_qp(rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, &attrs, 0); |
741 | iwch_modify_qp(rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, &attrs, 0); | ||
742 | } | ||
743 | wait_event(qhp->wait, !qhp->ep); | 730 | wait_event(qhp->wait, !qhp->ep); |
744 | 731 | ||
745 | remove_handle(rhp, &rhp->qpidr, qhp->wq.qpid); | 732 | remove_handle(rhp, &rhp->qpidr, qhp->wq.qpid); |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.h b/drivers/infiniband/hw/cxgb3/iwch_provider.h index de0fe1b93a0c..93bcc56756bd 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.h +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.h | |||
@@ -286,27 +286,20 @@ static inline int iwch_convert_state(enum ib_qp_state ib_state) | |||
286 | } | 286 | } |
287 | } | 287 | } |
288 | 288 | ||
289 | enum iwch_mem_perms { | 289 | static inline u32 iwch_ib_to_tpt_access(int acc) |
290 | IWCH_MEM_ACCESS_LOCAL_READ = 1 << 0, | ||
291 | IWCH_MEM_ACCESS_LOCAL_WRITE = 1 << 1, | ||
292 | IWCH_MEM_ACCESS_REMOTE_READ = 1 << 2, | ||
293 | IWCH_MEM_ACCESS_REMOTE_WRITE = 1 << 3, | ||
294 | IWCH_MEM_ACCESS_ATOMICS = 1 << 4, | ||
295 | IWCH_MEM_ACCESS_BINDING = 1 << 5, | ||
296 | IWCH_MEM_ACCESS_LOCAL = | ||
297 | (IWCH_MEM_ACCESS_LOCAL_READ | IWCH_MEM_ACCESS_LOCAL_WRITE), | ||
298 | IWCH_MEM_ACCESS_REMOTE = | ||
299 | (IWCH_MEM_ACCESS_REMOTE_WRITE | IWCH_MEM_ACCESS_REMOTE_READ) | ||
300 | /* cannot go beyond 1 << 31 */ | ||
301 | } __attribute__ ((packed)); | ||
302 | |||
303 | static inline u32 iwch_convert_access(int acc) | ||
304 | { | 290 | { |
305 | return (acc & IB_ACCESS_REMOTE_WRITE ? IWCH_MEM_ACCESS_REMOTE_WRITE : 0) | 291 | return (acc & IB_ACCESS_REMOTE_WRITE ? TPT_REMOTE_WRITE : 0) | |
306 | | (acc & IB_ACCESS_REMOTE_READ ? IWCH_MEM_ACCESS_REMOTE_READ : 0) | | 292 | (acc & IB_ACCESS_REMOTE_READ ? TPT_REMOTE_READ : 0) | |
307 | (acc & IB_ACCESS_LOCAL_WRITE ? IWCH_MEM_ACCESS_LOCAL_WRITE : 0) | | 293 | (acc & IB_ACCESS_LOCAL_WRITE ? TPT_LOCAL_WRITE : 0) | |
308 | (acc & IB_ACCESS_MW_BIND ? IWCH_MEM_ACCESS_BINDING : 0) | | 294 | TPT_LOCAL_READ; |
309 | IWCH_MEM_ACCESS_LOCAL_READ; | 295 | } |
296 | |||
297 | static inline u32 iwch_ib_to_mwbind_access(int acc) | ||
298 | { | ||
299 | return (acc & IB_ACCESS_REMOTE_WRITE ? T3_MEM_ACCESS_REM_WRITE : 0) | | ||
300 | (acc & IB_ACCESS_REMOTE_READ ? T3_MEM_ACCESS_REM_READ : 0) | | ||
301 | (acc & IB_ACCESS_LOCAL_WRITE ? T3_MEM_ACCESS_LOCAL_WRITE : 0) | | ||
302 | T3_MEM_ACCESS_LOCAL_READ; | ||
310 | } | 303 | } |
311 | 304 | ||
312 | enum iwch_mmid_state { | 305 | enum iwch_mmid_state { |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c index 9ea00cc4a5f8..0a472c9b44db 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_qp.c +++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c | |||
@@ -439,7 +439,7 @@ int iwch_bind_mw(struct ib_qp *qp, | |||
439 | wqe->bind.type = T3_VA_BASED_TO; | 439 | wqe->bind.type = T3_VA_BASED_TO; |
440 | 440 | ||
441 | /* TBD: check perms */ | 441 | /* TBD: check perms */ |
442 | wqe->bind.perms = iwch_convert_access(mw_bind->mw_access_flags); | 442 | wqe->bind.perms = iwch_ib_to_mwbind_access(mw_bind->mw_access_flags); |
443 | wqe->bind.mr_stag = cpu_to_be32(mw_bind->mr->lkey); | 443 | wqe->bind.mr_stag = cpu_to_be32(mw_bind->mr->lkey); |
444 | wqe->bind.mw_stag = cpu_to_be32(mw->rkey); | 444 | wqe->bind.mw_stag = cpu_to_be32(mw->rkey); |
445 | wqe->bind.mw_len = cpu_to_be32(mw_bind->length); | 445 | wqe->bind.mw_len = cpu_to_be32(mw_bind->length); |
diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 40404c9e2817..82ded44c6cee 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h | |||
@@ -52,6 +52,8 @@ struct ehca_mw; | |||
52 | struct ehca_pd; | 52 | struct ehca_pd; |
53 | struct ehca_av; | 53 | struct ehca_av; |
54 | 54 | ||
55 | #include <linux/wait.h> | ||
56 | |||
55 | #include <rdma/ib_verbs.h> | 57 | #include <rdma/ib_verbs.h> |
56 | #include <rdma/ib_user_verbs.h> | 58 | #include <rdma/ib_user_verbs.h> |
57 | 59 | ||
@@ -153,7 +155,9 @@ struct ehca_cq { | |||
153 | spinlock_t cb_lock; | 155 | spinlock_t cb_lock; |
154 | struct hlist_head qp_hashtab[QP_HASHTAB_LEN]; | 156 | struct hlist_head qp_hashtab[QP_HASHTAB_LEN]; |
155 | struct list_head entry; | 157 | struct list_head entry; |
156 | u32 nr_callbacks; | 158 | u32 nr_callbacks; /* #events assigned to cpu by scaling code */ |
159 | u32 nr_events; /* #events seen */ | ||
160 | wait_queue_head_t wait_completion; | ||
157 | spinlock_t task_lock; | 161 | spinlock_t task_lock; |
158 | u32 ownpid; | 162 | u32 ownpid; |
159 | /* mmap counter for resources mapped into user space */ | 163 | /* mmap counter for resources mapped into user space */ |
diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/infiniband/hw/ehca/ehca_cq.c index 6ebfa27e4e16..e2cdc1a16fe9 100644 --- a/drivers/infiniband/hw/ehca/ehca_cq.c +++ b/drivers/infiniband/hw/ehca/ehca_cq.c | |||
@@ -146,6 +146,7 @@ struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe, | |||
146 | spin_lock_init(&my_cq->spinlock); | 146 | spin_lock_init(&my_cq->spinlock); |
147 | spin_lock_init(&my_cq->cb_lock); | 147 | spin_lock_init(&my_cq->cb_lock); |
148 | spin_lock_init(&my_cq->task_lock); | 148 | spin_lock_init(&my_cq->task_lock); |
149 | init_waitqueue_head(&my_cq->wait_completion); | ||
149 | my_cq->ownpid = current->tgid; | 150 | my_cq->ownpid = current->tgid; |
150 | 151 | ||
151 | cq = &my_cq->ib_cq; | 152 | cq = &my_cq->ib_cq; |
@@ -302,6 +303,16 @@ create_cq_exit1: | |||
302 | return cq; | 303 | return cq; |
303 | } | 304 | } |
304 | 305 | ||
306 | static int get_cq_nr_events(struct ehca_cq *my_cq) | ||
307 | { | ||
308 | int ret; | ||
309 | unsigned long flags; | ||
310 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | ||
311 | ret = my_cq->nr_events; | ||
312 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | ||
313 | return ret; | ||
314 | } | ||
315 | |||
305 | int ehca_destroy_cq(struct ib_cq *cq) | 316 | int ehca_destroy_cq(struct ib_cq *cq) |
306 | { | 317 | { |
307 | u64 h_ret; | 318 | u64 h_ret; |
@@ -329,10 +340,11 @@ int ehca_destroy_cq(struct ib_cq *cq) | |||
329 | } | 340 | } |
330 | 341 | ||
331 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | 342 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); |
332 | while (my_cq->nr_callbacks) { | 343 | while (my_cq->nr_events) { |
333 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | 344 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); |
334 | yield(); | 345 | wait_event(my_cq->wait_completion, !get_cq_nr_events(my_cq)); |
335 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | 346 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); |
347 | /* recheck nr_events to assure no cqe has just arrived */ | ||
336 | } | 348 | } |
337 | 349 | ||
338 | idr_remove(&ehca_cq_idr, my_cq->token); | 350 | idr_remove(&ehca_cq_idr, my_cq->token); |
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index 3ec53c687d08..f284be1c9166 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c | |||
@@ -66,7 +66,9 @@ | |||
66 | static void queue_comp_task(struct ehca_cq *__cq); | 66 | static void queue_comp_task(struct ehca_cq *__cq); |
67 | 67 | ||
68 | static struct ehca_comp_pool* pool; | 68 | static struct ehca_comp_pool* pool; |
69 | #ifdef CONFIG_HOTPLUG_CPU | ||
69 | static struct notifier_block comp_pool_callback_nb; | 70 | static struct notifier_block comp_pool_callback_nb; |
71 | #endif | ||
70 | 72 | ||
71 | static inline void comp_event_callback(struct ehca_cq *cq) | 73 | static inline void comp_event_callback(struct ehca_cq *cq) |
72 | { | 74 | { |
@@ -404,10 +406,11 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe) | |||
404 | u32 token; | 406 | u32 token; |
405 | unsigned long flags; | 407 | unsigned long flags; |
406 | struct ehca_cq *cq; | 408 | struct ehca_cq *cq; |
409 | |||
407 | eqe_value = eqe->entry; | 410 | eqe_value = eqe->entry; |
408 | ehca_dbg(&shca->ib_device, "eqe_value=%lx", eqe_value); | 411 | ehca_dbg(&shca->ib_device, "eqe_value=%lx", eqe_value); |
409 | if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) { | 412 | if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) { |
410 | ehca_dbg(&shca->ib_device, "... completion event"); | 413 | ehca_dbg(&shca->ib_device, "Got completion event"); |
411 | token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value); | 414 | token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value); |
412 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | 415 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); |
413 | cq = idr_find(&ehca_cq_idr, token); | 416 | cq = idr_find(&ehca_cq_idr, token); |
@@ -419,16 +422,20 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe) | |||
419 | return; | 422 | return; |
420 | } | 423 | } |
421 | reset_eq_pending(cq); | 424 | reset_eq_pending(cq); |
422 | if (ehca_scaling_code) { | 425 | cq->nr_events++; |
426 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | ||
427 | if (ehca_scaling_code) | ||
423 | queue_comp_task(cq); | 428 | queue_comp_task(cq); |
424 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | 429 | else { |
425 | } else { | ||
426 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | ||
427 | comp_event_callback(cq); | 430 | comp_event_callback(cq); |
431 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | ||
432 | cq->nr_events--; | ||
433 | if (!cq->nr_events) | ||
434 | wake_up(&cq->wait_completion); | ||
435 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | ||
428 | } | 436 | } |
429 | } else { | 437 | } else { |
430 | ehca_dbg(&shca->ib_device, | 438 | ehca_dbg(&shca->ib_device, "Got non completion event"); |
431 | "Got non completion event"); | ||
432 | parse_identifier(shca, eqe_value); | 439 | parse_identifier(shca, eqe_value); |
433 | } | 440 | } |
434 | } | 441 | } |
@@ -478,6 +485,7 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq) | |||
478 | "token=%x", token); | 485 | "token=%x", token); |
479 | continue; | 486 | continue; |
480 | } | 487 | } |
488 | eqe_cache[eqe_cnt].cq->nr_events++; | ||
481 | spin_unlock(&ehca_cq_idr_lock); | 489 | spin_unlock(&ehca_cq_idr_lock); |
482 | } else | 490 | } else |
483 | eqe_cache[eqe_cnt].cq = NULL; | 491 | eqe_cache[eqe_cnt].cq = NULL; |
@@ -504,12 +512,18 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq) | |||
504 | /* call completion handler for cached eqes */ | 512 | /* call completion handler for cached eqes */ |
505 | for (i = 0; i < eqe_cnt; i++) | 513 | for (i = 0; i < eqe_cnt; i++) |
506 | if (eq->eqe_cache[i].cq) { | 514 | if (eq->eqe_cache[i].cq) { |
507 | if (ehca_scaling_code) { | 515 | if (ehca_scaling_code) |
508 | spin_lock(&ehca_cq_idr_lock); | ||
509 | queue_comp_task(eq->eqe_cache[i].cq); | 516 | queue_comp_task(eq->eqe_cache[i].cq); |
510 | spin_unlock(&ehca_cq_idr_lock); | 517 | else { |
511 | } else | 518 | struct ehca_cq *cq = eq->eqe_cache[i].cq; |
512 | comp_event_callback(eq->eqe_cache[i].cq); | 519 | comp_event_callback(cq); |
520 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | ||
521 | cq->nr_events--; | ||
522 | if (!cq->nr_events) | ||
523 | wake_up(&cq->wait_completion); | ||
524 | spin_unlock_irqrestore(&ehca_cq_idr_lock, | ||
525 | flags); | ||
526 | } | ||
513 | } else { | 527 | } else { |
514 | ehca_dbg(&shca->ib_device, "Got non completion event"); | 528 | ehca_dbg(&shca->ib_device, "Got non completion event"); |
515 | parse_identifier(shca, eq->eqe_cache[i].eqe->entry); | 529 | parse_identifier(shca, eq->eqe_cache[i].eqe->entry); |
@@ -523,7 +537,6 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq) | |||
523 | if (!eqe) | 537 | if (!eqe) |
524 | break; | 538 | break; |
525 | process_eqe(shca, eqe); | 539 | process_eqe(shca, eqe); |
526 | eqe_cnt++; | ||
527 | } while (1); | 540 | } while (1); |
528 | 541 | ||
529 | unlock_irq_spinlock: | 542 | unlock_irq_spinlock: |
@@ -567,8 +580,7 @@ static void __queue_comp_task(struct ehca_cq *__cq, | |||
567 | list_add_tail(&__cq->entry, &cct->cq_list); | 580 | list_add_tail(&__cq->entry, &cct->cq_list); |
568 | cct->cq_jobs++; | 581 | cct->cq_jobs++; |
569 | wake_up(&cct->wait_queue); | 582 | wake_up(&cct->wait_queue); |
570 | } | 583 | } else |
571 | else | ||
572 | __cq->nr_callbacks++; | 584 | __cq->nr_callbacks++; |
573 | 585 | ||
574 | spin_unlock(&__cq->task_lock); | 586 | spin_unlock(&__cq->task_lock); |
@@ -577,18 +589,21 @@ static void __queue_comp_task(struct ehca_cq *__cq, | |||
577 | 589 | ||
578 | static void queue_comp_task(struct ehca_cq *__cq) | 590 | static void queue_comp_task(struct ehca_cq *__cq) |
579 | { | 591 | { |
580 | int cpu; | ||
581 | int cpu_id; | 592 | int cpu_id; |
582 | struct ehca_cpu_comp_task *cct; | 593 | struct ehca_cpu_comp_task *cct; |
594 | int cq_jobs; | ||
595 | unsigned long flags; | ||
583 | 596 | ||
584 | cpu = get_cpu(); | ||
585 | cpu_id = find_next_online_cpu(pool); | 597 | cpu_id = find_next_online_cpu(pool); |
586 | BUG_ON(!cpu_online(cpu_id)); | 598 | BUG_ON(!cpu_online(cpu_id)); |
587 | 599 | ||
588 | cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id); | 600 | cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id); |
589 | BUG_ON(!cct); | 601 | BUG_ON(!cct); |
590 | 602 | ||
591 | if (cct->cq_jobs > 0) { | 603 | spin_lock_irqsave(&cct->task_lock, flags); |
604 | cq_jobs = cct->cq_jobs; | ||
605 | spin_unlock_irqrestore(&cct->task_lock, flags); | ||
606 | if (cq_jobs > 0) { | ||
592 | cpu_id = find_next_online_cpu(pool); | 607 | cpu_id = find_next_online_cpu(pool); |
593 | cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id); | 608 | cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id); |
594 | BUG_ON(!cct); | 609 | BUG_ON(!cct); |
@@ -608,11 +623,17 @@ static void run_comp_task(struct ehca_cpu_comp_task* cct) | |||
608 | cq = list_entry(cct->cq_list.next, struct ehca_cq, entry); | 623 | cq = list_entry(cct->cq_list.next, struct ehca_cq, entry); |
609 | spin_unlock_irqrestore(&cct->task_lock, flags); | 624 | spin_unlock_irqrestore(&cct->task_lock, flags); |
610 | comp_event_callback(cq); | 625 | comp_event_callback(cq); |
611 | spin_lock_irqsave(&cct->task_lock, flags); | ||
612 | 626 | ||
627 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | ||
628 | cq->nr_events--; | ||
629 | if (!cq->nr_events) | ||
630 | wake_up(&cq->wait_completion); | ||
631 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | ||
632 | |||
633 | spin_lock_irqsave(&cct->task_lock, flags); | ||
613 | spin_lock(&cq->task_lock); | 634 | spin_lock(&cq->task_lock); |
614 | cq->nr_callbacks--; | 635 | cq->nr_callbacks--; |
615 | if (cq->nr_callbacks == 0) { | 636 | if (!cq->nr_callbacks) { |
616 | list_del_init(cct->cq_list.next); | 637 | list_del_init(cct->cq_list.next); |
617 | cct->cq_jobs--; | 638 | cct->cq_jobs--; |
618 | } | 639 | } |
@@ -714,6 +735,7 @@ static void take_over_work(struct ehca_comp_pool *pool, | |||
714 | 735 | ||
715 | } | 736 | } |
716 | 737 | ||
738 | #ifdef CONFIG_HOTPLUG_CPU | ||
717 | static int comp_pool_callback(struct notifier_block *nfb, | 739 | static int comp_pool_callback(struct notifier_block *nfb, |
718 | unsigned long action, | 740 | unsigned long action, |
719 | void *hcpu) | 741 | void *hcpu) |
@@ -756,6 +778,7 @@ static int comp_pool_callback(struct notifier_block *nfb, | |||
756 | 778 | ||
757 | return NOTIFY_OK; | 779 | return NOTIFY_OK; |
758 | } | 780 | } |
781 | #endif | ||
759 | 782 | ||
760 | int ehca_create_comp_pool(void) | 783 | int ehca_create_comp_pool(void) |
761 | { | 784 | { |
@@ -786,9 +809,11 @@ int ehca_create_comp_pool(void) | |||
786 | } | 809 | } |
787 | } | 810 | } |
788 | 811 | ||
812 | #ifdef CONFIG_HOTPLUG_CPU | ||
789 | comp_pool_callback_nb.notifier_call = comp_pool_callback; | 813 | comp_pool_callback_nb.notifier_call = comp_pool_callback; |
790 | comp_pool_callback_nb.priority =0; | 814 | comp_pool_callback_nb.priority =0; |
791 | register_cpu_notifier(&comp_pool_callback_nb); | 815 | register_cpu_notifier(&comp_pool_callback_nb); |
816 | #endif | ||
792 | 817 | ||
793 | printk(KERN_INFO "eHCA scaling code enabled\n"); | 818 | printk(KERN_INFO "eHCA scaling code enabled\n"); |
794 | 819 | ||
@@ -802,7 +827,9 @@ void ehca_destroy_comp_pool(void) | |||
802 | if (!ehca_scaling_code) | 827 | if (!ehca_scaling_code) |
803 | return; | 828 | return; |
804 | 829 | ||
830 | #ifdef CONFIG_HOTPLUG_CPU | ||
805 | unregister_cpu_notifier(&comp_pool_callback_nb); | 831 | unregister_cpu_notifier(&comp_pool_callback_nb); |
832 | #endif | ||
806 | 833 | ||
807 | for (i = 0; i < NR_CPUS; i++) { | 834 | for (i = 0; i < NR_CPUS; i++) { |
808 | if (cpu_online(i)) | 835 | if (cpu_online(i)) |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index c1835121a822..059da9628bb5 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -52,7 +52,7 @@ | |||
52 | MODULE_LICENSE("Dual BSD/GPL"); | 52 | MODULE_LICENSE("Dual BSD/GPL"); |
53 | MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>"); | 53 | MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>"); |
54 | MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver"); | 54 | MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver"); |
55 | MODULE_VERSION("SVNEHCA_0021"); | 55 | MODULE_VERSION("SVNEHCA_0022"); |
56 | 56 | ||
57 | int ehca_open_aqp1 = 0; | 57 | int ehca_open_aqp1 = 0; |
58 | int ehca_debug_level = 0; | 58 | int ehca_debug_level = 0; |
@@ -810,7 +810,7 @@ int __init ehca_module_init(void) | |||
810 | int ret; | 810 | int ret; |
811 | 811 | ||
812 | printk(KERN_INFO "eHCA Infiniband Device Driver " | 812 | printk(KERN_INFO "eHCA Infiniband Device Driver " |
813 | "(Rel.: SVNEHCA_0021)\n"); | 813 | "(Rel.: SVNEHCA_0022)\n"); |
814 | idr_init(&ehca_qp_idr); | 814 | idr_init(&ehca_qp_idr); |
815 | idr_init(&ehca_cq_idr); | 815 | idr_init(&ehca_cq_idr); |
816 | spin_lock_init(&ehca_qp_idr_lock); | 816 | spin_lock_init(&ehca_qp_idr_lock); |
diff --git a/drivers/infiniband/hw/ipath/ipath_dma.c b/drivers/infiniband/hw/ipath/ipath_dma.c index f6f949040825..f87f003e3ef8 100644 --- a/drivers/infiniband/hw/ipath/ipath_dma.c +++ b/drivers/infiniband/hw/ipath/ipath_dma.c | |||
@@ -167,7 +167,7 @@ static void *ipath_dma_alloc_coherent(struct ib_device *dev, size_t size, | |||
167 | } | 167 | } |
168 | 168 | ||
169 | static void ipath_dma_free_coherent(struct ib_device *dev, size_t size, | 169 | static void ipath_dma_free_coherent(struct ib_device *dev, size_t size, |
170 | void *cpu_addr, dma_addr_t dma_handle) | 170 | void *cpu_addr, u64 dma_handle) |
171 | { | 171 | { |
172 | free_pages((unsigned long) cpu_addr, get_order(size)); | 172 | free_pages((unsigned long) cpu_addr, get_order(size)); |
173 | } | 173 | } |
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index 5b40a846ff95..ed55979bfd34 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c | |||
@@ -451,12 +451,18 @@ bail: | |||
451 | return ret; | 451 | return ret; |
452 | } | 452 | } |
453 | 453 | ||
454 | static void remove_file(struct dentry *parent, char *name) | 454 | static int remove_file(struct dentry *parent, char *name) |
455 | { | 455 | { |
456 | struct dentry *tmp; | 456 | struct dentry *tmp; |
457 | int ret; | ||
457 | 458 | ||
458 | tmp = lookup_one_len(name, parent, strlen(name)); | 459 | tmp = lookup_one_len(name, parent, strlen(name)); |
459 | 460 | ||
461 | if (IS_ERR(tmp)) { | ||
462 | ret = PTR_ERR(tmp); | ||
463 | goto bail; | ||
464 | } | ||
465 | |||
460 | spin_lock(&dcache_lock); | 466 | spin_lock(&dcache_lock); |
461 | spin_lock(&tmp->d_lock); | 467 | spin_lock(&tmp->d_lock); |
462 | if (!(d_unhashed(tmp) && tmp->d_inode)) { | 468 | if (!(d_unhashed(tmp) && tmp->d_inode)) { |
@@ -469,6 +475,14 @@ static void remove_file(struct dentry *parent, char *name) | |||
469 | spin_unlock(&tmp->d_lock); | 475 | spin_unlock(&tmp->d_lock); |
470 | spin_unlock(&dcache_lock); | 476 | spin_unlock(&dcache_lock); |
471 | } | 477 | } |
478 | |||
479 | ret = 0; | ||
480 | bail: | ||
481 | /* | ||
482 | * We don't expect clients to care about the return value, but | ||
483 | * it's there if they need it. | ||
484 | */ | ||
485 | return ret; | ||
472 | } | 486 | } |
473 | 487 | ||
474 | static int remove_device_files(struct super_block *sb, | 488 | static int remove_device_files(struct super_block *sb, |
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 71dc84bd4254..1c6b63aca268 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -1088,21 +1088,21 @@ static void mthca_unmap_memfree(struct mthca_dev *dev, | |||
1088 | static int mthca_alloc_memfree(struct mthca_dev *dev, | 1088 | static int mthca_alloc_memfree(struct mthca_dev *dev, |
1089 | struct mthca_qp *qp) | 1089 | struct mthca_qp *qp) |
1090 | { | 1090 | { |
1091 | int ret = 0; | ||
1092 | |||
1093 | if (mthca_is_memfree(dev)) { | 1091 | if (mthca_is_memfree(dev)) { |
1094 | qp->rq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_RQ, | 1092 | qp->rq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_RQ, |
1095 | qp->qpn, &qp->rq.db); | 1093 | qp->qpn, &qp->rq.db); |
1096 | if (qp->rq.db_index < 0) | 1094 | if (qp->rq.db_index < 0) |
1097 | return ret; | 1095 | return -ENOMEM; |
1098 | 1096 | ||
1099 | qp->sq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_SQ, | 1097 | qp->sq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_SQ, |
1100 | qp->qpn, &qp->sq.db); | 1098 | qp->qpn, &qp->sq.db); |
1101 | if (qp->sq.db_index < 0) | 1099 | if (qp->sq.db_index < 0) { |
1102 | mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index); | 1100 | mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index); |
1101 | return -ENOMEM; | ||
1102 | } | ||
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | return ret; | 1105 | return 0; |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | static void mthca_free_memfree(struct mthca_dev *dev, | 1108 | static void mthca_free_memfree(struct mthca_dev *dev, |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 3484e8ba24a4..e70492db74f6 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c | |||
@@ -452,7 +452,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_ | |||
452 | skb->len, tx->mtu); | 452 | skb->len, tx->mtu); |
453 | ++priv->stats.tx_dropped; | 453 | ++priv->stats.tx_dropped; |
454 | ++priv->stats.tx_errors; | 454 | ++priv->stats.tx_errors; |
455 | ipoib_cm_skb_too_long(dev, skb, tx->mtu - INFINIBAND_ALEN); | 455 | ipoib_cm_skb_too_long(dev, skb, tx->mtu - IPOIB_ENCAP_LEN); |
456 | return; | 456 | return; |
457 | } | 457 | } |
458 | 458 | ||
@@ -1095,7 +1095,7 @@ static void ipoib_cm_stale_task(struct work_struct *work) | |||
1095 | /* List if sorted by LRU, start from tail, | 1095 | /* List if sorted by LRU, start from tail, |
1096 | * stop when we see a recently used entry */ | 1096 | * stop when we see a recently used entry */ |
1097 | p = list_entry(priv->cm.passive_ids.prev, typeof(*p), list); | 1097 | p = list_entry(priv->cm.passive_ids.prev, typeof(*p), list); |
1098 | if (time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT)) | 1098 | if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT)) |
1099 | break; | 1099 | break; |
1100 | list_del_init(&p->list); | 1100 | list_del_init(&p->list); |
1101 | spin_unlock_irqrestore(&priv->lock, flags); | 1101 | spin_unlock_irqrestore(&priv->lock, flags); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index f2aa923ddbea..ba0ee5cf2ad7 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -328,9 +328,9 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, | |||
328 | struct ipoib_tx_buf *tx_req; | 328 | struct ipoib_tx_buf *tx_req; |
329 | u64 addr; | 329 | u64 addr; |
330 | 330 | ||
331 | if (unlikely(skb->len > priv->mcast_mtu + INFINIBAND_ALEN)) { | 331 | if (unlikely(skb->len > priv->mcast_mtu + IPOIB_ENCAP_LEN)) { |
332 | ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", | 332 | ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", |
333 | skb->len, priv->mcast_mtu + INFINIBAND_ALEN); | 333 | skb->len, priv->mcast_mtu + IPOIB_ENCAP_LEN); |
334 | ++priv->stats.tx_dropped; | 334 | ++priv->stats.tx_dropped; |
335 | ++priv->stats.tx_errors; | 335 | ++priv->stats.tx_errors; |
336 | ipoib_cm_skb_too_long(dev, skb, priv->mcast_mtu); | 336 | ipoib_cm_skb_too_long(dev, skb, priv->mcast_mtu); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index f9dbc6f68145..0741c6d1337c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -380,7 +380,7 @@ static void path_rec_completion(int status, | |||
380 | struct net_device *dev = path->dev; | 380 | struct net_device *dev = path->dev; |
381 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 381 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
382 | struct ipoib_ah *ah = NULL; | 382 | struct ipoib_ah *ah = NULL; |
383 | struct ipoib_neigh *neigh; | 383 | struct ipoib_neigh *neigh, *tn; |
384 | struct sk_buff_head skqueue; | 384 | struct sk_buff_head skqueue; |
385 | struct sk_buff *skb; | 385 | struct sk_buff *skb; |
386 | unsigned long flags; | 386 | unsigned long flags; |
@@ -418,7 +418,7 @@ static void path_rec_completion(int status, | |||
418 | while ((skb = __skb_dequeue(&path->queue))) | 418 | while ((skb = __skb_dequeue(&path->queue))) |
419 | __skb_queue_tail(&skqueue, skb); | 419 | __skb_queue_tail(&skqueue, skb); |
420 | 420 | ||
421 | list_for_each_entry(neigh, &path->neigh_list, list) { | 421 | list_for_each_entry_safe(neigh, tn, &path->neigh_list, list) { |
422 | kref_get(&path->ah->ref); | 422 | kref_get(&path->ah->ref); |
423 | neigh->ah = path->ah; | 423 | neigh->ah = path->ah; |
424 | memcpy(&neigh->dgid.raw, &path->pathrec.dgid.raw, | 424 | memcpy(&neigh->dgid.raw, &path->pathrec.dgid.raw, |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index bb2e3d5eee20..54fbead4de01 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -407,6 +407,10 @@ static int ipoib_mcast_join_complete(int status, | |||
407 | queue_delayed_work(ipoib_workqueue, | 407 | queue_delayed_work(ipoib_workqueue, |
408 | &priv->mcast_task, 0); | 408 | &priv->mcast_task, 0); |
409 | mutex_unlock(&mcast_mutex); | 409 | mutex_unlock(&mcast_mutex); |
410 | |||
411 | if (mcast == priv->broadcast) | ||
412 | netif_carrier_on(dev); | ||
413 | |||
410 | return 0; | 414 | return 0; |
411 | } | 415 | } |
412 | 416 | ||
@@ -594,7 +598,6 @@ void ipoib_mcast_join_task(struct work_struct *work) | |||
594 | ipoib_dbg_mcast(priv, "successfully joined all multicast groups\n"); | 598 | ipoib_dbg_mcast(priv, "successfully joined all multicast groups\n"); |
595 | 599 | ||
596 | clear_bit(IPOIB_MCAST_RUN, &priv->flags); | 600 | clear_bit(IPOIB_MCAST_RUN, &priv->flags); |
597 | netif_carrier_on(dev); | ||
598 | } | 601 | } |
599 | 602 | ||
600 | int ipoib_mcast_start_thread(struct net_device *dev) | 603 | int ipoib_mcast_start_thread(struct net_device *dev) |
@@ -641,6 +644,9 @@ static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast) | |||
641 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 644 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
642 | int ret = 0; | 645 | int ret = 0; |
643 | 646 | ||
647 | if (test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags)) | ||
648 | ib_sa_free_multicast(mcast->mc); | ||
649 | |||
644 | if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) { | 650 | if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) { |
645 | ipoib_dbg_mcast(priv, "leaving MGID " IPOIB_GID_FMT "\n", | 651 | ipoib_dbg_mcast(priv, "leaving MGID " IPOIB_GID_FMT "\n", |
646 | IPOIB_GID_ARG(mcast->mcmember.mgid)); | 652 | IPOIB_GID_ARG(mcast->mcmember.mgid)); |
@@ -652,9 +658,6 @@ static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast) | |||
652 | ipoib_warn(priv, "ipoib_mcast_detach failed (result = %d)\n", ret); | 658 | ipoib_warn(priv, "ipoib_mcast_detach failed (result = %d)\n", ret); |
653 | } | 659 | } |
654 | 660 | ||
655 | if (test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags)) | ||
656 | ib_sa_free_multicast(mcast->mc); | ||
657 | |||
658 | return 0; | 661 | return 0; |
659 | } | 662 | } |
660 | 663 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index 3cb551b88756..7f3ec205e35f 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c | |||
@@ -259,12 +259,13 @@ void ipoib_event(struct ib_event_handler *handler, | |||
259 | struct ipoib_dev_priv *priv = | 259 | struct ipoib_dev_priv *priv = |
260 | container_of(handler, struct ipoib_dev_priv, event_handler); | 260 | container_of(handler, struct ipoib_dev_priv, event_handler); |
261 | 261 | ||
262 | if (record->event == IB_EVENT_PORT_ERR || | 262 | if ((record->event == IB_EVENT_PORT_ERR || |
263 | record->event == IB_EVENT_PKEY_CHANGE || | 263 | record->event == IB_EVENT_PKEY_CHANGE || |
264 | record->event == IB_EVENT_PORT_ACTIVE || | 264 | record->event == IB_EVENT_PORT_ACTIVE || |
265 | record->event == IB_EVENT_LID_CHANGE || | 265 | record->event == IB_EVENT_LID_CHANGE || |
266 | record->event == IB_EVENT_SM_CHANGE || | 266 | record->event == IB_EVENT_SM_CHANGE || |
267 | record->event == IB_EVENT_CLIENT_REREGISTER) { | 267 | record->event == IB_EVENT_CLIENT_REREGISTER) && |
268 | record->element.port_num == priv->port) { | ||
268 | ipoib_dbg(priv, "Port state change event\n"); | 269 | ipoib_dbg(priv, "Port state change event\n"); |
269 | queue_work(ipoib_workqueue, &priv->flush_task); | 270 | queue_work(ipoib_workqueue, &priv->flush_task); |
270 | } | 271 | } |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index ec195a36e8f6..db9cca3b65e0 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -553,7 +553,8 @@ static int __devinit i8042_check_aux(void) | |||
553 | */ | 553 | */ |
554 | 554 | ||
555 | param = 0x5a; | 555 | param = 0x5a; |
556 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0x5a) { | 556 | retval = i8042_command(¶m, I8042_CMD_AUX_LOOP); |
557 | if (retval || param != 0x5a) { | ||
557 | 558 | ||
558 | /* | 559 | /* |
559 | * External connection test - filters out AT-soldered PS/2 i8042's | 560 | * External connection test - filters out AT-soldered PS/2 i8042's |
@@ -567,7 +568,12 @@ static int __devinit i8042_check_aux(void) | |||
567 | (param && param != 0xfa && param != 0xff)) | 568 | (param && param != 0xfa && param != 0xff)) |
568 | return -1; | 569 | return -1; |
569 | 570 | ||
570 | aux_loop_broken = 1; | 571 | /* |
572 | * If AUX_LOOP completed without error but returned unexpected data | ||
573 | * mark it as broken | ||
574 | */ | ||
575 | if (!retval) | ||
576 | aux_loop_broken = 1; | ||
571 | } | 577 | } |
572 | 578 | ||
573 | /* | 579 | /* |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index a163bca38973..dc7a8c78cbf9 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -2464,7 +2464,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) | |||
2464 | 2464 | ||
2465 | r = kvm_arch_ops->hardware_setup(); | 2465 | r = kvm_arch_ops->hardware_setup(); |
2466 | if (r < 0) | 2466 | if (r < 0) |
2467 | return r; | 2467 | goto out; |
2468 | 2468 | ||
2469 | on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1); | 2469 | on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1); |
2470 | r = register_cpu_notifier(&kvm_cpu_notifier); | 2470 | r = register_cpu_notifier(&kvm_cpu_notifier); |
@@ -2500,6 +2500,8 @@ out_free_2: | |||
2500 | out_free_1: | 2500 | out_free_1: |
2501 | on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1); | 2501 | on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1); |
2502 | kvm_arch_ops->hardware_unsetup(); | 2502 | kvm_arch_ops->hardware_unsetup(); |
2503 | out: | ||
2504 | kvm_arch_ops = NULL; | ||
2503 | return r; | 2505 | return r; |
2504 | } | 2506 | } |
2505 | 2507 | ||
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index a1a93368f314..e85b4c7c36f7 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -131,7 +131,7 @@ static int dbg = 1; | |||
131 | (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1)) | 131 | (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1)) |
132 | 132 | ||
133 | 133 | ||
134 | #define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & PAGE_MASK) | 134 | #define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & ~(u64)(PAGE_SIZE-1)) |
135 | #define PT64_DIR_BASE_ADDR_MASK \ | 135 | #define PT64_DIR_BASE_ADDR_MASK \ |
136 | (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1)) | 136 | (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1)) |
137 | 137 | ||
@@ -406,8 +406,8 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn) | |||
406 | spte = desc->shadow_ptes[0]; | 406 | spte = desc->shadow_ptes[0]; |
407 | } | 407 | } |
408 | BUG_ON(!spte); | 408 | BUG_ON(!spte); |
409 | BUG_ON((*spte & PT64_BASE_ADDR_MASK) != | 409 | BUG_ON((*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT |
410 | page_to_pfn(page) << PAGE_SHIFT); | 410 | != page_to_pfn(page)); |
411 | BUG_ON(!(*spte & PT_PRESENT_MASK)); | 411 | BUG_ON(!(*spte & PT_PRESENT_MASK)); |
412 | BUG_ON(!(*spte & PT_WRITABLE_MASK)); | 412 | BUG_ON(!(*spte & PT_WRITABLE_MASK)); |
413 | rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); | 413 | rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); |
@@ -1093,22 +1093,40 @@ out: | |||
1093 | return r; | 1093 | return r; |
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | static void mmu_pre_write_zap_pte(struct kvm_vcpu *vcpu, | ||
1097 | struct kvm_mmu_page *page, | ||
1098 | u64 *spte) | ||
1099 | { | ||
1100 | u64 pte; | ||
1101 | struct kvm_mmu_page *child; | ||
1102 | |||
1103 | pte = *spte; | ||
1104 | if (is_present_pte(pte)) { | ||
1105 | if (page->role.level == PT_PAGE_TABLE_LEVEL) | ||
1106 | rmap_remove(vcpu, spte); | ||
1107 | else { | ||
1108 | child = page_header(pte & PT64_BASE_ADDR_MASK); | ||
1109 | mmu_page_remove_parent_pte(vcpu, child, spte); | ||
1110 | } | ||
1111 | } | ||
1112 | *spte = 0; | ||
1113 | } | ||
1114 | |||
1096 | void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) | 1115 | void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) |
1097 | { | 1116 | { |
1098 | gfn_t gfn = gpa >> PAGE_SHIFT; | 1117 | gfn_t gfn = gpa >> PAGE_SHIFT; |
1099 | struct kvm_mmu_page *page; | 1118 | struct kvm_mmu_page *page; |
1100 | struct kvm_mmu_page *child; | ||
1101 | struct hlist_node *node, *n; | 1119 | struct hlist_node *node, *n; |
1102 | struct hlist_head *bucket; | 1120 | struct hlist_head *bucket; |
1103 | unsigned index; | 1121 | unsigned index; |
1104 | u64 *spte; | 1122 | u64 *spte; |
1105 | u64 pte; | ||
1106 | unsigned offset = offset_in_page(gpa); | 1123 | unsigned offset = offset_in_page(gpa); |
1107 | unsigned pte_size; | 1124 | unsigned pte_size; |
1108 | unsigned page_offset; | 1125 | unsigned page_offset; |
1109 | unsigned misaligned; | 1126 | unsigned misaligned; |
1110 | int level; | 1127 | int level; |
1111 | int flooded = 0; | 1128 | int flooded = 0; |
1129 | int npte; | ||
1112 | 1130 | ||
1113 | pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes); | 1131 | pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes); |
1114 | if (gfn == vcpu->last_pt_write_gfn) { | 1132 | if (gfn == vcpu->last_pt_write_gfn) { |
@@ -1144,22 +1162,26 @@ void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) | |||
1144 | } | 1162 | } |
1145 | page_offset = offset; | 1163 | page_offset = offset; |
1146 | level = page->role.level; | 1164 | level = page->role.level; |
1165 | npte = 1; | ||
1147 | if (page->role.glevels == PT32_ROOT_LEVEL) { | 1166 | if (page->role.glevels == PT32_ROOT_LEVEL) { |
1148 | page_offset <<= 1; /* 32->64 */ | 1167 | page_offset <<= 1; /* 32->64 */ |
1168 | /* | ||
1169 | * A 32-bit pde maps 4MB while the shadow pdes map | ||
1170 | * only 2MB. So we need to double the offset again | ||
1171 | * and zap two pdes instead of one. | ||
1172 | */ | ||
1173 | if (level == PT32_ROOT_LEVEL) { | ||
1174 | page_offset <<= 1; | ||
1175 | npte = 2; | ||
1176 | } | ||
1149 | page_offset &= ~PAGE_MASK; | 1177 | page_offset &= ~PAGE_MASK; |
1150 | } | 1178 | } |
1151 | spte = __va(page->page_hpa); | 1179 | spte = __va(page->page_hpa); |
1152 | spte += page_offset / sizeof(*spte); | 1180 | spte += page_offset / sizeof(*spte); |
1153 | pte = *spte; | 1181 | while (npte--) { |
1154 | if (is_present_pte(pte)) { | 1182 | mmu_pre_write_zap_pte(vcpu, page, spte); |
1155 | if (level == PT_PAGE_TABLE_LEVEL) | 1183 | ++spte; |
1156 | rmap_remove(vcpu, spte); | ||
1157 | else { | ||
1158 | child = page_header(pte & PT64_BASE_ADDR_MASK); | ||
1159 | mmu_page_remove_parent_pte(vcpu, child, spte); | ||
1160 | } | ||
1161 | } | 1184 | } |
1162 | *spte = 0; | ||
1163 | } | 1185 | } |
1164 | } | 1186 | } |
1165 | 1187 | ||
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index c07178e61122..bfa0ce42ea92 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -371,10 +371,10 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) | |||
371 | data = vmcs_read32(GUEST_SYSENTER_CS); | 371 | data = vmcs_read32(GUEST_SYSENTER_CS); |
372 | break; | 372 | break; |
373 | case MSR_IA32_SYSENTER_EIP: | 373 | case MSR_IA32_SYSENTER_EIP: |
374 | data = vmcs_read32(GUEST_SYSENTER_EIP); | 374 | data = vmcs_readl(GUEST_SYSENTER_EIP); |
375 | break; | 375 | break; |
376 | case MSR_IA32_SYSENTER_ESP: | 376 | case MSR_IA32_SYSENTER_ESP: |
377 | data = vmcs_read32(GUEST_SYSENTER_ESP); | 377 | data = vmcs_readl(GUEST_SYSENTER_ESP); |
378 | break; | 378 | break; |
379 | default: | 379 | default: |
380 | msr = find_msr_entry(vcpu, msr_index); | 380 | msr = find_msr_entry(vcpu, msr_index); |
@@ -412,10 +412,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) | |||
412 | vmcs_write32(GUEST_SYSENTER_CS, data); | 412 | vmcs_write32(GUEST_SYSENTER_CS, data); |
413 | break; | 413 | break; |
414 | case MSR_IA32_SYSENTER_EIP: | 414 | case MSR_IA32_SYSENTER_EIP: |
415 | vmcs_write32(GUEST_SYSENTER_EIP, data); | 415 | vmcs_writel(GUEST_SYSENTER_EIP, data); |
416 | break; | 416 | break; |
417 | case MSR_IA32_SYSENTER_ESP: | 417 | case MSR_IA32_SYSENTER_ESP: |
418 | vmcs_write32(GUEST_SYSENTER_ESP, data); | 418 | vmcs_writel(GUEST_SYSENTER_ESP, data); |
419 | break; | 419 | break; |
420 | case MSR_IA32_TIME_STAMP_COUNTER: | 420 | case MSR_IA32_TIME_STAMP_COUNTER: |
421 | guest_write_tsc(data); | 421 | guest_write_tsc(data); |
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index c625ddb8833d..d5ecd2d53046 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -188,7 +188,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) | |||
188 | for (i=0; i < cnt-1 ; i++) { | 188 | for (i=0; i < cnt-1 ; i++) { |
189 | sector_t sz = 0; | 189 | sector_t sz = 0; |
190 | int j; | 190 | int j; |
191 | for (j=i; i<cnt-1 && sz < min_spacing ; j++) | 191 | for (j = i; j < cnt - 1 && sz < min_spacing; j++) |
192 | sz += conf->disks[j].size; | 192 | sz += conf->disks[j].size; |
193 | if (sz >= min_spacing && sz < conf->hash_spacing) | 193 | if (sz >= min_spacing && sz < conf->hash_spacing) |
194 | conf->hash_spacing = sz; | 194 | conf->hash_spacing = sz; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 1ff5138e4bb6..9916cf32494d 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -1248,10 +1248,10 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) | |||
1248 | ret |= pvr2_write_register(hdw, 0xaa18, 0x00840000); /*unknown*/ | 1248 | ret |= pvr2_write_register(hdw, 0xaa18, 0x00840000); /*unknown*/ |
1249 | LOCK_TAKE(hdw->ctl_lock); do { | 1249 | LOCK_TAKE(hdw->ctl_lock); do { |
1250 | hdw->cmd_buffer[0] = FX2CMD_FWPOST1; | 1250 | hdw->cmd_buffer[0] = FX2CMD_FWPOST1; |
1251 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); | 1251 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
1252 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; | 1252 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; |
1253 | hdw->cmd_buffer[1] = 0; | 1253 | hdw->cmd_buffer[1] = 0; |
1254 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,0,0); | 1254 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,NULL,0); |
1255 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 1255 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
1256 | 1256 | ||
1257 | if (ret) { | 1257 | if (ret) { |
@@ -1320,7 +1320,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) | |||
1320 | LOCK_TAKE(hdw->ctl_lock); do { | 1320 | LOCK_TAKE(hdw->ctl_lock); do { |
1321 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; | 1321 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; |
1322 | hdw->cmd_buffer[1] = 0; | 1322 | hdw->cmd_buffer[1] = 0; |
1323 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,0,0); | 1323 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,NULL,0); |
1324 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 1324 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
1325 | 1325 | ||
1326 | if (ret) { | 1326 | if (ret) { |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 5313d342666e..25d3830b482a 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | |||
@@ -808,11 +808,11 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp) | |||
808 | { | 808 | { |
809 | if (vp->dev_video) { | 809 | if (vp->dev_video) { |
810 | pvr2_v4l2_dev_destroy(vp->dev_video); | 810 | pvr2_v4l2_dev_destroy(vp->dev_video); |
811 | vp->dev_video = 0; | 811 | vp->dev_video = NULL; |
812 | } | 812 | } |
813 | if (vp->dev_radio) { | 813 | if (vp->dev_radio) { |
814 | pvr2_v4l2_dev_destroy(vp->dev_radio); | 814 | pvr2_v4l2_dev_destroy(vp->dev_radio); |
815 | vp->dev_radio = 0; | 815 | vp->dev_radio = NULL; |
816 | } | 816 | } |
817 | 817 | ||
818 | pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_v4l2 id=%p",vp); | 818 | pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_v4l2 id=%p",vp); |
@@ -1138,7 +1138,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, | |||
1138 | { | 1138 | { |
1139 | int mindevnum; | 1139 | int mindevnum; |
1140 | int unit_number; | 1140 | int unit_number; |
1141 | int *nr_ptr = 0; | 1141 | int *nr_ptr = NULL; |
1142 | dip->v4lp = vp; | 1142 | dip->v4lp = vp; |
1143 | 1143 | ||
1144 | 1144 | ||
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index 295e931c0dfb..4b232124a1ab 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c | |||
@@ -211,7 +211,7 @@ static struct workqueue_struct *led_workqueue; | |||
211 | enum led_brightness value); \ | 211 | enum led_brightness value); \ |
212 | static void object##_led_update(struct work_struct *ignored); \ | 212 | static void object##_led_update(struct work_struct *ignored); \ |
213 | static int object##_led_wk; \ | 213 | static int object##_led_wk; \ |
214 | DECLARE_WORK(object##_led_work, object##_led_update); \ | 214 | static DECLARE_WORK(object##_led_work, object##_led_update); \ |
215 | static struct led_classdev object##_led = { \ | 215 | static struct led_classdev object##_led = { \ |
216 | .name = "asus:" ledname, \ | 216 | .name = "asus:" ledname, \ |
217 | .brightness_set = object##_led_set, \ | 217 | .brightness_set = object##_led_set, \ |
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 2ebe240dd537..ac708bc2f9f3 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -453,7 +453,7 @@ static int sony_acpi_resume(struct acpi_device *device) | |||
453 | static int sony_acpi_add(struct acpi_device *device) | 453 | static int sony_acpi_add(struct acpi_device *device) |
454 | { | 454 | { |
455 | acpi_status status; | 455 | acpi_status status; |
456 | int result; | 456 | int result = 0; |
457 | acpi_handle handle; | 457 | acpi_handle handle; |
458 | 458 | ||
459 | sony_acpi_acpi_device = device; | 459 | sony_acpi_acpi_device = device; |
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c index b060d4bfba29..0de5c9e94e74 100644 --- a/drivers/mmc/imxmmc.c +++ b/drivers/mmc/imxmmc.c | |||
@@ -569,10 +569,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat) | |||
569 | 569 | ||
570 | if(host->dma_dir == DMA_FROM_DEVICE) { | 570 | if(host->dma_dir == DMA_FROM_DEVICE) { |
571 | imxmci_busy_wait_for_status(host, &stat, | 571 | imxmci_busy_wait_for_status(host, &stat, |
572 | STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE, | 572 | STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE | |
573 | STATUS_TIME_OUT_READ, | ||
573 | 50, "imxmci_cpu_driven_data read"); | 574 | 50, "imxmci_cpu_driven_data read"); |
574 | 575 | ||
575 | while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) && | 576 | while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) && |
577 | !(stat & STATUS_TIME_OUT_READ) && | ||
576 | (host->data_cnt < 512)) { | 578 | (host->data_cnt < 512)) { |
577 | 579 | ||
578 | udelay(20); /* required for clocks < 8MHz*/ | 580 | udelay(20); /* required for clocks < 8MHz*/ |
@@ -602,6 +604,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat) | |||
602 | if(host->dma_size & 0x1ff) | 604 | if(host->dma_size & 0x1ff) |
603 | stat &= ~STATUS_CRC_READ_ERR; | 605 | stat &= ~STATUS_CRC_READ_ERR; |
604 | 606 | ||
607 | if(stat & STATUS_TIME_OUT_READ) { | ||
608 | dev_dbg(mmc_dev(host->mmc), "imxmci_cpu_driven_data read timeout STATUS = 0x%x\n", | ||
609 | stat); | ||
610 | trans_done = -1; | ||
611 | } | ||
612 | |||
605 | } else { | 613 | } else { |
606 | imxmci_busy_wait_for_status(host, &stat, | 614 | imxmci_busy_wait_for_status(host, &stat, |
607 | STATUS_APPL_BUFF_FE, | 615 | STATUS_APPL_BUFF_FE, |
@@ -709,6 +717,9 @@ static void imxmci_tasklet_fnc(unsigned long data) | |||
709 | */ | 717 | */ |
710 | stat |= host->status_reg; | 718 | stat |= host->status_reg; |
711 | 719 | ||
720 | if(test_bit(IMXMCI_PEND_CPU_DATA_b, &host->pending_events)) | ||
721 | stat &= ~STATUS_CRC_READ_ERR; | ||
722 | |||
712 | if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) { | 723 | if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) { |
713 | imxmci_busy_wait_for_status(host, &stat, | 724 | imxmci_busy_wait_for_status(host, &stat, |
714 | STATUS_END_CMD_RESP | STATUS_ERR_MASK, | 725 | STATUS_END_CMD_RESP | STATUS_ERR_MASK, |
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index e3acd398fb37..1f6445840461 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -359,6 +359,8 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) | |||
359 | cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp; | 359 | cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp; |
360 | cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp; | 360 | cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp; |
361 | cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp; | 361 | cfi->chips[i].erase_time = 1<<cfi->cfiq->BlockEraseTimeoutTyp; |
362 | cfi->chips[i].ref_point_counter = 0; | ||
363 | init_waitqueue_head(&(cfi->chips[i].wq)); | ||
362 | } | 364 | } |
363 | 365 | ||
364 | map->fldrv = &cfi_amdstd_chipdrv; | 366 | map->fldrv = &cfi_amdstd_chipdrv; |
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index 69d49e0250a9..b344ff858b2d 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c | |||
@@ -158,6 +158,8 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary) | |||
158 | cfi->chips[i].word_write_time = 128; | 158 | cfi->chips[i].word_write_time = 128; |
159 | cfi->chips[i].buffer_write_time = 128; | 159 | cfi->chips[i].buffer_write_time = 128; |
160 | cfi->chips[i].erase_time = 1024; | 160 | cfi->chips[i].erase_time = 1024; |
161 | cfi->chips[i].ref_point_counter = 0; | ||
162 | init_waitqueue_head(&(cfi->chips[i].wq)); | ||
161 | } | 163 | } |
162 | 164 | ||
163 | return cfi_staa_setup(map); | 165 | return cfi_staa_setup(map); |
diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c index b1104fe1f207..1c3b34ad7325 100644 --- a/drivers/mtd/maps/dilnetpc.c +++ b/drivers/mtd/maps/dilnetpc.c | |||
@@ -402,8 +402,8 @@ static int __init init_dnpc(void) | |||
402 | ++higlvl_partition_info[i].name; | 402 | ++higlvl_partition_info[i].name; |
403 | } | 403 | } |
404 | 404 | ||
405 | printk(KERN_NOTICE "DIL/Net %s flash: 0x%lx at 0x%lx\n", | 405 | printk(KERN_NOTICE "DIL/Net %s flash: 0x%lx at 0x%llx\n", |
406 | is_dnp ? "DNPC" : "ADNP", dnpc_map.size, dnpc_map.phys); | 406 | is_dnp ? "DNPC" : "ADNP", dnpc_map.size, (unsigned long long)dnpc_map.phys); |
407 | 407 | ||
408 | dnpc_map.virt = ioremap_nocache(dnpc_map.phys, dnpc_map.size); | 408 | dnpc_map.virt = ioremap_nocache(dnpc_map.phys, dnpc_map.size); |
409 | 409 | ||
diff --git a/drivers/mtd/maps/esb2rom.c b/drivers/mtd/maps/esb2rom.c index 0bc013fd66a3..aa64a4752781 100644 --- a/drivers/mtd/maps/esb2rom.c +++ b/drivers/mtd/maps/esb2rom.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #define ROM_PROBE_STEP_SIZE (64*1024) /* 64KiB */ | 31 | #define ROM_PROBE_STEP_SIZE (64*1024) /* 64KiB */ |
32 | 32 | ||
33 | #define BIOS_CNTL 0xDC | 33 | #define BIOS_CNTL 0xDC |
34 | #define BIOS_LOCK_ENABLE 0x02 | 34 | #define BIOS_LOCK_ENABLE 0x02 |
35 | #define BIOS_WRITE_ENABLE 0x01 | 35 | #define BIOS_WRITE_ENABLE 0x01 |
36 | 36 | ||
@@ -145,7 +145,7 @@ static void esb2rom_cleanup(struct esb2rom_window *window) | |||
145 | } | 145 | } |
146 | 146 | ||
147 | static int __devinit esb2rom_init_one(struct pci_dev *pdev, | 147 | static int __devinit esb2rom_init_one(struct pci_dev *pdev, |
148 | const struct pci_device_id *ent) | 148 | const struct pci_device_id *ent) |
149 | { | 149 | { |
150 | static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL }; | 150 | static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL }; |
151 | struct esb2rom_window *window = &esb2rom_window; | 151 | struct esb2rom_window *window = &esb2rom_window; |
@@ -185,7 +185,7 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev, | |||
185 | /* Find a region continuous to the end of the ROM window */ | 185 | /* Find a region continuous to the end of the ROM window */ |
186 | window->phys = 0; | 186 | window->phys = 0; |
187 | pci_read_config_word(pdev, FWH_DEC_EN1, &word); | 187 | pci_read_config_word(pdev, FWH_DEC_EN1, &word); |
188 | printk(KERN_DEBUG "pci_read_config_byte : %x\n", word); | 188 | printk(KERN_DEBUG "pci_read_config_word : %x\n", word); |
189 | 189 | ||
190 | if ((word & FWH_8MiB) == FWH_8MiB) | 190 | if ((word & FWH_8MiB) == FWH_8MiB) |
191 | window->phys = 0xff400000; | 191 | window->phys = 0xff400000; |
@@ -212,6 +212,11 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev, | |||
212 | else if ((word & FWH_0_5MiB) == FWH_0_5MiB) | 212 | else if ((word & FWH_0_5MiB) == FWH_0_5MiB) |
213 | window->phys = 0xfff80000; | 213 | window->phys = 0xfff80000; |
214 | 214 | ||
215 | if (window->phys == 0) { | ||
216 | printk(KERN_ERR MOD_NAME ": Rom window is closed\n"); | ||
217 | goto out; | ||
218 | } | ||
219 | |||
215 | /* reserved 0x0020 and 0x0010 */ | 220 | /* reserved 0x0020 and 0x0010 */ |
216 | window->phys -= 0x400000UL; | 221 | window->phys -= 0x400000UL; |
217 | window->size = (0xffffffffUL - window->phys) + 1UL; | 222 | window->size = (0xffffffffUL - window->phys) + 1UL; |
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 880580c44e01..41844ea02462 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c | |||
@@ -727,6 +727,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c | |||
727 | concat->mtd.erasesize = subdev[0]->erasesize; | 727 | concat->mtd.erasesize = subdev[0]->erasesize; |
728 | concat->mtd.writesize = subdev[0]->writesize; | 728 | concat->mtd.writesize = subdev[0]->writesize; |
729 | concat->mtd.oobsize = subdev[0]->oobsize; | 729 | concat->mtd.oobsize = subdev[0]->oobsize; |
730 | concat->mtd.oobavail = subdev[0]->oobavail; | ||
730 | if (subdev[0]->writev) | 731 | if (subdev[0]->writev) |
731 | concat->mtd.writev = concat_writev; | 732 | concat->mtd.writev = concat_writev; |
732 | if (subdev[0]->read_oob) | 733 | if (subdev[0]->read_oob) |
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 633def3fb087..1af989023c66 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -200,6 +200,11 @@ static int part_erase (struct mtd_info *mtd, struct erase_info *instr) | |||
200 | return -EINVAL; | 200 | return -EINVAL; |
201 | instr->addr += part->offset; | 201 | instr->addr += part->offset; |
202 | ret = part->master->erase(part->master, instr); | 202 | ret = part->master->erase(part->master, instr); |
203 | if (ret) { | ||
204 | if (instr->fail_addr != 0xffffffff) | ||
205 | instr->fail_addr -= part->offset; | ||
206 | instr->addr -= part->offset; | ||
207 | } | ||
203 | return ret; | 208 | return ret; |
204 | } | 209 | } |
205 | 210 | ||
@@ -338,6 +343,7 @@ int add_mtd_partitions(struct mtd_info *master, | |||
338 | slave->mtd.size = parts[i].size; | 343 | slave->mtd.size = parts[i].size; |
339 | slave->mtd.writesize = master->writesize; | 344 | slave->mtd.writesize = master->writesize; |
340 | slave->mtd.oobsize = master->oobsize; | 345 | slave->mtd.oobsize = master->oobsize; |
346 | slave->mtd.oobavail = master->oobavail; | ||
341 | slave->mtd.subpage_sft = master->subpage_sft; | 347 | slave->mtd.subpage_sft = master->subpage_sft; |
342 | 348 | ||
343 | slave->mtd.name = parts[i].name; | 349 | slave->mtd.name = parts[i].name; |
@@ -559,4 +565,3 @@ EXPORT_SYMBOL_GPL(deregister_mtd_parser); | |||
559 | MODULE_LICENSE("GPL"); | 565 | MODULE_LICENSE("GPL"); |
560 | MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>"); | 566 | MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>"); |
561 | MODULE_DESCRIPTION("Generic support for partitioning of MTD devices"); | 567 | MODULE_DESCRIPTION("Generic support for partitioning of MTD devices"); |
562 | |||
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c index 12608c13cce5..595208f965a5 100644 --- a/drivers/mtd/nand/diskonchip.c +++ b/drivers/mtd/nand/diskonchip.c | |||
@@ -114,7 +114,7 @@ module_param(no_autopart, int, 0); | |||
114 | static int show_firmware_partition = 0; | 114 | static int show_firmware_partition = 0; |
115 | module_param(show_firmware_partition, int, 0); | 115 | module_param(show_firmware_partition, int, 0); |
116 | 116 | ||
117 | #ifdef MTD_NAND_DISKONCHIP_BBTWRITE | 117 | #ifdef CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE |
118 | static int inftl_bbt_write = 1; | 118 | static int inftl_bbt_write = 1; |
119 | #else | 119 | #else |
120 | static int inftl_bbt_write = 0; | 120 | static int inftl_bbt_write = 0; |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index acaf97bc80d1..6af37b8cff65 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -2524,6 +2524,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
2524 | for (i = 0; chip->ecc.layout->oobfree[i].length; i++) | 2524 | for (i = 0; chip->ecc.layout->oobfree[i].length; i++) |
2525 | chip->ecc.layout->oobavail += | 2525 | chip->ecc.layout->oobavail += |
2526 | chip->ecc.layout->oobfree[i].length; | 2526 | chip->ecc.layout->oobfree[i].length; |
2527 | mtd->oobavail = chip->ecc.layout->oobavail; | ||
2527 | 2528 | ||
2528 | /* | 2529 | /* |
2529 | * Set the number of read / write steps for one page depending on ECC | 2530 | * Set the number of read / write steps for one page depending on ECC |
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 7f1cb6e5dccb..9e14a26ca4e8 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -4,6 +4,11 @@ | |||
4 | * Copyright (C) 2005-2007 Samsung Electronics | 4 | * Copyright (C) 2005-2007 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * Credits: | ||
8 | * Adrian Hunter <ext-adrian.hunter@nokia.com>: | ||
9 | * auto-placement support, read-while load support, various fixes | ||
10 | * Copyright (C) Nokia Corporation, 2007 | ||
11 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 13 | * it under the terms of the GNU General Public License version 2 as |
9 | * published by the Free Software Foundation. | 14 | * published by the Free Software Foundation. |
@@ -831,7 +836,7 @@ static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int col | |||
831 | int readcol = column; | 836 | int readcol = column; |
832 | int readend = column + thislen; | 837 | int readend = column + thislen; |
833 | int lastgap = 0; | 838 | int lastgap = 0; |
834 | uint8_t *oob_buf = this->page_buf + mtd->writesize; | 839 | uint8_t *oob_buf = this->oob_buf; |
835 | 840 | ||
836 | for (free = this->ecclayout->oobfree; free->length; ++free) { | 841 | for (free = this->ecclayout->oobfree; free->length; ++free) { |
837 | if (readcol >= lastgap) | 842 | if (readcol >= lastgap) |
@@ -849,7 +854,8 @@ static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int col | |||
849 | int n = ed - st; | 854 | int n = ed - st; |
850 | memcpy(buf, oob_buf + st, n); | 855 | memcpy(buf, oob_buf + st, n); |
851 | buf += n; | 856 | buf += n; |
852 | } | 857 | } else |
858 | break; | ||
853 | } | 859 | } |
854 | return 0; | 860 | return 0; |
855 | } | 861 | } |
@@ -947,9 +953,9 @@ static int onenand_do_read_oob(struct mtd_info *mtd, loff_t from, size_t len, | |||
947 | 953 | ||
948 | /** | 954 | /** |
949 | * onenand_read_oob - [MTD Interface] NAND write data and/or out-of-band | 955 | * onenand_read_oob - [MTD Interface] NAND write data and/or out-of-band |
950 | * @mtd: MTD device structure | 956 | * @param mtd: MTD device structure |
951 | * @from: offset to read from | 957 | * @param from: offset to read from |
952 | * @ops: oob operation description structure | 958 | * @param ops: oob operation description structure |
953 | */ | 959 | */ |
954 | static int onenand_read_oob(struct mtd_info *mtd, loff_t from, | 960 | static int onenand_read_oob(struct mtd_info *mtd, loff_t from, |
955 | struct mtd_oob_ops *ops) | 961 | struct mtd_oob_ops *ops) |
@@ -1017,7 +1023,7 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state) | |||
1017 | * onenand_bbt_read_oob - [MTD Interface] OneNAND read out-of-band for bbt scan | 1023 | * onenand_bbt_read_oob - [MTD Interface] OneNAND read out-of-band for bbt scan |
1018 | * @param mtd MTD device structure | 1024 | * @param mtd MTD device structure |
1019 | * @param from offset to read from | 1025 | * @param from offset to read from |
1020 | * @param @ops oob operation description structure | 1026 | * @param ops oob operation description structure |
1021 | * | 1027 | * |
1022 | * OneNAND read out-of-band data from the spare area for bbt scan | 1028 | * OneNAND read out-of-band data from the spare area for bbt scan |
1023 | */ | 1029 | */ |
@@ -1093,7 +1099,7 @@ int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, | |||
1093 | static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to) | 1099 | static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to) |
1094 | { | 1100 | { |
1095 | struct onenand_chip *this = mtd->priv; | 1101 | struct onenand_chip *this = mtd->priv; |
1096 | char *readp = this->page_buf + mtd->writesize; | 1102 | char oobbuf[64]; |
1097 | int status, i; | 1103 | int status, i; |
1098 | 1104 | ||
1099 | this->command(mtd, ONENAND_CMD_READOOB, to, mtd->oobsize); | 1105 | this->command(mtd, ONENAND_CMD_READOOB, to, mtd->oobsize); |
@@ -1102,9 +1108,9 @@ static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to | |||
1102 | if (status) | 1108 | if (status) |
1103 | return status; | 1109 | return status; |
1104 | 1110 | ||
1105 | this->read_bufferram(mtd, ONENAND_SPARERAM, readp, 0, mtd->oobsize); | 1111 | this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize); |
1106 | for(i = 0; i < mtd->oobsize; i++) | 1112 | for (i = 0; i < mtd->oobsize; i++) |
1107 | if (buf[i] != 0xFF && buf[i] != readp[i]) | 1113 | if (buf[i] != 0xFF && buf[i] != oobbuf[i]) |
1108 | return -EBADMSG; | 1114 | return -EBADMSG; |
1109 | 1115 | ||
1110 | return 0; | 1116 | return 0; |
@@ -1290,7 +1296,8 @@ static int onenand_fill_auto_oob(struct mtd_info *mtd, u_char *oob_buf, | |||
1290 | int n = ed - st; | 1296 | int n = ed - st; |
1291 | memcpy(oob_buf + st, buf, n); | 1297 | memcpy(oob_buf + st, buf, n); |
1292 | buf += n; | 1298 | buf += n; |
1293 | } | 1299 | } else |
1300 | break; | ||
1294 | } | 1301 | } |
1295 | return 0; | 1302 | return 0; |
1296 | } | 1303 | } |
@@ -1312,6 +1319,7 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len, | |||
1312 | struct onenand_chip *this = mtd->priv; | 1319 | struct onenand_chip *this = mtd->priv; |
1313 | int column, ret = 0, oobsize; | 1320 | int column, ret = 0, oobsize; |
1314 | int written = 0; | 1321 | int written = 0; |
1322 | u_char *oobbuf; | ||
1315 | 1323 | ||
1316 | DEBUG(MTD_DEBUG_LEVEL3, "onenand_write_oob: to = 0x%08x, len = %i\n", (unsigned int) to, (int) len); | 1324 | DEBUG(MTD_DEBUG_LEVEL3, "onenand_write_oob: to = 0x%08x, len = %i\n", (unsigned int) to, (int) len); |
1317 | 1325 | ||
@@ -1331,7 +1339,7 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len, | |||
1331 | } | 1339 | } |
1332 | 1340 | ||
1333 | /* For compatibility with NAND: Do not allow write past end of page */ | 1341 | /* For compatibility with NAND: Do not allow write past end of page */ |
1334 | if (column + len > oobsize) { | 1342 | if (unlikely(column + len > oobsize)) { |
1335 | printk(KERN_ERR "onenand_write_oob: " | 1343 | printk(KERN_ERR "onenand_write_oob: " |
1336 | "Attempt to write past end of page\n"); | 1344 | "Attempt to write past end of page\n"); |
1337 | return -EINVAL; | 1345 | return -EINVAL; |
@@ -1348,6 +1356,8 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len, | |||
1348 | /* Grab the lock and see if the device is available */ | 1356 | /* Grab the lock and see if the device is available */ |
1349 | onenand_get_device(mtd, FL_WRITING); | 1357 | onenand_get_device(mtd, FL_WRITING); |
1350 | 1358 | ||
1359 | oobbuf = this->oob_buf; | ||
1360 | |||
1351 | /* Loop until all data write */ | 1361 | /* Loop until all data write */ |
1352 | while (written < len) { | 1362 | while (written < len) { |
1353 | int thislen = min_t(int, oobsize, len - written); | 1363 | int thislen = min_t(int, oobsize, len - written); |
@@ -1358,12 +1368,12 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len, | |||
1358 | 1368 | ||
1359 | /* We send data to spare ram with oobsize | 1369 | /* We send data to spare ram with oobsize |
1360 | * to prevent byte access */ | 1370 | * to prevent byte access */ |
1361 | memset(this->page_buf, 0xff, mtd->oobsize); | 1371 | memset(oobbuf, 0xff, mtd->oobsize); |
1362 | if (mode == MTD_OOB_AUTO) | 1372 | if (mode == MTD_OOB_AUTO) |
1363 | onenand_fill_auto_oob(mtd, this->page_buf, buf, column, thislen); | 1373 | onenand_fill_auto_oob(mtd, oobbuf, buf, column, thislen); |
1364 | else | 1374 | else |
1365 | memcpy(this->page_buf + column, buf, thislen); | 1375 | memcpy(oobbuf + column, buf, thislen); |
1366 | this->write_bufferram(mtd, ONENAND_SPARERAM, this->page_buf, 0, mtd->oobsize); | 1376 | this->write_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize); |
1367 | 1377 | ||
1368 | this->command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize); | 1378 | this->command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize); |
1369 | 1379 | ||
@@ -1375,7 +1385,7 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len, | |||
1375 | break; | 1385 | break; |
1376 | } | 1386 | } |
1377 | 1387 | ||
1378 | ret = onenand_verify_oob(mtd, this->page_buf, to); | 1388 | ret = onenand_verify_oob(mtd, oobbuf, to); |
1379 | if (ret) { | 1389 | if (ret) { |
1380 | printk(KERN_ERR "onenand_write_oob: verify failed %d\n", ret); | 1390 | printk(KERN_ERR "onenand_write_oob: verify failed %d\n", ret); |
1381 | break; | 1391 | break; |
@@ -1400,9 +1410,9 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len, | |||
1400 | 1410 | ||
1401 | /** | 1411 | /** |
1402 | * onenand_write_oob - [MTD Interface] NAND write data and/or out-of-band | 1412 | * onenand_write_oob - [MTD Interface] NAND write data and/or out-of-band |
1403 | * @mtd: MTD device structure | 1413 | * @param mtd: MTD device structure |
1404 | * @from: offset to read from | 1414 | * @param to: offset to write |
1405 | * @ops: oob operation description structure | 1415 | * @param ops: oob operation description structure |
1406 | */ | 1416 | */ |
1407 | static int onenand_write_oob(struct mtd_info *mtd, loff_t to, | 1417 | static int onenand_write_oob(struct mtd_info *mtd, loff_t to, |
1408 | struct mtd_oob_ops *ops) | 1418 | struct mtd_oob_ops *ops) |
@@ -1616,6 +1626,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
1616 | * @param mtd MTD device structure | 1626 | * @param mtd MTD device structure |
1617 | * @param ofs offset relative to mtd start | 1627 | * @param ofs offset relative to mtd start |
1618 | * @param len number of bytes to lock or unlock | 1628 | * @param len number of bytes to lock or unlock |
1629 | * @param cmd lock or unlock command | ||
1619 | * | 1630 | * |
1620 | * Lock or unlock one or more blocks | 1631 | * Lock or unlock one or more blocks |
1621 | */ | 1632 | */ |
@@ -2117,10 +2128,11 @@ static void onenand_check_features(struct mtd_info *mtd) | |||
2117 | } | 2128 | } |
2118 | 2129 | ||
2119 | /** | 2130 | /** |
2120 | * onenand_print_device_info - Print device ID | 2131 | * onenand_print_device_info - Print device & version ID |
2121 | * @param device device ID | 2132 | * @param device device ID |
2133 | * @param version version ID | ||
2122 | * | 2134 | * |
2123 | * Print device ID | 2135 | * Print device & version ID |
2124 | */ | 2136 | */ |
2125 | static void onenand_print_device_info(int device, int version) | 2137 | static void onenand_print_device_info(int device, int version) |
2126 | { | 2138 | { |
@@ -2320,15 +2332,25 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) | |||
2320 | 2332 | ||
2321 | /* Allocate buffers, if necessary */ | 2333 | /* Allocate buffers, if necessary */ |
2322 | if (!this->page_buf) { | 2334 | if (!this->page_buf) { |
2323 | size_t len; | 2335 | this->page_buf = kzalloc(mtd->writesize, GFP_KERNEL); |
2324 | len = mtd->writesize + mtd->oobsize; | ||
2325 | this->page_buf = kmalloc(len, GFP_KERNEL); | ||
2326 | if (!this->page_buf) { | 2336 | if (!this->page_buf) { |
2327 | printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n"); | 2337 | printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n"); |
2328 | return -ENOMEM; | 2338 | return -ENOMEM; |
2329 | } | 2339 | } |
2330 | this->options |= ONENAND_PAGEBUF_ALLOC; | 2340 | this->options |= ONENAND_PAGEBUF_ALLOC; |
2331 | } | 2341 | } |
2342 | if (!this->oob_buf) { | ||
2343 | this->oob_buf = kzalloc(mtd->oobsize, GFP_KERNEL); | ||
2344 | if (!this->oob_buf) { | ||
2345 | printk(KERN_ERR "onenand_scan(): Can't allocate oob_buf\n"); | ||
2346 | if (this->options & ONENAND_PAGEBUF_ALLOC) { | ||
2347 | this->options &= ~ONENAND_PAGEBUF_ALLOC; | ||
2348 | kfree(this->page_buf); | ||
2349 | } | ||
2350 | return -ENOMEM; | ||
2351 | } | ||
2352 | this->options |= ONENAND_OOBBUF_ALLOC; | ||
2353 | } | ||
2332 | 2354 | ||
2333 | this->state = FL_READY; | 2355 | this->state = FL_READY; |
2334 | init_waitqueue_head(&this->wq); | 2356 | init_waitqueue_head(&this->wq); |
@@ -2367,6 +2389,7 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) | |||
2367 | for (i = 0; this->ecclayout->oobfree[i].length; i++) | 2389 | for (i = 0; this->ecclayout->oobfree[i].length; i++) |
2368 | this->ecclayout->oobavail += | 2390 | this->ecclayout->oobavail += |
2369 | this->ecclayout->oobfree[i].length; | 2391 | this->ecclayout->oobfree[i].length; |
2392 | mtd->oobavail = this->ecclayout->oobavail; | ||
2370 | 2393 | ||
2371 | mtd->ecclayout = this->ecclayout; | 2394 | mtd->ecclayout = this->ecclayout; |
2372 | 2395 | ||
@@ -2424,9 +2447,11 @@ void onenand_release(struct mtd_info *mtd) | |||
2424 | kfree(bbm->bbt); | 2447 | kfree(bbm->bbt); |
2425 | kfree(this->bbm); | 2448 | kfree(this->bbm); |
2426 | } | 2449 | } |
2427 | /* Buffer allocated by onenand_scan */ | 2450 | /* Buffers allocated by onenand_scan */ |
2428 | if (this->options & ONENAND_PAGEBUF_ALLOC) | 2451 | if (this->options & ONENAND_PAGEBUF_ALLOC) |
2429 | kfree(this->page_buf); | 2452 | kfree(this->page_buf); |
2453 | if (this->options & ONENAND_OOBBUF_ALLOC) | ||
2454 | kfree(this->oob_buf); | ||
2430 | } | 2455 | } |
2431 | 2456 | ||
2432 | EXPORT_SYMBOL_GPL(onenand_scan); | 2457 | EXPORT_SYMBOL_GPL(onenand_scan); |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 72995777f809..b406ecfa7268 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -858,19 +858,7 @@ static struct eisa_device_id vortex_eisa_ids[] = { | |||
858 | }; | 858 | }; |
859 | MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); | 859 | MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); |
860 | 860 | ||
861 | static int vortex_eisa_probe(struct device *device); | 861 | static int __init vortex_eisa_probe(struct device *device) |
862 | static int vortex_eisa_remove(struct device *device); | ||
863 | |||
864 | static struct eisa_driver vortex_eisa_driver = { | ||
865 | .id_table = vortex_eisa_ids, | ||
866 | .driver = { | ||
867 | .name = "3c59x", | ||
868 | .probe = vortex_eisa_probe, | ||
869 | .remove = vortex_eisa_remove | ||
870 | } | ||
871 | }; | ||
872 | |||
873 | static int vortex_eisa_probe(struct device *device) | ||
874 | { | 862 | { |
875 | void __iomem *ioaddr; | 863 | void __iomem *ioaddr; |
876 | struct eisa_device *edev; | 864 | struct eisa_device *edev; |
@@ -893,7 +881,7 @@ static int vortex_eisa_probe(struct device *device) | |||
893 | return 0; | 881 | return 0; |
894 | } | 882 | } |
895 | 883 | ||
896 | static int vortex_eisa_remove(struct device *device) | 884 | static int __devexit vortex_eisa_remove(struct device *device) |
897 | { | 885 | { |
898 | struct eisa_device *edev; | 886 | struct eisa_device *edev; |
899 | struct net_device *dev; | 887 | struct net_device *dev; |
@@ -918,7 +906,17 @@ static int vortex_eisa_remove(struct device *device) | |||
918 | free_netdev(dev); | 906 | free_netdev(dev); |
919 | return 0; | 907 | return 0; |
920 | } | 908 | } |
921 | #endif | 909 | |
910 | static struct eisa_driver vortex_eisa_driver = { | ||
911 | .id_table = vortex_eisa_ids, | ||
912 | .driver = { | ||
913 | .name = "3c59x", | ||
914 | .probe = vortex_eisa_probe, | ||
915 | .remove = __devexit_p(vortex_eisa_remove) | ||
916 | } | ||
917 | }; | ||
918 | |||
919 | #endif /* CONFIG_EISA */ | ||
922 | 920 | ||
923 | /* returns count found (>= 0), or negative on error */ | 921 | /* returns count found (>= 0), or negative on error */ |
924 | static int __init vortex_eisa_init(void) | 922 | static int __init vortex_eisa_init(void) |
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 88d4f70035bb..dee3638ad744 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -1328,7 +1328,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb, | |||
1328 | 1328 | ||
1329 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 1329 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
1330 | cso = skb->h.raw - skb->data; | 1330 | cso = skb->h.raw - skb->data; |
1331 | css = (skb->h.raw + skb->csum) - skb->data; | 1331 | css = (skb->h.raw + skb->csum_offset) - skb->data; |
1332 | if (unlikely(cso & 0x1)) { | 1332 | if (unlikely(cso & 0x1)) { |
1333 | printk(KERN_DEBUG "%s: payload offset != even number\n", | 1333 | printk(KERN_DEBUG "%s: payload offset != even number\n", |
1334 | atl1_driver_name); | 1334 | atl1_driver_name); |
@@ -1562,7 +1562,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1562 | /* mss will be nonzero if we're doing segment offload (TSO/GSO) */ | 1562 | /* mss will be nonzero if we're doing segment offload (TSO/GSO) */ |
1563 | mss = skb_shinfo(skb)->gso_size; | 1563 | mss = skb_shinfo(skb)->gso_size; |
1564 | if (mss) { | 1564 | if (mss) { |
1565 | if (skb->protocol == ntohs(ETH_P_IP)) { | 1565 | if (skb->protocol == htons(ETH_P_IP)) { |
1566 | proto_hdr_len = ((skb->h.raw - skb->data) + | 1566 | proto_hdr_len = ((skb->h.raw - skb->data) + |
1567 | (skb->h.th->doff << 2)); | 1567 | (skb->h.th->doff << 2)); |
1568 | if (unlikely(proto_hdr_len > len)) { | 1568 | if (unlikely(proto_hdr_len > len)) { |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 340ee99652eb..1d510bdc9b84 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1057,6 +1057,8 @@ static int stir421x_fw_upload(struct irda_usb_cb *self, | |||
1057 | 1057 | ||
1058 | if (ret < 0) | 1058 | if (ret < 0) |
1059 | break; | 1059 | break; |
1060 | |||
1061 | mdelay(10); | ||
1060 | } | 1062 | } |
1061 | 1063 | ||
1062 | kfree(patch_block); | 1064 | kfree(patch_block); |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 9ba21e0f27c5..1ee27c360a4b 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -787,6 +787,12 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
787 | unsigned int size; | 787 | unsigned int size; |
788 | int err; | 788 | int err; |
789 | 789 | ||
790 | /* Clear any pending ethernet port interrupts */ | ||
791 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); | ||
792 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); | ||
793 | /* wait for previous write to complete */ | ||
794 | mv_read (MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num)); | ||
795 | |||
790 | err = request_irq(dev->irq, mv643xx_eth_int_handler, | 796 | err = request_irq(dev->irq, mv643xx_eth_int_handler, |
791 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); | 797 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); |
792 | if (err) { | 798 | if (err) { |
@@ -875,10 +881,6 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
875 | 881 | ||
876 | mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */ | 882 | mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */ |
877 | 883 | ||
878 | /* Clear any pending ethernet port interrupts */ | ||
879 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); | ||
880 | mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); | ||
881 | |||
882 | eth_port_start(dev); | 884 | eth_port_start(dev); |
883 | 885 | ||
884 | /* Interrupt Coalescing */ | 886 | /* Interrupt Coalescing */ |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b05dc6ed7fb7..ac02b3b60f92 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -181,6 +181,7 @@ struct myri10ge_priv { | |||
181 | int intr_coal_delay; | 181 | int intr_coal_delay; |
182 | __be32 __iomem *intr_coal_delay_ptr; | 182 | __be32 __iomem *intr_coal_delay_ptr; |
183 | int mtrr; | 183 | int mtrr; |
184 | int wc_enabled; | ||
184 | int wake_queue; | 185 | int wake_queue; |
185 | int stop_queue; | 186 | int stop_queue; |
186 | int down_cnt; | 187 | int down_cnt; |
@@ -717,6 +718,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp) | |||
717 | int status; | 718 | int status; |
718 | size_t bytes; | 719 | size_t bytes; |
719 | u32 len; | 720 | u32 len; |
721 | struct page *dmatest_page; | ||
722 | dma_addr_t dmatest_bus; | ||
720 | 723 | ||
721 | /* try to send a reset command to the card to see if it | 724 | /* try to send a reset command to the card to see if it |
722 | * is alive */ | 725 | * is alive */ |
@@ -726,6 +729,11 @@ static int myri10ge_reset(struct myri10ge_priv *mgp) | |||
726 | dev_err(&mgp->pdev->dev, "failed reset\n"); | 729 | dev_err(&mgp->pdev->dev, "failed reset\n"); |
727 | return -ENXIO; | 730 | return -ENXIO; |
728 | } | 731 | } |
732 | dmatest_page = alloc_page(GFP_KERNEL); | ||
733 | if (!dmatest_page) | ||
734 | return -ENOMEM; | ||
735 | dmatest_bus = pci_map_page(mgp->pdev, dmatest_page, 0, PAGE_SIZE, | ||
736 | DMA_BIDIRECTIONAL); | ||
729 | 737 | ||
730 | /* Now exchange information about interrupts */ | 738 | /* Now exchange information about interrupts */ |
731 | 739 | ||
@@ -764,8 +772,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp) | |||
764 | 772 | ||
765 | len = mgp->tx.boundary; | 773 | len = mgp->tx.boundary; |
766 | 774 | ||
767 | cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); | 775 | cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus); |
768 | cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); | 776 | cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus); |
769 | cmd.data2 = len * 0x10000; | 777 | cmd.data2 = len * 0x10000; |
770 | status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); | 778 | status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); |
771 | if (status == 0) | 779 | if (status == 0) |
@@ -774,8 +782,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp) | |||
774 | else | 782 | else |
775 | dev_warn(&mgp->pdev->dev, "DMA read benchmark failed: %d\n", | 783 | dev_warn(&mgp->pdev->dev, "DMA read benchmark failed: %d\n", |
776 | status); | 784 | status); |
777 | cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); | 785 | cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus); |
778 | cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); | 786 | cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus); |
779 | cmd.data2 = len * 0x1; | 787 | cmd.data2 = len * 0x1; |
780 | status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); | 788 | status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); |
781 | if (status == 0) | 789 | if (status == 0) |
@@ -785,8 +793,8 @@ static int myri10ge_reset(struct myri10ge_priv *mgp) | |||
785 | dev_warn(&mgp->pdev->dev, "DMA write benchmark failed: %d\n", | 793 | dev_warn(&mgp->pdev->dev, "DMA write benchmark failed: %d\n", |
786 | status); | 794 | status); |
787 | 795 | ||
788 | cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); | 796 | cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus); |
789 | cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); | 797 | cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus); |
790 | cmd.data2 = len * 0x10001; | 798 | cmd.data2 = len * 0x10001; |
791 | status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); | 799 | status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); |
792 | if (status == 0) | 800 | if (status == 0) |
@@ -796,6 +804,9 @@ static int myri10ge_reset(struct myri10ge_priv *mgp) | |||
796 | dev_warn(&mgp->pdev->dev, | 804 | dev_warn(&mgp->pdev->dev, |
797 | "DMA read/write benchmark failed: %d\n", status); | 805 | "DMA read/write benchmark failed: %d\n", status); |
798 | 806 | ||
807 | pci_unmap_page(mgp->pdev, dmatest_bus, PAGE_SIZE, DMA_BIDIRECTIONAL); | ||
808 | put_page(dmatest_page); | ||
809 | |||
799 | memset(mgp->rx_done.entry, 0, bytes); | 810 | memset(mgp->rx_done.entry, 0, bytes); |
800 | 811 | ||
801 | /* reset mcp/driver shared state back to 0 */ | 812 | /* reset mcp/driver shared state back to 0 */ |
@@ -1375,7 +1386,7 @@ myri10ge_get_ethtool_stats(struct net_device *netdev, | |||
1375 | data[i] = ((unsigned long *)&mgp->stats)[i]; | 1386 | data[i] = ((unsigned long *)&mgp->stats)[i]; |
1376 | 1387 | ||
1377 | data[i++] = (unsigned int)mgp->tx.boundary; | 1388 | data[i++] = (unsigned int)mgp->tx.boundary; |
1378 | data[i++] = (unsigned int)(mgp->mtrr >= 0); | 1389 | data[i++] = (unsigned int)mgp->wc_enabled; |
1379 | data[i++] = (unsigned int)mgp->pdev->irq; | 1390 | data[i++] = (unsigned int)mgp->pdev->irq; |
1380 | data[i++] = (unsigned int)mgp->msi_enabled; | 1391 | data[i++] = (unsigned int)mgp->msi_enabled; |
1381 | data[i++] = (unsigned int)mgp->read_dma; | 1392 | data[i++] = (unsigned int)mgp->read_dma; |
@@ -1456,6 +1467,8 @@ static int myri10ge_allocate_rings(struct net_device *dev) | |||
1456 | status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_RING_SIZE, &cmd, 0); | 1467 | status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_RING_SIZE, &cmd, 0); |
1457 | tx_ring_size = cmd.data0; | 1468 | tx_ring_size = cmd.data0; |
1458 | status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0); | 1469 | status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0); |
1470 | if (status != 0) | ||
1471 | return status; | ||
1459 | rx_ring_size = cmd.data0; | 1472 | rx_ring_size = cmd.data0; |
1460 | 1473 | ||
1461 | tx_ring_entries = tx_ring_size / sizeof(struct mcp_kreq_ether_send); | 1474 | tx_ring_entries = tx_ring_size / sizeof(struct mcp_kreq_ether_send); |
@@ -1463,6 +1476,8 @@ static int myri10ge_allocate_rings(struct net_device *dev) | |||
1463 | mgp->tx.mask = tx_ring_entries - 1; | 1476 | mgp->tx.mask = tx_ring_entries - 1; |
1464 | mgp->rx_small.mask = mgp->rx_big.mask = rx_ring_entries - 1; | 1477 | mgp->rx_small.mask = mgp->rx_big.mask = rx_ring_entries - 1; |
1465 | 1478 | ||
1479 | status = -ENOMEM; | ||
1480 | |||
1466 | /* allocate the host shadow rings */ | 1481 | /* allocate the host shadow rings */ |
1467 | 1482 | ||
1468 | bytes = 8 + (MYRI10GE_MAX_SEND_DESC_TSO + 4) | 1483 | bytes = 8 + (MYRI10GE_MAX_SEND_DESC_TSO + 4) |
@@ -1735,7 +1750,7 @@ static int myri10ge_open(struct net_device *dev) | |||
1735 | goto abort_with_irq; | 1750 | goto abort_with_irq; |
1736 | } | 1751 | } |
1737 | 1752 | ||
1738 | if (myri10ge_wcfifo && mgp->mtrr >= 0) { | 1753 | if (myri10ge_wcfifo && mgp->wc_enabled) { |
1739 | mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; | 1754 | mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; |
1740 | mgp->rx_small.wc_fifo = | 1755 | mgp->rx_small.wc_fifo = |
1741 | (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; | 1756 | (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; |
@@ -2510,6 +2525,12 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp) | |||
2510 | bridge->vendor, bridge->device); | 2525 | bridge->vendor, bridge->device); |
2511 | mgp->tx.boundary = 4096; | 2526 | mgp->tx.boundary = 4096; |
2512 | mgp->fw_name = myri10ge_fw_aligned; | 2527 | mgp->fw_name = myri10ge_fw_aligned; |
2528 | } else if (bridge && | ||
2529 | bridge->vendor == PCI_VENDOR_ID_SGI && | ||
2530 | bridge->device == 0x4002 /* TIOCE pcie-port */ ) { | ||
2531 | /* this pcie bridge does not support 4K rdma request */ | ||
2532 | mgp->tx.boundary = 2048; | ||
2533 | mgp->fw_name = myri10ge_fw_aligned; | ||
2513 | } | 2534 | } |
2514 | } else { | 2535 | } else { |
2515 | if (myri10ge_force_firmware == 1) { | 2536 | if (myri10ge_force_firmware == 1) { |
@@ -2830,9 +2851,12 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2830 | mgp->board_span = pci_resource_len(pdev, 0); | 2851 | mgp->board_span = pci_resource_len(pdev, 0); |
2831 | mgp->iomem_base = pci_resource_start(pdev, 0); | 2852 | mgp->iomem_base = pci_resource_start(pdev, 0); |
2832 | mgp->mtrr = -1; | 2853 | mgp->mtrr = -1; |
2854 | mgp->wc_enabled = 0; | ||
2833 | #ifdef CONFIG_MTRR | 2855 | #ifdef CONFIG_MTRR |
2834 | mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span, | 2856 | mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span, |
2835 | MTRR_TYPE_WRCOMB, 1); | 2857 | MTRR_TYPE_WRCOMB, 1); |
2858 | if (mgp->mtrr >= 0) | ||
2859 | mgp->wc_enabled = 1; | ||
2836 | #endif | 2860 | #endif |
2837 | /* Hack. need to get rid of these magic numbers */ | 2861 | /* Hack. need to get rid of these magic numbers */ |
2838 | mgp->sram_size = | 2862 | mgp->sram_size = |
@@ -2927,7 +2951,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2927 | dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", | 2951 | dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", |
2928 | (mgp->msi_enabled ? "MSI" : "xPIC"), | 2952 | (mgp->msi_enabled ? "MSI" : "xPIC"), |
2929 | netdev->irq, mgp->tx.boundary, mgp->fw_name, | 2953 | netdev->irq, mgp->tx.boundary, mgp->fw_name, |
2930 | (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); | 2954 | (mgp->wc_enabled ? "Enabled" : "Disabled")); |
2931 | 2955 | ||
2932 | return 0; | 2956 | return 0; |
2933 | 2957 | ||
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index c6172a77a6d7..349b96a3ec4c 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -1712,7 +1712,7 @@ static void init_registers(struct net_device *dev) | |||
1712 | 1712 | ||
1713 | /* Enable interrupts by setting the interrupt mask. */ | 1713 | /* Enable interrupts by setting the interrupt mask. */ |
1714 | writel(DEFAULT_INTR, ioaddr + IntrMask); | 1714 | writel(DEFAULT_INTR, ioaddr + IntrMask); |
1715 | writel(1, ioaddr + IntrEnable); | 1715 | natsemi_irq_enable(dev); |
1716 | 1716 | ||
1717 | writel(RxOn | TxOn, ioaddr + ChipCmd); | 1717 | writel(RxOn | TxOn, ioaddr + ChipCmd); |
1718 | writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */ | 1718 | writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */ |
@@ -2119,28 +2119,35 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
2119 | struct netdev_private *np = netdev_priv(dev); | 2119 | struct netdev_private *np = netdev_priv(dev); |
2120 | void __iomem * ioaddr = ns_ioaddr(dev); | 2120 | void __iomem * ioaddr = ns_ioaddr(dev); |
2121 | 2121 | ||
2122 | if (np->hands_off) | 2122 | /* Reading IntrStatus automatically acknowledges so don't do |
2123 | * that while interrupts are disabled, (for example, while a | ||
2124 | * poll is scheduled). */ | ||
2125 | if (np->hands_off || !readl(ioaddr + IntrEnable)) | ||
2123 | return IRQ_NONE; | 2126 | return IRQ_NONE; |
2124 | 2127 | ||
2125 | /* Reading automatically acknowledges. */ | ||
2126 | np->intr_status = readl(ioaddr + IntrStatus); | 2128 | np->intr_status = readl(ioaddr + IntrStatus); |
2127 | 2129 | ||
2130 | if (!np->intr_status) | ||
2131 | return IRQ_NONE; | ||
2132 | |||
2128 | if (netif_msg_intr(np)) | 2133 | if (netif_msg_intr(np)) |
2129 | printk(KERN_DEBUG | 2134 | printk(KERN_DEBUG |
2130 | "%s: Interrupt, status %#08x, mask %#08x.\n", | 2135 | "%s: Interrupt, status %#08x, mask %#08x.\n", |
2131 | dev->name, np->intr_status, | 2136 | dev->name, np->intr_status, |
2132 | readl(ioaddr + IntrMask)); | 2137 | readl(ioaddr + IntrMask)); |
2133 | 2138 | ||
2134 | if (!np->intr_status) | ||
2135 | return IRQ_NONE; | ||
2136 | |||
2137 | prefetch(&np->rx_skbuff[np->cur_rx % RX_RING_SIZE]); | 2139 | prefetch(&np->rx_skbuff[np->cur_rx % RX_RING_SIZE]); |
2138 | 2140 | ||
2139 | if (netif_rx_schedule_prep(dev)) { | 2141 | if (netif_rx_schedule_prep(dev)) { |
2140 | /* Disable interrupts and register for poll */ | 2142 | /* Disable interrupts and register for poll */ |
2141 | natsemi_irq_disable(dev); | 2143 | natsemi_irq_disable(dev); |
2142 | __netif_rx_schedule(dev); | 2144 | __netif_rx_schedule(dev); |
2143 | } | 2145 | } else |
2146 | printk(KERN_WARNING | ||
2147 | "%s: Ignoring interrupt, status %#08x, mask %#08x.\n", | ||
2148 | dev->name, np->intr_status, | ||
2149 | readl(ioaddr + IntrMask)); | ||
2150 | |||
2144 | return IRQ_HANDLED; | 2151 | return IRQ_HANDLED; |
2145 | } | 2152 | } |
2146 | 2153 | ||
@@ -2156,6 +2163,20 @@ static int natsemi_poll(struct net_device *dev, int *budget) | |||
2156 | int work_done = 0; | 2163 | int work_done = 0; |
2157 | 2164 | ||
2158 | do { | 2165 | do { |
2166 | if (netif_msg_intr(np)) | ||
2167 | printk(KERN_DEBUG | ||
2168 | "%s: Poll, status %#08x, mask %#08x.\n", | ||
2169 | dev->name, np->intr_status, | ||
2170 | readl(ioaddr + IntrMask)); | ||
2171 | |||
2172 | /* netdev_rx() may read IntrStatus again if the RX state | ||
2173 | * machine falls over so do it first. */ | ||
2174 | if (np->intr_status & | ||
2175 | (IntrRxDone | IntrRxIntr | RxStatusFIFOOver | | ||
2176 | IntrRxErr | IntrRxOverrun)) { | ||
2177 | netdev_rx(dev, &work_done, work_to_do); | ||
2178 | } | ||
2179 | |||
2159 | if (np->intr_status & | 2180 | if (np->intr_status & |
2160 | (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) { | 2181 | (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) { |
2161 | spin_lock(&np->lock); | 2182 | spin_lock(&np->lock); |
@@ -2167,12 +2188,6 @@ static int natsemi_poll(struct net_device *dev, int *budget) | |||
2167 | if (np->intr_status & IntrAbnormalSummary) | 2188 | if (np->intr_status & IntrAbnormalSummary) |
2168 | netdev_error(dev, np->intr_status); | 2189 | netdev_error(dev, np->intr_status); |
2169 | 2190 | ||
2170 | if (np->intr_status & | ||
2171 | (IntrRxDone | IntrRxIntr | RxStatusFIFOOver | | ||
2172 | IntrRxErr | IntrRxOverrun)) { | ||
2173 | netdev_rx(dev, &work_done, work_to_do); | ||
2174 | } | ||
2175 | |||
2176 | *budget -= work_done; | 2191 | *budget -= work_done; |
2177 | dev->quota -= work_done; | 2192 | dev->quota -= work_done; |
2178 | 2193 | ||
@@ -2399,19 +2414,8 @@ static struct net_device_stats *get_stats(struct net_device *dev) | |||
2399 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2414 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2400 | static void natsemi_poll_controller(struct net_device *dev) | 2415 | static void natsemi_poll_controller(struct net_device *dev) |
2401 | { | 2416 | { |
2402 | struct netdev_private *np = netdev_priv(dev); | ||
2403 | |||
2404 | disable_irq(dev->irq); | 2417 | disable_irq(dev->irq); |
2405 | 2418 | intr_handler(dev->irq, dev); | |
2406 | /* | ||
2407 | * A real interrupt might have already reached us at this point | ||
2408 | * but NAPI might still haven't called us back. As the interrupt | ||
2409 | * status register is cleared by reading, we should prevent an | ||
2410 | * interrupt loss in this case... | ||
2411 | */ | ||
2412 | if (!np->intr_status) | ||
2413 | intr_handler(dev->irq, dev); | ||
2414 | |||
2415 | enable_irq(dev->irq); | 2419 | enable_irq(dev->irq); |
2416 | } | 2420 | } |
2417 | #endif | 2421 | #endif |
@@ -3071,7 +3075,7 @@ static void enable_wol_mode(struct net_device *dev, int enable_intr) | |||
3071 | * Could be used to send a netlink message. | 3075 | * Could be used to send a netlink message. |
3072 | */ | 3076 | */ |
3073 | writel(WOLPkt | LinkChange, ioaddr + IntrMask); | 3077 | writel(WOLPkt | LinkChange, ioaddr + IntrMask); |
3074 | writel(1, ioaddr + IntrEnable); | 3078 | natsemi_irq_enable(dev); |
3075 | } | 3079 | } |
3076 | } | 3080 | } |
3077 | 3081 | ||
@@ -3202,7 +3206,7 @@ static int natsemi_suspend (struct pci_dev *pdev, pm_message_t state) | |||
3202 | disable_irq(dev->irq); | 3206 | disable_irq(dev->irq); |
3203 | spin_lock_irq(&np->lock); | 3207 | spin_lock_irq(&np->lock); |
3204 | 3208 | ||
3205 | writel(0, ioaddr + IntrEnable); | 3209 | natsemi_irq_disable(dev); |
3206 | np->hands_off = 1; | 3210 | np->hands_off = 1; |
3207 | natsemi_stop_rxtx(dev); | 3211 | natsemi_stop_rxtx(dev); |
3208 | netif_stop_queue(dev); | 3212 | netif_stop_queue(dev); |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 81742e4e5610..dd8ce35332fe 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -232,6 +232,7 @@ enum { | |||
232 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 | 232 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 |
233 | 233 | ||
234 | extern unsigned long long netxen_dma_mask; | 234 | extern unsigned long long netxen_dma_mask; |
235 | extern unsigned long last_schedule_time; | ||
235 | 236 | ||
236 | /* | 237 | /* |
237 | * NetXen host-peg signal message structure | 238 | * NetXen host-peg signal message structure |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 986ef98db229..ee1b5a24cbe7 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -462,6 +462,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, | |||
462 | } | 462 | } |
463 | printk(KERN_INFO "%s: flash unlocked. \n", | 463 | printk(KERN_INFO "%s: flash unlocked. \n", |
464 | netxen_nic_driver_name); | 464 | netxen_nic_driver_name); |
465 | last_schedule_time = jiffies; | ||
465 | ret = netxen_flash_erase_secondary(adapter); | 466 | ret = netxen_flash_erase_secondary(adapter); |
466 | if (ret != FLASH_SUCCESS) { | 467 | if (ret != FLASH_SUCCESS) { |
467 | printk(KERN_ERR "%s: Flash erase failed.\n", | 468 | printk(KERN_ERR "%s: Flash erase failed.\n", |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index a2877f33fa85..6537574a9cda 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -228,7 +228,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
228 | &adapter->ctx_desc_pdev); | 228 | &adapter->ctx_desc_pdev); |
229 | 229 | ||
230 | printk("ctx_desc_phys_addr: 0x%llx\n", | 230 | printk("ctx_desc_phys_addr: 0x%llx\n", |
231 | (u64) adapter->ctx_desc_phys_addr); | 231 | (unsigned long long) adapter->ctx_desc_phys_addr); |
232 | if (addr == NULL) { | 232 | if (addr == NULL) { |
233 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); | 233 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); |
234 | err = -ENOMEM; | 234 | err = -ENOMEM; |
@@ -247,7 +247,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
247 | adapter->max_tx_desc_count, | 247 | adapter->max_tx_desc_count, |
248 | (dma_addr_t *) & hw->cmd_desc_phys_addr, | 248 | (dma_addr_t *) & hw->cmd_desc_phys_addr, |
249 | &adapter->ahw.cmd_desc_pdev); | 249 | &adapter->ahw.cmd_desc_pdev); |
250 | printk("cmd_desc_phys_addr: 0x%llx\n", (u64) hw->cmd_desc_phys_addr); | 250 | printk("cmd_desc_phys_addr: 0x%llx\n", |
251 | (unsigned long long) hw->cmd_desc_phys_addr); | ||
251 | 252 | ||
252 | if (addr == NULL) { | 253 | if (addr == NULL) { |
253 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); | 254 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); |
@@ -821,7 +822,10 @@ int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu) | |||
821 | { | 822 | { |
822 | struct netxen_adapter *adapter = port->adapter; | 823 | struct netxen_adapter *adapter = port->adapter; |
823 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; | 824 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; |
824 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, new_mtu); | 825 | if (port->portnum == 0) |
826 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, new_mtu); | ||
827 | else if (port->portnum == 1) | ||
828 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, new_mtu); | ||
825 | return 0; | 829 | return 0; |
826 | } | 830 | } |
827 | 831 | ||
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 586d32b676af..229aa1c4fb79 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -42,6 +42,8 @@ struct crb_addr_pair { | |||
42 | u32 data; | 42 | u32 data; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | unsigned long last_schedule_time; | ||
46 | |||
45 | #define NETXEN_MAX_CRB_XFORM 60 | 47 | #define NETXEN_MAX_CRB_XFORM 60 |
46 | static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; | 48 | static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; |
47 | #define NETXEN_ADDR_ERROR (0xffffffff) | 49 | #define NETXEN_ADDR_ERROR (0xffffffff) |
@@ -404,9 +406,14 @@ static inline int do_rom_fast_write(struct netxen_adapter *adapter, int addr, | |||
404 | static inline int | 406 | static inline int |
405 | do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | 407 | do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) |
406 | { | 408 | { |
409 | if (jiffies > (last_schedule_time + (8 * HZ))) { | ||
410 | last_schedule_time = jiffies; | ||
411 | schedule(); | ||
412 | } | ||
413 | |||
407 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); | 414 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); |
408 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); | 415 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); |
409 | udelay(70); /* prevent bursting on CRB */ | 416 | udelay(100); /* prevent bursting on CRB */ |
410 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 417 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
411 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); | 418 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); |
412 | if (netxen_wait_rom_done(adapter)) { | 419 | if (netxen_wait_rom_done(adapter)) { |
@@ -415,7 +422,7 @@ do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | |||
415 | } | 422 | } |
416 | /* reset abyte_cnt and dummy_byte_cnt */ | 423 | /* reset abyte_cnt and dummy_byte_cnt */ |
417 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); | 424 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); |
418 | udelay(70); /* prevent bursting on CRB */ | 425 | udelay(100); /* prevent bursting on CRB */ |
419 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 426 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
420 | 427 | ||
421 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); | 428 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index a956a51d284f..1060154ae750 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -138,7 +138,7 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
138 | 138 | ||
139 | ======================================================================*/ | 139 | ======================================================================*/ |
140 | 140 | ||
141 | static int ibmtr_attach(struct pcmcia_device *link) | 141 | static int __devinit ibmtr_attach(struct pcmcia_device *link) |
142 | { | 142 | { |
143 | ibmtr_dev_t *info; | 143 | ibmtr_dev_t *info; |
144 | struct net_device *dev; | 144 | struct net_device *dev; |
@@ -217,7 +217,7 @@ static void ibmtr_detach(struct pcmcia_device *link) | |||
217 | #define CS_CHECK(fn, ret) \ | 217 | #define CS_CHECK(fn, ret) \ |
218 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 218 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
219 | 219 | ||
220 | static int ibmtr_config(struct pcmcia_device *link) | 220 | static int __devinit ibmtr_config(struct pcmcia_device *link) |
221 | { | 221 | { |
222 | ibmtr_dev_t *info = link->priv; | 222 | ibmtr_dev_t *info = link->priv; |
223 | struct net_device *dev = info->dev; | 223 | struct net_device *dev = info->dev; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 15d954e50cae..521b5f0618a4 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -572,8 +572,8 @@ static void rtl8169_xmii_reset_enable(void __iomem *ioaddr) | |||
572 | { | 572 | { |
573 | unsigned int val; | 573 | unsigned int val; |
574 | 574 | ||
575 | mdio_write(ioaddr, MII_BMCR, BMCR_RESET); | 575 | val = mdio_read(ioaddr, MII_BMCR) | BMCR_RESET; |
576 | val = mdio_read(ioaddr, MII_BMCR); | 576 | mdio_write(ioaddr, MII_BMCR, val & 0xffff); |
577 | } | 577 | } |
578 | 578 | ||
579 | static void rtl8169_check_link_status(struct net_device *dev, | 579 | static void rtl8169_check_link_status(struct net_device *dev, |
@@ -1368,11 +1368,7 @@ static inline void rtl8169_request_timer(struct net_device *dev) | |||
1368 | (tp->phy_version >= RTL_GIGA_PHY_VER_H)) | 1368 | (tp->phy_version >= RTL_GIGA_PHY_VER_H)) |
1369 | return; | 1369 | return; |
1370 | 1370 | ||
1371 | init_timer(timer); | 1371 | mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT); |
1372 | timer->expires = jiffies + RTL8169_PHY_TIMEOUT; | ||
1373 | timer->data = (unsigned long)(dev); | ||
1374 | timer->function = rtl8169_phy_timer; | ||
1375 | add_timer(timer); | ||
1376 | } | 1372 | } |
1377 | 1373 | ||
1378 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1374 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -1685,6 +1681,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1685 | tp->mmio_addr = ioaddr; | 1681 | tp->mmio_addr = ioaddr; |
1686 | tp->align = rtl_cfg_info[ent->driver_data].align; | 1682 | tp->align = rtl_cfg_info[ent->driver_data].align; |
1687 | 1683 | ||
1684 | init_timer(&tp->timer); | ||
1685 | tp->timer.data = (unsigned long) dev; | ||
1686 | tp->timer.function = rtl8169_phy_timer; | ||
1687 | |||
1688 | spin_lock_init(&tp->lock); | 1688 | spin_lock_init(&tp->lock); |
1689 | 1689 | ||
1690 | rc = register_netdev(dev); | 1690 | rc = register_netdev(dev); |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index eea75a401b0c..8fecf1b817f7 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -3275,24 +3275,30 @@ static int skge_set_mac_address(struct net_device *dev, void *p) | |||
3275 | struct skge_hw *hw = skge->hw; | 3275 | struct skge_hw *hw = skge->hw; |
3276 | unsigned port = skge->port; | 3276 | unsigned port = skge->port; |
3277 | const struct sockaddr *addr = p; | 3277 | const struct sockaddr *addr = p; |
3278 | u16 ctrl; | ||
3278 | 3279 | ||
3279 | if (!is_valid_ether_addr(addr->sa_data)) | 3280 | if (!is_valid_ether_addr(addr->sa_data)) |
3280 | return -EADDRNOTAVAIL; | 3281 | return -EADDRNOTAVAIL; |
3281 | 3282 | ||
3282 | mutex_lock(&hw->phy_mutex); | ||
3283 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 3283 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); |
3284 | memcpy_toio(hw->regs + B2_MAC_1 + port*8, | ||
3285 | dev->dev_addr, ETH_ALEN); | ||
3286 | memcpy_toio(hw->regs + B2_MAC_2 + port*8, | ||
3287 | dev->dev_addr, ETH_ALEN); | ||
3288 | 3284 | ||
3289 | if (hw->chip_id == CHIP_ID_GENESIS) | 3285 | /* disable Rx */ |
3290 | xm_outaddr(hw, port, XM_SA, dev->dev_addr); | 3286 | ctrl = gma_read16(hw, port, GM_GP_CTRL); |
3291 | else { | 3287 | gma_write16(hw, port, GM_GP_CTRL, ctrl & ~GM_GPCR_RX_ENA); |
3292 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); | 3288 | |
3293 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); | 3289 | memcpy_toio(hw->regs + B2_MAC_1 + port*8, dev->dev_addr, ETH_ALEN); |
3290 | memcpy_toio(hw->regs + B2_MAC_2 + port*8, dev->dev_addr, ETH_ALEN); | ||
3291 | |||
3292 | if (netif_running(dev)) { | ||
3293 | if (hw->chip_id == CHIP_ID_GENESIS) | ||
3294 | xm_outaddr(hw, port, XM_SA, dev->dev_addr); | ||
3295 | else { | ||
3296 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); | ||
3297 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); | ||
3298 | } | ||
3294 | } | 3299 | } |
3295 | mutex_unlock(&hw->phy_mutex); | 3300 | |
3301 | gma_write16(hw, port, GM_GP_CTRL, ctrl); | ||
3296 | 3302 | ||
3297 | return 0; | 3303 | return 0; |
3298 | } | 3304 | } |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 53839979cfb8..ab0ab92583fe 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -2165,9 +2165,27 @@ force_update: | |||
2165 | /* fall through */ | 2165 | /* fall through */ |
2166 | #endif | 2166 | #endif |
2167 | case OP_RXCHKS: | 2167 | case OP_RXCHKS: |
2168 | skb = sky2->rx_ring[sky2->rx_next].skb; | 2168 | if (!sky2->rx_csum) |
2169 | skb->ip_summed = CHECKSUM_COMPLETE; | 2169 | break; |
2170 | skb->csum = status & 0xffff; | 2170 | |
2171 | /* Both checksum counters are programmed to start at | ||
2172 | * the same offset, so unless there is a problem they | ||
2173 | * should match. This failure is an early indication that | ||
2174 | * hardware receive checksumming won't work. | ||
2175 | */ | ||
2176 | if (likely(status >> 16 == (status & 0xffff))) { | ||
2177 | skb = sky2->rx_ring[sky2->rx_next].skb; | ||
2178 | skb->ip_summed = CHECKSUM_COMPLETE; | ||
2179 | skb->csum = status & 0xffff; | ||
2180 | } else { | ||
2181 | printk(KERN_NOTICE PFX "%s: hardware receive " | ||
2182 | "checksum problem (status = %#x)\n", | ||
2183 | dev->name, status); | ||
2184 | sky2->rx_csum = 0; | ||
2185 | sky2_write32(sky2->hw, | ||
2186 | Q_ADDR(rxqaddr[le->link], Q_CSR), | ||
2187 | BMU_DIS_RX_CHKSUM); | ||
2188 | } | ||
2171 | break; | 2189 | break; |
2172 | 2190 | ||
2173 | case OP_TXINDEXLE: | 2191 | case OP_TXINDEXLE: |
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index 0d97e10ccac5..01d55315ee8c 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -186,7 +186,6 @@ static char __devinit *adapter_def(char type) | |||
186 | #define TRC_INITV 0x02 /* verbose init trace points */ | 186 | #define TRC_INITV 0x02 /* verbose init trace points */ |
187 | static unsigned char ibmtr_debug_trace = 0; | 187 | static unsigned char ibmtr_debug_trace = 0; |
188 | 188 | ||
189 | static int ibmtr_probe(struct net_device *dev); | ||
190 | static int ibmtr_probe1(struct net_device *dev, int ioaddr); | 189 | static int ibmtr_probe1(struct net_device *dev, int ioaddr); |
191 | static unsigned char get_sram_size(struct tok_info *adapt_info); | 190 | static unsigned char get_sram_size(struct tok_info *adapt_info); |
192 | static int trdev_init(struct net_device *dev); | 191 | static int trdev_init(struct net_device *dev); |
@@ -335,17 +334,6 @@ static void ibmtr_cleanup_card(struct net_device *dev) | |||
335 | #endif | 334 | #endif |
336 | } | 335 | } |
337 | 336 | ||
338 | int ibmtr_probe_card(struct net_device *dev) | ||
339 | { | ||
340 | int err = ibmtr_probe(dev); | ||
341 | if (!err) { | ||
342 | err = register_netdev(dev); | ||
343 | if (err) | ||
344 | ibmtr_cleanup_card(dev); | ||
345 | } | ||
346 | return err; | ||
347 | } | ||
348 | |||
349 | /**************************************************************************** | 337 | /**************************************************************************** |
350 | * ibmtr_probe(): Routine specified in the network device structure | 338 | * ibmtr_probe(): Routine specified in the network device structure |
351 | * to probe for an IBM Token Ring Adapter. Routine outline: | 339 | * to probe for an IBM Token Ring Adapter. Routine outline: |
@@ -358,7 +346,7 @@ int ibmtr_probe_card(struct net_device *dev) | |||
358 | * which references it. | 346 | * which references it. |
359 | ****************************************************************************/ | 347 | ****************************************************************************/ |
360 | 348 | ||
361 | static int ibmtr_probe(struct net_device *dev) | 349 | static int __devinit ibmtr_probe(struct net_device *dev) |
362 | { | 350 | { |
363 | int i; | 351 | int i; |
364 | int base_addr = dev->base_addr; | 352 | int base_addr = dev->base_addr; |
@@ -378,6 +366,17 @@ static int ibmtr_probe(struct net_device *dev) | |||
378 | return -ENODEV; | 366 | return -ENODEV; |
379 | } | 367 | } |
380 | 368 | ||
369 | int __devinit ibmtr_probe_card(struct net_device *dev) | ||
370 | { | ||
371 | int err = ibmtr_probe(dev); | ||
372 | if (!err) { | ||
373 | err = register_netdev(dev); | ||
374 | if (err) | ||
375 | ibmtr_cleanup_card(dev); | ||
376 | } | ||
377 | return err; | ||
378 | } | ||
379 | |||
381 | /*****************************************************************************/ | 380 | /*****************************************************************************/ |
382 | 381 | ||
383 | static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | 382 | static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 24a29c99ba94..9aeac76184f3 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -190,13 +190,13 @@ | |||
190 | 190 | ||
191 | /* Structure/enum declaration ------------------------------- */ | 191 | /* Structure/enum declaration ------------------------------- */ |
192 | struct tx_desc { | 192 | struct tx_desc { |
193 | u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */ | 193 | __le32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */ |
194 | char *tx_buf_ptr; /* Data for us */ | 194 | char *tx_buf_ptr; /* Data for us */ |
195 | struct tx_desc *next_tx_desc; | 195 | struct tx_desc *next_tx_desc; |
196 | } __attribute__(( aligned(32) )); | 196 | } __attribute__(( aligned(32) )); |
197 | 197 | ||
198 | struct rx_desc { | 198 | struct rx_desc { |
199 | u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */ | 199 | __le32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */ |
200 | struct sk_buff *rx_skb_ptr; /* Data for us */ | 200 | struct sk_buff *rx_skb_ptr; /* Data for us */ |
201 | struct rx_desc *next_rx_desc; | 201 | struct rx_desc *next_rx_desc; |
202 | } __attribute__(( aligned(32) )); | 202 | } __attribute__(( aligned(32) )); |
@@ -458,7 +458,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
458 | 458 | ||
459 | /* read 64 word srom data */ | 459 | /* read 64 word srom data */ |
460 | for (i = 0; i < 64; i++) | 460 | for (i = 0; i < 64; i++) |
461 | ((u16 *) db->srom)[i] = | 461 | ((__le16 *) db->srom)[i] = |
462 | cpu_to_le16(read_srom_word(db->ioaddr, i)); | 462 | cpu_to_le16(read_srom_word(db->ioaddr, i)); |
463 | 463 | ||
464 | /* Set Node address */ | 464 | /* Set Node address */ |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index ebbda1d8f542..f3a972e74e9a 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -30,8 +30,8 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #define DRV_NAME "via-rhine" | 32 | #define DRV_NAME "via-rhine" |
33 | #define DRV_VERSION "1.4.2" | 33 | #define DRV_VERSION "1.4.3" |
34 | #define DRV_RELDATE "Sept-11-2006" | 34 | #define DRV_RELDATE "2007-03-06" |
35 | 35 | ||
36 | 36 | ||
37 | /* A few user-configurable values. | 37 | /* A few user-configurable values. |
@@ -105,6 +105,7 @@ static const int multicast_filter_limit = 32; | |||
105 | #include <asm/io.h> | 105 | #include <asm/io.h> |
106 | #include <asm/irq.h> | 106 | #include <asm/irq.h> |
107 | #include <asm/uaccess.h> | 107 | #include <asm/uaccess.h> |
108 | #include <linux/dmi.h> | ||
108 | 109 | ||
109 | /* These identify the driver base version and may not be removed. */ | 110 | /* These identify the driver base version and may not be removed. */ |
110 | static char version[] __devinitdata = | 111 | static char version[] __devinitdata = |
@@ -1995,6 +1996,23 @@ static struct pci_driver rhine_driver = { | |||
1995 | .shutdown = rhine_shutdown, | 1996 | .shutdown = rhine_shutdown, |
1996 | }; | 1997 | }; |
1997 | 1998 | ||
1999 | static struct dmi_system_id __initdata rhine_dmi_table[] = { | ||
2000 | { | ||
2001 | .ident = "EPIA-M", | ||
2002 | .matches = { | ||
2003 | DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."), | ||
2004 | DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"), | ||
2005 | }, | ||
2006 | }, | ||
2007 | { | ||
2008 | .ident = "KV7", | ||
2009 | .matches = { | ||
2010 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"), | ||
2011 | DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"), | ||
2012 | }, | ||
2013 | }, | ||
2014 | { NULL } | ||
2015 | }; | ||
1998 | 2016 | ||
1999 | static int __init rhine_init(void) | 2017 | static int __init rhine_init(void) |
2000 | { | 2018 | { |
@@ -2002,6 +2020,16 @@ static int __init rhine_init(void) | |||
2002 | #ifdef MODULE | 2020 | #ifdef MODULE |
2003 | printk(version); | 2021 | printk(version); |
2004 | #endif | 2022 | #endif |
2023 | if (dmi_check_system(rhine_dmi_table)) { | ||
2024 | /* these BIOSes fail at PXE boot if chip is in D3 */ | ||
2025 | avoid_D3 = 1; | ||
2026 | printk(KERN_WARNING "%s: Broken BIOS detected, avoid_D3 " | ||
2027 | "enabled.\n", | ||
2028 | DRV_NAME); | ||
2029 | } | ||
2030 | else if (avoid_D3) | ||
2031 | printk(KERN_INFO "%s: avoid_D3 set.\n", DRV_NAME); | ||
2032 | |||
2005 | return pci_register_driver(&rhine_driver); | 2033 | return pci_register_driver(&rhine_driver); |
2006 | } | 2034 | } |
2007 | 2035 | ||
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index 8dbcf83bb5f3..8b4540bfc1b0 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
@@ -407,7 +407,7 @@ static void z8530_tx(struct z8530_channel *c) | |||
407 | while(c->txcount) { | 407 | while(c->txcount) { |
408 | /* FIFO full ? */ | 408 | /* FIFO full ? */ |
409 | if(!(read_zsreg(c, R0)&4)) | 409 | if(!(read_zsreg(c, R0)&4)) |
410 | break; | 410 | return; |
411 | c->txcount--; | 411 | c->txcount--; |
412 | /* | 412 | /* |
413 | * Shovel out the byte | 413 | * Shovel out the byte |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index e594af46ff05..80cb88eb98c6 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -1858,9 +1858,6 @@ static irqreturn_t bcm43xx_interrupt_handler(int irq, void *dev_id) | |||
1858 | 1858 | ||
1859 | spin_lock(&bcm->irq_lock); | 1859 | spin_lock(&bcm->irq_lock); |
1860 | 1860 | ||
1861 | assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); | ||
1862 | assert(bcm->current_core->id == BCM43xx_COREID_80211); | ||
1863 | |||
1864 | reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); | 1861 | reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); |
1865 | if (reason == 0xffffffff) { | 1862 | if (reason == 0xffffffff) { |
1866 | /* irq not for us (shared irq) */ | 1863 | /* irq not for us (shared irq) */ |
@@ -1871,6 +1868,9 @@ static irqreturn_t bcm43xx_interrupt_handler(int irq, void *dev_id) | |||
1871 | if (!reason) | 1868 | if (!reason) |
1872 | goto out; | 1869 | goto out; |
1873 | 1870 | ||
1871 | assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); | ||
1872 | assert(bcm->current_core->id == BCM43xx_COREID_80211); | ||
1873 | |||
1874 | bcm->dma_reason[0] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA0_REASON) | 1874 | bcm->dma_reason[0] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA0_REASON) |
1875 | & 0x0001DC00; | 1875 | & 0x0001DC00; |
1876 | bcm->dma_reason[1] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA1_REASON) | 1876 | bcm->dma_reason[1] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA1_REASON) |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c index 3a5c9c2b2150..cae89258a640 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c | |||
@@ -859,6 +859,11 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm) | |||
859 | bcm43xx_radio_write16(bcm, 0x005D, 0x0088); | 859 | bcm43xx_radio_write16(bcm, 0x005D, 0x0088); |
860 | bcm43xx_radio_write16(bcm, 0x005E, 0x0088); | 860 | bcm43xx_radio_write16(bcm, 0x005E, 0x0088); |
861 | bcm43xx_radio_write16(bcm, 0x007D, 0x0088); | 861 | bcm43xx_radio_write16(bcm, 0x007D, 0x0088); |
862 | bcm43xx_shm_write32(bcm, BCM43xx_SHM_SHARED, | ||
863 | BCM43xx_UCODEFLAGS_OFFSET, | ||
864 | (bcm43xx_shm_read32(bcm, BCM43xx_SHM_SHARED, | ||
865 | BCM43xx_UCODEFLAGS_OFFSET) | ||
866 | | 0x00000200)); | ||
862 | } | 867 | } |
863 | if (radio->revision == 8) { | 868 | if (radio->revision == 8) { |
864 | bcm43xx_radio_write16(bcm, 0x0051, 0x0000); | 869 | bcm43xx_radio_write16(bcm, 0x0051, 0x0000); |
@@ -941,7 +946,8 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm) | |||
941 | bcm43xx_phy_write(bcm, 0x0038, 0x0668); | 946 | bcm43xx_phy_write(bcm, 0x0038, 0x0668); |
942 | bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); | 947 | bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); |
943 | if (radio->revision <= 5) | 948 | if (radio->revision <= 5) |
944 | bcm43xx_phy_write(bcm, 0x005D, bcm43xx_phy_read(bcm, 0x005D) | 0x0003); | 949 | bcm43xx_phy_write(bcm, 0x005D, (bcm43xx_phy_read(bcm, 0x005D) |
950 | & 0xFF80) | 0x0003); | ||
945 | if (radio->revision <= 2) | 951 | if (radio->revision <= 2) |
946 | bcm43xx_radio_write16(bcm, 0x005D, 0x000D); | 952 | bcm43xx_radio_write16(bcm, 0x005D, 0x000D); |
947 | 953 | ||
@@ -958,7 +964,7 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm) | |||
958 | bcm43xx_phy_write(bcm, 0x0016, 0x0410); | 964 | bcm43xx_phy_write(bcm, 0x0016, 0x0410); |
959 | bcm43xx_phy_write(bcm, 0x0017, 0x0820); | 965 | bcm43xx_phy_write(bcm, 0x0017, 0x0820); |
960 | bcm43xx_phy_write(bcm, 0x0062, 0x0007); | 966 | bcm43xx_phy_write(bcm, 0x0062, 0x0007); |
961 | (void) bcm43xx_radio_calibrationvalue(bcm); | 967 | bcm43xx_radio_init2050(bcm); |
962 | bcm43xx_phy_lo_g_measure(bcm); | 968 | bcm43xx_phy_lo_g_measure(bcm); |
963 | if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) { | 969 | if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) { |
964 | bcm43xx_calc_nrssi_slope(bcm); | 970 | bcm43xx_calc_nrssi_slope(bcm); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c index 7b665e2386a8..d6d9413d7f23 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c | |||
@@ -105,18 +105,24 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev, | |||
105 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); | 105 | struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); |
106 | unsigned long flags; | 106 | unsigned long flags; |
107 | u8 channel; | 107 | u8 channel; |
108 | s8 expon; | ||
108 | int freq; | 109 | int freq; |
109 | int err = -EINVAL; | 110 | int err = -EINVAL; |
110 | 111 | ||
111 | mutex_lock(&bcm->mutex); | 112 | mutex_lock(&bcm->mutex); |
112 | spin_lock_irqsave(&bcm->irq_lock, flags); | 113 | spin_lock_irqsave(&bcm->irq_lock, flags); |
113 | 114 | ||
114 | if ((data->freq.m >= 0) && (data->freq.m <= 1000)) { | 115 | if ((data->freq.e == 0) && |
116 | (data->freq.m >= 0) && (data->freq.m <= 1000)) { | ||
115 | channel = data->freq.m; | 117 | channel = data->freq.m; |
116 | freq = bcm43xx_channel_to_freq(bcm, channel); | 118 | freq = bcm43xx_channel_to_freq(bcm, channel); |
117 | } else { | 119 | } else { |
118 | channel = bcm43xx_freq_to_channel(bcm, data->freq.m); | ||
119 | freq = data->freq.m; | 120 | freq = data->freq.m; |
121 | expon = 6 - data->freq.e; | ||
122 | while (--expon >= 0) /* scale down the frequency to MHz */ | ||
123 | freq /= 10; | ||
124 | assert(freq > 1000); | ||
125 | channel = bcm43xx_freq_to_channel(bcm, freq); | ||
120 | } | 126 | } |
121 | if (!ieee80211_is_valid_channel(bcm->ieee, channel)) | 127 | if (!ieee80211_is_valid_channel(bcm->ieee, channel)) |
122 | goto out_unlock; | 128 | goto out_unlock; |
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 01869b1782e4..ad33e0159514 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -100,6 +100,7 @@ static void msi_set_mask_bit(unsigned int irq, int flag) | |||
100 | BUG(); | 100 | BUG(); |
101 | break; | 101 | break; |
102 | } | 102 | } |
103 | entry->msi_attrib.masked = !!flag; | ||
103 | } | 104 | } |
104 | 105 | ||
105 | void read_msi_msg(unsigned int irq, struct msi_msg *msg) | 106 | void read_msi_msg(unsigned int irq, struct msi_msg *msg) |
@@ -179,6 +180,7 @@ void write_msi_msg(unsigned int irq, struct msi_msg *msg) | |||
179 | default: | 180 | default: |
180 | BUG(); | 181 | BUG(); |
181 | } | 182 | } |
183 | entry->msg = *msg; | ||
182 | } | 184 | } |
183 | 185 | ||
184 | void mask_msi_irq(unsigned int irq) | 186 | void mask_msi_irq(unsigned int irq) |
@@ -225,164 +227,60 @@ static struct msi_desc* alloc_msi_entry(void) | |||
225 | } | 227 | } |
226 | 228 | ||
227 | #ifdef CONFIG_PM | 229 | #ifdef CONFIG_PM |
228 | static int __pci_save_msi_state(struct pci_dev *dev) | ||
229 | { | ||
230 | int pos, i = 0; | ||
231 | u16 control; | ||
232 | struct pci_cap_saved_state *save_state; | ||
233 | u32 *cap; | ||
234 | |||
235 | if (!dev->msi_enabled) | ||
236 | return 0; | ||
237 | |||
238 | pos = pci_find_capability(dev, PCI_CAP_ID_MSI); | ||
239 | if (pos <= 0) | ||
240 | return 0; | ||
241 | |||
242 | save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u32) * 5, | ||
243 | GFP_KERNEL); | ||
244 | if (!save_state) { | ||
245 | printk(KERN_ERR "Out of memory in pci_save_msi_state\n"); | ||
246 | return -ENOMEM; | ||
247 | } | ||
248 | cap = &save_state->data[0]; | ||
249 | |||
250 | pci_read_config_dword(dev, pos, &cap[i++]); | ||
251 | control = cap[0] >> 16; | ||
252 | pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, &cap[i++]); | ||
253 | if (control & PCI_MSI_FLAGS_64BIT) { | ||
254 | pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, &cap[i++]); | ||
255 | pci_read_config_dword(dev, pos + PCI_MSI_DATA_64, &cap[i++]); | ||
256 | } else | ||
257 | pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, &cap[i++]); | ||
258 | if (control & PCI_MSI_FLAGS_MASKBIT) | ||
259 | pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, &cap[i++]); | ||
260 | save_state->cap_nr = PCI_CAP_ID_MSI; | ||
261 | pci_add_saved_cap(dev, save_state); | ||
262 | return 0; | ||
263 | } | ||
264 | |||
265 | static void __pci_restore_msi_state(struct pci_dev *dev) | 230 | static void __pci_restore_msi_state(struct pci_dev *dev) |
266 | { | 231 | { |
267 | int i = 0, pos; | 232 | int pos; |
268 | u16 control; | 233 | u16 control; |
269 | struct pci_cap_saved_state *save_state; | 234 | struct msi_desc *entry; |
270 | u32 *cap; | ||
271 | 235 | ||
272 | if (!dev->msi_enabled) | 236 | if (!dev->msi_enabled) |
273 | return; | 237 | return; |
274 | 238 | ||
275 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSI); | 239 | entry = get_irq_msi(dev->irq); |
276 | pos = pci_find_capability(dev, PCI_CAP_ID_MSI); | 240 | pos = entry->msi_attrib.pos; |
277 | if (!save_state || pos <= 0) | ||
278 | return; | ||
279 | cap = &save_state->data[0]; | ||
280 | 241 | ||
281 | pci_intx(dev, 0); /* disable intx */ | 242 | pci_intx(dev, 0); /* disable intx */ |
282 | control = cap[i++] >> 16; | ||
283 | msi_set_enable(dev, 0); | 243 | msi_set_enable(dev, 0); |
284 | pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, cap[i++]); | 244 | write_msi_msg(dev->irq, &entry->msg); |
285 | if (control & PCI_MSI_FLAGS_64BIT) { | 245 | if (entry->msi_attrib.maskbit) |
286 | pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, cap[i++]); | 246 | msi_set_mask_bit(dev->irq, entry->msi_attrib.masked); |
287 | pci_write_config_dword(dev, pos + PCI_MSI_DATA_64, cap[i++]); | 247 | |
288 | } else | 248 | pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control); |
289 | pci_write_config_dword(dev, pos + PCI_MSI_DATA_32, cap[i++]); | 249 | control &= ~(PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE); |
290 | if (control & PCI_MSI_FLAGS_MASKBIT) | 250 | if (entry->msi_attrib.maskbit || !entry->msi_attrib.masked) |
291 | pci_write_config_dword(dev, pos + PCI_MSI_MASK_BIT, cap[i++]); | 251 | control |= PCI_MSI_FLAGS_ENABLE; |
292 | pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); | 252 | pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); |
293 | pci_remove_saved_cap(save_state); | ||
294 | kfree(save_state); | ||
295 | } | ||
296 | |||
297 | static int __pci_save_msix_state(struct pci_dev *dev) | ||
298 | { | ||
299 | int pos; | ||
300 | int irq, head, tail = 0; | ||
301 | u16 control; | ||
302 | struct pci_cap_saved_state *save_state; | ||
303 | |||
304 | if (!dev->msix_enabled) | ||
305 | return 0; | ||
306 | |||
307 | pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); | ||
308 | if (pos <= 0) | ||
309 | return 0; | ||
310 | |||
311 | /* save the capability */ | ||
312 | pci_read_config_word(dev, msi_control_reg(pos), &control); | ||
313 | save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u16), | ||
314 | GFP_KERNEL); | ||
315 | if (!save_state) { | ||
316 | printk(KERN_ERR "Out of memory in pci_save_msix_state\n"); | ||
317 | return -ENOMEM; | ||
318 | } | ||
319 | *((u16 *)&save_state->data[0]) = control; | ||
320 | |||
321 | /* save the table */ | ||
322 | irq = head = dev->first_msi_irq; | ||
323 | while (head != tail) { | ||
324 | struct msi_desc *entry; | ||
325 | |||
326 | entry = get_irq_msi(irq); | ||
327 | read_msi_msg(irq, &entry->msg_save); | ||
328 | |||
329 | tail = entry->link.tail; | ||
330 | irq = tail; | ||
331 | } | ||
332 | |||
333 | save_state->cap_nr = PCI_CAP_ID_MSIX; | ||
334 | pci_add_saved_cap(dev, save_state); | ||
335 | return 0; | ||
336 | } | ||
337 | |||
338 | int pci_save_msi_state(struct pci_dev *dev) | ||
339 | { | ||
340 | int rc; | ||
341 | |||
342 | rc = __pci_save_msi_state(dev); | ||
343 | if (rc) | ||
344 | return rc; | ||
345 | |||
346 | rc = __pci_save_msix_state(dev); | ||
347 | |||
348 | return rc; | ||
349 | } | 253 | } |
350 | 254 | ||
351 | static void __pci_restore_msix_state(struct pci_dev *dev) | 255 | static void __pci_restore_msix_state(struct pci_dev *dev) |
352 | { | 256 | { |
353 | u16 save; | ||
354 | int pos; | 257 | int pos; |
355 | int irq, head, tail = 0; | 258 | int irq, head, tail = 0; |
356 | struct msi_desc *entry; | 259 | struct msi_desc *entry; |
357 | struct pci_cap_saved_state *save_state; | 260 | u16 control; |
358 | 261 | ||
359 | if (!dev->msix_enabled) | 262 | if (!dev->msix_enabled) |
360 | return; | 263 | return; |
361 | 264 | ||
362 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSIX); | ||
363 | if (!save_state) | ||
364 | return; | ||
365 | save = *((u16 *)&save_state->data[0]); | ||
366 | pci_remove_saved_cap(save_state); | ||
367 | kfree(save_state); | ||
368 | |||
369 | pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); | ||
370 | if (pos <= 0) | ||
371 | return; | ||
372 | |||
373 | /* route the table */ | 265 | /* route the table */ |
374 | pci_intx(dev, 0); /* disable intx */ | 266 | pci_intx(dev, 0); /* disable intx */ |
375 | msix_set_enable(dev, 0); | 267 | msix_set_enable(dev, 0); |
376 | irq = head = dev->first_msi_irq; | 268 | irq = head = dev->first_msi_irq; |
269 | entry = get_irq_msi(irq); | ||
270 | pos = entry->msi_attrib.pos; | ||
377 | while (head != tail) { | 271 | while (head != tail) { |
378 | entry = get_irq_msi(irq); | 272 | entry = get_irq_msi(irq); |
379 | write_msi_msg(irq, &entry->msg_save); | 273 | write_msi_msg(irq, &entry->msg); |
274 | msi_set_mask_bit(irq, entry->msi_attrib.masked); | ||
380 | 275 | ||
381 | tail = entry->link.tail; | 276 | tail = entry->link.tail; |
382 | irq = tail; | 277 | irq = tail; |
383 | } | 278 | } |
384 | 279 | ||
385 | pci_write_config_word(dev, msi_control_reg(pos), save); | 280 | pci_read_config_word(dev, pos + PCI_MSIX_FLAGS, &control); |
281 | control &= ~PCI_MSIX_FLAGS_MASKALL; | ||
282 | control |= PCI_MSIX_FLAGS_ENABLE; | ||
283 | pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control); | ||
386 | } | 284 | } |
387 | 285 | ||
388 | void pci_restore_msi_state(struct pci_dev *dev) | 286 | void pci_restore_msi_state(struct pci_dev *dev) |
@@ -420,6 +318,7 @@ static int msi_capability_init(struct pci_dev *dev) | |||
420 | entry->msi_attrib.is_64 = is_64bit_address(control); | 318 | entry->msi_attrib.is_64 = is_64bit_address(control); |
421 | entry->msi_attrib.entry_nr = 0; | 319 | entry->msi_attrib.entry_nr = 0; |
422 | entry->msi_attrib.maskbit = is_mask_bit_support(control); | 320 | entry->msi_attrib.maskbit = is_mask_bit_support(control); |
321 | entry->msi_attrib.masked = 1; | ||
423 | entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ | 322 | entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ |
424 | entry->msi_attrib.pos = pos; | 323 | entry->msi_attrib.pos = pos; |
425 | if (is_mask_bit_support(control)) { | 324 | if (is_mask_bit_support(control)) { |
@@ -507,6 +406,7 @@ static int msix_capability_init(struct pci_dev *dev, | |||
507 | entry->msi_attrib.is_64 = 1; | 406 | entry->msi_attrib.is_64 = 1; |
508 | entry->msi_attrib.entry_nr = j; | 407 | entry->msi_attrib.entry_nr = j; |
509 | entry->msi_attrib.maskbit = 1; | 408 | entry->msi_attrib.maskbit = 1; |
409 | entry->msi_attrib.masked = 1; | ||
510 | entry->msi_attrib.default_irq = dev->irq; | 410 | entry->msi_attrib.default_irq = dev->irq; |
511 | entry->msi_attrib.pos = pos; | 411 | entry->msi_attrib.pos = pos; |
512 | entry->dev = dev; | 412 | entry->dev = dev; |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index df495300ce3d..d3eab057b2d3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -551,7 +551,9 @@ static int pci_save_pcie_state(struct pci_dev *dev) | |||
551 | if (pos <= 0) | 551 | if (pos <= 0) |
552 | return 0; | 552 | return 0; |
553 | 553 | ||
554 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL); | 554 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); |
555 | if (!save_state) | ||
556 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL); | ||
555 | if (!save_state) { | 557 | if (!save_state) { |
556 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); | 558 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); |
557 | return -ENOMEM; | 559 | return -ENOMEM; |
@@ -582,8 +584,6 @@ static void pci_restore_pcie_state(struct pci_dev *dev) | |||
582 | pci_write_config_word(dev, pos + PCI_EXP_LNKCTL, cap[i++]); | 584 | pci_write_config_word(dev, pos + PCI_EXP_LNKCTL, cap[i++]); |
583 | pci_write_config_word(dev, pos + PCI_EXP_SLTCTL, cap[i++]); | 585 | pci_write_config_word(dev, pos + PCI_EXP_SLTCTL, cap[i++]); |
584 | pci_write_config_word(dev, pos + PCI_EXP_RTCTL, cap[i++]); | 586 | pci_write_config_word(dev, pos + PCI_EXP_RTCTL, cap[i++]); |
585 | pci_remove_saved_cap(save_state); | ||
586 | kfree(save_state); | ||
587 | } | 587 | } |
588 | 588 | ||
589 | 589 | ||
@@ -597,7 +597,9 @@ static int pci_save_pcix_state(struct pci_dev *dev) | |||
597 | if (pos <= 0) | 597 | if (pos <= 0) |
598 | return 0; | 598 | return 0; |
599 | 599 | ||
600 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL); | 600 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); |
601 | if (!save_state) | ||
602 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL); | ||
601 | if (!save_state) { | 603 | if (!save_state) { |
602 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); | 604 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); |
603 | return -ENOMEM; | 605 | return -ENOMEM; |
@@ -622,8 +624,6 @@ static void pci_restore_pcix_state(struct pci_dev *dev) | |||
622 | cap = (u16 *)&save_state->data[0]; | 624 | cap = (u16 *)&save_state->data[0]; |
623 | 625 | ||
624 | pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); | 626 | pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); |
625 | pci_remove_saved_cap(save_state); | ||
626 | kfree(save_state); | ||
627 | } | 627 | } |
628 | 628 | ||
629 | 629 | ||
@@ -638,8 +638,6 @@ pci_save_state(struct pci_dev *dev) | |||
638 | /* XXX: 100% dword access ok here? */ | 638 | /* XXX: 100% dword access ok here? */ |
639 | for (i = 0; i < 16; i++) | 639 | for (i = 0; i < 16; i++) |
640 | pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]); | 640 | pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]); |
641 | if ((i = pci_save_msi_state(dev)) != 0) | ||
642 | return i; | ||
643 | if ((i = pci_save_pcie_state(dev)) != 0) | 641 | if ((i = pci_save_pcie_state(dev)) != 0) |
644 | return i; | 642 | return i; |
645 | if ((i = pci_save_pcix_state(dev)) != 0) | 643 | if ((i = pci_save_pcix_state(dev)) != 0) |
@@ -757,7 +755,8 @@ int pci_enable_device(struct pci_dev *dev) | |||
757 | * when a device is enabled using managed PCI device enable interface. | 755 | * when a device is enabled using managed PCI device enable interface. |
758 | */ | 756 | */ |
759 | struct pci_devres { | 757 | struct pci_devres { |
760 | unsigned int disable:1; | 758 | unsigned int enabled:1; |
759 | unsigned int pinned:1; | ||
761 | unsigned int orig_intx:1; | 760 | unsigned int orig_intx:1; |
762 | unsigned int restore_intx:1; | 761 | unsigned int restore_intx:1; |
763 | u32 region_mask; | 762 | u32 region_mask; |
@@ -781,7 +780,7 @@ static void pcim_release(struct device *gendev, void *res) | |||
781 | if (this->restore_intx) | 780 | if (this->restore_intx) |
782 | pci_intx(dev, this->orig_intx); | 781 | pci_intx(dev, this->orig_intx); |
783 | 782 | ||
784 | if (this->disable) | 783 | if (this->enabled && !this->pinned) |
785 | pci_disable_device(dev); | 784 | pci_disable_device(dev); |
786 | } | 785 | } |
787 | 786 | ||
@@ -820,12 +819,12 @@ int pcim_enable_device(struct pci_dev *pdev) | |||
820 | dr = get_pci_dr(pdev); | 819 | dr = get_pci_dr(pdev); |
821 | if (unlikely(!dr)) | 820 | if (unlikely(!dr)) |
822 | return -ENOMEM; | 821 | return -ENOMEM; |
823 | WARN_ON(!!dr->disable); | 822 | WARN_ON(!!dr->enabled); |
824 | 823 | ||
825 | rc = pci_enable_device(pdev); | 824 | rc = pci_enable_device(pdev); |
826 | if (!rc) { | 825 | if (!rc) { |
827 | pdev->is_managed = 1; | 826 | pdev->is_managed = 1; |
828 | dr->disable = 1; | 827 | dr->enabled = 1; |
829 | } | 828 | } |
830 | return rc; | 829 | return rc; |
831 | } | 830 | } |
@@ -843,9 +842,9 @@ void pcim_pin_device(struct pci_dev *pdev) | |||
843 | struct pci_devres *dr; | 842 | struct pci_devres *dr; |
844 | 843 | ||
845 | dr = find_pci_dr(pdev); | 844 | dr = find_pci_dr(pdev); |
846 | WARN_ON(!dr || !dr->disable); | 845 | WARN_ON(!dr || !dr->enabled); |
847 | if (dr) | 846 | if (dr) |
848 | dr->disable = 0; | 847 | dr->pinned = 1; |
849 | } | 848 | } |
850 | 849 | ||
851 | /** | 850 | /** |
@@ -876,7 +875,7 @@ pci_disable_device(struct pci_dev *dev) | |||
876 | 875 | ||
877 | dr = find_pci_dr(dev); | 876 | dr = find_pci_dr(dev); |
878 | if (dr) | 877 | if (dr) |
879 | dr->disable = 0; | 878 | dr->enabled = 0; |
880 | 879 | ||
881 | if (atomic_sub_return(1, &dev->enable_cnt) != 0) | 880 | if (atomic_sub_return(1, &dev->enable_cnt) != 0) |
882 | return; | 881 | return; |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index ae7a975995a5..62ea04c8af64 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -52,10 +52,8 @@ static inline void pci_no_msi(void) { } | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM) | 54 | #if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM) |
55 | int pci_save_msi_state(struct pci_dev *dev); | ||
56 | void pci_restore_msi_state(struct pci_dev *dev); | 55 | void pci_restore_msi_state(struct pci_dev *dev); |
57 | #else | 56 | #else |
58 | static inline int pci_save_msi_state(struct pci_dev *dev) { return 0; } | ||
59 | static inline void pci_restore_msi_state(struct pci_dev *dev) {} | 57 | static inline void pci_restore_msi_state(struct pci_dev *dev) {} |
60 | #endif | 58 | #endif |
61 | 59 | ||
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index b164de050d4f..db6ad8e763ac 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -66,7 +66,7 @@ static struct pci_error_handlers aer_error_handlers = { | |||
66 | .resume = aer_error_resume, | 66 | .resume = aer_error_resume, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | static struct pcie_port_service_driver aerdrv = { | 69 | static struct pcie_port_service_driver aerdriver = { |
70 | .name = "aer", | 70 | .name = "aer", |
71 | .id_table = &aer_id[0], | 71 | .id_table = &aer_id[0], |
72 | 72 | ||
@@ -328,7 +328,7 @@ static void aer_error_resume(struct pci_dev *dev) | |||
328 | **/ | 328 | **/ |
329 | static int __init aer_service_init(void) | 329 | static int __init aer_service_init(void) |
330 | { | 330 | { |
331 | return pcie_port_service_register(&aerdrv); | 331 | return pcie_port_service_register(&aerdriver); |
332 | } | 332 | } |
333 | 333 | ||
334 | /** | 334 | /** |
@@ -338,7 +338,7 @@ static int __init aer_service_init(void) | |||
338 | **/ | 338 | **/ |
339 | static void __exit aer_service_exit(void) | 339 | static void __exit aer_service_exit(void) |
340 | { | 340 | { |
341 | pcie_port_service_unregister(&aerdrv); | 341 | pcie_port_service_unregister(&aerdriver); |
342 | } | 342 | } |
343 | 343 | ||
344 | module_init(aer_service_init); | 344 | module_init(aer_service_init); |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index f17e7ed2b2a5..0be5a0b30725 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -276,7 +276,7 @@ static struct pci_error_handlers pcie_portdrv_err_handler = { | |||
276 | .resume = pcie_portdrv_err_resume, | 276 | .resume = pcie_portdrv_err_resume, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static struct pci_driver pcie_portdrv = { | 279 | static struct pci_driver pcie_portdriver = { |
280 | .name = (char *)device_name, | 280 | .name = (char *)device_name, |
281 | .id_table = &port_pci_ids[0], | 281 | .id_table = &port_pci_ids[0], |
282 | 282 | ||
@@ -298,7 +298,7 @@ static int __init pcie_portdrv_init(void) | |||
298 | printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval); | 298 | printk(KERN_WARNING "PCIE: bus_register error: %d\n", retval); |
299 | goto out; | 299 | goto out; |
300 | } | 300 | } |
301 | retval = pci_register_driver(&pcie_portdrv); | 301 | retval = pci_register_driver(&pcie_portdriver); |
302 | if (retval) | 302 | if (retval) |
303 | pcie_port_bus_unregister(); | 303 | pcie_port_bus_unregister(); |
304 | out: | 304 | out: |
@@ -307,7 +307,7 @@ static int __init pcie_portdrv_init(void) | |||
307 | 307 | ||
308 | static void __exit pcie_portdrv_exit(void) | 308 | static void __exit pcie_portdrv_exit(void) |
309 | { | 309 | { |
310 | pci_unregister_driver(&pcie_portdrv); | 310 | pci_unregister_driver(&pcie_portdriver); |
311 | pcie_port_bus_unregister(); | 311 | pcie_port_bus_unregister(); |
312 | } | 312 | } |
313 | 313 | ||
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index ff98eaddaa73..2dd8681d6b31 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | DECLARE_RWSEM(pci_bus_sem); | 16 | DECLARE_RWSEM(pci_bus_sem); |
17 | 17 | ||
18 | static struct pci_bus * __devinit | 18 | static struct pci_bus * |
19 | pci_do_find_bus(struct pci_bus* bus, unsigned char busnr) | 19 | pci_do_find_bus(struct pci_bus* bus, unsigned char busnr) |
20 | { | 20 | { |
21 | struct pci_bus* child; | 21 | struct pci_bus* child; |
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index 5026b345cb30..57e6ab1004d0 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -451,7 +451,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev) | |||
451 | return -EINVAL; | 451 | return -EINVAL; |
452 | 452 | ||
453 | if(!pnp_can_configure(dev)) { | 453 | if(!pnp_can_configure(dev)) { |
454 | pnp_info("Device %s does not support resource configuration.", dev->dev.bus_id); | 454 | pnp_dbg("Device %s does not support resource configuration.", dev->dev.bus_id); |
455 | return -ENODEV; | 455 | return -ENODEV; |
456 | } | 456 | } |
457 | 457 | ||
@@ -482,7 +482,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev) | |||
482 | int pnp_start_dev(struct pnp_dev *dev) | 482 | int pnp_start_dev(struct pnp_dev *dev) |
483 | { | 483 | { |
484 | if (!pnp_can_write(dev)) { | 484 | if (!pnp_can_write(dev)) { |
485 | pnp_info("Device %s does not support activation.", dev->dev.bus_id); | 485 | pnp_dbg("Device %s does not support activation.", dev->dev.bus_id); |
486 | return -EINVAL; | 486 | return -EINVAL; |
487 | } | 487 | } |
488 | 488 | ||
@@ -506,7 +506,7 @@ int pnp_start_dev(struct pnp_dev *dev) | |||
506 | int pnp_stop_dev(struct pnp_dev *dev) | 506 | int pnp_stop_dev(struct pnp_dev *dev) |
507 | { | 507 | { |
508 | if (!pnp_can_disable(dev)) { | 508 | if (!pnp_can_disable(dev)) { |
509 | pnp_info("Device %s does not support disabling.", dev->dev.bus_id); | 509 | pnp_dbg("Device %s does not support disabling.", dev->dev.bus_id); |
510 | return -EINVAL; | 510 | return -EINVAL; |
511 | } | 511 | } |
512 | if (dev->protocol->disable(dev)<0) { | 512 | if (dev->protocol->disable(dev)<0) { |
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 7a535542fe92..118ac9779b3c 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -89,6 +89,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi, | |||
89 | return; | 89 | return; |
90 | 90 | ||
91 | res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag | 91 | res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag |
92 | res->irq_resource[i].flags |= irq_flags(triggering, polarity); | ||
92 | irq = acpi_register_gsi(gsi, triggering, polarity); | 93 | irq = acpi_register_gsi(gsi, triggering, polarity); |
93 | if (irq < 0) { | 94 | if (irq < 0) { |
94 | res->irq_resource[i].flags |= IORESOURCE_DISABLED; | 95 | res->irq_resource[i].flags |= IORESOURCE_DISABLED; |
@@ -103,8 +104,52 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, u32 gsi, | |||
103 | pcibios_penalize_isa_irq(irq, 1); | 104 | pcibios_penalize_isa_irq(irq, 1); |
104 | } | 105 | } |
105 | 106 | ||
107 | static int dma_flags(int type, int bus_master, int transfer) | ||
108 | { | ||
109 | int flags = 0; | ||
110 | |||
111 | if (bus_master) | ||
112 | flags |= IORESOURCE_DMA_MASTER; | ||
113 | switch (type) { | ||
114 | case ACPI_COMPATIBILITY: | ||
115 | flags |= IORESOURCE_DMA_COMPATIBLE; | ||
116 | break; | ||
117 | case ACPI_TYPE_A: | ||
118 | flags |= IORESOURCE_DMA_TYPEA; | ||
119 | break; | ||
120 | case ACPI_TYPE_B: | ||
121 | flags |= IORESOURCE_DMA_TYPEB; | ||
122 | break; | ||
123 | case ACPI_TYPE_F: | ||
124 | flags |= IORESOURCE_DMA_TYPEF; | ||
125 | break; | ||
126 | default: | ||
127 | /* Set a default value ? */ | ||
128 | flags |= IORESOURCE_DMA_COMPATIBLE; | ||
129 | pnp_err("Invalid DMA type"); | ||
130 | } | ||
131 | switch (transfer) { | ||
132 | case ACPI_TRANSFER_8: | ||
133 | flags |= IORESOURCE_DMA_8BIT; | ||
134 | break; | ||
135 | case ACPI_TRANSFER_8_16: | ||
136 | flags |= IORESOURCE_DMA_8AND16BIT; | ||
137 | break; | ||
138 | case ACPI_TRANSFER_16: | ||
139 | flags |= IORESOURCE_DMA_16BIT; | ||
140 | break; | ||
141 | default: | ||
142 | /* Set a default value ? */ | ||
143 | flags |= IORESOURCE_DMA_8AND16BIT; | ||
144 | pnp_err("Invalid DMA transfer type"); | ||
145 | } | ||
146 | |||
147 | return flags; | ||
148 | } | ||
149 | |||
106 | static void | 150 | static void |
107 | pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma) | 151 | pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma, |
152 | int type, int bus_master, int transfer) | ||
108 | { | 153 | { |
109 | int i = 0; | 154 | int i = 0; |
110 | while (i < PNP_MAX_DMA && | 155 | while (i < PNP_MAX_DMA && |
@@ -112,6 +157,7 @@ pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma) | |||
112 | i++; | 157 | i++; |
113 | if (i < PNP_MAX_DMA) { | 158 | if (i < PNP_MAX_DMA) { |
114 | res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag | 159 | res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag |
160 | res->dma_resource[i].flags |= dma_flags(type, bus_master, transfer); | ||
115 | if (dma == -1) { | 161 | if (dma == -1) { |
116 | res->dma_resource[i].flags |= IORESOURCE_DISABLED; | 162 | res->dma_resource[i].flags |= IORESOURCE_DISABLED; |
117 | return; | 163 | return; |
@@ -123,7 +169,7 @@ pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res, u32 dma) | |||
123 | 169 | ||
124 | static void | 170 | static void |
125 | pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, | 171 | pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, |
126 | u64 io, u64 len) | 172 | u64 io, u64 len, int io_decode) |
127 | { | 173 | { |
128 | int i = 0; | 174 | int i = 0; |
129 | while (!(res->port_resource[i].flags & IORESOURCE_UNSET) && | 175 | while (!(res->port_resource[i].flags & IORESOURCE_UNSET) && |
@@ -131,6 +177,8 @@ pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, | |||
131 | i++; | 177 | i++; |
132 | if (i < PNP_MAX_PORT) { | 178 | if (i < PNP_MAX_PORT) { |
133 | res->port_resource[i].flags = IORESOURCE_IO; // Also clears _UNSET flag | 179 | res->port_resource[i].flags = IORESOURCE_IO; // Also clears _UNSET flag |
180 | if (io_decode == ACPI_DECODE_16) | ||
181 | res->port_resource[i].flags |= PNP_PORT_FLAG_16BITADDR; | ||
134 | if (len <= 0 || (io + len -1) >= 0x10003) { | 182 | if (len <= 0 || (io + len -1) >= 0x10003) { |
135 | res->port_resource[i].flags |= IORESOURCE_DISABLED; | 183 | res->port_resource[i].flags |= IORESOURCE_DISABLED; |
136 | return; | 184 | return; |
@@ -142,7 +190,7 @@ pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, | |||
142 | 190 | ||
143 | static void | 191 | static void |
144 | pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, | 192 | pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, |
145 | u64 mem, u64 len) | 193 | u64 mem, u64 len, int write_protect) |
146 | { | 194 | { |
147 | int i = 0; | 195 | int i = 0; |
148 | while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) && | 196 | while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) && |
@@ -154,6 +202,9 @@ pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, | |||
154 | res->mem_resource[i].flags |= IORESOURCE_DISABLED; | 202 | res->mem_resource[i].flags |= IORESOURCE_DISABLED; |
155 | return; | 203 | return; |
156 | } | 204 | } |
205 | if(write_protect == ACPI_READ_WRITE_MEMORY) | ||
206 | res->mem_resource[i].flags |= IORESOURCE_MEM_WRITEABLE; | ||
207 | |||
157 | res->mem_resource[i].start = mem; | 208 | res->mem_resource[i].start = mem; |
158 | res->mem_resource[i].end = mem + len - 1; | 209 | res->mem_resource[i].end = mem + len - 1; |
159 | } | 210 | } |
@@ -178,10 +229,11 @@ pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res_table, | |||
178 | 229 | ||
179 | if (p->resource_type == ACPI_MEMORY_RANGE) | 230 | if (p->resource_type == ACPI_MEMORY_RANGE) |
180 | pnpacpi_parse_allocated_memresource(res_table, | 231 | pnpacpi_parse_allocated_memresource(res_table, |
181 | p->minimum, p->address_length); | 232 | p->minimum, p->address_length, p->info.mem.write_protect); |
182 | else if (p->resource_type == ACPI_IO_RANGE) | 233 | else if (p->resource_type == ACPI_IO_RANGE) |
183 | pnpacpi_parse_allocated_ioresource(res_table, | 234 | pnpacpi_parse_allocated_ioresource(res_table, |
184 | p->minimum, p->address_length); | 235 | p->minimum, p->address_length, |
236 | p->granularity == 0xfff ? ACPI_DECODE_10 : ACPI_DECODE_16); | ||
185 | } | 237 | } |
186 | 238 | ||
187 | static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | 239 | static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, |
@@ -208,13 +260,17 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
208 | case ACPI_RESOURCE_TYPE_DMA: | 260 | case ACPI_RESOURCE_TYPE_DMA: |
209 | if (res->data.dma.channel_count > 0) | 261 | if (res->data.dma.channel_count > 0) |
210 | pnpacpi_parse_allocated_dmaresource(res_table, | 262 | pnpacpi_parse_allocated_dmaresource(res_table, |
211 | res->data.dma.channels[0]); | 263 | res->data.dma.channels[0], |
264 | res->data.dma.type, | ||
265 | res->data.dma.bus_master, | ||
266 | res->data.dma.transfer); | ||
212 | break; | 267 | break; |
213 | 268 | ||
214 | case ACPI_RESOURCE_TYPE_IO: | 269 | case ACPI_RESOURCE_TYPE_IO: |
215 | pnpacpi_parse_allocated_ioresource(res_table, | 270 | pnpacpi_parse_allocated_ioresource(res_table, |
216 | res->data.io.minimum, | 271 | res->data.io.minimum, |
217 | res->data.io.address_length); | 272 | res->data.io.address_length, |
273 | res->data.io.io_decode); | ||
218 | break; | 274 | break; |
219 | 275 | ||
220 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: | 276 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: |
@@ -224,7 +280,8 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
224 | case ACPI_RESOURCE_TYPE_FIXED_IO: | 280 | case ACPI_RESOURCE_TYPE_FIXED_IO: |
225 | pnpacpi_parse_allocated_ioresource(res_table, | 281 | pnpacpi_parse_allocated_ioresource(res_table, |
226 | res->data.fixed_io.address, | 282 | res->data.fixed_io.address, |
227 | res->data.fixed_io.address_length); | 283 | res->data.fixed_io.address_length, |
284 | ACPI_DECODE_10); | ||
228 | break; | 285 | break; |
229 | 286 | ||
230 | case ACPI_RESOURCE_TYPE_VENDOR: | 287 | case ACPI_RESOURCE_TYPE_VENDOR: |
@@ -236,17 +293,20 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
236 | case ACPI_RESOURCE_TYPE_MEMORY24: | 293 | case ACPI_RESOURCE_TYPE_MEMORY24: |
237 | pnpacpi_parse_allocated_memresource(res_table, | 294 | pnpacpi_parse_allocated_memresource(res_table, |
238 | res->data.memory24.minimum, | 295 | res->data.memory24.minimum, |
239 | res->data.memory24.address_length); | 296 | res->data.memory24.address_length, |
297 | res->data.memory24.write_protect); | ||
240 | break; | 298 | break; |
241 | case ACPI_RESOURCE_TYPE_MEMORY32: | 299 | case ACPI_RESOURCE_TYPE_MEMORY32: |
242 | pnpacpi_parse_allocated_memresource(res_table, | 300 | pnpacpi_parse_allocated_memresource(res_table, |
243 | res->data.memory32.minimum, | 301 | res->data.memory32.minimum, |
244 | res->data.memory32.address_length); | 302 | res->data.memory32.address_length, |
303 | res->data.memory32.write_protect); | ||
245 | break; | 304 | break; |
246 | case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: | 305 | case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: |
247 | pnpacpi_parse_allocated_memresource(res_table, | 306 | pnpacpi_parse_allocated_memresource(res_table, |
248 | res->data.fixed_memory32.address, | 307 | res->data.fixed_memory32.address, |
249 | res->data.fixed_memory32.address_length); | 308 | res->data.fixed_memory32.address_length, |
309 | res->data.fixed_memory32.write_protect); | ||
250 | break; | 310 | break; |
251 | case ACPI_RESOURCE_TYPE_ADDRESS16: | 311 | case ACPI_RESOURCE_TYPE_ADDRESS16: |
252 | case ACPI_RESOURCE_TYPE_ADDRESS32: | 312 | case ACPI_RESOURCE_TYPE_ADDRESS32: |
@@ -304,42 +364,8 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, struct acpi_reso | |||
304 | 364 | ||
305 | for(i = 0; i < p->channel_count; i++) | 365 | for(i = 0; i < p->channel_count; i++) |
306 | dma->map |= 1 << p->channels[i]; | 366 | dma->map |= 1 << p->channels[i]; |
307 | dma->flags = 0; | 367 | |
308 | if (p->bus_master) | 368 | dma->flags = dma_flags(p->type, p->bus_master, p->transfer); |
309 | dma->flags |= IORESOURCE_DMA_MASTER; | ||
310 | switch (p->type) { | ||
311 | case ACPI_COMPATIBILITY: | ||
312 | dma->flags |= IORESOURCE_DMA_COMPATIBLE; | ||
313 | break; | ||
314 | case ACPI_TYPE_A: | ||
315 | dma->flags |= IORESOURCE_DMA_TYPEA; | ||
316 | break; | ||
317 | case ACPI_TYPE_B: | ||
318 | dma->flags |= IORESOURCE_DMA_TYPEB; | ||
319 | break; | ||
320 | case ACPI_TYPE_F: | ||
321 | dma->flags |= IORESOURCE_DMA_TYPEF; | ||
322 | break; | ||
323 | default: | ||
324 | /* Set a default value ? */ | ||
325 | dma->flags |= IORESOURCE_DMA_COMPATIBLE; | ||
326 | pnp_err("Invalid DMA type"); | ||
327 | } | ||
328 | switch (p->transfer) { | ||
329 | case ACPI_TRANSFER_8: | ||
330 | dma->flags |= IORESOURCE_DMA_8BIT; | ||
331 | break; | ||
332 | case ACPI_TRANSFER_8_16: | ||
333 | dma->flags |= IORESOURCE_DMA_8AND16BIT; | ||
334 | break; | ||
335 | case ACPI_TRANSFER_16: | ||
336 | dma->flags |= IORESOURCE_DMA_16BIT; | ||
337 | break; | ||
338 | default: | ||
339 | /* Set a default value ? */ | ||
340 | dma->flags |= IORESOURCE_DMA_8AND16BIT; | ||
341 | pnp_err("Invalid DMA transfer type"); | ||
342 | } | ||
343 | 369 | ||
344 | pnp_register_dma_resource(option, dma); | 370 | pnp_register_dma_resource(option, dma); |
345 | return; | 371 | return; |
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index 1926b4d3e1f4..d21e04ccb021 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/reboot.h> | 24 | #include <linux/reboot.h> |
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | |||
28 | #include <asm/firmware.h> | ||
27 | #include <asm/lv1call.h> | 29 | #include <asm/lv1call.h> |
28 | #include <asm/ps3av.h> | 30 | #include <asm/ps3av.h> |
29 | #include <asm/ps3.h> | 31 | #include <asm/ps3.h> |
@@ -947,7 +949,12 @@ static struct ps3_vuart_port_driver ps3av_driver = { | |||
947 | 949 | ||
948 | static int ps3av_module_init(void) | 950 | static int ps3av_module_init(void) |
949 | { | 951 | { |
950 | int error = ps3_vuart_port_driver_register(&ps3av_driver); | 952 | int error; |
953 | |||
954 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
955 | return -ENODEV; | ||
956 | |||
957 | error = ps3_vuart_port_driver_register(&ps3av_driver); | ||
951 | if (error) { | 958 | if (error) { |
952 | printk(KERN_ERR | 959 | printk(KERN_ERR |
953 | "%s: ps3_vuart_port_driver_register failed %d\n", | 960 | "%s: ps3_vuart_port_driver_register failed %d\n", |
diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c index 21c97c80aa2e..bc70e81f8cb0 100644 --- a/drivers/ps3/ps3av_cmd.c +++ b/drivers/ps3/ps3av_cmd.c | |||
@@ -485,12 +485,12 @@ static u8 ps3av_cnv_mclk(u32 fs) | |||
485 | 485 | ||
486 | static const u32 ps3av_ns_table[][5] = { | 486 | static const u32 ps3av_ns_table[][5] = { |
487 | /* D1, D2, D3, D4, D5 */ | 487 | /* D1, D2, D3, D4, D5 */ |
488 | [PS3AV_CMD_AUDIO_FS_44K-BASE] { 6272, 6272, 17836, 17836, 8918 }, | 488 | [PS3AV_CMD_AUDIO_FS_44K-BASE] = { 6272, 6272, 17836, 17836, 8918 }, |
489 | [PS3AV_CMD_AUDIO_FS_48K-BASE] { 6144, 6144, 11648, 11648, 5824 }, | 489 | [PS3AV_CMD_AUDIO_FS_48K-BASE] = { 6144, 6144, 11648, 11648, 5824 }, |
490 | [PS3AV_CMD_AUDIO_FS_88K-BASE] { 12544, 12544, 35672, 35672, 17836 }, | 490 | [PS3AV_CMD_AUDIO_FS_88K-BASE] = { 12544, 12544, 35672, 35672, 17836 }, |
491 | [PS3AV_CMD_AUDIO_FS_96K-BASE] { 12288, 12288, 23296, 23296, 11648 }, | 491 | [PS3AV_CMD_AUDIO_FS_96K-BASE] = { 12288, 12288, 23296, 23296, 11648 }, |
492 | [PS3AV_CMD_AUDIO_FS_176K-BASE] { 25088, 25088, 71344, 71344, 35672 }, | 492 | [PS3AV_CMD_AUDIO_FS_176K-BASE] = { 25088, 25088, 71344, 71344, 35672 }, |
493 | [PS3AV_CMD_AUDIO_FS_192K-BASE] { 24576, 24576, 46592, 46592, 23296 } | 493 | [PS3AV_CMD_AUDIO_FS_192K-BASE] = { 24576, 24576, 46592, 46592, 23296 } |
494 | }; | 494 | }; |
495 | 495 | ||
496 | static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) | 496 | static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) |
@@ -543,9 +543,10 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) | |||
543 | 543 | ||
544 | #undef BASE | 544 | #undef BASE |
545 | 545 | ||
546 | static u8 ps3av_cnv_enable(u32 source, u8 *enable) | 546 | static u8 ps3av_cnv_enable(u32 source, const u8 *enable) |
547 | { | 547 | { |
548 | u8 *p, ret = 0; | 548 | const u8 *p; |
549 | u8 ret = 0; | ||
549 | 550 | ||
550 | if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { | 551 | if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { |
551 | ret = 0x03; | 552 | ret = 0x03; |
@@ -559,9 +560,10 @@ static u8 ps3av_cnv_enable(u32 source, u8 *enable) | |||
559 | return ret; | 560 | return ret; |
560 | } | 561 | } |
561 | 562 | ||
562 | static u8 ps3av_cnv_fifomap(u8 *map) | 563 | static u8 ps3av_cnv_fifomap(const u8 *map) |
563 | { | 564 | { |
564 | u8 *p, ret = 0; | 565 | const u8 *p; |
566 | u8 ret = 0; | ||
565 | 567 | ||
566 | p = map; | 568 | p = map; |
567 | ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); | 569 | ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); |
@@ -615,7 +617,7 @@ static void ps3av_cnv_info(struct ps3av_audio_info_frame *info, | |||
615 | info->pb5.lsv = mode->audio_downmix_level; | 617 | info->pb5.lsv = mode->audio_downmix_level; |
616 | } | 618 | } |
617 | 619 | ||
618 | static void ps3av_cnv_chstat(u8 *chstat, u8 *cs_info) | 620 | static void ps3av_cnv_chstat(u8 *chstat, const u8 *cs_info) |
619 | { | 621 | { |
620 | memcpy(chstat, cs_info, 5); | 622 | memcpy(chstat, cs_info, 5); |
621 | } | 623 | } |
diff --git a/drivers/ps3/sys-manager.c b/drivers/ps3/sys-manager.c index 0fc30be8b81e..3aa2b0dcc369 100644 --- a/drivers/ps3/sys-manager.c +++ b/drivers/ps3/sys-manager.c | |||
@@ -22,7 +22,10 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
24 | #include <linux/reboot.h> | 24 | #include <linux/reboot.h> |
25 | |||
26 | #include <asm/firmware.h> | ||
25 | #include <asm/ps3.h> | 27 | #include <asm/ps3.h> |
28 | |||
26 | #include "vuart.h" | 29 | #include "vuart.h" |
27 | 30 | ||
28 | MODULE_AUTHOR("Sony Corporation"); | 31 | MODULE_AUTHOR("Sony Corporation"); |
@@ -598,6 +601,9 @@ static struct ps3_vuart_port_driver ps3_sys_manager = { | |||
598 | 601 | ||
599 | static int __init ps3_sys_manager_init(void) | 602 | static int __init ps3_sys_manager_init(void) |
600 | { | 603 | { |
604 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
605 | return -ENODEV; | ||
606 | |||
601 | return ps3_vuart_port_driver_register(&ps3_sys_manager); | 607 | return ps3_vuart_port_driver_register(&ps3_sys_manager); |
602 | } | 608 | } |
603 | 609 | ||
diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c index 746298107d6f..6c12744eeb9d 100644 --- a/drivers/ps3/vuart.c +++ b/drivers/ps3/vuart.c | |||
@@ -952,7 +952,7 @@ fail_alloc_irq: | |||
952 | kfree(dev->priv); | 952 | kfree(dev->priv); |
953 | dev->priv = NULL; | 953 | dev->priv = NULL; |
954 | fail_alloc: | 954 | fail_alloc: |
955 | vuart_bus_priv.devices[port_number] = 0; | 955 | vuart_bus_priv.devices[port_number] = NULL; |
956 | fail_match: | 956 | fail_match: |
957 | up(&vuart_bus_priv.probe_mutex); | 957 | up(&vuart_bus_priv.probe_mutex); |
958 | dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__); | 958 | dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__); |
@@ -978,7 +978,7 @@ static int ps3_vuart_remove(struct device *_dev) | |||
978 | dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__, | 978 | dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__, |
979 | __LINE__, dev->core.bus_id); | 979 | __LINE__, dev->core.bus_id); |
980 | 980 | ||
981 | vuart_bus_priv.devices[dev->priv->port_number] = 0; | 981 | vuart_bus_priv.devices[dev->priv->port_number] = NULL; |
982 | 982 | ||
983 | if (--vuart_bus_priv.use_count == 0) { | 983 | if (--vuart_bus_priv.use_count == 0) { |
984 | BUG(); | 984 | BUG(); |
@@ -1031,7 +1031,7 @@ int __init ps3_vuart_bus_init(void) | |||
1031 | pr_debug("%s:%d:\n", __func__, __LINE__); | 1031 | pr_debug("%s:%d:\n", __func__, __LINE__); |
1032 | 1032 | ||
1033 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | 1033 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) |
1034 | return 0; | 1034 | return -ENODEV; |
1035 | 1035 | ||
1036 | init_MUTEX(&vuart_bus_priv.probe_mutex); | 1036 | init_MUTEX(&vuart_bus_priv.probe_mutex); |
1037 | result = bus_register(&ps3_vuart_bus); | 1037 | result = bus_register(&ps3_vuart_bus); |
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index d48e3ca4752c..5aeb68e732b0 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -71,19 +71,31 @@ __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev) | |||
71 | * Provide an 'ungroup' attribute so the user can remove group devices no | 71 | * Provide an 'ungroup' attribute so the user can remove group devices no |
72 | * longer needed or accidentially created. Saves memory :) | 72 | * longer needed or accidentially created. Saves memory :) |
73 | */ | 73 | */ |
74 | static void ccwgroup_ungroup_callback(struct device *dev) | ||
75 | { | ||
76 | struct ccwgroup_device *gdev = to_ccwgroupdev(dev); | ||
77 | |||
78 | __ccwgroup_remove_symlinks(gdev); | ||
79 | device_unregister(dev); | ||
80 | } | ||
81 | |||
74 | static ssize_t | 82 | static ssize_t |
75 | ccwgroup_ungroup_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 83 | ccwgroup_ungroup_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
76 | { | 84 | { |
77 | struct ccwgroup_device *gdev; | 85 | struct ccwgroup_device *gdev; |
86 | int rc; | ||
78 | 87 | ||
79 | gdev = to_ccwgroupdev(dev); | 88 | gdev = to_ccwgroupdev(dev); |
80 | 89 | ||
81 | if (gdev->state != CCWGROUP_OFFLINE) | 90 | if (gdev->state != CCWGROUP_OFFLINE) |
82 | return -EINVAL; | 91 | return -EINVAL; |
83 | 92 | ||
84 | __ccwgroup_remove_symlinks(gdev); | 93 | /* Note that we cannot unregister the device from one of its |
85 | device_unregister(dev); | 94 | * attribute methods, so we have to use this roundabout approach. |
86 | 95 | */ | |
96 | rc = device_schedule_callback(dev, ccwgroup_ungroup_callback); | ||
97 | if (rc) | ||
98 | count = rc; | ||
87 | return count; | 99 | return count; |
88 | } | 100 | } |
89 | 101 | ||
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 5b1e3ff26c0b..05fac0733f3d 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -210,9 +210,11 @@ again: | |||
210 | goto again; | 210 | goto again; |
211 | } | 211 | } |
212 | if (rc < 0) { | 212 | if (rc < 0) { |
213 | QDIO_DBF_TEXT3(1,trace,"sqberr"); | 213 | QDIO_DBF_TEXT3(1,trace,"sqberr"); |
214 | sprintf(dbf_text,"%2x,%2x,%d,%d",tmp_cnt,*cnt,ccq,q_no); | 214 | sprintf(dbf_text,"%2x,%2x",tmp_cnt,*cnt); |
215 | QDIO_DBF_TEXT3(1,trace,dbf_text); | 215 | QDIO_DBF_TEXT3(1,trace,dbf_text); |
216 | sprintf(dbf_text,"%d,%d",ccq,q_no); | ||
217 | QDIO_DBF_TEXT3(1,trace,dbf_text); | ||
216 | q->handler(q->cdev,QDIO_STATUS_ACTIVATE_CHECK_CONDITION| | 218 | q->handler(q->cdev,QDIO_STATUS_ACTIVATE_CHECK_CONDITION| |
217 | QDIO_STATUS_LOOK_FOR_ERROR, | 219 | QDIO_STATUS_LOOK_FOR_ERROR, |
218 | 0, 0, 0, -1, -1, q->int_parm); | 220 | 0, 0, 0, -1, -1, q->int_parm); |
@@ -1250,7 +1252,6 @@ qdio_is_inbound_q_done(struct qdio_q *q) | |||
1250 | if (!no_used) { | 1252 | if (!no_used) { |
1251 | QDIO_DBF_TEXT4(0,trace,"inqisdnA"); | 1253 | QDIO_DBF_TEXT4(0,trace,"inqisdnA"); |
1252 | QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); | 1254 | QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); |
1253 | QDIO_DBF_TEXT4(0,trace,dbf_text); | ||
1254 | return 1; | 1255 | return 1; |
1255 | } | 1256 | } |
1256 | if (irq->is_qebsm) { | 1257 | if (irq->is_qebsm) { |
@@ -3371,10 +3372,15 @@ qdio_do_qdio_fill_input(struct qdio_q *q, unsigned int qidx, | |||
3371 | unsigned int count, struct qdio_buffer *buffers) | 3372 | unsigned int count, struct qdio_buffer *buffers) |
3372 | { | 3373 | { |
3373 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; | 3374 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; |
3375 | int tmp = 0; | ||
3376 | |||
3374 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); | 3377 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); |
3375 | if (irq->is_qebsm) { | 3378 | if (irq->is_qebsm) { |
3376 | while (count) | 3379 | while (count) { |
3377 | set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count); | 3380 | tmp = set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count); |
3381 | if (!tmp) | ||
3382 | return; | ||
3383 | } | ||
3378 | return; | 3384 | return; |
3379 | } | 3385 | } |
3380 | for (;;) { | 3386 | for (;;) { |
@@ -3390,11 +3396,15 @@ qdio_do_qdio_fill_output(struct qdio_q *q, unsigned int qidx, | |||
3390 | unsigned int count, struct qdio_buffer *buffers) | 3396 | unsigned int count, struct qdio_buffer *buffers) |
3391 | { | 3397 | { |
3392 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; | 3398 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; |
3399 | int tmp = 0; | ||
3393 | 3400 | ||
3394 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); | 3401 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); |
3395 | if (irq->is_qebsm) { | 3402 | if (irq->is_qebsm) { |
3396 | while (count) | 3403 | while (count) { |
3397 | set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count); | 3404 | tmp = set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count); |
3405 | if (!tmp) | ||
3406 | return; | ||
3407 | } | ||
3398 | return; | 3408 | return; |
3399 | } | 3409 | } |
3400 | 3410 | ||
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index c7d1355237b6..181b51772b1b 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -65,6 +65,8 @@ module_param_named(poll_thread, ap_thread_flag, int, 0000); | |||
65 | MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 1 (on)."); | 65 | MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 1 (on)."); |
66 | 66 | ||
67 | static struct device *ap_root_device = NULL; | 67 | static struct device *ap_root_device = NULL; |
68 | static DEFINE_SPINLOCK(ap_device_lock); | ||
69 | static LIST_HEAD(ap_device_list); | ||
68 | 70 | ||
69 | /** | 71 | /** |
70 | * Workqueue & timer for bus rescan. | 72 | * Workqueue & timer for bus rescan. |
@@ -457,6 +459,9 @@ static int ap_device_probe(struct device *dev) | |||
457 | int rc; | 459 | int rc; |
458 | 460 | ||
459 | ap_dev->drv = ap_drv; | 461 | ap_dev->drv = ap_drv; |
462 | spin_lock_bh(&ap_device_lock); | ||
463 | list_add(&ap_dev->list, &ap_device_list); | ||
464 | spin_unlock_bh(&ap_device_lock); | ||
460 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; | 465 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; |
461 | return rc; | 466 | return rc; |
462 | } | 467 | } |
@@ -497,6 +502,9 @@ static int ap_device_remove(struct device *dev) | |||
497 | ap_flush_queue(ap_dev); | 502 | ap_flush_queue(ap_dev); |
498 | if (ap_drv->remove) | 503 | if (ap_drv->remove) |
499 | ap_drv->remove(ap_dev); | 504 | ap_drv->remove(ap_dev); |
505 | spin_lock_bh(&ap_device_lock); | ||
506 | list_del_init(&ap_dev->list); | ||
507 | spin_unlock_bh(&ap_device_lock); | ||
500 | return 0; | 508 | return 0; |
501 | } | 509 | } |
502 | 510 | ||
@@ -772,6 +780,7 @@ static void ap_scan_bus(struct work_struct *unused) | |||
772 | spin_lock_init(&ap_dev->lock); | 780 | spin_lock_init(&ap_dev->lock); |
773 | INIT_LIST_HEAD(&ap_dev->pendingq); | 781 | INIT_LIST_HEAD(&ap_dev->pendingq); |
774 | INIT_LIST_HEAD(&ap_dev->requestq); | 782 | INIT_LIST_HEAD(&ap_dev->requestq); |
783 | INIT_LIST_HEAD(&ap_dev->list); | ||
775 | if (device_type == 0) | 784 | if (device_type == 0) |
776 | ap_probe_device_type(ap_dev); | 785 | ap_probe_device_type(ap_dev); |
777 | else | 786 | else |
@@ -1033,14 +1042,13 @@ static void ap_poll_timeout(unsigned long unused) | |||
1033 | * polling until bit 2^0 of the control flags is not set. If bit 2^1 | 1042 | * polling until bit 2^0 of the control flags is not set. If bit 2^1 |
1034 | * of the control flags has been set arm the poll timer. | 1043 | * of the control flags has been set arm the poll timer. |
1035 | */ | 1044 | */ |
1036 | static int __ap_poll_all(struct device *dev, void *data) | 1045 | static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags) |
1037 | { | 1046 | { |
1038 | struct ap_device *ap_dev = to_ap_dev(dev); | ||
1039 | int rc; | 1047 | int rc; |
1040 | 1048 | ||
1041 | spin_lock(&ap_dev->lock); | 1049 | spin_lock(&ap_dev->lock); |
1042 | if (!ap_dev->unregistered) { | 1050 | if (!ap_dev->unregistered) { |
1043 | rc = ap_poll_queue(to_ap_dev(dev), (unsigned long *) data); | 1051 | rc = ap_poll_queue(ap_dev, flags); |
1044 | if (rc) | 1052 | if (rc) |
1045 | ap_dev->unregistered = 1; | 1053 | ap_dev->unregistered = 1; |
1046 | } else | 1054 | } else |
@@ -1054,10 +1062,15 @@ static int __ap_poll_all(struct device *dev, void *data) | |||
1054 | static void ap_poll_all(unsigned long dummy) | 1062 | static void ap_poll_all(unsigned long dummy) |
1055 | { | 1063 | { |
1056 | unsigned long flags; | 1064 | unsigned long flags; |
1065 | struct ap_device *ap_dev; | ||
1057 | 1066 | ||
1058 | do { | 1067 | do { |
1059 | flags = 0; | 1068 | flags = 0; |
1060 | bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all); | 1069 | spin_lock(&ap_device_lock); |
1070 | list_for_each_entry(ap_dev, &ap_device_list, list) { | ||
1071 | __ap_poll_all(ap_dev, &flags); | ||
1072 | } | ||
1073 | spin_unlock(&ap_device_lock); | ||
1061 | } while (flags & 1); | 1074 | } while (flags & 1); |
1062 | if (flags & 2) | 1075 | if (flags & 2) |
1063 | ap_schedule_poll_timer(); | 1076 | ap_schedule_poll_timer(); |
@@ -1075,6 +1088,7 @@ static int ap_poll_thread(void *data) | |||
1075 | DECLARE_WAITQUEUE(wait, current); | 1088 | DECLARE_WAITQUEUE(wait, current); |
1076 | unsigned long flags; | 1089 | unsigned long flags; |
1077 | int requests; | 1090 | int requests; |
1091 | struct ap_device *ap_dev; | ||
1078 | 1092 | ||
1079 | set_user_nice(current, 19); | 1093 | set_user_nice(current, 19); |
1080 | while (1) { | 1094 | while (1) { |
@@ -1092,10 +1106,12 @@ static int ap_poll_thread(void *data) | |||
1092 | set_current_state(TASK_RUNNING); | 1106 | set_current_state(TASK_RUNNING); |
1093 | remove_wait_queue(&ap_poll_wait, &wait); | 1107 | remove_wait_queue(&ap_poll_wait, &wait); |
1094 | 1108 | ||
1095 | local_bh_disable(); | ||
1096 | flags = 0; | 1109 | flags = 0; |
1097 | bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all); | 1110 | spin_lock_bh(&ap_device_lock); |
1098 | local_bh_enable(); | 1111 | list_for_each_entry(ap_dev, &ap_device_list, list) { |
1112 | __ap_poll_all(ap_dev, &flags); | ||
1113 | } | ||
1114 | spin_unlock_bh(&ap_device_lock); | ||
1099 | } | 1115 | } |
1100 | set_current_state(TASK_RUNNING); | 1116 | set_current_state(TASK_RUNNING); |
1101 | remove_wait_queue(&ap_poll_wait, &wait); | 1117 | remove_wait_queue(&ap_poll_wait, &wait); |
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h index 83b69c01cd6e..008559ea742b 100644 --- a/drivers/s390/crypto/ap_bus.h +++ b/drivers/s390/crypto/ap_bus.h | |||
@@ -106,6 +106,7 @@ struct ap_device { | |||
106 | struct device device; | 106 | struct device device; |
107 | struct ap_driver *drv; /* Pointer to AP device driver. */ | 107 | struct ap_driver *drv; /* Pointer to AP device driver. */ |
108 | spinlock_t lock; /* Per device lock. */ | 108 | spinlock_t lock; /* Per device lock. */ |
109 | struct list_head list; /* private list of all AP devices. */ | ||
109 | 110 | ||
110 | ap_qid_t qid; /* AP queue id. */ | 111 | ap_qid_t qid; /* AP queue id. */ |
111 | int queue_depth; /* AP queue depth.*/ | 112 | int queue_depth; /* AP queue depth.*/ |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 99761391f340..e3625a47a596 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
@@ -298,14 +298,14 @@ static long zcrypt_rsa_modexpo(struct ica_rsa_modexpo *mex) | |||
298 | get_device(&zdev->ap_dev->device); | 298 | get_device(&zdev->ap_dev->device); |
299 | zdev->request_count++; | 299 | zdev->request_count++; |
300 | __zcrypt_decrease_preference(zdev); | 300 | __zcrypt_decrease_preference(zdev); |
301 | spin_unlock_bh(&zcrypt_device_lock); | ||
302 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { | 301 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { |
302 | spin_unlock_bh(&zcrypt_device_lock); | ||
303 | rc = zdev->ops->rsa_modexpo(zdev, mex); | 303 | rc = zdev->ops->rsa_modexpo(zdev, mex); |
304 | spin_lock_bh(&zcrypt_device_lock); | ||
304 | module_put(zdev->ap_dev->drv->driver.owner); | 305 | module_put(zdev->ap_dev->drv->driver.owner); |
305 | } | 306 | } |
306 | else | 307 | else |
307 | rc = -EAGAIN; | 308 | rc = -EAGAIN; |
308 | spin_lock_bh(&zcrypt_device_lock); | ||
309 | zdev->request_count--; | 309 | zdev->request_count--; |
310 | __zcrypt_increase_preference(zdev); | 310 | __zcrypt_increase_preference(zdev); |
311 | put_device(&zdev->ap_dev->device); | 311 | put_device(&zdev->ap_dev->device); |
@@ -373,14 +373,14 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt) | |||
373 | get_device(&zdev->ap_dev->device); | 373 | get_device(&zdev->ap_dev->device); |
374 | zdev->request_count++; | 374 | zdev->request_count++; |
375 | __zcrypt_decrease_preference(zdev); | 375 | __zcrypt_decrease_preference(zdev); |
376 | spin_unlock_bh(&zcrypt_device_lock); | ||
377 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { | 376 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { |
377 | spin_unlock_bh(&zcrypt_device_lock); | ||
378 | rc = zdev->ops->rsa_modexpo_crt(zdev, crt); | 378 | rc = zdev->ops->rsa_modexpo_crt(zdev, crt); |
379 | spin_lock_bh(&zcrypt_device_lock); | ||
379 | module_put(zdev->ap_dev->drv->driver.owner); | 380 | module_put(zdev->ap_dev->drv->driver.owner); |
380 | } | 381 | } |
381 | else | 382 | else |
382 | rc = -EAGAIN; | 383 | rc = -EAGAIN; |
383 | spin_lock_bh(&zcrypt_device_lock); | ||
384 | zdev->request_count--; | 384 | zdev->request_count--; |
385 | __zcrypt_increase_preference(zdev); | 385 | __zcrypt_increase_preference(zdev); |
386 | put_device(&zdev->ap_dev->device); | 386 | put_device(&zdev->ap_dev->device); |
@@ -408,14 +408,14 @@ static long zcrypt_send_cprb(struct ica_xcRB *xcRB) | |||
408 | get_device(&zdev->ap_dev->device); | 408 | get_device(&zdev->ap_dev->device); |
409 | zdev->request_count++; | 409 | zdev->request_count++; |
410 | __zcrypt_decrease_preference(zdev); | 410 | __zcrypt_decrease_preference(zdev); |
411 | spin_unlock_bh(&zcrypt_device_lock); | ||
412 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { | 411 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { |
412 | spin_unlock_bh(&zcrypt_device_lock); | ||
413 | rc = zdev->ops->send_cprb(zdev, xcRB); | 413 | rc = zdev->ops->send_cprb(zdev, xcRB); |
414 | spin_lock_bh(&zcrypt_device_lock); | ||
414 | module_put(zdev->ap_dev->drv->driver.owner); | 415 | module_put(zdev->ap_dev->drv->driver.owner); |
415 | } | 416 | } |
416 | else | 417 | else |
417 | rc = -EAGAIN; | 418 | rc = -EAGAIN; |
418 | spin_lock_bh(&zcrypt_device_lock); | ||
419 | zdev->request_count--; | 419 | zdev->request_count--; |
420 | __zcrypt_increase_preference(zdev); | 420 | __zcrypt_increase_preference(zdev); |
421 | put_device(&zdev->ap_dev->device); | 421 | put_device(&zdev->ap_dev->device); |
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index e95c281f1e36..84b108d7c7fd 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h | |||
@@ -873,7 +873,7 @@ qeth_realloc_headroom(struct qeth_card *card, struct sk_buff *skb, int size) | |||
873 | } | 873 | } |
874 | 874 | ||
875 | static inline struct sk_buff * | 875 | static inline struct sk_buff * |
876 | qeth_pskb_unshare(struct sk_buff *skb, int pri) | 876 | qeth_pskb_unshare(struct sk_buff *skb, gfp_t pri) |
877 | { | 877 | { |
878 | struct sk_buff *nskb; | 878 | struct sk_buff *nskb; |
879 | if (!skb_cloned(skb)) | 879 | if (!skb_cloned(skb)) |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index c275dcac3f18..939de0de18bc 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -452,10 +452,22 @@ store_rescan_field (struct device *dev, struct device_attribute *attr, const cha | |||
452 | } | 452 | } |
453 | static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field); | 453 | static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field); |
454 | 454 | ||
455 | static void sdev_store_delete_callback(struct device *dev) | ||
456 | { | ||
457 | scsi_remove_device(to_scsi_device(dev)); | ||
458 | } | ||
459 | |||
455 | static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf, | 460 | static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf, |
456 | size_t count) | 461 | size_t count) |
457 | { | 462 | { |
458 | scsi_remove_device(to_scsi_device(dev)); | 463 | int rc; |
464 | |||
465 | /* An attribute cannot be unregistered by one of its own methods, | ||
466 | * so we have to use this roundabout approach. | ||
467 | */ | ||
468 | rc = device_schedule_callback(dev, sdev_store_delete_callback); | ||
469 | if (rc) | ||
470 | count = rc; | ||
459 | return count; | 471 | return count; |
460 | }; | 472 | }; |
461 | static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete); | 473 | static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete); |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index c53b69610a51..46c40bbc4bc6 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -17,6 +17,9 @@ | |||
17 | * License. See the file "COPYING" in the main directory of this archive | 17 | * License. See the file "COPYING" in the main directory of this archive |
18 | * for more details. | 18 | * for more details. |
19 | */ | 19 | */ |
20 | #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | ||
21 | #define SUPPORT_SYSRQ | ||
22 | #endif | ||
20 | 23 | ||
21 | #undef DEBUG | 24 | #undef DEBUG |
22 | 25 | ||
@@ -49,11 +52,6 @@ | |||
49 | #endif | 52 | #endif |
50 | 53 | ||
51 | #include <asm/sci.h> | 54 | #include <asm/sci.h> |
52 | |||
53 | #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | ||
54 | #define SUPPORT_SYSRQ | ||
55 | #endif | ||
56 | |||
57 | #include "sh-sci.h" | 55 | #include "sh-sci.h" |
58 | 56 | ||
59 | struct sci_port { | 57 | struct sci_port { |
@@ -645,6 +643,9 @@ static inline int sci_handle_breaks(struct uart_port *port) | |||
645 | struct tty_struct *tty = port->info->tty; | 643 | struct tty_struct *tty = port->info->tty; |
646 | struct sci_port *s = &sci_ports[port->line]; | 644 | struct sci_port *s = &sci_ports[port->line]; |
647 | 645 | ||
646 | if (uart_handle_break(port)) | ||
647 | return 0; | ||
648 | |||
648 | if (!s->break_flag && status & SCxSR_BRK(port)) { | 649 | if (!s->break_flag && status & SCxSR_BRK(port)) { |
649 | #if defined(CONFIG_CPU_SH3) | 650 | #if defined(CONFIG_CPU_SH3) |
650 | /* Debounce break */ | 651 | /* Debounce break */ |
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 253ceb895ca7..a27e9e92cb5e 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c | |||
@@ -636,25 +636,6 @@ static irqreturn_t sn_sal_interrupt(int irq, void *dev_id) | |||
636 | } | 636 | } |
637 | 637 | ||
638 | /** | 638 | /** |
639 | * sn_sal_connect_interrupt - Request interrupt, handled by sn_sal_interrupt | ||
640 | * @port: Our sn_cons_port (which contains the uart port) | ||
641 | * | ||
642 | * returns the console irq if interrupt is successfully registered, else 0 | ||
643 | * | ||
644 | */ | ||
645 | static int sn_sal_connect_interrupt(struct sn_cons_port *port) | ||
646 | { | ||
647 | if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, | ||
648 | IRQF_DISABLED | IRQF_SHARED, | ||
649 | "SAL console driver", port) >= 0) { | ||
650 | return SGI_UART_VECTOR; | ||
651 | } | ||
652 | |||
653 | printk(KERN_INFO "sn_console: console proceeding in polled mode\n"); | ||
654 | return 0; | ||
655 | } | ||
656 | |||
657 | /** | ||
658 | * sn_sal_timer_poll - this function handles polled console mode | 639 | * sn_sal_timer_poll - this function handles polled console mode |
659 | * @data: A pointer to our sn_cons_port (which contains the uart port) | 640 | * @data: A pointer to our sn_cons_port (which contains the uart port) |
660 | * | 641 | * |
@@ -746,30 +727,31 @@ static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port) | |||
746 | * mode. We were previously in asynch/polling mode (using init_timer). | 727 | * mode. We were previously in asynch/polling mode (using init_timer). |
747 | * | 728 | * |
748 | * We attempt to switch to interrupt mode here by calling | 729 | * We attempt to switch to interrupt mode here by calling |
749 | * sn_sal_connect_interrupt. If that works out, we enable receive interrupts. | 730 | * request_irq. If that works out, we enable receive interrupts. |
750 | */ | 731 | */ |
751 | static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) | 732 | static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) |
752 | { | 733 | { |
753 | int irq; | ||
754 | unsigned long flags; | 734 | unsigned long flags; |
755 | 735 | ||
756 | if (!port) | 736 | if (port) { |
757 | return; | 737 | DPRINTF("sn_console: switching to interrupt driven console\n"); |
758 | |||
759 | DPRINTF("sn_console: switching to interrupt driven console\n"); | ||
760 | |||
761 | spin_lock_irqsave(&port->sc_port.lock, flags); | ||
762 | 738 | ||
763 | irq = sn_sal_connect_interrupt(port); | 739 | if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, |
740 | IRQF_DISABLED | IRQF_SHARED, | ||
741 | "SAL console driver", port) >= 0) { | ||
742 | spin_lock_irqsave(&port->sc_port.lock, flags); | ||
743 | port->sc_port.irq = SGI_UART_VECTOR; | ||
744 | port->sc_ops = &intr_ops; | ||
764 | 745 | ||
765 | if (irq) { | 746 | /* turn on receive interrupts */ |
766 | port->sc_port.irq = irq; | 747 | ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); |
767 | port->sc_ops = &intr_ops; | 748 | spin_unlock_irqrestore(&port->sc_port.lock, flags); |
768 | 749 | } | |
769 | /* turn on receive interrupts */ | 750 | else { |
770 | ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); | 751 | printk(KERN_INFO |
752 | "sn_console: console proceeding in polled mode\n"); | ||
753 | } | ||
771 | } | 754 | } |
772 | spin_unlock_irqrestore(&port->sc_port.lock, flags); | ||
773 | } | 755 | } |
774 | 756 | ||
775 | /* | 757 | /* |
diff --git a/drivers/spi/at25.c b/drivers/spi/at25.c index 48e4f48e779f..8efa07e8b8c2 100644 --- a/drivers/spi/at25.c +++ b/drivers/spi/at25.c | |||
@@ -291,7 +291,7 @@ static int at25_probe(struct spi_device *spi) | |||
291 | */ | 291 | */ |
292 | sr = spi_w8r8(spi, AT25_RDSR); | 292 | sr = spi_w8r8(spi, AT25_RDSR); |
293 | if (sr < 0 || sr & AT25_SR_nRDY) { | 293 | if (sr < 0 || sr & AT25_SR_nRDY) { |
294 | dev_dbg(&at25->spi->dev, "rdsr --> %d (%02x)\n", sr, sr); | 294 | dev_dbg(&spi->dev, "rdsr --> %d (%02x)\n", sr, sr); |
295 | err = -ENXIO; | 295 | err = -ENXIO; |
296 | goto fail; | 296 | goto fail; |
297 | } | 297 | } |
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 6fa260d1a9be..66e7bc985797 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
@@ -425,7 +425,7 @@ static int atmel_spi_setup(struct spi_device *spi) | |||
425 | if (ret) | 425 | if (ret) |
426 | return ret; | 426 | return ret; |
427 | spi->controller_state = (void *)npcs_pin; | 427 | spi->controller_state = (void *)npcs_pin; |
428 | gpio_direction_output(npcs_pin); | 428 | gpio_direction_output(npcs_pin, !(spi->mode & SPI_CS_HIGH)); |
429 | } | 429 | } |
430 | 430 | ||
431 | dev_dbg(&spi->dev, | 431 | dev_dbg(&spi->dev, |
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 24a330d82395..88425e1af4d3 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c | |||
@@ -302,10 +302,6 @@ static void bitbang_work(struct work_struct *work) | |||
302 | setup_transfer = NULL; | 302 | setup_transfer = NULL; |
303 | 303 | ||
304 | list_for_each_entry (t, &m->transfers, transfer_list) { | 304 | list_for_each_entry (t, &m->transfers, transfer_list) { |
305 | if (bitbang->shutdown) { | ||
306 | status = -ESHUTDOWN; | ||
307 | break; | ||
308 | } | ||
309 | 305 | ||
310 | /* override or restore speed and wordsize */ | 306 | /* override or restore speed and wordsize */ |
311 | if (t->speed_hz || t->bits_per_word) { | 307 | if (t->speed_hz || t->bits_per_word) { |
@@ -410,8 +406,6 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m) | |||
410 | m->status = -EINPROGRESS; | 406 | m->status = -EINPROGRESS; |
411 | 407 | ||
412 | bitbang = spi_master_get_devdata(spi->master); | 408 | bitbang = spi_master_get_devdata(spi->master); |
413 | if (bitbang->shutdown) | ||
414 | return -ESHUTDOWN; | ||
415 | 409 | ||
416 | spin_lock_irqsave(&bitbang->lock, flags); | 410 | spin_lock_irqsave(&bitbang->lock, flags); |
417 | if (!spi->max_speed_hz) | 411 | if (!spi->max_speed_hz) |
@@ -507,28 +501,12 @@ EXPORT_SYMBOL_GPL(spi_bitbang_start); | |||
507 | */ | 501 | */ |
508 | int spi_bitbang_stop(struct spi_bitbang *bitbang) | 502 | int spi_bitbang_stop(struct spi_bitbang *bitbang) |
509 | { | 503 | { |
510 | unsigned limit = 500; | 504 | spi_unregister_master(bitbang->master); |
511 | |||
512 | spin_lock_irq(&bitbang->lock); | ||
513 | bitbang->shutdown = 0; | ||
514 | while (!list_empty(&bitbang->queue) && limit--) { | ||
515 | spin_unlock_irq(&bitbang->lock); | ||
516 | 505 | ||
517 | dev_dbg(bitbang->master->cdev.dev, "wait for queue\n"); | 506 | WARN_ON(!list_empty(&bitbang->queue)); |
518 | msleep(10); | ||
519 | |||
520 | spin_lock_irq(&bitbang->lock); | ||
521 | } | ||
522 | spin_unlock_irq(&bitbang->lock); | ||
523 | if (!list_empty(&bitbang->queue)) { | ||
524 | dev_err(bitbang->master->cdev.dev, "queue didn't empty\n"); | ||
525 | return -EBUSY; | ||
526 | } | ||
527 | 507 | ||
528 | destroy_workqueue(bitbang->workqueue); | 508 | destroy_workqueue(bitbang->workqueue); |
529 | 509 | ||
530 | spi_unregister_master(bitbang->master); | ||
531 | |||
532 | return 0; | 510 | return 0; |
533 | } | 511 | } |
534 | EXPORT_SYMBOL_GPL(spi_bitbang_stop); | 512 | EXPORT_SYMBOL_GPL(spi_bitbang_stop); |
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 651379c51ae6..220abce63e4a 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -41,7 +41,7 @@ struct s3c24xx_spi { | |||
41 | int len; | 41 | int len; |
42 | int count; | 42 | int count; |
43 | 43 | ||
44 | int (*set_cs)(struct s3c2410_spi_info *spi, | 44 | void (*set_cs)(struct s3c2410_spi_info *spi, |
45 | int cs, int pol); | 45 | int cs, int pol); |
46 | 46 | ||
47 | /* data buffers */ | 47 | /* data buffers */ |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index d38a25f36ea5..31ae661e586a 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -332,9 +332,9 @@ static void acm_rx_tasklet(unsigned long _acm) | |||
332 | if (!ACM_READY(acm)) | 332 | if (!ACM_READY(acm)) |
333 | return; | 333 | return; |
334 | 334 | ||
335 | spin_lock(&acm->throttle_lock); | 335 | spin_lock_irqsave(&acm->throttle_lock, flags); |
336 | throttled = acm->throttle; | 336 | throttled = acm->throttle; |
337 | spin_unlock(&acm->throttle_lock); | 337 | spin_unlock_irqrestore(&acm->throttle_lock, flags); |
338 | if (throttled) | 338 | if (throttled) |
339 | return; | 339 | return; |
340 | 340 | ||
@@ -352,9 +352,9 @@ next_buffer: | |||
352 | dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size); | 352 | dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size); |
353 | 353 | ||
354 | tty_buffer_request_room(tty, buf->size); | 354 | tty_buffer_request_room(tty, buf->size); |
355 | spin_lock(&acm->throttle_lock); | 355 | spin_lock_irqsave(&acm->throttle_lock, flags); |
356 | throttled = acm->throttle; | 356 | throttled = acm->throttle; |
357 | spin_unlock(&acm->throttle_lock); | 357 | spin_unlock_irqrestore(&acm->throttle_lock, flags); |
358 | if (!throttled) | 358 | if (!throttled) |
359 | tty_insert_flip_string(tty, buf->base, buf->size); | 359 | tty_insert_flip_string(tty, buf->base, buf->size); |
360 | tty_flip_buffer_push(tty); | 360 | tty_flip_buffer_push(tty); |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 63e50a1f1396..6584cf00f7f3 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -202,6 +202,7 @@ struct quirk_printer_struct { | |||
202 | 202 | ||
203 | #define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */ | 203 | #define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */ |
204 | #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */ | 204 | #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */ |
205 | #define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific Class or SubClass */ | ||
205 | 206 | ||
206 | static const struct quirk_printer_struct quirk_printers[] = { | 207 | static const struct quirk_printer_struct quirk_printers[] = { |
207 | { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */ | 208 | { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */ |
@@ -218,6 +219,7 @@ static const struct quirk_printer_struct quirk_printers[] = { | |||
218 | { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */ | 219 | { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */ |
219 | { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ | 220 | { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ |
220 | { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */ | 221 | { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */ |
222 | { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */ | ||
221 | { 0, 0 } | 223 | { 0, 0 } |
222 | }; | 224 | }; |
223 | 225 | ||
@@ -1048,7 +1050,8 @@ static int usblp_select_alts(struct usblp *usblp) | |||
1048 | ifd = &if_alt->altsetting[i]; | 1050 | ifd = &if_alt->altsetting[i]; |
1049 | 1051 | ||
1050 | if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1) | 1052 | if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1) |
1051 | continue; | 1053 | if (!(usblp->quirks & USBLP_QUIRK_BAD_CLASS)) |
1054 | continue; | ||
1052 | 1055 | ||
1053 | if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL || | 1056 | if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL || |
1054 | ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL) | 1057 | ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL) |
@@ -1232,6 +1235,7 @@ static struct usb_device_id usblp_ids [] = { | |||
1232 | { USB_INTERFACE_INFO(7, 1, 1) }, | 1235 | { USB_INTERFACE_INFO(7, 1, 1) }, |
1233 | { USB_INTERFACE_INFO(7, 1, 2) }, | 1236 | { USB_INTERFACE_INFO(7, 1, 2) }, |
1234 | { USB_INTERFACE_INFO(7, 1, 3) }, | 1237 | { USB_INTERFACE_INFO(7, 1, 3) }, |
1238 | { USB_DEVICE(0x04b8, 0x0202) }, /* Seiko Epson Receipt Printer M129C */ | ||
1235 | { } /* Terminating entry */ | 1239 | { } /* Terminating entry */ |
1236 | }; | 1240 | }; |
1237 | 1241 | ||
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 274f14f1633e..36e7a843bf91 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -912,7 +912,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
912 | struct async *as; | 912 | struct async *as; |
913 | struct usb_ctrlrequest *dr = NULL; | 913 | struct usb_ctrlrequest *dr = NULL; |
914 | unsigned int u, totlen, isofrmlen; | 914 | unsigned int u, totlen, isofrmlen; |
915 | int ret, interval = 0, ifnum = -1; | 915 | int ret, ifnum = -1; |
916 | 916 | ||
917 | if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP|USBDEVFS_URB_SHORT_NOT_OK| | 917 | if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP|USBDEVFS_URB_SHORT_NOT_OK| |
918 | URB_NO_FSBR|URB_ZERO_PACKET)) | 918 | URB_NO_FSBR|URB_ZERO_PACKET)) |
@@ -992,7 +992,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
992 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | 992 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) |
993 | != USB_ENDPOINT_XFER_ISOC) | 993 | != USB_ENDPOINT_XFER_ISOC) |
994 | return -EINVAL; | 994 | return -EINVAL; |
995 | interval = 1 << min (15, ep->desc.bInterval - 1); | ||
996 | isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) * uurb->number_of_packets; | 995 | isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) * uurb->number_of_packets; |
997 | if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL))) | 996 | if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL))) |
998 | return -ENOMEM; | 997 | return -ENOMEM; |
@@ -1021,10 +1020,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
1021 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | 1020 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) |
1022 | != USB_ENDPOINT_XFER_INT) | 1021 | != USB_ENDPOINT_XFER_INT) |
1023 | return -EINVAL; | 1022 | return -EINVAL; |
1024 | if (ps->dev->speed == USB_SPEED_HIGH) | ||
1025 | interval = 1 << min (15, ep->desc.bInterval - 1); | ||
1026 | else | ||
1027 | interval = ep->desc.bInterval; | ||
1028 | if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) | 1023 | if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) |
1029 | return -EINVAL; | 1024 | return -EINVAL; |
1030 | if (!access_ok((uurb->endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb->buffer, uurb->buffer_length)) | 1025 | if (!access_ok((uurb->endpoint & USB_DIR_IN) ? VERIFY_WRITE : VERIFY_READ, uurb->buffer, uurb->buffer_length)) |
@@ -1053,7 +1048,11 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
1053 | as->urb->setup_packet = (unsigned char*)dr; | 1048 | as->urb->setup_packet = (unsigned char*)dr; |
1054 | as->urb->start_frame = uurb->start_frame; | 1049 | as->urb->start_frame = uurb->start_frame; |
1055 | as->urb->number_of_packets = uurb->number_of_packets; | 1050 | as->urb->number_of_packets = uurb->number_of_packets; |
1056 | as->urb->interval = interval; | 1051 | if (uurb->type == USBDEVFS_URB_TYPE_ISO || |
1052 | ps->dev->speed == USB_SPEED_HIGH) | ||
1053 | as->urb->interval = 1 << min(15, ep->desc.bInterval - 1); | ||
1054 | else | ||
1055 | as->urb->interval = ep->desc.bInterval; | ||
1057 | as->urb->context = as; | 1056 | as->urb->context = as; |
1058 | as->urb->complete = async_completed; | 1057 | as->urb->complete = async_completed; |
1059 | for (totlen = u = 0; u < uurb->number_of_packets; u++) { | 1058 | for (totlen = u = 0; u < uurb->number_of_packets; u++) { |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 41400743ce2c..b89a98e61323 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1281,12 +1281,6 @@ int usb_new_device(struct usb_device *udev) | |||
1281 | { | 1281 | { |
1282 | int err; | 1282 | int err; |
1283 | 1283 | ||
1284 | /* Lock ourself into memory in order to keep a probe sequence | ||
1285 | * sleeping in a new thread from allowing us to be unloaded. | ||
1286 | */ | ||
1287 | if (!try_module_get(THIS_MODULE)) | ||
1288 | return -EINVAL; | ||
1289 | |||
1290 | /* Determine quirks */ | 1284 | /* Determine quirks */ |
1291 | usb_detect_quirks(udev); | 1285 | usb_detect_quirks(udev); |
1292 | 1286 | ||
@@ -1390,7 +1384,6 @@ int usb_new_device(struct usb_device *udev) | |||
1390 | usb_autoresume_device(udev->parent); | 1384 | usb_autoresume_device(udev->parent); |
1391 | 1385 | ||
1392 | exit: | 1386 | exit: |
1393 | module_put(THIS_MODULE); | ||
1394 | return err; | 1387 | return err; |
1395 | 1388 | ||
1396 | fail: | 1389 | fail: |
@@ -2443,7 +2436,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, | |||
2443 | 2436 | ||
2444 | if (portchange & USB_PORT_STAT_C_CONNECTION) { | 2437 | if (portchange & USB_PORT_STAT_C_CONNECTION) { |
2445 | status = hub_port_debounce(hub, port1); | 2438 | status = hub_port_debounce(hub, port1); |
2446 | if (status < 0) { | 2439 | if (status < 0 && printk_ratelimit()) { |
2447 | dev_err (hub_dev, | 2440 | dev_err (hub_dev, |
2448 | "connect-debounce failed, port %d disabled\n", | 2441 | "connect-debounce failed, port %d disabled\n", |
2449 | port1); | 2442 | port1); |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 2f17468b5c1e..217a3d6d0a06 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -221,10 +221,15 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, | |||
221 | 221 | ||
222 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 222 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
223 | USB_ENDPOINT_XFER_INT) { | 223 | USB_ENDPOINT_XFER_INT) { |
224 | int interval; | ||
225 | |||
226 | if (usb_dev->speed == USB_SPEED_HIGH) | ||
227 | interval = 1 << min(15, ep->desc.bInterval - 1); | ||
228 | else | ||
229 | interval = ep->desc.bInterval; | ||
224 | pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); | 230 | pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); |
225 | usb_fill_int_urb(urb, usb_dev, pipe, data, len, | 231 | usb_fill_int_urb(urb, usb_dev, pipe, data, len, |
226 | usb_api_blocking_completion, NULL, | 232 | usb_api_blocking_completion, NULL, interval); |
227 | ep->desc.bInterval); | ||
228 | } else | 233 | } else |
229 | usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, | 234 | usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, |
230 | usb_api_blocking_completion, NULL); | 235 | usb_api_blocking_completion, NULL); |
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index a4677802fb20..2a6e3163d944 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -1835,7 +1835,7 @@ static int at91udc_resume(struct platform_device *pdev) | |||
1835 | #define at91udc_resume NULL | 1835 | #define at91udc_resume NULL |
1836 | #endif | 1836 | #endif |
1837 | 1837 | ||
1838 | static struct platform_driver at91_udc = { | 1838 | static struct platform_driver at91_udc_driver = { |
1839 | .remove = __exit_p(at91udc_remove), | 1839 | .remove = __exit_p(at91udc_remove), |
1840 | .shutdown = at91udc_shutdown, | 1840 | .shutdown = at91udc_shutdown, |
1841 | .suspend = at91udc_suspend, | 1841 | .suspend = at91udc_suspend, |
@@ -1848,13 +1848,13 @@ static struct platform_driver at91_udc = { | |||
1848 | 1848 | ||
1849 | static int __init udc_init_module(void) | 1849 | static int __init udc_init_module(void) |
1850 | { | 1850 | { |
1851 | return platform_driver_probe(&at91_udc, at91udc_probe); | 1851 | return platform_driver_probe(&at91_udc_driver, at91udc_probe); |
1852 | } | 1852 | } |
1853 | module_init(udc_init_module); | 1853 | module_init(udc_init_module); |
1854 | 1854 | ||
1855 | static void __exit udc_exit_module(void) | 1855 | static void __exit udc_exit_module(void) |
1856 | { | 1856 | { |
1857 | platform_driver_unregister(&at91_udc); | 1857 | platform_driver_unregister(&at91_udc_driver); |
1858 | } | 1858 | } |
1859 | module_exit(udc_exit_module); | 1859 | module_exit(udc_exit_module); |
1860 | 1860 | ||
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index 7b3a326b57ab..65c91d3735de 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -297,27 +297,6 @@ goku_free_request(struct usb_ep *_ep, struct usb_request *_req) | |||
297 | 297 | ||
298 | /*-------------------------------------------------------------------------*/ | 298 | /*-------------------------------------------------------------------------*/ |
299 | 299 | ||
300 | #undef USE_KMALLOC | ||
301 | |||
302 | /* many common platforms have dma-coherent caches, which means that it's | ||
303 | * safe to use kmalloc() memory for all i/o buffers without using any | ||
304 | * cache flushing calls. (unless you're trying to share cache lines | ||
305 | * between dma and non-dma activities, which is a slow idea in any case.) | ||
306 | * | ||
307 | * other platforms need more care, with 2.6 having a moderately general | ||
308 | * solution except for the common "buffer is smaller than a page" case. | ||
309 | */ | ||
310 | #if defined(CONFIG_X86) | ||
311 | #define USE_KMALLOC | ||
312 | |||
313 | #elif defined(CONFIG_MIPS) && !defined(CONFIG_DMA_NONCOHERENT) | ||
314 | #define USE_KMALLOC | ||
315 | |||
316 | #elif defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE) | ||
317 | #define USE_KMALLOC | ||
318 | |||
319 | #endif | ||
320 | |||
321 | /* allocating buffers this way eliminates dma mapping overhead, which | 300 | /* allocating buffers this way eliminates dma mapping overhead, which |
322 | * on some platforms will mean eliminating a per-io buffer copy. with | 301 | * on some platforms will mean eliminating a per-io buffer copy. with |
323 | * some kinds of system caches, further tweaks may still be needed. | 302 | * some kinds of system caches, further tweaks may still be needed. |
@@ -334,11 +313,6 @@ goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes, | |||
334 | return NULL; | 313 | return NULL; |
335 | *dma = DMA_ADDR_INVALID; | 314 | *dma = DMA_ADDR_INVALID; |
336 | 315 | ||
337 | #if defined(USE_KMALLOC) | ||
338 | retval = kmalloc(bytes, gfp_flags); | ||
339 | if (retval) | ||
340 | *dma = virt_to_phys(retval); | ||
341 | #else | ||
342 | if (ep->dma) { | 316 | if (ep->dma) { |
343 | /* the main problem with this call is that it wastes memory | 317 | /* the main problem with this call is that it wastes memory |
344 | * on typical 1/N page allocations: it allocates 1-N pages. | 318 | * on typical 1/N page allocations: it allocates 1-N pages. |
@@ -348,7 +322,6 @@ goku_alloc_buffer(struct usb_ep *_ep, unsigned bytes, | |||
348 | bytes, dma, gfp_flags); | 322 | bytes, dma, gfp_flags); |
349 | } else | 323 | } else |
350 | retval = kmalloc(bytes, gfp_flags); | 324 | retval = kmalloc(bytes, gfp_flags); |
351 | #endif | ||
352 | return retval; | 325 | return retval; |
353 | } | 326 | } |
354 | 327 | ||
@@ -356,7 +329,6 @@ static void | |||
356 | goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes) | 329 | goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes) |
357 | { | 330 | { |
358 | /* free memory into the right allocator */ | 331 | /* free memory into the right allocator */ |
359 | #ifndef USE_KMALLOC | ||
360 | if (dma != DMA_ADDR_INVALID) { | 332 | if (dma != DMA_ADDR_INVALID) { |
361 | struct goku_ep *ep; | 333 | struct goku_ep *ep; |
362 | 334 | ||
@@ -365,7 +337,6 @@ goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes) | |||
365 | return; | 337 | return; |
366 | dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma); | 338 | dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma); |
367 | } else | 339 | } else |
368 | #endif | ||
369 | kfree (buf); | 340 | kfree (buf); |
370 | } | 341 | } |
371 | 342 | ||
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 9af529d22b3e..1813b7cac294 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -653,8 +653,7 @@ static int ehci_hub_control ( | |||
653 | if (status & ~0xffff) /* only if wPortChange is interesting */ | 653 | if (status & ~0xffff) /* only if wPortChange is interesting */ |
654 | #endif | 654 | #endif |
655 | dbg_port (ehci, "GetStatus", wIndex + 1, temp); | 655 | dbg_port (ehci, "GetStatus", wIndex + 1, temp); |
656 | // we "know" this alignment is good, caller used kmalloc()... | 656 | put_unaligned(cpu_to_le32 (status), (__le32 *) buf); |
657 | *((__le32 *) buf) = cpu_to_le32 (status); | ||
658 | break; | 657 | break; |
659 | case SetHubFeature: | 658 | case SetHubFeature: |
660 | switch (wValue) { | 659 | switch (wValue) { |
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c index bacc25c53ba3..8e4427aebb14 100644 --- a/drivers/usb/host/uhci-hub.c +++ b/drivers/usb/host/uhci-hub.c | |||
@@ -33,6 +33,9 @@ static __u8 root_hub_hub_des[] = | |||
33 | /* status change bits: nonzero writes will clear */ | 33 | /* status change bits: nonzero writes will clear */ |
34 | #define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC) | 34 | #define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC) |
35 | 35 | ||
36 | /* suspend/resume bits: port suspended or port resuming */ | ||
37 | #define SUSPEND_BITS (USBPORTSC_SUSP | USBPORTSC_RD) | ||
38 | |||
36 | /* A port that either is connected or has a changed-bit set will prevent | 39 | /* A port that either is connected or has a changed-bit set will prevent |
37 | * us from AUTO_STOPPING. | 40 | * us from AUTO_STOPPING. |
38 | */ | 41 | */ |
@@ -96,8 +99,8 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, | |||
96 | int status; | 99 | int status; |
97 | int i; | 100 | int i; |
98 | 101 | ||
99 | if (inw(port_addr) & (USBPORTSC_SUSP | USBPORTSC_RD)) { | 102 | if (inw(port_addr) & SUSPEND_BITS) { |
100 | CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD); | 103 | CLR_RH_PORTSTAT(SUSPEND_BITS); |
101 | if (test_bit(port, &uhci->resuming_ports)) | 104 | if (test_bit(port, &uhci->resuming_ports)) |
102 | set_bit(port, &uhci->port_c_suspend); | 105 | set_bit(port, &uhci->port_c_suspend); |
103 | 106 | ||
@@ -107,7 +110,7 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, | |||
107 | * Experiments show that some controllers take longer, so | 110 | * Experiments show that some controllers take longer, so |
108 | * we'll poll for completion. */ | 111 | * we'll poll for completion. */ |
109 | for (i = 0; i < 10; ++i) { | 112 | for (i = 0; i < 10; ++i) { |
110 | if (!(inw(port_addr) & USBPORTSC_RD)) | 113 | if (!(inw(port_addr) & SUSPEND_BITS)) |
111 | break; | 114 | break; |
112 | udelay(1); | 115 | udelay(1); |
113 | } | 116 | } |
@@ -289,7 +292,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
289 | wPortStatus |= USB_PORT_STAT_CONNECTION; | 292 | wPortStatus |= USB_PORT_STAT_CONNECTION; |
290 | if (status & USBPORTSC_PE) { | 293 | if (status & USBPORTSC_PE) { |
291 | wPortStatus |= USB_PORT_STAT_ENABLE; | 294 | wPortStatus |= USB_PORT_STAT_ENABLE; |
292 | if (status & (USBPORTSC_SUSP | USBPORTSC_RD)) | 295 | if (status & SUSPEND_BITS) |
293 | wPortStatus |= USB_PORT_STAT_SUSPEND; | 296 | wPortStatus |= USB_PORT_STAT_SUSPEND; |
294 | } | 297 | } |
295 | if (status & USBPORTSC_OC) | 298 | if (status & USBPORTSC_OC) |
diff --git a/drivers/usb/misc/berry_charge.c b/drivers/usb/misc/berry_charge.c index 60893c6c8221..b15f2fd8dab4 100644 --- a/drivers/usb/misc/berry_charge.c +++ b/drivers/usb/misc/berry_charge.c | |||
@@ -69,7 +69,7 @@ static int magic_charge(struct usb_device *udev) | |||
69 | return retval; | 69 | return retval; |
70 | } | 70 | } |
71 | 71 | ||
72 | dbg(&udev->dev, "Sending first magic command\n"); | 72 | dbg(&udev->dev, "Sending second magic command\n"); |
73 | retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 73 | retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
74 | 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100); | 74 | 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100); |
75 | if (retval != 0) { | 75 | if (retval != 0) { |
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 0c1d66ddb812..bc3327e3dd78 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c | |||
@@ -2905,17 +2905,31 @@ static int __init ftdi_elan_init(void) | |||
2905 | { | 2905 | { |
2906 | int result; | 2906 | int result; |
2907 | printk(KERN_INFO "driver %s built at %s on %s\n", ftdi_elan_driver.name, | 2907 | printk(KERN_INFO "driver %s built at %s on %s\n", ftdi_elan_driver.name, |
2908 | __TIME__, __DATE__); | 2908 | __TIME__, __DATE__); |
2909 | init_MUTEX(&ftdi_module_lock); | 2909 | init_MUTEX(&ftdi_module_lock); |
2910 | INIT_LIST_HEAD(&ftdi_static_list); | 2910 | INIT_LIST_HEAD(&ftdi_static_list); |
2911 | status_queue = create_singlethread_workqueue("ftdi-status-control"); | 2911 | status_queue = create_singlethread_workqueue("ftdi-status-control"); |
2912 | if (!status_queue) | ||
2913 | goto err1; | ||
2912 | command_queue = create_singlethread_workqueue("ftdi-command-engine"); | 2914 | command_queue = create_singlethread_workqueue("ftdi-command-engine"); |
2915 | if (!command_queue) | ||
2916 | goto err2; | ||
2913 | respond_queue = create_singlethread_workqueue("ftdi-respond-engine"); | 2917 | respond_queue = create_singlethread_workqueue("ftdi-respond-engine"); |
2918 | if (!respond_queue) | ||
2919 | goto err3; | ||
2914 | result = usb_register(&ftdi_elan_driver); | 2920 | result = usb_register(&ftdi_elan_driver); |
2915 | if (result) | 2921 | if (result) |
2916 | printk(KERN_ERR "usb_register failed. Error number %d\n", | 2922 | printk(KERN_ERR "usb_register failed. Error number %d\n", |
2917 | result); | 2923 | result); |
2918 | return result; | 2924 | return result; |
2925 | |||
2926 | err3: | ||
2927 | destroy_workqueue(command_queue); | ||
2928 | err2: | ||
2929 | destroy_workqueue(status_queue); | ||
2930 | err1: | ||
2931 | printk(KERN_ERR "%s couldn't create workqueue\n", ftdi_elan_driver.name); | ||
2932 | return -ENOMEM; | ||
2919 | } | 2933 | } |
2920 | 2934 | ||
2921 | static void __exit ftdi_elan_exit(void) | 2935 | static void __exit ftdi_elan_exit(void) |
diff --git a/drivers/usb/net/dm9601.c b/drivers/usb/net/dm9601.c index 4a932e1cd93b..5130cc7eb314 100644 --- a/drivers/usb/net/dm9601.c +++ b/drivers/usb/net/dm9601.c | |||
@@ -571,9 +571,21 @@ static const struct driver_info dm9601_info = { | |||
571 | 571 | ||
572 | static const struct usb_device_id products[] = { | 572 | static const struct usb_device_id products[] = { |
573 | { | 573 | { |
574 | USB_DEVICE(0x07aa, 0x9601), /* Corega FEther USB-TXC */ | ||
575 | .driver_info = (unsigned long)&dm9601_info, | ||
576 | }, | ||
577 | { | ||
574 | USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */ | 578 | USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */ |
575 | .driver_info = (unsigned long)&dm9601_info, | 579 | .driver_info = (unsigned long)&dm9601_info, |
576 | }, | 580 | }, |
581 | { | ||
582 | USB_DEVICE(0x0a46, 0x6688), /* ZT6688 USB NIC */ | ||
583 | .driver_info = (unsigned long)&dm9601_info, | ||
584 | }, | ||
585 | { | ||
586 | USB_DEVICE(0x0a46, 0x0268), /* ShanTou ST268 USB NIC */ | ||
587 | .driver_info = (unsigned long)&dm9601_info, | ||
588 | }, | ||
577 | {}, // END | 589 | {}, // END |
578 | }; | 590 | }; |
579 | 591 | ||
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c index 18816bf96a4d..7538c64a5097 100644 --- a/drivers/usb/serial/airprime.c +++ b/drivers/usb/serial/airprime.c | |||
@@ -18,10 +18,6 @@ | |||
18 | 18 | ||
19 | static struct usb_device_id id_table [] = { | 19 | static struct usb_device_id id_table [] = { |
20 | { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ | 20 | { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ |
21 | { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */ | ||
22 | { USB_DEVICE(0x1410, 0x1130) }, /* Novatel Wireless S720 CDMA/EV-DO */ | ||
23 | { USB_DEVICE(0x1410, 0x2110) }, /* Novatel Wireless U720 CDMA/EV-DO */ | ||
24 | { USB_DEVICE(0x1410, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ | ||
25 | { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */ | 21 | { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */ |
26 | { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ | 22 | { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ |
27 | { }, | 23 | { }, |
@@ -44,8 +40,43 @@ struct airprime_private { | |||
44 | int outstanding_urbs; | 40 | int outstanding_urbs; |
45 | int throttled; | 41 | int throttled; |
46 | struct urb *read_urbp[NUM_READ_URBS]; | 42 | struct urb *read_urbp[NUM_READ_URBS]; |
43 | |||
44 | /* Settings for the port */ | ||
45 | int rts_state; /* Handshaking pins (outputs) */ | ||
46 | int dtr_state; | ||
47 | int cts_state; /* Handshaking pins (inputs) */ | ||
48 | int dsr_state; | ||
49 | int dcd_state; | ||
50 | int ri_state; | ||
47 | }; | 51 | }; |
48 | 52 | ||
53 | static int airprime_send_setup(struct usb_serial_port *port) | ||
54 | { | ||
55 | struct usb_serial *serial = port->serial; | ||
56 | struct airprime_private *priv; | ||
57 | |||
58 | dbg("%s", __FUNCTION__); | ||
59 | |||
60 | if (port->number != 0) | ||
61 | return 0; | ||
62 | |||
63 | priv = usb_get_serial_port_data(port); | ||
64 | |||
65 | if (port->tty) { | ||
66 | int val = 0; | ||
67 | if (priv->dtr_state) | ||
68 | val |= 0x01; | ||
69 | if (priv->rts_state) | ||
70 | val |= 0x02; | ||
71 | |||
72 | return usb_control_msg(serial->dev, | ||
73 | usb_rcvctrlpipe(serial->dev, 0), | ||
74 | 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT); | ||
75 | } | ||
76 | |||
77 | return 0; | ||
78 | } | ||
79 | |||
49 | static void airprime_read_bulk_callback(struct urb *urb) | 80 | static void airprime_read_bulk_callback(struct urb *urb) |
50 | { | 81 | { |
51 | struct usb_serial_port *port = urb->context; | 82 | struct usb_serial_port *port = urb->context; |
@@ -118,6 +149,10 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp) | |||
118 | usb_set_serial_port_data(port, priv); | 149 | usb_set_serial_port_data(port, priv); |
119 | } | 150 | } |
120 | 151 | ||
152 | /* Set some sane defaults */ | ||
153 | priv->rts_state = 1; | ||
154 | priv->dtr_state = 1; | ||
155 | |||
121 | for (i = 0; i < NUM_READ_URBS; ++i) { | 156 | for (i = 0; i < NUM_READ_URBS; ++i) { |
122 | buffer = kmalloc(buffer_size, GFP_KERNEL); | 157 | buffer = kmalloc(buffer_size, GFP_KERNEL); |
123 | if (!buffer) { | 158 | if (!buffer) { |
@@ -151,6 +186,9 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp) | |||
151 | /* remember this urb so we can kill it when the port is closed */ | 186 | /* remember this urb so we can kill it when the port is closed */ |
152 | priv->read_urbp[i] = urb; | 187 | priv->read_urbp[i] = urb; |
153 | } | 188 | } |
189 | |||
190 | airprime_send_setup(port); | ||
191 | |||
154 | goto out; | 192 | goto out; |
155 | 193 | ||
156 | errout: | 194 | errout: |
@@ -176,6 +214,11 @@ static void airprime_close(struct usb_serial_port *port, struct file * filp) | |||
176 | 214 | ||
177 | dbg("%s - port %d", __FUNCTION__, port->number); | 215 | dbg("%s - port %d", __FUNCTION__, port->number); |
178 | 216 | ||
217 | priv->rts_state = 0; | ||
218 | priv->dtr_state = 0; | ||
219 | |||
220 | airprime_send_setup(port); | ||
221 | |||
179 | for (i = 0; i < NUM_READ_URBS; ++i) { | 222 | for (i = 0; i < NUM_READ_URBS; ++i) { |
180 | usb_kill_urb (priv->read_urbp[i]); | 223 | usb_kill_urb (priv->read_urbp[i]); |
181 | kfree (priv->read_urbp[i]->transfer_buffer); | 224 | kfree (priv->read_urbp[i]->transfer_buffer); |
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index db623e754899..d7d0ba986a80 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c | |||
@@ -63,6 +63,8 @@ static struct usb_device_id id_table [] = { | |||
63 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 63 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
64 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ | 64 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ |
65 | { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ | 65 | { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ |
66 | { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ | ||
67 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ | ||
66 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ | 68 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
67 | { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ | 69 | { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ |
68 | { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ | 70 | { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index c525b42dadde..1633a0fd48e8 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -315,6 +315,7 @@ static struct usb_device_id id_table_combined [] = { | |||
315 | { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, | 315 | { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, |
316 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, | 316 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, |
317 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, | 317 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, |
318 | { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, | ||
318 | { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, | 319 | { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, |
319 | { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, | 320 | { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, |
320 | { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, | 321 | { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, |
@@ -420,6 +421,14 @@ static struct usb_device_id id_table_combined [] = { | |||
420 | { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, | 421 | { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, |
421 | { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, | 422 | { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, |
422 | { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, | 423 | { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, |
424 | { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) }, | ||
425 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) }, | ||
426 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) }, | ||
427 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) }, | ||
428 | { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) }, | ||
429 | { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) }, | ||
430 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) }, | ||
431 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) }, | ||
423 | /* | 432 | /* |
424 | * These will probably use user-space drivers. Uncomment them if | 433 | * These will probably use user-space drivers. Uncomment them if |
425 | * you need them or use the user-specified vendor/product module | 434 | * you need them or use the user-specified vendor/product module |
@@ -459,6 +468,7 @@ static struct usb_device_id id_table_combined [] = { | |||
459 | { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, | 468 | { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, |
460 | { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, | 469 | { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, |
461 | { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, | 470 | { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, |
471 | { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, | ||
462 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, | 472 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, |
463 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, | 473 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, |
464 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, | 474 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, |
@@ -533,6 +543,7 @@ static const char *ftdi_chip_name[] = { | |||
533 | [FT8U232AM] = "FT8U232AM", | 543 | [FT8U232AM] = "FT8U232AM", |
534 | [FT232BM] = "FT232BM", | 544 | [FT232BM] = "FT232BM", |
535 | [FT2232C] = "FT2232C", | 545 | [FT2232C] = "FT2232C", |
546 | [FT232RL] = "FT232RL", | ||
536 | }; | 547 | }; |
537 | 548 | ||
538 | 549 | ||
@@ -588,6 +599,8 @@ struct ftdi_private { | |||
588 | static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id); | 599 | static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id); |
589 | static int ftdi_sio_attach (struct usb_serial *serial); | 600 | static int ftdi_sio_attach (struct usb_serial *serial); |
590 | static void ftdi_shutdown (struct usb_serial *serial); | 601 | static void ftdi_shutdown (struct usb_serial *serial); |
602 | static int ftdi_sio_port_probe (struct usb_serial_port *port); | ||
603 | static int ftdi_sio_port_remove (struct usb_serial_port *port); | ||
591 | static int ftdi_open (struct usb_serial_port *port, struct file *filp); | 604 | static int ftdi_open (struct usb_serial_port *port, struct file *filp); |
592 | static void ftdi_close (struct usb_serial_port *port, struct file *filp); | 605 | static void ftdi_close (struct usb_serial_port *port, struct file *filp); |
593 | static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count); | 606 | static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count); |
@@ -622,6 +635,8 @@ static struct usb_serial_driver ftdi_sio_device = { | |||
622 | .num_bulk_out = 1, | 635 | .num_bulk_out = 1, |
623 | .num_ports = 1, | 636 | .num_ports = 1, |
624 | .probe = ftdi_sio_probe, | 637 | .probe = ftdi_sio_probe, |
638 | .port_probe = ftdi_sio_port_probe, | ||
639 | .port_remove = ftdi_sio_port_remove, | ||
625 | .open = ftdi_open, | 640 | .open = ftdi_open, |
626 | .close = ftdi_close, | 641 | .close = ftdi_close, |
627 | .throttle = ftdi_throttle, | 642 | .throttle = ftdi_throttle, |
@@ -1024,11 +1039,10 @@ static ssize_t show_latency_timer(struct device *dev, struct device_attribute *a | |||
1024 | { | 1039 | { |
1025 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1040 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1026 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1041 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1027 | struct usb_device *udev; | 1042 | struct usb_device *udev = port->serial->dev; |
1028 | unsigned short latency = 0; | 1043 | unsigned short latency = 0; |
1029 | int rv = 0; | 1044 | int rv = 0; |
1030 | 1045 | ||
1031 | udev = to_usb_device(dev); | ||
1032 | 1046 | ||
1033 | dbg("%s",__FUNCTION__); | 1047 | dbg("%s",__FUNCTION__); |
1034 | 1048 | ||
@@ -1052,13 +1066,11 @@ static ssize_t store_latency_timer(struct device *dev, struct device_attribute * | |||
1052 | { | 1066 | { |
1053 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1067 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1054 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1068 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1055 | struct usb_device *udev; | 1069 | struct usb_device *udev = port->serial->dev; |
1056 | char buf[1]; | 1070 | char buf[1]; |
1057 | int v = simple_strtoul(valbuf, NULL, 10); | 1071 | int v = simple_strtoul(valbuf, NULL, 10); |
1058 | int rv = 0; | 1072 | int rv = 0; |
1059 | 1073 | ||
1060 | udev = to_usb_device(dev); | ||
1061 | |||
1062 | dbg("%s: setting latency timer = %i", __FUNCTION__, v); | 1074 | dbg("%s: setting latency timer = %i", __FUNCTION__, v); |
1063 | 1075 | ||
1064 | rv = usb_control_msg(udev, | 1076 | rv = usb_control_msg(udev, |
@@ -1083,13 +1095,11 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att | |||
1083 | { | 1095 | { |
1084 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1096 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1085 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1097 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1086 | struct usb_device *udev; | 1098 | struct usb_device *udev = port->serial->dev; |
1087 | char buf[1]; | 1099 | char buf[1]; |
1088 | int v = simple_strtoul(valbuf, NULL, 10); | 1100 | int v = simple_strtoul(valbuf, NULL, 10); |
1089 | int rv = 0; | 1101 | int rv = 0; |
1090 | 1102 | ||
1091 | udev = to_usb_device(dev); | ||
1092 | |||
1093 | dbg("%s: setting event char = %i", __FUNCTION__, v); | 1103 | dbg("%s: setting event char = %i", __FUNCTION__, v); |
1094 | 1104 | ||
1095 | rv = usb_control_msg(udev, | 1105 | rv = usb_control_msg(udev, |
@@ -1110,46 +1120,38 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att | |||
1110 | static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer); | 1120 | static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer); |
1111 | static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); | 1121 | static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); |
1112 | 1122 | ||
1113 | static int create_sysfs_attrs(struct usb_serial *serial) | 1123 | static int create_sysfs_attrs(struct usb_serial_port *port) |
1114 | { | 1124 | { |
1115 | struct ftdi_private *priv; | 1125 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1116 | struct usb_device *udev; | ||
1117 | int retval = 0; | 1126 | int retval = 0; |
1118 | 1127 | ||
1119 | dbg("%s",__FUNCTION__); | 1128 | dbg("%s",__FUNCTION__); |
1120 | 1129 | ||
1121 | priv = usb_get_serial_port_data(serial->port[0]); | ||
1122 | udev = serial->dev; | ||
1123 | |||
1124 | /* XXX I've no idea if the original SIO supports the event_char | 1130 | /* XXX I've no idea if the original SIO supports the event_char |
1125 | * sysfs parameter, so I'm playing it safe. */ | 1131 | * sysfs parameter, so I'm playing it safe. */ |
1126 | if (priv->chip_type != SIO) { | 1132 | if (priv->chip_type != SIO) { |
1127 | dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); | 1133 | dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); |
1128 | retval = device_create_file(&udev->dev, &dev_attr_event_char); | 1134 | retval = device_create_file(&port->dev, &dev_attr_event_char); |
1129 | if ((!retval) && | 1135 | if ((!retval) && |
1130 | (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) { | 1136 | (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) { |
1131 | retval = device_create_file(&udev->dev, | 1137 | retval = device_create_file(&port->dev, |
1132 | &dev_attr_latency_timer); | 1138 | &dev_attr_latency_timer); |
1133 | } | 1139 | } |
1134 | } | 1140 | } |
1135 | return retval; | 1141 | return retval; |
1136 | } | 1142 | } |
1137 | 1143 | ||
1138 | static void remove_sysfs_attrs(struct usb_serial *serial) | 1144 | static void remove_sysfs_attrs(struct usb_serial_port *port) |
1139 | { | 1145 | { |
1140 | struct ftdi_private *priv; | 1146 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1141 | struct usb_device *udev; | ||
1142 | 1147 | ||
1143 | dbg("%s",__FUNCTION__); | 1148 | dbg("%s",__FUNCTION__); |
1144 | 1149 | ||
1145 | priv = usb_get_serial_port_data(serial->port[0]); | ||
1146 | udev = serial->dev; | ||
1147 | |||
1148 | /* XXX see create_sysfs_attrs */ | 1150 | /* XXX see create_sysfs_attrs */ |
1149 | if (priv->chip_type != SIO) { | 1151 | if (priv->chip_type != SIO) { |
1150 | device_remove_file(&udev->dev, &dev_attr_event_char); | 1152 | device_remove_file(&port->dev, &dev_attr_event_char); |
1151 | if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { | 1153 | if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { |
1152 | device_remove_file(&udev->dev, &dev_attr_latency_timer); | 1154 | device_remove_file(&port->dev, &dev_attr_latency_timer); |
1153 | } | 1155 | } |
1154 | } | 1156 | } |
1155 | 1157 | ||
@@ -1169,13 +1171,9 @@ static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id | |||
1169 | return (0); | 1171 | return (0); |
1170 | } | 1172 | } |
1171 | 1173 | ||
1172 | /* attach subroutine */ | 1174 | static int ftdi_sio_port_probe(struct usb_serial_port *port) |
1173 | static int ftdi_sio_attach (struct usb_serial *serial) | ||
1174 | { | 1175 | { |
1175 | struct usb_serial_port *port = serial->port[0]; | ||
1176 | struct ftdi_private *priv; | 1176 | struct ftdi_private *priv; |
1177 | struct ftdi_sio_quirk *quirk; | ||
1178 | int retval; | ||
1179 | 1177 | ||
1180 | dbg("%s",__FUNCTION__); | 1178 | dbg("%s",__FUNCTION__); |
1181 | 1179 | ||
@@ -1215,19 +1213,21 @@ static int ftdi_sio_attach (struct usb_serial *serial) | |||
1215 | kfree(port->bulk_out_buffer); | 1213 | kfree(port->bulk_out_buffer); |
1216 | port->bulk_out_buffer = NULL; | 1214 | port->bulk_out_buffer = NULL; |
1217 | 1215 | ||
1218 | usb_set_serial_port_data(serial->port[0], priv); | 1216 | usb_set_serial_port_data(port, priv); |
1219 | 1217 | ||
1220 | ftdi_determine_type (serial->port[0]); | 1218 | ftdi_determine_type (port); |
1221 | retval = create_sysfs_attrs(serial); | 1219 | create_sysfs_attrs(port); |
1222 | if (retval) | 1220 | return 0; |
1223 | dev_err(&serial->dev->dev, "Error creating sysfs files, " | 1221 | } |
1224 | "continuing\n"); | ||
1225 | 1222 | ||
1223 | /* attach subroutine */ | ||
1224 | static int ftdi_sio_attach (struct usb_serial *serial) | ||
1225 | { | ||
1226 | /* Check for device requiring special set up. */ | 1226 | /* Check for device requiring special set up. */ |
1227 | quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial); | 1227 | struct ftdi_sio_quirk *quirk = usb_get_serial_data(serial); |
1228 | if (quirk && quirk->setup) { | 1228 | |
1229 | if (quirk && quirk->setup) | ||
1229 | quirk->setup(serial); | 1230 | quirk->setup(serial); |
1230 | } | ||
1231 | 1231 | ||
1232 | return 0; | 1232 | return 0; |
1233 | } /* ftdi_sio_attach */ | 1233 | } /* ftdi_sio_attach */ |
@@ -1271,17 +1271,18 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial) | |||
1271 | * calls __serial_close for each open of the port | 1271 | * calls __serial_close for each open of the port |
1272 | * shutdown is called then (ie ftdi_shutdown) | 1272 | * shutdown is called then (ie ftdi_shutdown) |
1273 | */ | 1273 | */ |
1274 | |||
1275 | |||
1276 | static void ftdi_shutdown (struct usb_serial *serial) | 1274 | static void ftdi_shutdown (struct usb_serial *serial) |
1277 | { /* ftdi_shutdown */ | 1275 | { |
1276 | dbg("%s", __FUNCTION__); | ||
1277 | } | ||
1278 | 1278 | ||
1279 | struct usb_serial_port *port = serial->port[0]; | 1279 | static int ftdi_sio_port_remove(struct usb_serial_port *port) |
1280 | { | ||
1280 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1281 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1281 | 1282 | ||
1282 | dbg("%s", __FUNCTION__); | 1283 | dbg("%s", __FUNCTION__); |
1283 | 1284 | ||
1284 | remove_sysfs_attrs(serial); | 1285 | remove_sysfs_attrs(port); |
1285 | 1286 | ||
1286 | /* all open ports are closed at this point | 1287 | /* all open ports are closed at this point |
1287 | * (by usbserial.c:__serial_close, which calls ftdi_close) | 1288 | * (by usbserial.c:__serial_close, which calls ftdi_close) |
@@ -1291,8 +1292,9 @@ static void ftdi_shutdown (struct usb_serial *serial) | |||
1291 | usb_set_serial_port_data(port, NULL); | 1292 | usb_set_serial_port_data(port, NULL); |
1292 | kfree(priv); | 1293 | kfree(priv); |
1293 | } | 1294 | } |
1294 | } /* ftdi_shutdown */ | ||
1295 | 1295 | ||
1296 | return 0; | ||
1297 | } | ||
1296 | 1298 | ||
1297 | static int ftdi_open (struct usb_serial_port *port, struct file *filp) | 1299 | static int ftdi_open (struct usb_serial_port *port, struct file *filp) |
1298 | { /* ftdi_open */ | 1300 | { /* ftdi_open */ |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 1bdda935f7d9..513cfe1b768b 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ | 27 | #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ |
28 | #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ | 28 | #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ |
29 | #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ | 29 | #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ |
30 | #define FTDI_232RL_PID 0xFBFA /* Product ID for FT232RL */ | ||
30 | #define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */ | 31 | #define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */ |
31 | #define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */ | 32 | #define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */ |
32 | #define FTDI_NF_RIC_PID 0x0001 /* Product Id */ | 33 | #define FTDI_NF_RIC_PID 0x0001 /* Product Id */ |
@@ -339,6 +340,12 @@ | |||
339 | #define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */ | 340 | #define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */ |
340 | 341 | ||
341 | /* | 342 | /* |
343 | * TTi (Thurlby Thandar Instruments) | ||
344 | */ | ||
345 | #define TTI_VID 0x103E /* Vendor Id */ | ||
346 | #define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */ | ||
347 | |||
348 | /* | ||
342 | * Definitions for B&B Electronics products. | 349 | * Definitions for B&B Electronics products. |
343 | */ | 350 | */ |
344 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ | 351 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ |
@@ -497,6 +504,19 @@ | |||
497 | #define TELLDUS_VID 0x1781 /* Vendor ID */ | 504 | #define TELLDUS_VID 0x1781 /* Vendor ID */ |
498 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ | 505 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ |
499 | 506 | ||
507 | /* | ||
508 | * IBS elektronik product ids | ||
509 | * Submitted by Thomas Schleusener | ||
510 | */ | ||
511 | #define FTDI_IBS_US485_PID 0xff38 /* IBS US485 (USB<-->RS422/485 interface) */ | ||
512 | #define FTDI_IBS_PICPRO_PID 0xff39 /* IBS PIC-Programmer */ | ||
513 | #define FTDI_IBS_PCMCIA_PID 0xff3a /* IBS Card reader for PCMCIA SRAM-cards */ | ||
514 | #define FTDI_IBS_PK1_PID 0xff3b /* IBS PK1 - Particel counter */ | ||
515 | #define FTDI_IBS_RS232MON_PID 0xff3c /* IBS RS232 - Monitor */ | ||
516 | #define FTDI_IBS_APP70_PID 0xff3d /* APP 70 (dust monitoring system) */ | ||
517 | #define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */ | ||
518 | #define FTDI_IBS_PROD_PID 0xff3f /* future device */ | ||
519 | |||
500 | /* Commands */ | 520 | /* Commands */ |
501 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 521 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
502 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ | 522 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ |
@@ -620,6 +640,7 @@ typedef enum { | |||
620 | FT8U232AM = 2, | 640 | FT8U232AM = 2, |
621 | FT232BM = 3, | 641 | FT232BM = 3, |
622 | FT2232C = 4, | 642 | FT2232C = 4, |
643 | FT232RL = 5, | ||
623 | } ftdi_chip_type_t; | 644 | } ftdi_chip_type_t; |
624 | 645 | ||
625 | typedef enum { | 646 | typedef enum { |
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index a408184334ea..d16e2e1764ad 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -247,6 +247,8 @@ static struct usb_device_id ipaq_id_table [] = { | |||
247 | { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */ | 247 | { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */ |
248 | { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */ | 248 | { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */ |
249 | { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */ | 249 | { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */ |
250 | { USB_DEVICE(0x04AD, 0x0306) }, /* GPS Pocket PC USB Sync */ | ||
251 | { USB_DEVICE(0x04B7, 0x0531) }, /* MyGuide 7000 XL USB Sync */ | ||
250 | { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ | 252 | { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ |
251 | { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ | 253 | { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ |
252 | { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ | 254 | { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 2d588fb82573..19bf403f9db2 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -1628,6 +1628,7 @@ static struct usb_serial_driver moschip7720_2port_driver = { | |||
1628 | .chars_in_buffer = mos7720_chars_in_buffer, | 1628 | .chars_in_buffer = mos7720_chars_in_buffer, |
1629 | .break_ctl = mos7720_break, | 1629 | .break_ctl = mos7720_break, |
1630 | .read_bulk_callback = mos7720_bulk_in_callback, | 1630 | .read_bulk_callback = mos7720_bulk_in_callback, |
1631 | .read_int_callback = mos7720_interrupt_callback, | ||
1631 | }; | 1632 | }; |
1632 | 1633 | ||
1633 | static int __init moschip7720_init(void) | 1634 | static int __init moschip7720_init(void) |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index db92a7fb1f7c..e178e6f40319 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -109,7 +109,6 @@ static int option_send_setup(struct usb_serial_port *port); | |||
109 | #define HUAWEI_PRODUCT_E220 0x1003 | 109 | #define HUAWEI_PRODUCT_E220 0x1003 |
110 | 110 | ||
111 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 111 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
112 | #define NOVATELWIRELESS_PRODUCT_U740 0x1400 | ||
113 | 112 | ||
114 | #define ANYDATA_VENDOR_ID 0x16d5 | 113 | #define ANYDATA_VENDOR_ID 0x16d5 |
115 | #define ANYDATA_PRODUCT_ID 0x6501 | 114 | #define ANYDATA_PRODUCT_ID 0x6501 |
@@ -152,7 +151,19 @@ static struct usb_device_id option_ids[] = { | |||
152 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, | 151 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, |
153 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, | 152 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, |
154 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, | 153 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, |
155 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, | 154 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */ |
155 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */ | ||
156 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */ | ||
157 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1130) }, /* Novatel Merlin S720 */ | ||
158 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1400) }, /* Novatel U730 */ | ||
159 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */ | ||
160 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */ | ||
161 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ | ||
162 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel XU870 */ | ||
163 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */ | ||
164 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ | ||
165 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ | ||
166 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ | ||
156 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, | 167 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, |
157 | { } /* Terminating entry */ | 168 | { } /* Terminating entry */ |
158 | }; | 169 | }; |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 6bf22a28adb8..7639022cdf84 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -99,9 +99,12 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po | |||
99 | continue; | 99 | continue; |
100 | 100 | ||
101 | *minor = i; | 101 | *minor = i; |
102 | j = 0; | ||
102 | dbg("%s - minor base = %d", __FUNCTION__, *minor); | 103 | dbg("%s - minor base = %d", __FUNCTION__, *minor); |
103 | for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) | 104 | for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) { |
104 | serial_table[i] = serial; | 105 | serial_table[i] = serial; |
106 | serial->port[j++]->number = i; | ||
107 | } | ||
105 | spin_unlock(&table_lock); | 108 | spin_unlock(&table_lock); |
106 | return serial; | 109 | return serial; |
107 | } | 110 | } |
@@ -826,7 +829,6 @@ int usb_serial_probe(struct usb_interface *interface, | |||
826 | num_ports = type->num_ports; | 829 | num_ports = type->num_ports; |
827 | } | 830 | } |
828 | 831 | ||
829 | serial->minor = minor; | ||
830 | serial->num_ports = num_ports; | 832 | serial->num_ports = num_ports; |
831 | serial->num_bulk_in = num_bulk_in; | 833 | serial->num_bulk_in = num_bulk_in; |
832 | serial->num_bulk_out = num_bulk_out; | 834 | serial->num_bulk_out = num_bulk_out; |
@@ -847,7 +849,6 @@ int usb_serial_probe(struct usb_interface *interface, | |||
847 | port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); | 849 | port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); |
848 | if (!port) | 850 | if (!port) |
849 | goto probe_error; | 851 | goto probe_error; |
850 | port->number = i + serial->minor; | ||
851 | port->serial = serial; | 852 | port->serial = serial; |
852 | spin_lock_init(&port->lock); | 853 | spin_lock_init(&port->lock); |
853 | mutex_init(&port->mutex); | 854 | mutex_init(&port->mutex); |
@@ -980,6 +981,7 @@ int usb_serial_probe(struct usb_interface *interface, | |||
980 | dev_err(&interface->dev, "No more free serial devices\n"); | 981 | dev_err(&interface->dev, "No more free serial devices\n"); |
981 | goto probe_error; | 982 | goto probe_error; |
982 | } | 983 | } |
984 | serial->minor = minor; | ||
983 | 985 | ||
984 | /* register all of the individual ports with the driver core */ | 986 | /* register all of the individual ports with the driver core */ |
985 | for (i = 0; i < num_ports; ++i) { | 987 | for (i = 0; i < num_ports; ++i) { |
@@ -1034,9 +1036,6 @@ probe_error: | |||
1034 | kfree(port->interrupt_out_buffer); | 1036 | kfree(port->interrupt_out_buffer); |
1035 | } | 1037 | } |
1036 | 1038 | ||
1037 | /* return the minor range that this device had */ | ||
1038 | return_serial (serial); | ||
1039 | |||
1040 | /* free up any memory that we allocated */ | 1039 | /* free up any memory that we allocated */ |
1041 | for (i = 0; i < serial->num_port_pointers; ++i) | 1040 | for (i = 0; i < serial->num_port_pointers; ++i) |
1042 | kfree(serial->port[i]); | 1041 | kfree(serial->port[i]); |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 9644a8ea4aa7..e13637dfb642 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -146,6 +146,13 @@ UNUSUAL_DEV( 0x0420, 0x0001, 0x0100, 0x0100, | |||
146 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 146 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
147 | US_FL_IGNORE_RESIDUE ), | 147 | US_FL_IGNORE_RESIDUE ), |
148 | 148 | ||
149 | /* Reported by Andrew Nayenko <relan@bk.ru> */ | ||
150 | UNUSUAL_DEV( 0x0421, 0x0019, 0x0592, 0x0592, | ||
151 | "Nokia", | ||
152 | "Nokia 6288", | ||
153 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
154 | US_FL_MAX_SECTORS_64 ), | ||
155 | |||
149 | /* Reported by Mario Rettig <mariorettig@web.de> */ | 156 | /* Reported by Mario Rettig <mariorettig@web.de> */ |
150 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, | 157 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, |
151 | "Nokia", | 158 | "Nokia", |
@@ -1395,16 +1402,6 @@ UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, | |||
1395 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1402 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1396 | US_FL_IGNORE_RESIDUE ), | 1403 | US_FL_IGNORE_RESIDUE ), |
1397 | 1404 | ||
1398 | /* Reported by Thomas Baechler <thomas@archlinux.org> | ||
1399 | * Fixes I/O errors with Teac HD-35PU devices | ||
1400 | */ | ||
1401 | |||
1402 | UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, | ||
1403 | "Super Top", | ||
1404 | "USB 2.0 IDE DEVICE", | ||
1405 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1406 | US_FL_IGNORE_RESIDUE), | ||
1407 | |||
1408 | /* patch submitted by Davide Perini <perini.davide@dpsoftware.org> | 1405 | /* patch submitted by Davide Perini <perini.davide@dpsoftware.org> |
1409 | * and Renato Perini <rperini@email.it> | 1406 | * and Renato Perini <rperini@email.it> |
1410 | */ | 1407 | */ |
@@ -1414,6 +1411,16 @@ UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001, | |||
1414 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1411 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1415 | US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), | 1412 | US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), |
1416 | 1413 | ||
1414 | /* | ||
1415 | * Patch by Pete Zaitcev <zaitcev@redhat.com> | ||
1416 | * Report by Mark Patton. Red Hat bz#208928. | ||
1417 | */ | ||
1418 | UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0001, | ||
1419 | "Motorola", | ||
1420 | "RAZR V3i", | ||
1421 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1422 | US_FL_FIX_CAPACITY), | ||
1423 | |||
1417 | /* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */ | 1424 | /* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */ |
1418 | UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, | 1425 | UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, |
1419 | "MPIO", | 1426 | "MPIO", |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 7f5a59836818..e4f0dd00ae85 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -1320,7 +1320,7 @@ config FB_AU1100 | |||
1320 | 1320 | ||
1321 | config FB_AU1200 | 1321 | config FB_AU1200 |
1322 | bool "Au1200 LCD Driver" | 1322 | bool "Au1200 LCD Driver" |
1323 | depends on FB && MIPS && SOC_AU1200 | 1323 | depends on (FB = y) && MIPS && SOC_AU1200 |
1324 | select FB_CFB_FILLRECT | 1324 | select FB_CFB_FILLRECT |
1325 | select FB_CFB_COPYAREA | 1325 | select FB_CFB_COPYAREA |
1326 | select FB_CFB_IMAGEBLIT | 1326 | select FB_CFB_IMAGEBLIT |
@@ -1470,7 +1470,7 @@ config FB_G364 | |||
1470 | 1470 | ||
1471 | config FB_68328 | 1471 | config FB_68328 |
1472 | bool "Motorola 68328 native frame buffer support" | 1472 | bool "Motorola 68328 native frame buffer support" |
1473 | depends on FB && (M68328 || M68EZ328 || M68VZ328) | 1473 | depends on (FB = y) && (M68328 || M68EZ328 || M68VZ328) |
1474 | select FB_CFB_FILLRECT | 1474 | select FB_CFB_FILLRECT |
1475 | select FB_CFB_COPYAREA | 1475 | select FB_CFB_COPYAREA |
1476 | select FB_CFB_IMAGEBLIT | 1476 | select FB_CFB_IMAGEBLIT |
@@ -1616,7 +1616,7 @@ config FB_IBM_GXT4500 | |||
1616 | 1616 | ||
1617 | config FB_PS3 | 1617 | config FB_PS3 |
1618 | bool "PS3 GPU framebuffer driver" | 1618 | bool "PS3 GPU framebuffer driver" |
1619 | depends on FB && PS3_PS3AV | 1619 | depends on (FB = y) && PS3_PS3AV |
1620 | select FB_CFB_FILLRECT | 1620 | select FB_CFB_FILLRECT |
1621 | select FB_CFB_COPYAREA | 1621 | select FB_CFB_COPYAREA |
1622 | select FB_CFB_IMAGEBLIT | 1622 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index d1312477813e..6b488b8a7eee 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c | |||
@@ -199,8 +199,8 @@ static int locomolcd_remove(struct locomo_dev *dev) | |||
199 | { | 199 | { |
200 | unsigned long flags; | 200 | unsigned long flags; |
201 | 201 | ||
202 | locomobl_data.brightness = 0; | 202 | locomolcd_bl_device->props.brightness = 0; |
203 | locomobl_data.power = 0; | 203 | locomolcd_bl_device->props.power = 0; |
204 | locomolcd_set_intensity(locomolcd_bl_device); | 204 | locomolcd_set_intensity(locomolcd_bl_device); |
205 | 205 | ||
206 | backlight_device_unregister(locomolcd_bl_device); | 206 | backlight_device_unregister(locomolcd_bl_device); |
diff --git a/drivers/video/backlight/progear_bl.c b/drivers/video/backlight/progear_bl.c index 702269357861..836ab4df0ef2 100644 --- a/drivers/video/backlight/progear_bl.c +++ b/drivers/video/backlight/progear_bl.c | |||
@@ -65,13 +65,13 @@ static int progearbl_probe(struct platform_device *pdev) | |||
65 | u8 temp; | 65 | u8 temp; |
66 | struct backlight_device *progear_backlight_device; | 66 | struct backlight_device *progear_backlight_device; |
67 | 67 | ||
68 | pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 0); | 68 | pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL); |
69 | if (!pmu_dev) { | 69 | if (!pmu_dev) { |
70 | printk("ALI M7101 PMU not found.\n"); | 70 | printk("ALI M7101 PMU not found.\n"); |
71 | return -ENODEV; | 71 | return -ENODEV; |
72 | } | 72 | } |
73 | 73 | ||
74 | sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 0); | 74 | sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); |
75 | if (!sb_dev) { | 75 | if (!sb_dev) { |
76 | printk("ALI 1533 SB not found.\n"); | 76 | printk("ALI 1533 SB not found.\n"); |
77 | pci_dev_put(pmu_dev); | 77 | pci_dev_put(pmu_dev); |
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index 9bb6257d6918..b0b2e40bbd9f 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c | |||
@@ -186,8 +186,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
186 | * Initialisation | 186 | * Initialisation |
187 | */ | 187 | */ |
188 | 188 | ||
189 | static void | 189 | static void __devinit bw2_init_fix(struct fb_info *info, int linebytes) |
190 | bw2_init_fix(struct fb_info *info, int linebytes) | ||
191 | { | 190 | { |
192 | strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); | 191 | strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); |
193 | 192 | ||
@@ -199,43 +198,44 @@ bw2_init_fix(struct fb_info *info, int linebytes) | |||
199 | info->fix.accel = FB_ACCEL_SUN_BWTWO; | 198 | info->fix.accel = FB_ACCEL_SUN_BWTWO; |
200 | } | 199 | } |
201 | 200 | ||
202 | static u8 bw2regs_1600[] __initdata = { | 201 | static u8 bw2regs_1600[] __devinitdata = { |
203 | 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, | 202 | 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, |
204 | 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, | 203 | 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, |
205 | 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, | 204 | 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, |
206 | 0x10, 0x21, 0 | 205 | 0x10, 0x21, 0 |
207 | }; | 206 | }; |
208 | 207 | ||
209 | static u8 bw2regs_ecl[] __initdata = { | 208 | static u8 bw2regs_ecl[] __devinitdata = { |
210 | 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, | 209 | 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, |
211 | 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, | 210 | 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, |
212 | 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, | 211 | 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, |
213 | 0x10, 0x20, 0 | 212 | 0x10, 0x20, 0 |
214 | }; | 213 | }; |
215 | 214 | ||
216 | static u8 bw2regs_analog[] __initdata = { | 215 | static u8 bw2regs_analog[] __devinitdata = { |
217 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, | 216 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, |
218 | 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, | 217 | 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, |
219 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, | 218 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, |
220 | 0x10, 0x20, 0 | 219 | 0x10, 0x20, 0 |
221 | }; | 220 | }; |
222 | 221 | ||
223 | static u8 bw2regs_76hz[] __initdata = { | 222 | static u8 bw2regs_76hz[] __devinitdata = { |
224 | 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, | 223 | 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, |
225 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, | 224 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, |
226 | 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, | 225 | 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, |
227 | 0x10, 0x24, 0 | 226 | 0x10, 0x24, 0 |
228 | }; | 227 | }; |
229 | 228 | ||
230 | static u8 bw2regs_66hz[] __initdata = { | 229 | static u8 bw2regs_66hz[] __devinitdata = { |
231 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, | 230 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, |
232 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, | 231 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, |
233 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, | 232 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, |
234 | 0x10, 0x20, 0 | 233 | 0x10, 0x20, 0 |
235 | }; | 234 | }; |
236 | 235 | ||
237 | static void bw2_do_default_mode(struct bw2_par *par, struct fb_info *info, | 236 | static void __devinit bw2_do_default_mode(struct bw2_par *par, |
238 | int *linebytes) | 237 | struct fb_info *info, |
238 | int *linebytes) | ||
239 | { | 239 | { |
240 | u8 status, mon; | 240 | u8 status, mon; |
241 | u8 *p; | 241 | u8 *p; |
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c index ec6a51a5822d..b071bb632b97 100644 --- a/drivers/video/cg14.c +++ b/drivers/video/cg14.c | |||
@@ -354,7 +354,8 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
354 | * Initialisation | 354 | * Initialisation |
355 | */ | 355 | */ |
356 | 356 | ||
357 | static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) | 357 | static void __devinit cg14_init_fix(struct fb_info *info, int linebytes, |
358 | struct device_node *dp) | ||
358 | { | 359 | { |
359 | const char *name = dp->name; | 360 | const char *name = dp->name; |
360 | 361 | ||
@@ -368,7 +369,7 @@ static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_nod | |||
368 | info->fix.accel = FB_ACCEL_SUN_CG14; | 369 | info->fix.accel = FB_ACCEL_SUN_CG14; |
369 | } | 370 | } |
370 | 371 | ||
371 | static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __initdata = { | 372 | static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __devinitdata = { |
372 | { | 373 | { |
373 | .voff = CG14_REGS, | 374 | .voff = CG14_REGS, |
374 | .poff = 0x80000000, | 375 | .poff = 0x80000000, |
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index 98919a6975f0..3091b20124b4 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c | |||
@@ -1000,11 +1000,12 @@ err_enable_device: | |||
1000 | static void __devexit s3_pci_remove(struct pci_dev *dev) | 1000 | static void __devexit s3_pci_remove(struct pci_dev *dev) |
1001 | { | 1001 | { |
1002 | struct fb_info *info = pci_get_drvdata(dev); | 1002 | struct fb_info *info = pci_get_drvdata(dev); |
1003 | struct s3fb_info *par = info->par; | ||
1004 | 1003 | ||
1005 | if (info) { | 1004 | if (info) { |
1006 | 1005 | ||
1007 | #ifdef CONFIG_MTRR | 1006 | #ifdef CONFIG_MTRR |
1007 | struct s3fb_info *par = info->par; | ||
1008 | |||
1008 | if (par->mtrr_reg >= 0) { | 1009 | if (par->mtrr_reg >= 0) { |
1009 | mtrr_del(par->mtrr_reg, 0, 0); | 1010 | mtrr_del(par->mtrr_reg, 0, 0); |
1010 | par->mtrr_reg = -1; | 1011 | par->mtrr_reg = -1; |
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 4afa30522fdb..0166ec2ccf32 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -384,6 +384,19 @@ SavageSetup2DEngine(struct savagefb_par *par) | |||
384 | BCI_SEND(0); | 384 | BCI_SEND(0); |
385 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); | 385 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); |
386 | BCI_SEND(GlobalBitmapDescriptor); | 386 | BCI_SEND(GlobalBitmapDescriptor); |
387 | |||
388 | /* | ||
389 | * I don't know why, sending this twice fixes the intial black screen, | ||
390 | * prevents X from crashing at least in Toshiba laptops with SavageIX. | ||
391 | * --Tony | ||
392 | */ | ||
393 | par->bci_ptr = 0; | ||
394 | par->SavageWaitFifo(par, 4); | ||
395 | |||
396 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD1); | ||
397 | BCI_SEND(0); | ||
398 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); | ||
399 | BCI_SEND(GlobalBitmapDescriptor); | ||
387 | } | 400 | } |
388 | 401 | ||
389 | static void savagefb_set_clip(struct fb_info *info) | 402 | static void savagefb_set_clip(struct fb_info *info) |
@@ -496,7 +509,7 @@ static int common_calc_clock(long freq, int min_m, int min_n1, int max_n1, | |||
496 | #ifdef SAVAGEFB_DEBUG | 509 | #ifdef SAVAGEFB_DEBUG |
497 | /* This function is used to debug, it prints out the contents of s3 regs */ | 510 | /* This function is used to debug, it prints out the contents of s3 regs */ |
498 | 511 | ||
499 | static void SavagePrintRegs(void) | 512 | static void SavagePrintRegs(struct savagefb_par *par) |
500 | { | 513 | { |
501 | unsigned char i; | 514 | unsigned char i; |
502 | int vgaCRIndex = 0x3d4; | 515 | int vgaCRIndex = 0x3d4; |
@@ -1525,7 +1538,7 @@ static int savagefb_set_par(struct fb_info *info) | |||
1525 | savagefb_set_fix(info); | 1538 | savagefb_set_fix(info); |
1526 | savagefb_set_clip(info); | 1539 | savagefb_set_clip(info); |
1527 | 1540 | ||
1528 | SavagePrintRegs(); | 1541 | SavagePrintRegs(par); |
1529 | return 0; | 1542 | return 0; |
1530 | } | 1543 | } |
1531 | 1544 | ||
@@ -2155,7 +2168,6 @@ static int __devinit savagefb_probe(struct pci_dev* dev, | |||
2155 | int video_len; | 2168 | int video_len; |
2156 | 2169 | ||
2157 | DBG("savagefb_probe"); | 2170 | DBG("savagefb_probe"); |
2158 | SavagePrintRegs(); | ||
2159 | 2171 | ||
2160 | info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev); | 2172 | info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev); |
2161 | if (!info) | 2173 | if (!info) |
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index 59cd1e750f30..62fa5500361d 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c | |||
@@ -257,6 +257,7 @@ static void __sst_dac_write(u8 __iomem *vbase, u8 reg, u8 val) | |||
257 | r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val); | 257 | r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val); |
258 | reg &= 0x07; | 258 | reg &= 0x07; |
259 | __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val); | 259 | __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val); |
260 | __sst_wait_idle(vbase); | ||
260 | } | 261 | } |
261 | 262 | ||
262 | /* indexed access to ti/att dacs */ | 263 | /* indexed access to ti/att dacs */ |