From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796098729; b=lp5NDfhX4MLgeV7Hib1tAJnsLDO6+GJNFUWm4MoXhjFqndqrZrDRJyi1/yHB1HvKYzR7 Iixb8DwLeqCw87ZwjlMMIIOQLxMVWLS/qFpwW5a6nqa4PG1qtBN6OLQEkbKy3t96K+k+t 8iiwrECFFP2yyyPL7mQGsqrOWSKztuce19r94HnVDr56sZKYH3MDXMbhjKhQL/s89vjRf +yYrVrsEz7sfElau6p6xZDcKt7C0TVmLNwYUDip3AEqq3HTY0AJsnhg75nnYBLsPVo/Ad Y6JlntVqwT1FslSs7LkZRHYJ4sOCpRWDJ7RAwakX6pbSfXgipSvFYDy8MgKY3nyxddA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796098729; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-Id:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=6xrxVqX2/Cv1+8+MciNI0LM+ChjounPFgWJ3zQw50gI=; b=zUh/i16D+n9HhG6/I8W3HoAygKgt8SDaZ7JFpZZn3I3DAcN8ZcD1YHdIlWbD0bU2Y1O+ JkWsDgWfgx3CiaECQJS/yeXMlEi2jkEgHjiS+5GoBbA6wzoSLVwLLth4mq0tz9U0r/wym YcLzaYVJIErx5GPpZP1qJ0eKX5r2X96ZFB/DL7/cMBYd5X7RsBzWLeQTaSc3OFuJA/ynV eQR7dQ/8zLFn3AiNQeI6NUpdE/h3AeGg/bmykLPORDYCfTIo/gnUaq6Qk8watCoEABM4f GSsBu5crvivtHBQaTsWOvVzxpFaMiXssfdUqrARgDviisConJ1RHlGile5uC8n9yX+w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uowNDKMR; arc=none smtp.remote-ip=209.85.210.171 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66A4A606A320 for ; Tue, 1 Dec 2026 04:18:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 66A4A606A320 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.a=rsa-sha256 header.s=20260707 header.b=uowNDKMR Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8a0880a46e7so6681738b3a.1 for ; Mon, 30 Nov 2026 20:18:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796098728; x=1796703528; 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=6xrxVqX2/Cv1+8+MciNI0LM+ChjounPFgWJ3zQw50gI=; b=uowNDKMRVahjZbS6viqA9xsUb60zJ8FvMIpeaFt95fZ5i6gIIZAfBykQ5i2Kg1z5s0 oiW50PF1buLo/zCcxKahXC/Ty3okP3izya9jQ8cphnWspRExrutjTjivxrNi4we2MzOj 32rZ1YxGydg3xlTL6sDiNa8+Sjy+Y05WHj7a6staM1OpJO5dZRhX2613e4vDS+kae/Ko g8G9z5kGJvTLwRD9jAYhNpQJfBaYdH3etlS1ShFju6X2djSEPXshnfVSQEFwK62nP/oE Bs6WNz+lb6erHB46HnAZghK7nm546HWsv8ThdkLw5q7RVW31/KrwaCd+szK4JlNyQcj2 rxfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796098728; x=1796703528; 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=6xrxVqX2/Cv1+8+MciNI0LM+ChjounPFgWJ3zQw50gI=; b=1Dm+8OHDhe/SRmM85GvDeTFxc9XfGJ9DQgKfsxennu9AYk4kYyDaOYt5+wC4aXgUAJ QxGjdpRSIECS1FvShSfRYyJxedFt2OG/6n17MftVceWLS2//BhaP4SJUE5yF19F/R96g U4TffYfqXKLm1GF6wpuKN51qXFGX3ZrAWxFYJWsxbrTGgASc8PTlNSl9pbb+Jsn67KWd VsU+9oyQs+mYPQhDMJXBgV0K7Td1fqiHCwQcOsmS//HYIUFCTSHgLQNbTjAWJWKGkfi7 Qv6KQ0dCN1aGwn7rfcNc+PHskQF4hcDeQzCgyA/B/JWcEc1In6QadUxN1KyZxPk+oQom X2rg== X-Gm-Message-State: APuU4Z/2fYOrHwmHlIJCac9TycH1CGN28Imoc8I4Ciyl4dMI/qL5hoXp JcKvSkuXWjrUrEONNbRjpYT1pWr6brEOEdIPmkgIYrk+d8+olWhCjOoL X-Gm-Gg: AZFdTZfXeJ9Rh4X7sncGdeWltTcox3Z3iqeqBilBo2yUDG2nvqvnfyq/jCdx9ib4fiu mcBUuSAFAuUobtuD1E8vZGG3w6HLbsG5sBCm5eMBdPO0AFDfBmudRQQOKmX2T+CqVImQDREnxI7 BHbfgqrAgcrAPchGJh0QLdsoHEuL7w8H0fOfXStAxmWrjmYMIXygXr1DXZC5HqOXZJKkETu9kNS /BkcxvmgDJBk9OA9iKwmBSmbZkyNWoBoj7/x1XaVugNTStlKa99pfh5PXqm2pl7SC5HGTCxEiyZ gv45CYsFSDXmL4g8Hzp3SSLkCQf/o3a1I+iQHI4jKJAuK7jzQQ8HgFqvHVeumKDZCoZs8+XjOQP SD2Q8M34aKhUfqyUGhzh2G1YVnHNaqbYLL8MqHU2PktHtBp4pOcX4R9//gc6OLuk6rp0pGw6H72 +tNscW6QAR1jZ0do2iROhtXfhWS1DEp8PC2q9Op+iJbaqFe3n+vp7trsgg0Uum5yTDGwbXw+dYT MQMZ2rMAbBflLZTSKtRT5RwSUgndSMgH2AehkTVnwW9ScZZZoGK4CSrLpoh8sjy7OI1xkuoE19H XZ1nVuDRSbBzTHt+qOONb7w1LfJbsfqnHlpJLn24e85QW+JK6GDcno7a3xI0hJR+KtLP X-Received: by 2002:a05:6a00:3d44:b0:8a0:5eff:ad5b with SMTP id d2e1a72fcca58-8c7ddfafeecmr26838068b3a.33.1796098727634; Mon, 30 Nov 2026 20:18:47 -0800 (PST) Received: from SGN-LDSENG.tasernet.com ([2405:4800:5cc3:11a:1ac0:4dff:fe8b:4a69]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c86d821637sm19334317b3a.0.2026.11.30.20.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 20:18:47 -0800 (PST) From: Cong Nguyen To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] Input: psxpad-spi - use devm_pm_runtime_enable() Date: Tue, 1 Dec 2026 11:18:42 +0700 Message-Id: <20261201041842.3162217-1-congnt264@gmail.com> X-Mailer: git-send-email 2.25.1 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit psxpad_spi_probe() calls pm_runtime_enable(), but the driver has no remove callback and nothing disables runtime PM on unbind. A later probe of the same device then calls pm_runtime_enable() with the disable depth already zero and warns about an unbalanced enable. Use devm_pm_runtime_enable() so runtime PM is disabled on unbind, and enable it before registering the input device so it is still enabled when that device is closed on unbind. Fixes: 8be193c7b1f4 ("Input: add support for PlayStation 1/2 joypads connected via SPI") Signed-off-by: Cong Nguyen --- Changes in v2: - Enable runtime PM and set the driver data before input_register_device(), so runtime PM is still enabled when the input device is closed on unbind (Sashiko review of v1). drivers/input/joystick/psxpad-spi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c index a2b00e420e38..c97607dbdbfa 100644 --- a/drivers/input/joystick/psxpad-spi.c +++ b/drivers/input/joystick/psxpad-spi.c @@ -365,6 +365,12 @@ static int psxpad_spi_probe(struct spi_device *spi) input_set_min_poll_interval(idev, 8); input_set_max_poll_interval(idev, 32); + spi_set_drvdata(spi, pad); + + err = devm_pm_runtime_enable(&spi->dev); + if (err) + return err; + /* register input poll device */ err = input_register_device(idev); if (err) { @@ -373,9 +379,6 @@ static int psxpad_spi_probe(struct spi_device *spi) return err; } - spi_set_drvdata(spi, pad); - pm_runtime_enable(&spi->dev); - return 0; } -- 2.25.1