linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu: v3d: fix a missing check of pm_runtime_get_sync
@ 2019-03-24 23:16 Kangjie Lu
  2019-03-27 15:09 ` Mukesh Ojha
  2019-04-01 17:49 ` Eric Anholt
  0 siblings, 2 replies; 3+ messages in thread
From: Kangjie Lu @ 2019-03-24 23:16 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Eric Anholt, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel

pm_runtime_get_sync could fail and thus deserves a check.

The patch adds such a check and return its error code upstream
if it indeed failed.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/gpu/drm/v3d/v3d_drv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index f0afcec72c34..99daad11fac2 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -101,6 +101,8 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
 			return -EINVAL;
 
 		ret = pm_runtime_get_sync(v3d->dev);
+		if (ret < 0)
+			return ret;
 		if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
 		    args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
 			args->value = V3D_CORE_READ(0, offset);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu: v3d: fix a missing check of pm_runtime_get_sync
  2019-03-24 23:16 [PATCH] gpu: v3d: fix a missing check of pm_runtime_get_sync Kangjie Lu
@ 2019-03-27 15:09 ` Mukesh Ojha
  2019-04-01 17:49 ` Eric Anholt
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-03-27 15:09 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: pakki001, Eric Anholt, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel


On 3/25/2019 4:46 AM, Kangjie Lu wrote:
> pm_runtime_get_sync could fail and thus deserves a check.
>
> The patch adds such a check and return its error code upstream
> if it indeed failed.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

-Mukesh
> ---
>   drivers/gpu/drm/v3d/v3d_drv.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
> index f0afcec72c34..99daad11fac2 100644
> --- a/drivers/gpu/drm/v3d/v3d_drv.c
> +++ b/drivers/gpu/drm/v3d/v3d_drv.c
> @@ -101,6 +101,8 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
>   			return -EINVAL;
>   
>   		ret = pm_runtime_get_sync(v3d->dev);
> +		if (ret < 0)
> +			return ret;
>   		if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
>   		    args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
>   			args->value = V3D_CORE_READ(0, offset);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu: v3d: fix a missing check of pm_runtime_get_sync
  2019-03-24 23:16 [PATCH] gpu: v3d: fix a missing check of pm_runtime_get_sync Kangjie Lu
  2019-03-27 15:09 ` Mukesh Ojha
@ 2019-04-01 17:49 ` Eric Anholt
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Anholt @ 2019-04-01 17:49 UTC (permalink / raw)
  To: Kangjie Lu, kjlu
  Cc: pakki001, David Airlie, Daniel Vetter, dri-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

Kangjie Lu <kjlu@umn.edu> writes:

> pm_runtime_get_sync could fail and thus deserves a check.
>
> The patch adds such a check and return its error code upstream
> if it indeed failed.

Applied the review and merged to drm-misc-next.  Thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-01 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-24 23:16 [PATCH] gpu: v3d: fix a missing check of pm_runtime_get_sync Kangjie Lu
2019-03-27 15:09 ` Mukesh Ojha
2019-04-01 17:49 ` Eric Anholt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).