1. 18 9月, 2006 4 次提交
    • S
      ieee1394: sbp2: safer last_orb and next_ORB handling · cc078189
      Stefan Richter 提交于
      The sbp2 initiator has two ways to tell a target's fetch agent about new
      command ORBs:
       - Write the ORB's address to the ORB_POINTER register.  This must not
         be done while the fetch agent is active.
       - Put the ORB's address into the previously submitted ORB's next_ORB
         field and write to the DOORBELL register.  This may be done while the
         fetch agent is active or suspended.  It must not be done while the
         fetch agent is in reset state.
      Sbp2 has a last_orb pointer which indicates in what way a new command
      should be announced.  That pointer is concurrently accessed at various
      occasions.  Furthermore, initiator and target are accessing the next_ORB
      field of ORBs concurrently and asynchronously.
      
      This patch does:
       - Protect all initiator accesses to last_orb by sbp2_command_orb_lock.
       - Add pci_dma_sync_single_for_device before a previously submitted
         ORB's next_ORB field is overwritten.
       - Insert a memory barrier between when next_ORB_lo and next_ORB_hi are
         overwritten.  Next_ORB_hi must not be updated before next_ORB_lo.
       - Remove the rather unspecific and now superfluous qualifier "volatile"
         from the next_ORB fields.
       - Add comments on how last_orb is connected with what is known about
         the target's fetch agent's state.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      cc078189
    • S
      ieee1394: remove #include <asm/semaphore.h> · 9154df53
      Stefan Richter 提交于
      These includes in ieee1394_core and eth1394 are obsolete.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      9154df53
    • S
      ieee1394: shrink tlabel pools, remove tpool semaphores · 9951903e
      Stefan Richter 提交于
      This patch reduces the size of struct hpsb_host and also removes
      semaphores from ieee1394_transactions.c.  On i386, struct hpsb_host
      shrinks from 10656 bytes to 6688 bytes.  This is accomplished by
       - using a single wait_queue for hpsb_get_tlabel instead of many
         instances of semaphores,
       - using a single lock to serialize access to all tlabel pools (the
         protected code regions are small, i.e. lock contention very low),
       - omitting the sysfs attribute tlabels_allocations.
      
      Drawback:  In the rare case that a process needs to sleep because all
      transaction labels for the node are temporarily exhausted, it is also
      woken up if a tlabel for a different node became free, checks for an
      available tlabel, and is put to sleep again.  The check is not costly
      and the situation occurs extremely rarely.  (Tlabels are typically
      only exhausted if there was no context switch to the khpsbpkt thread
      which recycles tlables.)  Therefore the benefit of reduced tpool size
      outweighs this drawback.
      
      The sysfs attributes tlabels_free and tlabels_mask are not compiled
      anymore unless CONFIG_IEEE1394_VERBOSEDEBUG is set.
      
      The by far biggest member of struct hpsb_host, the struct csr_control
      csr (5272 bytes on i386), is now placed at the end of struct hpsb_host.
      
      Note, hpsb_get_tlabel calls the macro wait_event_interruptible with a
      condition argument which has a side effect (allocation of a tlabel and
      manipulation of the packet).  This side effect happens only if the
      condition is true.  The patch relies on wait_event_interruptible not
      evaluating the condition again after it became true.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      9951903e
    • S
      ieee1394: merge from Linus · 9b4f2e95
      Stefan Richter 提交于
      Conflicts: drivers/ieee1394/hosts.c
      Patch "lockdep: annotate ieee1394 skb-queue-head locking" was meddling
      with patch "ieee1394: fix kerneldoc of hpsb_alloc_host".
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      9b4f2e95
  2. 17 9月, 2006 34 次提交
  3. 15 9月, 2006 2 次提交