mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Remy Bohmer" <linux@bohmer.net>
To: "Haavard Skinnemoen" <hskinnemoen@atmel.com>
Cc: "Andrew Victor" <linux@maxim.org.za>,
	"ARM Linux Mailing List"
	<linux-arm-kernel@lists.arm.linux.org.uk>,
	"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atmel_serial: Split the interrupt handler
Date: Tue, 18 Dec 2007 16:23:11 +0100	[thread overview]
Message-ID: <3efb10970712180723x2cd22c5ei6b342f0ab7cc39c2@mail.gmail.com> (raw)
In-Reply-To: <1197987255-23045-1-git-send-email-hskinnemoen@atmel.com>

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

Hello Haavard,

A few remarks:

> From: Remy Bohmer <hskinnemoen@atmel.com>

My name, at your address ;-)))

> This patch splits up the interrupt handler of the serial port
> into a interrupt top-half and a tasklet.

I see you moved the handling of the sysrq-key to the tasklet. This was
actually a very nice feature in the IRQ-top half on preempt-RT. This
helps debugging running away RT-processes.

> In this version of the patch, we try to only do things that are
> absolutely necessary in the interrupt handler, storing away the
> status register along with the received character and letting the
> tasklet handle break, sysrq, error flags, etc.

Preempt-RT now absolutely requires my (4th) IRQ_NODELAY patch, because
the spinlock now is always inside the code, and not only in
theexception path, and thus without my NO_DELAY patch we have a panic
during boot.
On preempt-RT this spinlock must be a raw-spinlock. (If this type is
known in the mainline kernel, you can apply that patch it anyway)

BTW: Attached I have added a 2nd patch that I use for Preempt-RT. (For
cleaner startup, and to get rid of useless IRQ-threads.

> This patch should apply on top of the cleanup patch I sent earlier

For the cleanup patch:
Acked-by: Remy Bohmer <linux@bohmer.net>

> today. Or at least I think so...I'll send the full series once
> everyone are happy.

So, for this patch: I am almost happy ;-)


Kind Regards,

Remy

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: prevent_startup_interrupt_thread_dbgu.patch --]
[-- Type: text/x-patch; name=prevent_startup_interrupt_thread_dbgu.patch, Size: 1483 bytes --]

This patch prevents starting up a useless IRQ-thread for IRQ-1,
because this IRQ is running in IRQF_NODELAY context due to the 
timer interrupt.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
---
 drivers/serial/atmel_serial.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: linux-2.6.23/drivers/serial/atmel_serial.c
===================================================================
--- linux-2.6.23.orig/drivers/serial/atmel_serial.c	2007-12-18 15:49:02.000000000 +0100
+++ linux-2.6.23/drivers/serial/atmel_serial.c	2007-12-18 15:56:37.000000000 +0100
@@ -549,6 +549,7 @@ static int atmel_startup(struct uart_por
 {
 	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
 	int retval;
+	unsigned long irqflags = IRQF_SHARED;
 
 	/*
 	 * Ensure that no interrupts are enabled otherwise when
@@ -557,10 +558,17 @@ static int atmel_startup(struct uart_por
 	 */
 	UART_PUT_IDR(port, -1);
 
+#ifdef CONFIG_PREEMPT_RT
+	/* IRQ1 is the System IRQ, which is shared with the Timer-IRQ, and
+	   thus it is running in IRQF_NODELAY context. By setting this flag
+	   here also, we prevent starting up a useless IRQ-thread.*/
+	if (port->irq == 1)
+		irqflags |= IRQF_NODELAY;
+#endif
 	/*
 	 * Allocate the IRQ
 	 */
-	retval = request_irq(port->irq, atmel_interrupt, IRQF_SHARED,
+	retval = request_irq(port->irq, atmel_interrupt, irqflags,
 			"atmel_serial", port);
 	if (retval) {
 		printk("atmel_serial: atmel_startup - Can't get irq\n");

  reply	other threads:[~2007-12-18 15:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 14:14 Haavard Skinnemoen
2007-12-18 15:23 ` Remy Bohmer [this message]
2007-12-18 17:19   ` Haavard Skinnemoen
2007-12-18 19:18     ` Remy Bohmer
2007-12-19 12:34   ` Haavard Skinnemoen
2007-12-19 12:50     ` Remy Bohmer
2007-12-19 13:11       ` Haavard Skinnemoen
2007-12-19 13:18         ` Remy Bohmer
2007-12-19 13:24           ` Haavard Skinnemoen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3efb10970712180723x2cd22c5ei6b342f0ab7cc39c2@mail.gmail.com \
    --to=linux@bohmer.net \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linux@maxim.org.za \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®