From patchwork Tue Jul 16 15:03:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 13734590 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2F65C3DA59 for ; Tue, 16 Jul 2024 15:04:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A11C6B0082; Tue, 16 Jul 2024 11:04:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 152426B0088; Tue, 16 Jul 2024 11:04:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBDF26B008A; Tue, 16 Jul 2024 11:04:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C283B6B0088 for ; Tue, 16 Jul 2024 11:04:33 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4A173817AA for ; Tue, 16 Jul 2024 15:04:33 +0000 (UTC) X-FDA: 82345937226.05.A854527 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf21.hostedemail.com (Postfix) with ESMTP id 25F0D1C0020 for ; Tue, 16 Jul 2024 15:04:30 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721142252; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MawF3QXYY+z0fdhXnN2UiVEGSuV4Ei+HbSmoDlqJP1k=; b=LRkcNiqc0F+vdEl4TaCwSwwhIcFkUL5DrIkq4Rh8nyZ+zpf7zpDAyeiGkegwpAa6FK2482 jz7Fj3tYb/7N87/G7rER7gl127mQlbhTIEGUpFQBCQJmKsrd/Chv3PLBiJbtsFquvlMYKX 7Ee/qIPXwxrJwIOYmhGf3+snIYAKYIY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of shiju.jose@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=shiju.jose@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721142252; a=rsa-sha256; cv=none; b=3SBpLwdBnjtz800G6L7gvmmohpR0Z4JUNaViaF/Q872YaqGj0LsU5EAi5VGtHgE2TEj8pA lNJrGmuzOgtTzpdCYdGW8MIsaZrcv6J+rwLJ9R44UOZoJjXJK+yrJr3UIXuAys0C5Q/Qjw igmpAuk72KGSI8y7kw5nfzY9HOzJmaM= Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WNj4H5PQ5z6JB50; Tue, 16 Jul 2024 23:03:11 +0800 (CST) Received: from lhrpeml500006.china.huawei.com (unknown [7.191.161.198]) by mail.maildlp.com (Postfix) with ESMTPS id 8BF76140A70; Tue, 16 Jul 2024 23:04:27 +0800 (CST) Received: from P_UKIT01-A7bmah.china.huawei.com (10.48.159.153) by lhrpeml500006.china.huawei.com (7.191.161.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 16 Jul 2024 16:04:26 +0100 From: To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH v9 02/11] EDAC: Add EDAC scrub control driver Date: Tue, 16 Jul 2024 16:03:26 +0100 Message-ID: <20240716150336.2042-3-shiju.jose@huawei.com> X-Mailer: git-send-email 2.43.0.windows.1 In-Reply-To: <20240716150336.2042-1-shiju.jose@huawei.com> References: <20240716150336.2042-1-shiju.jose@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.48.159.153] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500006.china.huawei.com (7.191.161.198) X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 25F0D1C0020 X-Stat-Signature: u54hukdkxxtiqmm8y5yinjehe7wudard X-HE-Tag: 1721142270-467429 X-HE-Meta: U2FsdGVkX19/74nHV0dGcBh66NbtEIDAioxIWchKXTvWygbw/qVQ2A8cihItSUq/1fK4AC3MXGw4lOxSegiBlsHranjdCBEN6LFe+Pn2uqQY8b3GU/w+jff58EDLLoMBe1X9mkRZpQieb+BSR9Inr9DuFnMXea/exwWDkd3KmlKtq3YwBim+t9aM0IpsBmP/6o5nVBw2saTIzsob2HUcGRI3Kldri4bVyKCHqYbRXEMkCl7Jy7+0etu3jyKvZoXDlOLxcObx2nOwWa0pfwg8TSEPFqsgIrQyJjIaj9bmr/wqJ0G4PGoaOwWYu4PkaqvD+Jp5eiCGFSOhMea5zkBV6jojIia85ZCC6iObNvQtaf04nRkfrcGLC1flJKm5DJ6JX1orbTB5R6hiIprAK9ZgLoSKnYDezkT/JjPtDEK7scM9iaKs+xZ0fDv9XnRlbS66nVT6Ai9YKOMYfksHYaaX4Z9xkcsm7NrQFoOZ0BX6tW83F1L7mI0YTJsOjw6xw3JjSPX28kbMWvKieXyJzYoS62TtCI3xTn3H0ZnUIjAEkiEIXpjLClnk7rMke8qsFm36nt75967JqHnQ+h8A8FC49PDhrzRTJvFLmylGoMRgMjhO0/sQyD03evBAowDsA2INH1F+EwlKR58a9ynQG0ZsRXqG4oWRCyb9lxYOZU6STyypG+tpFyoQFqJgFY2PyqRn1jmWVdM1jUpDKqVsi7B4IegH55HQqNJVErmww8nyAb1IFdOSVdvwLvv5lWL1mF3SeZ2vjkOtyICeO9qg+pKgzAtq5+78yEemPoQXuHhBTJSxbkP6E97lQ0N1RFHnV/wxKpdoFcHdq+uHTk0Mnprg+mQn2AKU6W4dO1rPxwkxfWIO3RVjVxcG+G32fL4v5kePI5mO+Tcr7SiMDFksTAeCrd2csIuj2vywaNUbsMN9Mi70FrseULfhhIZii46gRf1c9bFMclr3KGWIo4wbqrU ksYkaG15 yeFtOAV/c7PnRQ21ApQM6dM1KM+0sGyIeLn+e38Z7TjdXKAe2yVtrX7ljD3182S0JWnRbxz8m2MBusbdD1vDtn4PBDpGck7kJZM27Yy8J4inl3GRn78gHhrR41Y1BCQjC+BGeVvPm4seLebRMXZCUIxrhIbjdARJ07S+KptRdnm6H2Hzk8UN0fZz/C0JlpNMBI8EuE8Ym7tgcLMKmr6wApNKvYtyqW1BrOoaJTzRhDZ4VCsQeripNb/5f3Cmr12DqiuJkhsj6ZSNuD3pQjODUePlsbRidhn2K5LfOArxAKE+i5sY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Shiju Jose Add generic EDAC scrub control driver supports configuring the memory scrubbers in the system. The device with scrub feature, get the scrub descriptor from the EDAC scrub and registers with the EDAC RAS feature driver, which adds the sysfs scrub control interface. The scrub control attributes are available to the userspace in /sys/bus/edac/devices//scrub/. Generic EDAC scrub driver and the common sysfs scrub interface promotes unambiguous access from the userspace irrespective of the underlying scrub devices. Co-developed-by: Jonathan Cameron Signed-off-by: Jonathan Cameron Signed-off-by: Shiju Jose --- Documentation/ABI/testing/sysfs-edac-scrub | 64 +++++ drivers/edac/Makefile | 2 +- drivers/edac/edac_ras_feature.c | 1 + drivers/edac/edac_scrub.c | 312 +++++++++++++++++++++ include/linux/edac_ras_feature.h | 28 ++ 5 files changed, 406 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-edac-scrub create mode 100755 drivers/edac/edac_scrub.c diff --git a/Documentation/ABI/testing/sysfs-edac-scrub b/Documentation/ABI/testing/sysfs-edac-scrub new file mode 100644 index 000000000000..dd19afd5e165 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-edac-scrub @@ -0,0 +1,64 @@ +What: /sys/bus/edac/devices//scrub +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + The sysfs edac bus devices //scrub subdirectory + belongs to the memory scrub control feature, where + directory corresponds to a device/memory region registered + with the edac scrub driver and thus registered with the + generic edac ras driver too. + +What: /sys/bus/edac/devices//scrub/addr_range_base +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + (RW) The base of the address range of the memory region + to be scrubbed (on-demand scrubbing). + +What: /sys/bus/edac/devices//scrub/addr_range_size +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + (RW) The size of the address range of the memory region + to be scrubbed (on-demand scrubbing). + +What: /sys/bus/edac/devices//scrub/enable_background +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + (RW) Start/Stop background(patrol) scrubbing if supported. + +What: /sys/bus/edac/devices//scrub/enable_on_demand +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + (RW) Start/Stop on-demand scrubbing the memory region + if supported. + +What: /sys/bus/edac/devices//scrub/name +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + (RO) name of the memory scrubber + +What: /sys/bus/edac/devices//scrub/cycle_in_hours_available +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + (RO) Supported range for the scrub cycle in hours by the + memory scrubber. + +What: /sys/bus/edac/devices//scrub/cycle_in_hours +Date: Oct 2024 +KernelVersion: 6.12 +Contact: linux-edac@vger.kernel.org +Description: + (RW) The scrub cycle in hours specified and it must be with in the + supported range by the memory scrubber. diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile index c532b57a6d8a..de56cbd039eb 100644 --- a/drivers/edac/Makefile +++ b/drivers/edac/Makefile @@ -10,7 +10,7 @@ obj-$(CONFIG_EDAC) := edac_core.o edac_core-y := edac_mc.o edac_device.o edac_mc_sysfs.o edac_core-y += edac_module.o edac_device_sysfs.o wq.o -edac_core-y += edac_ras_feature.o +edac_core-y += edac_ras_feature.o edac_scrub.o edac_core-$(CONFIG_EDAC_DEBUG) += debugfs.o diff --git a/drivers/edac/edac_ras_feature.c b/drivers/edac/edac_ras_feature.c index 24a729fea66f..48927f868372 100755 --- a/drivers/edac/edac_ras_feature.c +++ b/drivers/edac/edac_ras_feature.c @@ -36,6 +36,7 @@ static int edac_ras_feat_scrub_init(struct device *parent, { sdata->ops = sfeat->scrub_ops; sdata->private = sfeat->scrub_ctx; + attr_groups[0] = edac_scrub_get_desc(); return 1; } diff --git a/drivers/edac/edac_scrub.c b/drivers/edac/edac_scrub.c new file mode 100755 index 000000000000..0b07eafd3551 --- /dev/null +++ b/drivers/edac/edac_scrub.c @@ -0,0 +1,312 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Generic EDAC scrub driver supports controlling the memory + * scrubbers in the system and the common sysfs scrub interface + * promotes unambiguous access from the userspace. + * + * Copyright (c) 2024 HiSilicon Limited. + */ + +#define pr_fmt(fmt) "EDAC SCRUB: " fmt + +#include + +static ssize_t addr_range_base_show(struct device *ras_feat_dev, + struct device_attribute *attr, + char *buf) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + u64 base, size; + int ret; + + ret = ops->read_range(ras_feat_dev->parent, ctx->scrub.private, &base, &size); + if (ret) + return ret; + + return sysfs_emit(buf, "0x%llx\n", base); +} + +static ssize_t addr_range_size_show(struct device *ras_feat_dev, + struct device_attribute *attr, + char *buf) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + u64 base, size; + int ret; + + ret = ops->read_range(ras_feat_dev->parent, ctx->scrub.private, &base, &size); + if (ret) + return ret; + + return sysfs_emit(buf, "0x%llx\n", size); +} + +static ssize_t addr_range_base_store(struct device *ras_feat_dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + u64 base, size; + int ret; + + ret = ops->read_range(ras_feat_dev->parent, ctx->scrub.private, &base, &size); + if (ret) + return ret; + + ret = kstrtou64(buf, 16, &base); + if (ret < 0) + return ret; + + ret = ops->write_range(ras_feat_dev->parent, ctx->scrub.private, base, size); + if (ret) + return ret; + + return len; +} + +static ssize_t addr_range_size_store(struct device *ras_feat_dev, + struct device_attribute *attr, + const char *buf, + size_t len) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + u64 base, size; + int ret; + + ret = ops->read_range(ras_feat_dev->parent, ctx->scrub.private, &base, &size); + if (ret) + return ret; + + ret = kstrtou64(buf, 16, &size); + if (ret < 0) + return ret; + + ret = ops->write_range(ras_feat_dev->parent, ctx->scrub.private, base, size); + if (ret) + return ret; + + return len; +} + +static ssize_t enable_background_store(struct device *ras_feat_dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + bool enable; + int ret; + + ret = kstrtobool(buf, &enable); + if (ret < 0) + return ret; + + ret = ops->set_enabled_bg(ras_feat_dev->parent, ctx->scrub.private, enable); + if (ret) + return ret; + + return len; +} + +static ssize_t enable_background_show(struct device *ras_feat_dev, + struct device_attribute *attr, char *buf) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + bool enable; + int ret; + + ret = ops->get_enabled_bg(ras_feat_dev->parent, ctx->scrub.private, &enable); + if (ret) + return ret; + + return sysfs_emit(buf, "%d\n", enable); +} + +static ssize_t enable_on_demand_show(struct device *ras_feat_dev, + struct device_attribute *attr, char *buf) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + bool enable; + int ret; + + ret = ops->get_enabled_od(ras_feat_dev->parent, ctx->scrub.private, &enable); + if (ret) + return ret; + + return sysfs_emit(buf, "%d\n", enable); +} + +static ssize_t enable_on_demand_store(struct device *ras_feat_dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + bool enable; + int ret; + + ret = kstrtobool(buf, &enable); + if (ret < 0) + return ret; + + ret = ops->set_enabled_od(ras_feat_dev->parent, ctx->scrub.private, enable); + if (ret) + return ret; + + return len; +} + +static ssize_t name_show(struct device *ras_feat_dev, + struct device_attribute *attr, char *buf) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + int ret; + + ret = ops->get_name(ras_feat_dev->parent, ctx->scrub.private, buf); + if (ret) + return ret; + + return strlen(buf); +} + +static ssize_t cycle_in_hours_show(struct device *ras_feat_dev, struct device_attribute *attr, + char *buf) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + u64 val; + int ret; + + ret = ops->cycle_in_hours_read(ras_feat_dev->parent, ctx->scrub.private, &val); + if (ret) + return ret; + + return sysfs_emit(buf, "0x%llx\n", val); +} + +static ssize_t cycle_in_hours_store(struct device *ras_feat_dev, struct device_attribute *attr, + const char *buf, size_t len) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + long val; + int ret; + + ret = kstrtol(buf, 10, &val); + if (ret < 0) + return ret; + + ret = ops->cycle_in_hours_write(ras_feat_dev->parent, ctx->scrub.private, val); + if (ret) + return ret; + + return len; +} + +static ssize_t cycle_in_hours_range_show(struct device *ras_feat_dev, + struct device_attribute *attr, + char *buf) +{ + struct edac_ras_feat_ctx *ctx = dev_get_drvdata(ras_feat_dev); + const struct edac_scrub_ops *ops = ctx->scrub.ops; + u64 min_schrs, max_schrs; + int ret; + + ret = ops->cycle_in_hours_range(ras_feat_dev->parent, ctx->scrub.private, + &min_schrs, &max_schrs); + if (ret) + return ret; + + return sysfs_emit(buf, "0x%llx-0x%llx\n", min_schrs, max_schrs); +} + +static DEVICE_ATTR_RW(addr_range_base); +static DEVICE_ATTR_RW(addr_range_size); +static DEVICE_ATTR_RW(enable_background); +static DEVICE_ATTR_RW(enable_on_demand); +static DEVICE_ATTR_RO(name); +static DEVICE_ATTR_RW(cycle_in_hours); +static DEVICE_ATTR_RO(cycle_in_hours_range); + +static struct attribute *scrub_attrs[] = { + &dev_attr_addr_range_base.attr, + &dev_attr_addr_range_size.attr, + &dev_attr_enable_background.attr, + &dev_attr_enable_on_demand.attr, + &dev_attr_name.attr, + &dev_attr_cycle_in_hours.attr, + &dev_attr_cycle_in_hours_range.attr, + NULL +}; + +static umode_t scrub_attr_visible(struct kobject *kobj, + struct attribute *a, int attr_id) +{ + struct device *ras_feat_dev = kobj_to_dev(kobj); + struct edac_ras_feat_ctx *ctx; + const struct edac_scrub_ops *ops; + + ctx = dev_get_drvdata(ras_feat_dev); + if (!ctx) + return 0; + + ops = ctx->scrub.ops; + if (a == &dev_attr_addr_range_base.attr || + a == &dev_attr_addr_range_size.attr) { + if (ops->read_range && ops->write_range) + return a->mode; + if (ops->read_range) + return 0444; + return 0; + } + if (a == &dev_attr_enable_background.attr) { + if (ops->set_enabled_bg && ops->get_enabled_bg) + return a->mode; + if (ops->get_enabled_bg) + return 0444; + return 0; + } + if (a == &dev_attr_enable_on_demand.attr) { + if (ops->set_enabled_od && ops->get_enabled_od) + return a->mode; + if (ops->get_enabled_od) + return 0444; + return 0; + } + if (a == &dev_attr_name.attr) + return ops->get_name ? a->mode : 0; + if (a == &dev_attr_cycle_in_hours_range.attr) + return ops->cycle_in_hours_range ? a->mode : 0; + if (a == &dev_attr_cycle_in_hours.attr) { /* Write only makes little sense */ + if (ops->cycle_in_hours_read && ops->cycle_in_hours_write) + return a->mode; + if (ops->cycle_in_hours_read) + return 0444; + return 0; + } + + return 0; +} + +static const struct attribute_group scrub_attr_group = { + .name = "scrub", + .attrs = scrub_attrs, + .is_visible = scrub_attr_visible, +}; + +/** + * edac_scrub_get_desc - get edac scrub's attr descriptor + * + * Returns attribute_group for the scrub feature. + */ +const struct attribute_group *edac_scrub_get_desc(void) +{ + return &scrub_attr_group; +} diff --git a/include/linux/edac_ras_feature.h b/include/linux/edac_ras_feature.h index 000e99141023..462f9ecbf9d4 100755 --- a/include/linux/edac_ras_feature.h +++ b/include/linux/edac_ras_feature.h @@ -19,6 +19,34 @@ enum edac_ras_feat { ras_feat_max }; +/** + * struct scrub_ops - scrub device operations (all elements optional) + * @read_range: read base and offset of scrubbing range. + * @write_range: set the base and offset of the scrubbing range. + * @get_enabled_bg: check if currently performing background scrub. + * @set_enabled_bg: start or stop a bg-scrub. + * @get_enabled_od: check if currently performing on-demand scrub. + * @set_enabled_od: start or stop an on-demand scrub. + * @cycle_in_hours_range: retrieve limits on supported cycle in hours. + * @cycle_in_hours_read: read the scrub cycle in hours. + * @cycle_in_hours_write: set the scrub cycle in hours. + * @get_name: get the memory scrubber's name. + */ +struct edac_scrub_ops { + int (*read_range)(struct device *dev, void *drv_data, u64 *base, u64 *size); + int (*write_range)(struct device *dev, void *drv_data, u64 base, u64 size); + int (*get_enabled_bg)(struct device *dev, void *drv_data, bool *enable); + int (*set_enabled_bg)(struct device *dev, void *drv_data, bool enable); + int (*get_enabled_od)(struct device *dev, void *drv_data, bool *enable); + int (*set_enabled_od)(struct device *dev, void *drv_data, bool enable); + int (*cycle_in_hours_range)(struct device *dev, void *drv_data, u64 *min, u64 *max); + int (*cycle_in_hours_read)(struct device *dev, void *drv_data, u64 *schrs); + int (*cycle_in_hours_write)(struct device *dev, void *drv_data, u64 schrs); + int (*get_name)(struct device *dev, void *drv_data, char *buf); +}; + +const struct attribute_group *edac_scrub_get_desc(void); + struct edac_ecs_ex_info { u16 num_media_frus; };