1. 10 4月, 2010 2 次提交
  2. 25 3月, 2010 2 次提交
    • S
      firewire: core: align driver match with modalias · fe43d6d9
      Stefan Richter 提交于
      The driver match strategy was:
        - Match vendor/model/specifier/version of the unit directory.
        - If that was a miss, match vendor from the root directory and
          model/specifier/version of the unit directory.
      
      This was inconsistent with how the modalias string was constructed
      until recently (take vendor/model from root directory and specifier/
      version from unit directory).  It was also inconsistent with how it is
      done since the parent commit:
        - Use vendor/model/specifier/version of the unit directory if possible,
        - fall back to one or more of vendor/model/specifier/version from the
          root directory depending on which ones are not present at the unit
          directory.
      
      Fix this inconsistency by sharing the ROM scanner function between
      modalias printer function and driver match function.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      fe43d6d9
    • S
      firewire: core: fix Model_ID in modalias · 5ae73518
      Stefan Richter 提交于
      The modalias string of devices that represent units on a FireWire node
      did not show Module_ID entries within unit directories.  This was
      because firewire-core searched only the root directory of the
      configuration ROM for a Model_ID entry.
      
      We now search first the root directory, then the unit directory.  IOW
      honor a unit directory's Model_ID if present, otherwise fall back to the
      root directory's model ID (if present).
      
      Furthermore, apply the same change to Vendor_ID.  This had the same
      issue but it was less apparent because most devices provide Vendor_ID
      only in the root directory.
      
      And finally, also use this strategy for the remaining two IDs in the
      modalias, Specifier_ID and Version.  It does not actually make sense to
      look for them elsewhere than in the unit directory because they are
      mandatory there.  However, a uniform search order simplifies the
      implementation and has no adverse affect in practice.
      
      Side notes:
        - The older counterpart of this, nodemgr.c of ieee1394, looked for
          Vendor_ID first in the root directory, then in the unit directory,
          and for Model_ID only in the unit directory.
        - There is a single mainline driver which requires Vendor_ID and
          Model_ID --- the firedtv driver.  This one worked because FireDTVs
          provide Vendor_ID in the root directory and Model_ID identically in
          root directory and unit directory.
        - Apart from firedtv, there are currently no drivers known to me
          (including userspace drivers) that look at the Vendor_ID or Model_ID
          of the modalias.
      Reported-by: NMaciej Żenczykowski <zenczykowski@gmail.com>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      5ae73518
  3. 18 3月, 2010 1 次提交
    • C
      firewire: ohci: add cycle timer quirk for the TI TSB12LV22 · 8301b91b
      Clemens Ladisch 提交于
      Among the many entries in the TSB12LV22 errata list (TI literature
      number SLLS312) is the following:
      
        PCI Slave reads of the Cycle Timer register may occasionally get an
        incorrect value.
        Software may be able to validate value by reading the register
        multiple times rapidly and evaluating for a reasonable difference.
      
      Signed-off-by: Clemens Ladisch <clemens@ladisch.de> (untested)
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (added #define)
      8301b91b
  4. 15 3月, 2010 1 次提交
  5. 25 2月, 2010 14 次提交
    • S
      firewire: ohci: extend initialization log message · 6fdb2ee2
      Stefan Richter 提交于
      by the number of available isochronous DMA contexts and active quirks
      which is occasionally useful information.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      6fdb2ee2
    • S
      firewire: ohci: fix IR/IT context mask mixup · 4802f16d
      Stefan Richter 提交于
      This bug was present in firewire-ohci since day one:  The number of
      available isochronous receive DMA contexts was mixed up with that of
      available isochronous transmit DMA contexts.
      
      This is harmless on a few chips which offer the same number of contexts
      in both directions, but most chips nowadays implement only the standard
      minimum of 4 IR contexts, but 8 IT contexts.  If a user attempted to run
      a lot of IR contexts at once, results with more than four were therefore
      unpredictable.  I suppose the controller would simply refuse to start
      DMA of any unimplemented context.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      4802f16d
    • 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
  6. 23 2月, 2010 16 次提交
  7. 22 2月, 2010 2 次提交
  8. 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