From patchwork Tue Dec 3 11:49:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yeoreum Yun X-Patchwork-Id: 13892267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3FB9CE64A82 for ; Tue, 3 Dec 2024 11:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Rr61SRZ9+9afGrKxPhL8mq7/OLZYAe3O2IEPdXkV16Q=; b=2C0jLAphBZwSWSfyaJjJhmpdbx YzzJ68+uvN8wkCQFK5JMBqRb6d3wJ1M/BUlnKAZ+T1+5UAnwxf/aVcvSY9bxxGX3wYsSrcRAtxpJn yvwZwhInQjiUhyXybmPttYGHqSl6L6OxBziDw16ATpuFtIAHF5kTugXt4v7LOtiffYV8Wsdmetwh1 dhaitkZgT0+TdFWAlI47PmdcufF4oeODcUaY4dnRF0WTLJC0JQUvNm4iLzyTDsEY89Z8M8aSjVKMi LuFgdvkea4mGPlSr9ndFiD7NmJmx90FdLNK+GIL8UtJPCu8ZVuTUFWCYslML/LpBJrvrRBuKagpz9 WW+/81sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIRQc-00000009KFd-0Bpt; Tue, 03 Dec 2024 11:50:54 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIRPb-00000009K1E-1oOJ for linux-arm-kernel@lists.infradead.org; Tue, 03 Dec 2024 11:49:52 +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 BDDA3FEC; Tue, 3 Dec 2024 03:50:16 -0800 (PST) Received: from e129823.cambridge.arm.com (e129823.arm.com [10.1.197.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DFB8F3F58B; Tue, 3 Dec 2024 03:49:46 -0800 (PST) From: Yeoreum Yun To: suzuki.poulose@arm.com, mike.leach@linaro.org, james.clark@linaro.org, alexander.shishkin@linux.intel.com, bigeasy@linutronix.de, clrkwllms@kernel.org, rostedt@goodmis.org Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, nd@arm.com, Yeoreum Yun Subject: [PATCH v2 0/9] coresight: change some driver' spinlock type to raw_spinlock_t Date: Tue, 3 Dec 2024 11:49:33 +0000 Message-Id: <20241203114942.697188-1-yeoreum.yun@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241203_034951_512836_FA9FC780 X-CRM114-Status: UNSURE ( 7.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In some coresight drivers, drvdata->spinlock can be held during __schedule() by perf_event_task_sched_out()/in(). Since drvdata->spinlock type is spinlock_t and perf_event_task_sched_out()/in() is called after acquiring rq_lock, which is raw_spinlock_t (an unsleepable lock), this poses an issue in PREEMPT_RT kernel where spinlock_t is sleepable. To address this,change type drvdata->spinlock in some coresight drivers, which can be called by perf_event_task_sched_out()/in(), from spinlock_t to raw_spinlock_t. Reviewed-by: James Clark v1 to v2: - seperate patchsets to change locktype and apply gurad API. Levi Yun (9): coresight: change coresight_device lock type to raw_spinlock_t coresight-etm4x: change etmv4_drvdata spinlock type to raw_spinlock_t coresight: change coresight_trace_id_map's lock type to raw_spinlock_t coresight-cti: change cti_drvdata spinlock's type to raw_spinlock_t coresight-etb10: change etb_drvdata spinlock's type to raw_spinlock_t coresight-funnel: change funnel_drvdata spinlock's type to raw_spinlock_t coresight-replicator: change replicator_drvdata spinlock's type to raw_spinlock_t coresight-tmc: change tmc_drvdata spinlock's type to raw_spinlock_t coresight/ultrasoc: change cti_drvdata spinlock's type to raw_spinlock_t .../hwtracing/coresight/coresight-config.c | 21 +- .../hwtracing/coresight/coresight-config.h | 2 +- drivers/hwtracing/coresight/coresight-core.c | 2 +- .../hwtracing/coresight/coresight-cti-core.c | 65 +- .../hwtracing/coresight/coresight-cti-sysfs.c | 135 +++-- drivers/hwtracing/coresight/coresight-cti.h | 2 +- drivers/hwtracing/coresight/coresight-etb10.c | 62 +- .../coresight/coresight-etm4x-core.c | 71 ++- .../coresight/coresight-etm4x-sysfs.c | 566 +++++++++--------- drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- .../hwtracing/coresight/coresight-funnel.c | 34 +- .../coresight/coresight-replicator.c | 36 +- .../hwtracing/coresight/coresight-syscfg.c | 75 ++- .../hwtracing/coresight/coresight-tmc-core.c | 9 +- .../hwtracing/coresight/coresight-tmc-etf.c | 195 +++--- .../hwtracing/coresight/coresight-tmc-etr.c | 199 +++--- drivers/hwtracing/coresight/coresight-tmc.h | 2 +- .../hwtracing/coresight/coresight-trace-id.c | 93 ++- drivers/hwtracing/coresight/ultrasoc-smb.c | 12 +- drivers/hwtracing/coresight/ultrasoc-smb.h | 2 +- include/linux/coresight.h | 4 +- 21 files changed, 751 insertions(+), 838 deletions(-) --- LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}