aboutsummaryrefslogtreecommitdiff
path: root/drivers/ieee1394/sbp2.h
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-07-23 22:16:00 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-09-17 19:29:22 +0200
commit3e98eab46d1a482532c653bdb0c006413654d171 (patch)
treeb7135fa6db9b39b3f351a6030df0131fb0514163 /drivers/ieee1394/sbp2.h
parentd4018d7fa63d25f3e1ecf6949fca6b81a182231a (diff)
ieee1394: sbp2: safer initialization of status fifo
Sbp2's copy of the status fifo was cleared when management ORBs or new command ORBs were prepared. The latter had potential for a race condition if the block layer's soft IRQ and the 1394 LLD's interrupt handler ran on different CPUs. It would also yield wrong status if a command was completed with non-zero completion status before other commands that had zero completion status, and no new command was enqueued in the meantime. Now, the status buffer is cleared right before it is written. Thus it ends up in the following simpler and safer access pattern: - sbp2_alloc_device: allocates and implicitly clears once, - sbp2_handle_status_write: clears, writes, and reads, - sbp2_query_logins, sbp2_login_device, sbp2_reconnect_device: read. The latter three do not race with sbp2_handle_status_write because of how the protocol works. As a tiny optimization, the first two quadlets of the status never need to be cleared. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/sbp2.h')
0 files changed, 0 insertions, 0 deletions