Panthor BO tagging and GEMS debug display
Subsystems (5)
v9 cover Panthor BO tagging and GEMS debug display
This patch series is aimed at providing UM with detailed memory profiling information in debug builds. It is achieved through a device-wide list of DRM GEM objects, and also implementing the ability to label BO's from UM through a new IOCTL.
The new debugfs file shows a list of driver DRM GEM objects in tabular mode. To visualise it, cat sudo cat /sys/kernel/debug/dri/*.gpu/gems. To test this functionality from UM, please refer to this Mesa patch series:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34224
Discussion of previous revision of this patch series can be found at:
https://lore.kernel.org/dri-devel/[email protected]/
Changelog:
v9:
- Added padding field to uAPI BO label ioctl struct
- Simplified copying and bounds checking of label in ioctl function
v8:
- Renamed NULL to NUL in comments describing NUL-terminated strings
- Removed 'size' parameter from labelling ioctl() as max length can be handled by the kernel itself
- Made sure to use kfree_const() everywhere labels are freed
- Replaced maximum label size with numerical constant rather than page size
- Added some warnings and checks in kernel BO labelling function
v7:
- Improved formating of DebugFS GEM's status and usage flags
- Deleted some spurious white spaces
- Renamed usage flags setting function
v6:
- Replaced some mutex calls with scoped guards
- Documented data size limits in the label ioctl
- Simplified GEMS status flags treatment (Panthor doesn't use madvise)
- Fixed some array size and string bugs
- Improved the naming of GEM status and usage flags to reflect their meaning
- Improved the formatting of the output table
v5:
- Kept case and naming of kernel BO's consistent
- Increased the driver minor after new ioctl
- Now adds BO to debugfs GEMs list at GEM object creation time
- No longer try to hide BO creator's name when it's a workqueue or modprobe
- Reworked the procedure for printing GEM state and kernel BO flags
- Turned kernel BO flags and GEM state flags into bit enums
- Wait until BO state is marked as initialied for debugfs display
v4:
- Labelled all kernel BO's, not just heap chunks.
- Refactored DebugGFs GEMs list handling functions
- Added debugfs GEMS node mask to tell different kinds of BO's
Adrián Larumbe (4):
drm/panthor: Introduce BO labeling
drm/panthor: Add driver IOCTL for setting BO labels drm/panthor: Label all kernel BO's
drm/panthor: show device-wide list of DRM GEM objects over DebugFS
drivers/gpu/drm/panthor/panthor_device.c | 5 + drivers/gpu/drm/panthor/panthor_device.h | 11 ++ drivers/gpu/drm/panthor/panthor_drv.c | 90 ++++++++- drivers/gpu/drm/panthor/panthor_fw.c | 8 +- drivers/gpu/drm/panthor/panthor_gem.c | 233 ++++++++++++++++++++++- drivers/gpu/drm/panthor/panthor_gem.h | 80 +++++++- drivers/gpu/drm/panthor/panthor_heap.c | 6 +- drivers/gpu/drm/panthor/panthor_sched.c | 9 +- include/uapi/drm/panthor_drm.h | 20 ++ 9 files changed, 451 insertions(+), 11 deletions(-)
--
2.48.1
PATCH v9 1/4 drm/panthor: Introduce BO labeling
Add a new character string Panthor BO field, and a function that allows setting it from within the driver.
Driver takes care of freeing the string when it's replaced or no longer needed at object destruction time, but allocating it is the responsibility of callers.
--- drivers/gpu/drm/panthor/panthor_gem.c | 46 +++++++++++++++++++++++++++ drivers/gpu/drm/panthor/panthor_gem.h | 17 ++++++++++ 2 files changed, 63 insertions(+)
drivers/gpu/drm/panthor/panthor_gem.c +46 -0
@@ -2,6 +2,7 @@/* Copyright 2019 Linaro, Ltd, Rob Herring <[email protected]> */ /* Copyright 2023 Collabora ltd. */ +#include <linux/cleanup.h> #include <linux/dma-buf.h> #include <linux/dma-mapping.h> #include <linux/err.h>
@@ -18,6 +19,14 @@ static void panthor_gem_free_object(struct drm_gem_object *obj)struct panthor_gem_object *bo =to_panthor_bo (obj);struct drm_gem_object *vm_root_gem = bo->exclusive_vm_root_gem; +/* +* Label might have been allocated with kstrdup_const(), +* we need to take that into account when freeing the memory +*/ +kfree_const (bo->label.str); + +mutex_destroy (&bo->label.lock); +drm_gem_free_mmap_offset (&bo->base.base);mutex_destroy (&bo->gpuva_list_lock);drm_gem_shmem_free (&bo->base);
@@ -196,6 +205,7 @@ struct drm_gem_object *panthor_gem_create_object(struct drm_device *ddev, size_t obj->base.map_wc = !ptdev->coherent;mutex_init (&obj->gpuva_list_lock);drm_gem_gpuva_set_lock (&obj->base.base, &obj->gpuva_list_lock); +mutex_init (&obj->label.lock);return &obj->base.base; }
@@ -247,3 +257,39 @@ panthor_gem_create_with_handle(struct drm_file *file,return ret; } + +void +panthor_gem_bo_set_label (struct drm_gem_object *obj,const char *label) +{ +struct panthor_gem_object *bo =to_panthor_bo (obj); +const char *old_label; + + scoped_guard(mutex, &bo->label.lock) { + old_label = bo->label.str; + bo->label.str = label; + } + +kfree_const (old_label); +} + +void +panthor_gem_kernel_bo_set_label (struct panthor_kernel_bo *bo,const char *label) +{ +const char *str; + +/* We should never attempt labelling a UM-exposed GEM object */ +if (drm_WARN_ON (bo->obj->dev, bo->obj->handle_count >0 )) +return ; + +if (!label) +return ; + + str =kstrdup_const (label,GFP_KERNEL ); +if (!str) { +/* Failing to allocate memory for a label isn't a fatal condition */ +drm_warn (bo->obj->dev,"Not enough memory to allocate BO label" ); +return ; + } + +panthor_gem_bo_set_label (bo->obj, str); +}
drivers/gpu/drm/panthor/panthor_gem.h +17 -0
@@ -46,6 +46,20 @@ struct panthor_gem_object {/** @flags: Combination of drm_panthor_bo_flags flags. */ u32 flags; + +/** +* @label: BO tagging fields. The label can be assigned within the +* driver itself or through a specific IOCTL. +*/ +struct { +/** +* @label.str: Pointer to NULL-terminated string, +*/ +const char *str; + +/** @lock.str: Protects access to the @label.str field. */ +struct mutex lock; + } label; };/**
@@ -91,6 +105,9 @@ panthor_gem_create_with_handle(struct drm_file *file,struct panthor_vm *exclusive_vm, u64 *size, u32 flags, uint32_t *handle); +void panthor_gem_bo_set_label (struct drm_gem_object *obj,const char *label); +void panthor_gem_kernel_bo_set_label (struct panthor_kernel_bo *bo,const char *label); +static inline u64 panthor_kernel_bo_gpuva (struct panthor_kernel_bo *bo) {
Signature · 1 line
2.48.1
PATCH v9 2/4 drm/panthor: Add driver IOCTL for setting BO labels
In reply to Adrián LarumbeAllow UM to label a BO for which it possesses a DRM handle.
--- drivers/gpu/drm/panthor/panthor_drv.c | 45 ++++++++++++++++++++++++++- drivers/gpu/drm/panthor/panthor_gem.h | 2 ++ include/uapi/drm/panthor_drm.h | 23 ++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_drv.c +44 -1
@@ -1331,6 +1331,47 @@ static int panthor_ioctl_vm_get_state(struct drm_device *ddev, void *data,return 0 ; } +static int panthor_ioctl_bo_set_label (struct drm_device *ddev,void *data, +struct drm_file *file) +{ +struct drm_panthor_bo_set_label *args = data; +struct drm_gem_object *obj; +const char *label =NULL ; +int ret =0 ; + +if (args->pad) +return -EINVAL ; + + obj =drm_gem_object_lookup (file, args->handle); +if (!obj) +return -ENOENT ; + +if (args->label) { + label =strndup_user ((const char __user *)(uintptr_t )args->label, +PANTHOR_BO_LABEL_MAXLEN ); +if (IS_ERR (label)) { + ret =PTR_ERR (label); +if (ret == -EINVAL ) + ret = -E2BIG ; + goto err_put_obj; + } + } + +/* +* We treat passing a label of length 0 and passing a NULL label +* differently, because even though they might seem conceptually +* similar, future uses of the BO label might expect a different +* behaviour in each case. +*/ +panthor_gem_bo_set_label (obj, label); + +err_put_obj: +drm_gem_object_put (obj); + +return ret; +} + +static int panthor_open (struct drm_device *ddev,struct drm_file *file) {
@@ -1400,6 +1441,7 @@ static const struct drm_ioctl_desc panthor_drm_driver_ioctls[] = {PANTHOR_IOCTL (TILER_HEAP_CREATE , tiler_heap_create,DRM_RENDER_ALLOW ),PANTHOR_IOCTL (TILER_HEAP_DESTROY , tiler_heap_destroy,DRM_RENDER_ALLOW ),PANTHOR_IOCTL (GROUP_SUBMIT , group_submit,DRM_RENDER_ALLOW ), + PANTHOR_IOCTL(BO_SET_LABEL, bo_set_label, DRM_RENDER_ALLOW), };static int panthor_mmap (struct file *filp,struct vm_area_struct *vma)
@@ -1509,6 +1551,7 @@ static void panthor_debugfs_init(struct drm_minor *minor)* - 1.2 - adds DEV_QUERY_GROUP_PRIORITIES_INFO query * - adds PANTHOR_GROUP_PRIORITY_REALTIME priority * - 1.3 - adds DRM_PANTHOR_GROUP_STATE_INNOCENT flag +* - 1.4 - adds DRM_IOCTL_PANTHOR_BO_SET_LABEL ioctl */ static const struct drm_driver panthor_drm_driver = { .driver_features = DRIVER_RENDER | DRIVER_GEM | DRIVER_SYNCOBJ |
@@ -1522,7 +1565,7 @@ static const struct drm_driver panthor_drm_driver = { .name = "panthor", .desc = "Panthor DRM driver", .major = 1, - .minor = 3, + .minor = 4, .gem_create_object = panthor_gem_create_object, .gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,
drivers/gpu/drm/panthor/panthor_gem.h +2 -0
@@ -13,6 +13,8 @@struct panthor_vm ; +#define PANTHOR_BO_LABEL_MAXLEN 4096 +/** * struct panthor_gem_object - Driver specific GEM object. */
include/uapi/drm/panthor_drm.h +23 -0
@@ -127,6 +127,9 @@ enum drm_panthor_ioctl_id {/** @DRM_PANTHOR_TILER_HEAP_DESTROY: Destroy a tiler heap. */ DRM_PANTHOR_TILER_HEAP_DESTROY , + +/** @DRM_PANTHOR_BO_SET_LABEL: Label a BO. */ + DRM_PANTHOR_BO_SET_LABEL, };/**
@@ -977,6 +980,24 @@ struct drm_panthor_tiler_heap_destroy {__u32 pad; }; +/** +* struct drm_panthor_bo_set_label - Arguments passed to DRM_IOCTL_PANTHOR_BO_SET_LABEL +*/ +struct drm_panthor_bo_set_label { +/** @handle: Handle of the buffer object to label. */ +__u32 handle; + +/** @pad: MBZ. */ +__u32 pad; + +/** +* @label: User pointer to a NUL-terminated string +* +* Length cannot be greater than 4096 +*/ +__u64 label; +}; +/** * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number * @__access: Access type. Must be R, W or RW.
@@ -1019,6 +1040,8 @@ enum {DRM_IOCTL_PANTHOR (WR ,TILER_HEAP_CREATE , tiler_heap_create),DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY =DRM_IOCTL_PANTHOR (WR ,TILER_HEAP_DESTROY , tiler_heap_destroy), +DRM_IOCTL_PANTHOR_BO_SET_LABEL = + DRM_IOCTL_PANTHOR(WR, BO_SET_LABEL, bo_set_label), };#if defined(__cplusplus)
Signature · 1 line
2.48.1
PATCH v9 3/4 drm/panthor: Label all kernel BO's
In reply to Adrián LarumbeKernel BO's aren't exposed to UM, so labelling them is the responsibility of the driver itself. This kind of tagging will prove useful in further commits when want to expose these objects through DebugFS.
Expand panthor_kernel_bo_create() interface to take a NUL-terminated string. No bounds checking is done because all label strings are given as statically-allocated literals, but if a more complex kernel BO naming scheme with explicit memory allocation and formatting was desired in the future, this would have to change.
--- drivers/gpu/drm/panthor/panthor_fw.c | 8 +++++--- drivers/gpu/drm/panthor/panthor_gem.c | 5 ++++- drivers/gpu/drm/panthor/panthor_gem.h | 2 +- drivers/gpu/drm/panthor/panthor_heap.c | 6 ++++-- drivers/gpu/drm/panthor/panthor_sched.c | 9 ++++++--- 5 files changed, 20 insertions(+), 10 deletions(-)
drivers/gpu/drm/panthor/panthor_fw.c +5 -3
@@ -449,7 +449,8 @@ panthor_fw_alloc_queue_iface_mem(struct panthor_device *ptdev,DRM_PANTHOR_BO_NO_MMAP ,DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC |DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED , - PANTHOR_VM_KERNEL_AUTO_VA); +PANTHOR_VM_KERNEL_AUTO_VA , + "Queue FW interface");if (IS_ERR (mem))return mem;
@@ -481,7 +482,8 @@ panthor_fw_alloc_suspend_buf_mem(struct panthor_device *ptdev, size_t size)return panthor_kernel_bo_create (ptdev,panthor_fw_vm (ptdev), size,DRM_PANTHOR_BO_NO_MMAP ,DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC , -PANTHOR_VM_KERNEL_AUTO_VA ); +PANTHOR_VM_KERNEL_AUTO_VA , +"FW suspend buffer" ); } static int panthor_fw_load_section_entry(struct panthor_device *ptdev,
@@ -601,7 +603,7 @@ static int panthor_fw_load_section_entry(struct panthor_device *ptdev, section->mem =panthor_kernel_bo_create (ptdev,panthor_fw_vm (ptdev), section_size,DRM_PANTHOR_BO_NO_MMAP , - vm_map_flags, va); + vm_map_flags, va,"FW section" );if (IS_ERR (section->mem))return PTR_ERR (section->mem);
drivers/gpu/drm/panthor/panthor_gem.c +4 -1
@@ -76,13 +76,14 @@ void panthor_kernel_bo_destroy(struct panthor_kernel_bo *bo)* @gpu_va: GPU address assigned when mapping to the VM. * If gpu_va == PANTHOR_VM_KERNEL_AUTO_VA, the virtual address will be * automatically allocated. +* @name: Descriptive label of the BO's contents * * Return: A valid pointer in case of success, an ERR_PTR() otherwise. */ struct panthor_kernel_bo *panthor_kernel_bo_create (struct panthor_device *ptdev,struct panthor_vm *vm,size_t size,u32 bo_flags,u32 vm_map_flags, -u64 gpu_va) +u64 gpu_va,const char *name) {struct drm_gem_shmem_object *obj;struct panthor_kernel_bo *kbo;
@@ -106,6 +107,8 @@ panthor_kernel_bo_create(struct panthor_device *ptdev, struct panthor_vm *vm, kbo->obj = &obj->base; bo->flags = bo_flags; +panthor_gem_kernel_bo_set_label (kbo, name); +/* The system and GPU MMU page size might differ, which becomes a * problem for FW sections that need to be mapped at explicit address * since our PAGE_SIZE alignment might cover a VA range that's
drivers/gpu/drm/panthor/panthor_gem.h +1 -1
@@ -153,7 +153,7 @@ panthor_kernel_bo_vunmap(struct panthor_kernel_bo *bo)struct panthor_kernel_bo *panthor_kernel_bo_create (struct panthor_device *ptdev,struct panthor_vm *vm,size_t size,u32 bo_flags,u32 vm_map_flags, -u64 gpu_va); +u64 gpu_va,const char *name);void panthor_kernel_bo_destroy (struct panthor_kernel_bo *bo);
drivers/gpu/drm/panthor/panthor_heap.c +4 -2
@@ -151,7 +151,8 @@ static int panthor_alloc_heap_chunk(struct panthor_heap_pool *pool, chunk->bo =panthor_kernel_bo_create (pool->ptdev, pool->vm, heap->chunk_size,DRM_PANTHOR_BO_NO_MMAP ,DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC , -PANTHOR_VM_KERNEL_AUTO_VA ); +PANTHOR_VM_KERNEL_AUTO_VA , +"Tiler heap chunk" );if (IS_ERR (chunk->bo)) { ret =PTR_ERR (chunk->bo); goto err_free_chunk;
@@ -555,7 +556,8 @@ panthor_heap_pool_create(struct panthor_device *ptdev, struct panthor_vm *vm) pool->gpu_contexts =panthor_kernel_bo_create (ptdev, vm, bosize,DRM_PANTHOR_BO_NO_MMAP ,DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC , -PANTHOR_VM_KERNEL_AUTO_VA ); +PANTHOR_VM_KERNEL_AUTO_VA , +"Heap pool" );if (IS_ERR (pool->gpu_contexts)) { ret =PTR_ERR (pool->gpu_contexts); goto err_destroy_pool;
drivers/gpu/drm/panthor/panthor_sched.c +6 -3
@@ -3332,7 +3332,8 @@ group_create_queue(struct panthor_group *group,DRM_PANTHOR_BO_NO_MMAP ,DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC |DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED , - PANTHOR_VM_KERNEL_AUTO_VA); +PANTHOR_VM_KERNEL_AUTO_VA , + "CS ring buffer");if (IS_ERR (queue->ringbuf)) { ret =PTR_ERR (queue->ringbuf); goto err_free_queue;
@@ -3362,7 +3363,8 @@ group_create_queue(struct panthor_group *group,DRM_PANTHOR_BO_NO_MMAP ,DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC |DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED , - PANTHOR_VM_KERNEL_AUTO_VA); +PANTHOR_VM_KERNEL_AUTO_VA , + "Group job stats");if (IS_ERR (queue->profiling.slots)) { ret =PTR_ERR (queue->profiling.slots);
@@ -3493,7 +3495,8 @@ int panthor_group_create(struct panthor_file *pfile,DRM_PANTHOR_BO_NO_MMAP ,DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC |DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED , - PANTHOR_VM_KERNEL_AUTO_VA); +PANTHOR_VM_KERNEL_AUTO_VA , + "Group sync objects");if (IS_ERR (group->syncobjs)) { ret =PTR_ERR (group->syncobjs); goto err_put_group;
Signature · 1 line
2.48.1
PATCH v9 4/4 drm/panthor: show device-wide list of DRM GEM objects over DebugFS
In reply to Adrián LarumbeAdd a device DebugFS file that displays a complete list of all the DRM GEM objects that are exposed to UM through a DRM handle.
Since leaking object identifiers that might belong to a different NS is inadmissible, this functionality is only made available in debug builds with DEBUGFS support enabled.
File format is that of a table, with each entry displaying a variety of fields with information about each GEM object.
Each GEM object entry in the file displays the following information
fields: Client PID, BO's global name, reference count, BO virtual size, BO resize size, VM address in its DRM-managed range, BO label and a GEM state flags.
There's also a usage flags field for the type of BO, which tells us whether it's a kernel BO and/or mapped onto the FW's address space.
--- drivers/gpu/drm/panthor/panthor_device.c | 5 + drivers/gpu/drm/panthor/panthor_device.h | 11 ++ drivers/gpu/drm/panthor/panthor_drv.c | 26 ++++ drivers/gpu/drm/panthor/panthor_gem.c | 182 +++++++++++++++++++++++ drivers/gpu/drm/panthor/panthor_gem.h | 59 ++++++++ 5 files changed, 283 insertions(+)
drivers/gpu/drm/panthor/panthor_device.c +5 -0
@@ -184,6 +184,11 @@ int panthor_device_init(struct panthor_device *ptdev)if (ret)return ret; +#ifdef CONFIG_DEBUG_FS +drmm_mutex_init (&ptdev->base, &ptdev->gems.lock); +INIT_LIST_HEAD (&ptdev->gems.node); +#endif +atomic_set (&ptdev->pm.state,PANTHOR_DEVICE_PM_STATE_SUSPENDED ); p =alloc_page (GFP_KERNEL | __GFP_ZERO);if (!p)
drivers/gpu/drm/panthor/panthor_device.h +11 -0
@@ -205,6 +205,17 @@ struct panthor_device {/** @fast_rate: Maximum device clock frequency. Set by DVFS */ unsigned long fast_rate; + +#ifdef CONFIG_DEBUG_FS +/** @gems: Device-wide list of GEM objects owned by at least one file. */ +struct { +/** @gems.lock: Protects the device-wide list of GEM objects. */ +struct mutex lock; + +/** @node: Used to keep track of all the device's DRM objects */ +struct list_head node; + } gems; +#endif };struct panthor_gpu_usage {
drivers/gpu/drm/panthor/panthor_drv.c +26 -0
@@ -1538,9 +1538,35 @@ static const struct file_operations panthor_drm_driver_fops = { };#ifdef CONFIG_DEBUG_FS +static int panthor_gems_show (struct seq_file *m,void *data) +{ +struct drm_info_node *node = m->private; +struct drm_device *dev = node->minor->dev; + struct panthor_device *ptdev = container_of(dev, struct panthor_device, base); + +panthor_gem_debugfs_print_bos (ptdev, m); + +return 0 ; +} + + +static struct drm_info_list panthor_debugfs_list[] = { + {"gems" , panthor_gems_show,0 ,NULL }, +}; + +static int panthor_gems_debugfs_init (struct drm_minor *minor) +{ +drm_debugfs_create_files (panthor_debugfs_list, +ARRAY_SIZE (panthor_debugfs_list), + minor->debugfs_root, minor); + +return 0 ; +} +static void panthor_debugfs_init (struct drm_minor *minor) {panthor_mmu_debugfs_init (minor); +panthor_gems_debugfs_init (minor); }#endif
drivers/gpu/drm/panthor/panthor_gem.c +182 -0
224 lines not on this page · raw message
drivers/gpu/drm/panthor/panthor_gem.h +59 -0
75 lines not on this page · raw message
Signature · 1 line
2.48.1
Boris Brezillon
maintainerRe: [PATCH v9 4/4] drm/panthor: show device-wide list of DRM GEM objects over DebugFS
Quoted 5 lines · On Fri, 18 Apr 2025 03:27:07 +0100 Adrián Larumbe…
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+#ifdef CONFIG_DEBUG_FS +static void +panthor_gem_debugfs_format_flags (char flags_str[],int flags_len, +const char *const names[],u32 name_count, +u32 flags)
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 364
Quoted 10 lines
drivers/gpu/drm/panthor/panthor_gem.c +10
-0+{ +bool first = true; +int offset =0 ; + +#define ACC_FLAGS (...) \ + ({ \ + offset += snprintf(flags_str + offset, flags_len - offset, ##__VA_ARGS__); \ + if (offset == flags_len) \ + return; \ + })
I tried applying, but checkpatch complains with:
-:225: WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided #225: FILE: drivers/gpu/drm/panthor/panthor_gem.c:359:
+#define ACC_FLAGS(...) \
+ ({ \
+ offset += snprintf(flags_str + offset, flags_len - offset, ##__VA_ARGS__); \
+ if (offset == flags_len) \
+ return; \
+ })
and now I'm wondering why we even need to return early? Oh, and the check looks suspicious to: snprintf() returns the number of chars that would have been written if the destination was big enough, so the offset will actually be greater than flags_len if the formatted string doesn't fit.
There are a few other formatting issues reported by checkpatch --strict BTW.
Unfortunately this led me to have a second look at these bits and I have a few more comments, sorry about that :-/.
Review
Quoted 2 lines
(quoted diff) +2
-0+ + ACC_FLAGS("%c", '(');
Now that flags have their own columns, I'm not sure it makes sense surround them with parenthesis. That's even weird if we start running out of space, because there would be an open '(', a few flags, the last one being truncated, and no closing ')'. The other thing that's bothering me is the fact we don't know when not all flags have been displayed because of lack of space.
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 372
Quoted 6 lines
drivers/gpu/drm/panthor/panthor_gem.c +6
-0+ +if (!flags) +ACC_FLAGS ("%s" ,"none" ); + +while (flags) { +u32 bit =fls (flags) -1 ;
I would probably print flags in bit position order, so ffs() instead of fls().
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 373
Quoted 1 line
drivers/gpu/drm/panthor/panthor_gem.c +1
-0+u32 idx = bit +1 ;
Why do you have a "+ 1" here? Feels like an off-by-one error to me.
Quoted 5 lines
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+ +if (!first) +ACC_FLAGS ("%s" ,"," ); + +if (idx < name_count && names[idx])
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 388
Quoted 10 lines
drivers/gpu/drm/panthor/panthor_gem.c +10
-0+ACC_FLAGS ("%s" , names[idx]); + + first = false; + flags &= ~BIT (bit); + } + +ACC_FLAGS ("%c" ,')' ); + +#undef ACC_FLAGS +}
How about something like that:
static void
panthor_gem_debugfs_format_flags(char *flags_str, u32 flags_str_len,
const char * const flag_names[],
u32 flag_name_count, u32 flags)
{
int offset = 0;
if (!flags) {
snprintf(flags_str, flags_str_len, "%s", "none");
return;
}
while (flags) {
const char *flag_name = "?";
u32 flag = ffs(flags) - 1;
int new_offset = offset;
flags &= ~BIT(flag);
if (flag < flag_name_count && flag_names[flag])
flag_name = flag_names[flag];
/* Print as much as we can. */
new_offset += snprintf(flags_str + offset, flags_str_len - offset,
"%s%s", offset ? "," : "", flag_name);
/* If we have flags remaining, check that we have enough space for
* the "...".
*/
if (flags)
new_offset += strlen(",...");
/* If we overflowed, replace what we've written by "..." and
* bail out.
*/
if (new_offset > flags_str_len) {
snprintf(flags_str + offset, flags_str_len - offset,
"%s...", offset ? "," : "");
return;
}
offset = new_offset;
}
}Re: [PATCH v9 4/4] drm/panthor: show device-wide list of DRM GEM objects over DebugFS
Hi Boris,
Quoted 31 lines · Boris Brezillon
Quoted 5 lines · On Fri, 18 Apr 2025 03:27:07 +0100 Adrián Larumbe…
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+#ifdef CONFIG_DEBUG_FS +static void +panthor_gem_debugfs_format_flags (char flags_str[],int flags_len, +const char *const names[],u32 name_count, +u32 flags)drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 364
Quoted 10 lines
drivers/gpu/drm/panthor/panthor_gem.c +10
-0+{ +bool first = true; +int offset =0 ; + +#define ACC_FLAGS (...) \ + ({ \ + offset += snprintf(flags_str + offset, flags_len - offset, ##__VA_ARGS__); \ + if (offset == flags_len) \ + return; \ + })I tried applying, but checkpatch complains with:
-:225: WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided #225: FILE:
drivers/gpu/drm/panthor/panthor_gem.c:359:drivers/gpu/drm/panthor/panthor_gem.c +6
-0+#define ACC_FLAGS (...) \ + ({ \ + offset += snprintf(flags_str + offset, flags_len - offset, ##__VA_ARGS__); \ + if (offset == flags_len) \ + return; \ + })
Quoted 5 lines
and now I'm wondering why we even need to return early? Oh, and the check looks suspicious to:
snprintf()returns the number of chars that would have been written if the destination was big enough, so the offset will actually be greater thanflags_lenif the formatted string doesn't fit.
I noticed this warning when running checkpatch myself, and while a return isn't strictly necessary, I thought there was no point in going down the function when no more bytes could be written into the format string because it's already full.
I did check the code for other locations where flow control is happening inside a macro and found this:
#define group_queue_work(group, wname) \
do { \
group_get(group); \
if (!queue_work((group)->ptdev->scheduler->wq, &(group)->wname ## _work)) \
group_put(group); \
} while (0)although I'm not sure whether the do {} while (0) is right there to make the warning go away.
Quoted 4 lines
snprintf()returns the number of chars
that would have been written if the destination was big enough, so the offset will actually be greater thanflags_lenif the formatted string doesn't fit.
Good catch, I don't know why I thought snprintf() would print at most 'flags_len
- offset' bytes, and would return exactly that count at most too, rather than throwing a hypothetical max value. Then maybe checking whether 'if (offset >= flags_len)' would be enough ?
Quoted 85 lines
There are a few other formatting issues reported by checkpatch --strict BTW.
Unfortunately this led me to have a second look at these bits and I have a few more comments, sorry about that :-/.
(quoted diff) +2
-0+ + ACC_FLAGS("%c", '(');Now that flags have their own columns, I'm not sure it makes sense surround them with parenthesis. That's even weird if we start running out of space, because there would be an open '(', a few flags, the last one being truncated, and no closing ')'. The other thing that's bothering me is the fact we don't know when not all flags have been displayed because of lack of space.
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 372
Quoted 6 lines
drivers/gpu/drm/panthor/panthor_gem.c +6
-0+ +if (!flags) +ACC_FLAGS ("%s" ,"none" ); + +while (flags) { +u32 bit =fls (flags) -1 ;I would probably print flags in bit position order, so
ffs()instead offls().drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 373
Quoted 1 line
drivers/gpu/drm/panthor/panthor_gem.c +1
-0+u32 idx = bit +1 ;Why do you have a "+ 1" here? Feels like an off-by-one error to me.
Quoted 5 lines
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+ +if (!first) +ACC_FLAGS ("%s" ,"," ); + +if (idx < name_count && names[idx])drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 388
Quoted 10 lines
drivers/gpu/drm/panthor/panthor_gem.c +10
-0+ACC_FLAGS ("%s" , names[idx]); + + first = false; + flags &= ~BIT (bit); + } + +ACC_FLAGS ("%c" ,')' ); + +#undef ACC_FLAGS +}How about something like that:
static void
panthor_gem_debugfs_format_flags(char*flags_str, u32flags_str_len,const char * const flag_names[], u32 flag_name_count, u32 flags) { int offset = 0; if (!flags) { snprintf(flags_str, flags_str_len, "%s", "none"); return; } while (flags) { const char *flag_name = "?"; u32 flag = ffs(flags) - 1; int new_offset = offset; flags &= ~BIT(flag); if (flag < flag_name_count && flag_names[flag]) flag_name = flag_names[flag]; /* Print as much as we can. */ new_offset += snprintf(flags_str + offset, flags_str_len - offset, "%s%s", offset ? "," : "", flag_name); /* If we have flags remaining, check that we have enough space for * the "...". */ if (flags) new_offset += strlen(",..."); /* If we overflowed, replace what we've written by "..." and * bail out. */ if (new_offset > flags_str_len) {
Quoted 8 lines
snprintf(flags_str + offset, flags_str_len - offset,
"%s...", offset ? "," : "");
return;
}
offset = new_offset;
}
}This looks good to me. However, I'm starting to wonder whether it makes sense to try to come up with a very elaborate flag formatting scheme, because of two reasons:
- It messes up with the output because we need to provide enough headroom in case the flag set will increase in the future. This is not a big deal because the debugfs file is meant to be parsed by UM tools, but ...
- In case we go over the space available to print flags, not printing the remaining ones feels even less informative than printing let's say a hexadecimal mask, because parsing tools would rather deal with no missing data than the absence of human-readable flag names.
On top of that, I think, while these flags could be mostly of interest to parsing tools, they'd be less so to someone casually peeking into the raw textual output. I think they'd be mostly interested in the process which triggered their creation, their size, virtual address in the VM, and above all their name (potentially a very long one).
With all these things born in mind, I'd say we'd best just print a 32 bit mask for both flag fields, for which we'd always know the exact span in bytes, and then print all the available flag names in the debugfs file prelude for parsing tools to pick up on.
Adrian Larumbe
Boris Brezillon
maintainerRe: [PATCH v9 4/4] drm/panthor: show device-wide list of DRM GEM objects over DebugFS
Quoted 47 lines · On Fri, 18 Apr 2025 21:15:32 +0100 Adrián Larumbe…
Hi Boris,
Quoted 31 lines · Boris Brezillon
Quoted 5 lines · On Fri, 18 Apr 2025 03:27:07 +0100 Adrián Larumbe…
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+#ifdef CONFIG_DEBUG_FS +static void +panthor_gem_debugfs_format_flags (char flags_str[],int flags_len, +const char *const names[],u32 name_count, +u32 flags)drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 364
Quoted 10 lines
drivers/gpu/drm/panthor/panthor_gem.c +10
-0+{ +bool first = true; +int offset =0 ; + +#define ACC_FLAGS (...) \ + ({ \ + offset += snprintf(flags_str + offset, flags_len - offset, ##__VA_ARGS__); \ + if (offset == flags_len) \ + return; \ + })I tried applying, but checkpatch complains with:
-:225: WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided #225: FILE:
drivers/gpu/drm/panthor/panthor_gem.c:359:drivers/gpu/drm/panthor/panthor_gem.c +6
-0+#define ACC_FLAGS (...) \ + ({ \ + offset += snprintf(flags_str + offset, flags_len - offset, ##__VA_ARGS__); \ + if (offset == flags_len) \ + return; \ + })Quoted 5 lines
and now I'm wondering why we even need to return early? Oh, and the check looks suspicious to:
snprintf()returns the number of chars that would have been written if the destination was big enough, so the offset will actually be greater thanflags_lenif the formatted string doesn't fit.I noticed this warning when running checkpatch myself, and while a return isn't strictly necessary, I thought there was no point in going down the function when no more bytes could be written into the format string because it's already full.
I did check the code for other locations where flow control is happening inside a macro and found this:
Quoted 8 lines
#define group_queue_work(group, wname) \ do { \ group_get(group); \ if (!queue_work((group)->ptdev->scheduler->wq, &(group)->wname ## _work)) \ group_put(group); \ } while (0)although I'm not sure whether the do {} while (0) is right there to make the warning go away.
No, the main difference is that it doesn't return behind the callers' back which is what checkscript is complaining about, though using do {} while(0) is usually preferred over ({}) when
you have nothing to return.
Quoted 10 lines
Quoted 5 lines
snprintf()returns the number of chars
that would have been written if the destination was big enough, so the offset will actually be greater thanflags_lenif the formatted string doesn't fit.Good catch, I don't know why I thought
snprintf()would print at most 'flags_len
- offset' bytes, and would return exactly that count at most too, rather than throwing a hypothetical max value. Then maybe checking whether 'if (offset >=flags_len)' would be enough ?
It should.
Quoted 115 lines
Quoted 87 lines
There are a few other formatting issues reported by checkpatch --strict BTW.
Unfortunately this led me to have a second look at these bits and I have a few more comments, sorry about that :-/.
(quoted diff) +2
-0+ + ACC_FLAGS("%c", '(');Now that flags have their own columns, I'm not sure it makes sense surround them with parenthesis. That's even weird if we start running out of space, because there would be an open '(', a few flags, the last one being truncated, and no closing ')'. The other thing that's bothering me is the fact we don't know when not all flags have been displayed because of lack of space.
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 372
Quoted 6 lines
drivers/gpu/drm/panthor/panthor_gem.c +6
-0+ +if (!flags) +ACC_FLAGS ("%s" ,"none" ); + +while (flags) { +u32 bit =fls (flags) -1 ;I would probably print flags in bit position order, so
ffs()instead offls().drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 373
Quoted 1 line
drivers/gpu/drm/panthor/panthor_gem.c +1
-0+u32 idx = bit +1 ;Why do you have a "+ 1" here? Feels like an off-by-one error to me.
Quoted 5 lines
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+ +if (!first) +ACC_FLAGS ("%s" ,"," ); + +if (idx < name_count && names[idx])drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 388
Quoted 10 lines
drivers/gpu/drm/panthor/panthor_gem.c +10
-0+ACC_FLAGS ("%s" , names[idx]); + + first = false; + flags &= ~BIT (bit); + } + +ACC_FLAGS ("%c" ,')' ); + +#undef ACC_FLAGS +}How about something like that:
static void
panthor_gem_debugfs_format_flags(char*flags_str, u32flags_str_len,const char * const flag_names[], u32 flag_name_count, u32 flags) { int offset = 0; if (!flags) { snprintf(flags_str, flags_str_len, "%s", "none"); return; } while (flags) { const char *flag_name = "?"; u32 flag = ffs(flags) - 1; int new_offset = offset; flags &= ~BIT(flag); if (flag < flag_name_count && flag_names[flag]) flag_name = flag_names[flag]; /* Print as much as we can. */ new_offset += snprintf(flags_str + offset, flags_str_len - offset, "%s%s", offset ? "," : "", flag_name); /* If we have flags remaining, check that we have enough space for * the "...". */ if (flags) new_offset += strlen(",..."); /* If we overflowed, replace what we've written by "..." and * bail out. */ if (new_offset > flags_str_len) {Quoted 8 lines
snprintf(flags_str + offset, flags_str_len - offset, "%s...", offset ? "," : ""); return; } offset = new_offset; } }This looks good to me. However, I'm starting to wonder whether it makes sense to try to come up with a very elaborate flag formatting scheme, because of two reasons:
- It messes up with the output because we need to provide enough headroom in case the flag set will increase in the future. This is not a big deal because the debugfs file is meant to be parsed by UM tools, but ...
- In case we go over the space available to print flags, not printing the remaining ones feels even less informative than printing let's say a hexadecimal mask, because parsing tools would rather deal with no missing data than the absence of human-readable flag names.
On top of that, I think, while these flags could be mostly of interest to parsing tools, they'd be less so to someone casually peeking into the raw textual output. I think they'd be mostly interested in the process which triggered their creation, their size, virtual address in the VM, and above all their name (potentially a very long one).
Quoted 4 lines
With all these things born in mind, I'd say we'd best just print a 32 bit mask for both flag fields, for which we'd always know the exact span in bytes, and then print all the available flag names in the debugfs file prelude for parsing tools to pick up on.
Yeah, I think I agree with you. The flag printing is messy as it is, and if we're going to use a tool to parse the output, we're probably better off with an hexadecimal value here.
Regards,
Boris
Boris Brezillon
maintainerRe: [PATCH v9 4/4] drm/panthor: show device-wide list of DRM GEM objects over DebugFS
In reply to Adrián Larumbedrivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 410
Quoted 3 lines · On Fri, 18 Apr 2025 03:27:07 +0100 Adrián Larumbe…
drivers/gpu/drm/panthor/panthor_gem.c +3
-0+static const char *const gem_state_flags_names[] = { + [PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED ] ="imported" , + [PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED ] ="exported" ,
Okay, I think I know where the flag indexing issue comes from:PANTHOR_DEBUGFS_GEM_STATE_FLAG_xx are flags, not bit positions, so we can't use them as indices here.
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 415
Quoted 5 lines
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+ }; + +static const char *const gem_usage_flags_names[] = { + [PANTHOR_DEBUGFS_GEM_USAGE_FLAG_KERNEL ] ="kernel" , + [PANTHOR_DEBUGFS_GEM_USAGE_FLAG_FW_MAPPED ] ="fw-mapped" ,
Same problem here.
Quoted 2 lines
(quoted diff) +2
-0+ }; +
Boris Brezillon
maintainerRe: [PATCH v9 4/4] drm/panthor: show device-wide list of DRM GEM objects over DebugFS
Quoted 5 lines · On Fri, 18 Apr 2025 10:11:56 +0200 Boris Brezillon…
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 409
Quoted 2 lines · On Fri, 18 Apr 2025 03:27:07 +0100 Adrián Larumbe…
drivers/gpu/drm/panthor/panthor_gem.c +2
-0+static const char *const gem_state_flags_names[] = { + [PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED ] ="imported" ,
FYI, the compiler seems to be happy with:
[ffs(PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED) - 1] = "imported",
but I'm not sure we want to fix it this way. The other option would be to define bit pos in the enum and then define flags according to these bit pos:
enum panthor_debugfs_gem_state_flags {
PANTHOR_DEBUGFS_GEM_STATE_IMPORTED_BIT = 0, PANTHOR_DEBUGFS_GEM_STATE_EXPORTED_BIT = 1,
/** @PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED: GEM BO is PRIME imported. */ PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED = BIT(PANTHOR_DEBUGFS_GEM_STATE_IMPORTED_BIT),
/** @PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED: GEM BO is PRIME exported. */ PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED = BIT(PANTHOR_DEBUGFS_GEM_STATE_EXPORTED_BIT),
};
Quoted 16 lines
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 410
Quoted 1 line
drivers/gpu/drm/panthor/panthor_gem.c +1
-0+ [PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED] = "exported",Okay, I think I know where the flag indexing issue comes from:
PANTHOR_DEBUGFS_GEM_STATE_FLAG_xxare flags, not bit positions, so we can't use them as indices here.drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 415
Quoted 5 lines
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+ }; + +static const char *const gem_usage_flags_names[] = { + [PANTHOR_DEBUGFS_GEM_USAGE_FLAG_KERNEL ] ="kernel" , + [PANTHOR_DEBUGFS_GEM_USAGE_FLAG_FW_MAPPED ] ="fw-mapped" ,Same problem here.
Quoted 2 lines
(quoted diff) +2
-0+ }; +
Re: [PATCH v9 4/4] drm/panthor: show device-wide list of DRM GEM objects over DebugFS
On 18.04.2025 10:26, Boris Brezillon wrote:
Quoted 18 lines · On Fri, 18 Apr 2025 10:11:56 +0200 Boris Brezillon…
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 409
Quoted 2 lines · On Fri, 18 Apr 2025 03:27:07 +0100 Adrián Larumbe…
drivers/gpu/drm/panthor/panthor_gem.c +2
-0+static const char *const gem_state_flags_names[] = { + [PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED ] ="imported" ,FYI, the compiler seems to be happy with:
[
ffs(PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED)- 1] = "imported",but I'm not sure we want to fix it this way. The other option would be to define bit pos in the enum and then define flags according to these bit pos:
enum
panthor_debugfs_gem_state_flags{
PANTHOR_DEBUGFS_GEM_STATE_IMPORTED_BIT= 0,PANTHOR_DEBUGFS_GEM_STATE_EXPORTED_BIT= 1,
Quoted 6 lines
/** @PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED: GEM BO is PRIME imported. */
PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED=BIT(PANTHOR_DEBUGFS_GEM_STATE_IMPORTED_BIT),/** @PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED: GEM BO is PRIME exported. */
PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED=BIT(PANTHOR_DEBUGFS_GEM_STATE_EXPORTED_BIT),
};
I'm happy with this solution too. To be frank I thought of something like this when I realised flag names array indices an bit values were askew by one, but since the names array is constant and mostly meant to be read in the future by programmers who want to add new flag meanings to the same table, I didn't think of having a hole in index 0 as a problem.
Quoted 14 lines
drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 410
Quoted 1 line
drivers/gpu/drm/panthor/panthor_gem.c +1
-0+ [PANTHOR_DEBUGFS_GEM_STATE_FLAG_EXPORTED] = "exported",Okay, I think I know where the flag indexing issue comes from:
PANTHOR_DEBUGFS_GEM_STATE_FLAG_xxare flags, not bit positions, so we can't use them as indices here.drivers/gpu/drm/panthor/panthor_gem.c panthor_gem_kernel_bo_set_label(struct panthor_kernel_bo *bo, const char *label) · line 415
Quoted 5 lines
drivers/gpu/drm/panthor/panthor_gem.c +5
-0+ }; + +static const char *const gem_usage_flags_names[] = { + [PANTHOR_DEBUGFS_GEM_USAGE_FLAG_KERNEL ] ="kernel" , + [PANTHOR_DEBUGFS_GEM_USAGE_FLAG_FW_MAPPED ] ="fw-mapped" ,Same problem here.
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ }; +
Adrian Larumbe