From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 7AAF33BADAA for ; Mon, 11 May 2026 09:28:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491725; cv=none; b=Zr7pizWJPK7NeqnM6moPzVfoUdkyhRDR++o+D2FWf4ReVmGCBqlH/EwenoUNdD2U5D5NW9I1Ce07I+Vh97vMnkAHMUIaaZZsrNITKoCtNGx9OJpLeqB6MKdpDGmNgbFpf/s9C0g3cz+aEBASMGdIKg7N+NfwcPJ+62p+RSJJyLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491725; c=relaxed/simple; bh=+gGuUyrj4v1S6qlSkMiMkJ4odJU+4BftsoUrliidOm0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BSKgspBg3gY1yOmco1pWsSGDGoEUACqcPI64IRFTD1fkHDtoWBNKhu4x8Rb/SxbAKD38EnNgmnKnsA9eF+qJTm8xsGxzI0SrP1PD0hi786M8rb7Kp1RA3l4hmKm2Q5RTpUszPtOrK2MaBKr4BqbUVC3M2qT+J4M0uKdEjSets4g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=P8VcXflm; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gdEhhF3z; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="P8VcXflm"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gdEhhF3z" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64B9I3an017280 for ; Mon, 11 May 2026 09:28:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= K0wwZAToO4X4O0TnP19EW/j+ovK4f+GpWzKJzDTpukM=; b=P8VcXflmlbOa985M L7mLh3gXv/kBUZusiatluySfV9+9a3Uz3wFLh1fhd0CNNpRVrsr62OlDsBn6zX6I Au+tJcW2qN2TBNA5NdIZd0CIBdMMVKtQLvnMZ5yIFgUVY1gIAeCmieN4lcfXyVHJ 00grixdM7x8BRSl8fapKfSXkUS+foOz2GnbrYvhSqYIV9inWjd5QghCPsROG4hL0 txR9TKohtmMl+YEy8x2NqnAwYL0jGWLhWz3ZbOE7mJ82HQItD96RbMjwox6X7ZEh CpT6Lqc4aAEF7n8vlg9IxuqQf+nVja3iBoVLGitcb4ivrsOgkfg5RyIg6NwhW1YP BqKjIA== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e37xfs2db-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 11 May 2026 09:28:43 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2b9a3c3c4eeso45579275ad.3 for ; Mon, 11 May 2026 02:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778491722; x=1779096522; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=K0wwZAToO4X4O0TnP19EW/j+ovK4f+GpWzKJzDTpukM=; b=gdEhhF3zkQFQVZthOe7DKlJ3r2fFAZGeTiXcPrmKP8qJw557jI3fyl1O5uMDXtGNVr t+FMA9HDFZL4YwL5IP6S3WNjhDai0PSAz7OvBTyfWfQC3U+p8cdQLwzHAbF1oulncdot XnCgvPBLVG7VNvTAY5L5lMKSc+5QOWw5Za2zzf4xidao9cA//HOzzqFCtDUM1z9fwhhC NClzrWY21FfTtfqf90NB9jnIKas3PzhoEN042Pz18gBGxfDDPZqNw/5ZqrqOMCb5b0rW UOAdyDjavP+facDOsWfuhppcdM2OzzPBzzP8epwdSiuOKKSJuQd/HUYyXk7fuaRBfPKY PsBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491722; x=1779096522; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=K0wwZAToO4X4O0TnP19EW/j+ovK4f+GpWzKJzDTpukM=; b=kTzLR+PkGrvj6T+nrGb5/8Us6Fiiks3FgA1lgYkaBMTnGmpu5a/W11MvG8mEgs77cG 6ZJsSzSE4tdqxH5yEwkxfVl+T0zrW7b8a44ikpP35OG1rr3BzwFWQ32ruAbnWFHZu1+N c233JT4Kzc1phhUD7Wn3elTdb/ixUp2qZIWfCdsIOmDKqavTaYeGLVZAq5HVFsQusfXi 2MUtwzSftLRiPtINwuWRYhTyeyu9/OtUHITsmLoYBuHdpMGowHCtyf8TNKOe+Q0XTNO7 1m22ZTOh+uLPJolWTZRL+SJ6jBaYMAqF9NDE4MCc5a9+1n46gzVB9T6STlUWk57MUhV4 7/Ug== X-Forwarded-Encrypted: i=1; AFNElJ9o0gijQiH/1FkUVSJ46bW19sgSfbt/I/CYRogd4BIoRFUssMY3tVbnmaSJDEbNRWBf8PtxKawRBke1qyA=@vger.kernel.org X-Gm-Message-State: AOJu0YyqDILUb5TeauY/oENphjMTmHGnsNS2lkWlZ6sZSeMfeoUl7ct2 PKWj3Bai3WXOqQ5QKqBmzK5eDrb2T5tMa2u9GGcHcj4DKJV/9a0Agfg8i9kwGC8nrRX4gMyAmFy T+DH05xGspnGU0du/CzcRjqVPTBpcPB1ZTsqJnW0jAnR5ibFdT9WxBHfF0gCPJfAAHDE= X-Gm-Gg: Acq92OEtJO4ahq0pjLT0tlUZharVlRJr2uH6EiKdGOjDNO4LbWwNPVcewpD6KzKTsRE /F5cIS87p9LSz5JCcE61987ceFDmudU2pmSSqrpqbZfSJ+Ti460uPbsoMnRKCe74REJnKUY0K+G H0zb4DHoDsjDZNK/KvMM96bBmwzlshqKW3dQfvcdccFNnb0k0Vg0Y9LNpvr8GqFqYIWCZashQh7 Kb8STp+lnsqkSm+K3osq16lEs+QSsRMP/Yo+VwlBXOhyphS50NYwZRvPoM4/9uDP5eDZtCy4IW3 +6ykUdo1r0gUBx6Cvrn5Avst7LW0mfyKhfIBzwEydQE6uuWwt1nm8E7lnPTWUajK/MeX0/MkQ17 DvJ9OGRDIcfHgLEWFKZQwMGsn/fs+bThToGYH3RQmXy+tyQtm8xN3wh+so59Rk7rPjNbPheTJum 92AQkn8tXVVQ== X-Received: by 2002:a17:903:11c7:b0:2bc:ac76:c1cf with SMTP id d9443c01a7336-2bcac76c3c9mr58794875ad.24.1778491722328; Mon, 11 May 2026 02:28:42 -0700 (PDT) X-Received: by 2002:a17:903:11c7:b0:2bc:ac76:c1cf with SMTP id d9443c01a7336-2bcac76c3c9mr58794675ad.24.1778491721794; Mon, 11 May 2026 02:28:41 -0700 (PDT) Received: from [10.133.33.31] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1d4050dsm92991665ad.31.2026.05.11.02.28.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 02:28:41 -0700 (PDT) Message-ID: Date: Mon, 11 May 2026 17:28:37 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] coresight: fix source not disabled on idr_alloc_u32 failure To: Leo Yan Cc: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Tingwei Zhang , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jie Gan References: <20260511-fix-coresight-sysfs-enable-issue-v1-1-1b3829748171@oss.qualcomm.com> <20260511092446.GJ3778514@e132581.arm.com> Content-Language: en-US From: Jie Gan In-Reply-To: <20260511092446.GJ3778514@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=TqXWQjXh c=1 sm=1 tr=0 ts=6a01a14b cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=COk6AnOGAAAA:8 a=oEJAsnpY_whPMBELc84A:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: cINAQi7fkLNVOWsb7qZI6JgasqS4L-jN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTExMDEwMyBTYWx0ZWRfXxKMuHBG9D1hf DuRR+gDljfhdiGSO30zKgdUizMFQOrVsubziAm2OXV6RZ4lyPmnlWfXo5NklObjS74gdsDi71/S 9e51457vdm2UThOOaKgOM1HnaFpj0pv/zrVKP1Ue+nj6z4O0FYkekB1gYA5RcS1L8uaE8QArBcj jH296A+6dFnIrRPAIj+Z1rwThxqkSKOl1Ce9SRPbr1vy3k75Khy6xSyfPrCJf6RAFIAkedhn/A3 Zo9MuSblXbH2CEh61XPatdLWFQ8vXJfOPK7l5XGvCM2xEC3wtAdhnQbVEmYoh2mkGrq+yFqOBzI Gcv3ihYKKxviVSECjeZPmBFkAou+shqmL4L63M4wANIm2kXCiH1p+BnIluxVTou8gBB//aedSyK k01jK0TEjooqQbdDmpe7BnRHoks6kAyxMqsNspt+3Jcz0cSk9eEmuRRPtjtdiCRmJip4rRSiQ4I 4VabnfSWvpJlebC5s7w== X-Proofpoint-ORIG-GUID: cINAQi7fkLNVOWsb7qZI6JgasqS4L-jN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-11_02,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605110103 Hi Leo, On 5/11/2026 5:24 PM, Leo Yan wrote: > On Mon, May 11, 2026 at 05:04:44PM +0800, Jie Gan wrote: >> In coresight_enable_sysfs(), for non-CPU sources (SOFTWARE, TPDM, >> OTHERS), the source device is enabled via coresight_enable_source_sysfs() >> before idr_alloc_u32() maps the path. If idr_alloc_u32() fails, the >> original code jumped directly to err_source, which only calls >> coresight_disable_path() and coresight_release_path(). The source device >> was left enabled with an incremented refcnt but no path tracked for it, >> leaving the device in an inconsistent state. >> >> Disable the source before jumping to err_source so the enable and path >> operations are fully unwound. >> >> Fixes: 1f5149c7751c ("coresight: Move all sysfs code to sysfs file") >> Signed-off-by: Jie Gan > > Actually I have noticed this. Since my PM series will remove IDR things, > and I don't think anyone really hit idr alloc error, this is why I > didn't send fix for this. > > Anyway, this is a reasonable fix. I will send out my PM series later > in today, I will pick this patch into my series and rebase on it, hope > this is easier for all of us. Well noted. Please feel free to pick it into your series. Thanks, Jie > > Thanks, > Leo