Commit 793e95c
committed
hw/bus: Update sanity check for locking
Code assume that node can be locked only once and
second lock is probably for another node.
Lock are internally use on each transaction.
Write, read, write then read transactions can be
used with just one lock.
spiflash driver locks node when it wants to write,
however writing consist of two transactions fist
command is sent (4 bytes) then another write is
done with separate buffer. CS must be low during
those two writes. While write could be performed
successfully current implementation would require
SPI controller to be unlocked between writes.
This could potentially lead to SPI controller
being locked for another device while CS is still
down for spi flash.
In fact due to sanity check spi flash driver
did not work at all with any bus driver since
code tried to lock device before writes and
then both writes would fail due to nested lock
sanity check.
Now sanit check verifies that nested lock is
for same device.
Signed-off-by: Jerzy Kasenberg <jerzy@apache.org>1 parent 3321a93 commit 793e95c
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
535 | | - | |
536 | | - | |
| 534 | + | |
| 535 | + | |
537 | 536 | | |
538 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
539 | 541 | | |
540 | 542 | | |
541 | 543 | | |
| |||
0 commit comments