CC: [email protected]
CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Matthew Auld <[email protected]>
TO: [email protected]
CC: [email protected]
CC: "Thomas Hellström" <[email protected]>

Hi Matthew,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on next-20211012]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next 
tegra-drm/drm/tegra/for-next airlied/drm-next v5.15-rc5]
[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/Matthew-Auld/drm-i915-gem-Break-out-some-shmem-backend-utils/20211011-230443
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-c001-20211012 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
c3dcf39554dbea780d6cb7e12239451ba47a2668)
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/43578548b98c603bc1bd2840b3e50bfde8bf0772
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Matthew-Auld/drm-i915-gem-Break-out-some-shmem-backend-utils/20211011-230443
        git checkout 43578548b98c603bc1bd2840b3e50bfde8bf0772
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 
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 >>)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/i2c-core-smbus.c:541:6: note: Assuming 'res' is not equal to 0
           if (res)
               ^~~
   drivers/i2c/i2c-core-smbus.c:541:2: note: Taking true branch
           if (res)
           ^
   drivers/i2c/i2c-core-smbus.c:542:3: note: Returning without writing to 
'data->word'
                   return res;
                   ^
   drivers/i2c/i2c-core-smbus.c:181:11: note: Returning from 'i2c_smbus_xfer'
           status = i2c_smbus_xfer(client->adapter, client->addr, client->flags,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/i2c-core-smbus.c:184:10: note: Assuming 'status' is >= 0
           return (status < 0) ? status : data.word;
                   ^~~~~~~~~~
   drivers/i2c/i2c-core-smbus.c:184:9: note: '?' condition is false
           return (status < 0) ? status : data.word;
                  ^
   drivers/i2c/i2c-core-smbus.c:184:2: note: Undefined or garbage value 
returned to caller
           return (status < 0) ? status : data.word;
           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 9 warnings (9 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   10 warnings generated.
   drivers/input/touchscreen/elants_i2c.c:137:8: warning: Excessive padding in 
'struct elants_data' (40 padding bytes, where 8 is optimal). 
   Optimal fields order: 
   buf, 
   test_version, 
   fw_version, 
   client, 
   input, 
   vcc33, 
   vccio, 
   reset_gpio, 
   x_res, 
   y_res, 
   x_max, 
   y_max, 
   phy_x, 
   phy_y, 
   state, 
   chip_id, 
   iap_mode, 
   prop, 
   cmd_done, 
   sysfs_mutex, 
   hw_version, 
   solution_version, 
   bc_version, 
   iap_version, 
   major_res, 
   wake_irq_enabled, 
   keep_power_in_suspend, 
   cmd_resp, 
   consider reordering the fields or adding explicit padding members 
[clang-analyzer-optin.performance.Padding]
   struct elants_data {
   ~~~~~~~^~~~~~~~~~~~~
   drivers/input/touchscreen/elants_i2c.c:137:8: note: Excessive padding in 
'struct elants_data' (40 padding bytes, where 8 is optimal). Optimal fields 
order: buf, test_version, fw_version, client, input, vcc33, vccio, reset_gpio, 
x_res, y_res, x_max, y_max, phy_x, phy_y, state, chip_id, iap_mode, prop, 
cmd_done, sysfs_mutex, hw_version, solution_version, bc_version, iap_version, 
major_res, wake_irq_enabled, keep_power_in_suspend, cmd_resp, consider 
reordering the fields or adding explicit padding members
   struct elants_data {
   ~~~~~~~^~~~~~~~~~~~~
   Suppressed 9 warnings (9 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   10 warnings generated.
   drivers/input/touchscreen/max11801_ts.c:107:3: warning: Value stored to 
'status' is never read [clang-analyzer-deadcode.DeadStores]
                   status = read_register(data->client, GENERNAL_STATUS_REG);
                   ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/input/touchscreen/max11801_ts.c:107:3: note: Value stored to 
'status' is never read
                   status = read_register(data->client, GENERNAL_STATUS_REG);
                   ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   10 warnings generated.
>> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:865:23: warning: Value stored to 
>> 'i915_tt' during its initialization is never read 
>> [clang-analyzer-deadcode.DeadStores]
                   struct i915_ttm_tt *i915_tt =
                                       ^~~~~~~
   drivers/gpu/drm/i915/gem/i915_gem_ttm.c:865:23: note: Value stored to 
'i915_tt' during its initialization is never read
                   struct i915_ttm_tt *i915_tt =
                                       ^~~~~~~
   Suppressed 9 warnings (9 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.
   10 warnings generated.
   drivers/gpu/drm/i915/gem/i915_gem_object.h:194:17: warning: Access to field 
'contended' results in a dereference of a null pointer (loaded from variable 
'ww') [clang-analyzer-core.NullDereference]
                   ww->contended = obj;
                                 ^
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:150:3: note: Left side of '&&' is 
false
                   container_of(apply, typeof(*pm_apply), base);
                   ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:150:3: note: Taking false branch
                   container_of(apply, typeof(*pm_apply), base);
                   ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:302:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:150:3: note: Loop condition is 
false.  Exiting loop
                   container_of(apply, typeof(*pm_apply), base);
                   ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:156:6: note: Assuming 'backup' is 
non-null
           if (!backup)
               ^~~~~~~
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:156:2: note: Taking false branch
           if (!backup)
           ^
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:159:6: note: Assuming field 
'allow_gpu' is true
           if (!pm_apply->allow_gpu && !(obj->flags & I915_BO_ALLOC_PM_EARLY))
               ^~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:159:27: note: Left side of '&&' 
is false
           if (!pm_apply->allow_gpu && !(obj->flags & I915_BO_ALLOC_PM_EARLY))
                                    ^
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:162:37: note: Passing value via 
2nd parameter 'ww'
           err = i915_gem_object_lock(backup, apply->ww);
                                              ^~~~~~~~~
   drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c:162:8: note: Calling 
'i915_gem_object_lock'
           err = i915_gem_object_lock(backup, apply->ww);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/gem/i915_gem_object.h:203:41: note: Assuming 'ww' is 
null
           return __i915_gem_object_lock(obj, ww, ww && ww->intr);
                                                  ^~
   drivers/gpu/drm/i915/gem/i915_gem_object.h:203:44: note: Left side of '&&' 
is false
           return __i915_gem_object_lock(obj, ww, ww && ww->intr);
                                                     ^
   drivers/gpu/drm/i915/gem/i915_gem_object.h:203:37: note: Passing value via 
2nd parameter 'ww'
           return __i915_gem_object_lock(obj, ww, ww && ww->intr);
                                              ^~
   drivers/gpu/drm/i915/gem/i915_gem_object.h:203:9: note: Calling 
'__i915_gem_object_lock'
           return __i915_gem_object_lock(obj, ww, ww && ww->intr);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/gem/i915_gem_object.h:180:6: note: 'intr' is false
           if (intr)
               ^~~~
   drivers/gpu/drm/i915/gem/i915_gem_object.h:180:2: note: Taking false branch
           if (intr)
           ^
   drivers/gpu/drm/i915/gem/i915_gem_object.h:183:39: note: 'ww' is null
                   ret = dma_resv_lock(obj->base.resv, ww ? &ww->ctx : NULL);
                                                       ^~
   drivers/gpu/drm/i915/gem/i915_gem_object.h:183:39: note: '?' condition is 
false
   drivers/gpu/drm/i915/gem/i915_gem_object.h:185:6: note: Assuming 'ret' is 
not equal to 0
           if (!ret && ww) {
               ^~~~
   drivers/gpu/drm/i915/gem/i915_gem_object.h:185:11: note: Left side of '&&' 
is false
           if (!ret && ww) {
                    ^
   drivers/gpu/drm/i915/gem/i915_gem_object.h:189:6: note: Assuming the 
condition is false

vim +/i915_tt +865 drivers/gpu/drm/i915/gem/i915_gem_ttm.c

213d5092776345a Thomas Hellström 2021-06-10  819  
b6e913e19c54edd Thomas Hellström 2021-06-29  820  static int 
__i915_ttm_get_pages(struct drm_i915_gem_object *obj,
b6e913e19c54edd Thomas Hellström 2021-06-29  821                                
struct ttm_placement *placement)
213d5092776345a Thomas Hellström 2021-06-10  822  {
213d5092776345a Thomas Hellström 2021-06-10  823        struct 
ttm_buffer_object *bo = i915_gem_to_ttm(obj);
213d5092776345a Thomas Hellström 2021-06-10  824        struct 
ttm_operation_ctx ctx = {
213d5092776345a Thomas Hellström 2021-06-10  825                .interruptible 
= true,
213d5092776345a Thomas Hellström 2021-06-10  826                .no_wait_gpu = 
false,
213d5092776345a Thomas Hellström 2021-06-10  827        };
213d5092776345a Thomas Hellström 2021-06-10  828        struct sg_table *st;
b07a6483839a838 Thomas Hellström 2021-06-18  829        int real_num_busy;
213d5092776345a Thomas Hellström 2021-06-10  830        int ret;
213d5092776345a Thomas Hellström 2021-06-10  831  
b07a6483839a838 Thomas Hellström 2021-06-18  832        /* First try only the 
requested placement. No eviction. */
b6e913e19c54edd Thomas Hellström 2021-06-29  833        real_num_busy = 
fetch_and_zero(&placement->num_busy_placement);
b6e913e19c54edd Thomas Hellström 2021-06-29  834        ret = 
ttm_bo_validate(bo, placement, &ctx);
b07a6483839a838 Thomas Hellström 2021-06-18  835        if (ret) {
b07a6483839a838 Thomas Hellström 2021-06-18  836                ret = 
i915_ttm_err_to_gem(ret);
b07a6483839a838 Thomas Hellström 2021-06-18  837                /*
b07a6483839a838 Thomas Hellström 2021-06-18  838                 * Anything 
that wants to restart the operation gets to
b07a6483839a838 Thomas Hellström 2021-06-18  839                 * do that.
b07a6483839a838 Thomas Hellström 2021-06-18  840                 */
b07a6483839a838 Thomas Hellström 2021-06-18  841                if (ret == 
-EDEADLK || ret == -EINTR || ret == -ERESTARTSYS ||
b07a6483839a838 Thomas Hellström 2021-06-18  842                    ret == 
-EAGAIN)
b07a6483839a838 Thomas Hellström 2021-06-18  843                        return 
ret;
b07a6483839a838 Thomas Hellström 2021-06-18  844  
b07a6483839a838 Thomas Hellström 2021-06-18  845                /*
b07a6483839a838 Thomas Hellström 2021-06-18  846                 * If the 
initial attempt fails, allow all accepted placements,
b07a6483839a838 Thomas Hellström 2021-06-18  847                 * evicting if 
necessary.
b07a6483839a838 Thomas Hellström 2021-06-18  848                 */
b6e913e19c54edd Thomas Hellström 2021-06-29  849                
placement->num_busy_placement = real_num_busy;
b6e913e19c54edd Thomas Hellström 2021-06-29  850                ret = 
ttm_bo_validate(bo, placement, &ctx);
213d5092776345a Thomas Hellström 2021-06-10  851                if (ret)
b07a6483839a838 Thomas Hellström 2021-06-18  852                        return 
i915_ttm_err_to_gem(ret);
b07a6483839a838 Thomas Hellström 2021-06-18  853        }
213d5092776345a Thomas Hellström 2021-06-10  854  
3c2b8f326e7f73d Thomas Hellström 2021-06-24  855        if (bo->ttm && 
!ttm_tt_is_populated(bo->ttm)) {
3c2b8f326e7f73d Thomas Hellström 2021-06-24  856                ret = 
ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
3c2b8f326e7f73d Thomas Hellström 2021-06-24  857                if (ret)
3c2b8f326e7f73d Thomas Hellström 2021-06-24  858                        return 
ret;
3c2b8f326e7f73d Thomas Hellström 2021-06-24  859  
3c2b8f326e7f73d Thomas Hellström 2021-06-24  860                
i915_ttm_adjust_domains_after_move(obj);
3c2b8f326e7f73d Thomas Hellström 2021-06-24  861                
i915_ttm_adjust_gem_after_move(obj);
3c2b8f326e7f73d Thomas Hellström 2021-06-24  862        }
3c2b8f326e7f73d Thomas Hellström 2021-06-24  863  
75e382850b7ea51 Jason Ekstrand   2021-07-23  864        if 
(!i915_gem_object_has_pages(obj)) {
3ffdf7a46488d57 Matthew Auld     2021-10-11 @865                struct 
i915_ttm_tt *i915_tt =
3ffdf7a46488d57 Matthew Auld     2021-10-11  866                        
container_of(bo->ttm, typeof(*i915_tt), ttm);
3ffdf7a46488d57 Matthew Auld     2021-10-11  867  
213d5092776345a Thomas Hellström 2021-06-10  868                /* Object 
either has a page vector or is an iomem object */
213d5092776345a Thomas Hellström 2021-06-10  869                st = bo->ttm ? 
i915_ttm_tt_get_st(bo->ttm) : obj->ttm.cached_io_st;
213d5092776345a Thomas Hellström 2021-06-10  870                if (IS_ERR(st))
213d5092776345a Thomas Hellström 2021-06-10  871                        return 
PTR_ERR(st);
213d5092776345a Thomas Hellström 2021-06-10  872  
213d5092776345a Thomas Hellström 2021-06-10  873                
__i915_gem_object_set_pages(obj, st, i915_sg_dma_sizes(st->sgl));
75e382850b7ea51 Jason Ekstrand   2021-07-23  874        }
213d5092776345a Thomas Hellström 2021-06-10  875  
43578548b98c603 Matthew Auld     2021-10-11  876        
i915_ttm_adjust_lru(obj);
213d5092776345a Thomas Hellström 2021-06-10  877        return ret;
213d5092776345a Thomas Hellström 2021-06-10  878  }
213d5092776345a Thomas Hellström 2021-06-10  879  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to