On Tue Nov 12, 2024 at 12:32 AM AEST, Fabiano Rosas wrote: > Nicholas Piggin <npig...@gmail.com> writes: > > > Add tests which init the host controller registers to the point > > where command and event rings, irqs are operational. Enumerate > > ports and set up an attached device context that enables device > > transfer ring to be set up and tested. > > > > This test does a bunch of things at once and is yet well > > librified, but it allows testing basic mechanisms and gives a > > starting point for further work. > > Please give it a pass through checkpatch when you get the chance.
Hey Fabiano, Thanks. Unfortunately there's a bunch of register macros added here that are copied from xhci model source, which does upset checkpatch. It did catch a few issues though, I will fix. > > > > > Signed-off-by: Nicholas Piggin <npig...@gmail.com> > > --- > > tests/qtest/usb-hcd-xhci-test.h | 232 +++++++++++++++ > > tests/qtest/usb-hcd-xhci-test.c | 506 +++++++++++++++++++++++++++++++- > > 2 files changed, 732 insertions(+), 6 deletions(-) > > create mode 100644 tests/qtest/usb-hcd-xhci-test.h > > > > <snip> > > > +static void pci_xhci_stress_rings(void) > > +{ > > + XHCIQState *s; > > + uint32_t value; > > + uint64_t input_context; > > + XHCIEvRingSeg ev_seg; > > + XHCITRB trb; > > + uint32_t hcsparams1; > > + uint32_t slotid; > > + void *mem; > > + int i; > > + > > + mem = g_malloc(0x1000); > > This is leaking. Good catch, thank you. Thanks, Nick