Bug 99012 - (ICH5) i830 depends on agpgart but module dependencies don't show it
(ICH5) i830 depends on agpgart but module dependencies don't show it
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ernie Petrides
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-07-11 13:40 EDT by Bill Peck
Modified: 2007-11-30 17:06 EST (History)
9 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Bill Peck 2003-07-11 13:40:36 EDT
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
/lib/modules/2.4.21-1.1931.2.323.ent/kernel/drivers/char/drm/i830.o:
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
failed

[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):
2.4.21-1.1931.2.323.ent

How reproducible:
everytime

Steps to Reproduce:
1. steps above
2.
3.
    
Actual results:


Expected results:


Additional info:
Comment 1 Rik van Riel 2003-09-15 13:43:09 EDT
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-25 20:42:47 EDT
can we close?
Comment 3 Bill Peck 2003-09-29 13:39:48 EDT
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 03:09:55 EST
Reassigning to davej, our agpgart dude.
Comment 5 Dave Jones 2004-10-25 22:11:10 EDT
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 15:36:10 EDT
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 02:33:21 EDT
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 02:35:31 EDT
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 03:20:49 EDT
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]
  inter_module_get("drm_agp")

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.