From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B339C282F36 for ; Sat, 3 Oct 2026 00:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790987105; cv=none; b=UIbd/LT52nkdRSuqvyJPNjIJci2JwRWicCvPC9SvyJyFJcue5ynGgLd6BJcfo6DGIo5pYUXs6TNX2w3KKtvZXjU2kiKCY+v4NgEWvmzG4OX+79Ss1HAbSO1mJGOZhaMqzHcII9m0IFPwu6gtVx1heX82/YssAjxkIShHlvFANS4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790987105; c=relaxed/simple; bh=A/3AUXde72fuZ6eY3PoFCI49hKa2ZKP7PMEccBpbJk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BeKj0dE5RNbF9Va9LNqa1+V6rwNfceP+4+M8W8Z89YbmCae95q/tr7VMbPB/i9HjTw02qNacW5HFh1yY/uU37kIfA2jnVIIfm6FiU43czPi/+dnCUd8EI/d2I23yNBZZfzTN6v49IJJ2v4DxSB6qEUe8HpErO0KwIMokmRk/+rw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IKpowAtE; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IKpowAtE" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-91791ec1b83so1726176d6.1 for ; Fri, 02 Oct 2026 17:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790987097; x=1791591897; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8hxKqOypKGR+ve63h/kwiqa4y6aqyuQrRDm4kuc2wAI=; b=IKpowAtEhkMc7UlX32fZg3kvjFh+HzDUPniQ2AqOUSysBqt/ewvXLPTpnUI4HVtHUD sVikVJIKWBkfCqqnDWZRQMKJg/YWKUUnWGDYXobqfixYAEY5c2Fp3Sm4t9QAk+SvYMZg 8RYEtTGW+em2ozbyFpOuVkUp+dyWUqQ9dqcn7riBQVG44C97HBkWH0ZA2CTuDEvXOoUP Fus2MrbzauY8DkNmYcRDHMOPr/RpjMEgK0d3Isrc0rMo02FSj27GrjNNLrza7EnHtjX6 Ds/oWzXIIyTu7bzq0nsecZKOjb1LWYL2VtJ+Yp8CuLGAS7UyzT2XtfBjWen6XlvdIQFU L5UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790987097; x=1791591897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=8hxKqOypKGR+ve63h/kwiqa4y6aqyuQrRDm4kuc2wAI=; b=Q99e/HLfh79spkJP3YcGY/ZM9syK1OwJ+pQIjO2o3kAyfTFaCXCPxAGa9ANbDcSl9f As2K1N2SZYR7+8Dyi7bfRzlyAbvdOgdrUVobIPCn3j5592nG7GG6autcA5hOLF5FkgQl ZUdR311Bz0zUGt0uz5pkXKEtwVIxpLu3zq35PjqcVX1VyrVpsKMfkjhRUjkuWXmwYKIt gphQMTSiZdpE4/9+DDrznw47jfJLpnc6+b4X8Q/i8FvX+Mq5QY8puXp2f7JlGMd5BpY7 gvb4qxr/pjo2t2UWLVjtnhpRuOiDdoIlrDNYXwQagFf9P4cjuu7BwRdLC59og/lIjqql +PkA== X-Forwarded-Encrypted: i=1; AKwUvByytEk9nl78PJjBaD/vmyYIXU0RK0xi8Lmj7Z4lcl8fVLCWfYqeSs9/mV+ICFpca3GxFD83MVPoIHsEjuE=@vger.kernel.org X-Gm-Message-State: AFuF++kKbhn3yBc6CDvPwQSgSG2e+GIPqspWCcuEMqb3o9abwC5Cu07t 3dXR5Lc/V8n6G8O/xToISV3on5MRhXQiv2HOcJIZYUyWiIAEDPvseaM= X-Gm-Gg: AYBFou3DqIaZVzne740L62Q0XVFhpIF7iKyh73w57CEF3kgAEobU8ohRTWUkHF4vUe2 uDfbIBSZxmY62+WddAdkA/5qW0XMRrMGjdG7jnWUEVjLjMa/5Lw/TLxQYt2/rR4xhxnBPtSgfd5 hvQ8o92bbWEnK2UaEYRbn43mwGAq46nM8qe6Q0CdJUycchzre1Grow09uKIvJFtgnGgYsCTlTnY aWZnTAaxsHtQIZS//FFsAkqpO9azDoUO2Nmq6SRwnfhBthCVkH9N0ZAYPbOwD+cDap4pfot6B4x jajEDk6u4atE6w3m/RT4AfT5V5Nio8nPNQvL0vyKWprznzKedhrcJA8b7vzPsM8XEeK9y05hgng DpTpmTpCLlJfl1pG6W+9+UIl1KXvoBEGxkpXLT8DG81iY1yRAacDX2QHXqH6WbkNRn13ZlUJMNe PxptH8ThTLBaqUXwiiRAga0f3CFjHR/5Yu1WfiAW4RT94JaeKtVAeewvH2cGWS6pQGaG2wY5Hmw USeelkvwMdAFu4L5hYMB1iT7lpJ49I+ezSvibJb4QNZQIVha5QjNGDocqper82owWRZ1CDUsGZg DXC9jRu9Fqfa4XDFjJNZoedq0w/V X-Received: by 2002:a05:620a:2814:b0:937:2d64:57ae with SMTP id af79cd13be357-93e50c00470mr224017585a.0.1790987097519; Fri, 02 Oct 2026 17:24:57 -0700 (PDT) Received: from i4-gl-tmk5904-1.ad.psu.edu ([130.203.156.90]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93cca1a48a5sm341771585a.14.2026.10.02.17.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2026 17:24:56 -0700 (PDT) From: Myeonghun Pak To: Maxime Ripard , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ijae Kim Subject: [PATCH 2/2] media: cadence: csi2rx: disable error IRQ while runtime suspended Date: Fri, 2 Oct 2026 20:24:51 -0400 Message-ID: <6778a4ae61c46294f5014125fbe82618067e2c30.1790986123.git.mhun512@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <0d41c39bc84b97efdb8c06ef451fdaefcb331058.1790986123.git.mhun512@gmail.com> References: <0d41c39bc84b97efdb8c06ef451fdaefcb331058.1790986123.git.mhun512@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The error IRQ handler accesses MMIO while runtime suspend can disable its clocks without draining the handler. Request the IRQ with IRQF_NO_AUTOEN, enable it after successful runtime resume, and disable and drain it before runtime suspend gates clocks. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Fixes: c85d3d5362a8 ("media: cadence: csi2rx: Support runtime PM") Assisted-by: LLM Cc: stable@vger.kernel.org Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak --- drivers/media/platform/cadence/cdns-csi2rx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index f8c626e19aa84569737aa785a31a0f8c94087613..9bb776b5a4c8248a65df733e3a8963a6393f0996 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -982,7 +982,7 @@ static int csi2rx_probe(struct platform_device *pdev) dev_dbg(csi2rx->dev, "Optional interrupt not defined, proceeding without it\n"); } else { ret = devm_request_irq(csi2rx->dev, csi2rx->error_irq, - csi2rx_irq_handler, 0, + csi2rx_irq_handler, IRQF_NO_AUTOEN, dev_name(&pdev->dev), csi2rx); if (ret) { dev_err(csi2rx->dev, @@ -1042,6 +1042,10 @@ static int csi2rx_runtime_suspend(struct device *dev) { struct csi2rx_priv *csi2rx = dev_get_drvdata(dev); + /* Drain the handler before disabling the clocks it needs. */ + if (csi2rx->error_irq >= 0) + disable_irq(csi2rx->error_irq); + reset_control_assert(csi2rx->sys_rst); clk_disable_unprepare(csi2rx->sys_clk); @@ -1082,6 +1086,9 @@ static int csi2rx_runtime_resume(struct device *dev) reset_control_deassert(csi2rx->sys_rst); + if (csi2rx->error_irq >= 0) + enable_irq(csi2rx->error_irq); + return 0; err_disable_pixclk: