1. 18 Oct, 2011 2 commits
    • Clemens Ladisch's avatar
      firewire: ohci: fix isochronous DMA synchronization · a572e688
      Clemens Ladisch authored
      Add the dma_sync_single_* calls necessary to ensure proper cache
      synchronization for isochronous data buffers on non-coherent
      architectures.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      a572e688
    • Clemens Ladisch's avatar
      firewire: ohci: work around selfID junk due to wrong gap count · 32eaeae1
      Clemens Ladisch authored
      If a device's firmware initiates a bus reset by setting the IBR bit in
      PHY register 1 without resetting the gap count field to 63 (and without
      having sent a PHY configuration packet beforehand), the gap count of
      this node will remain at the old value after the bus reset and thus be
      inconsistent with the gap count on all other nodes.
      
      The bus manager is supposed to detect the inconsistent gap count values
      in the self ID packets and correct them by issuing another bus reset.
      
      However, if the buggy device happens to be the cycle master, and if it
      sends a cycle start packet immediately after the bus reset (which is
      likely after a long bus reset), then the time between the end of the
      selfID phase and the start of the cycle start packet will be based on
      the too-small gap count value, so this gap will be too short to be
      detected as a subaction gap by the other nodes.  This means that the
      cycle start packet will be assumed to be self ID data, and will be
      stored after the actual self ID quadlets in the self ID buffer.
      
      This garbage in the self ID buffer made firewire-core ignore all of the
      self ID data, and thus prevented the Linux bus manager from correcting
      the problem.  Furthermore, because the bus reset handling was aborted
      completely, asynchronous transfers would be no longer handled correctly,
      and fw_run_transaction() would hang until the next bus reset.
      
      To fix this, make the detection of inconsistent self IDs more
      discriminating:  If the invalid data in the self ID buffer looks like
      a cycle start packet, we can assume that the previous data in the buffer
      is correctly received self ID information, and process it normally.
      
      (We inspect only the first quadlet of the cycle start packet, because
      this value is different enough from any valid self ID quadlet, and many
      controllers do not store the cycle start packet in five quadlets because
      they expect self ID data to have an even number of quadlets.)
      
      This bug has been observed when a bus-powered DesktopKonnekt6 is
      switched off with its power button.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      32eaeae1
  2. 09 Oct, 2011 4 commits
  3. 16 Sep, 2011 6 commits
    • Stephan Gatzka's avatar
      firewire: ohci: Add support for TSB41BA3D phy · 25935ebe
      Stephan Gatzka authored
      This patch implements a work around for the Texas Instruments PHY
      TSB41BA3D.  This phy has a bug at least in combination with the TI LLCs
      TSB82AA2B and TSB12LV26.  The selfid coming from the locally connected
      phy is not propagated into the selfid buffer of the OHCI (see
      http://www.ti.com/litv/pdf/sllz059 for details).  The main idea is to
      construct the selfid ourselves.
      Signed-off-by: default avatarStephan Gatzka <stephan@gatzka.org>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      25935ebe
    • Stephan Gatzka's avatar
      firewire: ohci: Move code from the bus reset tasklet into a workqueue · 2d7a36e2
      Stephan Gatzka authored
      Code inside bus_reset_work may now sleep. This is a prerequisite to
      support a phy from Texas Instruments cleanly. The patch to support this
      phy will be submitted later.
      Signed-off-by: default avatarStephan Gatzka <stephan@gatzka.org>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      2d7a36e2
    • Stefan Richter's avatar
      firewire: sbp2: fold two functions into one · 32ce38f4
      Stefan Richter authored
      sbp2_release_target() is folded into its primary user, sbp2_remove().
      The only other caller, a failure path in sbp2_probe(), now uses
      sbp2_remove().  This adds unnecessary cancel_delayed_work_sync() calls
      to that failure path but results in less code and text.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      32ce38f4
    • Stefan Richter's avatar
      firewire: sbp2: move some code to more sensible places · b2af07b6
      Stefan Richter authored
      Implement sbp2_queue_work(), which is now a very simple accessor to one
      of the struct sbp2_logical_unit members, right after the definition of
      struct sbp2_logical_unit.
      
      Put the sbp2_reconnect() implementation right after the sbp2_login()
      implementation.  They are both part of the SBP-2 access protocol.
      
      Implement the driver methods sbp2_probe(), spp2_update(), sbp2_remove()
      in this order, reflecting the lifetime of an SBP-2 target.
      
      Place the sbp2_release_target() implementation right next to
      sbp2_remove() which is its primary user, and after sbp2_probe() which is
      the counterpart to sbp2_release_target().
      
      There are no changes to the implementations here, or at least not meant
      to be.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      b2af07b6
    • Stefan Richter's avatar
      firewire: sbp2: remove obsolete reference counting · 6ff8147d
      Stefan Richter authored
      Since commit 0278ccd9 "firewire: sbp2:
      fix panic after rmmod with slow targets", the lifetime of an sbp2_target
      instance does no longer extent past the return of sbp2_remove().
      Therefore it is no longer necessary to call fw_unit_get/put() and
      fw_device_get/put() in sbp2_probe/remove().
      
      Furthermore, said commit also ensures that lu->work is not going to be
      executed or requeued at a time when the sbp2_target is no longer in use.
      Hence there is no need for sbp2_target reference counting for lu->work.
      
      Other concurrent contexts:
      
        - Processes which access the sysfs of the SCSI host device or of one
          of its subdevices are safe because these interfaces are all removed
          by scsi_remove_device/host() in sbp2_release_target().
      
        - SBP-2 command block ORB transactions are finished when
          scsi_remove_device() in sbp2_release_target() returns.
      
        - SBP-2 management ORB transactions are finished when
          cancel_delayed_work_sync(&lu->work) before sbp2_release_target()
          returns.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      6ff8147d
    • Ming Lei's avatar
      firewire: ohci: add no MSI quirk for O2Micro controller · f39aa30d
      Ming Lei authored
      This fixes https://bugs.launchpad.net/ubuntu/+source/linux/+bug/801719 .
      
      An O2Micro PCI Express FireWire controller,
      "FireWire (IEEE 1394) [0c00]: O2 Micro, Inc. Device [1217:11f7] (rev 05)"
      which is a combination device together with an SDHCI controller and some
      sort of storage controller, misses SBP-2 status writes from an attached
      FireWire HDD.  This problem goes away if MSI is disabled for this
      FireWire controller.
      
      The device reportedly does not require QUIRK_CYCLE_TIMER.
      Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (amended changelog)
      Cc: <stable@kernel.org>
      f39aa30d
  4. 12 Sep, 2011 9 commits
  5. 11 Sep, 2011 19 commits