Message ID | 20190919171713.8060-2-hhhawa@amazon.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add an API for edac device, for mulriple errors | expand |
On 19.09.19 18:17:12, Hanna Hawa wrote: > Add an API for EDAC device to report multiple errors with same type. > > Signed-off-by: Hanna Hawa <hhhawa@amazon.com> With the change below it looks good to me: Acked-by: Robert Richter <rrichter@marvell.com> Thanks, -Robert > --- > drivers/edac/edac_device.c | 62 ++++++++++++++++++++++++++------------ > drivers/edac/edac_device.h | 40 ++++++++++++++++++++++++ > 2 files changed, 82 insertions(+), 20 deletions(-) > > diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c > index 65cf2b9355c4..866934f2bcb0 100644 > --- a/drivers/edac/edac_device.c > +++ b/drivers/edac/edac_device.c > @@ -555,12 +555,16 @@ static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info > return edac_dev->panic_on_ue; > } > > -void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, > - int inst_nr, int block_nr, const char *msg) > +void __edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, > + unsigned int count, int inst_nr, int block_nr, > + const char *msg) > { > struct edac_device_instance *instance; > struct edac_device_block *block = NULL; > > + if (!count) > + return; > + Those checks should be moved to the *_count() variants of both functions. [...] > +static inline void edac_device_handle_ce_count(struct edac_device_ctl_info *edac_dev, > + unsigned int count, int inst_nr, > + int block_nr, const char *msg) > +{ if (count) ... > + __edac_device_handle_ce(edac_dev, count, inst_nr, block_nr, msg); > +} > + > +static inline void edac_device_handle_ue_count(struct edac_device_ctl_info *edac_dev, > + unsigned int count, int inst_nr, > + int block_nr, const char *msg) > +{ Here too. > + __edac_device_handle_ue(edac_dev, count, inst_nr, block_nr, msg); > +}
Hi Hanna, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [cannot apply to v5.3 next-20190919] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Hanna-Hawa/Add-an-API-for-edac-device-for-mulriple-errors/20190920-012316 reproduce: make htmldocs :::::: branch date: 2 hours ago :::::: commit date: 2 hours ago If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All warnings (new ones prefixed by >>): Warning: The Sphinx 'sphinx_rtd_theme' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme. WARNING: dot(1) not found, for better output quality install graphviz from http://www.graphviz.org WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org) include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quotactl' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quota_on' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'getprocattr' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'setprocattr' not described in 'security_list_options' >> drivers/edac/edac_device.h:332: warning: Function parameter or member 'count' not described in '__edac_device_handle_ue' drivers/edac/edac_device.h:332: warning: Excess function parameter 'error_count' description in '__edac_device_handle_ue' >> drivers/edac/edac_device.h:345: warning: Function parameter or member 'count' not described in '__edac_device_handle_ce' drivers/edac/edac_device.h:345: warning: Excess function parameter 'error_count' description in '__edac_device_handle_ce' include/linux/regulator/machine.h:196: warning: Function parameter or member 'max_uV_step' not described in 'regulation_constraints' include/linux/regulator/driver.h:223: warning: Function parameter or member 'resume' not described in 'regulator_ops' include/linux/spi/spi.h:190: warning: Function parameter or member 'driver_override' not described in 'spi_device' fs/fs-writeback.c:913: warning: Excess function parameter 'nr_pages' description in 'cgroup_writeback_by_id' fs/direct-io.c:258: warning: Excess function parameter 'offset' description in 'dio_complete' fs/libfs.c:496: warning: Excess function parameter 'available' description in 'simple_write_end' fs/posix_acl.c:647: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode' fs/posix_acl.c:647: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode' fs/posix_acl.c:647: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode' drivers/usb/typec/bus.c:1: warning: 'typec_altmode_unregister_driver' not found drivers/usb/typec/bus.c:1: warning: 'typec_altmode_register_driver' not found drivers/usb/typec/class.c:1: warning: 'typec_altmode_unregister_notifier' not found drivers/usb/typec/class.c:1: warning: 'typec_altmode_register_notifier' not found include/linux/w1.h:277: warning: Function parameter or member 'of_match_table' not described in 'w1_family' include/linux/skbuff.h:888: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'list' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'head_frag' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'encapsulation' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'csum_valid' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'vlan_present' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'csum_level' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:888: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:233: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:515: warning: Function parameter or member 'sk_rx_skb_cache' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_wq_raw' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_tx_skb_cache' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_bpf_storage' not described in 'sock' include/net/sock.h:2439: warning: Function parameter or member 'tcp_rx_skb_cache_key' not described in 'DECLARE_STATIC_KEY_FALSE' include/net/sock.h:2439: warning: Excess function parameter 'sk' description in 'DECLARE_STATIC_KEY_FALSE' include/net/sock.h:2439: warning: Excess function parameter 'skb' description in 'DECLARE_STATIC_KEY_FALSE' include/linux/netdevice.h:2053: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'name_assign_type' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'mpls_ptr' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'xdp_prog' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'qdisc_hash' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device' include/linux/netdevice.h:2053: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state' drivers/net/phy/phylink.c:595: warning: Function parameter or member 'config' not described in 'phylink_create' drivers/net/phy/phylink.c:595: warning: Excess function parameter 'ndev' description in 'phylink_create' drivers/gpio/gpiolib-of.c:92: warning: Excess function parameter 'dev' description in 'of_gpio_need_valid_mask' include/linux/i2c.h:337: warning: Function parameter or member 'init_irq' not described in 'i2c_client' include/linux/input/sparse-keymap.h:43: warning: Function parameter or member 'sw' not described in 'key_entry' lib/genalloc.c:1: warning: 'gen_pool_add_virt' not found lib/genalloc.c:1: warning: 'gen_pool_alloc' not found lib/genalloc.c:1: warning: 'gen_pool_free' not found lib/genalloc.c:1: warning: 'gen_pool_alloc_algo' not found include/linux/bitmap.h:341: warning: Function parameter or member 'nbits' not described in 'bitmap_or_equal' include/linux/rculist.h:374: warning: Excess function parameter 'cond' description in 'list_for_each_entry_rcu' include/linux/rculist.h:651: warning: Excess function parameter 'cond' description in 'hlist_for_each_entry_rcu' mm/util.c:1: warning: 'get_user_pages_fast' not found mm/slab.c:4215: warning: Function parameter or member 'objp' not described in '__ksize' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:142: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:347: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor ' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:348: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor ' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:494: warning: Function parameter or member 'start' not described in 'amdgpu_vm_pt_first_dfs' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:823: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_flags' # https://github.com/0day-ci/linux/commit/a424d1ea95bc2f0f1a6f3c8bd097f62c23832281 git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout a424d1ea95bc2f0f1a6f3c8bd097f62c23832281 vim +332 drivers/edac/edac_device.h 6d8ef2472410c8 Mauro Carvalho Chehab 2016-10-29 319 a424d1ea95bc2f Hanna Hawa 2019-09-19 320 /** a424d1ea95bc2f Hanna Hawa 2019-09-19 321 * __edac_device_handle_ue(): a424d1ea95bc2f Hanna Hawa 2019-09-19 322 * perform a common output and handling of an 'edac_dev' UE event a424d1ea95bc2f Hanna Hawa 2019-09-19 323 * a424d1ea95bc2f Hanna Hawa 2019-09-19 324 * @edac_dev: pointer to struct &edac_device_ctl_info a424d1ea95bc2f Hanna Hawa 2019-09-19 325 * @error_count: number of errors of the same type a424d1ea95bc2f Hanna Hawa 2019-09-19 326 * @inst_nr: number of the instance where the UE error happened a424d1ea95bc2f Hanna Hawa 2019-09-19 327 * @block_nr: number of the block where the UE error happened a424d1ea95bc2f Hanna Hawa 2019-09-19 328 * @msg: message to be printed a424d1ea95bc2f Hanna Hawa 2019-09-19 329 */ a424d1ea95bc2f Hanna Hawa 2019-09-19 330 void __edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, a424d1ea95bc2f Hanna Hawa 2019-09-19 331 unsigned int count, int inst_nr, a424d1ea95bc2f Hanna Hawa 2019-09-19 @332 int block_nr, const char *msg); a424d1ea95bc2f Hanna Hawa 2019-09-19 333 /** a424d1ea95bc2f Hanna Hawa 2019-09-19 334 * __edac_device_handle_ce(): a424d1ea95bc2f Hanna Hawa 2019-09-19 335 * perform a common output and handling of an 'edac_dev' CE event a424d1ea95bc2f Hanna Hawa 2019-09-19 336 * a424d1ea95bc2f Hanna Hawa 2019-09-19 337 * @edac_dev: pointer to struct &edac_device_ctl_info a424d1ea95bc2f Hanna Hawa 2019-09-19 338 * @error_count: number of errors of the same type a424d1ea95bc2f Hanna Hawa 2019-09-19 339 * @inst_nr: number of the instance where the CE error happened a424d1ea95bc2f Hanna Hawa 2019-09-19 340 * @block_nr: number of the block where the CE error happened a424d1ea95bc2f Hanna Hawa 2019-09-19 341 * @msg: message to be printed a424d1ea95bc2f Hanna Hawa 2019-09-19 342 */ a424d1ea95bc2f Hanna Hawa 2019-09-19 343 void __edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, a424d1ea95bc2f Hanna Hawa 2019-09-19 344 unsigned int count, int inst_nr, a424d1ea95bc2f Hanna Hawa 2019-09-19 @345 int block_nr, const char *msg); a424d1ea95bc2f Hanna Hawa 2019-09-19 346 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
On 9/20/2019 9:42 AM, Robert Richter wrote: > On 19.09.19 18:17:12, Hanna Hawa wrote: >> Add an API for EDAC device to report multiple errors with same type. >> >> Signed-off-by: Hanna Hawa <hhhawa@amazon.com> > > With the change below it looks good to me: > > Acked-by: Robert Richter <rrichter@marvell.com> Thanks > > Thanks, > > -Robert > >> --- >> drivers/edac/edac_device.c | 62 ++++++++++++++++++++++++++------------ >> drivers/edac/edac_device.h | 40 ++++++++++++++++++++++++ >> 2 files changed, 82 insertions(+), 20 deletions(-) >> >> diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c >> index 65cf2b9355c4..866934f2bcb0 100644 >> --- a/drivers/edac/edac_device.c >> +++ b/drivers/edac/edac_device.c >> @@ -555,12 +555,16 @@ static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info >> return edac_dev->panic_on_ue; >> } >> >> -void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, >> - int inst_nr, int block_nr, const char *msg) >> +void __edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, >> + unsigned int count, int inst_nr, int block_nr, >> + const char *msg) >> { >> struct edac_device_instance *instance; >> struct edac_device_block *block = NULL; >> >> + if (!count) >> + return; >> + > > Those checks should be moved to the *_count() variants of both > functions. Will be moved to the inline functions. > > [...] > >> +static inline void edac_device_handle_ce_count(struct edac_device_ctl_info *edac_dev, >> + unsigned int count, int inst_nr, >> + int block_nr, const char *msg) >> +{ > > if (count) > ... > >> + __edac_device_handle_ce(edac_dev, count, inst_nr, block_nr, msg); >> +} >> + >> +static inline void edac_device_handle_ue_count(struct edac_device_ctl_info *edac_dev, >> + unsigned int count, int inst_nr, >> + int block_nr, const char *msg) >> +{ > > Here too. > >> + __edac_device_handle_ue(edac_dev, count, inst_nr, block_nr, msg); >> +} Thanks, Hanna
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 65cf2b9355c4..866934f2bcb0 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -555,12 +555,16 @@ static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info return edac_dev->panic_on_ue; } -void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, - int inst_nr, int block_nr, const char *msg) +void __edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, + unsigned int count, int inst_nr, int block_nr, + const char *msg) { struct edac_device_instance *instance; struct edac_device_block *block = NULL; + if (!count) + return; + if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { edac_device_printk(edac_dev, KERN_ERR, "INTERNAL ERROR: 'instance' out of range " @@ -582,27 +586,31 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, if (instance->nr_blocks > 0) { block = instance->blocks + block_nr; - block->counters.ce_count++; + block->counters.ce_count += count; } /* Propagate the count up the 'totals' tree */ - instance->counters.ce_count++; - edac_dev->counters.ce_count++; + instance->counters.ce_count += count; + edac_dev->counters.ce_count += count; if (edac_device_get_log_ce(edac_dev)) edac_device_printk(edac_dev, KERN_WARNING, - "CE: %s instance: %s block: %s '%s'\n", - edac_dev->ctl_name, instance->name, - block ? block->name : "N/A", msg); + "CE: %s instance: %s block: %s count: %d '%s'\n", + edac_dev->ctl_name, instance->name, + block ? block->name : "N/A", count, msg); } -EXPORT_SYMBOL_GPL(edac_device_handle_ce); +EXPORT_SYMBOL_GPL(__edac_device_handle_ce); -void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, - int inst_nr, int block_nr, const char *msg) +void __edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, + unsigned int count, int inst_nr, int block_nr, + const char *msg) { struct edac_device_instance *instance; struct edac_device_block *block = NULL; + if (!count) + return; + if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { edac_device_printk(edac_dev, KERN_ERR, "INTERNAL ERROR: 'instance' out of range " @@ -624,22 +632,36 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, if (instance->nr_blocks > 0) { block = instance->blocks + block_nr; - block->counters.ue_count++; + block->counters.ue_count += count; } /* Propagate the count up the 'totals' tree */ - instance->counters.ue_count++; - edac_dev->counters.ue_count++; + instance->counters.ue_count += count; + edac_dev->counters.ue_count += count; if (edac_device_get_log_ue(edac_dev)) edac_device_printk(edac_dev, KERN_EMERG, - "UE: %s instance: %s block: %s '%s'\n", - edac_dev->ctl_name, instance->name, - block ? block->name : "N/A", msg); + "UE: %s instance: %s block: %s count: %d '%s'\n", + edac_dev->ctl_name, instance->name, + block ? block->name : "N/A", count, msg); if (edac_device_get_panic_on_ue(edac_dev)) - panic("EDAC %s: UE instance: %s block %s '%s'\n", - edac_dev->ctl_name, instance->name, - block ? block->name : "N/A", msg); + panic("EDAC %s: UE instance: %s block %s count: %d '%s'\n", + edac_dev->ctl_name, instance->name, + block ? block->name : "N/A", count, msg); +} +EXPORT_SYMBOL_GPL(__edac_device_handle_ue); + +void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, + int inst_nr, int block_nr, const char *msg) +{ + __edac_device_handle_ce(edac_dev, 1, inst_nr, block_nr, msg); +} +EXPORT_SYMBOL_GPL(edac_device_handle_ce); + +void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, + int inst_nr, int block_nr, const char *msg) +{ + __edac_device_handle_ue(edac_dev, 1, inst_nr, block_nr, msg); } EXPORT_SYMBOL_GPL(edac_device_handle_ue); diff --git a/drivers/edac/edac_device.h b/drivers/edac/edac_device.h index 1aaba74ae411..30dc5f5979c8 100644 --- a/drivers/edac/edac_device.h +++ b/drivers/edac/edac_device.h @@ -317,4 +317,44 @@ extern void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, extern int edac_device_alloc_index(void); extern const char *edac_layer_name[]; +/** + * __edac_device_handle_ue(): + * perform a common output and handling of an 'edac_dev' UE event + * + * @edac_dev: pointer to struct &edac_device_ctl_info + * @error_count: number of errors of the same type + * @inst_nr: number of the instance where the UE error happened + * @block_nr: number of the block where the UE error happened + * @msg: message to be printed + */ +void __edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, + unsigned int count, int inst_nr, + int block_nr, const char *msg); +/** + * __edac_device_handle_ce(): + * perform a common output and handling of an 'edac_dev' CE event + * + * @edac_dev: pointer to struct &edac_device_ctl_info + * @error_count: number of errors of the same type + * @inst_nr: number of the instance where the CE error happened + * @block_nr: number of the block where the CE error happened + * @msg: message to be printed + */ +void __edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, + unsigned int count, int inst_nr, + int block_nr, const char *msg); + +static inline void edac_device_handle_ce_count(struct edac_device_ctl_info *edac_dev, + unsigned int count, int inst_nr, + int block_nr, const char *msg) +{ + __edac_device_handle_ce(edac_dev, count, inst_nr, block_nr, msg); +} + +static inline void edac_device_handle_ue_count(struct edac_device_ctl_info *edac_dev, + unsigned int count, int inst_nr, + int block_nr, const char *msg) +{ + __edac_device_handle_ue(edac_dev, count, inst_nr, block_nr, msg); +} #endif
Add an API for EDAC device to report multiple errors with same type. Signed-off-by: Hanna Hawa <hhhawa@amazon.com> --- drivers/edac/edac_device.c | 62 ++++++++++++++++++++++++++------------ drivers/edac/edac_device.h | 40 ++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 20 deletions(-)