lkml.org 
[lkml]   [2002]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Problem with new driver model?
Patrick Mochel wrote:
>
> On 5 Jun 2002, Paul Fulghum wrote:
>
> > When testing the drivers I maintain on 2.5.20, I hit the
> > BUG_ON in include/linux/devices.txt:115.
>
> There is a patch that should fix this in Linus's tree.
>
> If you're using bitkeeper, you can pull it from
> linux.bkbits.net/linux-2.5.
>
> If not, it's appended here.
>
> -pat
>
> +void remove_driver(struct device_driver * drv)
> +{
> + spin_lock(&device_lock);
> + atomic_set(&drv->refcount,0);
> + spin_unlock(&device_lock);
> + __remove_driver(drv);
> +}
> +
> +/**
> + * put_driver - decrement driver's refcount and clean up if necessary
> + * @drv: driver in question
> + */
> +void put_driver(struct device_driver * drv)
> +{
> + if (!atomic_dec_and_lock(&drv->refcount,&device_lock))
> + return;
> + spin_unlock(&device_lock);
> +
> + __remove_driver(drv);
> +}

Shouldn't the calls to __remove_driver be done inside the device_lock?

--

Brian Gerst
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.046 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site