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=1795922515; b=XJf2hUYnA0Dta86bpn4iYkAepHn6sbUJGoNNRaG1R6F0ENYQb24GEAlliEAGhVSuakbY rlMV6h+FOJfA0cXZ7OzbR/IKoTfkbJ6X7QS2VEqDh/6lDP/gIM4tNIHHRky5CFSqfoZ0h SSpol2epnq0Q7b5My29yCgQW6PhYgkcpzFnpLsX2zANnf6ZJr4RFQrPkhWFysbW4RW7/K jmmjlwte1pua6haWL19YiXPRHogQ8VrWISqPtcvYmpkLDbihKxSHjyCSz8/Y4AxCZPJYV wc8Go1GZoZn4v2WCjcLV7P/aTwtOV3Ar716M6k+c5cct0/9iGmG/uHpDgmMff9+MtrQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795922515; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=kc61DdkOTy9nWI7AOj8gpFCyMjyrjOpfMJVMmSONXyM=; b=XrktjKG5Sd3skYpplc5zQnguU4pGJicDBhVkjMXRDcJC+xT12KAB4l475bsuv+Db5jdR /wy4wuAoaG6sKKKjdFQhGRGY6tRqmBwfK4Tdh5HGT78OKsgMsfv8Onm/XTTtTySfPe6Hl z3LGCQQsWYpe6qc3fqNol65AgR5/8A+n4sfEtOf64vqE+YcFLZaIIHCbi/OGZQL0DocMy FH9AIJUjuyvZfoFGSaak8wRfK19PuMVbEe/5XrVh9Q3EcPAYYHntM4HVSjLlS7yq2ftGX XrZAgoB887N5cGic5NBaukgamxGtMzbVWXFGsWdFEHu01eEFK/UzUG9x8M3f/k+MJsA== 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=ZJ+MDliL; 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 18229606A31C for ; Sun, 29 Nov 2026 03:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZJ+MDliL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66CC51F00896; Sun, 29 Nov 2026 03:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795922514; bh=kc61DdkOTy9nWI7AOj8gpFCyMjyrjOpfMJVMmSONXyM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ZJ+MDliLakpqEbZ/9IolWRDB1Bix6uk5OFlWlnly4u7euvO1SPQ8NiWNfX+JZ07+D LiOY7i3JrG9RM9Ed6oMw/6icz5KP/aZxMHFKv6SEtx/BbxR3B9sc+/TVk90bPZc1vw oFr1yb0D+UwXg4otSZ6BiDtuc64ihDcp7M/lCb0vzAMk0Z7Ifke9+pQ8x/0+rzsaaQ cukvzWLhYw2POioMeJhr1yVmeOxxSUPCrgospC9urhgNYfl60oHbuOGX6lROsOG2Cx KCIEF10S0n24Ub+y2/6kb3ZJNyOY+xPpTcWyiN1JNQh6WgMcO1tquGnHC7eWIb6fMK +MgQ6IXwmZsgg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ata: libata-core: Do not use pcim_enable_device() on PCI resume Reply-To: sashiko-reviews@lists.linux.dev To: "Weidong Wang" Cc: linux-ide@vger.kernel.org, dlemoal@kernel.org, cassel@kernel.org In-Reply-To: <20261128-kbug-l080-v1-1-90f7309990ea@illinois.edu> References: <20261128-kbug-l080-v1-1-90f7309990ea@illinois.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 03:21:53 +0000 X-Mailing-List: linux-ide@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] ata: pata_triflex: unbalanced pci_enable_device() on resume -- commit ec840bfcc0d665f55fd42682dab5f06844d5702d Author: Weidong Wang ata: libata-core: Do not use pcim_enable_device() on PCI resume This commit switches ata_pci_device_do_resume() from pcim_enable_device() to pci_enable_device() so that resume does not register a duplicate devres disable action, and open-codes cs5520_reinit_one() to avoid an enable count imbalance on pata_cs5520. > diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c > index f41ab71fc9e2b..587a393d27535 100644 > --- a/drivers/ata/libata-core.c > +++ b/drivers/ata/libata-core.c > @@ -6622,7 +6622,13 @@ int ata_pci_device_do_resume(struct pci_dev *pdev) > pci_set_power_state(pdev, PCI_D0); > pci_restore_state(pdev); > =20 > - rc =3D pcim_enable_device(pdev); > + /* > + * Balance the pci_disable_device() done on suspend. The devres action > + * registered by pcim_enable_device() at probe time is still in place, > + * so do not use pcim_enable_device() here or one more disable action > + * would be added on every resume. > + */ > + rc =3D pci_enable_device(pdev); > if (rc) { > dev_err(&pdev->dev, > "failed to enable device after resume (%d)\n", rc); [Severity: Medium] Does this leave pdev->enable_cnt unbalanced on pata_triflex after suspend and resume? Like pata_cs5520, pata_triflex does not disable the PCI device on suspend, but still uses ata_pci_device_resume() -> ata_pci_device_do_resume() for resume: drivers/ata/pata_triflex.c:triflex_ata_pci_device_suspend() { ... /* * We must not disable or powerdown the device. * APM bios refuses to suspend if IDE is not accessible. */ pci_save_state(pdev); return 0; } With pci_enable_device() here, each resume of pata_triflex increments pdev->enable_cnt without a matching disable on suspend or devres action on detach, so the single probe-time pcim_disable_device() action no longer brings enable_cnt to zero on driver unbind or module unload and leaves the PCI device enabled. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261128-kbug-l080-= v1-1-90f7309990ea@illinois.edu?part=3D1