Re: [PATCH] clk: Disable KUNIT_UML_PCI

From: David Gow

Date: Fri Nov 28 2025 - 03:46:51 EST


On Fri, 28 Nov 2025 at 15:44, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
>
> >
> > commit 031cdd3bc3f3 ("kunit: Enable PCI on UML without triggering WARN()")
> > causes clk gate test fail. Deselect KUNIT_UML_PCI to avoid the failure.
>
> While probably _true_ that this "caused" it, it also seems a bit
> dishonest to blame it on that without giving any information as to why
> the clk tests trigger some edge case or so?
>
> FTR, the warning only happens when you pass an address to ioread(),
> iowrite() or similar that wasn't obtained from ioremap(). Which ought to
> not be valid, and I'm pretty convinced that a unit test should never
> even end up here.
>
> So no, I don't think this is a valid change, I think the clk unit tests
> that end up doing readl() in the gate code for a non-existing device are
> broken.

Yeah, the correct solution here is definitely to rework the test to not do this.

Unfortunately, I don't think there's a really pleasant way of faking
these in KUnit tests, but a path forward might involve logic_iomem
(possibly with some changes). Otherwise, reworking the test to put
these writes behind a function which can be mocked would be nice.

Ultimately, I don't have a problem with us disabling this in the
meantime for clk tests -- ultimately it's up to clk folks what their
test config is, and having tests which always fail isn't great -- but
it'd be nice to eliminate the cast-a-random-pointer-to-iomem hacks in
tests.

Cheers,
-- David

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature