* [linux-next:master 5501/13432] drivers/gpu/drm/tegra/nvdec.c:48:13: error: 'nvdec_writel' defined but not used
@ 2021-11-08 9:45 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-11-08 9:45 UTC (permalink / raw)
To: Mikko Perttunen; +Cc: kbuild-all, Linux Memory Management List, Thierry Reding
[-- Attachment #1: Type: text/plain, Size: 8130 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e844ee04dee0cf1b6d97183c12266c7726d73636
commit: e76599df354df9f0e919d97dfea80590c24d9abb [5501/13432] drm/tegra: Add NVDEC driver
config: arm-buildonly-randconfig-r006-20211031 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e76599df354df9f0e919d97dfea80590c24d9abb
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout e76599df354df9f0e919d97dfea80590c24d9abb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/tegra/nvdec.c:240:12: error: 'nvdec_runtime_resume' defined but not used [-Werror=unused-function]
240 | static int nvdec_runtime_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/tegra/nvdec.c:48:13: error: 'nvdec_writel' defined but not used [-Werror=unused-function]
48 | static void nvdec_writel(struct nvdec *nvdec, u32 value, unsigned int offset)
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/nvdec_writel +48 drivers/gpu/drm/tegra/nvdec.c
47
> 48 static void nvdec_writel(struct nvdec *nvdec, u32 value, unsigned int offset)
49 {
50 writel(value, nvdec->regs + offset);
51 }
52
53 static int nvdec_boot(struct nvdec *nvdec)
54 {
55 #ifdef CONFIG_IOMMU_API
56 struct iommu_fwspec *spec = dev_iommu_fwspec_get(nvdec->dev);
57 #endif
58 int err;
59
60 #ifdef CONFIG_IOMMU_API
61 if (nvdec->config->supports_sid && spec) {
62 u32 value;
63
64 value = TRANSCFG_ATT(1, TRANSCFG_SID_FALCON) | TRANSCFG_ATT(0, TRANSCFG_SID_HW);
65 nvdec_writel(nvdec, value, VIC_TFBIF_TRANSCFG);
66
67 if (spec->num_ids > 0) {
68 value = spec->ids[0] & 0xffff;
69
70 nvdec_writel(nvdec, value, VIC_THI_STREAMID0);
71 nvdec_writel(nvdec, value, VIC_THI_STREAMID1);
72 }
73 }
74 #endif
75
76 err = falcon_boot(&nvdec->falcon);
77 if (err < 0)
78 return err;
79
80 err = falcon_wait_idle(&nvdec->falcon);
81 if (err < 0) {
82 dev_err(nvdec->dev, "falcon boot timed out\n");
83 return err;
84 }
85
86 return 0;
87 }
88
89 static int nvdec_init(struct host1x_client *client)
90 {
91 struct tegra_drm_client *drm = host1x_to_drm_client(client);
92 struct drm_device *dev = dev_get_drvdata(client->host);
93 struct tegra_drm *tegra = dev->dev_private;
94 struct nvdec *nvdec = to_nvdec(drm);
95 int err;
96
97 err = host1x_client_iommu_attach(client);
98 if (err < 0 && err != -ENODEV) {
99 dev_err(nvdec->dev, "failed to attach to domain: %d\n", err);
100 return err;
101 }
102
103 nvdec->channel = host1x_channel_request(client);
104 if (!nvdec->channel) {
105 err = -ENOMEM;
106 goto detach;
107 }
108
109 client->syncpts[0] = host1x_syncpt_request(client, 0);
110 if (!client->syncpts[0]) {
111 err = -ENOMEM;
112 goto free_channel;
113 }
114
115 err = tegra_drm_register_client(tegra, drm);
116 if (err < 0)
117 goto free_syncpt;
118
119 /*
120 * Inherit the DMA parameters (such as maximum segment size) from the
121 * parent host1x device.
122 */
123 client->dev->dma_parms = client->host->dma_parms;
124
125 return 0;
126
127 free_syncpt:
128 host1x_syncpt_put(client->syncpts[0]);
129 free_channel:
130 host1x_channel_put(nvdec->channel);
131 detach:
132 host1x_client_iommu_detach(client);
133
134 return err;
135 }
136
137 static int nvdec_exit(struct host1x_client *client)
138 {
139 struct tegra_drm_client *drm = host1x_to_drm_client(client);
140 struct drm_device *dev = dev_get_drvdata(client->host);
141 struct tegra_drm *tegra = dev->dev_private;
142 struct nvdec *nvdec = to_nvdec(drm);
143 int err;
144
145 /* avoid a dangling pointer just in case this disappears */
146 client->dev->dma_parms = NULL;
147
148 err = tegra_drm_unregister_client(tegra, drm);
149 if (err < 0)
150 return err;
151
152 host1x_syncpt_put(client->syncpts[0]);
153 host1x_channel_put(nvdec->channel);
154 host1x_client_iommu_detach(client);
155
156 if (client->group) {
157 dma_unmap_single(nvdec->dev, nvdec->falcon.firmware.phys,
158 nvdec->falcon.firmware.size, DMA_TO_DEVICE);
159 tegra_drm_free(tegra, nvdec->falcon.firmware.size,
160 nvdec->falcon.firmware.virt,
161 nvdec->falcon.firmware.iova);
162 } else {
163 dma_free_coherent(nvdec->dev, nvdec->falcon.firmware.size,
164 nvdec->falcon.firmware.virt,
165 nvdec->falcon.firmware.iova);
166 }
167
168 return 0;
169 }
170
171 static const struct host1x_client_ops nvdec_client_ops = {
172 .init = nvdec_init,
173 .exit = nvdec_exit,
174 };
175
176 static int nvdec_load_firmware(struct nvdec *nvdec)
177 {
178 struct host1x_client *client = &nvdec->client.base;
179 struct tegra_drm *tegra = nvdec->client.drm;
180 dma_addr_t iova;
181 size_t size;
182 void *virt;
183 int err;
184
185 if (nvdec->falcon.firmware.virt)
186 return 0;
187
188 err = falcon_read_firmware(&nvdec->falcon, nvdec->config->firmware);
189 if (err < 0)
190 return err;
191
192 size = nvdec->falcon.firmware.size;
193
194 if (!client->group) {
195 virt = dma_alloc_coherent(nvdec->dev, size, &iova, GFP_KERNEL);
196
197 err = dma_mapping_error(nvdec->dev, iova);
198 if (err < 0)
199 return err;
200 } else {
201 virt = tegra_drm_alloc(tegra, size, &iova);
202 }
203
204 nvdec->falcon.firmware.virt = virt;
205 nvdec->falcon.firmware.iova = iova;
206
207 err = falcon_load_firmware(&nvdec->falcon);
208 if (err < 0)
209 goto cleanup;
210
211 /*
212 * In this case we have received an IOVA from the shared domain, so we
213 * need to make sure to get the physical address so that the DMA API
214 * knows what memory pages to flush the cache for.
215 */
216 if (client->group) {
217 dma_addr_t phys;
218
219 phys = dma_map_single(nvdec->dev, virt, size, DMA_TO_DEVICE);
220
221 err = dma_mapping_error(nvdec->dev, phys);
222 if (err < 0)
223 goto cleanup;
224
225 nvdec->falcon.firmware.phys = phys;
226 }
227
228 return 0;
229
230 cleanup:
231 if (!client->group)
232 dma_free_coherent(nvdec->dev, size, virt, iova);
233 else
234 tegra_drm_free(tegra, size, virt, iova);
235
236 return err;
237 }
238
239
> 240 static int nvdec_runtime_resume(struct device *dev)
241 {
242 struct nvdec *nvdec = dev_get_drvdata(dev);
243 int err;
244
245 err = clk_prepare_enable(nvdec->clk);
246 if (err < 0)
247 return err;
248
249 usleep_range(10, 20);
250
251 err = nvdec_load_firmware(nvdec);
252 if (err < 0)
253 goto disable;
254
255 err = nvdec_boot(nvdec);
256 if (err < 0)
257 goto disable;
258
259 return 0;
260
261 disable:
262 clk_disable_unprepare(nvdec->clk);
263 return err;
264 }
265
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 44477 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-08 9:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 9:45 [linux-next:master 5501/13432] drivers/gpu/drm/tegra/nvdec.c:48:13: error: 'nvdec_writel' defined but not used kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox