diff --git a/drivers/gpu/drm/apple/av-lifetime-test.c b/drivers/gpu/drm/apple/av-lifetime-test.c index 0232dfb670bbd..193358ce2bfba 100644 --- a/drivers/gpu/drm/apple/av-lifetime-test.c +++ b/drivers/gpu/drm/apple/av-lifetime-test.c @@ -155,6 +155,7 @@ static struct av_life_test *av_life_setup(struct kunit *test, work_func_t owner_ t->dcp->dev = t->dev; dev_set_drvdata(t->dev, t->dcp); spin_lock_init(&t->ep->lock); + INIT_LIST_HEAD(&t->ep->compact_cmds); init_rwsem(&t->asrv->srv_rwsem); INIT_WORK(&t->asrv->start_av_service_wq, owner_fn); INIT_WORK(&t->asrv->terminate_wq, owner_fn); @@ -484,6 +485,7 @@ static struct av_life_test *av_life_group_setup(struct kunit *test, t->ep = devm_kzalloc(t->dev, sizeof(*t->ep), GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, t->ep); spin_lock_init(&t->ep->lock); + INIT_LIST_HEAD(&t->ep->compact_cmds); t->ep->dcp = t->dcp; t->wq = alloc_ordered_workqueue("av-lifetime-devres", 0); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, t->wq); diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/README b/tools/testing/selftests/drivers/gpu/apple-dcp/README index c49b2d48949af..ffd0ecfcb852c 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/README +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/README @@ -12,7 +12,13 @@ Or keep translation units, commands, failure logs and source hashes: An installed copy needs --source /path/to/kernel. --group edid, rate, phy or lifecycle or boot selects one group. HOSTCC selects the host compiler (default clang). Python 3 and a compiler supporting AddressSanitizer/UndefinedBehaviorSanitizer -are required. No target access, firmware command, captured fixture or kernel +are required. The usb-kconfig producer also needs GNU Make 4 or newer. The +runner uses MAKE when set, otherwise gmake if available, then make. On macOS, +install GNU Make or select an existing producer with KCONFIG_CONF. The host +fixtures use native errno definitions; Linux-only reply statuses stay local +to the synthetic callback test. + +No target access, firmware command, captured fixture or kernel configuration is required. One TAP entry point uses shared production extraction and compiler handling. diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/common.py b/tools/testing/selftests/drivers/gpu/apple-dcp/common.py index cdf20256dfa4f..918a9d91fa30f 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/common.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/common.py @@ -47,6 +47,8 @@ def source_defines(source): def tipd_pm_header(root): """CD321x PM state machine for host units, with a host clamp() for minmax.h.""" header = (root / 'drivers/usb/typec/tipd/cd321x-pm.h').read_text() + # Use the host errno namespace, not the AFK Linux-numbered shim. + header = header.replace('#include ', '#include ') # Host integer types; a repeated identical typedef is valid C11. header = header.replace('#include ', '#include \ntypedef uint32_t u32;') diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py index d7485a6681747..21a962fb10cb3 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py @@ -1770,6 +1770,10 @@ def power_reply(root): #include #include #include +/* Darwin has no EREMOTEIO; this synthetic status is never passed to libc. */ +#ifndef EREMOTEIO +#define EREMOTEIO 121 +#endif typedef uint32_t u32; typedef uint64_t u64; #define WRITE_ONCE(p,v) ((p)=(v)) #define container_of(p,t,m) ((t *)((char *)(p)-offsetof(t,m))) diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/pm.py b/tools/testing/selftests/drivers/gpu/apple-dcp/pm.py index 75fe10221fcc9..d5b3890d30861 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/pm.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/pm.py @@ -2,7 +2,7 @@ # Copyright 2026 Ryan Murray """Actual PM/HCD/mux/probe boundaries using the shared PHY extraction fixture.""" from pathlib import Path -import os, re, subprocess +import os, re, shlex, shutil, subprocess import phy from common import block, tipd_pm_header, atc_function @@ -681,7 +681,8 @@ def kconfig(root, output): 'config PHY_APPLE_ATC\n\ttristate "PHY"\n\t' + dependency + '\n') compiler = Path(os.environ.get('KCONFIG_CONF', root / 'scripts/kconfig/conf')) if not compiler.is_file(): - subprocess.run(['make', '-C', str(root), 'O=' + str(directory / 'producer'), + make = shlex.split(os.environ.get('MAKE', shutil.which('gmake') or 'make')) + subprocess.run(make + ['-C', str(root), 'O=' + str(directory / 'producer'), 'ARCH=arm64', 'LLVM=1', 'allnoconfig'], check=True) compiler = directory / 'producer/scripts/kconfig/conf' for usb, phy_setting in [('n', 'y'), ('y', 'y'), ('m', 'y'), ('m', 'm')]: