From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 062852BD58A; Tue, 24 Feb 2026 09:12:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771924358; cv=none; b=Da1BbYqToPVGJ6oYRmQU3VJeycTgPPT9MrRU9Hn/m0Sk2kkzFhrK4uvKYr6Q+UsEMjvVHuYvK+KGgxSWqGgBA653iOFBF/uLy4X8XNbGlKL2Wv1Q35jHi//DVENfQiwAduYeFjA2kq1PhJral3Bh/b2ouDfRqnI21aqjYHlvY4M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771924358; c=relaxed/simple; bh=sllJU41EvNnfq6cfH0Cm3WpH9/CrTwdLF2yCyQc6C20=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E/gAMpgHSZ1SRP7q4jSbxH6lKlJB0RkbVOgj2Ou31ACwVTXselEnNkatNS1c7f0mLJigu1lzQrCqdYVii9Ul292BC+YJHzV1Oj1PyQBwaa3v/0QKk9qQDF9FNohkXy3pDeIhilETSKGPTrbqLFXvohvzHrDQDQabwYX7h+iyuwM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AbGlTJ0Y; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AbGlTJ0Y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771924357; x=1803460357; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sllJU41EvNnfq6cfH0Cm3WpH9/CrTwdLF2yCyQc6C20=; b=AbGlTJ0YkokTsxQHaqiXwXrINmz91wb1ZioaSAF+CsR+O56xETJkqY5S 8RdcSWqpL/MIaJAwKcVfwiX6frQgP6fjGdYpiL3PSETbSWDksFYjApTdQ IuaSY1vp1e2RlL10rItHevyWNK7rf8mNnjALd+jy211Jc9xdEreTZ32yv FBijpVAAGR3yg5b+TV7b7gPC7qUjtwVehNpqTc58PQPMfj5gqhXtEg+xK gZoH6SwtfJeO86zDyORjTJxLMsaeBBs40t/GNKo6JHFyTpuZPbpbrYpnc Bl9a+Ogeax8CUXgHTMri8ECjaQ3Nc7KDR/Il3Fju0vuAsXM14vxaySz47 A==; X-CSE-ConnectionGUID: 1nHSjMqyQwuBAY0+m+QfCQ== X-CSE-MsgGUID: sq0LcavZRq+p34ZMSVo+Rw== X-IronPort-AV: E=McAfee;i="6800,10657,11710"; a="73039913" X-IronPort-AV: E=Sophos;i="6.21,308,1763452800"; d="scan'208";a="73039913" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2026 01:12:35 -0800 X-CSE-ConnectionGUID: v4GiDQV6T1ycBQRHOBv6QA== X-CSE-MsgGUID: yR3Uba70Qr6uzGgc8QUkgw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,308,1763452800"; d="scan'208";a="219937945" Received: from egrumbac-mobl6.ger.corp.intel.com (HELO localhost) ([10.245.244.146]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2026 01:12:17 -0800 Date: Tue, 24 Feb 2026 11:12:15 +0200 From: Andy Shevchenko To: phasta@kernel.org Cc: Simon Richter , Shawn Lin , Bjorn Helgaas , "Vaibhaav Ram T . L" , Kumaravel Thiagarajan , Even Xu , Xinpeng Sun , Srinivas Pandruvada , Jiri Kosina , Alexandre Belloni , Zhou Wang , Longfang Liu , Vinod Koul , Lee Jones , Jijie Shao , Jian Shen , Sunil Goutham , Andrew Lunn , Heiner Kallweit , "David S . Miller" , Jeff Hugo , Oded Gabbay , Maciej Falkowski , Karol Wachowski , Min Ma , Lizhi Hou , Andreas Noever , Mika Westerberg , Tomasz Jeznach , Will Deacon , Xinliang Liu , Tian Tao , Davidlohr Bueso , Jonathan Cameron , Srujana Challa , Bharat Bhushan , Antoine Tenart , Herbert Xu , Raag Jadav , Hans de Goede , Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , Manivannan Sadhasivam , Mika Westerberg , Andi Shyti , Robert Richter , Mark Brown , Nirmal Patel , Kurt Schwemmer , Logan Gunthorpe , Linus Walleij , Bartosz Golaszewski , Sakari Ailus , Bingbu Cao , Ulf Hansson , Arnd Bergmann , Benjamin Tissoires , linux-input@vger.kernel.org, linux-i3c@lists.infradead.org, dmaengine@vger.kernel.org, netdev@vger.kernel.org, nic_swsd@realtek.com, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org, iommu@lists.linux.dev, linux-riscv@lists.infradead.org, David Airlie , Simona Vetter , linux-cxl@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-serial@vger.kernel.org, mhi@lists.linux.dev, Jan Dabros , linux-i2c@vger.kernel.org, Daniel Mack , Haojian Zhuang , linux-spi@vger.kernel.org, Jonathan Derrick , linux-pci@vger.kernel.org, linux-gpio@vger.kernel.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-mmc@vger.kernel.org Subject: Re: [PATCH 0/37] PCI/MSI: Enforce explicit IRQ vector management by removing devres auto-free Message-ID: References: <1771860581-82092-1-git-send-email-shawn.lin@rock-chips.com> <6223f3cb-693f-42e7-9147-30f659f08563@hogyros.de> <7ca512d133f7a3bcfe00e9b0b2af5fe5f147ad77.camel@mailbox.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ca512d133f7a3bcfe00e9b0b2af5fe5f147ad77.camel@mailbox.org> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Tue, Feb 24, 2026 at 08:39:43AM +0100, Philipp Stanner wrote: > On Tue, 2026-02-24 at 13:14 +0900, Simon Richter wrote: > > On 2/24/26 12:29 AM, Shawn Lin wrote: > > > When such a driver also uses `pcim_enable_device()`, the devres framework may > > > attempt to free the IRQ vectors a second time upon device release, leading to > > > a double-free. Analysis of the tree shows this hazardous pattern exists widely, > > > while 35 other drivers correctly rely solely on the implicit cleanup. > > > > Would it make sense to have a function pcim_free_irq_vectors(), to allow > > explicit freeing even if the device is otherwise managed, analogous to > > pcim_iounmap()? > > We used to add those. In part because it is easier to port old users. > > Nowadays I tend to think that those APIs were more on the too-complex > than too-simple side for a long time. As an expert or as the API > designer you wouldn't expect it, but there are actually far too many > users who came to believe they always have to use pcim_iounmap() and > counter parts. > > If I could design it from scratch I would probably try to tell users to > use the unmanaged versions instead of revoking the devres consequence. +many. > Devres is actually about your consequence always happening whenever the > driver unloads, for whatever reason. I believe you meant "unbinds". The device<-->driver link can be broken without unloading the driver. -- With Best Regards, Andy Shevchenko