From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796015051; b=sJEUCrP3pMUv6IfmS1VjlYluOl7+6lhQN4OhQX6lR1p0l6KoLYnSdc1iYy1c3A2b3Kw0 UdlNMFUCuWIO8eu8d9RbGKTWSrDrQSC+WRXkz4UrrTR907oFWZs9UWEbuqv3imV6cCoug 0NIY9iWfOq08FfcSWfAoKhBlozJFqT0UdZeIk7V7dFkBQZfaGNN1JVVblGssO7vaAwcgO b4lLMmGWapscEmXbGGJG+LVyafC4NorsgbvDA+CvAcKBqs9lpu3XjR2kqwnyid7G7SuTx xRdjAMH0GQ44k7GijCYOu+z6xWUf04iKVVKrm8oqgV8TlwydfeNTTTFf3qv6XUoMp/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796015051; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=F1Bi4SW64Dv3Fjcm4GiPnm0wvid+SjuKa+kq1Y3X3g0=; b=YZgV0q8PvBK7wrxOgHjTG76c1gxM0r7Mw1bPcvDWheJkMSEFbGN6UJAjjp/4nLlWs020 7/RRpySHmQxMSR8szskrEtUbi0zEA+J72t6rDo9u6GKPy6kFHWTRg1IuUzZntHGMOpc0/ DPYSdR6l1tCb/zxe4zaUXhmhK6RkuWrdgYCCpWMjStn05vHILoicAsYLrU8+fRB8sr/4W rwtrWyXvSo7Ux5Y7FTLEAveTIYbHTvjs8tiWQW5+pufQz5xf28tnuiFKUnN9U/ZD5sovf FUorg8Bb481Ve/AeGJcU6Ony62uF72j+Yajxqw2M7pVY2kGkJIDlu2NVOhMES/Uv0kQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I1+OjMmt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0E0D606A31C for ; Mon, 30 Nov 2026 05:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I1+OjMmt Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F34D1F00897; Mon, 30 Nov 2026 05:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796015050; bh=F1Bi4SW64Dv3Fjcm4GiPnm0wvid+SjuKa+kq1Y3X3g0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=I1+OjMmt/vfeZkHmPlwt9OryzPhLYmyPi1ACldb9OzjueqBty/8vr5DtsEDd+xSVP R+d9M0OHEsuaEZOb0zKbifJSa03FihY1jh6ce5Lklj4hMefT2xsIaUmXPb2/fl4f7f hgR0lwjE3d189ii9Hf+4pIJ/fNOb+ffkjgeor4gnfcqBPHsse96QXxxRP4BbCt5VMc zI8uN/ij3Bz1GzaPiq370w38vmTH8bLAFmpiVa7UNA0K4pCbkOhx210k/K49Abq8zX RYZkxjbKW+FkB4NollKDwd+RXgeTPf32v4hDq4by8Qw1I//UVaEo8j5uls/PI56KJE 9irFkX6cthMgA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] Input: psxpad-spi - use devm_pm_runtime_enable() Reply-To: sashiko-reviews@lists.linux.dev To: "Cong Nguyen" Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <20261130045714.654571-1-congnt264@gmail.com> References: <20261130045714.654571-1-congnt264@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 05:04:09 +0000 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] Input: psxpad-spi - devm_pm_runtime_enable() called after input_register_device() -- commit 205ce29d7867cdc1a73d714ec01719f31658c807 Author: Cong Nguyen Input: psxpad-spi - use devm_pm_runtime_enable() This commit replaces pm_runtime_enable() with devm_pm_runtime_enable() in psxpad_spi_probe() so runtime PM is disabled when the driver unbinds. > diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick= /psxpad-spi.c > index a2b00e420e383..3f3c2e27f0999 100644 > --- a/drivers/input/joystick/psxpad-spi.c > +++ b/drivers/input/joystick/psxpad-spi.c > @@ -374,7 +374,9 @@ static int psxpad_spi_probe(struct spi_device *spi) > } > =20 > spi_set_drvdata(spi, pad); > - pm_runtime_enable(&spi->dev); > + err =3D devm_pm_runtime_enable(&spi->dev); > + if (err) > + return err; [Severity: Medium] Should devm_pm_runtime_enable() and spi_set_drvdata() be called before input_register_device()? Because idev is allocated with devm_input_allocate_device(), calling devm_pm_runtime_enable() after input_register_device() queues pm_runtime_disable_action after devm_input_device_unregister in devres. If the device is unbound while idev is open, devres disables runtime PM on spi->dev first, and the subsequent devm_input_device_unregister() -> psxpad_spi_poll_close() -> pm_runtime_put_sync() fails with -EACCES, leaving spi->dev in RPM_ACTIVE and leaking an active child count on the parent SPI controller. It also leaves a window after input_register_device() where psxpad_spi_poll_open() can call pm_runtime_get_sync() before runtime PM is enabled. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130045714.6545= 71-1-congnt264@gmail.com?part=3D1