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.129.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 7D5AD1B6D12 for ; Tue, 15 Oct 2024 19:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729022025; cv=none; b=mCCXd3Zw8/Vd6064nsiicbuWx/80vWGapOenQRci0sJbT1RmOBkQlbZ6UwdiSD3KY/ASXBLl9W09O0cAON8KKSCumLbpJbOSaC47mXtEJA0okYR6dYx++O8LI6mUEQi+R5uyJ5JgAOSOtDBLQOKTb4Hi0WjTVs1RknIh/sytxQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729022025; c=relaxed/simple; bh=EyK44VVSzqK0VVd6JZRUhzDLFA8N/4UuvEHVd2mlOVk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=coXbbyRn4uQ9wqMPLIINQs9TYgLhSxWKhrBQn5qkF2jlHHfTIhTksxI5tXn/sOZaQRGanrIAXFDvkj9xpW8Xt5OBe7BpXQ0uoMvfuF4tj/hjpUt/LvCYULAXNiH4npfBwqpMk6xJ2YtL5KP6e61atD22AhED95zdAmBVuJNA6K4= 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=GW5kbgnr; arc=none smtp.client-ip=170.10.129.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="GW5kbgnr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729022021; 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=iDdlfoCJodlBAEHv18hly2baxUxV3CY1ROqq62ZwNfA=; b=GW5kbgnroZdypZ0pri7f9IK/W/kIDeKtNVySbDcPp6EDis7zRB6U7TwcovpS1hjJHSBhx4 DrRJuB3jWOEnhigNPJMq+ISDVH/+4Ys/o3vwInG9p3jQQU0hoqvCQaGF4DfLZIqpUcJzsR cNTygXR/ZlZ9LJOL56rpiwq9BEpuEqo= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-103-Fw2CJZPYMYq5X4A680tW2w-1; Tue, 15 Oct 2024 15:53:40 -0400 X-MC-Unique: Fw2CJZPYMYq5X4A680tW2w-1 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-83547df1194so65413639f.3 for ; Tue, 15 Oct 2024 12:53:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729022020; x=1729626820; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iDdlfoCJodlBAEHv18hly2baxUxV3CY1ROqq62ZwNfA=; b=Y7xLHKdKJPxlD6Gb/eldiiQ/7eRcEtM+eyFqLIDAkCPEMpQbN7lKUTEIGbfPWbu82g ilSFYlBn4uVDKpX6XbRfM9PIqbwd8lHk5GwYrojD4yQnbA3oWqgAADXCZLEiwesqe3VY Guih0v3iuHnWL3vuGIMqUWeiHWLkl3fC+QDu+aU2Zq6vWLXy295KReUlXAeMdaAcJdbi qAaTwYiIyvQbIDhtiuAJBKYbZuI8Ynkst7mRsKtmlUlyEFpi8IRC3Hmj99QUCFIkdkv0 oRAiFlXZORNjJVc6AeTJD18Is6xuaZthSfay0+2SszLaZEC8tHdRuvESMPrRtDEQW5Z9 6Heg== X-Forwarded-Encrypted: i=1; AJvYcCVn4X4+jPuJX5yTcieiI99yn5MfuIDYGrqRp/XzWnnj3mj0D6v4aMcXYFda6QRWk0bw1oR9cTg63Qk=@vger.kernel.org X-Gm-Message-State: AOJu0YyxdVinZdr8D77HiGkFONF2cRSXIEe6u3tnY7huzLZMerQ8R2uF NOWBWl4VNzPfkXZX6XB5O1EMBjcHEhYGs5oTRxS53TnNPykkDa57EQgnZJjKuLy9xbn5o3/EDsE Idr8K+oQ1b2HI/3AOlo/2emwwIsV4jmhwFBudMq6WTPbPcoHLN3uDx5y+Dw== X-Received: by 2002:a05:6e02:20e6:b0:3a2:57d2:3489 with SMTP id e9e14a558f8ab-3a3de12de3emr696195ab.3.1729022019792; Tue, 15 Oct 2024 12:53:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESXVYWbDvg1wxgtSYFRG8WjdQ6j0NF7QGGfISEgWPkRfl6g2CRlLVPppWhf9Avs6HBI8mwDw== X-Received: by 2002:a05:6e02:20e6:b0:3a2:57d2:3489 with SMTP id e9e14a558f8ab-3a3de12de3emr696075ab.3.1729022019438; Tue, 15 Oct 2024 12:53:39 -0700 (PDT) Received: from redhat.com ([38.15.36.11]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4dbec9b24b5sm462948173.59.2024.10.15.12.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 12:53:39 -0700 (PDT) Date: Tue, 15 Oct 2024 13:53:36 -0600 From: Alex Williamson To: Philipp Stanner 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 =?UTF-8?B?SsOkcnZpbmVu?= , Andy Shevchenko , Mostafa Saleh , Jason Gunthorpe , Yi Liu , Christian Brauner , Ankit Agrawal , Eric Auger , Reinette Chatre , Ye Bin , Marek =?UTF-8?B?TWFyY3p5a293c2tpLUfDs3JlY2tp?= , 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 Subject: Re: [PATCH 13/13] PCI: Deprecate pci_intx(), pcim_intx() Message-ID: <20241015135336.0de9795e.alex.williamson@redhat.com> In-Reply-To: <20241015185124.64726-14-pstanner@redhat.com> References: <20241015185124.64726-1-pstanner@redhat.com> <20241015185124.64726-14-pstanner@redhat.com> Organization: Red Hat Precedence: bulk X-Mailing-List: linux-ide@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 15 Oct 2024 20:51:23 +0200 Philipp Stanner wrote: > 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(). > > Mark pci_intx() and pcim_intx() as deprecated and encourage usage of > pci_alloc_irq_vectors() in its place. I don't really understand this. 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. The latter is a generic mechanism for preventing PCI devices from generating INTx, regardless of whether there's a vector allocated for it. How does the former replace the latter and why do we feel the need to deprecate the latter? It feels like this fits some narrow narrative and makes all users of these now deprecated functions second class citizens. Why? At it's root these are simply providing mask and set or mask and clear register bit operations. Thanks, Alex > Signed-off-by: Philipp Stanner > --- > drivers/pci/devres.c | 5 ++++- > drivers/pci/pci.c | 5 ++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > > 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) > } > > /** > - * pcim_intx - managed pci_intx() > + * pcim_intx - managed pci_intx() (DEPRECATED) > * @pdev: the PCI device to operate on > * @enable: boolean: whether to enable or disable PCI INTx > * > @@ -443,6 +443,9 @@ static struct pcim_intx_devres *get_or_create_intx_devres(struct device *dev) > * > * Enable/disable PCI INTx for device @pdev. > * 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). > */ > int pcim_intx(struct pci_dev *pdev, int enable) > { > 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) > } > > /** > - * pci_intx - enables/disables PCI INTx for device dev > + * pci_intx - enables/disables PCI INTx for device dev (DEPRECATED) > * @pdev: the PCI device to operate on > * @enable: boolean: whether to enable or disable PCI INTx > * > * Enables/disables PCI INTx for device @pdev > + * > + * This function is DEPRECATED. Do not use it in new code. > + * Use pci_alloc_irq_vectors() instead. > */ > void pci_intx(struct pci_dev *pdev, int enable) > {