From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 197F5C4741F for ; Mon, 9 Nov 2020 09:49:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7FFC206ED for ; Mon, 9 Nov 2020 09:49:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sT4KACrw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7FFC206ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WPCCxtcRYQUQzYXkOppGGr94kQ8F3wGAR8yI42TVphU=; b=sT4KACrwaKrCmEZMUDySOBOkm 77hrVrSIoG6upRASxC9O2wI9YH0sWTZXaAe7T3l68cmr66tiaocLqraMjy+mFy1irNZXIsRok9J8+ E1bEKtiOjZFuSpWlCcVszCr9oof0TXYwtIJPLqtdOZAigDbaf7R0YnOR3NFVZpKAyeWTkGRLrfxOU Ij3HUJ7l3hLhN06+qBbU3FPEAyD4bILib0XahvNe9PV99A8p2F9Fp0nlg4w2lLIl+u+IHIALbxd7k 9PDZ6rdTisf5N2fv0L86lN6kqTkn6cZ8ldZvwZh4wj442DBAi0EM3fgrw4RFl7argDJqFVfOGwkQK hyTOLJu2Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kc3me-0001Al-I2; Mon, 09 Nov 2020 09:48:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kc3mb-00019k-Db for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2020 09:48:18 +0000 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 B29D11042; Mon, 9 Nov 2020 01:48:16 -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 714D03F718; Mon, 9 Nov 2020 01:48:15 -0800 (PST) Subject: Re: [PATCH v3 19/26] coresight: etm4x: Detect access early on the target CPU To: Mathieu Poirier References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-21-suzuki.poulose@arm.com> <20201106203438.GB3299843@xps15> From: Suzuki K Poulose Message-ID: Date: Mon, 9 Nov 2020 09:48:07 +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: <20201106203438.GB3299843@xps15> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_044817_529830_3EDF01A1 X-CRM114-Status: GOOD ( 22.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/6/20 8:34 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 { > > s/etm_init_arg/etm4_init_arg Part of the reason was to add a future IP support where it is not all ETM4. Again it doesn't really matter. I could change it. > >> + 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; >> +} > > Returning a boolean rather than an int for the above two functions seems odd to > me. > We don't return an error from the caller of these functions. So, all we need to know is, if the operation was success or failure. Having bool makes it explicit for the checkings, rather than documenting the expected return values. Hence the choice. But I am open to changing them if you prefer it that way. Cheers Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel