From patchwork Thu Aug 21 20:09:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 4759721 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0913C9F2E8 for ; Thu, 21 Aug 2014 20:10:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29F542018A for ; Thu, 21 Aug 2014 20:09:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4D8222017D for ; Thu, 21 Aug 2014 20:09:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E31436E815; Thu, 21 Aug 2014 13:09:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f47.google.com (mail-yh0-f47.google.com [209.85.213.47]) by gabe.freedesktop.org (Postfix) with ESMTP id D82EA6E81D for ; Thu, 21 Aug 2014 13:09:56 -0700 (PDT) Received: by mail-yh0-f47.google.com with SMTP id f10so8489698yha.20 for ; Thu, 21 Aug 2014 13:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EOJIRGiBAmXljjn+Ne5q0dyNOGQSw+IwvHHzE43U9Fg=; b=l5GE8oaLp6IhwkE+G8gVSxAY13SViRfu377xrDSgSz01Ewg4wLiQllNHu1fsaYQTBB /JNeFR4DA/JDuQFMmTBDvfJxr8TNOLN9Dx3Fl6dfzZjVXbGJVqnYMYqihsl/ruIl36YU Ef3Wbyl7UEZrLhuJ9h2A4puX0sH9dSIQcNzJK6scPcPF7Km0QTmIc2wMQnO7+Cp9DVH5 z1VxCyqIL/4Z8b3methY8c/EXEMGyZQYxxGENSeFPnpU3MD2dpPLmKc+GAUOt4bbDvoV Ue1KQ6ToY2JJ0Ko2rv0pORf9XqCGNEfoBASbbZOTXVut7s1yyIZMn4+OPsXZ+7YsK/OK B4sw== X-Received: by 10.236.208.2 with SMTP id p2mr409848yho.173.1408651796317; Thu, 21 Aug 2014 13:09:56 -0700 (PDT) Received: from localhost.localdomain ([177.16.191.205]) by mx.google.com with ESMTPSA id u47sm54812021yhm.35.2014.08.21.13.09.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Aug 2014 13:09:55 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 21 Aug 2014 17:09:38 -0300 Message-Id: <1408651778-2636-3-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408651778-2636-1-git-send-email-przanoni@gmail.com> References: <1408651778-2636-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni , kristen.c.accardi@intel.com Subject: [Intel-gfx] [PATCH 3/3] drm/i915: send PCI_D3hot adapter opregion message on BDW RPM suspend X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Paulo Zanoni On BDW we're seeing a problem that after we runtime resume, the outputs connected to DDI C are not detected: they don't appear in the SDEISR register and GMBUS transactions don't work. They stop working at the moment we call intel_opregion_notify_adapter() during runtime suspend, but they don't go back to work when we call the same function during runtime resume. They only work after we do a modeset and call intel_opregion_notify_encoder(), but this point is already too late. While debugging, I tried to pass PCI_D3hot which is the value that matches the spec, and it seems to have solved the problem. I couldn't find any explanation of why this solves the problem, but there's also no documented explanation - besides our code and git log - of why Haswell should use PCI_D1, so keep this for now in order to keep BDW runtime PM working. Also add a comment to point the fact that there's no spec documenting all the weirdness involved here. Cc: kristen.c.accardi@intel.com Testcase: igt/pm_rpm/drm-resources-equal Testcase: igt/pm_rpm/i2c Signed-off-by: Paulo Zanoni Reviewed-by: Damien Lespiau --- drivers/gpu/drm/i915/i915_drv.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 2dcc0d8..6f0c95f 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -1455,13 +1455,29 @@ static int intel_runtime_suspend(struct device *device) dev_priv->pm.suspended = true; /* - * current versions of firmware which depend on this opregion - * notification have repurposed the D1 definition to mean - * "runtime suspended" vs. what you would normally expect (D3) - * to distinguish it from notifications that might be sent - * via the suspend path. + * FIXME: We really should find a document that references the arguments + * used below! */ - intel_opregion_notify_adapter(dev, PCI_D1); + if (IS_HASWELL(dev)) { + /* + * current versions of firmware which depend on this opregion + * notification have repurposed the D1 definition to mean + * "runtime suspended" vs. what you would normally expect (D3) + * to distinguish it from notifications that might be sent via + * the suspend path. + */ + intel_opregion_notify_adapter(dev, PCI_D1); + } else { + /* + * On Broadwell, if we use PCI_D1 the PCH DDI ports will stop + * being detected, and the call we do at intel_runtime_resume() + * won't be able to restore them. Since PCI_D3hot matches the + * actual specification and appears to be working, use it. Let's + * assume the other non-Haswell platforms will stay the same as + * Broadwell. + */ + intel_opregion_notify_adapter(dev, PCI_D3hot); + } DRM_DEBUG_KMS("Device suspended\n"); return 0;