31 Mar, 2011

1 commit


22 Mar, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
    firewire: core: ignore link-active bit of new nodes, fix device recognition
    firewire: sbp2: revert obsolete 'fix stall with "Unsolicited response"'
    firewire: core: increase default SPLIT_TIMEOUT value
    firewire: ohci: Misleading kfree in ohci.c::pci_probe/remove
    firewire: ohci: omit IntEvent.busReset check rom AT queueing
    firewire: ohci: prevent starting of iso contexts with empty queue
    firewire: ohci: prevent iso completion callbacks after context stop
    firewire: core: rename some variables
    firewire: nosy: should work on Power Mac G4 PCI too
    firewire: core: fix card->reset_jiffies overflow
    firewire: cdev: remove unneeded reference
    firewire: cdev: always wait for outbound transactions to complete
    firewire: cdev: remove unneeded idr_find() from complete_transaction()
    firewire: ohci: log dead DMA contexts

    Linus Torvalds
     

20 Mar, 2011

3 commits

  • Like the older ieee1394 core driver, firewire-core skipped scanning of
    any new node whose PHY sent a self ID without "link active" bit. If a
    device had this bit off mistakenly, it meant that it was inaccessible to
    kernel drivers with the old IEEE 1394 driver stack but could still be
    accessed by userspace drivers through the raw1394 interface.

    But with firewire-core, userspace drivers don't get to see such buggy
    devices anymore. This is effectively a driver regression since this
    device bug is otherwise harmless.

    We now attempt to scan all devices, even repeaters that don't have a
    link or powered-down devices that have everything but their PHY shut
    down when plugged in. This results in futile repeated scanning attempts
    in case of such devices that really don't have an active link, but this
    doesn't hurt since recent workqueue infrastructure lets us run more
    concurrent scanning jobs than we can shake a stick at.

    This should fix accessibility of Focusrite Saffire PRO 26 I/O:
    http://sourceforge.net/mailarchive/forum.php?thread_name=20110314215622.5c751bb0%40stein&forum_name=ffado-user

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • Now that firewire-core sets the local node's SPLIT_TIMEOUT to 2 seconds
    per default, commit a481e97d3cdc40b9d58271675bd4f0abb79d4872 is no
    longer required.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • The SPLIT_TIMEOUT mechanism is intended to detect requests that somehow
    got lost. However, when the timeout value is too low, transactions that
    could have been completed successfully will be cancelled. Furthermore,
    there are chips whose firmwares ignore the configured split timeout and
    send late split response; known examples are the DM1x00 (BeBoB), TCD22x0
    (DICE), and some OXUF936QSE firmwares.

    This patch changes the default timeout to two seconds, which happens to
    be the default on other OSes, too.

    Actual lost requests are extremely rare, so there should be no practical
    downside to increasing the split timeout even on devices that work
    correctly.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     

15 Mar, 2011

3 commits

  • Add a driver for two playback-only FireWire devices based on the OXFW970
    chip.

    v2: better AMDTP API abstraction; fix fw_unit leak; small fixes
    v3: cache the iPCR value
    v4: FireWave constraints; fix fw_device reference counting;
    fix PCR caching; small changes and fixes
    v5: volume/mute support; fix crashing due to pcm stop races
    v6: fix build; one-channel volume for LaCie
    v7: use signed values to make volume (range checks) work; fix function
    block IDs for volume/mute; always use channel 0 for LaCie volume

    Signed-off-by: Clemens Ladisch
    Acked-by: Stefan Richter
    Tested-by: Jay Fenlason
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • It seems drivers/firewire/ohci.c is making some optimistic assumptions
    about struct fw_ohci and that member "card" will always remain the first
    member of the struct.
    Plus it's probably going to confuse a lot of static code analyzers too.

    So I wonder if there is a good reason not to free the ohci struct just
    like it was allocated instead of the tricky &ohci->card way?

    Signed-off-by: Oleg Drokin

    It is perhaps just a rudiment from before mainline submission of the
    driver.

    Signed-off-by: Stefan Richter

    Oleg Drokin
     
  • Since commit 82b662dc4102 "flush AT contexts after bus reset for OHCI 1.2",
    the driver takes care of any AT packets that were enqueued during a bus
    reset phase. The check from commit 76f73ca1b291 is therefore no longer
    necessary and the MMIO read can be avoided.

    Signed-off-by: Stefan Richter

    Stefan Richter
     

26 Feb, 2011

4 commits

  • If a misguided program tried to start an isochronous context before it
    has queued any packets, the call would appear to succeed, but the
    context would not actually go into the running state, and the OHCI
    controller would then raise an unrecoverableError interrupt because the
    first Z value is zero and thus invalid. The driver logs such errors,
    but there is no mechanism to report this back to the program.

    Add an explicit check so that this error can be returned synchronously.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • To prevent the iso packet callback from being called after
    fw_iso_context_stop() has returned, make sure that the
    context's tasklet has finished executing before that.

    This fixes access-after-free bugs that have so far been
    observed only in the upcoming snd-firewire-speakers driver,
    but can theoretically also happen in the firedtv driver.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • In manage_channel(), rename the variables "c" and "i" to the more
    expressive "bit" and "channel".

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • The first board generation of Power Mac G4 ("Yikes!", those with PCI
    graphics) still had a PCILynx controller like their G3 predecessors,
    but not the later AGP models. (Jonathan Woithe recalls to have heard
    of it, and some web sources reinforce it.)

    Signed-off-by: Stefan Richter

    Stefan Richter
     

23 Jan, 2011

5 commits


22 Jan, 2011

1 commit


21 Jan, 2011

3 commits

  • thanks to Clemens' and Maxim's fixes to firewire-ohci and -net in the
    last two kernel releases.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • This makes it possible to resume communication with a node that dropped
    off the bus for a brief period. Otherwise communication will only be
    possible after ARP cache entry timeouts.

    Signed-off-by: Maxim Levitsky
    Signed-off-by: Stefan Richter (rebased)

    Maxim Levitsky
     
  • Regression since commit 10389536742c, "firewire: core: check for 1394a
    compliant IRM, fix inaccessibility of Sony camcorder":

    The camcorder Canon MV5i generates lots of bus resets when asynchronous
    requests are sent to it (e.g. Config ROM read requests or FCP Command
    write requests) if the camcorder is not root node. This causes drop-
    outs in videos or makes the camcorder entirely inaccessible.
    https://bugzilla.redhat.com/show_bug.cgi?id=633260

    Fix this by allowing any Canon device, even if it is a pre-1394a IRM
    like MV5i are, to remain root node (if it is at least Cycle Master
    capable). With the FireWire controller cards that I tested, MV5i always
    becomes root node when plugged in and left to its own devices.

    Reported-by: Ralf Lange
    Signed-off-by: Stefan Richter
    Cc: # 2.6.32.y and newer

    Stefan Richter
     

13 Jan, 2011

1 commit

  • PAGE_KERNEL_RO is not available on all architectures, so its use
    in the new AR code broke compilation on sparc64.

    Because the read-only mapping was just a debugging aid, just use
    PAGE_KERNEL instead.

    Signed-off-by: Clemens Ladisch

    James Bottomley wrote:
    > On Thu, 2011-01-13 at 08:27 +0100, Clemens Ladisch wrote:
    >> firewire: ohci: fix compilation on arches without PAGE_KERNEL_RO, e.g. sparc
    >>
    >> PAGE_KERNEL_RO is not available on all architectures, so its use in the
    >> new AR code broke compilation on sparc64.
    >>
    >> Because the R/O mapping is only used to catch drivers that try to write
    >> to the reception buffer and not actually required for correct operation,
    >> we can just use a normal PAGE_KERNEL mapping where _RO is not available.
    [...]
    >> +/*
    >> + * For archs where PAGE_KERNEL_RO is not supported;
    >> + * mapping the AR buffers readonly for the CPU is just a debugging aid.
    >> + */
    >> +#ifndef PAGE_KERNEL_RO
    >> +#define PAGE_KERNEL_RO PAGE_KERNEL
    >> +#endif
    >
    > This might cause interesting issues on sparc64 if it ever acquired a
    > PAGE_KERNEL_RO. Sparc64 has extern pgprot_t for it's PAGE_KERNEL types
    > rather than #defines, so the #ifdef check wouldn't see this.
    >
    > I think either PAGE_PROT_RO becomes part of our arch API (so all
    > architectures are forced to add it), or, if it's not part of the API,
    > ohci isn't entitled to use it. The latter seems simplest since you have
    > no real use for write protection anyway.

    Reported-by: Andrew Morton
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     

04 Jan, 2011

5 commits


19 Dec, 2010

2 commits

  • At ifup, carrier status would be shown on even if it actually was off.
    Also add an include for ethtool_ops rather than to rely on the one from
    netdevice.h.

    Note, we can alas not use fwnet_device_mutex to serialize access to
    dev->peer_count (as I originally wanted). This would cause a lock
    inversion:
    - fwnet_probe | takes fwnet_device_mutex
    + register_netdev | takes rtnl_mutex
    - devinet_ioctl | takes rtnl_mutex
    + fwnet_open | ...must not take fwnet_device_mutex

    Hence use the dev->lock spinlock for serialization.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • To make userland, e.g. NetworkManager work with firewire, we need to
    detect whether cable is plugged or not. Simple and correct way of doing
    that is just counting number of peers. No peers - no link and vice
    versa.

    Signed-off-by: Stefan Richter

    Maxim Levitsky
     

14 Dec, 2010

10 commits

  • Unfortunately its easy to trigger such error messages by removing the
    cable while sending streams of data over the link.

    Such errors are normal, and therefore this patch stops firewire-net from
    flooding the kernel log with these errors, by combining series of same
    errors together.

    Signed-off-by: Maxim Levitsky

    (Stefan R:) Eventually we should remove this logging when firewire-net
    and related firewire-ohci facilities have been stabilized.

    Signed-off-by: Stefan Richter

    Maxim Levitsky
     
  • Restore iso channels DMA so that iso channels could continue to work
    after resume from RAM/disk.

    Signed-off-by: Maxim Levitsky
    Signed-off-by: Stefan Richter

    Maxim Levitsky
     
  • Some lousy BIOSes, e.g. my Aspire 5720 BIOS forget to restore the GUID
    register on resume from RAM.

    Fix that by setting it to the last value that was read from it.

    Signed-off-by: Maxim Levitsky
    Signed-off-by: Stefan Richter

    Maxim Levitsky
     
  • The buffers used for the selfIDs packets and the AR request and response
    descriptors end up using three pages because dma_alloc_coherent()
    allocates at least one page per call. However, these data structures
    would all fit into 4 KB, so we can save space by using a common buffer
    for them.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • When the isochRx/isochTx bit is clear, we do not need to read the
    corresponding iso interrupt event register.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • Change the header of PHY packets to be sent to include a pseudo
    transaction code. This makes the header consistent with that of
    received PHY packets, and allows at_context_queue_packet() and
    log_ar_at_event() to see the packet type directly instead of having
    to deduce it from the header length or even from the header contents.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • To remove the error information from the controller's queue and to allow
    more posted writes, the driver has to read the failed posted write
    address before clearing the postedWriteErr interrupt bit.

    Signed-off-by: Clemens Ladisch

    (Stefan R:) The spec is somewhat fuzzy about the actual requirements.
    To err on the safe side, let's do these two read accesses.

    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • Make sure that interrupt event clear bit writes are executed before the
    interrupt handler returns.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • Add proper error handling for the context_init() calls.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     
  • Move the AR DMA descriptors out of the buffer pages, and map the buffer
    pages linearly into the kernel's address space. This allows the driver
    to ignore any page boundaries in the DMA data and thus to avoid any
    copying around of packet payloads.

    This fixes the bug where S800 packets that are so big (> 4080 bytes)
    that they can be split over three pages were not handled correctly.

    Due to the changed algorithm, we can now use arbitrarily many buffer
    pages, which improves performance because the controller can more easily
    unload its DMA FIFO.

    Furthermore, using streaming DMA mappings should improve perfomance on
    architectures where coherent DMA mappings are not cacheable. Even on
    other architectures, the caching behaviour should be improved slightly
    because the CPU no longer writes to the buffer pages.

    v2: Detect the last filled buffer page by searching the descriptor's
    residual count value fields in order (like in the old code), instead
    of going backwards through the transfer status fields; it looks as
    if some controllers do not set the latter correctly.

    v3: Fix an old resume bug that would now make the handler run into
    a BUG_ON, and replace that check with more useful error handling.
    Increase the buffer size for better performance with non-TI chips.

    Signed-off-by: Clemens Ladisch

    Maxim Levitsky writes:
    Works almost perfectly. I can still see RCODE_BUSY errors
    sometimes, not very often though. 64K here eliminates these errors
    completely. This is most likely due to nouveau drivers and lowest
    perf level I use to lower card temperature. That increases
    latencies too much I think. Besides that the IO is just perfect.

    Tested-by: Maxim Levitsky
    Signed-off-by: Stefan Richter

    Clemens Ladisch
     

12 Dec, 2010

1 commit