Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b51e0cee authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'usb-serial-4.12-rc2' of...

Merge tag 'usb-serial-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial

 into usb-linus

Johan writes:

USB-serial fixes for v4.12-rc2

Here's a fix for a long-standing issue in the ftdi_sio driver that
prevented unprivileged users from updating the low-latency flag,
something which became apparent after a recent change that restored the
older setting of not using low-latency mode by default.

A run of sparse revealed a couple of endianness issues that are now
fixed, and addressed is also a user-triggerable division-by-zero in
io_ti when debugging is enabled.

Finally there are some new device ids, including a simplification of how
we deal with a couple of older Olimex JTAG adapters.

All have been in linux-next with no reported issues.

Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parents 6df2b42f 8d7a10dd
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -809,10 +809,10 @@ static const struct usb_device_id id_table_combined[] = {
	{ USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) },
	{ USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) },
	{ USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID),
	{ USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID),
		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
	{ USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID),
	{ USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID, 1) },
		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
	{ USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID, 1) },
	{ USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID),
	{ USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_PID, 1) },
		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
	{ USB_DEVICE_INTERFACE_NUMBER(OLIMEX_VID, OLIMEX_ARM_USB_TINY_H_PID, 1) },
	{ USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID),
	{ USB_DEVICE(FIC_VID, FIC_NEO1973_DEBUG_PID),
		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
	{ USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID),
	{ USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID),
@@ -1527,9 +1527,9 @@ static int set_serial_info(struct tty_struct *tty,
					(new_serial.flags & ASYNC_FLAGS));
					(new_serial.flags & ASYNC_FLAGS));
	priv->custom_divisor = new_serial.custom_divisor;
	priv->custom_divisor = new_serial.custom_divisor;


check_and_exit:
	write_latency_timer(port);
	write_latency_timer(port);


check_and_exit:
	if ((old_priv.flags & ASYNC_SPD_MASK) !=
	if ((old_priv.flags & ASYNC_SPD_MASK) !=
	     (priv->flags & ASYNC_SPD_MASK)) {
	     (priv->flags & ASYNC_SPD_MASK)) {
		if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
		if ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
+2 −0
Original line number Original line Diff line number Diff line
@@ -882,6 +882,8 @@
/* Olimex */
/* Olimex */
#define OLIMEX_VID			0x15BA
#define OLIMEX_VID			0x15BA
#define OLIMEX_ARM_USB_OCD_PID		0x0003
#define OLIMEX_ARM_USB_OCD_PID		0x0003
#define OLIMEX_ARM_USB_TINY_PID	0x0004
#define OLIMEX_ARM_USB_TINY_H_PID	0x002a
#define OLIMEX_ARM_USB_OCD_H_PID	0x002b
#define OLIMEX_ARM_USB_OCD_H_PID	0x002b


/*
/*
+4 −1
Original line number Original line Diff line number Diff line
@@ -2336,8 +2336,11 @@ static void change_port_settings(struct tty_struct *tty,
	if (!baud) {
	if (!baud) {
		/* pick a default, any default... */
		/* pick a default, any default... */
		baud = 9600;
		baud = 9600;
	} else
	} else {
		/* Avoid a zero divisor. */
		baud = min(baud, 461550);
		tty_encode_baud_rate(tty, baud, baud);
		tty_encode_baud_rate(tty, baud, baud);
	}


	edge_port->baud_rate = baud;
	edge_port->baud_rate = baud;
	config->wBaudRate = (__u16)((461550L + baud/2) / baud);
	config->wBaudRate = (__u16)((461550L + baud/2) / baud);
+12 −9
Original line number Original line Diff line number Diff line
@@ -197,6 +197,7 @@ static u8 ir_xbof_change(u8 xbof)
static int ir_startup(struct usb_serial *serial)
static int ir_startup(struct usb_serial *serial)
{
{
	struct usb_irda_cs_descriptor *irda_desc;
	struct usb_irda_cs_descriptor *irda_desc;
	int rates;


	irda_desc = irda_usb_find_class_desc(serial, 0);
	irda_desc = irda_usb_find_class_desc(serial, 0);
	if (!irda_desc) {
	if (!irda_desc) {
@@ -205,18 +206,20 @@ static int ir_startup(struct usb_serial *serial)
		return -ENODEV;
		return -ENODEV;
	}
	}


	rates = le16_to_cpu(irda_desc->wBaudRate);

	dev_dbg(&serial->dev->dev,
	dev_dbg(&serial->dev->dev,
		"%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n",
		"%s - Baud rates supported:%s%s%s%s%s%s%s%s%s\n",
		__func__,
		__func__,
		(irda_desc->wBaudRate & USB_IRDA_BR_2400) ? " 2400" : "",
		(rates & USB_IRDA_BR_2400) ? " 2400" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_9600) ? " 9600" : "",
		(rates & USB_IRDA_BR_9600) ? " 9600" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_19200) ? " 19200" : "",
		(rates & USB_IRDA_BR_19200) ? " 19200" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_38400) ? " 38400" : "",
		(rates & USB_IRDA_BR_38400) ? " 38400" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_57600) ? " 57600" : "",
		(rates & USB_IRDA_BR_57600) ? " 57600" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_115200) ? " 115200" : "",
		(rates & USB_IRDA_BR_115200) ? " 115200" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_576000) ? " 576000" : "",
		(rates & USB_IRDA_BR_576000) ? " 576000" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_1152000) ? " 1152000" : "",
		(rates & USB_IRDA_BR_1152000) ? " 1152000" : "",
		(irda_desc->wBaudRate & USB_IRDA_BR_4000000) ? " 4000000" : "");
		(rates & USB_IRDA_BR_4000000) ? " 4000000" : "");


	switch (irda_desc->bmAdditionalBOFs) {
	switch (irda_desc->bmAdditionalBOFs) {
	case USB_IRDA_AB_48:
	case USB_IRDA_AB_48:
+1 −1
Original line number Original line Diff line number Diff line
@@ -189,7 +189,7 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,
		return -ENOMEM;
		return -ENOMEM;


	divisor = mct_u232_calculate_baud_rate(serial, value, &speed);
	divisor = mct_u232_calculate_baud_rate(serial, value, &speed);
	put_unaligned_le32(cpu_to_le32(divisor), buf);
	put_unaligned_le32(divisor, buf);
	rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
	rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
				MCT_U232_SET_BAUD_RATE_REQUEST,
				MCT_U232_SET_BAUD_RATE_REQUEST,
				MCT_U232_SET_REQUEST_TYPE,
				MCT_U232_SET_REQUEST_TYPE,
Loading