From patchwork Thu Sep 29 08:49:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 9355957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 683776077A for ; Thu, 29 Sep 2016 08:52:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5077E29919 for ; Thu, 29 Sep 2016 08:52:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44EA32991E; Thu, 29 Sep 2016 08:52:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A482A29919 for ; Thu, 29 Sep 2016 08:52:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bpX3Q-0003eG-SS; Thu, 29 Sep 2016 08:50:56 +0000 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bpX2v-0002VV-Uo for linux-arm-kernel@lists.infradead.org; Thu, 29 Sep 2016 08:50:29 +0000 Received: by mail-lf0-x230.google.com with SMTP id g62so73472375lfe.3 for ; Thu, 29 Sep 2016 01:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/hH548HmZF2p2//xuJUpqAfm1td4OOBrKqShBYzxTW8=; b=evU3Vi30OClH5zqTZKrW2WPFKJl/OaHQY3Ert44kUZ1fnmNjH1F3THE9RIf+3Clmk4 Tlq0nZM79CC7vsqgWPonLmHr9J8USIJIUtpvZNJBZeNTnjJLxosgjX50wEVmhLZkUBs9 bD7ArG6pcV0aOK4951maQfv1DkPgeCkzaBYiY9XpjO1bB/1l8wy02HSx4WBrHyjqFSIY hZT9GGlLFOr+e/Tzjp5U1MGaINq0mOxnKNJi5l5HJMiIOBKpiIVqaMPa1r8LKo3JJcFG da0CO5jDh28nS6R2zwKh3frh7CxiYyn08P+aRUdDaQqM1hNcpk43PFMhnC7bQkZI29Yj OilA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/hH548HmZF2p2//xuJUpqAfm1td4OOBrKqShBYzxTW8=; b=PpVNiBatvPpUpZl04XYRgGgUNXMZWnMJ3f0kKJpnUb/wzge3roXiS2uesoCW2s6FwJ RitQKqrZGe8WuZecKKe5OTfTtJAis8EhW4JYuYakhAUBSVfZ5rhMUPtfFr1dfiZVFBy6 ukHJxgzb/neBoBMUD+V4jcuRt3HtZTfPtHke5MBMVFlqFD6fsI14OLjxj0QbLzFjeNyk +8TwZWNjiWK8/TfWZRkb5o38ApGF6QgrC2PI8tKp20YapEEsxLnlAQ3jw7WV8inKwaTH fXjSxSLV5rYXLBRTBDmng68273gBTvemYwoQTEiKJQXPEtmNbYznnkYNddHTAxv1njiw CfDg== X-Gm-Message-State: AA6/9Rkmh+xVKlMS2EitpAYphi4FBVjxmRHr1ih/XPCI06z4U+iZfdeYtbipHBhQHxik6A== X-Received: by 10.46.69.131 with SMTP id s125mr146977lja.29.1475139003592; Thu, 29 Sep 2016 01:50:03 -0700 (PDT) Received: from lnxartpec.se.axis.com (rocksteady.se.axis.com. [195.60.68.156]) by smtp.gmail.com with ESMTPSA id k129sm1937473lfg.37.2016.09.29.01.50.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2016 01:50:02 -0700 (PDT) Date: Thu, 29 Sep 2016 10:49:53 +0200 From: Rabin Vincent To: Mathieu Poirier Subject: Re: Crash seen on ARM Juno r1 with 4.8-rc8 when Coresight is enabled Message-ID: <20160929084953.GA24154@lnxartpec.se.axis.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160929_015026_204905_56A22437 X-CRM114-Status: GOOD ( 22.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Venkatesh Vivekanandan , Suzuki K Poulose , "linux-arm-kernel@lists.infradead.org" , Sudeep Holla Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Sep 28, 2016 at 11:41:41AM -0600, Mathieu Poirier wrote: > On 28 September 2016 at 10:35, Venkatesh Vivekanandan > wrote: > > [ 5.479353] Unable to handle kernel NULL pointer dereference at > > virtual address 00000000 > > [ 5.487372] pgd = ffff000008db1000 > > [ 5.490739] [00000000] *pgd=00000009ffffe003, > > *pud=00000009ffffd003, *pmd=0000000000000000 > > [ 5.498940] Internal error: Oops: 96000004 [#1] PREEMPT SMP > > [ 5.504451] Modules linked in: > > [ 5.507474] CPU: 0 PID: 449 Comm: kworker/0:1 Not tainted 4.8.0-rc8-dirty #1 > > [ 5.514447] Hardware name: ARM Juno development board (r1) (DT) > > [ 5.520310] Workqueue: events amba_deferred_retry_func > > [ 5.525394] task: ffff800976bfd780 task.stack: ffff8009760bc000 > > [ 5.531253] PC is at strcmp+0x1c/0x160 > > [ 5.534962] LR is at coresight_orphan_match+0x78/0xc8 > > [ 5.539957] pc : [] lr : [] > > pstate: 40000145 > > [ 5.547272] sp : ffff8009760bfa00 > > [ 5.550547] x29: ffff8009760bfa00 x28: ffff8009762c7f00 > > [ 5.555807] x27: ffff000008d66e46 x26: 0000000000000000 > > [ 5.561066] x25: 0000000000000001 x24: ffff000008702048 > > [ 5.566325] x23: 0000000000000000 x22: ffff800973ce5000 > > [ 5.571584] x21: ffff800973ce0800 x20: 0000000000000000 > > [ 5.576843] x19: ffff800976b08600 x18: 0000000000000000 > > [ 5.582101] x17: 0000000000000000 x16: ffff000008e52fff > > [ 5.587360] x15: ffff000008e52fff x14: ffffffffffffffff > > [ 5.592619] x13: ffff000008ca5000 x12: 0000000000000008 > > [ 5.597878] x11: 0000000000000020 x10: 0101010101010101 > > [ 5.603137] x9 : 0000000000000000 x8 : 7fff7f7f7f7f7f7f > > [ 5.608396] x7 : 0000000000000000 x6 : 000000008008cb22 > > [ 5.613655] x5 : 22cb080000000000 x4 : ffff800973ce0828 > > [ 5.618914] x3 : 0000000000000000 x2 : 3030303031303032 > > [ 5.624173] x1 : 0000000000000000 x0 : ffff8009760f1d08 > > [ 5.629432] > > Thanks you for reporting this Vankatesh, > > Sudeep and Suzuki, can you guys help me with this - I don't have an R1 > to test with. I've seen this too, on other platforms. This should fix it: 8<----------- From a9da7d7b47e67dd6ffcafddadb50e6f97503f296 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Tue, 30 Aug 2016 08:54:21 +0200 Subject: [PATCH] coresight: check for NULL child_name Connection child names associated to ports can sometimes be NULL, which is the case when booting a system on QEMU or when the Coresight power domain isn't switched on. fadf3a44e974 ("coresight: checking for NULL string in coresight_name_match()") fixed one place to handle this but the same check is needed in coresight_orphan_match() to prevent a crash there. Signed-off-by: Rabin Vincent --- drivers/hwtracing/coresight/coresight.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index d08d1ab..ceeaaea 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -725,7 +725,8 @@ static int coresight_orphan_match(struct device *dev, void *data) /* We have found at least one orphan connection */ if (conn->child_dev == NULL) { /* Does it match this newly added device? */ - if (!strcmp(dev_name(&csdev->dev), conn->child_name)) { + if (conn->child_name && + !strcmp(dev_name(&csdev->dev), conn->child_name)) { conn->child_dev = csdev; } else { /* This component still has an orphan */