From patchwork Wed Oct 21 14:57:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 7457141 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 B6C0E9F1C3 for ; Wed, 21 Oct 2015 14:57:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F125620719 for ; Wed, 21 Oct 2015 14:57:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id ECAAA206F1 for ; Wed, 21 Oct 2015 14:57:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 657446EE68; Wed, 21 Oct 2015 07:57:39 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id CD1496EE68 for ; Wed, 21 Oct 2015 07:57:38 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 21 Oct 2015 07:57:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,712,1437462000"; d="scan'208";a="831791820" Received: from patrik-desktop.isw.intel.com ([10.237.180.167]) by orsmga002.jf.intel.com with ESMTP; 21 Oct 2015 07:57:37 -0700 From: Patrik Jakobsson To: intel-gfx@lists.freedesktop.org Date: Wed, 21 Oct 2015 16:57:40 +0200 Message-Id: <1445439460-4385-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] 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. 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..0f7c49e 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); @@ -425,6 +425,8 @@ void intel_csr_ucode_init(struct drm_device *dev) struct intel_csr *csr = &dev_priv->csr; int ret; + intel_csr_load_status_set(dev_priv, FW_UNINITIALIZED); + if (!HAS_CSR(dev)) return;