Hi Wayne, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm-intel/for-linux-next] [also build test WARNING on drm-exynos/exynos-drm-next next-20210616] [cannot apply to drm-tip/drm-tip tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.13-rc6] [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/Wayne-Lin/Fix-observed-mst-problems-with-StarTech-hub/20210617-053552 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: nios2-randconfig-r026-20210617 (attached as .config) compiler: nios2-linux-gcc (GCC) 9.3.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/a904fdf8679b7eb026e3919cd14678ba9a06c8bc git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Wayne-Lin/Fix-observed-mst-problems-with-StarTech-hub/20210617-053552 git checkout a904fdf8679b7eb026e3919cd14678ba9a06c8bc # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/gpu/drm/drm_dp_mst_topology.c:45: drivers/gpu/drm/drm_dp_mst_topology.c: In function 'drm_dp_update_payload_part1': include/drm/drm_print.h:450:27: error: request for member 'dev' in something not a structure or union 450 | drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~ drivers/gpu/drm/drm_dp_mst_topology.c:3392:5: note: in expansion of macro 'drm_dbg_kms' 3392 | drm_dbg_kms("Virtual channel %d is not in current topology\n", i); | ^~~~~~~~~~~ >> drivers/gpu/drm/drm_dp_mst_topology.c:3392:68: warning: passing argument 3 of 'drm_dev_dbg' makes pointer from integer without a cast [-Wint-conversion] 3392 | drm_dbg_kms("Virtual channel %d is not in current topology\n", i); | ^ | | | int include/drm/drm_print.h:450:53: note: in definition of macro 'drm_dbg_kms' 450 | drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__) | ^~~ include/drm/drm_print.h:338:16: note: expected 'const char *' but argument is of type 'int' 338 | const char *format, ...); | ~~~~~~~~~~~~^~~~~~ drivers/gpu/drm/drm_dp_mst_topology.c:3407:53: error: macro "drm_dbg_kms" requires 3 arguments, but only 1 given 3407 | drm_dbg_kms("Fail:set payload to invalid sink"); | ^ In file included from drivers/gpu/drm/drm_dp_mst_topology.c:45: include/drm/drm_print.h:449: note: macro "drm_dbg_kms" defined here 449 | #define drm_dbg_kms(drm, fmt, ...) \ | drivers/gpu/drm/drm_dp_mst_topology.c:3407:7: error: 'drm_dbg_kms' undeclared (first use in this function) 3407 | drm_dbg_kms("Fail:set payload to invalid sink"); | ^~~~~~~~~~~ drivers/gpu/drm/drm_dp_mst_topology.c:3407:7: note: each undeclared identifier is reported only once for each function it appears in vim +/drm_dev_dbg +3392 drivers/gpu/drm/drm_dp_mst_topology.c 3352 3353 /** 3354 * drm_dp_update_payload_part1() - Execute payload update part 1 3355 * @mgr: manager to use. 3356 * 3357 * This iterates over all proposed virtual channels, and tries to 3358 * allocate space in the link for them. For 0->slots transitions, 3359 * this step just writes the VCPI to the MST device. For slots->0 3360 * transitions, this writes the updated VCPIs and removes the 3361 * remote VC payloads. 3362 * 3363 * after calling this the driver should generate ACT and payload 3364 * packets. 3365 */ 3366 int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr) 3367 { 3368 struct drm_dp_payload req_payload; 3369 struct drm_dp_mst_port *port; 3370 int i, j; 3371 int cur_slots = 1; 3372 bool skip; 3373 3374 mutex_lock(&mgr->payload_lock); 3375 for (i = 0; i < mgr->max_payloads; i++) { 3376 struct drm_dp_vcpi *vcpi = mgr->proposed_vcpis[i]; 3377 struct drm_dp_payload *payload = &mgr->payloads[i]; 3378 bool put_port = false; 3379 3380 /* solve the current payloads - compare to the hw ones 3381 - update the hw view */ 3382 req_payload.start_slot = cur_slots; 3383 if (vcpi) { 3384 port = container_of(vcpi, struct drm_dp_mst_port, 3385 vcpi); 3386 3387 mutex_lock(&mgr->lock); 3388 skip = !drm_dp_mst_port_downstream_of_branch(port, mgr->mst_primary); 3389 mutex_unlock(&mgr->lock); 3390 3391 if (skip) { > 3392 drm_dbg_kms("Virtual channel %d is not in current topology\n", i); 3393 continue; 3394 } 3395 /* Validated ports don't matter if we're releasing 3396 * VCPI 3397 */ 3398 if (vcpi->num_slots) { 3399 port = drm_dp_mst_topology_get_port_validated( 3400 mgr, port); 3401 if (!port) { 3402 if (vcpi->num_slots == payload->num_slots) { 3403 cur_slots += vcpi->num_slots; 3404 payload->start_slot = req_payload.start_slot; 3405 continue; 3406 } else { 3407 drm_dbg_kms("Fail:set payload to invalid sink"); 3408 mutex_unlock(&mgr->payload_lock); 3409 return -EINVAL; 3410 } 3411 } 3412 put_port = true; 3413 } 3414 3415 req_payload.num_slots = vcpi->num_slots; 3416 req_payload.vcpi = vcpi->vcpi; 3417 } else { 3418 port = NULL; 3419 req_payload.num_slots = 0; 3420 } 3421 3422 payload->start_slot = req_payload.start_slot; 3423 /* work out what is required to happen with this payload */ 3424 if (payload->num_slots != req_payload.num_slots) { 3425 3426 /* need to push an update for this payload */ 3427 if (req_payload.num_slots) { 3428 drm_dp_create_payload_step1(mgr, vcpi->vcpi, 3429 &req_payload); 3430 payload->num_slots = req_payload.num_slots; 3431 payload->vcpi = req_payload.vcpi; 3432 3433 } else if (payload->num_slots) { 3434 payload->num_slots = 0; 3435 drm_dp_destroy_payload_step1(mgr, port, 3436 payload->vcpi, 3437 payload); 3438 req_payload.payload_state = 3439 payload->payload_state; 3440 payload->start_slot = 0; 3441 } 3442 payload->payload_state = req_payload.payload_state; 3443 } 3444 cur_slots += req_payload.num_slots; 3445 3446 if (put_port) 3447 drm_dp_mst_topology_put_port(port); 3448 } 3449 3450 for (i = 0; i < mgr->max_payloads; /* do nothing */) { 3451 if (mgr->payloads[i].payload_state != DP_PAYLOAD_DELETE_LOCAL) { 3452 i++; 3453 continue; 3454 } 3455 3456 drm_dbg_kms(mgr->dev, "removing payload %d\n", i); 3457 for (j = i; j < mgr->max_payloads - 1; j++) { 3458 mgr->payloads[j] = mgr->payloads[j + 1]; 3459 mgr->proposed_vcpis[j] = mgr->proposed_vcpis[j + 1]; 3460 3461 if (mgr->proposed_vcpis[j] && 3462 mgr->proposed_vcpis[j]->num_slots) { 3463 set_bit(j + 1, &mgr->payload_mask); 3464 } else { 3465 clear_bit(j + 1, &mgr->payload_mask); 3466 } 3467 } 3468 3469 memset(&mgr->payloads[mgr->max_payloads - 1], 0, 3470 sizeof(struct drm_dp_payload)); 3471 mgr->proposed_vcpis[mgr->max_payloads - 1] = NULL; 3472 clear_bit(mgr->max_payloads, &mgr->payload_mask); 3473 } 3474 mutex_unlock(&mgr->payload_lock); 3475 3476 return 0; 3477 } 3478 EXPORT_SYMBOL(drm_dp_update_payload_part1); 3479 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org