[Intel-gfx] [PATCH 4/4] drm/i915/selftests: Introduce live tests of private PAT management

kbuild test robot lkp at intel.com
Fri Sep 8 08:57:36 UTC 2017


Hi Zhi,

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on next-20170908]
[cannot apply to v4.13]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Zhi-Wang/drm-i915-Factor-out-setup_private_pat/20170908-154240
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-randconfig-x001-201736 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:13:0,
                    from include/asm-generic/bug.h:15,
                    from arch/x86/include/asm/bug.h:81,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from drivers/gpu/drm/i915/i915_gem_gtt.c:26:
   drivers/gpu/drm/i915/selftests/i915_gem_gtt.c: In function 'igt_ppat_get':
   include/linux/kern_levels.h:4:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/printk.h:136:11: note: in definition of macro 'no_printk'
       printk(fmt, ##__VA_ARGS__); \
              ^~~
   include/linux/kern_levels.h:14:20: note: in expansion of macro 'KERN_SOH'
    #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
                       ^~~~~~~~
   include/linux/printk.h:339:12: note: in expansion of macro 'KERN_DEBUG'
     no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
               ^~~~~~~~~~
>> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c:1293:3: note: in expansion of macro 'pr_debug'
      pr_debug("ppat: alloc new entry value 0x%x index %lu\n",
      ^~~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/printk.h:136:11: note: in definition of macro 'no_printk'
       printk(fmt, ##__VA_ARGS__); \
              ^~~
   include/linux/kern_levels.h:14:20: note: in expansion of macro 'KERN_SOH'
    #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
                       ^~~~~~~~
   include/linux/printk.h:339:12: note: in expansion of macro 'KERN_DEBUG'
     no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
               ^~~~~~~~~~
   drivers/gpu/drm/i915/selftests/i915_gem_gtt.c:1330:2: note: in expansion of macro 'pr_debug'
     pr_debug("ppat: partial match entry value 0x%x index %lu\n",
     ^~~~~~~~
   include/linux/kern_levels.h:4:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/printk.h:136:11: note: in definition of macro 'no_printk'
       printk(fmt, ##__VA_ARGS__); \
              ^~~
   include/linux/kern_levels.h:14:20: note: in expansion of macro 'KERN_SOH'
    #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
                       ^~~~~~~~
   include/linux/printk.h:339:12: note: in expansion of macro 'KERN_DEBUG'
     no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
               ^~~~~~~~~~
   drivers/gpu/drm/i915/selftests/i915_gem_gtt.c:1343:4: note: in expansion of macro 'pr_debug'
       pr_debug("ppat: put entry value 0x%x index %lu\n",
       ^~~~~~~~

vim +/pr_debug +1293 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

  1205	
  1206	static int igt_ppat_get(void *arg)
  1207	{
  1208		struct drm_i915_private *i915 = arg;
  1209		struct intel_ppat *ppat = &i915->ppat;
  1210		const struct intel_ppat_entry **entries;
  1211		const struct intel_ppat_entry *entry;
  1212		unsigned int size = 0;
  1213		u8 value;
  1214		int i, ret;
  1215	
  1216		if (!ppat->max_entries)
  1217			return 0;
  1218	
  1219		pr_debug("ppat: ppat table before the test\n");
  1220	
  1221		for_each_set_bit(i, ppat->used, ppat->max_entries)
  1222			pr_debug("ppat %d: 0x%x\n", i, ppat->entries[i].value);
  1223	
  1224		pr_debug("ppat: make sure it's same with HW ppat table\n");
  1225	
  1226		ret = igt_ppat_init(i915);
  1227		if (ret)
  1228			return ret;
  1229	
  1230		pr_debug("ppat: case 1: perfect match\n");
  1231	
  1232		entry = intel_ppat_get(i915, ppat->entries[0].value);
  1233		if (IS_ERR(entry))
  1234			return PTR_ERR(entry);
  1235	
  1236		if (entry != &ppat->entries[0]) {
  1237			pr_err("not expected entry\n");
  1238			intel_ppat_put(entry);
  1239			return -EINVAL;
  1240		}
  1241	
  1242		intel_ppat_put(entry);
  1243	
  1244		pr_debug("ppat: OK\n");
  1245		pr_debug("ppat: case 2: alloc new entries\n");
  1246	
  1247		entries = NULL;
  1248		ret = 0;
  1249	
  1250		while (!ppat_table_is_full(ppat)) {
  1251			const struct intel_ppat_entry **p_entry;
  1252			DECLARE_BITMAP(used, INTEL_MAX_PPAT_ENTRIES);
  1253	
  1254			bitmap_copy(used, ppat->used, ppat->max_entries);
  1255	
  1256			entries = krealloc(entries, (size + 1) *
  1257					   sizeof(struct intel_ppat_entry *),
  1258					   GFP_KERNEL);
  1259			if (!entries) {
  1260				ret = -ENOSPC;
  1261				break;
  1262			}
  1263	
  1264			p_entry = &entries[size++];
  1265			*p_entry = NULL;
  1266	
  1267			value = generate_new_value(ppat, false);
  1268			if (!value) {
  1269				pr_err("cannot fill the unused PPAT entries?\n");
  1270				ret = -EINVAL;
  1271				break;
  1272			}
  1273	
  1274			*p_entry = entry = intel_ppat_get(i915, value);
  1275			if (IS_ERR(entry)) {
  1276				pr_err("fail to get new entry\n");
  1277				ret = PTR_ERR(entry);
  1278				break;
  1279			}
  1280	
  1281			if (entry->value != value) {
  1282				pr_err("fail to get expected new value\n");
  1283				ret = -EINVAL;
  1284				break;
  1285			}
  1286	
  1287			if (bitmap_equal(used, ppat->used, ppat->max_entries)) {
  1288				pr_err("fail to alloc a new entry\n");
  1289				ret = -EINVAL;
  1290				break;
  1291			}
  1292	
> 1293			pr_debug("ppat: alloc new entry value 0x%x index %lu\n",
  1294				entry->value, entry - ppat->entries);
  1295		}
  1296	
  1297		if (!ret)
  1298			pr_debug("ppat: OK\n");
  1299	
  1300		if (!entries)
  1301			pr_debug("ppat: ppat table is full, skip\n");
  1302	
  1303		if (ret)
  1304			goto ppat_put;
  1305	
  1306		pr_debug("ppat: case 3: partial match\n");
  1307	
  1308		value = generate_new_value(ppat, true);
  1309		if (!value) {
  1310			pr_err("fail to get new value\n");
  1311			ret = -EINVAL;
  1312			goto ppat_put;
  1313		}
  1314	
  1315		pr_debug("ppat: generate value 0x%x\n", value);
  1316	
  1317		entry = intel_ppat_get(i915, value);
  1318		if (IS_ERR(entry)) {
  1319			pr_err("fail to get new entry\n");
  1320			ret = PTR_ERR(entry);
  1321			goto ppat_put;
  1322		}
  1323	
  1324		if (!(entry->value != value &&
  1325		    GEN8_PPAT_GET_CA(entry->value) == GEN8_PPAT_GET_CA(value))) {
  1326			pr_err("fail to get expected value\n");
  1327			ret = -EINVAL;
  1328		}
  1329	
  1330		pr_debug("ppat: partial match entry value 0x%x index %lu\n",
  1331			entry->value, entry - ppat->entries);
  1332	
  1333		intel_ppat_put(entry);
  1334	
  1335	ppat_put:
  1336		if (entries) {
  1337			pr_debug("ppat: put entries\n");
  1338	
  1339			for (i = 0; i < size; i++) {
  1340				if (IS_ERR(entries[i]) || !entries[i])
  1341					continue;
  1342	
  1343				pr_debug("ppat: put entry value 0x%x index %lu\n",
  1344					entries[i]->value, entries[i] - ppat->entries);
  1345	
  1346				intel_ppat_put(entries[i]);
  1347	
  1348				if (entries[i]->value != ppat->clear_value) {
  1349					pr_err("fail to put ppat value\n");
  1350					ret = -EINVAL;
  1351					break;
  1352				}
  1353			}
  1354			pr_debug("ppat: OK\n");
  1355			kfree(entries);
  1356			entries = NULL;
  1357		}
  1358	
  1359		pr_debug("ppat: ppat table after the test\n");
  1360	
  1361		for_each_set_bit(i, ppat->used, ppat->max_entries)
  1362			pr_debug("ppat %d: 0x%x\n", i, ppat->entries[i].value);
  1363	
  1364		pr_debug("ppat: make sure it's same with HW ppat table\n");
  1365	
  1366		ret = igt_ppat_init(i915);
  1367		if (ret)
  1368			return ret;
  1369	
  1370		pr_debug("ppat: OK\n");
  1371	
  1372		return ret;
  1373	}
  1374	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 23087 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20170908/aa89d931/attachment-0001.gz>


More information about the Intel-gfx mailing list