diff options
Diffstat (limited to 'drivers')
102 files changed, 991 insertions, 591 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 9c4bd220c44f..86fd142f4bf3 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -1192,6 +1192,7 @@ static int asus_hotk_get_info(void) | |||
1192 | break; | 1192 | break; |
1193 | default: | 1193 | default: |
1194 | kfree(model); | 1194 | kfree(model); |
1195 | model = NULL; | ||
1195 | break; | 1196 | break; |
1196 | } | 1197 | } |
1197 | } | 1198 | } |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 81651032791b..d7b499fe0cd9 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -113,7 +113,7 @@ struct acpi_battery_info { | |||
113 | acpi_string oem_info; | 113 | acpi_string oem_info; |
114 | }; | 114 | }; |
115 | 115 | ||
116 | enum acpi_battery_files{ | 116 | enum acpi_battery_files { |
117 | ACPI_BATTERY_INFO = 0, | 117 | ACPI_BATTERY_INFO = 0, |
118 | ACPI_BATTERY_STATE, | 118 | ACPI_BATTERY_STATE, |
119 | ACPI_BATTERY_ALARM, | 119 | ACPI_BATTERY_ALARM, |
@@ -129,13 +129,14 @@ struct acpi_battery_flags { | |||
129 | }; | 129 | }; |
130 | 130 | ||
131 | struct acpi_battery { | 131 | struct acpi_battery { |
132 | struct mutex mutex; | ||
133 | struct acpi_device *device; | 132 | struct acpi_device *device; |
134 | struct acpi_battery_flags flags; | 133 | struct acpi_battery_flags flags; |
135 | struct acpi_buffer bif_data; | 134 | struct acpi_buffer bif_data; |
136 | struct acpi_buffer bst_data; | 135 | struct acpi_buffer bst_data; |
136 | struct mutex lock; | ||
137 | unsigned long alarm; | 137 | unsigned long alarm; |
138 | unsigned long update_time[ACPI_BATTERY_NUMFILES]; | 138 | unsigned long update_time[ACPI_BATTERY_NUMFILES]; |
139 | |||
139 | }; | 140 | }; |
140 | 141 | ||
141 | inline int acpi_battery_present(struct acpi_battery *battery) | 142 | inline int acpi_battery_present(struct acpi_battery *battery) |
@@ -235,10 +236,10 @@ static int acpi_battery_get_info(struct acpi_battery *battery) | |||
235 | return 0; | 236 | return 0; |
236 | 237 | ||
237 | /* Evaluate _BIF */ | 238 | /* Evaluate _BIF */ |
238 | 239 | mutex_lock(&battery->lock); | |
239 | status = | 240 | status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", |
240 | acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL, | 241 | NULL, &buffer); |
241 | &buffer); | 242 | mutex_unlock(&battery->lock); |
242 | if (ACPI_FAILURE(status)) { | 243 | if (ACPI_FAILURE(status)) { |
243 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); | 244 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); |
244 | return -ENODEV; | 245 | return -ENODEV; |
@@ -285,10 +286,10 @@ static int acpi_battery_get_state(struct acpi_battery *battery) | |||
285 | return 0; | 286 | return 0; |
286 | 287 | ||
287 | /* Evaluate _BST */ | 288 | /* Evaluate _BST */ |
288 | 289 | mutex_lock(&battery->lock); | |
289 | status = | 290 | status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST", |
290 | acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL, | 291 | NULL, &buffer); |
291 | &buffer); | 292 | mutex_unlock(&battery->lock); |
292 | if (ACPI_FAILURE(status)) { | 293 | if (ACPI_FAILURE(status)) { |
293 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); | 294 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); |
294 | return -ENODEV; | 295 | return -ENODEV; |
@@ -336,9 +337,10 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery, | |||
336 | 337 | ||
337 | arg0.integer.value = alarm; | 338 | arg0.integer.value = alarm; |
338 | 339 | ||
339 | status = | 340 | mutex_lock(&battery->lock); |
340 | acpi_evaluate_object(acpi_battery_handle(battery), "_BTP", | 341 | status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP", |
341 | &arg_list, NULL); | 342 | &arg_list, NULL); |
343 | mutex_unlock(&battery->lock); | ||
342 | if (ACPI_FAILURE(status)) | 344 | if (ACPI_FAILURE(status)) |
343 | return -ENODEV; | 345 | return -ENODEV; |
344 | 346 | ||
@@ -658,8 +660,6 @@ acpi_battery_write_alarm(struct file *file, | |||
658 | if (!battery || (count > sizeof(alarm_string) - 1)) | 660 | if (!battery || (count > sizeof(alarm_string) - 1)) |
659 | return -EINVAL; | 661 | return -EINVAL; |
660 | 662 | ||
661 | mutex_lock(&battery->mutex); | ||
662 | |||
663 | result = acpi_battery_update(battery, 1, &update_result); | 663 | result = acpi_battery_update(battery, 1, &update_result); |
664 | if (result) { | 664 | if (result) { |
665 | result = -ENODEV; | 665 | result = -ENODEV; |
@@ -688,9 +688,7 @@ acpi_battery_write_alarm(struct file *file, | |||
688 | acpi_battery_check_result(battery, result); | 688 | acpi_battery_check_result(battery, result); |
689 | 689 | ||
690 | if (!result) | 690 | if (!result) |
691 | result = count; | 691 | return count; |
692 | |||
693 | mutex_unlock(&battery->mutex); | ||
694 | 692 | ||
695 | return result; | 693 | return result; |
696 | } | 694 | } |
@@ -714,8 +712,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq) | |||
714 | int update_result = ACPI_BATTERY_NONE_UPDATE; | 712 | int update_result = ACPI_BATTERY_NONE_UPDATE; |
715 | int update = 0; | 713 | int update = 0; |
716 | 714 | ||
717 | mutex_lock(&battery->mutex); | ||
718 | |||
719 | update = (get_seconds() - battery->update_time[fid] >= update_time); | 715 | update = (get_seconds() - battery->update_time[fid] >= update_time); |
720 | update = (update | battery->flags.update[fid]); | 716 | update = (update | battery->flags.update[fid]); |
721 | 717 | ||
@@ -733,7 +729,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq) | |||
733 | result = acpi_read_funcs[fid].print(seq, result); | 729 | result = acpi_read_funcs[fid].print(seq, result); |
734 | acpi_battery_check_result(battery, result); | 730 | acpi_battery_check_result(battery, result); |
735 | battery->flags.update[fid] = result; | 731 | battery->flags.update[fid] = result; |
736 | mutex_unlock(&battery->mutex); | ||
737 | return result; | 732 | return result; |
738 | } | 733 | } |
739 | 734 | ||
@@ -897,10 +892,7 @@ static int acpi_battery_add(struct acpi_device *device) | |||
897 | if (!battery) | 892 | if (!battery) |
898 | return -ENOMEM; | 893 | return -ENOMEM; |
899 | 894 | ||
900 | mutex_init(&battery->mutex); | 895 | mutex_init(&battery->lock); |
901 | |||
902 | mutex_lock(&battery->mutex); | ||
903 | |||
904 | battery->device = device; | 896 | battery->device = device; |
905 | strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); | 897 | strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); |
906 | strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); | 898 | strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); |
@@ -936,7 +928,6 @@ static int acpi_battery_add(struct acpi_device *device) | |||
936 | kfree(battery); | 928 | kfree(battery); |
937 | } | 929 | } |
938 | 930 | ||
939 | mutex_unlock(&battery->mutex); | ||
940 | 931 | ||
941 | return result; | 932 | return result; |
942 | } | 933 | } |
@@ -951,8 +942,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type) | |||
951 | 942 | ||
952 | battery = acpi_driver_data(device); | 943 | battery = acpi_driver_data(device); |
953 | 944 | ||
954 | mutex_lock(&battery->mutex); | ||
955 | |||
956 | status = acpi_remove_notify_handler(device->handle, | 945 | status = acpi_remove_notify_handler(device->handle, |
957 | ACPI_ALL_NOTIFY, | 946 | ACPI_ALL_NOTIFY, |
958 | acpi_battery_notify); | 947 | acpi_battery_notify); |
@@ -963,9 +952,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type) | |||
963 | 952 | ||
964 | kfree(battery->bst_data.pointer); | 953 | kfree(battery->bst_data.pointer); |
965 | 954 | ||
966 | mutex_unlock(&battery->mutex); | 955 | mutex_destroy(&battery->lock); |
967 | |||
968 | mutex_destroy(&battery->mutex); | ||
969 | 956 | ||
970 | kfree(battery); | 957 | kfree(battery); |
971 | 958 | ||
diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index 56a5b3fffeb3..6daf6088ac88 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c | |||
@@ -337,7 +337,7 @@ static void bay_notify(acpi_handle handle, u32 event, void *data) | |||
337 | char *envp[] = { event_string, NULL }; | 337 | char *envp[] = { event_string, NULL }; |
338 | 338 | ||
339 | bay_dprintk(handle, "Bay event"); | 339 | bay_dprintk(handle, "Bay event"); |
340 | sprintf(event_string, "BAY_EVENT=%d\n", event); | 340 | sprintf(event_string, "BAY_EVENT=%d", event); |
341 | kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); | 341 | kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); |
342 | } | 342 | } |
343 | 343 | ||
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 6192c8be66df..1dabdf4c07b3 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -336,13 +336,13 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event) | |||
336 | static void dock_event(struct dock_station *ds, u32 event, int num) | 336 | static void dock_event(struct dock_station *ds, u32 event, int num) |
337 | { | 337 | { |
338 | struct device *dev = &dock_device->dev; | 338 | struct device *dev = &dock_device->dev; |
339 | char event_string[7]; | 339 | char event_string[13]; |
340 | char *envp[] = { event_string, NULL }; | 340 | char *envp[] = { event_string, NULL }; |
341 | 341 | ||
342 | if (num == UNDOCK_EVENT) | 342 | if (num == UNDOCK_EVENT) |
343 | sprintf(event_string, "UNDOCK"); | 343 | sprintf(event_string, "EVENT=undock"); |
344 | else | 344 | else |
345 | sprintf(event_string, "DOCK"); | 345 | sprintf(event_string, "EVENT=dock"); |
346 | 346 | ||
347 | /* | 347 | /* |
348 | * Indicate that the status of the dock station has | 348 | * Indicate that the status of the dock station has |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 469f3f57f881..56bee9e065cf 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -471,7 +471,6 @@ static void acpi_ec_gpe_query(void *ec_cxt) | |||
471 | } | 471 | } |
472 | } | 472 | } |
473 | mutex_unlock(&ec->lock); | 473 | mutex_unlock(&ec->lock); |
474 | printk(KERN_ERR PREFIX "Handler for query 0x%x is not found!\n", value); | ||
475 | } | 474 | } |
476 | 475 | ||
477 | static u32 acpi_ec_gpe_handler(void *data) | 476 | static u32 acpi_ec_gpe_handler(void *data) |
@@ -665,30 +664,44 @@ acpi_ec_register_query_methods(acpi_handle handle, u32 level, | |||
665 | return AE_OK; | 664 | return AE_OK; |
666 | } | 665 | } |
667 | 666 | ||
668 | static int ec_parse_device(struct acpi_ec *ec, acpi_handle handle) | 667 | static acpi_status |
668 | ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) | ||
669 | { | 669 | { |
670 | if (ACPI_FAILURE(acpi_walk_resources(handle, METHOD_NAME__CRS, | 670 | acpi_status status; |
671 | ec_parse_io_ports, ec))) | 671 | |
672 | return -EINVAL; | 672 | struct acpi_ec *ec = context; |
673 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, | ||
674 | ec_parse_io_ports, ec); | ||
675 | if (ACPI_FAILURE(status)) | ||
676 | return status; | ||
673 | 677 | ||
674 | /* Get GPE bit assignment (EC events). */ | 678 | /* Get GPE bit assignment (EC events). */ |
675 | /* TODO: Add support for _GPE returning a package */ | 679 | /* TODO: Add support for _GPE returning a package */ |
676 | if (ACPI_FAILURE(acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe))) | 680 | status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe); |
677 | return -EINVAL; | 681 | if (ACPI_FAILURE(status)) |
678 | 682 | return status; | |
679 | /* Use the global lock for all EC transactions? */ | ||
680 | acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock); | ||
681 | 683 | ||
682 | /* Find and register all query methods */ | 684 | /* Find and register all query methods */ |
683 | acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1, | 685 | acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1, |
684 | acpi_ec_register_query_methods, ec, NULL); | 686 | acpi_ec_register_query_methods, ec, NULL); |
685 | 687 | ||
688 | /* Use the global lock for all EC transactions? */ | ||
689 | acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock); | ||
690 | |||
686 | ec->handle = handle; | 691 | ec->handle = handle; |
687 | 692 | ||
688 | printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx", | 693 | printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n", |
689 | ec->gpe, ec->command_addr, ec->data_addr); | 694 | ec->gpe, ec->command_addr, ec->data_addr); |
690 | 695 | ||
691 | return 0; | 696 | return AE_CTRL_TERMINATE; |
697 | } | ||
698 | |||
699 | static void ec_remove_handlers(struct acpi_ec *ec) | ||
700 | { | ||
701 | acpi_remove_address_space_handler(ec->handle, | ||
702 | ACPI_ADR_SPACE_EC, | ||
703 | &acpi_ec_space_handler); | ||
704 | acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler); | ||
692 | } | 705 | } |
693 | 706 | ||
694 | static int acpi_ec_add(struct acpi_device *device) | 707 | static int acpi_ec_add(struct acpi_device *device) |
@@ -705,7 +718,8 @@ static int acpi_ec_add(struct acpi_device *device) | |||
705 | if (!ec) | 718 | if (!ec) |
706 | return -ENOMEM; | 719 | return -ENOMEM; |
707 | 720 | ||
708 | if (ec_parse_device(ec, device->handle)) { | 721 | if (ec_parse_device(device->handle, 0, ec, NULL) != |
722 | AE_CTRL_TERMINATE) { | ||
709 | kfree(ec); | 723 | kfree(ec); |
710 | return -EINVAL; | 724 | return -EINVAL; |
711 | } | 725 | } |
@@ -713,16 +727,13 @@ static int acpi_ec_add(struct acpi_device *device) | |||
713 | /* Check if we found the boot EC */ | 727 | /* Check if we found the boot EC */ |
714 | if (boot_ec) { | 728 | if (boot_ec) { |
715 | if (boot_ec->gpe == ec->gpe) { | 729 | if (boot_ec->gpe == ec->gpe) { |
716 | /* We might have incorrect info for GL at boot time */ | 730 | ec_remove_handlers(boot_ec); |
717 | mutex_lock(&boot_ec->lock); | 731 | mutex_destroy(&boot_ec->lock); |
718 | boot_ec->global_lock = ec->global_lock; | 732 | kfree(boot_ec); |
719 | /* Copy handlers from new ec into boot ec */ | 733 | first_ec = boot_ec = NULL; |
720 | list_splice(&ec->list, &boot_ec->list); | ||
721 | mutex_unlock(&boot_ec->lock); | ||
722 | kfree(ec); | ||
723 | ec = boot_ec; | ||
724 | } | 734 | } |
725 | } else | 735 | } |
736 | if (!first_ec) | ||
726 | first_ec = ec; | 737 | first_ec = ec; |
727 | ec->handle = device->handle; | 738 | ec->handle = device->handle; |
728 | acpi_driver_data(device) = ec; | 739 | acpi_driver_data(device) = ec; |
@@ -734,14 +745,14 @@ static int acpi_ec_add(struct acpi_device *device) | |||
734 | static int acpi_ec_remove(struct acpi_device *device, int type) | 745 | static int acpi_ec_remove(struct acpi_device *device, int type) |
735 | { | 746 | { |
736 | struct acpi_ec *ec; | 747 | struct acpi_ec *ec; |
737 | struct acpi_ec_query_handler *handler; | 748 | struct acpi_ec_query_handler *handler, *tmp; |
738 | 749 | ||
739 | if (!device) | 750 | if (!device) |
740 | return -EINVAL; | 751 | return -EINVAL; |
741 | 752 | ||
742 | ec = acpi_driver_data(device); | 753 | ec = acpi_driver_data(device); |
743 | mutex_lock(&ec->lock); | 754 | mutex_lock(&ec->lock); |
744 | list_for_each_entry(handler, &ec->list, node) { | 755 | list_for_each_entry_safe(handler, tmp, &ec->list, node) { |
745 | list_del(&handler->node); | 756 | list_del(&handler->node); |
746 | kfree(handler); | 757 | kfree(handler); |
747 | } | 758 | } |
@@ -751,9 +762,6 @@ static int acpi_ec_remove(struct acpi_device *device, int type) | |||
751 | if (ec == first_ec) | 762 | if (ec == first_ec) |
752 | first_ec = NULL; | 763 | first_ec = NULL; |
753 | 764 | ||
754 | /* Don't touch boot EC */ | ||
755 | if (boot_ec != ec) | ||
756 | kfree(ec); | ||
757 | return 0; | 765 | return 0; |
758 | } | 766 | } |
759 | 767 | ||
@@ -817,9 +825,7 @@ static int acpi_ec_start(struct acpi_device *device) | |||
817 | if (!ec) | 825 | if (!ec) |
818 | return -EINVAL; | 826 | return -EINVAL; |
819 | 827 | ||
820 | /* Boot EC is already working */ | 828 | ret = ec_install_handlers(ec); |
821 | if (ec != boot_ec) | ||
822 | ret = ec_install_handlers(ec); | ||
823 | 829 | ||
824 | /* EC is fully operational, allow queries */ | 830 | /* EC is fully operational, allow queries */ |
825 | atomic_set(&ec->query_pending, 0); | 831 | atomic_set(&ec->query_pending, 0); |
@@ -829,7 +835,6 @@ static int acpi_ec_start(struct acpi_device *device) | |||
829 | 835 | ||
830 | static int acpi_ec_stop(struct acpi_device *device, int type) | 836 | static int acpi_ec_stop(struct acpi_device *device, int type) |
831 | { | 837 | { |
832 | acpi_status status; | ||
833 | struct acpi_ec *ec; | 838 | struct acpi_ec *ec; |
834 | 839 | ||
835 | if (!device) | 840 | if (!device) |
@@ -838,21 +843,7 @@ static int acpi_ec_stop(struct acpi_device *device, int type) | |||
838 | ec = acpi_driver_data(device); | 843 | ec = acpi_driver_data(device); |
839 | if (!ec) | 844 | if (!ec) |
840 | return -EINVAL; | 845 | return -EINVAL; |
841 | 846 | ec_remove_handlers(ec); | |
842 | /* Don't touch boot EC */ | ||
843 | if (ec == boot_ec) | ||
844 | return 0; | ||
845 | |||
846 | status = acpi_remove_address_space_handler(ec->handle, | ||
847 | ACPI_ADR_SPACE_EC, | ||
848 | &acpi_ec_space_handler); | ||
849 | if (ACPI_FAILURE(status)) | ||
850 | return -ENODEV; | ||
851 | |||
852 | status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler); | ||
853 | if (ACPI_FAILURE(status)) | ||
854 | return -ENODEV; | ||
855 | |||
856 | return 0; | 847 | return 0; |
857 | } | 848 | } |
858 | 849 | ||
@@ -868,18 +859,21 @@ int __init acpi_ec_ecdt_probe(void) | |||
868 | /* | 859 | /* |
869 | * Generate a boot ec context | 860 | * Generate a boot ec context |
870 | */ | 861 | */ |
871 | |||
872 | status = acpi_get_table(ACPI_SIG_ECDT, 1, | 862 | status = acpi_get_table(ACPI_SIG_ECDT, 1, |
873 | (struct acpi_table_header **)&ecdt_ptr); | 863 | (struct acpi_table_header **)&ecdt_ptr); |
874 | if (ACPI_FAILURE(status)) | 864 | if (ACPI_SUCCESS(status)) { |
875 | goto error; | 865 | printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n\n"); |
876 | 866 | boot_ec->command_addr = ecdt_ptr->control.address; | |
877 | printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n"); | 867 | boot_ec->data_addr = ecdt_ptr->data.address; |
878 | 868 | boot_ec->gpe = ecdt_ptr->gpe; | |
879 | boot_ec->command_addr = ecdt_ptr->control.address; | 869 | boot_ec->handle = ACPI_ROOT_OBJECT; |
880 | boot_ec->data_addr = ecdt_ptr->data.address; | 870 | } else { |
881 | boot_ec->gpe = ecdt_ptr->gpe; | 871 | printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n"); |
882 | boot_ec->handle = ACPI_ROOT_OBJECT; | 872 | status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device, |
873 | boot_ec, NULL); | ||
874 | if (ACPI_FAILURE(status)) | ||
875 | goto error; | ||
876 | } | ||
883 | 877 | ||
884 | ret = ec_install_handlers(boot_ec); | 878 | ret = ec_install_handlers(boot_ec); |
885 | if (!ret) { | 879 | if (!ret) { |
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index dfa5853b17f0..95637a4ff782 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c | |||
@@ -108,7 +108,7 @@ static const struct file_operations acpi_system_event_ops = { | |||
108 | }; | 108 | }; |
109 | 109 | ||
110 | #ifdef CONFIG_NET | 110 | #ifdef CONFIG_NET |
111 | unsigned int acpi_event_seqnum; | 111 | static unsigned int acpi_event_seqnum; |
112 | struct acpi_genl_event { | 112 | struct acpi_genl_event { |
113 | acpi_device_class device_class; | 113 | acpi_device_class device_class; |
114 | char bus_id[15]; | 114 | char bus_id[15]; |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index a898991f77cb..a8634a0655fc 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -969,11 +969,17 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, | |||
969 | } | 969 | } |
970 | 970 | ||
971 | if (pr->flags.bm_check) { | 971 | if (pr->flags.bm_check) { |
972 | /* bus mastering control is necessary */ | ||
973 | if (!pr->flags.bm_control) { | 972 | if (!pr->flags.bm_control) { |
974 | /* In this case we enter C3 without bus mastering */ | 973 | if (pr->flags.has_cst != 1) { |
975 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 974 | /* bus mastering control is necessary */ |
976 | "C3 support without bus mastering control\n")); | 975 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
976 | "C3 support requires BM control\n")); | ||
977 | return; | ||
978 | } else { | ||
979 | /* Here we enter C3 without bus mastering */ | ||
980 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
981 | "C3 support without BM control\n")); | ||
982 | } | ||
977 | } | 983 | } |
978 | } else { | 984 | } else { |
979 | /* | 985 | /* |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index c4efc0c17f8f..463b0247cbc5 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -539,7 +539,7 @@ end: | |||
539 | } | 539 | } |
540 | 540 | ||
541 | int acpi_processor_preregister_performance( | 541 | int acpi_processor_preregister_performance( |
542 | struct acpi_processor_performance **performance) | 542 | struct acpi_processor_performance *performance) |
543 | { | 543 | { |
544 | int count, count_target; | 544 | int count, count_target; |
545 | int retval = 0; | 545 | int retval = 0; |
@@ -567,12 +567,12 @@ int acpi_processor_preregister_performance( | |||
567 | continue; | 567 | continue; |
568 | } | 568 | } |
569 | 569 | ||
570 | if (!performance || !performance[i]) { | 570 | if (!performance || !percpu_ptr(performance, i)) { |
571 | retval = -EINVAL; | 571 | retval = -EINVAL; |
572 | continue; | 572 | continue; |
573 | } | 573 | } |
574 | 574 | ||
575 | pr->performance = performance[i]; | 575 | pr->performance = percpu_ptr(performance, i); |
576 | cpu_set(i, pr->performance->shared_cpu_map); | 576 | cpu_set(i, pr->performance->shared_cpu_map); |
577 | if (acpi_processor_get_psd(pr)) { | 577 | if (acpi_processor_get_psd(pr)) { |
578 | retval = -EINVAL; | 578 | retval = -EINVAL; |
diff --git a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c index f63813a358c5..4c3fd4cdaf73 100644 --- a/drivers/acpi/resources/rsxface.c +++ b/drivers/acpi/resources/rsxface.c | |||
@@ -474,8 +474,6 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context) | |||
474 | return (AE_CTRL_TERMINATE); | 474 | return (AE_CTRL_TERMINATE); |
475 | } | 475 | } |
476 | 476 | ||
477 | ACPI_EXPORT_SYMBOL(acpi_rs_match_vendor_resource) | ||
478 | |||
479 | /******************************************************************************* | 477 | /******************************************************************************* |
480 | * | 478 | * |
481 | * FUNCTION: acpi_walk_resources | 479 | * FUNCTION: acpi_walk_resources |
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 7d8e78ea13a5..82c3a550016d 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -1415,7 +1415,7 @@ static int acpi_sbs_update_run(struct acpi_sbs *sbs, int id, int data_type) | |||
1415 | char dir_name[32]; | 1415 | char dir_name[32]; |
1416 | int do_battery_init = 0, do_ac_init = 0; | 1416 | int do_battery_init = 0, do_ac_init = 0; |
1417 | int old_remaining_capacity = 0; | 1417 | int old_remaining_capacity = 0; |
1418 | int update_ac = 1, update_battery = 1; | 1418 | int update_battery = 1; |
1419 | int up_tm = update_time; | 1419 | int up_tm = update_time; |
1420 | 1420 | ||
1421 | if (sbs_zombie(sbs)) { | 1421 | if (sbs_zombie(sbs)) { |
@@ -1435,10 +1435,6 @@ static int acpi_sbs_update_run(struct acpi_sbs *sbs, int id, int data_type) | |||
1435 | 1435 | ||
1436 | sbs->run_cnt++; | 1436 | sbs->run_cnt++; |
1437 | 1437 | ||
1438 | if (!update_ac && !update_battery) { | ||
1439 | goto end; | ||
1440 | } | ||
1441 | |||
1442 | old_ac_present = sbs->ac.ac_present; | 1438 | old_ac_present = sbs->ac.ac_present; |
1443 | 1439 | ||
1444 | result = acpi_ac_get_present(sbs); | 1440 | result = acpi_ac_get_present(sbs); |
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c index 5b302c4e293f..a9e3331fee5d 100644 --- a/drivers/acpi/tables/tbxface.c +++ b/drivers/acpi/tables/tbxface.c | |||
@@ -52,6 +52,8 @@ ACPI_MODULE_NAME("tbxface") | |||
52 | /* Local prototypes */ | 52 | /* Local prototypes */ |
53 | static acpi_status acpi_tb_load_namespace(void); | 53 | static acpi_status acpi_tb_load_namespace(void); |
54 | 54 | ||
55 | static int no_auto_ssdt; | ||
56 | |||
55 | /******************************************************************************* | 57 | /******************************************************************************* |
56 | * | 58 | * |
57 | * FUNCTION: acpi_allocate_root_table | 59 | * FUNCTION: acpi_allocate_root_table |
@@ -536,6 +538,10 @@ static acpi_status acpi_tb_load_namespace(void) | |||
536 | 538 | ||
537 | ACPI_INFO((AE_INFO, "Table DSDT replaced by host OS")); | 539 | ACPI_INFO((AE_INFO, "Table DSDT replaced by host OS")); |
538 | acpi_tb_print_table_header(0, table); | 540 | acpi_tb_print_table_header(0, table); |
541 | |||
542 | if (no_auto_ssdt == 0) { | ||
543 | printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\""); | ||
544 | } | ||
539 | } | 545 | } |
540 | 546 | ||
541 | status = | 547 | status = |
@@ -577,6 +583,11 @@ static acpi_status acpi_tb_load_namespace(void) | |||
577 | continue; | 583 | continue; |
578 | } | 584 | } |
579 | 585 | ||
586 | if (no_auto_ssdt) { | ||
587 | printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); | ||
588 | continue; | ||
589 | } | ||
590 | |||
580 | /* Ignore errors while loading tables, get as many as possible */ | 591 | /* Ignore errors while loading tables, get as many as possible */ |
581 | 592 | ||
582 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 593 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
@@ -622,3 +633,15 @@ acpi_status acpi_load_tables(void) | |||
622 | } | 633 | } |
623 | 634 | ||
624 | ACPI_EXPORT_SYMBOL(acpi_load_tables) | 635 | ACPI_EXPORT_SYMBOL(acpi_load_tables) |
636 | |||
637 | |||
638 | static int __init acpi_no_auto_ssdt_setup(char *s) { | ||
639 | |||
640 | printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); | ||
641 | |||
642 | no_auto_ssdt = 1; | ||
643 | |||
644 | return 1; | ||
645 | } | ||
646 | |||
647 | __setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); | ||
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 5a62de1b7f2a..1e06159fd9c4 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/dmi.h> | ||
36 | #include <linux/init.h> | 37 | #include <linux/init.h> |
37 | #include <linux/types.h> | 38 | #include <linux/types.h> |
38 | #include <linux/proc_fs.h> | 39 | #include <linux/proc_fs.h> |
@@ -74,10 +75,26 @@ MODULE_AUTHOR("Paul Diefenbaugh"); | |||
74 | MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); | 75 | MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); |
75 | MODULE_LICENSE("GPL"); | 76 | MODULE_LICENSE("GPL"); |
76 | 77 | ||
78 | static int act; | ||
79 | module_param(act, int, 0644); | ||
80 | MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n"); | ||
81 | |||
77 | static int tzp; | 82 | static int tzp; |
78 | module_param(tzp, int, 0); | 83 | module_param(tzp, int, 0444); |
79 | MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); | 84 | MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); |
80 | 85 | ||
86 | static int nocrt; | ||
87 | module_param(nocrt, int, 0); | ||
88 | MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n"); | ||
89 | |||
90 | static int off; | ||
91 | module_param(off, int, 0); | ||
92 | MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n"); | ||
93 | |||
94 | static int psv; | ||
95 | module_param(psv, int, 0644); | ||
96 | MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n"); | ||
97 | |||
81 | static int acpi_thermal_add(struct acpi_device *device); | 98 | static int acpi_thermal_add(struct acpi_device *device); |
82 | static int acpi_thermal_remove(struct acpi_device *device, int type); | 99 | static int acpi_thermal_remove(struct acpi_device *device, int type); |
83 | static int acpi_thermal_resume(struct acpi_device *device); | 100 | static int acpi_thermal_resume(struct acpi_device *device); |
@@ -339,9 +356,16 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
339 | 356 | ||
340 | /* Passive: Processors (optional) */ | 357 | /* Passive: Processors (optional) */ |
341 | 358 | ||
342 | status = | 359 | if (psv == -1) { |
343 | acpi_evaluate_integer(tz->device->handle, "_PSV", NULL, | 360 | status = AE_SUPPORT; |
344 | &tz->trips.passive.temperature); | 361 | } else if (psv > 0) { |
362 | tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv); | ||
363 | status = AE_OK; | ||
364 | } else { | ||
365 | status = acpi_evaluate_integer(tz->device->handle, | ||
366 | "_PSV", NULL, &tz->trips.passive.temperature); | ||
367 | } | ||
368 | |||
345 | if (ACPI_FAILURE(status)) { | 369 | if (ACPI_FAILURE(status)) { |
346 | tz->trips.passive.flags.valid = 0; | 370 | tz->trips.passive.flags.valid = 0; |
347 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No passive threshold\n")); | 371 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No passive threshold\n")); |
@@ -386,11 +410,33 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) | |||
386 | 410 | ||
387 | char name[5] = { '_', 'A', 'C', ('0' + i), '\0' }; | 411 | char name[5] = { '_', 'A', 'C', ('0' + i), '\0' }; |
388 | 412 | ||
389 | status = | 413 | if (act == -1) |
390 | acpi_evaluate_integer(tz->device->handle, name, NULL, | 414 | break; /* disable all active trip points */ |
391 | &tz->trips.active[i].temperature); | 415 | |
392 | if (ACPI_FAILURE(status)) | 416 | status = acpi_evaluate_integer(tz->device->handle, |
417 | name, NULL, &tz->trips.active[i].temperature); | ||
418 | |||
419 | if (ACPI_FAILURE(status)) { | ||
420 | if (i == 0) /* no active trip points */ | ||
421 | break; | ||
422 | if (act <= 0) /* no override requested */ | ||
423 | break; | ||
424 | if (i == 1) { /* 1 trip point */ | ||
425 | tz->trips.active[0].temperature = | ||
426 | CELSIUS_TO_KELVIN(act); | ||
427 | } else { /* multiple trips */ | ||
428 | /* | ||
429 | * Don't allow override higher than | ||
430 | * the next higher trip point | ||
431 | */ | ||
432 | tz->trips.active[i - 1].temperature = | ||
433 | (tz->trips.active[i - 2].temperature < | ||
434 | CELSIUS_TO_KELVIN(act) ? | ||
435 | tz->trips.active[i - 2].temperature : | ||
436 | CELSIUS_TO_KELVIN(act)); | ||
437 | } | ||
393 | break; | 438 | break; |
439 | } | ||
394 | 440 | ||
395 | name[2] = 'L'; | 441 | name[2] = 'L'; |
396 | status = | 442 | status = |
@@ -427,7 +473,7 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz) | |||
427 | 473 | ||
428 | static int acpi_thermal_critical(struct acpi_thermal *tz) | 474 | static int acpi_thermal_critical(struct acpi_thermal *tz) |
429 | { | 475 | { |
430 | if (!tz || !tz->trips.critical.flags.valid) | 476 | if (!tz || !tz->trips.critical.flags.valid || nocrt) |
431 | return -EINVAL; | 477 | return -EINVAL; |
432 | 478 | ||
433 | if (tz->temperature >= tz->trips.critical.temperature) { | 479 | if (tz->temperature >= tz->trips.critical.temperature) { |
@@ -449,7 +495,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz) | |||
449 | 495 | ||
450 | static int acpi_thermal_hot(struct acpi_thermal *tz) | 496 | static int acpi_thermal_hot(struct acpi_thermal *tz) |
451 | { | 497 | { |
452 | if (!tz || !tz->trips.hot.flags.valid) | 498 | if (!tz || !tz->trips.hot.flags.valid || nocrt) |
453 | return -EINVAL; | 499 | return -EINVAL; |
454 | 500 | ||
455 | if (tz->temperature >= tz->trips.hot.temperature) { | 501 | if (tz->temperature >= tz->trips.hot.temperature) { |
@@ -824,12 +870,14 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) | |||
824 | goto end; | 870 | goto end; |
825 | 871 | ||
826 | if (tz->trips.critical.flags.valid) | 872 | if (tz->trips.critical.flags.valid) |
827 | seq_printf(seq, "critical (S5): %ld C\n", | 873 | seq_printf(seq, "critical (S5): %ld C%s", |
828 | KELVIN_TO_CELSIUS(tz->trips.critical.temperature)); | 874 | KELVIN_TO_CELSIUS(tz->trips.critical.temperature), |
875 | nocrt ? " <disabled>\n" : "\n"); | ||
829 | 876 | ||
830 | if (tz->trips.hot.flags.valid) | 877 | if (tz->trips.hot.flags.valid) |
831 | seq_printf(seq, "hot (S4): %ld C\n", | 878 | seq_printf(seq, "hot (S4): %ld C%s", |
832 | KELVIN_TO_CELSIUS(tz->trips.hot.temperature)); | 879 | KELVIN_TO_CELSIUS(tz->trips.hot.temperature), |
880 | nocrt ? " <disabled>\n" : "\n"); | ||
833 | 881 | ||
834 | if (tz->trips.passive.flags.valid) { | 882 | if (tz->trips.passive.flags.valid) { |
835 | seq_printf(seq, | 883 | seq_printf(seq, |
@@ -1281,11 +1329,78 @@ static int acpi_thermal_resume(struct acpi_device *device) | |||
1281 | return AE_OK; | 1329 | return AE_OK; |
1282 | } | 1330 | } |
1283 | 1331 | ||
1332 | #ifdef CONFIG_DMI | ||
1333 | static int thermal_act(struct dmi_system_id *d) { | ||
1334 | |||
1335 | if (act == 0) { | ||
1336 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1337 | "disabling all active thermal trip points\n", d->ident); | ||
1338 | act = -1; | ||
1339 | } | ||
1340 | return 0; | ||
1341 | } | ||
1342 | static int thermal_tzp(struct dmi_system_id *d) { | ||
1343 | |||
1344 | if (tzp == 0) { | ||
1345 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1346 | "enabling thermal zone polling\n", d->ident); | ||
1347 | tzp = 300; /* 300 dS = 30 Seconds */ | ||
1348 | } | ||
1349 | return 0; | ||
1350 | } | ||
1351 | static int thermal_psv(struct dmi_system_id *d) { | ||
1352 | |||
1353 | if (psv == 0) { | ||
1354 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1355 | "disabling all passive thermal trip points\n", d->ident); | ||
1356 | psv = -1; | ||
1357 | } | ||
1358 | return 0; | ||
1359 | } | ||
1360 | |||
1361 | static struct dmi_system_id thermal_dmi_table[] __initdata = { | ||
1362 | /* | ||
1363 | * Award BIOS on this AOpen makes thermal control almost worthless. | ||
1364 | * http://bugzilla.kernel.org/show_bug.cgi?id=8842 | ||
1365 | */ | ||
1366 | { | ||
1367 | .callback = thermal_act, | ||
1368 | .ident = "AOpen i915GMm-HFS", | ||
1369 | .matches = { | ||
1370 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
1371 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
1372 | }, | ||
1373 | }, | ||
1374 | { | ||
1375 | .callback = thermal_psv, | ||
1376 | .ident = "AOpen i915GMm-HFS", | ||
1377 | .matches = { | ||
1378 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
1379 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
1380 | }, | ||
1381 | }, | ||
1382 | { | ||
1383 | .callback = thermal_tzp, | ||
1384 | .ident = "AOpen i915GMm-HFS", | ||
1385 | .matches = { | ||
1386 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
1387 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
1388 | }, | ||
1389 | }, | ||
1390 | {} | ||
1391 | }; | ||
1392 | #endif /* CONFIG_DMI */ | ||
1393 | |||
1284 | static int __init acpi_thermal_init(void) | 1394 | static int __init acpi_thermal_init(void) |
1285 | { | 1395 | { |
1286 | int result = 0; | 1396 | int result = 0; |
1287 | 1397 | ||
1398 | dmi_check_system(thermal_dmi_table); | ||
1288 | 1399 | ||
1400 | if (off) { | ||
1401 | printk(KERN_NOTICE "ACPI: thermal control disabled\n"); | ||
1402 | return -ENODEV; | ||
1403 | } | ||
1289 | acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); | 1404 | acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); |
1290 | if (!acpi_thermal_dir) | 1405 | if (!acpi_thermal_dir) |
1291 | return -ENODEV; | 1406 | return -ENODEV; |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index a78832ea81fa..071d274afaab 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = { | |||
436 | /* PM PS SM SS MAP */ | 436 | /* PM PS SM SS MAP */ |
437 | { P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ | 437 | { P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ |
438 | { RV, RV, RV, RV }, | 438 | { RV, RV, RV, RV }, |
439 | { IDE, IDE, NA, NA }, /* 10b (IDE mode) */ | 439 | { P0, P2, IDE, IDE }, /* 10b (IDE mode) */ |
440 | { RV, RV, RV, RV }, | 440 | { RV, RV, RV, RV }, |
441 | }, | 441 | }, |
442 | }; | 442 | }; |
@@ -901,6 +901,13 @@ static int piix_broken_suspend(void) | |||
901 | }, | 901 | }, |
902 | }, | 902 | }, |
903 | { | 903 | { |
904 | .ident = "TECRA M7", | ||
905 | .matches = { | ||
906 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
907 | DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"), | ||
908 | }, | ||
909 | }, | ||
910 | { | ||
904 | .ident = "Satellite U205", | 911 | .ident = "Satellite U205", |
905 | .matches = { | 912 | .matches = { |
906 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 913 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 60e78bef469f..99d4fbffb0df 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1723,7 +1723,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, | |||
1723 | tf.protocol = ATA_PROT_NODATA; | 1723 | tf.protocol = ATA_PROT_NODATA; |
1724 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; | 1724 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; |
1725 | err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0); | 1725 | err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0); |
1726 | if (err_mask) { | 1726 | if (err_mask && id[2] != 0x738c) { |
1727 | rc = -EIO; | 1727 | rc = -EIO; |
1728 | reason = "SPINUP failed"; | 1728 | reason = "SPINUP failed"; |
1729 | goto err_out; | 1729 | goto err_out; |
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index ce589d96ca42..b5352ebecef9 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * pata_artop.c - ARTOP ATA controller driver | 2 | * pata_artop.c - ARTOP ATA controller driver |
3 | * | 3 | * |
4 | * (C) 2006 Red Hat <alan@redhat.com> | 4 | * (C) 2006 Red Hat <alan@redhat.com> |
5 | * (C) 2007 Bartlomiej Zolnierkiewicz | ||
5 | * | 6 | * |
6 | * Based in part on drivers/ide/pci/aec62xx.c | 7 | * Based in part on drivers/ide/pci/aec62xx.c |
7 | * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> | 8 | * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> |
@@ -28,7 +29,7 @@ | |||
28 | #include <linux/ata.h> | 29 | #include <linux/ata.h> |
29 | 30 | ||
30 | #define DRV_NAME "pata_artop" | 31 | #define DRV_NAME "pata_artop" |
31 | #define DRV_VERSION "0.4.3" | 32 | #define DRV_VERSION "0.4.4" |
32 | 33 | ||
33 | /* | 34 | /* |
34 | * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we | 35 | * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we |
@@ -430,7 +431,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) | |||
430 | .udma_mask = ATA_UDMA4, | 431 | .udma_mask = ATA_UDMA4, |
431 | .port_ops = &artop6260_ops, | 432 | .port_ops = &artop6260_ops, |
432 | }; | 433 | }; |
433 | static const struct ata_port_info info_626x_fast = { | 434 | static const struct ata_port_info info_628x = { |
434 | .sht = &artop_sht, | 435 | .sht = &artop_sht, |
435 | .flags = ATA_FLAG_SLAVE_POSS, | 436 | .flags = ATA_FLAG_SLAVE_POSS, |
436 | .pio_mask = 0x1f, /* pio0-4 */ | 437 | .pio_mask = 0x1f, /* pio0-4 */ |
@@ -438,6 +439,14 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) | |||
438 | .udma_mask = ATA_UDMA5, | 439 | .udma_mask = ATA_UDMA5, |
439 | .port_ops = &artop6260_ops, | 440 | .port_ops = &artop6260_ops, |
440 | }; | 441 | }; |
442 | static const struct ata_port_info info_628x_fast = { | ||
443 | .sht = &artop_sht, | ||
444 | .flags = ATA_FLAG_SLAVE_POSS, | ||
445 | .pio_mask = 0x1f, /* pio0-4 */ | ||
446 | .mwdma_mask = 0x07, /* mwdma0-2 */ | ||
447 | .udma_mask = ATA_UDMA6, | ||
448 | .port_ops = &artop6260_ops, | ||
449 | }; | ||
441 | const struct ata_port_info *ppi[] = { NULL, NULL }; | 450 | const struct ata_port_info *ppi[] = { NULL, NULL }; |
442 | 451 | ||
443 | if (!printed_version++) | 452 | if (!printed_version++) |
@@ -455,13 +464,13 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) | |||
455 | } | 464 | } |
456 | else if (id->driver_data == 1) /* 6260 */ | 465 | else if (id->driver_data == 1) /* 6260 */ |
457 | ppi[0] = &info_626x; | 466 | ppi[0] = &info_626x; |
458 | else if (id->driver_data == 2) { /* 6260 or 6260 + fast */ | 467 | else if (id->driver_data == 2) { /* 6280 or 6280 + fast */ |
459 | unsigned long io = pci_resource_start(pdev, 4); | 468 | unsigned long io = pci_resource_start(pdev, 4); |
460 | u8 reg; | 469 | u8 reg; |
461 | 470 | ||
462 | ppi[0] = &info_626x; | 471 | ppi[0] = &info_628x; |
463 | if (inb(io) & 0x10) | 472 | if (inb(io) & 0x10) |
464 | ppi[0] = &info_626x_fast; | 473 | ppi[0] = &info_628x_fast; |
465 | /* Mac systems come up with some registers not set as we | 474 | /* Mac systems come up with some registers not set as we |
466 | will need them */ | 475 | will need them */ |
467 | 476 | ||
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index 84d9c5568567..c5ddd937dbf2 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
@@ -8,12 +8,10 @@ | |||
8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> | 8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> |
9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
10 | * Portions Copyright (C) 2003 Red Hat Inc | 10 | * Portions Copyright (C) 2003 Red Hat Inc |
11 | * Portions Copyright (C) 2005-2006 MontaVista Software, Inc. | 11 | * Portions Copyright (C) 2005-2007 MontaVista Software, Inc. |
12 | * | 12 | * |
13 | * TODO | 13 | * TODO |
14 | * PLL mode | 14 | * Look into engine reset on timeout errors. Should not be required. |
15 | * Look into engine reset on timeout errors. Should not be | ||
16 | * required. | ||
17 | */ | 15 | */ |
18 | 16 | ||
19 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
@@ -26,7 +24,7 @@ | |||
26 | #include <linux/libata.h> | 24 | #include <linux/libata.h> |
27 | 25 | ||
28 | #define DRV_NAME "pata_hpt37x" | 26 | #define DRV_NAME "pata_hpt37x" |
29 | #define DRV_VERSION "0.6.7" | 27 | #define DRV_VERSION "0.6.9" |
30 | 28 | ||
31 | struct hpt_clock { | 29 | struct hpt_clock { |
32 | u8 xfer_speed; | 30 | u8 xfer_speed; |
@@ -1092,9 +1090,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1092 | int dpll, adjust; | 1090 | int dpll, adjust; |
1093 | 1091 | ||
1094 | /* Compute DPLL */ | 1092 | /* Compute DPLL */ |
1095 | dpll = 2; | 1093 | dpll = (port->udma_mask & 0xC0) ? 3 : 2; |
1096 | if (port->udma_mask & 0xE0) | ||
1097 | dpll = 3; | ||
1098 | 1094 | ||
1099 | f_low = (MHz[clock_slot] * 48) / MHz[dpll]; | 1095 | f_low = (MHz[clock_slot] * 48) / MHz[dpll]; |
1100 | f_high = f_low + 2; | 1096 | f_high = f_low + 2; |
@@ -1116,7 +1112,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1116 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100); | 1112 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100); |
1117 | } | 1113 | } |
1118 | if (adjust == 8) { | 1114 | if (adjust == 8) { |
1119 | printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n"); | 1115 | printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n"); |
1120 | return -ENODEV; | 1116 | return -ENODEV; |
1121 | } | 1117 | } |
1122 | if (dpll == 3) | 1118 | if (dpll == 3) |
@@ -1124,7 +1120,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1124 | else | 1120 | else |
1125 | private_data = (void *)hpt37x_timings_50; | 1121 | private_data = (void *)hpt37x_timings_50; |
1126 | 1122 | ||
1127 | printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]); | 1123 | printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n", |
1124 | MHz[clock_slot], MHz[dpll]); | ||
1128 | } else { | 1125 | } else { |
1129 | private_data = (void *)chip_table->clocks[clock_slot]; | 1126 | private_data = (void *)chip_table->clocks[clock_slot]; |
1130 | /* | 1127 | /* |
@@ -1137,7 +1134,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1137 | port = &info_hpt370_33; | 1134 | port = &info_hpt370_33; |
1138 | if (clock_slot < 2 && port == &info_hpt370a) | 1135 | if (clock_slot < 2 && port == &info_hpt370a) |
1139 | port = &info_hpt370a_33; | 1136 | port = &info_hpt370a_33; |
1140 | printk(KERN_INFO "hpt37x: %s: Bus clock %dMHz.\n", chip_table->name, MHz[clock_slot]); | 1137 | printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n", |
1138 | chip_table->name, MHz[clock_slot]); | ||
1141 | } | 1139 | } |
1142 | 1140 | ||
1143 | /* Now kick off ATA set up */ | 1141 | /* Now kick off ATA set up */ |
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c index aa29cde09f8b..f8f234bfc8ce 100644 --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> | 8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> |
9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
10 | * Portions Copyright (C) 2003 Red Hat Inc | 10 | * Portions Copyright (C) 2003 Red Hat Inc |
11 | * Portions Copyright (C) 2005-2006 MontaVista Software, Inc. | 11 | * Portions Copyright (C) 2005-2007 MontaVista Software, Inc. |
12 | * | 12 | * |
13 | * | 13 | * |
14 | * TODO | 14 | * TODO |
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/libata.h> | 25 | #include <linux/libata.h> |
26 | 26 | ||
27 | #define DRV_NAME "pata_hpt3x2n" | 27 | #define DRV_NAME "pata_hpt3x2n" |
28 | #define DRV_VERSION "0.3.3" | 28 | #define DRV_VERSION "0.3.4" |
29 | 29 | ||
30 | enum { | 30 | enum { |
31 | HPT_PCI_FAST = (1 << 31), | 31 | HPT_PCI_FAST = (1 << 31), |
@@ -579,10 +579,12 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
579 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); | 579 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); |
580 | } | 580 | } |
581 | if (adjust == 8) { | 581 | if (adjust == 8) { |
582 | printk(KERN_WARNING "hpt3x2n: DPLL did not stabilize.\n"); | 582 | printk(KERN_ERR "pata_hpt3x2n: DPLL did not stabilize!\n"); |
583 | return -ENODEV; | 583 | return -ENODEV; |
584 | } | 584 | } |
585 | 585 | ||
586 | printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n", | ||
587 | pci_mhz); | ||
586 | /* Set our private data up. We only need a few flags so we use | 588 | /* Set our private data up. We only need a few flags so we use |
587 | it directly */ | 589 | it directly */ |
588 | port.private_data = NULL; | 590 | port.private_data = NULL; |
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c index 5525518204e6..91a396fa5b20 100644 --- a/drivers/ata/pata_isapnp.c +++ b/drivers/ata/pata_isapnp.c | |||
@@ -139,6 +139,8 @@ static struct pnp_device_id isapnp_devices[] = { | |||
139 | {.id = ""} | 139 | {.id = ""} |
140 | }; | 140 | }; |
141 | 141 | ||
142 | MODULE_DEVICE_TABLE(pnp, isapnp_devices); | ||
143 | |||
142 | static struct pnp_driver isapnp_driver = { | 144 | static struct pnp_driver isapnp_driver = { |
143 | .name = DRV_NAME, | 145 | .name = DRV_NAME, |
144 | .id_table = isapnp_devices, | 146 | .id_table = isapnp_devices, |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 8ec520885b95..3acf65e75eb2 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -621,6 +621,9 @@ static const struct pci_device_id mv_pci_tbl[] = { | |||
621 | { PCI_VDEVICE(MARVELL, 0x5041), chip_504x }, | 621 | { PCI_VDEVICE(MARVELL, 0x5041), chip_504x }, |
622 | { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 }, | 622 | { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 }, |
623 | { PCI_VDEVICE(MARVELL, 0x5081), chip_508x }, | 623 | { PCI_VDEVICE(MARVELL, 0x5081), chip_508x }, |
624 | /* RocketRAID 1740/174x have different identifiers */ | ||
625 | { PCI_VDEVICE(TTI, 0x1740), chip_508x }, | ||
626 | { PCI_VDEVICE(TTI, 0x1742), chip_508x }, | ||
624 | 627 | ||
625 | { PCI_VDEVICE(MARVELL, 0x6040), chip_604x }, | 628 | { PCI_VDEVICE(MARVELL, 0x6040), chip_604x }, |
626 | { PCI_VDEVICE(MARVELL, 0x6041), chip_604x }, | 629 | { PCI_VDEVICE(MARVELL, 0x6041), chip_604x }, |
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index bed9f58c2d5a..b554edac1ced 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig | |||
@@ -6,6 +6,11 @@ menuconfig ATM_DRIVERS | |||
6 | bool "ATM drivers" | 6 | bool "ATM drivers" |
7 | depends on NETDEVICES && ATM | 7 | depends on NETDEVICES && ATM |
8 | default y | 8 | default y |
9 | ---help--- | ||
10 | Say Y here to get to see options for Asynchronous Transfer Mode | ||
11 | device drivers. This option alone does not add any kernel code. | ||
12 | |||
13 | If you say N, all options in this submenu will be skipped and disabled. | ||
9 | 14 | ||
10 | if ATM_DRIVERS && NETDEVICES && ATM | 15 | if ATM_DRIVERS && NETDEVICES && ATM |
11 | 16 | ||
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 405ee5e09221..8b12925fe7a4 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c | |||
@@ -2435,7 +2435,7 @@ fore200e_init_cmd_queue(struct fore200e* fore200e) | |||
2435 | } | 2435 | } |
2436 | 2436 | ||
2437 | 2437 | ||
2438 | static void __init | 2438 | static void __devinit |
2439 | fore200e_param_bs_queue(struct fore200e* fore200e, | 2439 | fore200e_param_bs_queue(struct fore200e* fore200e, |
2440 | enum buffer_scheme scheme, enum buffer_magn magn, | 2440 | enum buffer_scheme scheme, enum buffer_magn magn, |
2441 | int queue_length, int pool_size, int supply_blksize) | 2441 | int queue_length, int pool_size, int supply_blksize) |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index a3b605a0ca17..ef52452640e0 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -1601,14 +1601,14 @@ static int rx_init(struct atm_dev *dev) | |||
1601 | 1601 | ||
1602 | skb_queue_head_init(&iadev->rx_dma_q); | 1602 | skb_queue_head_init(&iadev->rx_dma_q); |
1603 | iadev->rx_free_desc_qhead = NULL; | 1603 | iadev->rx_free_desc_qhead = NULL; |
1604 | iadev->rx_open = kmalloc(4*iadev->num_vc,GFP_KERNEL); | 1604 | |
1605 | if (!iadev->rx_open) | 1605 | iadev->rx_open = kzalloc(4 * iadev->num_vc, GFP_KERNEL); |
1606 | { | 1606 | if (!iadev->rx_open) { |
1607 | printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n", | 1607 | printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n", |
1608 | dev->number); | 1608 | dev->number); |
1609 | goto err_free_dle; | 1609 | goto err_free_dle; |
1610 | } | 1610 | } |
1611 | memset(iadev->rx_open, 0, 4*iadev->num_vc); | 1611 | |
1612 | iadev->rxing = 1; | 1612 | iadev->rxing = 1; |
1613 | iadev->rx_pkt_cnt = 0; | 1613 | iadev->rx_pkt_cnt = 0; |
1614 | /* Mode Register */ | 1614 | /* Mode Register */ |
@@ -3171,12 +3171,12 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
3171 | unsigned long flags; | 3171 | unsigned long flags; |
3172 | int ret; | 3172 | int ret; |
3173 | 3173 | ||
3174 | iadev = kmalloc(sizeof(*iadev), GFP_KERNEL); | 3174 | iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); |
3175 | if (!iadev) { | 3175 | if (!iadev) { |
3176 | ret = -ENOMEM; | 3176 | ret = -ENOMEM; |
3177 | goto err_out; | 3177 | goto err_out; |
3178 | } | 3178 | } |
3179 | memset(iadev, 0, sizeof(*iadev)); | 3179 | |
3180 | iadev->pci = pdev; | 3180 | iadev->pci = pdev; |
3181 | 3181 | ||
3182 | IF_INIT(printk("ia detected at bus:%d dev: %d function:%d\n", | 3182 | IF_INIT(printk("ia detected at bus:%d dev: %d function:%d\n", |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 55fd1b4543fd..144a49f15220 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -65,7 +65,6 @@ | |||
65 | #include <linux/init.h> | 65 | #include <linux/init.h> |
66 | #include <linux/delay.h> | 66 | #include <linux/delay.h> |
67 | #include <linux/interrupt.h> | 67 | #include <linux/interrupt.h> |
68 | #include <linux/dma-mapping.h> | ||
69 | 68 | ||
70 | /* -------------------- TUNABLE PARAMATERS: */ | 69 | /* -------------------- TUNABLE PARAMATERS: */ |
71 | 70 | ||
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index de2fcce10ba5..043353bd0600 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -8,6 +8,11 @@ | |||
8 | menuconfig AUXDISPLAY | 8 | menuconfig AUXDISPLAY |
9 | depends on PARPORT | 9 | depends on PARPORT |
10 | bool "Auxiliary Display support" | 10 | bool "Auxiliary Display support" |
11 | ---help--- | ||
12 | Say Y here to get to see options for auxiliary display drivers. | ||
13 | This option alone does not add any kernel code. | ||
14 | |||
15 | If you say N, all options in this submenu will be skipped and disabled. | ||
11 | 16 | ||
12 | if AUXDISPLAY && PARPORT | 17 | if AUXDISPLAY && PARPORT |
13 | 18 | ||
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index a4a311992408..ef32e977d307 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
@@ -6,6 +6,12 @@ menuconfig BLK_DEV | |||
6 | bool "Block devices" | 6 | bool "Block devices" |
7 | depends on BLOCK | 7 | depends on BLOCK |
8 | default y | 8 | default y |
9 | ---help--- | ||
10 | Say Y here to get to see options for various different block device | ||
11 | drivers. This option alone does not add any kernel code. | ||
12 | |||
13 | If you say N, all options in this submenu will be skipped and disabled; | ||
14 | only do this if you know what you are doing. | ||
9 | 15 | ||
10 | if BLK_DEV | 16 | if BLK_DEV |
11 | 17 | ||
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index a11b2bd54bbe..084358a828e9 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1977,12 +1977,13 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1977 | { | 1977 | { |
1978 | ReadCapdata_struct *buf; | 1978 | ReadCapdata_struct *buf; |
1979 | int return_code; | 1979 | int return_code; |
1980 | buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL); | 1980 | |
1981 | if (buf == NULL) { | 1981 | buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL); |
1982 | if (!buf) { | ||
1982 | printk(KERN_WARNING "cciss: out of memory\n"); | 1983 | printk(KERN_WARNING "cciss: out of memory\n"); |
1983 | return; | 1984 | return; |
1984 | } | 1985 | } |
1985 | memset(buf, 0, sizeof(ReadCapdata_struct)); | 1986 | |
1986 | if (withirq) | 1987 | if (withirq) |
1987 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY, | 1988 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY, |
1988 | ctlr, buf, sizeof(ReadCapdata_struct), | 1989 | ctlr, buf, sizeof(ReadCapdata_struct), |
@@ -2003,7 +2004,6 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
2003 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 2004 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
2004 | (unsigned long long)*total_size+1, *block_size); | 2005 | (unsigned long long)*total_size+1, *block_size); |
2005 | kfree(buf); | 2006 | kfree(buf); |
2006 | return; | ||
2007 | } | 2007 | } |
2008 | 2008 | ||
2009 | static void | 2009 | static void |
@@ -2011,12 +2011,13 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
2011 | { | 2011 | { |
2012 | ReadCapdata_struct_16 *buf; | 2012 | ReadCapdata_struct_16 *buf; |
2013 | int return_code; | 2013 | int return_code; |
2014 | buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL); | 2014 | |
2015 | if (buf == NULL) { | 2015 | buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL); |
2016 | if (!buf) { | ||
2016 | printk(KERN_WARNING "cciss: out of memory\n"); | 2017 | printk(KERN_WARNING "cciss: out of memory\n"); |
2017 | return; | 2018 | return; |
2018 | } | 2019 | } |
2019 | memset(buf, 0, sizeof(ReadCapdata_struct_16)); | 2020 | |
2020 | if (withirq) { | 2021 | if (withirq) { |
2021 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16, | 2022 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16, |
2022 | ctlr, buf, sizeof(ReadCapdata_struct_16), | 2023 | ctlr, buf, sizeof(ReadCapdata_struct_16), |
@@ -2038,7 +2039,6 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
2038 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 2039 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
2039 | (unsigned long long)*total_size+1, *block_size); | 2040 | (unsigned long long)*total_size+1, *block_size); |
2040 | kfree(buf); | 2041 | kfree(buf); |
2041 | return; | ||
2042 | } | 2042 | } |
2043 | 2043 | ||
2044 | static int cciss_revalidate(struct gendisk *disk) | 2044 | static int cciss_revalidate(struct gendisk *disk) |
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index be4e3477d83b..eb9799acf65b 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -420,18 +420,17 @@ static int __init cpqarray_register_ctlr( int i, struct pci_dev *pdev) | |||
420 | goto Enomem2; | 420 | goto Enomem2; |
421 | } | 421 | } |
422 | 422 | ||
423 | hba[i]->cmd_pool = (cmdlist_t *)pci_alloc_consistent( | 423 | hba[i]->cmd_pool = pci_alloc_consistent( |
424 | hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t), | 424 | hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t), |
425 | &(hba[i]->cmd_pool_dhandle)); | 425 | &(hba[i]->cmd_pool_dhandle)); |
426 | hba[i]->cmd_pool_bits = kmalloc( | 426 | hba[i]->cmd_pool_bits = kcalloc( |
427 | ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long), | 427 | (NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG, sizeof(unsigned long), |
428 | GFP_KERNEL); | 428 | GFP_KERNEL); |
429 | 429 | ||
430 | if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool) | 430 | if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool) |
431 | goto Enomem1; | 431 | goto Enomem1; |
432 | 432 | ||
433 | memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t)); | 433 | memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t)); |
434 | memset(hba[i]->cmd_pool_bits, 0, ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long)); | ||
435 | printk(KERN_INFO "cpqarray: Finding drives on %s", | 434 | printk(KERN_INFO "cpqarray: Finding drives on %s", |
436 | hba[i]->devname); | 435 | hba[i]->devname); |
437 | 436 | ||
@@ -1660,45 +1659,30 @@ static void getgeometry(int ctlr) | |||
1660 | 1659 | ||
1661 | info_p->log_drv_map = 0; | 1660 | info_p->log_drv_map = 0; |
1662 | 1661 | ||
1663 | id_ldrive = kmalloc(sizeof(id_log_drv_t), GFP_KERNEL); | 1662 | id_ldrive = kzalloc(sizeof(id_log_drv_t), GFP_KERNEL); |
1664 | if(id_ldrive == NULL) | 1663 | if (!id_ldrive) { |
1665 | { | ||
1666 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1664 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1667 | return; | 1665 | goto err_0; |
1668 | } | 1666 | } |
1669 | 1667 | ||
1670 | id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL); | 1668 | id_ctlr_buf = kzalloc(sizeof(id_ctlr_t), GFP_KERNEL); |
1671 | if(id_ctlr_buf == NULL) | 1669 | if (!id_ctlr_buf) { |
1672 | { | ||
1673 | kfree(id_ldrive); | ||
1674 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1670 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1675 | return; | 1671 | goto err_1; |
1676 | } | 1672 | } |
1677 | 1673 | ||
1678 | id_lstatus_buf = kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL); | 1674 | id_lstatus_buf = kzalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL); |
1679 | if(id_lstatus_buf == NULL) | 1675 | if (!id_lstatus_buf) { |
1680 | { | ||
1681 | kfree(id_ctlr_buf); | ||
1682 | kfree(id_ldrive); | ||
1683 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1676 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1684 | return; | 1677 | goto err_2; |
1685 | } | 1678 | } |
1686 | 1679 | ||
1687 | sense_config_buf = kmalloc(sizeof(config_t), GFP_KERNEL); | 1680 | sense_config_buf = kzalloc(sizeof(config_t), GFP_KERNEL); |
1688 | if(sense_config_buf == NULL) | 1681 | if (!sense_config_buf) { |
1689 | { | ||
1690 | kfree(id_lstatus_buf); | ||
1691 | kfree(id_ctlr_buf); | ||
1692 | kfree(id_ldrive); | ||
1693 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1682 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1694 | return; | 1683 | goto err_3; |
1695 | } | 1684 | } |
1696 | 1685 | ||
1697 | memset(id_ldrive, 0, sizeof(id_log_drv_t)); | ||
1698 | memset(id_ctlr_buf, 0, sizeof(id_ctlr_t)); | ||
1699 | memset(id_lstatus_buf, 0, sizeof(sense_log_drv_stat_t)); | ||
1700 | memset(sense_config_buf, 0, sizeof(config_t)); | ||
1701 | |||
1702 | info_p->phys_drives = 0; | 1686 | info_p->phys_drives = 0; |
1703 | info_p->log_drv_map = 0; | 1687 | info_p->log_drv_map = 0; |
1704 | info_p->drv_assign_map = 0; | 1688 | info_p->drv_assign_map = 0; |
@@ -1712,13 +1696,8 @@ static void getgeometry(int ctlr) | |||
1712 | * so the idastubopen will fail on all logical drives | 1696 | * so the idastubopen will fail on all logical drives |
1713 | * on the controller. | 1697 | * on the controller. |
1714 | */ | 1698 | */ |
1715 | /* Free all the buffers and return */ | ||
1716 | printk(KERN_ERR "cpqarray: error sending ID controller\n"); | 1699 | printk(KERN_ERR "cpqarray: error sending ID controller\n"); |
1717 | kfree(sense_config_buf); | 1700 | goto err_4; |
1718 | kfree(id_lstatus_buf); | ||
1719 | kfree(id_ctlr_buf); | ||
1720 | kfree(id_ldrive); | ||
1721 | return; | ||
1722 | } | 1701 | } |
1723 | 1702 | ||
1724 | info_p->log_drives = id_ctlr_buf->nr_drvs; | 1703 | info_p->log_drives = id_ctlr_buf->nr_drvs; |
@@ -1764,12 +1743,7 @@ static void getgeometry(int ctlr) | |||
1764 | " failed to report status of logical drive %d\n" | 1743 | " failed to report status of logical drive %d\n" |
1765 | "Access to this controller has been disabled\n", | 1744 | "Access to this controller has been disabled\n", |
1766 | ctlr, log_unit); | 1745 | ctlr, log_unit); |
1767 | /* Free all the buffers and return */ | 1746 | goto err_4; |
1768 | kfree(sense_config_buf); | ||
1769 | kfree(id_lstatus_buf); | ||
1770 | kfree(id_ctlr_buf); | ||
1771 | kfree(id_ldrive); | ||
1772 | return; | ||
1773 | } | 1747 | } |
1774 | /* | 1748 | /* |
1775 | Make sure the logical drive is configured | 1749 | Make sure the logical drive is configured |
@@ -1798,14 +1772,8 @@ static void getgeometry(int ctlr) | |||
1798 | sizeof(config_t), 0, 0, log_unit); | 1772 | sizeof(config_t), 0, 0, log_unit); |
1799 | if (ret_code == IO_ERROR) { | 1773 | if (ret_code == IO_ERROR) { |
1800 | info_p->log_drv_map = 0; | 1774 | info_p->log_drv_map = 0; |
1801 | /* Free all the buffers and return */ | ||
1802 | printk(KERN_ERR "cpqarray: error sending sense config\n"); | 1775 | printk(KERN_ERR "cpqarray: error sending sense config\n"); |
1803 | kfree(sense_config_buf); | 1776 | goto err_4; |
1804 | kfree(id_lstatus_buf); | ||
1805 | kfree(id_ctlr_buf); | ||
1806 | kfree(id_ldrive); | ||
1807 | return; | ||
1808 | |||
1809 | } | 1777 | } |
1810 | 1778 | ||
1811 | info_p->phys_drives = | 1779 | info_p->phys_drives = |
@@ -1820,12 +1788,18 @@ static void getgeometry(int ctlr) | |||
1820 | log_index = log_index + 1; | 1788 | log_index = log_index + 1; |
1821 | } /* end of if logical drive configured */ | 1789 | } /* end of if logical drive configured */ |
1822 | } /* end of for log_unit */ | 1790 | } /* end of for log_unit */ |
1791 | |||
1792 | /* Free all the buffers and return */ | ||
1793 | err_4: | ||
1823 | kfree(sense_config_buf); | 1794 | kfree(sense_config_buf); |
1824 | kfree(id_ldrive); | 1795 | err_3: |
1825 | kfree(id_lstatus_buf); | 1796 | kfree(id_lstatus_buf); |
1797 | err_2: | ||
1826 | kfree(id_ctlr_buf); | 1798 | kfree(id_ctlr_buf); |
1799 | err_1: | ||
1800 | kfree(id_ldrive); | ||
1801 | err_0: | ||
1827 | return; | 1802 | return; |
1828 | |||
1829 | } | 1803 | } |
1830 | 1804 | ||
1831 | static void __exit cpqarray_exit(void) | 1805 | static void __exit cpqarray_exit(void) |
diff --git a/drivers/block/lguest_blk.c b/drivers/block/lguest_blk.c index 93e3c4001bf5..160cf14431ac 100644 --- a/drivers/block/lguest_blk.c +++ b/drivers/block/lguest_blk.c | |||
@@ -308,9 +308,12 @@ static int lguestblk_probe(struct lguest_device *lgdev) | |||
308 | } | 308 | } |
309 | 309 | ||
310 | /* This allocates a "struct gendisk" where we pack all the information | 310 | /* This allocates a "struct gendisk" where we pack all the information |
311 | * about the disk which the rest of Linux sees. We ask for one minor | 311 | * about the disk which the rest of Linux sees. The argument is the |
312 | * number; I do wonder if we should be asking for more. */ | 312 | * number of minor devices desired: we need one minor for the main |
313 | bd->disk = alloc_disk(1); | 313 | * disk, and one for each partition. Of course, we can't possibly know |
314 | * how many partitions are on the disk (add_disk does that). | ||
315 | */ | ||
316 | bd->disk = alloc_disk(16); | ||
314 | if (!bd->disk) { | 317 | if (!bd->disk) { |
315 | err = -ENOMEM; | 318 | err = -ENOMEM; |
316 | goto out_unregister_blkdev; | 319 | goto out_unregister_blkdev; |
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 85916e2665d4..af3969a9c963 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/dma-mapping.h> | 41 | #include <linux/dma-mapping.h> |
42 | #include <linux/completion.h> | 42 | #include <linux/completion.h> |
43 | #include <linux/device.h> | 43 | #include <linux/device.h> |
44 | #include <linux/kernel.h> | ||
45 | 44 | ||
46 | #include <asm/uaccess.h> | 45 | #include <asm/uaccess.h> |
47 | #include <asm/vio.h> | 46 | #include <asm/vio.h> |
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index cb27e8863d7c..3ede0b63da13 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -902,26 +902,17 @@ static int ace_release(struct inode *inode, struct file *filp) | |||
902 | return 0; | 902 | return 0; |
903 | } | 903 | } |
904 | 904 | ||
905 | static int ace_ioctl(struct inode *inode, struct file *filp, | 905 | static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo) |
906 | unsigned int cmd, unsigned long arg) | ||
907 | { | 906 | { |
908 | struct ace_device *ace = inode->i_bdev->bd_disk->private_data; | 907 | struct ace_device *ace = bdev->bd_disk->private_data; |
909 | struct hd_geometry __user *geo = (struct hd_geometry __user *)arg; | ||
910 | struct hd_geometry g; | ||
911 | dev_dbg(ace->dev, "ace_ioctl()\n"); | ||
912 | |||
913 | switch (cmd) { | ||
914 | case HDIO_GETGEO: | ||
915 | g.heads = ace->cf_id.heads; | ||
916 | g.sectors = ace->cf_id.sectors; | ||
917 | g.cylinders = ace->cf_id.cyls; | ||
918 | g.start = 0; | ||
919 | return copy_to_user(geo, &g, sizeof(g)) ? -EFAULT : 0; | ||
920 | 908 | ||
921 | default: | 909 | dev_dbg(ace->dev, "ace_getgeo()\n"); |
922 | return -ENOTTY; | 910 | |
923 | } | 911 | geo->heads = ace->cf_id.heads; |
924 | return -ENOTTY; | 912 | geo->sectors = ace->cf_id.sectors; |
913 | geo->cylinders = ace->cf_id.cyls; | ||
914 | |||
915 | return 0; | ||
925 | } | 916 | } |
926 | 917 | ||
927 | static struct block_device_operations ace_fops = { | 918 | static struct block_device_operations ace_fops = { |
@@ -930,7 +921,7 @@ static struct block_device_operations ace_fops = { | |||
930 | .release = ace_release, | 921 | .release = ace_release, |
931 | .media_changed = ace_media_changed, | 922 | .media_changed = ace_media_changed, |
932 | .revalidate_disk = ace_revalidate_disk, | 923 | .revalidate_disk = ace_revalidate_disk, |
933 | .ioctl = ace_ioctl, | 924 | .getgeo = ace_getgeo, |
934 | }; | 925 | }; |
935 | 926 | ||
936 | /* -------------------------------------------------------------------- | 927 | /* -------------------------------------------------------------------- |
diff --git a/drivers/char/hvc_lguest.c b/drivers/char/hvc_lguest.c index feeccbaec438..3d6bd0baa56d 100644 --- a/drivers/char/hvc_lguest.c +++ b/drivers/char/hvc_lguest.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/err.h> | 35 | #include <linux/err.h> |
36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
37 | #include <linux/lguest_bus.h> | 37 | #include <linux/lguest_bus.h> |
38 | #include <asm/paravirt.h> | ||
38 | #include "hvc_console.h" | 39 | #include "hvc_console.h" |
39 | 40 | ||
40 | /*D:340 This is our single console input buffer, with associated "struct | 41 | /*D:340 This is our single console input buffer, with associated "struct |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index fee58e03dbe2..4177f6db83e9 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -1629,7 +1629,7 @@ static int cmm_open(struct inode *inode, struct file *filp) | |||
1629 | { | 1629 | { |
1630 | struct cm4000_dev *dev; | 1630 | struct cm4000_dev *dev; |
1631 | struct pcmcia_device *link; | 1631 | struct pcmcia_device *link; |
1632 | int rc, minor = iminor(inode); | 1632 | int minor = iminor(inode); |
1633 | 1633 | ||
1634 | if (minor >= CM4000_MAX_DEV) | 1634 | if (minor >= CM4000_MAX_DEV) |
1635 | return -ENODEV; | 1635 | return -ENODEV; |
@@ -1668,7 +1668,6 @@ static int cmm_open(struct inode *inode, struct file *filp) | |||
1668 | start_monitor(dev); | 1668 | start_monitor(dev); |
1669 | 1669 | ||
1670 | link->open = 1; /* only one open per device */ | 1670 | link->open = 1; /* only one open per device */ |
1671 | rc = 0; | ||
1672 | 1671 | ||
1673 | DEBUGP(2, dev, "<- cmm_open\n"); | 1672 | DEBUGP(2, dev, "<- cmm_open\n"); |
1674 | return nonseekable_open(inode, filp); | 1673 | return nonseekable_open(inode, filp); |
@@ -1824,7 +1823,7 @@ static int cm4000_resume(struct pcmcia_device *link) | |||
1824 | 1823 | ||
1825 | static void cm4000_release(struct pcmcia_device *link) | 1824 | static void cm4000_release(struct pcmcia_device *link) |
1826 | { | 1825 | { |
1827 | cmm_cm4000_release(link->priv); /* delay release until device closed */ | 1826 | cmm_cm4000_release(link); /* delay release until device closed */ |
1828 | pcmcia_disable_device(link); | 1827 | pcmcia_disable_device(link); |
1829 | } | 1828 | } |
1830 | 1829 | ||
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index af88181a17f4..b24a3e7bbb9f 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
@@ -599,7 +599,7 @@ cs_release: | |||
599 | 599 | ||
600 | static void reader_release(struct pcmcia_device *link) | 600 | static void reader_release(struct pcmcia_device *link) |
601 | { | 601 | { |
602 | cm4040_reader_release(link->priv); | 602 | cm4040_reader_release(link); |
603 | pcmcia_disable_device(link); | 603 | pcmcia_disable_device(link); |
604 | } | 604 | } |
605 | 605 | ||
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 73037a4d3c50..aeec67e27264 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type) | |||
1147 | return 0; | 1147 | return 0; |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | const static struct acpi_device_id sonypi_device_ids[] = { | ||
1151 | {"SNY6001", 0}, | ||
1152 | {"", 0}, | ||
1153 | }; | ||
1154 | |||
1150 | static struct acpi_driver sonypi_acpi_driver = { | 1155 | static struct acpi_driver sonypi_acpi_driver = { |
1151 | .name = "sonypi", | 1156 | .name = "sonypi", |
1152 | .class = "hkey", | 1157 | .class = "hkey", |
1153 | .ids = "SNY6001", | 1158 | .ids = sonypi_device_ids, |
1154 | .ops = { | 1159 | .ops = { |
1155 | .add = sonypi_acpi_add, | 1160 | .add = sonypi_acpi_add, |
1156 | .remove = sonypi_acpi_remove, | 1161 | .remove = sonypi_acpi_remove, |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index de37ebc3a4cf..51ea93cab6c4 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -369,25 +369,54 @@ static void tty_buffer_free(struct tty_struct *tty, struct tty_buffer *b) | |||
369 | } | 369 | } |
370 | 370 | ||
371 | /** | 371 | /** |
372 | * tty_buffer_flush - flush full tty buffers | 372 | * __tty_buffer_flush - flush full tty buffers |
373 | * @tty: tty to flush | 373 | * @tty: tty to flush |
374 | * | 374 | * |
375 | * flush all the buffers containing receive data | 375 | * flush all the buffers containing receive data. Caller must |
376 | * hold the buffer lock and must have ensured no parallel flush to | ||
377 | * ldisc is running. | ||
376 | * | 378 | * |
377 | * Locking: none | 379 | * Locking: Caller must hold tty->buf.lock |
378 | */ | 380 | */ |
379 | 381 | ||
380 | static void tty_buffer_flush(struct tty_struct *tty) | 382 | static void __tty_buffer_flush(struct tty_struct *tty) |
381 | { | 383 | { |
382 | struct tty_buffer *thead; | 384 | struct tty_buffer *thead; |
383 | unsigned long flags; | ||
384 | 385 | ||
385 | spin_lock_irqsave(&tty->buf.lock, flags); | ||
386 | while((thead = tty->buf.head) != NULL) { | 386 | while((thead = tty->buf.head) != NULL) { |
387 | tty->buf.head = thead->next; | 387 | tty->buf.head = thead->next; |
388 | tty_buffer_free(tty, thead); | 388 | tty_buffer_free(tty, thead); |
389 | } | 389 | } |
390 | tty->buf.tail = NULL; | 390 | tty->buf.tail = NULL; |
391 | } | ||
392 | |||
393 | /** | ||
394 | * tty_buffer_flush - flush full tty buffers | ||
395 | * @tty: tty to flush | ||
396 | * | ||
397 | * flush all the buffers containing receive data. If the buffer is | ||
398 | * being processed by flush_to_ldisc then we defer the processing | ||
399 | * to that function | ||
400 | * | ||
401 | * Locking: none | ||
402 | */ | ||
403 | |||
404 | static void tty_buffer_flush(struct tty_struct *tty) | ||
405 | { | ||
406 | unsigned long flags; | ||
407 | spin_lock_irqsave(&tty->buf.lock, flags); | ||
408 | |||
409 | /* If the data is being pushed to the tty layer then we can't | ||
410 | process it here. Instead set a flag and the flush_to_ldisc | ||
411 | path will process the flush request before it exits */ | ||
412 | if (test_bit(TTY_FLUSHING, &tty->flags)) { | ||
413 | set_bit(TTY_FLUSHPENDING, &tty->flags); | ||
414 | spin_unlock_irqrestore(&tty->buf.lock, flags); | ||
415 | wait_event(tty->read_wait, | ||
416 | test_bit(TTY_FLUSHPENDING, &tty->flags) == 0); | ||
417 | return; | ||
418 | } else | ||
419 | __tty_buffer_flush(tty); | ||
391 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 420 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
392 | } | 421 | } |
393 | 422 | ||
@@ -3594,6 +3623,7 @@ static void flush_to_ldisc(struct work_struct *work) | |||
3594 | return; | 3623 | return; |
3595 | 3624 | ||
3596 | spin_lock_irqsave(&tty->buf.lock, flags); | 3625 | spin_lock_irqsave(&tty->buf.lock, flags); |
3626 | set_bit(TTY_FLUSHING, &tty->flags); /* So we know a flush is running */ | ||
3597 | head = tty->buf.head; | 3627 | head = tty->buf.head; |
3598 | if (head != NULL) { | 3628 | if (head != NULL) { |
3599 | tty->buf.head = NULL; | 3629 | tty->buf.head = NULL; |
@@ -3607,6 +3637,11 @@ static void flush_to_ldisc(struct work_struct *work) | |||
3607 | tty_buffer_free(tty, tbuf); | 3637 | tty_buffer_free(tty, tbuf); |
3608 | continue; | 3638 | continue; |
3609 | } | 3639 | } |
3640 | /* Ldisc or user is trying to flush the buffers | ||
3641 | we are feeding to the ldisc, stop feeding the | ||
3642 | line discipline as we want to empty the queue */ | ||
3643 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) | ||
3644 | break; | ||
3610 | if (!tty->receive_room) { | 3645 | if (!tty->receive_room) { |
3611 | schedule_delayed_work(&tty->buf.work, 1); | 3646 | schedule_delayed_work(&tty->buf.work, 1); |
3612 | break; | 3647 | break; |
@@ -3620,8 +3655,17 @@ static void flush_to_ldisc(struct work_struct *work) | |||
3620 | disc->receive_buf(tty, char_buf, flag_buf, count); | 3655 | disc->receive_buf(tty, char_buf, flag_buf, count); |
3621 | spin_lock_irqsave(&tty->buf.lock, flags); | 3656 | spin_lock_irqsave(&tty->buf.lock, flags); |
3622 | } | 3657 | } |
3658 | /* Restore the queue head */ | ||
3623 | tty->buf.head = head; | 3659 | tty->buf.head = head; |
3624 | } | 3660 | } |
3661 | /* We may have a deferred request to flush the input buffer, | ||
3662 | if so pull the chain under the lock and empty the queue */ | ||
3663 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) { | ||
3664 | __tty_buffer_flush(tty); | ||
3665 | clear_bit(TTY_FLUSHPENDING, &tty->flags); | ||
3666 | wake_up(&tty->read_wait); | ||
3667 | } | ||
3668 | clear_bit(TTY_FLUSHING, &tty->flags); | ||
3625 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 3669 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
3626 | 3670 | ||
3627 | tty_ldisc_deref(disc); | 3671 | tty_ldisc_deref(disc); |
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 84ebfcc1ffb4..c0fc4aeb8596 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
@@ -2,6 +2,11 @@ | |||
2 | menuconfig CRYPTO_HW | 2 | menuconfig CRYPTO_HW |
3 | bool "Hardware crypto devices" | 3 | bool "Hardware crypto devices" |
4 | default y | 4 | default y |
5 | ---help--- | ||
6 | Say Y here to get to see options for hardware crypto devices and | ||
7 | processors. This option alone does not add any kernel code. | ||
8 | |||
9 | If you say N, all options in this submenu will be skipped and disabled. | ||
5 | 10 | ||
6 | if CRYPTO_HW | 11 | if CRYPTO_HW |
7 | 12 | ||
diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c index 5fbe56b5cea0..2d1f17865b64 100644 --- a/drivers/dma/ioatdma.c +++ b/drivers/dma/ioatdma.c | |||
@@ -347,8 +347,7 @@ ioat_dma_prep_memcpy(struct dma_chan *chan, size_t len, int int_en) | |||
347 | new->async_tx.ack = 0; /* client is in control of this ack */ | 347 | new->async_tx.ack = 0; /* client is in control of this ack */ |
348 | new->async_tx.cookie = -EBUSY; | 348 | new->async_tx.cookie = -EBUSY; |
349 | 349 | ||
350 | pci_unmap_len_set(new, src_len, orig_len); | 350 | pci_unmap_len_set(new, len, orig_len); |
351 | pci_unmap_len_set(new, dst_len, orig_len); | ||
352 | spin_unlock_bh(&ioat_chan->desc_lock); | 351 | spin_unlock_bh(&ioat_chan->desc_lock); |
353 | 352 | ||
354 | return new ? &new->async_tx : NULL; | 353 | return new ? &new->async_tx : NULL; |
@@ -423,11 +422,11 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *chan) | |||
423 | */ | 422 | */ |
424 | pci_unmap_page(chan->device->pdev, | 423 | pci_unmap_page(chan->device->pdev, |
425 | pci_unmap_addr(desc, dst), | 424 | pci_unmap_addr(desc, dst), |
426 | pci_unmap_len(desc, dst_len), | 425 | pci_unmap_len(desc, len), |
427 | PCI_DMA_FROMDEVICE); | 426 | PCI_DMA_FROMDEVICE); |
428 | pci_unmap_page(chan->device->pdev, | 427 | pci_unmap_page(chan->device->pdev, |
429 | pci_unmap_addr(desc, src), | 428 | pci_unmap_addr(desc, src), |
430 | pci_unmap_len(desc, src_len), | 429 | pci_unmap_len(desc, len), |
431 | PCI_DMA_TODEVICE); | 430 | PCI_DMA_TODEVICE); |
432 | } | 431 | } |
433 | 432 | ||
diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h index d3726478031a..bf4dad70e0f5 100644 --- a/drivers/dma/ioatdma.h +++ b/drivers/dma/ioatdma.h | |||
@@ -111,10 +111,9 @@ struct ioat_desc_sw { | |||
111 | struct ioat_dma_descriptor *hw; | 111 | struct ioat_dma_descriptor *hw; |
112 | struct list_head node; | 112 | struct list_head node; |
113 | int tx_cnt; | 113 | int tx_cnt; |
114 | DECLARE_PCI_UNMAP_LEN(len) | ||
114 | DECLARE_PCI_UNMAP_ADDR(src) | 115 | DECLARE_PCI_UNMAP_ADDR(src) |
115 | DECLARE_PCI_UNMAP_LEN(src_len) | ||
116 | DECLARE_PCI_UNMAP_ADDR(dst) | 116 | DECLARE_PCI_UNMAP_ADDR(dst) |
117 | DECLARE_PCI_UNMAP_LEN(dst_len) | ||
118 | struct dma_async_tx_descriptor async_tx; | 117 | struct dma_async_tx_descriptor async_tx; |
119 | }; | 118 | }; |
120 | 119 | ||
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 3b63b0b78122..19667fcc722a 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -5,6 +5,11 @@ menuconfig HID_SUPPORT | |||
5 | bool "HID Devices" | 5 | bool "HID Devices" |
6 | depends on INPUT | 6 | depends on INPUT |
7 | default y | 7 | default y |
8 | ---help--- | ||
9 | Say Y here to get to see options for various computer-human interface | ||
10 | device drivers. This option alone does not add any kernel code. | ||
11 | |||
12 | If you say N, all options in this submenu will be skipped and disabled. | ||
8 | 13 | ||
9 | if HID_SUPPORT | 14 | if HID_SUPPORT |
10 | 15 | ||
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c index 338ee4f54614..d3181967f167 100644 --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c | |||
@@ -585,6 +585,8 @@ static int __devinit smsc47m1_probe(struct platform_device *pdev) | |||
585 | 585 | ||
586 | if ((err = device_create_file(dev, &dev_attr_alarms))) | 586 | if ((err = device_create_file(dev, &dev_attr_alarms))) |
587 | goto error_remove_files; | 587 | goto error_remove_files; |
588 | if ((err = device_create_file(dev, &dev_attr_name))) | ||
589 | goto error_remove_files; | ||
588 | 590 | ||
589 | data->class_dev = hwmon_device_register(dev); | 591 | data->class_dev = hwmon_device_register(dev); |
590 | if (IS_ERR(data->class_dev)) { | 592 | if (IS_ERR(data->class_dev)) { |
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index c51ae2e17758..d9a9ec7dd84a 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -309,18 +309,16 @@ static inline int is_word_sized(u16 reg) | |||
309 | || (reg & 0x00ff) == 0x55)); | 309 | || (reg & 0x00ff) == 0x55)); |
310 | } | 310 | } |
311 | 311 | ||
312 | /* We assume that the default bank is 0, thus the following two functions do | 312 | /* Registers 0x50-0x5f are banked */ |
313 | nothing for registers which live in bank 0. For others, they respectively | ||
314 | set the bank register to the correct value (before the register is | ||
315 | accessed), and back to 0 (afterwards). */ | ||
316 | static inline void w83627ehf_set_bank(struct w83627ehf_data *data, u16 reg) | 313 | static inline void w83627ehf_set_bank(struct w83627ehf_data *data, u16 reg) |
317 | { | 314 | { |
318 | if (reg & 0xff00) { | 315 | if ((reg & 0x00f0) == 0x50) { |
319 | outb_p(W83627EHF_REG_BANK, data->addr + ADDR_REG_OFFSET); | 316 | outb_p(W83627EHF_REG_BANK, data->addr + ADDR_REG_OFFSET); |
320 | outb_p(reg >> 8, data->addr + DATA_REG_OFFSET); | 317 | outb_p(reg >> 8, data->addr + DATA_REG_OFFSET); |
321 | } | 318 | } |
322 | } | 319 | } |
323 | 320 | ||
321 | /* Not strictly necessary, but play it safe for now */ | ||
324 | static inline void w83627ehf_reset_bank(struct w83627ehf_data *data, u16 reg) | 322 | static inline void w83627ehf_reset_bank(struct w83627ehf_data *data, u16 reg) |
325 | { | 323 | { |
326 | if (reg & 0xff00) { | 324 | if (reg & 0xff00) { |
@@ -421,6 +419,31 @@ static void w83627ehf_write_fan_div(struct w83627ehf_data *data, int nr) | |||
421 | } | 419 | } |
422 | } | 420 | } |
423 | 421 | ||
422 | static void w83627ehf_update_fan_div(struct w83627ehf_data *data) | ||
423 | { | ||
424 | int i; | ||
425 | |||
426 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1); | ||
427 | data->fan_div[0] = (i >> 4) & 0x03; | ||
428 | data->fan_div[1] = (i >> 6) & 0x03; | ||
429 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV2); | ||
430 | data->fan_div[2] = (i >> 6) & 0x03; | ||
431 | i = w83627ehf_read_value(data, W83627EHF_REG_VBAT); | ||
432 | data->fan_div[0] |= (i >> 3) & 0x04; | ||
433 | data->fan_div[1] |= (i >> 4) & 0x04; | ||
434 | data->fan_div[2] |= (i >> 5) & 0x04; | ||
435 | if (data->has_fan & ((1 << 3) | (1 << 4))) { | ||
436 | i = w83627ehf_read_value(data, W83627EHF_REG_DIODE); | ||
437 | data->fan_div[3] = i & 0x03; | ||
438 | data->fan_div[4] = ((i >> 2) & 0x03) | ||
439 | | ((i >> 5) & 0x04); | ||
440 | } | ||
441 | if (data->has_fan & (1 << 3)) { | ||
442 | i = w83627ehf_read_value(data, W83627EHF_REG_SMI_OVT); | ||
443 | data->fan_div[3] |= (i >> 5) & 0x04; | ||
444 | } | ||
445 | } | ||
446 | |||
424 | static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) | 447 | static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) |
425 | { | 448 | { |
426 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 449 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
@@ -432,25 +455,7 @@ static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) | |||
432 | if (time_after(jiffies, data->last_updated + HZ + HZ/2) | 455 | if (time_after(jiffies, data->last_updated + HZ + HZ/2) |
433 | || !data->valid) { | 456 | || !data->valid) { |
434 | /* Fan clock dividers */ | 457 | /* Fan clock dividers */ |
435 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1); | 458 | w83627ehf_update_fan_div(data); |
436 | data->fan_div[0] = (i >> 4) & 0x03; | ||
437 | data->fan_div[1] = (i >> 6) & 0x03; | ||
438 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV2); | ||
439 | data->fan_div[2] = (i >> 6) & 0x03; | ||
440 | i = w83627ehf_read_value(data, W83627EHF_REG_VBAT); | ||
441 | data->fan_div[0] |= (i >> 3) & 0x04; | ||
442 | data->fan_div[1] |= (i >> 4) & 0x04; | ||
443 | data->fan_div[2] |= (i >> 5) & 0x04; | ||
444 | if (data->has_fan & ((1 << 3) | (1 << 4))) { | ||
445 | i = w83627ehf_read_value(data, W83627EHF_REG_DIODE); | ||
446 | data->fan_div[3] = i & 0x03; | ||
447 | data->fan_div[4] = ((i >> 2) & 0x03) | ||
448 | | ((i >> 5) & 0x04); | ||
449 | } | ||
450 | if (data->has_fan & (1 << 3)) { | ||
451 | i = w83627ehf_read_value(data, W83627EHF_REG_SMI_OVT); | ||
452 | data->fan_div[3] |= (i >> 5) & 0x04; | ||
453 | } | ||
454 | 459 | ||
455 | /* Measured voltages and limits */ | 460 | /* Measured voltages and limits */ |
456 | for (i = 0; i < data->in_num; i++) { | 461 | for (i = 0; i < data->in_num; i++) { |
@@ -1312,6 +1317,9 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
1312 | if (!(i & (1 << 1)) && (!fan5pin)) | 1317 | if (!(i & (1 << 1)) && (!fan5pin)) |
1313 | data->has_fan |= (1 << 4); | 1318 | data->has_fan |= (1 << 4); |
1314 | 1319 | ||
1320 | /* Read fan clock dividers immediately */ | ||
1321 | w83627ehf_update_fan_div(data); | ||
1322 | |||
1315 | /* Register sysfs hooks */ | 1323 | /* Register sysfs hooks */ |
1316 | for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) | 1324 | for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) |
1317 | if ((err = device_create_file(dev, | 1325 | if ((err = device_create_file(dev, |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index f85b48fea1c4..c95909cc1d21 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -740,9 +740,9 @@ store_sensor(struct device *dev, struct device_attribute *da, | |||
740 | static SENSOR_DEVICE_ATTR(temp1_type, S_IRUGO | S_IWUSR, | 740 | static SENSOR_DEVICE_ATTR(temp1_type, S_IRUGO | S_IWUSR, |
741 | show_sensor, store_sensor, 0); | 741 | show_sensor, store_sensor, 0); |
742 | static SENSOR_DEVICE_ATTR(temp2_type, S_IRUGO | S_IWUSR, | 742 | static SENSOR_DEVICE_ATTR(temp2_type, S_IRUGO | S_IWUSR, |
743 | show_sensor, store_sensor, 0); | 743 | show_sensor, store_sensor, 1); |
744 | static SENSOR_DEVICE_ATTR(temp3_type, S_IRUGO | S_IWUSR, | 744 | static SENSOR_DEVICE_ATTR(temp3_type, S_IRUGO | S_IWUSR, |
745 | show_sensor, store_sensor, 0); | 745 | show_sensor, store_sensor, 2); |
746 | 746 | ||
747 | /* I2C devices get this name attribute automatically, but for ISA devices | 747 | /* I2C devices get this name attribute automatically, but for ISA devices |
748 | we must create it by ourselves. */ | 748 | we must create it by ourselves. */ |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 8f5c686123b8..289816db52ae 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -272,11 +272,11 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, | |||
272 | /* Make sure the SMBus host is ready to start transmitting */ | 272 | /* Make sure the SMBus host is ready to start transmitting */ |
273 | temp = inb_p(SMBHSTSTS); | 273 | temp = inb_p(SMBHSTSTS); |
274 | if (i == 1) { | 274 | if (i == 1) { |
275 | /* Erronenous conditions before transaction: | 275 | /* Erroneous conditions before transaction: |
276 | * Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */ | 276 | * Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */ |
277 | errmask = 0x9f; | 277 | errmask = 0x9f; |
278 | } else { | 278 | } else { |
279 | /* Erronenous conditions during transaction: | 279 | /* Erroneous conditions during transaction: |
280 | * Failed, Bus_Err, Dev_Err, Intr */ | 280 | * Failed, Bus_Err, Dev_Err, Intr */ |
281 | errmask = 0x1e; | 281 | errmask = 0x1e; |
282 | } | 282 | } |
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index 440342bc62e1..ace644e21b14 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c | |||
@@ -490,6 +490,7 @@ iop3xx_i2c_probe(struct platform_device *pdev) | |||
490 | memcpy(new_adapter->name, pdev->name, strlen(pdev->name)); | 490 | memcpy(new_adapter->name, pdev->name, strlen(pdev->name)); |
491 | new_adapter->id = I2C_HW_IOP3XX; | 491 | new_adapter->id = I2C_HW_IOP3XX; |
492 | new_adapter->owner = THIS_MODULE; | 492 | new_adapter->owner = THIS_MODULE; |
493 | new_adapter->class = I2C_CLASS_HWMON; | ||
493 | new_adapter->dev.parent = &pdev->dev; | 494 | new_adapter->dev.parent = &pdev->dev; |
494 | new_adapter->nr = pdev->id; | 495 | new_adapter->nr = pdev->id; |
495 | 496 | ||
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 851c3ed513d0..d8de4ac88b7d 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -105,6 +105,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing) | |||
105 | schedule(); | 105 | schedule(); |
106 | if (time_after(jiffies, orig_jiffies + timeout)) { | 106 | if (time_after(jiffies, orig_jiffies + timeout)) { |
107 | pr_debug("I2C: timeout\n"); | 107 | pr_debug("I2C: timeout\n"); |
108 | writeccr(i2c, 0); | ||
108 | result = -EIO; | 109 | result = -EIO; |
109 | break; | 110 | break; |
110 | } | 111 | } |
@@ -116,10 +117,12 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing) | |||
116 | result = wait_event_interruptible_timeout(i2c->queue, | 117 | result = wait_event_interruptible_timeout(i2c->queue, |
117 | (i2c->interrupt & CSR_MIF), timeout * HZ); | 118 | (i2c->interrupt & CSR_MIF), timeout * HZ); |
118 | 119 | ||
119 | if (unlikely(result < 0)) | 120 | if (unlikely(result < 0)) { |
120 | pr_debug("I2C: wait interrupted\n"); | 121 | pr_debug("I2C: wait interrupted\n"); |
121 | else if (unlikely(!(i2c->interrupt & CSR_MIF))) { | 122 | writeccr(i2c, 0); |
123 | } else if (unlikely(!(i2c->interrupt & CSR_MIF))) { | ||
122 | pr_debug("I2C: wait timeout\n"); | 124 | pr_debug("I2C: wait timeout\n"); |
125 | writeccr(i2c, 0); | ||
123 | result = -ETIMEDOUT; | 126 | result = -ETIMEDOUT; |
124 | } | 127 | } |
125 | 128 | ||
@@ -172,7 +175,6 @@ static void mpc_i2c_start(struct mpc_i2c *i2c) | |||
172 | static void mpc_i2c_stop(struct mpc_i2c *i2c) | 175 | static void mpc_i2c_stop(struct mpc_i2c *i2c) |
173 | { | 176 | { |
174 | writeccr(i2c, CCR_MEN); | 177 | writeccr(i2c, CCR_MEN); |
175 | writeccr(i2c, 0); | ||
176 | } | 178 | } |
177 | 179 | ||
178 | static int mpc_write(struct mpc_i2c *i2c, int target, | 180 | static int mpc_write(struct mpc_i2c *i2c, int target, |
@@ -261,6 +263,7 @@ static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) | |||
261 | while (readb(i2c->base + MPC_I2C_SR) & CSR_MBB) { | 263 | while (readb(i2c->base + MPC_I2C_SR) & CSR_MBB) { |
262 | if (signal_pending(current)) { | 264 | if (signal_pending(current)) { |
263 | pr_debug("I2C: Interrupted\n"); | 265 | pr_debug("I2C: Interrupted\n"); |
266 | writeccr(i2c, 0); | ||
264 | return -EINTR; | 267 | return -EINTR; |
265 | } | 268 | } |
266 | if (time_after(jiffies, orig_jiffies + HZ)) { | 269 | if (time_after(jiffies, orig_jiffies + HZ)) { |
@@ -362,7 +365,7 @@ static int fsl_i2c_probe(struct platform_device *pdev) | |||
362 | 365 | ||
363 | fail_add: | 366 | fail_add: |
364 | if (i2c->irq != 0) | 367 | if (i2c->irq != 0) |
365 | free_irq(i2c->irq, NULL); | 368 | free_irq(i2c->irq, i2c); |
366 | fail_irq: | 369 | fail_irq: |
367 | iounmap(i2c->base); | 370 | iounmap(i2c->base); |
368 | fail_map: | 371 | fail_map: |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 251154ae5d97..bb7bf68a7fb6 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -107,6 +107,21 @@ struct mv64xxx_i2c_data { | |||
107 | * | 107 | * |
108 | ***************************************************************************** | 108 | ***************************************************************************** |
109 | */ | 109 | */ |
110 | |||
111 | /* Reset hardware and initialize FSM */ | ||
112 | static void | ||
113 | mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data) | ||
114 | { | ||
115 | writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SOFT_RESET); | ||
116 | writel((((drv_data->freq_m & 0xf) << 3) | (drv_data->freq_n & 0x7)), | ||
117 | drv_data->reg_base + MV64XXX_I2C_REG_BAUD); | ||
118 | writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SLAVE_ADDR); | ||
119 | writel(0, drv_data->reg_base + MV64XXX_I2C_REG_EXT_SLAVE_ADDR); | ||
120 | writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP, | ||
121 | drv_data->reg_base + MV64XXX_I2C_REG_CONTROL); | ||
122 | drv_data->state = MV64XXX_I2C_STATE_IDLE; | ||
123 | } | ||
124 | |||
110 | static void | 125 | static void |
111 | mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) | 126 | mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) |
112 | { | 127 | { |
@@ -203,7 +218,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) | |||
203 | drv_data->state, status, drv_data->msg->addr, | 218 | drv_data->state, status, drv_data->msg->addr, |
204 | drv_data->msg->flags); | 219 | drv_data->msg->flags); |
205 | drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; | 220 | drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; |
206 | drv_data->state = MV64XXX_I2C_STATE_IDLE; | 221 | mv64xxx_i2c_hw_init(drv_data); |
207 | drv_data->rc = -EIO; | 222 | drv_data->rc = -EIO; |
208 | } | 223 | } |
209 | } | 224 | } |
@@ -367,6 +382,7 @@ mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data) | |||
367 | "mv64xxx: I2C bus locked, block: %d, " | 382 | "mv64xxx: I2C bus locked, block: %d, " |
368 | "time_left: %d\n", drv_data->block, | 383 | "time_left: %d\n", drv_data->block, |
369 | (int)time_left); | 384 | (int)time_left); |
385 | mv64xxx_i2c_hw_init(drv_data); | ||
370 | } | 386 | } |
371 | } else | 387 | } else |
372 | spin_unlock_irqrestore(&drv_data->lock, flags); | 388 | spin_unlock_irqrestore(&drv_data->lock, flags); |
@@ -443,19 +459,6 @@ static const struct i2c_algorithm mv64xxx_i2c_algo = { | |||
443 | * | 459 | * |
444 | ***************************************************************************** | 460 | ***************************************************************************** |
445 | */ | 461 | */ |
446 | static void __devinit | ||
447 | mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data) | ||
448 | { | ||
449 | writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SOFT_RESET); | ||
450 | writel((((drv_data->freq_m & 0xf) << 3) | (drv_data->freq_n & 0x7)), | ||
451 | drv_data->reg_base + MV64XXX_I2C_REG_BAUD); | ||
452 | writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SLAVE_ADDR); | ||
453 | writel(0, drv_data->reg_base + MV64XXX_I2C_REG_EXT_SLAVE_ADDR); | ||
454 | writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP, | ||
455 | drv_data->reg_base + MV64XXX_I2C_REG_CONTROL); | ||
456 | drv_data->state = MV64XXX_I2C_STATE_IDLE; | ||
457 | } | ||
458 | |||
459 | static int __devinit | 462 | static int __devinit |
460 | mv64xxx_i2c_map_regs(struct platform_device *pd, | 463 | mv64xxx_i2c_map_regs(struct platform_device *pd, |
461 | struct mv64xxx_i2c_data *drv_data) | 464 | struct mv64xxx_i2c_data *drv_data) |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index e4540fcf6476..c44ada5f4292 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -39,8 +39,8 @@ | |||
39 | #include <asm/io.h> | 39 | #include <asm/io.h> |
40 | 40 | ||
41 | #include <asm/arch/regs-gpio.h> | 41 | #include <asm/arch/regs-gpio.h> |
42 | #include <asm/arch/regs-iic.h> | 42 | #include <asm/plat-s3c/regs-iic.h> |
43 | #include <asm/arch/iic.h> | 43 | #include <asm/plat-s3c/iic.h> |
44 | 44 | ||
45 | /* i2c controller state */ | 45 | /* i2c controller state */ |
46 | 46 | ||
diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c index 9fafadb92510..fe04e46991aa 100644 --- a/drivers/i2c/chips/isp1301_omap.c +++ b/drivers/i2c/chips/isp1301_omap.c | |||
@@ -18,8 +18,6 @@ | |||
18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | */ | 20 | */ |
21 | #undef DEBUG | ||
22 | #undef VERBOSE | ||
23 | 21 | ||
24 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 23 | #include <linux/module.h> |
@@ -44,7 +42,7 @@ | |||
44 | 42 | ||
45 | 43 | ||
46 | #define DRIVER_VERSION "24 August 2004" | 44 | #define DRIVER_VERSION "24 August 2004" |
47 | #define DRIVER_NAME (isp1301_driver.name) | 45 | #define DRIVER_NAME (isp1301_driver.driver.name) |
48 | 46 | ||
49 | MODULE_DESCRIPTION("ISP1301 USB OTG Transceiver Driver"); | 47 | MODULE_DESCRIPTION("ISP1301 USB OTG Transceiver Driver"); |
50 | MODULE_LICENSE("GPL"); | 48 | MODULE_LICENSE("GPL"); |
@@ -55,6 +53,7 @@ struct isp1301 { | |||
55 | void (*i2c_release)(struct device *dev); | 53 | void (*i2c_release)(struct device *dev); |
56 | 54 | ||
57 | int irq; | 55 | int irq; |
56 | int irq_type; | ||
58 | 57 | ||
59 | u32 last_otg_ctrl; | 58 | u32 last_otg_ctrl; |
60 | unsigned working:1; | 59 | unsigned working:1; |
@@ -63,7 +62,7 @@ struct isp1301 { | |||
63 | 62 | ||
64 | /* use keventd context to change the state for us */ | 63 | /* use keventd context to change the state for us */ |
65 | struct work_struct work; | 64 | struct work_struct work; |
66 | 65 | ||
67 | unsigned long todo; | 66 | unsigned long todo; |
68 | # define WORK_UPDATE_ISP 0 /* update ISP from OTG */ | 67 | # define WORK_UPDATE_ISP 0 /* update ISP from OTG */ |
69 | # define WORK_UPDATE_OTG 1 /* update OTG from ISP */ | 68 | # define WORK_UPDATE_OTG 1 /* update OTG from ISP */ |
@@ -94,7 +93,7 @@ struct isp1301 { | |||
94 | 93 | ||
95 | /* board-specific PM hooks */ | 94 | /* board-specific PM hooks */ |
96 | 95 | ||
97 | #include <asm/arch/gpio.h> | 96 | #include <asm/gpio.h> |
98 | #include <asm/arch/mux.h> | 97 | #include <asm/arch/mux.h> |
99 | #include <asm/mach-types.h> | 98 | #include <asm/mach-types.h> |
100 | 99 | ||
@@ -291,7 +290,7 @@ static void power_up(struct isp1301 *isp) | |||
291 | { | 290 | { |
292 | // isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_2, MC2_GLOBAL_PWR_DN); | 291 | // isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_2, MC2_GLOBAL_PWR_DN); |
293 | isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_1, MC1_SUSPEND_REG); | 292 | isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_1, MC1_SUSPEND_REG); |
294 | 293 | ||
295 | /* do this only when cpu is driving transceiver, | 294 | /* do this only when cpu is driving transceiver, |
296 | * so host won't see a low speed device... | 295 | * so host won't see a low speed device... |
297 | */ | 296 | */ |
@@ -799,7 +798,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp) | |||
799 | /* role is host */ | 798 | /* role is host */ |
800 | } else { | 799 | } else { |
801 | if (!(otg_ctrl & OTG_ID)) { | 800 | if (!(otg_ctrl & OTG_ID)) { |
802 | otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS; | 801 | otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS; |
803 | OTG_CTRL_REG = otg_ctrl | OTG_A_BUSREQ; | 802 | OTG_CTRL_REG = otg_ctrl | OTG_A_BUSREQ; |
804 | } | 803 | } |
805 | 804 | ||
@@ -1100,9 +1099,9 @@ static u8 isp1301_clear_latch(struct isp1301 *isp) | |||
1100 | } | 1099 | } |
1101 | 1100 | ||
1102 | static void | 1101 | static void |
1103 | isp1301_work(void *data) | 1102 | isp1301_work(struct work_struct *work) |
1104 | { | 1103 | { |
1105 | struct isp1301 *isp = data; | 1104 | struct isp1301 *isp = container_of(work, struct isp1301, work); |
1106 | int stop; | 1105 | int stop; |
1107 | 1106 | ||
1108 | /* implicit lock: we're the only task using this device */ | 1107 | /* implicit lock: we're the only task using this device */ |
@@ -1244,7 +1243,7 @@ static int isp1301_detach_client(struct i2c_client *i2c) | |||
1244 | * - DEVICE mode, for when there's a B/Mini-B (device) connector | 1243 | * - DEVICE mode, for when there's a B/Mini-B (device) connector |
1245 | * | 1244 | * |
1246 | * As a rule, you won't have an isp1301 chip unless it's there to | 1245 | * As a rule, you won't have an isp1301 chip unless it's there to |
1247 | * support the OTG mode. Other modes help testing USB controllers | 1246 | * support the OTG mode. Other modes help testing USB controllers |
1248 | * in isolation from (full) OTG support, or maybe so later board | 1247 | * in isolation from (full) OTG support, or maybe so later board |
1249 | * revisions can help to support those feature. | 1248 | * revisions can help to support those feature. |
1250 | */ | 1249 | */ |
@@ -1260,9 +1259,9 @@ static int isp1301_otg_enable(struct isp1301 *isp) | |||
1260 | * a few more interrupts than are strictly needed. | 1259 | * a few more interrupts than are strictly needed. |
1261 | */ | 1260 | */ |
1262 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, | 1261 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, |
1263 | INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND); | 1262 | INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND); |
1264 | isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING, | 1263 | isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING, |
1265 | INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND); | 1264 | INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND); |
1266 | 1265 | ||
1267 | dev_info(&isp->client.dev, "ready for dual-role USB ...\n"); | 1266 | dev_info(&isp->client.dev, "ready for dual-role USB ...\n"); |
1268 | 1267 | ||
@@ -1306,9 +1305,9 @@ isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host) | |||
1306 | 1305 | ||
1307 | dev_info(&isp->client.dev, "A-Host sessions ok\n"); | 1306 | dev_info(&isp->client.dev, "A-Host sessions ok\n"); |
1308 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, | 1307 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, |
1309 | INTR_ID_GND); | 1308 | INTR_ID_GND); |
1310 | isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING, | 1309 | isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING, |
1311 | INTR_ID_GND); | 1310 | INTR_ID_GND); |
1312 | 1311 | ||
1313 | /* If this has a Mini-AB connector, this mode is highly | 1312 | /* If this has a Mini-AB connector, this mode is highly |
1314 | * nonstandard ... but can be handy for testing, especially with | 1313 | * nonstandard ... but can be handy for testing, especially with |
@@ -1368,9 +1367,9 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget) | |||
1368 | isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0); | 1367 | isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0); |
1369 | 1368 | ||
1370 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, | 1369 | isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING, |
1371 | INTR_SESS_VLD); | 1370 | INTR_SESS_VLD); |
1372 | isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING, | 1371 | isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING, |
1373 | INTR_VBUS_VLD); | 1372 | INTR_VBUS_VLD); |
1374 | dev_info(&isp->client.dev, "B-Peripheral sessions ok\n"); | 1373 | dev_info(&isp->client.dev, "B-Peripheral sessions ok\n"); |
1375 | dump_regs(isp, __FUNCTION__); | 1374 | dump_regs(isp, __FUNCTION__); |
1376 | 1375 | ||
@@ -1494,7 +1493,7 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind) | |||
1494 | if (!isp) | 1493 | if (!isp) |
1495 | return 0; | 1494 | return 0; |
1496 | 1495 | ||
1497 | INIT_WORK(&isp->work, isp1301_work, isp); | 1496 | INIT_WORK(&isp->work, isp1301_work); |
1498 | init_timer(&isp->timer); | 1497 | init_timer(&isp->timer); |
1499 | isp->timer.function = isp1301_timer; | 1498 | isp->timer.function = isp1301_timer; |
1500 | isp->timer.data = (unsigned long) isp; | 1499 | isp->timer.data = (unsigned long) isp; |
@@ -1572,13 +1571,14 @@ fail1: | |||
1572 | /* IRQ wired at M14 */ | 1571 | /* IRQ wired at M14 */ |
1573 | omap_cfg_reg(M14_1510_GPIO2); | 1572 | omap_cfg_reg(M14_1510_GPIO2); |
1574 | isp->irq = OMAP_GPIO_IRQ(2); | 1573 | isp->irq = OMAP_GPIO_IRQ(2); |
1575 | omap_request_gpio(2); | 1574 | if (gpio_request(2, "isp1301") == 0) |
1576 | omap_set_gpio_direction(2, 1); | 1575 | gpio_direction_input(2); |
1577 | omap_set_gpio_edge_ctrl(2, OMAP_GPIO_FALLING_EDGE); | 1576 | isp->irq_type = IRQF_TRIGGER_FALLING; |
1578 | } | 1577 | } |
1579 | 1578 | ||
1579 | isp->irq_type |= IRQF_SAMPLE_RANDOM; | ||
1580 | status = request_irq(isp->irq, isp1301_irq, | 1580 | status = request_irq(isp->irq, isp1301_irq, |
1581 | IRQF_SAMPLE_RANDOM, DRIVER_NAME, isp); | 1581 | isp->irq_type, DRIVER_NAME, isp); |
1582 | if (status < 0) { | 1582 | if (status < 0) { |
1583 | dev_dbg(&i2c->dev, "can't get IRQ %d, err %d\n", | 1583 | dev_dbg(&i2c->dev, "can't get IRQ %d, err %d\n", |
1584 | isp->irq, status); | 1584 | isp->irq, status); |
diff --git a/drivers/i2c/chips/menelaus.c b/drivers/i2c/chips/menelaus.c index 48a7e2f0bdd3..d9c92c5e0077 100644 --- a/drivers/i2c/chips/menelaus.c +++ b/drivers/i2c/chips/menelaus.c | |||
@@ -1,4 +1,3 @@ | |||
1 | #define DEBUG | ||
2 | /* | 1 | /* |
3 | * Copyright (C) 2004 Texas Instruments, Inc. | 2 | * Copyright (C) 2004 Texas Instruments, Inc. |
4 | * | 3 | * |
@@ -933,7 +932,7 @@ static int menelaus_set_time(struct device *dev, struct rtc_time *t) | |||
933 | return status; | 932 | return status; |
934 | status = menelaus_write_reg(MENELAUS_RTC_WKDAY, BIN2BCD(t->tm_wday)); | 933 | status = menelaus_write_reg(MENELAUS_RTC_WKDAY, BIN2BCD(t->tm_wday)); |
935 | if (status < 0) { | 934 | if (status < 0) { |
936 | dev_err(&the_menelaus->client->dev, "rtc write reg %02x", | 935 | dev_err(&the_menelaus->client->dev, "rtc write reg %02x " |
937 | "err %d\n", MENELAUS_RTC_WKDAY, status); | 936 | "err %d\n", MENELAUS_RTC_WKDAY, status); |
938 | return status; | 937 | return status; |
939 | } | 938 | } |
diff --git a/drivers/infiniband/core/agent.c b/drivers/infiniband/core/agent.c index db2633e4aae6..ae7c2880e624 100644 --- a/drivers/infiniband/core/agent.c +++ b/drivers/infiniband/core/agent.c | |||
@@ -78,15 +78,14 @@ ib_get_agent_port(struct ib_device *device, int port_num) | |||
78 | return entry; | 78 | return entry; |
79 | } | 79 | } |
80 | 80 | ||
81 | int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | 81 | void agent_send_response(struct ib_mad *mad, struct ib_grh *grh, |
82 | struct ib_wc *wc, struct ib_device *device, | 82 | struct ib_wc *wc, struct ib_device *device, |
83 | int port_num, int qpn) | 83 | int port_num, int qpn) |
84 | { | 84 | { |
85 | struct ib_agent_port_private *port_priv; | 85 | struct ib_agent_port_private *port_priv; |
86 | struct ib_mad_agent *agent; | 86 | struct ib_mad_agent *agent; |
87 | struct ib_mad_send_buf *send_buf; | 87 | struct ib_mad_send_buf *send_buf; |
88 | struct ib_ah *ah; | 88 | struct ib_ah *ah; |
89 | int ret; | ||
90 | struct ib_mad_send_wr_private *mad_send_wr; | 89 | struct ib_mad_send_wr_private *mad_send_wr; |
91 | 90 | ||
92 | if (device->node_type == RDMA_NODE_IB_SWITCH) | 91 | if (device->node_type == RDMA_NODE_IB_SWITCH) |
@@ -96,23 +95,21 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | |||
96 | 95 | ||
97 | if (!port_priv) { | 96 | if (!port_priv) { |
98 | printk(KERN_ERR SPFX "Unable to find port agent\n"); | 97 | printk(KERN_ERR SPFX "Unable to find port agent\n"); |
99 | return -ENODEV; | 98 | return; |
100 | } | 99 | } |
101 | 100 | ||
102 | agent = port_priv->agent[qpn]; | 101 | agent = port_priv->agent[qpn]; |
103 | ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num); | 102 | ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num); |
104 | if (IS_ERR(ah)) { | 103 | if (IS_ERR(ah)) { |
105 | ret = PTR_ERR(ah); | 104 | printk(KERN_ERR SPFX "ib_create_ah_from_wc error\n"); |
106 | printk(KERN_ERR SPFX "ib_create_ah_from_wc error:%d\n", ret); | 105 | return; |
107 | return ret; | ||
108 | } | 106 | } |
109 | 107 | ||
110 | send_buf = ib_create_send_mad(agent, wc->src_qp, wc->pkey_index, 0, | 108 | send_buf = ib_create_send_mad(agent, wc->src_qp, wc->pkey_index, 0, |
111 | IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA, | 109 | IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA, |
112 | GFP_KERNEL); | 110 | GFP_KERNEL); |
113 | if (IS_ERR(send_buf)) { | 111 | if (IS_ERR(send_buf)) { |
114 | ret = PTR_ERR(send_buf); | 112 | printk(KERN_ERR SPFX "ib_create_send_mad error\n"); |
115 | printk(KERN_ERR SPFX "ib_create_send_mad error:%d\n", ret); | ||
116 | goto err1; | 113 | goto err1; |
117 | } | 114 | } |
118 | 115 | ||
@@ -126,16 +123,15 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | |||
126 | mad_send_wr->send_wr.wr.ud.port_num = port_num; | 123 | mad_send_wr->send_wr.wr.ud.port_num = port_num; |
127 | } | 124 | } |
128 | 125 | ||
129 | if ((ret = ib_post_send_mad(send_buf, NULL))) { | 126 | if (ib_post_send_mad(send_buf, NULL)) { |
130 | printk(KERN_ERR SPFX "ib_post_send_mad error:%d\n", ret); | 127 | printk(KERN_ERR SPFX "ib_post_send_mad error\n"); |
131 | goto err2; | 128 | goto err2; |
132 | } | 129 | } |
133 | return 0; | 130 | return; |
134 | err2: | 131 | err2: |
135 | ib_free_send_mad(send_buf); | 132 | ib_free_send_mad(send_buf); |
136 | err1: | 133 | err1: |
137 | ib_destroy_ah(ah); | 134 | ib_destroy_ah(ah); |
138 | return ret; | ||
139 | } | 135 | } |
140 | 136 | ||
141 | static void agent_send_handler(struct ib_mad_agent *mad_agent, | 137 | static void agent_send_handler(struct ib_mad_agent *mad_agent, |
diff --git a/drivers/infiniband/core/agent.h b/drivers/infiniband/core/agent.h index 86d72fab37b0..fb9ed1489f95 100644 --- a/drivers/infiniband/core/agent.h +++ b/drivers/infiniband/core/agent.h | |||
@@ -46,8 +46,8 @@ extern int ib_agent_port_open(struct ib_device *device, int port_num); | |||
46 | 46 | ||
47 | extern int ib_agent_port_close(struct ib_device *device, int port_num); | 47 | extern int ib_agent_port_close(struct ib_device *device, int port_num); |
48 | 48 | ||
49 | extern int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | 49 | extern void agent_send_response(struct ib_mad *mad, struct ib_grh *grh, |
50 | struct ib_wc *wc, struct ib_device *device, | 50 | struct ib_wc *wc, struct ib_device *device, |
51 | int port_num, int qpn); | 51 | int port_num, int qpn); |
52 | 52 | ||
53 | #endif /* __AGENT_H_ */ | 53 | #endif /* __AGENT_H_ */ |
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 3ada17c0f239..2506c43ba041 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
@@ -702,7 +702,7 @@ int ib_find_pkey(struct ib_device *device, | |||
702 | if (ret) | 702 | if (ret) |
703 | return ret; | 703 | return ret; |
704 | 704 | ||
705 | if (pkey == tmp_pkey) { | 705 | if ((pkey & 0x7fff) == (tmp_pkey & 0x7fff)) { |
706 | *index = i; | 706 | *index = i; |
707 | return 0; | 707 | return 0; |
708 | } | 708 | } |
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index bc547f1d34ba..6f4287716ab1 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
@@ -1842,16 +1842,11 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, | |||
1842 | { | 1842 | { |
1843 | struct ib_mad_qp_info *qp_info; | 1843 | struct ib_mad_qp_info *qp_info; |
1844 | struct ib_mad_private_header *mad_priv_hdr; | 1844 | struct ib_mad_private_header *mad_priv_hdr; |
1845 | struct ib_mad_private *recv, *response; | 1845 | struct ib_mad_private *recv, *response = NULL; |
1846 | struct ib_mad_list_head *mad_list; | 1846 | struct ib_mad_list_head *mad_list; |
1847 | struct ib_mad_agent_private *mad_agent; | 1847 | struct ib_mad_agent_private *mad_agent; |
1848 | int port_num; | 1848 | int port_num; |
1849 | 1849 | ||
1850 | response = kmem_cache_alloc(ib_mad_cache, GFP_KERNEL); | ||
1851 | if (!response) | ||
1852 | printk(KERN_ERR PFX "ib_mad_recv_done_handler no memory " | ||
1853 | "for response buffer\n"); | ||
1854 | |||
1855 | mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id; | 1850 | mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id; |
1856 | qp_info = mad_list->mad_queue->qp_info; | 1851 | qp_info = mad_list->mad_queue->qp_info; |
1857 | dequeue_mad(mad_list); | 1852 | dequeue_mad(mad_list); |
@@ -1879,6 +1874,13 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, | |||
1879 | if (!validate_mad(&recv->mad.mad, qp_info->qp->qp_num)) | 1874 | if (!validate_mad(&recv->mad.mad, qp_info->qp->qp_num)) |
1880 | goto out; | 1875 | goto out; |
1881 | 1876 | ||
1877 | response = kmem_cache_alloc(ib_mad_cache, GFP_KERNEL); | ||
1878 | if (!response) { | ||
1879 | printk(KERN_ERR PFX "ib_mad_recv_done_handler no memory " | ||
1880 | "for response buffer\n"); | ||
1881 | goto out; | ||
1882 | } | ||
1883 | |||
1882 | if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH) | 1884 | if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH) |
1883 | port_num = wc->port_num; | 1885 | port_num = wc->port_num; |
1884 | else | 1886 | else |
@@ -1914,12 +1916,11 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, | |||
1914 | response->header.recv_wc.recv_buf.mad = &response->mad.mad; | 1916 | response->header.recv_wc.recv_buf.mad = &response->mad.mad; |
1915 | response->header.recv_wc.recv_buf.grh = &response->grh; | 1917 | response->header.recv_wc.recv_buf.grh = &response->grh; |
1916 | 1918 | ||
1917 | if (!agent_send_response(&response->mad.mad, | 1919 | agent_send_response(&response->mad.mad, |
1918 | &response->grh, wc, | 1920 | &response->grh, wc, |
1919 | port_priv->device, | 1921 | port_priv->device, |
1920 | smi_get_fwd_port(&recv->mad.smp), | 1922 | smi_get_fwd_port(&recv->mad.smp), |
1921 | qp_info->qp->qp_num)) | 1923 | qp_info->qp->qp_num); |
1922 | response = NULL; | ||
1923 | 1924 | ||
1924 | goto out; | 1925 | goto out; |
1925 | } | 1926 | } |
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index 3663fd7022be..d43bc62005b3 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c | |||
@@ -163,8 +163,10 @@ static struct ib_mad_send_buf *alloc_response_msg(struct ib_mad_agent *agent, | |||
163 | hdr_len, 0, GFP_KERNEL); | 163 | hdr_len, 0, GFP_KERNEL); |
164 | if (IS_ERR(msg)) | 164 | if (IS_ERR(msg)) |
165 | ib_destroy_ah(ah); | 165 | ib_destroy_ah(ah); |
166 | else | 166 | else { |
167 | msg->ah = ah; | 167 | msg->ah = ah; |
168 | msg->context[0] = ah; | ||
169 | } | ||
168 | 170 | ||
169 | return msg; | 171 | return msg; |
170 | } | 172 | } |
@@ -197,9 +199,7 @@ static void ack_ds_ack(struct ib_mad_agent_private *agent, | |||
197 | 199 | ||
198 | void ib_rmpp_send_handler(struct ib_mad_send_wc *mad_send_wc) | 200 | void ib_rmpp_send_handler(struct ib_mad_send_wc *mad_send_wc) |
199 | { | 201 | { |
200 | struct ib_rmpp_mad *rmpp_mad = mad_send_wc->send_buf->mad; | 202 | if (mad_send_wc->send_buf->context[0] == mad_send_wc->send_buf->ah) |
201 | |||
202 | if (rmpp_mad->rmpp_hdr.rmpp_type != IB_MGMT_RMPP_TYPE_ACK) | ||
203 | ib_destroy_ah(mad_send_wc->send_buf->ah); | 203 | ib_destroy_ah(mad_send_wc->send_buf->ah); |
204 | ib_free_send_mad(mad_send_wc->send_buf); | 204 | ib_free_send_mad(mad_send_wc->send_buf); |
205 | } | 205 | } |
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 20ab6b3e484d..d271bd715c12 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c | |||
@@ -385,9 +385,7 @@ static void update_sm_ah(struct work_struct *work) | |||
385 | 385 | ||
386 | new_ah->pkey_index = 0; | 386 | new_ah->pkey_index = 0; |
387 | if (ib_find_pkey(port->agent->device, port->port_num, | 387 | if (ib_find_pkey(port->agent->device, port->port_num, |
388 | IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index) && | 388 | IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index)) |
389 | ib_find_pkey(port->agent->device, port->port_num, | ||
390 | IB_DEFAULT_PKEY_PARTIAL, &new_ah->pkey_index)) | ||
391 | printk(KERN_ERR "Couldn't find index for default PKey\n"); | 389 | printk(KERN_ERR "Couldn't find index for default PKey\n"); |
392 | 390 | ||
393 | memset(&ah_attr, 0, sizeof ah_attr); | 391 | memset(&ah_attr, 0, sizeof ah_attr); |
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 26d0470eef6e..664d2faa9e74 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c | |||
@@ -40,6 +40,11 @@ | |||
40 | 40 | ||
41 | #include "uverbs.h" | 41 | #include "uverbs.h" |
42 | 42 | ||
43 | #define IB_UMEM_MAX_PAGE_CHUNK \ | ||
44 | ((PAGE_SIZE - offsetof(struct ib_umem_chunk, page_list)) / \ | ||
45 | ((void *) &((struct ib_umem_chunk *) 0)->page_list[1] - \ | ||
46 | (void *) &((struct ib_umem_chunk *) 0)->page_list[0])) | ||
47 | |||
43 | static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int dirty) | 48 | static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int dirty) |
44 | { | 49 | { |
45 | struct ib_umem_chunk *chunk, *tmp; | 50 | struct ib_umem_chunk *chunk, *tmp; |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 9574088f0d4e..1cdfcd43b0bc 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -139,7 +139,7 @@ static void release_tid(struct t3cdev *tdev, u32 hwtid, struct sk_buff *skb) | |||
139 | req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); | 139 | req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); |
140 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid)); | 140 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid)); |
141 | skb->priority = CPL_PRIORITY_SETUP; | 141 | skb->priority = CPL_PRIORITY_SETUP; |
142 | tdev->send(tdev, skb); | 142 | cxgb3_ofld_send(tdev, skb); |
143 | return; | 143 | return; |
144 | } | 144 | } |
145 | 145 | ||
@@ -161,7 +161,7 @@ int iwch_quiesce_tid(struct iwch_ep *ep) | |||
161 | req->val = cpu_to_be64(1 << S_TCB_RX_QUIESCE); | 161 | req->val = cpu_to_be64(1 << S_TCB_RX_QUIESCE); |
162 | 162 | ||
163 | skb->priority = CPL_PRIORITY_DATA; | 163 | skb->priority = CPL_PRIORITY_DATA; |
164 | ep->com.tdev->send(ep->com.tdev, skb); | 164 | cxgb3_ofld_send(ep->com.tdev, skb); |
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
@@ -183,7 +183,7 @@ int iwch_resume_tid(struct iwch_ep *ep) | |||
183 | req->val = 0; | 183 | req->val = 0; |
184 | 184 | ||
185 | skb->priority = CPL_PRIORITY_DATA; | 185 | skb->priority = CPL_PRIORITY_DATA; |
186 | ep->com.tdev->send(ep->com.tdev, skb); | 186 | cxgb3_ofld_send(ep->com.tdev, skb); |
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
@@ -784,7 +784,7 @@ static int update_rx_credits(struct iwch_ep *ep, u32 credits) | |||
784 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RX_DATA_ACK, ep->hwtid)); | 784 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RX_DATA_ACK, ep->hwtid)); |
785 | req->credit_dack = htonl(V_RX_CREDITS(credits) | V_RX_FORCE_ACK(1)); | 785 | req->credit_dack = htonl(V_RX_CREDITS(credits) | V_RX_FORCE_ACK(1)); |
786 | skb->priority = CPL_PRIORITY_ACK; | 786 | skb->priority = CPL_PRIORITY_ACK; |
787 | ep->com.tdev->send(ep->com.tdev, skb); | 787 | cxgb3_ofld_send(ep->com.tdev, skb); |
788 | return credits; | 788 | return credits; |
789 | } | 789 | } |
790 | 790 | ||
@@ -1152,7 +1152,7 @@ static int listen_start(struct iwch_listen_ep *ep) | |||
1152 | req->opt1 = htonl(V_CONN_POLICY(CPL_CONN_POLICY_ASK)); | 1152 | req->opt1 = htonl(V_CONN_POLICY(CPL_CONN_POLICY_ASK)); |
1153 | 1153 | ||
1154 | skb->priority = 1; | 1154 | skb->priority = 1; |
1155 | ep->com.tdev->send(ep->com.tdev, skb); | 1155 | cxgb3_ofld_send(ep->com.tdev, skb); |
1156 | return 0; | 1156 | return 0; |
1157 | } | 1157 | } |
1158 | 1158 | ||
@@ -1186,7 +1186,7 @@ static int listen_stop(struct iwch_listen_ep *ep) | |||
1186 | req->cpu_idx = 0; | 1186 | req->cpu_idx = 0; |
1187 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid)); | 1187 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid)); |
1188 | skb->priority = 1; | 1188 | skb->priority = 1; |
1189 | ep->com.tdev->send(ep->com.tdev, skb); | 1189 | cxgb3_ofld_send(ep->com.tdev, skb); |
1190 | return 0; | 1190 | return 0; |
1191 | } | 1191 | } |
1192 | 1192 | ||
@@ -1264,7 +1264,7 @@ static void reject_cr(struct t3cdev *tdev, u32 hwtid, __be32 peer_ip, | |||
1264 | rpl->opt0l_status = htonl(CPL_PASS_OPEN_REJECT); | 1264 | rpl->opt0l_status = htonl(CPL_PASS_OPEN_REJECT); |
1265 | rpl->opt2 = 0; | 1265 | rpl->opt2 = 0; |
1266 | rpl->rsvd = rpl->opt2; | 1266 | rpl->rsvd = rpl->opt2; |
1267 | tdev->send(tdev, skb); | 1267 | cxgb3_ofld_send(tdev, skb); |
1268 | } | 1268 | } |
1269 | } | 1269 | } |
1270 | 1270 | ||
@@ -1557,7 +1557,7 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1557 | rpl->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); | 1557 | rpl->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); |
1558 | OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, ep->hwtid)); | 1558 | OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, ep->hwtid)); |
1559 | rpl->cmd = CPL_ABORT_NO_RST; | 1559 | rpl->cmd = CPL_ABORT_NO_RST; |
1560 | ep->com.tdev->send(ep->com.tdev, rpl_skb); | 1560 | cxgb3_ofld_send(ep->com.tdev, rpl_skb); |
1561 | if (state != ABORTING) { | 1561 | if (state != ABORTING) { |
1562 | state_set(&ep->com, DEAD); | 1562 | state_set(&ep->com, DEAD); |
1563 | release_ep_resources(ep); | 1563 | release_ep_resources(ep); |
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c index 660b27aecae5..8bf44daf45ec 100644 --- a/drivers/infiniband/hw/mlx4/cq.c +++ b/drivers/infiniband/hw/mlx4/cq.c | |||
@@ -389,7 +389,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq, | |||
389 | wc->opcode = IB_WC_SEND; | 389 | wc->opcode = IB_WC_SEND; |
390 | break; | 390 | break; |
391 | case MLX4_OPCODE_RDMA_READ: | 391 | case MLX4_OPCODE_RDMA_READ: |
392 | wc->opcode = IB_WC_SEND; | 392 | wc->opcode = IB_WC_RDMA_READ; |
393 | wc->byte_len = be32_to_cpu(cqe->byte_cnt); | 393 | wc->byte_len = be32_to_cpu(cqe->byte_cnt); |
394 | break; | 394 | break; |
395 | case MLX4_OPCODE_ATOMIC_CS: | 395 | case MLX4_OPCODE_ATOMIC_CS: |
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 333091787c5f..0ed02b7834da 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c | |||
@@ -109,7 +109,7 @@ int mlx4_MAD_IFC(struct mlx4_ib_dev *dev, int ignore_mkey, int ignore_bkey, | |||
109 | in_modifier, op_modifier, | 109 | in_modifier, op_modifier, |
110 | MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C); | 110 | MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C); |
111 | 111 | ||
112 | if (!err); | 112 | if (!err) |
113 | memcpy(response_mad, outmailbox->buf, 256); | 113 | memcpy(response_mad, outmailbox->buf, 256); |
114 | 114 | ||
115 | mlx4_free_cmd_mailbox(dev->dev, inmailbox); | 115 | mlx4_free_cmd_mailbox(dev->dev, inmailbox); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index 982eb88e27ec..563aeacf9e14 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c | |||
@@ -211,6 +211,7 @@ out_free_cq: | |||
211 | 211 | ||
212 | out_free_mr: | 212 | out_free_mr: |
213 | ib_dereg_mr(priv->mr); | 213 | ib_dereg_mr(priv->mr); |
214 | ipoib_cm_dev_cleanup(dev); | ||
214 | 215 | ||
215 | out_free_pd: | 216 | out_free_pd: |
216 | ib_dealloc_pd(priv->pd); | 217 | ib_dealloc_pd(priv->pd); |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index f01ca182f226..f6a051428144 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -75,16 +75,12 @@ module_param(topspin_workarounds, int, 0444); | |||
75 | MODULE_PARM_DESC(topspin_workarounds, | 75 | MODULE_PARM_DESC(topspin_workarounds, |
76 | "Enable workarounds for Topspin/Cisco SRP target bugs if != 0"); | 76 | "Enable workarounds for Topspin/Cisco SRP target bugs if != 0"); |
77 | 77 | ||
78 | static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad }; | ||
79 | |||
80 | static int mellanox_workarounds = 1; | 78 | static int mellanox_workarounds = 1; |
81 | 79 | ||
82 | module_param(mellanox_workarounds, int, 0444); | 80 | module_param(mellanox_workarounds, int, 0444); |
83 | MODULE_PARM_DESC(mellanox_workarounds, | 81 | MODULE_PARM_DESC(mellanox_workarounds, |
84 | "Enable workarounds for Mellanox SRP target bugs if != 0"); | 82 | "Enable workarounds for Mellanox SRP target bugs if != 0"); |
85 | 83 | ||
86 | static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 }; | ||
87 | |||
88 | static void srp_add_one(struct ib_device *device); | 84 | static void srp_add_one(struct ib_device *device); |
89 | static void srp_remove_one(struct ib_device *device); | 85 | static void srp_remove_one(struct ib_device *device); |
90 | static void srp_completion(struct ib_cq *cq, void *target_ptr); | 86 | static void srp_completion(struct ib_cq *cq, void *target_ptr); |
@@ -108,6 +104,24 @@ static const char *srp_target_info(struct Scsi_Host *host) | |||
108 | return host_to_target(host)->target_name; | 104 | return host_to_target(host)->target_name; |
109 | } | 105 | } |
110 | 106 | ||
107 | static int srp_target_is_topspin(struct srp_target_port *target) | ||
108 | { | ||
109 | static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad }; | ||
110 | static const u8 cisco_oui[3] = { 0x00, 0x1b, 0x0d }; | ||
111 | |||
112 | return topspin_workarounds && | ||
113 | (!memcmp(&target->ioc_guid, topspin_oui, sizeof topspin_oui) || | ||
114 | !memcmp(&target->ioc_guid, cisco_oui, sizeof cisco_oui)); | ||
115 | } | ||
116 | |||
117 | static int srp_target_is_mellanox(struct srp_target_port *target) | ||
118 | { | ||
119 | static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 }; | ||
120 | |||
121 | return mellanox_workarounds && | ||
122 | !memcmp(&target->ioc_guid, mellanox_oui, sizeof mellanox_oui); | ||
123 | } | ||
124 | |||
111 | static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, | 125 | static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, |
112 | gfp_t gfp_mask, | 126 | gfp_t gfp_mask, |
113 | enum dma_data_direction direction) | 127 | enum dma_data_direction direction) |
@@ -360,7 +374,7 @@ static int srp_send_req(struct srp_target_port *target) | |||
360 | * zero out the first 8 bytes of our initiator port ID and set | 374 | * zero out the first 8 bytes of our initiator port ID and set |
361 | * the second 8 bytes to the local node GUID. | 375 | * the second 8 bytes to the local node GUID. |
362 | */ | 376 | */ |
363 | if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) { | 377 | if (srp_target_is_topspin(target)) { |
364 | printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " | 378 | printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " |
365 | "activated for target GUID %016llx\n", | 379 | "activated for target GUID %016llx\n", |
366 | (unsigned long long) be64_to_cpu(target->ioc_guid)); | 380 | (unsigned long long) be64_to_cpu(target->ioc_guid)); |
@@ -585,8 +599,8 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat, | |||
585 | if (!dev->fmr_pool) | 599 | if (!dev->fmr_pool) |
586 | return -ENODEV; | 600 | return -ENODEV; |
587 | 601 | ||
588 | if ((ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask) && | 602 | if (srp_target_is_mellanox(target) && |
589 | mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3)) | 603 | (ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask)) |
590 | return -EINVAL; | 604 | return -EINVAL; |
591 | 605 | ||
592 | len = page_cnt = 0; | 606 | len = page_cnt = 0; |
@@ -1087,8 +1101,7 @@ static void srp_cm_rej_handler(struct ib_cm_id *cm_id, | |||
1087 | break; | 1101 | break; |
1088 | 1102 | ||
1089 | case IB_CM_REJ_PORT_REDIRECT: | 1103 | case IB_CM_REJ_PORT_REDIRECT: |
1090 | if (topspin_workarounds && | 1104 | if (srp_target_is_topspin(target)) { |
1091 | !memcmp(&target->ioc_guid, topspin_oui, 3)) { | ||
1092 | /* | 1105 | /* |
1093 | * Topspin/Cisco SRP gateways incorrectly send | 1106 | * Topspin/Cisco SRP gateways incorrectly send |
1094 | * reject reason code 25 when they mean 24 | 1107 | * reject reason code 25 when they mean 24 |
diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig index 6cecc396e040..7b64fd4aa2f3 100644 --- a/drivers/kvm/Kconfig +++ b/drivers/kvm/Kconfig | |||
@@ -5,6 +5,11 @@ menuconfig VIRTUALIZATION | |||
5 | bool "Virtualization" | 5 | bool "Virtualization" |
6 | depends on X86 | 6 | depends on X86 |
7 | default y | 7 | default y |
8 | ---help--- | ||
9 | Say Y here to get to see options for virtualization guest drivers. | ||
10 | This option alone does not add any kernel code. | ||
11 | |||
12 | If you say N, all options in this submenu will be skipped and disabled. | ||
8 | 13 | ||
9 | if VIRTUALIZATION | 14 | if VIRTUALIZATION |
10 | 15 | ||
diff --git a/drivers/lguest/lguest.c b/drivers/lguest/lguest.c index 524beea7fb19..6e135ac0834f 100644 --- a/drivers/lguest/lguest.c +++ b/drivers/lguest/lguest.c | |||
@@ -936,23 +936,24 @@ static const struct lguest_insns | |||
936 | /* Now our patch routine is fairly simple (based on the native one in | 936 | /* Now our patch routine is fairly simple (based on the native one in |
937 | * paravirt.c). If we have a replacement, we copy it in and return how much of | 937 | * paravirt.c). If we have a replacement, we copy it in and return how much of |
938 | * the available space we used. */ | 938 | * the available space we used. */ |
939 | static unsigned lguest_patch(u8 type, u16 clobber, void *insns, unsigned len) | 939 | static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf, |
940 | unsigned long addr, unsigned len) | ||
940 | { | 941 | { |
941 | unsigned int insn_len; | 942 | unsigned int insn_len; |
942 | 943 | ||
943 | /* Don't do anything special if we don't have a replacement */ | 944 | /* Don't do anything special if we don't have a replacement */ |
944 | if (type >= ARRAY_SIZE(lguest_insns) || !lguest_insns[type].start) | 945 | if (type >= ARRAY_SIZE(lguest_insns) || !lguest_insns[type].start) |
945 | return paravirt_patch_default(type, clobber, insns, len); | 946 | return paravirt_patch_default(type, clobber, ibuf, addr, len); |
946 | 947 | ||
947 | insn_len = lguest_insns[type].end - lguest_insns[type].start; | 948 | insn_len = lguest_insns[type].end - lguest_insns[type].start; |
948 | 949 | ||
949 | /* Similarly if we can't fit replacement (shouldn't happen, but let's | 950 | /* Similarly if we can't fit replacement (shouldn't happen, but let's |
950 | * be thorough). */ | 951 | * be thorough). */ |
951 | if (len < insn_len) | 952 | if (len < insn_len) |
952 | return paravirt_patch_default(type, clobber, insns, len); | 953 | return paravirt_patch_default(type, clobber, ibuf, addr, len); |
953 | 954 | ||
954 | /* Copy in our instructions. */ | 955 | /* Copy in our instructions. */ |
955 | memcpy(insns, lguest_insns[type].start, insn_len); | 956 | memcpy(ibuf, lguest_insns[type].start, insn_len); |
956 | return insn_len; | 957 | return insn_len; |
957 | } | 958 | } |
958 | 959 | ||
diff --git a/drivers/lguest/lguest_bus.c b/drivers/lguest/lguest_bus.c index 55a7940ca732..9e7752cc8002 100644 --- a/drivers/lguest/lguest_bus.c +++ b/drivers/lguest/lguest_bus.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/bootmem.h> | 5 | #include <linux/bootmem.h> |
6 | #include <linux/lguest_bus.h> | 6 | #include <linux/lguest_bus.h> |
7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
8 | #include <asm/paravirt.h> | ||
8 | 9 | ||
9 | static ssize_t type_show(struct device *_dev, | 10 | static ssize_t type_show(struct device *_dev, |
10 | struct device_attribute *attr, char *buf) | 11 | struct device_attribute *attr, char *buf) |
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index dbe96268866e..56cd8998fe4b 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig | |||
@@ -3,6 +3,11 @@ menuconfig MACINTOSH_DRIVERS | |||
3 | bool "Macintosh device drivers" | 3 | bool "Macintosh device drivers" |
4 | depends on PPC || MAC || X86 | 4 | depends on PPC || MAC || X86 |
5 | default y if (PPC_PMAC || MAC) | 5 | default y if (PPC_PMAC || MAC) |
6 | ---help--- | ||
7 | Say Y here to get to see options for devices used with Macintosh | ||
8 | computers. This option alone does not add any kernel code. | ||
9 | |||
10 | If you say N, all options in this submenu will be skipped and disabled. | ||
6 | 11 | ||
7 | if MACINTOSH_DRIVERS | 12 | if MACINTOSH_DRIVERS |
8 | 13 | ||
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 141ff9fa296e..2120155929a6 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -580,8 +580,8 @@ static void __map_bio(struct dm_target *ti, struct bio *clone, | |||
580 | /* the bio has been remapped so dispatch it */ | 580 | /* the bio has been remapped so dispatch it */ |
581 | 581 | ||
582 | blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, | 582 | blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, |
583 | tio->io->bio->bi_bdev->bd_dev, sector, | 583 | tio->io->bio->bi_bdev->bd_dev, |
584 | clone->bi_sector); | 584 | clone->bi_sector, sector); |
585 | 585 | ||
586 | generic_make_request(clone); | 586 | generic_make_request(clone); |
587 | } else if (r < 0 || r == DM_MAPIO_REQUEUE) { | 587 | } else if (r < 0 || r == DM_MAPIO_REQUEUE) { |
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index aaaa61ea4217..a26655881e6a 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -5,6 +5,11 @@ | |||
5 | menuconfig MISC_DEVICES | 5 | menuconfig MISC_DEVICES |
6 | bool "Misc devices" | 6 | bool "Misc devices" |
7 | default y | 7 | default y |
8 | ---help--- | ||
9 | Say Y here to get to see options for device drivers from various | ||
10 | different categories. This option alone does not add any kernel code. | ||
11 | |||
12 | If you say N, all options in this submenu will be skipped and disabled. | ||
8 | 13 | ||
9 | if MISC_DEVICES | 14 | if MISC_DEVICES |
10 | 15 | ||
@@ -200,14 +205,22 @@ config THINKPAD_ACPI_BAY | |||
200 | config THINKPAD_ACPI_INPUT_ENABLED | 205 | config THINKPAD_ACPI_INPUT_ENABLED |
201 | bool "Enable input layer support by default" | 206 | bool "Enable input layer support by default" |
202 | depends on THINKPAD_ACPI | 207 | depends on THINKPAD_ACPI |
203 | default y | 208 | default n |
204 | ---help--- | 209 | ---help--- |
205 | Enables hot key handling over the input layer by default. If unset, | 210 | This option enables thinkpad-acpi hot key handling over the input |
206 | the driver does not enable any hot key handling by default, and also | 211 | layer at driver load time. When it is unset, the driver does not |
207 | starts up with a mostly empty keymap. | 212 | enable hot key handling by default, and also starts up with a mostly |
208 | 213 | empty keymap. | |
209 | If you are not sure, say Y here. Say N to retain the deprecated | 214 | |
210 | behavior of ibm-acpi, and thinkpad-acpi for kernels up to 2.6.21. | 215 | This option should be enabled if you have a new enough HAL or other |
216 | userspace support that properly handles the thinkpad-acpi event | ||
217 | device. It auto-tunes the hot key support to those reported by the | ||
218 | firmware and enables it automatically. | ||
219 | |||
220 | If unsure, say N here to retain the old behaviour of ibm-acpi, and | ||
221 | thinkpad-acpi up to kernel 2.6.21: userspace will have to enable and | ||
222 | set up the thinkpad-acpi hot key handling using the sysfs interace | ||
223 | after loading the driver. | ||
211 | 224 | ||
212 | 225 | ||
213 | endif # MISC_DEVICES | 226 | endif # MISC_DEVICES |
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 14ee06c8f127..91da6880ae93 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -845,7 +845,7 @@ static struct sony_nc_event sony_C_events[] = { | |||
845 | }; | 845 | }; |
846 | 846 | ||
847 | /* SNC-only model map */ | 847 | /* SNC-only model map */ |
848 | struct dmi_system_id sony_nc_ids[] = { | 848 | static struct dmi_system_id sony_nc_ids[] = { |
849 | { | 849 | { |
850 | .ident = "Sony Vaio FE Series", | 850 | .ident = "Sony Vaio FE Series", |
851 | .callback = sony_nc_C_enable, | 851 | .callback = sony_nc_C_enable, |
@@ -942,6 +942,11 @@ static int sony_nc_resume(struct acpi_device *device) | |||
942 | } | 942 | } |
943 | } | 943 | } |
944 | 944 | ||
945 | /* set the last requested brightness level */ | ||
946 | if (sony_backlight_device && | ||
947 | !sony_backlight_update_status(sony_backlight_device)) | ||
948 | printk(KERN_WARNING DRV_PFX "unable to restore brightness level"); | ||
949 | |||
945 | /* re-initialize models with specific requirements */ | 950 | /* re-initialize models with specific requirements */ |
946 | dmi_check_system(sony_nc_ids); | 951 | dmi_check_system(sony_nc_ids); |
947 | 952 | ||
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index fa80f355e522..f6cd34a3dbac 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -4668,12 +4668,15 @@ static int __init thinkpad_acpi_module_init(void) | |||
4668 | thinkpad_acpi_module_exit(); | 4668 | thinkpad_acpi_module_exit(); |
4669 | return ret; | 4669 | return ret; |
4670 | } | 4670 | } |
4671 | tp_features.platform_drv_registered = 1; | ||
4672 | |||
4671 | ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver); | 4673 | ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver); |
4672 | if (ret) { | 4674 | if (ret) { |
4673 | printk(IBM_ERR "unable to create sysfs driver attributes\n"); | 4675 | printk(IBM_ERR "unable to create sysfs driver attributes\n"); |
4674 | thinkpad_acpi_module_exit(); | 4676 | thinkpad_acpi_module_exit(); |
4675 | return ret; | 4677 | return ret; |
4676 | } | 4678 | } |
4679 | tp_features.platform_drv_attrs_registered = 1; | ||
4677 | 4680 | ||
4678 | 4681 | ||
4679 | /* Device initialization */ | 4682 | /* Device initialization */ |
@@ -4756,8 +4759,11 @@ static void thinkpad_acpi_module_exit(void) | |||
4756 | if (tpacpi_pdev) | 4759 | if (tpacpi_pdev) |
4757 | platform_device_unregister(tpacpi_pdev); | 4760 | platform_device_unregister(tpacpi_pdev); |
4758 | 4761 | ||
4759 | tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); | 4762 | if (tp_features.platform_drv_attrs_registered) |
4760 | platform_driver_unregister(&tpacpi_pdriver); | 4763 | tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); |
4764 | |||
4765 | if (tp_features.platform_drv_registered) | ||
4766 | platform_driver_unregister(&tpacpi_pdriver); | ||
4761 | 4767 | ||
4762 | if (proc_dir) | 4768 | if (proc_dir) |
4763 | remove_proc_entry(IBM_PROC_DIR, acpi_root_dir); | 4769 | remove_proc_entry(IBM_PROC_DIR, acpi_root_dir); |
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 88af089d6494..eee8809a50d9 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h | |||
@@ -246,6 +246,8 @@ static struct { | |||
246 | u16 wan:1; | 246 | u16 wan:1; |
247 | u16 fan_ctrl_status_undef:1; | 247 | u16 fan_ctrl_status_undef:1; |
248 | u16 input_device_registered:1; | 248 | u16 input_device_registered:1; |
249 | u16 platform_drv_registered:1; | ||
250 | u16 platform_drv_attrs_registered:1; | ||
249 | } tp_features; | 251 | } tp_features; |
250 | 252 | ||
251 | struct thinkpad_id_data { | 253 | struct thinkpad_id_data { |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 8c86b802f212..d091b2430b48 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
9 | #include <linux/fs.h> | 9 | #include <linux/fs.h> |
10 | #include <linux/mm.h> | ||
10 | #include <linux/err.h> | 11 | #include <linux/err.h> |
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 001c66dd3a94..a8c0f436cdd2 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -1555,6 +1555,7 @@ vortex_up(struct net_device *dev) | |||
1555 | mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR); | 1555 | mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR); |
1556 | mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA); | 1556 | mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA); |
1557 | vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0); | 1557 | vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0); |
1558 | vp->mii.full_duplex = vp->full_duplex; | ||
1558 | 1559 | ||
1559 | vortex_check_media(dev, 1); | 1560 | vortex_check_media(dev, 1); |
1560 | } | 1561 | } |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 81ef81c9a584..5b9e17bf1749 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1968,6 +1968,16 @@ menuconfig NETDEV_1000 | |||
1968 | bool "Ethernet (1000 Mbit)" | 1968 | bool "Ethernet (1000 Mbit)" |
1969 | depends on !UML | 1969 | depends on !UML |
1970 | default y | 1970 | default y |
1971 | ---help--- | ||
1972 | Ethernet (also called IEEE 802.3 or ISO 8802-2) is the most common | ||
1973 | type of Local Area Network (LAN) in universities and companies. | ||
1974 | |||
1975 | Say Y here to get to see options for Gigabit Ethernet drivers. | ||
1976 | This option alone does not add any kernel code. | ||
1977 | Note that drivers supporting both 100 and 1000 MBit may be listed | ||
1978 | under "Ethernet (10 or 100MBit)" instead. | ||
1979 | |||
1980 | If you say N, all options in this submenu will be skipped and disabled. | ||
1971 | 1981 | ||
1972 | if NETDEV_1000 | 1982 | if NETDEV_1000 |
1973 | 1983 | ||
@@ -2339,6 +2349,11 @@ menuconfig NETDEV_10000 | |||
2339 | bool "Ethernet (10000 Mbit)" | 2349 | bool "Ethernet (10000 Mbit)" |
2340 | depends on !UML | 2350 | depends on !UML |
2341 | default y | 2351 | default y |
2352 | ---help--- | ||
2353 | Say Y here to get to see options for 10 Gigabit Ethernet drivers. | ||
2354 | This option alone does not add any kernel code. | ||
2355 | |||
2356 | If you say N, all options in this submenu will be skipped and disabled. | ||
2342 | 2357 | ||
2343 | if NETDEV_10000 | 2358 | if NETDEV_10000 |
2344 | 2359 | ||
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c index 83da1770bafb..90e0734e6037 100644 --- a/drivers/net/ax88796.c +++ b/drivers/net/ax88796.c | |||
@@ -821,8 +821,9 @@ static int ax_probe(struct platform_device *pdev) | |||
821 | dev->base_addr = (unsigned long)ei_status.mem; | 821 | dev->base_addr = (unsigned long)ei_status.mem; |
822 | 822 | ||
823 | if (ei_status.mem == NULL) { | 823 | if (ei_status.mem == NULL) { |
824 | dev_err(&pdev->dev, "Cannot ioremap area (%08zx,%08zx)\n", | 824 | dev_err(&pdev->dev, "Cannot ioremap area (%08llx,%08llx)\n", |
825 | res->start, res->end); | 825 | (unsigned long long)res->start, |
826 | (unsigned long long)res->end); | ||
826 | 827 | ||
827 | ret = -ENXIO; | 828 | ret = -ENXIO; |
828 | goto exit_req; | 829 | goto exit_req; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 070b78d959cc..1afda3230def 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1202,43 +1202,35 @@ static int bond_sethwaddr(struct net_device *bond_dev, | |||
1202 | return 0; | 1202 | return 0; |
1203 | } | 1203 | } |
1204 | 1204 | ||
1205 | #define BOND_INTERSECT_FEATURES \ | 1205 | #define BOND_VLAN_FEATURES \ |
1206 | (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_TSO | NETIF_F_UFO) | 1206 | (NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX | \ |
1207 | NETIF_F_HW_VLAN_FILTER) | ||
1207 | 1208 | ||
1208 | /* | 1209 | /* |
1209 | * Compute the common dev->feature set available to all slaves. Some | 1210 | * Compute the common dev->feature set available to all slaves. Some |
1210 | * feature bits are managed elsewhere, so preserve feature bits set on | 1211 | * feature bits are managed elsewhere, so preserve those feature bits |
1211 | * master device that are not part of the examined set. | 1212 | * on the master device. |
1212 | */ | 1213 | */ |
1213 | static int bond_compute_features(struct bonding *bond) | 1214 | static int bond_compute_features(struct bonding *bond) |
1214 | { | 1215 | { |
1215 | unsigned long features = BOND_INTERSECT_FEATURES; | ||
1216 | struct slave *slave; | 1216 | struct slave *slave; |
1217 | struct net_device *bond_dev = bond->dev; | 1217 | struct net_device *bond_dev = bond->dev; |
1218 | unsigned long features = bond_dev->features; | ||
1218 | unsigned short max_hard_header_len = ETH_HLEN; | 1219 | unsigned short max_hard_header_len = ETH_HLEN; |
1219 | int i; | 1220 | int i; |
1220 | 1221 | ||
1222 | features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES); | ||
1223 | features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | | ||
1224 | NETIF_F_GSO_MASK | NETIF_F_NO_CSUM; | ||
1225 | |||
1221 | bond_for_each_slave(bond, slave, i) { | 1226 | bond_for_each_slave(bond, slave, i) { |
1222 | features &= (slave->dev->features & BOND_INTERSECT_FEATURES); | 1227 | features = netdev_compute_features(features, |
1228 | slave->dev->features); | ||
1223 | if (slave->dev->hard_header_len > max_hard_header_len) | 1229 | if (slave->dev->hard_header_len > max_hard_header_len) |
1224 | max_hard_header_len = slave->dev->hard_header_len; | 1230 | max_hard_header_len = slave->dev->hard_header_len; |
1225 | } | 1231 | } |
1226 | 1232 | ||
1227 | if ((features & NETIF_F_SG) && | 1233 | features |= (bond_dev->features & BOND_VLAN_FEATURES); |
1228 | !(features & NETIF_F_ALL_CSUM)) | ||
1229 | features &= ~NETIF_F_SG; | ||
1230 | |||
1231 | /* | ||
1232 | * features will include NETIF_F_TSO (NETIF_F_UFO) iff all | ||
1233 | * slave devices support NETIF_F_TSO (NETIF_F_UFO), which | ||
1234 | * implies that all slaves also support scatter-gather | ||
1235 | * (NETIF_F_SG), which implies that features also includes | ||
1236 | * NETIF_F_SG. So no need to check whether we have an | ||
1237 | * illegal combination of NETIF_F_{TSO,UFO} and | ||
1238 | * !NETIF_F_SG | ||
1239 | */ | ||
1240 | |||
1241 | features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES); | ||
1242 | bond_dev->features = features; | 1234 | bond_dev->features = features; |
1243 | bond_dev->hard_header_len = max_hard_header_len; | 1235 | bond_dev->hard_header_len = max_hard_header_len; |
1244 | 1236 | ||
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index c90c92e72d2a..4c3785c9d4b8 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -1706,6 +1706,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol | |||
1706 | case E1000_DEV_ID_82545EM_COPPER: | 1706 | case E1000_DEV_ID_82545EM_COPPER: |
1707 | case E1000_DEV_ID_82546GB_QUAD_COPPER: | 1707 | case E1000_DEV_ID_82546GB_QUAD_COPPER: |
1708 | case E1000_DEV_ID_82546GB_PCIE: | 1708 | case E1000_DEV_ID_82546GB_PCIE: |
1709 | case E1000_DEV_ID_82571EB_SERDES_QUAD: | ||
1709 | /* these don't support WoL at all */ | 1710 | /* these don't support WoL at all */ |
1710 | wol->supported = 0; | 1711 | wol->supported = 0; |
1711 | break; | 1712 | break; |
@@ -1723,6 +1724,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol | |||
1723 | retval = 0; | 1724 | retval = 0; |
1724 | break; | 1725 | break; |
1725 | case E1000_DEV_ID_82571EB_QUAD_COPPER: | 1726 | case E1000_DEV_ID_82571EB_QUAD_COPPER: |
1727 | case E1000_DEV_ID_82571EB_QUAD_FIBER: | ||
1726 | case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: | 1728 | case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: |
1727 | case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: | 1729 | case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: |
1728 | /* quad port adapters only support WoL on port A */ | 1730 | /* quad port adapters only support WoL on port A */ |
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 9be44699300b..ba120f7fb0be 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -384,7 +384,10 @@ e1000_set_mac_type(struct e1000_hw *hw) | |||
384 | case E1000_DEV_ID_82571EB_COPPER: | 384 | case E1000_DEV_ID_82571EB_COPPER: |
385 | case E1000_DEV_ID_82571EB_FIBER: | 385 | case E1000_DEV_ID_82571EB_FIBER: |
386 | case E1000_DEV_ID_82571EB_SERDES: | 386 | case E1000_DEV_ID_82571EB_SERDES: |
387 | case E1000_DEV_ID_82571EB_SERDES_DUAL: | ||
388 | case E1000_DEV_ID_82571EB_SERDES_QUAD: | ||
387 | case E1000_DEV_ID_82571EB_QUAD_COPPER: | 389 | case E1000_DEV_ID_82571EB_QUAD_COPPER: |
390 | case E1000_DEV_ID_82571EB_QUAD_FIBER: | ||
388 | case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: | 391 | case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: |
389 | hw->mac_type = e1000_82571; | 392 | hw->mac_type = e1000_82571; |
390 | break; | 393 | break; |
@@ -485,6 +488,8 @@ e1000_set_media_type(struct e1000_hw *hw) | |||
485 | case E1000_DEV_ID_82545GM_SERDES: | 488 | case E1000_DEV_ID_82545GM_SERDES: |
486 | case E1000_DEV_ID_82546GB_SERDES: | 489 | case E1000_DEV_ID_82546GB_SERDES: |
487 | case E1000_DEV_ID_82571EB_SERDES: | 490 | case E1000_DEV_ID_82571EB_SERDES: |
491 | case E1000_DEV_ID_82571EB_SERDES_DUAL: | ||
492 | case E1000_DEV_ID_82571EB_SERDES_QUAD: | ||
488 | case E1000_DEV_ID_82572EI_SERDES: | 493 | case E1000_DEV_ID_82572EI_SERDES: |
489 | case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: | 494 | case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: |
490 | hw->media_type = e1000_media_type_internal_serdes; | 495 | hw->media_type = e1000_media_type_internal_serdes; |
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h index bd000b802ee7..fe8714655c90 100644 --- a/drivers/net/e1000/e1000_hw.h +++ b/drivers/net/e1000/e1000_hw.h | |||
@@ -475,7 +475,10 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw); | |||
475 | #define E1000_DEV_ID_82571EB_FIBER 0x105F | 475 | #define E1000_DEV_ID_82571EB_FIBER 0x105F |
476 | #define E1000_DEV_ID_82571EB_SERDES 0x1060 | 476 | #define E1000_DEV_ID_82571EB_SERDES 0x1060 |
477 | #define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4 | 477 | #define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4 |
478 | #define E1000_DEV_ID_82571EB_QUAD_FIBER 0x10A5 | ||
478 | #define E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE 0x10BC | 479 | #define E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE 0x10BC |
480 | #define E1000_DEV_ID_82571EB_SERDES_DUAL 0x10D9 | ||
481 | #define E1000_DEV_ID_82571EB_SERDES_QUAD 0x10DA | ||
479 | #define E1000_DEV_ID_82572EI_COPPER 0x107D | 482 | #define E1000_DEV_ID_82572EI_COPPER 0x107D |
480 | #define E1000_DEV_ID_82572EI_FIBER 0x107E | 483 | #define E1000_DEV_ID_82572EI_FIBER 0x107E |
481 | #define E1000_DEV_ID_82572EI_SERDES 0x107F | 484 | #define E1000_DEV_ID_82572EI_SERDES 0x107F |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index f48b659e0c2b..4a225950fb43 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -100,6 +100,7 @@ static struct pci_device_id e1000_pci_tbl[] = { | |||
100 | INTEL_E1000_ETHERNET_DEVICE(0x1099), | 100 | INTEL_E1000_ETHERNET_DEVICE(0x1099), |
101 | INTEL_E1000_ETHERNET_DEVICE(0x109A), | 101 | INTEL_E1000_ETHERNET_DEVICE(0x109A), |
102 | INTEL_E1000_ETHERNET_DEVICE(0x10A4), | 102 | INTEL_E1000_ETHERNET_DEVICE(0x10A4), |
103 | INTEL_E1000_ETHERNET_DEVICE(0x10A5), | ||
103 | INTEL_E1000_ETHERNET_DEVICE(0x10B5), | 104 | INTEL_E1000_ETHERNET_DEVICE(0x10B5), |
104 | INTEL_E1000_ETHERNET_DEVICE(0x10B9), | 105 | INTEL_E1000_ETHERNET_DEVICE(0x10B9), |
105 | INTEL_E1000_ETHERNET_DEVICE(0x10BA), | 106 | INTEL_E1000_ETHERNET_DEVICE(0x10BA), |
@@ -107,6 +108,8 @@ static struct pci_device_id e1000_pci_tbl[] = { | |||
107 | INTEL_E1000_ETHERNET_DEVICE(0x10BC), | 108 | INTEL_E1000_ETHERNET_DEVICE(0x10BC), |
108 | INTEL_E1000_ETHERNET_DEVICE(0x10C4), | 109 | INTEL_E1000_ETHERNET_DEVICE(0x10C4), |
109 | INTEL_E1000_ETHERNET_DEVICE(0x10C5), | 110 | INTEL_E1000_ETHERNET_DEVICE(0x10C5), |
111 | INTEL_E1000_ETHERNET_DEVICE(0x10D9), | ||
112 | INTEL_E1000_ETHERNET_DEVICE(0x10DA), | ||
110 | /* required last entry */ | 113 | /* required last entry */ |
111 | {0,} | 114 | {0,} |
112 | }; | 115 | }; |
@@ -1096,6 +1099,7 @@ e1000_probe(struct pci_dev *pdev, | |||
1096 | break; | 1099 | break; |
1097 | case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: | 1100 | case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: |
1098 | case E1000_DEV_ID_82571EB_QUAD_COPPER: | 1101 | case E1000_DEV_ID_82571EB_QUAD_COPPER: |
1102 | case E1000_DEV_ID_82571EB_QUAD_FIBER: | ||
1099 | case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: | 1103 | case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: |
1100 | /* if quad port adapter, disable WoL on all but port A */ | 1104 | /* if quad port adapter, disable WoL on all but port A */ |
1101 | if (global_quad_port_a != 0) | 1105 | if (global_quad_port_a != 0) |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 69f5f365239a..10f4e3b55168 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -3068,8 +3068,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data) | |||
3068 | np->nic_poll_irq = np->irqmask; | 3068 | np->nic_poll_irq = np->irqmask; |
3069 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3069 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3070 | } | 3070 | } |
3071 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3072 | spin_unlock(&np->lock); | 3071 | spin_unlock(&np->lock); |
3072 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3073 | break; | 3073 | break; |
3074 | } | 3074 | } |
3075 | 3075 | ||
@@ -3186,8 +3186,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data) | |||
3186 | np->nic_poll_irq = np->irqmask; | 3186 | np->nic_poll_irq = np->irqmask; |
3187 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3187 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3188 | } | 3188 | } |
3189 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3190 | spin_unlock(&np->lock); | 3189 | spin_unlock(&np->lock); |
3190 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3191 | break; | 3191 | break; |
3192 | } | 3192 | } |
3193 | 3193 | ||
@@ -3233,8 +3233,8 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data) | |||
3233 | np->nic_poll_irq |= NVREG_IRQ_TX_ALL; | 3233 | np->nic_poll_irq |= NVREG_IRQ_TX_ALL; |
3234 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3234 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3235 | } | 3235 | } |
3236 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i); | ||
3237 | spin_unlock_irqrestore(&np->lock, flags); | 3236 | spin_unlock_irqrestore(&np->lock, flags); |
3237 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i); | ||
3238 | break; | 3238 | break; |
3239 | } | 3239 | } |
3240 | 3240 | ||
@@ -3348,8 +3348,8 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data) | |||
3348 | np->nic_poll_irq |= NVREG_IRQ_RX_ALL; | 3348 | np->nic_poll_irq |= NVREG_IRQ_RX_ALL; |
3349 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3349 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3350 | } | 3350 | } |
3351 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i); | ||
3352 | spin_unlock_irqrestore(&np->lock, flags); | 3351 | spin_unlock_irqrestore(&np->lock, flags); |
3352 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i); | ||
3353 | break; | 3353 | break; |
3354 | } | 3354 | } |
3355 | } | 3355 | } |
@@ -3421,8 +3421,8 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data) | |||
3421 | np->nic_poll_irq |= NVREG_IRQ_OTHER; | 3421 | np->nic_poll_irq |= NVREG_IRQ_OTHER; |
3422 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3422 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3423 | } | 3423 | } |
3424 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i); | ||
3425 | spin_unlock_irqrestore(&np->lock, flags); | 3424 | spin_unlock_irqrestore(&np->lock, flags); |
3425 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i); | ||
3426 | break; | 3426 | break; |
3427 | } | 3427 | } |
3428 | 3428 | ||
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 0ac240ca905b..3b0fd83fa266 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1561,10 +1561,9 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf | |||
1561 | struct irda_class_desc *desc; | 1561 | struct irda_class_desc *desc; |
1562 | int ret; | 1562 | int ret; |
1563 | 1563 | ||
1564 | desc = kmalloc(sizeof (*desc), GFP_KERNEL); | 1564 | desc = kzalloc(sizeof(*desc), GFP_KERNEL); |
1565 | if (desc == NULL) | 1565 | if (!desc) |
1566 | return NULL; | 1566 | return NULL; |
1567 | memset(desc, 0, sizeof(*desc)); | ||
1568 | 1567 | ||
1569 | /* USB-IrDA class spec 1.0: | 1568 | /* USB-IrDA class spec 1.0: |
1570 | * 6.1.3: Standard "Get Descriptor" Device Request is not | 1569 | * 6.1.3: Standard "Get Descriptor" Device Request is not |
@@ -1617,7 +1616,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1617 | { | 1616 | { |
1618 | struct net_device *net; | 1617 | struct net_device *net; |
1619 | struct usb_device *dev = interface_to_usbdev(intf); | 1618 | struct usb_device *dev = interface_to_usbdev(intf); |
1620 | struct irda_usb_cb *self = NULL; | 1619 | struct irda_usb_cb *self; |
1621 | struct usb_host_interface *interface; | 1620 | struct usb_host_interface *interface; |
1622 | struct irda_class_desc *irda_desc; | 1621 | struct irda_class_desc *irda_desc; |
1623 | int ret = -ENOMEM; | 1622 | int ret = -ENOMEM; |
@@ -1655,7 +1654,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1655 | self->header_length = USB_IRDA_HEADER; | 1654 | self->header_length = USB_IRDA_HEADER; |
1656 | } | 1655 | } |
1657 | 1656 | ||
1658 | self->rx_urb = kzalloc(self->max_rx_urb * sizeof(struct urb *), | 1657 | self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *), |
1659 | GFP_KERNEL); | 1658 | GFP_KERNEL); |
1660 | 1659 | ||
1661 | for (i = 0; i < self->max_rx_urb; i++) { | 1660 | for (i = 0; i < self->max_rx_urb; i++) { |
@@ -1715,7 +1714,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1715 | /* Find IrDA class descriptor */ | 1714 | /* Find IrDA class descriptor */ |
1716 | irda_desc = irda_usb_find_class_desc(intf); | 1715 | irda_desc = irda_usb_find_class_desc(intf); |
1717 | ret = -ENODEV; | 1716 | ret = -ENODEV; |
1718 | if (irda_desc == NULL) | 1717 | if (!irda_desc) |
1719 | goto err_out_3; | 1718 | goto err_out_3; |
1720 | 1719 | ||
1721 | if (self->needspatch) { | 1720 | if (self->needspatch) { |
@@ -1738,15 +1737,13 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1738 | /* Don't change this buffer size and allocation without doing | 1737 | /* Don't change this buffer size and allocation without doing |
1739 | * some heavy and complete testing. Don't ask why :-( | 1738 | * some heavy and complete testing. Don't ask why :-( |
1740 | * Jean II */ | 1739 | * Jean II */ |
1741 | self->speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); | 1740 | self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); |
1742 | if (self->speed_buff == NULL) | 1741 | if (!self->speed_buff) |
1743 | goto err_out_3; | 1742 | goto err_out_3; |
1744 | 1743 | ||
1745 | memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU); | ||
1746 | |||
1747 | self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length, | 1744 | self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length, |
1748 | GFP_KERNEL); | 1745 | GFP_KERNEL); |
1749 | if (self->tx_buff == NULL) | 1746 | if (!self->tx_buff) |
1750 | goto err_out_4; | 1747 | goto err_out_4; |
1751 | 1748 | ||
1752 | ret = irda_usb_open(self); | 1749 | ret = irda_usb_open(self); |
@@ -1767,12 +1764,11 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1767 | 1764 | ||
1768 | /* replace IrDA class descriptor with what patched device is now reporting */ | 1765 | /* replace IrDA class descriptor with what patched device is now reporting */ |
1769 | irda_desc = irda_usb_find_class_desc (self->usbintf); | 1766 | irda_desc = irda_usb_find_class_desc (self->usbintf); |
1770 | if (irda_desc == NULL) { | 1767 | if (!irda_desc) { |
1771 | ret = -ENODEV; | 1768 | ret = -ENODEV; |
1772 | goto err_out_6; | 1769 | goto err_out_6; |
1773 | } | 1770 | } |
1774 | if (self->irda_desc) | 1771 | kfree(self->irda_desc); |
1775 | kfree (self->irda_desc); | ||
1776 | self->irda_desc = irda_desc; | 1772 | self->irda_desc = irda_desc; |
1777 | irda_usb_init_qos(self); | 1773 | irda_usb_init_qos(self); |
1778 | } | 1774 | } |
diff --git a/drivers/net/mlx4/reset.c b/drivers/net/mlx4/reset.c index e4dfd4b11a4a..e199715fabd0 100644 --- a/drivers/net/mlx4/reset.c +++ b/drivers/net/mlx4/reset.c | |||
@@ -119,6 +119,9 @@ int mlx4_reset(struct mlx4_dev *dev) | |||
119 | writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET); | 119 | writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET); |
120 | iounmap(reset); | 120 | iounmap(reset); |
121 | 121 | ||
122 | /* Docs say to wait one second before accessing device */ | ||
123 | msleep(1000); | ||
124 | |||
122 | end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES; | 125 | end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES; |
123 | do { | 126 | do { |
124 | if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) && | 127 | if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) && |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index deca65330b0f..ae9bb7b7fd67 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -191,6 +191,7 @@ struct myri10ge_priv { | |||
191 | struct timer_list watchdog_timer; | 191 | struct timer_list watchdog_timer; |
192 | int watchdog_tx_done; | 192 | int watchdog_tx_done; |
193 | int watchdog_tx_req; | 193 | int watchdog_tx_req; |
194 | int watchdog_pause; | ||
194 | int watchdog_resets; | 195 | int watchdog_resets; |
195 | int tx_linearized; | 196 | int tx_linearized; |
196 | int pause; | 197 | int pause; |
@@ -2800,6 +2801,7 @@ static void myri10ge_watchdog(struct work_struct *work) | |||
2800 | static void myri10ge_watchdog_timer(unsigned long arg) | 2801 | static void myri10ge_watchdog_timer(unsigned long arg) |
2801 | { | 2802 | { |
2802 | struct myri10ge_priv *mgp; | 2803 | struct myri10ge_priv *mgp; |
2804 | u32 rx_pause_cnt; | ||
2803 | 2805 | ||
2804 | mgp = (struct myri10ge_priv *)arg; | 2806 | mgp = (struct myri10ge_priv *)arg; |
2805 | 2807 | ||
@@ -2816,19 +2818,28 @@ static void myri10ge_watchdog_timer(unsigned long arg) | |||
2816 | myri10ge_fill_thresh) | 2818 | myri10ge_fill_thresh) |
2817 | mgp->rx_big.watchdog_needed = 0; | 2819 | mgp->rx_big.watchdog_needed = 0; |
2818 | } | 2820 | } |
2821 | rx_pause_cnt = ntohl(mgp->fw_stats->dropped_pause); | ||
2819 | 2822 | ||
2820 | if (mgp->tx.req != mgp->tx.done && | 2823 | if (mgp->tx.req != mgp->tx.done && |
2821 | mgp->tx.done == mgp->watchdog_tx_done && | 2824 | mgp->tx.done == mgp->watchdog_tx_done && |
2822 | mgp->watchdog_tx_req != mgp->watchdog_tx_done) | 2825 | mgp->watchdog_tx_req != mgp->watchdog_tx_done) { |
2823 | /* nic seems like it might be stuck.. */ | 2826 | /* nic seems like it might be stuck.. */ |
2824 | schedule_work(&mgp->watchdog_work); | 2827 | if (rx_pause_cnt != mgp->watchdog_pause) { |
2825 | else | 2828 | if (net_ratelimit()) |
2826 | /* rearm timer */ | 2829 | printk(KERN_WARNING "myri10ge %s:" |
2827 | mod_timer(&mgp->watchdog_timer, | 2830 | "TX paused, check link partner\n", |
2828 | jiffies + myri10ge_watchdog_timeout * HZ); | 2831 | mgp->dev->name); |
2829 | 2832 | } else { | |
2833 | schedule_work(&mgp->watchdog_work); | ||
2834 | return; | ||
2835 | } | ||
2836 | } | ||
2837 | /* rearm timer */ | ||
2838 | mod_timer(&mgp->watchdog_timer, | ||
2839 | jiffies + myri10ge_watchdog_timeout * HZ); | ||
2830 | mgp->watchdog_tx_done = mgp->tx.done; | 2840 | mgp->watchdog_tx_done = mgp->tx.done; |
2831 | mgp->watchdog_tx_req = mgp->tx.req; | 2841 | mgp->watchdog_tx_req = mgp->tx.req; |
2842 | mgp->watchdog_pause = rx_pause_cnt; | ||
2832 | } | 2843 | } |
2833 | 2844 | ||
2834 | static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 2845 | static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 6bb48ba80964..b47a12d684f9 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -2438,13 +2438,16 @@ static void netdev_error(struct net_device *dev, int intr_status) | |||
2438 | dev->name); | 2438 | dev->name); |
2439 | } | 2439 | } |
2440 | np->stats.rx_fifo_errors++; | 2440 | np->stats.rx_fifo_errors++; |
2441 | np->stats.rx_errors++; | ||
2441 | } | 2442 | } |
2442 | /* Hmmmmm, it's not clear how to recover from PCI faults. */ | 2443 | /* Hmmmmm, it's not clear how to recover from PCI faults. */ |
2443 | if (intr_status & IntrPCIErr) { | 2444 | if (intr_status & IntrPCIErr) { |
2444 | printk(KERN_NOTICE "%s: PCI error %#08x\n", dev->name, | 2445 | printk(KERN_NOTICE "%s: PCI error %#08x\n", dev->name, |
2445 | intr_status & IntrPCIErr); | 2446 | intr_status & IntrPCIErr); |
2446 | np->stats.tx_fifo_errors++; | 2447 | np->stats.tx_fifo_errors++; |
2448 | np->stats.tx_errors++; | ||
2447 | np->stats.rx_fifo_errors++; | 2449 | np->stats.rx_fifo_errors++; |
2450 | np->stats.rx_errors++; | ||
2448 | } | 2451 | } |
2449 | spin_unlock(&np->lock); | 2452 | spin_unlock(&np->lock); |
2450 | } | 2453 | } |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index c3fe230695a0..b56dff26772d 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -42,7 +42,13 @@ static int max_interrupt_work = 20; | |||
42 | 42 | ||
43 | /* Set the copy breakpoint for the copy-only-tiny-frames scheme. | 43 | /* Set the copy breakpoint for the copy-only-tiny-frames scheme. |
44 | Setting to > 1518 effectively disables this feature. */ | 44 | Setting to > 1518 effectively disables this feature. */ |
45 | #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \ | ||
46 | || defined(CONFIG_SPARC) || defined(__ia64__) \ | ||
47 | || defined(__sh__) || defined(__mips__) | ||
48 | static int rx_copybreak = 1518; | ||
49 | #else | ||
45 | static int rx_copybreak; | 50 | static int rx_copybreak; |
51 | #endif | ||
46 | 52 | ||
47 | /* Work-around for broken BIOSes: they are unable to get the chip back out of | 53 | /* Work-around for broken BIOSes: they are unable to get the chip back out of |
48 | power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */ | 54 | power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */ |
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 15b6e07a4382..071a64cacd5c 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -212,14 +212,13 @@ static pvc_device* add_pvc(struct net_device *dev, u16 dlci) | |||
212 | pvc_p = &(*pvc_p)->next; | 212 | pvc_p = &(*pvc_p)->next; |
213 | } | 213 | } |
214 | 214 | ||
215 | pvc = kmalloc(sizeof(pvc_device), GFP_ATOMIC); | 215 | pvc = kzalloc(sizeof(pvc_device), GFP_ATOMIC); |
216 | #ifdef DEBUG_PVC | 216 | #ifdef DEBUG_PVC |
217 | printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev); | 217 | printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev); |
218 | #endif | 218 | #endif |
219 | if (!pvc) | 219 | if (!pvc) |
220 | return NULL; | 220 | return NULL; |
221 | 221 | ||
222 | memset(pvc, 0, sizeof(pvc_device)); | ||
223 | pvc->dlci = dlci; | 222 | pvc->dlci = dlci; |
224 | pvc->frad = dev; | 223 | pvc->frad = dev; |
225 | pvc->next = *pvc_p; /* Put it in the chain */ | 224 | pvc->next = *pvc_p; /* Put it in the chain */ |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 489f69c5d6ca..4445810335a8 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -566,6 +566,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
566 | if (notify) | 566 | if (notify) |
567 | notify_remote_via_irq(np->netdev->irq); | 567 | notify_remote_via_irq(np->netdev->irq); |
568 | 568 | ||
569 | np->stats.tx_bytes += skb->len; | ||
570 | np->stats.tx_packets++; | ||
571 | |||
572 | /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */ | ||
569 | xennet_tx_buf_gc(dev); | 573 | xennet_tx_buf_gc(dev); |
570 | 574 | ||
571 | if (!netfront_tx_slot_available(np)) | 575 | if (!netfront_tx_slot_available(np)) |
@@ -573,9 +577,6 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
573 | 577 | ||
574 | spin_unlock_irq(&np->tx_lock); | 578 | spin_unlock_irq(&np->tx_lock); |
575 | 579 | ||
576 | np->stats.tx_bytes += skb->len; | ||
577 | np->stats.tx_packets++; | ||
578 | |||
579 | return 0; | 580 | return 0; |
580 | 581 | ||
581 | drop: | 582 | drop: |
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c index 268598ef3efe..20442fbf9346 100644 --- a/drivers/s390/char/monwriter.c +++ b/drivers/s390/char/monwriter.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/miscdevice.h> | 17 | #include <linux/miscdevice.h> |
18 | #include <linux/ctype.h> | 18 | #include <linux/ctype.h> |
19 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
20 | #include <linux/mutex.h> | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include <asm/ebcdic.h> | 22 | #include <asm/ebcdic.h> |
22 | #include <asm/io.h> | 23 | #include <asm/io.h> |
@@ -41,6 +42,7 @@ struct mon_private { | |||
41 | size_t hdr_to_read; | 42 | size_t hdr_to_read; |
42 | size_t data_to_read; | 43 | size_t data_to_read; |
43 | struct mon_buf *current_buf; | 44 | struct mon_buf *current_buf; |
45 | struct mutex thread_mutex; | ||
44 | }; | 46 | }; |
45 | 47 | ||
46 | /* | 48 | /* |
@@ -179,6 +181,7 @@ static int monwrite_open(struct inode *inode, struct file *filp) | |||
179 | return -ENOMEM; | 181 | return -ENOMEM; |
180 | INIT_LIST_HEAD(&monpriv->list); | 182 | INIT_LIST_HEAD(&monpriv->list); |
181 | monpriv->hdr_to_read = sizeof(monpriv->hdr); | 183 | monpriv->hdr_to_read = sizeof(monpriv->hdr); |
184 | mutex_init(&monpriv->thread_mutex); | ||
182 | filp->private_data = monpriv; | 185 | filp->private_data = monpriv; |
183 | return nonseekable_open(inode, filp); | 186 | return nonseekable_open(inode, filp); |
184 | } | 187 | } |
@@ -209,6 +212,7 @@ static ssize_t monwrite_write(struct file *filp, const char __user *data, | |||
209 | void *to; | 212 | void *to; |
210 | int rc; | 213 | int rc; |
211 | 214 | ||
215 | mutex_lock(&monpriv->thread_mutex); | ||
212 | for (written = 0; written < count; ) { | 216 | for (written = 0; written < count; ) { |
213 | if (monpriv->hdr_to_read) { | 217 | if (monpriv->hdr_to_read) { |
214 | len = min(count - written, monpriv->hdr_to_read); | 218 | len = min(count - written, monpriv->hdr_to_read); |
@@ -247,11 +251,13 @@ static ssize_t monwrite_write(struct file *filp, const char __user *data, | |||
247 | } | 251 | } |
248 | monpriv->hdr_to_read = sizeof(monpriv->hdr); | 252 | monpriv->hdr_to_read = sizeof(monpriv->hdr); |
249 | } | 253 | } |
254 | mutex_unlock(&monpriv->thread_mutex); | ||
250 | return written; | 255 | return written; |
251 | 256 | ||
252 | out_error: | 257 | out_error: |
253 | monpriv->data_to_read = 0; | 258 | monpriv->data_to_read = 0; |
254 | monpriv->hdr_to_read = sizeof(struct monwrite_hdr); | 259 | monpriv->hdr_to_read = sizeof(struct monwrite_hdr); |
260 | mutex_unlock(&monpriv->thread_mutex); | ||
255 | return rc; | 261 | return rc; |
256 | } | 262 | } |
257 | 263 | ||
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 161867cebd8c..04b19bdc09da 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c | |||
@@ -119,10 +119,12 @@ static void urdev_put(struct urdev *urd) | |||
119 | /* | 119 | /* |
120 | * Low-level functions to do I/O to a ur device. | 120 | * Low-level functions to do I/O to a ur device. |
121 | * alloc_chan_prog | 121 | * alloc_chan_prog |
122 | * free_chan_prog | ||
122 | * do_ur_io | 123 | * do_ur_io |
123 | * ur_int_handler | 124 | * ur_int_handler |
124 | * | 125 | * |
125 | * alloc_chan_prog allocates and builds the channel program | 126 | * alloc_chan_prog allocates and builds the channel program |
127 | * free_chan_prog frees memory of the channel program | ||
126 | * | 128 | * |
127 | * do_ur_io issues the channel program to the device and blocks waiting | 129 | * do_ur_io issues the channel program to the device and blocks waiting |
128 | * on a completion event it publishes at urd->io_done. The function | 130 | * on a completion event it publishes at urd->io_done. The function |
@@ -137,6 +139,16 @@ static void urdev_put(struct urdev *urd) | |||
137 | * address pointer that alloc_chan_prog returned. | 139 | * address pointer that alloc_chan_prog returned. |
138 | */ | 140 | */ |
139 | 141 | ||
142 | static void free_chan_prog(struct ccw1 *cpa) | ||
143 | { | ||
144 | struct ccw1 *ptr = cpa; | ||
145 | |||
146 | while (ptr->cda) { | ||
147 | kfree((void *)(addr_t) ptr->cda); | ||
148 | ptr++; | ||
149 | } | ||
150 | kfree(cpa); | ||
151 | } | ||
140 | 152 | ||
141 | /* | 153 | /* |
142 | * alloc_chan_prog | 154 | * alloc_chan_prog |
@@ -144,44 +156,45 @@ static void urdev_put(struct urdev *urd) | |||
144 | * with a final NOP CCW command-chained on (which ensures that CE and DE | 156 | * with a final NOP CCW command-chained on (which ensures that CE and DE |
145 | * are presented together in a single interrupt instead of as separate | 157 | * are presented together in a single interrupt instead of as separate |
146 | * interrupts unless an incorrect length indication kicks in first). The | 158 | * interrupts unless an incorrect length indication kicks in first). The |
147 | * data length in each CCW is reclen. The caller must ensure that count | 159 | * data length in each CCW is reclen. |
148 | * is an integral multiple of reclen. | ||
149 | * The channel program pointer returned by this function must be freed | ||
150 | * with kfree. The caller is responsible for checking that | ||
151 | * count/reclen is not ridiculously large. | ||
152 | */ | 160 | */ |
153 | static struct ccw1 *alloc_chan_prog(char *buf, size_t count, size_t reclen) | 161 | static struct ccw1 *alloc_chan_prog(const char __user *ubuf, int rec_count, |
162 | int reclen) | ||
154 | { | 163 | { |
155 | size_t num_ccws; | ||
156 | struct ccw1 *cpa; | 164 | struct ccw1 *cpa; |
165 | void *kbuf; | ||
157 | int i; | 166 | int i; |
158 | 167 | ||
159 | TRACE("alloc_chan_prog(%p, %zu, %zu)\n", buf, count, reclen); | 168 | TRACE("alloc_chan_prog(%p, %i, %i)\n", ubuf, rec_count, reclen); |
160 | 169 | ||
161 | /* | 170 | /* |
162 | * We chain a NOP onto the writes to force CE+DE together. | 171 | * We chain a NOP onto the writes to force CE+DE together. |
163 | * That means we allocate room for CCWs to cover count/reclen | 172 | * That means we allocate room for CCWs to cover count/reclen |
164 | * records plus a NOP. | 173 | * records plus a NOP. |
165 | */ | 174 | */ |
166 | num_ccws = count / reclen + 1; | 175 | cpa = kzalloc((rec_count + 1) * sizeof(struct ccw1), |
167 | cpa = kmalloc(num_ccws * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA); | 176 | GFP_KERNEL | GFP_DMA); |
168 | if (!cpa) | 177 | if (!cpa) |
169 | return NULL; | 178 | return ERR_PTR(-ENOMEM); |
170 | 179 | ||
171 | for (i = 0; count; i++) { | 180 | for (i = 0; i < rec_count; i++) { |
172 | cpa[i].cmd_code = WRITE_CCW_CMD; | 181 | cpa[i].cmd_code = WRITE_CCW_CMD; |
173 | cpa[i].flags = CCW_FLAG_CC | CCW_FLAG_SLI; | 182 | cpa[i].flags = CCW_FLAG_CC | CCW_FLAG_SLI; |
174 | cpa[i].count = reclen; | 183 | cpa[i].count = reclen; |
175 | cpa[i].cda = __pa(buf); | 184 | kbuf = kmalloc(reclen, GFP_KERNEL | GFP_DMA); |
176 | buf += reclen; | 185 | if (!kbuf) { |
177 | count -= reclen; | 186 | free_chan_prog(cpa); |
187 | return ERR_PTR(-ENOMEM); | ||
188 | } | ||
189 | cpa[i].cda = (u32)(addr_t) kbuf; | ||
190 | if (copy_from_user(kbuf, ubuf, reclen)) { | ||
191 | free_chan_prog(cpa); | ||
192 | return ERR_PTR(-EFAULT); | ||
193 | } | ||
194 | ubuf += reclen; | ||
178 | } | 195 | } |
179 | /* The following NOP CCW forces CE+DE to be presented together */ | 196 | /* The following NOP CCW forces CE+DE to be presented together */ |
180 | cpa[i].cmd_code = CCW_CMD_NOOP; | 197 | cpa[i].cmd_code = CCW_CMD_NOOP; |
181 | cpa[i].flags = 0; | ||
182 | cpa[i].count = 0; | ||
183 | cpa[i].cda = 0; | ||
184 | |||
185 | return cpa; | 198 | return cpa; |
186 | } | 199 | } |
187 | 200 | ||
@@ -189,7 +202,7 @@ static int do_ur_io(struct urdev *urd, struct ccw1 *cpa) | |||
189 | { | 202 | { |
190 | int rc; | 203 | int rc; |
191 | struct ccw_device *cdev = urd->cdev; | 204 | struct ccw_device *cdev = urd->cdev; |
192 | DECLARE_COMPLETION(event); | 205 | DECLARE_COMPLETION_ONSTACK(event); |
193 | 206 | ||
194 | TRACE("do_ur_io: cpa=%p\n", cpa); | 207 | TRACE("do_ur_io: cpa=%p\n", cpa); |
195 | 208 | ||
@@ -325,24 +338,11 @@ static ssize_t do_write(struct urdev *urd, const char __user *udata, | |||
325 | size_t count, size_t reclen, loff_t *ppos) | 338 | size_t count, size_t reclen, loff_t *ppos) |
326 | { | 339 | { |
327 | struct ccw1 *cpa; | 340 | struct ccw1 *cpa; |
328 | char *buf; | ||
329 | int rc; | 341 | int rc; |
330 | 342 | ||
331 | /* Data buffer must be under 2GB line for fmt1 CCWs: hence GFP_DMA */ | 343 | cpa = alloc_chan_prog(udata, count / reclen, reclen); |
332 | buf = kmalloc(count, GFP_KERNEL | GFP_DMA); | 344 | if (IS_ERR(cpa)) |
333 | if (!buf) | 345 | return PTR_ERR(cpa); |
334 | return -ENOMEM; | ||
335 | |||
336 | if (copy_from_user(buf, udata, count)) { | ||
337 | rc = -EFAULT; | ||
338 | goto fail_kfree_buf; | ||
339 | } | ||
340 | |||
341 | cpa = alloc_chan_prog(buf, count, reclen); | ||
342 | if (!cpa) { | ||
343 | rc = -ENOMEM; | ||
344 | goto fail_kfree_buf; | ||
345 | } | ||
346 | 346 | ||
347 | rc = do_ur_io(urd, cpa); | 347 | rc = do_ur_io(urd, cpa); |
348 | if (rc) | 348 | if (rc) |
@@ -354,10 +354,9 @@ static ssize_t do_write(struct urdev *urd, const char __user *udata, | |||
354 | } | 354 | } |
355 | *ppos += count; | 355 | *ppos += count; |
356 | rc = count; | 356 | rc = count; |
357 | |||
357 | fail_kfree_cpa: | 358 | fail_kfree_cpa: |
358 | kfree(cpa); | 359 | free_chan_prog(cpa); |
359 | fail_kfree_buf: | ||
360 | kfree(buf); | ||
361 | return rc; | 360 | return rc; |
362 | } | 361 | } |
363 | 362 | ||
@@ -473,7 +472,7 @@ static ssize_t diag14_read(struct file *file, char __user *ubuf, size_t count, | |||
473 | return rc; | 472 | return rc; |
474 | 473 | ||
475 | len = min((size_t) PAGE_SIZE, count); | 474 | len = min((size_t) PAGE_SIZE, count); |
476 | buf = kmalloc(PAGE_SIZE, GFP_KERNEL); | 475 | buf = (char *) __get_free_page(GFP_KERNEL | GFP_DMA); |
477 | if (!buf) | 476 | if (!buf) |
478 | return -ENOMEM; | 477 | return -ENOMEM; |
479 | 478 | ||
@@ -500,7 +499,7 @@ static ssize_t diag14_read(struct file *file, char __user *ubuf, size_t count, | |||
500 | *offs += copied; | 499 | *offs += copied; |
501 | rc = copied; | 500 | rc = copied; |
502 | fail: | 501 | fail: |
503 | kfree(buf); | 502 | free_page((unsigned long) buf); |
504 | return rc; | 503 | return rc; |
505 | } | 504 | } |
506 | 505 | ||
@@ -543,56 +542,97 @@ static int diag_read_next_file_info(struct file_control_block *buf, int spid) | |||
543 | } | 542 | } |
544 | } | 543 | } |
545 | 544 | ||
546 | static int verify_device(struct urdev *urd) | 545 | static int verify_uri_device(struct urdev *urd) |
547 | { | 546 | { |
548 | struct file_control_block fcb; | 547 | struct file_control_block *fcb; |
549 | char *buf; | 548 | char *buf; |
550 | int rc; | 549 | int rc; |
551 | 550 | ||
551 | fcb = kmalloc(sizeof(*fcb), GFP_KERNEL | GFP_DMA); | ||
552 | if (!fcb) | ||
553 | return -ENOMEM; | ||
554 | |||
555 | /* check for empty reader device (beginning of chain) */ | ||
556 | rc = diag_read_next_file_info(fcb, 0); | ||
557 | if (rc) | ||
558 | goto fail_free_fcb; | ||
559 | |||
560 | /* if file is in hold status, we do not read it */ | ||
561 | if (fcb->file_stat & (FLG_SYSTEM_HOLD | FLG_USER_HOLD)) { | ||
562 | rc = -EPERM; | ||
563 | goto fail_free_fcb; | ||
564 | } | ||
565 | |||
566 | /* open file on virtual reader */ | ||
567 | buf = (char *) __get_free_page(GFP_KERNEL | GFP_DMA); | ||
568 | if (!buf) { | ||
569 | rc = -ENOMEM; | ||
570 | goto fail_free_fcb; | ||
571 | } | ||
572 | rc = diag_read_file(urd->dev_id.devno, buf); | ||
573 | if ((rc != 0) && (rc != -ENODATA)) /* EOF does not hurt */ | ||
574 | goto fail_free_buf; | ||
575 | |||
576 | /* check if the file on top of the queue is open now */ | ||
577 | rc = diag_read_next_file_info(fcb, 0); | ||
578 | if (rc) | ||
579 | goto fail_free_buf; | ||
580 | if (!(fcb->file_stat & FLG_IN_USE)) { | ||
581 | rc = -EMFILE; | ||
582 | goto fail_free_buf; | ||
583 | } | ||
584 | rc = 0; | ||
585 | |||
586 | fail_free_buf: | ||
587 | free_page((unsigned long) buf); | ||
588 | fail_free_fcb: | ||
589 | kfree(fcb); | ||
590 | return rc; | ||
591 | } | ||
592 | |||
593 | static int verify_device(struct urdev *urd) | ||
594 | { | ||
552 | switch (urd->class) { | 595 | switch (urd->class) { |
553 | case DEV_CLASS_UR_O: | 596 | case DEV_CLASS_UR_O: |
554 | return 0; /* no check needed here */ | 597 | return 0; /* no check needed here */ |
555 | case DEV_CLASS_UR_I: | 598 | case DEV_CLASS_UR_I: |
556 | /* check for empty reader device (beginning of chain) */ | 599 | return verify_uri_device(urd); |
557 | rc = diag_read_next_file_info(&fcb, 0); | ||
558 | if (rc) | ||
559 | return rc; | ||
560 | |||
561 | /* open file on virtual reader */ | ||
562 | buf = kmalloc(PAGE_SIZE, GFP_KERNEL); | ||
563 | if (!buf) | ||
564 | return -ENOMEM; | ||
565 | rc = diag_read_file(urd->dev_id.devno, buf); | ||
566 | kfree(buf); | ||
567 | |||
568 | if ((rc != 0) && (rc != -ENODATA)) /* EOF does not hurt */ | ||
569 | return rc; | ||
570 | return 0; | ||
571 | default: | 600 | default: |
572 | return -ENOTSUPP; | 601 | return -ENOTSUPP; |
573 | } | 602 | } |
574 | } | 603 | } |
575 | 604 | ||
576 | static int get_file_reclen(struct urdev *urd) | 605 | static int get_uri_file_reclen(struct urdev *urd) |
577 | { | 606 | { |
578 | struct file_control_block fcb; | 607 | struct file_control_block *fcb; |
579 | int rc; | 608 | int rc; |
580 | 609 | ||
610 | fcb = kmalloc(sizeof(*fcb), GFP_KERNEL | GFP_DMA); | ||
611 | if (!fcb) | ||
612 | return -ENOMEM; | ||
613 | rc = diag_read_next_file_info(fcb, 0); | ||
614 | if (rc) | ||
615 | goto fail_free; | ||
616 | if (fcb->file_stat & FLG_CP_DUMP) | ||
617 | rc = 0; | ||
618 | else | ||
619 | rc = fcb->rec_len; | ||
620 | |||
621 | fail_free: | ||
622 | kfree(fcb); | ||
623 | return rc; | ||
624 | } | ||
625 | |||
626 | static int get_file_reclen(struct urdev *urd) | ||
627 | { | ||
581 | switch (urd->class) { | 628 | switch (urd->class) { |
582 | case DEV_CLASS_UR_O: | 629 | case DEV_CLASS_UR_O: |
583 | return 0; | 630 | return 0; |
584 | case DEV_CLASS_UR_I: | 631 | case DEV_CLASS_UR_I: |
585 | rc = diag_read_next_file_info(&fcb, 0); | 632 | return get_uri_file_reclen(urd); |
586 | if (rc) | ||
587 | return rc; | ||
588 | break; | ||
589 | default: | 633 | default: |
590 | return -ENOTSUPP; | 634 | return -ENOTSUPP; |
591 | } | 635 | } |
592 | if (fcb.file_stat & FLG_CP_DUMP) | ||
593 | return 0; | ||
594 | |||
595 | return fcb.rec_len; | ||
596 | } | 636 | } |
597 | 637 | ||
598 | static int ur_open(struct inode *inode, struct file *file) | 638 | static int ur_open(struct inode *inode, struct file *file) |
diff --git a/drivers/s390/char/vmur.h b/drivers/s390/char/vmur.h index 16d0a4e38e40..2b3c564e0472 100644 --- a/drivers/s390/char/vmur.h +++ b/drivers/s390/char/vmur.h | |||
@@ -50,7 +50,10 @@ struct file_control_block { | |||
50 | char rest[200]; | 50 | char rest[200]; |
51 | } __attribute__ ((packed)); | 51 | } __attribute__ ((packed)); |
52 | 52 | ||
53 | #define FLG_CP_DUMP 0x10 | 53 | #define FLG_SYSTEM_HOLD 0x04 |
54 | #define FLG_CP_DUMP 0x10 | ||
55 | #define FLG_USER_HOLD 0x20 | ||
56 | #define FLG_IN_USE 0x80 | ||
54 | 57 | ||
55 | /* | 58 | /* |
56 | * A struct urdev is created for each ur device that is made available | 59 | * A struct urdev is created for each ur device that is made available |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 1c27a5a06b49..5635e656c1a3 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -79,6 +79,7 @@ css_alloc_subchannel(struct subchannel_id schid) | |||
79 | sch->schib.pmcw.intparm = (__u32)(unsigned long)sch; | 79 | sch->schib.pmcw.intparm = (__u32)(unsigned long)sch; |
80 | ret = cio_modify(sch); | 80 | ret = cio_modify(sch); |
81 | if (ret) { | 81 | if (ret) { |
82 | kfree(sch->lock); | ||
82 | kfree(sch); | 83 | kfree(sch); |
83 | return ERR_PTR(ret); | 84 | return ERR_PTR(ret); |
84 | } | 85 | } |
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index ed026a1dc324..03347aed2b3e 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -81,6 +81,7 @@ static __u32 volatile spare_indicator; | |||
81 | static atomic_t spare_indicator_usecount; | 81 | static atomic_t spare_indicator_usecount; |
82 | #define QDIO_MEMPOOL_SCSSC_ELEMENTS 2 | 82 | #define QDIO_MEMPOOL_SCSSC_ELEMENTS 2 |
83 | static mempool_t *qdio_mempool_scssc; | 83 | static mempool_t *qdio_mempool_scssc; |
84 | static struct kmem_cache *qdio_q_cache; | ||
84 | 85 | ||
85 | static debug_info_t *qdio_dbf_setup; | 86 | static debug_info_t *qdio_dbf_setup; |
86 | static debug_info_t *qdio_dbf_sbal; | 87 | static debug_info_t *qdio_dbf_sbal; |
@@ -1617,23 +1618,21 @@ static void | |||
1617 | qdio_release_irq_memory(struct qdio_irq *irq_ptr) | 1618 | qdio_release_irq_memory(struct qdio_irq *irq_ptr) |
1618 | { | 1619 | { |
1619 | int i; | 1620 | int i; |
1621 | struct qdio_q *q; | ||
1620 | 1622 | ||
1621 | for (i=0;i<QDIO_MAX_QUEUES_PER_IRQ;i++) { | 1623 | for (i = 0; i < QDIO_MAX_QUEUES_PER_IRQ; i++) { |
1622 | if (!irq_ptr->input_qs[i]) | 1624 | q = irq_ptr->input_qs[i]; |
1623 | goto next; | 1625 | if (q) { |
1624 | 1626 | free_page((unsigned long) q->slib); | |
1625 | kfree(irq_ptr->input_qs[i]->slib); | 1627 | kmem_cache_free(qdio_q_cache, q); |
1626 | kfree(irq_ptr->input_qs[i]); | 1628 | } |
1627 | 1629 | q = irq_ptr->output_qs[i]; | |
1628 | next: | 1630 | if (q) { |
1629 | if (!irq_ptr->output_qs[i]) | 1631 | free_page((unsigned long) q->slib); |
1630 | continue; | 1632 | kmem_cache_free(qdio_q_cache, q); |
1631 | 1633 | } | |
1632 | kfree(irq_ptr->output_qs[i]->slib); | ||
1633 | kfree(irq_ptr->output_qs[i]); | ||
1634 | |||
1635 | } | 1634 | } |
1636 | kfree(irq_ptr->qdr); | 1635 | free_page((unsigned long) irq_ptr->qdr); |
1637 | free_page((unsigned long) irq_ptr); | 1636 | free_page((unsigned long) irq_ptr); |
1638 | } | 1637 | } |
1639 | 1638 | ||
@@ -1680,44 +1679,35 @@ qdio_alloc_qs(struct qdio_irq *irq_ptr, | |||
1680 | { | 1679 | { |
1681 | int i; | 1680 | int i; |
1682 | struct qdio_q *q; | 1681 | struct qdio_q *q; |
1683 | int result=-ENOMEM; | ||
1684 | |||
1685 | for (i=0;i<no_input_qs;i++) { | ||
1686 | q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL); | ||
1687 | 1682 | ||
1688 | if (!q) { | 1683 | for (i = 0; i < no_input_qs; i++) { |
1689 | QDIO_PRINT_ERR("kmalloc of q failed!\n"); | 1684 | q = kmem_cache_alloc(qdio_q_cache, GFP_KERNEL); |
1690 | goto out; | 1685 | if (!q) |
1691 | } | 1686 | return -ENOMEM; |
1687 | memset(q, 0, sizeof(*q)); | ||
1692 | 1688 | ||
1693 | q->slib = kmalloc(PAGE_SIZE, GFP_KERNEL); | 1689 | q->slib = (struct slib *) __get_free_page(GFP_KERNEL); |
1694 | if (!q->slib) { | 1690 | if (!q->slib) { |
1695 | QDIO_PRINT_ERR("kmalloc of slib failed!\n"); | 1691 | kmem_cache_free(qdio_q_cache, q); |
1696 | goto out; | 1692 | return -ENOMEM; |
1697 | } | 1693 | } |
1698 | |||
1699 | irq_ptr->input_qs[i]=q; | 1694 | irq_ptr->input_qs[i]=q; |
1700 | } | 1695 | } |
1701 | 1696 | ||
1702 | for (i=0;i<no_output_qs;i++) { | 1697 | for (i = 0; i < no_output_qs; i++) { |
1703 | q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL); | 1698 | q = kmem_cache_alloc(qdio_q_cache, GFP_KERNEL); |
1704 | 1699 | if (!q) | |
1705 | if (!q) { | 1700 | return -ENOMEM; |
1706 | goto out; | 1701 | memset(q, 0, sizeof(*q)); |
1707 | } | ||
1708 | 1702 | ||
1709 | q->slib=kmalloc(PAGE_SIZE,GFP_KERNEL); | 1703 | q->slib = (struct slib *) __get_free_page(GFP_KERNEL); |
1710 | if (!q->slib) { | 1704 | if (!q->slib) { |
1711 | QDIO_PRINT_ERR("kmalloc of slib failed!\n"); | 1705 | kmem_cache_free(qdio_q_cache, q); |
1712 | goto out; | 1706 | return -ENOMEM; |
1713 | } | 1707 | } |
1714 | |||
1715 | irq_ptr->output_qs[i]=q; | 1708 | irq_ptr->output_qs[i]=q; |
1716 | } | 1709 | } |
1717 | 1710 | return 0; | |
1718 | result=0; | ||
1719 | out: | ||
1720 | return result; | ||
1721 | } | 1711 | } |
1722 | 1712 | ||
1723 | static void | 1713 | static void |
@@ -2985,17 +2975,17 @@ qdio_allocate(struct qdio_initialize *init_data) | |||
2985 | QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*)); | 2975 | QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*)); |
2986 | 2976 | ||
2987 | if (!irq_ptr) { | 2977 | if (!irq_ptr) { |
2988 | QDIO_PRINT_ERR("kmalloc of irq_ptr failed!\n"); | 2978 | QDIO_PRINT_ERR("allocation of irq_ptr failed!\n"); |
2989 | return -ENOMEM; | 2979 | return -ENOMEM; |
2990 | } | 2980 | } |
2991 | 2981 | ||
2992 | init_MUTEX(&irq_ptr->setting_up_sema); | 2982 | init_MUTEX(&irq_ptr->setting_up_sema); |
2993 | 2983 | ||
2994 | /* QDR must be in DMA area since CCW data address is only 32 bit */ | 2984 | /* QDR must be in DMA area since CCW data address is only 32 bit */ |
2995 | irq_ptr->qdr=kmalloc(sizeof(struct qdr), GFP_KERNEL | GFP_DMA); | 2985 | irq_ptr->qdr = (struct qdr *) __get_free_page(GFP_KERNEL | GFP_DMA); |
2996 | if (!(irq_ptr->qdr)) { | 2986 | if (!(irq_ptr->qdr)) { |
2997 | free_page((unsigned long) irq_ptr); | 2987 | free_page((unsigned long) irq_ptr); |
2998 | QDIO_PRINT_ERR("kmalloc of irq_ptr->qdr failed!\n"); | 2988 | QDIO_PRINT_ERR("allocation of irq_ptr->qdr failed!\n"); |
2999 | return -ENOMEM; | 2989 | return -ENOMEM; |
3000 | } | 2990 | } |
3001 | QDIO_DBF_TEXT0(0,setup,"qdr:"); | 2991 | QDIO_DBF_TEXT0(0,setup,"qdr:"); |
@@ -3004,6 +2994,7 @@ qdio_allocate(struct qdio_initialize *init_data) | |||
3004 | if (qdio_alloc_qs(irq_ptr, | 2994 | if (qdio_alloc_qs(irq_ptr, |
3005 | init_data->no_input_qs, | 2995 | init_data->no_input_qs, |
3006 | init_data->no_output_qs)) { | 2996 | init_data->no_output_qs)) { |
2997 | QDIO_PRINT_ERR("queue allocation failed!\n"); | ||
3007 | qdio_release_irq_memory(irq_ptr); | 2998 | qdio_release_irq_memory(irq_ptr); |
3008 | return -ENOMEM; | 2999 | return -ENOMEM; |
3009 | } | 3000 | } |
@@ -3895,9 +3886,19 @@ init_QDIO(void) | |||
3895 | if (res) | 3886 | if (res) |
3896 | return res; | 3887 | return res; |
3897 | 3888 | ||
3889 | qdio_q_cache = kmem_cache_create("qdio_q", sizeof(struct qdio_q), | ||
3890 | 256, 0, NULL); | ||
3891 | if (!qdio_q_cache) { | ||
3892 | qdio_release_qdio_memory(); | ||
3893 | return -ENOMEM; | ||
3894 | } | ||
3895 | |||
3898 | res = qdio_register_dbf_views(); | 3896 | res = qdio_register_dbf_views(); |
3899 | if (res) | 3897 | if (res) { |
3898 | kmem_cache_destroy(qdio_q_cache); | ||
3899 | qdio_release_qdio_memory(); | ||
3900 | return res; | 3900 | return res; |
3901 | } | ||
3901 | 3902 | ||
3902 | QDIO_DBF_TEXT0(0,setup,"initQDIO"); | 3903 | QDIO_DBF_TEXT0(0,setup,"initQDIO"); |
3903 | res = bus_create_file(&ccw_bus_type, &bus_attr_qdio_performance_stats); | 3904 | res = bus_create_file(&ccw_bus_type, &bus_attr_qdio_performance_stats); |
@@ -3929,6 +3930,7 @@ cleanup_QDIO(void) | |||
3929 | qdio_release_qdio_memory(); | 3930 | qdio_release_qdio_memory(); |
3930 | qdio_unregister_dbf_views(); | 3931 | qdio_unregister_dbf_views(); |
3931 | mempool_destroy(qdio_mempool_scssc); | 3932 | mempool_destroy(qdio_mempool_scssc); |
3933 | kmem_cache_destroy(qdio_q_cache); | ||
3932 | bus_remove_file(&ccw_bus_type, &bus_attr_qdio_performance_stats); | 3934 | bus_remove_file(&ccw_bus_type, &bus_attr_qdio_performance_stats); |
3933 | printk("qdio: %s: module removed\n",version); | 3935 | printk("qdio: %s: module removed\n",version); |
3934 | } | 3936 | } |
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 0c16a2b39b41..2adf856e44c2 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -86,7 +86,7 @@ struct mpc83xx_spi { | |||
86 | 86 | ||
87 | unsigned nsecs; /* (clock cycle time)/2 */ | 87 | unsigned nsecs; /* (clock cycle time)/2 */ |
88 | 88 | ||
89 | u32 sysclk; | 89 | u32 spibrg; /* SPIBRG input clock */ |
90 | u32 rx_shift; /* RX data reg shift when in qe mode */ | 90 | u32 rx_shift; /* RX data reg shift when in qe mode */ |
91 | u32 tx_shift; /* TX data reg shift when in qe mode */ | 91 | u32 tx_shift; /* TX data reg shift when in qe mode */ |
92 | 92 | ||
@@ -148,6 +148,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | |||
148 | if (value == BITBANG_CS_ACTIVE) { | 148 | if (value == BITBANG_CS_ACTIVE) { |
149 | u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); | 149 | u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); |
150 | u32 len = spi->bits_per_word; | 150 | u32 len = spi->bits_per_word; |
151 | u8 pm; | ||
152 | |||
151 | if (len == 32) | 153 | if (len == 32) |
152 | len = 0; | 154 | len = 0; |
153 | else | 155 | else |
@@ -169,17 +171,20 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | |||
169 | 171 | ||
170 | regval |= SPMODE_LEN(len); | 172 | regval |= SPMODE_LEN(len); |
171 | 173 | ||
172 | if ((mpc83xx_spi->sysclk / spi->max_speed_hz) >= 64) { | 174 | if ((mpc83xx_spi->spibrg / spi->max_speed_hz) >= 64) { |
173 | u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 64); | 175 | pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 64) - 1; |
174 | if (pm > 0x0f) { | 176 | if (pm > 0x0f) { |
175 | printk(KERN_WARNING "MPC83xx SPI: SPICLK can't be less then a SYSCLK/1024!\n" | 177 | dev_err(&spi->dev, "Requested speed is too " |
176 | "Requested SPICLK is %d Hz. Will use %d Hz instead.\n", | 178 | "low: %d Hz. Will use %d Hz instead.\n", |
177 | spi->max_speed_hz, mpc83xx_spi->sysclk / 1024); | 179 | spi->max_speed_hz, |
180 | mpc83xx_spi->spibrg / 1024); | ||
178 | pm = 0x0f; | 181 | pm = 0x0f; |
179 | } | 182 | } |
180 | regval |= SPMODE_PM(pm) | SPMODE_DIV16; | 183 | regval |= SPMODE_PM(pm) | SPMODE_DIV16; |
181 | } else { | 184 | } else { |
182 | u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 4); | 185 | pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 4); |
186 | if (pm) | ||
187 | pm--; | ||
183 | regval |= SPMODE_PM(pm); | 188 | regval |= SPMODE_PM(pm); |
184 | } | 189 | } |
185 | 190 | ||
@@ -429,13 +434,17 @@ static int __init mpc83xx_spi_probe(struct platform_device *dev) | |||
429 | mpc83xx_spi->bitbang.chipselect = mpc83xx_spi_chipselect; | 434 | mpc83xx_spi->bitbang.chipselect = mpc83xx_spi_chipselect; |
430 | mpc83xx_spi->bitbang.setup_transfer = mpc83xx_spi_setup_transfer; | 435 | mpc83xx_spi->bitbang.setup_transfer = mpc83xx_spi_setup_transfer; |
431 | mpc83xx_spi->bitbang.txrx_bufs = mpc83xx_spi_bufs; | 436 | mpc83xx_spi->bitbang.txrx_bufs = mpc83xx_spi_bufs; |
432 | mpc83xx_spi->sysclk = pdata->sysclk; | ||
433 | mpc83xx_spi->activate_cs = pdata->activate_cs; | 437 | mpc83xx_spi->activate_cs = pdata->activate_cs; |
434 | mpc83xx_spi->deactivate_cs = pdata->deactivate_cs; | 438 | mpc83xx_spi->deactivate_cs = pdata->deactivate_cs; |
435 | mpc83xx_spi->qe_mode = pdata->qe_mode; | 439 | mpc83xx_spi->qe_mode = pdata->qe_mode; |
436 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; | 440 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; |
437 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; | 441 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; |
438 | 442 | ||
443 | if (mpc83xx_spi->qe_mode) | ||
444 | mpc83xx_spi->spibrg = pdata->sysclk / 2; | ||
445 | else | ||
446 | mpc83xx_spi->spibrg = pdata->sysclk; | ||
447 | |||
439 | mpc83xx_spi->rx_shift = 0; | 448 | mpc83xx_spi->rx_shift = 0; |
440 | mpc83xx_spi->tx_shift = 0; | 449 | mpc83xx_spi->tx_shift = 0; |
441 | if (mpc83xx_spi->qe_mode) { | 450 | if (mpc83xx_spi->qe_mode) { |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 630f781aeb19..c55459c592b8 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -183,7 +183,9 @@ static int spidev_message(struct spidev_data *spidev, | |||
183 | 183 | ||
184 | if (u_tmp->rx_buf) { | 184 | if (u_tmp->rx_buf) { |
185 | k_tmp->rx_buf = buf; | 185 | k_tmp->rx_buf = buf; |
186 | if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len)) | 186 | if (!access_ok(VERIFY_WRITE, (u8 __user *) |
187 | (ptrdiff_t) u_tmp->rx_buf, | ||
188 | u_tmp->len)) | ||
187 | goto done; | 189 | goto done; |
188 | } | 190 | } |
189 | if (u_tmp->tx_buf) { | 191 | if (u_tmp->tx_buf) { |
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 7dd73546bf43..63436892688c 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig | |||
@@ -6,6 +6,9 @@ menuconfig USB_SUPPORT | |||
6 | bool "USB support" | 6 | bool "USB support" |
7 | depends on HAS_IOMEM | 7 | depends on HAS_IOMEM |
8 | default y | 8 | default y |
9 | ---help--- | ||
10 | This option adds core support for Universal Serial Bus (USB). | ||
11 | You will also need drivers from the following menu to make use of it. | ||
9 | 12 | ||
10 | if USB_SUPPORT | 13 | if USB_SUPPORT |
11 | 14 | ||
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index decfdc8eb9cc..e58c87b3e3a0 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -127,8 +127,20 @@ static int last_fb_vc = MAX_NR_CONSOLES - 1; | |||
127 | static int fbcon_is_default = 1; | 127 | static int fbcon_is_default = 1; |
128 | static int fbcon_has_exited; | 128 | static int fbcon_has_exited; |
129 | static int primary_device = -1; | 129 | static int primary_device = -1; |
130 | |||
131 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY | ||
130 | static int map_override; | 132 | static int map_override; |
131 | 133 | ||
134 | static inline void fbcon_map_override(void) | ||
135 | { | ||
136 | map_override = 1; | ||
137 | } | ||
138 | #else | ||
139 | static inline void fbcon_map_override(void) | ||
140 | { | ||
141 | } | ||
142 | #endif /* CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY */ | ||
143 | |||
132 | /* font data */ | 144 | /* font data */ |
133 | static char fontname[40]; | 145 | static char fontname[40]; |
134 | 146 | ||
@@ -506,7 +518,7 @@ static int __init fb_console_setup(char *this_opt) | |||
506 | (options[j++]-'0') % FB_MAX; | 518 | (options[j++]-'0') % FB_MAX; |
507 | } | 519 | } |
508 | 520 | ||
509 | map_override = 1; | 521 | fbcon_map_override(); |
510 | } | 522 | } |
511 | 523 | ||
512 | return 1; | 524 | return 1; |
diff --git a/drivers/video/matrox/g450_pll.c b/drivers/video/matrox/g450_pll.c index 7c76e079ca7d..d42346e7fdda 100644 --- a/drivers/video/matrox/g450_pll.c +++ b/drivers/video/matrox/g450_pll.c | |||
@@ -331,16 +331,19 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll, | |||
331 | tmp |= M1064_XPIXCLKCTRL_PLL_UP; | 331 | tmp |= M1064_XPIXCLKCTRL_PLL_UP; |
332 | } | 332 | } |
333 | matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp); | 333 | matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp); |
334 | #ifdef __powerpc__ | 334 | /* DVI PLL preferred for frequencies up to |
335 | /* This is necessary to avoid jitter on PowerPC | 335 | panel link max, standard PLL otherwise */ |
336 | * (OpenFirmware) systems, but apparently | 336 | if (fout >= MINFO->max_pixel_clock_panellink) |
337 | * introduces jitter, at least on a x86-64 | 337 | tmp = 0; |
338 | * using DVI. | 338 | else tmp = |
339 | * A simple workaround is disable for non-PPC. | 339 | M1064_XDVICLKCTRL_DVIDATAPATHSEL | |
340 | */ | 340 | M1064_XDVICLKCTRL_C1DVICLKSEL | |
341 | matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0); | 341 | M1064_XDVICLKCTRL_C1DVICLKEN | |
342 | #endif /* __powerpc__ */ | 342 | M1064_XDVICLKCTRL_DVILOOPCTL | |
343 | matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl); | 343 | M1064_XDVICLKCTRL_P1LOOPBWDTCTL; |
344 | matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL,tmp); | ||
345 | matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, | ||
346 | xpwrctrl); | ||
344 | 347 | ||
345 | matroxfb_DAC_unlock_irqrestore(flags); | 348 | matroxfb_DAC_unlock_irqrestore(flags); |
346 | } | 349 | } |
diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h index df39c3193735..7a98ce8043d7 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.h +++ b/drivers/video/matrox/matroxfb_DAC1064.h | |||
@@ -33,6 +33,21 @@ void DAC1064_global_restore(WPMINFO2); | |||
33 | #define M1064_XCURCTRL_3COLOR 0x01 /* transparent, 0, 1, 2 */ | 33 | #define M1064_XCURCTRL_3COLOR 0x01 /* transparent, 0, 1, 2 */ |
34 | #define M1064_XCURCTRL_XGA 0x02 /* 0, 1, transparent, complement */ | 34 | #define M1064_XCURCTRL_XGA 0x02 /* 0, 1, transparent, complement */ |
35 | #define M1064_XCURCTRL_XWIN 0x03 /* transparent, transparent, 0, 1 */ | 35 | #define M1064_XCURCTRL_XWIN 0x03 /* transparent, transparent, 0, 1 */ |
36 | /* drive DVI by standard(0)/DVI(1) PLL */ | ||
37 | /* if set(1), C?DVICLKEN and C?DVICLKSEL must be set(1) */ | ||
38 | #define M1064_XDVICLKCTRL_DVIDATAPATHSEL 0x01 | ||
39 | /* drive CRTC1 by standard(0)/DVI(1) PLL */ | ||
40 | #define M1064_XDVICLKCTRL_C1DVICLKSEL 0x02 | ||
41 | /* drive CRTC2 by standard(0)/DVI(1) PLL */ | ||
42 | #define M1064_XDVICLKCTRL_C2DVICLKSEL 0x04 | ||
43 | /* pixel clock allowed to(0)/blocked from(1) driving CRTC1 */ | ||
44 | #define M1064_XDVICLKCTRL_C1DVICLKEN 0x08 | ||
45 | /* DVI PLL loop filter bandwidth selection bits */ | ||
46 | #define M1064_XDVICLKCTRL_DVILOOPCTL 0x30 | ||
47 | /* CRTC2 pixel clock allowed to(0)/blocked from(1) driving CRTC2 */ | ||
48 | #define M1064_XDVICLKCTRL_C2DVICLKEN 0x40 | ||
49 | /* P1PLL loop filter bandwith selection */ | ||
50 | #define M1064_XDVICLKCTRL_P1LOOPBWDTCTL 0x80 | ||
36 | #define M1064_XCURCOL0RED 0x08 | 51 | #define M1064_XCURCOL0RED 0x08 |
37 | #define M1064_XCURCOL0GREEN 0x09 | 52 | #define M1064_XCURCOL0GREEN 0x09 |
38 | #define M1064_XCURCOL0BLUE 0x0A | 53 | #define M1064_XCURCOL0BLUE 0x0A |
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h index d59577c8de86..f3107ad7e545 100644 --- a/drivers/video/matrox/matroxfb_base.h +++ b/drivers/video/matrox/matroxfb_base.h | |||
@@ -424,6 +424,7 @@ struct matrox_fb_info { | |||
424 | } mmio; | 424 | } mmio; |
425 | 425 | ||
426 | unsigned int max_pixel_clock; | 426 | unsigned int max_pixel_clock; |
427 | unsigned int max_pixel_clock_panellink; | ||
427 | 428 | ||
428 | struct matrox_switch* hw_switch; | 429 | struct matrox_switch* hw_switch; |
429 | 430 | ||
diff --git a/drivers/video/matrox/matroxfb_misc.c b/drivers/video/matrox/matroxfb_misc.c index 5948e54b9ef9..ab7fb50bc1de 100644 --- a/drivers/video/matrox/matroxfb_misc.c +++ b/drivers/video/matrox/matroxfb_misc.c | |||
@@ -658,6 +658,7 @@ static int parse_pins5(WPMINFO const struct matrox_bios* bd) { | |||
658 | MINFO->values.reg.mctlwtst_core = (MINFO->values.reg.mctlwtst & ~7) | | 658 | MINFO->values.reg.mctlwtst_core = (MINFO->values.reg.mctlwtst & ~7) | |
659 | wtst_xlat[MINFO->values.reg.mctlwtst & 7]; | 659 | wtst_xlat[MINFO->values.reg.mctlwtst & 7]; |
660 | } | 660 | } |
661 | MINFO->max_pixel_clock_panellink = bd->pins[47] * 4000; | ||
661 | return 0; | 662 | return 0; |
662 | } | 663 | } |
663 | 664 | ||
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c index f9300266044d..7d6c29800d14 100644 --- a/drivers/video/pvr2fb.c +++ b/drivers/video/pvr2fb.c | |||
@@ -94,6 +94,7 @@ | |||
94 | #define DISP_DIWCONF (DISP_BASE + 0xe8) | 94 | #define DISP_DIWCONF (DISP_BASE + 0xe8) |
95 | #define DISP_DIWHSTRT (DISP_BASE + 0xec) | 95 | #define DISP_DIWHSTRT (DISP_BASE + 0xec) |
96 | #define DISP_DIWVSTRT (DISP_BASE + 0xf0) | 96 | #define DISP_DIWVSTRT (DISP_BASE + 0xf0) |
97 | #define DISP_PIXDEPTH (DISP_BASE + 0x108) | ||
97 | 98 | ||
98 | /* Pixel clocks, one for TV output, doubled for VGA output */ | 99 | /* Pixel clocks, one for TV output, doubled for VGA output */ |
99 | #define TV_CLK 74239 | 100 | #define TV_CLK 74239 |
@@ -143,6 +144,7 @@ static struct pvr2fb_par { | |||
143 | unsigned char is_lowres; /* Is horizontal pixel-doubling enabled? */ | 144 | unsigned char is_lowres; /* Is horizontal pixel-doubling enabled? */ |
144 | 145 | ||
145 | unsigned long mmio_base; /* MMIO base */ | 146 | unsigned long mmio_base; /* MMIO base */ |
147 | u32 palette[16]; | ||
146 | } *currentpar; | 148 | } *currentpar; |
147 | 149 | ||
148 | static struct fb_info *fb_info; | 150 | static struct fb_info *fb_info; |
@@ -599,6 +601,7 @@ static void pvr2_init_display(struct fb_info *info) | |||
599 | 601 | ||
600 | /* bits per pixel */ | 602 | /* bits per pixel */ |
601 | fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE); | 603 | fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE); |
604 | fb_writel(bytesperpixel << 2, DISP_PIXDEPTH); | ||
602 | 605 | ||
603 | /* video enable, color sync, interlace, | 606 | /* video enable, color sync, interlace, |
604 | * hsync and vsync polarity (currently unused) */ | 607 | * hsync and vsync polarity (currently unused) */ |
@@ -790,7 +793,7 @@ static int __devinit pvr2fb_common_init(void) | |||
790 | fb_info->fbops = &pvr2fb_ops; | 793 | fb_info->fbops = &pvr2fb_ops; |
791 | fb_info->fix = pvr2_fix; | 794 | fb_info->fix = pvr2_fix; |
792 | fb_info->par = currentpar; | 795 | fb_info->par = currentpar; |
793 | fb_info->pseudo_palette = (void *)(fb_info->par + 1); | 796 | fb_info->pseudo_palette = currentpar->palette; |
794 | fb_info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; | 797 | fb_info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; |
795 | 798 | ||
796 | if (video_output == VO_VGA) | 799 | if (video_output == VO_VGA) |
@@ -807,6 +810,8 @@ static int __devinit pvr2fb_common_init(void) | |||
807 | 810 | ||
808 | if (register_framebuffer(fb_info) < 0) | 811 | if (register_framebuffer(fb_info) < 0) |
809 | goto out_err; | 812 | goto out_err; |
813 | /*Must write PIXDEPTH to register before anything is displayed - so force init */ | ||
814 | pvr2_init_display(fb_info); | ||
810 | 815 | ||
811 | modememused = get_line_length(fb_info->var.xres_virtual, | 816 | modememused = get_line_length(fb_info->var.xres_virtual, |
812 | fb_info->var.bits_per_pixel); | 817 | fb_info->var.bits_per_pixel); |
@@ -1082,14 +1087,15 @@ static int __init pvr2fb_init(void) | |||
1082 | #endif | 1087 | #endif |
1083 | size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32); | 1088 | size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32); |
1084 | 1089 | ||
1085 | fb_info = kzalloc(size, GFP_KERNEL); | 1090 | fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL); |
1091 | |||
1086 | if (!fb_info) { | 1092 | if (!fb_info) { |
1087 | printk(KERN_ERR "Failed to allocate memory for fb_info\n"); | 1093 | printk(KERN_ERR "Failed to allocate memory for fb_info\n"); |
1088 | return -ENOMEM; | 1094 | return -ENOMEM; |
1089 | } | 1095 | } |
1090 | 1096 | ||
1091 | 1097 | ||
1092 | currentpar = (struct pvr2fb_par *)(fb_info + 1); | 1098 | currentpar = fb_info->par; |
1093 | 1099 | ||
1094 | for (i = 0; i < ARRAY_SIZE(board_driver); i++) { | 1100 | for (i = 0; i < ARRAY_SIZE(board_driver); i++) { |
1095 | struct pvr2_board *pvr_board = board_driver + i; | 1101 | struct pvr2_board *pvr_board = board_driver + i; |
@@ -1102,7 +1108,7 @@ static int __init pvr2fb_init(void) | |||
1102 | if (ret != 0) { | 1108 | if (ret != 0) { |
1103 | printk(KERN_ERR "pvr2fb: Failed init of %s device\n", | 1109 | printk(KERN_ERR "pvr2fb: Failed init of %s device\n", |
1104 | pvr_board->name); | 1110 | pvr_board->name); |
1105 | kfree(fb_info); | 1111 | framebuffer_release(fb_info); |
1106 | break; | 1112 | break; |
1107 | } | 1113 | } |
1108 | } | 1114 | } |
@@ -1126,7 +1132,7 @@ static void __exit pvr2fb_exit(void) | |||
1126 | #endif | 1132 | #endif |
1127 | 1133 | ||
1128 | unregister_framebuffer(fb_info); | 1134 | unregister_framebuffer(fb_info); |
1129 | kfree(fb_info); | 1135 | framebuffer_release(fb_info); |
1130 | } | 1136 | } |
1131 | 1137 | ||
1132 | module_init(pvr2fb_init); | 1138 | module_init(pvr2fb_init); |
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c index c97709ecbad0..e7c8db2eb49b 100644 --- a/drivers/video/stifb.c +++ b/drivers/video/stifb.c | |||
@@ -1100,13 +1100,18 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref) | |||
1100 | /* only supported cards are allowed */ | 1100 | /* only supported cards are allowed */ |
1101 | switch (fb->id) { | 1101 | switch (fb->id) { |
1102 | case CRT_ID_VISUALIZE_EG: | 1102 | case CRT_ID_VISUALIZE_EG: |
1103 | /* look for a double buffering device like e.g. the | 1103 | /* Visualize cards can run either in "double buffer" or |
1104 | "INTERNAL_EG_DX1024" in the RDI precisionbook laptop | 1104 | "standard" mode. Depending on the mode, the card reports |
1105 | which won't work. The same device in non-double | 1105 | a different device name, e.g. "INTERNAL_EG_DX1024" in double |
1106 | buffering mode returns "INTERNAL_EG_X1024". */ | 1106 | buffer mode and "INTERNAL_EG_X1024" in standard mode. |
1107 | if (strstr(sti->outptr.dev_name, "EG_DX")) { | 1107 | Since this driver only supports standard mode, we check |
1108 | printk(KERN_WARNING | 1108 | if the device name contains the string "DX" and tell the |
1109 | "stifb: ignoring '%s'. Disable double buffering in IPL menu.\n", | 1109 | user how to reconfigure the card. */ |
1110 | if (strstr(sti->outptr.dev_name, "DX")) { | ||
1111 | printk(KERN_WARNING "WARNING: stifb framebuffer driver does not " | ||
1112 | "support '%s' in double-buffer mode.\n" | ||
1113 | KERN_WARNING "WARNING: Please disable the double-buffer mode " | ||
1114 | "in IPL menu (the PARISC-BIOS).\n", | ||
1110 | sti->outptr.dev_name); | 1115 | sti->outptr.dev_name); |
1111 | goto out_err0; | 1116 | goto out_err0; |
1112 | } | 1117 | } |