Skip to contentSkip to conversation

agpgart.ko can't be unloaded

DISCUSSION Krzysztof Halasa 4 participants 7 messages Dec 15, 2005 – Dec 17, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:

Module                  Size  Used by
intel_agp              19228  1 
agpgart                27592  1 intel_agp

The same is true for via_agp and probably for all other drivers.

The problem is agpgart increases reference count of hw driver to prevent it from being unloaded, and the hw driver references agpgart so agpgart can't be unloaded either.

Should agpgart be split into 2 parts, one (which would have to be unloaded first) managing the thing and the other - the library referenced by hw drivers?

I wouldn't write about this but there is code to unload them so I think it's not intentional.

Signature · 1 line
Krzysztof Halasa
#1 lore raw
Quoted 6 lines

I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:

Module                  Size  Used by
intel_agp              19228  1 
agpgart                27592  1 intel_agp

BTW: "rmmod -w agpgart intel_agp" hangs in uninterruptible sleep state ("D") forever.

This is i386 (Athlon XP to be precise), FC4-current, 2.6.14.

Signature · 1 line
Krzysztof Halasa
#2 lore raw
Quoted 9 lines · Krzysztof Halasa
Quoted 6 lines

I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:

Module                  Size  Used by
intel_agp              19228  1 
agpgart                27592  1 intel_agp

BTW: "rmmod -w agpgart intel_agp" hangs in uninterruptible sleep state ("D") forever.

That can happen; "rmmod -w" will block until it's no longer used. Still used, still waiting.

Looks from these refcounts that intel_agp is being used. Who is holding the refcount?

Cheers,
Rusty.

Signature · 1 line
 ccontrol: http://ozlabs.org/~rusty/ccontrol
#3 lore raw
Quoted 5 lines · Rusty Russell

That can happen; "rmmod -w" will block until it's no longer used. Still used, still waiting.

Looks from these refcounts that intel_agp is being used. Who is holding the refcount?

That's another story - they have deadlocked wrt refcounts, that's why rmmod is waiting so hard.

I'd expect the rmmod to be interruptible, though. Thanks for info.

Signature · 1 line
Krzysztof Halasa
#4 lore raw
In reply to Krzysztof Halasa
Quoted 11 lines · Krzysztof Halasa

Hi,

I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:

Module                  Size  Used by
intel_agp              19228  1 
agpgart                27592  1 intel_agp

The same is true for via_agp and probably for all other drivers.

Quoted 7 lines

The problem is agpgart increases reference count of hw driver to prevent it from being unloaded, and the hw driver references agpgart so agpgart can't be unloaded either.

Should agpgart be split into 2 parts, one (which would have to be unloaded first) managing the thing and the other - the library referenced by hw drivers?

the reference on the chipset driver should only be bumped when /dev/agpgart is open()'d, but currently that isn't the case.

Quoted 2 lines

I wouldn't write about this but there is code to unload them so I think it's not intentional.

The reference counting has been horked since the 'new' module loader appeared[*], and never got fixed as I've nearly always found something more important to work on, and it's not really a problem for 99% of users. If someone found the time to write a patch to make it do the right thing though, I'd be happy to merge it as long as it's done correctly.

Dave

[*] In fact, my first attempt at fixing it way back then may have even made the problem worse.

#5 lore raw
Quoted 2 lines · Dave Jones

the reference on the chipset driver should only be bumped when /dev/agpgart is open()'d, but currently that isn't the case.

Ok. I will look at it then.

Signature · 1 line
Krzysztof Halasa
#6 lore raw
In reply to Krzysztof Halasa

Hi,

Quoted 8 lines

I recently noticed that agpgart.ko (and corresponding hardware driver) can't be unloaded:

Module                  Size  Used by
intel_agp              19228  1 
agpgart                27592  1 intel_agp

The same is true for via_agp and probably for all other drivers.

I am able to remove it with "rmmod -f" without problems and reinsert them again. It does not feel good, but at least they are out when one really wants to.

Jan Engelhardt