ACPI & Suspend related patches for 2.6.29
Subsystems (21)
Len Brown
reviewerThese pathces are available on:git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git release
Len Brown
reviewerPATCH 1/94 ACPI: EC: Add some basic check for ECDT data
From: Alexey Starikovskiy <[email protected]>
One more ASUS comes with empty ECDT, add a guard for it...
http://bugzilla.kernel.org/show_bug.cgi?id=11880
--- drivers/acpi/ec.c | 43 ++++++++++++++++++++++--------------------- 1 files changed, 22 insertions(+), 21 deletions(-)
drivers/acpi/ec.c +22 -21
@@ -977,7 +977,6 @@ static const struct acpi_device_id ec_device_ids[] = {int __init acpi_ec_ecdt_probe (void ) { -int ret;acpi_status status;struct acpi_table_ecdt *ecdt_ptr;
@@ -1005,30 +1004,32 @@ int __init acpi_ec_ecdt_probe(void) boot_ec->gpe = ecdt_ptr->gpe; boot_ec->handle =ACPI_ROOT_OBJECT ;acpi_get_handle (ACPI_ROOT_OBJECT , ecdt_ptr->id, &boot_ec->handle); - }else { -/* This workaround is needed only on some broken machines, -* which require early EC, but fail to provide ECDT */ -acpi_handle x; - printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n"); - status =acpi_get_devices (ec_device_ids[0 ].id, ec_parse_device, - boot_ec,NULL ); -/* Check that acpi_get_devices actually find something */ -if (ACPI_FAILURE (status) || !boot_ec->handle) - goto error; -/* We really need to limit this workaround, the only ASUS, -* which needs it, has fake EC._INI method, so use it as flag. -* Keep boot_ec struct as it will be needed soon. -*/ -if (ACPI_FAILURE (acpi_get_handle (boot_ec->handle,"_INI" , &x))) -return -ENODEV ; +/* Add some basic check against completely broken table */ +if (boot_ec->data_addr != boot_ec->command_addr) + goto install; +/* fall through */ } - - ret =ec_install_handlers (boot_ec); -if (!ret) { +/* This workaround is needed only on some broken machines, +* which require early EC, but fail to provide ECDT */ +acpi_handle x; + printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n"); + status =acpi_get_devices (ec_device_ids[0 ].id, ec_parse_device, + boot_ec,NULL ); +/* Check that acpi_get_devices actually find something */ +if (ACPI_FAILURE (status) || !boot_ec->handle) + goto error; +/* We really need to limit this workaround, the only ASUS, +* which needs it, has fake EC._INI method, so use it as flag. +* Keep boot_ec struct as it will be needed soon. +*/ +if (ACPI_FAILURE (acpi_get_handle (boot_ec->handle,"_INI" , &x))) +return -ENODEV ; +install: +if (!ec_install_handlers (boot_ec)) { first_ec = boot_ec;return 0 ; } - error: +error:kfree (boot_ec); boot_ec =NULL ;return -ENODEV ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 2/94 ACPI: EC: fix compilation warning
In reply to Len BrownFrom: Hannes Eder <[email protected]>
Fix the warning introduced in commit c5279dee26c0e8d7c4200993bfc4b540d2469598, and give the dummy variable a more verbose name.
drivers/acpi/ec.c: In function 'acpi_ec_ecdt_probe':
drivers/acpi/ec.c:1015: warning: ISO C90 forbids mixed declarations and code
--- drivers/acpi/ec.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/ec.c +2 -2
@@ -979,6 +979,7 @@ int __init acpi_ec_ecdt_probe(void) {acpi_status status;struct acpi_table_ecdt *ecdt_ptr; +acpi_handle dummy; boot_ec =make_acpi_ec ();if (!boot_ec)
@@ -1011,7 +1012,6 @@ int __init acpi_ec_ecdt_probe(void) }/* This workaround is needed only on some broken machines, * which require early EC, but fail to provide ECDT */ -acpi_handle x; printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n"); status =acpi_get_devices (ec_device_ids[0 ].id, ec_parse_device, boot_ec,NULL );
@@ -1022,7 +1022,7 @@ int __init acpi_ec_ecdt_probe(void)* which needs it, has fake EC._INI method, so use it as flag. * Keep boot_ec struct as it will be needed soon. */ -if (ACPI_FAILURE (acpi_get_handle (boot_ec->handle,"_INI" , &x))) +if (ACPI_FAILURE (acpi_get_handle (boot_ec->handle,"_INI" , &dummy)))return -ENODEV ; install:if (!ec_install_handlers (boot_ec)) {
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 3/94 /proc/acpi/alarm: handle day-of-month wraparound on readback
In reply to Len BrownFrom: Mark Lord <[email protected]>
Fix month wrap issue with readback from /proc/acpi/alarm This bug has been around *forever*.
$ echo '2008-12-01 10:36:20' > /proc/acpi/alarm $ cat /proc/acpi/alarm 2008-11-01 10:36:20
Note how the readback above shows the month incorrectly when the alarm is set in the *next* calendar month. But with this patch applied, it shows the correct month (12).
--- drivers/acpi/sleep/proc.c | 53 +++++++++++++++++++++++++++----------------- 1 files changed, 32 insertions(+), 21 deletions(-)
drivers/acpi/sleep/proc.c +32 -21
@@ -84,12 +84,15 @@ acpi_system_write_sleep(struct file *file,#define HAVE_ACPI_LEGACY_ALARM #endif +static u32 cmos_bcd_read (int offset,int rtc_control); +#ifdef HAVE_ACPI_LEGACY_ALARM static int acpi_system_alarm_seq_show (struct seq_file *seq,void *offset) {u32 sec, min, hr;u32 day, mo, yr, cent =0 ; +u32 today =0 ;unsigned char rtc_control =0 ;unsigned long flags;
@@ -97,38 +100,32 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset)spin_lock_irqsave (&rtc_lock, flags); - sec =CMOS_READ (RTC_SECONDS_ALARM ); - min =CMOS_READ (RTC_MINUTES_ALARM ); - hr =CMOS_READ (RTC_HOURS_ALARM ); rtc_control =CMOS_READ (RTC_CONTROL ); + sec =cmos_bcd_read (RTC_SECONDS_ALARM , rtc_control); + min =cmos_bcd_read (RTC_MINUTES_ALARM , rtc_control); + hr =cmos_bcd_read (RTC_HOURS_ALARM , rtc_control);/* If we ever get an FACP with proper values... */ -if (acpi_gbl_FADT.day_alarm) +if (acpi_gbl_FADT.day_alarm) {/* ACPI spec: only low 6 its should be cared */ day =CMOS_READ (acpi_gbl_FADT.day_alarm) &0x3F ; -else - day =CMOS_READ (RTC_DAY_OF_MONTH ); +if (!(rtc_control &RTC_DM_BINARY ) ||RTC_ALWAYS_BCD ) + day =bcd2bin (day); + }else + day =cmos_bcd_read (RTC_DAY_OF_MONTH , rtc_control);if (acpi_gbl_FADT.month_alarm) - mo =CMOS_READ (acpi_gbl_FADT.month_alarm); -else - mo =CMOS_READ (RTC_MONTH ); + mo =cmos_bcd_read (acpi_gbl_FADT.month_alarm, rtc_control); +else { + mo =cmos_bcd_read (RTC_MONTH , rtc_control); + today =cmos_bcd_read (RTC_DAY_OF_MONTH , rtc_control); + }if (acpi_gbl_FADT.century) - cent =CMOS_READ (acpi_gbl_FADT.century); + cent =cmos_bcd_read (acpi_gbl_FADT.century, rtc_control); - yr =CMOS_READ (RTC_YEAR ); + yr =cmos_bcd_read (RTC_YEAR , rtc_control);spin_unlock_irqrestore (&rtc_lock, flags); -if (!(rtc_control &RTC_DM_BINARY ) ||RTC_ALWAYS_BCD ) { - sec =bcd2bin (sec); - min =bcd2bin (min); - hr =bcd2bin (hr); - day =bcd2bin (day); - mo =bcd2bin (mo); - yr =bcd2bin (yr); - cent =bcd2bin (cent); - } -/* we're trusting the FADT (see above) */ if (!acpi_gbl_FADT.century)/* If we're not trusting the FADT, we should at least make it
@@ -153,6 +150,20 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset)else yr += cent *100 ; +/* +* Show correct dates for alarms up to a month into the future. +* This solves issues for nearly all situations with the common +* 30-day alarm clocks in PC hardware. +*/ +if (day < today) { +if (mo <12 ) { + mo +=1 ; + }else { + mo =1 ; + yr +=1 ; + } + } +seq_printf (seq,"%4.4u-" , yr); (mo >12 ) ?seq_puts (seq,"**-" ) :seq_printf (seq,"%2.2u-" , mo); (day >31 ) ?seq_puts (seq,"** " ) :seq_printf (seq,"%2.2u " , day);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 4/94 ACPI: video: Fix reversed brightness behavior on ThinkPad SL series
In reply to Len BrownFrom: Zhang Rui <[email protected]>
Section B.6.2 of ACPI 3.0b specification that defines _BCL method doesn't require the brightness levels returned to be sorted. At least ThinkPad SL300 (and probably all IdeaPads) returns the array reversed (i.e. bightest levels have lowest indexes), which causes the brightness management behave in completely reversed manner on these machines (brightness increases when the laptop is idle, while the display dims when used).
Sorting the array by brightness level values after reading the list fixes the issue.
http://bugzilla.kernel.org/show_bug.cgi?id=12037
--- drivers/acpi/video.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
drivers/acpi/video.c +15 -0
@@ -36,6 +36,7 @@#include <linux/backlight.h> #include <linux/thermal.h> #include <linux/video_output.h> +#include <linux/sort.h> #include <asm/uaccess.h> #include <acpi/acpi_bus.h>
@@ -626,6 +627,16 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) }/* +* Simple comparison function used to sort backlight levels. +*/ + +static int +acpi_video_cmp_level (const void *a,const void *b) +{ +return *(int *)a - *(int *)b; +} + +/* * Arg: * device : video output device (LCD, CRT, ..) *
@@ -676,6 +687,10 @@ acpi_video_init_brightness(struct acpi_video_device *device) count++; } +/* don't sort the first two brightness levels */ +sort (&br->levels[2 ], count -2 ,sizeof (br->levels[2 ]), + acpi_video_cmp_level,NULL ); +if (count <2 ) goto out_free_levels;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 5/94 Hibernate: Call platform_begin before swsusp_shrink_memory
In reply to Len BrownFrom: Zhang Rui <[email protected]>
Call platform_begin() before swsusp_shrink_memory() so that we can always allocate enough memory to save the ACPI NVS region from platform_begin().
--- kernel/power/disk.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
kernel/power/disk.c +3 -3
@@ -259,12 +259,12 @@ int hibernation_snapshot(int platform_mode) {int error, ftrace_save; -/* Free memory before shutting down devices. */ - error =swsusp_shrink_memory (); + error =platform_begin (platform_mode);if (error)return error; - error =platform_begin (platform_mode); +/* Free memory before shutting down devices. */ + error =swsusp_shrink_memory ();if (error) goto Close;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 6/94 ACPI hibernate: Add a mechanism to save/restore ACPI NVS memory
In reply to Len BrownFrom: Rafael J. Wysocki <[email protected]>
According to the ACPI Specification 3.0b, Section 15.3.2, "OSPM will call the _PTS control method some time before entering a sleeping state, to allow the platform's AML code to update this memory image before entering the sleeping state. After the system awakes from an S4 state, OSPM will restore this memory area and call the _WAK control method to enable the BIOS to reclaim its memory image." For this reason, implement a mechanism allowing us to save the NVS memory during hibernation and to restore it during the subsequent resume.
Based on a patch by Zhang Rui.
--- drivers/acpi/sleep/main.c | 53 +++++++++++++++++--- include/linux/suspend.h | 13 +++++ kernel/power/swsusp.c | 122 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 180 insertions(+), 8 deletions(-)
drivers/acpi/sleep/main.c +45 -8
@@ -394,9 +394,25 @@ void __init acpi_no_s4_hw_signature(void)static int acpi_hibernation_begin (void ) { - acpi_target_sleep_state =ACPI_STATE_S4 ; -acpi_sleep_tts_switch (acpi_target_sleep_state); -return 0 ; +int error; + + error =hibernate_nvs_alloc (); +if (!error) { + acpi_target_sleep_state =ACPI_STATE_S4 ; +acpi_sleep_tts_switch (acpi_target_sleep_state); + } + +return error; +} + +static int acpi_hibernation_pre_snapshot (void ) +{ +int error =acpi_pm_prepare (); + +if (!error) +hibernate_nvs_save (); + +return error; }static int acpi_hibernation_enter (void )
@@ -417,6 +433,12 @@ static int acpi_hibernation_enter(void)return ACPI_SUCCESS (status) ?0 : -EFAULT ; } +static void acpi_hibernation_finish (void ) +{ +hibernate_nvs_free (); +acpi_pm_finish (); +} +static void acpi_hibernation_leave (void ) {/*
@@ -432,6 +454,8 @@ static void acpi_hibernation_leave(void) "cannot resume!\n");panic ("ACPI S4 hardware signature mismatch" ); } +/* Restore the NVS memory area */ +hibernate_nvs_restore (); }static void acpi_pm_enable_gpes (void )
@@ -442,8 +466,8 @@ static void acpi_pm_enable_gpes(void)static struct platform_hibernation_ops acpi_hibernation_ops = { .begin = acpi_hibernation_begin, .end = acpi_pm_end, - .pre_snapshot = acpi_pm_prepare, - .finish = acpi_pm_finish, + .pre_snapshot = acpi_hibernation_pre_snapshot, + .finish = acpi_hibernation_finish, .prepare = acpi_pm_prepare, .enter = acpi_hibernation_enter, .leave = acpi_hibernation_leave,
@@ -469,8 +493,21 @@ static int acpi_hibernation_begin_old(void) error =acpi_sleep_prepare (ACPI_STATE_S4 ); +if (!error) { + error =hibernate_nvs_alloc (); +if (!error) + acpi_target_sleep_state =ACPI_STATE_S4 ; + } +return error; +} + +static int acpi_hibernation_pre_snapshot_old (void ) +{ +int error =acpi_pm_disable_gpes (); +if (!error) - acpi_target_sleep_state =ACPI_STATE_S4 ; +hibernate_nvs_save (); +return error; }
@@ -481,8 +518,8 @@ static int acpi_hibernation_begin_old(void)static struct platform_hibernation_ops acpi_hibernation_ops_old = { .begin = acpi_hibernation_begin_old, .end = acpi_pm_end, - .pre_snapshot = acpi_pm_disable_gpes, - .finish = acpi_pm_finish, + .pre_snapshot = acpi_hibernation_pre_snapshot_old, + .finish = acpi_hibernation_finish, .prepare = acpi_pm_disable_gpes, .enter = acpi_hibernation_enter, .leave = acpi_hibernation_leave,
include/linux/suspend.h +13 -0
@@ -232,6 +232,11 @@ extern unsigned long get_safe_page(gfp_t gfp_mask);extern void hibernation_set_ops (struct platform_hibernation_ops *ops);extern int hibernate (void ); +extern int hibernate_nvs_register (unsigned long start,unsigned long size); +extern int hibernate_nvs_alloc (void ); +extern void hibernate_nvs_free (void ); +extern void hibernate_nvs_save (void ); +extern void hibernate_nvs_restore (void );#else /* CONFIG_HIBERNATION */ static inline int swsusp_page_is_forbidden (struct page *p) {return 0 ; }static inline void swsusp_set_page_free (struct page *p) {}
@@ -239,6 +244,14 @@ static inline void swsusp_unset_page_free(struct page *p) {}static inline void hibernation_set_ops (struct platform_hibernation_ops *ops) {}static inline int hibernate (void ) {return -ENOSYS ; } +static inline int hibernate_nvs_register (unsigned long a,unsigned long b) +{ +return 0 ; +} +static inline int hibernate_nvs_alloc (void ) {return 0 ; } +static inline void hibernate_nvs_free (void ) {} +static inline void hibernate_nvs_save (void ) {} +static inline void hibernate_nvs_restore (void ) {}#endif /* CONFIG_HIBERNATION */ #ifdef CONFIG_PM_SLEEP
kernel/power/swsusp.c +122 -0
125 lines not on this page · raw message
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 7/94 x86 hibernate: Mark ACPI NVS memory region at startup
In reply to Len BrownFrom: Rafael J. Wysocki <[email protected]>
Introduce new initcall for marking the ACPI NVS memory at startup, so that it can be saved/restored during hibernation/resume.
Based on a patch by Zhang Rui.
--- arch/x86/kernel/e820.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
arch/x86/kernel/e820.c +21 -0
@@ -665,6 +665,27 @@ void __init e820_mark_nosave_regions(unsigned long limit_pfn) }#endif +#ifdef CONFIG_HIBERNATION +/** +* Mark ACPI NVS memory region, so that we can save/restore it during +* hibernation and the subsequent resume. +*/ +static int __init e820_mark_nvs_memory (void ) +{ +int i; + +for (i =0 ; i < e820.nr_map; i++) { +struct e820entry *ei = &e820.map[i]; + +if (ei->type ==E820_NVS ) +hibernate_nvs_register (ei->addr, ei->size); + } + +return 0 ; +} +core_initcall (e820_mark_nvs_memory); +#endif +/* * Early reserved memory areas. */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 8/94 ACPI hibernate: Introduce new kernel parameter acpi_sleep=s4_nonvs
In reply to Len BrownFrom: Rafael J. Wysocki <[email protected]>
On some machines it may be necessary to disable the saving/restoring of the ACPI NVS memory region during hibernation/resume. For this purpose, introduce new ACPI kernel command line option acpi_sleep=s4_nonvs.
Based on a patch by Zhang Rui.
--- Documentation/kernel-parameters.txt | 5 ++++- arch/x86/kernel/acpi/sleep.c | 2 ++ drivers/acpi/sleep/main.c | 18 ++++++++++++++++-- include/linux/acpi.h | 1 + 4 files changed, 23 insertions(+), 3 deletions(-)
Documentation/kernel-parameters.txt +4 -1
@@ -149,7 +149,8 @@ and is between 256 and 4096 characters. It is defined in the file default: 0 acpi_sleep= [HW,ACPI] Sleep options - Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering } + Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, + old_ordering, s4_nonvs } See Documentation/power/video.txt for s3_bios and s3_mode. s3_beep is for debugging; it makes the PC's speaker beep as soon as the kernel's real-mode entry point is called.
@@ -159,6 +160,8 @@ and is between 256 and 4096 characters. It is defined in the file control method, wrt putting devices into low power states, to be enforced (the ACPI 2.0 ordering of _PTS is used by default). + s4_nonvs prevents the kernel from saving/restoring the + ACPI NVS memory during hibernation. acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode Format: { level | edge | high | low }
arch/x86/kernel/acpi/sleep.c +2 -0
@@ -159,6 +159,8 @@ static int __init acpi_sleep_setup(char *str)#endif if (strncmp (str,"old_ordering" ,12 ) ==0 )acpi_old_suspend_ordering (); +if (strncmp (str,"s4_nonvs" ,8 ) ==0 ) +acpi_s4_no_nvs (); str =strchr (str,',' );if (str !=NULL ) str +=strspn (str,", \t" );
drivers/acpi/sleep/main.c +16 -2
@@ -101,6 +101,19 @@ void __init acpi_old_suspend_ordering(void)* cases. */ static bool set_sci_en_on_resume; +/* +* The ACPI specification wants us to save NVS memory regions during hibernation +* and to restore them during the subsequent resume. However, it is not certain +* if this mechanism is going to work on all machines, so we allow the user to +* disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line +* option. +*/ +static bool s4_no_nvs; + +void __init acpi_s4_no_nvs (void ) +{ + s4_no_nvs = true; +}/** * acpi_pm_disable_gpes - Disable the GPEs.
@@ -396,7 +409,7 @@ static int acpi_hibernation_begin(void) {int error; - error =hibernate_nvs_alloc (); + error = s4_no_nvs ?0 :hibernate_nvs_alloc ();if (!error) { acpi_target_sleep_state =ACPI_STATE_S4 ;acpi_sleep_tts_switch (acpi_target_sleep_state);
@@ -494,7 +507,8 @@ static int acpi_hibernation_begin_old(void) error =acpi_sleep_prepare (ACPI_STATE_S4 );if (!error) { - error =hibernate_nvs_alloc (); +if (!s4_no_nvs) + error =hibernate_nvs_alloc ();if (!error) acpi_target_sleep_state =ACPI_STATE_S4 ; }
include/linux/acpi.h +1 -0
@@ -270,6 +270,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n,#ifdef CONFIG_PM_SLEEP void __init acpi_no_s4_hw_signature (void );void __init acpi_old_suspend_ordering (void ); +void __init acpi_s4_no_nvs (void );#endif /* CONFIG_PM_SLEEP */ #else /* CONFIG_ACPI */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 9/94 Hibernate: Do not oops on resume if image data are incorrect
In reply to Len BrownFrom: Rafael J. Wysocki <[email protected]>
During resume from hibernation using the userland interface image data are being passed from the used space process to the kernel. These data need not be valid, but currently the kernel sometimes oopses if it gets invalid image data, which is wrong. Make the kernel return error codes to the user space in such cases.
--- kernel/power/snapshot.c | 43 ++++++++++++++++++++++++++++++++----------- 1 files changed, 32 insertions(+), 11 deletions(-)
kernel/power/snapshot.c +32 -11
@@ -519,6 +519,14 @@ static int memory_bm_test_bit(struct memory_bitmap *bm, unsigned long pfn)return test_bit (bit, addr); } +static bool memory_bm_pfn_present (struct memory_bitmap *bm,unsigned long pfn) +{ +void *addr; +unsigned int bit; + +return !memory_bm_find_bit (bm, pfn, &addr, &bit); +} +/** * memory_bm_next_pfn - find the pfn that corresponds to the next set bit * in the bitmap @bm. If the pfn cannot be found, BM_END_OF_MAP is
@@ -1459,9 +1467,7 @@ load_header(struct swsusp_info *info)* unpack_orig_pfns - for each element of @buf[] (1 page at a time) set * the corresponding bit in the memory bitmap @bm */ - -static inline void -unpack_orig_pfns (unsigned long *buf,struct memory_bitmap *bm) +static int unpack_orig_pfns (unsigned long *buf,struct memory_bitmap *bm) {int j;
@@ -1469,8 +1475,13 @@ unpack_orig_pfns(unsigned long *buf, struct memory_bitmap *bm)if (unlikely (buf[j] ==BM_END_OF_MAP ))break ; -memory_bm_set_bit (bm, buf[j]); +if (memory_bm_pfn_present (bm, buf[j])) +memory_bm_set_bit (bm, buf[j]); +else +return -EFAULT ; } + +return 0 ; }/* List of "safe" pages that may be used to store data loaded from the suspend
@@ -1608,7 +1619,7 @@ get_highmem_page_buffer(struct page *page, struct chain_allocator *ca) pbe =chain_alloc (ca,sizeof (struct highmem_pbe ));if (!pbe) {swsusp_free (); -return NULL ; +return ERR_PTR (-ENOMEM ); } pbe->orig_page = page;if (safe_highmem_pages >0 ) {
@@ -1677,7 +1688,7 @@ prepare_highmem_image(struct memory_bitmap *bm, unsigned int *nr_highmem_p)static inline void *get_highmem_page_buffer (struct page *page,struct chain_allocator *ca) { -return NULL ; +return ERR_PTR (-EINVAL ); }static inline void copy_last_highmem_page (void ) {}
@@ -1788,8 +1799,13 @@ prepare_image(struct memory_bitmap *new_bm, struct memory_bitmap *bm)static void *get_buffer (struct memory_bitmap *bm,struct chain_allocator *ca) {struct pbe *pbe; -struct page *page =pfn_to_page (memory_bm_next_pfn (bm)); +struct page *page; +unsigned long pfn =memory_bm_next_pfn (bm); +if (pfn ==BM_END_OF_MAP ) +return ERR_PTR (-EFAULT ); + + page =pfn_to_page (pfn);if (PageHighMem (page))return get_highmem_page_buffer (page, ca);
@@ -1805,7 +1821,7 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca) pbe =chain_alloc (ca,sizeof (struct pbe ));if (!pbe) {swsusp_free (); -return NULL ; +return ERR_PTR (-ENOMEM ); } pbe->orig_address =page_address (page); pbe->address = safe_pages_list;
@@ -1868,7 +1884,10 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count)return error; }else if (handle->prev <= nr_meta_pages) { -unpack_orig_pfns (buffer, ©_bm); + error =unpack_orig_pfns (buffer, ©_bm); +if (error) +return error; +if (handle->prev == nr_meta_pages) { error =prepare_image (&orig_bm, ©_bm);if (error)
@@ -1879,12 +1898,14 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count) restore_pblist =NULL ; handle->buffer =get_buffer (&orig_bm, &ca); handle->sync_read =0 ; -if (!handle->buffer) -return -ENOMEM ; +if (IS_ERR (handle->buffer)) +return PTR_ERR (handle->buffer); } }else {copy_last_highmem_page (); handle->buffer =get_buffer (&orig_bm, &ca); +if (IS_ERR (handle->buffer)) +return PTR_ERR (handle->buffer);if (handle->buffer != buffer) handle->sync_read =0 ; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 10/94 Hibernate: Take overlapping zones into account (rev. 2)
In reply to Len BrownFrom: Rafael J. Wysocki <[email protected]>
It has been requested to make hibernation work with memory hotplugging enabled and for this purpose the hibernation code has to be reworked to take the possible overlapping of zones into account. Thus, rework the hibernation memory bitmaps code to prevent duplication of PFNs from occuring and add checks to make sure that one page frame will not be marked as saveable many times.
Additionally, use list.h lists instead of open-coded lists to implement the memory bitmaps.
--- kernel/power/snapshot.c | 325 ++++++++++++++++++++++++----------------------- 1 files changed, 166 insertions(+), 159 deletions(-)
kernel/power/snapshot.c +166 -159
@@ -25,6 +25,7 @@#include <linux/syscalls.h> #include <linux/console.h> #include <linux/highmem.h> +#include <linux/list.h> #include <asm/uaccess.h> #include <asm/mmu_context.h>
@@ -192,12 +193,6 @@ static void *chain_alloc(struct chain_allocator *ca, unsigned int size)return ret; } -static void chain_free (struct chain_allocator *ca,int clear_page_nosave) -{ -free_list_of_pages (ca->chain, clear_page_nosave); -memset (ca,0 ,sizeof (struct chain_allocator )); -} -/** * Data types related to memory bitmaps. *
@@ -233,7 +228,7 @@ static void chain_free(struct chain_allocator *ca, int clear_page_nosave)#define BM_BITS_PER_BLOCK (PAGE_SIZE << 3)struct bm_block { -struct bm_block *next;/* next element of the list */ +struct list_head hook;/* hook into a list of bitmap blocks */ unsigned long start_pfn;/* pfn represented by the first bit */ unsigned long end_pfn;/* pfn represented by the last bit plus 1 */ unsigned long *data;/* bitmap representing pages */
@@ -244,24 +239,15 @@ static inline unsigned long bm_block_bits(struct bm_block *bb)return bb->end_pfn - bb->start_pfn; } -struct zone_bitmap { -struct zone_bitmap *next;/* next element of the list */ -unsigned long start_pfn;/* minimal pfn in this zone */ -unsigned long end_pfn;/* maximal pfn in this zone plus 1 */ -struct bm_block *bm_blocks;/* list of bitmap blocks */ -struct bm_block *cur_block;/* recently used bitmap block */ -}; -/* strcut bm_position is used for browsing memory bitmaps */ struct bm_position { -struct zone_bitmap *zone_bm;struct bm_block *block;int bit; };struct memory_bitmap { -struct zone_bitmap *zone_bm_list;/* list of zone bitmaps */ +struct list_head blocks;/* list of bitmap blocks */ struct linked_page *p_list;/* list of pages used to store zone * bitmap objects and bitmap block * objects
@@ -273,11 +259,7 @@ struct memory_bitmap {static void memory_bm_position_reset (struct memory_bitmap *bm) { -struct zone_bitmap *zone_bm; - - zone_bm = bm->zone_bm_list; - bm->cur.zone_bm = zone_bm; - bm->cur.block = zone_bm->bm_blocks; + bm->cur.block = list_entry(bm->blocks.next, struct bm_block, hook); bm->cur.bit =0 ; }
@@ -285,151 +267,184 @@ static void memory_bm_free(struct memory_bitmap *bm, int clear_nosave_free);/** * create_bm_block_list - create a list of block bitmap objects +* @nr_blocks - number of blocks to allocate +* @list - list to put the allocated blocks into +* @ca - chain allocator to be used for allocating memory */ - -static inline struct bm_block * -create_bm_block_list (unsigned int nr_blocks,struct chain_allocator *ca) +static int create_bm_block_list (unsigned long pages, +struct list_head *list, +struct chain_allocator *ca) { -struct bm_block *bblist =NULL ; +unsigned int nr_blocks =DIV_ROUND_UP (pages,BM_BITS_PER_BLOCK );while (nr_blocks-- >0 ) {struct bm_block *bb; bb =chain_alloc (ca,sizeof (struct bm_block ));if (!bb) -return NULL ; - - bb->next = bblist; - bblist = bb; +return -ENOMEM ; +list_add (&bb->hook, list); } -return bblist; + +return 0 ; } +struct mem_extent { +struct list_head hook; +unsigned long start; +unsigned long end; +}; +/** -* create_zone_bm_list - create a list of zone bitmap objects +* free_mem_extents - free a list of memory extents +* @list - list of extents to empty */ +static void free_mem_extents (struct list_head *list) +{ +struct mem_extent *ext, *aux; + +list_for_each_entry_safe (ext, aux, list, hook) { +list_del (&ext->hook); +kfree (ext); + } +} -static inline struct zone_bitmap * -create_zone_bm_list (unsigned int nr_zones,struct chain_allocator *ca) +/** +* create_mem_extents - create a list of memory extents representing +* contiguous ranges of PFNs +* @list - list to put the extents into +* @gfp_mask - mask to use for memory allocations +*/ +static int create_mem_extents (struct list_head *list,gfp_t gfp_mask) { -struct zone_bitmap *zbmlist =NULL ; +struct zone *zone; -while (nr_zones-- >0 ) { -struct zone_bitmap *zbm; +INIT_LIST_HEAD (list); - zbm =chain_alloc (ca,sizeof (struct zone_bitmap )); -if (!zbm) -return NULL ; +for_each_zone (zone) { +unsigned long zone_start, zone_end; +struct mem_extent *ext, *cur, *aux; + +if (!populated_zone (zone)) +continue ; + + zone_start = zone->zone_start_pfn; + zone_end = zone->zone_start_pfn + zone->spanned_pages; - zbm->next = zbmlist; - zbmlist = zbm; +list_for_each_entry (ext, list, hook) +if (zone_start <= ext->end) +break ; + +if (&ext->hook == list || zone_end < ext->start) { +/* New extent is necessary */ +struct mem_extent *new_ext; + + new_ext =kzalloc (sizeof (struct mem_extent ), gfp_mask); +if (!new_ext) { +free_mem_extents (list); +return -ENOMEM ; + } + new_ext->start = zone_start; + new_ext->end = zone_end; +list_add_tail (&new_ext->hook, &ext->hook); +continue ; + } + +/* Merge this zone's range of PFNs with the existing one */ +if (zone_start < ext->start) + ext->start = zone_start; +if (zone_end > ext->end) + ext->end = zone_end; + +/* More merging may be possible */ + cur = ext; +list_for_each_entry_safe_continue (cur, aux, list, hook) { +if (zone_end < cur->start) +break ; +if (zone_end < cur->end) + ext->end = cur->end; +list_del (&cur->hook); +kfree (cur); + } } -return zbmlist; + +return 0 ; }/** * memory_bm_create - allocate memory for a memory bitmap */ -static int memory_bm_create (struct memory_bitmap *bm,gfp_t gfp_mask,int safe_needed) {struct chain_allocator ca; -struct zone *zone; -struct zone_bitmap *zone_bm; -struct bm_block *bb; -unsigned int nr; +struct list_head mem_extents; +struct mem_extent *ext; +int error;chain_init (&ca, gfp_mask, safe_needed); +INIT_LIST_HEAD (&bm->blocks); -/* Compute the number of zones */ - nr =0 ; -for_each_zone (zone) -if (populated_zone (zone)) - nr++; - -/* Allocate the list of zones bitmap objects */ - zone_bm =create_zone_bm_list (nr, &ca); - bm->zone_bm_list = zone_bm; -if (!zone_bm) { -chain_free (&ca,PG_UNSAFE_CLEAR ); -return -ENOMEM ; - } - -/* Initialize the zone bitmap objects */ -for_each_zone (zone) { -unsigned long pfn; + error =create_mem_extents (&mem_extents, gfp_mask); +if (error) +return error; -if (!populated_zone (zone)) -continue ; +list_for_each_entry (ext, &mem_extents, hook) { +struct bm_block *bb; +unsigned long pfn = ext->start; +unsigned long pages = ext->end - ext->start; - zone_bm->start_pfn = zone->zone_start_pfn; - zone_bm->end_pfn = zone->zone_start_pfn + zone->spanned_pages; -/* Allocate the list of bitmap block objects */ - nr =DIV_ROUND_UP (zone->spanned_pages,BM_BITS_PER_BLOCK ); - bb =create_bm_block_list (nr, &ca); - zone_bm->bm_blocks = bb; - zone_bm->cur_block = bb; -if (!bb) - goto Free; + bb = list_entry(bm->blocks.prev, struct bm_block, hook); - nr = zone->spanned_pages; - pfn = zone->zone_start_pfn; -/* Initialize the bitmap block objects */ -while (bb) { -unsigned long *ptr; + error =create_bm_block_list (pages, bm->blocks.prev, &ca); +if (error) + goto Error; - ptr =get_image_page (gfp_mask, safe_needed); - bb->data = ptr; -if (!ptr) - goto Free; +list_for_each_entry_continue (bb, &bm->blocks, hook) { + bb->data =get_image_page (gfp_mask, safe_needed); +if (!bb->data) { + error = -ENOMEM ; + goto Error; + } bb->start_pfn = pfn; -if (nr >=BM_BITS_PER_BLOCK ) { +if (pages >=BM_BITS_PER_BLOCK ) { pfn +=BM_BITS_PER_BLOCK ; - nr -=BM_BITS_PER_BLOCK ; + pages -=BM_BITS_PER_BLOCK ; }else {/* This is executed only once in the loop */ - pfn += nr; + pfn += pages; } bb->end_pfn = pfn; - bb = bb->next; } - zone_bm = zone_bm->next; } + bm->p_list = ca.chain;memory_bm_position_reset (bm); -return 0 ; + Exit: +free_mem_extents (&mem_extents); +return error; - Free: + Error: bm->p_list = ca.chain;memory_bm_free (bm,PG_UNSAFE_CLEAR ); -return -ENOMEM ; + goto Exit; }/** * memory_bm_free - free memory occupied by the memory bitmap @bm */ -static void memory_bm_free (struct memory_bitmap *bm,int clear_nosave_free) { -struct zone_bitmap *zone_bm; +struct bm_block *bb; -/* Free the list of bit blocks for each zone_bitmap object */ - zone_bm = bm->zone_bm_list; -while (zone_bm) { -struct bm_block *bb; +list_for_each_entry (bb, &bm->blocks, hook) +if (bb->data) +free_image_page (bb->data, clear_nosave_free); - bb = zone_bm->bm_blocks; -while (bb) { -if (bb->data) -free_image_page (bb->data, clear_nosave_free); - bb = bb->next; - } - zone_bm = zone_bm->next; - }free_list_of_pages (bm->p_list, clear_nosave_free); - bm->zone_bm_list =NULL ; + +INIT_LIST_HEAD (&bm->blocks); }/**
@@ -437,38 +452,33 @@ static void memory_bm_free(struct memory_bitmap *bm, int clear_nosave_free)* to given pfn. The cur_zone_bm member of @bm and the cur_block member * of @bm->cur_zone_bm are updated. */ -static int memory_bm_find_bit (struct memory_bitmap *bm,unsigned long pfn,void **addr,unsigned int *bit_nr) { -struct zone_bitmap *zone_bm;struct bm_block *bb; -/* Check if the pfn is from the current zone */ - zone_bm = bm->cur.zone_bm; -if (pfn < zone_bm->start_pfn || pfn >= zone_bm->end_pfn) { - zone_bm = bm->zone_bm_list; -/* We don't assume that the zones are sorted by pfns */ -while (pfn < zone_bm->start_pfn || pfn >= zone_bm->end_pfn) { - zone_bm = zone_bm->next; - -if (!zone_bm) -return -EFAULT ; - } - bm->cur.zone_bm = zone_bm; - } -/* Check if the pfn corresponds to the current bitmap block */ - bb = zone_bm->cur_block; +/* +* Check if the pfn corresponds to the current bitmap block and find +* the block where it fits if this is not the case. +*/ + bb = bm->cur.block;if (pfn < bb->start_pfn) - bb = zone_bm->bm_blocks; +list_for_each_entry_continue_reverse (bb, &bm->blocks, hook) +if (pfn >= bb->start_pfn) +break ; -while (pfn >= bb->end_pfn) { - bb = bb->next; +if (pfn >= bb->end_pfn) +list_for_each_entry_continue (bb, &bm->blocks, hook) +if (pfn >= bb->start_pfn && pfn < bb->end_pfn) +break ; -BUG_ON (!bb); - } - zone_bm->cur_block = bb; +if (&bb->hook == &bm->blocks) +return -EFAULT ; + +/* The block has been found */ + bm->cur.block = bb; pfn -= bb->start_pfn; + bm->cur.bit = pfn +1 ; *bit_nr = pfn; *addr = bb->data;return 0 ;
@@ -538,29 +548,21 @@ static bool memory_bm_pfn_present(struct memory_bitmap *bm, unsigned long pfn)static unsigned long memory_bm_next_pfn (struct memory_bitmap *bm) { -struct zone_bitmap *zone_bm;struct bm_block *bb;int bit; + bb = bm->cur.block;do { - bb = bm->cur.block; -do { - bit = bm->cur.bit; - bit =find_next_bit (bb->data,bm_block_bits (bb), bit); -if (bit <bm_block_bits (bb)) - goto Return_pfn; - - bb = bb->next; - bm->cur.block = bb; - bm->cur.bit =0 ; - }while (bb); - zone_bm = bm->cur.zone_bm->next; -if (zone_bm) { - bm->cur.zone_bm = zone_bm; - bm->cur.block = zone_bm->bm_blocks; - bm->cur.bit =0 ; - } - }while (zone_bm); + bit = bm->cur.bit; + bit =find_next_bit (bb->data,bm_block_bits (bb), bit); +if (bit <bm_block_bits (bb)) + goto Return_pfn; + + bb = list_entry(bb->hook.next, struct bm_block, hook); + bm->cur.block = bb; + bm->cur.bit =0 ; + }while (&bb->hook != &bm->blocks); +memory_bm_position_reset (bm);return BM_END_OF_MAP ;
@@ -816,8 +818,7 @@ static unsigned int count_free_highmem_pages(void)* We should save the page if it isn't Nosave or NosaveFree, or Reserved, * and it isn't a part of a free chunk of pages. */ - -static struct page *saveable_highmem_page (unsigned long pfn) +static struct page *saveable_highmem_page (struct zone *zone,unsigned long pfn) {struct page *page;
@@ -825,6 +826,8 @@ static struct page *saveable_highmem_page(unsigned long pfn)return NULL ; page =pfn_to_page (pfn); +if (page_zone (page) != zone) +return NULL ;BUG_ON (!PageHighMem (page));
@@ -854,13 +857,16 @@ unsigned int count_highmem_pages(void)mark_free_pages (zone); max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) -if (saveable_highmem_page (pfn)) +if (saveable_highmem_page (zone, pfn)) n++; }return n; }#else -static inline void *saveable_highmem_page (unsigned long pfn) {return NULL ; } +static inline void *saveable_highmem_page (struct zone *z,unsigned long p) +{ +return NULL ; +}#endif /* CONFIG_HIGHMEM */ /**
@@ -871,8 +877,7 @@ static inline void *saveable_highmem_page(unsigned long pfn) { return NULL; }* of pages statically defined as 'unsaveable', and it isn't a part of * a free chunk of pages. */ - -static struct page *saveable_page (unsigned long pfn) +static struct page *saveable_page (struct zone *zone,unsigned long pfn) {struct page *page;
@@ -880,6 +885,8 @@ static struct page *saveable_page(unsigned long pfn)return NULL ; page =pfn_to_page (pfn); +if (page_zone (page) != zone) +return NULL ;BUG_ON (PageHighMem (page));
@@ -911,7 +918,7 @@ unsigned int count_data_pages(void)mark_free_pages (zone); max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) -if (saveable_page (pfn)) +if (saveable_page (zone, pfn)) n++; }return n;
@@ -952,7 +959,7 @@ static inline struct page * page_is_saveable(struct zone *zone, unsigned long pfn) {return is_highmem (zone) ? -saveable_highmem_page (pfn) :saveable_page (pfn); +saveable_highmem_page (zone, pfn) :saveable_page (zone, pfn); }static void copy_data_page (unsigned long dst_pfn,unsigned long src_pfn)
@@ -983,7 +990,7 @@ static void copy_data_page(unsigned long dst_pfn, unsigned long src_pfn) } }#else -#define page_is_saveable (zone, pfn) saveable_page(pfn) +#define page_is_saveable (zone, pfn) saveable_page(zone, pfn)static inline void copy_data_page (unsigned long dst_pfn,unsigned long src_pfn) {
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 11/94 Hibernate: Replace unnecessary evaluation of pfn_to_page()
In reply to Len BrownFrom: Rafael J. Wysocki <[email protected]>
Replace one evaluation of pfn_to_page() in copy_data_pages() with the value of a local variable containing the right number already.
--- kernel/power/snapshot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/power/snapshot.c +1 -1
@@ -981,7 +981,7 @@ static void copy_data_page(unsigned long dst_pfn, unsigned long src_pfn)* data modified by kmap_atomic() */ safe_copy_page (buffer, s_page); - dst =kmap_atomic (pfn_to_page (dst_pfn),KM_USER0 ); + dst =kmap_atomic (d_page,KM_USER0 );memcpy (dst, buffer,PAGE_SIZE );kunmap_atomic (dst,KM_USER0 ); }else {
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 12/94 drivers/misc/Makefile, Kconfig: cleanup
In reply to Len BrownFrom: Len Brown <[email protected]>
tabs->space and delete unnecessary dummy build-in.o rule.
--- drivers/misc/Kconfig | 42 +++++++++++++++++++++--------------------- drivers/misc/Makefile | 1 - 2 files changed, 21 insertions(+), 22 deletions(-)
drivers/misc/Kconfig +21 -21
@@ -120,7 +120,7 @@ config TIFM_CORE cards are supported via 'MMC/SD Card support: TI Flash Media MMC/SD Interface support (MMC_TIFM_SD)'. - To compile this driver as a module, choose M here: the module will + To compile this driver as a module, choose M here: the module will be called tifm_core. config TIFM_7XX1
@@ -133,11 +133,11 @@ config TIFM_7XX1 To make actual use of the device, you will have to select some flash card format drivers, as outlined in the TIFM_CORE Help. - To compile this driver as a module, choose M here: the module will + To compile this driver as a module, choose M here: the module will be called tifm_7xx1. config ACER_WMI - tristate "Acer WMI Laptop Extras (EXPERIMENTAL)" + tristate "Acer WMI Laptop Extras (EXPERIMENTAL)" depends on X86 depends on EXPERIMENTAL depends on ACPI
@@ -159,14 +159,14 @@ config ACER_WMI here. config ASUS_LAPTOP - tristate "Asus Laptop Extras (EXPERIMENTAL)" - depends on X86 - depends on ACPI + tristate "Asus Laptop Extras (EXPERIMENTAL)" + depends on X86 + depends on ACPI depends on EXPERIMENTAL && !ACPI_ASUS depends on LEDS_CLASS depends on NEW_LEDS depends on BACKLIGHT_CLASS_DEVICE - ---help--- + ---help--- This is the new Linux driver for Asus laptops. It may also support some MEDION, JVC or VICTOR laptops. It makes all the extra buttons generate standard ACPI events that go through /proc/acpi/events. It also adds
@@ -179,12 +179,12 @@ config ASUS_LAPTOP If you have an ACPI-compatible ASUS laptop, say Y or M here. config FUJITSU_LAPTOP - tristate "Fujitsu Laptop Extras" - depends on X86 - depends on ACPI + tristate "Fujitsu Laptop Extras" + depends on X86 + depends on ACPI depends on INPUT - depends on BACKLIGHT_CLASS_DEVICE - ---help--- + depends on BACKLIGHT_CLASS_DEVICE + ---help--- This is a driver for laptops built by Fujitsu: * P2xxx/P5xxx/S6xxx/S7xxx series Lifebooks
@@ -221,11 +221,11 @@ config HP_WMI depends on INPUT depends on RFKILL help - Say Y here if you want to support WMI-based hotkeys on HP laptops and + Say Y here if you want to support WMI-based hotkeys on HP laptops and to read data from WMI such as docking or ambient light sensor state. - To compile this driver as a module, choose M here: the module will - be called hp-wmi. + To compile this driver as a module, choose M here: the module will + be called hp-wmi. config ICS932S401 tristate "Integrated Circuits ICS932S401"
@@ -238,11 +238,11 @@ config ICS932S401 will be called ics932s401. config MSI_LAPTOP - tristate "MSI Laptop Extras" - depends on X86 - depends on ACPI - depends on BACKLIGHT_CLASS_DEVICE - ---help--- + tristate "MSI Laptop Extras" + depends on X86 + depends on ACPI + depends on BACKLIGHT_CLASS_DEVICE + ---help--- This is a driver for laptops built by MSI (MICRO-STAR INTERNATIONAL):
@@ -259,7 +259,7 @@ config MSI_LAPTOP config PANASONIC_LAPTOP tristate "Panasonic Laptop Extras" depends on X86 && INPUT && ACPI - depends on BACKLIGHT_CLASS_DEVICE + depends on BACKLIGHT_CLASS_DEVICE ---help--- This driver adds support for access to backlight control and hotkeys on Panasonic Let's Note laptops.
drivers/misc/Makefile +0 -1
@@ -1,7 +1,6 @@ # # Makefile for misc devices that really don't fit anywhere else. # -obj- := misc.o # Dummy rule to force built-in.o to be made obj-$(CONFIG_IBM_ASM) += ibmasm/ obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 13/94 create drivers/platform/x86/ from drivers/misc/
In reply to Len BrownFrom: Len Brown <[email protected]>
Move x86 platform specific drivers from drivers/misc/ to a new home under drivers/platform/x86/.
The community has been maintaining x86 vendor-specific platform specific drivers under /drivers/misc/ for a few years. The oldest ones started life under drivers/acpi.
They moved out of drivers/acpi/ because they don't actually implement the ACPI specification, but either simply use ACPI, or implement vendor-specific ACPI extensions.
In the future we anticipate...drivers/misc/ will go away.
other architectures will create drivers/platform/<arch>
---
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/misc/Kconfig | 280 --------------------
drivers/misc/Makefile | 12 -
drivers/platform/Kconfig | 5 +
drivers/platform/Makefile | 5 +
drivers/platform/x86/Kconfig | 290 +++++++++++++++++++++
drivers/platform/x86/Makefile | 16 ++
drivers/{misc => platform/x86}/acer-wmi.c | 0
drivers/{misc => platform/x86}/asus-laptop.c | 0
drivers/{misc => platform/x86}/compal-laptop.c | 0
drivers/{misc => platform/x86}/eeepc-laptop.c | 0
drivers/{misc => platform/x86}/fujitsu-laptop.c | 0
drivers/{misc => platform/x86}/hp-wmi.c | 0
drivers/{misc => platform/x86}/intel_menlow.c | 0
drivers/{misc => platform/x86}/msi-laptop.c | 0
drivers/{misc => platform/x86}/panasonic-laptop.c | 0
drivers/{misc => platform/x86}/sony-laptop.c | 0
drivers/{misc => platform/x86}/tc1100-wmi.c | 0
drivers/{misc => platform/x86}/thinkpad_acpi.c | 0
20 files changed, 319 insertions(+), 292 deletions(-)
create mode 100644 drivers/platform/Kconfig
create mode 100644 drivers/platform/Makefile
create mode 100644 drivers/platform/x86/Kconfig
create mode 100644 drivers/platform/x86/Makefile
rename drivers/{misc => platform/x86}/acer-wmi.c (100%)
rename drivers/{misc => platform/x86}/asus-laptop.c (100%)
rename drivers/{misc => platform/x86}/compal-laptop.c (100%)
rename drivers/{misc => platform/x86}/eeepc-laptop.c (100%)
rename drivers/{misc => platform/x86}/fujitsu-laptop.c (100%)
rename drivers/{misc => platform/x86}/hp-wmi.c (100%)
rename drivers/{misc => platform/x86}/intel_menlow.c (100%)
rename drivers/{misc => platform/x86}/msi-laptop.c (100%)
rename drivers/{misc => platform/x86}/panasonic-laptop.c (100%)
rename drivers/{misc => platform/x86}/sony-laptop.c (100%)
rename drivers/{misc => platform/x86}/tc1100-wmi.c (100%)
rename drivers/{misc => platform/x86}/thinkpad_acpi.c (100%)drivers/Kconfig +2 -0
@@ -107,4 +107,6 @@ source "drivers/uio/Kconfig" source "drivers/xen/Kconfig" source "drivers/staging/Kconfig" + +source "drivers/platform/Kconfig" endmenu
drivers/Makefile +1 -0
@@ -102,3 +102,4 @@ obj-$(CONFIG_SSB) += ssb/ obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_REGULATOR) += regulator/ obj-$(CONFIG_STAGING) += staging/ +obj-y += platform/
drivers/misc/Kconfig +0 -280
298 lines not on this page · raw message
drivers/misc/Makefile +0 -12
@@ -4,28 +4,16 @@ obj-$(CONFIG_IBM_ASM) += ibmasm/ obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ -obj-$(CONFIG_ASUS_LAPTOP) += asus-laptop.o -obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o -obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o -obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o -obj-$(CONFIG_ACER_WMI) += acer-wmi.o obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o -obj-$(CONFIG_HP_WMI) += hp-wmi.o obj-$(CONFIG_ICS932S401) += ics932s401.o -obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o obj-$(CONFIG_LKDTM) += lkdtm.o obj-$(CONFIG_TIFM_CORE) += tifm_core.o obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o obj-$(CONFIG_PHANTOM) += phantom.o obj-$(CONFIG_SGI_IOC4) += ioc4.o -obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o -obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o -obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o -obj-$(CONFIG_PANASONIC_LAPTOP) += panasonic-laptop.o obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o -obj-$(CONFIG_INTEL_MENLOW) += intel_menlow.o obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o obj-$(CONFIG_KGDB_TESTS) += kgdbts.o obj-$(CONFIG_SGI_XP) += sgi-xp/
drivers/platform/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +# drivers/platform/Kconfig + +if X86 +source "drivers/platform/x86/Kconfig" +endif
drivers/platform/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for linux/drivers/platform +# + +obj-$(CONFIG_X86) += x86/
drivers/platform/x86/Kconfig new file +290 -0
290 lines not on this page · raw message
drivers/platform/x86/Makefile new file +16 -0
@@ -0,0 +1,16 @@ +# +# Makefile for linux/drivers/platform/x86 +# x86 Platform-Specific Drivers +# +obj-$(CONFIG_ASUS_LAPTOP) += asus-laptop.o +obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o +obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o +obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o +obj-$(CONFIG_ACER_WMI) += acer-wmi.o +obj-$(CONFIG_HP_WMI) += hp-wmi.o +obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o +obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o +obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o +obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o +obj-$(CONFIG_PANASONIC_LAPTOP) += panasonic-laptop.o +obj-$(CONFIG_INTEL_MENLOW) += intel_menlow.o
drivers/platform/x86/acer-wmi.c renamed from drivers/misc/acer-wmi.c +0 -0
drivers/platform/x86/asus-laptop.c renamed from drivers/misc/asus-laptop.c +0 -0
drivers/platform/x86/compal-laptop.c renamed from drivers/misc/compal-laptop.c +0 -0
drivers/platform/x86/eeepc-laptop.c renamed from drivers/misc/eeepc-laptop.c +0 -0
drivers/platform/x86/fujitsu-laptop.c renamed from drivers/misc/fujitsu-laptop.c +0 -0
drivers/platform/x86/hp-wmi.c renamed from drivers/misc/hp-wmi.c +0 -0
drivers/platform/x86/intel_menlow.c renamed from drivers/misc/intel_menlow.c +0 -0
drivers/platform/x86/msi-laptop.c renamed from drivers/misc/msi-laptop.c +0 -0
drivers/platform/x86/panasonic-laptop.c renamed from drivers/misc/panasonic-laptop.c +0 -0
drivers/platform/x86/sony-laptop.c renamed from drivers/misc/sony-laptop.c +0 -0
drivers/platform/x86/tc1100-wmi.c renamed from drivers/misc/tc1100-wmi.c +0 -0
drivers/platform/x86/thinkpad_acpi.c renamed from drivers/misc/thinkpad_acpi.c +0 -0
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 14/94 ACPI: move wmi, asus_acpi, toshiba_acpi to drivers/platform/x86
In reply to Len BrownFrom: Len Brown <[email protected]>
These are platform specific drivers that happen to use ACPI, while drivers/acpi/ is for code that implements ACPI itself.
---
drivers/acpi/Kconfig | 84 ------------------------
drivers/acpi/Makefile | 3 -
drivers/platform/x86/Kconfig | 85 +++++++++++++++++++++++++
drivers/platform/x86/Makefile | 3 +
drivers/{acpi => platform/x86}/asus_acpi.c | 0
drivers/{acpi => platform/x86}/toshiba_acpi.c | 0
drivers/{acpi => platform/x86}/wmi.c | 0
7 files changed, 88 insertions(+), 87 deletions(-)
rename drivers/{acpi => platform/x86}/asus_acpi.c (100%)
rename drivers/{acpi => platform/x86}/toshiba_acpi.c (100%)
rename drivers/{acpi => platform/x86}/wmi.c (100%)drivers/acpi/Kconfig +0 -84
@@ -196,90 +196,6 @@ config ACPI_NUMA depends on (X86 || IA64) default y if IA64_GENERIC || IA64_SGI_SN2 -config ACPI_WMI - tristate "WMI (EXPERIMENTAL)" - depends on X86 - depends on EXPERIMENTAL - help - This driver adds support for the ACPI-WMI (Windows Management - Instrumentation) mapper device (PNP0C14) found on some systems. - - ACPI-WMI is a proprietary extension to ACPI to expose parts of the - ACPI firmware to userspace - this is done through various vendor - defined methods and data blocks in a PNP0C14 device, which are then - made available for userspace to call. - - The implementation of this in Linux currently only exposes this to - other kernel space drivers. - - This driver is a required dependency to build the firmware specific - drivers needed on many machines, including Acer and HP laptops. - - It is safe to enable this driver even if your DSDT doesn't define - any ACPI-WMI devices. - -config ACPI_ASUS - tristate "ASUS/Medion Laptop Extras" - depends on X86 - select BACKLIGHT_CLASS_DEVICE - ---help--- - This driver provides support for extra features of ACPI-compatible - ASUS laptops. As some of Medion laptops are made by ASUS, it may also - support some Medion laptops (such as 9675 for example). It makes all - the extra buttons generate standard ACPI events that go through - /proc/acpi/events, and (on some models) adds support for changing the - display brightness and output, switching the LCD backlight on and off, - and most importantly, allows you to blink those fancy LEDs intended - for reporting mail and wireless status. - - Note: display switching code is currently considered EXPERIMENTAL, - toying with these values may even lock your machine. - - All settings are changed via /proc/acpi/asus directory entries. Owner - and group for these entries can be set with asus_uid and asus_gid - parameters. - - More information and a userspace daemon for handling the extra buttons - at <http://sourceforge.net/projects/acpi4asus/>. - - If you have an ACPI-compatible ASUS laptop, say Y or M here. This - driver is still under development, so if your laptop is unsupported or - something works not quite as expected, please use the mailing list - available on the above page ([email protected]). - - NOTE: This driver is deprecated and will probably be removed soon, - use asus-laptop instead. - -config ACPI_TOSHIBA - tristate "Toshiba Laptop Extras" - depends on X86 && INPUT - select INPUT_POLLDEV - select NET - select RFKILL - select BACKLIGHT_CLASS_DEVICE - ---help--- - This driver adds support for access to certain system settings - on "legacy free" Toshiba laptops. These laptops can be recognized by - their lack of a BIOS setup menu and APM support. - - On these machines, all system configuration is handled through the - ACPI. This driver is required for access to controls not covered - by the general ACPI drivers, such as LCD brightness, video output, - etc. - - This driver differs from the non-ACPI Toshiba laptop driver (located - under "Processor type and features") in several aspects. - Configuration is accessed by reading and writing text files in the - /proc tree instead of by program interface to /dev. Furthermore, no - power management functions are exposed, as those are handled by the - general ACPI drivers. - - More information about this driver is available at - <http://memebeam.org/toys/ToshibaAcpiDriver>. - - If you have a legacy free Toshiba laptop (such as the Libretto L1 - series), say Y. - config ACPI_CUSTOM_DSDT_FILE string "Custom DSDT Table file to include" default ""
drivers/acpi/Makefile +0 -3
@@ -59,9 +59,6 @@ obj-y += power.o obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o obj-$(CONFIG_ACPI_DEBUG) += debug.o obj-$(CONFIG_ACPI_NUMA) += numa.o -obj-$(CONFIG_ACPI_WMI) += wmi.o -obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o -obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o obj-$(CONFIG_ACPI_SBS) += sbshc.o
drivers/platform/x86/Kconfig +85 -0
89 lines not on this page · raw message
drivers/platform/x86/Makefile +3 -0
@@ -14,3 +14,6 @@ obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o obj-$(CONFIG_PANASONIC_LAPTOP) += panasonic-laptop.o obj-$(CONFIG_INTEL_MENLOW) += intel_menlow.o +obj-$(CONFIG_ACPI_WMI) += wmi.o +obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o +obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
drivers/platform/x86/asus_acpi.c renamed from drivers/acpi/asus_acpi.c +0 -0
drivers/platform/x86/toshiba_acpi.c renamed from drivers/acpi/toshiba_acpi.c +0 -0
drivers/platform/x86/wmi.c renamed from drivers/acpi/wmi.c +0 -0
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 15/94 doc: fix kernel-parameters.txt formatting
In reply to Len BrownFrom: Randy Dunlap <[email protected]>
Spell out "wrt". I suspect plenty of people won't know what that means.
Fix a '}' that should be a ']'.
Reformat long lines into shorter lines.
--- Documentation/kernel-parameters.txt | 40 +++++++++++++++++++--------------- 1 files changed, 22 insertions(+), 18 deletions(-)
Documentation/kernel-parameters.txt +22 -18
@@ -151,15 +151,16 @@ and is between 256 and 4096 characters. It is defined in the file acpi_sleep= [HW,ACPI] Sleep options Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering, s4_nonvs } - See Documentation/power/video.txt for s3_bios and s3_mode. + See Documentation/power/video.txt for information on + s3_bios and s3_mode. s3_beep is for debugging; it makes the PC's speaker beep as soon as the kernel's real-mode entry point is called. s4_nohwsig prevents ACPI hardware signature from being used during resume from hibernation. old_ordering causes the ACPI 1.0 ordering of the _PTS - control method, wrt putting devices into low power - states, to be enforced (the ACPI 2.0 ordering of _PTS is - used by default). + control method, with respect to putting devices into + low power states, to be enforced (the ACPI 2.0 ordering + of _PTS is used by default). s4_nonvs prevents the kernel from saving/restoring the ACPI NVS memory during hibernation.
@@ -196,7 +197,7 @@ and is between 256 and 4096 characters. It is defined in the file acpi_skip_timer_override [HW,ACPI] Recognize and ignore IRQ0/pin2 Interrupt Override. For broken nForce2 BIOS resulting in XT-PIC timer. - acpi_use_timer_override [HW,ACPI} + acpi_use_timer_override [HW,ACPI] Use timer override. For some broken Nvidia NF5 boards that require a timer override, but don't have HPET
@@ -860,17 +861,19 @@ and is between 256 and 4096 characters. It is defined in the file See Documentation/ide/ide.txt. idle= [X86] - Format: idle=poll or idle=mwait, idle=halt, idle=nomwait - Poll forces a polling idle loop that can slightly improves the performance - of waking up a idle CPU, but will use a lot of power and make the system - run hot. Not recommended. - idle=mwait. On systems which support MONITOR/MWAIT but the kernel chose - to not use it because it doesn't save as much power as a normal idle - loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same - as idle=poll. - idle=halt. Halt is forced to be used for CPU idle. + Format: idle=poll, idle=mwait, idle=halt, idle=nomwait + Poll forces a polling idle loop that can slightly + improve the performance of waking up a idle CPU, but + will use a lot of power and make the system run hot. + Not recommended. + idle=mwait: On systems which support MONITOR/MWAIT but + the kernel chose to not use it because it doesn't save + as much power as a normal idle loop, use the + MONITOR/MWAIT idle loop anyways. Performance should be + the same as idle=poll. + idle=halt: Halt is forced to be used for CPU idle. In such case C2/C3 won't be used again. - idle=nomwait. Disable mwait for CPU C-states + idle=nomwait: Disable mwait for CPU C-states ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem Claim all unknown PCI IDE storage controllers.
@@ -1052,8 +1055,8 @@ and is between 256 and 4096 characters. It is defined in the file lapic [X86-32,APIC] Enable the local APIC even if BIOS disabled it. - lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer in - C2 power state. + lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer + in C2 power state. libata.dma= [LIBATA] DMA control libata.dma=0 Disable all PATA and SATA DMA
@@ -2241,7 +2244,8 @@ and is between 256 and 4096 characters. It is defined in the file thermal.psv= [HW,ACPI] -1: disable all passive trip points - <degrees C>: override all passive trip points to this value + <degrees C>: override all passive trip points to this + value thermal.tzp= [HW,ACPI] Specify global default ACPI thermal zone polling rate
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 16/94 Newly inserted battery might differ from one just removed, so
In reply to Len BrownFrom: Alexey Starikovskiy <[email protected]>
--- drivers/acpi/battery.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/battery.c +3 -2
@@ -471,7 +471,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)static int acpi_battery_update (struct acpi_battery *battery) { -int result; +int result, old_present =acpi_battery_present (battery); result =acpi_battery_get_status (battery);if (result)return result;
@@ -482,7 +482,8 @@ static int acpi_battery_update(struct acpi_battery *battery) return 0; }#endif -if (!battery->update_time) { +if (!battery->update_time || + old_present !=acpi_battery_present (battery)) { result =acpi_battery_get_info (battery);if (result)return result;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 17/94 ACPI: disable MPS when NO APIC-table found
In reply to Len BrownFrom: Len Brown <[email protected]>
When ACPI is asked to find an MADT (APIC table) and fails, then ACPI expects to run in PIC mode.
However, if an MP Table is was found, IRQs will be registered as if an IOAPIC is being used, even though ACPI is configuring interrupt links links for PIC mode.
In this scenario, disable MPS so that IRQs are registered in PIC mode, consistent with ACPI.
http://bugzilla.kernel.org/show_bug.cgi?id=12257
--- arch/x86/kernel/acpi/boot.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
arch/x86/kernel/acpi/boot.c +11 -0
@@ -1359,6 +1359,17 @@ static void __init acpi_process_madt(void) "Invalid BIOS MADT, disabling ACPI\n"); disable_acpi(); } + }else { +/* +* ACPI found no MADT, and so ACPI wants UP PIC mode. +* In the event an MPS table was found, forget it. +* Boot with "acpi=off" to use MPS on such a system. +*/ +if (smp_found_config) { + printk(KERN_WARNING PREFIX + "No APIC-table, disabling MPS\n"); + smp_found_config =0 ; + } }#endif return ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 18/94 eeepc-laptop: use select and not depends on
In reply to Len BrownFrom: Corentin Chary <[email protected]>
As len said:
"Kconfig should offer users features, and not make users devine their dependencies.
--- drivers/misc/Kconfig | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/misc/Kconfig +3 -3
@@ -428,10 +428,10 @@ config EEEPC_LAPTOP tristate "Eee PC Hotkey Driver (EXPERIMENTAL)" depends on X86 depends on ACPI - depends on BACKLIGHT_CLASS_DEVICE - depends on HWMON depends on EXPERIMENTAL - depends on RFKILL + select BACKLIGHT_CLASS_DEVICE + select HWMON + select RFKILL ---help--- This driver supports the Fn-Fx keys on Eee PC laptops. It also adds the ability to switch camera/wlan on/off.
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 19/94 ACPICA: Fix several warnings under gcc 4 compiler
In reply to Len BrownFrom: Bob Moore <[email protected]>
New compiler is pickier than older versions. Joerg Sonnenberger. From ACPICA BZ 732.
http://www.acpica.org/bugzilla/show_bug.cgi?id=732
--- drivers/acpi/tables/tbfadt.c | 4 ++-- include/acpi/actypes.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/acpi/tables/tbfadt.c +2 -2
@@ -48,7 +48,7 @@ACPI_MODULE_NAME ("tbfadt" ) /* Local prototypes */ -static void inline +static inline void acpi_tb_init_generic_address (struct acpi_generic_address *generic_address,u8 byte_width,u64 address);
@@ -122,7 +122,7 @@ static struct acpi_fadt_info fadt_info_table[] = {* ******************************************************************************/ -static void inline +static inline void acpi_tb_init_generic_address (struct acpi_generic_address *generic_address,u8 byte_width,u64 address) {
include/acpi/actypes.h +4 -4
@@ -291,7 +291,7 @@ typedef u32 acpi_physical_address;#endif /* -* Mescellaneous types +* Miscellaneous types */ typedef u32 acpi_status ;/* All ACPI Exceptions */ typedef u32 acpi_name ;/* 4-byte ACPI name */
@@ -319,7 +319,7 @@ struct uint32_struct {#define acpi_semaphore void */* -* Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI +* Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI * version 2, integers are 64 bits. Note that this pertains to the ACPI integer * type only, not other integers used in the implementation of the ACPI CA * subsystem.
@@ -414,7 +414,7 @@ typedef unsigned long long acpi_integer;#define ACPI_NOTIFY_MAX 0x0B/* -* Types associated with ACPI names and objects. The first group of +* Types associated with ACPI names and objects. The first group of * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition * of the ACPI object_type() operator (See the ACPI Spec). Therefore, * only add to the first group if the spec changes.
@@ -787,7 +787,7 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status,u16 opcode, u32 aml_offset, void *context); -/* Table Event handler (Load, load_table etc) and types */ +/* Table Event handler (Load, load_table, etc.) and types */ typedef acpi_status (*acpi_tbl_handler ) (u32 event,void *table,void *context);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 20/94 ACPICA: Update FACS waking vector interfaces
In reply to Len BrownFrom: Bob Moore <[email protected]>
Split AcpiSetFirmwareWakingVector into two: one for the 32-bit vector, another for the 64-bit vector. This is required because the host OS must setup the wake much differently for each vector (real vs. protected mode, etc.) and the interface should not be deciding which vector to use. Also eliminate the GetFirmwareWakingVector interface, as it served no purpose (only the firmware reads the vector, OS only writes the vector.) ACPICA BZ 731.
http://www.acpica.org/bugzilla/show_bug.cgi?id=731
--- drivers/acpi/hardware/hwsleep.c | 54 +++++++++++++++++++++++---------------- include/acpi/acpixf.h | 6 +--- 2 files changed, 34 insertions(+), 26 deletions(-)
drivers/acpi/hardware/hwsleep.c +32 -22
@@ -52,16 +52,16 @@ ACPI_MODULE_NAME("hwsleep")* * FUNCTION: acpi_set_firmware_waking_vector * -* PARAMETERS: physical_address - Physical address of ACPI real mode +* PARAMETERS: physical_address - 32-bit physical address of ACPI real mode * entry point. * * RETURN: Status * -* DESCRIPTION: Access function for the firmware_waking_vector field in FACS +* DESCRIPTION: Sets the 32-bit firmware_waking_vector field of the FACS * ******************************************************************************/ acpi_status -acpi_set_firmware_waking_vector (acpi_physical_address physical_address) +acpi_set_firmware_waking_vector (u32 physical_address) {struct acpi_table_facs *facs;acpi_status status;
@@ -85,10 +85,16 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)* Protected Mode. Some systems (for example HP dv5-1004nr) are known * to fail to resume if the 64-bit vector is used. */ -if (facs->version >=1 ) - facs->xfirmware_waking_vector =0 ; - facs->firmware_waking_vector = (u32 )physical_address; +/* Set the 32-bit vector */ + + facs->firmware_waking_vector = physical_address; + +/* Clear the 64-bit vector if it exists */ + +if ((facs->length >32 ) && (facs->version >=1 )) { + facs->xfirmware_waking_vector =0 ; + }return_ACPI_STATUS (AE_OK ); }
@@ -97,29 +103,25 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector)/******************************************************************************* * -* FUNCTION: acpi_get_firmware_waking_vector +* FUNCTION: acpi_set_firmware_waking_vector64 * -* PARAMETERS: *physical_address - Where the contents of -* the firmware_waking_vector field of -* the FACS will be returned. +* PARAMETERS: physical_address - 64-bit physical address of ACPI protected +* mode entry point. * -* RETURN: Status, vector +* RETURN: Status * -* DESCRIPTION: Access function for the firmware_waking_vector field in FACS +* DESCRIPTION: Sets the 64-bit X_firmware_waking_vector field of the FACS, if +* it exists in the table. * ******************************************************************************/ -#ifdef ACPI_FUTURE_USAGE acpi_status -acpi_get_firmware_waking_vector (acpi_physical_address * physical_address) +acpi_set_firmware_waking_vector64 (u64 physical_address) {struct acpi_table_facs *facs;acpi_status status; -ACPI_FUNCTION_TRACE (acpi_get_firmware_waking_vector); +ACPI_FUNCTION_TRACE (acpi_set_firmware_waking_vector64); -if (!physical_address) { -return_ACPI_STATUS (AE_BAD_PARAMETER ); - }/* Get the FACS */
@@ -131,14 +133,22 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)return_ACPI_STATUS (status); } -/* Get the vector */ - *physical_address = (acpi_physical_address )facs->firmware_waking_vector; +/* Determine if the 64-bit vector actually exists */ + +if ((facs->length <=32 ) || (facs->version <1 )) { +return_ACPI_STATUS (AE_NOT_EXIST ); + } + +/* Clear 32-bit vector, set the 64-bit X_ vector */ + + facs->firmware_waking_vector =0 ; + facs->xfirmware_waking_vector = physical_address;return_ACPI_STATUS (AE_OK ); } -ACPI_EXPORT_SYMBOL (acpi_get_firmware_waking_vector) -#endif +ACPI_EXPORT_SYMBOL (acpi_set_firmware_waking_vector64) +/******************************************************************************* * * FUNCTION: acpi_enter_sleep_state_prep
include/acpi/acpixf.h +2 -4
@@ -320,12 +320,10 @@ acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value);acpi_status acpi_set_register (u32 register_id,u32 value);acpi_status -acpi_set_firmware_waking_vector (acpi_physical_address physical_address); +acpi_set_firmware_waking_vector (u32 physical_address); -#ifdef ACPI_FUTURE_USAGE acpi_status -acpi_get_firmware_waking_vector (acpi_physical_address * physical_address); -#endif +acpi_set_firmware_waking_vector64 (u64 physical_address);acpi_status acpi_get_sleep_type_data (u8 sleep_state,u8 * slp_typ_a,u8 * slp_typ_b);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 21/94 ACPICA: Fix possible memory leak on error in parser
In reply to Len BrownFrom: Lin Ming <[email protected]>
Fixes a possible memory leak if an allocation failure happens in the parse loop. Must terminate an executing control method. Lin Ming, Bob Moore. ACPICA BZ 489.
http://www.acpica.org/bugzilla/show_bug.cgi?id=489
--- drivers/acpi/parser/psparse.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/acpi/parser/psparse.c +8 -0
@@ -451,6 +451,14 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) thread =acpi_ut_create_thread_state ();if (!thread) { +if (walk_state->method_desc) { + +/* Executing a control method - additional cleanup */ + +acpi_ds_terminate_control_method ( + walk_state->method_desc, walk_state); + } +acpi_ds_delete_walk_state (walk_state);return_ACPI_STATUS (AE_NO_MEMORY ); }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 22/94 ACPICA: Optimize execution of AML While loops
In reply to Len BrownFrom: Bob Moore <[email protected]>
Previously, a control state object was allocated and freed for each execution of the loop. The optimization is to simply reuse the control state for each iteration. This speeds up the raw loop execution time by about 5%.
--- drivers/acpi/dispatcher/dsopcode.c | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-)
drivers/acpi/dispatcher/dsopcode.c +25 -4
@@ -1140,10 +1140,29 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, op->common.aml_opcode, walk_state));switch (op->common.aml_opcode) { -case AML_IF_OP :case AML_WHILE_OP :/* +* If this is an additional iteration of a while loop, continue. +* There is no need to allocate a new control state. +*/ +if (walk_state->control_state) { +if (walk_state->control_state->control.aml_predicate_start + == (walk_state->parser_state.aml -1 )) { + +/* Reset the state to start-of-loop */ + + walk_state->control_state->common.state = +ACPI_CONTROL_CONDITIONAL_EXECUTING ; +break ; + } + } + +/*lint -fallthrough */ + +case AML_IF_OP : + +/* * IF/WHILE: Create a new control state to manage these * constructs. We need to manage these as a stack, in order * to handle nesting.
@@ -1248,8 +1267,13 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,/* Predicate was true, go back and evaluate it again! */ status =AE_CTRL_PENDING ; + walk_state->aml_last_while = + walk_state->control_state->control.aml_predicate_start; +break ; } +/* Predicate was false, terminate this while loop */ +ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH ,"[WHILE_OP] termination! Op=%p\n" , op));
@@ -1257,9 +1281,6 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state, control_state =acpi_ut_pop_generic_state (&walk_state->control_state); - - walk_state->aml_last_while = - control_state->control.aml_predicate_start;acpi_ut_delete_generic_state (control_state);break ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 23/94 ACPICA: Add a mechanism to escape infinite AML While() loops
In reply to Len BrownFrom: Bob Moore <[email protected]>
Add a loop counter to force exit from AML While loops if the count becomes too large. This can occur in poorly written AML when the hardware does not respond within a while loop and the loop does not implement a timeout. The maximum loop count is configurable. A new exception code is returned when a loop is broken, AE_AML_INFINITE_LOOP. Bob Moore, Alexey Starikovskiy.
--- drivers/acpi/dispatcher/dsopcode.c | 26 ++++++++++++++++++++++---- include/acpi/acconfig.h | 4 ++++ include/acpi/acexcep.h | 4 +++- include/acpi/aclocal.h | 1 + 4 files changed, 30 insertions(+), 5 deletions(-)
drivers/acpi/dispatcher/dsopcode.c +21 -3
@@ -1262,13 +1262,31 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH ,"[WHILE_OP] Op=%p\n" , op)); -if (walk_state->control_state->common.value) { + control_state = walk_state->control_state; +if (control_state->common.value) { -/* Predicate was true, go back and evaluate it again! */ +/* Predicate was true, the body of the loop was just executed */ +/* +* This loop counter mechanism allows the interpreter to escape +* possibly infinite loops. This can occur in poorly written AML +* when the hardware does not respond within a while loop and the +* loop does not implement a timeout. +*/ + control_state->control.loop_count++; +if (control_state->control.loop_count > +ACPI_MAX_LOOP_ITERATIONS ) { + status =AE_AML_INFINITE_LOOP ; +break ; + } + +/* +* Go back and evaluate the predicate and maybe execute the loop +* another time +*/ status =AE_CTRL_PENDING ; walk_state->aml_last_while = - walk_state->control_state->control.aml_predicate_start; + control_state->control.aml_predicate_start;break ; }
include/acpi/acconfig.h +4 -0
@@ -119,6 +119,10 @@#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4 +/* Maximum number of While() loop iterations before forced abort */ + +#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF +/****************************************************************************** * * ACPI Specification constants (Do not change unless the specification changes)
include/acpi/acexcep.h +3 -1
@@ -153,8 +153,9 @@#define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x001E | AE_CODE_AML)#define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x001F | AE_CODE_AML)#define AE_AML_ILLEGAL_ADDRESS (acpi_status) (0x0020 | AE_CODE_AML) +#define AE_AML_INFINITE_LOOP (acpi_status) (0x0021 | AE_CODE_AML) -#define AE_CODE_AML_MAX 0x0020 +#define AE_CODE_AML_MAX 0x0021/* * Internal exceptions used for control
@@ -267,6 +268,7 @@ char const *acpi_gbl_exception_names_aml[] = {"AE_AML_CIRCULAR_REFERENCE" ,"AE_AML_BAD_RESOURCE_LENGTH" ,"AE_AML_ILLEGAL_ADDRESS" , +"AE_AML_INFINITE_LOOP" }; char const *acpi_gbl_exception_names_ctrl[] = {
include/acpi/aclocal.h +1 -0
@@ -566,6 +566,7 @@ struct acpi_control_state {union acpi_parse_object *predicate_op;u8 *aml_predicate_start;/* Start of if/while predicate */ u8 *package_end;/* End of if/while block */ +u32 loop_count;/* While() loop counter */ };/*
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 24/94 ACPICA: Update debug output for IndexField I/O
In reply to Len BrownFrom: Bob Moore <[email protected]>
Split the "data register I/O" with more informative read and write messages.
--- drivers/acpi/executer/exfldio.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/acpi/executer/exfldio.c +7 -4
@@ -498,14 +498,13 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,return_ACPI_STATUS (status); } -ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD , -"I/O to Data Register: ValuePtr %p\n" , - value)); -if (read_write ==ACPI_READ ) {/* Read the datum from the data_register */ +ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD , +"Read from Data Register\n" )); + status = acpi_ex_extract_from_field(obj_desc->index_field. data_obj, value,
@@ -513,6 +512,10 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, }else {/* Write the datum to the data_register */ +ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD , +"Write to Data Register: Value %8.8X%8.8X\n" , +ACPI_FORMAT_UINT64 (*value))); + status = acpi_ex_insert_into_field(obj_desc->index_field. data_obj, value,
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 25/94 ACPICA: Fix namestring for the SystemCMOS address space
In reply to Len BrownFrom: Bob Moore <[email protected]>
This fixes the name of this address space, changing it from the incorrect CMOS to the correct SystemCMOS.
--- drivers/acpi/utilities/utglobal.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/utilities/utglobal.c +1 -1
@@ -352,7 +352,7 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {"PCI_Config" ,"EmbeddedControl" ,"SMBus" , -"CMOS" , +"SystemCMOS" ,"PCIBARTarget" , "DataTable" };
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 26/94 ACPICA: Emit warning if two FACS or DSDT tables found in the FADT
In reply to Len BrownFrom: Bob Moore <[email protected]>
Checks if there are two valid but different addresses for the FACS and DSDT within the FADT (mismatch between the 32-bit and 64-bit fields.)
--- drivers/acpi/tables/tbfadt.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-)
drivers/acpi/tables/tbfadt.c +15 -2
@@ -286,14 +286,27 @@ static void acpi_tb_convert_fadt(void) acpi_gbl_FADT.header.length =sizeof (struct acpi_table_fadt ); -/* Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary */ - +/* +* Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. +* Later code will always use the X 64-bit field. Also, check for an +* address mismatch between the 32-bit and 64-bit address fields +* (FIRMWARE_CTRL/X_FIRMWARE_CTRL, DSDT/X_DSDT) which would indicate +* the presence of two FACS or two DSDT tables. +*/ if (!acpi_gbl_FADT.Xfacs) { acpi_gbl_FADT.Xfacs = (u64 ) acpi_gbl_FADT.facs; + }else if (acpi_gbl_FADT.facs && + (acpi_gbl_FADT.Xfacs != (u64 ) acpi_gbl_FADT.facs)) { +ACPI_WARNING ((AE_INFO , +"32/64 FACS address mismatch in FADT - two FACS tables!" )); }if (!acpi_gbl_FADT.Xdsdt) { acpi_gbl_FADT.Xdsdt = (u64 ) acpi_gbl_FADT.dsdt; + }else if (acpi_gbl_FADT.dsdt && + (acpi_gbl_FADT.Xdsdt != (u64 ) acpi_gbl_FADT.dsdt)) { +ACPI_WARNING ((AE_INFO , +"32/64 DSDT address mismatch in FADT - two DSDT tables!" )); }/*
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 27/94 ACPICA: Add global pointer for FACS table to simplify FACS access
In reply to Len BrownFrom: Bob Moore <[email protected]>
Use a global pointer instead of using AcpiGetTableByIndex for each FACS access. This simplifies the code for the Global Lock and the Firmware Waking Vector(s).
--- drivers/acpi/events/evmisc.c | 22 ++++++---------------- drivers/acpi/hardware/hwsleep.c | 37 ++++++------------------------------- drivers/acpi/tables/tbutils.c | 24 ++++++++++++++++++++++++ drivers/acpi/utilities/utglobal.c | 1 + drivers/acpi/utilities/utxface.c | 11 +++++++++++ include/acpi/acglobal.h | 1 + include/acpi/actables.h | 2 ++ 7 files changed, 51 insertions(+), 47 deletions(-)
drivers/acpi/events/evmisc.c +6 -16
@@ -49,11 +49,7 @@#define _COMPONENT ACPI_EVENTSACPI_MODULE_NAME ("evmisc" ) -/* Pointer to FACS needed for the Global Lock */ -static struct acpi_table_facs *facs =NULL ; - /* Local prototypes */ - static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);static u32 acpi_ev_global_lock_handler (void *context);
@@ -299,7 +295,7 @@ static u32 acpi_ev_global_lock_handler(void *context)* If we don't get it now, it will be marked pending and we will * take another interrupt when it becomes free. */ -ACPI_ACQUIRE_GLOBAL_LOCK (facs, acquired); +ACPI_ACQUIRE_GLOBAL_LOCK (acpi_gbl_FACS, acquired);if (acquired) {/* Got the lock, now wake all threads waiting for it */
@@ -336,15 +332,8 @@ acpi_status acpi_ev_init_global_lock_handler(void)ACPI_FUNCTION_TRACE (ev_init_global_lock_handler); - status =acpi_get_table_by_index (ACPI_TABLE_INDEX_FACS , - ACPI_CAST_INDIRECT_PTR(struct - acpi_table_header, - &facs)); -if (ACPI_FAILURE (status)) { -return_ACPI_STATUS (status); - } +/* Attempt installation of the global lock handler */ - acpi_gbl_global_lock_present = TRUE; status =acpi_install_fixed_event_handler (ACPI_EVENT_GLOBAL , acpi_ev_global_lock_handler,NULL );
@@ -361,9 +350,10 @@ acpi_status acpi_ev_init_global_lock_handler(void) "No response from Global Lock hardware, disabling lock")); acpi_gbl_global_lock_present = FALSE; - status =AE_OK ; +return_ACPI_STATUS (AE_OK ); } + acpi_gbl_global_lock_present = TRUE;return_ACPI_STATUS (status); }
@@ -472,7 +462,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)/* Attempt to acquire the actual hardware lock */ -ACPI_ACQUIRE_GLOBAL_LOCK (facs, acquired); +ACPI_ACQUIRE_GLOBAL_LOCK (acpi_gbl_FACS, acquired);if (acquired) {/* We got the lock */
@@ -536,7 +526,7 @@ acpi_status acpi_ev_release_global_lock(void)/* Allow any thread to release the lock */ -ACPI_RELEASE_GLOBAL_LOCK (facs, pending); +ACPI_RELEASE_GLOBAL_LOCK (acpi_gbl_FACS, pending);/* * If the pending bit was set, we must write GBL_RLS to the control
drivers/acpi/hardware/hwsleep.c +6 -31
@@ -63,20 +63,8 @@ ACPI_MODULE_NAME("hwsleep")acpi_status acpi_set_firmware_waking_vector (u32 physical_address) { -struct acpi_table_facs *facs; -acpi_status status; -ACPI_FUNCTION_TRACE (acpi_set_firmware_waking_vector); -/* Get the FACS */ - - status =acpi_get_table_by_index (ACPI_TABLE_INDEX_FACS , - ACPI_CAST_INDIRECT_PTR(struct - acpi_table_header, - &facs)); -if (ACPI_FAILURE (status)) { -return_ACPI_STATUS (status); - }/* * According to the ACPI specification 2.0c and later, the 64-bit
@@ -88,12 +76,12 @@ acpi_set_firmware_waking_vector(u32 physical_address)/* Set the 32-bit vector */ - facs->firmware_waking_vector = physical_address; + acpi_gbl_FACS->firmware_waking_vector = physical_address;/* Clear the 64-bit vector if it exists */ -if ((facs->length >32 ) && (facs->version >=1 )) { - facs->xfirmware_waking_vector =0 ; +if ((acpi_gbl_FACS->length >32 ) && (acpi_gbl_FACS->version >=1 )) { + acpi_gbl_FACS->xfirmware_waking_vector =0 ; }return_ACPI_STATUS (AE_OK );
@@ -117,32 +105,19 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector)acpi_status acpi_set_firmware_waking_vector64 (u64 physical_address) { -struct acpi_table_facs *facs; -acpi_status status; -ACPI_FUNCTION_TRACE (acpi_set_firmware_waking_vector64); -/* Get the FACS */ - - status =acpi_get_table_by_index (ACPI_TABLE_INDEX_FACS , - ACPI_CAST_INDIRECT_PTR(struct - acpi_table_header, - &facs)); -if (ACPI_FAILURE (status)) { -return_ACPI_STATUS (status); - } -/* Determine if the 64-bit vector actually exists */ -if ((facs->length <=32 ) || (facs->version <1 )) { +if ((acpi_gbl_FACS->length <=32 ) || (acpi_gbl_FACS->version <1 )) {return_ACPI_STATUS (AE_NOT_EXIST ); }/* Clear 32-bit vector, set the 64-bit X_ vector */ - facs->firmware_waking_vector =0 ; - facs->xfirmware_waking_vector = physical_address; + acpi_gbl_FACS->firmware_waking_vector =0 ; + acpi_gbl_FACS->xfirmware_waking_vector = physical_address;return_ACPI_STATUS (AE_OK ); }
drivers/acpi/tables/tbutils.c +24 -0
@@ -113,6 +113,30 @@ acpi_tb_check_xsdt(acpi_physical_address address)/******************************************************************************* * +* FUNCTION: acpi_tb_initialize_facs +* +* PARAMETERS: None +* +* RETURN: Status +* +* DESCRIPTION: Create a permanent mapping for the FADT and save it in a global +* for accessing the Global Lock and Firmware Waking Vector +* +******************************************************************************/ + +acpi_status acpi_tb_initialize_facs (void ) +{ +acpi_status status; + + status =acpi_get_table_by_index (ACPI_TABLE_INDEX_FACS , + ACPI_CAST_INDIRECT_PTR(struct + acpi_table_header, + &acpi_gbl_FACS)); +return status; +} + +/******************************************************************************* +* * FUNCTION: acpi_tb_tables_loaded * * PARAMETERS: None
drivers/acpi/utilities/utglobal.c +1 -0
@@ -771,6 +771,7 @@ acpi_status acpi_ut_init_globals(void) acpi_gbl_global_lock_mutex =NULL ; acpi_gbl_global_lock_acquired = FALSE; acpi_gbl_global_lock_handle =0 ; + acpi_gbl_global_lock_present = FALSE;/* Miscellaneous variables */
drivers/acpi/utilities/utxface.c +11 -0
@@ -45,6 +45,7 @@#include <acpi/acevents.h> #include <acpi/acnamesp.h> #include <acpi/acdebug.h> +#include <acpi/actables.h> #define _COMPONENT ACPI_UTILITIESACPI_MODULE_NAME ("utxface" )
@@ -148,6 +149,16 @@ acpi_status acpi_enable_subsystem(u32 flags) }/* +* Obtain a permanent mapping for the FACS. This is required for the +* Global Lock and the Firmware Waking Vector +*/ + status =acpi_tb_initialize_facs (); +if (ACPI_FAILURE (status)) { +ACPI_WARNING ((AE_INFO ,"Could not map the FACS table" )); +return_ACPI_STATUS (status); + } + +/* * Install the default op_region handlers. These are installed unless * other handlers have already been installed via the * install_address_space_handler interface.
include/acpi/acglobal.h +1 -0
@@ -140,6 +140,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags;*/ ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list; ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT; +ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS;extern u8 acpi_gbl_permanent_mmap;/* These addresses are calculated from FADT address values */
include/acpi/actables.h +2 -0
@@ -94,6 +94,8 @@ void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded);/* * tbutils - table manager utilities */ +acpi_status acpi_tb_initialize_facs (void ); +u8 acpi_tb_tables_loaded (void );void
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 28/94 ACPICA: Reformat comments, no functional changes
In reply to Len BrownFrom: Bob Moore <[email protected]>
Reformat comments to use fewer lines.
--- drivers/acpi/events/evevent.c | 14 ++-- drivers/acpi/events/evgpe.c | 36 ++++++------ drivers/acpi/events/evgpeblk.c | 38 ++++++------ drivers/acpi/events/evmisc.c | 29 ++++----- drivers/acpi/events/evregion.c | 133 +++++++++++++++++++--------------------- drivers/acpi/events/evrgnini.c | 41 ++++++------- drivers/acpi/events/evsci.c | 10 +-- drivers/acpi/events/evxface.c | 2 +- drivers/acpi/events/evxfevnt.c | 12 ++-- 9 files changed, 152 insertions(+), 163 deletions(-)
drivers/acpi/events/evevent.c +7 -7
@@ -72,8 +72,8 @@ acpi_status acpi_ev_initialize_events(void)/* * Initialize the Fixed and General Purpose Events. This is done prior to -* enabling SCIs to prevent interrupts from occurring before the handlers are -* installed. +* enabling SCIs to prevent interrupts from occurring before the handlers +* are installed. */ status =acpi_ev_fixed_event_initialize ();if (ACPI_FAILURE (status)) {
@@ -192,8 +192,8 @@ static acpi_status acpi_ev_fixed_event_initialize(void)acpi_status status;/* -* Initialize the structure that keeps track of fixed event handlers -* and enable the fixed events. +* Initialize the structure that keeps track of fixed event handlers and +* enable the fixed events. */ for (i =0 ; i <ACPI_NUM_FIXED_EVENTS ; i++) { acpi_gbl_fixed_event_handlers[i].handler =NULL ;
@@ -237,7 +237,7 @@ u32 acpi_ev_fixed_event_detect(void)/* * Read the fixed feature status and enable registers, as all the cases -* depend on their values. Ignore errors here. +* depend on their values. Ignore errors here. */ (void )acpi_hw_register_read (ACPI_REGISTER_PM1_STATUS , &fixed_status); (void )acpi_hw_register_read (ACPI_REGISTER_PM1_ENABLE , &fixed_enable);
@@ -291,8 +291,8 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event) status_register_id, 1);/* -* Make sure we've got a handler. If not, report an error. -* The event is disabled to prevent further interrupts. +* Make sure we've got a handler. If not, report an error. The event is +* disabled to prevent further interrupts. */ if (NULL == acpi_gbl_fixed_event_handlers[event].handler) { (void)acpi_set_register(acpi_gbl_fixed_event_info[event].
drivers/acpi/events/evgpe.c +18 -18
@@ -125,7 +125,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info, (1 << (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number)); -/* 1) Disable case. Simply clear all enable bits */ +/* 1) Disable case. Simply clear all enable bits */ if (type ==ACPI_GPE_DISABLE ) { ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake,
@@ -134,7 +134,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,return_ACPI_STATUS (AE_OK ); } -/* 2) Enable case. Set/Clear the appropriate enable bits */ +/* 2) Enable case. Set/Clear the appropriate enable bits */ switch (gpe_event_info->flags &ACPI_GPE_TYPE_MASK ) {case ACPI_GPE_TYPE_WAKE :
@@ -295,7 +295,7 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)* * FUNCTION: acpi_ev_get_gpe_event_info * -* PARAMETERS: gpe_device - Device node. NULL for GPE0/GPE1 +* PARAMETERS: gpe_device - Device node. NULL for GPE0/GPE1 * gpe_number - Raw GPE number * * RETURN: A GPE event_info struct. NULL if not a valid GPE
@@ -372,7 +372,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,* * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * -* DESCRIPTION: Detect if any GP events have occurred. This function is +* DESCRIPTION: Detect if any GP events have occurred. This function is * executed at interrupt level. * ******************************************************************************/
@@ -400,8 +400,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)/* * We need to obtain the GPE lock for both the data structs and registers -* Note: Not necessary to obtain the hardware lock, since the GPE registers -* are owned by the gpe_lock. +* Note: Not necessary to obtain the hardware lock, since the GPE +* registers are owned by the gpe_lock. */ flags =acpi_os_acquire_lock (acpi_gbl_gpe_lock);
@@ -410,9 +410,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) gpe_block = gpe_xrupt_list->gpe_block_list_head;while (gpe_block) {/* -* Read all of the 8-bit GPE status and enable registers -* in this GPE block, saving all of them. -* Find all currently active GP events. +* Read all of the 8-bit GPE status and enable registers in this GPE +* block, saving all of them. Find all currently active GP events. */ for (i =0 ; i < gpe_block->register_count; i++) {
@@ -527,8 +526,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) (void )acpi_ev_enable_gpe (gpe_event_info, FALSE);/* -* Take a snapshot of the GPE info for this level - we copy the -* info to prevent a race condition with remove_handler/remove_block. +* Take a snapshot of the GPE info for this level - we copy the info to +* prevent a race condition with remove_handler/remove_block. */ ACPI_MEMCPY (&local_gpe_event_info, gpe_event_info,sizeof (struct acpi_gpe_event_info ));
@@ -539,8 +538,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) }/* -* Must check for control method type dispatch one more -* time to avoid race with ev_gpe_install_handler +* Must check for control method type dispatch one more time to avoid a +* race with ev_gpe_install_handler */ if ((local_gpe_event_info.flags &ACPI_GPE_DISPATCH_MASK ) ==ACPI_GPE_DISPATCH_METHOD ) {
@@ -584,8 +583,8 @@ static void acpi_ev_asynch_enable_gpe(void *context)if ((gpe_event_info->flags &ACPI_GPE_XRUPT_TYPE_MASK ) ==ACPI_GPE_LEVEL_TRIGGERED ) {/* -* GPE is level-triggered, we clear the GPE status bit after -* handling the event. +* GPE is level-triggered, we clear the GPE status bit after handling +* the event. */ status =acpi_hw_clear_gpe (gpe_event_info);if (ACPI_FAILURE (status)) {
@@ -624,7 +623,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)acpi_os_gpe_count (gpe_number);/* -* If edge-triggered, clear the GPE status bit now. Note that +* If edge-triggered, clear the GPE status bit now. Note that * level-triggered events are cleared after the GPE is serviced. */ if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
@@ -650,7 +649,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)/* * Invoke the installed handler (at interrupt level) -* Ignore return status for now. TBD: leave GPE disabled on error? +* Ignore return status for now. +* TBD: leave GPE disabled on error? */ (void)gpe_event_info->dispatch.handler->address(gpe_event_info-> dispatch.
@@ -708,7 +708,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) gpe_number));/* -* Disable the GPE. The GPE will remain disabled until the ACPI +* Disable the GPE. The GPE will remain disabled until the ACPICA * Core Subsystem is restarted, or a handler is installed. */ status =acpi_ev_disable_gpe (gpe_event_info);
drivers/acpi/events/evgpeblk.c +20 -18
@@ -309,17 +309,17 @@ acpi_ev_save_method_info(acpi_handle obj_handle, (gpe_block->block_base_number + (gpe_block->register_count * 8)))) {/* -* Not valid for this GPE block, just ignore it -* However, it may be valid for a different GPE block, since GPE0 and GPE1 -* methods both appear under \_GPE. +* Not valid for this GPE block, just ignore it. However, it may be +* valid for a different GPE block, since GPE0 and GPE1 methods both +* appear under \_GPE. */ return_ACPI_STATUS (AE_OK ); }/* -* Now we can add this information to the gpe_event_info block -* for use during dispatch of this GPE. Default type is RUNTIME, although -* this may change when the _PRW methods are executed later. +* Now we can add this information to the gpe_event_info block for use +* during dispatch of this GPE. Default type is RUNTIME, although this may +* change when the _PRW methods are executed later. */ gpe_event_info = &gpe_block->event_info[gpe_number - gpe_block->block_base_number];
@@ -394,8 +394,8 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, gpe_block = gpe_info->gpe_block;/* -* The _PRW object must return a package, we are only interested -* in the first element +* The _PRW object must return a package, we are only interested in the +* first element */ obj_desc = pkg_desc->package.elements[0 ];
@@ -434,7 +434,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,/* * Is this GPE within this block? * -* TRUE iff these conditions are true: +* TRUE if and only if these conditions are true: * 1) The GPE devices match. * 2) The GPE index(number) is within the range of the Gpe Block * associated with the GPE device.
@@ -457,6 +457,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,if (ACPI_FAILURE (status)) { goto cleanup; } + status =acpi_ev_update_gpe_enable_masks (gpe_event_info,ACPI_GPE_DISABLE );
@@ -476,9 +477,9 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,* RETURN: A GPE interrupt block * * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt -* block per unique interrupt level used for GPEs. -* Should be called only when the GPE lists are semaphore locked -* and not subject to change. +* block per unique interrupt level used for GPEs. Should be +* called only when the GPE lists are semaphore locked and not +* subject to change. * ******************************************************************************/
@@ -608,8 +609,9 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)* * FUNCTION: acpi_ev_install_gpe_block * -* PARAMETERS: gpe_block - New GPE block -* interrupt_number - Xrupt to be associated with this GPE block +* PARAMETERS: gpe_block - New GPE block +* interrupt_number - Xrupt to be associated with this +* GPE block * * RETURN: Status *
@@ -666,7 +668,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,* * FUNCTION: acpi_ev_delete_gpe_block * -* PARAMETERS: gpe_block - Existing GPE block +* PARAMETERS: gpe_block - Existing GPE block * * RETURN: Status *
@@ -786,9 +788,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)/* * Initialize the GPE Register and Event structures. A goal of these -* tables is to hide the fact that there are two separate GPE register sets -* in a given GPE hardware block, the status registers occupy the first half, -* and the enable registers occupy the second half. +* tables is to hide the fact that there are two separate GPE register +* sets in a given GPE hardware block, the status registers occupy the +* first half, and the enable registers occupy the second half. */ this_register = gpe_register_info; this_event = gpe_event_info;
drivers/acpi/events/evmisc.c +14 -15
@@ -148,7 +148,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,break ;default : +/* All other types are not supported */ +return (AE_TYPE ); } }
@@ -189,9 +191,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,acpi_ut_delete_generic_state (notify_info); } }else { -/* -* There is no notify handler (per-device or system) for this device. -*/ +/* There is no notify handler (per-device or system) for this device */ + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No notify handler for Notify (%4.4s, %X) node %p\n", acpi_ut_get_node_name(node), notify_value,
@@ -225,9 +226,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)ACPI_FUNCTION_ENTRY ();/* -* We will invoke a global notify handler if installed. -* This is done _before_ we invoke the per-device handler attached -* to the device. +* We will invoke a global notify handler if installed. This is done +* _before_ we invoke the per-device handler attached to the device. */ if (notify_info->notify.value <=ACPI_MAX_SYS_NOTIFY ) {
@@ -339,11 +339,10 @@ acpi_status acpi_ev_init_global_lock_handler(void) NULL);/* -* If the global lock does not exist on this platform, the attempt -* to enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick) -* Map to AE_OK, but mark global lock as not present. -* Any attempt to actually use the global lock will be flagged -* with an error. +* If the global lock does not exist on this platform, the attempt to +* enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick). +* Map to AE_OK, but mark global lock as not present. Any attempt to +* actually use the global lock will be flagged with an error. */ if (status ==AE_NO_HARDWARE_RESPONSE ) { ACPI_ERROR((AE_INFO,
@@ -452,8 +451,8 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout) }/* -* Make sure that a global lock actually exists. If not, just treat -* the lock as a standard mutex. +* Make sure that a global lock actually exists. If not, just treat the +* lock as a standard mutex. */ if (!acpi_gbl_global_lock_present) { acpi_gbl_global_lock_acquired = TRUE;
@@ -572,8 +571,8 @@ void acpi_ev_terminate(void)if (acpi_gbl_events_initialized) {/* -* Disable all event-related functionality. -* In all cases, on error, print a message but obviously we don't abort. +* Disable all event-related functionality. In all cases, on error, +* print a message but obviously we don't abort. */ /* Disable all fixed events */
drivers/acpi/events/evregion.c +64 -69
260 lines not on this page · raw message
drivers/acpi/events/evrgnini.c +18 -23
96 lines not on this page · raw message
drivers/acpi/events/evsci.c +4 -6
@@ -115,10 +115,8 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)* if this interrupt handler is installed, ACPI is enabled. */ -/* -* GPEs: -* Check for and dispatch any GPEs that have occurred -*/ +/* GPEs: Check for and dispatch any GPEs that have occurred */ + interrupt_handled |=acpi_ev_gpe_detect (gpe_xrupt_list);return_UINT32 (interrupt_handled);
@@ -158,11 +156,11 @@ u32 acpi_ev_install_sci_handler(void)* RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not * installed to begin with * -* DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be +* DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be * taken. * * Note: It doesn't seem important to disable all events or set the event -* enable registers to their original values. The OS should disable +* enable registers to their original values. The OS should disable * the SCI interrupt level when the handler is removed, so no more * events will come in. *
drivers/acpi/events/evxface.c +1 -1
@@ -267,7 +267,7 @@ acpi_install_notify_handler(acpi_handle device,/* * Root Object: * Registering a notify handler on the root object indicates that the -* caller wishes to receive notifications for all objects. Note that +* caller wishes to receive notifications for all objects. Note that * only one <external> global handler can be regsitered (per notify type). */ if (device ==ACPI_ROOT_OBJECT ) {
drivers/acpi/events/evxfevnt.c +6 -6
@@ -161,8 +161,8 @@ acpi_status acpi_enable_event(u32 event, u32 flags) }/* -* Enable the requested fixed event (by writing a one to the -* enable register bit) +* Enable the requested fixed event (by writing a one to the enable +* register bit) */ status = acpi_set_register(acpi_gbl_fixed_event_info[event].
@@ -343,8 +343,8 @@ acpi_status acpi_disable_event(u32 event, u32 flags) }/* -* Disable the requested fixed event (by writing a zero to the -* enable register bit) +* Disable the requested fixed event (by writing a zero to the enable +* register bit) */ status = acpi_set_register(acpi_gbl_fixed_event_info[event].
@@ -396,8 +396,8 @@ acpi_status acpi_clear_event(u32 event) }/* -* Clear the requested fixed event (By writing a one to the -* status register bit) +* Clear the requested fixed event (By writing a one to the status +* register bit) */ status = acpi_set_register(acpi_gbl_fixed_event_info[event].
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 29/94 ACPICA: Add support to externally execute _OSI method
In reply to Len BrownFrom: Bob Moore <[email protected]>
The current implemenation of _OSI within ACPICA only allows other control methods to execute _OSI. This change allows the host OS to execute _OSI via the AcpiEvaluateObject interface. _OSI is a special method -- it does not exist in the AML code, it is implemented within ACPICA.
--- drivers/acpi/dispatcher/dsmethod.c | 3 +++ drivers/acpi/parser/psparse.c | 4 ++++ drivers/acpi/parser/psxface.c | 17 +++++++++++++++++ drivers/acpi/utilities/uteval.c | 6 +++--- 4 files changed, 27 insertions(+), 3 deletions(-)
drivers/acpi/dispatcher/dsmethod.c +3 -0
@@ -412,6 +412,9 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,if (obj_desc->method.method_flags &AML_METHOD_INTERNAL_ONLY ) { status = obj_desc->method.implementation (next_walk_state); +if (status ==AE_OK ) { + status =AE_CTRL_TERMINATE ; + } }return_ACPI_STATUS (status);
drivers/acpi/parser/psparse.c +4 -0
@@ -447,6 +447,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) walk_state, walk_state->parser_state.aml, walk_state->parser_state.aml_size)); +if (!walk_state->parser_state.aml) { +return_ACPI_STATUS (AE_NULL_OBJECT ); + } +/* Create and initialize a new thread state */ thread =acpi_ut_create_thread_state ();
drivers/acpi/parser/psxface.c +17 -0
@@ -45,6 +45,7 @@#include <acpi/acparser.h> #include <acpi/acdispat.h> #include <acpi/acinterp.h> +#include <acpi/amlcode.h> #define _COMPONENT ACPI_PARSERACPI_MODULE_NAME ("psxface" )
@@ -278,6 +279,22 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) goto cleanup; } +/* Invoke an internal method if necessary */ + +if (info->obj_desc->method.method_flags &AML_METHOD_INTERNAL_ONLY ) { + status = info->obj_desc->method.implementation (walk_state); + info->return_object = walk_state->return_desc; + +/* Cleanup states */ + +acpi_ds_scope_stack_clear (walk_state); +acpi_ps_cleanup_scope (&walk_state->parser_state); +acpi_ds_terminate_control_method (walk_state->method_desc, + walk_state); +acpi_ds_delete_walk_state (walk_state); + goto cleanup; + } +/* Parse the AML */ status =acpi_ps_parse_aml (walk_state);
drivers/acpi/utilities/uteval.c +3 -3
@@ -129,7 +129,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)/* The interface is supported */ -return_ACPI_STATUS (AE_CTRL_TERMINATE ); +return_ACPI_STATUS (AE_OK ); } }
@@ -143,13 +143,13 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)/* The interface is supported */ -return_ACPI_STATUS (AE_CTRL_TERMINATE ); +return_ACPI_STATUS (AE_OK ); }/* The interface is not supported */ return_desc->integer.value =0 ; -return_ACPI_STATUS (AE_CTRL_TERMINATE ); +return_ACPI_STATUS (AE_OK ); }/*******************************************************************************
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 30/94 ACPICA: Remove references to obsolete ACPI_DUMP_APP
In reply to Len BrownFrom: Bob Moore <[email protected]>
This define is no longer used.
--- drivers/acpi/namespace/nsaccess.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/acpi/namespace/nsaccess.c +2 -5
@@ -165,12 +165,9 @@ acpi_status acpi_ns_root_initialize(void) obj_desc->method.method_flags =AML_METHOD_INTERNAL_ONLY ; - -#ifndef ACPI_DUMP_APP obj_desc->method.implementation = acpi_ut_osi_implementation;#endif -#endif break ;case ACPI_TYPE_INTEGER :
@@ -521,11 +518,11 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, }/* -* Search namespace for each segment of the name. Loop through and +* Search namespace for each segment of the name. Loop through and * verify (or add to the namespace) each name segment. * * The object type is significant only at the last name -* segment. (We don't care about the types along the path, only +* segment. (We don't care about the types along the path, only * the type of the final target object.) */ this_search_type =ACPI_TYPE_ANY ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 31/94 ACPICA: Fix to allow aliases within ASL namepaths
In reply to Len BrownFrom: Bob Moore <[email protected]>
Fixes a problem where the use of an alias within a namepath would result in a not found error or cause the compiler to fault. Also now allows forward references from the Alias operator itself. ACPICA BZ 738.
http://www.acpica.org/bugzilla/show_bug.cgi?id=738
--- drivers/acpi/namespace/nsaccess.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/acpi/namespace/nsaccess.c +4 -0
@@ -588,6 +588,10 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,* segments). */ if (this_node->type ==ACPI_TYPE_LOCAL_ALIAS ) { +if (!this_node->object) { +return_ACPI_STATUS (AE_NOT_EXIST ); + } +if (acpi_ns_opens_scope (((struct acpi_namespace_node *)this_node-> object)->type)) {
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 32/94 ACPICA: Allow multiple backslash prefix in namepaths
In reply to Len BrownFrom: Lin Ming <[email protected]>
In a fully qualified namepath, allow multiple backslash prefixes. This can happen because of the use of a double-backslash in strings (since backslash is the escape character) causing confusion. ACPICA BZ 739 Lin Ming.
http://www.acpica.org/bugzilla/show_bug.cgi?id=739
--- drivers/acpi/namespace/nsutils.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/acpi/namespace/nsutils.c +7 -1
@@ -314,9 +314,15 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)* * strlen() + 1 covers the first name_seg, which has no path separator */ -if (acpi_ns_valid_root_prefix (next_external_char[0 ])) { +if (acpi_ns_valid_root_prefix (*next_external_char)) { info->fully_qualified = TRUE; next_external_char++; + +/* Skip redundant root_prefix, like \\_SB.PCI0.SBRG.EC0 */ + +while (acpi_ns_valid_root_prefix (*next_external_char)) { + next_external_char++; + } }else {/* * Handle Carat prefixes
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 33/94 ACPICA: Add Buffer->String conversion for predefined methods
In reply to Len BrownFrom: Bob Moore <[email protected]>
For predefined methods (such as _BIF), add automatic conversion for objects that are required to be a String, but a Buffer was found instead. This can happen when reading string battery data from an operation region, because it used to be difficult to convert the data from buffer to string from within the ASL. Linux BZ 11822.
http://bugzilla.kernel.org/show_bug.cgi?id=11822
--- drivers/acpi/namespace/nseval.c | 3 +- drivers/acpi/namespace/nspredef.c | 150 ++++++++++++++++++++++++++++++------- include/acpi/acnamesp.h | 2 +- 3 files changed, 125 insertions(+), 30 deletions(-)
drivers/acpi/namespace/nseval.c +1 -2
@@ -282,8 +282,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)* the method on invalid return object. */ (void )acpi_ns_check_predefined_names (node, - info-> - return_object); + &info->return_object); }/* Mark the node as having been evaluated */
drivers/acpi/namespace/nspredef.c +123 -27
284 lines not on this page · raw message
include/acpi/acnamesp.h +1 -1
@@ -182,7 +182,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);*/ acpi_status acpi_ns_check_predefined_names (struct acpi_namespace_node *node, -union acpi_operand_object *return_object); +union acpi_operand_object **return_object);const union acpi_predefined_info *acpi_ns_check_for_predefined_name (struct acpi_namespace_node
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 34/94 ACPICA: Consolidate method arg count validation code
In reply to Len BrownFrom: Bob Moore <[email protected]>
Merge the code that validates control method argument counts into the predefined validation module. Eliminates possible multiple warnings for incorrect counts.
--- drivers/acpi/namespace/nseval.c | 69 +++++------------------- drivers/acpi/namespace/nspredef.c | 106 ++++++++++++++++++++++++++++++------- include/acpi/acnamesp.h | 3 + 3 files changed, 104 insertions(+), 74 deletions(-)
drivers/acpi/namespace/nseval.c +14 -55
@@ -89,6 +89,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)/* Initialize the return value to an invalid object */ info->return_object =NULL ; + info->param_count =0 ;/* * Get the actual namespace node for the target object. Handles these cases:
@@ -141,41 +142,17 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)return_ACPI_STATUS (AE_NULL_OBJECT ); } -/* -* Calculate the number of arguments being passed to the method -*/ +/* Count the number of arguments being passed to the method */ - info->param_count =0 ;if (info->parameters) { -while (info->parameters[info->param_count]) +while (info->parameters[info->param_count]) { +if (info->param_count >ACPI_METHOD_MAX_ARG ) { +return_ACPI_STATUS (AE_LIMIT ); + } info->param_count++; + } } -/* -* Warning if too few or too many arguments have been passed by the -* caller. We don't want to abort here with an error because an -* incorrect number of arguments may not cause the method to fail. -* However, the method will fail if there are too few arguments passed -* and the method attempts to use one of the missing ones. -*/ - -if (info->param_count < info->obj_desc->method.param_count) { -ACPI_WARNING ((AE_INFO , -"Insufficient arguments - " -"method [%4.4s] needs %d, found %d" , -acpi_ut_get_node_name (info->resolved_node), - info->obj_desc->method.param_count, - info->param_count)); - }else if (info->param_count > - info->obj_desc->method.param_count) { -ACPI_WARNING ((AE_INFO , -"Excess arguments - " -"method [%4.4s] needs %d, found %d" , -acpi_ut_get_node_name (info-> - resolved_node), - info->obj_desc->method.param_count, - info->param_count)); - }ACPI_DUMP_PATHNAME (info->resolved_node,"Execute Method:" ,ACPI_LV_INFO , _COMPONENT);
@@ -264,31 +241,13 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) } } -/* Validation of return values for ACPI-predefined methods and objects */ - -if ((status ==AE_OK ) || (status ==AE_CTRL_RETURN_VALUE )) { -/* -* If this is the first evaluation, check the return value. This -* ensures that any warnings will only be emitted during the very -* first evaluation of the object. -*/ -if (!(node->flags &ANOBJ_EVALUATED )) { -/* -* Check for a predefined ACPI name. If found, validate the -* returned object. -* -* Note: Ignore return status for now, emit warnings if there are -* problems with the returned object. May change later to abort -* the method on invalid return object. -*/ - (void )acpi_ns_check_predefined_names (node, - &info->return_object); - } - -/* Mark the node as having been evaluated */ - - node->flags |=ANOBJ_EVALUATED ; - } +/* +* Check input argument count against the ASL-defined count for a method. +* Also check predefined names: argument count and return value against +* the ACPI specification. Some incorrect return value types are repaired. +*/ + (void )acpi_ns_check_predefined_names (node, info->param_count, + status, &info->return_object);/* Check if there is a return value that must be dealt with */
drivers/acpi/namespace/nspredef.c +87 -19
167 lines not on this page · raw message
include/acpi/acnamesp.h +3 -0
@@ -182,6 +182,8 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);*/ acpi_status acpi_ns_check_predefined_names (struct acpi_namespace_node *node, +u32 user_param_count, +acpi_status return_status,union acpi_operand_object **return_object); const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
@@ -191,6 +193,7 @@ const union acpi_predefined_info *acpi_ns_check_for_predefined_name(structvoid acpi_ns_check_parameter_count (char *pathname,struct acpi_namespace_node *node, +u32 user_param_count,const union acpi_predefined_info *info);/*
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 35/94 ACPICA: Enhance implicit return mechanism
In reply to Len BrownFrom: Lin Ming <[email protected]>
For Windows compatibility, return an implicit integer of value zero for methods that have no executable code. A default implicit value of zero is provided for methods. Lin Ming.
--- drivers/acpi/parser/psxface.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
drivers/acpi/parser/psxface.c +16 -0
@@ -295,6 +295,22 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) goto cleanup; } +/* +* Start method evaluation with an implicit return of zero. +* This is done for Windows compatibility. +*/ +if (acpi_gbl_enable_interpreter_slack) { + walk_state->implicit_return_obj = +acpi_ut_create_internal_object (ACPI_TYPE_INTEGER ); +if (!walk_state->implicit_return_obj) { + status =AE_NO_MEMORY ; +acpi_ds_delete_walk_state (walk_state); + goto cleanup; + } + + walk_state->implicit_return_obj->integer.value =0 ; + } +/* Parse the AML */ status =acpi_ps_parse_aml (walk_state);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 36/94 ACPICA: Update version to 20081031
In reply to Len BrownFrom: Bob Moore <[email protected]>
--- include/acpi/acconfig.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
@@ -63,7 +63,7 @@/* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20080926 +#define ACPI_CA_VERSION 0x20081031/* * OS name, used for the _OS object. The _OS object is essentially obsolete,
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 37/94 cpuidle: Add decaying history logic to menu idle predictor
In reply to Len BrownFrom: Pallipadi, Venkatesh <[email protected]>
Add decaying history of predicted idle time, instead of using the last early wakeup. This logic helps menu governor do better job of predicting idle time.
With this change, we also measured noticable (~8%) power savings on a DP server system with CPUs supporting deep C states, when system was lightly loaded. There was no change to power or perf on other load conditions.
--- drivers/cpuidle/governors/menu.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/cpuidle/governors/menu.c +9 -1
@@ -15,12 +15,14 @@#include <linux/tick.h> #define BREAK_FUZZ 4/* 4 us */ +#define PRED_HISTORY_PCT 50struct menu_device {int last_state_idx;unsigned int expected_us;unsigned int predicted_us; +unsigned int current_predicted_us;unsigned int last_measured_us;unsigned int elapsed_us; };
@@ -47,6 +49,12 @@ static int menu_select(struct cpuidle_device *dev) data->expected_us = (u32 )ktime_to_ns (tick_nohz_get_sleep_length ()) /1000 ; +/* Recalculate predicted_us based on prediction_history_pct */ + data->predicted_us *=PRED_HISTORY_PCT ; + data->predicted_us += (100 -PRED_HISTORY_PCT ) * + data->current_predicted_us; + data->predicted_us /=100 ; +/* find the deepest idle state that satisfies our constraints */ for (i =CPUIDLE_DRIVER_STATE_START +1 ; i < dev->state_count; i++) {struct cpuidle_state *s = &dev->states[i];
@@ -97,7 +105,7 @@ static void menu_reflect(struct cpuidle_device *dev) measured_us =-1 ;/* Predict time until next break event */ - data->predicted_us =max (measured_us, data->last_measured_us); + data->current_predicted_us =max (measured_us, data->last_measured_us);if (last_idle_us +BREAK_FUZZ < data->expected_us - target->exit_latency) {
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 38/94 ACPI: Do not modify SCI_EN directly
In reply to Len BrownFrom: Rafael J. Wysocki <[email protected]>
According to the ACPI specification the SCI_EN flag is controlled by the hardware, which sets this flag to inform the kernel that ACPI is enabled. For this reason, we shouldn't try to modify SCI_EN directly. Also, we don't need to do it in irqrouter_resume(), since lower-level resume code takes care of enabling ACPI in case it hasn't been enabled by the BIOS before passing control to the kernel (which by the way is against the ACPI specification).
--- drivers/acpi/pci_link.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
drivers/acpi/pci_link.c +0 -4
@@ -796,10 +796,6 @@ static int irqrouter_resume(struct sys_device *dev)struct list_head *node =NULL ;struct acpi_pci_link *link =NULL ; - -/* Make sure SCI is enabled again (Apple firmware bug?) */ -acpi_set_register (ACPI_BITREG_SCI_ENABLE ,1 ); -list_for_each (node, &acpi_link.entries) { link = list_entry(node, struct acpi_pci_link, node);if (!link) {
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 39/94 ACPI: PCI: use conventional PCI address format
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
Use the conventional format for PCI addresses (%04x:%02x:%02x.%d).
--- drivers/acpi/pci_bind.c | 12 ++++++------ drivers/acpi/pci_irq.c | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/acpi/pci_bind.c +6 -6
@@ -99,7 +99,7 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)*/ ACPI_DEBUG_PRINT ((ACPI_DB_INFO , -"Device %s has PCI address %02x:%02x:%02x.%02x\n" , +"Device %s has PCI address %04x:%02x:%02x.%d\n" ,acpi_device_bid (device), id->segment, id->bus, id->device, id->function));
@@ -166,7 +166,7 @@ int acpi_pci_bind(struct acpi_device *device) data->id.device = device->pnp.bus_address >>16 ; data->id.function = device->pnp.bus_address &0xFFFF ; -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"...to %02x:%02x:%02x.%02x\n" , +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"...to %04x:%02x:%02x.%d\n" , data->id.segment, data->id.bus, data->id.device, data->id.function));
@@ -196,7 +196,7 @@ int acpi_pci_bind(struct acpi_device *device) }if (!data->dev) {ACPI_DEBUG_PRINT ((ACPI_DB_INFO , -"Device %02x:%02x:%02x.%02x not present in PCI namespace\n" , +"Device %04x:%02x:%02x.%d not present in PCI namespace\n" , data->id.segment, data->id.bus, data->id.device, data->id.function)); result = -ENODEV ;
@@ -204,7 +204,7 @@ int acpi_pci_bind(struct acpi_device *device) }if (!data->dev->bus) { printk(KERN_ERR PREFIX -"Device %02x:%02x:%02x.%02x has invalid 'bus' field\n" , +"Device %04x:%02x:%02x.%d has invalid 'bus' field\n" , data->id.segment, data->id.bus, data->id.device, data->id.function); result = -ENODEV ;
@@ -219,7 +219,7 @@ int acpi_pci_bind(struct acpi_device *device)*/ if (data->dev->subordinate) {ACPI_DEBUG_PRINT ((ACPI_DB_INFO , -"Device %02x:%02x:%02x.%02x is a PCI bridge\n" , +"Device %04x:%02x:%02x.%d is a PCI bridge\n" , data->id.segment, data->id.bus, data->id.device, data->id.function)); data->bus = data->dev->subordinate;
@@ -353,7 +353,7 @@ acpi_pci_bind_root(struct acpi_device *device,acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer);ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Binding PCI root bridge [%s] to " -"%02x:%02x\n" , pathname, id->segment, id->bus)); +"%04x:%02x\n" , pathname, id->segment, id->bus)); status =acpi_attach_data (device->handle, acpi_pci_data_handler, data);if (ACPI_FAILURE (status)) {
drivers/acpi/pci_irq.c +5 -5
@@ -222,7 +222,7 @@ acpi_pci_irq_add_entry(acpi_handle handle, entry->link.index = prt->source_index;ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO , -" %02X:%02X:%02X[%c] -> %s[%d]\n" , +" %04x:%02x:%02x[%c] -> %s[%d]\n" , entry->id.segment, entry->id.bus, entry->id.device, ('A' + entry->pin), prt->source, entry->link.index));
@@ -328,8 +328,8 @@ void acpi_pci_irq_del_prt(int segment, int bus) }printk (KERN_DEBUG -"ACPI: Delete PCI Interrupt Routing Table for %x:%x\n" , segment, - bus); +"ACPI: Delete PCI Interrupt Routing Table for %04x:%02x\n" , + segment, bus);spin_lock (&acpi_prt_lock);list_for_each_safe (node, n, &acpi_prt.entries) { entry = list_entry(node, struct acpi_prt_entry, node);
@@ -403,12 +403,12 @@ acpi_pci_irq_lookup(struct pci_bus *bus,ACPI_DEBUG_PRINT ((ACPI_DB_INFO , -"Searching for PRT entry for %02x:%02x:%02x[%c]\n" , +"Searching for _PRT entry for %04x:%02x:%02x[%c]\n" , segment, bus_nr, device, ('A' + pin))); entry =acpi_pci_irq_find_prt_entry (segment, bus_nr, device, pin);if (!entry) { -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"PRT entry not found\n" )); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"_PRT entry not found\n" ));return -1 ; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 40/94 ACPI: PCI: remove unnecessary null pointer checks
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
Better to oops and learn about a bug than to silently cover it up.
--- drivers/acpi/pci_irq.c | 18 ------------------ 1 files changed, 0 insertions(+), 18 deletions(-)
drivers/acpi/pci_irq.c +0 -18
@@ -178,10 +178,6 @@ acpi_pci_irq_add_entry(acpi_handle handle, {struct acpi_prt_entry *entry =NULL ; - -if (!prt) -return -EINVAL ; - entry =kzalloc (sizeof (struct acpi_prt_entry ),GFP_KERNEL );if (!entry)return -ENOMEM ;
@@ -432,9 +428,6 @@ acpi_pci_irq_derive(struct pci_dev *dev,u8 bridge_pin =0 , orig_pin = pin; -if (!dev) -return -EINVAL ; -/* * Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge).
@@ -491,9 +484,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev)int rc; -if (!dev) -return -EINVAL ; - pin = dev->pin;if (!pin) { ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -503,11 +493,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev) } pin--; -if (!dev->bus) { -dev_err (&dev->dev,"invalid (NULL) 'bus' field\n" ); -return -ENODEV ; - } -/* * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot.
@@ -586,9 +571,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev)int polarity =ACPI_ACTIVE_LOW ; -if (!dev || !dev->bus) -return ; - pin = dev->pin;if (!pin)return ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 41/94 ACPI: PCI: simplify buffer management for evaluating _PRT
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
Previously, acpi_pci_irq_add_prt() did all its own buffer management. But now that we have ACPI_ALLOCATE_BUFFER, we no longer need to do that management. And we don't have to call acpi_get_irq_routing_table() twice (once to learn the size of the buffer needed, and again to actually get the table).
--- drivers/acpi/pci_irq.c | 52 +++++++++++------------------------------------ 1 files changed, 12 insertions(+), 40 deletions(-)
drivers/acpi/pci_irq.c +12 -40
@@ -243,55 +243,29 @@ acpi_pci_irq_del_entry(int segment, int bus, struct acpi_prt_entry *entry)int acpi_pci_irq_add_prt (acpi_handle handle,int segment,int bus) { -acpi_status status =AE_OK ; -char *pathname =NULL ; -struct acpi_buffer buffer = {0 ,NULL }; -struct acpi_pci_routing_table *prt =NULL ; -struct acpi_pci_routing_table *entry =NULL ; +acpi_status status; +struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; +struct acpi_pci_routing_table *entry;static int first_time =1 ; - - pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); -if (!pathname) -return -ENOMEM ; -if (first_time) { acpi_prt.count =0 ;INIT_LIST_HEAD (&acpi_prt.entries); first_time =0 ; } -/* -* NOTE: We're given a 'handle' to the _PRT object's parent device -* (either a PCI root bridge or PCI-PCI bridge). -*/ - - buffer.length =ACPI_PATHNAME_MAX ; - buffer.pointer = pathname; -acpi_get_name (handle,ACPI_FULL_PATHNAME , &buffer); +/* 'handle' is the _PRT's parent (root bridge or PCI-PCI bridge) */ + status =acpi_get_name (handle,ACPI_FULL_PATHNAME , &buffer); +if (ACPI_FAILURE (status)) +return -ENODEV ;printk (KERN_DEBUG "ACPI: PCI Interrupt Routing Table [%s._PRT]\n" , - pathname); + (char *) buffer.pointer); -/* -* Evaluate this _PRT and add its entries to our global list (acpi_prt). -*/ +kfree (buffer.pointer); - buffer.length =0 ; + buffer.length =ACPI_ALLOCATE_BUFFER ; buffer.pointer =NULL ; -kfree (pathname); - status =acpi_get_irq_routing_table (handle, &buffer); -if (status !=AE_BUFFER_OVERFLOW ) { -ACPI_EXCEPTION ((AE_INFO , status,"Evaluating _PRT [%s]" , -acpi_format_exception (status))); -return -ENODEV ; - } - - prt =kzalloc (buffer.length,GFP_KERNEL ); -if (!prt) { -return -ENOMEM ; - } - buffer.pointer = prt; status =acpi_get_irq_routing_table (handle, &buffer);if (ACPI_FAILURE (status)) {
@@ -301,16 +275,14 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)return -ENODEV ; } - entry = prt; - + entry = buffer.pointer;while (entry && (entry->length >0 )) {acpi_pci_irq_add_entry (handle, segment, bus, entry); entry = (struct acpi_pci_routing_table *) ((unsigned long )entry + entry->length); } -kfree (prt); - +kfree (buffer.pointer);return 0 ; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 42/94 ACPI: PCI: ignore _PRT function information
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
_PRT entries don't contain any useful PCI function information (the function part of the PCI address is supposed to be 0xffff), and we don't ever look at it, so this patch just removes the reference to it.
--- drivers/acpi/pci_irq.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/acpi/pci_irq.c +0 -1
@@ -185,7 +185,6 @@ acpi_pci_irq_add_entry(acpi_handle handle, entry->id.segment = segment; entry->id.bus = bus; entry->id.device = (prt->address >>16 ) &0xFFFF ; - entry->id.function = prt->address &0xFFFF ; entry->pin = prt->pin;do_prt_fixups (entry, prt);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 43/94 ACPI: PCI: fix GSI/IRQ naming confusion
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
The interrupt numbers from _PRT entries are GSIs, not Linux IRQs.
--- drivers/acpi/pci_irq.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
drivers/acpi/pci_irq.c +10 -10
@@ -333,7 +333,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry, *polarity =ACPI_ACTIVE_LOW ; } -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Found IRQ %d\n" , irq)); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Found GSI %d\n" , irq));return irq; }
@@ -432,7 +432,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,return -1 ; } -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Derive IRQ %d for device %s from %s\n" , +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Derive GSI %d for device %s from %s\n" , irq,pci_name (dev),pci_name (bridge)));return irq;
@@ -446,7 +446,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,int acpi_pci_irq_enable (struct pci_dev *dev) { -int irq =0 ; +int gsi =0 ;u8 pin =0 ;int triggering =ACPI_LEVEL_SENSITIVE ;int polarity =ACPI_ACTIVE_LOW ;
@@ -468,7 +468,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot. */ - irq =acpi_pci_irq_lookup (dev->bus,PCI_SLOT (dev->devfn), pin, + gsi =acpi_pci_irq_lookup (dev->bus,PCI_SLOT (dev->devfn), pin, &triggering, &polarity, &link, acpi_pci_allocate_irq);
@@ -476,12 +476,12 @@ int acpi_pci_irq_enable(struct pci_dev *dev)* If no PRT entry was found, we'll try to derive an IRQ from the * device's parent bridge. */ -if (irq <0 ) - irq =acpi_pci_irq_derive (dev, pin, &triggering, +if (gsi <0 ) + gsi =acpi_pci_irq_derive (dev, pin, &triggering, &polarity, &link, acpi_pci_allocate_irq); -if (irq <0 ) { +if (gsi <0 ) {/* * IDE legacy mode controller IRQs are magic. Why do compat * extensions always make such a nasty mess.
@@ -494,7 +494,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)* No IRQ known to the ACPI subsystem - maybe the BIOS / * driver reported one, then use it. Exit in any case. */ -if (irq <0 ) { +if (gsi <0 ) {dev_warn (&dev->dev,"PCI INT %c: no GSI" ,'A' + pin);/* Interrupt Line values above 0xF are forbidden */ if (dev->irq >0 && (dev->irq <=0xF )) {
@@ -508,7 +508,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) } } - rc =acpi_register_gsi (irq, triggering, polarity); + rc =acpi_register_gsi (gsi, triggering, polarity);if (rc <0 ) {dev_warn (&dev->dev,"PCI INT %c: failed to register GSI\n" ,'A' + pin);
@@ -522,7 +522,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) link_desc[0 ] ='\0' ;dev_info (&dev->dev,"PCI INT %c%s -> GSI %u (%s, %s) -> IRQ %d\n" , -'A' + pin, link_desc, irq, +'A' + pin, link_desc, gsi, (triggering ==ACPI_LEVEL_SENSITIVE ) ?"level" :"edge" , (polarity ==ACPI_ACTIVE_LOW ) ?"low" :"high" , dev->irq);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 44/94 ACPI: PCI: move struct acpi_prt_entry declaration out of public header file
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
The struct acpi_prt_entry is used only in pci_irq.c, so there's no need for the declaration to be public. This patch moves it into pci_irq.c.
--- drivers/acpi/pci_irq.c | 16 ++++++++++++++++ include/linux/acpi.h | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-)
drivers/acpi/pci_irq.c +16 -0
@@ -41,6 +41,22 @@#define _COMPONENT ACPI_PCI_COMPONENTACPI_MODULE_NAME ("pci_irq" ); +struct acpi_prt_entry { +struct list_head node; +struct acpi_pci_id id; +u8 pin; +struct { +acpi_handle handle; +u32 index; + } link; +u32 irq; +}; + +struct acpi_prt_list { +int count; +struct list_head entries; +}; +static struct acpi_prt_list acpi_prt;static DEFINE_SPINLOCK (acpi_prt_lock);
include/linux/acpi.h +0 -16
@@ -131,22 +131,6 @@ extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity);*/ void acpi_unregister_gsi (u32 gsi); -struct acpi_prt_entry { -struct list_head node; -struct acpi_pci_id id; -u8 pin; -struct { -acpi_handle handle; -u32 index; - } link; -u32 irq; -}; - -struct acpi_prt_list { -int count; -struct list_head entries; -}; -struct pci_dev ;int acpi_pci_irq_enable (struct pci_dev *dev);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 45/94 ACPI: PCI: add a helper to convert _PRT INTx pin number to name
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
This adds a helper function to convert INTx pin numbers from the _PRT (0, 1, 2, 3) to the pin name ('A', 'B', 'C', 'D').
--- drivers/acpi/pci_irq.c | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 deletions(-)
drivers/acpi/pci_irq.c +15 -10
@@ -60,6 +60,11 @@ struct acpi_prt_list {static struct acpi_prt_list acpi_prt;static DEFINE_SPINLOCK (acpi_prt_lock); +static inline char pin_name (int pin) +{ +return 'A' + pin; +} +/* -------------------------------------------------------------------------- PCI IRQ Routing Table (PRT) Support -------------------------------------------------------------------------- */
@@ -174,14 +179,14 @@ do_prt_fixups(struct acpi_prt_entry *entry, struct acpi_pci_routing_table *prt) entry->id.segment == quirk->segment && entry->id.bus == quirk->bus && entry->id.device == quirk->device && - entry->pin + 'A' == quirk->pin && + pin_name(entry->pin) == quirk->pin && !strcmp(prt->source, quirk->source) && strlen(prt->source) >= strlen(quirk->actual_source)) { printk(KERN_WARNING PREFIX "firmware reports ""%04x:%02x:%02x PCI INT %c connected to %s; " "changing to %s\n" , entry->id.segment, entry->id.bus, - entry->id.device,'A' + entry->pin, + entry->id.device,pin_name (entry->pin), prt->source, quirk->actual_source);strcpy (prt->source, quirk->actual_source); }
@@ -235,8 +240,8 @@ acpi_pci_irq_add_entry(acpi_handle handle,ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO ," %04x:%02x:%02x[%c] -> %s[%d]\n" , entry->id.segment, entry->id.bus, - entry->id.device, ('A' + entry->pin), prt->source, - entry->link.index)); + entry->id.device,pin_name (entry->pin), + prt->source, entry->link.index));spin_lock (&acpi_prt_lock);list_add_tail (&entry->node, &acpi_prt.entries);
@@ -387,7 +392,7 @@ acpi_pci_irq_lookup(struct pci_bus *bus,ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Searching for _PRT entry for %04x:%02x:%02x[%c]\n" , - segment, bus_nr, device, ('A' + pin))); + segment, bus_nr, device,pin_name (pin))); entry =acpi_pci_irq_find_prt_entry (segment, bus_nr, device, pin);if (!entry) {
@@ -444,7 +449,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,if (irq <0 ) {dev_warn (&dev->dev,"can't derive routing for PCI INT %c\n" , -'A' + orig_pin); +pin_name (orig_pin));return -1 ; }
@@ -511,7 +516,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)* driver reported one, then use it. Exit in any case. */ if (gsi <0 ) { -dev_warn (&dev->dev,"PCI INT %c: no GSI" ,'A' + pin); +dev_warn (&dev->dev,"PCI INT %c: no GSI" ,pin_name (pin));/* Interrupt Line values above 0xF are forbidden */ if (dev->irq >0 && (dev->irq <=0xF )) {printk (" - using IRQ %d\n" , dev->irq);
@@ -527,7 +532,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) rc =acpi_register_gsi (gsi, triggering, polarity);if (rc <0 ) {dev_warn (&dev->dev,"PCI INT %c: failed to register GSI\n" , -'A' + pin); +pin_name (pin));return rc; } dev->irq = rc;
@@ -538,7 +543,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) link_desc[0 ] ='\0' ;dev_info (&dev->dev,"PCI INT %c%s -> GSI %u (%s, %s) -> IRQ %d\n" , -'A' + pin, link_desc, gsi, +pin_name (pin), link_desc, gsi, (triggering ==ACPI_LEVEL_SENSITIVE ) ?"level" :"edge" , (polarity ==ACPI_ACTIVE_LOW ) ?"low" :"high" , dev->irq);
@@ -585,6 +590,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev)* (e.g. PCI_UNDEFINED_IRQ). */ -dev_info (&dev->dev,"PCI INT %c disabled\n" ,'A' + pin); +dev_info (&dev->dev,"PCI INT %c disabled\n" ,pin_name (pin));acpi_unregister_gsi (gsi); }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 46/94 ACPI: PCI: always use the PCI INTx pin values, not the _PRT ones
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
This patch changes pci_irq.c to always use PCI INTx pin encodings instead of a mix of PCI and _PRT encodings.
The PCI INTx pin numbers from the PCI_INTERRUPT_PIN config register are 0=device doesn't use interrupts, 1=INTA, ..., 4=INTD. But the _PRT table uses 0=INTA, ..., 3=INTD.
This patch converts the _PRT encoding to the PCI encoding immediately when we add a _PRT entry to the global list. All the rest of the code can then use the PCI encoding consistently.
The point of this is to make the interrupt swizzling look the same as on other architectures, so someday we can unify them.
--- drivers/acpi/pci_irq.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-)
drivers/acpi/pci_irq.c +8 -7
@@ -62,7 +62,7 @@ static DEFINE_SPINLOCK(acpi_prt_lock);static inline char pin_name (int pin) { -return 'A' + pin; +return 'A' + pin -1 ; }/* --------------------------------------------------------------------------
@@ -203,10 +203,15 @@ acpi_pci_irq_add_entry(acpi_handle handle,if (!entry)return -ENOMEM ; +/* +* Note that the _PRT uses 0=INTA, 1=INTB, etc, while PCI uses +* 1=INTA, 2=INTB. We use the PCI encoding throughout, so convert +* it here. +*/ entry->id.segment = segment; entry->id.bus = bus; entry->id.device = (prt->address >>16 ) &0xFFFF ; - entry->pin = prt->pin; + entry->pin = prt->pin +1 ;do_prt_fixups (entry, prt);
@@ -425,7 +430,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,* PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). */ while (irq <0 && bridge->bus->self) { - pin = (pin +PCI_SLOT (bridge->devfn)) %4 ; + pin = (((pin -1 ) +PCI_SLOT (bridge->devfn)) %4 ) +1 ; bridge = bridge->bus->self;if ((bridge->class >>8 ) ==PCI_CLASS_BRIDGE_CARDBUS ) {
@@ -437,8 +442,6 @@ acpi_pci_irq_derive(struct pci_dev *dev, pci_name(bridge)));return -1 ; } -/* Pin is from 0 to 3 */ - bridge_pin--; pin = bridge_pin; }
@@ -483,7 +486,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev) pci_name(dev)));return 0 ; } - pin--;/* * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT
@@ -566,7 +568,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev) pin = dev->pin;if (!pin)return ; - pin--;/* * First we check the PCI IRQ routing table (PRT) for an IRQ.
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 47/94 ACPI: PCI: use 1-based encoding for _PRT quirks
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
Use the PCI INTx pin encoding (1=INTA, 2=INTB, etc) for _PRT quirks. Then we can simply compare "entry->pin == quirk->pin".
--- drivers/acpi/pci_irq.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/acpi/pci_irq.c +6 -4
@@ -145,19 +145,21 @@ struct prt_quirk {char *actual_source; }; +#define PCI_INTX_PIN (c) (c - 'A' + 1) +/* * These systems have incorrect _PRT entries. The BIOS claims the PCI * interrupt at the listed segment/bus/device/pin is connected to the first * link device, but it is actually connected to the second. */ static struct prt_quirk prt_quirks[] = { - { medion_md9580,0 ,0 ,9 ,'A' , + { medion_md9580,0 ,0 ,9 ,PCI_INTX_PIN ('A' ),"\\_SB_.PCI0.ISA_.LNKA" ,"\\_SB_.PCI0.ISA_.LNKB" }, - { dell_optiplex,0 ,0 ,0xd ,'A' , + { dell_optiplex,0 ,0 ,0xd ,PCI_INTX_PIN ('A' ),"\\_SB_.LNKB" ,"\\_SB_.LNKA" }, - { hp_t5710,0 ,0 ,1 ,'A' , + { hp_t5710,0 ,0 ,1 ,PCI_INTX_PIN ('A' ),"\\_SB_.PCI0.LNK1" ,"\\_SB_.PCI0.LNK3" }, };
@@ -179,7 +181,7 @@ do_prt_fixups(struct acpi_prt_entry *entry, struct acpi_pci_routing_table *prt) entry->id.segment == quirk->segment && entry->id.bus == quirk->bus && entry->id.device == quirk->device && - pin_name(entry->pin) == quirk->pin && + entry->pin == quirk->pin && !strcmp(prt->source, quirk->source) && strlen(prt->source) >= strlen(quirk->actual_source)) { printk(KERN_WARNING PREFIX "firmware reports "
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 48/94 ACPI: PCI: lookup _PRT entry by PCI dev and pin, not segment/bus/dev/pin
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
There's no reason to pass around segment, bus, and device independently when we can just pass the pci_dev pointer, which carries all those already.
The pci_dev contains an interrupt pin, too, but we still have to pass both the pci_dev and the pin because when we use a bridge to derive an IRQ, we need the pin from the downstream device, not the bridge.
--- drivers/acpi/pci_irq.c | 27 ++++++++++++--------------- 1 files changed, 12 insertions(+), 15 deletions(-)
drivers/acpi/pci_irq.c +12 -15
@@ -69,11 +69,13 @@ static inline char pin_name(int pin)PCI IRQ Routing Table (PRT) Support -------------------------------------------------------------------------- */ -static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry (int segment, -int bus, -int device,int pin) +static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry (struct pci_dev *dev, +int pin) {struct acpi_prt_entry *entry =NULL ; +int segment =pci_domain_nr (dev->bus); +int bus = dev->bus->number; +int device =PCI_SLOT (dev->devfn);if (!acpi_prt.count)return NULL ;
@@ -385,23 +387,18 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry,* failure: return -1 */ static int -acpi_pci_irq_lookup (struct pci_bus *bus, -int device, -int pin, +acpi_pci_irq_lookup (struct pci_dev *dev,int pin,int *triggering,int *polarity,char **link,irq_lookup_func func) {struct acpi_prt_entry *entry =NULL ; -int segment =pci_domain_nr (bus); -int bus_nr = bus->number;int ret; -ACPI_DEBUG_PRINT ((ACPI_DB_INFO , -"Searching for _PRT entry for %04x:%02x:%02x[%c]\n" , - segment, bus_nr, device,pin_name (pin))); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Searching for _PRT entry for %s[%c]\n" , +pci_name (dev),pin_name (pin))); - entry =acpi_pci_irq_find_prt_entry (segment, bus_nr, device, pin); + entry =acpi_pci_irq_find_prt_entry (dev, pin);if (!entry) {ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"_PRT entry not found\n" ));return -1 ;
@@ -447,7 +444,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, pin = bridge_pin; } - irq =acpi_pci_irq_lookup (bridge->bus,PCI_SLOT (bridge->devfn), + irq =acpi_pci_irq_lookup (bridge, pin, triggering, polarity, link, func); }
@@ -493,7 +490,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot. */ - gsi =acpi_pci_irq_lookup (dev->bus,PCI_SLOT (dev->devfn), pin, + gsi =acpi_pci_irq_lookup (dev, pin, &triggering, &polarity, &link, acpi_pci_allocate_irq);
@@ -574,7 +571,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)/* * First we check the PCI IRQ routing table (PRT) for an IRQ. */ - gsi =acpi_pci_irq_lookup (dev->bus,PCI_SLOT (dev->devfn), pin, + gsi =acpi_pci_irq_lookup (dev, pin, &triggering, &polarity,NULL , acpi_pci_free_irq);/*
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 49/94 ACPI: PCI: tweak _PRT lookup debug
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
Print one message (either "found" or "not found") for every _PRT search. And add pin information to the INTx swizzling debug.
--- drivers/acpi/pci_irq.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
drivers/acpi/pci_irq.c +7 -6
@@ -395,15 +395,16 @@ acpi_pci_irq_lookup(struct pci_dev *dev, int pin,int ret; -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Searching for _PRT entry for %s[%c]\n" , -pci_name (dev),pin_name (pin))); - entry =acpi_pci_irq_find_prt_entry (dev, pin);if (!entry) { -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"_PRT entry not found\n" )); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No %s[%c] _PRT entry\n" , +pci_name (dev),pin_name (pin)));return -1 ; } +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Found %s[%c] _PRT entry\n" , +pci_name (dev),pin_name (pin))); + ret =func (entry, triggering, polarity, link);return ret; }
@@ -455,8 +456,8 @@ acpi_pci_irq_derive(struct pci_dev *dev,return -1 ; } -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Derive GSI %d for device %s from %s\n" , - irq,pci_name (dev),pci_name (bridge))); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Derived GSI %d for %s INT %c from %s\n" , + irq,pci_name (dev),pin_name (orig_pin),pci_name (bridge)));return irq; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 50/94 ACPI: PCI: remove callback from acpi_pci_irq_lookup & acpi_pci_irq_derive
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
We currently pass a callback function (either acpi_pci_allocate_irq() or acpi_pci_free_irq()) to acpi_pci_irq_lookup() and acpi_pci_irq_derive().
I think it's simpler to remove the callback and just have the enable/ disable functions make the calls directly.
--- drivers/acpi/pci_irq.c | 93 ++++++++++++++++++----------------------------- 1 files changed, 36 insertions(+), 57 deletions(-)
drivers/acpi/pci_irq.c +36 -57
@@ -339,8 +339,6 @@ void acpi_pci_irq_del_prt(int segment, int bus)/* -------------------------------------------------------------------------- PCI Interrupt Routing Support -------------------------------------------------------------------------- */ -typedef int (*irq_lookup_func ) (struct acpi_prt_entry *,int *,int *,char **); -static int acpi_pci_allocate_irq (struct acpi_prt_entry *entry,int *triggering,int *polarity,char **link)
@@ -368,8 +366,7 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry, }static int -acpi_pci_free_irq (struct acpi_prt_entry *entry, -int *triggering,int *polarity,char **link) +acpi_pci_free_irq (struct acpi_prt_entry *entry) {int irq;
@@ -381,47 +378,29 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry,return irq; } -/* -* acpi_pci_irq_lookup -* success: return IRQ >= 0 -* failure: return -1 -*/ -static int -acpi_pci_irq_lookup (struct pci_dev *dev,int pin, -int *triggering, -int *polarity,char **link,irq_lookup_func func) +static struct acpi_prt_entry * +acpi_pci_irq_lookup (struct pci_dev *dev,int pin) { -struct acpi_prt_entry *entry =NULL ; -int ret; - +struct acpi_prt_entry *entry; entry =acpi_pci_irq_find_prt_entry (dev, pin);if (!entry) {ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No %s[%c] _PRT entry\n" ,pci_name (dev),pin_name (pin))); -return -1 ; +return NULL ; }ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Found %s[%c] _PRT entry\n" ,pci_name (dev),pin_name (pin))); - ret =func (entry, triggering, polarity, link); -return ret; +return entry; } -/* -* acpi_pci_irq_derive -* success: return IRQ >= 0 -* failure: return < 0 -*/ -static int -acpi_pci_irq_derive (struct pci_dev *dev, -int pin, -int *triggering, -int *polarity,char **link,irq_lookup_func func) +static struct acpi_prt_entry * +acpi_pci_irq_derive (struct pci_dev *dev,int pin) { +struct acpi_prt_entry *entry =NULL ;struct pci_dev *bridge = dev; -int irq =-1 ;u8 bridge_pin =0 , orig_pin = pin;
@@ -429,7 +408,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,* Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). */ -while (irq <0 && bridge->bus->self) { +while (!entry && bridge->bus->self) { pin = (((pin -1 ) +PCI_SLOT (bridge->devfn)) %4 ) +1 ; bridge = bridge->bus->self;
@@ -440,26 +419,24 @@ acpi_pci_irq_derive(struct pci_dev *dev,ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No interrupt pin configured for device %s\n" ,pci_name (bridge))); -return -1 ; +return NULL ; } pin = bridge_pin; } - irq =acpi_pci_irq_lookup (bridge, - pin, triggering, polarity, - link, func); + entry =acpi_pci_irq_lookup (bridge, pin); } -if (irq <0 ) { +if (!entry) {dev_warn (&dev->dev,"can't derive routing for PCI INT %c\n" ,pin_name (orig_pin)); -return -1 ; +return NULL ; } -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Derived GSI %d for %s INT %c from %s\n" , - irq,pci_name (dev),pin_name (orig_pin),pci_name (bridge))); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Derived GSI for %s INT %c from %s\n" , +pci_name (dev),pin_name (orig_pin),pci_name (bridge))); -return irq; +return entry; }/*
@@ -470,6 +447,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,int acpi_pci_irq_enable (struct pci_dev *dev) { +struct acpi_prt_entry *entry;int gsi =0 ;u8 pin =0 ;int triggering =ACPI_LEVEL_SENSITIVE ;
@@ -491,18 +469,20 @@ int acpi_pci_irq_enable(struct pci_dev *dev)* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot. */ - gsi =acpi_pci_irq_lookup (dev, pin, - &triggering, &polarity, &link, - acpi_pci_allocate_irq); + entry =acpi_pci_irq_lookup (dev, pin);/* * If no PRT entry was found, we'll try to derive an IRQ from the * device's parent bridge. */ -if (gsi <0 ) - gsi =acpi_pci_irq_derive (dev, pin, &triggering, - &polarity, &link, - acpi_pci_allocate_irq); +if (!entry) + entry =acpi_pci_irq_derive (dev, pin); + +if (entry) + gsi =acpi_pci_allocate_irq (entry, &triggering, &polarity, + &link); +else + gsi =-1 ;if (gsi <0 ) {/*
@@ -559,10 +539,9 @@ void __attribute__ ((weak)) acpi_unregister_gsi(u32 i)void acpi_pci_irq_disable (struct pci_dev *dev) { +struct acpi_prt_entry *entry;int gsi =0 ;u8 pin =0 ; -int triggering =ACPI_LEVEL_SENSITIVE ; -int polarity =ACPI_ACTIVE_LOW ; pin = dev->pin;
@@ -572,20 +551,20 @@ void acpi_pci_irq_disable(struct pci_dev *dev)/* * First we check the PCI IRQ routing table (PRT) for an IRQ. */ - gsi =acpi_pci_irq_lookup (dev, pin, - &triggering, &polarity,NULL , - acpi_pci_free_irq); + entry =acpi_pci_irq_lookup (dev, pin); +/* * If no PRT entry was found, we'll try to derive an IRQ from the * device's parent bridge. */ -if (gsi <0 ) - gsi =acpi_pci_irq_derive (dev, pin, - &triggering, &polarity,NULL , - acpi_pci_free_irq); -if (gsi <0 ) +if (!entry) + entry =acpi_pci_irq_derive (dev, pin); + +if (!entry)return ; + gsi =acpi_pci_free_irq (entry); +/* * TBD: It might be worth clearing dev->irq by magic constant * (e.g. PCI_UNDEFINED_IRQ).
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 51/94 ACPI: PCI: use positive logic to simplify code
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
This doesn't change anything functionally; it just changes tests so we test for success instead of failure. This makes the code read more easily and allows us to remove the "!entry" in the while loop condition.
--- drivers/acpi/pci_irq.c | 33 ++++++++++++++++----------------- 1 files changed, 16 insertions(+), 17 deletions(-)
drivers/acpi/pci_irq.c +16 -17
@@ -384,16 +384,15 @@ acpi_pci_irq_lookup(struct pci_dev *dev, int pin)struct acpi_prt_entry *entry; entry =acpi_pci_irq_find_prt_entry (dev, pin); -if (!entry) { -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No %s[%c] _PRT entry\n" , +if (entry) { +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Found %s[%c] _PRT entry\n" ,pci_name (dev),pin_name (pin))); -return NULL ; +return entry; } -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Found %s[%c] _PRT entry\n" , +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No %s[%c] _PRT entry\n" ,pci_name (dev),pin_name (pin))); - -return entry; +return NULL ; } static struct acpi_prt_entry *
@@ -408,7 +407,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin)* Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). */ -while (!entry && bridge->bus->self) { +while (bridge->bus->self) { pin = (((pin -1 ) +PCI_SLOT (bridge->devfn)) %4 ) +1 ; bridge = bridge->bus->self;
@@ -425,18 +424,18 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin) } entry =acpi_pci_irq_lookup (bridge, pin); +if (entry) { +ACPI_DEBUG_PRINT ((ACPI_DB_INFO , +"Derived GSI for %s INT %c from %s\n" , +pci_name (dev),pin_name (orig_pin), +pci_name (bridge))); +return entry; + } } -if (!entry) { -dev_warn (&dev->dev,"can't derive routing for PCI INT %c\n" , -pin_name (orig_pin)); -return NULL ; - } - -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Derived GSI for %s INT %c from %s\n" , -pci_name (dev),pin_name (orig_pin),pci_name (bridge))); - -return entry; +dev_warn (&dev->dev,"can't derive routing for PCI INT %c\n" , +pin_name (orig_pin)); +return NULL ; }/*
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 52/94 ACPI: PCI: follow typical PCI INTx swizzling pattern
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
No functional change; this just uses the typical pattern of PCI INTx swizzling done on other architectures.
--- drivers/acpi/pci_irq.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/acpi/pci_irq.c +7 -4
@@ -399,7 +399,7 @@ static struct acpi_prt_entry * acpi_pci_irq_derive(struct pci_dev *dev, int pin) {struct acpi_prt_entry *entry =NULL ; -struct pci_dev *bridge = dev; +struct pci_dev *bridge;u8 bridge_pin =0 , orig_pin = pin;
@@ -407,9 +407,9 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin)* Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). */ -while (bridge->bus->self) { - pin = (((pin -1 ) +PCI_SLOT (bridge->devfn)) %4 ) +1 ; - bridge = bridge->bus->self; + bridge = dev->bus->self; +while (bridge) { + pin = (((pin -1 ) +PCI_SLOT (dev->devfn)) %4 ) +1 ;if ((bridge->class >>8 ) ==PCI_CLASS_BRIDGE_CARDBUS ) {/* PC card has the same IRQ as its cardbridge */
@@ -431,6 +431,9 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin) pci_name(bridge)));return entry; } + + dev = bridge; + bridge = dev->bus->self; } dev_warn(&dev->dev, "can't derive routing for PCI INT %c\n",
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 53/94 ACPI: PCI: combine lookup and derive
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
This folds acpi_pci_irq_derive() into acpi_pci_irq_lookup() so it can be easily used by both acpi_pci_irq_enable() and acpi_pci_irq_disable().
--- drivers/acpi/pci_irq.c | 55 +++++++++-------------------------------------- 1 files changed, 11 insertions(+), 44 deletions(-)
drivers/acpi/pci_irq.c +11 -44
@@ -382,6 +382,8 @@ static struct acpi_prt_entry * acpi_pci_irq_lookup(struct pci_dev *dev, int pin) {struct acpi_prt_entry *entry; +struct pci_dev *bridge; +u8 bridge_pin, orig_pin = pin; entry =acpi_pci_irq_find_prt_entry (dev, pin);if (entry) {
@@ -390,19 +392,6 @@ acpi_pci_irq_lookup(struct pci_dev *dev, int pin)return entry; } -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"No %s[%c] _PRT entry\n" , -pci_name (dev),pin_name (pin))); -return NULL ; -} - -static struct acpi_prt_entry * -acpi_pci_irq_derive (struct pci_dev *dev,int pin) -{ -struct acpi_prt_entry *entry =NULL ; -struct pci_dev *bridge; -u8 bridge_pin =0 , orig_pin = pin; - -/* * Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge).
@@ -423,7 +412,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin) pin = bridge_pin; } - entry =acpi_pci_irq_lookup (bridge, pin); + entry =acpi_pci_irq_find_prt_entry (bridge, pin);if (entry) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derived GSI for %s INT %c from %s\n",
@@ -467,26 +456,8 @@ int acpi_pci_irq_enable(struct pci_dev *dev)return 0 ; } -/* -* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT -* values override any BIOS-assigned IRQs set during boot. -*/ entry =acpi_pci_irq_lookup (dev, pin); - -/* -* If no PRT entry was found, we'll try to derive an IRQ from the -* device's parent bridge. -*/ -if (!entry) - entry =acpi_pci_irq_derive (dev, pin); - -if (entry) - gsi =acpi_pci_allocate_irq (entry, &triggering, &polarity, - &link); -else - gsi =-1 ; - -if (gsi <0 ) { +if (!entry) {/* * IDE legacy mode controller IRQs are magic. Why do compat * extensions always make such a nasty mess.
@@ -495,6 +466,13 @@ int acpi_pci_irq_enable(struct pci_dev *dev) (dev->class & 0x05) == 0)return 0 ; } + +if (entry) + gsi =acpi_pci_allocate_irq (entry, &triggering, &polarity, + &link); +else + gsi =-1 ; +/* * No IRQ known to the ACPI subsystem - maybe the BIOS / * driver reported one, then use it. Exit in any case.
@@ -550,18 +528,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)if (!pin)return ; -/* -* First we check the PCI IRQ routing table (PRT) for an IRQ. -*/ entry =acpi_pci_irq_lookup (dev, pin); - -/* -* If no PRT entry was found, we'll try to derive an IRQ from the -* device's parent bridge. -*/ -if (!entry) - entry =acpi_pci_irq_derive (dev, pin); -if (!entry)return ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 54/94 ACPI: PCI: simplify list of _PRT entries
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
We don't need a struct containing a count and a list_head; a simple list_head is sufficient. The list iterators handle empty lists fine.
--- drivers/acpi/pci_irq.c | 60 +++++++++-------------------------------------- 1 files changed, 12 insertions(+), 48 deletions(-)
drivers/acpi/pci_irq.c +12 -48
@@ -42,7 +42,7 @@ACPI_MODULE_NAME ("pci_irq" );struct acpi_prt_entry { -struct list_head node; +struct list_head list;struct acpi_pci_id id;u8 pin;struct {
@@ -52,12 +52,7 @@ struct acpi_prt_entry {u32 irq; }; -struct acpi_prt_list { -int count; -struct list_head entries; -}; - -static struct acpi_prt_list acpi_prt; +static LIST_HEAD (acpi_prt_list);static DEFINE_SPINLOCK (acpi_prt_lock);static inline char pin_name (int pin)
@@ -72,21 +67,13 @@ static inline char pin_name(int pin)static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry (struct pci_dev *dev,int pin) { -struct acpi_prt_entry *entry =NULL ; +struct acpi_prt_entry *entry;int segment =pci_domain_nr (dev->bus);int bus = dev->bus->number;int device =PCI_SLOT (dev->devfn); -if (!acpi_prt.count) -return NULL ; - -/* -* Parse through all PRT entries looking for a match on the specified -* PCI device's segment, bus, device, and pin (don't care about func). -* -*/ spin_lock (&acpi_prt_lock); -list_for_each_entry (entry, &acpi_prt.entries, node) { +list_for_each_entry (entry, &acpi_prt_list, list) {if ((segment == entry->id.segment) && (bus == entry->id.bus) && (device == entry->id.device)
@@ -95,7 +82,6 @@ static struct acpi_prt_entry *acpi_pci_irq_find_prt_entry(struct pci_dev *dev,return entry; } } -spin_unlock (&acpi_prt_lock);return NULL ; }
@@ -201,7 +187,7 @@ static int acpi_pci_irq_add_entry(acpi_handle handle, int segment, int bus, struct acpi_pci_routing_table *prt) { - struct acpi_prt_entry *entry = NULL; + struct acpi_prt_entry *entry; entry =kzalloc (sizeof (struct acpi_prt_entry ),GFP_KERNEL );if (!entry)
@@ -253,35 +239,17 @@ acpi_pci_irq_add_entry(acpi_handle handle, prt->source, entry->link.index));spin_lock (&acpi_prt_lock); -list_add_tail (&entry->node, &acpi_prt.entries); - acpi_prt.count++; +list_add_tail (&entry->list, &acpi_prt_list);spin_unlock (&acpi_prt_lock);return 0 ; } -static void -acpi_pci_irq_del_entry (int segment,int bus,struct acpi_prt_entry *entry) -{ -if (segment == entry->id.segment && bus == entry->id.bus) { - acpi_prt.count--; -list_del (&entry->node); -kfree (entry); - } -} -int acpi_pci_irq_add_prt (acpi_handle handle,int segment,int bus) {acpi_status status;struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };struct acpi_pci_routing_table *entry; -static int first_time =1 ; - -if (first_time) { - acpi_prt.count =0 ; -INIT_LIST_HEAD (&acpi_prt.entries); - first_time =0 ; - }/* 'handle' is the _PRT's parent (root bridge or PCI-PCI bridge) */ status =acpi_get_name (handle,ACPI_FULL_PATHNAME , &buffer);
@@ -317,21 +285,17 @@ int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus)void acpi_pci_irq_del_prt (int segment,int bus) { -struct list_head *node =NULL , *n =NULL ; -struct acpi_prt_entry *entry =NULL ; - -if (!acpi_prt.count) { -return ; - } +struct acpi_prt_entry *entry, *tmp;printk (KERN_DEBUG "ACPI: Delete PCI Interrupt Routing Table for %04x:%02x\n" , segment, bus);spin_lock (&acpi_prt_lock); -list_for_each_safe (node, n, &acpi_prt.entries) { - entry = list_entry(node, struct acpi_prt_entry, node); - -acpi_pci_irq_del_entry (segment, bus, entry); +list_for_each_entry_safe (entry, tmp, &acpi_prt_list, list) { +if (segment == entry->id.segment && bus == entry->id.bus) { +list_del (&entry->list); +kfree (entry); + } }spin_unlock (&acpi_prt_lock); }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 55/94 ACPI: PCI: simplify struct acpi_prt_entry
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
Remove unused "irq" field, remove unnecessary struct, rename "handle" to "link".
--- drivers/acpi/pci_irq.c | 35 +++++++++++++++-------------------- 1 files changed, 15 insertions(+), 20 deletions(-)
drivers/acpi/pci_irq.c +15 -20
@@ -45,11 +45,8 @@ struct acpi_prt_entry {struct list_head list;struct acpi_pci_id id;u8 pin; -struct { -acpi_handle handle; -u32 index; - } link; -u32 irq; +acpi_handle link; +u32 index;/* GSI, or link _CRS index */ };static LIST_HEAD (acpi_prt_list);
@@ -205,6 +202,8 @@ acpi_pci_irq_add_entry(acpi_handle handle,do_prt_fixups (entry, prt); + entry->index = prt->source_index; +/* * Type 1: Dynamic * ---------------
@@ -218,10 +217,9 @@ acpi_pci_irq_add_entry(acpi_handle handle,* (e.g. exists somewhere 'below' this _PRT entry in the ACPI * namespace). */ -if (prt->source[0 ]) { -acpi_get_handle (handle, prt->source, &entry->link.handle); - entry->link.index = prt->source_index; - } +if (prt->source[0 ]) +acpi_get_handle (handle, prt->source, &entry->link); +/* * Type 2: Static * --------------
@@ -229,14 +227,12 @@ acpi_pci_irq_add_entry(acpi_handle handle,* the IRQ value, which is hardwired to specific interrupt inputs on * the interrupt controller. */ - else - entry->link.index = prt->source_index;ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO ," %04x:%02x:%02x[%c] -> %s[%d]\n" , entry->id.segment, entry->id.bus, entry->id.device,pin_name (entry->pin), - prt->source, entry->link.index)); + prt->source, entry->index));spin_lock (&acpi_prt_lock);list_add_tail (&entry->list, &acpi_prt_list);
@@ -310,17 +306,16 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,int irq; -if (entry->link.handle) { - irq =acpi_pci_link_allocate_irq (entry->link.handle, - entry->link.index, triggering, - polarity, link); +if (entry->link) { + irq =acpi_pci_link_allocate_irq (entry->link, entry->index, + triggering, polarity, link);if (irq <0 ) { printk(KERN_WARNING PREFIX "Invalid IRQ link routing entry\n");return -1 ; } }else { - irq = entry->link.index; + irq = entry->index; *triggering =ACPI_LEVEL_SENSITIVE ; *polarity =ACPI_ACTIVE_LOW ; }
@@ -334,10 +329,10 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry) {int irq; -if (entry->link.handle) { - irq =acpi_pci_link_free_irq (entry->link.handle); +if (entry->link) { + irq =acpi_pci_link_free_irq (entry->link); }else { - irq = entry->link.index; + irq = entry->index; }return irq; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 56/94 ACPI: PCI: expand acpi_pci_allocate_irq() and acpi_pci_free_irq() inline
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
acpi_pci_allocate_irq() and acpi_pci_free_irq() are trivial and only used once, so just open-code them.
--- drivers/acpi/pci_irq.c | 56 +++++++++++------------------------------------ 1 files changed, 13 insertions(+), 43 deletions(-)
drivers/acpi/pci_irq.c +13 -43
@@ -299,44 +299,6 @@ void acpi_pci_irq_del_prt(int segment, int bus)/* -------------------------------------------------------------------------- PCI Interrupt Routing Support -------------------------------------------------------------------------- */ -static int -acpi_pci_allocate_irq (struct acpi_prt_entry *entry, -int *triggering,int *polarity,char **link) -{ -int irq; - - -if (entry->link) { - irq =acpi_pci_link_allocate_irq (entry->link, entry->index, - triggering, polarity, link); -if (irq <0 ) { - printk(KERN_WARNING PREFIX - "Invalid IRQ link routing entry\n"); -return -1 ; - } - }else { - irq = entry->index; - *triggering =ACPI_LEVEL_SENSITIVE ; - *polarity =ACPI_ACTIVE_LOW ; - } - -ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Found GSI %d\n" , irq)); -return irq; -} - -static int -acpi_pci_free_irq (struct acpi_prt_entry *entry) -{ -int irq; - -if (entry->link) { - irq =acpi_pci_link_free_irq (entry->link); - }else { - irq = entry->index; - } -return irq; -} -static struct acpi_prt_entry *acpi_pci_irq_lookup (struct pci_dev *dev,int pin) {
@@ -426,10 +388,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev)return 0 ; } -if (entry) - gsi =acpi_pci_allocate_irq (entry, &triggering, &polarity, - &link); -else +if (entry) { +if (entry->link) + gsi =acpi_pci_link_allocate_irq (entry->link, + entry->index, + &triggering, &polarity, + &link); +else + gsi = entry->index; + }else gsi =-1 ;/*
@@ -491,7 +458,10 @@ void acpi_pci_irq_disable(struct pci_dev *dev)if (!entry)return ; - gsi =acpi_pci_free_irq (entry); +if (entry->link) + gsi =acpi_pci_link_free_irq (entry->link); +else + gsi = entry->index;/* * TBD: It might be worth clearing dev->irq by magic constant
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 57/94 ACPI: PCI: whitespace and useless initialization cleanup
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
This patch makes function declarations consistent throughout the file and removes some unnecessary initializations.
--- drivers/acpi/pci_irq.c | 28 +++++++++------------------- 1 files changed, 9 insertions(+), 19 deletions(-)
drivers/acpi/pci_irq.c +9 -19
@@ -149,8 +149,8 @@ static struct prt_quirk prt_quirks[] = { "\\_SB_.PCI0.LNK3"}, }; -static void -do_prt_fixups (struct acpi_prt_entry *entry,struct acpi_pci_routing_table *prt) +static void do_prt_fixups (struct acpi_prt_entry *entry, +struct acpi_pci_routing_table *prt) {int i;struct prt_quirk *quirk;
@@ -180,9 +180,8 @@ do_prt_fixups(struct acpi_prt_entry *entry, struct acpi_pci_routing_table *prt) } } -static int -acpi_pci_irq_add_entry (acpi_handle handle, -int segment,int bus,struct acpi_pci_routing_table *prt) +static int acpi_pci_irq_add_entry (acpi_handle handle,int segment,int bus, +struct acpi_pci_routing_table *prt) {struct acpi_prt_entry *entry;
@@ -299,8 +298,7 @@ void acpi_pci_irq_del_prt(int segment, int bus)/* -------------------------------------------------------------------------- PCI Interrupt Routing Support -------------------------------------------------------------------------- */ -static struct acpi_prt_entry * -acpi_pci_irq_lookup (struct pci_dev *dev,int pin) +static struct acpi_prt_entry *acpi_pci_irq_lookup (struct pci_dev *dev,int pin) {struct acpi_prt_entry *entry;struct pci_dev *bridge;
@@ -351,24 +349,17 @@ acpi_pci_irq_lookup(struct pci_dev *dev, int pin)return NULL ; } -/* -* acpi_pci_irq_enable -* success: return 0 -* failure: return < 0 -*/ -int acpi_pci_irq_enable (struct pci_dev *dev) {struct acpi_prt_entry *entry; -int gsi =0 ; -u8 pin =0 ; +int gsi; +u8 pin;int triggering =ACPI_LEVEL_SENSITIVE ;int polarity =ACPI_ACTIVE_LOW ;char *link =NULL ;char link_desc[16 ];int rc; - pin = dev->pin;if (!pin) { ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -446,9 +437,8 @@ void __attribute__ ((weak)) acpi_unregister_gsi(u32 i)void acpi_pci_irq_disable (struct pci_dev *dev) {struct acpi_prt_entry *entry; -int gsi =0 ; -u8 pin =0 ; - +int gsi; +u8 pin; pin = dev->pin;if (!pin)
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 58/94 ACPI: PCI: add HP copyright
In reply to Len BrownFrom: Bjorn Helgaas <[email protected]>
Add HP copyright to pci_irq.c.
--- drivers/acpi/pci_irq.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/acpi/pci_irq.c +2 -0
@@ -4,6 +4,8 @@* Copyright (C) 2001, 2002 Andy Grover <[email protected]> * Copyright (C) 2001, 2002 Paul Diefenbaugh <[email protected]> * Copyright (C) 2002 Dominik Brodowski <[email protected]> +* (c) Copyright 2008 Hewlett-Packard Development Company, L.P. +* Bjorn Helgaas <[email protected]> * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 59/94 ACPI: simplify buffer management for acpi_pci_bind() etc.
In reply to Len BrownFrom: Len Brown <[email protected]>
use ACPI_ALLOCATE_BUFFER to remove the allocations
within acpi_pci_bind(), acpi_pci_unbind() and acpi_pci_bind_root(). While there, delete some unnecessary param inits from those routines.
Delete concept of ACPI_PATHNAME_MAX, since this was the last use.
--- drivers/acpi/pci_bind.c | 80 ++++++++++++++++----------------------- include/acpi/platform/aclinux.h | 3 - 2 files changed, 33 insertions(+), 50 deletions(-)
drivers/acpi/pci_bind.c +33 -47
@@ -111,12 +111,11 @@ EXPORT_SYMBOL(acpi_get_pci_id);int acpi_pci_bind (struct acpi_device *device) {int result =0 ; -acpi_status status =AE_OK ; -struct acpi_pci_data *data =NULL ; -struct acpi_pci_data *pdata =NULL ; -char *pathname =NULL ; -struct acpi_buffer buffer = {0 ,NULL }; -acpi_handle handle =NULL ; +acpi_status status; +struct acpi_pci_data *data; +struct acpi_pci_data *pdata; +struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; +acpi_handle handle;struct pci_dev *dev;struct pci_bus *bus;
@@ -124,21 +123,18 @@ int acpi_pci_bind(struct acpi_device *device)if (!device || !device->parent)return -EINVAL ; - pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); -if (!pathname) -return -ENOMEM ; - buffer.length =ACPI_PATHNAME_MAX ; - buffer.pointer = pathname; - data =kzalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL ); -if (!data) { -kfree (pathname); +if (!data)return -ENOMEM ; + + status =acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer); +if (ACPI_FAILURE (status)) { +kfree (data); +return -ENODEV ; } -acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer);ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Binding PCI device [%s]...\n" , - pathname)); + (char *)buffer.pointer));/* * Segment & Bus
@@ -262,7 +258,7 @@ int acpi_pci_bind(struct acpi_device *device) } end: -kfree (pathname); +kfree (buffer.pointer);if (result)kfree (data);
@@ -272,25 +268,21 @@ int acpi_pci_bind(struct acpi_device *device)static int acpi_pci_unbind (struct acpi_device *device) {int result =0 ; -acpi_status status =AE_OK ; -struct acpi_pci_data *data =NULL ; -char *pathname =NULL ; -struct acpi_buffer buffer = {0 ,NULL }; +acpi_status status; +struct acpi_pci_data *data; +struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };if (!device || !device->parent)return -EINVAL ; - pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); -if (!pathname) -return -ENOMEM ; + status =acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer); +if (ACPI_FAILURE (status)) +return -ENODEV ; - buffer.length =ACPI_PATHNAME_MAX ; - buffer.pointer = pathname; -acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer);ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Unbinding PCI device [%s]...\n" , - pathname)); -kfree (pathname); + (char *) buffer.pointer)); +kfree (buffer.pointer); status = acpi_get_data(device->handle, acpi_pci_data_handler,
@@ -322,50 +314,44 @@ acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus) { int result = 0; -acpi_status status =AE_OK ; +acpi_status status;struct acpi_pci_data *data =NULL ; -char *pathname =NULL ; -struct acpi_buffer buffer = {0 ,NULL }; - - pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); -if (!pathname) -return -ENOMEM ; - - buffer.length =ACPI_PATHNAME_MAX ; - buffer.pointer = pathname; +struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL };if (!device || !id || !bus) { -kfree (pathname);return -EINVAL ; } data =kzalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL ); -if (!data) { -kfree (pathname); +if (!data)return -ENOMEM ; - } data->id = *id; data->bus = bus; device->ops.bind = acpi_pci_bind; device->ops.unbind = acpi_pci_unbind; -acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer); + status =acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer); +if (ACPI_FAILURE (status)) { +kfree (data); +return -ENODEV ; + }ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Binding PCI root bridge [%s] to " -"%04x:%02x\n" , pathname, id->segment, id->bus)); +"%04x:%02x\n" , (char *)buffer.pointer, + id->segment, id->bus)); status =acpi_attach_data (device->handle, acpi_pci_data_handler, data);if (ACPI_FAILURE (status)) {ACPI_EXCEPTION ((AE_INFO , status,"Unable to attach ACPI-PCI context to device %s" , - pathname)); + (char *)buffer.pointer)); result = -ENODEV ; goto end; } end: -kfree (pathname); +kfree (buffer.pointer);if (result !=0 )kfree (data);
include/acpi/platform/aclinux.h +0 -3
@@ -70,9 +70,6 @@#define ACPI_EXPORT_SYMBOL (symbol) EXPORT_SYMBOL(symbol);#define strtoul simple_strtoul -/* Full namespace pathname length limit - arbitrary */ -#define ACPI_PATHNAME_MAX 256 -#else /* !__KERNEL__ */ #include <stdarg.h>
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 60/94 ACPI: ec.c, pci_link.c, video_detec.c: static
In reply to Len BrownFrom: Roel Kluin <[email protected]>
Sparse asked whether these could be static.
--- drivers/acpi/ec.c | 4 ++-- drivers/acpi/pci_link.c | 2 +- drivers/acpi/video_detect.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/ec.c +2 -2
@@ -370,7 +370,7 @@ unlock:* Note: samsung nv5000 doesn't work with ec burst mode. * http://bugzilla.kernel.org/show_bug.cgi?id=4980 */ -int acpi_ec_burst_enable (struct acpi_ec *ec) +static int acpi_ec_burst_enable (struct acpi_ec *ec) {u8 d;struct transaction t = {.command =ACPI_EC_BURST_ENABLE ,
@@ -380,7 +380,7 @@ int acpi_ec_burst_enable(struct acpi_ec *ec)return acpi_ec_transaction (ec, &t,0 ); } -int acpi_ec_burst_disable (struct acpi_ec *ec) +static int acpi_ec_burst_disable (struct acpi_ec *ec) {struct transaction t = {.command =ACPI_EC_BURST_DISABLE , .wdata =NULL , .rdata =NULL ,
drivers/acpi/pci_link.c +1 -1
@@ -912,7 +912,7 @@ static int __init acpi_irq_nobalance_set(char *str)__setup ("acpi_irq_nobalance" , acpi_irq_nobalance_set); -int __init acpi_irq_balance_set (char *str) +static int __init acpi_irq_balance_set (char *str) { acpi_irq_balance =1 ;return 1 ;
drivers/acpi/video_detect.c +2 -2
@@ -234,7 +234,7 @@ EXPORT_SYMBOL(acpi_video_display_switch_support);* To force that backlight or display output switching is processed by vendor * specific acpi drivers or video.ko driver. */ -int __init acpi_backlight (char *str) +static int __init acpi_backlight (char *str) {if (str ==NULL || *str =='\0' )return 1 ;
@@ -250,7 +250,7 @@ int __init acpi_backlight(char *str) }__setup ("acpi_backlight=" , acpi_backlight); -int __init acpi_display_output (char *str) +static int __init acpi_display_output (char *str) {if (str ==NULL || *str =='\0' )return 1 ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 61/94 video: always update the brightness when poking "brightness"
In reply to Len BrownFrom: Zhang Rui <[email protected]>
always update props.brightness no matter the backlight is changed via procfs, hotkeys or sysfs.
--- drivers/acpi/video.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/acpi/video.c +5 -0
@@ -481,6 +481,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)int status =AE_OK ;union acpi_object arg0 = {ACPI_TYPE_INTEGER };struct acpi_object_list args = {1 , &arg0 }; +int state; arg0.integer.value = level;
@@ -489,6 +490,10 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) status =acpi_evaluate_object (device->dev->handle,"_BCM" , &args,NULL ); device->brightness->curr = level; +for (state =2 ; state < device->brightness->count; state++) +if (level == device->brightness->levels[state]) + device->backlight->props.brightness = state -2 ; +return status; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 62/94 ACPI: osl.c: replace return_ACPI_STATUS with return
In reply to Len BrownFrom: Lin Ming <[email protected]>
return_ACPI_STATUS is an internal acpica function, replace it with return. acpi_gbl_permanent_mmap moved from acglobal.h to acpixf.h for external use
--- drivers/acpi/osl.c | 4 ++-- include/acpi/acglobal.h | 1 - include/acpi/acpixf.h | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/acpi/osl.c +2 -2
@@ -726,7 +726,7 @@ static acpi_status __acpi_os_execute(acpi_execute_type type, dpc =kmalloc (sizeof (struct acpi_os_dpc ),GFP_ATOMIC );if (!dpc) -return_ACPI_STATUS (AE_NO_MEMORY ); +return AE_NO_MEMORY ; dpc->function = function; dpc->context = context;
@@ -747,7 +747,7 @@ static acpi_status __acpi_os_execute(acpi_execute_type type, status =AE_ERROR ;kfree (dpc); } -return_ACPI_STATUS (status); +return status; } acpi_status acpi_os_execute(acpi_execute_type type,
include/acpi/acglobal.h +0 -1
@@ -141,7 +141,6 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags; ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list; ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT; ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS; -extern u8 acpi_gbl_permanent_mmap;/* These addresses are calculated from FADT address values */
include/acpi/acpixf.h +2 -0
@@ -48,6 +48,8 @@#include "actypes.h" #include "actbl.h" +extern u8 acpi_gbl_permanent_mmap; +/* * Global interfaces */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 63/94 ACPI: ec.c: call acpi_get_name to get node name
In reply to Len BrownFrom: Lin Ming <[email protected]>
acpi_namespace_node is internal struct, it should not be used outside of ACPICA call acpi_get_name to get node ascii name
--- drivers/acpi/ec.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/acpi/ec.c +7 -2
@@ -756,10 +756,15 @@ static acpi_status acpi_ec_register_query_methods(acpi_handle handle, u32 level, void *context, void **return_value) { - struct acpi_namespace_node *node = handle; + char node_name[5]; +struct acpi_buffer buffer = {sizeof (node_name), node_name };struct acpi_ec *ec = context;int value =0 ; -if (sscanf (node->name.ascii,"_Q%x" , &value) ==1 ) { +acpi_status status; + + status =acpi_get_name (handle,ACPI_SINGLE_NAME , &buffer); + +if (ACPI_SUCCESS (status) &&sscanf (node_name,"_Q%x" , &value) ==1 ) {acpi_ec_add_query_handler (ec, value, handle,NULL ,NULL ); }return AE_OK ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 64/94 ACPI: proc.c: remove ACPI_FUNCTION_TRACE
In reply to Len BrownFrom: Lin Ming <[email protected]>
ACPI_FUNCTION_TRACE and return_VALUE are internal acpica functions. remove ACPI_FUNCTION_TRACE
replace return_VALUE with return
--- drivers/acpi/sleep/proc.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-)
drivers/acpi/sleep/proc.c +3 -9
@@ -28,8 +28,6 @@ static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) {int i; -ACPI_FUNCTION_TRACE ("acpi_system_sleep_seq_show" ); -for (i =0 ; i <=ACPI_STATE_S5 ; i++) {if (sleep_states[i]) {seq_printf (seq,"S%d " , i);
@@ -93,8 +91,6 @@ static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset)unsigned char rtc_control =0 ;unsigned long flags; -ACPI_FUNCTION_TRACE ("acpi_system_alarm_seq_show" ); -spin_lock_irqsave (&rtc_lock, flags); sec =CMOS_READ (RTC_SECONDS_ALARM );
@@ -227,13 +223,11 @@ acpi_system_write_alarm(struct file *file,int adjust =0 ;unsigned char rtc_control =0 ; -ACPI_FUNCTION_TRACE ("acpi_system_write_alarm" ); -if (count >sizeof (alarm_string) -1 ) -return_VALUE (-EINVAL ); +return -EINVAL ;if (copy_from_user (alarm_string, buffer, count)) -return_VALUE (-EFAULT ); +return -EFAULT ; alarm_string[count] ='\0' ;
@@ -334,7 +328,7 @@ acpi_system_write_alarm(struct file *file, result =0 ; end: - return_VALUE(result ? result : count); + return result ? result : count; }#endif /* HAVE_ACPI_LEGACY_ALARM */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 65/94 ACPI: wakeup.c: remove ACPI_FUNCTION_TRACE
In reply to Len BrownFrom: Lin Ming <[email protected]>
ACPI_FUNCTION_TRACE is an internal acpica function. remove ACPI_FUNCTION_TRACE
--- drivers/acpi/sleep/wakeup.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/acpi/sleep/wakeup.c +0 -5
@@ -28,8 +28,6 @@ void acpi_enable_wakeup_device_prep(u8 sleep_state) {struct list_head *node, *next; -ACPI_FUNCTION_TRACE ("acpi_enable_wakeup_device_prep" ); -spin_lock (&acpi_device_lock);list_for_each_safe (node, next, &acpi_wakeup_device_list) { struct acpi_device *dev = container_of(node,
@@ -61,7 +59,6 @@ void acpi_enable_wakeup_device(u8 sleep_state)* Caution: this routine must be invoked when interrupt is disabled * Refer ACPI2.0: P212 */ -ACPI_FUNCTION_TRACE ("acpi_enable_wakeup_device" );spin_lock (&acpi_device_lock);list_for_each_safe (node, next, &acpi_wakeup_device_list) { struct acpi_device *dev =
@@ -103,8 +100,6 @@ void acpi_disable_wakeup_device(u8 sleep_state) {struct list_head *node, *next; -ACPI_FUNCTION_TRACE ("acpi_disable_wakeup_device" ); -spin_lock (&acpi_device_lock);list_for_each_safe (node, next, &acpi_wakeup_device_list) { struct acpi_device *dev =
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 66/94 ACPICA: New: acpi_get_gpe_device interface
In reply to Len BrownFrom: Bob Moore <[email protected]>
This function maps an input GPE index to a GPE block device. Also Added acpi_current_gpe_count to track the current number of GPEs that are being managed by the ACPICA core (both FADT-based GPEs and the GPEs contained in GPE block devices.)
Modify drivers/acpi/system.c to use these 2 new interfaces
--- drivers/acpi/events/evgpeblk.c | 25 ++++++++-- drivers/acpi/events/evmisc.c | 4 +- drivers/acpi/events/evxfevnt.c | 93 +++++++++++++++++++++++++++++++++++++ drivers/acpi/hardware/hwgpe.c | 26 ++++++----- drivers/acpi/hardware/hwregs.c | 2 +- drivers/acpi/system.c | 63 +------------------------ drivers/acpi/utilities/utglobal.c | 6 ++- include/acpi/acevents.h | 6 ++- include/acpi/acglobal.h | 1 + include/acpi/achware.h | 7 ++- include/acpi/aclocal.h | 13 ++++-- include/acpi/acpixf.h | 2 + 12 files changed, 156 insertions(+), 92 deletions(-)
drivers/acpi/events/evgpeblk.c +20 -5
@@ -124,6 +124,7 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)* FUNCTION: acpi_ev_walk_gpe_list * * PARAMETERS: gpe_walk_callback - Routine called for each GPE block +* Context - Value passed to callback * * RETURN: Status *
@@ -131,7 +132,8 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)* ******************************************************************************/ -acpi_status acpi_ev_walk_gpe_list (acpi_gpe_callback gpe_walk_callback) +acpi_status +acpi_ev_walk_gpe_list (acpi_gpe_callback gpe_walk_callback,void *context) {struct acpi_gpe_block_info *gpe_block;struct acpi_gpe_xrupt_info *gpe_xrupt_info;
@@ -154,8 +156,13 @@ acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback)/* One callback per GPE block */ - status =gpe_walk_callback (gpe_xrupt_info, gpe_block); + status = +gpe_walk_callback (gpe_xrupt_info, gpe_block, + context);if (ACPI_FAILURE (status)) { +if (status ==AE_CTRL_END ) {/* Callback abort */ + status =AE_OK ; + } goto unlock_and_exit; }
@@ -186,7 +193,8 @@ acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback)acpi_status acpi_ev_delete_gpe_handlers (struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block) +struct acpi_gpe_block_info *gpe_block, +void *context) {struct acpi_gpe_event_info *gpe_event_info;u32 i;
@@ -690,7 +698,8 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)/* Disable all GPEs in this block */ - status =acpi_hw_disable_gpe_block (gpe_block->xrupt_block, gpe_block); + status = +acpi_hw_disable_gpe_block (gpe_block->xrupt_block, gpe_block,NULL );if (!gpe_block->previous && !gpe_block->next) {
@@ -717,6 +726,9 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)acpi_os_release_lock (acpi_gbl_gpe_lock, flags); } + acpi_current_gpe_count -= + gpe_block->register_count *ACPI_GPE_REGISTER_WIDTH ; +/* Free the gpe_block */ ACPI_FREE (gpe_block->register_info);
@@ -958,6 +970,9 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, gpe_device->name.ascii, gpe_block->register_count, interrupt_number)); +/* Update global count of currently available GPEs */ + + acpi_current_gpe_count += register_count *ACPI_GPE_REGISTER_WIDTH ;return_ACPI_STATUS (AE_OK ); }
@@ -1057,7 +1072,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,/* Enable all valid runtime GPEs found above */ - status =acpi_hw_enable_runtime_gpe_block (NULL , gpe_block); + status =acpi_hw_enable_runtime_gpe_block (NULL , gpe_block,NULL );if (ACPI_FAILURE (status)) {ACPI_ERROR ((AE_INFO ,"Could not enable GPEs in GpeBlock %p" , gpe_block));
drivers/acpi/events/evmisc.c +2 -2
@@ -588,7 +588,7 @@ void acpi_ev_terminate(void)/* Disable all GPEs in all GPE blocks */ - status =acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block); + status =acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block,NULL );/* Remove SCI handler */
@@ -606,7 +606,7 @@ void acpi_ev_terminate(void)/* Deallocate all handler objects installed within GPE info structs */ - status =acpi_ev_walk_gpe_list (acpi_ev_delete_gpe_handlers); + status =acpi_ev_walk_gpe_list (acpi_ev_delete_gpe_handlers,NULL );/* Return to original mode if necessary */
drivers/acpi/events/evxfevnt.c +93 -0
108 lines not on this page · raw message
drivers/acpi/hardware/hwgpe.c +14 -12
@@ -51,7 +51,8 @@ ACPI_MODULE_NAME("hwgpe")/* Local prototypes */ static acpi_status acpi_hw_enable_wakeup_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block); +struct acpi_gpe_block_info *gpe_block, +void *context);/****************************************************************************** *
@@ -260,8 +261,8 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,******************************************************************************/ acpi_status -acpi_hw_disable_gpe_block (struct acpi_gpe_xrupt_info * gpe_xrupt_info, -struct acpi_gpe_block_info * gpe_block) +acpi_hw_disable_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, +struct acpi_gpe_block_info *gpe_block,void *context) {u32 i;acpi_status status;
@@ -297,8 +298,8 @@ acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,******************************************************************************/ acpi_status -acpi_hw_clear_gpe_block (struct acpi_gpe_xrupt_info * gpe_xrupt_info, -struct acpi_gpe_block_info * gpe_block) +acpi_hw_clear_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, +struct acpi_gpe_block_info *gpe_block,void *context) {u32 i;acpi_status status;
@@ -335,8 +336,8 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,******************************************************************************/ acpi_status -acpi_hw_enable_runtime_gpe_block (struct acpi_gpe_xrupt_info * gpe_xrupt_info, -struct acpi_gpe_block_info * gpe_block) +acpi_hw_enable_runtime_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, +struct acpi_gpe_block_info *gpe_block,void *context) {u32 i;acpi_status status;
@@ -382,7 +383,8 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,static acpi_status acpi_hw_enable_wakeup_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block) +struct acpi_gpe_block_info *gpe_block, +void *context) {u32 i;acpi_status status;
@@ -427,8 +429,8 @@ acpi_status acpi_hw_disable_all_gpes(void)ACPI_FUNCTION_TRACE (hw_disable_all_gpes); - status =acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block); - status =acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block); + status =acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block,NULL ); + status =acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block,NULL );return_ACPI_STATUS (status); }
@@ -450,7 +452,7 @@ acpi_status acpi_hw_enable_all_runtime_gpes(void)ACPI_FUNCTION_TRACE (hw_enable_all_runtime_gpes); - status =acpi_ev_walk_gpe_list (acpi_hw_enable_runtime_gpe_block); + status =acpi_ev_walk_gpe_list (acpi_hw_enable_runtime_gpe_block,NULL );return_ACPI_STATUS (status); }
@@ -472,6 +474,6 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void)ACPI_FUNCTION_TRACE (hw_enable_all_wakeup_gpes); - status =acpi_ev_walk_gpe_list (acpi_hw_enable_wakeup_gpe_block); + status =acpi_ev_walk_gpe_list (acpi_hw_enable_wakeup_gpe_block,NULL );return_ACPI_STATUS (status); }
drivers/acpi/hardware/hwregs.c +1 -1
@@ -94,7 +94,7 @@ acpi_status acpi_hw_clear_acpi_status(void)/* Clear the GPE Bits in all GPE registers in all GPE blocks */ - status =acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block); + status =acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block,NULL ); unlock_and_exit:acpi_os_release_lock (acpi_gbl_hardware_lock, lock_flags);
drivers/acpi/system.c +2 -61
81 lines not on this page · raw message
drivers/acpi/utilities/utglobal.c +4 -2
@@ -46,9 +46,8 @@#include <acpi/acpi.h> #include <acpi/acnamesp.h> -ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)#define _COMPONENT ACPI_UTILITIES -ACPI_MODULE_NAME ("utglobal" ) +ACPI_MODULE_NAME ("utglobal" )/******************************************************************************* *
@@ -756,6 +755,7 @@ acpi_status acpi_ut_init_globals(void) acpi_gbl_gpe_xrupt_list_head =NULL ; acpi_gbl_gpe_fadt_blocks[0 ] =NULL ; acpi_gbl_gpe_fadt_blocks[1 ] =NULL ; + acpi_current_gpe_count =0 ;/* Global handlers */
@@ -816,5 +816,7 @@ acpi_status acpi_ut_init_globals(void)return_ACPI_STATUS (AE_OK ); } +ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) ACPI_EXPORT_SYMBOL(acpi_dbg_level) ACPI_EXPORT_SYMBOL(acpi_dbg_layer) +ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)
include/acpi/acevents.h +4 -2
@@ -93,11 +93,13 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,*/ u8 acpi_ev_valid_gpe_event (struct acpi_gpe_event_info *gpe_event_info); -acpi_status acpi_ev_walk_gpe_list (acpi_gpe_callback gpe_walk_callback); +acpi_status +acpi_ev_walk_gpe_list (acpi_gpe_callback gpe_walk_callback,void *context);acpi_status acpi_ev_delete_gpe_handlers (struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block); +struct acpi_gpe_block_info *gpe_block, +void *context); acpi_status acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
include/acpi/acglobal.h +1 -0
@@ -326,6 +326,7 @@ ACPI_EXTERN struct acpi_fixed_event_handler ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; ACPI_EXTERN struct acpi_gpe_block_info *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS ]; +ACPI_EXTERN u32 acpi_current_gpe_count;/***************************************************************************** *
include/acpi/achware.h +4 -3
@@ -94,13 +94,13 @@ acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);acpi_status acpi_hw_disable_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block); +struct acpi_gpe_block_info *gpe_block,void *context);acpi_status acpi_hw_clear_gpe (struct acpi_gpe_event_info *gpe_event_info);acpi_status acpi_hw_clear_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block); +struct acpi_gpe_block_info *gpe_block,void *context); acpi_status acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
@@ -114,7 +114,8 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void);acpi_status acpi_hw_enable_runtime_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block); +struct acpi_gpe_block_info *gpe_block, +void *context);#ifdef ACPI_FUTURE_USAGE /*
include/acpi/aclocal.h +9 -4
@@ -487,10 +487,15 @@ struct acpi_gpe_walk_info {struct acpi_gpe_block_info *gpe_block; }; -typedef acpi_status (*acpi_gpe_callback ) (struct acpi_gpe_xrupt_info * - gpe_xrupt_info, -struct acpi_gpe_block_info * - gpe_block); +struct acpi_gpe_device_info { +u32 index; +u32 next_block_base_index; +acpi_status status; +struct acpi_namespace_node *gpe_device; +}; + +typedef acpi_status (*acpi_gpe_callback ) (struct acpi_gpe_xrupt_info *gpe_xrupt_info, +struct acpi_gpe_block_info *gpe_block,void *context);/* Information about each particular fixed event */
include/acpi/acpixf.h +2 -0
@@ -265,6 +265,8 @@ acpi_get_gpe_status(acpi_handle gpe_device,u32 gpe_number, u32 flags, acpi_event_status * event_status); +acpi_status acpi_get_gpe_device (u32 gpe_index,acpi_handle *gpe_device); + acpi_status acpi_install_gpe_block(acpi_handle gpe_device, struct acpi_generic_address *gpe_block_address,
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 67/94 ACPICA: New: Public GPE group enable/disable interfaces
In reply to Len BrownFrom: Bob Moore <[email protected]>
Added acpi_disable_all_gpes and acpi_enable_all_runtime_gpes for public use.
--- drivers/acpi/events/evxfevnt.c | 58 ++++++++++++++++++++++++++++++++++++++++ include/acpi/acpixf.h | 15 +++++++--- 2 files changed, 69 insertions(+), 4 deletions(-)
drivers/acpi/events/evxfevnt.c +58 -0
@@ -810,3 +810,61 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,return (AE_OK ); } + +/****************************************************************************** +* +* FUNCTION: acpi_disable_all_gpes +* +* PARAMETERS: None +* +* RETURN: Status +* +* DESCRIPTION: Disable and clear all GPEs in all GPE blocks +* +******************************************************************************/ + +acpi_status acpi_disable_all_gpes (void ) +{ +acpi_status status; + +ACPI_FUNCTION_TRACE (acpi_disable_all_gpes); + + status =acpi_ut_acquire_mutex (ACPI_MTX_EVENTS ); +if (ACPI_FAILURE (status)) { +return_ACPI_STATUS (status); + } + + status =acpi_hw_disable_all_gpes (); + (void )acpi_ut_release_mutex (ACPI_MTX_EVENTS ); + +return_ACPI_STATUS (status); +} + +/****************************************************************************** +* +* FUNCTION: acpi_enable_all_runtime_gpes +* +* PARAMETERS: None +* +* RETURN: Status +* +* DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks +* +******************************************************************************/ + +acpi_status acpi_enable_all_runtime_gpes (void ) +{ +acpi_status status; + +ACPI_FUNCTION_TRACE (acpi_enable_all_runtime_gpes); + + status =acpi_ut_acquire_mutex (ACPI_MTX_EVENTS ); +if (ACPI_FAILURE (status)) { +return_ACPI_STATUS (status); + } + + status =acpi_hw_enable_all_runtime_gpes (); + (void )acpi_ut_release_mutex (ACPI_MTX_EVENTS ); + +return_ACPI_STATUS (status); +}
include/acpi/acpixf.h +11 -4
@@ -229,6 +229,10 @@ acpi_install_gpe_handler(acpi_handle gpe_device,u32 gpe_number, u32 type, acpi_event_handler address, void *context); +acpi_status +acpi_remove_gpe_handler (acpi_handle gpe_device, +u32 gpe_number,acpi_event_handler address); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_install_exception_handler (acpi_exception_handler handler);#endif
@@ -240,10 +244,6 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle);acpi_status acpi_release_global_lock (u32 handle); -acpi_status -acpi_remove_gpe_handler (acpi_handle gpe_device, -u32 gpe_number,acpi_event_handler address); -acpi_status acpi_enable_event (u32 event,u32 flags);acpi_status acpi_disable_event (u32 event,u32 flags);
@@ -252,6 +252,9 @@ acpi_status acpi_clear_event(u32 event);acpi_status acpi_get_event_status (u32 event,acpi_event_status * event_status); +/* +* GPE Interfaces +*/ acpi_status acpi_set_gpe_type (acpi_handle gpe_device,u32 gpe_number,u8 type);acpi_status acpi_enable_gpe (acpi_handle gpe_device,u32 gpe_number);
@@ -265,6 +268,10 @@ acpi_get_gpe_status(acpi_handle gpe_device,u32 gpe_number, u32 flags, acpi_event_status * event_status); +acpi_status acpi_disable_all_gpes (void ); + +acpi_status acpi_enable_all_runtime_gpes (void ); +acpi_status acpi_get_gpe_device (u32 gpe_index,acpi_handle *gpe_device); acpi_status
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 68/94 ACPI: main.c: use new public GPE group enable/disable interfaces
In reply to Len BrownFrom: Lin Ming <[email protected]>
Avoid using internal functions: acpi_hw_disable_all_gpes and acpi_hw_enable_all_runtime_gpes Use new public GPE group enable/disable interfaces: acpi_disable_all_gpes and acpi_enable_all_runtime_gpes
Also avoid using internal symbol ACPI_TABLE_INDEX_FACS, call acpi_get_table.
--- drivers/acpi/sleep/main.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/acpi/sleep/main.c +6 -6
@@ -107,7 +107,7 @@ static bool set_sci_en_on_resume;*/ static int acpi_pm_disable_gpes (void ) { -acpi_hw_disable_all_gpes (); +acpi_disable_all_gpes ();return 0 ; }
@@ -135,7 +135,7 @@ static int acpi_pm_prepare(void)int error =__acpi_pm_prepare ();if (!error) -acpi_hw_disable_all_gpes (); +acpi_disable_all_gpes ();return error; }
@@ -267,7 +267,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)* (like wakeup GPE) haven't handler, this can avoid such GPE misfire. * acpi_leave_sleep_state will reenable specific GPEs later */ -acpi_hw_disable_all_gpes (); +acpi_disable_all_gpes ();local_irq_restore (flags);printk (KERN_DEBUG "Back to C!\n" );
@@ -436,7 +436,7 @@ static void acpi_hibernation_leave(void)static void acpi_pm_enable_gpes (void ) { -acpi_hw_enable_all_runtime_gpes (); +acpi_enable_all_runtime_gpes (); }static struct platform_hibernation_ops acpi_hibernation_ops = {
@@ -622,7 +622,7 @@ static void acpi_power_off_prepare(void) {/* Prepare to power off the system */ acpi_sleep_prepare (ACPI_STATE_S5 ); -acpi_hw_disable_all_gpes (); +acpi_disable_all_gpes (); }static void acpi_power_off (void )
@@ -671,7 +671,7 @@ int __init acpi_sleep_init(void) sleep_states[ACPI_STATE_S4 ] =1 ;printk (" S4" );if (!nosigcheck) { -acpi_get_table_by_index (ACPI_TABLE_INDEX_FACS , +acpi_get_table (ACPI_SIG_FACS ,1 , (struct acpi_table_header **)&facs);if (facs) s4_hardware_signature =
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 69/94 ACPI: sony-laptop.c: call acpi_get_object_info to get node info
In reply to Len BrownFrom: Lin Ming <[email protected]>
Avoid using internal acpica structures acpi_namespace_node and acpi_operand_object Call acpi_get_object_info to get node ascii name and method arg count
--- drivers/misc/sony-laptop.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
drivers/misc/sony-laptop.c +9 -6
@@ -935,14 +935,17 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)static acpi_status sony_walk_callback (acpi_handle handle,u32 level,void *context,void **return_value) { -struct acpi_namespace_node *node; -union acpi_operand_object *operand; +struct acpi_device_info *info; +struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; - node = (struct acpi_namespace_node *)handle; - operand = (union acpi_operand_object *)node->object; +if (ACPI_SUCCESS (acpi_get_object_info (handle, &buffer))) { + info = buffer.pointer; - printk(KERN_WARNING DRV_PFX "method: name: %4.4s, args %X\n", node->name.ascii, - (u32) operand->method.param_count); + printk(KERN_WARNING DRV_PFX "method: name: %4.4s, args %X\n", + (char *)&info->name, info->param_count); + +kfree (buffer.pointer); + }return AE_OK ; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 70/94 ACPI: power.c: call acpi_get_name to get node name
In reply to Len BrownFrom: Lin Ming <[email protected]>
acpi_ut_get_node_name is an internal acpica function. use acpi_get_name to get node ascii name
--- drivers/acpi/power.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/acpi/power.c +5 -1
@@ -139,6 +139,8 @@ static int acpi_power_get_state(acpi_handle handle, int *state) {acpi_status status =AE_OK ;unsigned long long sta =0 ; +char node_name[5 ]; +struct acpi_buffer buffer = {sizeof (node_name), node_name };if (!handle || !state)
@@ -151,8 +153,10 @@ static int acpi_power_get_state(acpi_handle handle, int *state) *state = (sta &0x01 )?ACPI_POWER_RESOURCE_STATE_ON :ACPI_POWER_RESOURCE_STATE_OFF ; +acpi_get_name (handle,ACPI_SINGLE_NAME , &buffer); +ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Resource [%s] is %s\n" , -acpi_ut_get_node_name (handle), + node_name, *state ?"on" :"off" ));return 0 ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 71/94 ACPI: panasonic-laptop.c: remove ACPI_FUNCTION_TRACE
In reply to Len BrownFrom: Lin Ming <[email protected]>
ACPI_FUNCTION_TRACE is an internal acpica function. remove ACPI_FUNCTION_TRACE from driver file
--- drivers/misc/panasonic-laptop.c | 22 ---------------------- 1 files changed, 0 insertions(+), 22 deletions(-)
drivers/misc/panasonic-laptop.c +0 -22
@@ -241,8 +241,6 @@ static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, int val) };acpi_status status =AE_OK ; -ACPI_FUNCTION_TRACE ("acpi_pcc_write_sset" ); - status =acpi_evaluate_object (pcc->handle,METHOD_HKEY_SSET , ¶ms,NULL );
@@ -254,8 +252,6 @@ static inline int acpi_pcc_get_sqty(struct acpi_device *device)unsigned long long s;acpi_status status; -ACPI_FUNCTION_TRACE ("acpi_pcc_get_sqty" ); - status =acpi_evaluate_integer (device->handle,METHOD_HKEY_SQTY ,NULL , &s);if (ACPI_SUCCESS (status))
@@ -274,8 +270,6 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc, u32 *sinf)union acpi_object *hkey =NULL ;int i; -ACPI_FUNCTION_TRACE ("acpi_pcc_retrieve_biosdata" ); - status =acpi_evaluate_object (pcc->handle,METHOD_HKEY_SINF ,0 , &buffer);if (ACPI_FAILURE (status)) {
@@ -501,8 +495,6 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)int key_code, hkey_num;unsigned long long result; -ACPI_FUNCTION_TRACE ("acpi_pcc_generate_keyinput" ); - rc =acpi_evaluate_integer (pcc->handle,METHOD_HKEY_QUERY ,NULL , &result);if (!ACPI_SUCCESS (rc)) {
@@ -538,8 +530,6 @@ static void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *data) {struct pcc_acpi *pcc = (struct pcc_acpi *) data; -ACPI_FUNCTION_TRACE ("acpi_pcc_hotkey_notify" ); -switch (event) {case HKEY_NOTIFY :acpi_pcc_generate_keyinput (pcc);
@@ -554,8 +544,6 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc) {int i, rc; -ACPI_FUNCTION_TRACE ("acpi_pcc_init_input" ); - pcc->input_dev =input_allocate_device ();if (!pcc->input_dev) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
@@ -597,8 +585,6 @@ static int acpi_pcc_hotkey_resume(struct acpi_device *device)struct pcc_acpi *pcc =acpi_driver_data (device);acpi_status status =AE_OK ; -ACPI_FUNCTION_TRACE ("acpi_pcc_hotkey_resume" ); -if (device ==NULL || pcc ==NULL )return -EINVAL ;
@@ -616,8 +602,6 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)struct pcc_acpi *pcc;int num_sifr, result; -ACPI_FUNCTION_TRACE ("acpi_pcc_hotkey_add" ); -if (!device)return -EINVAL ;
@@ -714,8 +698,6 @@ static int __init acpi_pcc_init(void) {int result =0 ; -ACPI_FUNCTION_TRACE ("acpi_pcc_init" ); -if (acpi_disabled)return -ENODEV ;
@@ -733,8 +715,6 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type) {struct pcc_acpi *pcc =acpi_driver_data (device); -ACPI_FUNCTION_TRACE ("acpi_pcc_hotkey_remove" ); -if (!device || !pcc)return -EINVAL ;
@@ -757,8 +737,6 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type) static void __exit acpi_pcc_exit(void) { -ACPI_FUNCTION_TRACE ("acpi_pcc_exit" ); -acpi_bus_unregister_driver (&acpi_pcc_driver); }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 72/94 ACPI: io_acpi_init.c: call acpi_get_name to get node fullname
In reply to Len BrownFrom: Lin Ming <[email protected]>
acpi_ns_print_node_pathname is internal used only
use acpi_get_name instead to get node fullname
--- arch/ia64/sn/kernel/io_acpi_init.c | 102 ++++++++++++++++++++---------------- 1 files changed, 56 insertions(+), 46 deletions(-)
arch/ia64/sn/kernel/io_acpi_init.c +56 -46
@@ -64,6 +64,7 @@ static acpi_status __init sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) { struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; +struct acpi_buffer name_buffer = {ACPI_ALLOCATE_BUFFER ,NULL };u64 addr;struct hubdev_info *hubdev;struct hubdev_info *hubdev_ptr;
@@ -77,11 +78,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) status =acpi_get_vendor_resource (handle,METHOD_NAME__CRS , &sn_uuid, &buffer);if (ACPI_FAILURE (status)) { +acpi_get_name (handle,ACPI_FULL_PATHNAME , &name_buffer);printk (KERN_ERR "sn_acpi_hubdev_init: acpi_get_vendor_resource() " -"(0x%x) failed for: " , status); -acpi_ns_print_node_pathname (handle,NULL ); -printk ("\n" ); +"(0x%x) failed for: %s\n" , status, + (char *)name_buffer.pointer); +kfree (name_buffer.pointer);return AE_OK ;/* Continue walking namespace */ }
@@ -89,11 +91,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) vendor = &resource->data.vendor_typed;if ((vendor->byte_length -sizeof (struct acpi_vendor_uuid )) !=sizeof (struct hubdev_info *)) { +acpi_get_name (handle,ACPI_FULL_PATHNAME , &name_buffer);printk (KERN_ERR -"sn_acpi_hubdev_init: Invalid vendor data length: %d for: " , - vendor->byte_length); -acpi_ns_print_node_pathname (handle,NULL ); -printk ("\n" ); +"sn_acpi_hubdev_init: Invalid vendor data length: " +"%d for: %s\n" , + vendor->byte_length, (char *)name_buffer.pointer); +kfree (name_buffer.pointer); goto exit; }
@@ -120,6 +123,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus) {u64 addr;struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; +struct acpi_buffer name_buffer = {ACPI_ALLOCATE_BUFFER ,NULL };acpi_handle handle;struct pcibus_bussoft *prom_bussoft_ptr;struct acpi_resource *resource;
@@ -131,11 +135,11 @@ sn_get_bussoft_ptr(struct pci_bus *bus) status =acpi_get_vendor_resource (handle,METHOD_NAME__CRS , &sn_uuid, &buffer);if (ACPI_FAILURE (status)) { +acpi_get_name (handle,ACPI_FULL_PATHNAME , &name_buffer);printk (KERN_ERR "%s: " -"acpi_get_vendor_resource() failed (0x%x) for: " , - __func__, status); -acpi_ns_print_node_pathname (handle,NULL ); -printk ("\n" ); +"acpi_get_vendor_resource() failed (0x%x) for: %s\n" , + __func__, status, (char *)name_buffer.pointer); +kfree (name_buffer.pointer);return NULL ; } resource = buffer.pointer;
@@ -168,6 +172,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, {u64 addr;struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; +struct acpi_buffer name_buffer = {ACPI_ALLOCATE_BUFFER ,NULL };struct sn_irq_info *irq_info, *irq_info_prom;struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr;struct acpi_resource *resource;
@@ -182,11 +187,11 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, status =acpi_get_vendor_resource (handle,METHOD_NAME__CRS , &sn_uuid, &buffer);if (ACPI_FAILURE (status)) { +acpi_get_name (handle,ACPI_FULL_PATHNAME , &name_buffer);printk (KERN_ERR -"%s: acpi_get_vendor_resource() failed (0x%x) for: " , - __func__, status); -acpi_ns_print_node_pathname (handle,NULL ); -printk ("\n" ); +"%s: acpi_get_vendor_resource() failed (0x%x) for: %s\n" , + __func__, status, (char *)name_buffer.pointer); +kfree (name_buffer.pointer);return 1 ; }
@@ -194,11 +199,12 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info, vendor = &resource->data.vendor_typed;if ((vendor->byte_length -sizeof (struct acpi_vendor_uuid )) !=sizeof (struct pci_devdev_info *)) { +acpi_get_name (handle,ACPI_FULL_PATHNAME , &name_buffer);printk (KERN_ERR -"%s: Invalid vendor data length: %d for: " , - __func__, vendor->byte_length); -acpi_ns_print_node_pathname (handle,NULL ); -printk ("\n" ); +"%s: Invalid vendor data length: %d for: %s\n" , + __func__, vendor->byte_length, + (char *)name_buffer.pointer); +kfree (name_buffer.pointer); ret =1 ; goto exit; }
@@ -239,6 +245,9 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)acpi_handle parent;int slot;acpi_status status; +struct acpi_buffer name_buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; + +acpi_get_name (device_handle,ACPI_FULL_PATHNAME , &name_buffer);/* * Do an upward search to find the root bus device, and
@@ -249,9 +258,8 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) status =acpi_get_parent (child, &parent);if (ACPI_FAILURE (status)) {printk (KERN_ERR "%s: acpi_get_parent() failed " -"(0x%x) for: " , __func__, status); -acpi_ns_print_node_pathname (child,NULL ); -printk ("\n" ); +"(0x%x) for: %s\n" , __func__, status, + (char *)name_buffer.pointer);panic ("%s: Unable to find host devfn\n" , __func__); }if (parent == rootbus_handle)
@@ -259,22 +267,20 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) child = parent; }if (!child) { -printk (KERN_ERR "%s: Unable to find root bus for: " , - __func__); -acpi_ns_print_node_pathname (device_handle,NULL ); -printk ("\n" ); +printk (KERN_ERR "%s: Unable to find root bus for: %s\n" , + __func__, (char *)name_buffer.pointer);BUG (); } status =acpi_evaluate_integer (child,METHOD_NAME__ADR ,NULL , &adr);if (ACPI_FAILURE (status)) { -printk (KERN_ERR "%s: Unable to get _ADR (0x%x) for: " , - __func__, status); -acpi_ns_print_node_pathname (child,NULL ); -printk ("\n" ); +printk (KERN_ERR "%s: Unable to get _ADR (0x%x) for: %s\n" , + __func__, status, (char *)name_buffer.pointer);panic ("%s: Unable to find host devfn\n" , __func__); } +kfree (name_buffer.pointer); + slot = (adr >>16 ) &0xffff ; function = adr &0xffff ; devfn =PCI_DEVFN (slot, function);
@@ -300,27 +306,28 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)int function;int slot;struct sn_pcidev_match *info = context; +struct acpi_buffer name_buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; status =acpi_evaluate_integer (handle,METHOD_NAME__ADR ,NULL , &adr);if (ACPI_SUCCESS (status)) { status =acpi_get_parent (handle, &parent);if (ACPI_FAILURE (status)) { +acpi_get_name (handle,ACPI_FULL_PATHNAME , &name_buffer);printk (KERN_ERR -"%s: acpi_get_parent() failed (0x%x) for: " , - __func__, status); -acpi_ns_print_node_pathname (handle,NULL ); -printk ("\n" ); +"%s: acpi_get_parent() failed (0x%x) for: %s\n" , + __func__, status, (char *)name_buffer.pointer); +kfree (name_buffer.pointer);return AE_OK ; } status =acpi_evaluate_integer (parent,METHOD_NAME__BBN ,NULL , &bbn);if (ACPI_FAILURE (status)) { +acpi_get_name (handle,ACPI_FULL_PATHNAME , &name_buffer);printk (KERN_ERR -"%s: Failed to find _BBN in parent of: " , - __func__); -acpi_ns_print_node_pathname (handle,NULL ); -printk ("\n" ); +"%s: Failed to find _BBN in parent of: %s\n" , + __func__, (char *)name_buffer.pointer); +kfree (name_buffer.pointer);return AE_OK ; }
@@ -350,24 +357,27 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,acpi_handle rootbus_handle;unsigned long long segment;acpi_status status; +struct acpi_buffer name_buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; rootbus_handle =PCI_CONTROLLER (dev)->acpi_handle; status =acpi_evaluate_integer (rootbus_handle,METHOD_NAME__SEG ,NULL , &segment);if (ACPI_SUCCESS (status)) {if (segment !=pci_domain_nr (dev)) { +acpi_get_name (rootbus_handle,ACPI_FULL_PATHNAME , + &name_buffer);printk (KERN_ERR -"%s: Segment number mismatch, 0x%llx vs 0x%x for: " , - __func__, segment,pci_domain_nr (dev)); -acpi_ns_print_node_pathname (rootbus_handle,NULL ); -printk ("\n" ); +"%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n" , + __func__, segment,pci_domain_nr (dev), + (char *)name_buffer.pointer); +kfree (name_buffer.pointer);return 1 ; } }else { -printk (KERN_ERR "%s: Unable to get __SEG from: " , - __func__); -acpi_ns_print_node_pathname (rootbus_handle,NULL ); -printk ("\n" ); +acpi_get_name (rootbus_handle,ACPI_FULL_PATHNAME , &name_buffer); +printk (KERN_ERR "%s: Unable to get __SEG from: %s\n" , + __func__, (char *)name_buffer.pointer); +kfree (name_buffer.pointer);return 1 ; }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 73/94 ACPI: io_common.c: call acpi_get_table to avoid using ACPI_SIG_DSDT
In reply to Len BrownFrom: Lin Ming <[email protected]>
ACPI_SIG_DSDT is acpica internal used only.
call acpi_get_table to avoid using ACPI_SIG_DSDT.
--- arch/ia64/sn/kernel/io_common.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/ia64/sn/kernel/io_common.c +2 -2
@@ -473,7 +473,7 @@ sn_io_early_init(void) {struct acpi_table_header *header =NULL ; -acpi_get_table_by_index (ACPI_TABLE_INDEX_DSDT , &header); +acpi_get_table (ACPI_SIG_DSDT ,1 , &header);BUG_ON (header ==NULL ); sn_acpi_rev = header->oem_revision; }
@@ -505,7 +505,7 @@ sn_io_early_init(void) {struct acpi_table_header *header; - (void )acpi_get_table_by_index (ACPI_TABLE_INDEX_DSDT , &header); + (void )acpi_get_table (ACPI_SIG_DSDT ,1 , &header);printk (KERN_INFO "ACPI DSDT OEM Rev 0x%x\n" , header->oem_revision); }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 74/94 ACPICA: New: acpi_read and acpi_write public interfaces
In reply to Len BrownFrom: Bob Moore <[email protected]>
Changed the acpi_hw_low_level_read and acpi_hw_low_level_write functions to the public acpi_read and acpi_write to allow direct access to ACPI registers. Removed the "width" parameter since the width can be obtained from the input GAS structure. Updated the FADT initialization to setup the GAS structures with the proper widths. Some widths are still hardcoded because many FADTs have incorrect register lengths.
--- drivers/acpi/events/evgpe.c | 12 ++--- drivers/acpi/events/evgpeblk.c | 14 ++---- drivers/acpi/hardware/hwgpe.c | 49 +++++++---------- drivers/acpi/hardware/hwregs.c | 117 ++++++++++++++++++---------------------- drivers/acpi/reboot.c | 2 +- include/acpi/achware.h | 7 --- include/acpi/acpixf.h | 14 +++-- 7 files changed, 89 insertions(+), 126 deletions(-)
drivers/acpi/events/evgpe.c +4 -8
@@ -422,10 +422,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)/* Read the Status Register */ status = -acpi_hw_low_level_read (ACPI_GPE_REGISTER_WIDTH , - &status_reg, - &gpe_register_info-> - status_address); +acpi_read (&status_reg, + &gpe_register_info->status_address);if (ACPI_FAILURE (status)) { goto unlock_and_exit; }
@@ -433,10 +431,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)/* Read the Enable Register */ status = -acpi_hw_low_level_read (ACPI_GPE_REGISTER_WIDTH , - &enable_reg, - &gpe_register_info-> - enable_address); +acpi_read (&enable_reg, + &gpe_register_info->enable_address);if (ACPI_FAILURE (status)) { goto unlock_and_exit; }
drivers/acpi/events/evgpeblk.c +4 -10
@@ -830,10 +830,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)ACPI_GPE_REGISTER_WIDTH ; this_register->enable_address.bit_width =ACPI_GPE_REGISTER_WIDTH ; - this_register->status_address.bit_offset = -ACPI_GPE_REGISTER_WIDTH ; - this_register->enable_address.bit_offset = -ACPI_GPE_REGISTER_WIDTH ; + this_register->status_address.bit_offset =0 ; + this_register->enable_address.bit_offset =0 ;/* Init the event_info for each GPE within this register */
@@ -846,18 +844,14 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)/* Disable all GPEs within this register */ - status =acpi_hw_low_level_write (ACPI_GPE_REGISTER_WIDTH ,0x00 , - &this_register-> - enable_address); + status =acpi_write (0x00 , &this_register->enable_address);if (ACPI_FAILURE (status)) { goto error_exit; }/* Clear any pending GPE events within this register */ - status =acpi_hw_low_level_write (ACPI_GPE_REGISTER_WIDTH ,0xFF , - &this_register-> - status_address); + status =acpi_write (0xFF , &this_register->status_address);if (ACPI_FAILURE (status)) { goto error_exit; }
drivers/acpi/hardware/hwgpe.c +19 -30
103 lines not on this page · raw message
drivers/acpi/hardware/hwregs.c +53 -64
269 lines not on this page · raw message
drivers/acpi/reboot.c +1 -1
@@ -42,7 +42,7 @@ void acpi_reboot(void)case ACPI_ADR_SPACE_SYSTEM_MEMORY :case ACPI_ADR_SPACE_SYSTEM_IO :printk (KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n" ); -acpi_hw_low_level_write (8 , reset_value, rr); +acpi_write (reset_value, rr);break ; }/* Wait ten seconds */
include/acpi/achware.h +0 -7
@@ -75,13 +75,6 @@ acpi_hw_register_read(u32 register_id, u32 * return_value);acpi_status acpi_hw_register_write (u32 register_id,u32 value); -acpi_status -acpi_hw_low_level_read (u32 width, -u32 * value,struct acpi_generic_address *reg); - -acpi_status -acpi_hw_low_level_write (u32 width,u32 value,struct acpi_generic_address *reg); -acpi_status acpi_hw_clear_acpi_status (void );/*
include/acpi/acpixf.h +8 -6
@@ -81,11 +81,6 @@ const char *acpi_format_exception(acpi_status exception);acpi_status acpi_purge_cached_objects (void ); -#ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_install_initialization_handler (acpi_init_handler handler,u32 function); -#endif -/* * ACPI Memory management */
@@ -195,9 +190,12 @@ acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);acpi_status acpi_get_parent (acpi_handle object,acpi_handle * out_handle);/* -* Event handler interfaces +* Handler interfaces */ acpi_status +acpi_install_initialization_handler (acpi_init_handler handler,u32 function); + +acpi_status acpi_install_fixed_event_handler (u32 acpi_event,acpi_event_handler handler,void *context);
@@ -336,6 +334,10 @@ acpi_set_firmware_waking_vector(u32 physical_address);acpi_status acpi_set_firmware_waking_vector64 (u64 physical_address); +acpi_status acpi_read (u32 *value,struct acpi_generic_address *reg); + +acpi_status acpi_write (u32 value,struct acpi_generic_address *reg); +acpi_status acpi_get_sleep_type_data (u8 sleep_state,u8 * slp_typ_a,u8 * slp_typ_b);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 75/94 ACPICA: Move all public H/W interfaces to new hwxface
In reply to Len BrownFrom: Bob Moore <[email protected]>
Move public interfaces from hwregs.c to new file, hwxface.c - similar to the structure of the other ACPICA components.
---
drivers/acpi/hardware/Makefile | 2 +-
drivers/acpi/hardware/hwregs.c | 498 +-----------------
drivers/acpi/hardware/{hwregs.c => hwxface.c} | 715 ++++++++-----------------
3 files changed, 215 insertions(+), 1000 deletions(-)
copy drivers/acpi/hardware/{hwregs.c => hwxface.c} (65%)drivers/acpi/hardware/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for all Linux ACPI interpreter subdirectories # -obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o +obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o obj-$(ACPI_FUTURE_USAGE) += hwtimer.o
drivers/acpi/hardware/hwregs.c +2 -496
525 lines not on this page · raw message
drivers/acpi/hardware/hwxface.c renamed from drivers/acpi/hardware/hwregs.c +212 -503
857 lines not on this page · raw message
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 76/94 ACPICA: New: acpi_reset interface - write to reset register
In reply to Len BrownFrom: Bob Moore <[email protected]>
Uses the FADT-defined reset register and reset value. Checks the FADT flags for the reset register supported bit. Supports reset register in memory or I/O space, but not in PCI config space since the host has the information to do it.
--- drivers/acpi/hardware/hwxface.c | 37 +++++++++++++++++++++++++++++++++++++ include/acpi/acpixf.h | 2 ++ 2 files changed, 39 insertions(+), 0 deletions(-)
drivers/acpi/hardware/hwxface.c +37 -0
@@ -50,6 +50,43 @@ ACPI_MODULE_NAME("hwxface")/****************************************************************************** * +* FUNCTION: acpi_reset +* +* PARAMETERS: None +* +* RETURN: Status +* +* DESCRIPTION: Set reset register in memory or IO space. Note: Does not +* support reset register in PCI config space, this must be +* handled separately. +* +******************************************************************************/ +acpi_status acpi_reset (void ) +{ +struct acpi_generic_address *reset_reg; +acpi_status status; + +ACPI_FUNCTION_TRACE (acpi_reset); + + reset_reg = &acpi_gbl_FADT.reset_register; + +/* Check if the reset register is supported */ + +if (!(acpi_gbl_FADT.flags &ACPI_FADT_RESET_REGISTER ) || + !reset_reg->address) { +return_ACPI_STATUS (AE_NOT_EXIST ); + } + +/* Write the reset value to the reset register */ + + status =acpi_write (acpi_gbl_FADT.reset_value, reset_reg); +return_ACPI_STATUS (status); +} + +ACPI_EXPORT_SYMBOL (acpi_reset) + +/****************************************************************************** +* * FUNCTION: acpi_read * * PARAMETERS: Value - Where the value is returned
include/acpi/acpixf.h +2 -0
@@ -322,6 +322,8 @@ acpi_resource_to_address64(struct acpi_resource *resource,/* * Hardware (ACPI device) interfaces */ +acpi_status acpi_reset (void ); +acpi_status acpi_get_register (u32 register_id,u32 * return_value);acpi_status acpi_get_register_unlocked (u32 register_id,u32 *return_value);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 77/94 ACPI: reboot.c: use new acpi_reset interface
In reply to Len BrownFrom: Lin Ming <[email protected]>
Use new acpi_reset interface to write to reset register
--- drivers/acpi/reboot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/reboot.c +1 -1
@@ -42,7 +42,7 @@ void acpi_reboot(void)case ACPI_ADR_SPACE_SYSTEM_MEMORY :case ACPI_ADR_SPACE_SYSTEM_IO :printk (KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n" ); -acpi_write (reset_value, rr); +acpi_reset ();break ; }/* Wait ten seconds */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 78/94 ACPI: remove private acpica headers from driver files
In reply to Len BrownFrom: Lin Ming <[email protected]>
External driver files should not include any private acpica headers.
--- arch/ia64/include/asm/acpi-ext.h | 1 - arch/ia64/include/asm/sn/acpi.h | 2 -- arch/ia64/sn/kernel/io_acpi_init.c | 1 - arch/ia64/sn/kernel/io_common.c | 1 - drivers/acpi/cm_sbs.c | 3 --- drivers/acpi/debug.c | 1 - drivers/acpi/ec.c | 1 - drivers/acpi/numa.c | 1 - drivers/acpi/sbshc.c | 1 - drivers/acpi/scan.c | 1 - drivers/acpi/sleep/wakeup.c | 1 - drivers/ata/libata-acpi.c | 6 ------ drivers/ata/pata_acpi.c | 6 ------ drivers/char/tpm/tpm_bios.c | 2 -- drivers/ide/ide-acpi.c | 6 ------ drivers/misc/tc1100-wmi.c | 1 - drivers/misc/thinkpad_acpi.c | 1 - drivers/pci/hotplug/acpi_pcihp.c | 1 - drivers/pci/hotplug/pciehp.h | 1 - drivers/pci/pci-acpi.c | 2 -- drivers/pnp/pnpacpi/core.c | 1 - include/linux/pci_hotplug.h | 1 - 22 files changed, 0 insertions(+), 42 deletions(-)
arch/ia64/include/asm/acpi-ext.h +0 -1
@@ -14,7 +14,6 @@#define _ASM_IA64_ACPI_EXT_H#include <linux/types.h> -#include <acpi/actypes.h> extern acpi_status hp_acpi_csr_space (acpi_handle ,u64 *base,u64 *length);
arch/ia64/include/asm/sn/acpi.h +0 -2
@@ -9,8 +9,6 @@#ifndef _ASM_IA64_SN_ACPI_H#define _ASM_IA64_SN_ACPI_H -#include "acpi/acglobal.h" -extern int sn_acpi_rev;#define SN_ACPI_BASE_SUPPORT () (sn_acpi_rev >= 0x20101)
arch/ia64/sn/kernel/io_acpi_init.c +0 -1
@@ -13,7 +13,6 @@#include <asm/sn/sn_sal.h> #include "xtalk/hubdev.h" #include <linux/acpi.h> -#include <acpi/acnamesp.h> /*
arch/ia64/sn/kernel/io_common.c +0 -1
@@ -26,7 +26,6 @@#include <linux/acpi.h> #include <asm/sn/sn2/sn_hwperf.h> #include <asm/sn/acpi.h> -#include "acpi/acglobal.h" extern void sn_init_cpei_timer (void );extern void register_sn_procfs (void );
drivers/acpi/cm_sbs.c +0 -3
@@ -27,9 +27,6 @@#include <linux/seq_file.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> -#include <acpi/acmacros.h> -#include <acpi/actypes.h> -#include <acpi/acutils.h> ACPI_MODULE_NAME ("cm_sbs" );#define ACPI_AC_CLASS "ac_adapter"
drivers/acpi/debug.c +0 -1
@@ -9,7 +9,6 @@#include <linux/moduleparam.h> #include <asm/uaccess.h> #include <acpi/acpi_drivers.h> -#include <acpi/acglobal.h> #define _COMPONENT ACPI_SYSTEM_COMPONENTACPI_MODULE_NAME ("debug" );
drivers/acpi/ec.c +0 -1
@@ -42,7 +42,6 @@#include <asm/io.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> -#include <acpi/actypes.h> #define ACPI_EC_CLASS "embedded_controller"#define ACPI_EC_DEVICE_NAME "Embedded Controller"
drivers/acpi/numa.c +0 -1
@@ -29,7 +29,6 @@#include <linux/errno.h> #include <linux/acpi.h> #include <acpi/acpi_bus.h> -#include <acpi/acmacros.h> #define ACPI_NUMA 0x80000000#define _COMPONENT ACPI_NUMA
drivers/acpi/sbshc.c +0 -1
@@ -10,7 +10,6 @@#include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> -#include <acpi/actypes.h> #include <linux/wait.h> #include <linux/delay.h> #include <linux/interrupt.h>
drivers/acpi/scan.c +0 -1
@@ -10,7 +10,6 @@#include <linux/kthread.h> #include <acpi/acpi_drivers.h> -#include <acpi/acinterp.h> /* for acpi_ex_eisa_id_to_string() */ #define _COMPONENT ACPI_BUS_COMPONENTACPI_MODULE_NAME ("scan" );
drivers/acpi/sleep/wakeup.c +0 -1
@@ -8,7 +8,6 @@#include <acpi/acpi_drivers.h> #include <linux/kernel.h> #include <linux/types.h> -#include <acpi/acevents.h> #include "sleep.h" #define _COMPONENT ACPI_SYSTEM_COMPONENT
drivers/ata/libata-acpi.c +0 -6
@@ -19,12 +19,6 @@#include "libata.h" #include <acpi/acpi_bus.h> -#include <acpi/acnames.h> -#include <acpi/acnamesp.h> -#include <acpi/acparser.h> -#include <acpi/acexcep.h> -#include <acpi/acmacros.h> -#include <acpi/actypes.h> enum {ATA_ACPI_FILTER_SETXFER =1 <<0 ,
drivers/ata/pata_acpi.c +0 -6
@@ -13,12 +13,6 @@#include <linux/device.h> #include <scsi/scsi_host.h> #include <acpi/acpi_bus.h> -#include <acpi/acnames.h> -#include <acpi/acnamesp.h> -#include <acpi/acparser.h> -#include <acpi/acexcep.h> -#include <acpi/acmacros.h> -#include <acpi/actypes.h> #include <linux/libata.h> #include <linux/ata.h>
drivers/char/tpm/tpm_bios.c +0 -2
@@ -23,8 +23,6 @@#include <linux/security.h> #include <linux/module.h> #include <acpi/acpi.h> -#include <acpi/actypes.h> -#include <acpi/actbl.h> #include "tpm.h" #define TCG_EVENT_NAME_LEN_MAX 255
drivers/ide/ide-acpi.c +0 -6
@@ -18,12 +18,6 @@#include <linux/dmi.h> #include <acpi/acpi_bus.h> -#include <acpi/acnames.h> -#include <acpi/acnamesp.h> -#include <acpi/acparser.h> -#include <acpi/acexcep.h> -#include <acpi/acmacros.h> -#include <acpi/actypes.h> #define REGS_PER_GTF 7struct taskfile_array {
drivers/misc/tc1100-wmi.c +0 -1
@@ -30,7 +30,6 @@#include <linux/init.h> #include <linux/types.h> #include <acpi/acpi.h> -#include <acpi/actypes.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> #include <linux/platform_device.h>
drivers/misc/thinkpad_acpi.c +0 -1
@@ -76,7 +76,6 @@#include <linux/workqueue.h> #include <acpi/acpi_drivers.h> -#include <acpi/acnamesp.h> #include <linux/pci_ids.h>
drivers/pci/hotplug/acpi_pcihp.c +0 -1
@@ -33,7 +33,6 @@#include <linux/pci-acpi.h> #include <acpi/acpi.h> #include <acpi/acpi_bus.h> -#include <acpi/actypes.h> #define MY_NAME "acpi_pcihp"
drivers/pci/hotplug/pciehp.h +0 -1
@@ -217,7 +217,6 @@ struct hpc_ops {#ifdef CONFIG_ACPI #include <acpi/acpi.h> #include <acpi/acpi_bus.h> -#include <acpi/actypes.h> #include <linux/pci-acpi.h> static inline int pciehp_get_hp_hw_control_from_firmware (struct pci_dev *dev)
drivers/pci/pci-acpi.c +0 -2
@@ -13,8 +13,6 @@#include <linux/module.h> #include <linux/pci-aspm.h> #include <acpi/acpi.h> -#include <acpi/acnamesp.h> -#include <acpi/acresrc.h> #include <acpi/acpi_bus.h> #include <linux/pci-acpi.h>
drivers/pnp/pnpacpi/core.c +0 -1
@@ -23,7 +23,6 @@#include <linux/pnp.h> #include <linux/mod_devicetable.h> #include <acpi/acpi_bus.h> -#include <acpi/actypes.h> #include "../base.h" #include "pnpacpi.h"
include/linux/pci_hotplug.h +0 -1
@@ -223,7 +223,6 @@ struct hotplug_params {#ifdef CONFIG_ACPI #include <acpi/acpi.h> #include <acpi/acpi_bus.h> -#include <acpi/actypes.h> extern acpi_status acpi_get_hp_params_from_firmware (struct pci_bus *bus,struct hotplug_params *hpp);int acpi_get_hp_hw_control_from_firmware (struct pci_dev *dev,u32 flags);
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 80/94 ACPICA: Fixes for various ACPI data tables
In reply to Len BrownFrom: Bob Moore <[email protected]>
Eliminate extraneous "zero length subtable" messages. Fix subtable output for ERST, MCFG, EINJ tables. Implement all subtables for HEST.
--- include/acpi/acdisasm.h | 8 ++++++++ include/acpi/actbl1.h | 2 +- 2 files changed, 9 insertions(+), 1 deletions(-)
include/acpi/acdisasm.h +8 -0
@@ -173,6 +173,14 @@ extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];extern struct acpi_dmtable_info acpi_dm_table_info_gas[];extern struct acpi_dmtable_info acpi_dm_table_info_header[];extern struct acpi_dmtable_info acpi_dm_table_info_hest[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest0[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest1[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest3[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest4[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest5[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest6[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest7[]; +extern struct acpi_dmtable_info acpi_dm_table_info_hest8[];extern struct acpi_dmtable_info acpi_dm_table_info_hest9[];extern struct acpi_dmtable_info acpi_dm_table_info_hest_notify[];extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
include/acpi/actbl1.h +1 -1
@@ -627,7 +627,7 @@ struct acpi_hest_aer_common {u32 uncorrectable_error_mask;u32 uncorrectable_error_severity;u32 correctable_error_mask; -u32 advanced_error_cababilities; +u32 advanced_error_capabilities; };/* Hardware Error Notification */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 81/94 ACPICA: Add ACPI_MUTEX_TYPE configuration option
In reply to Len BrownFrom: Bob Moore <[email protected]>
Used to specify whether the OSL mutex interfaces should be used, or binary semaphores instead.
--- include/acpi/acpiosxf.h | 13 +++------ include/acpi/actypes.h | 54 ++++++++++++++++++++++++++++---------- include/acpi/platform/acenv.h | 35 +++++++++++++++++++++---- include/acpi/platform/aclinux.h | 1 + 4 files changed, 75 insertions(+), 28 deletions(-)
include/acpi/acpiosxf.h +5 -8
@@ -121,8 +121,11 @@ acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);acpi_status acpi_os_signal_semaphore (acpi_semaphore handle,u32 units);/* -* Mutex primitives +* Mutex primitives. May be configured to use semaphores instead via +* ACPI_MUTEX_TYPE (see platform/acenv.h) */ +#if (ACPI_MUTEX_TYPE !=ACPI_BINARY_SEMAPHORE ) +acpi_status acpi_os_create_mutex (acpi_mutex * out_handle);void acpi_os_delete_mutex (acpi_mutex handle);
@@ -130,13 +133,7 @@ void acpi_os_delete_mutex(acpi_mutex handle);acpi_status acpi_os_acquire_mutex (acpi_mutex handle,u16 timeout);void acpi_os_release_mutex (acpi_mutex handle); - -/* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */ - -#define acpi_os_create_mutex (out_handle) acpi_os_create_semaphore (1, 1, out_handle) -#define acpi_os_delete_mutex (handle) (void) acpi_os_delete_semaphore (handle) -#define acpi_os_acquire_mutex (handle,time) acpi_os_wait_semaphore (handle, 1, time) -#define acpi_os_release_mutex (handle) (void) acpi_os_signal_semaphore (handle, 1) +#endif /* * Memory allocation and mapping
include/acpi/actypes.h +40 -14
80 lines not on this page · raw message
include/acpi/platform/acenv.h +29 -6
@@ -44,13 +44,26 @@#ifndef __ACENV_H__#define __ACENV_H__ -/* +/* Types for ACPI_MUTEX_TYPE */ + +#define ACPI_BINARY_SEMAPHORE 0 +#define ACPI_OSL_MUTEX 1 + +/* Types for DEBUGGER_THREADING */ + +#define DEBUGGER_SINGLE_THREADED 0 +#define DEBUGGER_MULTI_THREADED 1 + +/****************************************************************************** +* * Configuration for ACPI tools and utilities -*/ +* +*****************************************************************************/ +#ifdef ACPI_LIBRARY /* * Note: The non-debug version of the acpi_library does not contain any -* debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG +* debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG */ #define ACPI_USE_LOCAL_CACHE #endif
@@ -167,6 +180,19 @@/*! [End] no source code translation !*/ +/****************************************************************************** +* +* Miscellaneous configuration +* +*****************************************************************************/ + +/* +* Are mutexes supported by the host? default is no, use binary semaphores. +*/ +#ifndef ACPI_MUTEX_TYPE +#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE +#endif +/* * Debugger threading model * Use single threaded if the entire subsystem is contained in an application
@@ -175,9 +201,6 @@* By default the model is single threaded if ACPI_APPLICATION is set, * multi-threaded if ACPI_APPLICATION is not set. */ -#define DEBUGGER_SINGLE_THREADED 0 -#define DEBUGGER_MULTI_THREADED 1 -#ifndef DEBUGGER_THREADING #ifdef ACPI_APPLICATION #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
include/acpi/platform/aclinux.h +1 -0
@@ -46,6 +46,7 @@#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 +#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE#ifdef __KERNEL__
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 82/94 ACPICA: FADT parsing changes and fixes
In reply to Len BrownFrom: Bob Moore <[email protected]>
1) Update the register lengths for the PM1 event blocks. The length must be divided by two in order to use these to access the status registers.
2) Add run-time option to use default register lengths to override a faulty FADT.
3) Add warning message if any of the X64 address structures contain a length that does not match the legacy length earlier in the FADT.
4) Move all FADT warning messages into the ValidateFadt function.
--- drivers/acpi/tables/tbfadt.c | 125 +++++++++++++++++++++++++++++++++++------- include/acpi/acglobal.h | 6 ++ include/acpi/actypes.h | 8 ++- 3 files changed, 118 insertions(+), 21 deletions(-)
drivers/acpi/tables/tbfadt.c +105 -20
@@ -51,7 +51,7 @@ ACPI_MODULE_NAME("tbfadt")/* Local prototypes */ static inline void acpi_tb_init_generic_address (struct acpi_generic_address *generic_address, -u8 byte_width,u64 address); +u8 space_id,u8 byte_width,u64 address);static void acpi_tb_convert_fadt (void );
@@ -125,7 +125,7 @@ static struct acpi_fadt_info fadt_info_table[] = {static inline void acpi_tb_init_generic_address (struct acpi_generic_address *generic_address, -u8 byte_width,u64 address) +u8 space_id,u8 byte_width,u64 address) {/*
@@ -136,10 +136,10 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,/* All other fields are byte-wide */ - generic_address->space_id =ACPI_ADR_SPACE_SYSTEM_IO ; - generic_address->bit_width = byte_width <<3 ; + generic_address->space_id = space_id; + generic_address->bit_width = (u8 )ACPI_MUL_8 (byte_width); generic_address->bit_offset =0 ; - generic_address->access_width =0 ; + generic_address->access_width =0 ;/* Access width ANY */ }/*******************************************************************************
@@ -226,7 +226,8 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)*/ if (length >sizeof (struct acpi_table_fadt )) {ACPI_WARNING ((AE_INFO , -"FADT (revision %u) is longer than ACPI 2.0 version, truncating length 0x%X to 0x%zX" , +"FADT (revision %u) is longer than ACPI 2.0 version, " +"truncating length 0x%X to 0x%zX" , table->revision, (unsigned )length,sizeof (struct acpi_table_fadt ))); }
@@ -245,7 +246,6 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)* 2) Validate some of the important values within the FADT */ acpi_tb_convert_fadt (); -acpi_tb_validate_fadt (); }/*******************************************************************************
@@ -337,7 +337,11 @@ static void acpi_tb_convert_fadt(void)/* Expand only if the X target is null */ if (!target->address) { + + /* The space_id is always I/O for the legacy address fields */ + acpi_tb_init_generic_address(target, + ACPI_ADR_SPACE_SYSTEM_IO, *ACPI_ADD_PTR(u8, &acpi_gbl_FADT, fadt_info_table
@@ -350,6 +354,25 @@ static void acpi_tb_convert_fadt(void) } } +/* Validate FADT values now, before we make any changes */ + +acpi_tb_validate_fadt (); + +/* +* Get the length of the individual PM1 registers. Each register is +* defined to be the event block length / 2. +*/ + pm1_register_length = (u8 )ACPI_DIV_2 (acpi_gbl_FADT.pm1_event_length); + +/* +* Adjust the lengths of the PM1 Event Blocks so that they can be used to +* access the PM1 status register(s). +*/ + acpi_gbl_FADT.xpm1a_event_block.bit_width = + (u8 )ACPI_MUL_8 (pm1_register_length); + acpi_gbl_FADT.xpm1b_event_block.bit_width = + (u8 )ACPI_MUL_8 (pm1_register_length); +/* * Calculate separate GAS structs for the PM1 Enable registers. * These addresses do not appear (directly) in the FADT, so it is
@@ -370,11 +393,11 @@ static void acpi_tb_convert_fadt(void)" PM1_EVT_LEN (%u)\n" , acpi_gbl_FADT.xpm1a_event_block.bit_width, acpi_gbl_FADT.pm1_event_length); - pm1_register_length = (u8 )ACPI_DIV_2 (acpi_gbl_FADT.pm1_event_length);/* The PM1A register block is required */ acpi_tb_init_generic_address (&acpi_gbl_xpm1a_enable, + acpi_gbl_FADT.xpm1a_event_block.space_id, pm1_register_length, (acpi_gbl_FADT.xpm1a_event_block.address + pm1_register_length));
@@ -393,6 +416,7 @@ static void acpi_tb_convert_fadt(void) acpi_gbl_FADT.xpm1b_event_block.bit_width, acpi_gbl_FADT.pm1_event_length);acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable, + acpi_gbl_FADT.xpm1b_event_block.space_id, pm1_register_length, (acpi_gbl_FADT.xpm1b_event_block. address + pm1_register_length));
@@ -401,6 +425,30 @@ static void acpi_tb_convert_fadt(void) acpi_gbl_FADT.xpm1b_event_block.space_id; } + +if (acpi_gbl_use_default_register_widths) { +/* +* Optionally, use the default sizes for the ACPI registers. +* Some FADTs do not have the correct length(s). +* +* Note: Xpm1a_event_block and Xpm1b_event_block are used to access the PM1 +* status registers. The PM1 enable registers are created above. +*/ + acpi_gbl_xpm1a_enable.bit_width =ACPI_PM1_REGISTER_WIDTH ; + acpi_gbl_xpm1b_enable.bit_width =ACPI_PM1_REGISTER_WIDTH ; + + acpi_gbl_FADT.xpm1a_event_block.bit_width = +ACPI_PM1_REGISTER_WIDTH ; + acpi_gbl_FADT.xpm1b_event_block.bit_width = +ACPI_PM1_REGISTER_WIDTH ; + acpi_gbl_FADT.xpm1a_control_block.bit_width = +ACPI_PM1_REGISTER_WIDTH ; + acpi_gbl_FADT.xpm1b_control_block.bit_width = +ACPI_PM1_REGISTER_WIDTH ; + acpi_gbl_FADT.xpm2_control_block.bit_width = +ACPI_PM2_REGISTER_WIDTH ; + acpi_gbl_FADT.xpm_timer_block.bit_width =ACPI_PM_TIMER_WIDTH ; + } }/******************************************************************************
@@ -425,26 +473,63 @@ static void acpi_tb_convert_fadt(void)static void acpi_tb_validate_fadt (void ) { +char *name;u32 *address32;struct acpi_generic_address *address64;u8 length;u32 i; -/* Examine all of the 64-bit extended address fields (X fields) */ +/* +* Check for FACS and DSDT address mismatches. An address mismatch between +* the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and +* DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. +*/ +if (acpi_gbl_FADT.facs && + (acpi_gbl_FADT.Xfacs != (u64 ) acpi_gbl_FADT.facs)) { +ACPI_WARNING ((AE_INFO , +"32/64 FACS address mismatch in FADT - " +"two FACS tables! %8.8X/%8.8X%8.8X" , + acpi_gbl_FADT.facs, +ACPI_FORMAT_UINT64 (acpi_gbl_FADT.Xfacs))); + } -for (i =0 ; i <ACPI_FADT_INFO_ENTRIES ; i++) { +if (acpi_gbl_FADT.dsdt && + (acpi_gbl_FADT.Xdsdt != (u64 ) acpi_gbl_FADT.dsdt)) { +ACPI_WARNING ((AE_INFO , +"32/64 DSDT address mismatch in FADT - " +"two DSDT tables! %8.8X/%8.8X%8.8X" , + acpi_gbl_FADT.dsdt, +ACPI_FORMAT_UINT64 (acpi_gbl_FADT.Xdsdt))); + } -/* Generate pointers to the 32-bit and 64-bit addresses and get the length */ +/* Examine all of the 64-bit extended address fields (X fields) */ - address64 = - ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT, - fadt_info_table[i].target); +for (i =0 ; i <ACPI_FADT_INFO_ENTRIES ; i++) { +/* +* Generate pointers to the 32-bit and 64-bit addresses, get the +* register length (width), and the register name +*/ + address64 = ACPI_ADD_PTR(struct acpi_generic_address, + &acpi_gbl_FADT, + fadt_info_table[i].target); address32 =ACPI_ADD_PTR (u32, &acpi_gbl_FADT, fadt_info_table[i].source); length = *ACPI_ADD_PTR (u8, &acpi_gbl_FADT, fadt_info_table[i].length); + name = fadt_info_table[i].name; + +/* +* For each extended field, check for length mismatch between the +* legacy length field and the corresonding 64-bit X length field. +*/ +if (address64 && (address64->bit_width !=ACPI_MUL_8 (length))) { +ACPI_WARNING ((AE_INFO , +"32/64X bit length mismatch in %s: %d/%d" , + name,ACPI_MUL_8 (length), + address64->bit_width)); + }if (fadt_info_table[i].type &ACPI_FADT_REQUIRED ) {/*
@@ -453,8 +538,8 @@ static void acpi_tb_validate_fadt(void)*/ if (!address64->address || !length) {ACPI_ERROR ((AE_INFO , -"Required field \"%s\" has zero address and/or length: %8.8X%8.8X/%X" , - fadt_info_table[i].name, +"Required field %s has zero address and/or length: %8.8X%8.8X/%X" , + name,ACPI_FORMAT_UINT64 (address64-> address), length));
@@ -467,8 +552,8 @@ static void acpi_tb_validate_fadt(void)if ((address64->address && !length) || (!address64->address && length)) {ACPI_WARNING ((AE_INFO , -"Optional field \"%s\" has zero address or length: %8.8X%8.8X/%X" , - fadt_info_table[i].name, +"Optional field %s has zero address or length: %8.8X%8.8X/%X" , + name,ACPI_FORMAT_UINT64 (address64-> address), length));
@@ -480,8 +565,8 @@ static void acpi_tb_validate_fadt(void)if (address64->address && *address32 && (address64->address != (u64) * address32)) {ACPI_ERROR ((AE_INFO , -"32/64X address mismatch in \"%s\": [%8.8X] [%8.8X%8.8X], using 64X" , - fadt_info_table[i].name, *address32, +"32/64X address mismatch in %s: [%8.8X] [%8.8X%8.8X], using 64X" , + name, *address32,ACPI_FORMAT_UINT64 (address64->address))); } }
include/acpi/acglobal.h +6 -0
@@ -102,6 +102,12 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);*/ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE); +/* +* Optionally use default values for the ACPI register widths. Set this to +* TRUE to use the defaults, if an FADT contains incorrect widths/lengths. +*/ +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, FALSE); +/***************************************************************************** * * Debug support
include/acpi/actypes.h +7 -1
@@ -309,10 +309,16 @@ typedef u32 acpi_physical_address;* *****************************************************************************/ -/* Number of distinct GPE register blocks and register width */ +/* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */ #define ACPI_MAX_GPE_BLOCKS 2 + +/* Default ACPI register widths */ +#define ACPI_GPE_REGISTER_WIDTH 8 +#define ACPI_PM1_REGISTER_WIDTH 16 +#define ACPI_PM2_REGISTER_WIDTH 8 +#define ACPI_PM_TIMER_WIDTH 32/* Names within the namespace are 4 bytes long */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 83/94 ACPICA: FADT: set acpi_gbl_use_default_register_widths to TRUE by default
In reply to Len BrownFrom: [email protected] <[email protected]>
This returns the FADT support to the original behavior, which is to use default register widths. However, now check each register definition and report a warning if it differs from the default. This is a first step to moving away from the default widths, rather than outright believing the widths in all FADTs for all machines, considered rather dangerous until more data is obtained.
--- drivers/acpi/tables/tbfadt.c | 173 +++++++++++++++++++++++++---------------- include/acpi/acglobal.h | 2 +- 2 files changed, 106 insertions(+), 69 deletions(-)
drivers/acpi/tables/tbfadt.c +105 -68
@@ -61,9 +61,10 @@ static void acpi_tb_validate_fadt(void);typedef struct acpi_fadt_info {char *name; -u8 target; -u8 source; +u8 address64; +u8 address32;u8 length; +u8 default_length;u8 type; }acpi_fadt_info ;
@@ -72,37 +73,61 @@ typedef struct acpi_fadt_info {#define ACPI_FADT_SEPARATE_LENGTH 2static struct acpi_fadt_info fadt_info_table[] = { - {"Pm1aEventBlock" ,ACPI_FADT_OFFSET (xpm1a_event_block), + {"Pm1aEventBlock" , +ACPI_FADT_OFFSET (xpm1a_event_block),ACPI_FADT_OFFSET (pm1a_event_block), -ACPI_FADT_OFFSET (pm1_event_length),ACPI_FADT_REQUIRED }, +ACPI_FADT_OFFSET (pm1_event_length), +ACPI_PM1_REGISTER_WIDTH *2 ,/* Enable + Status register */ +ACPI_FADT_REQUIRED }, - {"Pm1bEventBlock" ,ACPI_FADT_OFFSET (xpm1b_event_block), + {"Pm1bEventBlock" , +ACPI_FADT_OFFSET (xpm1b_event_block),ACPI_FADT_OFFSET (pm1b_event_block), -ACPI_FADT_OFFSET (pm1_event_length),0 }, +ACPI_FADT_OFFSET (pm1_event_length), +ACPI_PM1_REGISTER_WIDTH *2 ,/* Enable + Status register */ +0 }, - {"Pm1aControlBlock" ,ACPI_FADT_OFFSET (xpm1a_control_block), + {"Pm1aControlBlock" , +ACPI_FADT_OFFSET (xpm1a_control_block),ACPI_FADT_OFFSET (pm1a_control_block), -ACPI_FADT_OFFSET (pm1_control_length),ACPI_FADT_REQUIRED }, +ACPI_FADT_OFFSET (pm1_control_length), +ACPI_PM1_REGISTER_WIDTH , +ACPI_FADT_REQUIRED }, - {"Pm1bControlBlock" ,ACPI_FADT_OFFSET (xpm1b_control_block), + {"Pm1bControlBlock" , +ACPI_FADT_OFFSET (xpm1b_control_block),ACPI_FADT_OFFSET (pm1b_control_block), -ACPI_FADT_OFFSET (pm1_control_length),0 }, +ACPI_FADT_OFFSET (pm1_control_length), +ACPI_PM1_REGISTER_WIDTH , +0 }, - {"Pm2ControlBlock" ,ACPI_FADT_OFFSET (xpm2_control_block), + {"Pm2ControlBlock" , +ACPI_FADT_OFFSET (xpm2_control_block),ACPI_FADT_OFFSET (pm2_control_block), -ACPI_FADT_OFFSET (pm2_control_length),ACPI_FADT_SEPARATE_LENGTH }, +ACPI_FADT_OFFSET (pm2_control_length), +ACPI_PM2_REGISTER_WIDTH , +ACPI_FADT_SEPARATE_LENGTH }, - {"PmTimerBlock" ,ACPI_FADT_OFFSET (xpm_timer_block), + {"PmTimerBlock" , +ACPI_FADT_OFFSET (xpm_timer_block),ACPI_FADT_OFFSET (pm_timer_block), -ACPI_FADT_OFFSET (pm_timer_length),ACPI_FADT_REQUIRED }, +ACPI_FADT_OFFSET (pm_timer_length), +ACPI_PM_TIMER_WIDTH , +ACPI_FADT_REQUIRED }, - {"Gpe0Block" ,ACPI_FADT_OFFSET (xgpe0_block), + {"Gpe0Block" , +ACPI_FADT_OFFSET (xgpe0_block),ACPI_FADT_OFFSET (gpe0_block), -ACPI_FADT_OFFSET (gpe0_block_length),ACPI_FADT_SEPARATE_LENGTH }, +ACPI_FADT_OFFSET (gpe0_block_length), +0 , +ACPI_FADT_SEPARATE_LENGTH }, - {"Gpe1Block" ,ACPI_FADT_OFFSET (xgpe1_block), + {"Gpe1Block" , +ACPI_FADT_OFFSET (xgpe1_block),ACPI_FADT_OFFSET (gpe1_block), -ACPI_FADT_OFFSET (gpe1_block_length),ACPI_FADT_SEPARATE_LENGTH } +ACPI_FADT_OFFSET (gpe1_block_length), +0 , +ACPI_FADT_SEPARATE_LENGTH } };#define ACPI_FADT_INFO_ENTRIES (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))
@@ -279,8 +304,9 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)static void acpi_tb_convert_fadt (void ) { -u8 pm1_register_length; -struct acpi_generic_address *target; +u8 pm1_register_bit_width; +u8 pm1_register_byte_width; +struct acpi_generic_address *target64;u32 i;/* Update the local FADT table header length */
@@ -326,21 +352,22 @@ static void acpi_tb_convert_fadt(void) } /* - * Expand the ACPI 1.0 32-bit V1.0 addresses to the ACPI 2.0 64-bit "X" - * generic address structures as necessary. + * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X" + * generic address structures as necessary. Later code will always use + * the 64-bit address structures. */ for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { - target = + target64 = ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT, - fadt_info_table[i].target); + fadt_info_table[i].address64); - /* Expand only if the X target is null */ + /* Expand only if the 64-bit X target is null */ - if (!target->address) { + if (!target64->address) { - /* The space_id is always I/O for the legacy address fields */ + /* The space_id is always I/O for the 32-bit legacy address fields */ - acpi_tb_init_generic_address(target, + acpi_tb_init_generic_address(target64, ACPI_ADR_SPACE_SYSTEM_IO, *ACPI_ADD_PTR(u8, &acpi_gbl_FADT,
@@ -350,7 +377,7 @@ static void acpi_tb_convert_fadt(void) &acpi_gbl_FADT, fadt_info_table [i]. - source)); + address32)); } }
@@ -359,19 +386,53 @@ static void acpi_tb_convert_fadt(void)acpi_tb_validate_fadt ();/* -* Get the length of the individual PM1 registers. Each register is -* defined to be the event block length / 2. +* Optionally check all register lengths against the default values and +* update them if they are incorrect. */ - pm1_register_length = (u8 )ACPI_DIV_2 (acpi_gbl_FADT.pm1_event_length); +if (acpi_gbl_use_default_register_widths) { +for (i =0 ; i <ACPI_FADT_INFO_ENTRIES ; i++) { + target64 = + ACPI_ADD_PTR(struct acpi_generic_address, + &acpi_gbl_FADT, + fadt_info_table[i].address64); + +/* +* If a valid register (Address != 0) and the (default_length > 0) +* (Not a GPE register), then check the width against the default. +*/ +if ((target64->address) && + (fadt_info_table[i].default_length >0 ) && + (fadt_info_table[i].default_length != + target64->bit_width)) { +ACPI_WARNING ((AE_INFO , +"Invalid length for %s: %d, using default %d" , + fadt_info_table[i].name, + target64->bit_width, + fadt_info_table[i]. + default_length)); + +/* Incorrect size, set width to the default */ + + target64->bit_width = + fadt_info_table[i].default_length; + } + } + } + +/* +* Get the length of the individual PM1 registers (enable and status). +* Each register is defined to be (event block length / 2). +*/ + pm1_register_bit_width = + (u8 )ACPI_DIV_2 (acpi_gbl_FADT.xpm1a_event_block.bit_width); + pm1_register_byte_width = (u8 )ACPI_DIV_8 (pm1_register_bit_width);/* * Adjust the lengths of the PM1 Event Blocks so that they can be used to -* access the PM1 status register(s). +* access the PM1 status register(s). Use (width / 2) */ - acpi_gbl_FADT.xpm1a_event_block.bit_width = - (u8 )ACPI_MUL_8 (pm1_register_length); - acpi_gbl_FADT.xpm1b_event_block.bit_width = - (u8 )ACPI_MUL_8 (pm1_register_length); + acpi_gbl_FADT.xpm1a_event_block.bit_width = pm1_register_bit_width; + acpi_gbl_FADT.xpm1b_event_block.bit_width = pm1_register_bit_width;/* * Calculate separate GAS structs for the PM1 Enable registers.
@@ -398,9 +459,9 @@ static void acpi_tb_convert_fadt(void)acpi_tb_init_generic_address (&acpi_gbl_xpm1a_enable, acpi_gbl_FADT.xpm1a_event_block.space_id, - pm1_register_length, + pm1_register_byte_width, (acpi_gbl_FADT.xpm1a_event_block.address + - pm1_register_length)); + pm1_register_byte_width));/* Don't forget to copy space_id of the GAS */ acpi_gbl_xpm1a_enable.space_id = acpi_gbl_FADT.xpm1a_event_block.space_id;
@@ -417,38 +478,14 @@ static void acpi_tb_convert_fadt(void) acpi_gbl_FADT.pm1_event_length);acpi_tb_init_generic_address (&acpi_gbl_xpm1b_enable, acpi_gbl_FADT.xpm1b_event_block.space_id, - pm1_register_length, + pm1_register_byte_width, (acpi_gbl_FADT.xpm1b_event_block. - address + pm1_register_length)); + address + pm1_register_byte_width));/* Don't forget to copy space_id of the GAS */ acpi_gbl_xpm1b_enable.space_id = acpi_gbl_FADT.xpm1b_event_block.space_id; } - -if (acpi_gbl_use_default_register_widths) { -/* -* Optionally, use the default sizes for the ACPI registers. -* Some FADTs do not have the correct length(s). -* -* Note: Xpm1a_event_block and Xpm1b_event_block are used to access the PM1 -* status registers. The PM1 enable registers are created above. -*/ - acpi_gbl_xpm1a_enable.bit_width =ACPI_PM1_REGISTER_WIDTH ; - acpi_gbl_xpm1b_enable.bit_width =ACPI_PM1_REGISTER_WIDTH ; - - acpi_gbl_FADT.xpm1a_event_block.bit_width = -ACPI_PM1_REGISTER_WIDTH ; - acpi_gbl_FADT.xpm1b_event_block.bit_width = -ACPI_PM1_REGISTER_WIDTH ; - acpi_gbl_FADT.xpm1a_control_block.bit_width = -ACPI_PM1_REGISTER_WIDTH ; - acpi_gbl_FADT.xpm1b_control_block.bit_width = -ACPI_PM1_REGISTER_WIDTH ; - acpi_gbl_FADT.xpm2_control_block.bit_width = -ACPI_PM2_REGISTER_WIDTH ; - acpi_gbl_FADT.xpm_timer_block.bit_width =ACPI_PM_TIMER_WIDTH ; - } }/******************************************************************************
@@ -511,10 +548,10 @@ static void acpi_tb_validate_fadt(void)*/ address64 = ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT, - fadt_info_table[i].target); + fadt_info_table[i].address64); address32 =ACPI_ADD_PTR (u32, &acpi_gbl_FADT, - fadt_info_table[i].source); + fadt_info_table[i].address32); length = *ACPI_ADD_PTR (u8, &acpi_gbl_FADT, fadt_info_table[i].length);
@@ -522,7 +559,7 @@ static void acpi_tb_validate_fadt(void)/* * For each extended field, check for length mismatch between the -* legacy length field and the corresonding 64-bit X length field. +* legacy length field and the corresponding 64-bit X length field. */ if (address64 && (address64->bit_width !=ACPI_MUL_8 (length))) { ACPI_WARNING((AE_INFO,
include/acpi/acglobal.h +1 -1
@@ -106,7 +106,7 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);* Optionally use default values for the ACPI register widths. Set this to * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, FALSE); +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE);/***************************************************************************** *
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 84/94 ACPICA: FADT: Update error msgs for consistency
In reply to Len BrownFrom: Bob Moore <[email protected]>
Update all messages so they look consistent.
--- drivers/acpi/tables/tbfadt.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/acpi/tables/tbfadt.c +4 -4
@@ -524,7 +524,7 @@ static void acpi_tb_validate_fadt(void)if (acpi_gbl_FADT.facs && (acpi_gbl_FADT.Xfacs != (u64 ) acpi_gbl_FADT.facs)) {ACPI_WARNING ((AE_INFO , -"32/64 FACS address mismatch in FADT - " +"32/64X FACS address mismatch in FADT - " "two FACS tables! %8.8X/%8.8X%8.8X" , acpi_gbl_FADT.facs,ACPI_FORMAT_UINT64 (acpi_gbl_FADT.Xfacs)));
@@ -533,7 +533,7 @@ static void acpi_tb_validate_fadt(void)if (acpi_gbl_FADT.dsdt && (acpi_gbl_FADT.Xdsdt != (u64 ) acpi_gbl_FADT.dsdt)) {ACPI_WARNING ((AE_INFO , -"32/64 DSDT address mismatch in FADT - " +"32/64X DSDT address mismatch in FADT - " "two DSDT tables! %8.8X/%8.8X%8.8X" , acpi_gbl_FADT.dsdt,ACPI_FORMAT_UINT64 (acpi_gbl_FADT.Xdsdt)));
@@ -563,7 +563,7 @@ static void acpi_tb_validate_fadt(void)*/ if (address64 && (address64->bit_width !=ACPI_MUL_8 (length))) {ACPI_WARNING ((AE_INFO , -"32/64X bit length mismatch in %s: %d/%d" , +"32/64X length mismatch in %s: %d/%d" , name,ACPI_MUL_8 (length), address64->bit_width)); }
@@ -602,7 +602,7 @@ static void acpi_tb_validate_fadt(void)if (address64->address && *address32 && (address64->address != (u64) * address32)) {ACPI_ERROR ((AE_INFO , -"32/64X address mismatch in %s: [%8.8X] [%8.8X%8.8X], using 64X" , +"32/64X address mismatch in %s: %8.8X/%8.8X%8.8X, using 64X" , name, *address32,ACPI_FORMAT_UINT64 (address64->address))); }
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 85/94 ACPICA: Update version to 20081204.
In reply to Len BrownFrom: [email protected] <[email protected]>
--- include/acpi/acpixf.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acpixf.h +1 -1
@@ -47,7 +47,7 @@/* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20081031 +#define ACPI_CA_VERSION 0x20081204#include "actypes.h" #include "actbl.h"
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 86/94 ACPICA: delete acdisasm.h
In reply to Len BrownFrom: Len Brown <[email protected]>
it is referenced only #ifdef ACPI_DISASSEMBLER,
which is never set by the kernel.
--- drivers/acpi/dispatcher/dsmethod.c | 2 + include/acpi/acdisasm.h | 453 ------------------------------------ 2 files changed, 2 insertions(+), 453 deletions(-) delete mode 100644 include/acpi/acdisasm.h
drivers/acpi/dispatcher/dsmethod.c +2 -0
@@ -47,7 +47,9 @@#include <acpi/acdispat.h> #include <acpi/acinterp.h> #include <acpi/acnamesp.h> +#ifdef ACPI_DISASSEMBLER #include <acpi/acdisasm.h> +#endif #define _COMPONENT ACPI_DISPATCHERACPI_MODULE_NAME ("dsmethod" )
include/acpi/acdisasm.h deleted +0 -453
453 lines not on this page · raw message
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 87/94 ACPICA: delete utcache.c
In reply to Len BrownFrom: Len Brown <[email protected]>
ACPI_USE_LOCAL_CACHE will never be defined by the Linux kernel, and thus utcache.c will always be dead code.
--- drivers/acpi/utilities/Makefile | 2 +- drivers/acpi/utilities/utcache.c | 315 -------------------------------------- 2 files changed, 1 insertions(+), 316 deletions(-) delete mode 100644 drivers/acpi/utilities/utcache.c
drivers/acpi/utilities/Makefile +1 -1
@@ -4,6 +4,6 @@ obj-y := utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \ utcopy.o utdelete.o utglobal.o utmath.o utobject.o \ - utstate.o utmutex.o utobject.o utcache.o utresrc.o + utstate.o utmutex.o utobject.o utresrc.o EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/utilities/utcache.c deleted +0 -315
315 lines not on this page · raw message
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 88/94 fujitsu-laptop: Add BL power, LED control and radio state information
In reply to Len BrownFrom: Tony Vroon <[email protected]>
The FUNC interface in the Fujitsu-Siemens DSDT was unused until now. It exposes state information that is now reported in additional platform files (whether the radios are killed by the hardware switch or operational, whether the machine is docked and whether the lid is open).
Support for the backlight class is now extended with the ability to power the backlight on & off. Optional support for the LED class allows the keyboard headlamps found on the U810 netbook and the Fujitsu logo illumination on the P8010 notebook to be turned on & off.
This was fed through checkpatch.pl and tested on the S6420, P8010 & U810 platforms.
--- drivers/misc/fujitsu-laptop.c | 305 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 272 insertions(+), 33 deletions(-)
drivers/misc/fujitsu-laptop.c +272 -33
@@ -3,6 +3,7 @@/* Copyright (C) 2007,2008 Jonathan Woithe <[email protected]> Copyright (C) 2008 Peter Gruber <[email protected]> +Copyright (C) 2008 Tony Vroon <[email protected]> Based on earlier work: Copyright (C) 2003 Shane Spencer <[email protected]> Adrian Yee <[email protected]>
@@ -65,8 +66,11 @@#include <linux/kfifo.h> #include <linux/video_output.h> #include <linux/platform_device.h> +#ifdef CONFIG_LEDS_CLASS +#include <linux/leds.h> +#endif -#define FUJITSU_DRIVER_VERSION "0.4.3" +#define FUJITSU_DRIVER_VERSION "0.5.0"#define FUJITSU_LCD_N_LEVELS 8
@@ -83,6 +87,24 @@#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87 +/* FUNC interface - command values */ +#define FUNC_RFKILL 0x1000 +#define FUNC_LEDS 0x1001 +#define FUNC_BUTTONS 0x1002 +#define FUNC_BACKLIGHT 0x1004 + +/* FUNC interface - responses */ +#define UNSUPPORTED_CMD 0x80000000 + +#ifdef CONFIG_LEDS_CLASS +/* FUNC interface - LED control */ +#define FUNC_LED_OFF 0x1 +#define FUNC_LED_ON 0x30001 +#define KEYBOARD_LAMPS 0x100 +#define LOGOLAMP_POWERON 0x2000 +#define LOGOLAMP_ALWAYS 0x4000 +#endif +/* Hotkey details */ #define KEY1_CODE 0x410/* codes for the keys in the GIRB register */ #define KEY2_CODE 0x411
@@ -145,8 +167,9 @@ struct fujitsu_hotkey_t {struct platform_device *pf_device;struct kfifo *fifo;spinlock_t fifo_lock; - -unsigned int irb;/* info about the pressed buttons */ +int rfkill_state; +int logolamp_registered; +int kblamps_registered; };static struct fujitsu_hotkey_t *fujitsu_hotkey;
@@ -154,12 +177,139 @@ static struct fujitsu_hotkey_t *fujitsu_hotkey;static void acpi_fujitsu_hotkey_notify (acpi_handle handle,u32 event,void *data); +#ifdef CONFIG_LEDS_CLASS +static enum led_brightness logolamp_get (struct led_classdev *cdev); +static void logolamp_set (struct led_classdev *cdev, +enum led_brightness brightness); + +struct led_classdev logolamp_led = { + .name ="fujitsu::logolamp" , + .brightness_get = logolamp_get, + .brightness_set = logolamp_set +}; + +static enum led_brightness kblamps_get (struct led_classdev *cdev); +static void kblamps_set (struct led_classdev *cdev, +enum led_brightness brightness); + +struct led_classdev kblamps_led = { + .name ="fujitsu::kblamps" , + .brightness_get = kblamps_get, + .brightness_set = kblamps_set +}; +#endif +#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG static u32 dbg_level =0x03 ;#endif static void acpi_fujitsu_notify (acpi_handle handle,u32 event,void *data); +/* Fujitsu ACPI interface function */ + +static int call_fext_func (int cmd,int arg0,int arg1,int arg2) +{ +acpi_status status =AE_OK ; +union acpi_object params[4 ] = { + { .type =ACPI_TYPE_INTEGER }, + { .type =ACPI_TYPE_INTEGER }, + { .type =ACPI_TYPE_INTEGER }, + { .type =ACPI_TYPE_INTEGER } + }; +struct acpi_object_list arg_list = {4 , ¶ms[0 ] }; +struct acpi_buffer output; +union acpi_object out_obj; +acpi_handle handle =NULL ; + + status =acpi_get_handle (fujitsu_hotkey->acpi_handle,"FUNC" , &handle); +if (ACPI_FAILURE (status)) { +vdbg_printk (FUJLAPTOP_DBG_ERROR , +"FUNC interface is not present\n" ); +return -ENODEV ; + } + + params[0 ].integer.value = cmd; + params[1 ].integer.value = arg0; + params[2 ].integer.value = arg1; + params[3 ].integer.value = arg2; + + output.length =sizeof (out_obj); + output.pointer = &out_obj; + + status =acpi_evaluate_object (handle,NULL , &arg_list, &output); +if (ACPI_FAILURE (status)) { +vdbg_printk (FUJLAPTOP_DBG_WARN , +"FUNC 0x%x (args 0x%x, 0x%x, 0x%x) call failed\n" , + cmd, arg0, arg1, arg2); +return -ENODEV ; + } + +if (out_obj.type !=ACPI_TYPE_INTEGER ) { +vdbg_printk (FUJLAPTOP_DBG_WARN , +"FUNC 0x%x (args 0x%x, 0x%x, 0x%x) did not " +"return an integer\n" , + cmd, arg0, arg1, arg2); +return -ENODEV ; + } + +vdbg_printk (FUJLAPTOP_DBG_TRACE , +"FUNC 0x%x (args 0x%x, 0x%x, 0x%x) returned 0x%x\n" , + cmd, arg0, arg1, arg2, (int )out_obj.integer.value); +return out_obj.integer.value; +} + +#ifdef CONFIG_LEDS_CLASS +/* LED class callbacks */ + +static void logolamp_set (struct led_classdev *cdev, +enum led_brightness brightness) +{ +if (brightness >=LED_FULL ) { +call_fext_func (FUNC_LEDS ,0x1 ,LOGOLAMP_POWERON ,FUNC_LED_ON ); +call_fext_func (FUNC_LEDS ,0x1 ,LOGOLAMP_ALWAYS ,FUNC_LED_ON ); + }else if (brightness >=LED_HALF ) { +call_fext_func (FUNC_LEDS ,0x1 ,LOGOLAMP_POWERON ,FUNC_LED_ON ); +call_fext_func (FUNC_LEDS ,0x1 ,LOGOLAMP_ALWAYS ,FUNC_LED_OFF ); + }else { +call_fext_func (FUNC_LEDS ,0x1 ,LOGOLAMP_POWERON ,FUNC_LED_OFF ); + } +} + +static void kblamps_set (struct led_classdev *cdev, +enum led_brightness brightness) +{ +if (brightness >=LED_FULL ) +call_fext_func (FUNC_LEDS ,0x1 ,KEYBOARD_LAMPS ,FUNC_LED_ON ); +else +call_fext_func (FUNC_LEDS ,0x1 ,KEYBOARD_LAMPS ,FUNC_LED_OFF ); +} + +static enum led_brightness logolamp_get (struct led_classdev *cdev) +{ +enum led_brightness brightness =LED_OFF ; +int poweron, always; + + poweron =call_fext_func (FUNC_LEDS ,0x2 ,LOGOLAMP_POWERON ,0x0 ); +if (poweron ==FUNC_LED_ON ) { + brightness =LED_HALF ; + always =call_fext_func (FUNC_LEDS ,0x2 ,LOGOLAMP_ALWAYS ,0x0 ); +if (always ==FUNC_LED_ON ) + brightness =LED_FULL ; + } +return brightness; +} + +static enum led_brightness kblamps_get (struct led_classdev *cdev) +{ +enum led_brightness brightness =LED_OFF ; + +if (call_fext_func (FUNC_LEDS ,0x2 ,KEYBOARD_LAMPS ,0x0 ) ==FUNC_LED_ON ) + brightness =LED_FULL ; + +return brightness; +} +#endif +/* Hardware access for LCD brightness control */ static int set_lcd_level (int level)
@@ -297,10 +447,25 @@ static int bl_get_brightness(struct backlight_device *b)static int bl_update_status (struct backlight_device *b) { +int ret; +if (b->props.power ==4 ) + ret =call_fext_func (FUNC_BACKLIGHT ,0x1 ,0x4 ,0x3 ); +else + ret =call_fext_func (FUNC_BACKLIGHT ,0x1 ,0x4 ,0x0 ); +if (ret !=0 ) +vdbg_printk (FUJLAPTOP_DBG_ERROR , +"Unable to adjust backlight power, error code %i\n" , + ret); +if (use_alt_lcd_levels) -return set_lcd_level_alt (b->props.brightness); + ret =set_lcd_level_alt (b->props.brightness);else -return set_lcd_level (b->props.brightness); + ret =set_lcd_level (b->props.brightness); +if (ret !=0 ) +vdbg_printk (FUJLAPTOP_DBG_ERROR , +"Unable to adjust LCD brightness, error code %i\n" , + ret); +return ret; }static struct backlight_ops fujitsubl_ops = {
@@ -382,42 +547,64 @@ static ssize_t store_lcd_level(struct device *dev,return count; } -/* Hardware access for hotkey device */ - -static int get_irb (void ) +static ssize_t +ignore_store (struct device *dev, +struct device_attribute *attr,const char *buf,size_t count) { -unsigned long long state =0 ; -acpi_status status =AE_OK ; - -vdbg_printk (FUJLAPTOP_DBG_TRACE ,"Get irb\n" ); - - status = -acpi_evaluate_integer (fujitsu_hotkey->acpi_handle,"GIRB" ,NULL , - &state); -if (status <0 ) -return status; +return count; +} - fujitsu_hotkey->irb = state; +static ssize_t +show_lid_state (struct device *dev, +struct device_attribute *attr,char *buf) +{ +if (fujitsu_hotkey->rfkill_state ==UNSUPPORTED_CMD ) +return sprintf (buf,"unknown\n" ); +if (fujitsu_hotkey->rfkill_state &0x100 ) +return sprintf (buf,"open\n" ); +else +return sprintf (buf,"closed\n" ); +} -return fujitsu_hotkey->irb; +static ssize_t +show_dock_state (struct device *dev, +struct device_attribute *attr,char *buf) +{ +if (fujitsu_hotkey->rfkill_state ==UNSUPPORTED_CMD ) +return sprintf (buf,"unknown\n" ); +if (fujitsu_hotkey->rfkill_state &0x200 ) +return sprintf (buf,"docked\n" ); +else +return sprintf (buf,"undocked\n" ); }static ssize_t -ignore_store (struct device *dev, -struct device_attribute *attr,const char *buf,size_t count) +show_radios_state (struct device *dev, +struct device_attribute *attr,char *buf) { -return count; +if (fujitsu_hotkey->rfkill_state ==UNSUPPORTED_CMD ) +return sprintf (buf,"unknown\n" ); +if (fujitsu_hotkey->rfkill_state &0x20 ) +return sprintf (buf,"on\n" ); +else +return sprintf (buf,"killed\n" ); } static DEVICE_ATTR(max_brightness, 0444, show_max_brightness, ignore_store); static DEVICE_ATTR(brightness_changed, 0444, show_brightness_changed, ignore_store); static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level); +static DEVICE_ATTR(lid, 0444, show_lid_state, ignore_store); +static DEVICE_ATTR(dock, 0444, show_dock_state, ignore_store); +static DEVICE_ATTR(radios, 0444, show_radios_state, ignore_store);static struct attribute *fujitsupf_attributes[] = { &dev_attr_brightness_changed.attr, &dev_attr_max_brightness.attr, &dev_attr_lcd_level.attr, + &dev_attr_lid.attr, + &dev_attr_dock.attr, + &dev_attr_radios.attr,NULL };
@@ -771,7 +958,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) input->id.bustype =BUS_HOST ; input->id.product =0x06 ; input->dev.parent = &device->dev; - input->evbit[0 ] =BIT (EV_KEY ); + +set_bit (EV_KEY , input->evbit);set_bit (fujitsu->keycode1, input->keybit);set_bit (fujitsu->keycode2, input->keybit);set_bit (fujitsu->keycode3, input->keybit);
@@ -803,10 +991,44 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)printk (KERN_ERR "_INI Method failed\n" ); } - i =0 ;/* Discard hotkey ringbuffer */ -while (get_irb () !=0 && (i++) <MAX_HOTKEY_RINGBUFFER_SIZE ) ; + i =0 ; +while (call_fext_func (FUNC_BUTTONS ,0x1 ,0x0 ,0x0 ) !=0 + && (i++) <MAX_HOTKEY_RINGBUFFER_SIZE ) + ;/* No action, result is discarded */ vdbg_printk (FUJLAPTOP_DBG_INFO ,"Discarded %i ringbuffer entries\n" , i); + fujitsu_hotkey->rfkill_state = +call_fext_func (FUNC_RFKILL ,0x4 ,0x0 ,0x0 ); + +/* Suspect this is a keymap of the application panel, print it */ +printk (KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n" , +call_fext_func (FUNC_BUTTONS ,0x0 ,0x0 ,0x0 )); + +#ifdef CONFIG_LEDS_CLASS +if (call_fext_func (FUNC_LEDS ,0x0 ,0x0 ,0x0 ) &LOGOLAMP_POWERON ) { + result =led_classdev_register (&fujitsu->pf_device->dev, + &logolamp_led); +if (result ==0 ) { + fujitsu_hotkey->logolamp_registered =1 ; + }else { +printk (KERN_ERR "fujitsu-laptop: Could not register " +"LED handler for logo lamp, error %i\n" , result); + } + } + +if ((call_fext_func (FUNC_LEDS ,0x0 ,0x0 ,0x0 ) &KEYBOARD_LAMPS ) && + (call_fext_func (FUNC_BUTTONS ,0x0 ,0x0 ,0x0 ) ==0x0 )) { + result =led_classdev_register (&fujitsu->pf_device->dev, + &kblamps_led); +if (result ==0 ) { + fujitsu_hotkey->kblamps_registered =1 ; + }else { +printk (KERN_ERR "fujitsu-laptop: Could not register " +"LED handler for keyboard lamps, error %i\n" , result); + } + } +#endif +return result; end:
@@ -852,16 +1074,15 @@ static void acpi_fujitsu_hotkey_notify(acpi_handle handle, u32 event, input = fujitsu_hotkey->input; -vdbg_printk (FUJLAPTOP_DBG_TRACE ,"Hotkey event\n" ); + fujitsu_hotkey->rfkill_state = +call_fext_func (FUNC_RFKILL ,0x4 ,0x0 ,0x0 );switch (event) {case ACPI_FUJITSU_NOTIFY_CODE1 : i =0 ; -while ((irb =get_irb ()) !=0 - && (i++) <MAX_HOTKEY_RINGBUFFER_SIZE ) { -vdbg_printk (FUJLAPTOP_DBG_TRACE ,"GIRB result [%x]\n" , - irb); - +while ((irb = +call_fext_func (FUNC_BUTTONS ,0x1 ,0x0 ,0x0 )) !=0 + && (i++) <MAX_HOTKEY_RINGBUFFER_SIZE ) {switch (irb &0x4ff ) {case KEY1_CODE : keycode = fujitsu->keycode1;
@@ -1035,6 +1256,15 @@ static int __init fujitsu_init(void) goto fail_hotkey1; } +/* Sync backlight power status (needs FUJ02E3 device, hence deferred) */ + +if (!acpi_video_backlight_support ()) { +if (call_fext_func (FUNC_BACKLIGHT ,0x2 ,0x4 ,0x0 ) ==3 ) + fujitsu->bl_device->props.power =4 ; +else + fujitsu->bl_device->props.power =0 ; + } +printk (KERN_INFO "fujitsu-laptop: driver " FUJITSU_DRIVER_VERSION " successfully loaded.\n" );
@@ -1074,6 +1304,14 @@ fail_acpi: static void __exit fujitsu_cleanup(void) { +#ifdef CONFIG_LEDS_CLASS +if (fujitsu_hotkey->logolamp_registered !=0 ) +led_classdev_unregister (&logolamp_led); + +if (fujitsu_hotkey->kblamps_registered !=0 ) +led_classdev_unregister (&kblamps_led); +#endif +sysfs_remove_group (&fujitsu->pf_device->dev.kobj, &fujitsupf_attribute_group);platform_device_unregister (fujitsu->pf_device);
@@ -1108,12 +1346,13 @@ module_param_named(debug, dbg_level, uint, 0644);MODULE_PARM_DESC (debug,"Sets debug level bit-mask" );#endif -MODULE_AUTHOR ("Jonathan Woithe, Peter Gruber" ); +MODULE_AUTHOR ("Jonathan Woithe, Peter Gruber, Tony Vroon" );MODULE_DESCRIPTION ("Fujitsu laptop extras support" );MODULE_VERSION (FUJITSU_DRIVER_VERSION );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1D3:*:cvrS6410:*" ); +MODULE_ALIAS ("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1E6:*:cvrS6420:*" );MODULE_ALIAS ("dmi:*:svnFUJITSU:*:pvr:rvnFUJITSU:rnFJNB19C:*:cvrS7020:*" );static struct pnp_device_id pnp_ids[] = {
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 89/94 fujitsu-laptop: Simplify SBLL/SBL2 backlight handling
In reply to Len BrownFrom: Tony Vroon <[email protected]>
GBLS and GBLL only differ in the clearing of the GHKS flag, so there is no need to have two backlight level readouts. Also, per Peter Gruber, the need for the BLNF check has disappeared.
As a result, cleanups can be made in the code. This has been tested on the both the S6410 and the S6420 platforms and causes no functionality regressions, on the console without X or within X. One module parameter to disable the hotkeys is dropped, as we only ever took one codepath anyway.
--- drivers/misc/fujitsu-laptop.c | 114 ++++++++--------------------------------- 1 files changed, 21 insertions(+), 93 deletions(-)
drivers/misc/fujitsu-laptop.c +21 -93
@@ -155,7 +155,6 @@ struct fujitsu_t {static struct fujitsu_t *fujitsu;static int use_alt_lcd_levels =-1 ; -static int disable_brightness_keys =-1 ;static int disable_brightness_adjust =-1 ;/* Device used to access other hotkeys on the laptop */
@@ -413,36 +412,11 @@ static int get_max_brightness(void)return fujitsu->max_brightness; } -static int get_lcd_level_alt (void ) -{ -unsigned long long state =0 ; -acpi_status status =AE_OK ; - -vdbg_printk (FUJLAPTOP_DBG_TRACE ,"get lcd level via GBLS\n" ); - - status = -acpi_evaluate_integer (fujitsu->acpi_handle,"GBLS" ,NULL , &state); -if (status <0 ) -return status; - - fujitsu->brightness_level = state &0x0fffffff ; - -if (state &0x80000000 ) - fujitsu->brightness_changed =1 ; -else - fujitsu->brightness_changed =0 ; - -return fujitsu->brightness_level; -} -/* Backlight device stuff */ static int bl_get_brightness (struct backlight_device *b) { -if (use_alt_lcd_levels) -return get_lcd_level_alt (); -else -return get_lcd_level (); +return get_lcd_level (); }static int bl_update_status (struct backlight_device *b)
@@ -509,10 +483,7 @@ static ssize_t show_lcd_level(struct device *dev,int ret; -if (use_alt_lcd_levels) - ret =get_lcd_level_alt (); -else - ret =get_lcd_level (); + ret =get_lcd_level ();if (ret <0 )return ret;
@@ -537,10 +508,7 @@ static ssize_t store_lcd_level(struct device *dev,if (ret <0 )return ret; -if (use_alt_lcd_levels) - ret =get_lcd_level_alt (); -else - ret =get_lcd_level (); + ret =get_lcd_level ();if (ret <0 )return ret;
@@ -622,24 +590,16 @@ static struct platform_driver fujitsupf_driver = {static void dmi_check_cb_common (const struct dmi_system_id *id) {acpi_handle handle; -int have_blnf;printk (KERN_INFO "fujitsu-laptop: Identified laptop model '%s'.\n" , id->ident); - have_blnf =ACPI_SUCCESS - (acpi_get_handle (NULL ,"\\_SB.PCI0.GFX0.LCD.BLNF" , &handle));if (use_alt_lcd_levels ==-1 ) { -vdbg_printk (FUJLAPTOP_DBG_TRACE ,"auto-detecting usealt\n" ); - use_alt_lcd_levels =1 ; - } -if (disable_brightness_keys ==-1 ) { -vdbg_printk (FUJLAPTOP_DBG_TRACE , -"auto-detecting disable_keys\n" ); - disable_brightness_keys = have_blnf ?1 :0 ; - } -if (disable_brightness_adjust ==-1 ) { -vdbg_printk (FUJLAPTOP_DBG_TRACE , -"auto-detecting disable_adjust\n" ); - disable_brightness_adjust = have_blnf ?0 :1 ; +if (ACPI_SUCCESS (acpi_get_handle (NULL , +"\\_SB.PCI0.LPCB.FJEX.SBL2" , &handle))) + use_alt_lcd_levels =1 ; +else + use_alt_lcd_levels =0 ; +vdbg_printk (FUJLAPTOP_DBG_TRACE ,"auto-detected usealt as " +"%i\n" , use_alt_lcd_levels); } }
@@ -768,19 +728,14 @@ static int acpi_fujitsu_add(struct acpi_device *device)/* do config (detect defaults) */ use_alt_lcd_levels = use_alt_lcd_levels ==1 ?1 :0 ; - disable_brightness_keys = disable_brightness_keys ==1 ?1 :0 ; disable_brightness_adjust = disable_brightness_adjust ==1 ?1 :0 ;vdbg_printk (FUJLAPTOP_DBG_INFO , -"config: [alt interface: %d], [key disable: %d], [adjust disable: %d]\n" , - use_alt_lcd_levels, disable_brightness_keys, - disable_brightness_adjust); +"config: [alt interface: %d], [adjust disable: %d]\n" , + use_alt_lcd_levels, disable_brightness_adjust);if (get_max_brightness () <=0 ) fujitsu->max_brightness =FUJITSU_LCD_N_LEVELS ; -if (use_alt_lcd_levels) -get_lcd_level_alt (); -else -get_lcd_level (); +get_lcd_level ();return result;
@@ -831,43 +786,23 @@ static void acpi_fujitsu_notify(acpi_handle handle, u32 event, void *data)case ACPI_FUJITSU_NOTIFY_CODE1 : keycode =0 ; oldb = fujitsu->brightness_level; -get_lcd_level ();/* the alt version always yields changed */ +get_lcd_level (); newb = fujitsu->brightness_level;vdbg_printk (FUJLAPTOP_DBG_TRACE ,"brightness button event [%i -> %i (%i)]\n" , oldb, newb, fujitsu->brightness_changed); -if (oldb == newb && fujitsu->brightness_changed) { - keycode =0 ; -if (disable_brightness_keys !=1 ) { -if (oldb ==0 ) { -acpi_bus_generate_proc_event - (fujitsu->dev, -ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS , -0 ); - keycode =KEY_BRIGHTNESSDOWN ; - }else if (oldb == - (fujitsu->max_brightness) -1 ) { -acpi_bus_generate_proc_event - (fujitsu->dev, -ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS , -0 ); - keycode =KEY_BRIGHTNESSUP ; - } - } - }else if (oldb < newb) { +if (oldb < newb) {if (disable_brightness_adjust !=1 ) {if (use_alt_lcd_levels)set_lcd_level_alt (newb);else set_lcd_level (newb); } -if (disable_brightness_keys !=1 ) { -acpi_bus_generate_proc_event (fujitsu->dev, -ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS ,0 ); - keycode =KEY_BRIGHTNESSUP ; - } +acpi_bus_generate_proc_event (fujitsu->dev, +ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS ,0 ); + keycode =KEY_BRIGHTNESSUP ; }else if (oldb > newb) {if (disable_brightness_adjust !=1 ) {if (use_alt_lcd_levels)
@@ -875,13 +810,9 @@ static void acpi_fujitsu_notify(acpi_handle handle, u32 event, void *data)else set_lcd_level (newb); } -if (disable_brightness_keys !=1 ) { -acpi_bus_generate_proc_event (fujitsu->dev, -ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS ,0 ); - keycode =KEY_BRIGHTNESSDOWN ; - } - }else { - keycode =KEY_UNKNOWN ; +acpi_bus_generate_proc_event (fujitsu->dev, +ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS ,0 ); + keycode =KEY_BRIGHTNESSDOWN ; }break ;default :
@@ -1336,9 +1267,6 @@ module_exit(fujitsu_cleanup);module_param (use_alt_lcd_levels, uint,0644 );MODULE_PARM_DESC (use_alt_lcd_levels,"Use alternative interface for lcd_levels (needed for Lifebook s6410)." ); -module_param (disable_brightness_keys, uint,0644 ); -MODULE_PARM_DESC (disable_brightness_keys, -"Disable brightness keys (eg. if they are already handled by the generic ACPI_VIDEO device)." );module_param (disable_brightness_adjust, uint,0644 );MODULE_PARM_DESC (disable_brightness_adjust,"Disable brightness adjustment ." );#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 90/94 ACPI: Avoid array address overflow when _CST MWAIT hint bits are set
In reply to Len BrownFrom: Zhao Yakui <[email protected]>
The Cx Register address obtained from the _CST object is used as the MWAIT hints if the register type is FFixedHW. And it is used to check whether the Cx type is supported or not.
On some boxes the following Cx state package is obtained from _CST object:
Quoted 1 line
{
ResourceTemplate ()
{
Register (FFixedHW,
0x01, // Bit Width
0x02, // Bit Offset
0x0000000000889759, // Address
0x03, // Access Size
)
},
0x03,
0xF5,
0x015E } In such case we should use the bit[7:4] of Cx address to check whether
the Cx type is supported or not.
mask the MWAIT hint to avoid array address overflow
--- arch/x86/kernel/acpi/cstate.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/x86/kernel/acpi/cstate.c +3 -1
@@ -56,6 +56,7 @@ static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */static short mwait_supported[ACPI_PROCESSOR_MAX_POWER ];#define MWAIT_SUBSTATE_MASK (0xf) +#define MWAIT_CSTATE_MASK (0xf)#define MWAIT_SUBSTATE_SIZE (4)#define CPUID_MWAIT_LEAF (5)
@@ -98,7 +99,8 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,cpuid (CPUID_MWAIT_LEAF , &eax, &ebx, &ecx, &edx);/* Check whether this particular cx_type (in CST) is supported or not */ - cstate_type = (cx->address >>MWAIT_SUBSTATE_SIZE ) +1 ; + cstate_type = ((cx->address >>MWAIT_SUBSTATE_SIZE ) & +MWAIT_CSTATE_MASK ) +1 ; edx_part = edx >> (cstate_type *MWAIT_SUBSTATE_SIZE ); num_cstate_subtype = edx_part &MWAIT_SUBSTATE_MASK ;
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 91/94 ACPI : Use RSDT instead of XSDT by adding boot option of "acpi=rsdt"
In reply to Len BrownFrom: Zhao Yakui <[email protected]>
On some boxes there exist both RSDT and XSDT table. But unfortunately sometimes there exists the following error when XSDT table is used:
a. 32/64X address mismatch
b. The 32/64X FACS address mismatch
In such case the boot option of "acpi=rsdt" is provided so that
RSDT is tried instead of XSDT table when the system can't work well.
http://bugzilla.kernel.org/show_bug.cgi?id=8246
--- Documentation/kernel-parameters.txt | 1 + arch/ia64/kernel/acpi.c | 1 + arch/x86/kernel/acpi/boot.c | 6 +++++- drivers/acpi/tables/tbutils.c | 3 ++- include/acpi/acpixf.h | 1 + 5 files changed, 10 insertions(+), 2 deletions(-)
Documentation/kernel-parameters.txt +1 -0
@@ -139,6 +139,7 @@ and is between 256 and 4096 characters. It is defined in the file ht -- run only enough ACPI to enable Hyper Threading strict -- Be less tolerant of platforms that are not strictly ACPI specification compliant. + rsdt -- prefer RSDT over (default) XSDT See also Documentation/power/pm.txt, pci=noacpi
arch/ia64/kernel/acpi.c +1 -0
@@ -65,6 +65,7 @@ EXPORT_SYMBOL(pm_idle);void (*pm_power_off) (void );EXPORT_SYMBOL (pm_power_off); +u32 acpi_rsdt_forced;unsigned int acpi_cpei_override;unsigned int acpi_cpei_phys_cpuid;
arch/x86/kernel/acpi/boot.c +5 -1
@@ -47,7 +47,7 @@#endif static int __initdata acpi_force =0 ; - +u32 acpi_rsdt_forced;#ifdef CONFIG_ACPI int acpi_disabled =0 ;#else
@@ -1783,6 +1783,10 @@ static int __init parse_acpi(char *arg)disable_acpi (); acpi_ht =1 ; } +/* acpi=rsdt use RSDT instead of XSDT */ +else if (strcmp (arg,"rsdt" ) ==0 ) { + acpi_rsdt_forced =1 ; + }/* "acpi=noirq" disables ACPI interrupt routing */ else if (strcmp (arg,"noirq" ) ==0 ) {acpi_noirq_set ();
drivers/acpi/tables/tbutils.c +2 -1
@@ -420,7 +420,8 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)/* Differentiate between RSDT and XSDT root tables */ -if (rsdp->revision >1 && rsdp->xsdt_physical_address) { +if (rsdp->revision >1 && rsdp->xsdt_physical_address + && !acpi_rsdt_forced) {/* * Root table is an XSDT (64-bit physical addresses). We must use the * XSDT if the revision is > 1 and the XSDT pointer is present, as per
include/acpi/acpixf.h +1 -0
@@ -48,6 +48,7 @@#include "actypes.h" #include "actbl.h" +extern u32 acpi_rsdt_forced;/* * Global interfaces */
Signature · 1 line
1.5.6.6
Len Brown
reviewerPATCH 92/94 ACPI: fix build warning
In reply to Len BrownFrom: Len Brown <[email protected]>
when CONFIG_RTC_DRV_CMOS=m
and thus !defined(HAVE_ACPI_LEGACY_ALARM)
drivers/acpi/proc.c:85: warning: ‘cmos_bcd_read’ declared ‘static’ but never defined
--- drivers/acpi/sleep/proc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/sleep/proc.c +2 -2
@@ -84,10 +84,10 @@ acpi_system_write_sleep(struct file *file,#define HAVE_ACPI_LEGACY_ALARM #endif -static u32 cmos_bcd_read (int offset,int rtc_control); -#ifdef HAVE_ACPI_LEGACY_ALARM +static u32 cmos_bcd_read (int offset,int rtc_control); +static int acpi_system_alarm_seq_show (struct seq_file *seq,void *offset) {u32 sec, min, hr;
Signature · 6 lines
1.5.6.6 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Len Brown
reviewerPATCH 93/94 ACPICA: create acpica/ directory
In reply to Len BrownFrom: Len Brown <[email protected]>
also, delete sleep/ and delete ACPI_CFLAGS from Makefile
---
drivers/acpi/Makefile | 22 +++++-------
drivers/acpi/acpica/Makefile | 44 ++++++++++++++++++++++++
drivers/acpi/{dispatcher => acpica}/dsfield.c | 0
drivers/acpi/{dispatcher => acpica}/dsinit.c | 0
drivers/acpi/{dispatcher => acpica}/dsmethod.c | 0
drivers/acpi/{dispatcher => acpica}/dsmthdat.c | 0
drivers/acpi/{dispatcher => acpica}/dsobject.c | 0
drivers/acpi/{dispatcher => acpica}/dsopcode.c | 0
drivers/acpi/{dispatcher => acpica}/dsutils.c | 0
drivers/acpi/{dispatcher => acpica}/dswexec.c | 0
drivers/acpi/{dispatcher => acpica}/dswload.c | 0
drivers/acpi/{dispatcher => acpica}/dswscope.c | 0
drivers/acpi/{dispatcher => acpica}/dswstate.c | 0
drivers/acpi/{events => acpica}/evevent.c | 0
drivers/acpi/{events => acpica}/evgpe.c | 0
drivers/acpi/{events => acpica}/evgpeblk.c | 0
drivers/acpi/{events => acpica}/evmisc.c | 0
drivers/acpi/{events => acpica}/evregion.c | 0
drivers/acpi/{events => acpica}/evrgnini.c | 0
drivers/acpi/{events => acpica}/evsci.c | 0
drivers/acpi/{events => acpica}/evxface.c | 0
drivers/acpi/{events => acpica}/evxfevnt.c | 0
drivers/acpi/{events => acpica}/evxfregn.c | 0
drivers/acpi/{executer => acpica}/exconfig.c | 0
drivers/acpi/{executer => acpica}/exconvrt.c | 0
drivers/acpi/{executer => acpica}/excreate.c | 0
drivers/acpi/{executer => acpica}/exdump.c | 0
drivers/acpi/{executer => acpica}/exfield.c | 0
drivers/acpi/{executer => acpica}/exfldio.c | 0
drivers/acpi/{executer => acpica}/exmisc.c | 0
drivers/acpi/{executer => acpica}/exmutex.c | 0
drivers/acpi/{executer => acpica}/exnames.c | 0
drivers/acpi/{executer => acpica}/exoparg1.c | 0
drivers/acpi/{executer => acpica}/exoparg2.c | 0
drivers/acpi/{executer => acpica}/exoparg3.c | 0
drivers/acpi/{executer => acpica}/exoparg6.c | 0
drivers/acpi/{executer => acpica}/exprep.c | 0
drivers/acpi/{executer => acpica}/exregion.c | 0
drivers/acpi/{executer => acpica}/exresnte.c | 0
drivers/acpi/{executer => acpica}/exresolv.c | 0
drivers/acpi/{executer => acpica}/exresop.c | 0
drivers/acpi/{executer => acpica}/exstore.c | 0
drivers/acpi/{executer => acpica}/exstoren.c | 0
drivers/acpi/{executer => acpica}/exstorob.c | 0
drivers/acpi/{executer => acpica}/exsystem.c | 0
drivers/acpi/{executer => acpica}/exutils.c | 0
drivers/acpi/{hardware => acpica}/hwacpi.c | 0
drivers/acpi/{hardware => acpica}/hwgpe.c | 0
drivers/acpi/{hardware => acpica}/hwregs.c | 0
drivers/acpi/{hardware => acpica}/hwsleep.c | 0
drivers/acpi/{hardware => acpica}/hwtimer.c | 0
drivers/acpi/{hardware => acpica}/hwxface.c | 0
drivers/acpi/{namespace => acpica}/nsaccess.c | 0
drivers/acpi/{namespace => acpica}/nsalloc.c | 0
drivers/acpi/{namespace => acpica}/nsdump.c | 0
drivers/acpi/{namespace => acpica}/nsdumpdv.c | 0
drivers/acpi/{namespace => acpica}/nseval.c | 0
drivers/acpi/{namespace => acpica}/nsinit.c | 0
drivers/acpi/{namespace => acpica}/nsload.c | 0
drivers/acpi/{namespace => acpica}/nsnames.c | 0
drivers/acpi/{namespace => acpica}/nsobject.c | 0
drivers/acpi/{namespace => acpica}/nsparse.c | 0
drivers/acpi/{namespace => acpica}/nspredef.c | 0
drivers/acpi/{namespace => acpica}/nssearch.c | 0
drivers/acpi/{namespace => acpica}/nsutils.c | 0
drivers/acpi/{namespace => acpica}/nswalk.c | 0
drivers/acpi/{namespace => acpica}/nsxfeval.c | 0
drivers/acpi/{namespace => acpica}/nsxfname.c | 0
drivers/acpi/{namespace => acpica}/nsxfobj.c | 0
drivers/acpi/{parser => acpica}/psargs.c | 0
drivers/acpi/{parser => acpica}/psloop.c | 0
drivers/acpi/{parser => acpica}/psopcode.c | 0
drivers/acpi/{parser => acpica}/psparse.c | 0
drivers/acpi/{parser => acpica}/psscope.c | 0
drivers/acpi/{parser => acpica}/pstree.c | 0
drivers/acpi/{parser => acpica}/psutils.c | 0
drivers/acpi/{parser => acpica}/pswalk.c | 0
drivers/acpi/{parser => acpica}/psxface.c | 0
drivers/acpi/{resources => acpica}/rsaddr.c | 0
drivers/acpi/{resources => acpica}/rscalc.c | 0
drivers/acpi/{resources => acpica}/rscreate.c | 0
drivers/acpi/{resources => acpica}/rsdump.c | 0
drivers/acpi/{resources => acpica}/rsinfo.c | 0
drivers/acpi/{resources => acpica}/rsio.c | 0
drivers/acpi/{resources => acpica}/rsirq.c | 0
drivers/acpi/{resources => acpica}/rslist.c | 0
drivers/acpi/{resources => acpica}/rsmemory.c | 0
drivers/acpi/{resources => acpica}/rsmisc.c | 0
drivers/acpi/{resources => acpica}/rsutils.c | 0
drivers/acpi/{resources => acpica}/rsxface.c | 0
drivers/acpi/{tables => acpica}/tbfadt.c | 0
drivers/acpi/{tables => acpica}/tbfind.c | 0
drivers/acpi/{tables => acpica}/tbinstal.c | 0
drivers/acpi/{tables => acpica}/tbutils.c | 0
drivers/acpi/{tables => acpica}/tbxface.c | 0
drivers/acpi/{tables => acpica}/tbxfroot.c | 0
drivers/acpi/{utilities => acpica}/utalloc.c | 0
drivers/acpi/{utilities => acpica}/utcopy.c | 0
drivers/acpi/{utilities => acpica}/utdebug.c | 0
drivers/acpi/{utilities => acpica}/utdelete.c | 0
drivers/acpi/{utilities => acpica}/uteval.c | 0
drivers/acpi/{utilities => acpica}/utglobal.c | 0
drivers/acpi/{utilities => acpica}/utinit.c | 0
drivers/acpi/{utilities => acpica}/utmath.c | 0
drivers/acpi/{utilities => acpica}/utmisc.c | 0
drivers/acpi/{utilities => acpica}/utmutex.c | 0
drivers/acpi/{utilities => acpica}/utobject.c | 0
drivers/acpi/{utilities => acpica}/utresrc.c | 0
drivers/acpi/{utilities => acpica}/utstate.c | 0
drivers/acpi/{utilities => acpica}/utxface.c | 0
drivers/acpi/dispatcher/Makefile | 9 -----
drivers/acpi/events/Makefile | 9 -----
drivers/acpi/executer/Makefile | 10 -----
drivers/acpi/hardware/Makefile | 9 -----
drivers/acpi/{sleep => }/main.c | 0
drivers/acpi/namespace/Makefile | 12 ------
drivers/acpi/parser/Makefile | 8 ----
drivers/acpi/{sleep => }/proc.c | 0
drivers/acpi/resources/Makefile | 10 -----
drivers/acpi/{sleep => }/sleep.h | 0
drivers/acpi/sleep/Makefile | 5 ---
drivers/acpi/tables/Makefile | 7 ----
drivers/acpi/utilities/Makefile | 9 -----
drivers/acpi/{sleep => }/wakeup.c | 0
124 files changed, 53 insertions(+), 101 deletions(-)
create mode 100644 drivers/acpi/acpica/Makefile
rename drivers/acpi/{dispatcher => acpica}/dsfield.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dsinit.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dsmethod.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dsmthdat.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dsobject.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dsopcode.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dsutils.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dswexec.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dswload.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dswscope.c (100%)
rename drivers/acpi/{dispatcher => acpica}/dswstate.c (100%)
rename drivers/acpi/{events => acpica}/evevent.c (100%)
rename drivers/acpi/{events => acpica}/evgpe.c (100%)
rename drivers/acpi/{events => acpica}/evgpeblk.c (100%)
rename drivers/acpi/{events => acpica}/evmisc.c (100%)
rename drivers/acpi/{events => acpica}/evregion.c (100%)
rename drivers/acpi/{events => acpica}/evrgnini.c (100%)
rename drivers/acpi/{events => acpica}/evsci.c (100%)
rename drivers/acpi/{events => acpica}/evxface.c (100%)
rename drivers/acpi/{events => acpica}/evxfevnt.c (100%)
rename drivers/acpi/{events => acpica}/evxfregn.c (100%)
rename drivers/acpi/{executer => acpica}/exconfig.c (100%)
rename drivers/acpi/{executer => acpica}/exconvrt.c (100%)
rename drivers/acpi/{executer => acpica}/excreate.c (100%)
rename drivers/acpi/{executer => acpica}/exdump.c (100%)
rename drivers/acpi/{executer => acpica}/exfield.c (100%)
rename drivers/acpi/{executer => acpica}/exfldio.c (100%)
rename drivers/acpi/{executer => acpica}/exmisc.c (100%)
rename drivers/acpi/{executer => acpica}/exmutex.c (100%)
rename drivers/acpi/{executer => acpica}/exnames.c (100%)
rename drivers/acpi/{executer => acpica}/exoparg1.c (100%)
rename drivers/acpi/{executer => acpica}/exoparg2.c (100%)
rename drivers/acpi/{executer => acpica}/exoparg3.c (100%)
rename drivers/acpi/{executer => acpica}/exoparg6.c (100%)
rename drivers/acpi/{executer => acpica}/exprep.c (100%)
rename drivers/acpi/{executer => acpica}/exregion.c (100%)
rename drivers/acpi/{executer => acpica}/exresnte.c (100%)
rename drivers/acpi/{executer => acpica}/exresolv.c (100%)
rename drivers/acpi/{executer => acpica}/exresop.c (100%)
rename drivers/acpi/{executer => acpica}/exstore.c (100%)
rename drivers/acpi/{executer => acpica}/exstoren.c (100%)
rename drivers/acpi/{executer => acpica}/exstorob.c (100%)
rename drivers/acpi/{executer => acpica}/exsystem.c (100%)
rename drivers/acpi/{executer => acpica}/exutils.c (100%)
rename drivers/acpi/{hardware => acpica}/hwacpi.c (100%)
rename drivers/acpi/{hardware => acpica}/hwgpe.c (100%)
rename drivers/acpi/{hardware => acpica}/hwregs.c (100%)
rename drivers/acpi/{hardware => acpica}/hwsleep.c (100%)
rename drivers/acpi/{hardware => acpica}/hwtimer.c (100%)
rename drivers/acpi/{hardware => acpica}/hwxface.c (100%)
rename drivers/acpi/{namespace => acpica}/nsaccess.c (100%)
rename drivers/acpi/{namespace => acpica}/nsalloc.c (100%)
rename drivers/acpi/{namespace => acpica}/nsdump.c (100%)
rename drivers/acpi/{namespace => acpica}/nsdumpdv.c (100%)
rename drivers/acpi/{namespace => acpica}/nseval.c (100%)
rename drivers/acpi/{namespace => acpica}/nsinit.c (100%)
rename drivers/acpi/{namespace => acpica}/nsload.c (100%)
rename drivers/acpi/{namespace => acpica}/nsnames.c (100%)
rename drivers/acpi/{namespace => acpica}/nsobject.c (100%)
rename drivers/acpi/{namespace => acpica}/nsparse.c (100%)
rename drivers/acpi/{namespace => acpica}/nspredef.c (100%)
rename drivers/acpi/{namespace => acpica}/nssearch.c (100%)
rename drivers/acpi/{namespace => acpica}/nsutils.c (100%)
rename drivers/acpi/{namespace => acpica}/nswalk.c (100%)
rename drivers/acpi/{namespace => acpica}/nsxfeval.c (100%)
rename drivers/acpi/{namespace => acpica}/nsxfname.c (100%)
rename drivers/acpi/{namespace => acpica}/nsxfobj.c (100%)
rename drivers/acpi/{parser => acpica}/psargs.c (100%)
rename drivers/acpi/{parser => acpica}/psloop.c (100%)
rename drivers/acpi/{parser => acpica}/psopcode.c (100%)
rename drivers/acpi/{parser => acpica}/psparse.c (100%)
rename drivers/acpi/{parser => acpica}/psscope.c (100%)
rename drivers/acpi/{parser => acpica}/pstree.c (100%)
rename drivers/acpi/{parser => acpica}/psutils.c (100%)
rename drivers/acpi/{parser => acpica}/pswalk.c (100%)
rename drivers/acpi/{parser => acpica}/psxface.c (100%)
rename drivers/acpi/{resources => acpica}/rsaddr.c (100%)
rename drivers/acpi/{resources => acpica}/rscalc.c (100%)
rename drivers/acpi/{resources => acpica}/rscreate.c (100%)
rename drivers/acpi/{resources => acpica}/rsdump.c (100%)
rename drivers/acpi/{resources => acpica}/rsinfo.c (100%)
rename drivers/acpi/{resources => acpica}/rsio.c (100%)
rename drivers/acpi/{resources => acpica}/rsirq.c (100%)
rename drivers/acpi/{resources => acpica}/rslist.c (100%)
rename drivers/acpi/{resources => acpica}/rsmemory.c (100%)
rename drivers/acpi/{resources => acpica}/rsmisc.c (100%)
rename drivers/acpi/{resources => acpica}/rsutils.c (100%)
rename drivers/acpi/{resources => acpica}/rsxface.c (100%)
rename drivers/acpi/{tables => acpica}/tbfadt.c (100%)
rename drivers/acpi/{tables => acpica}/tbfind.c (100%)
rename drivers/acpi/{tables => acpica}/tbinstal.c (100%)
rename drivers/acpi/{tables => acpica}/tbutils.c (100%)
rename drivers/acpi/{tables => acpica}/tbxface.c (100%)
rename drivers/acpi/{tables => acpica}/tbxfroot.c (100%)
rename drivers/acpi/{utilities => acpica}/utalloc.c (100%)
rename drivers/acpi/{utilities => acpica}/utcopy.c (100%)
rename drivers/acpi/{utilities => acpica}/utdebug.c (100%)
rename drivers/acpi/{utilities => acpica}/utdelete.c (100%)
rename drivers/acpi/{utilities => acpica}/uteval.c (100%)
rename drivers/acpi/{utilities => acpica}/utglobal.c (100%)
rename drivers/acpi/{utilities => acpica}/utinit.c (100%)
rename drivers/acpi/{utilities => acpica}/utmath.c (100%)
rename drivers/acpi/{utilities => acpica}/utmisc.c (100%)
rename drivers/acpi/{utilities => acpica}/utmutex.c (100%)
rename drivers/acpi/{utilities => acpica}/utobject.c (100%)
rename drivers/acpi/{utilities => acpica}/utresrc.c (100%)
rename drivers/acpi/{utilities => acpica}/utstate.c (100%)
rename drivers/acpi/{utilities => acpica}/utxface.c (100%)
delete mode 100644 drivers/acpi/dispatcher/Makefile
delete mode 100644 drivers/acpi/events/Makefile
delete mode 100644 drivers/acpi/executer/Makefile
delete mode 100644 drivers/acpi/hardware/Makefile
rename drivers/acpi/{sleep => }/main.c (100%)
delete mode 100644 drivers/acpi/namespace/Makefile
delete mode 100644 drivers/acpi/parser/Makefile
rename drivers/acpi/{sleep => }/proc.c (100%)
delete mode 100644 drivers/acpi/resources/Makefile
rename drivers/acpi/{sleep => }/sleep.h (100%)
delete mode 100644 drivers/acpi/sleep/Makefile
delete mode 100644 drivers/acpi/tables/Makefile
delete mode 100644 drivers/acpi/utilities/Makefile
rename drivers/acpi/{sleep => }/wakeup.c (100%)drivers/acpi/Makefile +9 -13
@@ -2,15 +2,8 @@ # Makefile for the Linux ACPI interpreter # -export ACPI_CFLAGS - -ACPI_CFLAGS := -Os - -ifdef CONFIG_ACPI_DEBUG - ACPI_CFLAGS += -DACPI_DEBUG_OUTPUT -endif - -EXTRA_CFLAGS += $(ACPI_CFLAGS) +ccflags-y := -Os +ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT # # ACPI Boot-Time Table Parsing
@@ -22,9 +15,13 @@ obj-$(CONFIG_X86) += blacklist.o # ACPI Core Subsystem (Interpreter) # obj-y += osl.o utils.o reboot.o\ - dispatcher/ events/ executer/ hardware/ \ - namespace/ parser/ resources/ tables/ \ - utilities/ + acpica/ + +# sleep related files +obj-y += wakeup.o +obj-y += main.o +obj-$(CONFIG_ACPI_SLEEP) += proc.o + # # ACPI Bus and Device Drivers
@@ -35,7 +32,6 @@ ifdef CONFIG_CPU_FREQ processor-objs += processor_perflib.o endif -obj-y += sleep/ obj-y += bus.o glue.o obj-y += scan.o # Keep EC driver first. Initialization of others depend on it.
drivers/acpi/acpica/Makefile new file +44 -0
44 lines not on this page · raw message
drivers/acpi/acpica/dsfield.c renamed from drivers/acpi/dispatcher/dsfield.c +0 -0
drivers/acpi/acpica/dsinit.c renamed from drivers/acpi/dispatcher/dsinit.c +0 -0
drivers/acpi/acpica/dsmethod.c renamed from drivers/acpi/dispatcher/dsmethod.c +0 -0
drivers/acpi/acpica/dsmthdat.c renamed from drivers/acpi/dispatcher/dsmthdat.c +0 -0
drivers/acpi/acpica/dsobject.c renamed from drivers/acpi/dispatcher/dsobject.c +0 -0
drivers/acpi/acpica/dsopcode.c renamed from drivers/acpi/dispatcher/dsopcode.c +0 -0
drivers/acpi/acpica/dsutils.c renamed from drivers/acpi/dispatcher/dsutils.c +0 -0
drivers/acpi/acpica/dswexec.c renamed from drivers/acpi/dispatcher/dswexec.c +0 -0
drivers/acpi/acpica/dswload.c renamed from drivers/acpi/dispatcher/dswload.c +0 -0
drivers/acpi/acpica/dswscope.c renamed from drivers/acpi/dispatcher/dswscope.c +0 -0
drivers/acpi/acpica/dswstate.c renamed from drivers/acpi/dispatcher/dswstate.c +0 -0
drivers/acpi/acpica/evevent.c renamed from drivers/acpi/events/evevent.c +0 -0
drivers/acpi/acpica/evgpe.c renamed from drivers/acpi/events/evgpe.c +0 -0
drivers/acpi/acpica/evgpeblk.c renamed from drivers/acpi/events/evgpeblk.c +0 -0
drivers/acpi/acpica/evmisc.c renamed from drivers/acpi/events/evmisc.c +0 -0
drivers/acpi/acpica/evregion.c renamed from drivers/acpi/events/evregion.c +0 -0
drivers/acpi/acpica/evrgnini.c renamed from drivers/acpi/events/evrgnini.c +0 -0
drivers/acpi/acpica/evsci.c renamed from drivers/acpi/events/evsci.c +0 -0
drivers/acpi/acpica/evxface.c renamed from drivers/acpi/events/evxface.c +0 -0
drivers/acpi/acpica/evxfevnt.c renamed from drivers/acpi/events/evxfevnt.c +0 -0
drivers/acpi/acpica/evxfregn.c renamed from drivers/acpi/events/evxfregn.c +0 -0
drivers/acpi/acpica/exconfig.c renamed from drivers/acpi/executer/exconfig.c +0 -0
drivers/acpi/acpica/exconvrt.c renamed from drivers/acpi/executer/exconvrt.c +0 -0
drivers/acpi/acpica/excreate.c renamed from drivers/acpi/executer/excreate.c +0 -0
drivers/acpi/acpica/exdump.c renamed from drivers/acpi/executer/exdump.c +0 -0
drivers/acpi/acpica/exfield.c renamed from drivers/acpi/executer/exfield.c +0 -0
drivers/acpi/acpica/exfldio.c renamed from drivers/acpi/executer/exfldio.c +0 -0
drivers/acpi/acpica/exmisc.c renamed from drivers/acpi/executer/exmisc.c +0 -0
drivers/acpi/acpica/exmutex.c renamed from drivers/acpi/executer/exmutex.c +0 -0
drivers/acpi/acpica/exnames.c renamed from drivers/acpi/executer/exnames.c +0 -0
drivers/acpi/acpica/exoparg1.c renamed from drivers/acpi/executer/exoparg1.c +0 -0
drivers/acpi/acpica/exoparg2.c renamed from drivers/acpi/executer/exoparg2.c +0 -0
drivers/acpi/acpica/exoparg3.c renamed from drivers/acpi/executer/exoparg3.c +0 -0
drivers/acpi/acpica/exoparg6.c renamed from drivers/acpi/executer/exoparg6.c +0 -0
drivers/acpi/acpica/exprep.c renamed from drivers/acpi/executer/exprep.c +0 -0
drivers/acpi/acpica/exregion.c renamed from drivers/acpi/executer/exregion.c +0 -0
drivers/acpi/acpica/exresnte.c renamed from drivers/acpi/executer/exresnte.c +0 -0
drivers/acpi/acpica/exresolv.c renamed from drivers/acpi/executer/exresolv.c +0 -0
drivers/acpi/acpica/exresop.c renamed from drivers/acpi/executer/exresop.c +0 -0
drivers/acpi/acpica/exstore.c renamed from drivers/acpi/executer/exstore.c +0 -0
drivers/acpi/acpica/exstoren.c renamed from drivers/acpi/executer/exstoren.c +0 -0
drivers/acpi/acpica/exstorob.c renamed from drivers/acpi/executer/exstorob.c +0 -0
drivers/acpi/acpica/exsystem.c renamed from drivers/acpi/executer/exsystem.c +0 -0
drivers/acpi/acpica/exutils.c renamed from drivers/acpi/executer/exutils.c +0 -0
drivers/acpi/acpica/hwacpi.c renamed from drivers/acpi/hardware/hwacpi.c +0 -0
drivers/acpi/acpica/hwgpe.c renamed from drivers/acpi/hardware/hwgpe.c +0 -0
drivers/acpi/acpica/hwregs.c renamed from drivers/acpi/hardware/hwregs.c +0 -0
drivers/acpi/acpica/hwsleep.c renamed from drivers/acpi/hardware/hwsleep.c +0 -0
drivers/acpi/acpica/hwtimer.c renamed from drivers/acpi/hardware/hwtimer.c +0 -0
drivers/acpi/acpica/hwxface.c renamed from drivers/acpi/hardware/hwxface.c +0 -0
drivers/acpi/acpica/nsaccess.c renamed from drivers/acpi/namespace/nsaccess.c +0 -0
drivers/acpi/acpica/nsalloc.c renamed from drivers/acpi/namespace/nsalloc.c +0 -0
drivers/acpi/acpica/nsdump.c renamed from drivers/acpi/namespace/nsdump.c +0 -0
drivers/acpi/acpica/nsdumpdv.c renamed from drivers/acpi/namespace/nsdumpdv.c +0 -0
drivers/acpi/acpica/nseval.c renamed from drivers/acpi/namespace/nseval.c +0 -0
drivers/acpi/acpica/nsinit.c renamed from drivers/acpi/namespace/nsinit.c +0 -0
drivers/acpi/acpica/nsload.c renamed from drivers/acpi/namespace/nsload.c +0 -0
drivers/acpi/acpica/nsnames.c renamed from drivers/acpi/namespace/nsnames.c +0 -0
drivers/acpi/acpica/nsobject.c renamed from drivers/acpi/namespace/nsobject.c +0 -0
drivers/acpi/acpica/nsparse.c renamed from drivers/acpi/namespace/nsparse.c +0 -0
drivers/acpi/acpica/nspredef.c renamed from drivers/acpi/namespace/nspredef.c +0 -0
drivers/acpi/acpica/nssearch.c renamed from drivers/acpi/namespace/nssearch.c +0 -0
drivers/acpi/acpica/nsutils.c renamed from drivers/acpi/namespace/nsutils.c +0 -0
drivers/acpi/acpica/nswalk.c renamed from drivers/acpi/namespace/nswalk.c +0 -0
drivers/acpi/acpica/nsxfeval.c renamed from drivers/acpi/namespace/nsxfeval.c +0 -0
drivers/acpi/acpica/nsxfname.c renamed from drivers/acpi/namespace/nsxfname.c +0 -0
drivers/acpi/acpica/nsxfobj.c renamed from drivers/acpi/namespace/nsxfobj.c +0 -0
drivers/acpi/acpica/psargs.c renamed from drivers/acpi/parser/psargs.c +0 -0
drivers/acpi/acpica/psloop.c renamed from drivers/acpi/parser/psloop.c +0 -0
drivers/acpi/acpica/psopcode.c renamed from drivers/acpi/parser/psopcode.c +0 -0
drivers/acpi/acpica/psparse.c renamed from drivers/acpi/parser/psparse.c +0 -0
drivers/acpi/acpica/psscope.c renamed from drivers/acpi/parser/psscope.c +0 -0
drivers/acpi/acpica/pstree.c renamed from drivers/acpi/parser/pstree.c +0 -0
drivers/acpi/acpica/psutils.c renamed from drivers/acpi/parser/psutils.c +0 -0
drivers/acpi/acpica/pswalk.c renamed from drivers/acpi/parser/pswalk.c +0 -0
drivers/acpi/acpica/psxface.c renamed from drivers/acpi/parser/psxface.c +0 -0
drivers/acpi/acpica/rsaddr.c renamed from drivers/acpi/resources/rsaddr.c +0 -0
drivers/acpi/acpica/rscalc.c renamed from drivers/acpi/resources/rscalc.c +0 -0
drivers/acpi/acpica/rscreate.c renamed from drivers/acpi/resources/rscreate.c +0 -0
drivers/acpi/acpica/rsdump.c renamed from drivers/acpi/resources/rsdump.c +0 -0
drivers/acpi/acpica/rsinfo.c renamed from drivers/acpi/resources/rsinfo.c +0 -0
drivers/acpi/acpica/rsio.c renamed from drivers/acpi/resources/rsio.c +0 -0
drivers/acpi/acpica/rsirq.c renamed from drivers/acpi/resources/rsirq.c +0 -0
drivers/acpi/acpica/rslist.c renamed from drivers/acpi/resources/rslist.c +0 -0
drivers/acpi/acpica/rsmemory.c renamed from drivers/acpi/resources/rsmemory.c +0 -0
drivers/acpi/acpica/rsmisc.c renamed from drivers/acpi/resources/rsmisc.c +0 -0
drivers/acpi/acpica/rsutils.c renamed from drivers/acpi/resources/rsutils.c +0 -0
drivers/acpi/acpica/rsxface.c renamed from drivers/acpi/resources/rsxface.c +0 -0
drivers/acpi/acpica/tbfadt.c renamed from drivers/acpi/tables/tbfadt.c +0 -0
drivers/acpi/acpica/tbfind.c renamed from drivers/acpi/tables/tbfind.c +0 -0
drivers/acpi/acpica/tbinstal.c renamed from drivers/acpi/tables/tbinstal.c +0 -0
drivers/acpi/acpica/tbutils.c renamed from drivers/acpi/tables/tbutils.c +0 -0
drivers/acpi/acpica/tbxface.c renamed from drivers/acpi/tables/tbxface.c +0 -0
drivers/acpi/acpica/tbxfroot.c renamed from drivers/acpi/tables/tbxfroot.c +0 -0
drivers/acpi/acpica/utalloc.c renamed from drivers/acpi/utilities/utalloc.c +0 -0
drivers/acpi/acpica/utcopy.c renamed from drivers/acpi/utilities/utcopy.c +0 -0
drivers/acpi/acpica/utdebug.c renamed from drivers/acpi/utilities/utdebug.c +0 -0
drivers/acpi/acpica/utdelete.c renamed from drivers/acpi/utilities/utdelete.c +0 -0
drivers/acpi/acpica/uteval.c renamed from drivers/acpi/utilities/uteval.c +0 -0
drivers/acpi/acpica/utglobal.c renamed from drivers/acpi/utilities/utglobal.c +0 -0
drivers/acpi/acpica/utinit.c renamed from drivers/acpi/utilities/utinit.c +0 -0
drivers/acpi/acpica/utmath.c renamed from drivers/acpi/utilities/utmath.c +0 -0
drivers/acpi/acpica/utmisc.c renamed from drivers/acpi/utilities/utmisc.c +0 -0
drivers/acpi/acpica/utmutex.c renamed from drivers/acpi/utilities/utmutex.c +0 -0
drivers/acpi/acpica/utobject.c renamed from drivers/acpi/utilities/utobject.c +0 -0
drivers/acpi/acpica/utresrc.c renamed from drivers/acpi/utilities/utresrc.c +0 -0
drivers/acpi/acpica/utstate.c renamed from drivers/acpi/utilities/utstate.c +0 -0
drivers/acpi/acpica/utxface.c renamed from drivers/acpi/utilities/utxface.c +0 -0
drivers/acpi/dispatcher/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \ - dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \ - dsinit.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/events/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := evevent.o evregion.o evsci.o evxfevnt.o \ - evmisc.o evrgnini.o evxface.o evxfregn.o \ - evgpe.o evgpeblk.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/executer/Makefile deleted +0 -10
@@ -1,10 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\ - exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\ - excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \ - exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/hardware/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o - -obj-$(ACPI_FUTURE_USAGE) += hwtimer.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/main.c renamed from drivers/acpi/sleep/main.c +0 -0
drivers/acpi/namespace/Makefile deleted +0 -12
@@ -1,12 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := nsaccess.o nsload.o nssearch.o nsxfeval.o \ - nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \ - nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \ - nsparse.o nspredef.o - -obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/parser/Makefile deleted +0 -8
@@ -1,8 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := psargs.o psparse.o psloop.o pstree.o pswalk.o \ - psopcode.o psscope.o psutils.o psxface.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/proc.c renamed from drivers/acpi/sleep/proc.c +0 -0
drivers/acpi/resources/Makefile deleted +0 -10
@@ -1,10 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \ - rscalc.o rsirq.o rsmemory.o rsutils.o - -obj-$(ACPI_FUTURE_USAGE) += rsdump.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/sleep.h renamed from drivers/acpi/sleep/sleep.h +0 -0
drivers/acpi/sleep/Makefile deleted +0 -5
@@ -1,5 +0,0 @@ -obj-y := wakeup.o -obj-y += main.o -obj-$(CONFIG_ACPI_SLEEP) += proc.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/tables/Makefile deleted +0 -7
@@ -1,7 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/utilities/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# Makefile for all Linux ACPI interpreter subdirectories -# - -obj-y := utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \ - utcopy.o utdelete.o utglobal.o utmath.o utobject.o \ - utstate.o utmutex.o utobject.o utresrc.o - -EXTRA_CFLAGS += $(ACPI_CFLAGS)
drivers/acpi/wakeup.c renamed from drivers/acpi/sleep/wakeup.c +0 -0
Signature · 1 line
1.5.6.6