Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI: EC: Don't parse DSDT for EC early init on Compal
ACPI: EC: Rewrite DMI checks
ACPI: dock: fix "sibiling" typo
ACPI: kill overly verbose "throttling states" log messages
ACPI: Fix bound checks for copy_from_user in the acpi /proc code
ACPI: fix bus scanning memory leaks
ACPI: EC: Restart command even if no interrupts from EC
sony-laptop: Don't unregister the SPIC driver if it wasn't registered
sony-laptop: remove _INI call at init time
sony-laptop: SPIC unset IRQF_SHARED, set IRQF_DISABLED
sony-laptop: remove device_ctrl and the SPIC mini drivers

+113 -104
+8 -8
drivers/acpi/dock.c
··· 67 67 struct list_head dependent_devices; 68 68 struct list_head hotplug_devices; 69 69 70 - struct list_head sibiling; 70 + struct list_head sibling; 71 71 struct platform_device *dock_device; 72 72 }; 73 73 static LIST_HEAD(dock_stations); ··· 275 275 276 276 if (is_dock(handle)) 277 277 return 1; 278 - list_for_each_entry(dock_station, &dock_stations, sibiling) { 278 + list_for_each_entry(dock_station, &dock_stations, sibling) { 279 279 if (find_dock_dependent_device(dock_station, handle)) 280 280 return 1; 281 281 } ··· 619 619 * make sure this handle is for a device dependent on the dock, 620 620 * this would include the dock station itself 621 621 */ 622 - list_for_each_entry(dock_station, &dock_stations, sibiling) { 622 + list_for_each_entry(dock_station, &dock_stations, sibling) { 623 623 /* 624 624 * An ATA bay can be in a dock and itself can be ejected 625 625 * seperately, so there are two 'dock stations' which need the ··· 651 651 if (!dock_station_count) 652 652 return; 653 653 654 - list_for_each_entry(dock_station, &dock_stations, sibiling) { 654 + list_for_each_entry(dock_station, &dock_stations, sibling) { 655 655 dd = find_dock_dependent_device(dock_station, handle); 656 656 if (dd) 657 657 dock_del_hotplug_device(dock_station, dd); ··· 787 787 if (event != ACPI_NOTIFY_BUS_CHECK && event != ACPI_NOTIFY_DEVICE_CHECK 788 788 && event != ACPI_NOTIFY_EJECT_REQUEST) 789 789 return 0; 790 - list_for_each_entry(dock_station, &dock_stations, sibiling) { 790 + list_for_each_entry(dock_station, &dock_stations, sibling) { 791 791 if (dock_station->handle == handle) { 792 792 struct dock_data *dock_data; 793 793 ··· 958 958 dock_station->last_dock_time = jiffies - HZ; 959 959 INIT_LIST_HEAD(&dock_station->dependent_devices); 960 960 INIT_LIST_HEAD(&dock_station->hotplug_devices); 961 - INIT_LIST_HEAD(&dock_station->sibiling); 961 + INIT_LIST_HEAD(&dock_station->sibling); 962 962 spin_lock_init(&dock_station->dd_lock); 963 963 mutex_init(&dock_station->hp_lock); 964 964 ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); ··· 1044 1044 add_dock_dependent_device(dock_station, dd); 1045 1045 1046 1046 dock_station_count++; 1047 - list_add(&dock_station->sibiling, &dock_stations); 1047 + list_add(&dock_station->sibling, &dock_stations); 1048 1048 return 0; 1049 1049 1050 1050 dock_add_err_unregister: ··· 1149 1149 struct dock_station *tmp; 1150 1150 1151 1151 unregister_acpi_bus_notifier(&dock_acpi_notifier); 1152 - list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibiling) 1152 + list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling) 1153 1153 dock_remove(dock_station); 1154 1154 } 1155 1155
+47 -9
drivers/acpi/ec.c
··· 119 119 } *boot_ec, *first_ec; 120 120 121 121 static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */ 122 + static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */ 123 + static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */ 122 124 123 125 /* -------------------------------------------------------------------------- 124 126 Transaction Management ··· 234 232 } 235 233 advance_transaction(ec, acpi_ec_read_status(ec)); 236 234 } while (time_before(jiffies, delay)); 237 - if (!ec->curr->irq_count || 238 - (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)) 235 + if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) 239 236 break; 240 - /* try restart command if we get any false interrupts */ 241 237 pr_debug(PREFIX "controller reset, restart transaction\n"); 242 238 spin_lock_irqsave(&ec->curr_lock, flags); 243 239 start_transaction(ec); ··· 899 899 {"", 0}, 900 900 }; 901 901 902 + /* Some BIOS do not survive early DSDT scan, skip it */ 903 + static int ec_skip_dsdt_scan(const struct dmi_system_id *id) 904 + { 905 + EC_FLAGS_SKIP_DSDT_SCAN = 1; 906 + return 0; 907 + } 908 + 909 + /* ASUStek often supplies us with broken ECDT, validate it */ 910 + static int ec_validate_ecdt(const struct dmi_system_id *id) 911 + { 912 + EC_FLAGS_VALIDATE_ECDT = 1; 913 + return 0; 914 + } 915 + 916 + /* MSI EC needs special treatment, enable it */ 917 + static int ec_flag_msi(const struct dmi_system_id *id) 918 + { 919 + EC_FLAGS_MSI = 1; 920 + EC_FLAGS_VALIDATE_ECDT = 1; 921 + return 0; 922 + } 923 + 924 + static struct dmi_system_id __initdata ec_dmi_table[] = { 925 + { 926 + ec_skip_dsdt_scan, "Compal JFL92", { 927 + DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"), 928 + DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL}, 929 + { 930 + ec_flag_msi, "MSI hardware", { 931 + DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star"), 932 + DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star") }, NULL}, 933 + { 934 + ec_validate_ecdt, "ASUS hardware", { 935 + DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, 936 + {}, 937 + }; 938 + 939 + 902 940 int __init acpi_ec_ecdt_probe(void) 903 941 { 904 942 acpi_status status; ··· 949 911 /* 950 912 * Generate a boot ec context 951 913 */ 952 - if (dmi_name_in_vendors("Micro-Star") || 953 - dmi_name_in_vendors("Notebook")) { 954 - pr_info(PREFIX "Enabling special treatment for EC from MSI.\n"); 955 - EC_FLAGS_MSI = 1; 956 - } 914 + dmi_check_system(ec_dmi_table); 957 915 status = acpi_get_table(ACPI_SIG_ECDT, 1, 958 916 (struct acpi_table_header **)&ecdt_ptr); 959 917 if (ACPI_SUCCESS(status)) { ··· 960 926 boot_ec->handle = ACPI_ROOT_OBJECT; 961 927 acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle); 962 928 /* Don't trust ECDT, which comes from ASUSTek */ 963 - if (!dmi_name_in_vendors("ASUS") && EC_FLAGS_MSI == 0) 929 + if (!EC_FLAGS_VALIDATE_ECDT) 964 930 goto install; 965 931 saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 966 932 if (!saved_ec) ··· 968 934 memcpy(saved_ec, boot_ec, sizeof(struct acpi_ec)); 969 935 /* fall through */ 970 936 } 937 + 938 + if (EC_FLAGS_SKIP_DSDT_SCAN) 939 + return -ENODEV; 940 + 971 941 /* This workaround is needed only on some broken machines, 972 942 * which require early EC, but fail to provide ECDT */ 973 943 printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
+2
drivers/acpi/proc.c
··· 398 398 399 399 if (len > 4) 400 400 len = 4; 401 + if (len < 0) 402 + return -EFAULT; 401 403 402 404 if (copy_from_user(strbuf, buffer, len)) 403 405 return -EFAULT;
-7
drivers/acpi/processor_core.c
··· 863 863 goto err_remove_sysfs; 864 864 } 865 865 866 - if (pr->flags.throttling) { 867 - printk(KERN_INFO PREFIX "%s [%s] (supports", 868 - acpi_device_name(device), acpi_device_bid(device)); 869 - printk(" %d throttling states", pr->throttling.state_count); 870 - printk(")\n"); 871 - } 872 - 873 866 return 0; 874 867 875 868 err_remove_sysfs:
+2 -5
drivers/acpi/scan.c
··· 1052 1052 device->flags.bus_address = 1; 1053 1053 } 1054 1054 1055 + kfree(info); 1056 + 1055 1057 /* 1056 1058 * Some devices don't reliably have _HIDs & _CIDs, so add 1057 1059 * synthetic HIDs to make sure drivers can find them. ··· 1327 1325 struct acpi_device **child) 1328 1326 { 1329 1327 acpi_status status; 1330 - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 1331 1328 void *device = NULL; 1332 - 1333 - acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); 1334 - printk(KERN_INFO PREFIX "Enumerating devices from [%s]\n", 1335 - (char *) buffer.pointer); 1336 1329 1337 1330 status = acpi_bus_check_add(handle, 0, ops, &device); 1338 1331 if (ACPI_SUCCESS(status))
+54 -75
drivers/platform/x86/sony-laptop.c
··· 1211 1211 } 1212 1212 } 1213 1213 1214 - /* try to _INI the device if such method exists (ACPI spec 3.0-6.5.1 1215 - * should be respected as we already checked for the device presence above */ 1216 - if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, METHOD_NAME__INI, &handle))) { 1217 - dprintk("Invoking _INI\n"); 1218 - if (ACPI_FAILURE(acpi_evaluate_object(sony_nc_acpi_handle, METHOD_NAME__INI, 1219 - NULL, NULL))) 1220 - dprintk("_INI Method failed\n"); 1221 - } 1222 - 1223 1214 if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "ECON", 1224 1215 &handle))) { 1225 1216 if (acpi_callsetfunc(sony_nc_acpi_handle, "ECON", 1, NULL)) ··· 1390 1399 struct sonypi_event *events; 1391 1400 }; 1392 1401 1393 - struct device_ctrl { 1394 - int model; 1395 - int (*handle_irq)(const u8, const u8); 1396 - u16 evport_offset; 1397 - u8 has_camera; 1398 - u8 has_bluetooth; 1399 - u8 has_wwan; 1400 - struct sonypi_eventtypes *event_types; 1401 - }; 1402 - 1403 1402 struct sony_pic_dev { 1404 - struct device_ctrl *control; 1405 - struct acpi_device *acpi_dev; 1406 - struct sony_pic_irq *cur_irq; 1407 - struct sony_pic_ioport *cur_ioport; 1408 - struct list_head interrupts; 1409 - struct list_head ioports; 1410 - struct mutex lock; 1411 - u8 camera_power; 1412 - u8 bluetooth_power; 1413 - u8 wwan_power; 1403 + struct acpi_device *acpi_dev; 1404 + struct sony_pic_irq *cur_irq; 1405 + struct sony_pic_ioport *cur_ioport; 1406 + struct list_head interrupts; 1407 + struct list_head ioports; 1408 + struct mutex lock; 1409 + struct sonypi_eventtypes *event_types; 1410 + int (*handle_irq)(const u8, const u8); 1411 + int model; 1412 + u16 evport_offset; 1413 + u8 camera_power; 1414 + u8 bluetooth_power; 1415 + u8 wwan_power; 1414 1416 }; 1415 1417 1416 1418 static struct sony_pic_dev spic_dev = { 1417 1419 .interrupts = LIST_HEAD_INIT(spic_dev.interrupts), 1418 1420 .ioports = LIST_HEAD_INIT(spic_dev.ioports), 1419 1421 }; 1422 + 1423 + static int spic_drv_registered; 1420 1424 1421 1425 /* Event masks */ 1422 1426 #define SONYPI_JOGGER_MASK 0x00000001 ··· 1710 1724 return 1; 1711 1725 } 1712 1726 1713 - static struct device_ctrl spic_types[] = { 1714 - { 1715 - .model = SONYPI_DEVICE_TYPE1, 1716 - .handle_irq = NULL, 1717 - .evport_offset = SONYPI_TYPE1_OFFSET, 1718 - .event_types = type1_events, 1719 - }, 1720 - { 1721 - .model = SONYPI_DEVICE_TYPE2, 1722 - .handle_irq = NULL, 1723 - .evport_offset = SONYPI_TYPE2_OFFSET, 1724 - .event_types = type2_events, 1725 - }, 1726 - { 1727 - .model = SONYPI_DEVICE_TYPE3, 1728 - .handle_irq = type3_handle_irq, 1729 - .evport_offset = SONYPI_TYPE3_OFFSET, 1730 - .event_types = type3_events, 1731 - }, 1732 - }; 1733 - 1734 1727 static void sony_pic_detect_device_type(struct sony_pic_dev *dev) 1735 1728 { 1736 1729 struct pci_dev *pcidev; ··· 1717 1752 pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, 1718 1753 PCI_DEVICE_ID_INTEL_82371AB_3, NULL); 1719 1754 if (pcidev) { 1720 - dev->control = &spic_types[0]; 1755 + dev->model = SONYPI_DEVICE_TYPE1; 1756 + dev->evport_offset = SONYPI_TYPE1_OFFSET; 1757 + dev->event_types = type1_events; 1721 1758 goto out; 1722 1759 } 1723 1760 1724 1761 pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, 1725 1762 PCI_DEVICE_ID_INTEL_ICH6_1, NULL); 1726 1763 if (pcidev) { 1727 - dev->control = &spic_types[2]; 1764 + dev->model = SONYPI_DEVICE_TYPE2; 1765 + dev->evport_offset = SONYPI_TYPE2_OFFSET; 1766 + dev->event_types = type2_events; 1728 1767 goto out; 1729 1768 } 1730 1769 1731 1770 pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, 1732 1771 PCI_DEVICE_ID_INTEL_ICH7_1, NULL); 1733 1772 if (pcidev) { 1734 - dev->control = &spic_types[2]; 1773 + dev->model = SONYPI_DEVICE_TYPE3; 1774 + dev->handle_irq = type3_handle_irq; 1775 + dev->evport_offset = SONYPI_TYPE3_OFFSET; 1776 + dev->event_types = type3_events; 1735 1777 goto out; 1736 1778 } 1737 1779 1738 1780 pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, 1739 1781 PCI_DEVICE_ID_INTEL_ICH8_4, NULL); 1740 1782 if (pcidev) { 1741 - dev->control = &spic_types[2]; 1783 + dev->model = SONYPI_DEVICE_TYPE3; 1784 + dev->handle_irq = type3_handle_irq; 1785 + dev->evport_offset = SONYPI_TYPE3_OFFSET; 1786 + dev->event_types = type3_events; 1742 1787 goto out; 1743 1788 } 1744 1789 1745 1790 pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, 1746 1791 PCI_DEVICE_ID_INTEL_ICH9_1, NULL); 1747 1792 if (pcidev) { 1748 - dev->control = &spic_types[2]; 1793 + dev->model = SONYPI_DEVICE_TYPE3; 1794 + dev->handle_irq = type3_handle_irq; 1795 + dev->evport_offset = SONYPI_TYPE3_OFFSET; 1796 + dev->event_types = type3_events; 1749 1797 goto out; 1750 1798 } 1751 1799 1752 1800 /* default */ 1753 - dev->control = &spic_types[1]; 1801 + dev->model = SONYPI_DEVICE_TYPE2; 1802 + dev->evport_offset = SONYPI_TYPE2_OFFSET; 1803 + dev->event_types = type2_events; 1754 1804 1755 1805 out: 1756 1806 if (pcidev) 1757 1807 pci_dev_put(pcidev); 1758 1808 1759 1809 printk(KERN_INFO DRV_PFX "detected Type%d model\n", 1760 - dev->control->model == SONYPI_DEVICE_TYPE1 ? 1 : 1761 - dev->control->model == SONYPI_DEVICE_TYPE2 ? 2 : 3); 1810 + dev->model == SONYPI_DEVICE_TYPE1 ? 1 : 1811 + dev->model == SONYPI_DEVICE_TYPE2 ? 2 : 3); 1762 1812 } 1763 1813 1764 1814 /* camera tests and poweron/poweroff */ ··· 2546 2566 buffer.pointer = resource; 2547 2567 2548 2568 /* setup Type 1 resources */ 2549 - if (spic_dev.control->model == SONYPI_DEVICE_TYPE1) { 2569 + if (spic_dev.model == SONYPI_DEVICE_TYPE1) { 2550 2570 2551 2571 /* setup io resources */ 2552 2572 resource->res1.type = ACPI_RESOURCE_TYPE_IO; ··· 2629 2649 data_mask = inb_p(dev->cur_ioport->io2.minimum); 2630 2650 else 2631 2651 data_mask = inb_p(dev->cur_ioport->io1.minimum + 2632 - dev->control->evport_offset); 2652 + dev->evport_offset); 2633 2653 2634 2654 dprintk("event ([%.2x] [%.2x]) at port 0x%.4x(+0x%.2x)\n", 2635 2655 ev, data_mask, dev->cur_ioport->io1.minimum, 2636 - dev->control->evport_offset); 2656 + dev->evport_offset); 2637 2657 2638 2658 if (ev == 0x00 || ev == 0xff) 2639 2659 return IRQ_HANDLED; 2640 2660 2641 - for (i = 0; dev->control->event_types[i].mask; i++) { 2661 + for (i = 0; dev->event_types[i].mask; i++) { 2642 2662 2643 - if ((data_mask & dev->control->event_types[i].data) != 2644 - dev->control->event_types[i].data) 2663 + if ((data_mask & dev->event_types[i].data) != 2664 + dev->event_types[i].data) 2645 2665 continue; 2646 2666 2647 - if (!(mask & dev->control->event_types[i].mask)) 2667 + if (!(mask & dev->event_types[i].mask)) 2648 2668 continue; 2649 2669 2650 - for (j = 0; dev->control->event_types[i].events[j].event; j++) { 2651 - if (ev == dev->control->event_types[i].events[j].data) { 2670 + for (j = 0; dev->event_types[i].events[j].event; j++) { 2671 + if (ev == dev->event_types[i].events[j].data) { 2652 2672 device_event = 2653 - dev->control-> 2654 - event_types[i].events[j].event; 2673 + dev->event_types[i].events[j].event; 2655 2674 goto found; 2656 2675 } 2657 2676 } ··· 2658 2679 /* Still not able to decode the event try to pass 2659 2680 * it over to the minidriver 2660 2681 */ 2661 - if (dev->control->handle_irq && 2662 - dev->control->handle_irq(data_mask, ev) == 0) 2682 + if (dev->handle_irq && dev->handle_irq(data_mask, ev) == 0) 2663 2683 return IRQ_HANDLED; 2664 2684 2665 2685 dprintk("unknown event ([%.2x] [%.2x]) at port 0x%.4x(+0x%.2x)\n", 2666 2686 ev, data_mask, dev->cur_ioport->io1.minimum, 2667 - dev->control->evport_offset); 2687 + dev->evport_offset); 2668 2688 return IRQ_HANDLED; 2669 2689 2670 2690 found: ··· 2794 2816 /* request IRQ */ 2795 2817 list_for_each_entry_reverse(irq, &spic_dev.interrupts, list) { 2796 2818 if (!request_irq(irq->irq.interrupts[0], sony_pic_irq, 2797 - IRQF_SHARED, "sony-laptop", &spic_dev)) { 2819 + IRQF_DISABLED, "sony-laptop", &spic_dev)) { 2798 2820 dprintk("IRQ: %d - triggering: %d - " 2799 2821 "polarity: %d - shr: %d\n", 2800 2822 irq->irq.interrupts[0], ··· 2927 2949 "Unable to register SPIC driver."); 2928 2950 goto out; 2929 2951 } 2952 + spic_drv_registered = 1; 2930 2953 } 2931 2954 2932 2955 result = acpi_bus_register_driver(&sony_nc_driver); ··· 2939 2960 return 0; 2940 2961 2941 2962 out_unregister_pic: 2942 - if (!no_spic) 2963 + if (spic_drv_registered) 2943 2964 acpi_bus_unregister_driver(&sony_pic_driver); 2944 2965 out: 2945 2966 return result; ··· 2948 2969 static void __exit sony_laptop_exit(void) 2949 2970 { 2950 2971 acpi_bus_unregister_driver(&sony_nc_driver); 2951 - if (!no_spic) 2972 + if (spic_drv_registered) 2952 2973 acpi_bus_unregister_driver(&sony_pic_driver); 2953 2974 } 2954 2975