Thread (24 messages) flat view 24 messages, 4 authors, 2017-07-18

Re: [PATCH v3 02/10] mtd: powernv_flash: Lock around concurrent access to OPAL

From: Cyril Bur <hidden>
Date: 2017-07-17 07:56:00

On Mon, 2017-07-17 at 17:34 +1000, Balbir Singh wrote:
On Wed, 2017-07-12 at 14:22 +1000, Cyril Bur wrote:
quoted
OPAL can only manage one flash access at a time and will return an
OPAL_BUSY error for each concurrent access to the flash. The simplest
way to prevent this from happening is with a mutex.

Signed-off-by: Cyril Bur <redacted>
---
Should the mutex_lock() be mutex_lock_interruptible()? Are we OK waiting on
the mutex while other operations with the lock are busy?
This is a good question. My best interpretation is that
_interruptible() should be used when you'll only be coming from a user
context. Which is mostly true for this driver, however, MTD does
provide kernel interfaces, so I was hesitant, there isn't a great deal
of use of _interruptible() in drivers/mtd. 

Thoughts?

Cyril
Balbir Singh.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help