Commit a21e98ce authored by Jason Baron's avatar Jason Baron Committed by Borislav Petkov

x38_edac: make use of lo_hi_readq()

Convert to the generic API.
Signed-off-by: default avatarJason Baron <jbaron@akamai.com>
Link: http://lkml.kernel.org/r/bb9a4cbb980cc7b51be75cbfcf644553bf6a04cd.1403818526.git.jbaron@akamai.comSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
parent 3a044178
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/pci_ids.h> #include <linux/pci_ids.h>
#include <linux/edac.h> #include <linux/edac.h>
#include <asm-generic/io-64-nonatomic-lo-hi.h>
#include "edac_core.h" #include "edac_core.h"
#define X38_REVISION "1.1" #define X38_REVISION "1.1"
...@@ -161,11 +163,6 @@ static void x38_clear_error_info(struct mem_ctl_info *mci) ...@@ -161,11 +163,6 @@ static void x38_clear_error_info(struct mem_ctl_info *mci)
X38_ERRSTS_BITS); X38_ERRSTS_BITS);
} }
static u64 x38_readq(const void __iomem *addr)
{
return readl(addr) | (((u64)readl(addr + 4)) << 32);
}
static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, static void x38_get_and_clear_error_info(struct mem_ctl_info *mci,
struct x38_error_info *info) struct x38_error_info *info)
{ {
...@@ -183,9 +180,9 @@ static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, ...@@ -183,9 +180,9 @@ static void x38_get_and_clear_error_info(struct mem_ctl_info *mci,
if (!(info->errsts & X38_ERRSTS_BITS)) if (!(info->errsts & X38_ERRSTS_BITS))
return; return;
info->eccerrlog[0] = x38_readq(window + X38_C0ECCERRLOG); info->eccerrlog[0] = lo_hi_readq(window + X38_C0ECCERRLOG);
if (x38_channel_num == 2) if (x38_channel_num == 2)
info->eccerrlog[1] = x38_readq(window + X38_C1ECCERRLOG); info->eccerrlog[1] = lo_hi_readq(window + X38_C1ECCERRLOG);
pci_read_config_word(pdev, X38_ERRSTS, &info->errsts2); pci_read_config_word(pdev, X38_ERRSTS, &info->errsts2);
...@@ -196,10 +193,10 @@ static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, ...@@ -196,10 +193,10 @@ static void x38_get_and_clear_error_info(struct mem_ctl_info *mci,
* should be UE info. * should be UE info.
*/ */
if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) {
info->eccerrlog[0] = x38_readq(window + X38_C0ECCERRLOG); info->eccerrlog[0] = lo_hi_readq(window + X38_C0ECCERRLOG);
if (x38_channel_num == 2) if (x38_channel_num == 2)
info->eccerrlog[1] = info->eccerrlog[1] =
x38_readq(window + X38_C1ECCERRLOG); lo_hi_readq(window + X38_C1ECCERRLOG);
} }
x38_clear_error_info(mci); x38_clear_error_info(mci);
......
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