From patchwork Wed Mar 20 18:49:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 160722 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp626955jan; Wed, 20 Mar 2019 11:51:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1HubnI0Oju6vHw4H1EAOE0UyfT/P4DJ2WsFvlfFFJlHHEOtQ2aB3FhLLeX/f/hGygRZ+9 X-Received: by 2002:a65:6489:: with SMTP id e9mr8781935pgv.260.1553107916157; Wed, 20 Mar 2019 11:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553107916; cv=none; d=google.com; s=arc-20160816; b=cL/ajhx5WpIqXTIreR4osh+bx5RWNouQ+hM5HWPS9v5O3o8QLaPuPpckQoChyNhWT2 xdgGUpGrHnw84sKmPvRYLf/aiyIvJ74svYdXxLcmTp3HVpyJleKMl080aV0F9sCHworF bj1UVQmdbIxXyq+FF24QwZHBoUaAS0QLYVzK+pHkLJFnJOr76cHQHH5fZz8S+lSsy9UK ge2aiLiideDTGEGAvifG29lq9D/dS2HsPBc5Y3B++l3yghpoy2GhOZqSHI9PX0H8akz9 k/6mt6TBKjzskd4/njsDnk77zo9HBwiKPUE6ugdLJ5ARWjsLcIQ1SDMCCcsoeafu4YuV L43A== 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; bh=l/I07nCsy3hy/cIFaDIhTBYtMuwTfdLWlXZ6iKQSlw8=; b=hpqjYazPD0eDZ6Gk86r9lyW7PVzjEEV+CUX3uipRxb2NB5M3MVfhiKvIYo9+psbH75 q8V+6p1WBRc6RpSeDGPAX+rNxhNwOgzGyLQNjwgeJnKLRN90yWiitF4+LCnCR+V4DB0Y kRkHzR3Br68iliSHMY7ZEyrzfN+LOuNLoJQ+yRxr92kOocc31JUhA7+pscxjVCcM2i02 M4JGMVuFeYxfFCWNiKlrCNV+uCRx3eT88+1fCa15CnIQacPjxJowULE4E3rNDvARLzXt 7n35XQuMAe45QH3uqy0TkiFG7m6dflyoulXyV9q6o8Rj28AOY1ycDkNVpvZQfuL3BJZR fQnw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si2575835plw.242.2019.03.20.11.51.55; Wed, 20 Mar 2019 11:51:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727805AbfCTSvy (ORCPT + 31 others); Wed, 20 Mar 2019 14:51:54 -0400 Received: from foss.arm.com ([217.140.101.70]:44920 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727577AbfCTSua (ORCPT ); Wed, 20 Mar 2019 14:50:30 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3956A1AC1; Wed, 20 Mar 2019 11:50:30 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B3CFF3F59C; Wed, 20 Mar 2019 11:50:28 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, coresight@lists.linaro.org, mike.leach@linaro.org, robert.walker@arm.com, Suzuki K Poulose , Mathieu Poirier Subject: [PATCH 12/25] coresight: etm: Clean up device specific data Date: Wed, 20 Mar 2019 18:49:29 +0000 Message-Id: <1553107783-3340-13-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553107783-3340-1-git-send-email-suzuki.poulose@arm.com> References: <1553107783-3340-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Track the coresight device instead of the real device. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm3x.c | 6 +++--- drivers/hwtracing/coresight/coresight-etm4x.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index be302ec..1b9ae3a 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -462,7 +462,7 @@ int etm_get_trace_id(struct etm_drvdata *drvdata) if (!local_read(&drvdata->mode)) return drvdata->traceid; - pm_runtime_get_sync(drvdata->dev); + pm_runtime_get_sync(drvdata->dev->parent); spin_lock_irqsave(&drvdata->spinlock, flags); @@ -471,7 +471,7 @@ int etm_get_trace_id(struct etm_drvdata *drvdata) CS_LOCK(drvdata->base); spin_unlock_irqrestore(&drvdata->spinlock, flags); - pm_runtime_put(drvdata->dev); + pm_runtime_put(drvdata->dev->parent); out: return trace_id; @@ -803,7 +803,6 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id) drvdata->use_cp14 = of_property_read_bool(np, "arm,cp14"); } - drvdata->dev = &adev->dev; dev_set_drvdata(dev, drvdata); /* Validity for the resource is already checked by the AMBA core */ @@ -864,6 +863,7 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id) goto err_arch_supported; } + drvdata->dev = &drvdata->csdev->dev; ret = etm_perf_symlink(drvdata->csdev, true); if (ret) { coresight_unregister(drvdata->csdev); diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 08ce37c..8d5ee3b 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -987,7 +987,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) adev->dev.platform_data = pdata; } - drvdata->dev = &adev->dev; dev_set_drvdata(dev, drvdata); /* Validity for the resource is already checked by the AMBA core */ @@ -1042,6 +1041,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) goto err_arch_supported; } + drvdata->dev = &drvdata->csdev->dev; ret = etm_perf_symlink(drvdata->csdev, true); if (ret) { coresight_unregister(drvdata->csdev); @@ -1049,7 +1049,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) } pm_runtime_put(&adev->dev); - dev_info(dev, "CPU%d: ETM v%d.%d initialized\n", + dev_info(drvdata->dev, "CPU%d: ETM v%d.%d initialized\n", drvdata->cpu, drvdata->arch >> 4, drvdata->arch & 0xf); if (boot_enable) {