drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:2112: warning: cannot understand function prototype: 'struct rpc_ucode_libos_print_v1e_08 '
From: kernel test robot
Date: Fri Jan 31 2025 - 01:44:46 EST
Hi Timur,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 69e858e0b8b2ea07759e995aa383e8780d9d140c
commit: 214c9539cf2f5a0116051dc8e2a36b0577383a5e drm/nouveau: expose GSP-RM logging buffers via debugfs
date: 8 weeks ago
config: alpha-randconfig-r026-20211101 (https://download.01.org/0day-ci/archive/20250131/202501311431.Od7RxfB4-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250131/202501311431.Od7RxfB4-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501311431.Od7RxfB4-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1136: warning: cannot understand function prototype: 'struct registry_list_entry '
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1340: warning: cannot understand function prototype: 'const struct nv_gsp_registry_entries r535_registry_entries[] = '
>> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:2112: warning: cannot understand function prototype: 'struct rpc_ucode_libos_print_v1e_08 '
>> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:2174: warning: expecting prototype for create_debufgs(). Prototype was for create_debugfs() instead
>> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:2800: warning: Function parameter or struct member 'parent' not described in 'r535_gsp_copy_log'
>> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:2800: warning: Function parameter or struct member 'name' not described in 'r535_gsp_copy_log'
>> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:2800: warning: Function parameter or struct member 's' not described in 'r535_gsp_copy_log'
>> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:2800: warning: Function parameter or struct member 't' not described in 'r535_gsp_copy_log'
--
>> drivers/gpu/drm/nouveau/nouveau_drm.c:129: warning: Function parameter or struct member 'gsp_logs' not described in 'NVIF_LOGS_DECLARE'
>> drivers/gpu/drm/nouveau/nouveau_drm.c:129: warning: expecting prototype for gsp_logs(). Prototype was for NVIF_LOGS_DECLARE() instead
vim +2112 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
2102
2103 /**
2104 * rpc_ucode_libos_print_v1E_08 - RPC payload for libos print buffers
2105 * @ucode_eng_desc: the engine descriptor
2106 * @libos_print_buf_size: the size of the libos_print_buf[]
2107 * @libos_print_buf: the actual buffer
2108 *
2109 * The engine descriptor is divided into 31:8 "class ID" and 7:0 "instance
2110 * ID". We only care about messages from PMU.
2111 */
> 2112 struct rpc_ucode_libos_print_v1e_08 {
2113 u32 ucode_eng_desc;
2114 u32 libos_print_buf_size;
2115 u8 libos_print_buf[];
2116 };
2117
2118 /**
2119 * r535_gsp_msg_libos_print - capture log message from the PMU
2120 * @priv: gsp pointer
2121 * @fn: function number (ignored)
2122 * @repv: pointer to libos print RPC
2123 * @repc: message size
2124 *
2125 * Called when we receive a UCODE_LIBOS_PRINT event RPC from GSP-RM. This RPC
2126 * contains the contents of the libos print buffer from PMU. It is typically
2127 * only written to when PMU encounters an error.
2128 *
2129 * Technically this RPC can be used to pass print buffers from any number of
2130 * GSP-RM engines, but we only expect to receive them for the PMU.
2131 *
2132 * For the PMU, the buffer is 4K in size and the RPC always contains the full
2133 * contents.
2134 */
2135 static int
2136 r535_gsp_msg_libos_print(void *priv, u32 fn, void *repv, u32 repc)
2137 {
2138 struct nvkm_gsp *gsp = priv;
2139 struct nvkm_subdev *subdev = &gsp->subdev;
2140 struct rpc_ucode_libos_print_v1e_08 *rpc = repv;
2141 unsigned int class = rpc->ucode_eng_desc >> 8;
2142
2143 nvkm_debug(subdev, "received libos print from class 0x%x for %u bytes\n",
2144 class, rpc->libos_print_buf_size);
2145
2146 if (class != NV_GSP_MSG_EVENT_UCODE_LIBOS_CLASS_PMU) {
2147 nvkm_warn(subdev,
2148 "received libos print from unknown class 0x%x\n",
2149 class);
2150 return -ENOMSG;
2151 }
2152
2153 if (rpc->libos_print_buf_size > GSP_PAGE_SIZE) {
2154 nvkm_error(subdev, "libos print is too large (%u bytes)\n",
2155 rpc->libos_print_buf_size);
2156 return -E2BIG;
2157 }
2158
2159 memcpy(gsp->blob_pmu.data, rpc->libos_print_buf, rpc->libos_print_buf_size);
2160
2161 return 0;
2162 }
2163
2164 /**
2165 * create_debufgs - create a blob debugfs entry
2166 * @gsp: gsp pointer
2167 * @name: name of this dentry
2168 * @blob: blob wrapper
2169 *
2170 * Creates a debugfs entry for a logging buffer with the name 'name'.
2171 */
2172 static struct dentry *create_debugfs(struct nvkm_gsp *gsp, const char *name,
2173 struct debugfs_blob_wrapper *blob)
> 2174 {
2175 struct dentry *dent;
2176
2177 dent = debugfs_create_blob(name, 0444, gsp->debugfs.parent, blob);
2178 if (IS_ERR(dent)) {
2179 nvkm_error(&gsp->subdev,
2180 "failed to create %s debugfs entry\n", name);
2181 return NULL;
2182 }
2183
2184 /*
2185 * For some reason, debugfs_create_blob doesn't set the size of the
2186 * dentry, so do that here. See [1]
2187 *
2188 * [1] https://lore.kernel.org/r/linux-fsdevel/20240207200619.3354549-1-ttabi@xxxxxxxxxx/
2189 */
2190 i_size_write(d_inode(dent), blob->size);
2191
2192 return dent;
2193 }
2194
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki