提交 d3a96c94 编写于 作者: L Lukas Wunner 提交者: Greg Kroah-Hartman

serial: pl011: Use cached copy of IMSC register

Commit 075167ed ("drivers: PL011: replace UART_MIS reading with
_RIS & _IMSC") amended this driver's interrupt handler to read the
Raw Interrupt Status (RIS) and Interrupt Mask Set/Clear (IMSC) registers
instead of the Masked Interrupt Status (MIS) register.  The change was
made to attain compatibility with SBSA UARTs which lack the MIS register.

However the IMSC register is cached by the driver.  Using the cached
copy saves one register read per interrupt.

I've tested this change successfully on a BCM2837 (Raspberry Pi CM3).

Cc: Mathias Duckeck <m.duckeck@kunbus.de>
Cc: Phil Elwell <phil@raspberrypi.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Mark Langsdorf <mlangsdo@redhat.com>
Cc: Naresh Bhat <nbhat@cavium.com>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: NLukas Wunner <lukas@wunner.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d8dcbdd0
...@@ -1480,12 +1480,10 @@ static irqreturn_t pl011_int(int irq, void *dev_id) ...@@ -1480,12 +1480,10 @@ static irqreturn_t pl011_int(int irq, void *dev_id)
struct uart_amba_port *uap = dev_id; struct uart_amba_port *uap = dev_id;
unsigned long flags; unsigned long flags;
unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT; unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT;
u16 imsc;
int handled = 0; int handled = 0;
spin_lock_irqsave(&uap->port.lock, flags); spin_lock_irqsave(&uap->port.lock, flags);
imsc = pl011_read(uap, REG_IMSC); status = pl011_read(uap, REG_RIS) & uap->im;
status = pl011_read(uap, REG_RIS) & imsc;
if (status) { if (status) {
do { do {
check_apply_cts_event_workaround(uap); check_apply_cts_event_workaround(uap);
...@@ -1509,7 +1507,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id) ...@@ -1509,7 +1507,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id)
if (pass_counter-- == 0) if (pass_counter-- == 0)
break; break;
status = pl011_read(uap, REG_RIS) & imsc; status = pl011_read(uap, REG_RIS) & uap->im;
} while (status != 0); } while (status != 0);
handled = 1; handled = 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册