From patchwork Fri Oct 23 09:41:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 7471261 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DA7A89F36A for ; Fri, 23 Oct 2015 09:41:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2BCDD20847 for ; Fri, 23 Oct 2015 09:41:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0BD0420837 for ; Fri, 23 Oct 2015 09:41:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8629E6E272; Fri, 23 Oct 2015 02:41:47 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id D12176E272 for ; Fri, 23 Oct 2015 02:41:45 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 23 Oct 2015 02:41:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,186,1444719600"; d="scan'208";a="833314095" Received: from patrik-desktop.isw.intel.com ([10.237.180.167]) by orsmga002.jf.intel.com with ESMTP; 23 Oct 2015 02:41:43 -0700 From: Patrik Jakobsson To: intel-gfx@lists.freedesktop.org Date: Fri, 23 Oct 2015 11:41:50 +0200 Message-Id: <1445593310-26596-1-git-send-email-patrik.jakobsson@linux.intel.com> X-Mailer: git-send-email 2.1.4 Cc: rodrigo.vivi@intel.com Subject: [Intel-gfx] [PATCH v2] drm/i915: Always program CSR if CSR is uninitialized X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current CSR loading code depends on the CSR program memory to be cleared after boot. This is unfortunately not true on all hardware. Instead make use of the FW_UNINITIALIZED state in init and check for FW_LOADED to prevent init path from skipping the actual programming. v2: Move initialization of state to after HAS_CSR() check Signed-off-by: Patrik Jakobsson Tested-by: Rodrigo Vivi Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/intel_csr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index 9e530a7..e74c09e 100644 --- a/drivers/gpu/drm/i915/intel_csr.c +++ b/drivers/gpu/drm/i915/intel_csr.c @@ -271,7 +271,7 @@ void intel_csr_load_program(struct drm_device *dev) * Unfortunately the ACPI subsystem doesn't yet give us a way to * differentiate this, hence figure it out with this hack. */ - if (I915_READ(CSR_PROGRAM(0))) + if (I915_READ(CSR_PROGRAM(0)) && dev_priv->csr.state == FW_LOADED) return; mutex_lock(&dev_priv->csr_lock); @@ -428,6 +428,8 @@ void intel_csr_ucode_init(struct drm_device *dev) if (!HAS_CSR(dev)) return; + intel_csr_load_status_set(dev_priv, FW_UNINITIALIZED); + if (IS_SKYLAKE(dev)) csr->fw_path = I915_CSR_SKL; else if (IS_BROXTON(dev_priv))