--- tests/intel-ci/fast-feedback.testlist | 2 ++ tests/pm_rpm.c | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist index f71a16bcd191..e9322249dd73 100644 --- a/tests/intel-ci/fast-feedback.testlist +++ b/tests/intel-ci/fast-feedback.testlist @@ -293,3 +293,5 @@ igt@drv_module_reload@basic-reload igt@drv_module_reload@basic-no-display igt@drv_module_reload@basic-reload-inject igt@gvt_basic@invalid-placeholder-test +igt@pm_rpm@irq-affinity +igt@kms_vblank@crtc-id diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index fb26e384e236..943476dce3ef 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -1860,6 +1860,65 @@ static int opt_handler(int opt, int opt_index, void *data) return 0; } +static void irq_affinity_subtest(void) +{ + int fd, sysfs_fd; + char irq[6], irq_path[40]; + ssize_t ret; + + /* Disable irqbalance, we want to juggle this manually.. */ + system("killall -STOP irqbalance"); + +#define CPU "3" + + fd = open("/sys/devices/system/cpu/cpu" CPU "/online", O_WRONLY); + igt_require(fd >= 0); + igt_assert_eq(write(fd, "1\n", 2), 2); + close(fd); + + /* Read irq number.. */ + sysfs_fd = igt_sysfs_open(drm_fd, NULL); + fd = openat(sysfs_fd, "device/irq", O_RDONLY); + close(sysfs_fd); + ret = read(fd, irq, sizeof(irq)); + igt_assert(ret > 0); + irq[ret - 1] = 0; + close(fd); + + sprintf(irq_path, "/proc/irq/%s/smp_affinity_list", irq); + fd = open(irq_path, O_WRONLY); + igt_assert(fd >= 0); + igt_assert_eq(write(fd, CPU "\n", 2), 2); + close(fd); + + disable_all_screens_and_wait(&ms_data); + + igt_assert(igt_wait(device_in_pci_d3(), 2000, 100)); + + fd = open("/sys/devices/system/cpu/cpu" CPU "/online", O_WRONLY); + igt_assert(fd >= 0); + igt_assert_eq(write(fd, "0\n", 2), 2); + close(fd); + + sprintf(irq_path, "/proc/irq/%s/smp_affinity_list", irq); + fd = open(irq_path, O_WRONLY); + igt_assert(fd >= 0); + igt_assert_eq(write(fd, "0\n", 2), 2); + close(fd); + + igt_debug_wait_for_keypress("asdf"); + + enable_one_screen_and_wait(&ms_data); + + fd = open("/sys/devices/system/cpu/cpu" CPU "/online", O_WRONLY); + igt_assert(fd >= 0); + igt_assert_eq(write(fd, "1\n", 2), 2); + close(fd); + + system("killall -CONT irqbalance"); +} + + int main(int argc, char *argv[]) { const char *help_str = @@ -1989,6 +2048,9 @@ int main(int argc, char *argv[]) igt_subtest("pm-caching") pm_test_caching(); + igt_subtest("irq-affinity") + irq_affinity_subtest(); + igt_fixture teardown_environment(); -- 2.15.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx