Thread (27 messages) 27 messages, 6 authors, 2020-10-28

Re: [patch V2 03/13] USB: serial: keyspan_pda: Consolidate room query

From: Johan Hovold <johan@kernel.org>
Date: 2020-10-25 17:05:46
Also in: linux-omap, linux-samsung-soc, linux-usb, lkml

On Mon, Oct 19, 2020 at 12:06:32PM +0200, Thomas Gleixner wrote:
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Having two copies of the same code doesn't make the code more readable and
allocating a buffer of 1 byte for a synchronous operation is a pointless
exercise.
As Alan pointed out, this buffer is in fact required and not pointless
at all even if reallocating it may be suboptimal.

Note however that there are several further allocations done by
usb_control_msg() for each control request.
Allocate a byte buffer at init which can be used instead. The buffer is
only used in open() and tty->write(). Console writes are not calling into
the query. open() obviously happens before write() and the writes are
serialized by bit 0 of port->write_urbs_free which protects also the
transaction itself.
As I mentioned in my comments to the previous patch, I've rewritten the
driver so that is no longer does this query in the write path. I kept
the buffer allocation for now though in case you want to rework this one
top.

Johan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help