From nobody Fri Sep 25 07:59:35 2026 Received: from mail-pz2-f12.google.com (mail-pz2-f12.google.com [74.125.228.12]) (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 60D31495026 for ; Tue, 15 Sep 2026 08:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789461891; cv=none; b=EcTfjFBqOu+6whyoyAD0cDXAOk0HjYRIV6N9tjMrIurk5vD1iTRHGu2X8FTkyZCPdBQOG61xGH46t0XW/tLZjC5cYq6c3kG9Bgv3QHGCrDoGbXVclYYkWTAnnnczFzCLzlKopNWLkjqMveKtESQpNj+o91oPoquBIoDAxJmiktw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789461891; c=relaxed/simple; bh=sIWXsFOViFSc+IDafr5CEvfwl5IYge2eVO88nxfFni0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N/79sf4FoSF+Zd3yssOZAvFe2sJBUTDFNf5kWBkav/njPwDQZsRDmaSko14PyLr6Y8GrVuVWdhSQqM2Hz34Ye1FvwSUmIoL553uQp9NwegUGspfUm1oEPJlDIDIdNvKezrQmwKVx6cKHg0ZiVOm4i5/0VF9M/p7L9lNV7rZQ2eg= 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=jI8qnZnu; arc=none smtp.client-ip=74.125.228.12 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="jI8qnZnu" Received: by mail-pz2-f12.google.com with SMTP id 41be03b00d2f7-cc4d04d740cso17475a12.0 for ; Tue, 15 Sep 2026 01:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789461888; x=1790066688; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ZZpYund0BctTk6ZH3SpbNGSO6zmMyboEAdN+GkOuIBA=; b=jI8qnZnu7uDOdAVW2I8qt620CwL1qYLkLRpFYssH/rWpXNRd0J3r5TMKdv+11vPr0J L67H/ULryeVp3mjXhiCycncaZ1R2FFURGZm6ss7salhjCCobfTJovosHdGZWK/uMTwZB 31+R0BP9vX9CFJx/y6K+LNzpNxpDi9aCuCFrtsrlPGNJhVvBlrhSZkuUUkE26G5zTsqZ i8VXrnxtO3GarP75GwZtW/PgOvatJWxChudVV8Rah4Pd7WmFHN5Ahej1w+zFIUKKBCSG h2nzLLIA+sxd2wfm2P8kRQrpmRxNZ1EBAdALsl789N8e3O095KUcVmYhafm39XEMQgpK Am/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789461888; x=1790066688; h=content-transfer-encoding:mime-version: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=ZZpYund0BctTk6ZH3SpbNGSO6zmMyboEAdN+GkOuIBA=; b=NGQCyLGO3aANCugkvo+lXiZfCKbPITHSLiTT6k2lLGHCDeISAhG9sLvF3VoUjvSf1F ipizcH40hQP2ysslNz1zR8s2yiCSNNldyehtKuNGg01HMjXYvvcZ1Z/Wp/3TXAJ6u6Bu vBgblVqY2dEJ6s80384GyxGOkuPmHMHuQ+V5cuSyf/tBbrW5AbRJeO2ovK4QZJoMaP5O UgoEu+Zb2MStKDWVxu1HDgbSR7gfiOLLJkyfxCQUyfwgAMXWZd14RKiCnEoj5RDwmfqX A0J9e96cMsKDyQVU4cVMcjqOrfL+VyiALg3A13O15akdT+q/B6eE5fimtDbSGSwPKBwL Ijhg== X-Forwarded-Encrypted: i=1; AKwUvBxLJYVb0qePqpn+ZYL3uy4IcaZ8W0lCUWjcvE4maFnyFMGDYUdlT5M8aoU/CKg1Sra/nnpDTCbszXWuW/0=@vger.kernel.org X-Gm-Message-State: AFuF++nJsI+b2GJr9Bu6Q8x1mYSNwuwLlik44CpJL/tqKLyrw8pqCX+T +2sSgXdU1shbLj5d8Wh5PLCMDHiOglWNIBWCkKZk6N05p1UzxWkagMnl X-Gm-Gg: AYBFou2S2UNajC16DqrOjZhuE7RXNMWDIHFN4xcvtBs+bcuZ+l3ERG37omO9IUgxJu/ 2MAce0nWRZBffyuPlIWwMFCZFAENi+KsG28SieHVipB4EDnWw4TEpFFGPp77irzi4blO68QC9cS MoQxdky1y8//0NnO5NsXX9cz/m3+j7ufg9mxlV1nHaI04CV4QGp7GiF7wj3JFZ1qwChBRKpfz8S 3+MzL7hkMTFQUWNUnHv6Prb6NgIC3kb97bFc9KbF78l5VJtB6WaOD+KJrGFROEynzgUPyi4IXH5 91pKNZ9PCkMrNIsS1cDNeqML324nbQ4P/tCKjD34WfmWtY3eyxCcRo/Rrni+F2/TP/N6HwPKmi8 yHhiwtT5oYAxWZFxOT3iKYpXGRvTYnEA9ywqeLXNbcJ6uuAW/bkLEc599TdSCiHOby/LTpaX+T7 QKqsI8xdHf55+ywgyHXItbLvdpSvRcx4nG3ZBBJFFsxgbvBNeSg1f0qDQ= X-Received: by 2002:a05:6a20:7f8a:b0:3da:7140:da35 with SMTP id adf61e73a8af0-3dd52823778mr469275637.15.1789461887506; Tue, 15 Sep 2026 01:44:47 -0700 (PDT) Received: from lgs.. ([2001:250:5800:1002::de93]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc4c6528fb9sm6186338a12.10.2026.09.15.01.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 01:44:45 -0700 (PDT) From: Guangshuo Li To: Sakari Ailus , Arec Kao , Mauro Carvalho Chehab , Bingbu Cao , Hans de Goede , Hao Yao , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Guangshuo Li , stable@vger.kernel.org Subject: [PATCH] media: i2c: ov13b10: fix power cleanup on remove Date: Tue, 15 Sep 2026 16:44:36 +0800 Message-ID: <20260915084436.2329278-1-lgs201920130244@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ov13b10_remove() disables runtime PM and marks the device suspended, but does not power off the sensor if it is still runtime active. pm_runtime_disable() prevents further runtime PM callbacks, but does not force the runtime suspend callback to run. If the sensor is active when the driver is removed, pm_runtime_set_suspended() only updates the runtime PM state while the imaging clock and regulators can remain enabled and the reset line can remain deasserted. After disabling runtime PM, check whether the device is already suspended and call ov13b10_power_off() if it is still active. Avoid calling the power-off helper for an already suspended device to prevent unbalanced clock and regulator disable operations. This issue was found by manual code inspection. Fixes: 6e28afd152280 ("media: ov13b10: add PM control support based on powe= r resources") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li --- drivers/media/i2c/ov13b10.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/i2c/ov13b10.c b/drivers/media/i2c/ov13b10.c index b0d34141a13a..6d57da39c371 100644 --- a/drivers/media/i2c/ov13b10.c +++ b/drivers/media/i2c/ov13b10.c @@ -1688,6 +1688,8 @@ static void ov13b10_remove(struct i2c_client *client) ov13b10_free_controls(ov13b); =20 pm_runtime_disable(ov13b->dev); + if (!pm_runtime_status_suspended(ov13b->dev)) + ov13b10_power_off(ov13b->dev); pm_runtime_set_suspended(ov13b->dev); } =20 --=20 2.43.0