linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spin_lock instead of spin_lock_irqsave in imx uart interuput
@ 2018-08-26 15:00 QIANJUN
  2018-08-26 17:04 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: QIANJUN @ 2018-08-26 15:00 UTC (permalink / raw)
  To: gregkh, jslaby, linux-serial, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 61 bytes --]

spin_lock instead of spin_lock_irqsave in imx uart interuput

[-- Attachment #2: 0001-before-the-programe-into-the-uart-interuput-s-handle.patch --]
[-- Type: text/x-diff, Size: 2580 bytes --]

From 6580790d7be51a78d1376b90df49b04019a1f944 Mon Sep 17 00:00:00 2001
From: jun qian <hangdianqj@163.com>
Date: Sun, 26 Aug 2018 06:58:35 -0700
Subject: [PATCH] before the programe into the uart interuput's handler, the
 system has already disabled the local cpu interuput. so the spin_lock
 interface is More suitable for here.

Signed-off-by: jun qian <hangdianqj@163.com>
---
 drivers/tty/serial/imx.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 239c0fa2e981..3069ee93583e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -706,27 +706,25 @@ static irqreturn_t imx_uart_rtsint(int irq, void *dev_id)
 {
 	struct imx_port *sport = dev_id;
 	u32 usr1;
-	unsigned long flags;
 
-	spin_lock_irqsave(&sport->port.lock, flags);
+	spin_lock(&sport->port.lock);
 
 	imx_uart_writel(sport, USR1_RTSD, USR1);
 	usr1 = imx_uart_readl(sport, USR1) & USR1_RTSS;
 	uart_handle_cts_change(&sport->port, !!usr1);
 	wake_up_interruptible(&sport->port.state->port.delta_msr_wait);
 
-	spin_unlock_irqrestore(&sport->port.lock, flags);
+	spin_unlock(&sport->port.lock);
 	return IRQ_HANDLED;
 }
 
 static irqreturn_t imx_uart_txint(int irq, void *dev_id)
 {
 	struct imx_port *sport = dev_id;
-	unsigned long flags;
 
-	spin_lock_irqsave(&sport->port.lock, flags);
+	spin_lock(&sport->port.lock);
 	imx_uart_transmit_buffer(sport);
-	spin_unlock_irqrestore(&sport->port.lock, flags);
+	spin_unlock(&sport->port.lock);
 	return IRQ_HANDLED;
 }
 
@@ -735,9 +733,8 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id)
 	struct imx_port *sport = dev_id;
 	unsigned int rx, flg, ignored = 0;
 	struct tty_port *port = &sport->port.state->port;
-	unsigned long flags;
 
-	spin_lock_irqsave(&sport->port.lock, flags);
+	spin_lock(&sport->port.lock);
 
 	while (imx_uart_readl(sport, USR2) & USR2_RDR) {
 		u32 usr2;
@@ -797,7 +794,7 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id)
 	}
 
 out:
-	spin_unlock_irqrestore(&sport->port.lock, flags);
+	spin_unlock(&sport->port.lock);
 	tty_flip_buffer_push(port);
 	return IRQ_HANDLED;
 }
@@ -903,13 +900,11 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id)
 	}
 
 	if (usr1 & USR1_DTRD) {
-		unsigned long flags;
-
 		imx_uart_writel(sport, USR1_DTRD, USR1);
 
-		spin_lock_irqsave(&sport->port.lock, flags);
+		spin_lock(&sport->port.lock);
 		imx_uart_mctrl_check(sport);
-		spin_unlock_irqrestore(&sport->port.lock, flags);
+		spin_unlock(&sport->port.lock);
 
 		ret = IRQ_HANDLED;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: spin_lock instead of spin_lock_irqsave in imx uart interuput
  2018-08-26 15:00 spin_lock instead of spin_lock_irqsave in imx uart interuput QIANJUN
@ 2018-08-26 17:04 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-08-26 17:04 UTC (permalink / raw)
  To: QIANJUN; +Cc: jslaby, linux-serial, linux-kernel

On Sun, Aug 26, 2018 at 08:00:42AM -0700, QIANJUN wrote:
> spin_lock instead of spin_lock_irqsave in imx uart interuput

What does that mean?

> >From 6580790d7be51a78d1376b90df49b04019a1f944 Mon Sep 17 00:00:00 2001
> From: jun qian <hangdianqj@163.com>
> Date: Sun, 26 Aug 2018 06:58:35 -0700
> Subject: [PATCH] before the programe into the uart interuput's handler, the
>  system has already disabled the local cpu interuput. so the spin_lock
>  interface is More suitable for here.

Why is this here?  The changelog text belongs in the changelog, not in
the subject line :(

can you fix this all up and resend?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-26 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-26 15:00 spin_lock instead of spin_lock_irqsave in imx uart interuput QIANJUN
2018-08-26 17:04 ` Greg KH

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).