netdev
[Top] [All Lists]

Re: PATCH 2.4.0.9.2: export ethtool interface

To: Andrew Morton <andrewm@xxxxxxxxxx>
Subject: Re: PATCH 2.4.0.9.2: export ethtool interface
From: Andi Kleen <ak@xxxxxx>
Date: Thu, 21 Sep 2000 13:33:02 +0200
Cc: Donald Becker <becker@xxxxxxxxx>, "howling@xxxxxxxx" <havanna_moon@xxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <39C9F123.D8FA4F68@xxxxxxxxxx>; from Andrew Morton on Thu, Sep 21, 2000 at 01:30:42PM +0200
References: <39C883CF.9FB262FC@xxxxxxxxxx> <Pine.LNX.4.10.10009201152510.1031-100000@xxxxxxxxxxxxx> <39C9F123.D8FA4F68@xxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Thu, Sep 21, 2000 at 01:30:42PM +0200, Andrew Morton wrote:
> Donald Becker wrote:
> > 
> > ...
> > >   Not a thing you'd want
> > > to poll very frequently, particularly as some drivers are racy in this
> > > area, and the consequences of hitting the race could be quite bad.
> > > spin_lock_bh() is the correct solution for mdio protection, BTW.
> > 
> > Or having the timer based media monitor just skip the check until the next
> > tick if the lock is set.  Imagine taking timer interrupt during the
> > user-level ioctl()...  (There are a few other dangerous cases to consider as
> > well.)
> 
> Yes.  On 2.4 (at least) there is nothing to prevent the driver's ioctl()
> function from running on two or more CPUs simultaneously.

There is (2.4.0test9pre2): 

asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
        struct file * filp;
        unsigned int flag;
        int on, error = -EBADF;

        filp = fget(fd);
        if (!filp)
                goto out;
        error = 0;
        lock_kernel();                   <--------------
        switch (cmd) {



-Andi

<Prev in Thread] Current Thread [Next in Thread>