From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796118338; b=cKmgbCt/r16GiQcUoKaU42+M+RLF11XhJelhGQtURFtK9sgbbfMxnFiQBfnd6KwlZC7D 7pyerILzdcc9IPwrlHlLop+0o4PaodjcvuA7zyjdfCh5oOm1QNJOMa9RKKD49eFcGZzJu ATXDEu3J3MuSdoVEKYmSp9eY1XeCYYhyqjeuU/2XxtyOLDk9oWFy9F6eUNLzpm2sNUfGg 462Pq1JnWlgS3htYP2+ABE/r1xiulHhpsm0MzYa3AC8jsOD5NwMYVtrnJj5K/dKUT+GAb vUJXKQ2C3c81gb+G7TEbR1msIlBkMcr/J3IZNa6nl5czm39ugWXrT5N7ao0j9kyhB2w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796118338; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:User-Agent: MIME-Version; bh=hPjDcckheWf6oYLCmwuNAde7ONIduCgpmZ565q50VFk=; b=wlkcXl6rwrxbksXG3sU7VMNgFSJST7D6EYN0H6JyGtPMSQ0A4Pi60KcTKfMgXYHWUihC 9uiSw2N1ZkxDHsP9jnUcIcg97IbyG5raJsuGD0+sVnZbAIxBbCOqqpNnMr6Z33EsjdxDX TP23bMzj2pnp0s//50AIJNnEBVWVM+CTqIr5r8Oces5wDDwWRhkPZlxMOcGdG/6pjQLbU q+638c2GpceJvPYb0B9qI1S/sn7oK3tK0XFujojEZPxih76DJK4kOmHYkEZmIiIn2blc+ D3ZnPJL7UfXXusVYJ04hA1yARzJoTVWDAMUgicByBGOVu43WeNd4Ttrm2jG5/Cjq5Tg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gLITRBDh; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=MI5Ltc+5; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCA1D606A338 for ; Tue, 1 Dec 2026 09:45:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BCA1D606A338 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gLITRBDh; dkim=pass (2048-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=MI5Ltc+5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796118336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hPjDcckheWf6oYLCmwuNAde7ONIduCgpmZ565q50VFk=; b=gLITRBDhB5jJXz8bYEBjiEPhO+itdfqKi6HS2E4YuohVjk7Z7o1RGsQUmvA8Zv4P9b3Rxe kFJM7WJTeTLpQBTwroYt3p5zhgWy48Cl2H+cWhXEVibe33pPNb7purXhFRPOiZJyHYoxHW q6KthBgp7Ah67u5lAUpnEHvoCXAexQo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-khqAlwprO6C4K3_omJ6TNA-1; Tue, 1 Dec 2026 09:45:34 +0000 X-MC-Unique: khqAlwprO6C4K3_omJ6TNA-1 X-Mimecast-MFC-AGG-ID: khqAlwprO6C4K3_omJ6TNA_1796118333 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4a7c864000eso6745847f8f.0 for ; Tue, 01 Dec 2026 01:45:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796118333; x=1796723133; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=hPjDcckheWf6oYLCmwuNAde7ONIduCgpmZ565q50VFk=; b=MI5Ltc+5zaFqR9AP8brnryrryw3M6YVPMa0gna9WwYArarMVBS8TQnrlbcDYNcMfn2 OrUBXGOGr+xVuSN+xGw5oDO5k3ISfe9IcZqmZtjTlQw+Y2M6RfuZ1Vllvd7/2xNQhNnR ffgFloSUV3XlfAKd+2DyuT9DuLiUkfHVtyvhYWmdh5pxpZEhIg2QxyYC5zg00j+nP1gM 91yFNqMJVnEnn07LqL910HQQsVVliuSqkfblNX3MmTjvKXEBap4QfVjOB9UWWeRiKP7z pE6NTr/6pmpReK0BZIjQCCAFJZXmH8mwpVJk0OCM+PEqLkGGJftEj8BGuEkAqRTzpsjk CsmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796118333; x=1796723133; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hPjDcckheWf6oYLCmwuNAde7ONIduCgpmZ565q50VFk=; b=VHV/zGLYBgUOLaatxYJp5rPHSNquS2bAE4sYT4+4CyrUG6UitbmLsSe0P43GRIOtKh cb0v2SrErEGRaiF82CRRpI7MXaw/a6pOomIkz/fftPDW6d+GTafiL0niArxiT1P0aeBd E63rQPsZx25mtrhNYgDVpYAk1sd5mrw9CsuW2IU4gvOyAaU6Cbs1ZaTWSSfR8nyEb1rG Kqk7pLRPVryS8tG/Z1rC6tsPG0RU6dDcWQErVEdWVv2lceGWrb50fjR5EpjQ5frZHugd Wkn7PkWlauO2uI+GX7UW3KhFiCN7UCjbDtuLOF8smr/3dpuYQ2u0JRSpeS5gOhSUHkTA pRJA== X-Forwarded-Encrypted: i=1; AL+hErGVd3zvsb1Hd4gYAtyeKgNVlDqWGoow07NebIhQfMoC54CSkyT+5KgwmNzcCLVgi7V8zsbNctM=@vger.kernel.org X-Gm-Message-State: APuU4Z+5I02rV+sEPCnOfkTj1i2SKn6M9Zm14iL1+HmUGQBBa6YAV60i zamiEwzF3Czh5hpUUUt+sJLJfKGuHz2poUF9w8Glg+6Jugi3asggULpVVy4UqZmQ+DBA+lVY1b5 re0TY82HAqvyFFCJtRLzYqWq9yM616/lGHbnsEBbo+umcMAh1pW7yg22w8g== X-Gm-Gg: AZFdTZfkT/wcyZpQaHwp0Fs+q8IMc26NRl4pwYtLxtsVMXpRS3g8RoJFoCRIKRp77uq 6/eZcPmEfemHGTV6DLyEJgOj2WP/pxffbkkCHVX/dl7YQIrS9sLx7WawNaioEA7B6J/UueqvQ2y VyhU7w452UHKqs9G+5QxjFbtXEHuJzAGVbqXu4UQG7FrPO4xdhPDqEI1j599bb2Me86N8ClDTiQ t3gyUoYsNu0W95+hRmvkEHLbB55n1QWHkoR4ISRg2MHcWjZuE+DD7bEsJKRXvV2MWw/P7z61lrk jPCih3DGVskuhWi4TN0UTXuT4aMc3+6GwDGTXJyniF5OAGumWfFBdYcjO/VBcI+GNliiLhje14A 3h0HlyWoaBKAi5z9kLyFCSNi0yRq9jNBkGy95NhihXT9E0Vj0vKQQ+ME23lGQ/TX3FV90H6rWZ7 Gtd++OrSXeHE/HhDHUuGPeiuEG3yELAa7SCQ9xjLDK25/nnuJfi9NM4Ah/OLGTbrL0qGE/AJJsn tFX2GaIolvX X-Received: by 2002:a05:600d:4:b0:4bb:abe2:bbd4 with SMTP id 5b1f17b1804b1-4bbabe2bcfdmr317210605e9.19.1796118333534; Tue, 01 Dec 2026 01:45:33 -0800 (PST) X-Received: by 2002:a05:600d:4:b0:4bb:abe2:bbd4 with SMTP id 5b1f17b1804b1-4bbabe2bcfdmr317210295e9.19.1796118333097; Tue, 01 Dec 2026 01:45:33 -0800 (PST) Received: from ?IPv6:2001:16b8:2dff:3100:57ca:6543:aa03:6b50? (200116b82dff310057ca6543aa036b50.dip.versatel-1u1.de. [2001:16b8:2dff:3100:57ca:6543:aa03:6b50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6bb989b3sm69898756f8f.51.2026.12.01.01.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 01:45:32 -0800 (PST) Message-ID: <97494bf10c949bc3a6845f79aef02ca52afe945f.camel@redhat.com> Subject: Re: [PATCH net] net: wwan: t7xx: Do not call pcim_enable_device() on every reinit From: "pstanner@redhat.com" To: Bjorn Helgaas , 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 , Krzysztof =?UTF-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , netdev@vger.kernel.org Date: Tue, 01 Dec 2026 10:45:31 +0100 In-Reply-To: <20261201000233.GA399004@bhelgaas> References: <20261201000233.GA399004@bhelgaas> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) 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 On Mon, 2026-11-30 at 18:02 -0600, Bjorn Helgaas wrote: > 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. > >=20 > > The device is enabled once in t7xx_pci_probe() and the driver never > > disables it, so drop the call from the reinit path. >=20 > 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.=C2=A0 It seems a bit subtle and like something > driver authors are likely to trip over. I don't think that the APIs behavior should be guarded with more checks (like "already enabled" checks). In the past, first the managed API was added, and then (for unknown reasons) counter APIs were added to revoke the managed actions. Look at pcim_pin_device(). IMO that makes the API more convoluted, inconsistent and even harder to understand. But it's true that drivers often don't seem to understand what a managed interface is, proven by the fact that many of them also called pcim_disable_device() in their remove(), which leads the entire design ad absurdum. I think what we can is to document more explicitly what functions you could use when and for what purpose. Especially, we should deprecate pcim_disable_device(), pcim_iounmap() et al. I can send a patch for that. P.