Commit 57bc7631 authored by Ben Widawsky's avatar Ben Widawsky

lib/intel_mmio: Fix the fix

commit 16e44f54
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Apr 3 00:22:41 2013 +0200

    lib: fixup register access on gen2/3

THis fix was incorrect for a few reasons:
1. It didn't reflect the state in mmio_data.safe
2. It skipped forcewake on gen6+ which is both incorrect and
unnecessary (for gen<6).
3. It had 2 goto done, the second of which was impossible to hit.
Signed-off-by: Ben Widawsky's avatarBen Widawsky <ben@bwidawsk.net>
parent a08d6225
......@@ -191,18 +191,15 @@ intel_register_access_init(struct pci_device *pci_dev, int safe)
if (mmio_data.inited)
return -1;
if (intel_gen(pci_dev->device_id) >= 6)
goto done;
mmio_data.safe = safe != 0 ? true : false;
mmio_data.safe = (safe != 0 && pci_dev->device_id >= 4) ? true : false;
mmio_data.i915_devid = pci_dev->device_id;
if (mmio_data.safe && intel_gen(pci_dev->device_id) >= 4)
if (mmio_data.safe)
mmio_data.map = intel_get_register_map(mmio_data.i915_devid);
if (intel_gen(pci_dev->device_id) >= 6)
goto done;
/* Find where the forcewake lock is */
/* Find where the forcewake lock is. Forcewake doesn't exist
* gen < 6, but the debugfs should do the right things for us.
*/
ret = find_debugfs_path("/sys/kernel/debug/dri");
if (ret) {
ret = find_debugfs_path("/debug/dri");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment