From mboxrd@z Thu Jan 1 00:00:00 1970 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=gvnGvu1ZqA0GucSeLEpCVt5seO2PSJmv0uNxhbYZnbuSAUGClOoo3eLusDnEBAKtEw3m cgAAwf7E5cE+msQ781pPHwRiQF3s2LtMOFrB1UR3M9e2j5vgUnTneAZunnz/C2KPR0cUi g+OZzweWvuYf778prmyALVbgv8MzayBIfbk1IOYw39HRd8ZhTNmprlJ+nIfbi6crQQdwJ 2bkB56WwyXQ7ws7P9doKJrbF0M1MpcBWmdYJMYTMXhSzwCWCYcEHk7MIiRC3LPfHP2th9 +Rw4+o9DBcROnBx28wE1cYldi1DlCu9DlpmLuYkwmu7R/eVorj333dX2VYpwM7Qfilg== 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-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Spam-Info: X-Proofpoint-GUID:X-Authority-Analysis:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=sm+VT9IxZr1SPKsdk6vx7pOAdT6D+hhqEyX33cyfAVA=; b=aZQfdtYkK5hyrFHRzx9yVtbeoxInnpmaGgSLB1evv4S2e5wC10kzOyPXiS1H0oeyW1+J gIcciWfTIVeBBD1/xlvpLfakIs7dqIsw94DiPLmo4+X8lDk6XC7AWPpl57tRaurAOKnb3 2AK9iz+FGO+0l/OLzGHko9R+3hT/BHiyrJ62OBzcinxgzn/fNAoHXdzJf77WYpY8q3gqU eQmyt+hTG02VrBuoB5cLokTv75OPXuhBAcMvaQZHjh+NxgjQXz7RMqwwuE8b8G1WZCafO aUfM3rHeTr379/S6x58hP+P4QGRL7NrovXSg7aavbbsmUxMs9Dy7hCQvKFod1mghdsw== 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 991C6606A320 for ; Tue, 1 Dec 2026 01:46:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 991C6606A320 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 (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B10WN5U2345632 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-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j9cd3j1g8-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-f200.google.com with SMTP id 5a478bee46e88-386c3309469so8565612eec.0 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=yTTFAUOCwsmIAMDzG0iBp6YIFsxI9qX6hY3VvV8kMhbjsVWWscEnrHt1AKMt+upszv 2JafXL/jVnHNuTa6GgvEF0ed0cqk2n0xjoJDgC99L00YxgqCUH1YwGR5Jwnj/5xyMFAx ltr/u0Qg9DBzJglQ/Q0bxHnKF6b41jV08B+IRiW7svoH9DNmc9ERinzhU2hq3/FyCu0T F+1RnIVaNMnMe5PB5kswuUT0LPqmTVsm34s5SsQ5X1IAOLEZOpTME3f4SVfESsJNpaFj GloWWvOZnVeNhY/PnTl4Li/RHSnX65fKWtUheHdvdTHDgttlcpiWZKqXMe7cEO3wuHa9 HizQ== X-Forwarded-Encrypted: i=1; AL+hErGVI9Y94XdIBGxisPZu7M4oy6qmGEevYSGZd/GqXj7X+2r0tFbN59ZFDMSQGyYkz2Dyti1YdDo=@vger.kernel.org X-Gm-Message-State: APuU4Z/VtlXdubl9bKKYrraWibEJ3ZBvf+8tpiDpF/FNzbgZhjWfvsLP tQw/KPxruwHJg8/SZae4z4yUmC4tlUzRTWStz7EOVIJrkF3zdQlGXxomRBaCFVaeQmdya2TyyRs p3xe/6HraSHWhFA/ldOdCkPEyqD6jv0DZUfoaNgpGExm4AZFNqjUkzQZHLgo= X-Gm-Gg: AZFdTZeEXgIgKhvzgkq01Q2HEC4VmLrvXjv+ybUovIl9AT1KoqYbtOw0tlXBn9m0vWt WW1M5uy7tml05gKSJNHy7FoHoxSc9m9Ob+Mx6vIFxNGBWR3S7XMjyo+ZQzH/2GeBjLm0OkBUCjn hjn8QLiELh+RP3nMpPiI7fO2bmo6lGX91stejIW4Iyj0jbux0eSv652nxo124uyFa/Z7kiSnREq ROWf/fwXiCjo2VbWGbEUKH72dgjBwQ+0BN5N5Mt7nerJFDehtxJy+NFY2kTJDpry0Tuw5IjXBpH /bBcLcU1h9NJMfsTrLI4zwO/MLpDUSxbEBj9VQucsVBXlZFEz7lVlxIgo6vQuRdwbBbzs4v0a/V RX8Ju6xcRgzlSEW7NSymLp5rAuMxA+n0fmGws02bfymc4JcBYw8p17ACiInGFVaAK0j8DRy89px DgfPiEPRk9rTLjTg== X-Received: by 2002:a05:7301:2e30:b0:376:19bd:2af9 with SMTP id 5a478bee46e88-3856c2c4a0dmr38159998eec.5.1796089598292; 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: stable@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-ORIG-GUID: WSCbH6SmrH6HLTiise400Etd6m1DpCqQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDAwNiBTYWx0ZWRfX/dZ4/lUCqWdl aTOS1gVCJUWEvP5z9zV70UThnM+RwwzcuikHB1tabCNR2hUppFrh/ySxwQQfq/ZrlkBzhLVPtsB DmNb2aIc6EjhSpd5pcRR04Zpz9hPB/AT6hgYLZ5PQ1+cBG3sfowoQg0heHrU3I/TRcjE1aaKAmm 9cUTixdyU3p1XcrinW8WJ3Ls9SxMcM4WDFdjZghlLaSL0Z880a688PAn4edpI+ES2o8YLiuDwRw H39Ay4AT/p8b4HdzvO8aw98v+hX8p2bWtnSaCC3PU6wiPEmxdVlWbM2b5oQfYt6LAGW3Hza2eaB +rqSP/SwmRhO4FfBNOGU3tT1r2pycEbp+irHDIB+PQMFgxIoLeGaLMDQcWMupME1jFhev88TDM6 iXn0v0neumST/y7ki4cO0dGuKw0u4zmalXDPgS2lCLkhqU2/BoA10GFBLqx6SJ/+kQuNmToycLm DYvjyLkCo0a93e+aldQ== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDAwNiBTYWx0ZWRfX3r7+Zz8eiekM iY0xj6v9tkMKhiQTW/YIuowzS6TFJ9+JWpSiN44Q85TqPgdP/8ORY/lFh3oY9ZK7exCFiJ1Jm0w dqjaCALSbBLirzAYLcc5JNPgRuEiJsM= X-Proofpoint-GUID: WSCbH6SmrH6HLTiise400Etd6m1DpCqQ X-Authority-Analysis: v=2.4 cv=HIhWhYtv c=1 sm=1 tr=0 ts=6b0e26ff cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=kj9zAlcOel0A:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=nuBZ55paaMCq4FNzAmAA:9 a=CjuIK1q_8ugA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 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 impostorscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 phishscore=0 adultscore=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/