Messages in this thread | | | Date | Tue, 8 Apr 2014 15:52:47 +0200 | From | Johan Hovold <> | Subject | Re: [PATCH] cdc-acm: some enhancement on acm delayed write |
| |
> > > If I see this correctly, then ASYNCB_INITIALIZED is cleared in > > > tty_port_close() we is called from acm_tty_close(). Thus it should > > > be enough to make sure that the device is resumed at the beginning > > > of acm_tty_close() and acm_resume() will do the job automatically. > > > What do you think? > > > > But the device should already be about to be resumed, right? If the port > > Yes. > > > is closed fast enough that resume hasn't had time to run before > > shutdown is called I think the right thing to do is simply to discard > > the delayed bytes (in shutdown). > > I think if we said we have transmitted then we should do so.
We haven't made any such promises -- only that we've buffered the data. Just like any write urb can be cancelled at close / shutdown before having been transmitted.
The user needs to use closing_wait or drain_delay to give the buffers a chance to empty. If not used at all, or we get a time out, then the data should be discarded.
Johan
| |