Skip to content

usb: xhci: plat: fix the modpost break in xhci-plat-test (KUNIT_ALL_TESTS=m), add missing KUnit module descriptions - #347

Merged
RyanTheTide merged 3 commits into
aurora-wipfrom
fix/xhci-plat-test-modpost
Oct 17, 2026
Merged

RyanTheTide merged 3 commits into
aurora-wipfrom
fix/xhci-plat-test-modpost

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

A distro-style config fails at modpost on aurora-wip. Fedora's is one: KUNIT_ALL_TESTS=m with USB_XHCI_HCD=y.

ERROR: modpost: "xhci_irq" [drivers/usb/host/xhci-plat-test.ko] undefined!

#340 made the xhci-plat s2idle test call xhci_irq() directly, and xhci_irq() isn't exported. Found during the M1 Pro post-merge run.

Fix (3 commits, test code only, +7/−2)

  1. usb: xhci: plat: the test calls the interrupt handler through the HC driver, t->driver.irq(t->hcd). That is exactly xhci_irq: xhci_init_driver() copies xhci_hc_driver, and overrides can't replace .irq. It is also how the USB core enters it (usb_hcd_irq()), so no export is added to the xHCI core.
  2. tipd: adds the missing MODULE_DESCRIPTION() to cd321x-pm-test.
  3. drm/apple: adds MODULE_DESCRIPTION() to four KUnit test modules that warn whenever DRM_APPLE_KUNIT_TEST=m: afk_test, dcp_backlight_test, afk-service-test and iomfb-state-test.

Testing

  • The M1 Pro Fedora recipe:
    • before: make_exit 2 with the modpost error;
    • after: make_exit 0, 0 modpost warnings or errors, also with DRM_APPLE_KUNIT_TEST=m.
    • xhci-plat-test.ko has no undefined xhci_irq.
  • Published J700 config: 0 warnings, 2,513 modules. KUnit is off in that config, so the Image is unaffected.
  • KUnit:
    • usb-dart-atc-lockdep 135/135, including all 30 xhci_s2idle cases through .irq;
    • usb-nopm 16/16;
    • bt 10/10.
  • apple-dcp host selftests: 55/55.
  • checkpatch: 0 errors.

Under -smp 2, cd321x_ack_retry_across_sleep_test from #338 flaked once in 11 runs, on both base and head. That's the same delayed_work_pending() test race #338 fixed in another case. It's tracked separately and not touched here.

🤖 Generated with Claude Code

RyanTheTide and others added 3 commits October 17, 2026 17:19
…tests

The suspend-to-idle tests call xhci_irq() directly, but that function is
not exported. With the xHCI core built in and the tests built as a
module, as with KUNIT_ALL_TESTS=m on a distribution config, modpost
fails:

  ERROR: modpost: "xhci_irq" [drivers/usb/host/xhci-plat-test.ko] undefined!

The tests already set up the generic xHCI hc_driver with
xhci_init_driver() and call its hub_control and hub_status_data methods.
Call the interrupt handler through its irq method as well, which is
xhci_irq() and is how the USB core invokes it from usb_hcd_irq().

Fixes: e9573a1 ("usb: xhci: Wake from suspend-to-idle only for wakeup events")
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
modpost warns when the CD321x PM tests are built as a module:

  WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/typec/tipd/cd321x-pm-test.o

Add one, as the other tipd test modules have.

Fixes: c2514e4 ("thunderbolt: restore M1 tunneled PCIe state and recover late link loss")
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
modpost warns about four of the Apple display KUnit test modules when
DRM_APPLE_KUNIT_TEST is built as a module, as KUNIT_ALL_TESTS=m does on
a distribution config:

  WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/apple/afk_test.o
  WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/apple/dcp_backlight_test.o
  WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/apple/afk-service-test.o
  WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/apple/iomfb-state-test.o

Add one to each, as dcp-announce-test has.

Fixes: 1ff8bb4 ("drm: apple: afk: derive the ring header stride from INITRB")
Fixes: 0da3b48 ("drm: apple: test H17P backlight takeover and DPMS policy")
Fixes: 5837706 ("drm/apple: pin DP service owners before recycling retired AFK slots")
Fixes: fb40feb ("drm/apple: preserve mode invalidation across hotplug and modeset")
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide
RyanTheTide merged commit dedcb27 into aurora-wip Oct 17, 2026
@RyanTheTide
RyanTheTide deleted the fix/xhci-plat-test-modpost branch October 17, 2026 09:34
RyanTheTide added a commit that referenced this pull request Oct 17, 2026
Bring the 7.2.10 assembly to the tree of the canonical top-up #6
assembly, stacked on top-up #5 f34b5ae so that it is a
fast-forward of the published branch. The second parent is that
canonical assembly; the tree is identical to it.

Ported from aurora-wip, each with cherry-pick -x and its original
author:
- #347 KUNIT_ALL_TESTS=m modpost (3): the xHCI platform tests call the
  interrupt handler through the HC driver (170-usb), and module
  descriptions for the CD321x PM tests (170-usb) and the drm/apple
  KUnit test modules (200-dcp).
- #349 the CD321x IRQ test waits for the resume read before checking
  its retry (170-usb).
- #350 trusted keys keep a source that registers before
  init_trusted() (100-sep). Its test commit is already carried as
  76d70cc and is not duplicated.
- #351 SEP hwrng: recover the entropy exchange after a request times
  out, and hold entropy requests while the system sleeps (100-sep).
- #352 SEP SBIO: take a reply header only once it has landed, and
  poison it again once read and before each host send (100-sep).

Adaptations, each with a [ryan: ...] note in its commit:
- trusted-type.h: context only, the declaration goes above the
  7.2.10 CONFIG_TRUSTED_KEYS_DEBUG block;
- the CD321x IRQ test takes its data from tipd_hw_variants[], and its
  retry loop replaces the 7.2.10-only fix of the same race in
  11e0ce6.

The Co-Authored-By lines of the three #347 commits are dropped.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant