linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Mendoza-Jonas <sam@mendozajonas.com>
To: linuxppc-dev@ozlabs.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Alistair Popple <alistair@popple.id.au>,
	Samuel Mendoza-Jonas <sam@mendozajonas.com>,
	"# 4 . 1 . x-" <stable@vger.kernel.org>
Subject: [PATCH V2 2/2] tty/hvc: Use opal irqchip interface if available
Date: Mon, 11 Jul 2016 13:38:58 +1000	[thread overview]
Message-ID: <20160711033858.16172-2-sam@mendozajonas.com> (raw)
In-Reply-To: <20160711033858.16172-1-sam@mendozajonas.com>

Update the hvc driver to use the OPAL irqchip if made available by the
running firmware. If it is not present, the driver falls back to the
existing OPAL event number.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <stable@vger.kernel.org> # 4.1.x-
---
v2: Always try irq_of_parse_and_map before falling back

 drivers/tty/hvc/hvc_opal.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index b7cd0ae..5107993 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -214,7 +214,13 @@ static int hvc_opal_probe(struct platform_device *dev)
 		dev->dev.of_node->full_name,
 		boot ? " (boot console)" : "");
 
-	irq = opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));
+	irq = irq_of_parse_and_map(dev->dev.of_node, 0);
+	if (!irq) {
+		pr_info("hvc%d: No interrupts property, using OPAL event\n",
+				termno);
+		irq = opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));
+	}
+
 	if (!irq) {
 		pr_err("hvc_opal: Unable to map interrupt for device %s\n",
 			dev->dev.of_node->full_name);
-- 
2.9.0

  reply	other threads:[~2016-07-11  3:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11  3:38 [PATCH V2 1/2] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles Samuel Mendoza-Jonas
2016-07-11  3:38 ` Samuel Mendoza-Jonas [this message]
2016-07-11  6:28   ` [PATCH V2 2/2] tty/hvc: Use opal irqchip interface if available Michael Ellerman
2016-07-27 14:32   ` [V2,2/2] " Michael Ellerman
2016-07-11  6:29 ` [PATCH V2 1/2] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles Michael Ellerman
2016-07-26  4:11   ` Michael Ellerman
2016-07-26  4:28     ` Greg KH
2016-07-26  9:49       ` Michael Ellerman
2016-07-27 14:32 ` [V2,1/2] " Michael Ellerman

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=20160711033858.16172-2-sam@mendozajonas.com \
    --to=sam@mendozajonas.com \
    --cc=alistair@popple.id.au \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).