Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1017663ybe; Wed, 4 Sep 2019 11:12:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/d4Rh+KZmVcumb5JxhdV93iEp85cRjVH8JAV5ymIuSd2aZvUt4It/fAKDnQEEFaKAoFjt X-Received: by 2002:a17:90a:be07:: with SMTP id a7mr6339181pjs.88.1567620746063; Wed, 04 Sep 2019 11:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620746; cv=none; d=google.com; s=arc-20160816; b=Jx4sfcAjV3eXIaLe3qzA9Ty4ychGMv0lx4cdfIEHx3G2Vhq33XHcgWFa77xznEZ9Xi DBmC2b7UAfze6XvSpAc0K43DdEmNPraXnVEDS2/5UdtbgSD/NRE/dHdduGzY83aC/Div ERvzV2ky6qgZf/M/RQKVxhuDT7AL4sFsS07z0ggnQBtimqsoI7/dP8Hu4oyoD0ONIR44 bNAbrb2qqNNik0s3A0C7zkW0QAVe0VDWe2biBCOlnotITyGJL4+IX6FZFVehJPAmx9BX 8FS2hq7KAlE3lJ6XGcTPqFhN9cAw3N5E1CBvcXYvpkuSgx+b7K9yEaP2Vh8KzSDnZ+78 hxGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SuAue+rPWU27MNlw8bCuUXVJgvye5wszyEJ4xIhopoU=; b=eOKMuKl005SV0Ecl/1NK5qziJN7shyEjJALUabgWpIHXu9+nutTQKxhYtGdESzptq4 1acXfh0U8mjg5BbruojaDUpg1WCDUguyqtrYVntqDc5yHu79vF2Z+lKdw8CHx5l29ni3 IlukfOTGEo8k7vouyv7Va715hxdPZnpZpLfGX9Lvp4xrUsw4VUH+nrufV5i+u0r2STaN xRdg0ARdIi3+Sb6MAk9nJ0TZJuLhrKA3y/SOWZl095zY4IjbNzqvndsqlvta66Ru1/iV Mm1fb2MHbYFDvSQ3GQSYPD5xVV8aMQBTDmAXcqYhG/48pBwD8XPiUgnaCT64SUzFgguj jqrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wxIfSVAf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si2785263ply.30.2019.09.04.11.12.10; Wed, 04 Sep 2019 11:12:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wxIfSVAf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389438AbfIDSKm (ORCPT + 99 others); Wed, 4 Sep 2019 14:10:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390134AbfIDSKj (ORCPT ); Wed, 4 Sep 2019 14:10:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 402D6206BA; Wed, 4 Sep 2019 18:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620638; bh=+kpJyF91rRJsDXidBspwhd2qYoEQQF+vrN2XtsvIEk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wxIfSVAfBm46vZyjhL/PybS5JCoSvu0MDZ6QJyvOvDgHb2NybagurZutz7NKtIMZh 3EEikQ0+rI5CGlQsZA0+/ffIeHSM92gC/qN4NpPvfrI7uojT1782SERkcmP2yk8iFw wYs9Hs5YkOwiQwG7RAcpy6w9/9c38UprSfIiZJu8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Y.C. Chen" , Benjamin Herrenschmidt , Dave Airlie , Sasha Levin Subject: [PATCH 5.2 039/143] drm/ast: Fixed reboot test may cause system hanged Date: Wed, 4 Sep 2019 19:53:02 +0200 Message-Id: <20190904175315.582408856@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 05b439711f6ff8700e8660f97a1179650778b9cb ] There is another thread still access standard VGA I/O while loading drm driver. Disable standard VGA I/O decode to avoid this issue. Signed-off-by: Y.C. Chen Reviewed-by: Benjamin Herrenschmidt Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/1523410059-18415-1-git-send-email-yc_chen@aspeedtech.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/ast/ast_main.c | 5 ++++- drivers/gpu/drm/ast/ast_mode.c | 2 +- drivers/gpu/drm/ast/ast_post.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 2854399856ba0..4aebe21e6ad9f 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -131,8 +131,8 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post) /* Enable extended register access */ - ast_enable_mmio(dev); ast_open_key(ast); + ast_enable_mmio(dev); /* Find out whether P2A works or whether to use device-tree */ ast_detect_config_mode(dev, &scu_rev); @@ -576,6 +576,9 @@ void ast_driver_unload(struct drm_device *dev) { struct ast_private *ast = dev->dev_private; + /* enable standard VGA decode */ + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04); + ast_release_firmware(dev); kfree(ast->dp501_fw_addr); ast_mode_fini(dev); diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 97fed0627d1c8..74da15a3341a8 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -601,7 +601,7 @@ static int ast_crtc_mode_set(struct drm_crtc *crtc, return -EINVAL; ast_open_key(ast); - ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04); + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06); ast_set_std_reg(crtc, adjusted_mode, &vbios_mode); ast_set_crtc_reg(crtc, adjusted_mode, &vbios_mode); diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c index f7d421359d564..c1d1ac51d1c20 100644 --- a/drivers/gpu/drm/ast/ast_post.c +++ b/drivers/gpu/drm/ast/ast_post.c @@ -46,7 +46,7 @@ void ast_enable_mmio(struct drm_device *dev) { struct ast_private *ast = dev->dev_private; - ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04); + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06); } -- 2.20.1