Skip to content

Commit

Permalink
Merge tag 'edac_for_3.20' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/bp/bp

Pull EDAC updates from Borislav Petkov:

 - a new synopsys_edac.c driver for the Synopsys DDR controller, from
   Punnaiah Choudary Kalluri.

 - minor fixes/cleanups all around

 - Mauro and I are adding the repo URLs to MAINTAINERS since people
   asked for trees to base upcoming work on.

* tag 'edac_for_3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  EDAC: Add repo URLs to MAINTAINERS
  EDAC, mv64x60_edac: Fix an error code in probe()
  EDAC: edac_mc_sysfs: Make stuff static
  EDAC: Fix the leak of mci->bus->name when bus_register fails
  edac: i5100_edac: Remove unused i5100_recmema_dm_buf_id
  EDAC, synps: Add EDAC support for zynq ddr ecc controller
  mpc85xx_edac: Fix a typo in comments
  EDAC, mce_amd_inj: Fix sparse non static symbol warning
  • Loading branch information
Linus Torvalds committed Feb 10, 2015
2 parents e07e0d4 + 7a85951 commit ed824a6
Show file tree
Hide file tree
Showing 10 changed files with 578 additions and 33 deletions.
3 changes: 3 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,7 @@ N: xilinx
F: drivers/clocksource/cadence_ttc_timer.c
F: drivers/i2c/busses/i2c-cadence.c
F: drivers/mmc/host/sdhci-of-arasan.c
F: drivers/edac/synopsys_edac.c

ARM SMMU DRIVER
M: Will Deacon <will.deacon@arm.com>
Expand Down Expand Up @@ -3513,6 +3514,8 @@ M: Borislav Petkov <bp@alien8.de>
M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
L: linux-edac@vger.kernel.org
W: bluesmoke.sourceforge.net
T: git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git#for-next
T: git://git.kernel.org/pub/linux/kernel/git/mchehab/linux-edac.git#linux_next
S: Supported
F: Documentation/edac.txt
F: drivers/edac/
Expand Down
7 changes: 7 additions & 0 deletions drivers/edac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,11 @@ config EDAC_ALTERA_MC
preloader must initialize the SDRAM before loading
the kernel.

config EDAC_SYNOPSYS
tristate "Synopsys DDR Memory Controller"
depends on EDAC_MM_EDAC && ARCH_ZYNQ
help
Support for error detection and correction on the Synopsys DDR
memory controller.

endif # EDAC
1 change: 1 addition & 0 deletions drivers/edac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ obj-$(CONFIG_EDAC_OCTEON_LMC) += octeon_edac-lmc.o
obj-$(CONFIG_EDAC_OCTEON_PCI) += octeon_edac-pci.o

obj-$(CONFIG_EDAC_ALTERA_MC) += altera_edac.o
obj-$(CONFIG_EDAC_SYNOPSYS) += synopsys_edac.o
51 changes: 27 additions & 24 deletions drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct dev_ch_attribute {
};

#define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) \
struct dev_ch_attribute dev_attr_legacy_##_name = \
static struct dev_ch_attribute dev_attr_legacy_##_name = \
{ __ATTR(_name, _mode, _show, _store), (_var) }

#define to_channel(k) (container_of(k, struct dev_ch_attribute, attr)->channel)
Expand Down Expand Up @@ -850,20 +850,20 @@ static const struct file_operations debug_fake_inject_fops = {
#endif

/* default Control file */
DEVICE_ATTR(reset_counters, S_IWUSR, NULL, mci_reset_counters_store);
static DEVICE_ATTR(reset_counters, S_IWUSR, NULL, mci_reset_counters_store);

/* default Attribute files */
DEVICE_ATTR(mc_name, S_IRUGO, mci_ctl_name_show, NULL);
DEVICE_ATTR(size_mb, S_IRUGO, mci_size_mb_show, NULL);
DEVICE_ATTR(seconds_since_reset, S_IRUGO, mci_seconds_show, NULL);
DEVICE_ATTR(ue_noinfo_count, S_IRUGO, mci_ue_noinfo_show, NULL);
DEVICE_ATTR(ce_noinfo_count, S_IRUGO, mci_ce_noinfo_show, NULL);
DEVICE_ATTR(ue_count, S_IRUGO, mci_ue_count_show, NULL);
DEVICE_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
DEVICE_ATTR(max_location, S_IRUGO, mci_max_location_show, NULL);
static DEVICE_ATTR(mc_name, S_IRUGO, mci_ctl_name_show, NULL);
static DEVICE_ATTR(size_mb, S_IRUGO, mci_size_mb_show, NULL);
static DEVICE_ATTR(seconds_since_reset, S_IRUGO, mci_seconds_show, NULL);
static DEVICE_ATTR(ue_noinfo_count, S_IRUGO, mci_ue_noinfo_show, NULL);
static DEVICE_ATTR(ce_noinfo_count, S_IRUGO, mci_ce_noinfo_show, NULL);
static DEVICE_ATTR(ue_count, S_IRUGO, mci_ue_count_show, NULL);
static DEVICE_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
static DEVICE_ATTR(max_location, S_IRUGO, mci_max_location_show, NULL);

/* memory scrubber attribute file */
DEVICE_ATTR(sdram_scrub_rate, 0, NULL, NULL);
static DEVICE_ATTR(sdram_scrub_rate, 0, NULL, NULL);

static struct attribute *mci_attrs[] = {
&dev_attr_reset_counters.attr,
Expand Down Expand Up @@ -989,7 +989,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)

err = bus_register(mci->bus);
if (err < 0)
return err;
goto fail_free_name;

/* get the /sys/devices/system/edac subsys reference */
mci->dev.type = &mci_attr_type;
Expand All @@ -1005,25 +1005,24 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
err = device_add(&mci->dev);
if (err < 0) {
edac_dbg(1, "failure: create device %s\n", dev_name(&mci->dev));
bus_unregister(mci->bus);
kfree(mci->bus->name);
return err;
goto fail_unregister_bus;
}

if (mci->set_sdram_scrub_rate || mci->get_sdram_scrub_rate) {
if (mci->get_sdram_scrub_rate) {
dev_attr_sdram_scrub_rate.attr.mode |= S_IRUGO;
dev_attr_sdram_scrub_rate.show = &mci_sdram_scrub_rate_show;
}

if (mci->set_sdram_scrub_rate) {
dev_attr_sdram_scrub_rate.attr.mode |= S_IWUSR;
dev_attr_sdram_scrub_rate.store = &mci_sdram_scrub_rate_store;
}
err = device_create_file(&mci->dev,
&dev_attr_sdram_scrub_rate);

err = device_create_file(&mci->dev, &dev_attr_sdram_scrub_rate);
if (err) {
edac_dbg(1, "failure: create sdram_scrub_rate\n");
goto fail2;
goto fail_unregister_dev;
}
}
/*
Expand All @@ -1032,8 +1031,9 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
for (i = 0; i < mci->tot_dimms; i++) {
struct dimm_info *dimm = mci->dimms[i];
/* Only expose populated DIMMs */
if (dimm->nr_pages == 0)
if (!dimm->nr_pages)
continue;

#ifdef CONFIG_EDAC_DEBUG
edac_dbg(1, "creating dimm%d, located at ", i);
if (edac_debug_level >= 1) {
Expand All @@ -1048,31 +1048,34 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
err = edac_create_dimm_object(mci, dimm, i);
if (err) {
edac_dbg(1, "failure: create dimm %d obj\n", i);
goto fail;
goto fail_unregister_dimm;
}
}

#ifdef CONFIG_EDAC_LEGACY_SYSFS
err = edac_create_csrow_objects(mci);
if (err < 0)
goto fail;
goto fail_unregister_dimm;
#endif

#ifdef CONFIG_EDAC_DEBUG
edac_create_debug_nodes(mci);
#endif
return 0;

fail:
fail_unregister_dimm:
for (i--; i >= 0; i--) {
struct dimm_info *dimm = mci->dimms[i];
if (dimm->nr_pages == 0)
if (!dimm->nr_pages)
continue;

device_unregister(&dimm->dev);
}
fail2:
fail_unregister_dev:
device_unregister(&mci->dev);
fail_unregister_bus:
bus_unregister(mci->bus);
fail_free_name:
kfree(mci->bus->name);
return err;
}
Expand Down
5 changes: 0 additions & 5 deletions drivers/edac/i5100_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,6 @@ static inline u32 i5100_recmema_rank(u32 a)
return i5100_nrecmema_rank(a);
}

static inline u32 i5100_recmema_dm_buf_id(u32 a)
{
return i5100_nrecmema_dm_buf_id(a);
}

static inline u32 i5100_recmemb_cas(u32 a)
{
return i5100_nrecmemb_cas(a);
Expand Down
2 changes: 1 addition & 1 deletion drivers/edac/mce_amd_inj.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int inj_bank_get(void *data, u64 *val)

DEFINE_SIMPLE_ATTRIBUTE(bank_fops, inj_bank_get, inj_bank_set, "%llu\n");

struct dfs_node {
static struct dfs_node {
char *name;
struct dentry *d;
const struct file_operations *fops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/edac/mpc85xx_edac.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Freescale MPC85xx Memory Controller kenel module
* Freescale MPC85xx Memory Controller kernel module
*
* Parts Copyrighted (c) 2013 by Freescale Semiconductor, Inc.
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/edac/mpc85xx_edac.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Freescale MPC85xx Memory Controller kenel module
* Freescale MPC85xx Memory Controller kernel module
* Author: Dave Jiang <djiang@mvista.com>
*
* 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
Expand Down
3 changes: 2 additions & 1 deletion drivers/edac/mv64x60_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,8 @@ static int mv64x60_mc_err_probe(struct platform_device *pdev)
ctl = (ctl & 0xff00ffff) | 0x10000;
out_le32(pdata->mc_vbase + MV64X60_SDRAM_ERR_ECC_CNTL, ctl);

if (edac_mc_add_mc(mci)) {
res = edac_mc_add_mc(mci);
if (res) {
edac_dbg(3, "failed edac_mc_add_mc()\n");
goto err;
}
Expand Down
Loading

0 comments on commit ed824a6

Please sign in to comment.