From: "Jan Beulich" Subject: [PATCH 7/7] x86: cleanup bogus CONFIG_ACPI_PCI uses Date: Thu, 31 Mar 2011 16:57:42 +0100 Message-ID: <4D94C09602000078000396D1@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part735FA766.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part735FA766.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline We're building for one case (CONFIG_ACPI_PCI defined) only, yet still had the other case's code in there. Additionally there was quite a bit of pseudo-duplication between disabled(!) DMI scan and ACPI boot code. acpi_pci_disabled had only a single reader, which is off by default (i.e. must be enable on the command line), so it seems pointless to keep it. Signed-off-by: Jan Beulich --- a/xen/arch/x86/acpi/boot.c +++ b/xen/arch/x86/acpi/boot.c @@ -43,21 +43,13 @@ #include #include =20 -#define CONFIG_ACPI_PCI - #define BAD_MADT_ENTRY(entry, end) ( = \ (!entry) || (unsigned long)entry + sizeof(*entry) > end || = \ ((struct acpi_subtable_header *)entry)->length !=3D = sizeof(*entry)) =20 #define PREFIX "ACPI: " =20 -#ifdef CONFIG_ACPI_PCI bool_t __initdata acpi_noirq; /* skip ACPI IRQ initialization */ -bool_t __initdata acpi_pci_disabled; /* skip ACPI PCI scan and IRQ = initialization */ -#else -bool_t __initdata acpi_noirq =3D 1; -bool_t __initdata acpi_pci_disabled =3D 1; -#endif bool_t __initdata acpi_ht =3D 1; /* enable HT */ =20 bool_t __initdata acpi_lapic; @@ -572,7 +564,6 @@ static void __init acpi_process_madt(voi */ error =3D acpi_parse_madt_ioapic_entries(); if (!error) { - acpi_irq_balance_set(NULL); acpi_ioapic =3D 1; =20 smp_found_config =3D 1; @@ -604,16 +595,6 @@ static int __init disable_acpi_irq(struc return 0; } =20 -static int __init disable_acpi_pci(struct dmi_system_id *d) -{ - if (!acpi_force) { - printk(KERN_NOTICE "%s detected: force use of pci=3Dnoacpi\= n", - d->ident); - /*acpi_disable_pci();*/ - } - return 0; -} - static int __init dmi_disable_acpi(struct dmi_system_id *d) { if (!acpi_force) { @@ -774,29 +755,6 @@ static struct dmi_system_id __initdata a "ASUS A7V ACPI BIOS Revision 1007"), }, }, - - /* - * Boxes that need ACPI PCI IRQ routing and PCI scan disabled - */ - { /* _BBN 0 bug */ - .callback =3D disable_acpi_pci, - .ident =3D "ASUS PR-DLS", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), - DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"), - DMI_MATCH(DMI_BIOS_VERSION, - "ASUS PR-DLS ACPI BIOS Revision 1010"), - DMI_MATCH(DMI_BIOS_DATE, "03/21/2003") - }, - }, - { - .callback =3D disable_acpi_pci, - .ident =3D "Acer TravelMate 36x Laptop", - .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), - }, - }, {} }; =20 --- a/xen/arch/x86/dmi_scan.c +++ b/xen/arch/x86/dmi_scan.c @@ -229,27 +229,6 @@ static __init __attribute__((unused)) in }=20 #endif =20 -#ifdef CONFIG_ACPI_PCI -static __init int disable_acpi_irq(struct dmi_blacklist *d)=20 -{ - if (!acpi_force) { - printk(KERN_NOTICE "%s detected: force use of acpi=3Dnoirq\= n", - d->ident); =09 - acpi_noirq_set(); - } - return 0; -} -static __init int disable_acpi_pci(struct dmi_blacklist *d)=20 -{ - if (!acpi_force) { - printk(KERN_NOTICE "%s detected: force use of pci=3Dnoacpi\= n", - d->ident); =09 - acpi_disable_pci(); - } - return 0; -} =20 -#endif - /* * Process the DMI blacklists */ @@ -354,35 +333,6 @@ static __initdata struct dmi_blacklist d =20 #endif // CONFIG_ACPI_BOOT =20 -#ifdef CONFIG_ACPI_PCI - /* - * Boxes that need ACPI PCI IRQ routing disabled - */ - - { disable_acpi_irq, "ASUS A7V", { - MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), - MATCH(DMI_BOARD_NAME, ""), - /* newer BIOS, Revision 1011, does work */ - MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS = Revision 1007"), - NO_MATCH }}, - - /* - * Boxes that need ACPI PCI IRQ routing and PCI scan disabled - */ - { disable_acpi_pci, "ASUS PR-DLS", { /* _BBN 0 bug */ - MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), - MATCH(DMI_BOARD_NAME, "PR-DLS"), - MATCH(DMI_BIOS_VERSION, "ASUS PR-DLS ACPI BIOS = Revision 1010"), - MATCH(DMI_BIOS_DATE, "03/21/2003") }}, - - { disable_acpi_pci, "Acer TravelMate 36x Laptop", { - MATCH(DMI_SYS_VENDOR, "Acer"), - MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), - NO_MATCH, NO_MATCH - } }, - -#endif - { NULL, } }; =20 --- a/xen/arch/x86/x86_64/mmconf-fam10h.c +++ b/xen/arch/x86/x86_64/mmconf-fam10h.c @@ -146,21 +146,14 @@ void __cpuinit fam10h_check_enable_mmcfg =20 /* try to make sure that AP's setting is identical to BSP setting = */ if (val & FAM10H_MMIO_CONF_ENABLE) { - unsigned busnbits; - busnbits =3D (val >> FAM10H_MMIO_CONF_BUSRANGE_SHIFT) & - FAM10H_MMIO_CONF_BUSRANGE_MASK; - - /* only trust the one handle 256 buses, if acpi=3Doff */ - if (!acpi_pci_disabled || busnbits >=3D 8) { - u64 base =3D val & MASK; - - if (!fam10h_pci_mmconf_base) { - fam10h_pci_mmconf_base =3D base; - return; - } - if (fam10h_pci_mmconf_base =3D=3D base) - return; + u64 base =3D val & MASK; + + if (!fam10h_pci_mmconf_base) { + fam10h_pci_mmconf_base =3D base; + return; } + if (fam10h_pci_mmconf_base =3D=3D base) + return; } =20 /* --- a/xen/include/asm-ia64/linux-xen/asm/acpi.h +++ b/xen/include/asm-ia64/linux-xen/asm/acpi.h @@ -96,8 +96,6 @@ ia64_acpi_release_global_lock (unsigned=20 ((Acq) =3D ia64_acpi_release_global_lock(&facs->global_lock)) =20 #define acpi_disabled 0 /* ACPI always enabled on IA64 */ -#define acpi_noirq 0 /* ACPI always enabled on IA64 */ -#define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) = */ static inline void disable_acpi(void) { } --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -79,8 +79,7 @@ int __acpi_release_global_lock(unsigned=20 :"0"(n_hi), "1"(n_lo)) =20 extern bool_t acpi_lapic, acpi_ioapic, acpi_noirq; -extern bool_t acpi_force, acpi_ht; -extern bool_t acpi_disabled, acpi_pci_disabled; +extern bool_t acpi_force, acpi_ht, acpi_disabled; extern bool_t acpi_skip_timer_override; extern u32 acpi_smi_cmd; extern u8 acpi_enable_value, acpi_disable_value; @@ -90,7 +89,6 @@ static inline void disable_acpi(void) { acpi_disabled =3D 1; acpi_ht =3D 0; - acpi_pci_disabled =3D 1; acpi_noirq =3D 1; } =20 @@ -98,12 +96,6 @@ static inline void disable_acpi(void) #define FIX_ACPI_PAGES 4 =20 static inline void acpi_noirq_set(void) { acpi_noirq =3D 1; } -static inline void acpi_disable_pci(void) -{ - acpi_pci_disabled =3D 1; - acpi_noirq_set(); -} -static inline int acpi_irq_balance_set(char *str) { return 0; } =20 /* routines for saving/restoring kernel state */ extern int acpi_save_state_mem(void); --=__Part735FA766.0__= Content-Type: text/plain; name="x86-acpi-pci-cleanup.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-acpi-pci-cleanup.patch" We're building for one case (CONFIG_ACPI_PCI defined) only, yet still=0Ahad= the other case's code in there. Additionally there was quite a bit=0Aof = pseudo-duplication between disabled(!) DMI scan and ACPI boot code.=0A=0Aac= pi_pci_disabled had only a single reader, which is off by default=0A(i.e. = must be enable on the command line), so it seems pointless to=0Akeep = it.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/arch/x86/acpi/boot.c=0A+++ b/xen/arch/x86/acpi/boot.c=0A@@ -43,21 = +43,13 @@=0A #include =0A #include =0A = =0A-#define CONFIG_ACPI_PCI=0A-=0A #define BAD_MADT_ENTRY(entry, end) ( = \=0A (!entry) || (unsigned = long)entry + sizeof(*entry) > end || \=0A ((struct acpi_subta= ble_header *)entry)->length !=3D sizeof(*entry))=0A =0A #define PREFIX = "ACPI: "=0A =0A-#ifdef CONFIG_ACPI_PCI=0A bool_t __initdata = acpi_noirq; /* skip ACPI IRQ initialization */=0A-bool_t __initdata = acpi_pci_disabled; /* skip ACPI PCI scan and IRQ initialization */=0A-#else= =0A-bool_t __initdata acpi_noirq =3D 1;=0A-bool_t __initdata acpi_pci_disab= led =3D 1;=0A-#endif=0A bool_t __initdata acpi_ht =3D 1; /* enable = HT */=0A =0A bool_t __initdata acpi_lapic;=0A@@ -572,7 +564,6 @@ static = void __init acpi_process_madt(voi=0A */=0A = error =3D acpi_parse_madt_ioapic_entries();=0A if = (!error) {=0A- acpi_irq_balance_set(NULL);=0A = acpi_ioapic =3D 1;=0A =0A = smp_found_config =3D 1;=0A@@ -604,16 +595,6 @@ static int __init disable_ac= pi_irq(struc=0A return 0;=0A }=0A =0A-static int __init disable_acp= i_pci(struct dmi_system_id *d)=0A-{=0A- if (!acpi_force) {=0A- = printk(KERN_NOTICE "%s detected: force use of pci=3Dnoacpi\n",=0A- = d->ident);=0A- /*acpi_disable_pci();*/=0A- }=0A- = return 0;=0A-}=0A-=0A static int __init dmi_disable_acpi(struct dmi_system_= id *d)=0A {=0A if (!acpi_force) {=0A@@ -774,29 +755,6 @@ static struct = dmi_system_id __initdata a=0A "ASUS A7V ACPI BIOS = Revision 1007"),=0A },=0A },=0A-=0A- /*=0A- * = Boxes that need ACPI PCI IRQ routing and PCI scan disabled=0A- */=0A- { = /* _BBN 0 bug */=0A- .callback =3D disable_acpi_pci,=0A= - .ident =3D "ASUS PR-DLS",=0A- .matches =3D {=0A- = DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),=0A- = DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),=0A- DMI_MATCH(DMI_= BIOS_VERSION,=0A- "ASUS PR-DLS ACPI BIOS = Revision 1010"),=0A- DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")= =0A- },=0A- },=0A- {=0A- .callback =3D disable_acpi= _pci,=0A- .ident =3D "Acer TravelMate 36x Laptop",=0A- .matches = =3D {=0A- DMI_MATCH(DMI_SYS_VENDOR, "Acer"),=0A- = DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),=0A- = },=0A- },=0A {}=0A };=0A =0A--- a/xen/arch/x86/dmi_scan.c=0A+++ = b/xen/arch/x86/dmi_scan.c=0A@@ -229,27 +229,6 @@ static __init __attribute_= _((unused)) in=0A } =0A #endif=0A =0A-#ifdef CONFIG_ACPI_PCI=0A-static = __init int disable_acpi_irq(struct dmi_blacklist *d) =0A-{=0A- if = (!acpi_force) {=0A- printk(KERN_NOTICE "%s detected: force use = of acpi=3Dnoirq\n",=0A- d->ident); =0A- = acpi_noirq_set();=0A- }=0A- return 0;=0A-}=0A-static __init int = disable_acpi_pci(struct dmi_blacklist *d) =0A-{=0A- if (!acpi_force) = {=0A- printk(KERN_NOTICE "%s detected: force use of pci=3Dnoacpi\= n",=0A- d->ident); =0A- acpi_disable_pci();= =0A- }=0A- return 0;=0A-} =0A-#endif=0A-=0A /*=0A * Process = the DMI blacklists=0A */=0A@@ -354,35 +333,6 @@ static __initdata struct = dmi_blacklist d=0A =0A #endif // CONFIG_ACPI_BOOT=0A =0A-#ifdef = CONFIG_ACPI_PCI=0A- /*=0A- * Boxes that need ACPI PCI IRQ = routing disabled=0A- */=0A-=0A- { disable_acpi_irq, "ASUS A7V", = {=0A- MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer = INC"),=0A- MATCH(DMI_BOARD_NAME, ""),=0A- = /* newer BIOS, Revision 1011, does work */=0A- = MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),=0A- = NO_MATCH }},=0A-=0A- /*=0A- * Boxes that need ACPI PCI = IRQ routing and PCI scan disabled=0A- */=0A- { disable_acpi_pci, "ASUS = PR-DLS", { /* _BBN 0 bug */=0A- MATCH(DMI_BOARD_VEN= DOR, "ASUSTeK Computer INC."),=0A- MATCH(DMI_BOARD_NAM= E, "PR-DLS"),=0A- MATCH(DMI_BIOS_VERSION, "ASUS = PR-DLS ACPI BIOS Revision 1010"),=0A- MATCH(DMI_BIOS_DATE= , "03/21/2003") }},=0A-=0A- { disable_acpi_pci, "Acer TravelMate 36x = Laptop", {=0A- MATCH(DMI_SYS_VENDOR, "Acer"),=0A- = MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),=0A- = NO_MATCH, NO_MATCH=0A- } },=0A-=0A-#endif=0A-=0A { = NULL, }=0A };=0A =0A--- a/xen/arch/x86/x86_64/mmconf-fam10h.c=0A+++ = b/xen/arch/x86/x86_64/mmconf-fam10h.c=0A@@ -146,21 +146,14 @@ void = __cpuinit fam10h_check_enable_mmcfg=0A =0A /* try to make sure that = AP's setting is identical to BSP setting */=0A if (val & FAM10H_MMIO_CONF_= ENABLE) {=0A- unsigned busnbits;=0A- busnbits =3D (val = >> FAM10H_MMIO_CONF_BUSRANGE_SHIFT) &=0A- FAM10H_MMIO= _CONF_BUSRANGE_MASK;=0A-=0A- /* only trust the one handle 256 = buses, if acpi=3Doff */=0A- if (!acpi_pci_disabled || busnbits = >=3D 8) {=0A- u64 base =3D val & MASK;=0A-=0A- = if (!fam10h_pci_mmconf_base) {=0A- = fam10h_pci_mmconf_base =3D base;=0A- return;=0A-= }=0A- if (fam10h_pci_mmconf_base = =3D=3D base)=0A- return;=0A+ = u64 base =3D val & MASK;=0A+=0A+ if (!fam10h_pci_mmconf_base= ) {=0A+ fam10h_pci_mmconf_base =3D base;=0A+ = return;=0A }=0A+ if (fam10h_pci_mmconf_base =3D=3D = base)=0A+ return;=0A }=0A =0A /*=0A--- = a/xen/include/asm-ia64/linux-xen/asm/acpi.h=0A+++ b/xen/include/asm-ia64/li= nux-xen/asm/acpi.h=0A@@ -96,8 +96,6 @@ ia64_acpi_release_global_lock = (unsigned =0A ((Acq) =3D ia64_acpi_release_global_lock(&facs->global_lock= ))=0A =0A #define acpi_disabled 0 /* ACPI always enabled on IA64 = */=0A-#define acpi_noirq 0 /* ACPI always enabled on IA64 */=0A-#defin= e acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */=0A #define = acpi_strict 1 /* no ACPI spec workarounds on IA64 */=0A #define = acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */=0A = static inline void disable_acpi(void) { }=0A--- a/xen/include/asm-x86/acpi.= h=0A+++ b/xen/include/asm-x86/acpi.h=0A@@ -79,8 +79,7 @@ int __acpi_release= _global_lock(unsigned =0A :"0"(n_hi), "1"(n_lo))=0A =0A extern = bool_t acpi_lapic, acpi_ioapic, acpi_noirq;=0A-extern bool_t acpi_force, = acpi_ht;=0A-extern bool_t acpi_disabled, acpi_pci_disabled;=0A+extern = bool_t acpi_force, acpi_ht, acpi_disabled;=0A extern bool_t acpi_skip_timer= _override;=0A extern u32 acpi_smi_cmd;=0A extern u8 acpi_enable_value, = acpi_disable_value;=0A@@ -90,7 +89,6 @@ static inline void disable_acpi(voi= d)=0A {=0A acpi_disabled =3D 1;=0A acpi_ht =3D 0;=0A- = acpi_pci_disabled =3D 1;=0A acpi_noirq =3D 1;=0A }=0A =0A@@ -98,12 = +96,6 @@ static inline void disable_acpi(void)=0A #define FIX_ACPI_PAGES = 4=0A =0A static inline void acpi_noirq_set(void) { acpi_noirq =3D 1; = }=0A-static inline void acpi_disable_pci(void)=0A-{=0A- acpi_pci_disabled = =3D 1;=0A- acpi_noirq_set();=0A-}=0A-static inline int acpi_irq_balanc= e_set(char *str) { return 0; }=0A =0A /* routines for saving/restoring = kernel state */=0A extern int acpi_save_state_mem(void);=0A --=__Part735FA766.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part735FA766.0__=--