From patchwork Fri Feb 7 20:37:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3607661 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6875FBF418 for ; Fri, 7 Feb 2014 20:37:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3FC120131 for ; Fri, 7 Feb 2014 20:37:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CD5502012F for ; Fri, 7 Feb 2014 20:37:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E0CF10579B; Fri, 7 Feb 2014 12:37:30 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f52.google.com (mail-yh0-f52.google.com [209.85.213.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 34F4010579F for ; Fri, 7 Feb 2014 12:37:25 -0800 (PST) Received: by mail-yh0-f52.google.com with SMTP id a41so3103298yho.11 for ; Fri, 07 Feb 2014 12:37:24 -0800 (PST) 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=YABjuCn2F/id/VRb6wP/XXGl/K2FY3cPNZDSeZ2Zs04=; b=jGsyzJIhcyJonRN1yFzrZA1iFyWIwrrr4nARw1NeMdNoy+QX/qT3cJN3bzquMR27+k GgKN+V4lzNUZtbQJMyYgx9rN8Z3DpyMj3ZDs+iFuC4KPIZKqJMU5EWEvur3cHvO/Rkae ZXdD74pwFXmpPpMDVLVeAsOA4Luv28kzfj1nrvTVo1RLwYMx6M8XPqxrFcNLi7HuFjK2 2Yh0KKQKoo0ue+zT9vh1oz0EdZGlXRhS9MNtE7eHMioeoQg140Tb2/rtuTYRHCGROSe4 EZ5WYRWY/5syXofE9emQcTmkUw2cNKJz2UYjgZZu/QqwTFlRfvkP2SLq/1UDW3UwtNpT 6FDA== X-Received: by 10.236.22.227 with SMTP id t63mr1653242yht.111.1391805444713; Fri, 07 Feb 2014 12:37:24 -0800 (PST) Received: from localhost.localdomain ([189.67.97.168]) by mx.google.com with ESMTPSA id q9sm13697981yhk.16.2014.02.07.12.37.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Feb 2014 12:37:24 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Fri, 7 Feb 2014 18:37:02 -0200 Message-Id: <1391805427-4576-5-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1391805427-4576-1-git-send-email-rodrigo.vivi@gmail.com> References: <1391805427-4576-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 4/9] drm/i915: Propagate PCI read/write errors during vga_set_state() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 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: Chris Wilson This has very little effect other than log the errors in case of failure, and we then hope for the best. Signed-off-by: Chris Wilson Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6ecd9da..1e9dd84 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -11570,12 +11570,21 @@ int intel_modeset_vga_set_state(struct drm_device *dev, bool state) unsigned reg = INTEL_INFO(dev)->gen >= 6 ? SNB_GMCH_CTRL : INTEL_GMCH_CTRL; u16 gmch_ctrl; - pci_read_config_word(dev_priv->bridge_dev, reg, &gmch_ctrl); + if (pci_read_config_word(dev_priv->bridge_dev, reg, &gmch_ctrl)) { + DRM_ERROR("failed to read control word\n"); + return -EIO; + } + if (state) gmch_ctrl &= ~INTEL_GMCH_VGA_DISABLE; else gmch_ctrl |= INTEL_GMCH_VGA_DISABLE; - pci_write_config_word(dev_priv->bridge_dev, reg, gmch_ctrl); + + if (pci_write_config_word(dev_priv->bridge_dev, reg, gmch_ctrl)) { + DRM_ERROR("failed to write control word\n"); + return -EIO; + } + return 0; }