Skip to content

Commit

Permalink
Merge tag 'edac_for_4.21' 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:

 - Support for ZynqMP DDR controller support to synopsys_edac along with
   a driver cleanup and generalization for the addition of support for
   the new IP. (Manish Narani)

 - Removal of the /sys/bus/edac devices hierarchy. This enabled us to
   get rid of the silly memory controllers maximum number notion. (Tony
   Luck and Borislav Petkov)

 - skx_edac improvements and fixes. (Qiuxu Zhuo and Tony Luck)

 - The usual garden variety of small cleanups and fixes.

* tag 'edac_for_4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: (25 commits)
  EDAC, fsl_ddr: Add LS1021A to the list of supported hardware
  EDAC, i5000: Remove set but not used local variables
  MAINTAINERS, EDAC: Drop bouncing email
  EDAC, i82975x: Fix spelling mistake "reserverd" -> "reserved"
  EDAC, fsl: Move error injection under CONFIG_EDAC_DEBUG
  EDAC, skx: Let EDAC core show the decoded result for debugfs
  EDAC, skx: Move debugfs node under EDAC's hierarchy
  EDAC, skx: Prepend hex formatting with '0x'
  EDAC, skx: Fix function calling order in skx_exit()
  EDAC: Drop per-memory controller buses
  EDAC: Don't add devices under /sys/bus/edac
  EDAC: Fix indentation issues in several EDAC drivers
  EDAC, skx: Fix randconfig builds in a better way
  EDAC, i82975x: Remove set but not used variable dtype
  EDAC, qcom_edac: Remove irq_handled local variable
  EDAC, synopsys: Add Error Injection support for ZynqMP DDR controller
  EDAC, synopsys: Add ECC support for ZynqMP DDR controller
  EDAC, synopsys: Add macro defines for ZynqMP DDRC
  dt: bindings: Document ZynqMP DDRC in Synopsys documentation
  EDAC, synopsys: Add error handling for the of_device_get_match_data() result
  ...
  • Loading branch information
Linus Torvalds committed Dec 25, 2018
2 parents 8e61e7b + 75dfa87 commit b271b21
Show file tree
Hide file tree
Showing 17 changed files with 1,174 additions and 332 deletions.
27 changes: 22 additions & 5 deletions Documentation/devicetree/bindings/memory-controllers/synopsys.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
Binding for Synopsys IntelliDDR Multi Protocol Memory Controller

This controller has an optional ECC support in half-bus width (16-bit)
configuration. The ECC controller corrects one bit error and detects
two bit errors.
The ZynqMP DDR ECC controller has an optional ECC support in 64-bit and 32-bit
bus width configurations.

The Zynq DDR ECC controller has an optional ECC support in half-bus width
(16-bit) configuration.

These both ECC controllers correct single bit ECC errors and detect double bit
ECC errors.

Required properties:
- compatible: Should be 'xlnx,zynq-ddrc-a05'
- reg: Base address and size of the controllers memory area
- compatible: One of:
- 'xlnx,zynq-ddrc-a05' : Zynq DDR ECC controller
- 'xlnx,zynqmp-ddrc-2.40a' : ZynqMP DDR ECC controller
- reg: Should contain DDR controller registers location and length.

Required properties for "xlnx,zynqmp-ddrc-2.40a":
- interrupts: Property with a value describing the interrupt number.

Example:
memory-controller@f8006000 {
compatible = "xlnx,zynq-ddrc-a05";
reg = <0xf8006000 0x1000>;
};

mc: memory-controller@fd070000 {
compatible = "xlnx,zynqmp-ddrc-2.40a";
reg = <0x0 0xfd070000 0x0 0x30000>;
interrupt-parent = <&gic>;
interrupts = <0 112 4>;
};
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5445,7 +5445,6 @@ S: Maintained
F: drivers/edac/i82443bxgx_edac.c

EDAC-I82975X
M: Ranganathan Desikan <ravi@jetztechnologies.com>
M: "Arvind R." <arvino55@gmail.com>
L: linux-edac@vger.kernel.org
S: Maintained
Expand Down
6 changes: 3 additions & 3 deletions drivers/edac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ config EDAC_SBRIDGE

config EDAC_SKX
tristate "Intel Skylake server Integrated MC"
depends on PCI && X86_64 && X86_MCE_INTEL && PCI_MMCONFIG
depends on PCI && X86_64 && X86_MCE_INTEL && PCI_MMCONFIG && ACPI
depends on ACPI_NFIT || !ACPI_NFIT # if ACPI_NFIT=m, EDAC_SKX can't be y
select DMI
select ACPI_ADXL if ACPI
select ACPI_ADXL
help
Support for error detection and correction the Intel
Skylake server Integrated Memory Controllers. If your
Expand Down Expand Up @@ -442,7 +442,7 @@ config EDAC_ALTERA_SDMMC

config EDAC_SYNOPSYS
tristate "Synopsys DDR Memory Controller"
depends on ARCH_ZYNQ
depends on ARCH_ZYNQ || ARCH_ZYNQMP
help
Support for error detection and correction on the Synopsys DDR
memory controller.
Expand Down
4 changes: 2 additions & 2 deletions drivers/edac/e752x_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,8 @@ static int __init e752x_init(void)

edac_dbg(3, "\n");

/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();
/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();

pci_rc = pci_register_driver(&e752x_driver);
return (pci_rc < 0) ? pci_rc : 0;
Expand Down
9 changes: 1 addition & 8 deletions drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ static LIST_HEAD(mc_devices);
*/
static const char *edac_mc_owner;

static struct bus_type mc_bus[EDAC_MAX_MCS];

int edac_get_report_status(void)
{
return edac_report;
Expand Down Expand Up @@ -716,11 +714,6 @@ int edac_mc_add_mc_with_groups(struct mem_ctl_info *mci,
int ret = -EINVAL;
edac_dbg(0, "\n");

if (mci->mc_idx >= EDAC_MAX_MCS) {
pr_warn_once("Too many memory controllers: %d\n", mci->mc_idx);
return -ENODEV;
}

#ifdef CONFIG_EDAC_DEBUG
if (edac_debug_level >= 3)
edac_mc_dump_mci(mci);
Expand Down Expand Up @@ -760,7 +753,7 @@ int edac_mc_add_mc_with_groups(struct mem_ctl_info *mci,
/* set load time so that error rate can be tracked */
mci->start_time = jiffies;

mci->bus = &mc_bus[mci->mc_idx];
mci->bus = edac_get_sysfs_subsys();

if (edac_create_sysfs_mci_device(mci, groups)) {
edac_mc_printk(mci, KERN_WARNING,
Expand Down
33 changes: 2 additions & 31 deletions drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
struct csrow_info *csrow, int index)
{
csrow->dev.type = &csrow_attr_type;
csrow->dev.bus = mci->bus;
csrow->dev.groups = csrow_dev_groups;
device_initialize(&csrow->dev);
csrow->dev.parent = &mci->dev;
Expand Down Expand Up @@ -636,7 +635,6 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci,
dimm->mci = mci;

dimm->dev.type = &dimm_attr_type;
dimm->dev.bus = mci->bus;
device_initialize(&dimm->dev);

dimm->dev.parent = &mci->dev;
Expand Down Expand Up @@ -914,33 +912,13 @@ static const struct device_type mci_attr_type = {
int edac_create_sysfs_mci_device(struct mem_ctl_info *mci,
const struct attribute_group **groups)
{
char *name;
int i, err;

/*
* The memory controller needs its own bus, in order to avoid
* namespace conflicts at /sys/bus/edac.
*/
name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
if (!name)
return -ENOMEM;

mci->bus->name = name;

edac_dbg(0, "creating bus %s\n", mci->bus->name);

err = bus_register(mci->bus);
if (err < 0) {
kfree(name);
return err;
}

/* get the /sys/devices/system/edac subsys reference */
mci->dev.type = &mci_attr_type;
device_initialize(&mci->dev);

mci->dev.parent = mci_pdev;
mci->dev.bus = mci->bus;
mci->dev.groups = groups;
dev_set_name(&mci->dev, "mc%d", mci->mc_idx);
dev_set_drvdata(&mci->dev, mci);
Expand All @@ -950,7 +928,7 @@ 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));
goto fail_unregister_bus;
goto out;
}

/*
Expand Down Expand Up @@ -998,10 +976,8 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci,
device_unregister(&dimm->dev);
}
device_unregister(&mci->dev);
fail_unregister_bus:
bus_unregister(mci->bus);
kfree(name);

out:
return err;
}

Expand Down Expand Up @@ -1032,13 +1008,8 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)

void edac_unregister_sysfs(struct mem_ctl_info *mci)
{
struct bus_type *bus = mci->bus;
const char *name = mci->bus->name;

edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
device_unregister(&mci->dev);
bus_unregister(bus);
kfree(name);
}

static void mc_attr_release(struct device *dev)
Expand Down
8 changes: 6 additions & 2 deletions drivers/edac/fsl_ddr_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Freescale Memory Controller kernel module
*
* Support Power-based SoCs including MPC85xx, MPC86xx, MPC83xx and
* ARM-based Layerscape SoCs including LS2xxx. Originally split
* out from mpc85xx_edac EDAC driver.
* ARM-based Layerscape SoCs including LS2xxx and LS1021A. Originally
* split out from mpc85xx_edac EDAC driver.
*
* Parts Copyrighted (c) 2013 by Freescale Semiconductor, Inc.
*
Expand Down Expand Up @@ -51,6 +51,7 @@ static inline void ddr_out32(void __iomem *addr, u32 value)
iowrite32be(value, addr);
}

#ifdef CONFIG_EDAC_DEBUG
/************************ MC SYSFS parts ***********************************/

#define to_mci(k) container_of(k, struct mem_ctl_info, dev)
Expand Down Expand Up @@ -151,11 +152,14 @@ static DEVICE_ATTR(inject_data_lo, S_IRUGO | S_IWUSR,
fsl_mc_inject_data_lo_show, fsl_mc_inject_data_lo_store);
static DEVICE_ATTR(inject_ctrl, S_IRUGO | S_IWUSR,
fsl_mc_inject_ctrl_show, fsl_mc_inject_ctrl_store);
#endif /* CONFIG_EDAC_DEBUG */

static struct attribute *fsl_ddr_dev_attrs[] = {
#ifdef CONFIG_EDAC_DEBUG
&dev_attr_inject_data_hi.attr,
&dev_attr_inject_data_lo.attr,
&dev_attr_inject_ctrl.attr,
#endif
NULL
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/edac/fsl_ddr_edac.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Freescale Memory Controller kernel module
*
* Support Power-based SoCs including MPC85xx, MPC86xx, MPC83xx and
* ARM-based Layerscape SoCs including LS2xxx. Originally split
* out from mpc85xx_edac EDAC driver.
* ARM-based Layerscape SoCs including LS2xxx and LS1021A. Originally
* split out from mpc85xx_edac EDAC driver.
*
* Author: Dave Jiang <djiang@mvista.com>
*
Expand Down
4 changes: 2 additions & 2 deletions drivers/edac/i3000_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ static int __init i3000_init(void)

edac_dbg(3, "MC:\n");

/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();
/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();

pci_rc = pci_register_driver(&i3000_driver);
if (pci_rc < 0)
Expand Down
13 changes: 3 additions & 10 deletions drivers/edac/i5000_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,6 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci)
u32 actual_tolm;
u16 limit;
int slot_row;
int maxch;
int maxdimmperch;
int way0, way1;

pvt = mci->pvt_info;
Expand All @@ -1145,9 +1143,6 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci)
pci_read_config_dword(pvt->system_address, AMBASE + sizeof(u32),
&pvt->u.ambase_top);

maxdimmperch = pvt->maxdimmperch;
maxch = pvt->maxch;

edac_dbg(2, "AMBASE= 0x%lx MAXCH= %d MAX-DIMM-Per-CH= %d\n",
(long unsigned int)pvt->ambase, pvt->maxch, pvt->maxdimmperch);

Expand Down Expand Up @@ -1253,16 +1248,14 @@ static int i5000_init_csrows(struct mem_ctl_info *mci)
{
struct i5000_pvt *pvt;
struct dimm_info *dimm;
int empty, channel_count;
int empty;
int max_csrows;
int mtr;
int csrow_megs;
int channel;
int slot;

pvt = mci->pvt_info;

channel_count = pvt->maxch;
max_csrows = pvt->maxdimmperch * 2;

empty = 1; /* Assume NO memory */
Expand Down Expand Up @@ -1559,8 +1552,8 @@ static int __init i5000_init(void)

edac_dbg(2, "MC:\n");

/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();
/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();

pci_rc = pci_register_driver(&i5000_driver);

Expand Down
2 changes: 1 addition & 1 deletion drivers/edac/i7core_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ static ssize_t i7core_inject_type_store(struct device *dev,
const char *data, size_t count)
{
struct mem_ctl_info *mci = to_mci(dev);
struct i7core_pvt *pvt = mci->pvt_info;
struct i7core_pvt *pvt = mci->pvt_info;
unsigned long value;
int rc;

Expand Down
21 changes: 7 additions & 14 deletions drivers/edac/i82975x_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ NOTE: Only ONE of the three must be enabled
*
* 31:14 Base Addr of 16K memory-mapped
* configuration space
* 13:1 reserverd
* 13:1 reserved
* 0 mem-mapped config space enable
*/

Expand Down Expand Up @@ -358,14 +358,6 @@ static int dual_channel_active(void __iomem *mch_window)
return dualch;
}

static enum dev_type i82975x_dram_type(void __iomem *mch_window, int rank)
{
/*
* ECC is possible on i92975x ONLY with DEV_X8
*/
return DEV_X8;
}

static void i82975x_init_csrows(struct mem_ctl_info *mci,
struct pci_dev *pdev, void __iomem *mch_window)
{
Expand All @@ -375,7 +367,6 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
u32 cumul_size, nr_pages;
int index, chan;
struct dimm_info *dimm;
enum dev_type dtype;

last_cumul_size = 0;

Expand Down Expand Up @@ -413,7 +404,6 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
* [0-7] for single-channel; i.e. csrow->nr_channels = 1
* [0-3] for dual-channel; i.e. csrow->nr_channels = 2
*/
dtype = i82975x_dram_type(mch_window, index);
for (chan = 0; chan < csrow->nr_channels; chan++) {
dimm = mci->csrows[index]->channels[chan]->dimm;

Expand All @@ -423,7 +413,10 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
(chan == 0) ? 'A' : 'B',
index);
dimm->grain = 1 << 7; /* 128Byte cache-line resolution */
dimm->dtype = i82975x_dram_type(mch_window, index);

/* ECC is possible on i92975x ONLY with DEV_X8. */
dimm->dtype = DEV_X8;

dimm->mtype = MEM_DDR2; /* I82975x supports only DDR2 */
dimm->edac_mode = EDAC_SECDED; /* only supported */
}
Expand Down Expand Up @@ -655,8 +648,8 @@ static int __init i82975x_init(void)

edac_dbg(3, "\n");

/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();
/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();

pci_rc = pci_register_driver(&i82975x_driver);
if (pci_rc < 0)
Expand Down
Loading

0 comments on commit b271b21

Please sign in to comment.