mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-26 14:09:28 +07:00
drm/nouveau/tegra: Set clock rate if not set
If the GPU clock has not had a rate set, initialize it to the maximum clock rate to make sure it does run. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
b0b651aedb
commit
fc12262b96
@ -279,6 +279,7 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func,
|
||||
struct nvkm_device **pdevice)
|
||||
{
|
||||
struct nvkm_device_tegra *tdev;
|
||||
unsigned long rate;
|
||||
int ret;
|
||||
|
||||
if (!(tdev = kzalloc(sizeof(*tdev), GFP_KERNEL)))
|
||||
@ -307,6 +308,17 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func,
|
||||
goto free;
|
||||
}
|
||||
|
||||
rate = clk_get_rate(tdev->clk);
|
||||
if (rate == 0) {
|
||||
ret = clk_set_rate(tdev->clk, ULONG_MAX);
|
||||
if (ret < 0)
|
||||
goto free;
|
||||
|
||||
rate = clk_get_rate(tdev->clk);
|
||||
|
||||
dev_dbg(&pdev->dev, "GPU clock set to %lu\n", rate);
|
||||
}
|
||||
|
||||
if (func->require_ref_clk)
|
||||
tdev->clk_ref = devm_clk_get(&pdev->dev, "ref");
|
||||
if (IS_ERR(tdev->clk_ref)) {
|
||||
|
Loading…
Reference in New Issue
Block a user