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 917CD1DD0E2 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=1729022024; cv=none; b=hi9g5aQra6h4ldhbEh5D0YzzclSNvyVI01aZmC6QFENbTeMbhCp4spGO5tntQ/BRLEoasFUfFAF3JHcfip9AulR1esQICJbELmcDfTH0/lmh2rrCDR8Uz41m6YrciSVwT4vulG+9mjSM0p/3+ImvQZeAk4ijyB1m2W5eHN+MMy8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729022024; c=relaxed/simple; bh=EyK44VVSzqK0VVd6JZRUhzDLFA8N/4UuvEHVd2mlOVk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tngu/84NFC+WExVktb5OY2zVlx4H0IvE+mnsJ/dPhpxZUo7Ay4A9u6aO97EnljHvQCwuxNmeq6oG9f0YbLmDwySo0OaXqT4A7oDOAKhgq6EWr/+0TdvCOI+I4s7mL7Vq6WSuJNMR49k0BVAYZfRnw77kPo5+AJkVPETD96feZ18= 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--kP_wmGMNZmOUVMqT_lCig-1; Tue, 15 Oct 2024 15:53:40 -0400 X-MC-Unique: -kP_wmGMNZmOUVMqT_lCig-1 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-83547df1194so65414439f.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=EDKXr8sYQAC/Jf3qil9JWHy3TqOaKWKmXHkmOe9WT5XIH2H04S7rBut/Ic2Q3L6W+l c4UEgBvd+zGhRqI5nbufs7a8FEC89gr2kUI4UPpjU0bvJc9K9wb9eHajD4uWje1YP9qB pLN0NWHO9oHW/FS/ItSskX4H1++lMQMfFRNOoq1J2zYWoTM80DbF0YUUuGj7Q4hGYJNH X72z9hnmgL/eQOJn/7BGlUZC8HurJkWLe/JShPUWf+8otwMKR8FlrDJh4G7I2SNNopZK lQRRbzCLY7f6c9XPrIoQrhrcHJ5+SNsDoZPcnWXHW5ovqhrLAEimBAIsE5q8IGxJGmqL j7mg== X-Forwarded-Encrypted: i=1; AJvYcCWpxbUncB7R6rim4bZKvG2JwJwfDaT49jEUuH8C2t9q0N6EWyADCLiUbvqqq3ekglNoqDKKqWqkhvdXd/E=@vger.kernel.org X-Gm-Message-State: AOJu0Yxh9v4zqXf4IAaK/VfJxTmdUEEqZIRbHssqc/bhJTtnMobTdTA6 QOs4ufB2hc0/8qAV1lnOA3Jj1t2E8AK3qI0ZTLxQ68lKxSWxR4fPiI6w6VhF2og99lLqpv8J5PC bSm3cd1q1x2s6iMvtkaWKBr3LPRF5bnnr961VR9t3m2kM88e5/F0PF+Gt1GJW0A== X-Received: by 2002:a05:6e02:20e6:b0:3a2:57d2:3489 with SMTP id e9e14a558f8ab-3a3de12de3emr696535ab.3.1729022019810; 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-kernel@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) > {