History

drm/tegra: Do not implement runtime PM

The Tegra DRM driver heavily relies on the implementations for runtime suspend/resume to be called at specific times. Unfortunately, there are some cases where that doesn't work. One example is if the user disables runtime PM for a given subdevice. Another example is that the PM core acquires a reference to runtime PM during system sleep, effectively preventing devices from going into low power modes. This is intentional to avoid nasty race conditions, but it also causes system sleep to not function properly on all Tegra systems. Fix this by not implementing runtime PM at all. Instead, a minimal, reference-counted suspend/resume infrastructure is added to the host1x bus. This has the benefit that it can be used regardless of the system power state (or any transitions we might be in), or whether or not the user allows runtime PM. Atomic modesetting guarantees that these functions will end up being called at the right point in time, so the pitfalls for the more generic runtime PM do not apply here.

Thierry Reding committed 6 years ago

Commit fd67e9c1 parent 608f43a10 files · +541 −331Browse files

Showing the changes to include/linux (1 of 10 files). Show all

Unified · Split

include/linux/host1x.h+11−0
@@ -24,10 +24,14 @@ struct iommu_group; · 23 unmodified lines
24 * struct host1x_client_ops - host1x client operations24 * struct host1x_client_ops - host1x client operations
25 * @init: host1x client initialization code25 * @init: host1x client initialization code
26 * @exit: host1x client tear down code26 * @exit: host1x client tear down code
27 * @suspend: host1x client suspend code
28 * @resume: host1x client resume code
27 */29 */
28struct host1x_client_ops {30struct host1x_client_ops {
29 int (*init)(struct host1x_client *client);31 int (*init)(struct host1x_client *client);
30 int (*exit)(struct host1x_client *client);32 int (*exit)(struct host1x_client *client);
33 int (*suspend)(struct host1x_client *client);
34 int (*resume)(struct host1x_client *client);
31};35};
32 36
33/**37/**
@@ -55,6 +59,10 @@ struct host1x_client { · 21 unmodified lines
55 59
56 struct host1x_syncpt **syncpts;60 struct host1x_syncpt **syncpts;
57 unsigned int num_syncpts;61 unsigned int num_syncpts;
62
63 struct host1x_client *parent;
64 unsigned int usecount;
65 struct mutex lock;
58};66};
59 67
60/*68/*
@@ -322,6 +330,9 @@ int host1x_device_exit(struct host1x_device *device); · 261 unmodified lines
322int host1x_client_register(struct host1x_client *client);330int host1x_client_register(struct host1x_client *client);
323int host1x_client_unregister(struct host1x_client *client);331int host1x_client_unregister(struct host1x_client *client);
324 332
333int host1x_client_suspend(struct host1x_client *client);
334int host1x_client_resume(struct host1x_client *client);
335
325struct tegra_mipi_device;336struct tegra_mipi_device;
326 337
327struct tegra_mipi_device *tegra_mipi_request(struct device *device);338struct tegra_mipi_device *tegra_mipi_request(struct device *device);