From patchwork Fri Mar 18 00:54:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 599288 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qR6Q45VX0z9sds for ; Fri, 18 Mar 2016 12:02:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b=vf/wdVQ/; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qR6Q44MQ8zDr3R for ; Fri, 18 Mar 2016 12:02:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b=vf/wdVQ/; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org X-Greylist: delayed 359 seconds by postgrey-1.35 at bilbo; Fri, 18 Mar 2016 12:00:58 AEDT Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b=vf/wdVQ/; dkim-atps=neutral Received: from mendozajonas.com (mendozajonas.com [188.166.185.233]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qR6NV53MpzDqGd for ; Fri, 18 Mar 2016 12:00:58 +1100 (AEDT) Received: from skellige.ozlabs.ibm.com (unknown [122.99.82.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: sam@mendozajonas.com) by mendozajonas.com (Postfix) with ESMTPSA id 2608A140054; Fri, 18 Mar 2016 08:54:55 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1458262497; bh=cobCjG9fnCJnoBolQtlR8/Mi+Dsqr0+2AKx63qcpc5I=; h=From:To:Cc:Subject:Date:From; b=vf/wdVQ/c2p9CV6Z5l5JEqvK0JeRdC4n6x/c642MjlWWmf8yzljROFXw+ayJ6Dom1 dnN66GUP9qK6iyXxVH+yA/4HWwJdcAIw3s5Wohf3gZ+gIEg7OLwqTUBhjfbS6ja7Hh 2C6ktVMbpRutJIIiRZG5XKiG/c9yhyM0vJ1zocLY= From: Samuel Mendoza-Jonas To: Subject: [PATCH] tty/hvc: Use IRQF_SHARED for hvc consoles Date: Fri, 18 Mar 2016 11:54:43 +1100 Message-Id: <1458262483-15149-1-git-send-email-sam@mendozajonas.com> X-Mailer: git-send-email 2.7.3 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , Samuel Mendoza-Jonas , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Jiri Slaby MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit 2def86a7200c ("hvc: Convert to using interrupts instead of opal events") enabled the use of interrupts in the hvc_driver for OPAL platforms. However on machines with more than one hvc console, any console after the first will fail to register an interrupt handler in notifier_add_irq() since all consoles share the same IRQ number but do not set the IRQF_SHARED flag: [ 51.179907] genirq: Flags mismatch irq 31. 00000000 (hvc_console) vs. 00000000 (hvc_console) [ 51.180010] hvc_open: request_irq failed with rc -16. This error propagates up to hvc_open() and the console is closed, but OPAL will still generate interrupts that are not handled, leading to rcu_sched stall warnings. Set IRQF_SHARED when calling request_irq, allowing additional consoles to start properly. Signed-off-by: Samuel Mendoza-Jonas Cc: # 4.1.x- Tested-by: Stewart Smith --- drivers/tty/hvc/hvc_irq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_irq.c b/drivers/tty/hvc/hvc_irq.c index c9adb05..621263a 100644 --- a/drivers/tty/hvc/hvc_irq.c +++ b/drivers/tty/hvc/hvc_irq.c @@ -14,6 +14,9 @@ static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance) /* if hvc_poll request a repoll, then kick the hvcd thread */ if (hvc_poll(dev_instance)) hvc_kick(); + /* We're safe to always return IRQ_HANDLED as the hvcd thread will + * iterate through each hvc_struct + */ return IRQ_HANDLED; } @@ -28,7 +31,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq) hp->irq_requested = 0; return 0; } - rc = request_irq(irq, hvc_handle_interrupt, 0, + rc = request_irq(irq, hvc_handle_interrupt, IRQF_SHARED, "hvc_console", hp); if (!rc) hp->irq_requested = 1;