summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2026-06-09 17:09:18 +0900
committerThierry Reding <treding@nvidia.com>2026-07-16 20:29:02 +0200
commit254290869fd234b85119c48dbb98efa5fcd41a31 (patch)
tree09ac5306bf727049c5b9774c00bad41f126ab92c
parent7a39b9856acccc8e9b05845ca2bf62494fcd3dfa (diff)
downloadlinux-next-254290869fd234b85119c48dbb98efa5fcd41a31.tar.gz
linux-next-254290869fd234b85119c48dbb98efa5fcd41a31.zip
gpu: host1x: Avoid double device_add when clients already present
host1x_device_add looks through the idle clients list to populate subdevs, and any matches entries are moved from the subdevs list to the active list. If all subdevs are populated, device_add will be called on the device. The secondary "subdevs list empty" check will then incorrectly again call device_add. However, this would require a convoluted scenario since clients don't typically end up on the idle clients list. Fix by checking whether the device was already added before adding again. Fixes: fab823d82ee5 ("gpu: host1x: Allow loading tegra-drm without enabled engines") Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patch.msgid.link/20260609-b4-host1x-small-fixes-a-v1-2-7c1131c0b3ad@nvidia.com
-rw-r--r--drivers/gpu/host1x/bus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
index e3884096c2fe..825a943c64dd 100644
--- a/drivers/gpu/host1x/bus.c
+++ b/drivers/gpu/host1x/bus.c
@@ -508,7 +508,7 @@ static int host1x_device_add(struct host1x *host1x,
* Add device even if there are no subdevs to ensure syncpoint functionality
* is available regardless of whether any engine subdevices are present
*/
- if (list_empty(&device->subdevs)) {
+ if (list_empty(&device->subdevs) && !device->registered) {
err = device_add(&device->dev);
if (err < 0)
dev_err(&device->dev, "failed to add device: %d\n", err);