From patchwork Wed May 14 15:58:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 4176131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3ADE69F387 for ; Wed, 14 May 2014 16:03:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6058B201FE for ; Wed, 14 May 2014 16:03:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7452A201F5 for ; Wed, 14 May 2014 16:03:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wkbbv-0001mj-Tn; Wed, 14 May 2014 16:00:51 +0000 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wkbb3-0008Tw-79 for linux-arm-kernel@lists.infradead.org; Wed, 14 May 2014 15:59:58 +0000 Received: by mail-wi0-f182.google.com with SMTP id r20so2673049wiv.3 for ; Wed, 14 May 2014 08:59:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X15D3yvdP+aY0dAKJFpsjf9h6hfgKoF1ZUNjHT4fUug=; b=Mvm+k6k7JU5mdJWss9r/3J0GxJZnfTy9RX2kAIxYSOU83eb/kxFNGKTKNzt5n3qt+K E1aDlakHNfbtkJbUgEpjS5xL0olll7TUsqJO74X3KDpTXbhtv9+N6h2ujg9MYicetrZh +nVnVicw8YvseS4hqCRCCYhFeGrijsiqxSJ/AiHLDL0Kps+q7xvVxS7Q773NWyn9XWK1 mNjHFHIioVmqp/arUW0Fxo8B8f3gKjG24tN9Gi9tmQ//MD11QVvJ7d4uih/CrD0u7yG9 nxbFFXbTgSzfXQB+MaskXSeytFAcNiknDoyWXwh225/2tBitJcDgTgGA7e+zty0cZH2N JwEA== X-Gm-Message-State: ALoCoQkZsSyxXWsyu/8ub3mSL8PLBQwV+TuT0J+nCbLxOjNUAOcsqFfwVim09tKg5ndeR1pgL72z X-Received: by 10.180.87.165 with SMTP id az5mr3309129wib.10.1400083175058; Wed, 14 May 2014 08:59:35 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id dn4sm4687808wib.18.2014.05.14.08.59.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 May 2014 08:59:34 -0700 (PDT) From: Daniel Thompson To: Jason Wessel , kgdb-bugreport@lists.sourceforge.net Subject: [RFC 5/8] serial: amba-pl011: Pass on FIQ information to KGDB. Date: Wed, 14 May 2014 16:58:42 +0100 Message-Id: <1400083125-1464-6-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1400083125-1464-1-git-send-email-daniel.thompson@linaro.org> References: <1400083125-1464-1-git-send-email-daniel.thompson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140514_085957_443217_93239E4D X-CRM114-Status: GOOD ( 14.59 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , kernel@stlinux.com, Frederic Weisbecker , Linus Walleij , Jiri Slaby , Daniel Thompson , Dirk Behme , Russell King , Nicolas Pitre , Ian Campbell , Anton Vorontsov , "David A. Long" , linux-serial@vger.kernel.org, Catalin Marinas , kernel-team@android.com, devicetree@vger.kernel.org, linaro-kernel@lists.linaro.org, Pawel Moll , patches@linaro.org, Kumar Gala , Rob Herring , John Stultz , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Colin Cross , Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is important this information comes from the serial driver because, by doing so, the driver offers "permission" for KGDB to route its interrupt signal from the drivers own handler to KGDBs FIQ handler (which will handle the interrupt signal by making polled I/O callbacks). Signed-off-by: Daniel Thompson --- drivers/tty/serial/amba-pl011.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index dacf0a0..aac817a 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -58,6 +58,7 @@ #include #include #include +#include #define UART_NR 14 @@ -2091,6 +2092,18 @@ static int pl011_probe_dt_alias(int index, struct device *dev) return ret; } +#ifdef CONFIG_KGDB_FIQ +/* Register with KGDB if there is a FIQ linked to this device */ +static void pl011_register_fiq(struct amba_device *dev) +{ + int fiq = dev->irq[1]; + if (fiq > 0) + kgdb_register_fiq(fiq); +} +#else +static void pl011_register_fiq(struct platform_device *pdev) {} +#endif + static int pl011_probe(struct amba_device *dev, const struct amba_id *id) { struct uart_amba_port *uap; @@ -2164,11 +2177,14 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) } ret = uart_add_one_port(&amba_reg, &uap->port); - if (ret) { + if (0 == ret) { + pl011_register_fiq(dev); + } else { amba_ports[i] = NULL; uart_unregister_driver(&amba_reg); pl011_dma_remove(uap); } + out: return ret; }