1. 22 Feb, 2012 3 commits
    • Stefan Richter's avatar
      firewire: net: use dev_printk API · 8408dc1c
      Stefan Richter authored
      Change the log line prefix from "firewire_net: " to "net firewire0: "
      etc. for the case that several RFC 2734 interfaces are being used in the
      same machine.
      
      Note, the netdev_printk API is not very useful to firewire-net.
      netdev_notice(net, "abc\n") would result in irritating messages like
      "firewire_ohci 0000:0a:00.0: firewire0: abc".  Nor would a dev_printk on
      the fw_unit.device to which firewire-net is being bound be useful,
      because there are generally multiple ones of those per interface (from
      all RFC 2734 peers on the bus, the local node being only one of them).
      
      In the initialization message of each interface, log the PCI device
      name of the card which is parent of the netdevice instead of the GUID
      of the peer which was semi-randomly used to establish the netdevice.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      8408dc1c
    • Stefan Richter's avatar
      firewire: net: identify to driver core as "firewire_net", not "net" · 59759ff6
      Stefan Richter authored
      On second thought, there is little reason to have driver name differ
      from module name.  Therefore, change
          /sys/bus/firewire/drivers/net
          /sys/bus/firewire/devices/fw0.0/driver -> [...]/net
          /sys/module/firewire_net/drivers/firewire:net
      to
          /sys/bus/firewire/drivers/firewire_net
          /sys/bus/firewire/devices/fw0.0/driver -> [...]/firewire_net
          /sys/module/firewire_net/drivers/firewire:firewire_net
      It is redundant but consistent with firewire-sbp2's recently changed
      driver name.
      
      I don't see this anywhere used, so it should not matter either way.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      59759ff6
    • Stefan Richter's avatar
      firewire: sbp2: identify to driver core as "firewire_sbp2", not "sbp2" · 0c22ecde
      Stefan Richter authored
      Commit eba9ebaa "firewire: sbp2: use dev_printk API" changed
      messages from e.g.
          firewire_sbp2: fw3.0: logged in to LUN 0000 (0 retries)
      to
          sbp2 fw3.0: logged in to LUN 0000 (0 retries)
      because the driver calls itself as "sbp2" when registering with driver
      core and with SCSI core.  This is of course confusing, so switch to the
      name "firewire_sbp2" for driver core in order to match what lsmod and
      /sys/module/ show.  So we are back to
          firewire_sbp2 fw3.0: logged in to LUN 0000 (0 retries)
      in the kernel log.
      
      This also changes
          /sys/bus/firewire/drivers/sbp2
          /sys/bus/firewire/devices/fw3.0/driver -> [...]/sbp2
          /sys/module/firewire_sbp2/drivers/firewire:sbp2
      to
          /sys/bus/firewire/drivers/firewire_sbp2
          /sys/bus/firewire/devices/fw3.0/driver -> [...]/firewire_sbp2
          /sys/module/firewire_sbp2/drivers/firewire:firewire_sbp2
      
      but "cat /sys/class/scsi_host/host27/proc_name" stays "sbp2" just in
      case that proc_name is used by any userland.
      
      The transport detection in lsscsi is not affected.  (Tested with lsscsi
      version 0.25.)  Udev's /dev/disk/by-id and by-path symlinks are not
      affected either.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      0c22ecde
  2. 15 Jan, 2012 3 commits
  3. 25 Dec, 2011 1 commit
  4. 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
  5. 09 Oct, 2011 4 commits
  6. 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
  7. 12 Sep, 2011 9 commits
  8. 11 Sep, 2011 12 commits