1. 22 Nov, 2014 5 commits
    • Alex Elder's avatar
      greybus: minor tweak in gb_connection_recv_response() · 0e3d0e8f
      Alex Elder authored
      Any time we queue work on the operation work queue we need to have
      set the operation errno first.
      
      This patch moves the assignment of that field to be immediately
      prior to the queue_work() call in gb_connection_recv_response(),
      so it is easier to see at a glance that this has been done.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      0e3d0e8f
    • Alex Elder's avatar
      greybus: add a reference to pending operations · deb4b9ef
      Alex Elder authored
      Grab an extra reference to an operation before sending it.  Drop
      that reference at the end of its completion handling.
      
      It turns out gb_operation_get() got deleted along the way, so this
      re-introduces it.  We're assuming we only get a reference when
      there's at least one in existence so we don't need a semaphore to
      protect it.  Emphasize this by *not* returning a pointer to
      the referenced operation.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      deb4b9ef
    • Alex Elder's avatar
      greybus: handle data send errors in workqueue · 583c3117
      Alex Elder authored
      The data sent callback can execute in atomic context.  If an error
      occurred, we shouldn't be completing the operation right then and
      there.  Instead, hand it off to the operation workqueue to complete
      the operation.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      583c3117
    • Alex Elder's avatar
      greybus: abandon incoming requests for now · ee637a9b
      Alex Elder authored
      Change the operation "receive workqueue" to be just the operation
      "workqueue".  All it does is complete an operation in non-atomic
      context.  This is all that's required for an outgoing request.
      
      Similarly, ignore any notion that a response will only exist
      for outgoing requests in gb_operation_cancel().
      
      I'm doing this in the interest of getting the outgoing request path
      verified without the encumbrance of any preconceptions about how
      incoming requests need to work.  When I finally turn my full
      attenion to incoming requests I'll adapt the code as needed.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      ee637a9b
    • Alex Elder's avatar
      greybus: use errno for operation result · 23383def
      Alex Elder authored
      An in-core operation structure tracks the progress of an operation.
      Currently it holds a result field that was intended to take the
      status value that arrives in an operation response message header.
      
      But operations can fail for reasons other than that, and it's
      inconvenient to try to represent those using the operation status
      codes.
      
      So change the operation->result field to be an int, and switch to
      storing negative errno values in it.  Rename it "errno" to make
      it obvious how to interpret the value.
      
      This patch makes another change, which simplifies the protocol drivers
      a lot.  It's being done as part of this patch because it affects all
      the same code as the above change does.  If desired I can split this
      into two separate patches.
      
      If a caller makes a synchronous gb_operation_request_send() request
      (i.e., no callback function is supplied), and the operation request
      and response messages were transferred successfully, have
      gb_operation_request_send() return the result of the request (i.e.,
      operation->errno).  This allows the caller (or more generally, any
      caller of gb_request_wait() to avoid having to look at this field
      for every successful send.
      
      Any caller that does an asynchronous request will of course need
      to look at request->errno in the callback function to see the
      result of the operation.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      23383def
  2. 21 Nov, 2014 10 commits
  3. 20 Nov, 2014 12 commits
  4. 19 Nov, 2014 11 commits
  5. 18 Nov, 2014 2 commits