From patchwork Thu Dec 21 08:20:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 122517 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp580556qgn; Thu, 21 Dec 2017 00:21:12 -0800 (PST) X-Google-Smtp-Source: ACJfBosMSQBF7lGM9OGx6t+gcwChgRHfxlnBnsyE5BQBw06Wp2UG+WcsI9LkFxUzEzUv77x1ZAwi X-Received: by 10.98.153.221 with SMTP id t90mr9697729pfk.210.1513844472461; Thu, 21 Dec 2017 00:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513844472; cv=none; d=google.com; s=arc-20160816; b=yRgp/xD19penojeFD+B5GpNx4zZHSrfOamKvk6JZakqGSpxkAoW2aqu0rNd6g0EecG PqqnjnIlT+SzVmd8FslT9i/ETr3SMJMHaRAOU/k9IcJ46oneQ0X6iA6L2UZLDbvYQoMO tCLD0X0NMeI3/ISVDQ8o8l2+R/uaJOrWeG2AC+imyG3RX/FxA9ijxdggNEtFm/W34Xp5 8O1Za6yUaNabYBhjgwTV3NITA8A4O3/kOxPyA+lvRkcDWUVfHWU7N2klN1AmSt9RCB6S aYO1QadIviQ9PD4UeFDPdryfUhia/iyF0sS+1PYEYIc1oo5hCjl7tn7d/EoorH0bdsp0 l4yQ== 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=VrQnCBWyYC/bWHHsGYRdCSdNpGE6DgLe9rHXJv0twrw=; b=wk3FyRaqBjBN0loUIM2NqHpHjuZynXBe/Oka7MjFIXuJgSDir5xA/QViaICguIktx9 gY2H4SlqJAnVmPNjPIF53V4rig2hrBgMxPOIe5Og3x/BGPddrhE3E3Pt0us2gg5bg/H7 FZzKWnZESrwF0zJYwXH8/mzRAtKXLOOnk5LZ7a3de4HTZMqM7XXrcXCiZgKp1VoO6dSy GXmfSNtnHScG5X4SM6nLegpvZBmUl5mmpVu8cuyfaWixM/LRkWy1ZH6obRfJq0WmfgTY V6nEUMX5WL1cNRABmKu1w31xr5Gw0KUREJzos31t/O5puspyxi9jVKTp+bTA2G1wV7wZ Tb6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QmVAUYjD; 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 8si14568944pfo.144.2017.12.21.00.21.12; Thu, 21 Dec 2017 00:21:12 -0800 (PST) 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 header.s=google header.b=QmVAUYjD; 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 S1751907AbdLUIVK (ORCPT + 28 others); Thu, 21 Dec 2017 03:21:10 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44596 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751685AbdLUIVE (ORCPT ); Thu, 21 Dec 2017 03:21:04 -0500 Received: by mail-pl0-f67.google.com with SMTP id n13so10586760plp.11 for ; Thu, 21 Dec 2017 00:21:03 -0800 (PST) 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=VrQnCBWyYC/bWHHsGYRdCSdNpGE6DgLe9rHXJv0twrw=; b=QmVAUYjDqqIl4lYzl8syiIDmJZ1lFIeSkbucwsCySdmT1KvfLgaCN4Dw8/DQzgRA/O l49QP5pKxusxYxhXFyVch5zwpfYRk9FwqAwsMQHUUJu561WPJ+XLOY24iJ6Ltn5gbhyg 6YtQ9gLARlBhJk3t4jPvya15yZTPYW4ILdgSw= 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=VrQnCBWyYC/bWHHsGYRdCSdNpGE6DgLe9rHXJv0twrw=; b=BqtSoRHIv4hEGgWooxeoPFpzITTNHcNaxkj7s8UtXEygxrERa0AwnNcNdBnoI+zBo3 1m2d1srMegZxbx+5JJFFQD6/c+NVfaMDr2K+4S5TYn2gPX+A+i1E+l1wHzYPTifiq/a8 ZAA9zVFFzO8Fq5smJfO9QeFzLjsccmPNJI061pvFD964L/nTnO0QUxifK/LR8LXdX4+T /GJS1PaNq/OcKs4XvX2c2c2HDcuzn6QuluZTb8T/D1/XiHlc7ALboIz9z3/YWc9F7bjB WRq98eeMRvyk43JttLigVPCYkHohzgSMPsz+Sj0u9dY2fx22gtQbgJdmwqLGg1DejMLo vOBA== X-Gm-Message-State: AKGB3mKgGMpZbEc6j5Sk4enH1IocE6SJQbCD5+OKMy1zPoG1wenVFZ4+ kYcHe4n1rXOjnwLOdrS7FVbs4Eb0Xh8= X-Received: by 10.159.247.134 with SMTP id e6mr9481274pls.279.1513844463689; Thu, 21 Dec 2017 00:21:03 -0800 (PST) Received: from localhost.localdomain (li159-223.members.linode.com. [173.230.149.223]) by smtp.gmail.com with ESMTPSA id r86sm43699720pfk.114.2017.12.21.00.20.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Dec 2017 00:21:02 -0800 (PST) From: Leo Yan To: Jonathan Corbet , Mathieu Poirier , Greg Kroah-Hartman , Will Deacon , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: Leo Yan Subject: [PATCH v3 5/6] coresight: Add and delete sink callback for panic kdump list Date: Thu, 21 Dec 2017 16:20:14 +0800 Message-Id: <1513844415-11427-6-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513844415-11427-1-git-send-email-leo.yan@linaro.org> References: <1513844415-11427-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 If the sink device has panic kdump callback, this means the sink device wants to save tracing data for panic happening. This commit adds node into panic kdump list when the sink device is enabled, and delete node when the sink device is disabled. Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 389c4ba..56798b1 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -146,6 +146,14 @@ static int coresight_enable_sink(struct coresight_device *csdev, u32 mode) if (ret) return ret; } + + /* Add into panic kdump list */ + if (sink_ops(csdev)->panic_cb) { + ret = coresight_kdump_add(csdev, 0); + if (ret) + return ret; + } + csdev->enable = true; } @@ -157,6 +165,10 @@ static int coresight_enable_sink(struct coresight_device *csdev, u32 mode) static void coresight_disable_sink(struct coresight_device *csdev) { if (atomic_dec_return(csdev->refcnt) == 0) { + /* Delete from panic kdump list */ + if (sink_ops(csdev)->panic_cb) + coresight_kdump_del(csdev); + if (sink_ops(csdev)->disable) { sink_ops(csdev)->disable(csdev); csdev->enable = false;