1. 22 2月, 2008 1 次提交
  2. 20 2月, 2008 3 次提交
    • S
      firewire: fw-sbp2: fix NULL pointer deref. in scsi_remove_device · 33f1c6c3
      Stefan Richter 提交于
      Fix a kernel bug when unplugging an SBP-2 device after having its
      scsi_device already removed via the "delete" sysfs attribute.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      33f1c6c3
    • S
      firewire: fw-sbp2: fix NULL pointer deref. in slave_alloc · 5513c5f6
      Stefan Richter 提交于
      Fix a kernel bug when running rescan-scsi-bus while a FireWire disk is
      connected:  http://bugzilla.kernel.org/show_bug.cgi?id=10008Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      5513c5f6
    • S
      firewire: fw-sbp2: (try to) avoid I/O errors during reconnect · 2e2705bd
      Stefan Richter 提交于
      While fw-sbp2 takes the necessary time to reconnect to a logical unit
      after bus reset, the SCSI core keeps sending new commands.  They are all
      immediately completed with host busy status, and application clients or
      filesystems will break quickly.  The SCSI device might even be taken
      offline:  http://bugzilla.kernel.org/show_bug.cgi?id=9734
      
      The only remedy seems to be to block the SCSI device until reconnect.
      Alas the SCSI core has no useful API to block only one logical unit i.e.
      the scsi_device, therefore we block the entire Scsi_Host.  This
      currently corresponds to an SBP-2 target.  In case of targets with
      multiple logical units, we need to satisfy the dependencies between
      logical units by carefully tracking the blocking state of the target and
      its units.  We block all logical units of a target as soon as one of
      them needs to be blocked, and keep them blocked until all of them are
      ready to be unblocked.
      
      Furthermore, as the history of the old sbp2 driver has shown, the
      scsi_block_requests() API is a minefield with high potential of
      deadlocks.  We therefore take extra measures to keep logical units
      unblocked during __scsi_add_device() and during shutdown.
      
      This avoids I/O errors during reconnect in many but alas not in all
      cases.  There may still be errors after a re-login had to be performed.
      Also, some bridges have been seen to cease fetching management ORBs if
      I/O went on up until a bus reset.  In these cases, all management ORBs
      time out after mgt_orb_timeout.  The old sbp2 driver is less vulnerable
      or maybe not vulnerable to this, for as yet unknown reasons.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      2e2705bd
  3. 16 2月, 2008 12 次提交
    • S
      firewire: fw-sbp2: enforce a retry of __scsi_add_device if bus generation changed · e80de370
      Stefan Richter 提交于
      fw-sbp2 is unable to reconnect while performing __scsi_add_device
      because there is only a single workqueue thread context available for
      both at the moment.  This should be fixed eventually.
      
      An actual failure of __scsi_add_device is easy to handle, but an
      incomplete execution of __scsi_add_device with an sdev returned would
      remain undetected and leave the SBP-2 target unusable.
      
      Therefore we use a workaround:  If there was a bus reset during
      __scsi_add_device (i.e. during the SCSI probe), we remove the new sdev
      immediately, log out, and attempt login and SCSI probe again.
      
      Tested-by: Jarod Wilson <jwilson@redhat.com> (earlier version)
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      e80de370
    • S
      firewire: fw-sbp2: sort includes · 7bb6bf7c
      Stefan Richter 提交于
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      7bb6bf7c
    • S
      firewire: fw-sbp2: logout and login after failed reconnect · ce896d95
      Stefan Richter 提交于
      If fw-sbp2 was too late with requesting the reconnect, the target would
      reject this.  In this case, log out before attempting the reconnect.
      Else several firmwares will deny the re-login because they somehow
      didn't invalidate the old login.
      
      Also, don't retry reconnects in this situation.  The retries won't
      succeed either.
      
      These changes improve chances for successful re-login and shorten the
      period during which the logical unit is inaccessible.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      ce896d95
    • S
      firewire: fw-sbp2: don't add scsi_device twice · 0fa6dfdb
      Stefan Richter 提交于
      When a reconnect failed but re-login succeeded, __scsi_add_device was
      called again.
      
      In those cases, __scsi_add_device succeeded and returned the pointer to
      the existing scsi_device.  fw-sbp2 then continued orderly, except that
      it missed to call sbp2_cancel_orbs.  SCSI core would call fw-sbp2's
      eh_abort_handler eventually if there had been an outstanding command.
      
      This patch avoids the needless lookups and temporary allocations in SCSI
      core and I/O stall and timeout until eh_abort_handler hits.
      
      Also, __scsi_add_device tolerating calls for devices which already exist
      is undocumented behavior on which we shouldn't rely.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      0fa6dfdb
    • S
      firewire: fw-sbp2: log bus_id at management request failures · 48f18c76
      Stefan Richter 提交于
      for easier readable logs if more than one SBP-2 device is present.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      48f18c76
    • S
      firewire: fw-sbp2: wait for completion of fetch agent reset · e0e60215
      Stefan Richter 提交于
      Like the old sbp2 driver, wait for the write transaction to the
      AGENT_RESET to complete before proceeding (after login, after reconnect,
      or in SCSI error handling).
      
      There is one occasion where AGENT_RESET is written to from atomic
      context when getting DEAD status for a command ORB.  There we still
      continue without waiting for the transaction to complete because this
      is more difficult to fix...
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      e0e60215
    • S
      firewire: fw-sbp2: add INQUIRY delay workaround · 9220f194
      Stefan Richter 提交于
      Several different SBP-2 bridges accept a login early while the IDE
      device is still powering up.  They are therefore unable to respond to
      SCSI INQUIRY immediately, and the SCSI core has to retry the INQUIRY.
      One of these retries is typically successful, and all is well.
      
      But in case of Momobay FX-3A, the INQUIRY retries tend to fail entirely.
      This can usually be avoided by waiting a little while after login before
      letting the SCSI core send the INQUIRY.  The old sbp2 driver handles
      this more gracefully for as yet unknown reasons (perhaps because it
      waits for fetch agent resets to complete, unlike fw-sbp2 which quickly
      proceeds after requesting the agent reset).  Therefore the workaround is
      not as much necessary for sbp2.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      9220f194
    • S
      firewire: log GUID of new devices · fa6e697b
      Stefan Richter 提交于
      This should help to interpret user reports.  E.g. one can look up the
      vendor OUI (first three bytes of the GUID) and thus tell what is what.
      
      Also simplifies the math in the GUID sysfs attribute.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      fa6e697b
    • S
      firewire: fw-sbp2: don't retry login or reconnect after unplug · be6f48b0
      Stefan Richter 提交于
      If a device is being unplugged while fw-sbp2 had a login or reconnect on
      schedule, it would take about half a minute to shut the fw_unit down:
      
          Jan 27 18:34:54 stein firewire_sbp2: logged in to fw2.0 LUN 0000 (0 retries)
          <unplug>
          Jan 27 18:34:59 stein firewire_sbp2: sbp2_scsi_abort
          Jan 27 18:34:59 stein scsi 25:0:0:0: Device offlined - not ready after error recovery
          Jan 27 18:35:01 stein firewire_sbp2: orb reply timed out, rcode=0x11
          Jan 27 18:35:06 stein firewire_sbp2: orb reply timed out, rcode=0x11
          Jan 27 18:35:12 stein firewire_sbp2: orb reply timed out, rcode=0x11
          Jan 27 18:35:17 stein firewire_sbp2: orb reply timed out, rcode=0x11
          Jan 27 18:35:22 stein firewire_sbp2: orb reply timed out, rcode=0x11
          Jan 27 18:35:27 stein firewire_sbp2: orb reply timed out, rcode=0x11
          Jan 27 18:35:32 stein firewire_sbp2: orb reply timed out, rcode=0x11
          Jan 27 18:35:32 stein firewire_sbp2: failed to login to fw2.0 LUN 0000
          Jan 27 18:35:32 stein firewire_sbp2: released fw2.0
      
      After this patch, typically only a few seconds spent in __scsi_add_device
      remain:
      
          Jan 27 19:05:50 stein firewire_sbp2: logged in to fw2.0 LUN 0000 (0 retries)
          <unplug>
          Jan 27 19:05:56 stein firewire_sbp2: sbp2_scsi_abort
          Jan 27 19:05:56 stein scsi 33:0:0:0: Device offlined - not ready after error recovery
          Jan 27 19:05:56 stein firewire_sbp2: released fw2.0
      
      The benefit of this is less noise in the syslog.  It furthermore avoids
      a few wasted CPU cycles and needlessly prolonged lifetime of a few
      driver objects.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      be6f48b0
    • S
      firewire: fix "kobject_add failed for fw* with -EEXIST" · 96b19062
      Stefan Richter 提交于
      There is a race between shutdown and creation of devices:  fw-core may
      attempt to add a device with the same name of an already existing
      device.  http://bugzilla.kernel.org/show_bug.cgi?id=9828
      
      Impact of the bug:  Happens rarely (when shutdown of a device coincides
      with creation of another), forces the user to unplug and replug the new
      device to get it working.
      
      The fix is obvious:  Free the minor number *after* instead of *before*
      device_unregister().  This requires to take an additional reference of
      the fw_device as long as the IDR tree points to it.
      
      And while we are at it, we fix an additional race condition:
      fw_device_op_open() took its reference of the fw_device a little bit too
      late, hence was in danger to access an already invalid fw_device.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      96b19062
    • S
      firewire: fw-sbp2: fix logout before login retry · 1b9c12ba
      Stefan Richter 提交于
      This fixes a "can't recognize device" kind of bug.
      
      If the SCSI INQUIRY failed and hence __scsi_add_device failed due to a
      bus reset, we tried a logout and then waited for the already scheduled
      login work to happen.  So far so good, but the generation used for the
      logout was outdated, hence the logout never reached the target.  The
      target might therefore deny the subsequent relogin attempt, which would
      also leave the target inaccessible.
      
      Therefore fetch a fresh device->generation for the logout.  Use memory
      barriers to prevent our plan being foiled by compiler or hardware
      optimizations.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      1b9c12ba
    • S
      firewire: fw-sbp2: unsigned int vs. unsigned · 05cca738
      Stefan Richter 提交于
      Standardize on "unsigned int" style.
      Sort some struct members thematically.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      05cca738
  4. 31 1月, 2008 17 次提交
    • J
      firewire: fw-sbp2: Use sbp2 device-provided mgt orb timeout for logins · 384170da
      Jarod Wilson 提交于
      To be more compliant with section 7.4.8 of the SBP-2 specification,
      use the mgt_ORB_timeout specified in the SBP-2 device's config rom
      for login ORB attempts (though with some sanity checks). A happy
      side-effect is that certain device and controller combinations that
      sometimes take more than 20 seconds to get synced up (like my laptop
      with just about any SBP-2 device) now function more reliably.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (silenced sparse)
      384170da
    • J
      firewire: fw-sbp2: increase login orb reply timeout, fix "failed to login" · a4c379c1
      Jarod Wilson 提交于
      Increase (and rename) the login orb reply timeout value to 20s
      to match that of the old firewire stack. 2s simply didn't give
      many devices enough time to spin up and reply.
      
      Fixes inability to recognize some devices.
      Failure mode was "orb reply timed out"/"failed to login".
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (style, comments, changelog)
      a4c379c1
    • J
      firewire: replace subtraction with bitwise and · 8f9f963e
      Jarod Wilson 提交于
      Replace an unnecessary subtraction with a bitwise AND when determining the
      value of ext_tcode in fw_fill_transaction() to save a cpu cycle or two in a
      somewhat critical path.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      8f9f963e
    • S
      firewire: fw-core: react on bus resets while the config ROM is being fetched · f8d2dc39
      Stefan Richter 提交于
      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.
      
      Note, the memory barrier in read_rom() is still necessary according to
      tests by Jarod Wilson, despite of the ->generation access being moved up
      in the call chain.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      
      This is essentially what I've been beating on locally, and I've yet to hit
      another config rom read failure with it.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      f8d2dc39
    • S
      firewire: enforce access order between generation and node ID, fix "giving up on config rom" · b5d2a5e0
      Stefan Richter 提交于
      fw_device.node_id and fw_device.generation are accessed without mutexes.
      We have to ensure that all readers will get to see node_id updates
      before generation updates.
      
      Fixes an inability to recognize devices after "giving up on config rom",
      https://bugzilla.redhat.com/show_bug.cgi?id=429950Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      
      Reviewed by Nick Piggin <nickpiggin@yahoo.com.au>.
      
      Verified to fix 'giving up on config rom' issues on multiple system and
      drive combinations that were previously affected.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      Signed-off-by: NKristian Høgsberg <krh@redhat.com>
      b5d2a5e0
    • S
      firewire: fw-cdev: use device generation, not card generation · cf5a56ac
      Stefan Richter 提交于
      We have to use the fw_device.generation here, not the fw_card.generation,
      because the generation must never be newer than the node ID when we emit
      a transaction.  This cannot be guaranteed with fw_card.generation.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      
      Verified in concert with subsequent memory barriers patch to fix 'giving
      up on config rom' issues on multiple system and drive combinations that
      were previously affected.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      cf5a56ac
    • S
      firewire: fw-sbp2: use device generation, not card generation · 5a8a1bcd
      Stefan Richter 提交于
      There was a small window where a login or reconnect job could use an
      already updated card generation with an outdated node ID.  We have to
      use the fw_device.generation here, not the fw_card.generation, because
      the generation must never be newer than the node ID when we emit a
      transaction.  This cannot be guaranteed with fw_card.generation.
      
      Furthermore, the target's and initiator's node IDs can be obtained from
      fw_device and fw_card.  Dereferencing their underlying topology objects
      is not necessary.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      
      Verified in concert with subsequent memory barriers patch to fix 'giving
      up on config rom' issues on multiple system and drive combinations that
      were previously affected.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      5a8a1bcd
    • S
      firewire: fw-sbp2: try to increase reconnect_hold (speed up reconnection) · 14dc992a
      Stefan Richter 提交于
      Ask the target to grant 4 seconds instead of the standard and minimum of
      1 second window after bus reset for reconnection.  This accelerates
      reconnection if there are more than one targets on the bus:  If a login
      and inquiry to one target blocks the fw-sbp2 workqueue for more than 1s
      after bus reset, we now still can reconnect to the other target.
      
      Before that, fw-sbp2's reconnect attempts would be rejected with "error
      status: 0:9" (function rejected), and fw-sbp2 would finally re-login.
      All those futile reconnect attemps cost extra time until the target
      which needs re-login is ready for I/O again.
      
      The reconnect timeout field in the login ORB doesn't have to be honored
      by the target though.  I found that we could get up to
        - allegedly 32768s from an old OXFW911 firmware
        - 256s from LSI bridges
        - 4s from OXUF922 and OXFW912 bridges,
        - 2s from TI bridges,
        - only the standard 1s from Initio and Prolific bridges and from
          Apple OpenFirmware in target mode.
      
      We just try to get 4 seconds which already covers the case of a few
      HDDs on the same bus quite nicely.
      
      A minor drawback occurs in the following (rare and impractical) border
      case:
        - two initiators are there, initiator 1 holds an exclusive login to
          a target,
        - initiator 1 goes off the bus,
        - target refuses login attempts from initiator 2 until reconnect_hold
          seconds after bus reset.
      
      An alternative approach to the issue at hand would be to parallelize
      fw-sbp2's reconnect and login work.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: NJarod Wilson <jwilson@redhat.com>
      14dc992a
    • S
      firewire: fw-sbp2: skip unnecessary logout · 4dccd020
      Stefan Richter 提交于
      Don't attempt to send a logout ORB if the target was already unplugged
      or had its link switched off.  If two targets are attached, this
      enhances the chance to quickly reconnect to the remaining target when
      one target is plugged out.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: NJarod Wilson <jwilson@redhat.com>
      4dccd020
    • D
      firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors · fe5ca634
      David Moore 提交于
      Previously, the fw-ohci driver used fixed-length buffers for storing
      descriptors for isochronous receive DMA programs.  If an application
      (such as libdc1394) generated a DMA program that was too large, fw-ohci
      would reach the limit of its fixed-sized buffer and return an error to
      userspace.
      
      This patch replaces the fixed-length ring-buffer with a linked-list of
      page-sized buffers.  Additional buffers can be dynamically allocated and
      appended to the list when necessary.  For a particular context, buffers
      are kept around after use and reused as necessary, so there is no
      allocation taking place after the DMA program is generated for the first
      time.
      
      In addition, the buffers it uses are coherent for DMA so there is no
      syncing required before and after writes.  This syncing wasn't properly
      done in the previous version of the code.
      
      -
      
      This is the fourth version of my patch that replaces a fixed-length
      buffer for DMA descriptors with a dynamically allocated linked-list of
      buffers.
      
      As we discovered with the last attempt, new context programs are
      sometimes queued from interrupt context, making it unacceptable to call
      tasklet_disable() from context_get_descriptors().
      
      This version of the patch uses ohci->lock for all locking needs instead
      of tasklet_disable/enable.  There is a new requirement that
      context_get_descriptors() be called while holding ohci->lock.  It was
      already held for the AT context, so adding the requirement for the iso
      context did not seem particularly onerous.  In addition, this has the
      side benefit of allowing iso queue to be safely called from concurrent
      user-space threads, which previously was not safe.
      Signed-off-by: NDavid Moore <dcm@acm.org>
      Signed-off-by: NKristian Høgsberg <krh@redhat.com>
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      
      -
      
      Fixes the following issues:
        - Isochronous reception stopped prematurely if an application used a
          larger buffer.  (Reproduced with coriander.)
        - Isochronous reception stopped after one or a few frames on VT630x
          in OHCI 1.0 mode.  (Fixes reception in coriander, but dvgrab still
          doesn't work with these chips.)
      
      Patch update: struct member alignment, whitespace nits
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      fe5ca634
    • S
      firewire: fw-ohci: CycleTooLong interrupt management · bb9f2206
      Stefan Richter 提交于
      The firewire-ohci driver so far lacked the ability to resume cycle
      master duty after that condition happened, as added to ohci1394 in Linux
      2.6.18 by commit 57fdb58f.  This ports
      this patch to fw-ohci.
      
      The "cycle too long" condition has been seen in practice
        - with IIDC cameras if a mode with packets too large for a speed is
          chosen,
        - sporadically when capturing DV on a VIA VT6306 card with ohci1394/
          ieee1394/ raw1394/ dvgrab 2.
          https://bugzilla.redhat.com/show_bug.cgi?id=415841#c7
      (This does not fix Fedora bug 415841.)
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      bb9f2206
    • R
      firewire: Fix extraction of source node id · 478b233e
      Rabin Vincent 提交于
      Fix extraction of the source node id from the packet header.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      478b233e
    • D
      firewire: fw-ohci: Bug fixes for packet-per-buffer support · bcee893c
      David Moore 提交于
      This patch corrects a number of bugs in the current OHCI 1.0
      packet-per-buffer support:
      
      1. Correctly deal with payloads that cross a page boundary.  The
      previous version would not split the descriptor at such a boundary,
      potentially corrupting unrelated memory.
      
      2. Allow user-space to specify multiple packets per struct
      fw_cdev_iso_packet in the same way that dual-buffer allows.  This is
      signaled by header_length being a multiple of header_size.  This
      multiple determines the number of packets.  The payload size allocated
      per packet is determined by dividing the total payload size by the
      number of packets.
      
      3. Make sync support work properly for packet-per-buffer.
      
      I have tested this patch with libdc1394 by forcing my OHCI 1.1
      controller to use the packet-per-buffer support instead of dual-buffer.
      
      I would greatly appreciate testing by those who have a DV devices and
      other types of iso streamers to make sure I didn't cause any
      regressions.
      
      Stefan, with this patch, I'm hoping that libdc1394 will work with all
      your OHCI 1.0 controllers now.
      
      The one bit of future work that remains for packet-per-buffer support is
      the automatic compaction of short payloads that I discussed with
      Kristian.
      Signed-off-by: NDavid Moore <dcm@acm.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      bcee893c
    • D
      firewire: fw-ohci: Fix for dualbuffer three-or-more buffers · 0642b657
      David Moore 提交于
      This patch fixes the problem where different OHCI 1.1 controllers behave
      differently when a received iso packet straddles three or more buffers
      when using the dual-buffer receive mode.  Two changes are made in order
      to handle this situation:
      
      1. The packet sync DMA descriptor is given a non-zero header length and
      non-zero payload length.  This is because zero-payload descriptors are
      not discussed in the OHCI 1.1 specs and their behavior is thus
      undefined.  Instead we use a header size just large enough for a single
      header and a payload length of 4 bytes for this first descriptor.
      
      2. As we process received packets in the context's tasklet, read the
      packet length out of the headers.  Keep track of the running total of
      the packet length as "excess_bytes", so we can ignore any descriptors
      where no packet starts or ends.  These descriptors may not have had
      their first_res_count or second_res_count fields updated by the
      controller so we cannot rely on those values.
      
      The main drawback of this patch is that the excess_bytes value might get
      "out of sync" with the packet descriptors if something strange happens
      to the DMA program.  I'm not if such a thing could ever happen, but I
      appreciate any suggestions in making it more robust.
      
      Also, the packet-per-buffer support may need a similar fix to deal with
      issue 1, but I haven't done any work on that yet.
      
      Stefan, I'm hoping that with this patch, all your OHCI 1.1 controllers
      will work properly with an unmodified version of libdc1394.
      Signed-off-by: NDavid Moore <dcm@acm.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      0642b657
    • S
      firewire: fw-sbp2: remove unused misleading macro · 4b11ea96
      Stefan Richter 提交于
      SBP2_MAX_SECTORS is nowhere used in fw-sbp2.
      It merely got copied over from sbp2 where it played a role in the past.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      4b11ea96
    • S
      b7811da2
    • S
      firewire: fw-sbp2: refactor workq and kref handling · 285838eb
      Stefan Richter 提交于
      This somewhat reduces the size of firewire-sbp2.ko.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      285838eb
  5. 12 1月, 2008 1 次提交
  6. 11 12月, 2007 1 次提交
    • J
      firewire: OHCI 1.0 Isochronous Receive support · a186b4a6
      Jarod Wilson 提交于
      Third rendition of FireWire OHCI 1.0 Isochronous Receive support, using a
      zer-copy method similar to OHCI 1.1 which puts the IR data payload directly
      into the userspace buffer. The zero-copy implementation eliminates the
      video artifacts, audio popping, and buffer underrun problems seen with
      version 1 of this patch, as well as fixing a regression in OHCI 1.1 support
      introduced by version 2 of this patch.
      
      Successfully tested in OHCI 1.1 mode on the following chipsets:
      
      - NEC uPD72847 (rev 01), OHCI 1.1 (PCI)
      - Ti XIO2200(A) (rev 01), OHCI 1.1 (PCIe)
      - Ti TSB41AB2 (rev 01), OHCI 1.1 (PCI on SB Audigy)
      - Apple UniNorth 2 (rev 81), OHCI 1.1 (PowerBook G4 onboard)
      
      Successfully tested in OHCI 1.0 mode on the following chipsets:
      
      - Agere FW323 (rev 06), OHCI 1.0 (Mac Mini onboard)
      - Agere FW323 (rev 06), OHCI 1.0 (PCI)
      - Via VT6306 (rev 46), OHCI 1.0 (PCI)
      - NEC OrangeLink (rev 01), OHCI 1.0 (PCI)
      - NEC uPD72847 (rev 01), OHCI 1.1 (PCI)
      - Ti XIO2200(A) (rev 01), OHCI 1.1 (PCIe)
      
      The bulk of testing was done in an x86_64 system, but was also successfully
      sanity-tested on other systems, including a PPC(32) PowerBook G4 and an i686
      EPIA M10k. Crude benchmarking (watching top during capture) puts the cpu
      utilization during capture on the EPIA's 1GHz Via C3 processor around 13%,
      which is down from 30% with the v1 code.
      
      Some implementation details:
      
      To maintain the same userspace API as dual-buffer mode, we set up two
      descriptors for every incoming packet. The first is an INPUT_MORE descriptor,
      pointing to a buffer large enough to hold just the packet's iso headers,
      immediately followed by an INPUT_LAST descriptor, pointing to a chunk of the
      userspace buffer big enough for the packet's data payload. With this setup,
      each incoming packet fills in these two descriptors in a manner that very
      closely emulates dual-buffer receive, to the point where the bulk of the
      handle_ir_* code is now identical between the two (and probably primed for
      some restructuring to share code between them).
      
      The only caveat I have at the moment is that neither of my OHCI 1.0 Via
      VT6307-based FireWire controllers work particularly well with this code
      for reasons I have yet to figure out.
      Signed-off-by: NJarod Wilson <jwilson@redhat.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a186b4a6
  7. 07 11月, 2007 1 次提交
    • S
      firewire: fw-sbp2: fix refcounting · 7c45d191
      Stefan Richter 提交于
      Since patch "fw-sbp2: use an own workqueue (fix system responsiveness)"
      increased parallelism between fw-sbp2 and fw-core, it was possible that
      fw-sbp2 didn't release the SCSI device when the FireWire device was
      disconnected.
      
      This happened if sbp2_update() ran during sbp2_login(), because a bus
      reset occurred during sbp2_login().  The sbp2_login() work would [try
      to] reschedule itself because it failed due to the bus reset, and it
      would _not_ drop its reference on the target.  However, sbp2_update()
      would schedule sbp2_login() too before sbp2_login() rescheduled itself
      and hence sbp2_update() would take an additional reference.  And then
      we would have one reference too many.
      
      The fix is to _always_ drop the reference when leaving the sbp2_login()
      work.  If the sbp2_login() work reschedules itself, it takes a
      reference, but only if it wasn't already rescheduled by sbp2_update().
      
      Ditto in the sbp2_reconnect() work.
      
      The resulting code is actually simpler than before:  We _always_ take
      a reference when successfully scheduling work.  And we _always_ drop
      a reference when leaving a workqueue job.  No exceptions.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      7c45d191
  8. 01 11月, 2007 1 次提交
  9. 23 10月, 2007 2 次提交
  10. 20 10月, 2007 1 次提交