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=1796304473; b=o0i+kASCcUqMZ4ph/mp3JJq0CIHjNbHDdfh87IyydbrqdzklEQiHB3F2ppR9f8AQbwu7 gamhaPb4L6nRBknVR2yQzKsl5ttmRWtAFk1I/lkKDKPhzdQU0hYkvvdFCzFWeLub+kMrD HJnaxaVJ44SdwKMcdd2vmYa76O8JIkQ1RUZYEbIOuI8+P8Rr6+cWPPhgW/QtMiXlW0VqQ ch4XHqPVGS2VVTVLWiyos8ibPrOpN19fNieEDQ/MbG4ZF84ZYsnLMYDB8oOz6M0+5HVnM NJjro5pS/RtmWmivsUh50ydhiE0XenmXoATWxWhGP6nqTn9dxk5I+otQgcUU2qiBYew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304473; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=V3rZ9xmOSsa6yLhanB5UTYHaBD/cF1qlGnKppDmAli4=; b=4h/TghJDU2uEM4L/mBCy47Xrf/9N04+cWjUSyJrnlO08BIa2JAgj7j4jM/wgc/fEVKsZ XNpU/CQIp1tOMGKKrd/X7uvDUksouSW2ckPogpPPNNTWz8jkgbBA6nQRxPIdsmtonV+60 Xvym5OJwSZagtOW93tg9u9cpRKJpUUkuaCudLHmK4SkOkg1DWaG1CsNraEdM4Tb9YHgiQ PBAz/nKVudMOCYYGqnxJvJEW/oncPlmjzs6y0QPWMRFNMTnuFGX0opHAli35bT00tZKbn 52KsiVfWDaiuVFEsAkgcNXLKnw2GAAiUhVGJPdB+W8qYIgIqIec9eIpjjFveGb/f7Ww== 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=WStiv5Yr; 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 A0C47606A322; Thu, 3 Dec 2026 13:27:53 +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=WStiv5Yr Received: by smtp.kernel.org (Postfix) with ESMTPSA id 996AC1F000C1; Thu, 3 Dec 2026 13:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796304473; bh=V3rZ9xmOSsa6yLhanB5UTYHaBD/cF1qlGnKppDmAli4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=WStiv5YrkPPyLyNpHB2zVI9SGfALFzmN+63GyMJG1l9Y05ISGT+Au6uTN6EqQlzSF 8D/719Z67Q5WHCU++WTLw4Cub8el+PODKTVtrPDFcS5MA+ndgWJUvDySvKKXLZYFeF WPUB+LfHzlqstbWKSCfFVFJ/CY0jpQ/tDgzQk7I1SYEZLn5vnCEKma26oYXoxV6iVD lOdPyo0s06BYLTM4LfU6YO2551Xc1JM84BcCZKewc8KtlzegsqLadyTfdac//hy62C yF4KpmFFFmVvrTc4GSmvtneSyIX16QH6MVTb4WfEozoB2KAStsUCxk3XcMffPumico 8SwaDLxn0mP8w== Date: Thu, 3 Dec 2026 14:27:48 +0100 From: Niklas Cassel To: Weidong Wang Cc: "pstanner@redhat.com" , Damien Le Moal , linux-ide@vger.kernel.org, Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] ata: libata-core: Do not use pcim_enable_device() on PCI resume Message-ID: References: <022e98e0c153e1e306fd06bf9198c25f32645389.camel@redhat.com> <20261201201504.1308278-1-weidongw@illinois.edu> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201201504.1308278-1-weidongw@illinois.edu> Hello Weidong, On Tue, Dec 01, 2026 at 02:15:04PM -0600, Weidong Wang wrote: > On Mon, 2026-11-30 at 14:00 +0100, Philipp Stanner wrote: > > Most of them suspend through ata_pci_device_suspend(), which disables > the device, so the enable on resume matches it. The exceptions are > drivers whose suspend leaves the device enabled: pata_cs5520, > pata_triflex, and the broken-suspend path of ata_piix. ata_piix already > skips ata_pci_device_do_resume() there and uses pci_reenable_device(). > I missed pata_triflex (sashiko pointed it out); v2 will handle it the > same way as pata_cs5520. > > > That change looks suspicious. I would expect it to be unnecessary if > > all that were changed in ATA were replacing the pcim_ functions with > > the pci_ ones. > > pata_cs5520 does not disable the device on suspend, so any resume path > that calls pci_enable_device() raises the enable count without a > matching disable, whether probe used pcim_ or pci_. That is why its > resume must not go through ata_pci_device_do_resume(). > > Moving all of libata to the unmanaged API would touch the probe and > remove paths of every PCI ATA driver, so I kept the fix to the resume > path. Damien, Niklas, let me know if you would prefer that instead. Philipp is the author of f748a07a0b64 ("PCI: Remove legacy pcim_release()"), so I trust his judgement. But to me it makes sense to make libata consistent, either fully use the pci_* APIs or fully use the pcim_* APIs. Without looking at the patches, it is hard to know if it is more wise to convert everything to pci_* or to convert everything to pcim_*. (I assume that there was some weird corner case that caused someone to mix the APIs in the first place... So personally I would prefer the solution which untangles this mess with the most logical/beautiful end result.) Kind regards, Niklas