diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2015-09-18 01:01:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 20:50:57 +0200 |
commit | 0b0496625715374c7d0b747268c11528e8af32a3 (patch) | |
tree | 6f129e982f9f3325162afe0271414833597471e9 /drivers/vme/vme_bridge.h | |
parent | vme: include address space in error filtering (diff) | |
download | linux-0b0496625715374c7d0b747268c11528e8af32a3.tar.xz linux-0b0496625715374c7d0b747268c11528e8af32a3.zip |
vme: change bus error handling scheme
The current VME bus error handler adds errors to the bridge error list.
vme_master_{read,write} then traverses that list to look for relevant
errors.
Such scheme didn't work well for accesses going through vme_master_mmap
because they would also allocate a vme_bus_error, but have no way to do
vme_clear_errors call to free that memory.
This changes the error handling process to be other way around: now
vme_master_{read,write} defines a window in VME address space that will
catch possible errors. VME bus error interrupt only traverses these
windows and marks those that had errors in them.
Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Cc: Igor Alekseev <igor.alekseev@itep.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vme/vme_bridge.h')
-rw-r--r-- | drivers/vme/vme_bridge.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/vme/vme_bridge.h b/drivers/vme/vme_bridge.h index 92fbe18cbc42..397578a73883 100644 --- a/drivers/vme/vme_bridge.h +++ b/drivers/vme/vme_bridge.h @@ -75,10 +75,13 @@ struct vme_lm_resource { int monitors; }; -struct vme_bus_error { +struct vme_error_handler { struct list_head list; - u32 aspace; - unsigned long long address; + unsigned long long start; /* Beginning of error window */ + unsigned long long end; /* End of error window */ + unsigned long long first_error; /* Address of the first error */ + u32 aspace; /* Address space of error window*/ + unsigned num_errors; /* Number of errors */ }; struct vme_callback { @@ -106,8 +109,10 @@ struct vme_bridge { struct list_head dma_resources; struct list_head lm_resources; - struct list_head vme_errors; /* List for errors generated on VME */ - struct list_head devices; /* List of devices on this bridge */ + /* List for registered errors handlers */ + struct list_head vme_error_handlers; + /* List of devices on this bridge */ + struct list_head devices; /* Bridge Info - XXX Move to private structure? */ struct device *parent; /* Parent device (eg. pdev->dev for PCI) */ @@ -168,13 +173,13 @@ struct vme_bridge { void vme_bus_error_handler(struct vme_bridge *bridge, unsigned long long address, int am); -struct vme_bus_error *vme_find_error(struct vme_bridge *bridge, u32 aspace, - unsigned long long address, size_t count); -void vme_clear_errors(struct vme_bridge *bridge, u32 aspace, - unsigned long long address, size_t count); void vme_irq_handler(struct vme_bridge *, int, int); int vme_register_bridge(struct vme_bridge *); void vme_unregister_bridge(struct vme_bridge *); +struct vme_error_handler *vme_register_error_handler( + struct vme_bridge *bridge, u32 aspace, + unsigned long long address, size_t len); +void vme_unregister_error_handler(struct vme_error_handler *handler); #endif /* _VME_BRIDGE_H_ */ |