All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@codemonkey.org.uk>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ed Tomlinson <tomlins@cam.org>, linux-kernel@vger.kernel.org
Subject: Re: [drm:drm_init] *ERROR* Cannot initialize the agpgart module.
Date: Mon, 23 Dec 2002 12:10:22 +0000	[thread overview]
Message-ID: <20021223121022.GA32080@suse.de> (raw)
In-Reply-To: <20021223021009.C6CC32C0E3@lists.samba.org>

On Mon, Dec 23, 2002 at 12:10:47PM +1100, Rusty Russell wrote:
 > > This one is due to the way AGPGART does (or has done for the last 3
 > > years) its module locking. It does a MOD_INC_USE_COUNT as soon as
 > > someone calls the acquire routines.
 > Which is racy under SMP, and under preempt, which is why it's
 > deprecated.

Crapola. I've just realised why this is no longer relevant.
I've moved what this was protecting into the per chipset modules.
Right now its possible to load modules, start x (which loads DRM),
then rmmod via_agp from under its feet. result - boom when something
tries to use 3d.

Sure it's unlikely someone would be crazy enough to try and do this,
and they deserve what they get, but it's not exactly clean, or nice.

So where is the documentation describing module locking de jour ?

 > > (So you can't unload agpgart whilst you've a 3d using app (like X)
 > > open).  This seems quite sensible, but these days you can't unload
 > > agpgart.ko anyway because the chipset module (via-agp.ko in your
 > > case) already has it 'in use', so I'm tempted to drop those bits.
 > If this is true (it usually is), you can simply drop them.

I'll need 'something' in the chipset drivers. The first thing that
jumps to mind is to give the chipset drivers an 'acquire' op
which does the locking much like the old agp_backend_acquire() does.
 
 > There are other cases where the caller is not grabbing references, so
 > MOD_INC_USE_COUNT is better than nothing (should the warning stay for
 > 2.6?  Good question).

Why exactly isn't it safe any more?  If there's documentation on this,
I'd love to read it. If there isn't, there really should be.

		Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

  reply	other threads:[~2002-12-23 12:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20021218094714.43C712C076@lists.samba.org>
2002-12-18 12:57 ` [drm:drm_init] *ERROR* Cannot initialize the agpgart module Ed Tomlinson
2002-12-18 16:29   ` Dave Jones
     [not found] ` <200212181803.23279.tomlins@cam.org>
     [not found]   ` <20021219105909.GE29122@suse.de>
2002-12-20 23:29     ` Ed Tomlinson
2002-12-21 14:22       ` Dave Jones
2002-12-22  4:41         ` Ed Tomlinson
2002-12-22 12:28           ` Dave Jones
2002-12-22 14:08             ` Ed Tomlinson
2002-12-23  1:10         ` Rusty Russell
2002-12-23 12:10           ` Dave Jones [this message]
2002-12-26  3:51             ` Rusty Russell
2002-12-28  0:20               ` Roman Zippel
2002-12-17  1:49 Ed Tomlinson
2002-12-17  8:06 ` Paul P Komkoff Jr
2002-12-17 12:50   ` Ed Tomlinson
2002-12-20  1:30     ` Matt Bernstein
2002-12-20  1:43       ` Randy.Dunlap
2002-12-20  9:33         ` Dave Jones
2002-12-17 12:33 ` Dave Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021223121022.GA32080@suse.de \
    --to=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tomlins@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.