From nobody Tue Sep 29 10:33:02 2026 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 4956C326938 for ; Sat, 8 Aug 2026 15:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786202874; cv=none; b=oORRS+VMyGRnmxDztZZ8oyDmew+9VUYCQkhkZpUJMaGM6d98GoewOBEHSAXtmFA1H8UzrXNa3XftGeiIhSq/z7HjcGKDWvkifoGXZ4NI4iD2dBzvCPaHbAdJmqihvgfCmPgnq76jIPS19CkTcBtDmuLOLxnbqdvBWG6kpUxwUxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786202874; c=relaxed/simple; bh=kpeaAxS9LFu/8STzYbBglogfC3SD8I76cMF2ZM5B+38=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QyyX8lYPwqkzNBD6T3Wjv0misRSFFJhEC3gVNahLzox1bKT/5fyBzLECNbJSlAjkVVkK+ZW2zHGQltvCQC7Owy1/g5xlDW3P5e6jZkAEuDQQarLCj8yUfzBuOY0JXfuvCq5JZNJaHeG0XUUPb60FpJemYZzVolyYxnSMsB4uVRc= 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=KysmkUTq; arc=none smtp.client-ip=209.85.214.171 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="KysmkUTq" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2caed617615so6189945ad.3 for ; Sat, 08 Aug 2026 08:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786202873; x=1786807673; 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=fosxO2aakWlymDAhSXtvCLChemt0o7MdN2FsRA0clTA=; b=KysmkUTqvEMmUDI6rr3JrQHnS3DNGxej+YMklGux+vGCgE6ao+ia+N0OzoSf/UD+0n zz47KhxwcJbEkljkVssNm3hFW1Q2T0Y14eg7d624Uo5xntn7uJjyz6ZmIyJZmSrWK+pw zMJGsvSj4mXzgBagfdwcJ2Ut+ptz4AGNV6nF92bfzRqX7FqjCET9ZCwnvMMygOAPnxPo jljRQY63iPqBckV5/Zs+9GOlAZJIUoCsmVO8+Vpy43Tx3BwM2c/0evaUXDduLCJWVZpD 0KYhi7OtKYkXP9sbQubJc6vwwWpxq67yzgLO7T5BJOQmdD99z8AEFShkmcDs47ff6tDK WbaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786202873; x=1786807673; 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=fosxO2aakWlymDAhSXtvCLChemt0o7MdN2FsRA0clTA=; b=M30VyqaHNVGss68eIyZCadKqCh/mKjJrP/guZm48F3crAE9Lzzpi22VON8S8G8+k7o MswZd7HR/hfX4HMS5J7+M0S0vJ+00wG6G/8IyFLDQu6ZkYlVV+EBP75P9P3FX9MyAN63 5NuIS4+dHCrDOurml6pHZSVKsMK8Vd4HU06pIj00jjJNqkNM5jXcAgC+j4RPC1vKn422 dP100HfDKANeK83dRbfp8oEVcOAcY5cZ8IyM+j0b0wNKmlom8DfLwdmTBRJLYJKYYGME kdjDTR1JEIGvMgMM/DWvD4bbmWiBu6+KnvJ5NjmvfKnFtIHMg8g2sFF9CdxOi0f0wwVX qBXw== X-Forwarded-Encrypted: i=1; AHgh+RrQufzImYEbVt6lI1hWkFBWFFbUPk9Y2bNcRtFqoNzZIrql0i387B8QeRK6GhrHNEMTbsq05LFJ2ohRbxQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy09TE9ZhhC4LAwanhWESgTloZcoIgAYj+Az6VZ/GB0W/N432xc IsMmEBIJlfYy7BfEBmcR4DWdeif5L27wHRHZcmOwnTvAXqZZwzC82agX X-Gm-Gg: AR+sD10jT/rkQW0YVThipDKwsNZMPdf7RacnuUEz9KrZjnJ1aV/VJFaMp3HS8sEIfjr qnNvOOhJ7GgKDgwnd307VxqsUfySjskkC5vZDFWSDArpKw1MM0N9T7z2CHoohVUq02MQ2Mv6TKG nxNDW2bFzp2w3LPJj7Uu7ZyC5hZjWKimc3deP4CRAML2Y9lWX+hW6lWBJS3F1h2qqcIJEM45H0Y ruJbDNIUnyctUW0TQjECzQ2ovd1ZOWqfAKQFbj27ER27Ytp4sDxU39XEL5nzCs6hXnqA3uu63Ki WaJcYCr3oZ3BJOHu4G6+zrCVLtGkdH0AbPVAWeGKRQTJlDb/B8GJMxcjS/lA+EdT1IpeJMkTJKs ZaWR3ZwUFNDj2dk+d+G+7AmdXV4w2CNtAXYyyseS/MSUUpbN+SJ3q2ZtQ468b0NlZbVEh0qxjaJ odtf5ePVP3B9GLXx7Jky9CCRX80Vo1ihSo416fL0394WrQJ0JcNkiGYgzExWgGehFhYAeiIw== X-Received: by 2002:a17:902:e951:b0:2ca:bf68:2a54 with SMTP id d9443c01a7336-2d0ca96246bmr402478875ad.22.1786202872580; Sat, 08 Aug 2026 08:27:52 -0700 (PDT) Received: from lgs.. ([101.76.249.46]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d14d57f8b7sm19558175ad.30.2026.08.08.08.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2026 08:27:52 -0700 (PDT) From: Guangshuo Li To: Codrin Ciubotariu , Andi Shyti , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Ludovic Desroches , Wenyou Yang , Wolfram Sang , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Guangshuo Li , stable@vger.kernel.org Subject: [PATCH] i2c: at91: fix autosuspend cleanup during teardown Date: Sat, 8 Aug 2026 23:26:54 +0800 Message-ID: <20260808152654.2943371-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" at91_twi_probe() calls pm_runtime_use_autosuspend(), but neither the probe error path nor at91_twi_remove() calls the matching pm_runtime_dont_use_autosuspend() during teardown. If the autosuspend delay is set to a negative value while autosuspend is enabled, the runtime PM core increments usage_count to prevent runtime suspend. Without calling pm_runtime_dont_use_autosuspend() during teardown, this reference is not dropped. The documentation for pm_runtime_use_autosuspend() also notes that it is important to undo it with pm_runtime_dont_use_autosuspend() at driver exit time, unless runtime PM was initially enabled with devm_pm_runtime_enable(). Add the missing pm_runtime_dont_use_autosuspend() calls to the probe error and driver remove paths. This issue was found by manual code inspection. Fixes: d64a818859af ("i2c: at91: add support for runtime PM") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li --- drivers/i2c/busses/i2c-at91-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at= 91-core.c index b64adef778d4..65b389d07d2f 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -253,6 +253,7 @@ static int at91_twi_probe(struct platform_device *pdev) =20 rc =3D i2c_add_numbered_adapter(&dev->adapter); if (rc) { + pm_runtime_dont_use_autosuspend(dev->dev); pm_runtime_disable(dev->dev); pm_runtime_set_suspended(dev->dev); =20 @@ -270,6 +271,7 @@ static void at91_twi_remove(struct platform_device *pde= v) =20 i2c_del_adapter(&dev->adapter); =20 + pm_runtime_dont_use_autosuspend(dev->dev); pm_runtime_disable(dev->dev); pm_runtime_set_suspended(dev->dev); } --=20 2.43.0