CC: [email protected]
TO: [email protected]
TO: Guenter Roeck <[email protected]>

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel 
chromeos-5.10
head:   26a3cf7b7d542f4ff85e2855ab69140bff097a50
commit: ed87340a6d1e040dd01d1d1ae1a12f1a7e504559 [7805/9999] CHROMIUM: media: 
mtk-vcodec: Add vp9 slice api driver for mt8192
:::::: branch date: 3 days ago
:::::: commit date: 10 weeks ago
config: arm-randconfig-c002-20220120 
(https://download.01.org/0day-ci/archive/20220125/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
7b3d30728816403d1fd73cc5082e9fb761262bce)
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
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        git remote add chrome-os 
https://chromium.googlesource.com/chromiumos/third_party/kernel
        git fetch --no-tags chrome-os chromeos-5.10
        git checkout ed87340a6d1e040dd01d1d1ae1a12f1a7e504559
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
           for (; rl[1].length; rl++)
           ^
   fs/ntfs/mft.c:1817:6: note: Calling 'IS_ERR'
           if (IS_ERR(mrec)) {
               ^~~~~~~~~~~~
   include/linux/err.h:36:2: note: Returning the value 1, which participates in 
a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs/mft.c:1817:6: note: Returning from 'IS_ERR'
           if (IS_ERR(mrec)) {
               ^~~~~~~~~~~~
   fs/ntfs/mft.c:1817:2: note: Taking true branch
           if (IS_ERR(mrec)) {
           ^
   fs/ntfs/mft.c:1820:3: note: Control jumps to line 1953
                   goto undo_alloc;
                   ^
   fs/ntfs/mft.c:1953:6: note: Assuming the condition is false
           if (ntfs_cluster_free(mft_ni, old_last_vcn, -1, ctx) < 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ntfs/mft.c:1953:2: note: Taking false branch
           if (ntfs_cluster_free(mft_ni, old_last_vcn, -1, ctx) < 0) {
           ^
   fs/ntfs/mft.c:1958:6: note: Access to field 'attr' results in a dereference 
of a null pointer (loaded from variable 'ctx')
           a = ctx->attr;
               ^~~
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   drivers/clk/sprd/pll.c:200:2: warning: Value stored to 'width' is never read 
[clang-analyzer-deadcode.DeadStores]
           width = pwidth(pll, PLL_KINT);
           ^
   drivers/clk/sprd/pll.c:200:2: note: Value stored to 'width' is never read
   3 warnings generated.
   Suppressed 3 warnings (3 with check filters).
   2 warnings generated.
   drivers/dax/bus.c:827:7: warning: Value stored to 'is_shrink' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           bool is_shrink = resource_size(res) > size;
                ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/dax/bus.c:827:7: note: Value stored to 'is_shrink' during its 
initialization is never read
           bool is_shrink = resource_size(res) > size;
                ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/dax/bus.c:1117:17: warning: Value stored to 'dev' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &dev_dax->dev;
                          ^~~   ~~~~~~~~~~~~~
   drivers/dax/bus.c:1117:17: note: Value stored to 'dev' during its 
initialization is never read
           struct device *dev = &dev_dax->dev;
                          ^~~   ~~~~~~~~~~~~~
   3 warnings generated.
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:523:3: warning: 
Access to field 'id' results in a dereference of a null pointer (loaded from 
field 'ctx') [clang-analyzer-core.NullDereference]
                   mtk_vcodec_err(instance, "invalid ctx or vsi 0x%px 0x%px\n",
                   ^
   drivers/media/platform/mtk-vcodec/vdec/../mtk_vcodec_util.h:38:9: note: 
expanded from macro 'mtk_vcodec_err'
                  ((struct mtk_vcodec_ctx *)h->ctx)->id, __func__, ##args)
                  ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1750:6: note: 
Assuming 'instance' is non-null
           if (!instance)
               ^~~~~~~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1750:2: note: 
Taking false branch
           if (!instance)
           ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1759:8: note: 
Value assigned to field 'ctx'
           ret = vpu_dec_init(&instance->vpu);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1760:6: note: 
Assuming 'ret' is 0
           if (ret) {
               ^~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1760:2: note: 
Taking false branch
           if (ret) {
           ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1769:6: note: 
Assuming 'vsi' is non-null
           if (!vsi) {
               ^~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1769:2: note: 
Taking false branch
           if (!vsi) {
           ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1777:6: note: 
Assuming field 'core_vsi' is non-null
           if (!instance->core_vsi) {
               ^~~~~~~~~~~~~~~~~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1777:2: note: 
Taking false branch
           if (!instance->core_vsi) {
           ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:1788:8: note: 
Calling 'vdec_vp9_slice_init_default_frame_ctx'
           ret = vdec_vp9_slice_init_default_frame_ctx(instance);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:522:6: note: 
Assuming 'ctx' is null
           if (!ctx || !vsi) {
               ^~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:522:11: note: 
Left side of '||' is true
           if (!ctx || !vsi) {
                    ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:523:3: note: 
Access to field 'id' results in a dereference of a null pointer (loaded from 
field 'ctx')
                   mtk_vcodec_err(instance, "invalid ctx or vsi 0x%px 0x%px\n",
                   ^
   drivers/media/platform/mtk-vcodec/vdec/../mtk_vcodec_util.h:38:9: note: 
expanded from macro 'mtk_vcodec_err'
                  ((struct mtk_vcodec_ctx *)h->ctx)->id, __func__, ##args)
                  ^                            ~~~
   include/linux/printk.h:343:33: note: expanded from macro 'pr_err'
           printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
                                          ^~~~~~~~~~~
>> drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2068:4: 
>> warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
                           pfc->vsi.trans.dma_addr_end);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2005:6: note: 
Assuming 'lat_buf' is non-null
           if (!lat_buf)
               ^~~~~~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2005:2: note: 
Taking false branch
           if (!lat_buf)
           ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2008:2: note: 
Value assigned to 'pfc'
           pfc = lat_buf->private_data;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2010:6: note: 
Assuming 'pfc' is null
           if (!pfc || !ctx)
               ^~~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2010:11: note: 
Left side of '||' is true
           if (!pfc || !ctx)
                    ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2011:3: note: 
Control jumps to line 2065
                   goto err;
                   ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2065:6: note: 
Assuming 'ctx' is non-null
           if (ctx) {
               ^~~
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2065:2: note: 
Taking true branch
           if (ctx) {
           ^
   drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c:2068:4: note: 
Dereference of null pointer
                           pfc->vsi.trans.dma_addr_end);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   lib/math/reciprocal_div.c:48:14: warning: The result of the left shift is 
undefined due to shifting by '64', which is greater or equal to the width of 
type 'unsigned long long' [clang-analyzer-core.UndefinedBinaryOperatorResult]
           mlow = 1ULL << (32 + l);
                       ^  ~~~~~~~~
   lib/math/reciprocal_div.c:44:7: note: Assuming 'l' is equal to 32
           WARN(l == 32,
                ^
   include/asm-generic/bug.h:128:25: note: expanded from macro 'WARN'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   lib/math/reciprocal_div.c:44:2: note: Taking true branch
           WARN(l == 32,
           ^
   include/asm-generic/bug.h:129:2: note: expanded from macro 'WARN'
           if (unlikely(__ret_warn_on))                                    \
           ^
   lib/math/reciprocal_div.c:44:2: note: Loop condition is false.  Exiting loop
           WARN(l == 32,
           ^
   include/asm-generic/bug.h:130:3: note: expanded from macro 'WARN'
                   __WARN_printf(TAINT_WARN, format);                      \
                   ^
   include/asm-generic/bug.h:88:3: note: expanded from macro '__WARN_printf'
                   instrumentation_begin();                                \
                   ^
   include/linux/instrumentation.h:53:34: note: expanded from macro 
'instrumentation_begin'
   # define instrumentation_begin()        do { } while(0)
                                           ^
   lib/math/reciprocal_div.c:44:2: note: Loop condition is false.  Exiting loop
           WARN(l == 32,
           ^
   include/asm-generic/bug.h:130:3: note: expanded from macro 'WARN'
                   __WARN_printf(TAINT_WARN, format);                      \
                   ^
   include/asm-generic/bug.h:90:3: note: expanded from macro '__WARN_printf'
                   instrumentation_end();                                  \
                   ^
   include/linux/instrumentation.h:54:33: note: expanded from macro 
'instrumentation_end'
   # define instrumentation_end()          do { } while(0)
                                           ^
   lib/math/reciprocal_div.c:44:2: note: Loop condition is false.  Exiting loop
           WARN(l == 32,
           ^
   include/asm-generic/bug.h:130:3: note: expanded from macro 'WARN'
                   __WARN_printf(TAINT_WARN, format);                      \
                   ^
   include/asm-generic/bug.h:87:38: note: expanded from macro '__WARN_printf'
   #define __WARN_printf(taint, arg...) do {                               \
                                        ^
   lib/math/reciprocal_div.c:48:14: note: The result of the left shift is 
undefined due to shifting by '64', which is greater or equal to the width of 
type 'unsigned long long'
           mlow = 1ULL << (32 + l);
                       ^  ~~~~~~~~
   2 warnings generated.
   drivers/clk/clk.c:423:19: warning: Value stored to 'parent' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct clk_core *parent = ERR_PTR(-ENOENT);
                            ^~~~~~   ~~~~~~~~~~~~~~~~
   drivers/clk/clk.c:423:19: note: Value stored to 'parent' during its 
initialization is never read
           struct clk_core *parent = ERR_PTR(-ENOENT);
                            ^~~~~~   ~~~~~~~~~~~~~~~~
   drivers/clk/clk.c:1930:3: warning: Value stored to 'best_parent_rate' is 
never read [clang-analyzer-deadcode.DeadStores]
                   best_parent_rate = parent->rate;
                   ^                  ~~~~~~~~~~~~
   drivers/clk/clk.c:1930:3: note: Value stored to 'best_parent_rate' is never 
read
                   best_parent_rate = parent->rate;
                   ^                  ~~~~~~~~~~~~
   2 warnings generated.
   drivers/clk/clk-divider.c:330:9: warning: Division by zero 
[clang-analyzer-core.DivideZero]
                   now = DIV_ROUND_UP_ULL((u64)parent_rate, i);
                         ^
   include/linux/kernel.h:91:2: note: expanded from macro 'DIV_ROUND_UP_ULL'

vim +2068 drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_req_lat_if.c

ed87340a6d1e04 Yunfei Dong 2021-01-21  1995  
ed87340a6d1e04 Yunfei Dong 2021-01-21  1996  static int 
vdec_vp9_slice_core_decode(
ed87340a6d1e04 Yunfei Dong 2021-01-21  1997     struct vdec_lat_buf *lat_buf)
ed87340a6d1e04 Yunfei Dong 2021-01-21  1998  {
ed87340a6d1e04 Yunfei Dong 2021-01-21  1999     struct vdec_vp9_slice_instance 
*instance;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2000     struct vdec_vp9_slice_pfc *pfc;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2001     struct mtk_vcodec_ctx *ctx = 
NULL;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2002     struct vdec_fb *fb = NULL;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2003     int ret = -EINVAL;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2004  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2005     if (!lat_buf)
ed87340a6d1e04 Yunfei Dong 2021-01-21  2006             goto err;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2007  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2008     pfc = lat_buf->private_data;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2009     ctx = lat_buf->ctx;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2010     if (!pfc || !ctx)
ed87340a6d1e04 Yunfei Dong 2021-01-21  2011             goto err;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2012  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2013     instance = ctx->drv_handle;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2014     if (!instance)
ed87340a6d1e04 Yunfei Dong 2021-01-21  2015             goto err;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2016  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2017     fb = 
ctx->dev->vdec_pdata->get_cap_buffer(ctx);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2018     if (!fb) {
ed87340a6d1e04 Yunfei Dong 2021-01-21  2019             ret = -EBUSY;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2020             goto err;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2021     }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2022  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2023     ret = 
vdec_vp9_slice_setup_core(instance, fb, lat_buf, pfc);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2024     if (ret) {
ed87340a6d1e04 Yunfei Dong 2021-01-21  2025             
mtk_vcodec_err(instance, "vdec_vp9_slice_setup_core\n");
ed87340a6d1e04 Yunfei Dong 2021-01-21  2026             goto err;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2027     }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2028     
vdec_vp9_slice_vsi_to_remote(&pfc->vsi, instance->core_vsi);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2029  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2030     ret = 
vpu_dec_core(&instance->vpu);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2031     if (ret) {
ed87340a6d1e04 Yunfei Dong 2021-01-21  2032             
mtk_vcodec_err(instance, "vpu_dec_core\n");
ed87340a6d1e04 Yunfei Dong 2021-01-21  2033             goto err;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2034     }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2035  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2036     if (instance->irq) {
ed87340a6d1e04 Yunfei Dong 2021-01-21  2037             ret = 
mtk_vcodec_wait_for_comp_done_ctx(ctx,
ed87340a6d1e04 Yunfei Dong 2021-01-21  2038                     
MTK_INST_IRQ_RECEIVED,
ed87340a6d1e04 Yunfei Dong 2021-01-21  2039                     
WAIT_INTR_TIMEOUT_MS, MTK_VDEC_CORE);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2040             /* update remote vsi if 
decode timeout */
ed87340a6d1e04 Yunfei Dong 2021-01-21  2041             if (ret) {
ed87340a6d1e04 Yunfei Dong 2021-01-21  2042                     
mtk_vcodec_err(instance, "VP9 core timeout\n");
ed87340a6d1e04 Yunfei Dong 2021-01-21  2043                     writel(1, 
&instance->core_vsi->state.timeout);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2044             }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2045             
vpu_dec_core_end(&instance->vpu);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2046     }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2047  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2048     
vdec_vp9_slice_vsi_from_remote(&pfc->vsi, instance->core_vsi, 1);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2049     ret = 
vdec_vp9_slice_update_core(instance, lat_buf, pfc);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2050     if (ret) {
ed87340a6d1e04 Yunfei Dong 2021-01-21  2051             
mtk_vcodec_err(instance, "vdec_vp9_slice_update_core\n");
ed87340a6d1e04 Yunfei Dong 2021-01-21  2052             goto err;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2053     }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2054  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2055     pfc->vsi.trans.dma_addr_end += 
ctx->msg_queue.wdma_addr.dma_addr;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2056     mtk_vcodec_debug(instance, 
"core dma_addr_end 0x%llx\n",
ed87340a6d1e04 Yunfei Dong 2021-01-21  2057             
pfc->vsi.trans.dma_addr_end);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2058     
vdec_msg_queue_update_ube_rptr(&ctx->msg_queue,
ed87340a6d1e04 Yunfei Dong 2021-01-21  2059             
pfc->vsi.trans.dma_addr_end);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2060     
ctx->dev->vdec_pdata->cap_to_disp(ctx, fb, 0);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2061  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2062     return 0;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2063  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2064  err:
ed87340a6d1e04 Yunfei Dong 2021-01-21  2065     if (ctx) {
ed87340a6d1e04 Yunfei Dong 2021-01-21  2066             /* always update read 
pointer */
ed87340a6d1e04 Yunfei Dong 2021-01-21  2067             
vdec_msg_queue_update_ube_rptr(&ctx->msg_queue,
ed87340a6d1e04 Yunfei Dong 2021-01-21 @2068                     
pfc->vsi.trans.dma_addr_end);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2069  
ed87340a6d1e04 Yunfei Dong 2021-01-21  2070             if (fb)
ed87340a6d1e04 Yunfei Dong 2021-01-21  2071                     
ctx->dev->vdec_pdata->cap_to_disp(ctx, fb, 1);
ed87340a6d1e04 Yunfei Dong 2021-01-21  2072     }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2073     return ret;
ed87340a6d1e04 Yunfei Dong 2021-01-21  2074  }
ed87340a6d1e04 Yunfei Dong 2021-01-21  2075  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to