* [PATCH 0/2] serial: add sparse context annotation
@ 2020-07-23 12:14 Johan Hovold
2020-07-23 12:14 ` [PATCH 1/2] serial: pmac_zilog: " Johan Hovold
2020-07-23 12:14 ` [PATCH 2/2] serial: msm_serial: " Johan Hovold
0 siblings, 2 replies; 3+ messages in thread
From: Johan Hovold @ 2020-07-23 12:14 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial, linux-kernel, Johan Hovold
The Intel test robot reported a new sparse warning in pmac_zilog, which
wasn't actually new.
Add sparse annotation to the two drivers that release and reacquire the
port lock in their receive handlers to suppress these warnings.
Johan
Johan Hovold (2):
serial: pmac_zilog: add sparse context annotation
serial: msm_serial: add sparse context annotation
drivers/tty/serial/msm_serial.c | 2 ++
drivers/tty/serial/pmac_zilog.c | 1 +
2 files changed, 3 insertions(+)
--
2.26.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] serial: pmac_zilog: add sparse context annotation
2020-07-23 12:14 [PATCH 0/2] serial: add sparse context annotation Johan Hovold
@ 2020-07-23 12:14 ` Johan Hovold
2020-07-23 12:14 ` [PATCH 2/2] serial: msm_serial: " Johan Hovold
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2020-07-23 12:14 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Jiri Slaby, linux-serial, linux-kernel, Johan Hovold, kernel test robot
Add sparse context annotation to the receive handler, which releases and
reacquires the port lock, to silence a sparse warning:
drivers/tty/serial/pmac_zilog.c:255:36: sparse: sparse: context imbalance in 'pmz_receive_chars' - unexpected unlock
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/tty/serial/pmac_zilog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index ba65a3bbd72a..b0d8f4a6f9b4 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -213,6 +213,7 @@ static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable)
}
static bool pmz_receive_chars(struct uart_pmac_port *uap)
+ __must_hold(uap->port.lock)
{
struct tty_port *port;
unsigned char ch, r1, drop, flag;
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] serial: msm_serial: add sparse context annotation
2020-07-23 12:14 [PATCH 0/2] serial: add sparse context annotation Johan Hovold
2020-07-23 12:14 ` [PATCH 1/2] serial: pmac_zilog: " Johan Hovold
@ 2020-07-23 12:14 ` Johan Hovold
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2020-07-23 12:14 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-serial, linux-kernel, Johan Hovold
Add sparse context annotation to the receive handlers, which release and
reacquire the port lock, to silence sparse warnings:
drivers/tty/serial/msm_serial.c:748:25: warning: context imbalance in 'msm_handle_rx_dm' - unexpected unlock
drivers/tty/serial/msm_serial.c:814:28: warning: context imbalance in 'msm_handle_rx' - unexpected unlock
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/tty/serial/msm_serial.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 60a9c53fa7cb..7f26cda5ba1c 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -696,6 +696,7 @@ static void msm_enable_ms(struct uart_port *port)
}
static void msm_handle_rx_dm(struct uart_port *port, unsigned int misr)
+ __must_hold(port->lock)
{
struct tty_port *tport = &port->state->port;
unsigned int sr;
@@ -771,6 +772,7 @@ static void msm_handle_rx_dm(struct uart_port *port, unsigned int misr)
}
static void msm_handle_rx(struct uart_port *port)
+ __must_hold(port->lock)
{
struct tty_port *tport = &port->state->port;
unsigned int sr;
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-23 12:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 12:14 [PATCH 0/2] serial: add sparse context annotation Johan Hovold
2020-07-23 12:14 ` [PATCH 1/2] serial: pmac_zilog: " Johan Hovold
2020-07-23 12:14 ` [PATCH 2/2] serial: msm_serial: " Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).