From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 270A81D14E2 for ; Mon, 21 Oct 2024 06:47:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729493277; cv=none; b=qKmxjsewObUAUssSuBlvOb7rwg3Z74uf0cBD0Y7E1Eaa72etL7Q84P93lGs8JiUknYjuUmaipl5eCu/WGaYlcvgL/zYKXp5L1v0bzBUTu7jTHfrhpEetZ8MBJIVMHROPsX/v6CE+r86S4+VCdK/DcNpoJ32kFQcldgJlf1I/Fts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729493277; c=relaxed/simple; bh=teyMIfpNNQjSsb5MbXyVqzP1VIlH5kdTfogRdrP4p8U=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=X6P+QYHeUQL0vS2YcVsvbYL79H0PbLueski8yWVjSySOY7rzi9mHi2bFoQ2RvvyFDC7/nVeLdSR0MH0q3vh8J8o+IlAFpVINjpIo/5qZvxwyIP0Lc/qL72yxJQMSVMR1aorOfS73t01bTOL+3ma2mJHwVc0SufCjZlKRm/NNDcY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H6yyz7ZQ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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) header.d=redhat.com header.i=@redhat.com header.b="H6yyz7ZQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729493274; 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=teyMIfpNNQjSsb5MbXyVqzP1VIlH5kdTfogRdrP4p8U=; b=H6yyz7ZQHfOJWxDQybm0UBGe0/oNi9DhJrT6zT7tpjtTexTcwOt0JzQY8Amy4NLVvnVbjA Xi2DatgmBicfvR3VXskiKwJhoV3hy3sOnt5UHDm3IIVCiL+6grEtWOk5WBE54nubgIXcXi QBWW19Wvy8uPGrR8ZoWXTz7SD4722Ao= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-fpJwFZRmM_mrvL4-gOrEqQ-1; Mon, 21 Oct 2024 02:47:50 -0400 X-MC-Unique: fpJwFZRmM_mrvL4-gOrEqQ-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4316300bb15so20468185e9.2 for ; Sun, 20 Oct 2024 23:47:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729493269; x=1730098069; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=teyMIfpNNQjSsb5MbXyVqzP1VIlH5kdTfogRdrP4p8U=; b=fyiGu9e23E11dPXOb/pRz2Lg4UM6JAg25yGe0KCCtxVjpQ+TeK4Szh2b38g7YClmAL wN95hwxvRSnMGGNs+7/gjrQJOCORZ4K/T85CTA9L3D224joTnKc04K2uPplIoQ6jFhcv dgMo0SWxRCyWyRqxpXDQdWD+xNs0V+HJIu8fezbTFiM6Sut0FIB/hrQ3+AMZw6r4bvFo JYh4M810tABwSlbJHfskIwH5PId4+d6tJpQNpAQmrMtTJhBbX0brzKJ4+NZs1BNt7JI2 Wxah8ubEi6/6ZZSl4+wl5KH0CE1FFvJmh9hzO0TlX2tr7CFtiiWLoW5hzJw+0UJrsHec kY8w== X-Forwarded-Encrypted: i=1; AJvYcCVATasFZZMTe5UjeWYxgmijAo+BolP2QeCQT4hulOUsh1Zy5JQGMRkDje6WI2KePCHUMelK4FVnO6TANw==@vger.kernel.org X-Gm-Message-State: AOJu0YwnnLXq8KykoymyMatw7AfuaIDRveLx0YmfTAIkCSl4yiWrQa5T HK5lBOPRfNTiDDKOJ3NyD1IIhGF4cFEjE0oslX/OBm1uHlI31IhY6XzlTk3p7+CY8oy7F5+TutW x3ObYpxcLVKzVOlajwuzCI13Xm4Y6O8ltpVPtDcHadb0WyPHmOzp4UMNApPEo X-Received: by 2002:a05:600c:3591:b0:431:4c14:abf4 with SMTP id 5b1f17b1804b1-4316163a1b2mr84025785e9.14.1729493269433; Sun, 20 Oct 2024 23:47:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVZgn1S+/IbVUHVqZogTbkz5rvgpgAowACslYYkYZ99T9pAyCEi5NExPZQP+nHcWcbmjh9Bw== X-Received: by 2002:a05:600c:3591:b0:431:4c14:abf4 with SMTP id 5b1f17b1804b1-4316163a1b2mr84025225e9.14.1729493268971; Sun, 20 Oct 2024 23:47:48 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d449800aee93296d73e68da.dip.versatel-1u1.de. [2001:16b8:2d44:9800:aee9:3296:d73e:68da]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4316f570f89sm45821675e9.7.2024.10.20.23.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2024 23:47:48 -0700 (PDT) Message-ID: <1f90d885f0e8dc2e8d9b2b7e88700b4cdb19d84c.camel@redhat.com> Subject: Re: [PATCH 13/13] PCI: Deprecate pci_intx(), pcim_intx() From: Philipp Stanner To: Bjorn Helgaas Cc: Heiner Kallweit , Alex Williamson , Damien Le Moal , Niklas Cassel , Sergey Shtylyov , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Jaroslav Kysela , Takashi Iwai , Chen Ni , Mario Limonciello , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , Ilpo =?ISO-8859-1?Q?J=E4rvinen?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , Marek =?ISO-8859-1?Q?Marczykowski-G=F3recki?= , Pierre-Louis Bossart , Peter Ujfalusi , Maarten Lankhorst , Kai Vehmanen , Rui Salvaterra , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, linux-sound@vger.kernel.org Date: Mon, 21 Oct 2024 08:47:46 +0200 In-Reply-To: <20241018234537.GA770692@bhelgaas> References: <20241018234537.GA770692@bhelgaas> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2024-10-18 at 18:45 -0500, Bjorn Helgaas wrote: > On Wed, Oct 16, 2024 at 10:53:16AM +0200, Philipp Stanner wrote: > > On Wed, 2024-10-16 at 10:43 +0200, Heiner Kallweit wrote: > > > On 16.10.2024 08:57, Philipp Stanner wrote: > > > > On Tue, 2024-10-15 at 13:53 -0600, Alex Williamson wrote: > > > > > On Tue, 15 Oct 2024 20:51:23 +0200 > > > > > Philipp Stanner wrote: > > > > >=20 > > > > > > pci_intx() and its managed counterpart pcim_intx() only > > > > > > exist > > > > > > for > > > > > > older > > > > > > drivers which have not been ported yet for various reasons. > > > > > > Future > > > > > > drivers should preferably use pci_alloc_irq_vectors(). > > > > > >=20 > > > > > > Mark pci_intx() and pcim_intx() as deprecated and encourage > > > > > > usage > > > > > > of > > > > > > pci_alloc_irq_vectors() in its place. > > > > >=20 > > > > > I don't really understand this.=C2=A0 As we've discussed > > > > > previously > > > > > pci_alloc_irq_vectors() is, unsurprisingly, for allocating > > > > > PCI > > > > > IRQ > > > > > vectors while pci_intx() is for manipulating the INTx disable > > > > > bit > > > > > on > > > > > PCI devices.=C2=A0 The latter is a generic mechanism for > > > > > preventing > > > > > PCI > > > > > devices from generating INTx, regardless of whether there's a > > > > > vector > > > > > allocated for it.=C2=A0 How does the former replace the latter an= d > > > > > why > > > > > do > > > > > we > > > > > feel the need to deprecate the latter? > > > > >=20 > > > > > It feels like this fits some narrow narrative and makes all > > > > > users > > > > > of > > > > > these now deprecated functions second class citizens.=C2=A0 Why?= =C2=A0 > > > > > At > > > > > it's > > > > > root these are simply providing mask and set or mask and > > > > > clear > > > > > register > > > > > bit operations.=C2=A0 Thanks, > > > >=20 > > > > I got the feeling from the RFC discussion that that was > > > > basically > > > > the > > > > consensus: people should use pci_alloc_irq_vectors(). Or did I > > > > misunderstand Andy and Heiner? > > > >=20 > > > I think there are two different use cases for pci_intx(). > > > At first there are several drivers where the direct usage of > > > pci_intx() > > > can be eliminated by switching to the pci_alloc_irq_vectors() > > > API. > > >=20 > > > And then there's usage of pci_intx() in > > > drivers/vfio/pci/vfio_pci_intrs.c > > > drivers/xen/xen-pciback/conf_space_header.c > > > There we have to keep the (AFAICS unmanaged) pci_intx() calls. > >=20 > > There is also the usage within PCI itself, in MSI. Patch =E2=84=968 tou= ches > > that. > >=20 > > It's why I think this series should land before anyone should port > > direct pci_intx() users to the irq vectors function, because the > > latter > > also uses pci_intx() and its own devres, which sounds explosive to > > me. > >=20 > > > > I'm perfectly happy with dropping this patch and continue > > > > offering > > > > pci{m}_intx() to users, since after removing that hybrid > > > > hazzard I > > > > don't see any harm in them anymore. >=20 > So is the bottom line that we should drop *this* patch and apply the > rest of the series? Yes Sir, that's the idea Regards, P. >=20 > > > > > > Signed-off-by: Philipp Stanner > > > > > > --- > > > > > > =C2=A0drivers/pci/devres.c | 5 ++++- > > > > > > =C2=A0drivers/pci/pci.c=C2=A0=C2=A0=C2=A0 | 5 ++++- > > > > > > =C2=A02 files changed, 8 insertions(+), 2 deletions(-) > > > > > >=20 > > > > > > diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c > > > > > > index 6f8f712fe34e..4c76fc063104 100644 > > > > > > --- a/drivers/pci/devres.c > > > > > > +++ b/drivers/pci/devres.c > > > > > > @@ -435,7 +435,7 @@ static struct pcim_intx_devres > > > > > > *get_or_create_intx_devres(struct device *dev) > > > > > > =C2=A0} > > > > > > =C2=A0 > > > > > > =C2=A0/** > > > > > > - * pcim_intx - managed pci_intx() > > > > > > + * pcim_intx - managed pci_intx() (DEPRECATED) > > > > > > =C2=A0 * @pdev: the PCI device to operate on > > > > > > =C2=A0 * @enable: boolean: whether to enable or disable PCI INT= x > > > > > > =C2=A0 * > > > > > > @@ -443,6 +443,9 @@ static struct pcim_intx_devres > > > > > > *get_or_create_intx_devres(struct device *dev) > > > > > > =C2=A0 * > > > > > > =C2=A0 * Enable/disable PCI INTx for device @pdev. > > > > > > =C2=A0 * Restore the original state on driver detach. > > > > > > + * > > > > > > + * This function is DEPRECATED. Do not use it in new code. > > > > > > + * Use pci_alloc_irq_vectors() instead (there is no > > > > > > managed > > > > > > version, currently). > > > > > > =C2=A0 */ > > > > > > =C2=A0int pcim_intx(struct pci_dev *pdev, int enable) > > > > > > =C2=A0{ > > > > > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > > > > > > index 7ce1d0e3a1d5..dc69e23b8982 100644 > > > > > > --- a/drivers/pci/pci.c > > > > > > +++ b/drivers/pci/pci.c > > > > > > @@ -4477,11 +4477,14 @@ void pci_disable_parity(struct > > > > > > pci_dev > > > > > > *dev) > > > > > > =C2=A0} > > > > > > =C2=A0 > > > > > > =C2=A0/** > > > > > > - * pci_intx - enables/disables PCI INTx for device dev > > > > > > + * pci_intx - enables/disables PCI INTx for device dev > > > > > > (DEPRECATED) > > > > > > =C2=A0 * @pdev: the PCI device to operate on > > > > > > =C2=A0 * @enable: boolean: whether to enable or disable PCI INT= x > > > > > > =C2=A0 * > > > > > > =C2=A0 * Enables/disables PCI INTx for device @pdev > > > > > > + * > > > > > > + * This function is DEPRECATED. Do not use it in new code. > > > > > > + * Use pci_alloc_irq_vectors() instead. > > > > > > =C2=A0 */ > > > > > > =C2=A0void pci_intx(struct pci_dev *pdev, int enable) > > > > > > =C2=A0{ > > > > >=20 > > > >=20 > > > >=20 > > >=20 > >=20 >=20