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 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 686CFC3ABAA for ; Fri, 2 May 2025 10:37:25 +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:MIME-Version:In-Reply-To: Content-Type:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WzYgVSRd333DKATrQvbKSjYexpqyLoFCLB6U6mUq6h0=; b=cNf+Uw8puxY98N9nllDA4CCouT +JDIp8PbKlZODGCfDMtAuxB2uYmNAtTzzgRZMbaCYBFqPxo/WiSLJuFs6t1MidTwnDPx9Dw4vizTo dGt89fdYU8MpsuTck+nt+ZQ3eSiknFfJ9XAIEBKp803ZnqnrI/+aBWR9vrzDNFcMXg9PXjf6u+N0Z 3ABEP99YUGzrquyScrcAj8+rbY+oQ3lVzctnnqmS7MSl0d0Si5qGWEjEQWQs3PHlwi4VWthFqqONC Q/BanBvy2ltnYSsdfEntVV8QMJz2TYcnyGiu4qo0+OhaodIw6IdUFJofxVabrFoU4IO5t6vKBiW8p lDSk3VqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uAnlZ-00000001cxK-3rW8; Fri, 02 May 2025 10:37:13 +0000 Received: from mail-db8eur05on20625.outbound.protection.outlook.com ([2a01:111:f403:2614::625] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uAnjZ-00000001cLM-1vNg for linux-arm-kernel@lists.infradead.org; Fri, 02 May 2025 10:35:12 +0000 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Pft22UUa+PyKtUEDMG1C2iLSJwZTktfGoO1yFHNo9tO+bdv6ctaujypjAe2Loi4XVlvucG8OKk5grsVB8joR+9onlNesDBaCJUHRT9J1I+SvopKBp3w2aqfI2y8Kw+0GkYn4s8lk+pSCAo8/t+d8QXHmEMEQ33ZyH8J7hmd4oeMzh82+GZPazBnba1ws1Fkqiuozfn0mvLG4UWijh4t6/NeSIuGltACiCWfowr5l5APvglX7vt4ZK/bIgzVR4ukh+9Mmybj1MEuNdIYqZQxwBOA4Q2GaHJwzRYJITXVNKIIszkaoVDrVAGz7o4sMTwd/OInzodbc/+JFu/8HRJ93pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WzYgVSRd333DKATrQvbKSjYexpqyLoFCLB6U6mUq6h0=; b=ouy2LkTWgeBec+mYq6+CQseXfPd63Vvcf/Hc3dt1tZYnn6bAW4Lzj4WMXHt2LDSuClTkOlWCW2q5fTarYa/LIQUTrrMGPM3mimIq/xrszTIwvrcz+iq5JsX6KRaP6QFA118SuackcVx40XfEgS8s7m3WCVctgjPS1cbWXUkdf/oz2i+TGUFIqlsl/qIICqk0qi/+ApPZvBCLHaTzKX3ECkJ40fxQIosxdowtvmh8dz3TV8d0lT1WfUH1KuVHNtPR5oSK0dbytO3NINewDXUdPvEKTE0YThpCLbTPfmCWjE01nwJ8GiZKAeU0+d0VO1ciCV+UcZT/+rHyXUlfwlNPpw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=linaro.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WzYgVSRd333DKATrQvbKSjYexpqyLoFCLB6U6mUq6h0=; b=b3vkJqCwJAfgqVJgY0QEAK2DGoaJ9z+6qcKLph290Nz+DcKDPxkDQRl3doYaN0t8IfJbrFU2oWpYW5jwFAh/ALKg6Dr5H4whfHA5CPoyEBgQqZtDgmOnHNDlbj1Xi4R9PEkQoQ7K1JWWDupJ/DplByy1fouf3gCoPFF3dGx6J/w= Received: from DUZP191CA0041.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::20) by AS8PR08MB8948.eurprd08.prod.outlook.com (2603:10a6:20b:5b2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8699.20; Fri, 2 May 2025 10:34:54 +0000 Received: from DU2PEPF0001E9C6.eurprd03.prod.outlook.com (2603:10a6:10:4f8:cafe::79) by DUZP191CA0041.outlook.office365.com (2603:10a6:10:4f8::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8655.41 via Frontend Transport; Fri, 2 May 2025 10:34:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DU2PEPF0001E9C6.mail.protection.outlook.com (10.167.8.75) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8699.20 via Frontend Transport; Fri, 2 May 2025 10:34:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PQ4lw4UDhio8w9Gt1QzbHCz9eGrcBjSI8DkiOyxjMydsyRc3X8AEc1kqOrjfn/1l+2cKvcGBuEZEfvQFgzBzuaXKY0w6TO4X1JrU9Mo02Vr6gUwKnq3CUxmCHvykM1z9UMKQzAvG0fitILGXzTrpXpMzo1bC9dFkjQiwbJ/RDJTS1cPIBbW+xmKESyEng4NpFD2Ep06SRvrvTChykUtLnhcoaBs3pwJNT6iaSyUw6dR+27nocgmtDHUs7CwZsTxVeoAu8s1QEZS4u2l4rFQrCHdE3kTcda/3pmoE7z5GE5AWFwmxo2YgIUddIXIkJzdd7F5PXAMnz44Z3hCGh1xR2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WzYgVSRd333DKATrQvbKSjYexpqyLoFCLB6U6mUq6h0=; b=kR+hLjyaJcVHjESWTnE1TQGQtF31aQy7+2Lj0pGNGyNV+NLVZrK52ekktrFpnLvG811IvPmwzw/ybvaoMmhY7HoWYzoqHoG7UMlvkdrFH52HWtuXd94k/lljF3OIHzefnudyBQ9al/eUuHoxWEqwjwn1yX9tqLDy//UxwC+dA+vIJF1MgmkcwrpDCi/dLL0XLewL+pjqSJusl4g5YPoNgwpRBWOd23eepRJtGwks48+tqKDvEUNsgSIzeosx7vdlRu+0AZvkas58orXqfu2A98rhk1fMLtWLnyMLLNyRsPHrLslPi7bOtRI/hj8pu54vIGFR5DvjdYoUSLJiCd0ybA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WzYgVSRd333DKATrQvbKSjYexpqyLoFCLB6U6mUq6h0=; b=b3vkJqCwJAfgqVJgY0QEAK2DGoaJ9z+6qcKLph290Nz+DcKDPxkDQRl3doYaN0t8IfJbrFU2oWpYW5jwFAh/ALKg6Dr5H4whfHA5CPoyEBgQqZtDgmOnHNDlbj1Xi4R9PEkQoQ7K1JWWDupJ/DplByy1fouf3gCoPFF3dGx6J/w= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from GV1PR08MB10521.eurprd08.prod.outlook.com (2603:10a6:150:163::20) by PAWPR08MB11196.eurprd08.prod.outlook.com (2603:10a6:102:46d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8699.22; Fri, 2 May 2025 10:34:21 +0000 Received: from GV1PR08MB10521.eurprd08.prod.outlook.com ([fe80::d430:4ef9:b30b:c739]) by GV1PR08MB10521.eurprd08.prod.outlook.com ([fe80::d430:4ef9:b30b:c739%6]) with mapi id 15.20.8699.021; Fri, 2 May 2025 10:34:20 +0000 Date: Fri, 2 May 2025 11:34:17 +0100 From: Yeoreum Yun To: Leo Yan Cc: suzuki.poulose@arm.com, mike.leach@linaro.org, james.clark@linaro.org, alexander.shishkin@linux.intel.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] coresight: prevent deactivate active config while enabling the config Message-ID: References: <20250324191740.64964-1-yeoreum.yun@arm.com> <20250325151803.GD604566@e132581.arm.com> <20250428162214.GG551819@e132581.arm.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250428162214.GG551819@e132581.arm.com> X-ClientProxiedBy: LO4P123CA0118.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::15) To GV1PR08MB10521.eurprd08.prod.outlook.com (2603:10a6:150:163::20) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: GV1PR08MB10521:EE_|PAWPR08MB11196:EE_|DU2PEPF0001E9C6:EE_|AS8PR08MB8948:EE_ X-MS-Office365-Filtering-Correlation-Id: b85705fd-a13f-4c76-5166-08dd8964f9e5 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info-Original: =?us-ascii?Q?6HwqQKSpQRStLRR20+Q/eSy82HjlpllxYl6GZkhqPQXN4eWicmY/4qkuP9ik?= =?us-ascii?Q?yI9JyMNn46Zc+rEGZFoe88qel25R6tP6RY/L+FKPAoNkw3oaLBTknt8npGFN?= =?us-ascii?Q?Y1++rGrdDGPVx6hoWrPoxvz4wHocCW/ekEPcPFA7N5kqszDzaUxIW0HVtTZP?= =?us-ascii?Q?Idp1N+f1jDdcd4BHrVwRAOjZOCm3fk0UmU/VQh5ErbSukacxLy5DeOtkQ2pH?= =?us-ascii?Q?Nvrjd9dRJr6FldICW1RGNNrNSAI1+aUIxtjqOvAo+IFGrlkitVXyjkixMqPo?= =?us-ascii?Q?4ByE0qjXIC+bRNsNsFZKtTVbaa9PvP91eCZpxgtCODvbg7a/SdPCMygCUbxB?= =?us-ascii?Q?hx/cUTDV8pBcbENewSP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io7fj6yilG+NGlnB?= =?us-ascii?Q?ZLT6jaHkpzrJnzbQB/xjMRMdPr1twV/v3+a/lYsckdNyWx32LJ6mN1WJxTQ7?= =?us-ascii?Q?8qjcDePJBYaPNH/CRIGaYWGqTz7XZU+dbMsYraIP5cdUPToZP14HVlhw3XOy?= =?us-ascii?Q?XSg/JBSjyrXO07nCxyj8SMMp0PkKXHPOPerb0TJLBiTl11M8OPDUs9ZCk1mi?= =?us-ascii?Q?BjDoMFseVp8=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR08MB10521.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB11196 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF0001E9C6.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2513af46-f7a6-4fc8-9ebc-08dd8964e5be X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|35042699022|376014|14060799003; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tcTzs33sduZkHT1CdcJR3G5EB43szi6rxEp1QEH5tU0OR0Et9+QtThWMhVoY?= =?us-ascii?Q?nEPGbQcNK/pOfaHrjScELEaHgxCBvpfhPF6g3tKv1/HMfgvoVte15gHgH7tS?= =?us-ascii?Q?VPR6TbiLKLJaOQ/rugQLRBC2Id/MaAYowuo98CMdP3au1O9TA8nUfyBb7xrT?= =?us-ascii?Q?JN8txdr9SBBQz8VBQLy0SW/YYsrX8hkl840u755Ll3SJXU3esFL9uK/9kvnr?= =?us-ascii?Q?iild4BrJPYwuFJmGGT0vLYp4C37xJzA0e1E5cYHEJjKtdrlfKpi/ly7FKgDz?= =?us-ascii?Q?OuDP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6a+1aA1VCdqEuUmildmz/eSI?= =?us-ascii?Q?ciFue4lZ4taAsiLoqSMoYqB0KhRF/1q5NxdO3vthTZlisilyNcWCpmIgcV1G?= =?us-ascii?Q?S8GXJjz12s4WMda1KuVkenoQv4Zq/NDkaNM85UulHICXYmVKxC2S0Pk7VSvE?= =?us-ascii?Q?cRizHOEOXehPZrYwbiobiRZrJNnycB9Eb1/qXyjCrCx1oUVbpNsySR4PHaLZ?= =?us-ascii?Q?9DDUaVWtQu+A/zgtXzyiMosfzg14W4mEStcu9bUXrkwj1ChFCeTbXJ7ChwWl?= =?us-ascii?Q?mBbbpX+wN1TDpREfKTogoGiV9Voe/IhHKN3IQykdK+AyGGgM/W04CMq13MjW?= =?us-ascii?Q?/bcwT2Lmy9yVz6IbS7pdPX9xjCq4os5s8BfF?= X-Forefront-Antispam-Report: CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(35042699022)(376014)(14060799003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2025 10:34:53.7623 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b85705fd-a13f-4c76-5166-08dd8964f9e5 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF0001E9C6.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8948 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250502_033509_789005_E6A85EA8 X-CRM114-Status: GOOD ( 32.54 ) 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 Hi Leo, > > [...] > > > > > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > > > > @@ -1020,6 +1020,9 @@ static void etm4_disable_sysfs(struct coresight_device *csdev) > > > > smp_call_function_single(drvdata->cpu, etm4_disable_hw, drvdata, 1); > > > > > > > > raw_spin_unlock(&drvdata->spinlock); > > > > + > > > > + cscfg_csdev_disable_active_config(csdev); > > > > + > > > > > > In general, we need to split changes into several patches if each > > > addresses a different issue. From my understanding, the change above is > > > to fix missing to disable config when disable Sysfs mode. > > > > > > If so, could we use a seperate patch for this change? > > > > > > > It's not a differnt issue. Without this line, the active count wouldn't > > decrese and it raise another issue -- unloadable moudle for active_cnt :( > > So I think it should be included in this patch. > > I read the code again and concluded the change above is not related to > locking and would be a separate issue: when we close a Sysfs session, > we need to disable a config on a CoreSight device. > Could you clarify what is meaning "unloadable moudle for active_cnt"? > I only saw "cscfg_mgr->sys_active_cnt" is used for module unloading, > but have no clue why "active_cnt" impacts module unloading. Yes. but it also related "by this patch". When the load config and "activate" configuration via sysfs, not only the cscfg_mgr->sys_active_cnt is increase but also "individual cscfg->active_cnt". This patch extends the meaning of "cscfg->active_cnt" includes "enable of configuraiton". so that cscfg_config_desc_put() prevent decrease "module reference" while holding individual active_cnt. That's why without this change, the "module reference" couldn't be decreased. The problem before this change is deactivation doesn't chekc cscfg->active_cnt but put module reference whenever it calls. > > > > cpus_read_unlock(); > > > > > > > > /* > > > > diff --git a/drivers/hwtracing/coresight/coresight-syscfg.c b/drivers/hwtracing/coresight/coresight-syscfg.c > > > > index a70c1454b410..6d8c212ad434 100644 > > > > --- a/drivers/hwtracing/coresight/coresight-syscfg.c > > > > +++ b/drivers/hwtracing/coresight/coresight-syscfg.c > > > > @@ -391,14 +391,17 @@ static void cscfg_owner_put(struct cscfg_load_owner_info *owner_info) > > > > static void cscfg_remove_owned_csdev_configs(struct coresight_device *csdev, void *load_owner) > > > > { > > > > struct cscfg_config_csdev *config_csdev, *tmp; > > > > + unsigned long flags; > > > > > > > > if (list_empty(&csdev->config_csdev_list)) > > > > return; > > > > > > > > + raw_spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags); > > > > > > I think we should use spinlock to guard the condition checking > > > list_empty(). > > > > > > Here the race condition is the 'config_csdev_list' list and > > > configurations on the list. For atomicity, we should use lock to > > > protect any operations on the list (read, add, delete, etc). > > > > Interesting... Would you let me know which race it is? > > here to check list_empty(), it already guarded with "cscfg_mutex". > > Thanks for pointing out this. I read the code and understood that in > some scenarios the list is protected by the mutex "cscfg_mutex". > > I would argue for using locking, we need to make clear for two thigns: > > - What is the race condition; > - What locking is used to protect the race condition. > > For current case, a CoreSight device has a config list, the race > condition is the config list will be manipulated by multiple places > (e.g., for module loading / unloading, opening or closing a perf or > SysFS session). So a spinlock is used to to protect the config list. > > "cscfg_mutex" is a high level lock, my understanding is to protect the > high level operations from the Sysfs knobs, though sometimes it can > mitigate the race condition on configuration list mentioned above, but > the spinlock is the locking mechanism for the low level's config list > on a CoreSight device. [...] > > However list_del() is special case because iterating config_csdev_list > > can be done without cscfg_mutex -- see > > cscfg_csdev_enable_active_config(). > > This gurad with spinlock purpose to guard race unloading and > > get the config in cscfg_csdev_enable_active_config() > > (Please see my response below...). > > > > the emptiness of config_csdev_list is guarded with cscfg_mutex. > > therefore, It seems enough to guard iterating part with spinlock :) > > Mixed using cscfg_mutex and spinlock get code complexity, and I am a bit > concerned this is not best practice. > > At a glance, I would say 'cscfg_mutex' is purposed to protect the global > 'cscfg_mgr', per CoreSight device's config list should be protected by > 'cscfg_csdev_lock'. Agree. BTW this patch is just for bugfix and consider to backport to lower version. I think it would be better to improve lock related things with another patch if it's necessary. > > > A side topic, as here it adds locks for protecting 'config_csdev_list', > > > I am wandering why we do not do the same thing for > > > 'feature_csdev_list' (See cscfg_remove_owned_csdev_features() and > > > cscfg_get_feat_csdev()). > > > > In case of feature, It's okay since it couldn't be accessed when it > > gets failed to get related config. > > I looked at cscfg_load_feat_csdev(), it uses 'cscfg_csdev_lock' to > protect the feature list. This is why I thought the feature list also > need to be protected by the lock. Now it is only partially protected. I don't think the feature don't need. Since when add the configuration. "feature first and config second" and reference and remove is done with "config first and feature second". That menas if enable logic get configuration, we can gurantee the liveness of each feature. > > When we see cscfg_csdev_enable_active_config(), the config could be > > accessed without cscfg_mutex lock. so the config need to be guarded with > > spin_lock otherwise it could be acquired while unload module > > (after get active_cnt in search logic cscfg_csdev_enable_active_config() > > and other running unloading process) > > To make things more clear, I have a questions. > > 'cscfg_mgr->sys_active_cnt' is used in the cscfg_unload_config_sets() > function to decide if can unload module, if any configuration is > active, why this variable cannot prevent unloading module? because cscfg_unload_config_sets() runs in "unload_modules" where module reference is 0. in the diagram. the enable get the configuration but other cpu do deactivate and unload together. Here, by other sys_active_cnt becames 0. while enable logic get the config's pointer. > > But feature list is depends on config, If config is safe from > > load/unload, this is not an issue so we don't need it. > > > > Thanks for your review! -- Sincerely, Yeoreum Yun