]> git.baikalelectronics.ru Git - kernel.git/commit
firewire: fw-core: react on bus resets while the config ROM is being fetched
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Fri, 25 Jan 2008 16:53:49 +0000 (17:53 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 30 Jan 2008 21:22:28 +0000 (22:22 +0100)
commit22cdf85d2f3494b1d6ee9da20e28785b2e8f1d58
tree7576ee70223a9ad550b8dd7dbad339d9f6b03052
parent751bae83a4287d6d8529e3ab296b714b07d06588
firewire: fw-core: react on bus resets while the config ROM is being fetched

read_rom() obtained a fresh new fw_device.generation for each read
transaction.  Hence it was able to continue reading in the middle of the
ROM even if a bus reset happened.  However the device may have modified
the ROM during the reset.  We would end up with a corrupt fetched ROM
image then.

Although all of this is quite unlikely, it is not impossible.
Therefore we now restart reading the ROM if the bus generation changed.

Note, the memory barrier in read_rom() is still necessary according to
tests by Jarod Wilson, despite of the ->generation access being moved up
in the call chain.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This is essentially what I've been beating on locally, and I've yet to hit
another config rom read failure with it.

Signed-off-by: Jarod Wilson <jwilson@redhat.com>
drivers/firewire/fw-device.c