* drivers/dma-buf/dma-fence.c:1112:51: sparse: sparse: incorrect type in return expression (different address spaces)
@ 2026-01-16 17:22 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-01-16 17:22 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: oe-kbuild-all, linux-kernel, Christian König
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 983d014aafb14ee5e4915465bf8948e8f3a723b5
commit: 506aa8b02a8d6898c64cc095d233fbae1cef8b8a dma-fence: Add safe access helpers and document the rules
date: 7 months ago
config: i386-randconfig-063-20260116 (https://download.01.org/0day-ci/archive/20260117/202601170112.FVBMyjX0-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260117/202601170112.FVBMyjX0-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601170112.FVBMyjX0-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/dma-buf/dma-fence.c:1112:51: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected char const [noderef] __rcu * @@ got char const * @@
drivers/dma-buf/dma-fence.c:1112:51: sparse: expected char const [noderef] __rcu *
drivers/dma-buf/dma-fence.c:1112:51: sparse: got char const *
drivers/dma-buf/dma-fence.c:1114:24: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected char const [noderef] __rcu * @@ got char * @@
drivers/dma-buf/dma-fence.c:1114:24: sparse: expected char const [noderef] __rcu *
drivers/dma-buf/dma-fence.c:1114:24: sparse: got char *
drivers/dma-buf/dma-fence.c:1144:51: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected char const [noderef] __rcu * @@ got char const * @@
drivers/dma-buf/dma-fence.c:1144:51: sparse: expected char const [noderef] __rcu *
drivers/dma-buf/dma-fence.c:1144:51: sparse: got char const *
drivers/dma-buf/dma-fence.c:1146:24: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected char const [noderef] __rcu * @@ got char * @@
drivers/dma-buf/dma-fence.c:1146:24: sparse: expected char const [noderef] __rcu *
drivers/dma-buf/dma-fence.c:1146:24: sparse: got char *
drivers/dma-buf/dma-fence.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/dma_fence.h):
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void const *driver_ptr_ @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected void const *driver_ptr_
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void const *timeline_ptr_ @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected void const *timeline_ptr_
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void const *driver_ptr_ @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected void const *driver_ptr_
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *str @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected char const *str
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
include/trace/events/dma_fence.h:12:1: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void const *timeline_ptr_ @@ got char const [noderef] __rcu * @@
include/trace/events/dma_fence.h:12:1: sparse: expected void const *timeline_ptr_
include/trace/events/dma_fence.h:12:1: sparse: got char const [noderef] __rcu *
vim +1112 drivers/dma-buf/dma-fence.c
1085
1086 /**
1087 * dma_fence_driver_name - Access the driver name
1088 * @fence: the fence to query
1089 *
1090 * Returns a driver name backing the dma-fence implementation.
1091 *
1092 * IMPORTANT CONSIDERATION:
1093 * Dma-fence contract stipulates that access to driver provided data (data not
1094 * directly embedded into the object itself), such as the &dma_fence.lock and
1095 * memory potentially accessed by the &dma_fence.ops functions, is forbidden
1096 * after the fence has been signalled. Drivers are allowed to free that data,
1097 * and some do.
1098 *
1099 * To allow safe access drivers are mandated to guarantee a RCU grace period
1100 * between signalling the fence and freeing said data.
1101 *
1102 * As such access to the driver name is only valid inside a RCU locked section.
1103 * The pointer MUST be both queried and USED ONLY WITHIN a SINGLE block guarded
1104 * by the &rcu_read_lock and &rcu_read_unlock pair.
1105 */
1106 const char __rcu *dma_fence_driver_name(struct dma_fence *fence)
1107 {
1108 RCU_LOCKDEP_WARN(!rcu_read_lock_held(),
1109 "RCU protection is required for safe access to returned string");
1110
1111 if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
> 1112 return fence->ops->get_driver_name(fence);
1113 else
1114 return "detached-driver";
1115 }
1116 EXPORT_SYMBOL(dma_fence_driver_name);
1117
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-16 17:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 17:22 drivers/dma-buf/dma-fence.c:1112:51: sparse: sparse: incorrect type in return expression (different address spaces) kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.