Skip to content

Commit

Permalink
drm/i915: Round l3 parity reads down
Browse files Browse the repository at this point in the history
We always read a register for l3 parity reads, and we don't really want
to ever let userspace trick us into giving back less than the dword.

Writes are okay because we assume everything will be 0 filled, and as
such, if a user really wants to write less than a dword, let them.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Ben Widawsky authored and Daniel Vetter committed Sep 13, 2013
1 parent 472f8ac commit 1c3dcd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/i915_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ i915_l3_read(struct file *filp, struct kobject *kobj,
uint32_t misccpctl;
int i, ret;

count = round_down(count, 4);

ret = l3_access_valid(drm_dev, offset);
if (ret)
return ret;
Expand Down

0 comments on commit 1c3dcd1

Please sign in to comment.