Bug 99012 - (ICH5) i830 depends on agpgart but module dependencies don't show it
Summary: (ICH5) i830 depends on agpgart but module dependencies don't show it
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel   
(Show other bugs)
Version: 3.0
Hardware: All Linux
Target Milestone: ---
Assignee: Ernie Petrides
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2003-07-11 17:40 UTC by Bill Peck
Modified: 2007-11-30 22:06 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-28 07:20:49 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Bill Peck 2003-07-11 17:40:36 UTC
Description of problem:
i830 requires agpgart to be loaded which would normally mean that modprobe would
then load agpgart all at once.  but evidently module dependancies are not being
done correctly.

Here is some examples:

[root@dhcp64-243 root]# modprobe i830
init_module: Cannot allocate memory
Hint: insmod errors can be caused by incorrect module parameters, including
invalid IO or IRQ parameters.
      You may find more information in syslog or the output from dmesg
/lib/modules/2.4.21-1.1931.2.323.ent/kernel/drivers/char/drm/i830.o: insmod
/lib/modules/2.4.21-1.1931.2.323.ent/kernel/drivers/char/drm/i830.o failed
/lib/modules/2.4.21-1.1931.2.323.ent/kernel/drivers/char/drm/i830.o: insmod i830

[drm:drm_init] *ERROR* Cannot initialize the agpgart module.

now I'll load agpgart
[root@dhcp64-243 root]# modprobe agpgart
[root@dhcp64-243 root]# lsmod
Module                  Size  Used by    Not tainted
agpgart                55672   0  (unused)

[root@dhcp64-243 root]# modprobe i830
[root@dhcp64-243 root]# lsmod
Module                  Size  Used by    Not tainted
i830                   71704   0  (unused)
agpgart                55672   1 

but agpgart doesn't show i830 in the used by field.  even though its used count
has gone to 1.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. steps above
Actual results:

Expected results:

Additional info:

Comment 1 Rik van Riel 2003-09-15 17:43:09 UTC
Bill, chances are this got fixed recently with a utilities upgrade.  Could you
please verify whether this problem still exists ?

Comment 2 Matt Wilson 2003-09-26 00:42:47 UTC
can we close?

Comment 3 Bill Peck 2003-09-29 17:39:48 UTC
It still acts the same.  I don't think its a showstopper but it should be fixed
eventually.  modules.dep confirms that there is no relationship between the two.

Comment 4 Jeff Garzik 2004-03-03 08:09:55 UTC
Reassigning to davej, our agpgart dude.

Comment 5 Dave Jones 2004-10-26 02:11:10 UTC
if this hasnt been fixed yet, it should be trivial to add a dependancy of
AGPGART to drivers/char/drm/Config.in

Comment 6 Ernie Petrides 2004-10-26 19:36:10 UTC
DaveJ, drivers/char/drm/Config.in has not been changed since
taroon-gold (initial release of RHEL3).  But there is this line:

  dep_tristate '  Intel 830M' CONFIG_DRM_I830 $CONFIG_AGP

Is this what you were suggesting?  If not, could you please take
back this bug and post an appropriate patch to rhkernel-list?

Thanks.  -ernie

Comment 7 Ernie Petrides 2005-10-28 06:33:21 UTC
I've reproduced this problem on the latest RHEL3 (2.4.21-37.7.EL), but I've
also determined that there are no unresolved global symbols in the i830.o
module that are satisfied by those exported from the agpgart.o module.  Thus,
the modules.dep file is in fact correct in not showing any dependencies.

However, I'm still at a loss to explain why the "modprobe i830" works iff
preceded by an "insmod agpgart".

Anyone on the cc: list have any ideas?

Comment 8 Ernie Petrides 2005-10-28 06:35:31 UTC
Don, adding you to cc: list, too (since you've been in the DRM code before).

Any ideas?  (Please read last comment.)

Comment 9 Ernie Petrides 2005-10-28 07:20:49 UTC
I think I've figured this out.  (The DRM code is absolutely abominable!
Tags and cscope are useless, function names are created from macro arg
concatentation, huge sections of code are generated from header files,
it's impossible to see function calling trees, and there are obscure
run-time dependencies on other modules.  This stuff is utterly amazing
... make that, downright aggravating!)

Anyway, here's the insmod failure chain (sources are in drivers/char/drm):

  [DRM(x) is defined as i830_##x in i830.h]
  drm_init()      [drm_drv.h]
  DRM(agp_init)   [drm_agpsupport.h]
  DRM_AGP_GET     [drm_agpsupport.h]

The last call returns NULL causing the insmod failure unless some other
module has previously called inter_module_register("drm_agp", ...), and
that is only done from agp_init() in drivers/char/agp/agpgart_be.c.

Thus, there is a run-time dependency but no global symbol dependency.

I concede this is a DRM bug due to a design flaw, but I don't think that
depmod-style module dependencies are an appropriate mechanism to fix this.

I recommend working around this problem with /etc/modules.conf, but I'm
closing this as WONTFIX.  If someone can suggest an easy way to solve this,
I'll reconsider.  But DRM is the only current user of this goofy interface.

Note You need to log in before you can comment on or make changes to this bug.