drm/nouveau: handle -EACCES runtime PM return code
pm_runtime_get*() may return -EACCES to indicate a device does not have runtime PM enabled. This is currently the case with platform devices on Nouveau, and is not an error in that context. Handle this case without failure. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
ef98c1f7b3
commit
b6c4285afa
|
@ -1048,7 +1048,7 @@ nouveau_crtc_set_config(struct drm_mode_set *set)
|
||||||
|
|
||||||
/* get a pm reference here */
|
/* get a pm reference here */
|
||||||
ret = pm_runtime_get_sync(dev->dev);
|
ret = pm_runtime_get_sync(dev->dev);
|
||||||
if (ret < 0)
|
if (ret < 0 && ret != -EACCES)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = drm_crtc_helper_set_config(set);
|
ret = drm_crtc_helper_set_config(set);
|
||||||
|
|
|
@ -255,7 +255,7 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(connector->dev->dev);
|
ret = pm_runtime_get_sync(connector->dev->dev);
|
||||||
if (ret < 0)
|
if (ret < 0 && ret != -EACCES)
|
||||||
return conn_status;
|
return conn_status;
|
||||||
|
|
||||||
i2c = nouveau_connector_ddc_detect(connector, &nv_encoder);
|
i2c = nouveau_connector_ddc_detect(connector, &nv_encoder);
|
||||||
|
|
|
@ -679,7 +679,7 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv)
|
||||||
|
|
||||||
/* need to bring up power immediately if opening device */
|
/* need to bring up power immediately if opening device */
|
||||||
ret = pm_runtime_get_sync(dev->dev);
|
ret = pm_runtime_get_sync(dev->dev);
|
||||||
if (ret < 0)
|
if (ret < 0 && ret != -EACCES)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
get_task_comm(tmpname, current);
|
get_task_comm(tmpname, current);
|
||||||
|
@ -762,7 +762,7 @@ long nouveau_drm_ioctl(struct file *filp,
|
||||||
dev = file_priv->minor->dev;
|
dev = file_priv->minor->dev;
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(dev->dev);
|
ret = pm_runtime_get_sync(dev->dev);
|
||||||
if (ret < 0)
|
if (ret < 0 && ret != -EACCES)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = drm_ioctl(filp, cmd, arg);
|
ret = drm_ioctl(filp, cmd, arg);
|
||||||
|
|
Loading…
Reference in New Issue