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=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 F0340C433E1 for ; Tue, 21 Jul 2020 07:05:37 +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 BCD66208E4 for ; Tue, 21 Jul 2020 07:05:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TBc7XPhq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="Dl3OrCkM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCD66208E4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org 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:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2T7zLsJFIdUWrh2cRDA1iyNxPSLCPmPBVoCMWFoVHJE=; b=TBc7XPhqq7ovq145LK7xkuQmZ Noh0ui05m6Tp6i61NvWTGA0kJcVCdbyw+P71isP+vrYocNsmQRGH0Bj6nuBlQDrmOj5Ln2MlRqELO 4Xvlbam49LPHNtpJnsCiDyU4Be8JTQEZtbC48HkXXsLDx7k/T6DskIwJsfhpnENKsvi9MTWJwPsI6 b5+Yf9zzob/tpqP8/I4K3DHZ+tNhAUS7s8Rz7YgHj1p4xAytnssX1YKsHJ++t+DTYo7Jl6nklQ106 jhOBkt3NyCqK4IjB3hgwaWE/vrPxYF+49yFFZnG47QhEkWqyGECR1Rn/JPHjlliUZZhdXaR/yYyUM +wnJnK/kA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxmJt-0006BJ-QA; Tue, 21 Jul 2020 07:04:09 +0000 Received: from mail29.static.mailgun.info ([104.130.122.29]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxmJq-0006AF-Er for linux-arm-kernel@lists.infradead.org; Tue, 21 Jul 2020 07:04:08 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595315045; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=4A+lvIZ9Lq8yx5ptiJxyo+euSs6mKU/hFQV6C5Yf6SY=; b=Dl3OrCkMUanyM1B0R9G9xF9a9oji6TzcSasfsvvDjZx2ej89liyyRXejwKcWQTwLUBSI8avA i2cs6fUN1Q9QhC2TQ8qJhHlE3hJ8DaETCEx9whpPEwUr0IJYHpsdLo9bb9avUEqCIAiaY1fD clgeJkdF6jg3HFlPpyMGrVdKA28= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n17.prod.us-west-2.postgun.com with SMTP id 5f16934d5b75bcda6026c405 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 21 Jul 2020 07:03:41 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 039EFC433CB; Tue, 21 Jul 2020 07:03:40 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id A6F29C433C9; Tue, 21 Jul 2020 07:03:39 +0000 (UTC) MIME-Version: 1.0 Date: Tue, 21 Jul 2020 12:33:39 +0530 From: Sai Prakash Ranjan To: Tingwei Zhang Subject: Re: [PATCH v3 08/20] coresight: allow etm4x to be built as a module In-Reply-To: <70d9c3f4dfac478f2128e2c25beaecd7@codeaurora.org> References: <20200717054536.7052-1-tingwei@codeaurora.org> <20200717054536.7052-9-tingwei@codeaurora.org> <70d9c3f4dfac478f2128e2c25beaecd7@codeaurora.org> Message-ID: <97ed83f9b4bde5158c3b0b50252af1d8@codeaurora.org> X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_030406_621453_5F5D2B96 X-CRM114-Status: GOOD ( 22.34 ) 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: tsoni@codeaurora.org, Kim Phillips , Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , Greg Kroah-Hartman , coresight@lists.linaro.org, Mao Jinlong , Mian Yousaf Kaukab , Russell King , Randy Dunlap , Leo Yan , linux-arm-kernel@lists.infradead.org, Mike Leach 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 Hi Tingwei, On 2020-07-20 12:28, Sai Prakash Ranjan wrote: > Hi Tingwei, > > On 2020-07-17 11:15, Tingwei Zhang wrote: >> From: Kim Phillips >> >> Allow to build coresight-etm4x as a module, for ease of development. >> >> - Kconfig becomes a tristate, to allow =m >> - append -core to source file name to allow module to >> be called coresight-etm4x by the Makefile >> - add an etm4_remove function, for module unload >> - add a MODULE_DEVICE_TABLE for autoloading on boot >> >> Cc: Mathieu Poirier >> Cc: Leo Yan >> Cc: Alexander Shishkin >> Cc: Randy Dunlap >> Cc: Suzuki K Poulose >> Cc: Greg Kroah-Hartman >> Cc: Russell King >> Signed-off-by: Kim Phillips >> Signed-off-by: Tingwei Zhang >> --- >> drivers/hwtracing/coresight/Kconfig | 5 ++- >> drivers/hwtracing/coresight/Makefile | 4 +-- >> ...resight-etm4x.c => coresight-etm4x-core.c} | 31 >> ++++++++++++++++++- >> 3 files changed, 36 insertions(+), 4 deletions(-) >> rename drivers/hwtracing/coresight/{coresight-etm4x.c => >> coresight-etm4x-core.c} (98%) >> > > ... > > Thanks for adding this support. etm4_cpu_pm_unregister() is dropped > now with change to ETM PM code. > You can base the patches on coresight-next - > https://git.linaro.org/kernel/coresight.git/log/?h=next > > Also I am trying this series on SDM845 MTP (5.8.0-rc5) with Debian > distribution, > I see below warning when trying to disable ETM, logs below: > > root@linaro-developer:~# lsmod > Module Size Used by > cpufreq_powersave 16384 0 > cpufreq_conservative 16384 0 > msm 856064 1 > coresight_stm 24576 0 > crct10dif_ce 20480 1 > stm_core 28672 1 coresight_stm > i2c_qcom_geni 24576 0 > qcom_rng 16384 0 > coresight_tmc 40960 0 > coresight_funnel 20480 0 > coresight_etm4x 61440 0 > coresight_replicator 20480 0 > camcc_sdm845 49152 0 > ath10k_snoc 53248 0 > socinfo 20480 0 > ip_tables 32768 0 > x_tables 45056 1 ip_tables > ipv6 458752 26 > nf_defrag_ipv6 24576 1 ipv6 > root@linaro-developer:~# > root@linaro-developer:~# echo 1 > > /sys/bus/coresight/devices/tmc_etr0/enable_sink > root@linaro-developer:~# echo 1 > > /sys/bus/coresight/devices/etm0/enable_source > root@linaro-developer:~# echo 0 > > /sys/bus/coresight/devices/etm0/enable_source > [ 332.855363] ------------[ cut here ]------------ > [ 332.860175] WARNING: CPU: 0 PID: 0 at > drivers/hwtracing/coresight/coresight-core.c:227 > coresight_disclaim_device_unlocked+0x28/0x50 > [ 332.872177] Modules linked in: cpufreq_powersave > cpufreq_conservative msm(+) coresight_stm crct10dif_ce stm_core > i2c_qcom_geni qcom_rng coresi > ght_tmc coresight_funnel coresight_etm4x coresight_replicator > camcc_sdm845 ath10k_snoc socinfo ip_tables x_tables ipv6 > nf_defrag_ipv6 > [ 332.897043] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G D W > 5.8.0-rc5-next-20200716-00040-g50ad3222c13f-dirty #80 > [ 332.908330] Hardware name: Qualcomm Technologies, Inc. SDM845 MTP > (DT) > [ 332.914969] pstate: 80400085 (Nzcv daIf +PAN -UAO BTYPE=--) > [ 332.920643] pc : coresight_disclaim_device_unlocked+0x28/0x50 > [ 332.926543] lr : etm4_disable_hw+0xd8/0x128 [coresight_etm4x] > [ 332.932391] sp : ffff800010003ed0 > [ 332.935775] x29: ffff800010003ed0 x28: ffffb05e1bd13980 > [ 332.941193] x27: 0000004d7fb06ef3 x26: ffff800010004000 > [ 332.946606] x25: 0000000000000000 x24: ffffb05e1bd03cc0 > [ 332.952022] x23: 0000000000000000 x22: 0000000000000000 > [ 332.957436] x21: ffff800010c73c00 x20: ffff000175547400 > [ 332.962851] x19: ffff8000103af000 x18: 0000000000000005 > [ 332.968267] x17: 0000000000000000 x16: ffffb05e1a875f38 > [ 332.973678] x15: 0000000000000000 x14: ffffb05e1bd13980 > [ 332.979093] x13: ffff4fa361082000 x12: 000000003474591d > [ 332.984507] x11: 0000000000000000 x10: 0000000000001000 > [ 332.989920] x9 : ffffb05e19a81800 x8 : 000001b2b5503510 > [ 332.995336] x7 : 000000b2b5503510 x6 : 000000003fd5ea33 > [ 333.000749] x5 : 00ffffffffffffff x4 : 000000000000b2be > [ 333.006162] x3 : ffff0001725c8150 x2 : ffff8000103af168 > [ 333.011574] x1 : 0000000000000000 x0 : ffff8000103affa4 > [ 333.016993] Call trace: > [ 333.019516] coresight_disclaim_device_unlocked+0x28/0x50 > [ 333.025035] etm4_disable_hw+0xd8/0x128 [coresight_etm4x] > [ 333.030552] flush_smp_call_function_queue+0x154/0x250 > [ 333.035795] generic_smp_call_function_single_interrupt+0x18/0x20 > [ 333.041999] handle_IPI+0x32c/0x390 > [ 333.045569] gic_handle_irq+0x15c/0x160 > [ 333.049489] el1_irq+0xb8/0x180 > [ 333.052709] cpuidle_enter_state+0xac/0x4e8 > [ 333.056983] cpuidle_enter+0x3c/0x50 > [ 333.060646] call_cpuidle+0x40/0x70 > [ 333.064210] do_idle+0x20c/0x290 > [ 333.067516] cpu_startup_entry+0x28/0x70 > [ 333.071528] rest_init+0xdc/0xe8 > [ 333.074847] arch_call_rest_init+0x14/0x1c > [ 333.079027] start_kernel+0x4e0/0x518 > [ 333.082764] ---[ end trace 162d5cef8c2b863b ]--- > root@linaro-developer:~# > I found that above warning is not due to your changes. If I add "arm,coresight-loses-context-with-cpu" to SDM845 ETM nodes then I don't see these warnings, so will add them since idle support is present on sdm845. Thanks, Sai -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel