Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1029414ybe; Wed, 4 Sep 2019 11:23:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9NgZ9cWIm0bemK2zCAu/l2DVdPTwGKvQGP1WJtn2EgcUf0Fk3uZWxtBDzSuwbn/jhrFJp X-Received: by 2002:a63:c203:: with SMTP id b3mr36559955pgd.450.1567621422339; Wed, 04 Sep 2019 11:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621422; cv=none; d=google.com; s=arc-20160816; b=JH4xWRRgda4CNQ7ghK5hsjrBKo+p/3yBDfTPvzUEzK/bR1a2AkVqxQBenBTa9cnvYd HMOSz07aMPoD3FM78lv0xXqCjI0rrr3Bk6snwjsQo1AoE0f679Y4CBayCMhWoYJ+NF7c CqMDqaLSxMNJaJrNYfucmIHHkqEZzmskZin8tOyXisMWQlucKrnp2ITq/670L5o+Xr1F YVY/oAfahIZq82MVu3s9SHC/AoBBt89v+JyHZaGkRPtG9H36NYeMUgE1DDFCLqDrd45u KQ6CWdoIKERrlN+2EWsnERvI2BYZ/4EYGGvrkrwzwLgZ8gMukBCby0JUmhKu3LNEIm+p AW/A== 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=LRInRpPjw61ivDzIOYk5vGnO1AlcYAeEF4SASEw/luw=; b=hBo6z3T0l6GC9NsSB5mSf7mm50OWjEcPyZxtaV701ywfYDSKjAhqyuCUtyad1AjDZs BU0KjtFH1xHiqK16K5dh3tQyq3+65FkSTDZsetCn4+L+DRIYKyY7pXanM/ACzzSzGkGT lvwzJlLGJmG7gP/QqI6xrdxuISmDWMcUDpC9onMW97r/O7dlaPqlwF/+UnKcaQD0DPjt +tV+X5STqdmm7Cvn6YiNWCukPMMKQnn10NYlBEQ8teygw/orZU8eU5SzHFHzS2QJTgpp 6IzrDreGOnqD4doZKhpzk3JlzPhFZkDb5x+Pip4u9f97o8upkB0URlc8dthY66z+6HoG gwsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="geo/HNiz"; 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 j70si17206523pgd.500.2019.09.04.11.23.26; Wed, 04 Sep 2019 11:23:42 -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="geo/HNiz"; 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 S2388961AbfIDSFp (ORCPT + 99 others); Wed, 4 Sep 2019 14:05:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:47334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388958AbfIDSFn (ORCPT ); Wed, 4 Sep 2019 14:05:43 -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 F0734206B8; Wed, 4 Sep 2019 18:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620342; bh=lnqkE3M+BQ/GONSwSD8tujzQUyv67os8UdwOV/de+ZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=geo/HNizvHCsAREb8DPmL7WITOInMURROOUqCzZ0xRVc/+x9FGvqPm3LFUJk5XJRH 0c86GQFzbRn1uac7TlPxou8fMbwZKaP3y2/dPRQSPCXFu7cgX4NMtNA7uQqYulgDVN ZInzYegZxsVu2NG8pcfbztrSRJ5XG17wRVulgHgc= 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 4.19 22/93] drm/ast: Fixed reboot test may cause system hanged Date: Wed, 4 Sep 2019 19:53:24 +0200 Message-Id: <20190904175305.218878328@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175302.845828956@linuxfoundation.org> References: <20190904175302.845828956@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 373700c05a00f..224fa1ef87ff9 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 8bb355d5d43d8..9d92d2d2fcfc7 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -600,7 +600,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