On Wed, Jun 14, 2017 at 4:33 PM, Alan Cox <gnomes@xxxxxxxxxxxxxxxxxxx> wrote: >> That would cut it, but TIOCPKT is too coupled with having a linked tty. >> I could make acm behave like a pty (accept TIOCPKT and issue the >> ctrl_status bits), but for that I need n_tty to know that packet does >> not always mean a linked tty is present, and that in case it isn't we >> take our own ctrl_status bits instead of the link's. I could write a >> small (inline?) function to fetch the correct ctrl_status bits and put >> that in n_tty. Does that make sense? > > I think that makes sense, and I would do the job properly rather than do > a hack with tty->link. Those hacks in the long term never work out the > best approach. > > Alan Ok, so I'm doing that and everything is great until I got to actually modifying tty->termios. I need to modify it from interrupt context (the usb_request's complete() callback), but modifying the termios requires a rw_semaphore I can't take. I could queue_work() to do it, but then I'd have to flush the work from another non-sleepable context in acm_disconnect() (which runs under a spinlock). I can't change the semaphore to a spinlock because some drivers that use it actually wanna sleep while holding it. Any ideas? -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html