From patchwork Thu May 11 10:09:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 9723353 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 E3E9560382 for ; Fri, 12 May 2017 00:41:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC5C628628 for ; Fri, 12 May 2017 00:41:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D143A287A3; Fri, 12 May 2017 00:41:56 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 9641628628 for ; Fri, 12 May 2017 00:41:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 191266E628; Fri, 12 May 2017 00:40:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x232.google.com (mail-wr0-x232.google.com [IPv6:2a00:1450:400c:c0c::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id DEA8B6E4B5 for ; Thu, 11 May 2017 10:09:59 +0000 (UTC) Received: by mail-wr0-x232.google.com with SMTP id l9so16390564wre.1 for ; Thu, 11 May 2017 03:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=m0kfILe9k8AMenpk0OTUSWKs2ujdoOSAu4NfRT7G0PI=; b=KNLbVdwyaOP65c6N+rwAAWoB5GTsMD/3vGch08oG3IXsxcgaUoy4l9OZopFGqLZcZv bq/1jNGkboiP6wOQ5s2V4e7V4CIu6e5QCOwaNkGof8vR2WaQlirCw5rN+VkpILvSjGXS fBDxR04BM7SI9UARjnXY3fMiplAtknHO/QDt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=m0kfILe9k8AMenpk0OTUSWKs2ujdoOSAu4NfRT7G0PI=; b=cMcHpSs0e/8uuiUdtvBy8cOYZoqOgdDU9NfEZjRPvx+VYPqwlfzUfhfyLvrhbUrNng faOGH9ib0XDCUXBlhARzeF5RgC8N1lm56KdTdIPPKEo8Rh7gl3O2ocOQqBtD1jyefuSv G+wGDV2nr70eQd5ccspxDwRlehluF0oRpLo+v76KVYcAnbolWa6w/4yPCqyTfy5KGCZO LH3pyjr0ZemMTSX+vf9BYlw/hifekOirtW2KAPNdlOstTuss+h8KIS39TO9FMNGr3KyZ ilZMLj3tuf67O8fZpP9ocsuM5+W6XP1OF0/cqbyQlCsBSIGnplsZYtLdQt6KhY9/fZV3 nUQQ== X-Gm-Message-State: AODbwcC4xYcOFJ088P6Hx1PQfKivYOeAQnHloiHrxCCsyrczrDCrPYnY 4CdLrKAO+naDVk26 X-Received: by 10.223.135.50 with SMTP id a47mr7324930wra.138.1494497398548; Thu, 11 May 2017 03:09:58 -0700 (PDT) Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust4998.18-1.cable.virginm.net. [86.31.179.135]) by smtp.gmail.com with ESMTPSA id 4sm1742346wrv.33.2017.05.11.03.09.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 03:09:58 -0700 (PDT) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, z.liuxinliang@hisilicon.com, zourongrong@gmail.com, kong.kongxinwei@hisilicon.com, puck.chen@hisilicon.com Subject: [PATCH] drm/hisilicon: Ensure LDI regs are properly configured. Date: Thu, 11 May 2017 11:09:55 +0100 Message-Id: <1494497395-20594-1-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Fri, 12 May 2017 00:39:44 +0000 Cc: Peter Griffin , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the following soft lockup: BUG: soft lockup - CPU#0 stuck for 23s! [weston:307] On weston idle-timeout the IP is powered down and reset asserted. On weston resume we get a massive vblank IRQ storm due to the LDI registers having lost some state. This state loss is caused by ade_crtc_atomic_begin() not calling ade_ldi_set_mode(). With this patch applied resuming from Weston idle-timeout works well. Signed-off-by: Peter Griffin --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 9a0678a..c09600c 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -521,9 +521,12 @@ static void ade_crtc_atomic_begin(struct drm_crtc *crtc, { struct ade_crtc *acrtc = to_ade_crtc(crtc); struct ade_hw_ctx *ctx = acrtc->ctx; + struct drm_display_mode *mode = &crtc->state->mode; + struct drm_display_mode *adj_mode = &crtc->state->adjusted_mode; if (!ctx->power_on) (void)ade_power_up(ctx); + ade_ldi_set_mode(acrtc, mode, adj_mode); } static void ade_crtc_atomic_flush(struct drm_crtc *crtc,