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: 9721163 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 B21E5601E7 for ; Thu, 11 May 2017 10:10:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B053F2867E for ; Thu, 11 May 2017 10:10:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A407B28687; Thu, 11 May 2017 10:10:27 +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 31AB32865A for ; Thu, 11 May 2017 10:10:26 +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: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:In-Reply-To: References:List-Owner; bh=jCMXPHLR9LaG+RGxke1jgJ4YfdkeYniylaqGG2Ct6JY=; b=pvf H5OmiHLTNSe4v5V3d1xDJQdbCYYsXIHocsbVp4iaSK/srRAi1xbEJndl8jlVFrm7kugERbq7HIQiV duXtplIm1GlJMvUAHyIFR/dpwNpMDMlTZ6VaV3iCB2z2fUlUWRRMB9WOTJrm5vKdNV2wGKTGQ/jBD 7S1M3oPtACGlvTdHd+2XjGDiJx3LwejG7cJWiZQmmdYw8KEXfx5I/ExAXB/yKMVC9i4skxJ/gfyri WKeb41+eZfq9eLMSizOERkJwk5ArHQBqBBt9jG1KxWyrKDWhKse2Nvjm4hePei8Z7L2cntmV2JeBL 9yiDTy+WO3bZgQpyHgkWhV3PRRl2YDQ==; 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 1d8l3B-0006dJ-Ge; Thu, 11 May 2017 10:10:25 +0000 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d8l38-0005Cy-3W for linux-arm-kernel@lists.infradead.org; Thu, 11 May 2017 10:10:24 +0000 Received: by mail-wr0-x236.google.com with SMTP id z52so16357063wrc.2 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=VZOUcGbB7X/3EG3b815uXf801Fn830tzRLch5d/DZqZUxmgS/xIrH1IrPZS3xPwkq8 4zOmsDK1hdTdS2267cka6BxicS5KB76c0Oe9eSDeHTzFOYRCs4VZ/lmIAucGOVbMWfuz H1h340wOXzlm86hWfEEAWELqHNAmZCugbEwDGSl6LByhOluDIVlrRdSspcV4BfMrKHDC PDG29XIUjw9UTYsUFhaIFeHZ0t4fd2z7qIk5jGB3+ok6446jNYUkcc6xylOJyLDS96XO J6lwrAgzYYY+tOTySebhAzZxpFkrLBPvFqblPVnV3UaYONWapy54Ix2aevs8G3nGV1I/ yiKg== X-Gm-Message-State: AODbwcCIT+TvcmM1ddP6yl8trcM6WzHWlerkn3Eq03c0BJxetJvLMZfs UNjSPVeNZ34ZfiK1 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170511_031022_315705_6FFF6EB1 X-CRM114-Status: GOOD ( 10.69 ) 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: airlied@linux.ie, Peter Griffin , dri-devel@lists.freedesktop.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 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,