Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ast: Fixed reboot test may cause system hanged

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 <yc_chen@aspeedtech.com>
Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1523410059-18415-1-git-send-email-yc_chen@aspeedtech.com

authored by

Y.C. Chen and committed by
Dave Airlie
05b43971 d45331b0

+6 -3
+4 -1
drivers/gpu/drm/ast/ast_main.c
··· 131 131 132 132 133 133 /* Enable extended register access */ 134 - ast_enable_mmio(dev); 135 134 ast_open_key(ast); 135 + ast_enable_mmio(dev); 136 136 137 137 /* Find out whether P2A works or whether to use device-tree */ 138 138 ast_detect_config_mode(dev, &scu_rev); ··· 575 575 void ast_driver_unload(struct drm_device *dev) 576 576 { 577 577 struct ast_private *ast = dev->dev_private; 578 + 579 + /* enable standard VGA decode */ 580 + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04); 578 581 579 582 ast_release_firmware(dev); 580 583 kfree(ast->dp501_fw_addr);
+1 -1
drivers/gpu/drm/ast/ast_mode.c
··· 604 604 return -EINVAL; 605 605 ast_open_key(ast); 606 606 607 - ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04); 607 + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06); 608 608 609 609 ast_set_std_reg(crtc, adjusted_mode, &vbios_mode); 610 610 ast_set_crtc_reg(crtc, adjusted_mode, &vbios_mode);
+1 -1
drivers/gpu/drm/ast/ast_post.c
··· 46 46 { 47 47 struct ast_private *ast = dev->dev_private; 48 48 49 - ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04); 49 + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06); 50 50 } 51 51 52 52