kunit: Setup DMA masks on the kunit device
authorMaxime Ripard <mripard@kernel.org>
Wed, 21 Feb 2024 12:53:24 +0000 (13:53 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 27 Feb 2024 21:46:35 +0000 (14:46 -0700)
commitc5215d54dc10e801a6cefef62445a00a4c28a515
tree956dbe36ffe042b0c89e7a182ee4e0e45bd2530a
parent2fadeb950f53c017bde9e156e443528265dd3629
kunit: Setup DMA masks on the kunit device

Commit d393acce7b3f ("drm/tests: Switch to kunit devices") switched the
DRM device creation helpers from an ad-hoc implementation to the new
kunit device creation helpers introduced in commit d03c720e03bd ("kunit:
Add APIs for managing devices").

However, while the DRM helpers were using a platform_device, the kunit
helpers are using a dedicated bus and device type.

That situation creates small differences in the initialisation, and one
of them is that the kunit devices do not have the DMA masks setup. In
turn, this means that we can't do any kind of DMA buffer allocation
anymore, which creates a regression on some (downstream for now) tests.

Let's set up a default DMA mask that should work on any platform to fix
it.

Fixes: d03c720e03bd ("kunit: Add APIs for managing devices")
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
lib/kunit/device.c