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)
{
*PING*
On Tue, 2024-08-06 at 16:38 +0200, Philipp Stanner wrote:
> drm_sched_job_init() has no control over how users allocate struct
> drm_sched_job. Unfortunately, the function can also not set some
> struct
> members such as job->sched.
>
> This could theoreticall
ed_job_arm() does in this regard and which rules the API-User has
to follow once the function has been called.
Add a section to drm_sched_job_arm()'s docstring which details the
function's consequences regarding the job's fences.
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/s
3f0a ("drm/sched: Convert the GPU scheduler to variable number
of run-queues")
Reported-by: Danilo Krummrich
Closes: https://lore.kernel.org/lkml/20231108022716.15250-1-d...@redhat.com/
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/scheduler/sched_main.c | 2 +-
1 file changed, 1 insert
On Tue, 2024-08-27 at 11:00 +0200, Christian König wrote:
> Am 27.08.24 um 10:39 schrieb Danilo Krummrich:
> > On 8/27/24 9:45 AM, Philipp Stanner wrote:
> > > In drm_sched_job_init(), commit 56e449603f0a ("drm/sched: Convert
> > > the
> > > GPU s
On Mon, 2024-08-26 at 14:25 +0200, Christian König wrote:
> The current implementation of drm_sched_start uses a hardcoded
> -ECANCELED to dispose of a job when the parent/hw fence is NULL.
> This results in drm_sched_job_done being called with -ECANCELED for
> each job with a NULL parent in the pe
bug such issues if these pointers are initialized to
NULL, so dereferencing them causes a NULL pointer exception.
Accordingly, drm_sched_entity_init() does precisely that and initializes
its struct with memset().
Initialize parameter "job" to 0 in drm_sched_job_init().
Signed-off-by: Phili
ruct members.
Document that job->sched in particular is uninitialized before
drm_sched_job_arm().
Signed-off-by: Philipp Stanner
---
Changes in v2:
- Change grammar in the new comments a bit.
---
drivers/gpu/drm/scheduler/sched_main.c | 4
include/drm/gpu_scheduler.h|
On Wed, 2024-08-28 at 14:04 +0300, Anastasia Belova wrote:
> Switch to a managed drm device to cleanup some error handling
> and make future work easier.
It's best to state what the current situation is like and then how this
patch addresses it.
If the cleanup topic is separate from the addressed
On Fri, 2024-08-30 at 15:15 +0200, Christian König wrote:
> Am 28.08.24 um 11:30 schrieb Philipp Stanner:
> > On Mon, 2024-08-26 at 14:25 +0200, Christian König wrote:
> > > The current implementation of drm_sched_start uses a hardcoded
> > > -ECANCELED to dispose of a j
that to happen.
Suggested-by: Danilo Krummrich
Signed-off-by: Philipp Stanner
---
Hi all,
since the scheduler has many stake holders, I want this solution
discussed as an RFC first.
This version here has IMO the advantage (and disadvantage...) that it
blocks infinitly if the driver messed up the
Signed-off-by: Philipp Stanner
---
Hi all,
since the scheduler has many stake holders, I want this solution
discussed as an RFC first.
The advantage of this version would be that it does not block
drm_sched_fini(), but the price paid for that is that the scheduler
keeps running until all jobs are gone
Luben? Christian?
On Wed, 2024-08-28 at 11:41 +0200, Philipp Stanner wrote:
> drm_sched_job_init() has no control over how users allocate struct
> drm_sched_job. Unfortunately, the function can also not set some
> struct
> members such as job->sched.
>
> This could theore
On Wed, 2024-09-04 at 19:47 +0200, Simona Vetter wrote:
> On Tue, Sep 03, 2024 at 11:44:47AM +0200, Philipp Stanner wrote:
> > The GPU scheduler currently does not ensure that its pending_list
> > is
> > empty before performing various other teardown tasks in
> > dr
Hi,
On Fri, 2024-09-06 at 19:06 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin
>
> In a recent conversation with Christian there was a thought that
> drm_sched_entity_modify_sched() should start using the entity-
> >rq_lock to be
> safe against job submission and simultaneous priority chang
On Fri, 2024-09-06 at 19:06 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin
>
> Without the locking amdgpu currently can race
> amdgpu_ctx_set_entity_priority() and drm_sched_job_arm(),
I would explicitly say "amdgpu's amdgpu_ctx_set_entity_priority() races
through drm_sched_entity_modify_s
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
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
ora38 @ 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:
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
Gentle ping because the Merge Window opened 8-)
On Fri, 2024-03-01 at 12:29 +0100, Philipp Stanner wrote:
> This v4 now can (hopefully) be applied to linux-next, but not to
> mainline/master.
>
> Changes in v4:
> - Rebase against linux-next
>
> Changes in v3:
> -
@Bjorn, @Krzysztof
On Mon, 2024-07-08 at 21:46 +, Ashish Kalra wrote:
> With this patch applied, we are observing unloading and then
> reloading issues with the AMD Crypto (CCP) driver:
Thank you very much for digging into this, Ashish
Could you give me some pointers how one could test CCP b
>From c24bd5b66e798a341caf183fb7cdbdf235502d90 Mon Sep 17 00:00:00 2001
From: Philipp Stanner
Date: Tue, 9 Jul 2024 09:45:48 +0200
Subject: [PATCH] PCI: Fix pcim_intx() recursive calls
pci_intx() calls into pcim_intx() in managed mode, i.e., when
pcim_enable_device() had been called. T
7;s "timeout"
parameter. The actual "hang_limit" parameter is directly set to 0.
Define a new variable and rename the existing one to make naming
congruent with the function API.
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/nouveau/nouveau_sched.c | 5 +++--
1 file
7;s "timeout"
parameter. The actual "hang_limit" parameter is directly set to 0.
Rename "job_hang_limit" to "timeout".
Signed-off-by: Philipp Stanner
---
Changes in v2:
- Remove variable "hang_limit". (Danilo)
---
drivers/gpu/drm/nouveau/nouveau_sc
places in drm/scheduler where the
ternary operator is used.
Replace the expression with the standard one.
[1] https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Conditionals.html
Suggested-by: Marco Pagani
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/scheduler/sched_main.c | 2 +-
1 file changed
On Thu, 2023-11-16 at 15:15 +0100, Christian König wrote:
> Start to improve the scheduler document. Especially document the
> lifetime of each of the objects as well as the restrictions around
> DMA-fence handling and userspace compatibility.
Hallo Christian,
thanks for working on this.
I'm cur
Hi everyone,
Now that we've got the simplified PCI devres API available we can slowly
start using it in drivers and step by step phase the more problematic
API out.
vboxvideo currently does not have a region request, so it is a suitable
first user.
P.
Philipp Stanner (2):
PCI:
: Philipp Stanner
---
drivers/pci/devres.c | 1 +
drivers/pci/pci.h| 2 --
include/linux/pci.h | 1 +
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 3780a9f9ec00..0127ca58c6e5 100644
--- a/drivers/pci/devres.c
+++ b/drivers/pci
vboxvideo currently does not reserve its PCI BAR through a region
request.
Implement the request through the managed function
pcim_request_region().
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/vboxvideo/vbox_main.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm
bug such issues if these pointers are initialized to
NULL, so dereferencing them causes a NULL pointer exception.
Accordingly, drm_sched_entity_init() does precisely that and initializes
its struct with memset().
Initialize parameter "job" to 0 in drm_sched_job_init().
Signed-off-by: Phili
ruct members.
Document that job->sched in particular is uninitialized before
drm_sched_job_arm().
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/scheduler/sched_main.c | 4
include/drm/gpu_scheduler.h| 7 +++
2 files changed, 11 insertions(+)
diff --git a/drivers/gp
pcim_iomap_region() a public function.
Mark pcim_iomap_regions() as deprecated.
Signed-off-by: Philipp Stanner
---
drivers/pci/devres.c | 8 ++--
include/linux/pci.h | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index
().
Suggested-by: Thomas Zimmermann
Signed-off-by: Philipp Stanner
---
drivers/gpu/drm/ast/ast_drv.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index aae019e79bda..1fadaadfbe39 100644
--- a
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;
>
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:
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
---
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
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
ed-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 ab
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
ed-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 --
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_
@Bjorn:
Hey Bjorn, are we good with this series? Any more wishes or
suggestions?
P.
On Tue, 2024-02-06 at 14:39 +0100, Philipp Stanner wrote:
> Changes in v3:
> - Use the term "PCI devres API" in some forgotten places.
> - Fix more grammar errors in patch #3.
>
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 i
ut
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
PCI: Deprecate iomap-table functions
PCI: Warn use
e devres directly 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/p
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(
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
dev.
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 --
drive
ean bit 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/pc
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
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
x() 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
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_enable_
es and reserves resources as intended on my system.
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 n
e devres directly 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/p
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(
ean bit 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/pc
dev.
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 --
drive
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
x() 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
On Wed, 2024-05-22 at 08:53 +0900, FUJITA Tomonori wrote:
> Hi,
> Thanks for working on the firmware API!
>
> On Mon, 20 May 2024 19:24:19 +0200
> Danilo Krummrich wrote:
>
> > Add an abstraction around the kernels firmware API to request
> > firmware
> > images. The abstraction provides functio
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. S
On Thu, 2024-03-28 at 12:55 -0500, Bjorn Helgaas wrote:
> On Fri, Mar 01, 2024 at 12:29:58PM +0100, Philipp Stanner wrote:
> > When the PCI devres API was introduced to this driver, it was
> > wrongly
> > assumed that initializing the device with pcim_enable_device
1]
I tested this on a x86 VM with a simple pci test-device with two
regions. Operates and reserves resources as intended on my system.
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 A
e devres directly 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/p
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(
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
dev.
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 --
drive
x() 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
ean bit 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/pc
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
, 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().
Fixes: 8558de401b5f ("drm/vboxvideo: use managed pci functions")
Signed-off-by: Philipp Stanner
Reviewed-by: Han
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
Hello,
On Thu, 2024-04-04 at 09:29 +0300, Dan Carpenter wrote:
> Hi Philipp,
>
> kernel test robot noticed the following build warnings:
>
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:
> https://github.com/intel-lab-lkp/linux/commits
isting 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
PCI: Deprecate iomap-table functions
PCI: Warn users about complicated devres natu
e devres directly 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/p
.
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(
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 | 372 +--
drivers/pci/pci.c| 20 +++
drivers/pci/pci.h| 5 +
include/linux/pci.h
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
1 - 100 of 684 matches
Mail list logo