[v2] drm/i915/gvt: return error on cmd access

Submitted by Zhao, Yan Y on Aug. 1, 2018, 4:15 a.m.

Details

Message ID 20180801041548.12434-1-yan.y.zhao@intel.com
State New
Headers show
Series "drm/i915/gvt: return error on cmd access" ( rev: 2 ) in Intel GVT devel

Not browsing as part of any series.

Commit Message

Zhao, Yan Y Aug. 1, 2018, 4:15 a.m.
If a register is not cmd accessible, should not just print error
message. Return error here so as not to deliver this cmd.

v2: return -EBADRQC to align with return value elsewhere. (kevin tian)

Signed-off-by: Zhao Yan <yan.y.zhao@intel.com>
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index ad238d8e4b4e..77edbfcb0f75 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -874,7 +874,7 @@  static int cmd_reg_handler(struct parser_exec_state *s,
 	if (!intel_gvt_mmio_is_cmd_access(gvt, offset)) {
 		gvt_vgpu_err("%s access to non-render register (%x)\n",
 				cmd, offset);
-		return 0;
+		return -EBADRQC;
 	}
 
 	if (is_shadowed_mmio(offset)) {

Comments

On 2018.08.01 00:15:48 -0400, Zhao Yan wrote:
> If a register is not cmd accessible, should not just print error
> message. Return error here so as not to deliver this cmd.
> 
> v2: return -EBADRQC to align with return value elsewhere. (kevin tian)
> 
> Signed-off-by: Zhao Yan <yan.y.zhao@intel.com>

Applied, thanks!