[lkml]   [2008]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 1/1] Blackfin OTP Char Driver: add writing support of OTP
    On 10/13/2008 12:07 PM, Mike Frysinger wrote:
    > the pos gets updated every time a half-page gets processed. so if you
    > call write() and tell it to write 128 bytes, but you get an error half
    > way through, the pos points right at the place where the error
    > occurred. i dont get what you're asking.

    Ah, OK, that's because I don't know exactly what should happen if a write fails.
    I though userspace expects the state of the fd to not be touched.

    >> But is this OK to you:
    >> lock
    >> set allow_writes
    >> write
    >> check allow_writes
    >> be interrupted
    >> whatever
    >> unlock
    >> unset allow_writes
    >> sleep
    >> mutex lock
    >> the processing...
    > i dont see a problem here. there is no loss of data, hardware
    > failure, software crashes, etc... in other words, there is no
    > misbehavior.

    I see no purpose of allow_writes then. Why is it there? I don't need to call
    memlock if anybody else did and I raced with him. Also when somebody else
    unlocks after finishing of writes I can start failing in the middle of my writes
    -- this doesn't have anything to do with locking, but with the design, the one
    global variable.

     \ /
      Last update: 2008-10-13 12:37    [W:0.022 / U:2.400 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site