Skip to contentSkip to conversation

Patch "drm/ast: Handle configuration without P2A bridge" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message Mar 12, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm/ast: Handle configuration without P2A bridge

to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-ast-handle-configuration-without-p2a-bridge.patch
and it can be found in the queue-4.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 71f677a91046599ece96ebab21df956ce909c456 Mon Sep 17 00:00:00 2001

From: Russell Currey <[email protected]>
Date: Fri, 17 Feb 2017 14:33:01 +1100
Subject: drm/ast: Handle configuration without P2A bridge

From: Russell Currey <[email protected]>

commit 71f677a91046599ece96ebab21df956ce909c456 upstream.

The ast driver configures a window to enable access into BMC memory space in order to read some configuration registers.

If this window is disabled, which it can be from the BMC side, the ast driver can't function.

Closing this window is a necessity for security if a machine's host side and BMC side are controlled by different parties; i.e. a cloud provider offering machines "bare metal".

A recent patch went in to try to check if that window is open but it does so by trying to access the registers in question and testing if the result is 0xffffffff.

This method will trigger a PCIe error when the window is closed which on some systems will be fatal (it will trigger an EEH for example on POWER which will take out the device).

This patch improves this in two ways:

- First, if the firmware has put properties in the device-tree
containing the relevant configuration information, we use these.

- Otherwise, a bit in one of the SCU scratch registers (which
are readable via the VGA register space and writeable by the BMC) will indicate if the BMC has closed the window. This bit has been defined by Y.C Chen from Aspeed.

If the window is closed and the configuration isn't available from the device-tree, some sane defaults are used. Those defaults are hopefully sufficient for standard video modes used on a server.

---
 drivers/gpu/drm/ast/ast_drv.h  |    6 
 drivers/gpu/drm/ast/ast_main.c |  264 +++++++++++++++++++++++++----------------
 drivers/gpu/drm/ast/ast_post.c |    7 -
 3 files changed, 168 insertions(+), 109 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +5 -1
@@ -113,7 +113,11 @@ struct ast_private {
 	struct ttm_bo_kmap_obj cache_kmap;
 	int next_cursor;
 	bool support_wide_screen;
-	bool DisableP2A;
+	enum {
+		ast_use_p2a,
+		ast_use_dt,
+		ast_use_defaults
+	} config_mode;
 
 	enum ast_tx_chip tx_chip_type;
 	u8 dp501_maxclk;
drivers/gpu/drm/ast/ast_main.c +161 -103

314 lines not on this page · raw message

drivers/gpu/drm/ast/ast_post.c +2 -5
@@ -379,17 +379,14 @@ void ast_post_gpu(struct drm_device *dev
 	ast_open_key(ast);
 	ast_set_def_ext_reg(dev);
 
-	if (ast->DisableP2A == false)
-	{
+	if (ast->config_mode == ast_use_p2a) {
 		if (ast->chip == AST2300 || ast->chip == AST2400)
 			ast_init_dram_2300(dev);
 		else
 			ast_init_dram_reg(dev);
 
 		ast_init_3rdtx(dev);
-	}
-	else
-	{
+	} else {
 		if (ast->tx_chip_type != AST_TX_NONE)
 			ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xcf, 0x80);	/* Enable DVO */
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.10/drm-ast-handle-configuration-without-p2a-bridge.patch