mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
mtd: docg3 add protection against concurrency
As docg3 is intolerant against reentrancy, especially because of its weird register access (ie. a register read is performed by a first register write), each access to the docg3 IO space must be locked. Lock the IO space with a mutex, shared by all chips on the same cascade, as they all share the same IO space. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
committed by
David Woodhouse
parent
1b15a5f93b
commit
7b0e67f604
@@ -273,11 +273,13 @@
|
||||
* @floors: floors (ie. one physical docg3 chip is one floor)
|
||||
* @base: IO space to access all chips in the cascade
|
||||
* @bch: the BCH correcting control structure
|
||||
* @lock: lock to protect docg3 IO space from concurrent accesses
|
||||
*/
|
||||
struct docg3_cascade {
|
||||
struct mtd_info *floors[DOC_MAX_NBFLOORS];
|
||||
void __iomem *base;
|
||||
struct bch_control *bch;
|
||||
struct mutex lock;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user