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=1796083355; b=ZTaj7gW5U29bEmkMxsqIvXYlsXbu9zwnslGe0vPD0HPfV9eZqRqVXRJdicIVS2GNG9N4 dILJVMzoYCAntIOE0q6MvEcV9ECjxM1k6pvaf5ApkRCyM+REn+LS2NEae6vpZQvhyXgd5 ZVfAlNPAt+CNTd2O0wjn+YkSG+g0G4uMSdXvjfUPWsJ8vEeiHZ2DTIDQP3NV9UXHJX8ME Mbum7oVhXowDlMiTWRnOW//V4S5okrYopvLlx6KdKNiEL5uqEnZmxL+BYc/sO1nC/w3nG SeOGA12ZfVE6q42MNg3OrNMVOwo+W9lHV80vaCVX6aD5UUBbo0yWYIT+zYgeDRqX/rA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796083355; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=CGpN1Kuo1/wRSIre3T/QvHy07qfurxmtBPGr9Xd3JBg=; b=5jFaaU2X3D553f4SzpQZrhfInE2CCKzDstp9UkYifTKx2/lzr2LWr4whCDNEnj/mOn53 wsaptWI5yR/43Zl/x4P23WSr76+vC2pjDde6t4N6FiGuPrQL3yFjO0cIb/Z5IGXP+Yp/B 9mcUS8grpbzkIx/YnfqUUBZ+TQdFxcnBn/iapk1KH5SPwNHfkxxSyLZB8EOMp7hVgXrOR zN9BwaZwmP3Grb+NU20TXlHjMLK7dFXBKynOGmByzudBxf21RwSa2mA5nEFSmx7yrl2uh 7w+zu99b8Py2d40Tlm5g3Ft1N6XB5E+lUmjnkQkK3IOPWAue+TUJZRGEY6igQHyiBUA== 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=XaHl6mxD; 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 5F485606A31A for ; Tue, 1 Dec 2026 00:02:35 +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=XaHl6mxD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 668371F00919; Tue, 1 Dec 2026 00:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796083354; bh=CGpN1Kuo1/wRSIre3T/QvHy07qfurxmtBPGr9Xd3JBg=; h=Date:From:To:Cc:Subject:In-Reply-To; b=XaHl6mxD/LwnXNEMxTxp3AI8/H5KAibnxQMCjCUIOUijS0Geo6lZs25UkkJVuNkpU 8skMTdvHBJgjok1W/lf4NfBSwnnGJL/+BP3GAJdd52m8OcExTnKQgsAjmwFPIab4BU 6EgADGphdshlo6du44SCeP2G9BEkCo9cmDroycSRPoH7FXgpa8+oHRLTX9PcDa1CQs NMXZ1htSy+OyRvragzetUUdC4H5epdHGYR0pltuCoq38UDcwbpF7q4FE+cbgdUOJqa QrUN+YNIWj5HBKdUYuogcWsAVNiQ7mrU+kKYZKZ93DosPxYBSqaHPCtCy4S3lVOnqv qo5uW55MiN7kA== Date: Mon, 30 Nov 2026 18:02:33 -0600 From: Bjorn Helgaas To: Arina Kharlamova Cc: Chandrashekar Devegowda , Liu Haijun , Ricardo Martinez , Loic Poulain , Sergey Ryazanov , Johannes Berg , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Philipp Stanner , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , netdev@vger.kernel.org Subject: Re: [PATCH net] net: wwan: t7xx: Do not call pcim_enable_device() on every reinit Message-ID: <20261201000233.GA399004@bhelgaas> X-Mailing-List: netdev@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: <20261201-s2p-d64-v1-1-c9147b2eedb0@mbzuai.ac.ae> On Tue, Dec 01, 2026 at 02:56:31AM +0400, Arina Kharlamova wrote: > t7xx_pcie_reinit() runs on resume from L2 or L3 and on every reprobe > after a modem reset. It calls pcim_enable_device(), which did nothing > for an already enabled managed device until commit 77f79ac8de0f > ("PCI: Remove struct pci_devres.enabled status bit"). Since then each > call raises the enable count. Since commit f748a07a0b64 ("PCI: Remove > legacy pcim_release()") each call also registers a new > pcim_disable_device() devres action, and the actions pile up until the > device is unbound. > > The device is enabled once in t7xx_pci_probe() and the driver never > disables it, so drop the call from the reinit path. This and the loongson/lsdc issue (https://lore.kernel.org/all/20261201-s2p-d60-v1-1-d88cf22132ab@mbzuai.ac.ae) seem like basically the same issue, so I wonder if the pcim API could be improved to avoid it. It seems a bit subtle and like something driver authors are likely to trip over. > Fixes: 77f79ac8de0f ("PCI: Remove struct pci_devres.enabled status bit") > Fixes: f748a07a0b64 ("PCI: Remove legacy pcim_release()") > Signed-off-by: Arina Kharlamova > --- > Found by checks derived from the spec2patch kernel API specifications, > with the help of an AI coding assistant (Claude); I reviewed the > analysis and the fix. > --- > drivers/net/wwan/t7xx/t7xx_pci.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/net/wwan/t7xx/t7xx_pci.c b/drivers/net/wwan/t7xx/t7xx_pci.c > index c51c3b267186..47593e759238 100644 > --- a/drivers/net/wwan/t7xx/t7xx_pci.c > +++ b/drivers/net/wwan/t7xx/t7xx_pci.c > @@ -496,12 +496,6 @@ static void t7xx_pcie_interrupt_reinit(struct t7xx_pci_dev *t7xx_dev) > > static int t7xx_pcie_reinit(struct t7xx_pci_dev *t7xx_dev, bool is_d3) > { > - int ret; > - > - ret = pcim_enable_device(t7xx_dev->pdev); > - if (ret) > - return ret; > - > t7xx_pcie_mac_atr_init(t7xx_dev); > t7xx_pcie_interrupt_reinit(t7xx_dev); > > > --- > base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5 > change-id: 20261129-s2p-d64-e315656e3f12 > > Best regards, > -- > Arina Kharlamova >