1. 25 3月, 2009 7 次提交
    • S
      firewire: cdev: address handler input validation · 3e0b5f0d
      Stefan Richter 提交于
      Like before my commit 1415d918,
      fw_core_add_address_handler() does not align the address region now.
      Instead the caller is required to pass valid parameters.
      
      Since one of the callers of fw_core_add_address_handler() is the cdev
      userspace interface, we now check for valid input.  If the client is
      buggy, we give it a hint with -EINVAL.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      3e0b5f0d
    • J
      firewire: cdev: use an idr rather than a linked list for resources · 45ee3199
      Jay Fenlason 提交于
      The current code uses a linked list and a counter for storing
      resources and the corresponding handle numbers.  By changing to an idr
      we can be safe from counter wrap-around giving two resources the same
      handle.
      
      Furthermore, the deallocation ioctls now check whether the resource to
      be freed is of the intended type.
      Signed-off-by: NJay Fenlason <fenlason@redhat.com>
      
      Some rework by Stefan R:
        - The idr API documentation says we get an ID within 0...0x7fffffff.
          Hence we can rest assured that idr handles fit into cdev handles.
        - Fix some races.  Add a client->in_shutdown flag for this purpose.
        - Add allocation retry to add_client_resource().
        - It is possible to use idr_for_each() in fw_device_op_release().
        - Fix ioctl_send_response() regression.
        - Small style changes.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      45ee3199
    • S
      firewire: cdev: fix race of fw_device_op_release with bus reset · 97811e34
      Stefan Richter 提交于
      Unlink the client from the fw_device earlier in order to prevent bus
      reset events being added to client->event_list during shutdown.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      97811e34
    • S
      firewire: cdev: tcodes input validation · 1f3125af
      Stefan Richter 提交于
      The behaviour of fw-transaction.c::fw_send_request is ill-defined for
      any other tcodes than read/ write/ lock request tcodes.  Therefore
      prevent requests with wrong tcodes from entering the transaction layer.
      
      Maybe fw_send_request should check them itself, but I am not inclined to
      change it and fw_fill_request from void-valued functions to ones which
      return error codes and pass those up.  Besides, maybe fw_send_request is
      going to support one more tcode than ioctl_send_request in the future
      (TCODE_STREAM_DATA).
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      1f3125af
    • S
      firewire: convert client_list_lock to mutex · d67cfb96
      Stefan Richter 提交于
      So far it is only taken in non-atomic contexts.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      d67cfb96
    • J
      firewire: add a client_list_lock · cf417e54
      Jay Fenlason 提交于
      This adds a client_list_lock, which only protects the device's
      client_list, so that future versions of the driver can call code that
      takes the card->lock while holding the client_list_lock.  Adding this
      lock is much simpler than adding __ versions of all the functions that
      the future version may need.  The one ordering issue is to make sure
      code never takes the client_list_lock with card->lock held.  Since
      client_list_lock is only used in three places, that isn't hard.
      Signed-off-by: NJay Fenlason <fenlason@redhat.com>
      
      Update fill_bus_reset_event() accordingly.  Include linux/spinlock.h.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      cf417e54
    • D
      firewire: Include iso timestamp in headers when header_size > 4 · 1aa292bb
      David Moore 提交于
      Previously, when an iso context had header_size > 4, the iso header
      (len/tag/channel/tcode/sy) was passed to userspace followed by quadlets
      stripped from the payload.  This patch changes the behavior:
      header_size = 8 now passes the header quadlet followed by the timestamp
      quadlet.  When header_size > 8, quadlets are stripped from the payload.
      The header_size = 4 case remains identical.
      
      Since this alters the semantics of the API, the firewire API version
      needs to be bumped concurrently with this change.
      
      This change also refactors the header copying code slightly to be much
      easier to read.
      Signed-off-by: NDavid Moore <dcm@acm.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      1aa292bb
  2. 01 2月, 2009 1 次提交
  3. 30 1月, 2009 1 次提交
  4. 29 1月, 2009 3 次提交
  5. 25 1月, 2009 1 次提交
    • S
      firewire: core: optimize card shutdown · e747a5c0
      Stefan Richter 提交于
      This fixes a regression by "firewire: keep highlevel drivers attached
      during brief connection loss":  There were 2 seconds unnecessary waiting
      added to the shutdown procedure of each controller.
      
      We use card->link as status flag to signal the device handler that there
      is no use to wait for a come-back.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      e747a5c0
  6. 24 1月, 2009 2 次提交
  7. 21 1月, 2009 3 次提交
    • S
      firewire: keep highlevel drivers attached during brief connection loss · 3d36a0df
      Stefan Richter 提交于
      There are situations when nodes vanish from the bus and come back
      quickly thereafter:
        - When certain bus-powered hubs are plugged in,
        - when certain devices are plugged into 6-port hubs,
        - when certain disk enclosures are switched from self-power to bus
          power or vice versa and break the daisy chain during the transition,
        - when the user plugs a cable out and quickly plugs it back in, e.g.
          to reorder a daisy chain (works on Mac OS X if done quickly enough),
        - when certain hubs temporarily malfunction during high bus traffic.
      
      Until now, firewire-core reported affected nodes as lost to the
      highlevel drivers (firewire-sbp2 and userspace drivers).  We now delay
      the destruction of device representations until after at least two
      seconds after the last bus reset.  If a "new" device is detected in this
      period whose bus information block and root directory header match that
      of a device which is pending for deletion, we resurrect that device and
      send update calls to highlevel drivers.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      3d36a0df
    • S
      firewire: unnecessary BM delay after generation rollover · 8cd0bbbd
      Stefan Richter 提交于
      Noticed by Jarod Wilson:  The bus manager work was unnecessarily delayed
      each time the bus generation counter rolled over.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      8cd0bbbd
    • S
      firewire: insist on successive self ID complete events · a5c7f471
      Stefan Richter 提交于
      The whole topology code only works if the old and new topologies which
      are compared come from immediately successive self ID complete events.
      
      If there happened bus resets without self ID complete events in the
      meantime, or self ID complete events with invalid selfIDs, the topology
      comparison could identify nodes wrongly, or more likely just corrupt
      kernel memory or panic right away.
      
      We now discard all nodes of the old topology and treat all current nodes
      as new ones if the current self ID generation is not the previous one
      plus 1.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      a5c7f471
  8. 10 1月, 2009 1 次提交
  9. 05 1月, 2009 6 次提交
  10. 10 12月, 2008 1 次提交
  11. 26 11月, 2008 1 次提交
  12. 31 10月, 2008 1 次提交
  13. 26 10月, 2008 6 次提交
  14. 16 10月, 2008 5 次提交
  15. 20 8月, 2008 1 次提交