dect
/
linux-2.6
Archived
13
0
Fork 0

dect: coa: fix race condition in firmware patching

Use atomic writes to make sure the DIP doesn't read the new
opcode before the operand has been written to memory.

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2011-07-13 21:12:33 +02:00
parent 9caa914b64
commit 84c198f221
1 changed files with 1 additions and 2 deletions

View File

@ -372,8 +372,7 @@ static void sc1442x_toggle_led(struct coa_device *dev)
static void sc1442x_write_cmd(const struct coa_device *dev, u16 label,
u8 opcode, u8 operand)
{
sc1442x_writeb(dev, dev->code_base + 2 * label + 0, opcode);
sc1442x_writeb(dev, dev->code_base + 2 * label + 1, operand);
sc1442x_writew(dev, dev->code_base + 2 * label, operand << 8 | opcode);
}
static void sc1442x_to_cmem(const struct coa_device *dev,