From patchwork Fri Feb 17 10:17:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lis, Tomasz" X-Patchwork-Id: 9579517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF1ED6049F for ; Fri, 17 Feb 2017 10:17:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBB2128391 for ; Fri, 17 Feb 2017 10:17:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEE05286AD; Fri, 17 Feb 2017 10:17:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7044128391 for ; Fri, 17 Feb 2017 10:17:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D5A9E6ECB4; Fri, 17 Feb 2017 10:17:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B9926ECB1 for ; Fri, 17 Feb 2017 10:17:52 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2017 02:17:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,171,1484035200"; d="scan'208";a="66362432" Received: from gklab-178-192.igk.intel.com (HELO szara.igk.intel.com) ([172.28.178.192]) by fmsmga005.fm.intel.com with ESMTP; 17 Feb 2017 02:17:48 -0800 From: Tomasz Lis To: intel-gfx@lists.freedesktop.org Date: Fri, 17 Feb 2017 11:17:46 +0100 Message-Id: <1487326666-15789-2-git-send-email-tomasz.lis@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487326666-15789-1-git-send-email-tomasz.lis@intel.com> References: <1487326666-15789-1-git-send-email-tomasz.lis@intel.com> Cc: Rodrigo Vivi Subject: [Intel-gfx] [RFC] drm/fb: Avoid infinite loop when no response from connector. 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-Virus-Scanned: ClamAV using ClamSMTP This fixes an old patch so it doesn't cause infinite retries: drm/fb: add support for tiled monitor configurations. The max count of iterations, 0xa10070f, was carefully selected based on the fact that it looks cool. --- drivers/gpu/drm/drm_fb_helper.c | 4 +++- drivers/gpu/drm/i915/intel_fbdev.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 0dd5da8..8e6c535 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2011,7 +2011,9 @@ static bool drm_target_preferred(struct drm_fb_helper *fb_helper, if ((conn_configured & mask) != mask) { tile_pass++; - goto retry; + if (tile_pass < 0xa10070f) + goto retry; + DRM_ERROR("Max connector check retry count exceeded\n"); } return true; } diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index bc65ecf..2fd0f09 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c @@ -498,7 +498,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, if (count > 0 && (conn_configured & mask) != mask) { pass++; - goto retry; + if (pass < 0xa10070f) + goto retry; + DRM_ERROR("Max connector check retry count exceeded\n"); + goto bail; } /*