[PATCH v5 0/3] EDAC: Add Xilinx XilSEM error monitoring driver

Rama devi Veggalam posted 3 patches 2 days, 9 hours ago
.../ABI/testing/sysfs-devices-xilsem-edac          | 188 +++++
.../devicetree/bindings/edac/xlnx,xilsem.yaml      |  53 ++
MAINTAINERS                                        |  12 +
drivers/edac/Kconfig                               |  16 +
drivers/edac/Makefile                              |   1 +
drivers/edac/xilsem_edac.c                         | 859 +++++++++++++++++++++
drivers/edac/xilsem_edac.h                         | 131 ++++
drivers/firmware/xilinx/Makefile                   |   2 +-
drivers/firmware/xilinx/zynqmp-sem.c               | 142 ++++
drivers/soc/xilinx/xlnx_event_manager.c            |  16 +-
include/linux/firmware/xlnx-zynqmp-sem.h           | 127 +++
include/linux/firmware/xlnx-zynqmp.h               |  50 ++
12 files changed, 1594 insertions(+), 3 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-devices-xilsem-edac
create mode 100644 Documentation/devicetree/bindings/edac/xlnx,xilsem.yaml
create mode 100644 drivers/edac/xilsem_edac.c
create mode 100644 drivers/edac/xilsem_edac.h
create mode 100644 drivers/firmware/xilinx/zynqmp-sem.c
create mode 100644 include/linux/firmware/xlnx-zynqmp-sem.h
[PATCH v5 0/3] EDAC: Add Xilinx XilSEM error monitoring driver
Posted by Rama devi Veggalam 2 days, 9 hours ago
Add a driver for XilSEM (Xilinx Soft Error Mitigation) on Versal and
Versal NET devices. XilSEM runs as part of the Platform Loader and
Manager (PLM) on the PMC and monitors Configuration RAM (CRAM) and the
NoC Programming Interface (NPI) for correctable and uncorrectable
errors. The driver reports these errors to the EDAC core and provides
sysfs attributes to control scans, inject CRAM errors and read status.
It is a separate driver, matched through a single "xlnx,xilsem"
compatible, because XilSEM is common to Versal and Versal NET. Only
monolithic devices are supported.

Note on CE reporting after a bitstream reload:
The PLM clears the XilSEM RTCA, including the CE count, when a new
bitstream is loaded. The driver reads the CE count to find the CEs that
are new since its last report, and takes a count below the saved one as
a reload. A reload is not detected if the count has already reached or
passed the saved value when the callback runs, so the CEs up to the
saved value are not reported, and the EDAC CE count is too low by that
number. No CE is reported that did not happen. The RTCA does not
indicate that a reload happened. A complete fix needs a reload counter
in the RTCA, added in the XilSEM and PLM source, which the driver can
compare. This driver is not changed for it.

Note on xlnx_unregister_event():
xsem_edac_remove() unregisters the event and then frees its state, which
is the normal sequence for an event manager client. It is only safe if
xlnx_unregister_event() does not return while a callback is still
running on another CPU, and the event manager does not guarantee that
today: it walks its callback list from the SGI handler without RCU or a
lock. The missing wait belongs in the event manager, where one fix
covers every client, so this driver is not changed. A fix in the event
manager is planned. Until it lands, unbinding the driver while error
events are being raised is not safe. The probe path is not affected,
because the event is registered as the last step of probe.

This series contains:
- A new devicetree binding for the "xlnx,xilsem" compatible.
- The firmware (EEMI) interface and the XilSEM error event node IDs
  and masks.
- The EDAC driver, with its sysfs ABI documentation in the same patch.

Changes in v5:
- Moved the XilSEM binding out of the Versal DDRMC EDAC yaml into its
  own xilsem yaml, with a single "xlnx,xilsem" compatible.
- Moved the driver out of versal_edac.c into a separate xilsem_edac
  driver.
- Limited support to monolithic devices and documented it in the binding
  and ABI.
- Added the xlnx_unregister_event() and CE reload notes above.
- Added the L: linux-edac entry to MAINTAINERS.

Rama devi Veggalam (3):
  dt-bindings: edac: Add Xilinx XilSEM
  firmware: xilinx: Add XilSEM firmware interface
  edac: Add Xilinx XilSEM error monitoring driver

 .../ABI/testing/sysfs-devices-xilsem-edac          | 188 +++++
 .../devicetree/bindings/edac/xlnx,xilsem.yaml      |  53 ++
 MAINTAINERS                                        |  12 +
 drivers/edac/Kconfig                               |  16 +
 drivers/edac/Makefile                              |   1 +
 drivers/edac/xilsem_edac.c                         | 859 +++++++++++++++++++++
 drivers/edac/xilsem_edac.h                         | 131 ++++
 drivers/firmware/xilinx/Makefile                   |   2 +-
 drivers/firmware/xilinx/zynqmp-sem.c               | 142 ++++
 drivers/soc/xilinx/xlnx_event_manager.c            |  16 +-
 include/linux/firmware/xlnx-zynqmp-sem.h           | 127 +++
 include/linux/firmware/xlnx-zynqmp.h               |  50 ++
 12 files changed, 1594 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-devices-xilsem-edac
 create mode 100644 Documentation/devicetree/bindings/edac/xlnx,xilsem.yaml
 create mode 100644 drivers/edac/xilsem_edac.c
 create mode 100644 drivers/edac/xilsem_edac.h
 create mode 100644 drivers/firmware/xilinx/zynqmp-sem.c
 create mode 100644 include/linux/firmware/xlnx-zynqmp-sem.h

-- 
1.9.5