Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2532196ybg; Fri, 31 Jul 2020 02:34:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBUHSdhE/n1rdlDFHmtkq9uXtd8LA2znww5rbu+xHDrGzIMk/leE5FMN8kCDsNfIu/9Htj X-Received: by 2002:a17:906:2851:: with SMTP id s17mr3230551ejc.347.1596188097391; Fri, 31 Jul 2020 02:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596188097; cv=none; d=google.com; s=arc-20160816; b=XnJdy/hma2w4PYt3o4tnL+nlfn3p7s5ccZ3QLDwGUF0bmXd6PxqFw0DEt5ukjbkxTm civPZraGnxruIu1qgIk4KI9OjztvuO5pBlKHNl7pChap240ee1rkSXRwJY84j2hUhqQs utLW5TructcEfTE20axbwELj36eyZiwnorq64XIPm1KopMLLlLMggiL7ZcdtDYvy4i9G kFPXOzOXl8vwwIUi0qfO5wwMHuiRf2x3hP+K2U+Fd96CUszMl4a7MTVAC517zWfDTj8c zr4xf2aInAlyIhxiNNvdXdGi3rT4/DNe31TWkLWRoQOthnJYgv1R1jNH5setdI72peTk woeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=PRRiyXEJ7A4wDMNgJy3xBKLxFfjqmwwGItt8H6dCQ3A=; b=XLqEY+bMIomP8jXHUVTwn+YuC2UkLsiUpDPlud0eeK28O7GMu0Uw4/I85SLWMVxZWL XVn8HYM698nAo9hAHtoS5bUuETV3g0mEQxw/+w9G6f9zulhQknyBpVNnua4xGb25FcpN nVmKGn7ggvhCE/yz7XuVz98ZjTak8GK5T3xE5HR/jjhzBLmznWxa1cuGXcHZeUnEZ0iv zIRmHruJPICSQO/uujHf9LTj339ouKF4UQfBr4Ow0h9SKYPxTiVoixj4aoRjGlwva4+X R9nWL9UV8EN0ukmG0oveHaGIgbmjzYmyszffrrfs+Cn8M6cuHukrzsPbG73wq4r1zpIg TMtw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 89si4965504edr.415.2020.07.31.02.34.34; Fri, 31 Jul 2020 02:34:57 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732107AbgGaJea (ORCPT + 99 others); Fri, 31 Jul 2020 05:34:30 -0400 Received: from foss.arm.com ([217.140.110.172]:53780 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727096AbgGaJe3 (ORCPT ); Fri, 31 Jul 2020 05:34:29 -0400 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 D21DE31B; Fri, 31 Jul 2020 02:34:28 -0700 (PDT) Received: from [10.37.12.83] (unknown [10.37.12.83]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7773F3F66E; Fri, 31 Jul 2020 02:34:27 -0700 (PDT) Subject: Re: [RFC PATCH 04/14] coresight: etm4x: Free up argument of etm4_init_arch_data To: mathieu.poirier@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mike.leach@linaro.org, coresight@lists.linaro.org References: <20200722172040.1299289-1-suzuki.poulose@arm.com> <20200722172040.1299289-5-suzuki.poulose@arm.com> <20200730173131.GA3155687@xps15> From: Suzuki K Poulose Message-ID: Date: Fri, 31 Jul 2020 10:39:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20200730173131.GA3155687@xps15> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/30/2020 06:31 PM, Mathieu Poirier wrote: > On Wed, Jul 22, 2020 at 06:20:30PM +0100, Suzuki K Poulose wrote: >> etm4_init_arch_data is called early during the device probe, >> even before the coresight_device is registered. Since we are >> about to replace the direct access via abstraction layer, we >> need a way to pass in the csdev_access for the given device. >> Towards this free up the argument, which is already available >> via etmdrvdata[smp_processor_id()]. >> >> Cc: Mathieu Poirier >> Cc: Mike Leach >> Signed-off-by: Suzuki K Poulose >> --- >> drivers/hwtracing/coresight/coresight-etm4x.c | 15 +++++++++++---- >> 1 file changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c >> index 7bb74c659c4f..67deb4a4e618 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c >> @@ -614,7 +614,8 @@ static const struct coresight_ops etm4_cs_ops = { >> .source_ops = &etm4_source_ops, >> }; >> >> -static void etm4_init_arch_data(void *info) >> + >> +static void etm4_init_arch_data(void *__unused) >> { >> u32 etmidr0; >> u32 etmidr1; >> @@ -622,8 +623,14 @@ static void etm4_init_arch_data(void *info) >> u32 etmidr3; >> u32 etmidr4; >> u32 etmidr5; >> - struct etmv4_drvdata *drvdata = info; >> - int i; >> + struct etmv4_drvdata *drvdata; >> + int i, cpu; >> + >> + cpu = raw_smp_processor_id(); > > Can you provide details on the motivation to use the raw_ version over the regular > one? As far as I can see in linux/smp.h there is no difference between them > unless DEBUB_PREEMPT is enabled. Even then the debug version won't complain > since the task is CPU affined. > Right, it is partly my misunderstanding. debug_smp_processor_id() is to detect cases where smp_processor_id() is called in pre-emptible contexts. This is not the case here. So it is fine to use the smp_processor_id(). I will switch to that in the next version. Thanks Suzuki