1. 25 2月, 2010 12 次提交
    • S
      firewire: ohci: add module parameter to activate quirk fixes · 3e9cc2f3
      Stefan Richter 提交于
      This way, we can advise users of precompiled kernel packages to test
      existing quirk fixes on chips which have not been listed yet, without
      them having to build a kernel from source.
      
      Note, to use this feature on a machine with more than one controller,
      steps like these are necessary:
      # lspci | grep 1394
      # ls /sys/bus/pci/drivers/firewire_ohci/
      # echo -n "0000:03:02.0" > /sys/bus/pci/drivers/firewire_ohci/unbind
      # echo 2 > /sys/module/firewire_ohci/parameters/quirks
      # echo -n "0000:03:02.0" > /sys/bus/pci/drivers/firewire_ohci/bind
      # echo 0 > /sys/module/firewire_ohci/parameters/quirks
      
      The parameter can also be used to switch off quirk flags that were
      hardwired into firewire-ohci's quirks table.  Simply specify a non-zero
      quirks value but without any known flags, e.g. 0x100.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      3e9cc2f3
    • S
      firewire: ohci: use an ID table for quirks detection · 4a635593
      Stefan Richter 提交于
      We don't have a lot of quirks to take into account (especially since
      dual-buffer IR is out of the picture), but still, a table-based approach
      is more organized than a series of if () clauses.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      4a635593
    • S
      firewire: ohci: reorder struct fw_ohci for better cache efficiency · ecb1cf9c
      Stefan Richter 提交于
      The config_rom struct members are only accessed during relatively
      infrequent self-ID-complete interrupts and only if the local config ROM
      was changed, while the ar_, at_, ir_, it_ members are used very
      frequently during I/O.  Hence move the config_rom members further down.
      
      More importantly, make the huge self_id_buffer member the last one; this
      is only accessed in self-ID-complete interrupts.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      ecb1cf9c
    • S
      firewire: ohci: remove unused dualbuffer IR code · 6498ba04
      Stefan Richter 提交于
      This code was no longer used since 2.6.33, "firewire: ohci: always use
      packet-per-buffer mode for isochronous reception" commit 090699c0.  If
      anybody needs this code in the future for special purposes, it can be
      brought back in.  But it must not be re-enabled by default; drivers
      (kernelspace or userspace drivers) should only get this mode if they
      explicitly request it.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      6498ba04
    • S
      64582298
    • S
      firewire: core: change type of a data buffer · 6e95dea7
      Stefan Richter 提交于
      from array of char to union of structs.  I already used a union to size
      the buffer which holds ioctl arguments; more consequent is to define it
      as an instance of this union in the first place.
      
      Also rename several local variables from "request" to "a"(rgument) since
      the term request can be mistaken to mean a transaction subaction, e.g.
      an instance of struct fw_request.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      6e95dea7
    • S
      firewire: cdev: add more flexible cycle timer ioctl · abfe5a01
      Stefan Richter 提交于
      The system time from CLOCK_REALTIME is not monotonic, hence problematic
      for the main user of the FW_CDEV_IOC_GET_CYCLE_TIMER ioctl.  This issue
      exists in its successor ABI, i.e. raw1394, too.
      http://subversion.ffado.org/ticket/242
      
      We now offer an alternative ioctl which lets the caller choose between
      CLOCK_REALTIME, CLOCK_MONOTONIC, and CLOCK_MONOTONIC_RAW as source of
      the local time, very similar to the clock_gettime libc function.  The
      format of the local time return value matches that of clock_gettime
      (seconds and nanoseconds, instead of a single microseconds value from
      the existing ioctl).
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      abfe5a01
    • S
      firewire: core: rename an internal function · fd6e0c51
      Stefan Richter 提交于
      according to what it really does.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      fd6e0c51
    • S
      firewire: core: fix an information leak · 137d9ebf
      Stefan Richter 提交于
      If a device exposes a sparsely populated configuration ROM,
      firewire-core's sysfs interface and character device file interface
      showed random data in the gaps between config ROM blocks.  Fix this by
      zero-initialization of the config ROM reader's scratch buffer.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      137d9ebf
    • S
      firewire: core: increase stack size of config ROM reader · 58aaa542
      Stefan Richter 提交于
      The stack size of 16 was artificially chosen and may be too small in
      extreme cases.  A device won't be accessible then.
      
      Since it doesn't really matter to the slab allocator whether we ask for
      1088 bytes or 2048 bytes of scratch memory, just allocate 2048 bytes for
      the sum of temporary config ROM image and stack, and we will never ever
      overflow the stack (because there simply can't be more stack items than
      ROM entries).
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      58aaa542
    • S
      firewire: core: don't fail device creation in case of too large config ROM blocks · 2799d5c5
      Stefan Richter 提交于
      It never happened yet, but better safe than sorry:  If a device's config
      ROM contains a block which overlaps the boundary at 0xfffff00007ff, just
      ignore that one block instead of refusing to add the device
      representation.  That way, upper layers (kernelspace or userspace
      drivers) might still be able to use the device to some degree.
      
      That's better than total inaccessibility of the device.  Worse, the core
      would have logged only a generic "giving up on config rom" message which
      could only be debugged by feeding a firewire-ohci debug logging session
      through a config ROM interpreter, IOW would likely remain undiagnosed.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      2799d5c5
    • S
      firewire: core: fix "giving up on config rom" with Panasonic AG-DV2500 · d54423c6
      Stefan Richter 提交于
      The Panasonic AG-DV2500 tape deck contains an invalid entry in its
      configuration ROM root directory:  A leaf pointer with the undefined key
      ID 0 and an offset that points way out of the standard config ROM area.
      This caused firewire-core to dismiss the device with the generic log
      message "giving up on config rom for node id...", after which it was of
      course impossible to access the tape deck with dvgrab or any other
      program.  https://bugzilla.redhat.com/show_bug.cgi?id=449252#c29
      
      The fix is to simply ignore this invalid ROM entry and proceed to read
      the valid rest of the ROM.  There is a catch though:  When the kernel
      later iterates over the ROM, it would be nasty having to check again for
      such too large ROM offsets.  Therefore we manipulate the defective or
      unsupported ROM entry to become a harmless immediate entry that won't
      have any side effects later (an entry with the value 0x00000000).
      
      Reported-by: George Chriss
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      d54423c6
  2. 23 2月, 2010 16 次提交
  3. 22 2月, 2010 2 次提交
  4. 21 2月, 2010 2 次提交
    • S
      firewire: remove incomplete Bus_Time CSR support · 168cf9af
      Stefan Richter 提交于
      The current implementation of Bus_Time read access was buggy since it
      did not ensure that Bus_Time.second_count_hi and second_count_lo came
      from the same 128 seconds period.
      Reported-by: NHåkan Johansson <f96hajo@chalmers.se>
      
      Instead of a fix, remove Bus_Time register support altogether.  The spec
      requires all cycle master capable nodes to implement this (all Linux
      nodes are cycle master capable) while it also says that it "may" be
      initialized by the bus manager or by the IRM standing in for a bus
      manager.  (Neither Linux' firewire-core nor ieee1394 nodemgr implement
      this.)
      
      Since we cannot rely on Bus_Time having been initialized by a bus
      manager, it is better to return an error instead of a nonsensical value
      on a read request to Bus_Time.
      
      Alternatively, we could fix the Bus_Time read integrity bug _and_
      implement (a) cycle master's write support of the register as well as
      (b) bus manager's Bus_Time initialization service, i.e. preservation of
      the Bus_Time when the cycle master node of a bus changes.  However, that
      would be quite some code for a feature that is unreliable to begin with
      and very likely unused in practice.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      168cf9af
    • S
      firewire: get_cycle_timer optimization and cleanup · 4a9bde9b
      Stefan Richter 提交于
      ohci:  Break out of the retry loop if too many attempts were necessary.
      This may theoretically happen if the chip is fatally defective or if the
      get_cycle_timer ioctl was performed after a CardBus controller was
      ejected.
      
      Also micro-optimize the loop by re-using the last two register reads in
      the next iteration, remove a questionable inline keyword, and shuffle a
      comment around.
      
      core:  ioctl_get_cycle_timer() is always called with interrupts on,
      therefore local_irq_save() can be replaced by local_irq_disable().
      Disabled local IRQs imply disabled preemption, hence preempt_disable()
      can be removed.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      4a9bde9b
  5. 20 2月, 2010 8 次提交