kernel: bump 6.1 to 6.1.68
[openwrt/staging/stintel.git] / target / linux / bcm27xx / patches-6.1 / 950-0102-amba_pl011-Add-cts-event-workaround-DT-property.patch
1 From 4864acae00c88dc62956bf4a0bb369cf1989314c Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Fri, 29 Sep 2017 10:32:19 +0100
4 Subject: [PATCH] amba_pl011: Add cts-event-workaround DT property
5
6 The BCM2835 PL011 implementation seems to have a bug that can lead to a
7 transmission lockup if CTS changes frequently. A workaround was added to
8 the driver with a vendor-specific flag to enable it, but this flag is
9 currently not set for ARM implementations.
10
11 Add a "cts-event-workaround" property to Pi DTBs and use the presence
12 of that property to force the flag to be enabled in the driver.
13
14 See: https://github.com/raspberrypi/linux/issues/1280
15
16 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
17 ---
18 Documentation/devicetree/bindings/serial/pl011.yaml | 6 ++++++
19 drivers/tty/serial/amba-pl011.c | 5 +++++
20 2 files changed, 11 insertions(+)
21
22 --- a/Documentation/devicetree/bindings/serial/pl011.yaml
23 +++ b/Documentation/devicetree/bindings/serial/pl011.yaml
24 @@ -100,6 +100,12 @@ properties:
25 on the device.
26 enum: [1, 4]
27
28 + cts-event-workaround:
29 + description:
30 + Enables the (otherwise vendor-specific) workaround for the
31 + CTS-induced TX lockup.
32 + type: boolean
33 +
34 required:
35 - compatible
36 - reg
37 --- a/drivers/tty/serial/amba-pl011.c
38 +++ b/drivers/tty/serial/amba-pl011.c
39 @@ -2801,6 +2801,11 @@ static int pl011_probe(struct amba_devic
40 if (IS_ERR(uap->clk))
41 return PTR_ERR(uap->clk);
42
43 + if (of_property_read_bool(dev->dev.of_node, "cts-event-workaround")) {
44 + vendor->cts_event_workaround = true;
45 + dev_info(&dev->dev, "cts_event_workaround enabled\n");
46 + }
47 +
48 uap->reg_offset = vendor->reg_offset;
49 uap->vendor = vendor;
50 uap->fifosize = vendor->get_fifosize(dev);