Re: Bad performance change: "USB: serial: usb_debug,usb_generic_serial: implement sysrq and serial break"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> When the tty layer requests a serial break the usb_debug driver sends
> the magic packet.  On the receiving side the magic packet is thrown
> away or a sysrq is activated depending on what kernel .config options
> have been set.

Really it ought to be runtime. And magic packets of data that can occur
in other places are asking for trouble in general paths.

> non usb uart based drivers implement the sysrq handling.  This will
> allow other usb serial devices to implement sysrq handling as desired.

Which for the normal "break received" case is good

> +	if (port->console) {
> +		for (i = 0; i < urb->actual_length; i++, ch++) {
> +			if (!usb_serial_handle_sysrq_char(port, *ch))
> +				tty_insert_flip_char(tty, *ch, TTY_NORMAL);
> +		}
> +		tty_flip_buffer_push(tty);
> +	} else if (urb->actual_length) {
> +		i = tty_buffer_request_room(tty, urb->actual_length);
> +		if (i) {
> +			tty_insert_flip_string(tty, urb->transfer_buffer, i);
>  			tty_flip_buffer_push(tty);

I'd check urb->actual_length first ?

The bit that wants to be inline needs to look something
like

	if (unlikely(port->sysrq_enabled))
		uninlined_slow_path()
	else {
		tty_insert_flip_string(tty,
		urb->transfer_buffer, i);		
  		tty_flip_buffer_push(tty);
	}

(You don't need the request_room and for non DMA block transfers its
probably actually not beneficial to override the default allocation
behaviour)

I suspect it would be a good thing to support both normal break and magic
packet as independant options (eg sysrq_enabled = 1 and = 2 or as
bitmasks, but with 0 = fastpath).

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux