linux/drivers/edac/edac_mc.c

/*
 * edac_mc kernel module
 * (C) 2005, 2006 Linux Networx (http://lnxi.com)
 * This file may be distributed under the terms of the
 * GNU General Public License.
 *
 * Written by Thayne Harbaugh
 * Based on work by Dan Hollis <goemon at anime dot net> and others.
 *	http://www.anime.net/~goemon/linux-ecc/
 *
 * Modified by Dave Peterson and Doug Thompson
 *
 */

#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/smp.h>
#include <linux/init.h>
#include <linux/sysctl.h>
#include <linux/highmem.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/ctype.h>
#include <linux/edac.h>
#include <linux/bitops.h>
#include <linux/uaccess.h>
#include <asm/page.h>
#include "edac_mc.h"
#include "edac_module.h"
#include <ras/ras_event.h>

#ifdef CONFIG_EDAC_ATOMIC_SCRUB
#include <asm/edac.h>
#else
#define edac_atomic_scrub
#endif

int edac_op_state =;
EXPORT_SYMBOL_GPL();

/* lock to memory controller's control array */
static DEFINE_MUTEX(mem_ctls_mutex);
static LIST_HEAD(mc_devices);

/*
 * Used to lock EDAC MC to just one module, avoiding two drivers e. g.
 *	apei/ghes and i7core_edac to be used at the same time.
 */
static const char *edac_mc_owner;

static struct mem_ctl_info *error_desc_to_mci(struct edac_raw_error_desc *e)
{}

unsigned int edac_dimm_info_location(struct dimm_info *dimm, char *buf,
				     unsigned int len)
{}

#ifdef CONFIG_EDAC_DEBUG

static void edac_mc_dump_channel(struct rank_info *chan)
{}

static void edac_mc_dump_dimm(struct dimm_info *dimm)
{}

static void edac_mc_dump_csrow(struct csrow_info *csrow)
{}

static void edac_mc_dump_mci(struct mem_ctl_info *mci)
{}

#endif				/* CONFIG_EDAC_DEBUG */

const char * const edac_mem_types[] =;
EXPORT_SYMBOL_GPL();

static void _edac_mc_free(struct mem_ctl_info *mci)
{}

static void mci_release(struct device *dev)
{}

static int edac_mc_alloc_csrows(struct mem_ctl_info *mci)
{}

static int edac_mc_alloc_dimms(struct mem_ctl_info *mci)
{}

struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num,
				   unsigned int n_layers,
				   struct edac_mc_layer *layers,
				   unsigned int sz_pvt)
{}
EXPORT_SYMBOL_GPL();

void edac_mc_free(struct mem_ctl_info *mci)
{}
EXPORT_SYMBOL_GPL();

bool edac_has_mcs(void)
{}
EXPORT_SYMBOL_GPL();

/* Caller must hold mem_ctls_mutex */
static struct mem_ctl_info *__find_mci_by_dev(struct device *dev)
{}

/**
 * find_mci_by_dev
 *
 *	scan list of controllers looking for the one that manages
 *	the 'dev' device
 * @dev: pointer to a struct device related with the MCI
 */
struct mem_ctl_info *find_mci_by_dev(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

/*
 * edac_mc_workq_function
 *	performs the operation scheduled by a workq request
 */
static void edac_mc_workq_function(struct work_struct *work_req)
{}

/*
 * edac_mc_reset_delay_period(unsigned long value)
 *
 *	user space has updated our poll period value, need to
 *	reset our workq delays
 */
void edac_mc_reset_delay_period(unsigned long value)
{}



/* Return 0 on success, 1 on failure.
 * Before calling this function, caller must
 * assign a unique value to mci->mc_idx.
 *
 *	locking model:
 *
 *		called with the mem_ctls_mutex lock held
 */
static int add_mc_to_global_list(struct mem_ctl_info *mci)
{}

static int del_mc_from_global_list(struct mem_ctl_info *mci)
{}

struct mem_ctl_info *edac_mc_find(int idx)
{}
EXPORT_SYMBOL();

const char *edac_get_owner(void)
{}
EXPORT_SYMBOL_GPL();

/* FIXME - should a warning be printed if no error detection? correction? */
int edac_mc_add_mc_with_groups(struct mem_ctl_info *mci,
			       const struct attribute_group **groups)
{}
EXPORT_SYMBOL_GPL();

struct mem_ctl_info *edac_mc_del_mc(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

static void edac_mc_scrub_block(unsigned long page, unsigned long offset,
				u32 size)
{}

/* FIXME - should return -1 */
int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page)
{}
EXPORT_SYMBOL_GPL();

const char *edac_layer_name[] =;
EXPORT_SYMBOL_GPL();

static void edac_inc_ce_error(struct edac_raw_error_desc *e)
{}

static void edac_inc_ue_error(struct edac_raw_error_desc *e)
{}

static void edac_ce_error(struct edac_raw_error_desc *e)
{}

static void edac_ue_error(struct edac_raw_error_desc *e)
{}

static void edac_inc_csrow(struct edac_raw_error_desc *e, int row, int chan)
{}

void edac_raw_mc_handle_error(struct edac_raw_error_desc *e)
{}
EXPORT_SYMBOL_GPL();

void edac_mc_handle_error(const enum hw_event_mc_err_type type,
			  struct mem_ctl_info *mci,
			  const u16 error_count,
			  const unsigned long page_frame_number,
			  const unsigned long offset_in_page,
			  const unsigned long syndrome,
			  const int top_layer,
			  const int mid_layer,
			  const int low_layer,
			  const char *msg,
			  const char *other_detail)
{}
EXPORT_SYMBOL_GPL();