Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3892740pxb; Tue, 10 Nov 2020 02:50:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHMayfkAaV228hsyikuC8ISFoKVEenS9f3IZP6phPQR1gv6M00bny7vxpk8nhRPVKhiEnQ X-Received: by 2002:a05:6402:cb4:: with SMTP id cn20mr20096283edb.235.1605005424452; Tue, 10 Nov 2020 02:50:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605005424; cv=none; d=google.com; s=arc-20160816; b=B6BXDITRyg3IBiLSKiVXPomN+vqDSIHVvG+bwjDcVZS4j+zmlHMu0IMWVO6z5y5ein /9ZlH6NnK01wn6FiqLeV8xVtFHy84IFgztZ5Oy2D9hh9GoAH2bC2tQagdZ9RwAmuWyO3 CaIm53zi0JOCfAg9f/rVmfWoOO6o9Rf2JBDc/0JFPzcS9JMqX/sg0aXPkA+F5iQXdg7g aenc08NMtnTswYTmDVriDPiPcuXB7Nhh/pMPBXhAPF6lf6VO2fTZ7XB8lF2Af0sh2ODm oxS97IGMliXQWk57BsSlKCH/WzUd3CulKOIRrSML3fyYYJ4D/l50h3zeIU/hqVNiBSuh tfCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ywDfrwnZ50O655CWpUtUXzjc7DyVHfE8Igo/wbonpT8=; b=tkig6JKLpEarYtCv+sm8t4mmugYdNRNML+oImu8ulhf011q505IpFSZfqt0UVTJEbF HY82FQhQ+yBHI7bNMuqsFkfM89l9PakGYzzFVbnrp707Sz7TA2TBJVCtVVC+h4o7U9SE NQvvL2DOX8UH2+n6ejyYRLy7bESIsMe60FxjV1wpfiNMJywJqQMBGqBzOuTPH4tIszpz MS6ZJnxE6PY2RcBABUPvoVKIqFhCHUc+Hz6LRv4RtjQceT4YAQ/sXV1J5xf1Bup6Rxuw 4ngO9edS8YCHfPHfl66nNeuTCL37r797v4SuHykykeNyAPmTbLI9vKrTdG6Rme5c0a++ +jmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg6si5628984edb.243.2020.11.10.02.50.01; Tue, 10 Nov 2020 02:50:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728320AbgKJKsD (ORCPT + 99 others); Tue, 10 Nov 2020 05:48:03 -0500 Received: from foss.arm.com ([217.140.110.172]:53744 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbgKJKsD (ORCPT ); Tue, 10 Nov 2020 05:48:03 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E46911D4; Tue, 10 Nov 2020 02:48:02 -0800 (PST) Received: from [10.57.23.123] (unknown [10.57.23.123]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 40EC03F6CF; Tue, 10 Nov 2020 02:48:01 -0800 (PST) Subject: Re: [PATCH v3 19/26] coresight: etm4x: Detect access early on the target CPU To: Mathieu Poirier Cc: linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-21-suzuki.poulose@arm.com> <20201106204649.GC3299843@xps15> From: Suzuki K Poulose Message-ID: <61d7e897-3e83-7e95-033c-d43847cfeb09@arm.com> Date: Tue, 10 Nov 2020 10:47:54 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <20201106204649.GC3299843@xps15> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/6/20 8:46 PM, Mathieu Poirier wrote: > On Wed, Oct 28, 2020 at 10:09:38PM +0000, Suzuki K Poulose wrote: >> In preparation to detect the support for system instruction >> support, move the detection of the device access to the target >> CPU. >> >> Signed-off-by: Suzuki K Poulose >> --- >> .../coresight/coresight-etm4x-core.c | 45 ++++++++++++++++--- >> 1 file changed, 40 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> index f038bb10bc78..308674ab746c 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> @@ -56,6 +56,11 @@ static u64 etm4_get_access_type(struct etmv4_config *config); >> >> static enum cpuhp_state hp_online; >> >> +struct etm_init_arg { >> + struct etmv4_drvdata *drvdata; >> + struct csdev_access *csa; >> +}; >> + >> u64 etm4x_sysreg_read(struct csdev_access *csa, >> u32 offset, >> bool _relaxed, >> @@ -669,6 +674,22 @@ static const struct coresight_ops etm4_cs_ops = { >> .source_ops = &etm4_source_ops, >> }; >> >> +static bool etm_init_iomem_access(struct etmv4_drvdata *drvdata, >> + struct csdev_access *csa) >> +{ >> + *csa = CSDEV_ACCESS_IOMEM(drvdata->base); >> + return true; >> +} >> + >> +static bool etm_init_csdev_access(struct etmv4_drvdata *drvdata, >> + struct csdev_access *csa) >> +{ >> + if (drvdata->base) >> + return etm_init_iomem_access(drvdata, csa); >> + >> + return false; >> +} > > I would also prefix the above two functions with "etm4_" rather than "etm_" to > follow what is already done in this file. sure, will do. suzuki