lkml.org 
[lkml]   [2008]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 38/76] tty: usb-serial krefs
On Sun, Oct 05, 2008 at 10:36:58PM -0700, Greg KH wrote:
> Should we be calling kref_get() and kref_put() in interrupt context?
> Could we just get the reference in open and then put in close when we
> are done with it for each driver?

That depends how you handle hangups and interrupt synchronization. If you
can be sure you will get no more interrupts before you drop the reference
in close/hangup then yes that should be fine. In particular watch out for
the fact that hangup/close/re-open can run pretty much in parallel with
cases like

close called by user
interrupted by carrier drop causing hangup

in parallel another open begins and blocks waiting a close

(Obviously for hotplug some further care is needed on the unplug paths)

Right now USB serial doesn't actually address all those cases anyway I suspect.
I wasn't going to attack that until I had a common tty_port and tty_port code
to do all that work rather than trying to fix each group of drivers.

Alan



\
 
 \ /
  Last update: 2008-10-06 11:05    [W:0.066 / U:51.604 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site