Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 357151 - sys-kernel/vanilla-sources-2.6.37.2 will not compile when CONFIG_XEN_PLATFORM_PCI set using menuconfig
Summary: sys-kernel/vanilla-sources-2.6.37.2 will not compile when CONFIG_XEN_PLATFORM...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-02 21:11 UTC by Chris Richards
Modified: 2011-03-03 23:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xen kernel configuration (kernel-config,39.39 KB, text/plain)
2011-03-02 21:12 UTC, Chris Richards
Details
Make CONFIG_XEN_PLATFORM_PCI depend on CONFIG_PCI (XEN-PLATFORM-PCI-depends-on-PCI.patch,453 bytes, patch)
2011-03-02 21:27 UTC, Anthony Basile
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Richards 2011-03-02 21:11:09 UTC
When compiling 2.6.37-r4 kernel, configuration generated by menuconfig will not compile with CONFIG_XEN_PLATFORM_PCI unless CONFIG_PCI is also set.  While this seems reasonable on its face, menuconfig neither indicates this dependency, nor enforces it.  Thus it is possible to set CONFIG_XEN_PLATFORM_PCI without having CONFIG_PCI set, and the kernel will fail to compile as a result.

2.6.36-r9 kernel exhibits the same menuconfig behavior, but compiles successfully.

Reproducible: Always

Steps to Reproduce:
1. merge 2.6.37-r4 kernel
2. configure for XEN guest using attached config file


Actual Results:  
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC [M]  drivers/xen/platform-pci.o
drivers/xen/platform-pci.c: In function 'platform_pci_init':
drivers/xen/platform-pci.c:127: error: implicit declaration of function 'pci_request_region'
drivers/xen/platform-pci.c:165: error: implicit declaration of function 'pci_release_region'
make[2]: *** [drivers/xen/platform-pci.o] Error 1
make[1]: *** [drivers/xen] Error 2
make: *** [drivers] Error 2

Expected Results:  
Compile succesfully using config generated by make menuconfig
Comment 1 Chris Richards 2011-03-02 21:12:30 UTC
Created attachment 264525 [details]
xen kernel configuration

This config is from a hardened gentoo kernel, but the problem has been confirmed on vanilla as well.
Comment 2 Anthony Basile gentoo-dev 2011-03-02 21:20:37 UTC
Okay this appeared on 2.6.37 because of a change to drivers/xen/platform-pci.c.  The calls to request_region and release_region in <=2.6.36 where changed to pci_request_region and pci_release_region in 2.6.37.  While <linux/pci.h> is included, when CONFIG_PCI is off, the appropriate function prototypes, namely

void pci_release_region(struct pci_dev *, int);
int __must_check pci_request_region(struct pci_dev *, int, const char *);

are NOT included because they are ifdef-ed out.  This suggests that CONFIG_XEN_PLATFORM_PCI ought to depend on CONFIG_PCI.  In the next post, I'll prepare a patch which address that.  I've tested it and it does fix the problem.
Comment 3 Anthony Basile gentoo-dev 2011-03-02 21:27:46 UTC
Created attachment 264527 [details, diff]
Make CONFIG_XEN_PLATFORM_PCI depend on CONFIG_PCI
Comment 4 Anthony Basile gentoo-dev 2011-03-03 23:29:15 UTC
(In reply to comment #3)
> Created an attachment (id=264527) [details]
> Make CONFIG_XEN_PLATFORM_PCI depend on CONFIG_PCI
> 

Okay someone stole my thunder!  The fix is already upstream:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e528db5b392ab2a624258a667fed0e65af6e411b

Rather than backporting this one, I recommend we just refer people to this bug with the workaround of setting CONFIG_PCI=y until this fix makes it into one of the stable releases.

Closing it FIXED.