Commit bc8f10ba authored by Qiuxu Zhuo's avatar Qiuxu Zhuo Committed by Borislav Petkov

EDAC, pnd2: Properly toggle hidden state for P2SB PCI device

Properly handle hidden state of P2SB PCI device (DEV:D, FUN:0) for
Apollo Lake.
Signed-off-by: default avatarQiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170814154905.21707-1-qiuxu.zhuo@intel.comSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
parent 5fd77cb3
...@@ -161,7 +161,11 @@ static int _apl_rd_reg(int port, int off, int op, u32 *data) ...@@ -161,7 +161,11 @@ static int _apl_rd_reg(int port, int off, int op, u32 *data)
{ {
int retries = 0xff, ret; int retries = 0xff, ret;
u16 status; u16 status;
u8 hidden;
/* Unhide the P2SB device, if it's hidden */
P2SB_READ(byte, P2SB_HIDE_OFF, &hidden);
if (hidden)
P2SB_WRITE(byte, P2SB_HIDE_OFF, 0); P2SB_WRITE(byte, P2SB_HIDE_OFF, 0);
if (p2sb_is_busy(&status)) { if (p2sb_is_busy(&status)) {
...@@ -185,7 +189,9 @@ static int _apl_rd_reg(int port, int off, int op, u32 *data) ...@@ -185,7 +189,9 @@ static int _apl_rd_reg(int port, int off, int op, u32 *data)
P2SB_READ(dword, P2SB_DATA_OFF, data); P2SB_READ(dword, P2SB_DATA_OFF, data);
ret = (status >> 1) & 0x3; ret = (status >> 1) & 0x3;
out: out:
P2SB_WRITE(byte, P2SB_HIDE_OFF, 1); /* Hide the P2SB device, if it was hidden before */
if (hidden)
P2SB_WRITE(byte, P2SB_HIDE_OFF, hidden);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment