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 409B5C433E2 for ; Mon, 20 Jul 2020 07:00:53 +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 0AB5920734 for ; Mon, 20 Jul 2020 07:00:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dEvO/JYQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="lI5z7VHS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AB5920734 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=PbrghJw7wGLc97fpnTWsw5plBJUGpoIBjZ55uEtvRMY=; b=dEvO/JYQiDQrMDYhSxp5pPYuk FUZHjoGyLzCjrkhbd3CAvKQU1P2Vem0nbY6K891UBNm1aU+uFfoi+98UGXB+1oXeCXxJO4QRPUjKv bLxbVyrp6OwTqKNIii8zHyI9d+dYSCqMeRpoK8rWlVlw2e4VkYKsDUP2LVXqiVPVSFQ8ANqACXrhb h3nixcDtPedWWQ1agP6EY80YsPl04wX4rcrDf8clX6kLEpiafOk80vVuE9hHREek5HrE9gga6pnzK bOQlNNBYdGyPyTAd0kri/7rEzrzWhvAOOvuAfg91c2M39M8iPpmjLXKpkqvdOwIrGKsE9z7vpY3tu BuR/07tlw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxPlb-0000JB-Re; Mon, 20 Jul 2020 06:59:15 +0000 Received: from m43-7.mailgun.net ([69.72.43.7]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxPlX-0000IX-Dz for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2020 06:59:14 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595228353; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=QUJgBwmo8xfNWOXGrI/ynamGgOJ+hGJo4GYPzuFHKJM=; b=lI5z7VHSx0G6u1Rd1EkwmOVciifmry/vPYBgCkWMR1krxOQoi4XO3M1nvxwjDkqzgX6eXUiq q3ue5cHqc57AH9H84/0rqes4/Bh1DmVGyOqnk53xAZuumWh061aZXXmEqAD3cayLdJS9vTZF EUrCB93tyjfU+bNduc2CsM/L3hY= X-Mailgun-Sending-Ip: 69.72.43.7 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-n13.prod.us-west-2.postgun.com with SMTP id 5f15407fee6926bb4fb29077 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 20 Jul 2020 06:58:07 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C3202C433AD; Mon, 20 Jul 2020 06:58:06 +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 3FE2DC433C6; Mon, 20 Jul 2020 06:58:05 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 20 Jul 2020 12:28:05 +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: <20200717054536.7052-9-tingwei@codeaurora.org> References: <20200717054536.7052-1-tingwei@codeaurora.org> <20200717054536.7052-9-tingwei@codeaurora.org> Message-ID: <70d9c3f4dfac478f2128e2c25beaecd7@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-20200720_025913_856614_D67F9484 X-CRM114-Status: GOOD ( 17.85 ) 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-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:~# 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