Bug 10576 - drm modules won't compile with 2.6.21-rc6 (vm_insert_pfn names clash)
Summary: drm modules won't compile with 2.6.21-rc6 (vm_insert_pfn names clash)
Status: RESOLVED NOTABUG
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/other (show other bugs)
Version: DRI git
Hardware: All All
: highest normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-09 10:18 UTC by Michał Sznajder
Modified: 2007-04-28 18:00 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Michał Sznajder 2007-04-09 10:18:10 UTC
It looks like that latest (as of writing 2.6.21-rc6@kernel.org) kernel contains function named vm_insert_pfn in /mm/memory.c and /mm/mm.h (see http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e0dc0d8f4a327d033bfb63d43f113d5f31d11b3c  for specific check-in). Unfortunately vm_insert_pfn is also used in drm_compat.c thus resulting in naming clash. At a first glance they both differ in code very much. 

The result of make is 
/home/michal/nouveau/drm/linux-core/drm_compat.c:190: error: static declaration of ‘vm_insert_pfn’ follows non-static declaration
include/linux/mm.h:1126: error: previous declaration of ‘vm_insert_pfn’ was here 

The bug was found on Ubuntu Feisty with latest kernel packages installed (which apparently is 2.6.20. uname -r gives 2.6.20-14-generic) 2.6.20 from gentoo does not have this problem.
Comment 1 Michał Sznajder 2007-04-09 11:09:36 UTC
Links to drm and kernels git's  that have introduced incompatibility:

http://gitweb.freedesktop.org/?p=mesa/drm.git;a=commitdiff;h=f2db76e2f206d2017f710eaddc4b33add4498898

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

Someone has to change the name but who?
Comment 2 Thomas Hellström 2007-04-09 11:27:28 UTC
(In reply to comment #1)
> Links to drm and kernels git's  that have introduced incompatibility:
> 
> http://gitweb.freedesktop.org/?p=mesa/drm.git;a=commitdiff;h=f2db76e2f206d2017f710eaddc4b33add4498898
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e0dc0d8f4a327d033bfb63d43f113d5f31d11b3c
> 
> Someone has to change the name but who?
> 

vm_insert_pfn first appears in the kernel in the 2.6.21-rc series.
In drm_compat.c it is not included if the kernel version >= 2.6.21, when the
symbol DRM_FULL_MM_COMPAT is defined. 

The semantics of the two functions, although they are looking very different are the same. The one in the mainstream kernel should be used if there is a clash.

I'm not sure why it appears in Ubuntu 2.6.20. I think you need to ask the Ubuntu guys. 

/Thomas

 

Comment 3 Chris Ball 2007-04-27 15:34:47 UTC
(In reply to comment #2)
> I'm not sure why it appears in Ubuntu 2.6.20. I think you need to ask the
> Ubuntu guys. 

It's hardly uncommon for a distro to choose a kernel (2.6.20), and then pull selectively from patches intended for a newer release without updating their kernel version to describe itself as that newer release (which it isn't).

What would you have the Ubuntu maintainers do instead?
Comment 4 Thomas Hellström 2007-04-28 13:50:17 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > I'm not sure why it appears in Ubuntu 2.6.20. I think you need to ask the
> > Ubuntu guys. 
> It's hardly uncommon for a distro to choose a kernel (2.6.20), and then pull
> selectively from patches intended for a newer release without updating their
> kernel version to describe itself as that newer release (which it isn't).
> What would you have the Ubuntu maintainers do instead?

Actually I think that's fine. I cant really figure out why they would want to pull vm_insert_pfn, since AFAICT it is only used by DRM and cell, but anyway they are free to do what they want.

The more important question raised here is what are the DRM developers expected to do about this? Should we maintain compatibility with all more or less selectively patched kernels from all distros?

Thomas
Comment 5 Dave Airlie 2007-04-28 18:00:13 UTC
We used to do this, but it takes a fair bit of effort... and I really couldn't be bothered, I run ubuntu here and I just ifdef around it rather than try to figure out what they did to their kernel..


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.