From patchwork Sat Jun 3 14:42:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 101327 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp203957qgd; Sat, 3 Jun 2017 07:44:14 -0700 (PDT) X-Received: by 10.98.192.134 with SMTP id g6mr11960932pfk.26.1496501054262; Sat, 03 Jun 2017 07:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496501054; cv=none; d=google.com; s=arc-20160816; b=t6VXBuEGPNCEZytr/7z3i/lELL7uAs1JA8fQLfUb6P+5qxGZlhyiZwB6xVcIKErrIG aNvEi/nxHBY1DAi5K7oUVrYp1vPMS7JXpBRabovKzhAur42+6AqMR8EfszIYlpdSQSDU iJrBkMRwNiJJ1wnOrZ0QWMocpuXm9DaNcDlmRS9I5cbmUBy47GYejKxTxgZrC6SK6F+9 2hgxjFjbo1LsfxNJ+HN2mhEXRlR8+Eujn1NcVwPQ4/AKy/qPBxZ0Gz4bLoVGm3yacuEf HeUhbSNTvfe30RUlumiQrR36fhAmrT+SoHoeQjHou4ZpJ7IdgXVmH60haUg13nmRcq1i STPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3mL7U13BoT2g+Y/Krj6xL7W0FneQRf7/jf5zG6HgJ5k=; b=ojXd3snKZ0IdK+MV+wx3b+tixiLKdGnpEZIM2wS676d8WE9asQ1VUlgkapRHP0jRxo ZvwvjUx+OvJ6FNs+kSbnUZeERdv2x2UH1ee9x7sIfhz9XZfol21JS6gn3tsEA/SFCBEC 7pib5hRqWXlFFAjx0yGM/n9MiIGQmEyVkkOx8kdSk0x4WC8H+iJn4BWUHYnHCml8ooRA Vwoh+HaPcwETvKJ0AXZTmorMR61UpDd9j8PK3+BA0artfvJEtrPZkc1DjRVTEO4Z5eEy asWlZ4/7dpdsWFY0TcZceV3/uZomuNMMim0riVNv8HRiaqEpceGNwan3QS1YB7qqh7Rk Kp2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si2514676plk.369.2017.06.03.07.44.13; Sat, 03 Jun 2017 07:44:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751278AbdFCOnt (ORCPT + 25 others); Sat, 3 Jun 2017 10:43:49 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:33175 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750765AbdFCOnq (ORCPT ); Sat, 3 Jun 2017 10:43:46 -0400 Received: by mail-pf0-f171.google.com with SMTP id 83so6370306pfr.0 for ; Sat, 03 Jun 2017 07:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3mL7U13BoT2g+Y/Krj6xL7W0FneQRf7/jf5zG6HgJ5k=; b=X1UilP7CpF9PebN2N47s0U9R/jzharAYWoijrml2+0Z/JfGltc5RbpzK0e3oLqJKqu svcgaRGCOcXfx4Mv+VPTwO9IdlTqJH6QzIvSq82PS/4sSuGcKGNh7vrQrsNorIf4jqa2 qJDUntl1CvaaLmmd/JgUgVzblkFneM2jlo/OU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3mL7U13BoT2g+Y/Krj6xL7W0FneQRf7/jf5zG6HgJ5k=; b=H/MqFIAF3Eu/m0nCbfwOOwUt0sUXUO+Fpt3xw0ZzVfPkeRRVnU1Eaui1mDWKZnFko+ AVEl7K9VHuKL5EoUMZ3XKHKvlP7vTuHjpudQR0wpAFsnl68xN3QUA48sHtVVliNL8FCf 5X2VdZEflkWyyOIeheSWff7uEEC/WJGBO0mg5+dvNyGkzQX8+pX6dxGh2FSFvziHDzEX qjkOVSVsMi72W69RzZoNyL1cFhEr2W2UkvBged6jPTFQtDCsMiGG7UClb7Bj2hdkQ11F UPIGbAO0amjcssUGWKL1256lAQGKBotpMW9DP9V3C2OvCLewzHgEY2GrZ5rjumyy34QU k6LQ== X-Gm-Message-State: AODbwcDZraEHQSgnwIX8lXNUgSksnKBK9rmTrQo4CtGM52dXLUdNUAkO P9P3Z9xtVBNbDwcEMYbATw== X-Received: by 10.84.197.131 with SMTP id n3mr5463608pld.170.1496501025604; Sat, 03 Jun 2017 07:43:45 -0700 (PDT) Received: from localhost.localdomain (li1568-49.members.linode.com. [139.162.88.49]) by smtp.gmail.com with ESMTPSA id s68sm43510861pgc.5.2017.06.03.07.43.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Jun 2017 07:43:44 -0700 (PDT) From: Leo Yan To: Mathieu Poirier , Will Deacon , Suzuki K Poulose , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mike Leach , Chunyan Zhang Cc: Leo Yan Subject: [PATCH v1 4/4] coresight: etb10: hook panic callback Date: Sat, 3 Jun 2017 22:42:56 +0800 Message-Id: <1496500976-18362-5-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496500976-18362-1-git-send-email-leo.yan@linaro.org> References: <1496500976-18362-1-git-send-email-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch is to hook panic callback for etb10 driver; so after panic can dump trace data from it. Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-etb10.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index 979ea6e..c9ea281 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -473,6 +473,21 @@ static void etb_update_buffer(struct coresight_device *csdev, CS_LOCK(drvdata->base); } +static int etb_panic_cb(struct coresight_device *csdev) +{ + struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); + unsigned long flags; + + spin_lock_irqsave(&drvdata->spinlock, flags); + etb_disable_hw(drvdata); + etb_dump_hw(drvdata); + spin_unlock_irqrestore(&drvdata->spinlock, flags); + + dev_err(drvdata->dev, "Dump ETB buffer 0x%x@0x%p\n", + drvdata->buffer_depth, drvdata->buf); + return 0; +} + static const struct coresight_ops_sink etb_sink_ops = { .enable = etb_enable, .disable = etb_disable, @@ -481,6 +496,7 @@ static const struct coresight_ops_sink etb_sink_ops = { .set_buffer = etb_set_buffer, .reset_buffer = etb_reset_buffer, .update_buffer = etb_update_buffer, + .panic_cb = etb_panic_cb, }; static const struct coresight_ops etb_cs_ops = {