Skip to content

Commit 1519fc7

Browse files
committed
Merge tag 'tty-6.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial fixes from Greg KH: "Here are some small tty and serial driver fixes for 6.17-rc6 that resolve some reported problems. Included in here are: - 8250 driver dt bindings fixes - broadcom serial driver binding fixes - hvc_console bugfix - xilinx serial driver bugfix - sc16is7xx serial driver bugfix All of these have been in linux-next for the past week with no reported issues" * tag 'tty-6.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: xilinx_uartps: read reg size from DTS tty: hvc_console: Call hvc_kick in hvc_write unconditionally dt-bindings: serial: 8250: allow "main" and "uart" as clock names dt-bindings: serial: 8250: move a constraint dt-bindings: serial: brcm,bcm7271-uart: Constrain clocks serial: sc16is7xx: fix bug in flow control levels init
2 parents d6b4278 + b5e3277 commit 1519fc7

File tree

5 files changed

+42
-46
lines changed

5 files changed

+42
-46
lines changed

Documentation/devicetree/bindings/serial/8250.yaml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ allOf:
4848
oneOf:
4949
- required: [ clock-frequency ]
5050
- required: [ clocks ]
51-
5251
- if:
5352
properties:
5453
compatible:
@@ -60,12 +59,39 @@ allOf:
6059
items:
6160
- const: uartclk
6261
- const: reg
63-
else:
62+
- if:
63+
properties:
64+
compatible:
65+
contains:
66+
const: spacemit,k1-uart
67+
then:
6468
properties:
6569
clock-names:
6670
items:
6771
- const: core
6872
- const: bus
73+
- if:
74+
properties:
75+
compatible:
76+
contains:
77+
enum:
78+
- spacemit,k1-uart
79+
- nxp,lpc1850-uart
80+
then:
81+
required:
82+
- clocks
83+
- clock-names
84+
properties:
85+
clocks:
86+
minItems: 2
87+
clock-names:
88+
minItems: 2
89+
else:
90+
properties:
91+
clocks:
92+
maxItems: 1
93+
clock-names:
94+
maxItems: 1
6995

7096
properties:
7197
compatible:
@@ -162,6 +188,9 @@ properties:
162188
minItems: 1
163189
maxItems: 2
164190
oneOf:
191+
- enum:
192+
- main
193+
- uart
165194
- items:
166195
- const: core
167196
- const: bus
@@ -264,29 +293,6 @@ required:
264293
- reg
265294
- interrupts
266295

267-
if:
268-
properties:
269-
compatible:
270-
contains:
271-
enum:
272-
- spacemit,k1-uart
273-
- nxp,lpc1850-uart
274-
then:
275-
required:
276-
- clocks
277-
- clock-names
278-
properties:
279-
clocks:
280-
minItems: 2
281-
clock-names:
282-
minItems: 2
283-
else:
284-
properties:
285-
clocks:
286-
maxItems: 1
287-
clock-names:
288-
maxItems: 1
289-
290296
unevaluatedProperties: false
291297

292298
examples:

Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ properties:
4141
- const: dma_intr2
4242

4343
clocks:
44-
minItems: 1
44+
maxItems: 1
4545

4646
clock-names:
4747
const: sw_baud

drivers/tty/hvc/hvc_console.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ static ssize_t hvc_write(struct tty_struct *tty, const u8 *buf, size_t count)
543543
}
544544

545545
/*
546-
* Racy, but harmless, kick thread if there is still pending data.
546+
* Kick thread to flush if there's still pending data
547+
* or to wakeup the write queue.
547548
*/
548-
if (hp->n_outbuf)
549-
hvc_kick();
549+
hvc_kick();
550550

551551
return written;
552552
}

drivers/tty/serial/sc16is7xx.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,17 +1177,6 @@ static int sc16is7xx_startup(struct uart_port *port)
11771177
sc16is7xx_port_write(port, SC16IS7XX_FCR_REG,
11781178
SC16IS7XX_FCR_FIFO_BIT);
11791179

1180-
/* Enable EFR */
1181-
sc16is7xx_port_write(port, SC16IS7XX_LCR_REG,
1182-
SC16IS7XX_LCR_CONF_MODE_B);
1183-
1184-
regcache_cache_bypass(one->regmap, true);
1185-
1186-
/* Enable write access to enhanced features and internal clock div */
1187-
sc16is7xx_port_update(port, SC16IS7XX_EFR_REG,
1188-
SC16IS7XX_EFR_ENABLE_BIT,
1189-
SC16IS7XX_EFR_ENABLE_BIT);
1190-
11911180
/* Enable TCR/TLR */
11921181
sc16is7xx_port_update(port, SC16IS7XX_MCR_REG,
11931182
SC16IS7XX_MCR_TCRTLR_BIT,
@@ -1199,7 +1188,8 @@ static int sc16is7xx_startup(struct uart_port *port)
11991188
SC16IS7XX_TCR_RX_RESUME(24) |
12001189
SC16IS7XX_TCR_RX_HALT(48));
12011190

1202-
regcache_cache_bypass(one->regmap, false);
1191+
/* Disable TCR/TLR access */
1192+
sc16is7xx_port_update(port, SC16IS7XX_MCR_REG, SC16IS7XX_MCR_TCRTLR_BIT, 0);
12031193

12041194
/* Now, initialize the UART */
12051195
sc16is7xx_port_write(port, SC16IS7XX_LCR_REG, SC16IS7XX_LCR_WORD_LEN_8);

drivers/tty/serial/xilinx_uartps.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#define CDNS_UART_MINOR 0 /* works best with devtmpfs */
3434
#define CDNS_UART_NR_PORTS 16
3535
#define CDNS_UART_FIFO_SIZE 64 /* FIFO size */
36-
#define CDNS_UART_REGISTER_SPACE 0x1000
3736
#define TX_TIMEOUT 500000
3837

3938
/* Rx Trigger level */
@@ -1098,15 +1097,15 @@ static int cdns_uart_verify_port(struct uart_port *port,
10981097
*/
10991098
static int cdns_uart_request_port(struct uart_port *port)
11001099
{
1101-
if (!request_mem_region(port->mapbase, CDNS_UART_REGISTER_SPACE,
1100+
if (!request_mem_region(port->mapbase, port->mapsize,
11021101
CDNS_UART_NAME)) {
11031102
return -ENOMEM;
11041103
}
11051104

1106-
port->membase = ioremap(port->mapbase, CDNS_UART_REGISTER_SPACE);
1105+
port->membase = ioremap(port->mapbase, port->mapsize);
11071106
if (!port->membase) {
11081107
dev_err(port->dev, "Unable to map registers\n");
1109-
release_mem_region(port->mapbase, CDNS_UART_REGISTER_SPACE);
1108+
release_mem_region(port->mapbase, port->mapsize);
11101109
return -ENOMEM;
11111110
}
11121111
return 0;
@@ -1121,7 +1120,7 @@ static int cdns_uart_request_port(struct uart_port *port)
11211120
*/
11221121
static void cdns_uart_release_port(struct uart_port *port)
11231122
{
1124-
release_mem_region(port->mapbase, CDNS_UART_REGISTER_SPACE);
1123+
release_mem_region(port->mapbase, port->mapsize);
11251124
iounmap(port->membase);
11261125
port->membase = NULL;
11271126
}
@@ -1780,6 +1779,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
17801779
* and triggers invocation of the config_port() entry point.
17811780
*/
17821781
port->mapbase = res->start;
1782+
port->mapsize = resource_size(res);
17831783
port->irq = irq;
17841784
port->dev = &pdev->dev;
17851785
port->uartclk = clk_get_rate(cdns_uart_data->uartclk);

0 commit comments

Comments
 (0)