lkml.org 
[lkml]   [2008]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4/4] firewire: fw-core: react on bus resets while the config ROM is being fetched
    Stefan Richter wrote:
    > 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.
    >
    > Side note: The barrier in read_rom(), inserted by patch "firewire:
    > enforce access order between generation and node ID" is not necessary
    > anymore because the sequence of calls
    > fw_device_init() ->
    > read_bus_info_block() ->
    > read_rom()
    > read_rom()
    > read_rom()
    > ...
    > will take care that generation is read before node_id, won't it?
    >
    > Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

    Based on a quick read through the code path, coupled with empirical evidence,
    yes, it appears safe to remove the barrier in read_rom().

    Signed-off-by: Jarod Wilson <jwilson@redhat.com>

    --
    Jarod Wilson
    jwilson@redhat.com



    \
     
     \ /
      Last update: 2008-01-24 17:15    [W:5.964 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site