Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796089601; b=YT2bt9zw4JTCp/D0sCq3ZJXRA7uG/6aQt+WevZSMXx35BWlD6tQi9WQUxnRwMwS9az3K E3OC59l/52jWgTYMplWG1XDBpij/P8KkNdYqRgp0dGwwxJoSy8zLhwRZXUzl850opESeB YQitSuyTcDYTRF+PPXqx9cS3bbIcTb1nDF+DRKV4f7tTa2OAL4nUS0gLaofUvLlhPlgxy RjlcfxPDTYQNqIlHWYVGq6BfRL/zVlVtAroNOkOJ/27H72E4QmdFXpvLWBJpWsScqzEsN 5ix7PQ6EyLzxoqmGqw5M8tgHnJ0rJX4wJx6xJ/hM4FX1VDjUi1ztvYd7aD6jUDL3C0g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796089601; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Spam-Info:X-Proofpoint-GUID:X-Authority-Analysis: X-Proofpoint-ORIG-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=sm+VT9IxZr1SPKsdk6vx7pOAdT6D+hhqEyX33cyfAVA=; b=i1tJ7/nQGDUL78FpgZJF7GSqxeKWW46z6BRDWGmb0PlOEHonlfXajolobkf4MuYGSWu9 VMPJzUVj5evWpt4uyA+uANVFqy4xtu92JzZJ3cQIpS2VfMfQb8Ylavgm9Yxf2H3yqo6P2 o85uyzLqIzZEsnQV9hHD/VFjmC/iOUfsG/TyyuRI+Ph5/+7QPNQXKNsSnJoDViJpu8GNZ HiXw9wAKaIDfDkOKTn6YerFWoe52v18xn4id42D3XNkLbFYzA/A8gzEQQ0ksGqGEdSTeR c8ZjDFwGRzHSHNDT1bly3740vs+lkNEmj9nyim08RuLtHHKF5kT5TTsQpm6DwhWG/9A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=AKfbHFfg; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=YIxxXbjT; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9911A606A31A for ; Tue, 1 Dec 2026 01:46:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9911A606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=AKfbHFfg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=YIxxXbjT Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B10Wik83987021 for ; Tue, 1 Dec 2026 01:46:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=sm+VT9IxZr1SPKsdk6vx7pOA dT6D+hhqEyX33cyfAVA=; b=AKfbHFfgiqSBWJgaxA5X1f3exBTxRTkHB/A/VTvR NsK4Sha1uK0zVCwRAphFvwgNMZXGt707xDZGQitzFz+1T+4hHH8YOdtnY0c2lmJg 18mze2f0EB8mKB3g8XLspXrBPkuC+3w2VxuPcAtXRmASDkHreuZSkrIY3ShOIebh Y1+AM66/GAhecKku5Jm1fjK9kFXhW1GznOSE78JwPHZ9eskOSW/kdvy7hpEQmhdi xyCyJoiyu/OKM7itgcoBQPkEw2U7zWXymjCZl8+vGyYVZIosuED+CCs9Wi7egyCU cU/wqRql66VdFaB+hFXAb3yTA9bIfBSTWLwk/yKXwxGfjw== Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j9ffgs3sn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 01 Dec 2026 01:46:39 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-383ec96a7deso12968149eec.1 for ; Mon, 30 Nov 2026 17:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796089598; x=1796694398; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=sm+VT9IxZr1SPKsdk6vx7pOAdT6D+hhqEyX33cyfAVA=; b=YIxxXbjTdN48vinxhQP37ryNdbhZE2NkF4e5A5yCtCeGJUIxpoHbqb5WroZOJo1jqH u6D80LaDen1Imgieg6NI51hbzXAaO8hCjmJsCIE5F077wZ/GbL1nF1WZnHJcmM8LE12D XyBuxA/tKBKcw/UbFJohcxTn/UovdKcFthrH3MXv8zGfiV5ue1cbtj+WptcU4mi8hX74 R6r7DE9nUUp6mn1kEiPtfeZAgd5M15c1RmR3gsVfMZB5JUcFgoYOMTm7Odm7JE4ZBzuY bZ2r3DXmJoO2l0MrisfuhJJtAoUb0xIbg09DNen/9Tk3mQl6S8sCzIKG46Jo8vBBOjAn leKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796089598; x=1796694398; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=sm+VT9IxZr1SPKsdk6vx7pOAdT6D+hhqEyX33cyfAVA=; b=vLIcFtFiz1NGZZNmzoDWBSL6Vgj+e/J9R2gzSFp3lpzdrElpnukMZDJU7EtjIKZIgG BubJG+QCI1dKcSRCV+cUKooIyYcxuvK4nUCocAqXh9lBLxIrFXEyddQZuDAkGS3cqKCU Cm+sc3on0aT65qNTSRZnfVH01uObZpx53NdmIW5UP5hG5/F3wqWdbzuh6eWo81sUncJi t5EOwJ2ZLzkT2ckrovaDQoaJdSM4MjewgVkLa4y4oaNP3p6UWOHkXiA8QUffshjIRmGI kcixv/d7GAO3D7QWsm2mn5klPUI9xW81l7qqgLe56FH0kHq/K4/Ht7td46IeckT0Nx20 GJoQ== X-Forwarded-Encrypted: i=1; AL+hErHe/AyGH7P+/AbSAn+alOaJ2O4ptJh46y3piBEPXLfbPgRGFL11P/qz0u0q8gu7tDChsWY51MYvo/QjYHlf@vger.kernel.org X-Gm-Message-State: APuU4Z8ik1CCyOEiYoH8OOgC0DgrO6FGZr+mj6GYnUI56GrtLk8H+fYI LHRtSK9uilQ0sTa2HGJ6/8hkYyBbZeTdZE1Ya9s9sOdSGoxuVcWifqH+1F7CHGef+nuK1WIacrJ V2wVNOLGkF4xHuMvvKts7yy5Fjn/3UOLUeWP/3/eVroHd0WhyGkMPHLSkkzbSjcXfPC7a X-Gm-Gg: AZFdTZfMNDmaz+Yn6v+Zfciv+0edyfH3lHKmlYm47qtbcPSse/c+lb/mpjzhCXdaijL tQ8RlfyZsUGKDLjMitzlhE9dInu9a/1nS2wg56/69HWLExxt0N4lc6BKNdsdyqbPtxpP/FWPHlF AMZ5aSBjEfpLfg9Yrx6jJyb6P9xRetUWCbKle0fVgdDm4r1dyeY+jQDzH9dVnf+b4rc6oe+B8Ms AMJgwRCe8noZ9NIyV3RoAm+VDuWRW40phWm4UzEpGxzyLkyhkTNGiMOrB2Phta+H5COKGwLA29r vr4b7r6f0oDwWkHNydkOnhgEtP9PioLrG6uSZOJzSdifMBG8hRLRwxE7HeJ742HLUiPgBbGuVuc /rsd7aN/SPBaorZelwmZYjoMLR85gwWPILJsdBspMP0GRX/dsZa9k+vDYduV/QWkzhqmyCoiZm5 fz0RZ9dnYqNWmObQ== X-Received: by 2002:a05:7301:2e30:b0:376:19bd:2af9 with SMTP id 5a478bee46e88-3856c2c4a0dmr38160005eec.5.1796089598314; Mon, 30 Nov 2026 17:46:38 -0800 (PST) X-Received: by 2002:a05:7301:2e30:b0:376:19bd:2af9 with SMTP id 5a478bee46e88-3856c2c4a0dmr38159966eec.5.1796089597786; Mon, 30 Nov 2026 17:46:37 -0800 (PST) Received: from QCOM-aGQu4IUr3Y (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-385666e96bdsm96525176eec.7.2026.11.30.17.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 17:46:37 -0800 (PST) Date: Tue, 1 Dec 2026 09:46:31 +0800 From: Shawn Guo To: Vinayak Katoch Cc: Srinivas Kandagatla , Ekansh Gupta , Arnd Bergmann , Greg Kroah-Hartman , Anandu Krishnan E , Bharath Kumar , Chenna Kesava Raju , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, stable@vger.kernel.org Subject: Re: [PATCH] misc: fastrpc: make put_work scheduling lock-free Message-ID: References: <20261127-fix-put-work-irq-deadlock-v1-1-3aa66fe4f2c9@oss.qualcomm.com> X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261127-fix-put-work-irq-deadlock-v1-1-3aa66fe4f2c9@oss.qualcomm.com> X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDAwNiBTYWx0ZWRfX0LMOqGn0yKNa HvNWAXOflMKAV6bdbPMHD2ci3CQvW2xmM+POCpmKIjVU2tvi6PSvkbpl8uypbVDHH+t4KigI2YT x7F7mxtlhxOvS9FH5ydPHDegKLkyPN6OMo/XA7jFFDDd6kAmHczd7dYVc4MpBi/bGZDUOCdZ7v4 A34T8Mmq7U00cs37LXxDRS1R+azq6il9Cy7LlwvTSOPCC0wHjkzFF6RsBL6steo3rKemJb0tgu3 eDTtMZ0VdN3CZNneerFYpiNqBOws953DL3irZ95tEG2oMNAoiVRmTsp8vqZHMQlg8LthgBnj0ZZ rnkh8ptzyhufJMr4ltGVvSPJMdTwwb1wkldlLMNuwvZYQTxicczHIutupOkundFo2r4CqnhjD0Z TkhTL/rJTcAO3K5hqLqxgl3Bdog3EBf+AI/54rwBjS/JqI3JGJf6AYgFwltVC5+rR5KSW+k6Mhe u8lPlGM0OA8AgbnkA2w== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDAwNiBTYWx0ZWRfX5HWWvVMz1yx0 buj8E9jUgBAhPr1dRejDHFyePE3pnaB66b2aBsVCEcEJCsWnyV+ZI7AbNTssHfEShk65ji7Ulsz hz8ENCNP3KZxwyTAFHJCbXRE3yBSlLo= X-Proofpoint-GUID: 9qberPsDPJ5x8VkbDR-R-2W3gF9aGHAG X-Authority-Analysis: v=2.4 cv=dvpOmFg4 c=1 sm=1 tr=0 ts=6b0e26ff cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=kj9zAlcOel0A:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=nuBZ55paaMCq4FNzAmAA:9 a=CjuIK1q_8ugA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-ORIG-GUID: 9qberPsDPJ5x8VkbDR-R-2W3gF9aGHAG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_05,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 bulkscore=0 clxscore=1015 suspectscore=0 adultscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010006 On Fri, Nov 27, 2026 at 03:34:09PM +0530, Vinayak Katoch wrote: > fastrpc_context_schedule_put_work() guards the once-only schedule_work() > with fl->lock. That helper is called from fastrpc_rpmsg_callback(), which > runs in hard-IRQ context on the glink rx interrupt, while every other > user of fl->lock takes it with a plain spin_lock() in process context > with interrupts enabled. > > If the glink interrupt fires on a CPU that is already holding fl->lock, > for example fastrpc_context_put_wq() -> fastrpc_context_free() or > fastrpc_free_map() running in a kworker on that CPU, the handler spins > on the lock the interrupted code holds. The holder can never run again, > so the CPU hangs with interrupts masked, an RCU stall is reported for > it, and the system is eventually reset by the watchdog. It is easy to > hit because schedule_work() queues onto the local CPU's worker pool, so > the worker that takes fl->lock tends to run on the very CPU that > receives the glink interrupt. > > The same helper is also called by fastrpc_notify_users() while it holds > user->lock, and ctx->fl == user, so a context left on fl->pending or > fl->interrupted when the channel is removed deadlocks on the same lock > there too. > > The flag is only used to make sure put_work is queued once, so no lock > is needed. Turn it into an atomic_t and claim it with atomic_xchg(). > Whichever caller sees the old value 0 queues the work; any later or > racing caller sees 1 and does nothing. This makes the helper safe from > hard-IRQ context and with fl->lock already held. > > Fixes: 3f645f6884b5 ("misc: fastrpc: fix context leak and hang on signal-interrupted invoke") > Cc: stable@vger.kernel.org > Signed-off-by: Vinayak Katoch It fixes the regression [1] on Nord I reported yesterday. Tested-by: Shawn Guo Shawn [1] https://lore.kernel.org/all/awz0TMG1-NdBWqyZ@QCOM-aGQu4IUr3Y/