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: 30174 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 536AE20446 for ; Wed, 14 May 2014 15:59:37 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id ma3sf9897054pbc.3 for ; Wed, 14 May 2014 08:59:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=X15D3yvdP+aY0dAKJFpsjf9h6hfgKoF1ZUNjHT4fUug=; b=lR04QCHeXSKRL0tEJzSHgVa4ulTZefiMdOvGVeUqSrIF2QeXLVc2pWVMtjF8X2dUGq 6KIAdSi5c7Ip6lC61HRumPoO7Tgam5FqRwMRigvywCwEfZ5KvdgeAhYmoQLZpAXtFb/C FJxyfLhOcEEc1U0obhlIbANjiIMVoU6DzwBQLyhIIvHGQRphI5UBNolZO8uf3HcChc+c Pgqf8+T27JIvaGBsJfT+EDHIF8K3aantoyWCeycaypbKLA+Xg4sI5pqbb/lVa4UeuaOT Rrd01YxWXDp3y/ZlJFra7v5vaqzHDMMrWkl7ISPWdLqRPjdeTeLGrbbe219eBB3gdwD1 y6jA== X-Gm-Message-State: ALoCoQl+C7K/t+2MdDwBIvM6AjcpWLlf6KIaqG4DjvrHSf0w7g00b4kvwBwcT+eWcQkgFQIOA3SD X-Received: by 10.66.122.70 with SMTP id lq6mr10587429pab.47.1400083176666; Wed, 14 May 2014 08:59:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.145 with SMTP id h17ls2377118qgd.31.gmail; Wed, 14 May 2014 08:59:36 -0700 (PDT) X-Received: by 10.221.51.77 with SMTP id vh13mr997179vcb.41.1400083176575; Wed, 14 May 2014 08:59:36 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id mr9si395635vec.119.2014.05.14.08.59.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 08:59:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id hy4so2732455vcb.11 for ; Wed, 14 May 2014 08:59:36 -0700 (PDT) X-Received: by 10.52.181.132 with SMTP id dw4mr355304vdc.86.1400083176491; Wed, 14 May 2014 08:59:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp251770vcb; Wed, 14 May 2014 08:59:35 -0700 (PDT) X-Received: by 10.180.11.178 with SMTP id r18mr27096885wib.41.1400083175497; Wed, 14 May 2014 08:59:35 -0700 (PDT) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx.google.com with ESMTPS id hj14si5208989wib.38.2014.05.14.08.59.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 08:59:35 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; Received: by mail-wi0-f174.google.com with SMTP id r20so8290608wiv.13 for ; Wed, 14 May 2014 08:59:35 -0700 (PDT) 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 Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, Daniel Thompson , linux-kernel@vger.kernel.org, John Stultz , Anton Vorontsov , Colin Cross , Dirk Behme , kernel-team@android.com, Russell King , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , "David A. Long" , Nicolas Pitre , Catalin Marinas , Frederic Weisbecker , Linus Walleij , Christoffer Dall , linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, devicetree@vger.kernel.org, linux-serial@vger.kernel.org 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; }