[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240424201253.GA499493@bhelgaas>
Date: Wed, 24 Apr 2024 15:12:53 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Philipp Stanner <pstanner@...hat.com>
Cc: Hans de Goede <hdegoede@...hat.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Sam Ravnborg <sam@...nborg.org>, dakr@...hat.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: Re: [PATCH v6 03/10] PCI: Warn users about complicated devres nature
On Mon, Apr 08, 2024 at 10:44:15AM +0200, Philipp Stanner wrote:
> The PCI region-request functions become managed functions when
> pcim_enable_device() has been called previously instead of
> pci_enable_device().
>
> This has already caused bugs by confusing users, who came to believe
> that all pci functions, such as pci_iomap_range(), suddenly are managed
> that way.
Since you mention a bug, it'd be nice to include a URL or commit if
you have one.
> This is not the case.
>
> Add comments to the relevant functions' docstrings that warn users about
> this behavior.
> @@ -3914,6 +3916,13 @@ EXPORT_SYMBOL(pci_release_region);
> *
> * Returns 0 on success, or %EBUSY on error. A warning
> * message is also printed on failure.
> + *
> + * NOTE:
> + * This is a "hybrid" function: Its normally unmanaged, but becomes managed
> + * when pcim_enable_device() has been called in advance.
> + * This hybrid feature is DEPRECATED! If you need to implement a new pci
> + * function that does automatic cleanup, write a new pcim_* function that uses
> + * devres directly.
This note makes sense on exported functions, but I think it's overkill
on static ones like this.
s/Its normally/It's normally/
s/new pci/new PCI/
Rewrap into one paragraph (or separate by blank line).
Applies to all the hunks of this patch.
> static int __pci_request_region(struct pci_dev *pdev, int bar,
> const char *res_name, int exclusive)
Powered by blists - more mailing lists