diff options
Diffstat (limited to 'drivers')
56 files changed, 504 insertions, 179 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index b811f2173f6f..88681aca88c5 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
| @@ -105,7 +105,7 @@ config ACPI_EC_DEBUGFS | |||
| 105 | 105 | ||
| 106 | Be aware that using this interface can confuse your Embedded | 106 | Be aware that using this interface can confuse your Embedded |
| 107 | Controller in a way that a normal reboot is not enough. You then | 107 | Controller in a way that a normal reboot is not enough. You then |
| 108 | have to power of your system, and remove the laptop battery for | 108 | have to power off your system, and remove the laptop battery for |
| 109 | some seconds. | 109 | some seconds. |
| 110 | An Embedded Controller typically is available on laptops and reads | 110 | An Embedded Controller typically is available on laptops and reads |
| 111 | sensor values like battery state and temperature. | 111 | sensor values like battery state and temperature. |
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index b76848c80be3..6b115f6c4313 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c | |||
| @@ -382,31 +382,32 @@ static void acpi_pad_remove_sysfs(struct acpi_device *device) | |||
| 382 | device_remove_file(&device->dev, &dev_attr_rrtime); | 382 | device_remove_file(&device->dev, &dev_attr_rrtime); |
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | /* Query firmware how many CPUs should be idle */ | 385 | /* |
| 386 | static int acpi_pad_pur(acpi_handle handle, int *num_cpus) | 386 | * Query firmware how many CPUs should be idle |
| 387 | * return -1 on failure | ||
| 388 | */ | ||
| 389 | static int acpi_pad_pur(acpi_handle handle) | ||
| 387 | { | 390 | { |
| 388 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; | 391 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; |
| 389 | union acpi_object *package; | 392 | union acpi_object *package; |
| 390 | int rev, num, ret = -EINVAL; | 393 | int num = -1; |
| 391 | 394 | ||
| 392 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer))) | 395 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer))) |
| 393 | return -EINVAL; | 396 | return num; |
| 394 | 397 | ||
| 395 | if (!buffer.length || !buffer.pointer) | 398 | if (!buffer.length || !buffer.pointer) |
| 396 | return -EINVAL; | 399 | return num; |
| 397 | 400 | ||
| 398 | package = buffer.pointer; | 401 | package = buffer.pointer; |
| 399 | if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2) | 402 | |
| 400 | goto out; | 403 | if (package->type == ACPI_TYPE_PACKAGE && |
| 401 | rev = package->package.elements[0].integer.value; | 404 | package->package.count == 2 && |
| 402 | num = package->package.elements[1].integer.value; | 405 | package->package.elements[0].integer.value == 1) /* rev 1 */ |
| 403 | if (rev != 1 || num < 0) | 406 | |
| 404 | goto out; | 407 | num = package->package.elements[1].integer.value; |
| 405 | *num_cpus = num; | 408 | |
| 406 | ret = 0; | ||
| 407 | out: | ||
| 408 | kfree(buffer.pointer); | 409 | kfree(buffer.pointer); |
| 409 | return ret; | 410 | return num; |
| 410 | } | 411 | } |
| 411 | 412 | ||
| 412 | /* Notify firmware how many CPUs are idle */ | 413 | /* Notify firmware how many CPUs are idle */ |
| @@ -433,7 +434,8 @@ static void acpi_pad_handle_notify(acpi_handle handle) | |||
| 433 | uint32_t idle_cpus; | 434 | uint32_t idle_cpus; |
| 434 | 435 | ||
| 435 | mutex_lock(&isolated_cpus_lock); | 436 | mutex_lock(&isolated_cpus_lock); |
| 436 | if (acpi_pad_pur(handle, &num_cpus)) { | 437 | num_cpus = acpi_pad_pur(handle); |
| 438 | if (num_cpus < 0) { | ||
| 437 | mutex_unlock(&isolated_cpus_lock); | 439 | mutex_unlock(&isolated_cpus_lock); |
| 438 | return; | 440 | return; |
| 439 | } | 441 | } |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index df85b53a674f..7dad9160f209 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
| @@ -854,6 +854,7 @@ struct acpi_bit_register_info { | |||
| 854 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ | 854 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ |
| 855 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ | 855 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ |
| 856 | ACPI_BITMASK_RT_CLOCK_STATUS | \ | 856 | ACPI_BITMASK_RT_CLOCK_STATUS | \ |
| 857 | ACPI_BITMASK_PCIEXP_WAKE_DISABLE | \ | ||
| 857 | ACPI_BITMASK_WAKE_STATUS) | 858 | ACPI_BITMASK_WAKE_STATUS) |
| 858 | 859 | ||
| 859 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 | 860 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 |
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c index 74c24d517f81..4093522eed45 100644 --- a/drivers/acpi/acpica/exutils.c +++ b/drivers/acpi/acpica/exutils.c | |||
| @@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void) | |||
| 109 | * | 109 | * |
| 110 | * DESCRIPTION: Reacquire the interpreter execution region from within the | 110 | * DESCRIPTION: Reacquire the interpreter execution region from within the |
| 111 | * interpreter code. Failure to enter the interpreter region is a | 111 | * interpreter code. Failure to enter the interpreter region is a |
| 112 | * fatal system error. Used in conjuction with | 112 | * fatal system error. Used in conjunction with |
| 113 | * relinquish_interpreter | 113 | * relinquish_interpreter |
| 114 | * | 114 | * |
| 115 | ******************************************************************************/ | 115 | ******************************************************************************/ |
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index 22cfcfbd9fff..491191e6cf69 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c | |||
| @@ -149,7 +149,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type) | |||
| 149 | 149 | ||
| 150 | /* | 150 | /* |
| 151 | * 16-, 32-, and 64-bit cases must use the move macros that perform | 151 | * 16-, 32-, and 64-bit cases must use the move macros that perform |
| 152 | * endian conversion and/or accomodate hardware that cannot perform | 152 | * endian conversion and/or accommodate hardware that cannot perform |
| 153 | * misaligned memory transfers | 153 | * misaligned memory transfers |
| 154 | */ | 154 | */ |
| 155 | case ACPI_RSC_MOVE16: | 155 | case ACPI_RSC_MOVE16: |
diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 907e350f1c7d..fca34ccfd294 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig | |||
| @@ -34,6 +34,6 @@ config ACPI_APEI_ERST_DEBUG | |||
| 34 | depends on ACPI_APEI | 34 | depends on ACPI_APEI |
| 35 | help | 35 | help |
| 36 | ERST is a way provided by APEI to save and retrieve hardware | 36 | ERST is a way provided by APEI to save and retrieve hardware |
| 37 | error infomation to and from a persistent store. Enable this | 37 | error information to and from a persistent store. Enable this |
| 38 | if you want to debugging and testing the ERST kernel support | 38 | if you want to debugging and testing the ERST kernel support |
| 39 | and firmware implementation. | 39 | and firmware implementation. |
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 73fd0c7487c1..4a904a4bf05f 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c | |||
| @@ -445,11 +445,15 @@ EXPORT_SYMBOL_GPL(apei_resources_sub); | |||
| 445 | int apei_resources_request(struct apei_resources *resources, | 445 | int apei_resources_request(struct apei_resources *resources, |
| 446 | const char *desc) | 446 | const char *desc) |
| 447 | { | 447 | { |
| 448 | struct apei_res *res, *res_bak; | 448 | struct apei_res *res, *res_bak = NULL; |
| 449 | struct resource *r; | 449 | struct resource *r; |
| 450 | int rc; | ||
| 450 | 451 | ||
| 451 | apei_resources_sub(resources, &apei_resources_all); | 452 | rc = apei_resources_sub(resources, &apei_resources_all); |
| 453 | if (rc) | ||
| 454 | return rc; | ||
| 452 | 455 | ||
| 456 | rc = -EINVAL; | ||
| 453 | list_for_each_entry(res, &resources->iomem, list) { | 457 | list_for_each_entry(res, &resources->iomem, list) { |
| 454 | r = request_mem_region(res->start, res->end - res->start, | 458 | r = request_mem_region(res->start, res->end - res->start, |
| 455 | desc); | 459 | desc); |
| @@ -475,7 +479,11 @@ int apei_resources_request(struct apei_resources *resources, | |||
| 475 | } | 479 | } |
| 476 | } | 480 | } |
| 477 | 481 | ||
| 478 | apei_resources_merge(&apei_resources_all, resources); | 482 | rc = apei_resources_merge(&apei_resources_all, resources); |
| 483 | if (rc) { | ||
| 484 | pr_err(APEI_PFX "Fail to merge resources!\n"); | ||
| 485 | goto err_unmap_ioport; | ||
| 486 | } | ||
| 479 | 487 | ||
| 480 | return 0; | 488 | return 0; |
| 481 | err_unmap_ioport: | 489 | err_unmap_ioport: |
| @@ -491,12 +499,13 @@ err_unmap_iomem: | |||
| 491 | break; | 499 | break; |
| 492 | release_mem_region(res->start, res->end - res->start); | 500 | release_mem_region(res->start, res->end - res->start); |
| 493 | } | 501 | } |
| 494 | return -EINVAL; | 502 | return rc; |
| 495 | } | 503 | } |
| 496 | EXPORT_SYMBOL_GPL(apei_resources_request); | 504 | EXPORT_SYMBOL_GPL(apei_resources_request); |
| 497 | 505 | ||
| 498 | void apei_resources_release(struct apei_resources *resources) | 506 | void apei_resources_release(struct apei_resources *resources) |
| 499 | { | 507 | { |
| 508 | int rc; | ||
| 500 | struct apei_res *res; | 509 | struct apei_res *res; |
| 501 | 510 | ||
| 502 | list_for_each_entry(res, &resources->iomem, list) | 511 | list_for_each_entry(res, &resources->iomem, list) |
| @@ -504,7 +513,9 @@ void apei_resources_release(struct apei_resources *resources) | |||
| 504 | list_for_each_entry(res, &resources->ioport, list) | 513 | list_for_each_entry(res, &resources->ioport, list) |
| 505 | release_region(res->start, res->end - res->start); | 514 | release_region(res->start, res->end - res->start); |
| 506 | 515 | ||
| 507 | apei_resources_sub(&apei_resources_all, resources); | 516 | rc = apei_resources_sub(&apei_resources_all, resources); |
| 517 | if (rc) | ||
| 518 | pr_err(APEI_PFX "Fail to sub resources!\n"); | ||
| 508 | } | 519 | } |
| 509 | EXPORT_SYMBOL_GPL(apei_resources_release); | 520 | EXPORT_SYMBOL_GPL(apei_resources_release); |
| 510 | 521 | ||
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 465c885938ee..cf29df69380b 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c | |||
| @@ -426,7 +426,9 @@ DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL, | |||
| 426 | 426 | ||
| 427 | static int einj_check_table(struct acpi_table_einj *einj_tab) | 427 | static int einj_check_table(struct acpi_table_einj *einj_tab) |
| 428 | { | 428 | { |
| 429 | if (einj_tab->header_length != sizeof(struct acpi_table_einj)) | 429 | if ((einj_tab->header_length != |
| 430 | (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header))) | ||
| 431 | && (einj_tab->header_length != sizeof(struct acpi_table_einj))) | ||
| 430 | return -EINVAL; | 432 | return -EINVAL; |
| 431 | if (einj_tab->header.length < sizeof(struct acpi_table_einj)) | 433 | if (einj_tab->header.length < sizeof(struct acpi_table_einj)) |
| 432 | return -EINVAL; | 434 | return -EINVAL; |
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c index 5281ddda2777..da1228a9a544 100644 --- a/drivers/acpi/apei/erst-dbg.c +++ b/drivers/acpi/apei/erst-dbg.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * APEI Error Record Serialization Table debug support | 2 | * APEI Error Record Serialization Table debug support |
| 3 | * | 3 | * |
| 4 | * ERST is a way provided by APEI to save and retrieve hardware error | 4 | * ERST is a way provided by APEI to save and retrieve hardware error |
| 5 | * infomation to and from a persistent store. This file provide the | 5 | * information to and from a persistent store. This file provide the |
| 6 | * debugging/testing support for ERST kernel support and firmware | 6 | * debugging/testing support for ERST kernel support and firmware |
| 7 | * implementation. | 7 | * implementation. |
| 8 | * | 8 | * |
| @@ -111,11 +111,13 @@ retry: | |||
| 111 | goto out; | 111 | goto out; |
| 112 | } | 112 | } |
| 113 | if (len > erst_dbg_buf_len) { | 113 | if (len > erst_dbg_buf_len) { |
| 114 | kfree(erst_dbg_buf); | 114 | void *p; |
| 115 | rc = -ENOMEM; | 115 | rc = -ENOMEM; |
| 116 | erst_dbg_buf = kmalloc(len, GFP_KERNEL); | 116 | p = kmalloc(len, GFP_KERNEL); |
| 117 | if (!erst_dbg_buf) | 117 | if (!p) |
| 118 | goto out; | 118 | goto out; |
| 119 | kfree(erst_dbg_buf); | ||
| 120 | erst_dbg_buf = p; | ||
| 119 | erst_dbg_buf_len = len; | 121 | erst_dbg_buf_len = len; |
| 120 | goto retry; | 122 | goto retry; |
| 121 | } | 123 | } |
| @@ -150,11 +152,13 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf, | |||
| 150 | if (mutex_lock_interruptible(&erst_dbg_mutex)) | 152 | if (mutex_lock_interruptible(&erst_dbg_mutex)) |
| 151 | return -EINTR; | 153 | return -EINTR; |
| 152 | if (usize > erst_dbg_buf_len) { | 154 | if (usize > erst_dbg_buf_len) { |
| 153 | kfree(erst_dbg_buf); | 155 | void *p; |
| 154 | rc = -ENOMEM; | 156 | rc = -ENOMEM; |
| 155 | erst_dbg_buf = kmalloc(usize, GFP_KERNEL); | 157 | p = kmalloc(usize, GFP_KERNEL); |
| 156 | if (!erst_dbg_buf) | 158 | if (!p) |
| 157 | goto out; | 159 | goto out; |
| 160 | kfree(erst_dbg_buf); | ||
| 161 | erst_dbg_buf = p; | ||
| 158 | erst_dbg_buf_len = usize; | 162 | erst_dbg_buf_len = usize; |
| 159 | } | 163 | } |
| 160 | rc = copy_from_user(erst_dbg_buf, ubuf, usize); | 164 | rc = copy_from_user(erst_dbg_buf, ubuf, usize); |
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 18645f4e83cd..1211c03149e8 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * APEI Error Record Serialization Table support | 2 | * APEI Error Record Serialization Table support |
| 3 | * | 3 | * |
| 4 | * ERST is a way provided by APEI to save and retrieve hardware error | 4 | * ERST is a way provided by APEI to save and retrieve hardware error |
| 5 | * infomation to and from a persistent store. | 5 | * information to and from a persistent store. |
| 6 | * | 6 | * |
| 7 | * For more information about ERST, please refer to ACPI Specification | 7 | * For more information about ERST, please refer to ACPI Specification |
| 8 | * version 4.0, section 17.4. | 8 | * version 4.0, section 17.4. |
| @@ -266,13 +266,30 @@ static int erst_exec_move_data(struct apei_exec_context *ctx, | |||
| 266 | { | 266 | { |
| 267 | int rc; | 267 | int rc; |
| 268 | u64 offset; | 268 | u64 offset; |
| 269 | void *src, *dst; | ||
| 270 | |||
| 271 | /* ioremap does not work in interrupt context */ | ||
| 272 | if (in_interrupt()) { | ||
| 273 | pr_warning(ERST_PFX | ||
| 274 | "MOVE_DATA can not be used in interrupt context"); | ||
| 275 | return -EBUSY; | ||
| 276 | } | ||
| 269 | 277 | ||
| 270 | rc = __apei_exec_read_register(entry, &offset); | 278 | rc = __apei_exec_read_register(entry, &offset); |
| 271 | if (rc) | 279 | if (rc) |
| 272 | return rc; | 280 | return rc; |
| 273 | memmove((void *)ctx->dst_base + offset, | 281 | |
| 274 | (void *)ctx->src_base + offset, | 282 | src = ioremap(ctx->src_base + offset, ctx->var2); |
| 275 | ctx->var2); | 283 | if (!src) |
| 284 | return -ENOMEM; | ||
| 285 | dst = ioremap(ctx->dst_base + offset, ctx->var2); | ||
| 286 | if (!dst) | ||
| 287 | return -ENOMEM; | ||
| 288 | |||
| 289 | memmove(dst, src, ctx->var2); | ||
| 290 | |||
| 291 | iounmap(src); | ||
| 292 | iounmap(dst); | ||
| 276 | 293 | ||
| 277 | return 0; | 294 | return 0; |
| 278 | } | 295 | } |
| @@ -750,7 +767,9 @@ __setup("erst_disable", setup_erst_disable); | |||
| 750 | 767 | ||
| 751 | static int erst_check_table(struct acpi_table_erst *erst_tab) | 768 | static int erst_check_table(struct acpi_table_erst *erst_tab) |
| 752 | { | 769 | { |
| 753 | if (erst_tab->header_length != sizeof(struct acpi_table_erst)) | 770 | if ((erst_tab->header_length != |
| 771 | (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) | ||
| 772 | && (erst_tab->header_length != sizeof(struct acpi_table_einj))) | ||
| 754 | return -EINVAL; | 773 | return -EINVAL; |
| 755 | if (erst_tab->header.length < sizeof(struct acpi_table_erst)) | 774 | if (erst_tab->header.length < sizeof(struct acpi_table_erst)) |
| 756 | return -EINVAL; | 775 | return -EINVAL; |
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 385a6059714a..0d505e59214d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
| @@ -302,7 +302,7 @@ static int __devinit ghes_probe(struct platform_device *ghes_dev) | |||
| 302 | struct ghes *ghes = NULL; | 302 | struct ghes *ghes = NULL; |
| 303 | int rc = -EINVAL; | 303 | int rc = -EINVAL; |
| 304 | 304 | ||
| 305 | generic = ghes_dev->dev.platform_data; | 305 | generic = *(struct acpi_hest_generic **)ghes_dev->dev.platform_data; |
| 306 | if (!generic->enabled) | 306 | if (!generic->enabled) |
| 307 | return -ENODEV; | 307 | return -ENODEV; |
| 308 | 308 | ||
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index 343168d18266..1a3508a7fe03 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c | |||
| @@ -137,20 +137,23 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data) | |||
| 137 | 137 | ||
| 138 | static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) | 138 | static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) |
| 139 | { | 139 | { |
| 140 | struct acpi_hest_generic *generic; | ||
| 141 | struct platform_device *ghes_dev; | 140 | struct platform_device *ghes_dev; |
| 142 | struct ghes_arr *ghes_arr = data; | 141 | struct ghes_arr *ghes_arr = data; |
| 143 | int rc; | 142 | int rc; |
| 144 | 143 | ||
| 145 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) | 144 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) |
| 146 | return 0; | 145 | return 0; |
| 147 | generic = (struct acpi_hest_generic *)hest_hdr; | 146 | |
| 148 | if (!generic->enabled) | 147 | if (!((struct acpi_hest_generic *)hest_hdr)->enabled) |
| 149 | return 0; | 148 | return 0; |
| 150 | ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); | 149 | ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); |
| 151 | if (!ghes_dev) | 150 | if (!ghes_dev) |
| 152 | return -ENOMEM; | 151 | return -ENOMEM; |
| 153 | ghes_dev->dev.platform_data = generic; | 152 | |
| 153 | rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *)); | ||
| 154 | if (rc) | ||
| 155 | goto err; | ||
| 156 | |||
| 154 | rc = platform_device_add(ghes_dev); | 157 | rc = platform_device_add(ghes_dev); |
| 155 | if (rc) | 158 | if (rc) |
| 156 | goto err; | 159 | goto err; |
diff --git a/drivers/acpi/atomicio.c b/drivers/acpi/atomicio.c index 8f8bd736d4ff..542e53903891 100644 --- a/drivers/acpi/atomicio.c +++ b/drivers/acpi/atomicio.c | |||
| @@ -142,7 +142,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr, | |||
| 142 | list_add_tail_rcu(&map->list, &acpi_iomaps); | 142 | list_add_tail_rcu(&map->list, &acpi_iomaps); |
| 143 | spin_unlock_irqrestore(&acpi_iomaps_lock, flags); | 143 | spin_unlock_irqrestore(&acpi_iomaps_lock, flags); |
| 144 | 144 | ||
| 145 | return vaddr + (paddr - pg_off); | 145 | return map->vaddr + (paddr - map->paddr); |
| 146 | err_unmap: | 146 | err_unmap: |
| 147 | iounmap(vaddr); | 147 | iounmap(vaddr); |
| 148 | return NULL; | 148 | return NULL; |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index dc58402b0a17..98417201e9ce 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
| @@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = { | |||
| 273 | POWER_SUPPLY_PROP_CYCLE_COUNT, | 273 | POWER_SUPPLY_PROP_CYCLE_COUNT, |
| 274 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, | 274 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, |
| 275 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | 275 | POWER_SUPPLY_PROP_VOLTAGE_NOW, |
| 276 | POWER_SUPPLY_PROP_CURRENT_NOW, | ||
| 277 | POWER_SUPPLY_PROP_POWER_NOW, | 276 | POWER_SUPPLY_PROP_POWER_NOW, |
| 278 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | 277 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, |
| 279 | POWER_SUPPLY_PROP_ENERGY_FULL, | 278 | POWER_SUPPLY_PROP_ENERGY_FULL, |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 2bb28b9d91c4..f7619600270a 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
| @@ -183,6 +183,8 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) | |||
| 183 | { | 183 | { |
| 184 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | 184 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); |
| 185 | acpi_osi_setup("!Windows 2006"); | 185 | acpi_osi_setup("!Windows 2006"); |
| 186 | acpi_osi_setup("!Windows 2006 SP1"); | ||
| 187 | acpi_osi_setup("!Windows 2006 SP2"); | ||
| 186 | return 0; | 188 | return 0; |
| 187 | } | 189 | } |
| 188 | static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) | 190 | static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) |
| @@ -226,6 +228,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
| 226 | }, | 228 | }, |
| 227 | }, | 229 | }, |
| 228 | { | 230 | { |
| 231 | .callback = dmi_disable_osi_vista, | ||
| 232 | .ident = "Toshiba Satellite L355", | ||
| 233 | .matches = { | ||
| 234 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 235 | DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"), | ||
| 236 | }, | ||
| 237 | }, | ||
| 238 | { | ||
| 229 | .callback = dmi_disable_osi_win7, | 239 | .callback = dmi_disable_osi_win7, |
| 230 | .ident = "ASUS K50IJ", | 240 | .ident = "ASUS K50IJ", |
| 231 | .matches = { | 241 | .matches = { |
| @@ -233,6 +243,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
| 233 | DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"), | 243 | DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"), |
| 234 | }, | 244 | }, |
| 235 | }, | 245 | }, |
| 246 | { | ||
| 247 | .callback = dmi_disable_osi_vista, | ||
| 248 | .ident = "Toshiba P305D", | ||
| 249 | .matches = { | ||
| 250 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 251 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"), | ||
| 252 | }, | ||
| 253 | }, | ||
| 236 | 254 | ||
| 237 | /* | 255 | /* |
| 238 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. | 256 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 5c221ab535d5..310e3b9749cb 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
| @@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir); | |||
| 55 | static int set_power_nocheck(const struct dmi_system_id *id) | 55 | static int set_power_nocheck(const struct dmi_system_id *id) |
| 56 | { | 56 | { |
| 57 | printk(KERN_NOTICE PREFIX "%s detected - " | 57 | printk(KERN_NOTICE PREFIX "%s detected - " |
| 58 | "disable power check in power transistion\n", id->ident); | 58 | "disable power check in power transition\n", id->ident); |
| 59 | acpi_power_nocheck = 1; | 59 | acpi_power_nocheck = 1; |
| 60 | return 0; | 60 | return 0; |
| 61 | } | 61 | } |
| @@ -80,23 +80,15 @@ static int set_copy_dsdt(const struct dmi_system_id *id) | |||
| 80 | 80 | ||
| 81 | static struct dmi_system_id dsdt_dmi_table[] __initdata = { | 81 | static struct dmi_system_id dsdt_dmi_table[] __initdata = { |
| 82 | /* | 82 | /* |
| 83 | * Insyde BIOS on some TOSHIBA machines corrupt the DSDT. | 83 | * Invoke DSDT corruption work-around on all Toshiba Satellite. |
| 84 | * https://bugzilla.kernel.org/show_bug.cgi?id=14679 | 84 | * https://bugzilla.kernel.org/show_bug.cgi?id=14679 |
| 85 | */ | 85 | */ |
| 86 | { | 86 | { |
| 87 | .callback = set_copy_dsdt, | 87 | .callback = set_copy_dsdt, |
| 88 | .ident = "TOSHIBA Satellite A505", | 88 | .ident = "TOSHIBA Satellite", |
| 89 | .matches = { | 89 | .matches = { |
| 90 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 90 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
| 91 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A505"), | 91 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"), |
| 92 | }, | ||
| 93 | }, | ||
| 94 | { | ||
| 95 | .callback = set_copy_dsdt, | ||
| 96 | .ident = "TOSHIBA Satellite L505D", | ||
| 97 | .matches = { | ||
| 98 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 99 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L505D"), | ||
| 100 | }, | 92 | }, |
| 101 | }, | 93 | }, |
| 102 | {} | 94 | {} |
| @@ -1027,7 +1019,7 @@ static int __init acpi_init(void) | |||
| 1027 | 1019 | ||
| 1028 | /* | 1020 | /* |
| 1029 | * If the laptop falls into the DMI check table, the power state check | 1021 | * If the laptop falls into the DMI check table, the power state check |
| 1030 | * will be disabled in the course of device power transistion. | 1022 | * will be disabled in the course of device power transition. |
| 1031 | */ | 1023 | */ |
| 1032 | dmi_check_system(power_nocheck_dmi_table); | 1024 | dmi_check_system(power_nocheck_dmi_table); |
| 1033 | 1025 | ||
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 8a3b840c0bb2..d94d2953c974 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
| @@ -369,7 +369,9 @@ static void __exit acpi_fan_exit(void) | |||
| 369 | 369 | ||
| 370 | acpi_bus_unregister_driver(&acpi_fan_driver); | 370 | acpi_bus_unregister_driver(&acpi_fan_driver); |
| 371 | 371 | ||
| 372 | #ifdef CONFIG_ACPI_PROCFS | ||
| 372 | remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); | 373 | remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir); |
| 374 | #endif | ||
| 373 | 375 | ||
| 374 | return; | 376 | return; |
| 375 | } | 377 | } |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index ba1bd263d903..3a73a93596e8 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
| @@ -447,8 +447,8 @@ int acpi_processor_notify_smm(struct module *calling_module) | |||
| 447 | if (!try_module_get(calling_module)) | 447 | if (!try_module_get(calling_module)) |
| 448 | return -EINVAL; | 448 | return -EINVAL; |
| 449 | 449 | ||
| 450 | /* is_done is set to negative if an error occured, | 450 | /* is_done is set to negative if an error occurred, |
| 451 | * and to postitive if _no_ error occured, but SMM | 451 | * and to postitive if _no_ error occurred, but SMM |
| 452 | * was already notified. This avoids double notification | 452 | * was already notified. This avoids double notification |
| 453 | * which might lead to unexpected results... | 453 | * which might lead to unexpected results... |
| 454 | */ | 454 | */ |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index cf82989ae756..4754ff6e70e6 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -363,6 +363,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d) | |||
| 363 | return 0; | 363 | return 0; |
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | static int __init init_nvs_nosave(const struct dmi_system_id *d) | ||
| 367 | { | ||
| 368 | acpi_nvs_nosave(); | ||
| 369 | return 0; | ||
| 370 | } | ||
| 371 | |||
| 366 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | 372 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { |
| 367 | { | 373 | { |
| 368 | .callback = init_old_suspend_ordering, | 374 | .callback = init_old_suspend_ordering, |
| @@ -397,6 +403,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
| 397 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), | 403 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), |
| 398 | }, | 404 | }, |
| 399 | }, | 405 | }, |
| 406 | { | ||
| 407 | .callback = init_nvs_nosave, | ||
| 408 | .ident = "Sony Vaio VGN-SR11M", | ||
| 409 | .matches = { | ||
| 410 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
| 411 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"), | ||
| 412 | }, | ||
| 413 | }, | ||
| 414 | { | ||
| 415 | .callback = init_nvs_nosave, | ||
| 416 | .ident = "Everex StepNote Series", | ||
| 417 | .matches = { | ||
| 418 | DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."), | ||
| 419 | DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), | ||
| 420 | }, | ||
| 421 | }, | ||
| 400 | {}, | 422 | {}, |
| 401 | }; | 423 | }; |
| 402 | #endif /* CONFIG_SUSPEND */ | 424 | #endif /* CONFIG_SUSPEND */ |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 68e2e4582fa2..f8588f81048a 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
| @@ -100,7 +100,7 @@ static const struct acpi_dlevel acpi_debug_levels[] = { | |||
| 100 | ACPI_DEBUG_INIT(ACPI_LV_EVENTS), | 100 | ACPI_DEBUG_INIT(ACPI_LV_EVENTS), |
| 101 | }; | 101 | }; |
| 102 | 102 | ||
| 103 | static int param_get_debug_layer(char *buffer, struct kernel_param *kp) | 103 | static int param_get_debug_layer(char *buffer, const struct kernel_param *kp) |
| 104 | { | 104 | { |
| 105 | int result = 0; | 105 | int result = 0; |
| 106 | int i; | 106 | int i; |
| @@ -128,7 +128,7 @@ static int param_get_debug_layer(char *buffer, struct kernel_param *kp) | |||
| 128 | return result; | 128 | return result; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | static int param_get_debug_level(char *buffer, struct kernel_param *kp) | 131 | static int param_get_debug_level(char *buffer, const struct kernel_param *kp) |
| 132 | { | 132 | { |
| 133 | int result = 0; | 133 | int result = 0; |
| 134 | int i; | 134 | int i; |
| @@ -149,10 +149,18 @@ static int param_get_debug_level(char *buffer, struct kernel_param *kp) | |||
| 149 | return result; | 149 | return result; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | module_param_call(debug_layer, param_set_uint, param_get_debug_layer, | 152 | static struct kernel_param_ops param_ops_debug_layer = { |
| 153 | &acpi_dbg_layer, 0644); | 153 | .set = param_set_uint, |
| 154 | module_param_call(debug_level, param_set_uint, param_get_debug_level, | 154 | .get = param_get_debug_layer, |
| 155 | &acpi_dbg_level, 0644); | 155 | }; |
| 156 | |||
| 157 | static struct kernel_param_ops param_ops_debug_level = { | ||
| 158 | .set = param_set_uint, | ||
| 159 | .get = param_get_debug_level, | ||
| 160 | }; | ||
| 161 | |||
| 162 | module_param_cb(debug_layer, ¶m_ops_debug_layer, &acpi_dbg_layer, 0644); | ||
| 163 | module_param_cb(debug_level, ¶m_ops_debug_level, &acpi_dbg_level, 0644); | ||
| 156 | 164 | ||
| 157 | static char trace_method_name[6]; | 165 | static char trace_method_name[6]; |
| 158 | module_param_string(trace_method_name, trace_method_name, 6, 0644); | 166 | module_param_string(trace_method_name, trace_method_name, 6, 0644); |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index c5fef01b3c95..b83676126598 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
| @@ -59,8 +59,8 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, | |||
| 59 | "support\n")); | 59 | "support\n")); |
| 60 | *cap |= ACPI_VIDEO_BACKLIGHT; | 60 | *cap |= ACPI_VIDEO_BACKLIGHT; |
| 61 | if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy))) | 61 | if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy))) |
| 62 | printk(KERN_WARNING FW_BUG PREFIX "ACPI brightness " | 62 | printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, " |
| 63 | "control misses _BQC function\n"); | 63 | "cannot determine initial brightness\n"); |
| 64 | /* We have backlight support, no need to scan further */ | 64 | /* We have backlight support, no need to scan further */ |
| 65 | return AE_CTRL_TERMINATE; | 65 | return AE_CTRL_TERMINATE; |
| 66 | } | 66 | } |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ff1c945fba98..99d0e5a51148 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -90,6 +90,10 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); | |||
| 90 | static int ahci_pci_device_resume(struct pci_dev *pdev); | 90 | static int ahci_pci_device_resume(struct pci_dev *pdev); |
| 91 | #endif | 91 | #endif |
| 92 | 92 | ||
| 93 | static struct scsi_host_template ahci_sht = { | ||
| 94 | AHCI_SHT("ahci"), | ||
| 95 | }; | ||
| 96 | |||
| 93 | static struct ata_port_operations ahci_vt8251_ops = { | 97 | static struct ata_port_operations ahci_vt8251_ops = { |
| 94 | .inherits = &ahci_ops, | 98 | .inherits = &ahci_ops, |
| 95 | .hardreset = ahci_vt8251_hardreset, | 99 | .hardreset = ahci_vt8251_hardreset, |
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 474427b6f99f..e5fdeebf9ef0 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
| @@ -298,7 +298,17 @@ struct ahci_host_priv { | |||
| 298 | 298 | ||
| 299 | extern int ahci_ignore_sss; | 299 | extern int ahci_ignore_sss; |
| 300 | 300 | ||
| 301 | extern struct scsi_host_template ahci_sht; | 301 | extern struct device_attribute *ahci_shost_attrs[]; |
| 302 | extern struct device_attribute *ahci_sdev_attrs[]; | ||
| 303 | |||
| 304 | #define AHCI_SHT(drv_name) \ | ||
| 305 | ATA_NCQ_SHT(drv_name), \ | ||
| 306 | .can_queue = AHCI_MAX_CMDS - 1, \ | ||
| 307 | .sg_tablesize = AHCI_MAX_SG, \ | ||
| 308 | .dma_boundary = AHCI_DMA_BOUNDARY, \ | ||
| 309 | .shost_attrs = ahci_shost_attrs, \ | ||
| 310 | .sdev_attrs = ahci_sdev_attrs | ||
| 311 | |||
| 302 | extern struct ata_port_operations ahci_ops; | 312 | extern struct ata_port_operations ahci_ops; |
| 303 | 313 | ||
| 304 | void ahci_save_initial_config(struct device *dev, | 314 | void ahci_save_initial_config(struct device *dev, |
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 4e97f33cca44..84b643270e7a 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
| @@ -23,6 +23,10 @@ | |||
| 23 | #include <linux/ahci_platform.h> | 23 | #include <linux/ahci_platform.h> |
| 24 | #include "ahci.h" | 24 | #include "ahci.h" |
| 25 | 25 | ||
| 26 | static struct scsi_host_template ahci_platform_sht = { | ||
| 27 | AHCI_SHT("ahci_platform"), | ||
| 28 | }; | ||
| 29 | |||
| 26 | static int __init ahci_probe(struct platform_device *pdev) | 30 | static int __init ahci_probe(struct platform_device *pdev) |
| 27 | { | 31 | { |
| 28 | struct device *dev = &pdev->dev; | 32 | struct device *dev = &pdev->dev; |
| @@ -145,7 +149,7 @@ static int __init ahci_probe(struct platform_device *pdev) | |||
| 145 | ahci_print_info(host, "platform"); | 149 | ahci_print_info(host, "platform"); |
| 146 | 150 | ||
| 147 | rc = ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED, | 151 | rc = ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED, |
| 148 | &ahci_sht); | 152 | &ahci_platform_sht); |
| 149 | if (rc) | 153 | if (rc) |
| 150 | goto err0; | 154 | goto err0; |
| 151 | 155 | ||
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 68dc6785472f..8eea309ea212 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
| @@ -121,7 +121,7 @@ static DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL); | |||
| 121 | static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO, | 121 | static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO, |
| 122 | ahci_read_em_buffer, ahci_store_em_buffer); | 122 | ahci_read_em_buffer, ahci_store_em_buffer); |
| 123 | 123 | ||
| 124 | static struct device_attribute *ahci_shost_attrs[] = { | 124 | struct device_attribute *ahci_shost_attrs[] = { |
| 125 | &dev_attr_link_power_management_policy, | 125 | &dev_attr_link_power_management_policy, |
| 126 | &dev_attr_em_message_type, | 126 | &dev_attr_em_message_type, |
| 127 | &dev_attr_em_message, | 127 | &dev_attr_em_message, |
| @@ -132,22 +132,14 @@ static struct device_attribute *ahci_shost_attrs[] = { | |||
| 132 | &dev_attr_em_buffer, | 132 | &dev_attr_em_buffer, |
| 133 | NULL | 133 | NULL |
| 134 | }; | 134 | }; |
| 135 | EXPORT_SYMBOL_GPL(ahci_shost_attrs); | ||
| 135 | 136 | ||
| 136 | static struct device_attribute *ahci_sdev_attrs[] = { | 137 | struct device_attribute *ahci_sdev_attrs[] = { |
| 137 | &dev_attr_sw_activity, | 138 | &dev_attr_sw_activity, |
| 138 | &dev_attr_unload_heads, | 139 | &dev_attr_unload_heads, |
| 139 | NULL | 140 | NULL |
| 140 | }; | 141 | }; |
| 141 | 142 | EXPORT_SYMBOL_GPL(ahci_sdev_attrs); | |
| 142 | struct scsi_host_template ahci_sht = { | ||
| 143 | ATA_NCQ_SHT("ahci"), | ||
| 144 | .can_queue = AHCI_MAX_CMDS - 1, | ||
| 145 | .sg_tablesize = AHCI_MAX_SG, | ||
| 146 | .dma_boundary = AHCI_DMA_BOUNDARY, | ||
| 147 | .shost_attrs = ahci_shost_attrs, | ||
| 148 | .sdev_attrs = ahci_sdev_attrs, | ||
| 149 | }; | ||
| 150 | EXPORT_SYMBOL_GPL(ahci_sht); | ||
| 151 | 143 | ||
| 152 | struct ata_port_operations ahci_ops = { | 144 | struct ata_port_operations ahci_ops = { |
| 153 | .inherits = &sata_pmp_port_ops, | 145 | .inherits = &sata_pmp_port_ops, |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index b1cbeb59bb76..37a2bb595076 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
| @@ -2369,7 +2369,7 @@ static void pkt_release_dev(struct pktcdvd_device *pd, int flush) | |||
| 2369 | pkt_shrink_pktlist(pd); | 2369 | pkt_shrink_pktlist(pd); |
| 2370 | } | 2370 | } |
| 2371 | 2371 | ||
| 2372 | static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor) | 2372 | static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor) |
| 2373 | { | 2373 | { |
| 2374 | if (dev_minor >= MAX_WRITERS) | 2374 | if (dev_minor >= MAX_WRITERS) |
| 2375 | return NULL; | 2375 | return NULL; |
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 86c5ae9fde34..411d5bf50fc4 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
| @@ -162,7 +162,7 @@ static int mv_is_err_intr(u32 intr_cause) | |||
| 162 | 162 | ||
| 163 | static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan) | 163 | static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan) |
| 164 | { | 164 | { |
| 165 | u32 val = (1 << (1 + (chan->idx * 16))); | 165 | u32 val = ~(1 << (chan->idx * 16)); |
| 166 | dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val); | 166 | dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val); |
| 167 | __raw_writel(val, XOR_INTR_CAUSE(chan)); | 167 | __raw_writel(val, XOR_INTR_CAUSE(chan)); |
| 168 | } | 168 | } |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 3630308e7b81..6b21e25f7a84 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
| @@ -339,6 +339,9 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci) | |||
| 339 | { | 339 | { |
| 340 | int status; | 340 | int status; |
| 341 | 341 | ||
| 342 | if (mci->op_state != OP_RUNNING_POLL) | ||
| 343 | return; | ||
| 344 | |||
| 342 | status = cancel_delayed_work(&mci->work); | 345 | status = cancel_delayed_work(&mci->work); |
| 343 | if (status == 0) { | 346 | if (status == 0) { |
| 344 | debugf0("%s() not canceled, flush the queue\n", | 347 | debugf0("%s() not canceled, flush the queue\n", |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index cf4ffbee1c00..bced9b25c71e 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -2400,7 +2400,7 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj) | |||
| 2400 | I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0); | 2400 | I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0); |
| 2401 | break; | 2401 | break; |
| 2402 | case 3: | 2402 | case 3: |
| 2403 | if (obj_priv->fence_reg > 8) | 2403 | if (obj_priv->fence_reg >= 8) |
| 2404 | fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4; | 2404 | fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4; |
| 2405 | else | 2405 | else |
| 2406 | case 2: | 2406 | case 2: |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index e8e902d614ed..ee73e428a84a 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -2170,8 +2170,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) | |||
| 2170 | return true; | 2170 | return true; |
| 2171 | 2171 | ||
| 2172 | err: | 2172 | err: |
| 2173 | intel_sdvo_destroy_enhance_property(connector); | 2173 | intel_sdvo_destroy(connector); |
| 2174 | kfree(intel_sdvo_connector); | ||
| 2175 | return false; | 2174 | return false; |
| 2176 | } | 2175 | } |
| 2177 | 2176 | ||
| @@ -2243,8 +2242,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) | |||
| 2243 | return true; | 2242 | return true; |
| 2244 | 2243 | ||
| 2245 | err: | 2244 | err: |
| 2246 | intel_sdvo_destroy_enhance_property(connector); | 2245 | intel_sdvo_destroy(connector); |
| 2247 | kfree(intel_sdvo_connector); | ||
| 2248 | return false; | 2246 | return false; |
| 2249 | } | 2247 | } |
| 2250 | 2248 | ||
| @@ -2522,11 +2520,10 @@ static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, | |||
| 2522 | uint16_t response; | 2520 | uint16_t response; |
| 2523 | } enhancements; | 2521 | } enhancements; |
| 2524 | 2522 | ||
| 2525 | if (!intel_sdvo_get_value(intel_sdvo, | 2523 | enhancements.response = 0; |
| 2526 | SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, | 2524 | intel_sdvo_get_value(intel_sdvo, |
| 2527 | &enhancements, sizeof(enhancements))) | 2525 | SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS, |
| 2528 | return false; | 2526 | &enhancements, sizeof(enhancements)); |
| 2529 | |||
| 2530 | if (enhancements.response == 0) { | 2527 | if (enhancements.response == 0) { |
| 2531 | DRM_DEBUG_KMS("No enhancement is supported\n"); | 2528 | DRM_DEBUG_KMS("No enhancement is supported\n"); |
| 2532 | return true; | 2529 | return true; |
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index baa842a80b4b..a23b17a78ace 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
| 37 | #include <asm/msr.h> | 37 | #include <asm/msr.h> |
| 38 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
| 39 | #include <asm/smp.h> | ||
| 39 | 40 | ||
| 40 | #define DRVNAME "coretemp" | 41 | #define DRVNAME "coretemp" |
| 41 | 42 | ||
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index d88077a21994..13c88871dc3b 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
| @@ -463,7 +463,8 @@ static int send_connect(struct iwch_ep *ep) | |||
| 463 | V_MSS_IDX(mtu_idx) | | 463 | V_MSS_IDX(mtu_idx) | |
| 464 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); | 464 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); |
| 465 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); | 465 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); |
| 466 | opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor); | 466 | opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) | |
| 467 | V_CONG_CONTROL_FLAVOR(cong_flavor); | ||
| 467 | skb->priority = CPL_PRIORITY_SETUP; | 468 | skb->priority = CPL_PRIORITY_SETUP; |
| 468 | set_arp_failure_handler(skb, act_open_req_arp_failure); | 469 | set_arp_failure_handler(skb, act_open_req_arp_failure); |
| 469 | 470 | ||
| @@ -1280,7 +1281,8 @@ static void accept_cr(struct iwch_ep *ep, __be32 peer_ip, struct sk_buff *skb) | |||
| 1280 | V_MSS_IDX(mtu_idx) | | 1281 | V_MSS_IDX(mtu_idx) | |
| 1281 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); | 1282 | V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx); |
| 1282 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); | 1283 | opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10); |
| 1283 | opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor); | 1284 | opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) | |
| 1285 | V_CONG_CONTROL_FLAVOR(cong_flavor); | ||
| 1284 | 1286 | ||
| 1285 | rpl = cplhdr(skb); | 1287 | rpl = cplhdr(skb); |
| 1286 | rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); | 1288 | rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); |
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 74dce4ba0262..350eb34f049c 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c | |||
| @@ -81,7 +81,7 @@ static int ns2_led_get_mode(struct ns2_led_data *led_dat, | |||
| 81 | int cmd_level; | 81 | int cmd_level; |
| 82 | int slow_level; | 82 | int slow_level; |
| 83 | 83 | ||
| 84 | read_lock(&led_dat->rw_lock); | 84 | read_lock_irq(&led_dat->rw_lock); |
| 85 | 85 | ||
| 86 | cmd_level = gpio_get_value(led_dat->cmd); | 86 | cmd_level = gpio_get_value(led_dat->cmd); |
| 87 | slow_level = gpio_get_value(led_dat->slow); | 87 | slow_level = gpio_get_value(led_dat->slow); |
| @@ -95,7 +95,7 @@ static int ns2_led_get_mode(struct ns2_led_data *led_dat, | |||
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | read_unlock(&led_dat->rw_lock); | 98 | read_unlock_irq(&led_dat->rw_lock); |
| 99 | 99 | ||
| 100 | return ret; | 100 | return ret; |
| 101 | } | 101 | } |
| @@ -104,8 +104,9 @@ static void ns2_led_set_mode(struct ns2_led_data *led_dat, | |||
| 104 | enum ns2_led_modes mode) | 104 | enum ns2_led_modes mode) |
| 105 | { | 105 | { |
| 106 | int i; | 106 | int i; |
| 107 | unsigned long flags; | ||
| 107 | 108 | ||
| 108 | write_lock(&led_dat->rw_lock); | 109 | write_lock_irqsave(&led_dat->rw_lock, flags); |
| 109 | 110 | ||
| 110 | for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) { | 111 | for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) { |
| 111 | if (mode == ns2_led_modval[i].mode) { | 112 | if (mode == ns2_led_modval[i].mode) { |
| @@ -116,7 +117,7 @@ static void ns2_led_set_mode(struct ns2_led_data *led_dat, | |||
| 116 | } | 117 | } |
| 117 | } | 118 | } |
| 118 | 119 | ||
| 119 | write_unlock(&led_dat->rw_lock); | 120 | write_unlock_irqrestore(&led_dat->rw_lock, flags); |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | static void ns2_led_set(struct led_classdev *led_cdev, | 123 | static void ns2_led_set(struct led_classdev *led_cdev, |
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 71ad4163b95e..aacb862ecc8a 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
| @@ -241,8 +241,10 @@ static struct sdhci_ops sdhci_s3c_ops = { | |||
| 241 | static void sdhci_s3c_notify_change(struct platform_device *dev, int state) | 241 | static void sdhci_s3c_notify_change(struct platform_device *dev, int state) |
| 242 | { | 242 | { |
| 243 | struct sdhci_host *host = platform_get_drvdata(dev); | 243 | struct sdhci_host *host = platform_get_drvdata(dev); |
| 244 | unsigned long flags; | ||
| 245 | |||
| 244 | if (host) { | 246 | if (host) { |
| 245 | spin_lock(&host->lock); | 247 | spin_lock_irqsave(&host->lock, flags); |
| 246 | if (state) { | 248 | if (state) { |
| 247 | dev_dbg(&dev->dev, "card inserted.\n"); | 249 | dev_dbg(&dev->dev, "card inserted.\n"); |
| 248 | host->flags &= ~SDHCI_DEVICE_DEAD; | 250 | host->flags &= ~SDHCI_DEVICE_DEAD; |
| @@ -253,7 +255,7 @@ static void sdhci_s3c_notify_change(struct platform_device *dev, int state) | |||
| 253 | host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; | 255 | host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; |
| 254 | } | 256 | } |
| 255 | tasklet_schedule(&host->card_tasklet); | 257 | tasklet_schedule(&host->card_tasklet); |
| 256 | spin_unlock(&host->lock); | 258 | spin_unlock_irqrestore(&host->lock, flags); |
| 257 | } | 259 | } |
| 258 | } | 260 | } |
| 259 | 261 | ||
| @@ -481,8 +483,10 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) | |||
| 481 | sdhci_remove_host(host, 1); | 483 | sdhci_remove_host(host, 1); |
| 482 | 484 | ||
| 483 | for (ptr = 0; ptr < 3; ptr++) { | 485 | for (ptr = 0; ptr < 3; ptr++) { |
| 484 | clk_disable(sc->clk_bus[ptr]); | 486 | if (sc->clk_bus[ptr]) { |
| 485 | clk_put(sc->clk_bus[ptr]); | 487 | clk_disable(sc->clk_bus[ptr]); |
| 488 | clk_put(sc->clk_bus[ptr]); | ||
| 489 | } | ||
| 486 | } | 490 | } |
| 487 | clk_disable(sc->clk_io); | 491 | clk_disable(sc->clk_io); |
| 488 | clk_put(sc->clk_io); | 492 | clk_put(sc->clk_io); |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index fa42103b2874..179871d9e71f 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
| @@ -2942,6 +2942,9 @@ static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
| 2942 | { | 2942 | { |
| 2943 | struct vortex_private *vp = netdev_priv(dev); | 2943 | struct vortex_private *vp = netdev_priv(dev); |
| 2944 | 2944 | ||
| 2945 | if (!VORTEX_PCI(vp)) | ||
| 2946 | return; | ||
| 2947 | |||
| 2945 | wol->supported = WAKE_MAGIC; | 2948 | wol->supported = WAKE_MAGIC; |
| 2946 | 2949 | ||
| 2947 | wol->wolopts = 0; | 2950 | wol->wolopts = 0; |
| @@ -2952,6 +2955,10 @@ static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
| 2952 | static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 2955 | static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
| 2953 | { | 2956 | { |
| 2954 | struct vortex_private *vp = netdev_priv(dev); | 2957 | struct vortex_private *vp = netdev_priv(dev); |
| 2958 | |||
| 2959 | if (!VORTEX_PCI(vp)) | ||
| 2960 | return -EOPNOTSUPP; | ||
| 2961 | |||
| 2955 | if (wol->wolopts & ~WAKE_MAGIC) | 2962 | if (wol->wolopts & ~WAKE_MAGIC) |
| 2956 | return -EINVAL; | 2963 | return -EINVAL; |
| 2957 | 2964 | ||
| @@ -3201,6 +3208,9 @@ static void acpi_set_WOL(struct net_device *dev) | |||
| 3201 | return; | 3208 | return; |
| 3202 | } | 3209 | } |
| 3203 | 3210 | ||
| 3211 | if (VORTEX_PCI(vp)->current_state < PCI_D3hot) | ||
| 3212 | return; | ||
| 3213 | |||
| 3204 | /* Change the power state to D3; RxEnable doesn't take effect. */ | 3214 | /* Change the power state to D3; RxEnable doesn't take effect. */ |
| 3205 | pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot); | 3215 | pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot); |
| 3206 | } | 3216 | } |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 63b9ba0cc67e..c73be2848319 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
| @@ -1251,6 +1251,12 @@ static void atl1_free_ring_resources(struct atl1_adapter *adapter) | |||
| 1251 | 1251 | ||
| 1252 | rrd_ring->desc = NULL; | 1252 | rrd_ring->desc = NULL; |
| 1253 | rrd_ring->dma = 0; | 1253 | rrd_ring->dma = 0; |
| 1254 | |||
| 1255 | adapter->cmb.dma = 0; | ||
| 1256 | adapter->cmb.cmb = NULL; | ||
| 1257 | |||
| 1258 | adapter->smb.dma = 0; | ||
| 1259 | adapter->smb.smb = NULL; | ||
| 1254 | } | 1260 | } |
| 1255 | 1261 | ||
| 1256 | static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter) | 1262 | static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter) |
| @@ -2847,10 +2853,11 @@ static int atl1_resume(struct pci_dev *pdev) | |||
| 2847 | pci_enable_wake(pdev, PCI_D3cold, 0); | 2853 | pci_enable_wake(pdev, PCI_D3cold, 0); |
| 2848 | 2854 | ||
| 2849 | atl1_reset_hw(&adapter->hw); | 2855 | atl1_reset_hw(&adapter->hw); |
| 2850 | adapter->cmb.cmb->int_stats = 0; | ||
| 2851 | 2856 | ||
| 2852 | if (netif_running(netdev)) | 2857 | if (netif_running(netdev)) { |
| 2858 | adapter->cmb.cmb->int_stats = 0; | ||
| 2853 | atl1_up(adapter); | 2859 | atl1_up(adapter); |
| 2860 | } | ||
| 2854 | netif_device_attach(netdev); | 2861 | netif_device_attach(netdev); |
| 2855 | 2862 | ||
| 2856 | return 0; | 2863 | return 0; |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 66ed08f726fb..ba302a5c2c30 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
| @@ -57,6 +57,7 @@ enum e1e_registers { | |||
| 57 | E1000_SCTL = 0x00024, /* SerDes Control - RW */ | 57 | E1000_SCTL = 0x00024, /* SerDes Control - RW */ |
| 58 | E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */ | 58 | E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */ |
| 59 | E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */ | 59 | E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */ |
| 60 | E1000_FEXTNVM4 = 0x00024, /* Future Extended NVM 4 - RW */ | ||
| 60 | E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ | 61 | E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ |
| 61 | E1000_FCT = 0x00030, /* Flow Control Type - RW */ | 62 | E1000_FCT = 0x00030, /* Flow Control Type - RW */ |
| 62 | E1000_VET = 0x00038, /* VLAN Ether Type - RW */ | 63 | E1000_VET = 0x00038, /* VLAN Ether Type - RW */ |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 63930d12711c..57b5435599ab 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
| @@ -105,6 +105,10 @@ | |||
| 105 | #define E1000_FEXTNVM_SW_CONFIG 1 | 105 | #define E1000_FEXTNVM_SW_CONFIG 1 |
| 106 | #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ | 106 | #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ |
| 107 | 107 | ||
| 108 | #define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7 | ||
| 109 | #define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7 | ||
| 110 | #define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3 | ||
| 111 | |||
| 108 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL | 112 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL |
| 109 | 113 | ||
| 110 | #define E1000_ICH_RAR_ENTRIES 7 | 114 | #define E1000_ICH_RAR_ENTRIES 7 |
| @@ -125,6 +129,7 @@ | |||
| 125 | 129 | ||
| 126 | /* SMBus Address Phy Register */ | 130 | /* SMBus Address Phy Register */ |
| 127 | #define HV_SMB_ADDR PHY_REG(768, 26) | 131 | #define HV_SMB_ADDR PHY_REG(768, 26) |
| 132 | #define HV_SMB_ADDR_MASK 0x007F | ||
| 128 | #define HV_SMB_ADDR_PEC_EN 0x0200 | 133 | #define HV_SMB_ADDR_PEC_EN 0x0200 |
| 129 | #define HV_SMB_ADDR_VALID 0x0080 | 134 | #define HV_SMB_ADDR_VALID 0x0080 |
| 130 | 135 | ||
| @@ -237,6 +242,8 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | |||
| 237 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | 242 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); |
| 238 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); | 243 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); |
| 239 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); | 244 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); |
| 245 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); | ||
| 246 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); | ||
| 240 | 247 | ||
| 241 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 248 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
| 242 | { | 249 | { |
| @@ -272,7 +279,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) | |||
| 272 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | 279 | static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) |
| 273 | { | 280 | { |
| 274 | struct e1000_phy_info *phy = &hw->phy; | 281 | struct e1000_phy_info *phy = &hw->phy; |
| 275 | u32 ctrl; | 282 | u32 ctrl, fwsm; |
| 276 | s32 ret_val = 0; | 283 | s32 ret_val = 0; |
| 277 | 284 | ||
| 278 | phy->addr = 1; | 285 | phy->addr = 1; |
| @@ -294,7 +301,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 294 | * disabled, then toggle the LANPHYPC Value bit to force | 301 | * disabled, then toggle the LANPHYPC Value bit to force |
| 295 | * the interconnect to PCIe mode. | 302 | * the interconnect to PCIe mode. |
| 296 | */ | 303 | */ |
| 297 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | 304 | fwsm = er32(FWSM); |
| 305 | if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) { | ||
| 298 | ctrl = er32(CTRL); | 306 | ctrl = er32(CTRL); |
| 299 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; | 307 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; |
| 300 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; | 308 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; |
| @@ -303,6 +311,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 303 | ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; | 311 | ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; |
| 304 | ew32(CTRL, ctrl); | 312 | ew32(CTRL, ctrl); |
| 305 | msleep(50); | 313 | msleep(50); |
| 314 | |||
| 315 | /* | ||
| 316 | * Gate automatic PHY configuration by hardware on | ||
| 317 | * non-managed 82579 | ||
| 318 | */ | ||
| 319 | if (hw->mac.type == e1000_pch2lan) | ||
| 320 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
| 306 | } | 321 | } |
| 307 | 322 | ||
| 308 | /* | 323 | /* |
| @@ -315,6 +330,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
| 315 | if (ret_val) | 330 | if (ret_val) |
| 316 | goto out; | 331 | goto out; |
| 317 | 332 | ||
| 333 | /* Ungate automatic PHY configuration on non-managed 82579 */ | ||
| 334 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 335 | !(fwsm & E1000_ICH_FWSM_FW_VALID)) { | ||
| 336 | msleep(10); | ||
| 337 | e1000_gate_hw_phy_config_ich8lan(hw, false); | ||
| 338 | } | ||
| 339 | |||
| 318 | phy->id = e1000_phy_unknown; | 340 | phy->id = e1000_phy_unknown; |
| 319 | ret_val = e1000e_get_phy_id(hw); | 341 | ret_val = e1000e_get_phy_id(hw); |
| 320 | if (ret_val) | 342 | if (ret_val) |
| @@ -561,13 +583,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
| 561 | if (mac->type == e1000_ich8lan) | 583 | if (mac->type == e1000_ich8lan) |
| 562 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); | 584 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); |
| 563 | 585 | ||
| 564 | /* Disable PHY configuration by hardware, config by software */ | 586 | /* Gate automatic PHY configuration by hardware on managed 82579 */ |
| 565 | if (mac->type == e1000_pch2lan) { | 587 | if ((mac->type == e1000_pch2lan) && |
| 566 | u32 extcnf_ctrl = er32(EXTCNF_CTRL); | 588 | (er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) |
| 567 | 589 | e1000_gate_hw_phy_config_ich8lan(hw, true); | |
| 568 | extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
| 569 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
| 570 | } | ||
| 571 | 590 | ||
| 572 | return 0; | 591 | return 0; |
| 573 | } | 592 | } |
| @@ -652,6 +671,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | |||
| 652 | goto out; | 671 | goto out; |
| 653 | } | 672 | } |
| 654 | 673 | ||
| 674 | if (hw->mac.type == e1000_pch2lan) { | ||
| 675 | ret_val = e1000_k1_workaround_lv(hw); | ||
| 676 | if (ret_val) | ||
| 677 | goto out; | ||
| 678 | } | ||
| 679 | |||
| 655 | /* | 680 | /* |
| 656 | * Check if there was DownShift, must be checked | 681 | * Check if there was DownShift, must be checked |
| 657 | * immediately after link-up | 682 | * immediately after link-up |
| @@ -895,6 +920,34 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) | |||
| 895 | } | 920 | } |
| 896 | 921 | ||
| 897 | /** | 922 | /** |
| 923 | * e1000_write_smbus_addr - Write SMBus address to PHY needed during Sx states | ||
| 924 | * @hw: pointer to the HW structure | ||
| 925 | * | ||
| 926 | * Assumes semaphore already acquired. | ||
| 927 | * | ||
| 928 | **/ | ||
| 929 | static s32 e1000_write_smbus_addr(struct e1000_hw *hw) | ||
| 930 | { | ||
| 931 | u16 phy_data; | ||
| 932 | u32 strap = er32(STRAP); | ||
| 933 | s32 ret_val = 0; | ||
| 934 | |||
| 935 | strap &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
| 936 | |||
| 937 | ret_val = e1000_read_phy_reg_hv_locked(hw, HV_SMB_ADDR, &phy_data); | ||
| 938 | if (ret_val) | ||
| 939 | goto out; | ||
| 940 | |||
| 941 | phy_data &= ~HV_SMB_ADDR_MASK; | ||
| 942 | phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT); | ||
| 943 | phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
| 944 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data); | ||
| 945 | |||
| 946 | out: | ||
| 947 | return ret_val; | ||
| 948 | } | ||
| 949 | |||
| 950 | /** | ||
| 898 | * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration | 951 | * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration |
| 899 | * @hw: pointer to the HW structure | 952 | * @hw: pointer to the HW structure |
| 900 | * | 953 | * |
| @@ -903,7 +956,6 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) | |||
| 903 | **/ | 956 | **/ |
| 904 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | 957 | static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) |
| 905 | { | 958 | { |
| 906 | struct e1000_adapter *adapter = hw->adapter; | ||
| 907 | struct e1000_phy_info *phy = &hw->phy; | 959 | struct e1000_phy_info *phy = &hw->phy; |
| 908 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; | 960 | u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask; |
| 909 | s32 ret_val = 0; | 961 | s32 ret_val = 0; |
| @@ -921,7 +973,8 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
| 921 | if (phy->type != e1000_phy_igp_3) | 973 | if (phy->type != e1000_phy_igp_3) |
| 922 | return ret_val; | 974 | return ret_val; |
| 923 | 975 | ||
| 924 | if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) { | 976 | if ((hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) || |
| 977 | (hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_C)) { | ||
| 925 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; | 978 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; |
| 926 | break; | 979 | break; |
| 927 | } | 980 | } |
| @@ -961,21 +1014,16 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
| 961 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | 1014 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; |
| 962 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | 1015 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; |
| 963 | 1016 | ||
| 964 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | 1017 | if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && |
| 965 | ((hw->mac.type == e1000_pchlan) || | 1018 | (hw->mac.type == e1000_pchlan)) || |
| 966 | (hw->mac.type == e1000_pch2lan))) { | 1019 | (hw->mac.type == e1000_pch2lan)) { |
| 967 | /* | 1020 | /* |
| 968 | * HW configures the SMBus address and LEDs when the | 1021 | * HW configures the SMBus address and LEDs when the |
| 969 | * OEM and LCD Write Enable bits are set in the NVM. | 1022 | * OEM and LCD Write Enable bits are set in the NVM. |
| 970 | * When both NVM bits are cleared, SW will configure | 1023 | * When both NVM bits are cleared, SW will configure |
| 971 | * them instead. | 1024 | * them instead. |
| 972 | */ | 1025 | */ |
| 973 | data = er32(STRAP); | 1026 | ret_val = e1000_write_smbus_addr(hw); |
| 974 | data &= E1000_STRAP_SMBUS_ADDRESS_MASK; | ||
| 975 | reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT; | ||
| 976 | reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | ||
| 977 | ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, | ||
| 978 | reg_data); | ||
| 979 | if (ret_val) | 1027 | if (ret_val) |
| 980 | goto out; | 1028 | goto out; |
| 981 | 1029 | ||
| @@ -1440,10 +1488,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1440 | goto out; | 1488 | goto out; |
| 1441 | 1489 | ||
| 1442 | /* Enable jumbo frame workaround in the PHY */ | 1490 | /* Enable jumbo frame workaround in the PHY */ |
| 1443 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
| 1444 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
| 1445 | if (ret_val) | ||
| 1446 | goto out; | ||
| 1447 | e1e_rphy(hw, PHY_REG(769, 23), &data); | 1491 | e1e_rphy(hw, PHY_REG(769, 23), &data); |
| 1448 | data &= ~(0x7F << 5); | 1492 | data &= ~(0x7F << 5); |
| 1449 | data |= (0x37 << 5); | 1493 | data |= (0x37 << 5); |
| @@ -1452,7 +1496,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1452 | goto out; | 1496 | goto out; |
| 1453 | e1e_rphy(hw, PHY_REG(769, 16), &data); | 1497 | e1e_rphy(hw, PHY_REG(769, 16), &data); |
| 1454 | data &= ~(1 << 13); | 1498 | data &= ~(1 << 13); |
| 1455 | data |= (1 << 12); | ||
| 1456 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | 1499 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); |
| 1457 | if (ret_val) | 1500 | if (ret_val) |
| 1458 | goto out; | 1501 | goto out; |
| @@ -1477,7 +1520,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1477 | 1520 | ||
| 1478 | mac_reg = er32(RCTL); | 1521 | mac_reg = er32(RCTL); |
| 1479 | mac_reg &= ~E1000_RCTL_SECRC; | 1522 | mac_reg &= ~E1000_RCTL_SECRC; |
| 1480 | ew32(FFLT_DBG, mac_reg); | 1523 | ew32(RCTL, mac_reg); |
| 1481 | 1524 | ||
| 1482 | ret_val = e1000e_read_kmrn_reg(hw, | 1525 | ret_val = e1000e_read_kmrn_reg(hw, |
| 1483 | E1000_KMRNCTRLSTA_CTRL_OFFSET, | 1526 | E1000_KMRNCTRLSTA_CTRL_OFFSET, |
| @@ -1503,17 +1546,12 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
| 1503 | goto out; | 1546 | goto out; |
| 1504 | 1547 | ||
| 1505 | /* Write PHY register values back to h/w defaults */ | 1548 | /* Write PHY register values back to h/w defaults */ |
| 1506 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
| 1507 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
| 1508 | if (ret_val) | ||
| 1509 | goto out; | ||
| 1510 | e1e_rphy(hw, PHY_REG(769, 23), &data); | 1549 | e1e_rphy(hw, PHY_REG(769, 23), &data); |
| 1511 | data &= ~(0x7F << 5); | 1550 | data &= ~(0x7F << 5); |
| 1512 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); | 1551 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); |
| 1513 | if (ret_val) | 1552 | if (ret_val) |
| 1514 | goto out; | 1553 | goto out; |
| 1515 | e1e_rphy(hw, PHY_REG(769, 16), &data); | 1554 | e1e_rphy(hw, PHY_REG(769, 16), &data); |
| 1516 | data &= ~(1 << 12); | ||
| 1517 | data |= (1 << 13); | 1555 | data |= (1 << 13); |
| 1518 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | 1556 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); |
| 1519 | if (ret_val) | 1557 | if (ret_val) |
| @@ -1559,6 +1597,69 @@ out: | |||
| 1559 | } | 1597 | } |
| 1560 | 1598 | ||
| 1561 | /** | 1599 | /** |
| 1600 | * e1000_k1_gig_workaround_lv - K1 Si workaround | ||
| 1601 | * @hw: pointer to the HW structure | ||
| 1602 | * | ||
| 1603 | * Workaround to set the K1 beacon duration for 82579 parts | ||
| 1604 | **/ | ||
| 1605 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw) | ||
| 1606 | { | ||
| 1607 | s32 ret_val = 0; | ||
| 1608 | u16 status_reg = 0; | ||
| 1609 | u32 mac_reg; | ||
| 1610 | |||
| 1611 | if (hw->mac.type != e1000_pch2lan) | ||
| 1612 | goto out; | ||
| 1613 | |||
| 1614 | /* Set K1 beacon duration based on 1Gbps speed or otherwise */ | ||
| 1615 | ret_val = e1e_rphy(hw, HV_M_STATUS, &status_reg); | ||
| 1616 | if (ret_val) | ||
| 1617 | goto out; | ||
| 1618 | |||
| 1619 | if ((status_reg & (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) | ||
| 1620 | == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) { | ||
| 1621 | mac_reg = er32(FEXTNVM4); | ||
| 1622 | mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK; | ||
| 1623 | |||
| 1624 | if (status_reg & HV_M_STATUS_SPEED_1000) | ||
| 1625 | mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC; | ||
| 1626 | else | ||
| 1627 | mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC; | ||
| 1628 | |||
| 1629 | ew32(FEXTNVM4, mac_reg); | ||
| 1630 | } | ||
| 1631 | |||
| 1632 | out: | ||
| 1633 | return ret_val; | ||
| 1634 | } | ||
| 1635 | |||
| 1636 | /** | ||
| 1637 | * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware | ||
| 1638 | * @hw: pointer to the HW structure | ||
| 1639 | * @gate: boolean set to true to gate, false to ungate | ||
| 1640 | * | ||
| 1641 | * Gate/ungate the automatic PHY configuration via hardware; perform | ||
| 1642 | * the configuration via software instead. | ||
| 1643 | **/ | ||
| 1644 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate) | ||
| 1645 | { | ||
| 1646 | u32 extcnf_ctrl; | ||
| 1647 | |||
| 1648 | if (hw->mac.type != e1000_pch2lan) | ||
| 1649 | return; | ||
| 1650 | |||
| 1651 | extcnf_ctrl = er32(EXTCNF_CTRL); | ||
| 1652 | |||
| 1653 | if (gate) | ||
| 1654 | extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
| 1655 | else | ||
| 1656 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
| 1657 | |||
| 1658 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
| 1659 | return; | ||
| 1660 | } | ||
| 1661 | |||
| 1662 | /** | ||
| 1562 | * e1000_lan_init_done_ich8lan - Check for PHY config completion | 1663 | * e1000_lan_init_done_ich8lan - Check for PHY config completion |
| 1563 | * @hw: pointer to the HW structure | 1664 | * @hw: pointer to the HW structure |
| 1564 | * | 1665 | * |
| @@ -1602,6 +1703,9 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) | |||
| 1602 | if (e1000_check_reset_block(hw)) | 1703 | if (e1000_check_reset_block(hw)) |
| 1603 | goto out; | 1704 | goto out; |
| 1604 | 1705 | ||
| 1706 | /* Allow time for h/w to get to quiescent state after reset */ | ||
| 1707 | msleep(10); | ||
| 1708 | |||
| 1605 | /* Perform any necessary post-reset workarounds */ | 1709 | /* Perform any necessary post-reset workarounds */ |
| 1606 | switch (hw->mac.type) { | 1710 | switch (hw->mac.type) { |
| 1607 | case e1000_pchlan: | 1711 | case e1000_pchlan: |
| @@ -1630,6 +1734,13 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) | |||
| 1630 | /* Configure the LCD with the OEM bits in NVM */ | 1734 | /* Configure the LCD with the OEM bits in NVM */ |
| 1631 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); | 1735 | ret_val = e1000_oem_bits_config_ich8lan(hw, true); |
| 1632 | 1736 | ||
| 1737 | /* Ungate automatic PHY configuration on non-managed 82579 */ | ||
| 1738 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 1739 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | ||
| 1740 | msleep(10); | ||
| 1741 | e1000_gate_hw_phy_config_ich8lan(hw, false); | ||
| 1742 | } | ||
| 1743 | |||
| 1633 | out: | 1744 | out: |
| 1634 | return ret_val; | 1745 | return ret_val; |
| 1635 | } | 1746 | } |
| @@ -1646,6 +1757,11 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) | |||
| 1646 | { | 1757 | { |
| 1647 | s32 ret_val = 0; | 1758 | s32 ret_val = 0; |
| 1648 | 1759 | ||
| 1760 | /* Gate automatic PHY configuration by hardware on non-managed 82579 */ | ||
| 1761 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 1762 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) | ||
| 1763 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
| 1764 | |||
| 1649 | ret_val = e1000e_phy_hw_reset_generic(hw); | 1765 | ret_val = e1000e_phy_hw_reset_generic(hw); |
| 1650 | if (ret_val) | 1766 | if (ret_val) |
| 1651 | goto out; | 1767 | goto out; |
| @@ -2910,6 +3026,14 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
| 2910 | * external PHY is reset. | 3026 | * external PHY is reset. |
| 2911 | */ | 3027 | */ |
| 2912 | ctrl |= E1000_CTRL_PHY_RST; | 3028 | ctrl |= E1000_CTRL_PHY_RST; |
| 3029 | |||
| 3030 | /* | ||
| 3031 | * Gate automatic PHY configuration by hardware on | ||
| 3032 | * non-managed 82579 | ||
| 3033 | */ | ||
| 3034 | if ((hw->mac.type == e1000_pch2lan) && | ||
| 3035 | !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) | ||
| 3036 | e1000_gate_hw_phy_config_ich8lan(hw, true); | ||
| 2913 | } | 3037 | } |
| 2914 | ret_val = e1000_acquire_swflag_ich8lan(hw); | 3038 | ret_val = e1000_acquire_swflag_ich8lan(hw); |
| 2915 | e_dbg("Issuing a global reset to ich8lan\n"); | 3039 | e_dbg("Issuing a global reset to ich8lan\n"); |
| @@ -3460,13 +3584,20 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) | |||
| 3460 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) | 3584 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) |
| 3461 | { | 3585 | { |
| 3462 | u32 phy_ctrl; | 3586 | u32 phy_ctrl; |
| 3587 | s32 ret_val; | ||
| 3463 | 3588 | ||
| 3464 | phy_ctrl = er32(PHY_CTRL); | 3589 | phy_ctrl = er32(PHY_CTRL); |
| 3465 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE; | 3590 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE; |
| 3466 | ew32(PHY_CTRL, phy_ctrl); | 3591 | ew32(PHY_CTRL, phy_ctrl); |
| 3467 | 3592 | ||
| 3468 | if (hw->mac.type >= e1000_pchlan) | 3593 | if (hw->mac.type >= e1000_pchlan) { |
| 3469 | e1000_phy_hw_reset_ich8lan(hw); | 3594 | e1000_oem_bits_config_ich8lan(hw, true); |
| 3595 | ret_val = hw->phy.ops.acquire(hw); | ||
| 3596 | if (ret_val) | ||
| 3597 | return; | ||
| 3598 | e1000_write_smbus_addr(hw); | ||
| 3599 | hw->phy.ops.release(hw); | ||
| 3600 | } | ||
| 3470 | } | 3601 | } |
| 3471 | 3602 | ||
| 3472 | /** | 3603 | /** |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 2b8ef44bd2b1..e561d15c3eb1 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
| @@ -2704,6 +2704,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
| 2704 | u32 psrctl = 0; | 2704 | u32 psrctl = 0; |
| 2705 | u32 pages = 0; | 2705 | u32 pages = 0; |
| 2706 | 2706 | ||
| 2707 | /* Workaround Si errata on 82579 - configure jumbo frame flow */ | ||
| 2708 | if (hw->mac.type == e1000_pch2lan) { | ||
| 2709 | s32 ret_val; | ||
| 2710 | |||
| 2711 | if (adapter->netdev->mtu > ETH_DATA_LEN) | ||
| 2712 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | ||
| 2713 | else | ||
| 2714 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | ||
| 2715 | } | ||
| 2716 | |||
| 2707 | /* Program MC offset vector base */ | 2717 | /* Program MC offset vector base */ |
| 2708 | rctl = er32(RCTL); | 2718 | rctl = er32(RCTL); |
| 2709 | rctl &= ~(3 << E1000_RCTL_MO_SHIFT); | 2719 | rctl &= ~(3 << E1000_RCTL_MO_SHIFT); |
| @@ -2744,16 +2754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
| 2744 | e1e_wphy(hw, 22, phy_data); | 2754 | e1e_wphy(hw, 22, phy_data); |
| 2745 | } | 2755 | } |
| 2746 | 2756 | ||
| 2747 | /* Workaround Si errata on 82579 - configure jumbo frame flow */ | ||
| 2748 | if (hw->mac.type == e1000_pch2lan) { | ||
| 2749 | s32 ret_val; | ||
| 2750 | |||
| 2751 | if (rctl & E1000_RCTL_LPE) | ||
| 2752 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | ||
| 2753 | else | ||
| 2754 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | ||
| 2755 | } | ||
| 2756 | |||
| 2757 | /* Setup buffer sizes */ | 2757 | /* Setup buffer sizes */ |
| 2758 | rctl &= ~E1000_RCTL_SZ_4096; | 2758 | rctl &= ~E1000_RCTL_SZ_4096; |
| 2759 | rctl |= E1000_RCTL_BSEX; | 2759 | rctl |= E1000_RCTL_BSEX; |
| @@ -4833,6 +4833,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
| 4833 | return -EINVAL; | 4833 | return -EINVAL; |
| 4834 | } | 4834 | } |
| 4835 | 4835 | ||
| 4836 | /* Jumbo frame workaround on 82579 requires CRC be stripped */ | ||
| 4837 | if ((adapter->hw.mac.type == e1000_pch2lan) && | ||
| 4838 | !(adapter->flags2 & FLAG2_CRC_STRIPPING) && | ||
| 4839 | (new_mtu > ETH_DATA_LEN)) { | ||
| 4840 | e_err("Jumbo Frames not supported on 82579 when CRC " | ||
| 4841 | "stripping is disabled.\n"); | ||
| 4842 | return -EINVAL; | ||
| 4843 | } | ||
| 4844 | |||
| 4836 | /* 82573 Errata 17 */ | 4845 | /* 82573 Errata 17 */ |
| 4837 | if (((adapter->hw.mac.type == e1000_82573) || | 4846 | if (((adapter->hw.mac.type == e1000_82573) || |
| 4838 | (adapter->hw.mac.type == e1000_82574)) && | 4847 | (adapter->hw.mac.type == e1000_82574)) && |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 3506fd6ad726..519e19e23955 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
| @@ -2928,7 +2928,7 @@ static int __devinit emac_probe(struct platform_device *ofdev, | |||
| 2928 | if (dev->emac_irq != NO_IRQ) | 2928 | if (dev->emac_irq != NO_IRQ) |
| 2929 | irq_dispose_mapping(dev->emac_irq); | 2929 | irq_dispose_mapping(dev->emac_irq); |
| 2930 | err_free: | 2930 | err_free: |
| 2931 | kfree(ndev); | 2931 | free_netdev(ndev); |
| 2932 | err_gone: | 2932 | err_gone: |
| 2933 | /* if we were on the bootlist, remove us as we won't show up and | 2933 | /* if we were on the bootlist, remove us as we won't show up and |
| 2934 | * wake up all waiters to notify them in case they were waiting | 2934 | * wake up all waiters to notify them in case they were waiting |
| @@ -2971,7 +2971,7 @@ static int __devexit emac_remove(struct platform_device *ofdev) | |||
| 2971 | if (dev->emac_irq != NO_IRQ) | 2971 | if (dev->emac_irq != NO_IRQ) |
| 2972 | irq_dispose_mapping(dev->emac_irq); | 2972 | irq_dispose_mapping(dev->emac_irq); |
| 2973 | 2973 | ||
| 2974 | kfree(dev->ndev); | 2974 | free_netdev(dev->ndev); |
| 2975 | 2975 | ||
| 2976 | return 0; | 2976 | return 0; |
| 2977 | } | 2977 | } |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index cabae7bb1fc6..b075a35b85d4 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
| @@ -1540,7 +1540,6 @@ netxen_process_rcv(struct netxen_adapter *adapter, | |||
| 1540 | if (pkt_offset) | 1540 | if (pkt_offset) |
| 1541 | skb_pull(skb, pkt_offset); | 1541 | skb_pull(skb, pkt_offset); |
| 1542 | 1542 | ||
| 1543 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
| 1544 | skb->protocol = eth_type_trans(skb, netdev); | 1543 | skb->protocol = eth_type_trans(skb, netdev); |
| 1545 | 1544 | ||
| 1546 | napi_gro_receive(&sds_ring->napi, skb); | 1545 | napi_gro_receive(&sds_ring->napi, skb); |
| @@ -1602,8 +1601,6 @@ netxen_process_lro(struct netxen_adapter *adapter, | |||
| 1602 | 1601 | ||
| 1603 | skb_put(skb, lro_length + data_offset); | 1602 | skb_put(skb, lro_length + data_offset); |
| 1604 | 1603 | ||
| 1605 | skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); | ||
| 1606 | |||
| 1607 | skb_pull(skb, l2_hdr_offset); | 1604 | skb_pull(skb, l2_hdr_offset); |
| 1608 | skb->protocol = eth_type_trans(skb, netdev); | 1605 | skb->protocol = eth_type_trans(skb, netdev); |
| 1609 | 1606 | ||
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 75ba744b173c..2c7cf0b64811 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
| @@ -1316,7 +1316,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, | |||
| 1316 | return -ENOMEM; | 1316 | return -ENOMEM; |
| 1317 | } | 1317 | } |
| 1318 | 1318 | ||
| 1319 | skb_reserve(skb, 2); | 1319 | skb_reserve(skb, NET_IP_ALIGN); |
| 1320 | 1320 | ||
| 1321 | dma = pci_map_single(pdev, skb->data, | 1321 | dma = pci_map_single(pdev, skb->data, |
| 1322 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | 1322 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); |
| @@ -1404,7 +1404,6 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter, | |||
| 1404 | if (pkt_offset) | 1404 | if (pkt_offset) |
| 1405 | skb_pull(skb, pkt_offset); | 1405 | skb_pull(skb, pkt_offset); |
| 1406 | 1406 | ||
| 1407 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
| 1408 | skb->protocol = eth_type_trans(skb, netdev); | 1407 | skb->protocol = eth_type_trans(skb, netdev); |
| 1409 | 1408 | ||
| 1410 | napi_gro_receive(&sds_ring->napi, skb); | 1409 | napi_gro_receive(&sds_ring->napi, skb); |
| @@ -1466,8 +1465,6 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter, | |||
| 1466 | 1465 | ||
| 1467 | skb_put(skb, lro_length + data_offset); | 1466 | skb_put(skb, lro_length + data_offset); |
| 1468 | 1467 | ||
| 1469 | skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb); | ||
| 1470 | |||
| 1471 | skb_pull(skb, l2_hdr_offset); | 1468 | skb_pull(skb, l2_hdr_offset); |
| 1472 | skb->protocol = eth_type_trans(skb, netdev); | 1469 | skb->protocol = eth_type_trans(skb, netdev); |
| 1473 | 1470 | ||
| @@ -1700,8 +1697,6 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, | |||
| 1700 | if (pkt_offset) | 1697 | if (pkt_offset) |
| 1701 | skb_pull(skb, pkt_offset); | 1698 | skb_pull(skb, pkt_offset); |
| 1702 | 1699 | ||
| 1703 | skb->truesize = skb->len + sizeof(struct sk_buff); | ||
| 1704 | |||
| 1705 | if (!qlcnic_check_loopback_buff(skb->data)) | 1700 | if (!qlcnic_check_loopback_buff(skb->data)) |
| 1706 | adapter->diag_cnt++; | 1701 | adapter->diag_cnt++; |
| 1707 | 1702 | ||
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 07eb884ff982..44150f2f7bfd 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c | |||
| @@ -384,7 +384,7 @@ static void rionet_remove(struct rio_dev *rdev) | |||
| 384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? | 384 | free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? |
| 385 | __ilog2(sizeof(void *)) + 4 : 0); | 385 | __ilog2(sizeof(void *)) + 4 : 0); |
| 386 | unregister_netdev(ndev); | 386 | unregister_netdev(ndev); |
| 387 | kfree(ndev); | 387 | free_netdev(ndev); |
| 388 | 388 | ||
| 389 | list_for_each_entry_safe(peer, tmp, &rionet_peers, node) { | 389 | list_for_each_entry_safe(peer, tmp, &rionet_peers, node) { |
| 390 | list_del(&peer->node); | 390 | list_del(&peer->node); |
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index cc4bd8c65f8b..9265315baa0b 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c | |||
| @@ -804,7 +804,7 @@ static int __devinit sgiseeq_probe(struct platform_device *pdev) | |||
| 804 | err_out_free_page: | 804 | err_out_free_page: |
| 805 | free_page((unsigned long) sp->srings); | 805 | free_page((unsigned long) sp->srings); |
| 806 | err_out_free_dev: | 806 | err_out_free_dev: |
| 807 | kfree(dev); | 807 | free_netdev(dev); |
| 808 | 808 | ||
| 809 | err_out: | 809 | err_out: |
| 810 | return err; | 810 | return err; |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 0909ae934ad0..8150ba154116 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | 58 | ||
| 59 | MODULE_LICENSE("GPL"); | 59 | MODULE_LICENSE("GPL"); |
| 60 | MODULE_VERSION(SMSC_DRV_VERSION); | 60 | MODULE_VERSION(SMSC_DRV_VERSION); |
| 61 | MODULE_ALIAS("platform:smsc911x"); | ||
| 61 | 62 | ||
| 62 | #if USE_DEBUG > 0 | 63 | #if USE_DEBUG > 0 |
| 63 | static int debug = 16; | 64 | static int debug = 16; |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 5efa57757a2c..6888e3d41462 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
| @@ -243,6 +243,7 @@ enum { | |||
| 243 | NWayState = (1 << 14) | (1 << 13) | (1 << 12), | 243 | NWayState = (1 << 14) | (1 << 13) | (1 << 12), |
| 244 | NWayRestart = (1 << 12), | 244 | NWayRestart = (1 << 12), |
| 245 | NonselPortActive = (1 << 9), | 245 | NonselPortActive = (1 << 9), |
| 246 | SelPortActive = (1 << 8), | ||
| 246 | LinkFailStatus = (1 << 2), | 247 | LinkFailStatus = (1 << 2), |
| 247 | NetCxnErr = (1 << 1), | 248 | NetCxnErr = (1 << 1), |
| 248 | }; | 249 | }; |
| @@ -363,7 +364,9 @@ static u16 t21040_csr15[] = { 0, 0, 0x0006, 0x0000, 0x0000, }; | |||
| 363 | 364 | ||
| 364 | /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ | 365 | /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/ |
| 365 | static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; | 366 | static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }; |
| 366 | static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, }; | 367 | static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }; |
| 368 | /* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */ | ||
| 369 | static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }; | ||
| 367 | static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; | 370 | static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; |
| 368 | 371 | ||
| 369 | 372 | ||
| @@ -1064,6 +1067,9 @@ static void de21041_media_timer (unsigned long data) | |||
| 1064 | unsigned int carrier; | 1067 | unsigned int carrier; |
| 1065 | unsigned long flags; | 1068 | unsigned long flags; |
| 1066 | 1069 | ||
| 1070 | /* clear port active bits */ | ||
| 1071 | dw32(SIAStatus, NonselPortActive | SelPortActive); | ||
| 1072 | |||
| 1067 | carrier = (status & NetCxnErr) ? 0 : 1; | 1073 | carrier = (status & NetCxnErr) ? 0 : 1; |
| 1068 | 1074 | ||
| 1069 | if (carrier) { | 1075 | if (carrier) { |
| @@ -1158,14 +1164,29 @@ no_link_yet: | |||
| 1158 | static void de_media_interrupt (struct de_private *de, u32 status) | 1164 | static void de_media_interrupt (struct de_private *de, u32 status) |
| 1159 | { | 1165 | { |
| 1160 | if (status & LinkPass) { | 1166 | if (status & LinkPass) { |
| 1167 | /* Ignore if current media is AUI or BNC and we can't use TP */ | ||
| 1168 | if ((de->media_type == DE_MEDIA_AUI || | ||
| 1169 | de->media_type == DE_MEDIA_BNC) && | ||
| 1170 | (de->media_lock || | ||
| 1171 | !de_ok_to_advertise(de, DE_MEDIA_TP_AUTO))) | ||
| 1172 | return; | ||
| 1173 | /* If current media is not TP, change it to TP */ | ||
| 1174 | if ((de->media_type == DE_MEDIA_AUI || | ||
| 1175 | de->media_type == DE_MEDIA_BNC)) { | ||
| 1176 | de->media_type = DE_MEDIA_TP_AUTO; | ||
| 1177 | de_stop_rxtx(de); | ||
| 1178 | de_set_media(de); | ||
| 1179 | de_start_rxtx(de); | ||
| 1180 | } | ||
| 1161 | de_link_up(de); | 1181 | de_link_up(de); |
| 1162 | mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); | 1182 | mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); |
| 1163 | return; | 1183 | return; |
| 1164 | } | 1184 | } |
| 1165 | 1185 | ||
| 1166 | BUG_ON(!(status & LinkFail)); | 1186 | BUG_ON(!(status & LinkFail)); |
| 1167 | 1187 | /* Mark the link as down only if current media is TP */ | |
| 1168 | if (netif_carrier_ok(de->dev)) { | 1188 | if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI && |
| 1189 | de->media_type != DE_MEDIA_BNC) { | ||
| 1169 | de_link_down(de); | 1190 | de_link_down(de); |
| 1170 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); | 1191 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); |
| 1171 | } | 1192 | } |
| @@ -1229,6 +1250,7 @@ static void de_adapter_sleep (struct de_private *de) | |||
| 1229 | if (de->de21040) | 1250 | if (de->de21040) |
| 1230 | return; | 1251 | return; |
| 1231 | 1252 | ||
| 1253 | dw32(CSR13, 0); /* Reset phy */ | ||
| 1232 | pci_read_config_dword(de->pdev, PCIPM, &pmctl); | 1254 | pci_read_config_dword(de->pdev, PCIPM, &pmctl); |
| 1233 | pmctl |= PM_Sleep; | 1255 | pmctl |= PM_Sleep; |
| 1234 | pci_write_config_dword(de->pdev, PCIPM, pmctl); | 1256 | pci_write_config_dword(de->pdev, PCIPM, pmctl); |
| @@ -1574,12 +1596,15 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd) | |||
| 1574 | return 0; /* nothing to change */ | 1596 | return 0; /* nothing to change */ |
| 1575 | 1597 | ||
| 1576 | de_link_down(de); | 1598 | de_link_down(de); |
| 1599 | mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK); | ||
| 1577 | de_stop_rxtx(de); | 1600 | de_stop_rxtx(de); |
| 1578 | 1601 | ||
| 1579 | de->media_type = new_media; | 1602 | de->media_type = new_media; |
| 1580 | de->media_lock = media_lock; | 1603 | de->media_lock = media_lock; |
| 1581 | de->media_advertise = ecmd->advertising; | 1604 | de->media_advertise = ecmd->advertising; |
| 1582 | de_set_media(de); | 1605 | de_set_media(de); |
| 1606 | if (netif_running(de->dev)) | ||
| 1607 | de_start_rxtx(de); | ||
| 1583 | 1608 | ||
| 1584 | return 0; | 1609 | return 0; |
| 1585 | } | 1610 | } |
| @@ -1911,8 +1936,14 @@ fill_defaults: | |||
| 1911 | for (i = 0; i < DE_MAX_MEDIA; i++) { | 1936 | for (i = 0; i < DE_MAX_MEDIA; i++) { |
| 1912 | if (de->media[i].csr13 == 0xffff) | 1937 | if (de->media[i].csr13 == 0xffff) |
| 1913 | de->media[i].csr13 = t21041_csr13[i]; | 1938 | de->media[i].csr13 = t21041_csr13[i]; |
| 1914 | if (de->media[i].csr14 == 0xffff) | 1939 | if (de->media[i].csr14 == 0xffff) { |
| 1915 | de->media[i].csr14 = t21041_csr14[i]; | 1940 | /* autonegotiation is broken at least on some chip |
| 1941 | revisions - rev. 0x21 works, 0x11 does not */ | ||
| 1942 | if (de->pdev->revision < 0x20) | ||
| 1943 | de->media[i].csr14 = t21041_csr14_brk[i]; | ||
| 1944 | else | ||
| 1945 | de->media[i].csr14 = t21041_csr14[i]; | ||
| 1946 | } | ||
| 1916 | if (de->media[i].csr15 == 0xffff) | 1947 | if (de->media[i].csr15 == 0xffff) |
| 1917 | de->media[i].csr15 = t21041_csr15[i]; | 1948 | de->media[i].csr15 = t21041_csr15[i]; |
| 1918 | } | 1949 | } |
| @@ -2158,6 +2189,8 @@ static int de_resume (struct pci_dev *pdev) | |||
| 2158 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); | 2189 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); |
| 2159 | goto out; | 2190 | goto out; |
| 2160 | } | 2191 | } |
| 2192 | pci_set_master(pdev); | ||
| 2193 | de_init_rings(de); | ||
| 2161 | de_init_hw(de); | 2194 | de_init_hw(de); |
| 2162 | out_attach: | 2195 | out_attach: |
| 2163 | netif_device_attach(dev); | 2196 | netif_device_attach(dev); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 07dbc2796448..e23c4060a0f0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
| @@ -2613,6 +2613,11 @@ int iwl_force_reset(struct iwl_priv *priv, int mode, bool external) | |||
| 2613 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 2613 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
| 2614 | return -EINVAL; | 2614 | return -EINVAL; |
| 2615 | 2615 | ||
| 2616 | if (test_bit(STATUS_SCANNING, &priv->status)) { | ||
| 2617 | IWL_DEBUG_INFO(priv, "scan in progress.\n"); | ||
| 2618 | return -EINVAL; | ||
| 2619 | } | ||
| 2620 | |||
| 2616 | if (mode >= IWL_MAX_FORCE_RESET) { | 2621 | if (mode >= IWL_MAX_FORCE_RESET) { |
| 2617 | IWL_DEBUG_INFO(priv, "invalid reset request.\n"); | 2622 | IWL_DEBUG_INFO(priv, "invalid reset request.\n"); |
| 2618 | return -EINVAL; | 2623 | return -EINVAL; |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 5ac2aa783f58..4789f8e8bf7a 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
| @@ -3757,6 +3757,33 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) | |||
| 3757 | 3757 | ||
| 3758 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); | 3758 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); |
| 3759 | 3759 | ||
| 3760 | #define GGC 0x52 | ||
| 3761 | #define GGC_MEMORY_SIZE_MASK (0xf << 8) | ||
| 3762 | #define GGC_MEMORY_SIZE_NONE (0x0 << 8) | ||
| 3763 | #define GGC_MEMORY_SIZE_1M (0x1 << 8) | ||
| 3764 | #define GGC_MEMORY_SIZE_2M (0x3 << 8) | ||
| 3765 | #define GGC_MEMORY_VT_ENABLED (0x8 << 8) | ||
| 3766 | #define GGC_MEMORY_SIZE_2M_VT (0x9 << 8) | ||
| 3767 | #define GGC_MEMORY_SIZE_3M_VT (0xa << 8) | ||
| 3768 | #define GGC_MEMORY_SIZE_4M_VT (0xb << 8) | ||
| 3769 | |||
| 3770 | static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev) | ||
| 3771 | { | ||
| 3772 | unsigned short ggc; | ||
| 3773 | |||
| 3774 | if (pci_read_config_word(dev, GGC, &ggc)) | ||
| 3775 | return; | ||
| 3776 | |||
| 3777 | if (!(ggc & GGC_MEMORY_VT_ENABLED)) { | ||
| 3778 | printk(KERN_INFO "DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics\n"); | ||
| 3779 | dmar_map_gfx = 0; | ||
| 3780 | } | ||
| 3781 | } | ||
| 3782 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt); | ||
| 3783 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt); | ||
| 3784 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt); | ||
| 3785 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt); | ||
| 3786 | |||
| 3760 | /* On Tylersburg chipsets, some BIOSes have been known to enable the | 3787 | /* On Tylersburg chipsets, some BIOSes have been known to enable the |
| 3761 | ISOCH DMAR unit for the Azalia sound device, but not give it any | 3788 | ISOCH DMAR unit for the Azalia sound device, but not give it any |
| 3762 | TLB entries, which causes it to deadlock. Check for that. We do | 3789 | TLB entries, which causes it to deadlock. Check for that. We do |
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index ce6a3666b3d9..553d8ee55c1c 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
| @@ -608,7 +608,7 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno, | |||
| 608 | * the VF BAR size multiplied by the number of VFs. The alignment | 608 | * the VF BAR size multiplied by the number of VFs. The alignment |
| 609 | * is just the VF BAR size. | 609 | * is just the VF BAR size. |
| 610 | */ | 610 | */ |
| 611 | int pci_sriov_resource_alignment(struct pci_dev *dev, int resno) | 611 | resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno) |
| 612 | { | 612 | { |
| 613 | struct resource tmp; | 613 | struct resource tmp; |
| 614 | enum pci_bar_type type; | 614 | enum pci_bar_type type; |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 7754a678ab15..6beb11b617a9 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -264,7 +264,8 @@ extern int pci_iov_init(struct pci_dev *dev); | |||
| 264 | extern void pci_iov_release(struct pci_dev *dev); | 264 | extern void pci_iov_release(struct pci_dev *dev); |
| 265 | extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, | 265 | extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, |
| 266 | enum pci_bar_type *type); | 266 | enum pci_bar_type *type); |
| 267 | extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno); | 267 | extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, |
| 268 | int resno); | ||
| 268 | extern void pci_restore_iov_state(struct pci_dev *dev); | 269 | extern void pci_restore_iov_state(struct pci_dev *dev); |
| 269 | extern int pci_iov_bus_range(struct pci_bus *bus); | 270 | extern int pci_iov_bus_range(struct pci_bus *bus); |
| 270 | 271 | ||
| @@ -320,7 +321,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 320 | } | 321 | } |
| 321 | #endif /* CONFIG_PCI_IOV */ | 322 | #endif /* CONFIG_PCI_IOV */ |
| 322 | 323 | ||
| 323 | static inline int pci_resource_alignment(struct pci_dev *dev, | 324 | static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, |
| 324 | struct resource *res) | 325 | struct resource *res) |
| 325 | { | 326 | { |
| 326 | #ifdef CONFIG_PCI_IOV | 327 | #ifdef CONFIG_PCI_IOV |
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index a5c176598d95..9ba4dade69a4 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
| @@ -595,7 +595,13 @@ int pcmcia_request_io(struct pcmcia_device *p_dev) | |||
| 595 | if (c->io[1].end) { | 595 | if (c->io[1].end) { |
| 596 | ret = alloc_io_space(s, &c->io[1], p_dev->io_lines); | 596 | ret = alloc_io_space(s, &c->io[1], p_dev->io_lines); |
| 597 | if (ret) { | 597 | if (ret) { |
| 598 | struct resource tmp = c->io[0]; | ||
| 599 | /* release the previously allocated resource */ | ||
| 598 | release_io_space(s, &c->io[0]); | 600 | release_io_space(s, &c->io[0]); |
| 601 | /* but preserve the settings, for they worked... */ | ||
| 602 | c->io[0].end = resource_size(&tmp); | ||
| 603 | c->io[0].start = tmp.start; | ||
| 604 | c->io[0].flags = tmp.flags; | ||
| 599 | goto out; | 605 | goto out; |
| 600 | } | 606 | } |
| 601 | } else | 607 | } else |
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index b8a869af0f44..deef6656ab7b 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c | |||
| @@ -646,7 +646,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev, | |||
| 646 | if (!pci_resource_start(dev, 0)) { | 646 | if (!pci_resource_start(dev, 0)) { |
| 647 | dev_warn(&dev->dev, "refusing to load the driver as the " | 647 | dev_warn(&dev->dev, "refusing to load the driver as the " |
| 648 | "io_base is NULL.\n"); | 648 | "io_base is NULL.\n"); |
| 649 | goto err_out_free_mem; | 649 | goto err_out_disable; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx " | 652 | dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx " |
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 6edf20b62de5..2c7d2d9be4d0 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
| @@ -1154,7 +1154,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) | |||
| 1154 | dev_fsm, dev_fsm_len, GFP_KERNEL); | 1154 | dev_fsm, dev_fsm_len, GFP_KERNEL); |
| 1155 | if (priv->fsm == NULL) { | 1155 | if (priv->fsm == NULL) { |
| 1156 | CTCMY_DBF_DEV(SETUP, dev, "init_fsm error"); | 1156 | CTCMY_DBF_DEV(SETUP, dev, "init_fsm error"); |
| 1157 | kfree(dev); | 1157 | free_netdev(dev); |
| 1158 | return NULL; | 1158 | return NULL; |
| 1159 | } | 1159 | } |
| 1160 | fsm_newstate(priv->fsm, DEV_STATE_STOPPED); | 1160 | fsm_newstate(priv->fsm, DEV_STATE_STOPPED); |
| @@ -1165,7 +1165,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) | |||
| 1165 | grp = ctcmpc_init_mpc_group(priv); | 1165 | grp = ctcmpc_init_mpc_group(priv); |
| 1166 | if (grp == NULL) { | 1166 | if (grp == NULL) { |
| 1167 | MPC_DBF_DEV(SETUP, dev, "init_mpc_group error"); | 1167 | MPC_DBF_DEV(SETUP, dev, "init_mpc_group error"); |
| 1168 | kfree(dev); | 1168 | free_netdev(dev); |
| 1169 | return NULL; | 1169 | return NULL; |
| 1170 | } | 1170 | } |
| 1171 | tasklet_init(&grp->mpc_tasklet2, | 1171 | tasklet_init(&grp->mpc_tasklet2, |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 29e850a7a2f9..7c8008225ee3 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
| @@ -243,7 +243,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, | |||
| 243 | int r, nlogs = 0; | 243 | int r, nlogs = 0; |
| 244 | 244 | ||
| 245 | while (datalen > 0) { | 245 | while (datalen > 0) { |
| 246 | if (unlikely(headcount >= VHOST_NET_MAX_SG)) { | 246 | if (unlikely(seg >= VHOST_NET_MAX_SG)) { |
| 247 | r = -ENOBUFS; | 247 | r = -ENOBUFS; |
| 248 | goto err; | 248 | goto err; |
| 249 | } | 249 | } |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c579dcc9200c..dd3d6f7406f8 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
| @@ -858,11 +858,12 @@ int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, | |||
| 858 | if (r < 0) | 858 | if (r < 0) |
| 859 | return r; | 859 | return r; |
| 860 | len -= l; | 860 | len -= l; |
| 861 | if (!len) | 861 | if (!len) { |
| 862 | if (vq->log_ctx) | ||
| 863 | eventfd_signal(vq->log_ctx, 1); | ||
| 862 | return 0; | 864 | return 0; |
| 865 | } | ||
| 863 | } | 866 | } |
| 864 | if (vq->log_ctx) | ||
| 865 | eventfd_signal(vq->log_ctx, 1); | ||
| 866 | /* Length written exceeds what we have stored. This is a bug. */ | 867 | /* Length written exceeds what we have stored. This is a bug. */ |
| 867 | BUG(); | 868 | BUG(); |
| 868 | return 0; | 869 | return 0; |
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index 5d786bd3e304..a31a77ff6f3d 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c | |||
| @@ -298,8 +298,8 @@ static void set_dma_control0(struct pxa168fb_info *fbi) | |||
| 298 | * Set bit to enable graphics DMA. | 298 | * Set bit to enable graphics DMA. |
| 299 | */ | 299 | */ |
| 300 | x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0); | 300 | x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0); |
| 301 | x |= fbi->active ? 0x00000100 : 0; | 301 | x &= ~CFG_GRA_ENA_MASK; |
| 302 | fbi->active = 0; | 302 | x |= fbi->active ? CFG_GRA_ENA(1) : CFG_GRA_ENA(0); |
| 303 | 303 | ||
| 304 | /* | 304 | /* |
| 305 | * If we are in a pseudo-color mode, we need to enable | 305 | * If we are in a pseudo-color mode, we need to enable |
