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 62EA7198E81 for ; Wed, 16 Oct 2024 06:58:10 +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=1729061893; cv=none; b=s66240ZbvS14GzqS8Exk9ng2C00rOc/ehce6yKh7XEk/epyPZF7yEWdEeVksmuyXiTrHUsVUBGl8pp1LFi7XxeaT7NTaJspVIqdkgyy5HndVq7pF0ZQuEYbWM/sbr0D5gc8pFc1MCBAgBUd1ckeE7q5MNX7yavCFBuITK/TNZDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729061893; c=relaxed/simple; bh=nKJfP3LmeT/Qx7oKj5HM871IgPtYRSHVMsPL1c0DDh4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=sCpQpyMuZns9g7ljbx4eYXcHqrekZkSwQ60o5AlyRPwjQqMZfdtEEoaLnIoBoD5NYwWYLdXBSRfY7QkX0RpK1/l6Yb4b/+W6kodM3WpLtOi+pDJPFnGhalrAG9YfHtNm897n6DONPbHfuFR9J2CNl+ZD3ceEm8h6BbTbq553q0I= 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=faAgi0n+; 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="faAgi0n+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729061889; 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=nKJfP3LmeT/Qx7oKj5HM871IgPtYRSHVMsPL1c0DDh4=; b=faAgi0n+nbWHYJ4pDmHKIOAXnzZ19LFScJO289nhqxn51rHmnBrwc5qTlpbmCAiin+iS5E eFQ2EeUBmDSaB5ATUx2+ha6H060UW6foeQ9yzW05yiP0Ae1JLq7a4ifOEAdMkXN/CRRhj+ q/4Ss0Ui80qpErz8YtHn3X3bqq1PsOg= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-290-lro-RK3CP2qcB8E4_j5qVg-1; Wed, 16 Oct 2024 02:58:08 -0400 X-MC-Unique: lro-RK3CP2qcB8E4_j5qVg-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7b111381632so1218010785a.3 for ; Tue, 15 Oct 2024 23:58:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729061887; x=1729666687; 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=nKJfP3LmeT/Qx7oKj5HM871IgPtYRSHVMsPL1c0DDh4=; b=f+ovXCuCPkB1RrDlGIfW9gVDu1lzJGBeZ02n0J24McTgxyshMEaZL5S+02VeD3SF5W lp1NXBF1+FvPwD4QBT6uszJ5g3R4sAUw/PaY38GaysH3YZ3g4T9gOsVcIDG5iEEZ1CfE WGrZ87tVEbjXZFK/Tk5qMK4Bs3+g3zUrNMzuEr+V9QiNmbCNyvpd/qq8+2ZHWBVkp38o k8G+x83JPspqAr6HSR2ocJuehit4grRglU3I8dHdtNlcrq71G2aurrc3+3lZrluimhsw SIKMcnv9hd6LkCfJ0CBd9a/MWV1joU9jyH7e8tGkBZnIVdLcZFWjDb6yKJEDV9ymkNxt UABg== X-Forwarded-Encrypted: i=1; AJvYcCWf8LbZuQ6rJmGoFy+v6gK2r/n1i102psBJPsbO4c3x1mpXQf+XAvYARF4jZmBmp0epoYb2Qgxyuawarg==@vger.kernel.org X-Gm-Message-State: AOJu0Yy4zXlLiH5OS+j3dTItGq5tTT1DqzFzGyPutNVekdB8dZnSGrGT dCkFMF/nmHWW3rnrSbY2zzgDPjaTh48rRN94wWw91L/p2yyBnx6B70GMhu0HcJRm1vhuKZQou9+ bBZkb2FkFl2+9ItNc6ELLErQ67mQ9wNxekHzZdFDTVOp/8lCEDM31jhG7ksCz X-Received: by 2002:a05:620a:400d:b0:7a1:62ad:9d89 with SMTP id af79cd13be357-7b14186f1c8mr461446385a.64.1729061887553; Tue, 15 Oct 2024 23:58:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcw8kz1/9R04Vwhhq2lqNVDk3gX6xFnXYOAV6a2cL/WNRAli0C59zaADhpNPO2+u1Q91URSw== X-Received: by 2002:a05:620a:400d:b0:7a1:62ad:9d89 with SMTP id af79cd13be357-7b14186f1c8mr461441885a.64.1729061887092; Tue, 15 Oct 2024 23:58:07 -0700 (PDT) Received: from dhcp-64-113.muc.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b136164dfbsm149785985a.21.2024.10.15.23.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 23:58:06 -0700 (PDT) Message-ID: Subject: Re: [PATCH 13/13] PCI: Deprecate pci_intx(), pcim_intx() From: Philipp Stanner To: Alex Williamson Cc: 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: Wed, 16 Oct 2024 08:57:58 +0200 In-Reply-To: <20241015135336.0de9795e.alex.williamson@redhat.com> References: <20241015185124.64726-1-pstanner@redhat.com> <20241015185124.64726-14-pstanner@redhat.com> <20241015135336.0de9795e.alex.williamson@redhat.com> 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 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 and 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, 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? 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. P. >=20 > Alex > =C2=A0 > > 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 INTx > > =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 INTx > > =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