lkml.org 
[lkml]   [2011]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] misc: add CARMA DATA-FPGA Access Driver
On Wed, Feb 09, 2011 at 03:35:45PM -0800, Ira W. Snyder wrote:
> On Wed, Feb 09, 2011 at 10:27:40AM -0800, Dmitry Torokhov wrote:
>
> [ snip stuff I've already fixed in the next version ]
>
> > >
> > > The requirement is that the device stay open during reconfiguration.
> > > This provides for that. Readers just block for as long as the device is
> > > not producing data.
> >
> > OK, you still need to make sure you do not touch free/used buffer while
> > device is disabled. Also, you need to kick readers if you unbind the
> > driver, so maybe a new flag priv->exists should be introduced and
> > checked.
> >
>
> I don't understand what you mean by "kick readers if you unbind the
> driver". The kernel automatically increases the refcount on a module
> when a process is using the module. This shows up in the "Used by"
> column of lsmod's output.
>
> The kernel will not let you rmmod a module with a non-zero refcount. You
> cannot get into the situation where you have rmmod'ed the module and a
> reader is still blocking in read()/poll().

However you can still unbind the driver from the device by writing into
driver's sysfs 'unbind' attribute.

See drivers/base/bus.c::driver_unbind().

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2011-02-10 00:45    [W:0.042 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site