1. 28 7月, 2013 1 次提交
  2. 01 5月, 2013 4 次提交
    • P
      firewire: ohci: dump_stack() for PHY regs read/write failures · 6fe9efb9
      Peter Hurley 提交于
      A stack trace is an invaluable tool in determining the basis
      and cause of PHY regs read/write failures.
      
      Include PHY reg addr (and value for writes) in the diagnostic.
      
      [Stefan R:  changed whitespace]
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      6fe9efb9
    • P
      firewire: ohci: Improve bus reset error messages · 67672134
      Peter Hurley 提交于
      Many of the error messages possible from bus_reset_work() do not
      contain enough information to distinguish which error condition
      occurred nor enough information to evaluate the error afterwards.
      
      Differentiate all error conditions in bus_reset_work(); add
      additional information to make error diagnosis possible.
      
      [Stefan R:  fixed self-ID endian conversion]
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      67672134
    • P
      firewire: ohci: Alias dev_* log functions · de97cb64
      Peter Hurley 提交于
      Convert dev_xxxx(ohci->card.device, ...) log functions to
      ohci_xxxx(ohci, ...).
      
      [Stefan R:  Peter argues that this increases readability of the code.]
      [Stefan R:  changed whitespace]
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      de97cb64
    • P
      firewire: ohci: Fix 'failed to read phy reg' on FW643 rev8 · bd972688
      Peter Hurley 提交于
      With the LSI FW643 rev 8 [1], the first commanded bus reset at
      the conclusion of ohci_enable() has been observed to fail with
      the following messages:
      
      [    4.884015] firewire_ohci 0000:01:00.0: failed to read phy reg
      ....
      [    5.684012] firewire_ohci 0000:01:00.0: failed to read phy reg
      
      With drivers/firewire/ohci.c instrumented, the error condition [2]
      indicates the PHY arbitration state machine has timed out prior to
      enabling PHY LCtrl.
      
      Furthermore, instrumenting ohci_enable() shows that LPS has been
      enabled within 1 ms.
      
      Test LPS latching every 1 ms rather than every 50ms.
      
      [1]  lspci -v
      
      01:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 08) (prog-if 10 [OHCI])
      	Subsystem: LSI Corporation FW643 [TrueFire] PCIe 1394b Controller
      	Flags: bus master, fast devsel, latency 0, IRQ 92
      	Memory at fbeff000 (64-bit, non-prefetchable) [size=4K]
      	Capabilities: [44] Power Management version 3
      	Capabilities: [4c] MSI: Enable+ Count=1/1 Maskable- 64bit+
      	Capabilities: [60] Express Endpoint, MSI 00
      	Capabilities: [100] Advanced Error Reporting
      	Capabilities: [140] Virtual Channel
      	Capabilities: [170] Device Serial Number 08-14-43-82-00-00-41-fc
      	Kernel driver in use: firewire_ohci
      	Kernel modules: firewire-ohci
      
      [2] instrumented WARNING in read_phy_reg()
      
      [    4.576010] ------------[ cut here ]------------
      [    4.576035] WARNING: at ./drivers/firewire/ohci.c:570 read_phy_reg+0x93/0xe0 [firewire_ohci]()
      [    4.576050] Hardware name: Precision WorkStation T5400
      [    4.576058] failed to read phy reg:1 (phy(5) @ config enhance:19)
      [    4.576068] Modules linked in: hid_logitech_dj hid_generic(+) usbhid <...snip...>
      [    4.576140] Pid: 61, comm: kworker/2:1 Not tainted 3.8.0-2+fwtest-xeon #2+fwtest
      [    4.576149] Call Trace:
      [    4.576160]  [<ffffffff8105468f>] warn_slowpath_common+0x7f/0xc0
      [    4.576168]  [<ffffffff81054786>] warn_slowpath_fmt+0x46/0x50
      [    4.576178]  [<ffffffffa00caca3>] read_phy_reg+0x93/0xe0 [firewire_ohci]
      [    4.576188]  [<ffffffffa00cae19>] ohci_read_phy_reg+0x39/0x60 [firewire_ohci]
      [    4.576203]  [<ffffffffa00731ff>] fw_send_phy_config+0xbf/0xe0 [firewire_core]
      [    4.576214]  [<ffffffffa006b2d6>] br_work+0x46/0xb0 [firewire_core]
      [    4.576225]  [<ffffffff81071e0c>] process_one_work+0x13c/0x500
      [    4.576238]  [<ffffffffa006b290>] ? fw_card_initialize+0x180/0x180 [firewire_core]
      [    4.576248]  [<ffffffff810737ed>] worker_thread+0x16d/0x470
      [    4.576257]  [<ffffffff81073680>] ? busy_worker_rebind_fn+0x100/0x100
      [    4.576266]  [<ffffffff8107d160>] kthread+0xc0/0xd0
      [    4.576275]  [<ffffffff816a0000>] ? pcpu_dump_alloc_info+0x1cb/0x2c4
      [    4.576284]  [<ffffffff8107d0a0>] ? kthread_create_on_node+0x130/0x130
      [    4.576297]  [<ffffffff816b2f6c>] ret_from_fork+0x7c/0xb0
      [    4.576305]  [<ffffffff8107d0a0>] ? kthread_create_on_node+0x130/0x130
      [    4.576313] ---[ end trace cbc940994b300302 ]---
      
      [Stefan R:  Peter also reports a change of behavior with LSI FW323.
      Before the patch, there would often occur a lock transaction failure
      during firewire-core startup:
      [    6.056022] firewire_core 0000:07:06.0: BM lock failed (timeout), making local node (ffc0) root
      This failure no longer happens after the patch, without an obvious
      reason for the failure or the fix.]
      
      [Stefan R:  Added quirk flag, quirk table entry, and comment.]
      Reported-by: NTim Jordan <tim@insipid.org.uk>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      bd972688
  3. 29 4月, 2013 5 次提交
    • A
      firewire: ohci: fix VIA VT6306 video reception · be8dcab9
      Andy Leiserson 提交于
      Add quirk for VT6306 wake bit behavior.
      
      VT6306 seems to reread the wrong descriptor when the wake bit is
      written. work around by putting a copy of the branch address in the
      first descriptor of the block.
      
      [Stefan R:  This fixes the known broken video reception via gstreamer
      on VIA VT6306.  100% repeatable testcase:
      $ gst-launch-0.10 dv1394src \! dvdemux \! dvdec \! xvimagesink
      with a camcorder or other DV source connected.  Likewise for MPEG2-TS
      reception via gstreamer, e.g. from TV settop boxes.
      Perhaps this also fixes dv4l on VT6306, but this is as yet untested.
      Kino, dvgrab or FFADO had not been affected by this chip quirk.
      Additional comments from Andy:]
      
      I've looked into some problems with the wake bit on a vt6306 family
      chip (1106:3044, rev 46).
      
      I used this firewire card in a mythtv setup (ISO receive MPEG2 stream)
      with Debian 2.6.32 kernels for ~2 years without problems.
      
      Since upgrading to 3.2, I've been having problems with the input stream
      freezing -- input data stops until I restart mythtv (I expect closing
      and reopening the device would be sufficient). This happens
      infrequently, maybe one out of 20 recordings. I eventually determined
      that the problem is more likely to occur if the system is loaded.
      
      I isolated the kernel version as the triggering SW factor and then
      specifically the change from dualbuffer back to packet-per-buffer DMA
      mode.
      
      The possibility that the controller does not properly respond to the
      wake bit was suggested in
      https://bugzilla.redhat.com/show_bug.cgi?id=415841, but not proven.
      
      Based on the fact that dualbuffer mode worked while packet-per-buffer
      has trouble, I guessed that upon seeing the wake bit written, the vt6306
      controller only checks the branch address in the first descriptor of the
      block, even if that is not the correct place to look (because the block
      has multiple descriptors).
      
      This theory seems to be correct. When the ISO reception is hung, I am
      able to resume it by manually writing the branch address to the first
      descriptor in the block, and then writing the wake bit.
      
      I've had luck so far with the attached patch, so I'm including it. It's
      probably not a complete solution -- I haven't tested transmit modes to
      see whether they have a similar issue.
      
      I doubt that the quirk test is any cheaper than just writing the extra
      branch address in all cases, but it does reduce the risk of breaking
      other hardware.
      
      [Stefan R:  omitted QUIRK_NO_MSI from VT6306 quirks table entry,
      changed whitespace]
      Signed-off-by: NAndy Leiserson <andy@leiserson.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      be8dcab9
    • P
      firewire: ohci: Check LPS before register access on pci removal · 8db49149
      Peter Hurley 提交于
      A pci device can be removed while in its suspended state. If the ohci
      host controller is suspended, the PHY is also in low-power mode and
      LPS is disabled. If LPS is disabled, most of the host registers aren't
      accessible, including IntMaskClear. Furthermore, access to these registers
      when LPS is disabled can cause hard lockups on some hardware. Since
      interrupts are already disabled in this mode, further action is
      unnecessary.
      
      Test LPS before attempting to write IntMaskClear to disable interrupts.
      
      [Stefan R: whitespace changes]
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      8db49149
    • P
      firewire: ohci: Fix double free_irq() · 247fd50b
      Peter Hurley 提交于
      A pci device can be removed while in its suspended state.
      Because the ohci driver freed the irq to suspend, free_irq() is
      called twice; once from pci_remove() and again from pci_suspend(),
      which issues the warning below [1].
      
      Rather than allocate the irq in the .enable() path, move the
      allocation to .probe(). Consequently, the irq is not reallocated
      upon pci_resume() and thus is not freed upon pci_suspend().
      
      [1] Warning reported by Mark Einon <mark.einon@gmail.com> when
      suspending an MSI MS-1727 GT740 laptop on Ubuntu 3.5.0-22-generic
      
      WARNING: at ./kernel/irq/manage.c:1198 __free_irq+0xa3/0x1e0()
      Hardware name: MS-1727
      Trying to free already-free IRQ 16
      Modules linked in: ip6table_filter ip6_tables ebtable_nat ebtables <...snip...>
      Pid: 4, comm: kworker/0:0 Tainted: P           O 3.5.0-22-generic #34-Ubuntu
      Call Trace:
       [<ffffffff81051c1f>] warn_slowpath_common+0x7f/0xc0
       [<ffffffff81051d16>] warn_slowpath_fmt+0x46/0x50
       [<ffffffff8103fa39>] ? default_spin_lock_flags+0x9/0x10
       [<ffffffff810df6b3>] __free_irq+0xa3/0x1e0
       [<ffffffff810df844>] free_irq+0x54/0xc0
       [<ffffffffa005a27e>] pci_remove+0x6e/0x210 [firewire_ohci]
       [<ffffffff8135ae7f>] pci_device_remove+0x3f/0x110
       [<ffffffff8141fdbc>] __device_release_driver+0x7c/0xe0
       [<ffffffff8141fe4c>] device_release_driver+0x2c/0x40
       [<ffffffff8141f5f1>] bus_remove_device+0xe1/0x120
       [<ffffffff8141cd1a>] device_del+0x12a/0x1c0
       [<ffffffff8141cdc6>] device_unregister+0x16/0x30
       [<ffffffff81354784>] pci_stop_bus_device+0x94/0xa0
       [<ffffffffa0091c67>] acpiphp_disable_slot+0xb7/0x1a0 [acpiphp]
       [<ffffffffa0090716>] ? get_slot_status+0x46/0xc0 [acpiphp]
       [<ffffffffa0091d7d>] acpiphp_check_bridge.isra.15+0x2d/0xf0 [acpiphp]
       [<ffffffffa0092442>] _handle_hotplug_event_bridge+0x372/0x4d0 [acpiphp]
       [<ffffffff81390f8c>] ? acpi_os_execute_deferred+0x2f/0x34
       [<ffffffff8116e22d>] ? kfree+0xed/0x110
       [<ffffffff8107086a>] process_one_work+0x12a/0x420
       [<ffffffffa00920d0>] ? _handle_hotplug_event_func+0x1d0/0x1d0 [acpiphp]
       [<ffffffff8107141e>] worker_thread+0x12e/0x2f0
       [<ffffffff810712f0>] ? manage_workers.isra.26+0x200/0x200
       [<ffffffff81075f13>] kthread+0x93/0xa0
       [<ffffffff8168d024>] kernel_thread_helper+0x4/0x10
       [<ffffffff81075e80>] ? kthread_freezable_should_stop+0x70/0x70
       [<ffffffff8168d020>] ? gs_change+0x13/0x13
      Reported-by: NMark Einon <mark.einon@gmail.com>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      247fd50b
    • S
      firewire: remove unnecessary alloc/OOM messages · cfb0c9d1
      Stefan Richter 提交于
      These are redundant to log messages from the mm core.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      cfb0c9d1
    • P
      firewire: Remove two unneeded checks for macros · df7ce663
      Paul Bolle 提交于
      The old IEEE 1394 driver stack was removed in v2.6.37. That made the
      checks for two Kconfig (module) macros unneeded, since they will now
      always evaluate to true. Remove these two checks.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      df7ce663
  4. 09 1月, 2013 1 次提交
  5. 29 11月, 2012 1 次提交
  6. 19 11月, 2012 1 次提交
  7. 25 9月, 2012 1 次提交
  8. 18 6月, 2012 1 次提交
  9. 05 6月, 2012 1 次提交
  10. 27 5月, 2012 1 次提交
  11. 18 4月, 2012 2 次提交
  12. 09 4月, 2012 1 次提交
  13. 29 3月, 2012 1 次提交
  14. 19 3月, 2012 7 次提交
  15. 17 3月, 2012 1 次提交
    • C
      firewire: ohci: fix too-early completion of IR multichannel buffers · 0c0efbac
      Clemens Ladisch 提交于
      handle_ir_buffer_fill() assumed that a completed descriptor would be
      indicated by a non-zero transfer_status (as in most other descriptors).
      However, this field is written by the controller as soon as (the end of)
      the first packet has been written into the buffer.  As a consequence, if
      we happen to run into such a descriptor when the interrupt handler is
      executed after such a packet has completed, the descriptor would be
      taken out of the list of active descriptors as soon as the buffer had
      been partially filled, so the event for the buffer being completely
      filled would never be sent.
      
      To fix this, handle descriptors only when they have been completely
      filled, i.e., when res_count == 0.  (This also matches the condition
      that is reported by the controller with an interrupt.)
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Cc: 2.6.36+ <stable@vger.kernel.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      0c0efbac
  16. 11 3月, 2012 2 次提交
  17. 31 1月, 2012 1 次提交
  18. 27 1月, 2012 1 次提交
  19. 16 1月, 2012 1 次提交
  20. 18 10月, 2011 2 次提交
    • C
      firewire: ohci: fix isochronous DMA synchronization · a572e688
      Clemens Ladisch 提交于
      Add the dma_sync_single_* calls necessary to ensure proper cache
      synchronization for isochronous data buffers on non-coherent
      architectures.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a572e688
    • C
      firewire: ohci: work around selfID junk due to wrong gap count · 32eaeae1
      Clemens Ladisch 提交于
      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: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      32eaeae1
  21. 09 10月, 2011 3 次提交
    • S
      firewire: net: Use posted writes · a74477db
      Stephan Gatzka 提交于
      Change memory region to ohci "middle address space". This effectively
      reduces the number of packets by 50%.
      
      [Stefan R.:]  This eliminates 1394 ack packets and improved throughput
      by a few percent in some tests with an S400a connection with and without
      gap count optimization.  Since firewire-net taxes the AR-req DMA unit of
      a FireWire controller much more than firewire-sbp2 (which uses the
      middle address space with PCI posted writes too), this commit also
      changes a related error printk into a ratelimited one as a precaution.
      
      Side note:  The IPv4-over-1394 drivers of Mac OS X 10.4, Windows XP SP3,
      and the Thesycon 1394 bus driver for Windows all use the middle address
      space too.
      Signed-off-by: NStephan Gatzka <stephan@gatzka.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a74477db
    • S
      firewire: ohci: optimize TSB41BA3D detection · b810e4ae
      Stefan Richter 提交于
      Takes less source code and machine code, and less runtime with PHYs
      other than TSB41BA3D (e.g. TSB81BA3 with device ID 0x831304 which takes
      one instead of six read_paged_phy_reg now).
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      b810e4ae
    • S
      firewire: ohci: TSB41BA3D support tweaks · 28897fb7
      Stefan Richter 提交于
      Fix:  phy_reg_mutex must be held over the write/read_phy_reg pair which
      gets PHY port status.
      
      Only print to the log when a TSB41BA3D was found.  By far most TSB82AA2
      cards have a TSB81BA3, and firewire-ohci can keep quiet about that.
      
      Shorten some strings and comments.  Change some whitespace.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      28897fb7
  22. 17 9月, 2011 1 次提交