Hi Moudy,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on media-tree/master]
[also build test ERROR on robh/for-next linus/master v5.15-rc6]
[cannot apply to mbgg-mediatek/for-next next-20211022]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Moudy-Ho/media-mediatek-support-...
base:
git://linuxtv.org/media_tree.git master
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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://github.com/0day-ci/linux/commit/6714c533b8b6f1c7484244d7bd155c386...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Moudy-Ho/media-mediatek-support-mdp3-on-mt8183-platform/20211015-203943
git checkout 6714c533b8b6f1c7484244d7bd155c386681a67a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/vdso/const.h:5,
from include/linux/const.h:4,
from include/linux/list.h:8,
from include/linux/mutex.h:15,
from include/linux/remoteproc.h:39,
from drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:7:
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c: In function
'mdp_vpu_dev_init':
> drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:180:22: error:
cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
180 | pool = ALIGN((phys_addr_t)vpu->work + vpu->work_size, 8);
| ^
include/uapi/linux/const.h:32:44: note: in definition of macro
'__ALIGN_KERNEL_MASK'
32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
| ^
include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL'
8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
| ^~~~~~~~~~~~~~
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:180:16: note: in expansion of macro
'ALIGN'
180 | pool = ALIGN((phys_addr_t)vpu->work + vpu->work_size, 8);
| ^~~~~
> drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:180:22: error:
cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
180 | pool = ALIGN((phys_addr_t)vpu->work + vpu->work_size, 8);
| ^
include/uapi/linux/const.h:32:50: note: in definition of macro
'__ALIGN_KERNEL_MASK'
32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
| ^~~~
include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL'
8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
| ^~~~~~~~~~~~~~
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:180:16: note: in expansion of macro
'ALIGN'
180 | pool = ALIGN((phys_addr_t)vpu->work + vpu->work_size, 8);
| ^~~~~
> drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:180:22: error:
cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
180 | pool = ALIGN((phys_addr_t)vpu->work + vpu->work_size, 8);
| ^
include/uapi/linux/const.h:32:61: note: in definition of macro
'__ALIGN_KERNEL_MASK'
32 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
| ^~~~
include/linux/align.h:8:33: note: in expansion of macro '__ALIGN_KERNEL'
8 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
| ^~~~~~~~~~~~~~
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:180:16: note: in expansion of macro
'ALIGN'
180 | pool = ALIGN((phys_addr_t)vpu->work + vpu->work_size, 8);
| ^~~~~
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:181:32: error: cast from pointer to
integer of different size [-Werror=pointer-to-int-cast]
181 | if (pool + pool_size - (phys_addr_t)vpu->work > mem_size) {
| ^
> drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:193:21: error:
cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
193 | vpu->pool = (struct mdp_config_pool *)pool;
| ^
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c: In function 'mdp_config_get':
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:240:42: error: cast from pointer to
integer of different size [-Werror=pointer-to-int-cast]
240 | ((unsigned long)config - (phys_addr_t)vpu->work);
| ^
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c: In function 'mdp_vpu_process':
drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c:310:19: error: cast from pointer to
integer of different size [-Werror=pointer-to-int-cast]
310 | addr.va = (phys_addr_t)ctx->vpu_dev->work;
| ^
cc1: all warnings being treated as errors
vim +180 drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c
152
153 int mdp_vpu_dev_init(struct mdp_vpu_dev *vpu, struct mtk_scp *scp,
154 struct mutex *lock)
155 {
156 struct mdp_ipi_init_msg msg = {
157 .drv_data = (unsigned long)vpu,
158 };
159 size_t mem_size;
160 phys_addr_t pool;
161 const size_t pool_size = sizeof(struct mdp_config_pool);
162 struct mdp_dev *mdp = vpu_to_mdp(vpu);
163 int err;
164
165 init_completion(&vpu->ipi_acked);
166 vpu->scp = scp;
167 vpu->lock = lock;
168 vpu->work_size = 0;
169 err = mdp_vpu_sendmsg(vpu, SCP_IPI_MDP_INIT, &msg, sizeof(msg));
170 if (err)
171 goto err_work_size;
172 /* vpu work_size was set in mdp_vpu_ipi_handle_init_ack */
173
174 mem_size = vpu_alloc_size;
175 if (mdp_vpu_shared_mem_alloc(vpu)) {
176 dev_err(&mdp->pdev->dev, "VPU memory alloc fail!");
177 goto err_mem_alloc;
178 }
179
180 pool = ALIGN((phys_addr_t)vpu->work + vpu->work_size, 8);
181 if (pool + pool_size - (phys_addr_t)vpu->work > mem_size) {
182 dev_err(&mdp->pdev->dev,
183 "VPU memory insufficient: %zx + %zx > %zx",
184 vpu->work_size, pool_size, mem_size);
185 err = -ENOMEM;
186 goto err_mem_size;
187 }
188
189 dev_dbg(&mdp->pdev->dev,
190 "VPU work:%pK pa:%pad sz:%zx pool:%pa sz:%zx (mem sz:%zx)",
191 vpu->work, &vpu->work_addr, vpu->work_size,
192 &pool, pool_size, mem_size);
193 vpu->pool = (struct mdp_config_pool *)pool;
194 msg.work_addr = vpu->work_addr;
195 msg.work_size = vpu->work_size;
196 err = mdp_vpu_sendmsg(vpu, SCP_IPI_MDP_INIT, &msg, sizeof(msg));
197 if (err)
198 goto err_work_size;
199
200 memset(vpu->pool, 0, sizeof(*vpu->pool));
201 return 0;
202
203 err_work_size:
204 switch (vpu->status) {
205 case -MDP_IPI_EBUSY:
206 err = -EBUSY;
207 break;
208 case -MDP_IPI_ENOMEM:
209 err = -ENOSPC; /* -ENOMEM */
210 break;
211 }
212 return err;
213 err_mem_size:
214 err_mem_alloc:
215 return err;
216 }
217
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org