[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 01/17] pci: msi: pass pdev to pci_enable_msi() function
- To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 30 Oct 2023 16:55:26 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SXBZ0yuj37WjjDEcWh7Qb4ZpzwNyuWKUHgvB2OrnO3U=; b=hN12UNelVQzE2cYudsEo30+oGjV4uRa9RXwJCLOPyQufMcKpoO9g7F4vYwewRcKFcgKEE33m+g9Lvr+vYrpGX3HaPPR9r+EPds5y+OfwB6tz4X/iiLKEnnKCK/gheBn2Inowt+TQzpriIaFstlCOq1DY05zxbPLFSjMorOKAmGWSriL1guu+2zsfYsEymYDknpmCt5iNLHvGZKoAEtDp8/IyGoYAyPuqFBGEmuAe0qX059jlQl31DCxnPqr3WJnC5rNTCIP7SWQqqrwXiKzpXMWPplQkUM7i8NpddQay040H159brRFFIO9NamfbZM9wa4raEjBkOLo49rd7UnHIdA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S/VWhyNTx7nkzzdLsGoivGsD4Ilyk11c9sCbWxarHY+worU0yyzzja8LcTZcmUBOUyncgI3BxvjHSOpJhLVsO7VAy7B1K4+bvh98BO0gLUAIwV5TtIzw9A9kb4PVi/ejWNCt8vjQSCKhLsJIVJiSCnCwRHfMCO7/TOtpnYCvIlggMLDmEqk40pce1oh9EiZhzLEMpwRu0TuHdqFLxzoR64Xu+yPr2Z5n7R9lan7ASf3Cv6alxCRpENG3XHOXbZ6oBe8QmmY7r1MGdx5vQm7VwTNVBbEQ75xtSrk/ivQniSJj73Fcpq+7V1M4TFWaOVsQ5PkrLE2uHN8Izh/lD2H82w==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 30 Oct 2023 15:55:41 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 13.10.2023 00:09, Volodymyr Babchuk wrote:
> Previously pci_enable_msi() function obtained pdev pointer by itself,
> but taking into account upcoming changes to PCI locking, it is better
> when caller passes already acquired pdev pointer to the function.
For the patch to be understandable on its own, the "is better" wants
explaining here.
> Note that ns16550 driver does not check validity of obtained pdev
> pointer because pci_enable_msi() already does this.
I'm not convinced of this model. I'd rather see the caller do the
check, and the callee - optionally - have a respective assertion.
> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -983,13 +983,13 @@ static int msix_capability_init(struct pci_dev *dev,
> * irq or non-zero for otherwise.
> **/
>
> -static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc)
> +static int __pci_enable_msi(struct msi_info *msi, struct msi_desc **desc,
> + struct pci_dev *pdev)
In line with msi_capability_init() and ...
> @@ -1038,13 +1038,13 @@ static void __pci_disable_msi(struct msi_desc *entry)
> * of irqs available. Driver should use the returned value to re-send
> * its request.
> **/
> -static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc)
> +static int __pci_enable_msix(struct msi_info *msi, struct msi_desc **desc,
> + struct pci_dev *pdev)
... msix_capability_init(), may I ask that the new parameter then
become the first one, not the last (and hence even past output
parameters)?
Jan
|