Skip to content

Commit 8a65af0

Browse files
committed
Merge tag 'tty-7.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial fixes from Greg KH: "Here are some small tty/serial/vt fixes for 7.2-rc3 that resolve some reported problems. Included in here are: - vt spurious modifier issue that showed up in -rc1 (reported a bunch) - 8250 driver bugfixes - msm serial driver bugfix - max310x serial driver bugfix All of these have been in linux-next with no reported issues" * tag 'tty-7.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250: Ignore flow control on suspend/resume with no_console_suspend serial: 8250_mid: Disable DMA for selected platforms serial: 8250_omap: clear rx_running on zero-length DMA completes vt: fix spurious modifier in CSI/cursor key sequences serial: msm: Disable DMA for kernel console UART serial: max310x: implement gpio_chip::get_direction()
2 parents 534f8f0 + 302fbbb commit 8a65af0

6 files changed

Lines changed: 44 additions & 9 deletions

File tree

drivers/tty/serial/8250/8250_mid.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/module.h>
1111
#include <linux/pci.h>
1212
#include <linux/rational.h>
13+
#include <linux/util_macros.h>
1314

1415
#include <linux/dma/hsu.h>
1516

@@ -368,8 +369,16 @@ static const struct mid8250_board dnv_board = {
368369
.freq = 133333333,
369370
.base_baud = 115200,
370371
.bar = 1,
371-
.setup = dnv_setup,
372-
.exit = dnv_exit,
372+
/*
373+
* Errata:
374+
* HSUART May Stop Functioning when DMA is Active.
375+
*
376+
* - Denverton document #572409, rev 3.4, DNV60
377+
* - Ice Lake Xeon D document #714070, ICXD65
378+
* - Snowridge document #731931, SNR44
379+
*/
380+
.setup = PTR_IF(false, dnv_setup),
381+
.exit = PTR_IF(false, dnv_exit),
373382
};
374383

375384
static const struct pci_device_id pci_ids[] = {

drivers/tty/serial/8250/8250_omap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,11 +944,12 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
944944
dev_err(p->port.dev, "teardown incomplete\n");
945945
}
946946
}
947+
948+
dma->rx_running = 0;
947949
if (!count)
948950
goto out;
949951
ret = tty_insert_flip_string(tty_port, dma->rx_buf, count);
950952

951-
dma->rx_running = 0;
952953
p->port.icount.rx += ret;
953954
p->port.icount.buf_overrun += count - ret;
954955
out:

drivers/tty/serial/8250/8250_port.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,8 +2000,14 @@ static void wait_for_xmitr(struct uart_8250_port *up, int bits)
20002000

20012001
tx_ready = wait_for_lsr(up, bits);
20022002

2003-
/* Wait up to 1s for flow control if necessary */
2004-
if (uart_console_hwflow_active(&up->port)) {
2003+
/*
2004+
* Wait up to 1s for flow control if necessary.
2005+
* When 'no_console_suspend' is active (in the window between
2006+
* suspend() and resume()), flow control is temporarily ignored
2007+
* because the canary workaround is not reliable in all situations,
2008+
* leading to flow control timeouts for every character.
2009+
*/
2010+
if (uart_console_hwflow_active(&up->port) && !up->canary) {
20052011
for (tmout = 1000000; tmout; tmout--) {
20062012
unsigned int msr = serial_in(up, UART_MSR);
20072013
up->msr_saved_flags |= msr & MSR_SAVE_FLAGS;

drivers/tty/serial/max310x.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,17 @@ static int max310x_gpio_set(struct gpio_chip *chip, unsigned int offset,
12431243
return 0;
12441244
}
12451245

1246+
static int max310x_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
1247+
{
1248+
struct max310x_port *s = gpiochip_get_data(chip);
1249+
struct uart_port *port = &s->p[offset / 4].port;
1250+
unsigned int val;
1251+
1252+
val = max310x_port_read(port, MAX310X_GPIOCFG_REG);
1253+
1254+
return val & BIT(offset % 4) ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
1255+
}
1256+
12461257
static int max310x_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
12471258
{
12481259
struct max310x_port *s = gpiochip_get_data(chip);
@@ -1446,6 +1457,7 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty
14461457
s->gpio.owner = THIS_MODULE;
14471458
s->gpio.parent = dev;
14481459
s->gpio.label = devtype->name;
1460+
s->gpio.get_direction = max310x_gpio_get_direction;
14491461
s->gpio.direction_input = max310x_gpio_direction_input;
14501462
s->gpio.get = max310x_gpio_get;
14511463
s->gpio.direction_output= max310x_gpio_direction_output;

drivers/tty/serial/msm_serial.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,8 @@ static int msm_startup(struct uart_port *port)
12281228
data |= MSM_UART_MR1_AUTO_RFR_LEVEL0 & rfr_level;
12291229
msm_write(port, data, MSM_UART_MR1);
12301230

1231-
if (msm_port->is_uartdm) {
1231+
/* Disable DMA for console to prevent PIO/DMA collisions */
1232+
if (msm_port->is_uartdm && !uart_console(port)) {
12321233
msm_request_tx_dma(msm_port, msm_port->uart.mapbase);
12331234
msm_request_rx_dma(msm_port, msm_port->uart.mapbase);
12341235
}

drivers/tty/vt/keyboard.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,16 +765,22 @@ static void k_fn(struct vc_data *vc, unsigned char value, char up_flag)
765765
/*
766766
* Compute xterm-style modifier parameter for CSI sequences.
767767
* Returns 1 + (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0)
768+
*
769+
* Only the canonical modifier weights are counted. The left/right variants
770+
* (KG_SHIFTL, KG_SHIFTR, KG_CTRLL, KG_CTRLR) and KG_ALTGR are commonly
771+
* repurposed as keymap layout-group or level selectors rather than as plain
772+
* modifiers (for instance XKB-derived keymaps select the layout group with
773+
* KG_SHIFTL/KG_SHIFTR), so counting them would encode a spurious modifier.
768774
*/
769775
static int csi_modifier_param(void)
770776
{
771777
int mod = 1;
772778

773-
if (shift_state & (BIT(KG_SHIFT) | BIT(KG_SHIFTL) | BIT(KG_SHIFTR)))
779+
if (shift_state & BIT(KG_SHIFT))
774780
mod += 1;
775-
if (shift_state & (BIT(KG_ALT) | BIT(KG_ALTGR)))
781+
if (shift_state & BIT(KG_ALT))
776782
mod += 2;
777-
if (shift_state & (BIT(KG_CTRL) | BIT(KG_CTRLL) | BIT(KG_CTRLR)))
783+
if (shift_state & BIT(KG_CTRL))
778784
mod += 4;
779785
return mod;
780786
}

0 commit comments

Comments
 (0)