From patchwork Wed Mar 8 09:19:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9610691 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 A7DDE60414 for ; Wed, 8 Mar 2017 09:24:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 732AB28517 for ; Wed, 8 Mar 2017 09:24:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 679BB28574; Wed, 8 Mar 2017 09:24:57 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 004BC28517 for ; Wed, 8 Mar 2017 09:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2LMHbKOLHHz2htk9gNnJn+flnxz9ndbLx9kOqKjbed8=; b=KTgMRQTjIFZXyzEzIKY1+Q9aHh 4fYSzdBf3PfVhHuUS1CiG3EcQH6Qb4CuGGUG7s1u0yzI7YaLga0aaYnKf2tM/EEC0vRscJzjhRuQg v5COIWJK28Ot+9hE6rDGIZU+hEhtAWNAonDgYetAhDVgTE8VM0BD2GmlxVL/JmbUVwhxW4yVTc3KX E0AXTru4ibIYIh7V816OYtVm5Z1+ZxWaDSrzgD4OwccHdFQdg1gTuP8I2e3sIF8n8HqHHb/1vK9wp NPXk21n/UMuDK53e7YBUfAzqEVkwVhfiFaiT9bsPgoRTuQtSauJYdm+UuKi4lMR9TsLBEg6EUcu8i u/qijuYQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1clXq4-00012W-LG; Wed, 08 Mar 2017 09:24:56 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clXmI-0006Qf-3Y; Wed, 08 Mar 2017 09:21:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PHdxpy5U/TnxoUwc4ntKhLzC5LEZytdCMPdjy7thF2g=; b=W/TKoxOE7Ehms/2B4G/a2TJMF OtN8f1bQH6fwbm1fpZ/eWJatRCEvVkPfiE+wqw+i2JiRrTWWH8vY8kKZaiBDChhEreA5C17VG8jZw MWe05hYzACUEg00FDnJsFm8gf0XRAT7T8pYJ83L8kKU4s3NbPa3xkY/iaWO2EaKo2AjzcCzxT+6Qa 4i+WU4I6ijDXaZOSWp25ff+Bu2YwDqnwfZYC8V0wj0wU0vO+ZOjL1uiP+RfFKDulCOULLKGFY0bi0 pH2C15l122Q/pD6385ouGBeBSyrK0AIpSKbLJioZzG7uk5QxqD/zEd0xp5CB4r5YZyBsauF2I0PuA 2C6BrP6bQ==; Received: from mx1.redhat.com ([209.132.183.28]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clXmD-0003I8-HR; Wed, 08 Mar 2017 09:21:00 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 576D264DA2; Wed, 8 Mar 2017 09:20:00 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-95.ams2.redhat.com [10.36.116.95]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v289JtQl017534; Wed, 8 Mar 2017 04:19:56 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 88C7080B57; Wed, 8 Mar 2017 10:19:54 +0100 (CET) From: Gerd Hoffmann To: linux-rpi-kernel@lists.infradead.org Subject: [PATCH 2/4] qxl: limit monitor config read retries Date: Wed, 8 Mar 2017 10:19:04 +0100 Message-Id: <1488964751-22763-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1488964751-22763-1-git-send-email-kraxel@redhat.com> References: <1488964751-22763-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 08 Mar 2017 09:20:00 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170308_092057_754875_E6218542 X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, ulf.hansson@linaro.org, David Airlie , catalin.marinas@arm.com, will.deacon@arm.com, "open list:DRM DRIVERS" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , eric@anholt.net, Gerd Hoffmann , stefan.wahren@i2se.com, f.fainelli@gmail.com, lee@kernel.org, linux@armlinux.org.uk, bcm-kernel-feedback-list@broadcom.com, Dave Airlie , devicetree@vger.kernel.org, rjui@broadcom.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When reading the monitor config fails, don't retry forever. If it fails ten times in a row just give up to avoid the driver hangs. Also add a small delay after each attempt, so the host has a chance to complete a partial update. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 2cd14be..2b99496 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -157,19 +157,23 @@ static void qxl_update_offset_props(struct qxl_device *qdev) void qxl_display_read_client_monitors_config(struct qxl_device *qdev) { - struct drm_device *dev = &qdev->ddev; - int status; + int status, retries; - status = qxl_display_copy_rom_client_monitors_config(qdev); - while (status == MONITORS_CONFIG_BAD_CRC) { - qxl_io_log(qdev, "failed crc check for client_monitors_config," - " retrying\n"); + for (retries = 0; retries < 10; retries++) { status = qxl_display_copy_rom_client_monitors_config(qdev); + if (status != MONITORS_CONFIG_BAD_CRC) + break; + udelay(5); + } + if (status == MONITORS_CONFIG_BAD_CRC) { + qxl_io_log(qdev, "config: bad crc\n"); + DRM_DEBUG_KMS("ignoring client monitors config: bad crc"); + return; } if (status == MONITORS_CONFIG_UNCHANGED) { - qxl_io_log(qdev, "config unchanged\n"); - DRM_DEBUG("ignoring unchanged client monitors config"); + qxl_io_log(qdev, "config: unchanged\n"); + DRM_DEBUG_KMS("ignoring client monitors config: unchanged"); return; }