2009-07-16 08:48:06

by Alexander Beregalov

[permalink] [raw]
Subject: next: sfi build fails when !CONFIG_ACPI

Hi

drivers/sfi/sfi_core.c: In function 'sfi_init':
drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared (first
use in this function)
drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
reported only once
drivers/sfi/sfi_core.c:346: error: for each function it appears in.)


$ grep ACPI .config
# Power management and ACPI options


2009-07-17 13:57:18

by Alexander Beregalov

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

2009/7/17 Len Brown <[email protected]>:
>> drivers/sfi/sfi_core.c: In function 'sfi_init':
>> drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared (first
>> use in this function)
>> drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
>> reported only once
>> drivers/sfi/sfi_core.c:346: error: for each function it appears in.)
>>
>>
>> $ grep ACPI .config
>> # Power management and ACPI options
>
> It builds for me.
> Please send me the complete failing .config

Attached (x86_64)


Attachments:
sfi-config (53.92 kB)

2009-07-21 18:21:30

by Len Brown

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

> drivers/sfi/sfi_core.c: In function 'sfi_init':
> drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared (first
> use in this function)
> drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
> reported only once
> drivers/sfi/sfi_core.c:346: error: for each function it appears in.)
>
>
> $ grep ACPI .config
> # Power management and ACPI options

It builds for me.
Please send me the complete failing .config

thanks,
Len Brown, Intel Open Source Technology Center

2009-07-22 22:06:29

by Randy Dunlap

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

On Thu, 16 Jul 2009 12:48:01 +0400 Alexander Beregalov wrote:

> Hi
>
> drivers/sfi/sfi_core.c: In function 'sfi_init':
> drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared (first
> use in this function)
> drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
> reported only once
> drivers/sfi/sfi_core.c:346: error: for each function it appears in.)
>
>
> $ grep ACPI .config
> # Power management and ACPI options
> --

next-20090722 still fails on x86_32 when SFI=y & ACPI=n:

arch/x86/pci/mmconfig_32.c:34: error: invalid use of undefined type 'struct acpi_mcfg_allocation'
arch/x86/pci/mmconfig_32.c:34: error: dereferencing pointer to incomplete type
arch/x86/pci/mmconfig_32.c:35: error: dereferencing pointer to incomplete type
arch/x86/pci/mmconfig_32.c:36: error: dereferencing pointer to incomplete type
arch/x86/pci/mmconfig_32.c:37: error: dereferencing pointer to incomplete type
arch/x86/pci/mmconfig_32.c:38: error: dereferencing pointer to incomplete type

config is attached.

---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/


Attachments:
config-sfi (55.13 kB)

2009-07-23 08:34:23

by Feng Tang

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

On Thu, 23 Jul 2009 06:06:17 +0800
Randy Dunlap <[email protected]> wrote:

> On Thu, 16 Jul 2009 12:48:01 +0400 Alexander Beregalov wrote:
>
> > Hi
> >
> > drivers/sfi/sfi_core.c: In function 'sfi_init':
> > drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared (first
> > use in this function)
> > drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
> > reported only once
> > drivers/sfi/sfi_core.c:346: error: for each function it appears in.)
> >
> >
> > $ grep ACPI .config
> > # Power management and ACPI options
> > --
>
> next-20090722 still fails on x86_32 when SFI=y & ACPI=n:
>
> arch/x86/pci/mmconfig_32.c:34: error: invalid use of undefined type
> 'struct acpi_mcfg_allocation' arch/x86/pci/mmconfig_32.c:34: error:
> dereferencing pointer to incomplete type
> arch/x86/pci/mmconfig_32.c:35: error: dereferencing pointer to
> incomplete type arch/x86/pci/mmconfig_32.c:36: error: dereferencing
> pointer to incomplete type arch/x86/pci/mmconfig_32.c:37: error:
> dereferencing pointer to incomplete type
> arch/x86/pci/mmconfig_32.c:38: error: dereferencing pointer to
> incomplete type
>
> config is attached.
Hi Randy,

Thanks for the catch. Could you try the following patch? thanks!

- Feng

diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 25a0d9f..e89bf33 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -557,15 +557,15 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
i -= sizeof(struct acpi_mcfg_allocation);
};
if (pci_mmcfg_config_num == 0) {
- printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
+ printk(KERN_ERR "PCI: MMCONFIG has no entries\n");
return -ENODEV;
}

config_size = pci_mmcfg_config_num * sizeof(*pci_mmcfg_config);
pci_mmcfg_config = kmalloc(config_size, GFP_KERNEL);
if (!pci_mmcfg_config) {
- printk(KERN_WARNING PREFIX
- "No memory for MCFG config tables\n");
+ printk(KERN_WARNING
+ "PCI: No memory for MCFG config tables\n");
return -ENOMEM;
}

@@ -576,8 +576,8 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
for (i = 0; i < pci_mmcfg_config_num; ++i) {
if ((pci_mmcfg_config[i].address > 0xFFFFFFFF) &&
!acpi_mcfg_64bit_base_addr) {
- printk(KERN_ERR PREFIX
- "MMCONFIG not in low 4GB of memory\n");
+ printk(KERN_ERR
+ "PCI: MMCONFIG not in low 4GB of memory\n");
kfree(pci_mmcfg_config);
pci_mmcfg_config_num = 0;
return -ENODEV;
@@ -609,7 +609,9 @@ static void __init __pci_mmcfg_init(int early)
if (!known_bridge)
x86_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg);

+#ifdef CONFIG_ACPI
pci_mmcfg_reject_broken(early);
+#endif

if ((pci_mmcfg_config_num == 0) ||
(pci_mmcfg_config == NULL) ||
diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
index 8b2d561..f10a7e9 100644
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -11,9 +11,9 @@

#include <linux/pci.h>
#include <linux/init.h>
-#include <linux/acpi.h>
#include <asm/e820.h>
#include <asm/pci_x86.h>
+#include <acpi/acpi.h>

/* Assume systems with more busses have correct MCFG */
#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG))
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
index 356d0a2..3c645bb 100644
--- a/include/linux/sfi_acpi.h
+++ b/include/linux/sfi_acpi.h
@@ -50,8 +50,10 @@ extern int sfi_acpi_table_parse(char *signature, char *oem_id,
static inline int x86_table_parse(char *signature,
int (*handler)(struct acpi_table_header *))
{
+#ifdef CONFIG_ACPI
if (!acpi_table_parse(signature, handler))
return 0;
+#endif

return sfi_acpi_table_parse(signature, NULL, NULL, handler);
}

>
> ---
> ~Randy
> LPC 2009, Sept. 23-25, Portland, Oregon
> http://linuxplumbersconf.org/2009/

2009-07-23 08:43:33

by Alexander Beregalov

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

2009/7/17 Alexander Beregalov <[email protected]>:
> 2009/7/17 Len Brown <[email protected]>:
>>> drivers/sfi/sfi_core.c: In function 'sfi_init':
>>> drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared (first
>>> use in this function)
>>> drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
>>> reported only once
>>> drivers/sfi/sfi_core.c:346: error: for each function it appears in.)
>>>
>>>
>>> $ grep ACPI .config
>>> # Power management and ACPI options
>>
>> It builds for me.
>> Please send me the complete failing .config
>
> Attached (x86_64)

Still fails for me in the same way,
X86_64
next-20090723

2009-07-23 10:16:25

by Feng Tang

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

On Thu, 23 Jul 2009 16:43:30 +0800
Alexander Beregalov <[email protected]> wrote:

> 2009/7/17 Alexander Beregalov <[email protected]>:
> > 2009/7/17 Len Brown <[email protected]>:
> >>> drivers/sfi/sfi_core.c: In function 'sfi_init':
> >>> drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared
> >>> (first use in this function)
> >>> drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
> >>> reported only once
> >>> drivers/sfi/sfi_core.c:346: error: for each function it appears
> >>> in.)
> >>>
> >>>
> >>> $ grep ACPI .config
> >>> # Power management and ACPI options
> >>
> >> It builds for me.
> >> Please send me the complete failing .config
> >
> > Attached (x86_64)
>
> Still fails for me in the same way,
> X86_64
> next-20090723

sorry for the late response, please try the following patch:

diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c
index 62e2f98..fa66824 100644
--- a/drivers/sfi/sfi_core.c
+++ b/drivers/sfi/sfi_core.c
@@ -361,9 +361,6 @@ static __init int sfi_find_syst(void)

void __init sfi_init(void)
{
- if (!acpi_disabled)
- disable_sfi();
-
if (sfi_disabled)
return;

Thanks,
Feng

2009-07-23 11:28:32

by Alexander Beregalov

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

2009/7/23 Feng Tang <[email protected]>:
> On Thu, 23 Jul 2009 16:43:30 +0800
> Alexander Beregalov <[email protected]> wrote:
>
>> 2009/7/17 Alexander Beregalov <[email protected]>:
>> > 2009/7/17 Len Brown <[email protected]>:
>> >>> drivers/sfi/sfi_core.c: In function 'sfi_init':
>> >>> drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared
>> >>> (first use in this function)
>> >>> drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
>> >>> reported only once
>> >>> drivers/sfi/sfi_core.c:346: error: for each function it appears
>> >>> in.)
>> >>>
>> >>>
>> >>> $ grep ACPI .config
>> >>> # Power management and ACPI options
>> >>
>> >> It builds for me.
>> >> Please send me the complete failing .config
>> >
>> > Attached (x86_64)
>>
>> Still fails for me in the same way,
>> X86_64
>> next-20090723
>
> sorry for the late response, please try the following patch:
It obviously works. Thanks

>
> diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c
> index 62e2f98..fa66824 100644
> --- a/drivers/sfi/sfi_core.c
> +++ b/drivers/sfi/sfi_core.c
> @@ -361,9 +361,6 @@ static __init int sfi_find_syst(void)
>
>  void __init sfi_init(void)
>  {
> -       if (!acpi_disabled)
> -               disable_sfi();
> -
>        if (sfi_disabled)
>                return;
>
> Thanks,
> Feng
>

2009-07-23 14:54:06

by Randy Dunlap

[permalink] [raw]
Subject: Re: next: sfi build fails when !CONFIG_ACPI

On Thu, 23 Jul 2009 16:33:22 +0800 Feng Tang wrote:

> On Thu, 23 Jul 2009 06:06:17 +0800
> Randy Dunlap <[email protected]> wrote:
>
> > On Thu, 16 Jul 2009 12:48:01 +0400 Alexander Beregalov wrote:
> >
> > > Hi
> > >
> > > drivers/sfi/sfi_core.c: In function 'sfi_init':
> > > drivers/sfi/sfi_core.c:346: error: 'acpi_disabled' undeclared (first
> > > use in this function)
> > > drivers/sfi/sfi_core.c:346: error: (Each undeclared identifier is
> > > reported only once
> > > drivers/sfi/sfi_core.c:346: error: for each function it appears in.)
> > >
> > >
> > > $ grep ACPI .config
> > > # Power management and ACPI options
> > > --
> >
> > next-20090722 still fails on x86_32 when SFI=y & ACPI=n:
> >
> > arch/x86/pci/mmconfig_32.c:34: error: invalid use of undefined type
> > 'struct acpi_mcfg_allocation' arch/x86/pci/mmconfig_32.c:34: error:
> > dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig_32.c:35: error: dereferencing pointer to
> > incomplete type arch/x86/pci/mmconfig_32.c:36: error: dereferencing
> > pointer to incomplete type arch/x86/pci/mmconfig_32.c:37: error:
> > dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig_32.c:38: error: dereferencing pointer to
> > incomplete type
> >
> > config is attached.
> Hi Randy,
>
> Thanks for the catch. Could you try the following patch? thanks!

Works for me. Thanks.


> - Feng
>
> diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
> index 25a0d9f..e89bf33 100644
> --- a/arch/x86/pci/mmconfig-shared.c
> +++ b/arch/x86/pci/mmconfig-shared.c
> @@ -557,15 +557,15 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
> i -= sizeof(struct acpi_mcfg_allocation);
> };
> if (pci_mmcfg_config_num == 0) {
> - printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
> + printk(KERN_ERR "PCI: MMCONFIG has no entries\n");
> return -ENODEV;
> }
>
> config_size = pci_mmcfg_config_num * sizeof(*pci_mmcfg_config);
> pci_mmcfg_config = kmalloc(config_size, GFP_KERNEL);
> if (!pci_mmcfg_config) {
> - printk(KERN_WARNING PREFIX
> - "No memory for MCFG config tables\n");
> + printk(KERN_WARNING
> + "PCI: No memory for MCFG config tables\n");
> return -ENOMEM;
> }
>
> @@ -576,8 +576,8 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
> for (i = 0; i < pci_mmcfg_config_num; ++i) {
> if ((pci_mmcfg_config[i].address > 0xFFFFFFFF) &&
> !acpi_mcfg_64bit_base_addr) {
> - printk(KERN_ERR PREFIX
> - "MMCONFIG not in low 4GB of memory\n");
> + printk(KERN_ERR
> + "PCI: MMCONFIG not in low 4GB of memory\n");
> kfree(pci_mmcfg_config);
> pci_mmcfg_config_num = 0;
> return -ENODEV;
> @@ -609,7 +609,9 @@ static void __init __pci_mmcfg_init(int early)
> if (!known_bridge)
> x86_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg);
>
> +#ifdef CONFIG_ACPI
> pci_mmcfg_reject_broken(early);
> +#endif
>
> if ((pci_mmcfg_config_num == 0) ||
> (pci_mmcfg_config == NULL) ||
> diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
> index 8b2d561..f10a7e9 100644
> --- a/arch/x86/pci/mmconfig_32.c
> +++ b/arch/x86/pci/mmconfig_32.c
> @@ -11,9 +11,9 @@
>
> #include <linux/pci.h>
> #include <linux/init.h>
> -#include <linux/acpi.h>
> #include <asm/e820.h>
> #include <asm/pci_x86.h>
> +#include <acpi/acpi.h>
>
> /* Assume systems with more busses have correct MCFG */
> #define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG))
> diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
> index 356d0a2..3c645bb 100644
> --- a/include/linux/sfi_acpi.h
> +++ b/include/linux/sfi_acpi.h
> @@ -50,8 +50,10 @@ extern int sfi_acpi_table_parse(char *signature, char *oem_id,
> static inline int x86_table_parse(char *signature,
> int (*handler)(struct acpi_table_header *))
> {
> +#ifdef CONFIG_ACPI
> if (!acpi_table_parse(signature, handler))
> return 0;
> +#endif
>
> return sfi_acpi_table_parse(signature, NULL, NULL, handler);
> }


---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/