Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 4 ++--
1 file
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
kernel/watch_queue.c | 2 +-
1 file changed, 1 insertion(+), 1
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/drm_lease.c | 4 ++--
1 file changed, 2
merged.
P.
Philipp Stanner (5):
string.h: add array-wrappers for (v)memdup_user()
kernel: kexec: copy user-array safely
kernel: watch_queue: copy user-array safely
drm_lease.c: copy user-array safely
drm: vmgfx_surface.c: copy user-array safely
drivers/gpu/drm/drm_lease.c
() and vmemdup_user() to
provide a standardized and safe way for duplicating user arrays.
This is both for new code as well as replacing usage of (v)memdup_user()
in existing code that uses, e.g., n * size to calculate array sizes.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
include/linux
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
kernel/kexec.c | 2 +-
1 file changed, 1 insertion(+), 1
@ x86_64 does also boot
fine.
If there is more I can do to verify the early boot stages are fine,
please let me know!
P.
Philipp Stanner (5):
string.h: add array-wrappers for (v)memdup_user()
kernel: kexec: copy user-array safely
kernel: watch_queue: copy user-array safely
drm_lease.c: copy
() and vmemdup_user() to
provide a standardized and safe way for duplicating user arrays.
This is both for new code as well as replacing usage of (v)memdup_user()
in existing code that uses, e.g., n * size to calculate array sizes.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
include/linux
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
kernel/kexec.c | 2 +-
1 file changed, 1 insertion(+), 1
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
kernel/watch_queue.c | 2 +-
1 file changed, 1 insertion(+), 1
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/drm_lease.c | 4 ++--
1 file changed, 2
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 4 ++--
1 file
o wrote:
> > > > > On Wed, Aug 30, 2023 at 4:46 PM Philipp Stanner
> > > > >
> > > Alphabetical.
> > >
> > > compiler.h
> > > err.h
> > > overflow.h
> > > ...the rest that is a bit unordered...
> > >
On Wed, 2023-08-30 at 17:11 +0300, Andy Shevchenko wrote:
> On Wed, Aug 30, 2023 at 4:46 PM Philipp Stanner
> wrote:
> >
> > Currently, user array duplications are sometimes done without an
> > overflow check. Sometimes the checks are done manually; sometimes
> > th
viafbdev.c utilizes memdup_user() to copy an array from userspace.
There is a new wrapper, specifically designed for copying arrays. Use
this one instead.
Suggested-by: Dave Airlie
Signed-off-by: Philipp Stanner
---
drivers/video/fbdev/via/viafbdev.c | 2 +-
1 file changed, 1 insertion(+), 1
-by: Thomas Zimmermann
Signed-off-by: Philipp Stanner
---
Changes in v2:
- Remove unnecessary return code checks for pcim_iomap_regions()
(Jocelyn)
Thx Jocelyn for the kind review
---
drivers/gpu/drm/ast/ast_main.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git
-by: Thomas Zimmermann
Signed-off-by: Philipp Stanner
---
¡Hola!
I picked up the memory-region-request-task from the DRM-TODO-List [1]
and began with this driver.
Please have a first look. I wasn't entirely sure about -ENOMEM... for
example, as far as my understanding goes, it should not be able to fail
On Sat, 2023-09-16 at 17:32 +0300, Dan Carpenter wrote:
> On Fri, Sep 08, 2023 at 09:59:40PM +0200, Philipp Stanner wrote:
> > +static inline void *memdup_array_user(const void __user *src,
> > size_t n, size_t size)
> > +{
> > + size_t nbytes;
>
() and vmemdup_user() to
provide a standardized and safe way for duplicating user arrays.
This is both for new code as well as replacing usage of (v)memdup_user()
in existing code that uses, e.g., n * size to calculate array sizes.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
Reviewed-by: Andy
' docstrings
- Return -EOVERFLOW instead of -EINVAL from wrapper functions
P.
Philipp Stanner (5):
string.h: add array-wrappers for (v)memdup_user()
kernel: kexec: copy user-array safely
kernel: watch_queue: copy user-array safely
drm_lease.c: copy user-array safely
drm: vmgfx_surface.c: copy
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
Acked-by: Baoquan He
Reviewed-by: Kees Cook
Reviewed-by: Zack
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
Reviewed-by: Kees Cook
Reviewed-by: Zack Rusin
---
drivers/gpu
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
Reviewed-by: Kees Cook
Reviewed-by: Zack Rusin
---
kernel
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie
Signed-off-by: Philipp Stanner
Reviewed-by: Kees Cook
Reviewed-by: Zack Rusin
---
drivers/gpu
On Fri, 2023-11-03 at 19:25 +0100, Philipp Stanner wrote:
> Currently, tha ast-driver just maps the PCI-dev's regions with
> pcim_iomap(). It does not actually reserve the regions exclusively
> with, e.g., pci_request_regions().
>
> Replace the calls to pcim_io
Hello folks,
I'm currently trying to learn more about DRM and discovered the
following code sequence:
drivers/gpu/drm/amd/amdkfd/kfd_device.c, Line 824 on 6.4-rc7
static inline void kfd_queue_work(struct workqueue_struct *wq,
struct work_struct *work)
{
you might want to have a closer look.
P.
[1]
https://lore.kernel.org/lkml/45ad1d0f-a10f-483e-848a-76a30252edbe@paulmck-laptop/
Philipp Stanner (2):
drm/imx/dcss: request memory region
drm/imx/dcss: have all init functions use devres
drivers/gpu/drm/imx/dcss/dcss-blkctl.c | 13
The driver's memory regions are currently just ioremap()ed, but not
reserved through a request. That's not a bug, but having the request is
a little more robust.
Implement the region-request through the corresponding managed
devres-function.
Signed-off-by: Philipp Stanner
Reviewed-by: Laurentiu
-by: Philipp Stanner
---
drivers/gpu/drm/imx/dcss/dcss-blkctl.c | 13 ++---
drivers/gpu/drm/imx/dcss/dcss-ctxld.c | 14 +++---
drivers/gpu/drm/imx/dcss/dcss-dev.c| 12 ++--
drivers/gpu/drm/imx/dcss/dcss-dev.h| 1 -
drivers/gpu/drm/imx/dcss/dcss-dpr.c| 21
ly and
bypass the legacy iomap table mechanism.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 473 ++-
include/linux/pci.h | 11 +
2 files changed, 479 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
ind
as much of the iomap-table-mechanism as possible.
Add comments describing the path towards a cleaned-up API.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 374 +--
drivers/pci/pci.c| 20 +++
drivers/pci/pci.h| 5 +
include/linux/pci.h
.
This is not the case.
Add comments to the relevant functions' docstrings that warn users about
this behavior.
Signed-off-by: Philipp Stanner
---
drivers/pci/iomap.c | 18 ++
drivers/pci/pci.c | 60 -
2 files changed, 77 insertions(+), 1
to struct pci_dev.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 11 ---
drivers/pci/pci.c| 17 ++---
drivers/pci/pci.h| 1 -
include/linux/pci.h | 1 +
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
.
This will later permit simplifying pcim_enable_device().
Move the 'pinned' boolean bit to struct pci_dev.
Restructure bits in struct pci_dev so the pm / pme fields are next to
each other.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 14 --
drivers/pci/pci.h| 1
the pci_request / release functions call their pcim_ counterparts.
Remove the now surplus region_mask from struct pci_devres.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 49 ++-
drivers/pci/pci.c| 50
Managing pci_set_mwi() with devres can easily be done with its own
callback, without the necessity to store any state about it in a
device-related struct.
Remove the MWI state from struct pci_devres.
Give pcim_set_mwi() a separate devres-callback.
Signed-off-by: Philipp Stanner
---
drivers/pci
pcim_intx() in the managed case.
Remove the struct pci_devres from pci.h.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 76 ++--
drivers/pci/pci.c| 24 +++---
drivers/pci/pci.h| 21 +++-
3 files changed, 77 insertions(+), 44
the now surplus function get_pci_dr().
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 49 +++-
1 file changed, 21 insertions(+), 28 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 8a643f15140a..3e567773c556 100644
, functions become managed that way.
The function pci_iomap_range() is never managed.
Replace pci_iomap_range() with the actually managed function
pcim_iomap_range().
CC: # v5.10+
Fixes: 8558de401b5f ("drm/vboxvideo: use managed pci functions")
Signed-off-by: Philipp Stanner
---
drive
tem.
Kasan and kmemleak didn't find any problems.
I believe this series cleans the API up as much as possible without
having to port all existing drivers to the new API. Especially, I think
that this implementation is easy to extend if the need for new managed
functions arises :)
Greetings,
P.
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 19 ---
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 8ebd7134ee21..2ad3f44a6e2d 100644
--- a/drivers/gpu/drm
The driver's memory regions are currently just ioremap()ed, but not
reserved through a request. That's not a bug, but having the request is
a little more robust.
Implement the region-request through the corresponding managed
devres-function.
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm
Some drivers want to use (request) a region exclusively but nevertheless
create several mappings within that region.
Currently, there is no managed devres function to request a region
without mapping it.
Add the function devm_platform_get_resource()
Signed-off-by: Philipp Stanner
---
drivers
.
Philipp Stanner (2):
platform_device: add devres function region-reqs
drm/dcss: request memory region
drivers/base/platform.c | 37 +
drivers/gpu/drm/imx/dcss/dcss-dev.c | 8 +++
include/linux/platform_device.h | 2 ++
3 files changed, 43 insertions
-by: Philipp Stanner
---
This is a separate patch because it can be applied independently from my
other patch-series that applies the region-request for this driver.
---
drivers/gpu/drm/imx/dcss/dcss-blkctl.c | 14 +++---
drivers/gpu/drm/imx/dcss/dcss-ctxld.c | 15 ---
drivers/gpu/drm
want to have a closer look.
P.
Philipp Stanner (2):
drm/imx/dcss: request memory region
drm/imx/dcss: have all init functions use devres
drivers/gpu/drm/imx/dcss/dcss-blkctl.c | 14 +++---
drivers/gpu/drm/imx/dcss/dcss-ctxld.c | 15 ---
drivers/gpu/drm/imx/dcss/dcss-dev.c
The driver's memory regions are currently just ioremap()ed, but not
reserved through a request. That's not a bug, but having the request is
a little more robust.
Implement the region-request through the corresponding managed
devres-function.
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm
-by: Philipp Stanner
---
drivers/gpu/drm/imx/dcss/dcss-blkctl.c | 14 +++---
drivers/gpu/drm/imx/dcss/dcss-ctxld.c | 15 ---
drivers/gpu/drm/imx/dcss/dcss-dev.c| 12 ++--
drivers/gpu/drm/imx/dcss/dcss-dev.h| 1 -
drivers/gpu/drm/imx/dcss/dcss-dpr.c| 25
On Tue, 2024-01-16 at 23:15 +0200, andy.shevche...@gmail.com wrote:
> Mon, Jan 15, 2024 at 03:46:12PM +0100, Philipp Stanner kirjoitti:
> > PCI's devres API is not extensible to ranged mappings and has
> > bug-provoking features. Improve that by providing better
> > altern
On Tue, 2024-01-16 at 23:27 +0200, andy.shevche...@gmail.com wrote:
> Mon, Jan 15, 2024 at 03:46:13PM +0100, Philipp Stanner kirjoitti:
> > The old plural devres functions tie PCI's devres implementation to
> > the
> > iomap-table mechanism which unfortunat
d) region-request functions being sometimes managed and
sometimes not is bug-provoking.
Implement a set of singular pcim_ functions that use devres directly
and bypass the legacy iomap table mechanism.
Add devres.c to driver-api documentation.
Signed-off-by: Philipp Stanner
---
Docume
ions arises :)
Greetings,
P.
[1] https://lore.kernel.org/lkml/20240111085540.7740-1-pstan...@redhat.com/
Philipp Stanner (10):
pci: add new set of devres functions
pci: deprecate iomap-table functions
pci: warn users about complicated devres nature
pci: devres: make devres region requests c
.
This is not the case.
Add comments to the relevant functions' docstrings that warn users about
this behavior.
Signed-off-by: Philipp Stanner
---
drivers/pci/iomap.c | 18 ++
drivers/pci/pci.c | 60 -
2 files changed, 77 insertions(+), 1 deletion
.
Remove as much of the iomap-table-mechanism as possible.
Add comments describing the path towards a cleaned-up API.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 369 +--
drivers/pci/pci.c| 20 +++
drivers/pci/pci.h| 5 +
include
the pci_request / release functions call their pcim_ counterparts.
Remove the now surplus region_mask from the devres struct.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 49 ++-
drivers/pci/pci.c| 50
the region-request-functions, pci_intx() has to call into its
managed counterpart for backwards compatibility.
Implement pcim_intx() with its own device resource.
Make pci_intx() call pcim_intx() in the managed case.
Remove the legacy devres struct from pci.h.
Signed-off-by: Philipp Stanner
---
d
the now surplus get_dr() function.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 38 --
1 file changed, 8 insertions(+), 30 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 7c4edcaeb8fe..87bc62be21eb 100644
--- a/drivers
managing mwi with devres can easily be done with its own callback,
without the necessity to store any state about it in a device-related
struct.
Remove the mwi state from the devres-struct.
Make the devres-mwi functions set a separate devres-callback.
Signed-off-by: Philipp Stanner
---
drivers
to struct pci_dev.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 11 ---
drivers/pci/pci.c| 17 ++---
drivers/pci/pci.h| 1 -
include/linux/pci.h | 1 +
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
struct.
This will later permit simplifying pcim_enable_device().
Move the 'pinned' boolean bit to struct pci_dev.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 14 --
drivers/pci/pci.h| 1 -
include/linux/pci.h | 1 +
3 files changed, 5 insertions(+), 11 deletions
pci_iomap_range() is never managed.
Replace pci_iomap_range() with the actually managed function
pcim_iomap_range().
Additionally, add a call to pcim_request_region() to ensure exclusive
access to BAR 0.
CC: # v5.10+
Fixes: 8558de401b5f ("drm/vboxvideo: use managed pci functions")
Signed-off-b
On Tue, 2024-01-16 at 12:44 -0600, Bjorn Helgaas wrote:
> On Mon, Jan 15, 2024 at 03:46:12PM +0100, Philipp Stanner wrote:
> > PCI's devres API is not extensible to ranged mappings and has
> > bug-provoking features. Improve that by providing better
> > alternatives.
>
&g
On Tue, 2024-01-16 at 23:34 +0200, andy.shevche...@gmail.com wrote:
> Mon, Jan 15, 2024 at 03:46:17PM +0100, Philipp Stanner kirjoitti:
> > The bit describing whether the PCI device is currently pinned is
> > stored
> > in the PCI devres struct. To clean up and simplify t
On Tue, 2024-01-16 at 23:17 +0200, andy.shevche...@gmail.com wrote:
> Mon, Jan 15, 2024 at 03:46:11PM +0100, Philipp Stanner kirjoitti:
> > ¡Hola!
>
> i? Vim user? :-)
The Dark Side of the Force is the path to many abilities, that some
consider to be... unnatural
https://www
On Wed, 2024-01-17 at 10:59 +0100, Philipp Stanner wrote:
> On Tue, 2024-01-16 at 23:17 +0200, andy.shevche...@gmail.com wrote:
> > Mon, Jan 15, 2024 at 03:46:11PM +0100, Philipp Stanner kirjoitti:
[...]
> >
> >
> > > PCI's devres API suffers seve
On Tue, 2024-01-16 at 23:40 +0200, andy.shevche...@gmail.com wrote:
> Mon, Jan 15, 2024 at 03:46:20PM +0100, Philipp Stanner kirjoitti:
> > Thanks to preceding cleanup steps, pcim_release() is now not needed
> > anymore and can be replaced by pcim_disable_device(), which i
Hi
On Fri, 2024-01-05 at 20:11 +0100, Uwe Kleine-König wrote:
> On Fri, Jan 05, 2024 at 06:22:18PM +0100, Philipp Stanner wrote:
> > Some drivers want to use (request) a region exclusively but
> > nevertheless
> > create several mappings within that region.
> >
> &g
Yo!
On Mon, 2024-01-08 at 12:46 +0100, Uwe Kleine-König wrote:
> On Mon, Jan 08, 2024 at 10:45:31AM +0100, Philipp Stanner wrote:
> > On Mon, 2024-01-08 at 10:37 +0100, Uwe Kleine-König wrote:
> > > Other than that I indifferent if this is a good idea. There are
> > > s
The driver's memory regions are currently just ioremap()ed, but not
reserved through a request. That's not a bug, but having the request is
a little more robust.
Implement the region-request through the corresponding managed
devres-function.
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm
-by: Philipp Stanner
---
drivers/gpu/drm/imx/dcss/dcss-blkctl.c | 14 +++---
drivers/gpu/drm/imx/dcss/dcss-ctxld.c | 15 ---
drivers/gpu/drm/imx/dcss/dcss-dev.c| 11 ++-
drivers/gpu/drm/imx/dcss/dcss-dpr.c| 25 ++---
drivers/gpu/drm/imx/dcss/dcss-drv.c
.
Philipp Stanner (2):
drm/dcss: request memory region
drm/imx/dcss: have all init functions use devres
drivers/gpu/drm/imx/dcss/dcss-blkctl.c | 14 +++---
drivers/gpu/drm/imx/dcss/dcss-ctxld.c | 15 ---
drivers/gpu/drm/imx/dcss/dcss-dev.c| 18 +-
drivers
On Mon, 2024-01-08 at 10:37 +0100, Uwe Kleine-König wrote:
> Hello Philipp,
>
> the Subject is incomprehensible (to me). Maybe make it:
>
> platform_device: Add devm function to simplify mem and io
> requests
>
> ?
>
> On Mon, Jan 08, 2024 at 10:20:42A
Some drivers want to use (request) a region exclusively but nevertheless
create several mappings within that region.
Currently, there is no managed devres function to request a region
without mapping it.
Add the function devm_platform_get_resource().
Signed-off-by: Philipp Stanner
---
drivers
The driver's memory regions are currently just ioremap()ed, but not
reserved through a request. That's not a bug, but having the request is
a little more robust.
Implement the region-request through the corresponding managed
devres-function.
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm
this successfully but unfortunately don't have the hardware
to test it for dcss.
So you might want to have a closer look.
Greetings,
P.
Philipp Stanner (2):
platform_device: add devres function region-reqs
drm/dcss: request memory region
drivers/base/platform.c | 38
On Fri, 2023-12-01 at 02:37 +, zhuweixi wrote:
> From your argument on KVM I can see that the biggest miscommunication
> between us is that you believed that GMEM wanted to share the whole
> address space. No, it is not the case. GMEM is only providing
> coordination via certain mmap() calls.
Hi,
On Mon, 2024-01-29 at 12:15 +0100, Hans de Goede wrote:
> Hi Philipp,
>
> On 1/23/24 10:43, Philipp Stanner wrote:
> > When the PCI devres API was introduced to this driver, it was
> > wrongly
> > assumed that initializing the device with pcim_
as much of the iomap-table-mechanism as possible.
Add comments describing the path towards a cleaned-up API.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 374 +--
drivers/pci/pci.c| 20 +++
drivers/pci/pci.h| 5 +
include/linux/pci.h
.
This is not the case.
Add comments to the relevant functions' docstrings that warn users about
this behavior.
Signed-off-by: Philipp Stanner
---
drivers/pci/iomap.c | 18 ++
drivers/pci/pci.c | 60 -
2 files changed, 77 insertions(+), 1
the pci_request / release functions call their pcim_ counterparts.
Remove the now surplus region_mask from struct pci_devres.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 49 ++-
drivers/pci/pci.c| 50
the now surplus function get_pci_dr().
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 49 +++-
1 file changed, 21 insertions(+), 28 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 4314d0863282..f368181c6c92 100644
to struct pci_dev.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 11 ---
drivers/pci/pci.c| 17 ++---
drivers/pci/pci.h| 1 -
include/linux/pci.h | 1 +
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
series cleans the API up as much as possible without
having to port all existing drivers to the new API. Especially, I think
that this implementation is easy to extend if the need for new managed
functions arises :)
Greetings,
P.
Philipp Stanner (10):
PCI: add new set of devres functions
ly and
bypass the legacy iomap table mechanism.
Add devres.c to driver-api documentation.
Signed-off-by: Philipp Stanner
---
Documentation/driver-api/pci/pci.rst | 3 +
drivers/pci/devres.c | 473 ++-
include/linux/pci.h | 11 +
3
pcim_intx() in the managed case.
Remove the struct pci_devres from pci.h.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 76 ++--
drivers/pci/pci.c| 24 +++---
drivers/pci/pci.h| 21 +++-
3 files changed, 77 insertions(+), 44
t;drm/vboxvideo: use managed pci functions")
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/vboxvideo/vbox_main.c | 24 +---
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/vboxvideo/vbox_main.c
b/drivers/gpu/drm/vboxvideo/vbox_ma
.
This will later permit simplifying pcim_enable_device().
Move the 'pinned' boolean bit to struct pci_dev.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 14 --
drivers/pci/pci.h| 1 -
include/linux/pci.h | 5 +++--
3 files changed, 7 insertions(+), 13 deletions(-)
diff
Managing pci_set_mwi() with devres can easily be done with its own
callback, without the necessity to store any state about it in a
device-related struct.
Remove the MWI state from struct pci_devres.
Give pcim_set_mwi() a separate devres-callback.
Signed-off-by: Philipp Stanner
---
drivers/pci
Forgot to add a few changes to the changelog:
On Tue, 2024-01-23 at 10:42 +0100, Philipp Stanner wrote:
> Changes in v2:
> - Make commit head lines congruent with PCI's style (Bjorn)
> - Add missing error checks for devm_add_action(). (Andy)
> - Repair the "Returns:
On Thu, 2024-02-29 at 14:57 -0600, Bjorn Helgaas wrote:
> On Thu, Feb 29, 2024 at 09:31:20AM +0100, Philipp Stanner wrote:
> > @Bjorn:
> > Hey Bjorn, are we good with this series? Any more wishes or
> > suggestions?
>
> Sorry, haven't had a chance to go through it yet
Especially, I think
that this implementation is easy to extend if the need for new managed
functions arises :)
Greetings,
P.
Philipp Stanner (10):
PCI: Add new set of devres functions
PCI: Deprecate iomap-table functions
PCI: Warn users about complicated devres nature
PCI: Make devres r
ly and
bypass the legacy iomap table mechanism.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 473 ++-
include/linux/pci.h | 11 +
2 files changed, 479 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
ind
the now surplus function get_pci_dr().
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 49 +++-
1 file changed, 21 insertions(+), 28 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 8a643f15140a..3e567773c556 100644
, functions become managed that way.
The function pci_iomap_range() is never managed.
Replace pci_iomap_range() with the actually managed function
pcim_iomap_range().
CC: # v5.10+
Fixes: 8558de401b5f ("drm/vboxvideo: use managed pci functions")
Signed-off-by: Philipp Stanner
---
drive
pcim_intx() in the managed case.
Remove the struct pci_devres from pci.h.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 74 +++-
drivers/pci/pci.c| 24 +++---
drivers/pci/pci.h| 17 +-
3 files changed, 74 insertions(+), 41
as much of the iomap-table-mechanism as possible.
Add comments describing the path towards a cleaned-up API.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 374 +--
drivers/pci/pci.c| 20 +++
drivers/pci/pci.h| 5 +
include/linux/pci.h
.
This is not the case.
Add comments to the relevant functions' docstrings that warn users about
this behavior.
Signed-off-by: Philipp Stanner
---
drivers/pci/iomap.c | 18 ++
drivers/pci/pci.c | 60 -
2 files changed, 77 insertions(+), 1
the pci_request / release functions call their pcim_ counterparts.
Remove the now surplus region_mask from struct pci_devres.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 49 ++-
drivers/pci/pci.c| 50
.
This will later permit simplifying pcim_enable_device().
Move the 'pinned' boolean bit to struct pci_dev.
Restructure bits in struct pci_dev so the pm / pme fields are next to
each other.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 14 --
drivers/pci/pci.h| 1
to struct pci_dev.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 11 ---
drivers/pci/pci.c| 17 ++---
drivers/pci/pci.h| 1 -
include/linux/pci.h | 1 +
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
1 - 100 of 131 matches
Mail list logo