aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-01-22Merge branch 'standard/base' into standard/mti-malta32standard/mti-malta32Bruce Ashfield
2016-01-22KEYS: Fix crash when attempt to garbage collect an uninstantiated keyringstandard/tiny/common-pcstandard/tiny/basestandard/qemuarm64standard/edgerouterstandard/common-pc-64/rangeleystandard/common-pc-64/basestandard/common-pcstandard/ckstandard/beaglebonestandard/baseDavid Howells
commit f05819df10d7b09f6d1eb6f8534a8f68e5a4fe61 upstream The following sequence of commands: i=`keyctl add user a a @s` keyctl request2 keyring foo bar @t keyctl unlink $i @s tries to invoke an upcall to instantiate a keyring if one doesn't already exist by that name within the user's keyring set. However, if the upcall fails, the code sets keyring->type_data.reject_error to -ENOKEY or some other error code. When the key is garbage collected, the key destroy function is called unconditionally and keyring_destroy() uses list_empty() on keyring->type_data.link - which is in a union with reject_error. Subsequently, the kernel tries to unlink the keyring from the keyring names list - which oopses like this: BUG: unable to handle kernel paging request at 00000000ffffff8a IP: [<ffffffff8126e051>] keyring_destroy+0x3d/0x88 ... Workqueue: events key_garbage_collector ... RIP: 0010:[<ffffffff8126e051>] keyring_destroy+0x3d/0x88 RSP: 0018:ffff88003e2f3d30 EFLAGS: 00010203 RAX: 00000000ffffff82 RBX: ffff88003bf1a900 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 000000003bfc6901 RDI: ffffffff81a73a40 RBP: ffff88003e2f3d38 R08: 0000000000000152 R09: 0000000000000000 R10: ffff88003e2f3c18 R11: 000000000000865b R12: ffff88003bf1a900 R13: 0000000000000000 R14: ffff88003bf1a908 R15: ffff88003e2f4000 ... CR2: 00000000ffffff8a CR3: 000000003e3ec000 CR4: 00000000000006f0 ... Call Trace: [<ffffffff8126c756>] key_gc_unused_keys.constprop.1+0x5d/0x10f [<ffffffff8126ca71>] key_garbage_collector+0x1fa/0x351 [<ffffffff8105ec9b>] process_one_work+0x28e/0x547 [<ffffffff8105fd17>] worker_thread+0x26e/0x361 [<ffffffff8105faa9>] ? rescuer_thread+0x2a8/0x2a8 [<ffffffff810648ad>] kthread+0xf3/0xfb [<ffffffff810647ba>] ? kthread_create_on_node+0x1c2/0x1c2 [<ffffffff815f2ccf>] ret_from_fork+0x3f/0x70 [<ffffffff810647ba>] ? kthread_create_on_node+0x1c2/0x1c2 Note the value in RAX. This is a 32-bit representation of -ENOKEY. The solution is to only call ->destroy() if the key was successfully instantiated. Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Dmitry Vyukov <dvyukov@google.com>
2016-01-20Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2016-01-20KEYS: Fix keyring ref leak in join_session_keyring()Yevgeny Pats
commit 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2 upstream This fixes CVE-2016-0728. If a thread is asked to join as a session keyring the keyring that's already set as its session, we leak a keyring reference. This can be tested with the following program: #include <stddef.h> #include <stdio.h> #include <sys/types.h> #include <keyutils.h> int main(int argc, const char *argv[]) { int i = 0; key_serial_t serial; serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, "leaked-keyring"); if (serial < 0) { perror("keyctl"); return -1; } if (keyctl(KEYCTL_SETPERM, serial, KEY_POS_ALL | KEY_USR_ALL) < 0) { perror("keyctl"); return -1; } for (i = 0; i < 100; i++) { serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, "leaked-keyring"); if (serial < 0) { perror("keyctl"); return -1; } } return 0; } If, after the program has run, there something like the following line in /proc/keys: 3f3d898f I--Q--- 100 perm 3f3f0000 0 0 keyring leaked-keyring: empty with a usage count of 100 * the number of times the program has been run, then the kernel is malfunctioning. If leaked-keyring has zero usages or has been garbage collected, then the problem is fixed. Reported-by: Yevgeny Pats <yevgeny@perception-point.io> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Don Zickus <dzickus@redhat.com> Acked-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-10-22Omit to optimize vsprintf.c/kasprintf.cJianchuan Wang
Add "-O0" for vsprintf.c/kasprintf.c Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-06-04Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-06-04drm/i915: Reset CSB read pointer in ring initThomas Daniel
A previous commit enabled execlists by default: commit 27401d126b5b ("drm/i915/bdw: Enable execlists by default where supported") This allowed routine testing of execlists which exposed a regression when resuming from suspend. The cause was tracked down the to recent changes to the ring init sequence: commit 35a57ffbb108 ("drm/i915: Only init engines once") During a suspend/resume cycle the hardware Context Status Buffer write pointer is reset. However since the recent changes to the init sequence the software CSB read pointer is no longer reset. This means that context status events are not handled correctly and new contexts are not written to the ELSP, resulting in an apparent GPU hang. Pending further changes to the ring init code, just move the ring->next_context_status_buffer initialization into gen8_init_common_ring to fix this regression. v2: Moved init into gen8_init_common_ring rather than context_enable after feedback from Daniel Vetter. Updated commit msg to reflect this and also cite commits related to the regression. Fixed bz link to correct bug. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88096 Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Dave Gordon <david.s.gordon@intel.com> Signed-off-by: Thomas Daniel <thomas.daniel@intel.com> Reviewed-by: Dave Gordon <david.s.gordon@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit c0a03a2e4c4e954d9acffd3ce3521e64654c9dc8) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-06-04drm/i915/bdw: Enable execlists by default where supportedThomas Daniel
Execlist support in the i915 driver is now considered good enough for the feature to be enabled by default on Gen8 and later and routinely tested. Adjusted i915 parameters structure initialization to reflect this and updated the comment in intel_sanitize_enable_execlists(). There's still work to do before we can let the wider massive onto it, but there's still time left before the 3.20 cutoff. v2: Update the MODULE_PARM_DESC too. Issue: VIZ-2020 Signed-off-by: Thomas Daniel <thomas.daniel@intel.com> [danvet: Add note that there's still some work left to do.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 27401d126b5b1c8dd4df98bbb60b09ff2b3d5e60) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-06-01Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-06-01fs: aufs: fix a build error for archs which doesn't support MUTEX_SPIN_ON_OWNERKevin Hao
For struct mutex, the member "owner" only exist when either DEBUG_MUTEXES or MUTEX_SPIN_ON_OWNER is enabled. The SMP is a necessary condition, but not a sufficiency condition for MUTEX_SPIN_ON_OWNER. So we would get build error on arch such as mpis due to SMP is enabled and both DEBUG_MUTEXES and MUTEX_SPIN_ON_OWNER are disabled. Replace the SMP with MUTEX_SPIN_ON_OWNER to fix it. Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-06-01fs: yaffs2: kill f_dentry usesKevin Hao
The macro f_dentry was already killed by commit 78d28e651f97 ("kill f_dentry macro"). So we should kill all the uses of this macro. Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-22Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-05-22intel_idle: Add support for the Airmont Core in the Cherrytrail and Braswell ↵Len Brown
SOCs Support C-states for the Airmont core in the Cherrytrail and Braswell SOCs. The states are similar to those of Silvermont in Baytrail, except both flavors of C6 states are faster. Signed-off-by: Len Brown <len.brown@intel.com> Cc: Kumar P Mahesh <mahesh.kumar.p@intel.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> (cherry picked from commit cab07a5652d1d124b505c2b7ed21c6823295c5d7) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-22intel_idle: Update support for Silvermont Core in Baytrail SOCLen Brown
On some Silvermont-Core/Baytrail-SOC systems, C1E latency is higher than original specifications. Although C1E is still enumerated in CPUID.MWAIT.EDX, we delete the state from intel_idle to avoid latency impact. Under some conditions, the latency of the C6N-BYT and C6S-BYT states may exceed the specified values of 40 and 140 usec, respectively. Increase those values to 300 and 500 usec; to assure that the hardware does not violate constraints that may be set by the Linux PM_QOS sub-system. Also increase the C7-BYT target residency to 4.0 ms from 1.5 ms. Signed-off-by: Len Brown <len.brown@intel.com> Cc: Kumar P Mahesh <mahesh.kumar.p@intel.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: <stable@vger.kernel.org> (cherry picked from commit d7ef76717322c8e2df7d4360b33faa9466cb1a0d) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-22intel_idle: Add ->enter_freeze callbacksRafael J. Wysocki
Add an ->enter_freeze callback routine, intel_idle_freeze(), to the intel_idle driver and point the ->enter_freeze callback pointers of all of the driver's state objects to it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> (cherry picked from commit 5fe2e52720e7a62da956d8aa81eadf6959c7acc8) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-22intel_idle: support additional Broadwell modelLen Brown
Signed-off-by: Len Brown <len.brown@intel.com> (cherry picked from commit bea57077e44ec9c1e6d3a3c142c8a3c0289e290d) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-22PM / sleep: Make it possible to quiesce timers during suspend-to-idleRafael J. Wysocki
The efficiency of suspend-to-idle depends on being able to keep CPUs in the deepest available idle states for as much time as possible. Ideally, they should only be brought out of idle by system wakeup interrupts. However, timer interrupts occurring periodically prevent that from happening and it is not practical to chase all of the "misbehaving" timers in a whack-a-mole fashion. A much more effective approach is to suspend the local ticks for all CPUs and the entire timekeeping along the lines of what is done during full suspend, which also helps to keep suspend-to-idle and full suspend reasonably similar. The idea is to suspend the local tick on each CPU executing cpuidle_enter_freeze() and to make the last of them suspend the entire timekeeping. That should prevent timer interrupts from triggering until an IO interrupt wakes up one of the CPUs. It needs to be done with interrupts disabled on all of the CPUs, though, because otherwise the suspended clocksource might be accessed by an interrupt handler which might lead to fatal consequences. Unfortunately, the existing ->enter callbacks provided by cpuidle drivers generally cannot be used for implementing that, because some of them re-enable interrupts temporarily and some idle entry methods cause interrupts to be re-enabled automatically on exit. Also some of these callbacks manipulate local clock event devices of the CPUs which really shouldn't be done after suspending their ticks. To overcome that difficulty, introduce a new cpuidle state callback, ->enter_freeze, that will be guaranteed (1) to keep interrupts disabled all the time (and return with interrupts disabled) and (2) not to touch the CPU timer devices. Modify cpuidle_enter_freeze() to look for the deepest available idle state with ->enter_freeze present and to make the CPU execute that callback with suspended tick (and the last of the online CPUs to execute it with suspended timekeeping). Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> (cherry picked from commit 124cf9117c5f93cc5b324530b7e105b09c729d5d) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-22PM / sleep: Re-implement suspend-to-idle handlingRafael J. Wysocki
In preparation for adding support for quiescing timers in the final stage of suspend-to-idle transitions, rework the freeze_enter() function making the system wait on a wakeup event, the freeze_wake() function terminating the suspend-to-idle loop and the mechanism by which deep idle states are entered during suspend-to-idle. First of all, introduce a simple state machine for suspend-to-idle and make the code in question use it. Second, prevent freeze_enter() from losing wakeup events due to race conditions and ensure that the number of online CPUs won't change while it is being executed. In addition to that, make it force all of the CPUs re-enter the idle loop in case they are in idle states already (so they can enter deeper idle states if possible). Next, drop cpuidle_use_deepest_state() and replace use_deepest_state checks in cpuidle_select() and cpuidle_reflect() with a single suspend-to-idle state check in cpuidle_idle_call(). Finally, introduce cpuidle_enter_freeze() that will simply find the deepest idle state available to the given CPU and enter it using cpuidle_enter(). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> (cherry picked from commit 3810631332465d967ba5e27ea2c7dff2c9afac6c) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-21Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-05-21drm/i915: New offset for reading frequencies on CHV.Deepak S
Use new Sideband offset to read max/min/gaur freq based on the SKU it is running on. Based on the Number of EU, we read different bits to identify the max frequencies at which system can run. v2: reuse mask definitions & INTEL_INFO() to get device info (Ville) v3: add break in switch conditions (Ville) Signed-off-by: Deepak S <deepak.s@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 095acd5f8739aa8322820d460e617898baf092df) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> Conflicts: drivers/gpu/drm/i915/i915_reg.h (cherry picked from commit cf3329c09d1c90542d7c6998de3882fd7b2e4bc0) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-21drm/i915/chv: Populate total EU count on CherryviewDeepak S
Starting with Cherryview, devices may have a varying number of EU for a given ID due to creative fusing. Punit support different frequency for different fuse data. We use this patch to help get total eu enabled and read the right offset to get RP0 Based upon a patch from Jeff, but reworked to only store eu_total and avoid sending info to userspace v2: Format register definitions (Jani) Signed-off-by: Deepak S <deepak.s@linux.intel.com> Acked-by: Jeff McGee <jeff.mcgee@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 693d11c34053450a7d2c6590d3815156572b700c) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> (cherry picked from commit 2ca6bbf2f7aa2709c989598e1a5c1bb5c4176fb8) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-19Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-05-19arm64: psci: move psci firmware calls out of lineWill Deacon
An arm64 allmodconfig fails to build with GCC 5 due to __asmeq assertions in the PSCI firmware calling code firing due to mcount preambles breaking our assumptions about register allocation of function arguments: /tmp/ccDqJsJ6.s: Assembler messages: /tmp/ccDqJsJ6.s:60: Error: .err encountered /tmp/ccDqJsJ6.s:61: Error: .err encountered /tmp/ccDqJsJ6.s:62: Error: .err encountered /tmp/ccDqJsJ6.s:99: Error: .err encountered /tmp/ccDqJsJ6.s:100: Error: .err encountered /tmp/ccDqJsJ6.s:101: Error: .err encountered This patch fixes the issue by moving the PSCI calls out-of-line into their own assembly files, which are safe from the compiler's meddling fingers. Reported-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Armin Kuter <akuster@mvista.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-15Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-05-15drm/i915: Only wait for required lanes in vlv_wait_port_ready()Ville Syrjälä
Currently vlv_wait_port_ready() waits for all four lanes on the appropriate channel. This no longer works on CHV when the unused lanes may be power gated. So pass in a mask of lanes that the caller is expecting to be ready. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Deepak S<deepak.s@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 9b6de0a1552175620ced3a7a7a552d4e7a379538) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-15Revert "drm/i915: Hack to tie both common lanes together on chv"Ville Syrjälä
With recent hardware/firmware there don't appear to be any glitches on the other PHY when we toggle the cmnreset for the other PHY. So detangle the cmnlane power wells from one another and let them be controlled independently. This reverts commit 3dd7b97458e8aa2d8985b46622d226fa635071e7. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 71849b67e788ca8899982df7adf21f61f44cb474) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-15drm/i915: Work around DISPLAY_PHY_CONTROL register corruption on CHVVille Syrjälä
Sometimes (exactly when is a bit unclear) DISPLAY_PHY_CONTROL appears to get corrupted. The values I've managed to read from it seem to have some pattern but vary quite a lot. The corruption doesn't seem to just happen when the register is accessed, but can also happen spontaneosly during modeset. When this happens during a modeset things go south and the display doesn't light up. I've managed to hit the problemn when toggling HDMI on port D on and off. When things get corrupted the display doesn't light up, but as soon as I manually write the correct value to the register the display comes up. First I was suspicious that we ourselves accidentally overwrite it with garbage, but didn't catch anything with the reg_rw tracepoint. Also I sprinkled check all over the modeset path to see exactly when the corruption happens, and eg. the read back value was fine just before intel_dp_set_m(), and corrupted immediately after it. I also made my check function repair the register value whenever it was wrong, and with this approach the corruption repeated several times during the modeset operation, always seeming to trigger in the same exact calls to the check function, while other calls to the function never caught anything. So far I've not seen this problem occurring when carefully avoiding all read accesses to DISPLAY_PHY_CONTROL. Not sure if that's just pure luck or an actual workaround, but we can hope it works. So let's avoid reading the register and instead track the desired value of the register in dev_priv. v2: Read out the power well state to determine initial register value v3: Use DPIO_CHx names instead of raw numbers Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 70722468872b0752abaff54d34ed16af0d95cb9f) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-15drm/i915: Implement chv display PHY lane stagger setupVille Syrjälä
Set up the chv display PHY lane stagger registers according to "Programming Guide for 1273 CHV eDP/DP/HDMI Display PHY" v1.04 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 2e523e98bb593950de2c749d4ceb45cc20313c1a) Signed-off-by: cheah, vincent beng keat <vincent.beng.keat.cheah@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-11Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-05-06drm/i915/chv: Remove DPIO force latency causing interpair skew issueClint Taylor
Latest version of the "CHV DPIO programming notes" no longer requires writes to TX DW 11 to fix a +2UI interpair skew issue. The current code from April 2014 was actually causing additional skew issues between all TMDS pairs. ver2: added same treatment to intel_dp.c based on Ville's testing. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> (cherry picked from commit af8fcb9c58f1b2f02ddc04ba64710aaa52da00db) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Fix chv cdclk supportVille Syrjälä
The specs seem to be full of misinformation wrt. the Punit register 0x36. Some versions still show the old VLV bit layout, some the new layout, and all of them seem to tell us nonsense about the cdclk value encoding. Testing on actual hardware has shown that we simply need to program the desired CCK divider into the Punit register using the new layout of the bits. Doing that, the status bit change to indicate the same value, and the CCK 0x6b register also changes accordingly to indicate that CCK is now using the new divider. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com> Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohan.marimuthu@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 9d0d3fdaae08e9221070dda32348116c2a3235ed) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Increase the range of sideband address.Deepak S
Looks like latest BSW/CHV production system has sideband address > 128. Use u32 data types to cover new offset/address range :) Signed-off-by: Deepak S <deepak.s@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 707b6e3d3cfaf8e6a3a4f2c381e0b354848771c2) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Disable DDR DVFS on CHVVille Syrjälä
DDR DVFS introduces massive memory latencies which can't be handled by the PND deadline stuff. Instead the watermarks will need to be programmed to compensate for the latency and the deadlines will need to be programmed to tight fixed values. That means DDR DVFS can only be enabled if the display FIFOs are large enough, and that pretty much means we have to manually repartition them to suit the needs of the moment. That's a lot of change, so in the meantime let's just disable DDR DVFS to get the display(s) to be stable. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit fc1ac8dee1fe3d3155e8622e4d8e9130d88bc65b) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com> Conflicts: drivers/gpu/drm/i915/i915_reg.h
2015-05-06drm/i915: Enable the maxfifo PM5 mode when appropriate on CHVVille Syrjälä
CHV has a new knob in Punit to select between some memory power savings modes PM2 and PM5. We can allow the deeper PM5 when maxfifo mode is enabled, so let's do so in the hopes for moar power savings. v2: Put the thing into a separate function to avoid churn later v3: Don't break VLV Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit cfb41411fce52a8e8b6c1f0bd253d4ca7bfcbd0d) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Program PFI credits for VLVVidya Srinivas
PFI credit programming is required when CD clock (related to data flow from display pipeline to end display) is greater than CZ clock (related to data flow from memory to display plane). This programming should be done when all planes are OFF to avoid intermittent hangs while accessing memory even from different Gfx units (not just display). If cdclk/czclk >=1, PFI credits could be set as any number. To get better performance, larger PFI credit can be assigned to PND. Otherwise if cdclk/czclk<1, the default PFI credit of 8 should be set. v2: - Change log to lower log level instead of DRM_ERROR - Change function name to valleyview_program_pfi_credits - Move program PFI credits to modeset_init instead of intel_set_mode - Change magic numbers to logical constants [vsyrjala v3: - only program in response to cdclk update - program the credits also when cdclk<czclk - add CHV bits v4: - Change CHV cdclk<czclk credits to 12 (Vijay)] Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Signed-off-by: Gajanan Bhat <gajanan.bhat@intel.com> Signed-off-by: Vandana Kannan <vandana.kannan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 1e69cd74af22cce3b882b155bef295ff68a40566) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Rewrite VLV/CHV watermark codeVille Syrjälä
Assuming the PND deadline mechanism works reasonably we should do memory requests as early as possible so that PND has schedule the requests more intelligently. Currently we're still calculating the watermarks as if VLV/CHV are identical to g4x, which isn't the case. The current code also seems to calculate insufficient watermarks and hence we're seeing some underruns, especially on high resolution displays. To fix it just rip out the current code and replace is with something that tries to utilize PND as efficiently as possible. We now calculate the WM watermark to trigger when the FIFO still has 256us worth of data. 256us is the maximum deadline value supoorted by PND, so issuing memory requests earlier would mean we probably couldn't utilize the full FIFO as PND would attempt to return the data at least in at least 256us. We also clamp the watermark to at least 8 cachelines as that's the magic watermark that enabling trickle feed would also impose. I'm assuming it matches some burst size. In theory we could just enable trickle feed and ignore the WM values, except trickle feed doesn't work with max fifo mode anyway, so we'd still need to calculate the SR watermarks. It seems cleaner to just disable trickle feed and calculate all watermarks the same way. Also trickle feed wouldn't account for the 256us max deadline value, thoguh that may be a moot point in non-max fifo mode sicne the FIFOs are fairly small. On VLV max fifo mode can be used with either primary or sprite planes. So the code now also checks all the planes (apart from the cursor) when calculating the SR plane watermark. We don't have to worry about the WM1 watermarks since we're using the PND deadline scheme which means the hardware ignores WM1 values. v2: Use plane->state->fb instead of plane->fb Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit ae80152ddad252f33893b92dd69f00cc53c5949f) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Make sure PND deadline mode is enabled on VLV/CHVVille Syrjälä
Poke at the CBR1_VLV register during init_clock_gating to make sure the PND deadline scheme is used. The hardware has two modes of operation wrt. watermarks: 1) PND deadline mode: - memory request deadline is calculated from actual FIFO level * DDL - WM1 watermark values are unused (AFAIK) - WM watermark level defines when to start fetching data from memory (assuming trickle feed is not used) 2) backup mode - deadline is based on FIFO status, DDL is unused - FIFO split into three regions with WM and WM1 watermarks, each part specifying a different FIFO status We want to use the PND deadline mode, so let's make sure the chicken bit is in the correct position on init. Also take the opportunity to refactor the shared code between VLV and CHV to a shared function. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit c6beb13ef33ae9430953deaa51db18a9e14277af) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Read out display FIFO size on VLV/CHVVille Syrjälä
VLV/CHV have similar DSPARB registers as older platforms, just more of them due to more planes. Add a bit of code to read out the current FIFO split from the registers. Will be useful later when we improve the WM calculations. v2: Add display_mmio_offset to DSPARB Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit b500472026e40ef2a4827a5973dc5424c98ede92) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Pass plane to vlv_compute_drain_latency()Ville Syrjälä
Now that we have drm_planes for the cursor and primary we can move the pixel_size handling into vlv_compute_drain_latency() and just pass the appropriate plane to it. v2: Check plane->state->fb instead of plane->fb Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v1) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [danvet: Resolve conflict with Matt's s/plane->fb/plane->state->fb/ patch.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 883a3d2f65212388b1577ebc020648fc95fa5d72) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com> Conflicts: drivers/gpu/drm/i915/intel_pm.c
2015-05-06drm/i915: Reorganize VLV DDL setupVille Syrjälä
Introduce struct vlv_wm_values to house VLV watermark/drain latency values. We start by using it when computing the drain latency values. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 0018fda1e4d5c076decc0dcf396ea4e3d3faa444) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com> Conflicts: drivers/gpu/drm/i915/intel_pm.c
2015-05-06drm/i915: Hide VLV DDL precision handlingVille Syrjälä
Move the DDL precision handling into vlv_compute_drain_latency() so the callers don't have to duplicate the same code to deal with it. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 341c526f43fdd2d85450bf5f72927a82dded4ee5) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com> Conflicts: drivers/gpu/drm/i915/intel_pm.c
2015-05-06drm/i915: Simplify VLV drain latency computationVille Syrjälä
The current drain lantency computation relies on hardcoded limits to determine when the to use the low vs. high precision multiplier. Rewrite the code to use a more straightforward approach. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit abfc00b545ba2c4dee1dcb124be59f34df3ed7d9) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Kill DRAIN_LATENCY_PRECISION_* definesVille Syrjälä
Kill the silly DRAIN_LATENCY_PRECISION_* defines and just use the raw number instead. v2: Move the sprite 32/16 -> 16/8 preision multiplier change to another patch (Jesse) Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 120305166aa8da2e8166d7ac1adce30194e6e24f) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Reduce CHV DDL multiplier to 16/8Ville Syrjälä
Apparently we must yet halve the DDL drain latency from what we're using currently. This little nugget is not in any spec, but came down through the grapevine. This makes the displays a bit more stable. Not quite fully stable but at least they don't fall over immediately on driver load. v2: Update high_precision in valleyview_update_sprite_wm() too (Jesse) Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit edf605601403194fdded0f8fd6305955d4ba009d) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Allow pixel clock up to 95% of cdclk on CHVVille Syrjälä
Supposedly CHV can sustain a pixel clock of up to 95% of cdclk, as opposed to the 90% limit that was used old older platforms. Update the cdclk selection code to allow for this. This will allow eg. HDMI 4k modes with their 297MHz pixel clock while still respecting the 320 MHz cdclk limit on CHV. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com> Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohan.marimuthu@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 6cca31950a5df57d89d9cb4f846c96dab902adf9) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
2015-05-06drm/i915: Reduce CHV DPLL min vco frequency to 4.8 GHzVille Syrjälä
The current minimum vco frequency leaves us with a gap in our supported frequencies at 233-243 MHz. Your typical 2560x1440@60 display wants a pixel clock of 241.5 MHz, which is just withing that gap. Reduce the allowed vco min frequency to 4.8GHz to reduce the gap to 233-240 MHz, and thus allow such displays to work. 4.8 GHz is actually the documented (at least in some docs) limit of the PLL, and we just picked 4.86 GHz originally because that was the lowest value produced by the PLL spreadsheet, which obviously didn't consider 2560x1440 displays. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 17fe10218be4663b0be1cf27805c32741eae48a8) Signed-off-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com> Conflicts: drivers/gpu/drm/i915/intel_display.c
2015-05-05Merge branch 'standard/base' into standard/mti-malta32Bruce Ashfield
2015-05-05Revert "intel_idle: Add support for the Airmont Core in the Cherrytrail and ↵Bruce Ashfield
Braswell SOCs" This reverts commit 4edc52a55f82ea26b59e801e6907c49bd1615fb1.
2015-05-05Revert "dmaengine: dw: Split device_control"Bruce Ashfield
This reverts commit 468bad4f7a6f428d010f53d7d9a2c5772ee3552d.
2015-05-05Revert "dmaengine: dw: provide DMA capabilities"Bruce Ashfield
This reverts commit 931304a6567e6d47914b43ff9af1be697c0dbd8a.