bus.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2014 Google, Inc
  4. */
  5. #include <common.h>
  6. #ifdef CONFIG_SANDBOX
  7. #include <log.h>
  8. #include <os.h>
  9. #endif
  10. #include <dm.h>
  11. #include <dm/device.h>
  12. #include <dm/device-internal.h>
  13. #include <dm/test.h>
  14. #include <dm/uclass-internal.h>
  15. #include <dm/util.h>
  16. #include <test/test.h>
  17. #include <test/ut.h>
  18. DECLARE_GLOBAL_DATA_PTR;
  19. struct dm_test_parent_platdata {
  20. int count;
  21. int bind_flag;
  22. int uclass_bind_flag;
  23. };
  24. enum {
  25. FLAG_CHILD_PROBED = 10,
  26. FLAG_CHILD_REMOVED = -7,
  27. };
  28. static struct dm_test_state *test_state;
  29. static int testbus_drv_probe(struct udevice *dev)
  30. {
  31. return dm_scan_fdt_dev(dev);
  32. }
  33. static int testbus_child_post_bind(struct udevice *dev)
  34. {
  35. struct dm_test_parent_platdata *plat;
  36. plat = dev_get_parent_platdata(dev);
  37. plat->bind_flag = 1;
  38. plat->uclass_bind_flag = 2;
  39. return 0;
  40. }
  41. static int testbus_child_pre_probe(struct udevice *dev)
  42. {
  43. struct dm_test_parent_data *parent_data = dev_get_parent_priv(dev);
  44. parent_data->flag += FLAG_CHILD_PROBED;
  45. return 0;
  46. }
  47. static int testbus_child_pre_probe_uclass(struct udevice *dev)
  48. {
  49. struct dm_test_priv *priv = dev_get_priv(dev);
  50. priv->uclass_flag++;
  51. return 0;
  52. }
  53. static int testbus_child_post_probe_uclass(struct udevice *dev)
  54. {
  55. struct dm_test_priv *priv = dev_get_priv(dev);
  56. priv->uclass_postp++;
  57. return 0;
  58. }
  59. static int testbus_child_post_remove(struct udevice *dev)
  60. {
  61. struct dm_test_parent_data *parent_data = dev_get_parent_priv(dev);
  62. struct dm_test_state *dms = test_state;
  63. parent_data->flag += FLAG_CHILD_REMOVED;
  64. if (dms)
  65. dms->removed = dev;
  66. return 0;
  67. }
  68. static const struct udevice_id testbus_ids[] = {
  69. {
  70. .compatible = "denx,u-boot-test-bus",
  71. .data = DM_TEST_TYPE_FIRST },
  72. { }
  73. };
  74. U_BOOT_DRIVER(testbus_drv) = {
  75. .name = "testbus_drv",
  76. .of_match = testbus_ids,
  77. .id = UCLASS_TEST_BUS,
  78. .probe = testbus_drv_probe,
  79. .child_post_bind = testbus_child_post_bind,
  80. .priv_auto_alloc_size = sizeof(struct dm_test_priv),
  81. .platdata_auto_alloc_size = sizeof(struct dm_test_pdata),
  82. .per_child_auto_alloc_size = sizeof(struct dm_test_parent_data),
  83. .per_child_platdata_auto_alloc_size =
  84. sizeof(struct dm_test_parent_platdata),
  85. .child_pre_probe = testbus_child_pre_probe,
  86. .child_post_remove = testbus_child_post_remove,
  87. };
  88. UCLASS_DRIVER(testbus) = {
  89. .name = "testbus",
  90. .id = UCLASS_TEST_BUS,
  91. .flags = DM_UC_FLAG_SEQ_ALIAS,
  92. .child_pre_probe = testbus_child_pre_probe_uclass,
  93. .child_post_probe = testbus_child_post_probe_uclass,
  94. };
  95. /* Test that we can probe for children */
  96. static int dm_test_bus_children(struct unit_test_state *uts)
  97. {
  98. int num_devices = 9;
  99. struct udevice *bus;
  100. struct uclass *uc;
  101. ut_assertok(uclass_get(UCLASS_TEST_FDT, &uc));
  102. ut_asserteq(num_devices, list_count_items(&uc->dev_head));
  103. /* Probe the bus, which should yield 3 more devices */
  104. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  105. num_devices += 3;
  106. ut_assertok(uclass_get(UCLASS_TEST_FDT, &uc));
  107. ut_asserteq(num_devices, list_count_items(&uc->dev_head));
  108. ut_assert(!dm_check_devices(uts, num_devices));
  109. return 0;
  110. }
  111. DM_TEST(dm_test_bus_children, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  112. /* Test our functions for accessing children */
  113. static int dm_test_bus_children_funcs(struct unit_test_state *uts)
  114. {
  115. const void *blob = gd->fdt_blob;
  116. struct udevice *bus, *dev;
  117. int node;
  118. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  119. /* device_get_child() */
  120. ut_assertok(device_get_child(bus, 0, &dev));
  121. ut_asserteq(-ENODEV, device_get_child(bus, 4, &dev));
  122. ut_assertok(device_get_child_by_seq(bus, 5, &dev));
  123. ut_assert(dev->flags & DM_FLAG_ACTIVATED);
  124. ut_asserteq_str("c-test@5", dev->name);
  125. /* Device with sequence number 0 should be accessible */
  126. ut_asserteq(-ENODEV, device_find_child_by_seq(bus, -1, true, &dev));
  127. ut_assertok(device_find_child_by_seq(bus, 0, true, &dev));
  128. ut_assert(!(dev->flags & DM_FLAG_ACTIVATED));
  129. ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 0, false, &dev));
  130. ut_assertok(device_get_child_by_seq(bus, 0, &dev));
  131. ut_assert(dev->flags & DM_FLAG_ACTIVATED);
  132. /* There is no device with sequence number 2 */
  133. ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, false, &dev));
  134. ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, true, &dev));
  135. ut_asserteq(-ENODEV, device_get_child_by_seq(bus, 2, &dev));
  136. /* Looking for something that is not a child */
  137. node = fdt_path_offset(blob, "/junk");
  138. ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev));
  139. node = fdt_path_offset(blob, "/d-test");
  140. ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev));
  141. return 0;
  142. }
  143. DM_TEST(dm_test_bus_children_funcs, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  144. static int dm_test_bus_children_of_offset(struct unit_test_state *uts)
  145. {
  146. const void *blob = gd->fdt_blob;
  147. struct udevice *bus, *dev;
  148. int node;
  149. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  150. ut_assertnonnull(bus);
  151. /* Find a valid child */
  152. node = fdt_path_offset(blob, "/some-bus/c-test@1");
  153. ut_assert(node > 0);
  154. ut_assertok(device_find_child_by_of_offset(bus, node, &dev));
  155. ut_assertnonnull(dev);
  156. ut_assert(!(dev->flags & DM_FLAG_ACTIVATED));
  157. ut_assertok(device_get_child_by_of_offset(bus, node, &dev));
  158. ut_assertnonnull(dev);
  159. ut_assert(dev->flags & DM_FLAG_ACTIVATED);
  160. return 0;
  161. }
  162. DM_TEST(dm_test_bus_children_of_offset,
  163. UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE);
  164. /* Test that we can iterate through children */
  165. static int dm_test_bus_children_iterators(struct unit_test_state *uts)
  166. {
  167. struct udevice *bus, *dev, *child;
  168. /* Walk through the children one by one */
  169. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  170. ut_assertok(device_find_first_child(bus, &dev));
  171. ut_asserteq_str("c-test@5", dev->name);
  172. ut_assertok(device_find_next_child(&dev));
  173. ut_asserteq_str("c-test@0", dev->name);
  174. ut_assertok(device_find_next_child(&dev));
  175. ut_asserteq_str("c-test@1", dev->name);
  176. ut_assertok(device_find_next_child(&dev));
  177. ut_asserteq_ptr(dev, NULL);
  178. /* Move to the next child without using device_find_first_child() */
  179. ut_assertok(device_find_child_by_seq(bus, 5, true, &dev));
  180. ut_asserteq_str("c-test@5", dev->name);
  181. ut_assertok(device_find_next_child(&dev));
  182. ut_asserteq_str("c-test@0", dev->name);
  183. /* Try a device with no children */
  184. ut_assertok(device_find_first_child(dev, &child));
  185. ut_asserteq_ptr(child, NULL);
  186. return 0;
  187. }
  188. DM_TEST(dm_test_bus_children_iterators,
  189. UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  190. /* Test that the bus can store data about each child */
  191. static int test_bus_parent_data(struct unit_test_state *uts)
  192. {
  193. struct dm_test_parent_data *parent_data;
  194. struct udevice *bus, *dev;
  195. struct uclass *uc;
  196. int value;
  197. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  198. /* Check that parent data is allocated */
  199. ut_assertok(device_find_child_by_seq(bus, 0, true, &dev));
  200. ut_asserteq_ptr(NULL, dev_get_parent_priv(dev));
  201. ut_assertok(device_get_child_by_seq(bus, 0, &dev));
  202. parent_data = dev_get_parent_priv(dev);
  203. ut_assert(NULL != parent_data);
  204. /* Check that it starts at 0 and goes away when device is removed */
  205. parent_data->sum += 5;
  206. ut_asserteq(5, parent_data->sum);
  207. device_remove(dev, DM_REMOVE_NORMAL);
  208. ut_asserteq_ptr(NULL, dev_get_parent_priv(dev));
  209. /* Check that we can do this twice */
  210. ut_assertok(device_get_child_by_seq(bus, 0, &dev));
  211. parent_data = dev_get_parent_priv(dev);
  212. ut_assert(NULL != parent_data);
  213. parent_data->sum += 5;
  214. ut_asserteq(5, parent_data->sum);
  215. /* Add parent data to all children */
  216. ut_assertok(uclass_get(UCLASS_TEST_FDT, &uc));
  217. value = 5;
  218. uclass_foreach_dev(dev, uc) {
  219. /* Ignore these if they are not on this bus */
  220. if (dev->parent != bus) {
  221. ut_asserteq_ptr(NULL, dev_get_parent_priv(dev));
  222. continue;
  223. }
  224. ut_assertok(device_probe(dev));
  225. parent_data = dev_get_parent_priv(dev);
  226. parent_data->sum = value;
  227. value += 5;
  228. }
  229. /* Check it is still there */
  230. value = 5;
  231. uclass_foreach_dev(dev, uc) {
  232. /* Ignore these if they are not on this bus */
  233. if (dev->parent != bus)
  234. continue;
  235. parent_data = dev_get_parent_priv(dev);
  236. ut_asserteq(value, parent_data->sum);
  237. value += 5;
  238. }
  239. return 0;
  240. }
  241. /* Test that the bus can store data about each child */
  242. static int dm_test_bus_parent_data(struct unit_test_state *uts)
  243. {
  244. return test_bus_parent_data(uts);
  245. }
  246. DM_TEST(dm_test_bus_parent_data, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  247. /* As above but the size is controlled by the uclass */
  248. static int dm_test_bus_parent_data_uclass(struct unit_test_state *uts)
  249. {
  250. struct driver *drv;
  251. struct udevice *bus;
  252. int size;
  253. int ret;
  254. /* Set the driver size to 0 so that the uclass size is used */
  255. ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
  256. drv = (struct driver *)bus->driver;
  257. size = drv->per_child_auto_alloc_size;
  258. #ifdef CONFIG_SANDBOX
  259. os_mprotect_allow(bus->uclass->uc_drv, sizeof(*bus->uclass->uc_drv));
  260. os_mprotect_allow(drv, sizeof(*drv));
  261. #endif
  262. bus->uclass->uc_drv->per_child_auto_alloc_size = size;
  263. drv->per_child_auto_alloc_size = 0;
  264. ret = test_bus_parent_data(uts);
  265. if (ret)
  266. return ret;
  267. bus->uclass->uc_drv->per_child_auto_alloc_size = 0;
  268. drv->per_child_auto_alloc_size = size;
  269. return 0;
  270. }
  271. DM_TEST(dm_test_bus_parent_data_uclass,
  272. UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  273. /* Test that the bus ops are called when a child is probed/removed */
  274. static int dm_test_bus_parent_ops(struct unit_test_state *uts)
  275. {
  276. struct dm_test_parent_data *parent_data;
  277. struct dm_test_state *dms = uts->priv;
  278. struct udevice *bus, *dev;
  279. struct uclass *uc;
  280. test_state = dms;
  281. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  282. ut_assertok(uclass_get(UCLASS_TEST_FDT, &uc));
  283. uclass_foreach_dev(dev, uc) {
  284. /* Ignore these if they are not on this bus */
  285. if (dev->parent != bus)
  286. continue;
  287. ut_asserteq_ptr(NULL, dev_get_parent_priv(dev));
  288. ut_assertok(device_probe(dev));
  289. parent_data = dev_get_parent_priv(dev);
  290. ut_asserteq(FLAG_CHILD_PROBED, parent_data->flag);
  291. }
  292. uclass_foreach_dev(dev, uc) {
  293. /* Ignore these if they are not on this bus */
  294. if (dev->parent != bus)
  295. continue;
  296. parent_data = dev_get_parent_priv(dev);
  297. ut_asserteq(FLAG_CHILD_PROBED, parent_data->flag);
  298. ut_assertok(device_remove(dev, DM_REMOVE_NORMAL));
  299. ut_asserteq_ptr(NULL, dev_get_parent_priv(dev));
  300. ut_asserteq_ptr(dms->removed, dev);
  301. }
  302. test_state = NULL;
  303. return 0;
  304. }
  305. DM_TEST(dm_test_bus_parent_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  306. static int test_bus_parent_platdata(struct unit_test_state *uts)
  307. {
  308. struct dm_test_parent_platdata *plat;
  309. struct udevice *bus, *dev;
  310. /* Check that the bus has no children */
  311. ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
  312. device_find_first_child(bus, &dev);
  313. ut_asserteq_ptr(NULL, dev);
  314. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  315. for (device_find_first_child(bus, &dev);
  316. dev;
  317. device_find_next_child(&dev)) {
  318. /* Check that platform data is allocated */
  319. plat = dev_get_parent_platdata(dev);
  320. ut_assert(plat != NULL);
  321. /*
  322. * Check that it is not affected by the device being
  323. * probed/removed
  324. */
  325. plat->count++;
  326. ut_asserteq(1, plat->count);
  327. device_probe(dev);
  328. device_remove(dev, DM_REMOVE_NORMAL);
  329. ut_asserteq_ptr(plat, dev_get_parent_platdata(dev));
  330. ut_asserteq(1, plat->count);
  331. ut_assertok(device_probe(dev));
  332. }
  333. ut_asserteq(3, device_get_child_count(bus));
  334. /* Removing the bus should also have no effect (it is still bound) */
  335. device_remove(bus, DM_REMOVE_NORMAL);
  336. for (device_find_first_child(bus, &dev);
  337. dev;
  338. device_find_next_child(&dev)) {
  339. /* Check that platform data is allocated */
  340. plat = dev_get_parent_platdata(dev);
  341. ut_assert(plat != NULL);
  342. ut_asserteq(1, plat->count);
  343. }
  344. ut_asserteq(3, device_get_child_count(bus));
  345. /* Unbind all the children */
  346. do {
  347. device_find_first_child(bus, &dev);
  348. if (dev)
  349. device_unbind(dev);
  350. } while (dev);
  351. /* Now the child platdata should be removed and re-added */
  352. device_probe(bus);
  353. for (device_find_first_child(bus, &dev);
  354. dev;
  355. device_find_next_child(&dev)) {
  356. /* Check that platform data is allocated */
  357. plat = dev_get_parent_platdata(dev);
  358. ut_assert(plat != NULL);
  359. ut_asserteq(0, plat->count);
  360. }
  361. ut_asserteq(3, device_get_child_count(bus));
  362. return 0;
  363. }
  364. /* Test that the bus can store platform data about each child */
  365. static int dm_test_bus_parent_platdata(struct unit_test_state *uts)
  366. {
  367. return test_bus_parent_platdata(uts);
  368. }
  369. DM_TEST(dm_test_bus_parent_platdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  370. /* As above but the size is controlled by the uclass */
  371. static int dm_test_bus_parent_platdata_uclass(struct unit_test_state *uts)
  372. {
  373. struct udevice *bus;
  374. struct driver *drv;
  375. int size;
  376. int ret;
  377. /* Set the driver size to 0 so that the uclass size is used */
  378. ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
  379. drv = (struct driver *)bus->driver;
  380. size = drv->per_child_platdata_auto_alloc_size;
  381. #ifdef CONFIG_SANDBOX
  382. os_mprotect_allow(bus->uclass->uc_drv, sizeof(*bus->uclass->uc_drv));
  383. os_mprotect_allow(drv, sizeof(*drv));
  384. #endif
  385. bus->uclass->uc_drv->per_child_platdata_auto_alloc_size = size;
  386. drv->per_child_platdata_auto_alloc_size = 0;
  387. ret = test_bus_parent_platdata(uts);
  388. if (ret)
  389. return ret;
  390. bus->uclass->uc_drv->per_child_platdata_auto_alloc_size = 0;
  391. drv->per_child_platdata_auto_alloc_size = size;
  392. return 0;
  393. }
  394. DM_TEST(dm_test_bus_parent_platdata_uclass,
  395. UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  396. /* Test that the child post_bind method is called */
  397. static int dm_test_bus_child_post_bind(struct unit_test_state *uts)
  398. {
  399. struct dm_test_parent_platdata *plat;
  400. struct udevice *bus, *dev;
  401. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  402. for (device_find_first_child(bus, &dev);
  403. dev;
  404. device_find_next_child(&dev)) {
  405. /* Check that platform data is allocated */
  406. plat = dev_get_parent_platdata(dev);
  407. ut_assert(plat != NULL);
  408. ut_asserteq(1, plat->bind_flag);
  409. }
  410. ut_asserteq(3, device_get_child_count(bus));
  411. return 0;
  412. }
  413. DM_TEST(dm_test_bus_child_post_bind, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  414. /* Test that the child post_bind method is called */
  415. static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts)
  416. {
  417. struct dm_test_parent_platdata *plat;
  418. struct udevice *bus, *dev;
  419. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  420. for (device_find_first_child(bus, &dev);
  421. dev;
  422. device_find_next_child(&dev)) {
  423. /* Check that platform data is allocated */
  424. plat = dev_get_parent_platdata(dev);
  425. ut_assert(plat != NULL);
  426. ut_asserteq(2, plat->uclass_bind_flag);
  427. }
  428. ut_asserteq(3, device_get_child_count(bus));
  429. return 0;
  430. }
  431. DM_TEST(dm_test_bus_child_post_bind_uclass,
  432. UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  433. /*
  434. * Test that the bus' uclass' child_pre_probe() is called before the
  435. * device's probe() method
  436. */
  437. static int dm_test_bus_child_pre_probe_uclass(struct unit_test_state *uts)
  438. {
  439. struct udevice *bus, *dev;
  440. /*
  441. * See testfdt_drv_probe() which effectively checks that the uclass
  442. * flag is set before that method is called
  443. */
  444. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  445. for (device_find_first_child(bus, &dev);
  446. dev;
  447. device_find_next_child(&dev)) {
  448. struct dm_test_priv *priv = dev_get_priv(dev);
  449. /* Check that things happened in the right order */
  450. ut_asserteq_ptr(NULL, priv);
  451. ut_assertok(device_probe(dev));
  452. priv = dev_get_priv(dev);
  453. ut_assert(priv != NULL);
  454. ut_asserteq(1, priv->uclass_flag);
  455. ut_asserteq(1, priv->uclass_total);
  456. }
  457. ut_asserteq(3, device_get_child_count(bus));
  458. return 0;
  459. }
  460. DM_TEST(dm_test_bus_child_pre_probe_uclass,
  461. UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
  462. /*
  463. * Test that the bus' uclass' child_post_probe() is called after the
  464. * device's probe() method
  465. */
  466. static int dm_test_bus_child_post_probe_uclass(struct unit_test_state *uts)
  467. {
  468. struct udevice *bus, *dev;
  469. /*
  470. * See testfdt_drv_probe() which effectively initializes that
  471. * the uclass postp flag is set to a value
  472. */
  473. ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
  474. for (device_find_first_child(bus, &dev);
  475. dev;
  476. device_find_next_child(&dev)) {
  477. struct dm_test_priv *priv = dev_get_priv(dev);
  478. /* Check that things happened in the right order */
  479. ut_asserteq_ptr(NULL, priv);
  480. ut_assertok(device_probe(dev));
  481. priv = dev_get_priv(dev);
  482. ut_assert(priv != NULL);
  483. ut_asserteq(0, priv->uclass_postp);
  484. }
  485. ut_asserteq(3, device_get_child_count(bus));
  486. return 0;
  487. }
  488. DM_TEST(dm_test_bus_child_post_probe_uclass,
  489. UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);