From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98F5A33E361 for ; Wed, 21 Jan 2026 10:15:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768990551; cv=none; b=C5B3ijSGp0ZoZ7J1dRrH7on7AK3m00w4NUwWYnJ9MKCS75m5va4LB5w4cOYJqBcZ1oWBf8/ygO2ZAh8fgyL8SxdhEvxrTIPsFlf4FkJ2Y1Ne+LZjE3fzStKuCx2NKx2BGzLnrKS6ZNXCUvR4m8vYg4DrRIc6YSw3GXqn6dfLJKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768990551; c=relaxed/simple; bh=HZ2w067m/7lZ1RW2UNNPQYtSQelSBDMptTxJ9xBQXxM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=nueg4eEZdP9goW186CYGjvrq7P+hd6zRhuBcRnKIa6LJ9dLh/oqKuAdEp1YEOAbGt9Jp9NrBvv9rNk9ERdcYAefSP4WFWzsYNwtXrr7kyOlINq625/LDIHG99XTHYxASC7IeKSggx/BEyDeg2Pyb0U+3aYBcmgEzpYFoUo87iDM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=vwcuBFzv; arc=none smtp.client-ip=113.46.200.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="vwcuBFzv" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=HoLSQNKJGeycECcOUEjcwDX9vSGBUFRa5zOBOGIA7rE=; b=vwcuBFzvEtgieL1+kmzIoudJfiGfsUn/6r86O4uH2ExGF2TjLN+JBABqCiwhRvmaMmCxNEyRQ PQzku/bpN34+KWQeDm8MMjoUadh/k39PRQBbtG3esP6tW57wdV+Zb/cnfczwUZ9AN4k6KymSj3B xn69WP9YOGuZ5KZFa+ZSHuc= Received: from mail.maildlp.com (unknown [172.19.163.200]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4dx0P3096Qz1K96y; Wed, 21 Jan 2026 18:12:23 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id C445F40563; Wed, 21 Jan 2026 18:15:44 +0800 (CST) Received: from kwepemn100008.china.huawei.com (7.202.194.111) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 21 Jan 2026 18:15:44 +0800 Received: from localhost.huawei.com (10.90.31.46) by kwepemn100008.china.huawei.com (7.202.194.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Wed, 21 Jan 2026 18:15:43 +0800 From: Yushan Wang To: , , , , , CC: , , , , , , Subject: [PATCH v5 0/3] Coresight TMC-ETR: refactor the tmc-etr mode and some cleanups Date: Wed, 21 Jan 2026 18:15:40 +0800 Message-ID: <20260121101543.2017014-1-wangyushan12@huawei.com> X-Mailer: git-send-email 2.33.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To kwepemn100008.china.huawei.com (7.202.194.111) From: Junhao He This patchset builds upon Yicong's previous patches [1]. I rebase the patchset onto coresight for-next branch. Patch 2 introducing fix race issues found by using TMC-ETR. Patch 1 & 3 introducing two cleanups found when debugging the issues. [1] https://lore.kernel.org/linux-arm-kernel/20241202092419.11777-1-yangyicong@huawei.com/ --- Changes in v5: - a) Rebase the patchset onto coresight for-next branch. - b) Drop the refactoring of the mode handling, retain only the essential fix Link: https://lore.kernel.org/linux-arm-kernel/20251111122149.1981162-1-hejunhao3@h-partners.com/ --- Changes in v4: - a) Add comment at the context of set etr to sysfs mode. - b) Move the check on drvdata->read to the start of enable etr. - c) Add checks to prevent multiple sysfs processes from simultaneously competing to enable ETR. - d) Fix the issue with the guard used. Link: https://lore.kernel.org/linux-arm-kernel/20250818080600.418425-1-hejunhao3@huawei.com/ --- Changes in v3: - Patches 1: Additional comment for tmc_drvdata::etr_mode. Update comment for tmc_drvdata::reading with Jonathan's Tag. - Patches 2: Replace scoped_guard with guard with Jonathan's Tag. - Patches 2: Fix spinlock to raw_spinlock, and refactor this code based on Leo's suggested solution. - Patches 3: change the size's type to ssize_t and use max_t to simplify the code with Leo's Tag. Link: https://lore.kernel.org/linux-arm-kernel/20250620075412.952934-1-hejunhao3@huawei.com/ Changes in v2: - Updated the commit of patch2. - Rebase to v6.16-rc1 Yicong Yang (3): coresight: tmc: Add missing doc including reading and etr_mode of struct tmc_drvdata coresight: tmc-etr: Fix race condition between sysfs and perf mode coresight: tmc: Decouple the perf buffer allocation from sysfs mode .../hwtracing/coresight/coresight-tmc-etr.c | 43 ++++++++++--------- drivers/hwtracing/coresight/coresight-tmc.h | 2 + 2 files changed, 24 insertions(+), 21 deletions(-) -- 2.33.0