1. 20 8月, 2010 2 次提交
    • S
      firewire: sbp2: fix stall with "Unsolicited response" · a481e97d
      Stefan Richter 提交于
      Fix I/O stalls with some 4-bay RAID enclosures which are based on
      OXUF936QSE:
        - Onnto dataTale RSM4QO, old firmware (not anymore with current
          firmware),
        - inXtron Hydra Super-S LCM, old as well as current firmware
      when used in RAID-5 mode, perhaps also in other RAID modes.
      
      The stalls happen during heavy or moderate disk traffic in periods that
      are a multiple of 5 minutes, roughly twice per hour.  They are caused
      by the target responding too late to an ORB_Pointer register write:
      The target responds after Split_Timeout, hence firewire-core cancels
      the transaction, and firewire-sbp2 fails the SCSI request.  The SCSI
      core retries the request, that fails again (and again), hence SCSI core
      calls firewire-sbp2's abort handler (and even the Management_Agent
      register write in the abort handler has the transaction timeout
      problem).
      
      During all that, the process which issued the I/O is stalled in I/O
      wait state.
      
      Meanwhile, the target actually acts on the first failed SCSI request:
      It responds to the ORB_Pointer write later (seen in the kernel log as
      "firewire_core: Unsolicited response") and also finishes the SCSI
      request with proper status (seen in the kernel log as "firewire_sbp2:
      status write for unknown orb").
      
      So let's just ignore RCODE_CANCELLED in the transaction callback and
      wait for the target to complete the ORB nevertheless.  This requires
      a small modification is sbp2_cancel_orbs(); it now needs to call
      orb->callback() regardless whether fw_cancel_transaction() found the
      transaction unfinished or finished.
      
      A different solution is to increase Split_Timeout on the local node.
      (Tested: 2000ms timeout; maybe 1000ms or something like that works too.
      200ms is insufficient.  Standard is 100ms.)  However, I rather not do
      this because any software on any node could change the Split_Timeout to
      something unsuitable.  Or such a large Split_Timeout may be undesirable
      for other purposes.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a481e97d
    • S
      firewire: sbp2: fix memory leak in sbp2_cancel_orbs or at send error · 6c74340b
      Stefan Richter 提交于
      When an ORB was canceled (Command ORB i.e. SCSI request timed out, or
      Management ORB timed out), or there was a send error in the initial
      transaction, we missed to drop one of the ORB's references and thus
      leaked memory.
      
      Background:
      In total, we hold 3 references to each Operation Request Block:
        - 1 during sbp2_scsi_queuecommand() or sbp2_send_management_orb()
          respectively,
        - 1 for the duration of the write transaction to the ORB_Pointer or
          Management_Agent register of the target,
        - 1 for as long as the ORB stays within the lu->orb_list, until
          the ORB is unlinked from the list and the orb->callback was
          executed.
      
      The latter one of these 3 references is finished
        - normally by sbp2_status_write() when the target wrote status
          for a pending ORB,
        - or by sbp2_cancel_orbs() in case of an ORB time-out,
        - or by complete_transaction() in case of a send error.
      Of them, the latter two lacked the kref_put.
      
      Add the missing kref_put()s.  Add comments to the gets and puts of
      references for transaction callbacks and ORB callbacks so that it is
      easier to see what is supposed to happen.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      6c74340b
  2. 06 8月, 2010 1 次提交
  3. 02 8月, 2010 1 次提交
  4. 31 7月, 2010 3 次提交
  5. 30 7月, 2010 5 次提交
    • S
      firewire: add isochronous multichannel reception · 872e330e
      Stefan Richter 提交于
      This adds the DMA context programming and userspace ABI for multichannel
      reception, i.e. for listening on multiple channel numbers by means of a
      single DMA context.
      
      The use case is reception of more streams than there are IR DMA units
      offered by the link layer.  This is already implemented by the older
      ohci1394 + ieee1394 + raw1394 stack.  And as discussed recently on
      linux1394-devel, this feature is occasionally used in practice.
      
      The big drawbacks of this mode are that buffer layout and interrupt
      generation necessarily differ from single-channel reception:  Headers
      and trailers are not stripped from packets, packets are not aligned with
      buffer chunks, interrupts are per buffer chunk, not per packet.
      
      These drawbacks also cause a rather hefty code footprint to support this
      rarely used OHCI-1394 feature.  (367 lines added, among them 94 lines of
      added userspace ABI documentation.)
      
      This implementation enforces that a multichannel reception context may
      only listen to channels to which no single-channel context on the same
      link layer is presently listening to.  OHCI-1394 would allow to overlay
      single-channel contexts by the multi-channel context, but this would be
      a departure from the present first-come-first-served policy of IR
      context creation.
      
      The implementation is heavily based on an earlier one by Jay Fenlason.
      Thanks Jay.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      872e330e
    • S
      firewire: core: small clarifications in core-cdev · ae2a9766
      Stefan Richter 提交于
      Make a note on the seemingly unused linux/sched.h.
      Rename an irritatingly named variable.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      ae2a9766
    • S
      firewire: core: remove unused code · 69e61d0c
      Stefan Richter 提交于
      ioctl_create_iso_context enforces ctx->header_size >= 4.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      69e61d0c
    • S
      firewire: ohci: release channel in error path · e5b06c07
      Stefan Richter 提交于
      firewire-ohci keeps book of which isochronous channels are occupied by
      IR DMA contexts, so that there cannot be more than one context listening
      to a certain channel.
      
      If IR context creation failed due to an out-of-memory condition, this
      bookkeeping leaked a channel.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      e5b06c07
    • S
      firewire: ohci: use memory barriers to order descriptor updates · 071595eb
      Stefan Richter 提交于
      When we append to a DMA program, we need to ensure that the order in
      which initialization of the new descriptors and update of the
      branch_address of the old tail descriptor, as seen by the PCI device,
      happen as intended.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      071595eb
  6. 29 7月, 2010 2 次提交
  7. 28 7月, 2010 5 次提交
  8. 27 7月, 2010 21 次提交
    • A
      wm8350-regulator: fix wm8350_register_regulator error handling · e9a1c512
      Axel Lin 提交于
      In the case of platform_device_add() fail, we should call
      platform_device_put() instead of platform_device_del()
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
      e9a1c512
    • A
      ab3100: fix off-by-one value range checking for voltage selector · 979da89a
      Axel Lin 提交于
      We use voltage selector as an array index for typ_voltages.
      Thus the valid range for voltage selector should be 0..voltages_len-1.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLinus Walleij <linus.walleij@stericsson.com>
      Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
      979da89a
    • S
      tools/firewire: add userspace front-end of nosy · 9f6d3c4b
      Stefan Richter 提交于
      This adds nosy-dump, the userspace part of nosy, the IEEE 1394 traffic
      sniffer for Texas Instruments PCILynx/ PCILynx2 based cards.  Author is
      Kristian Høgsberg.
      
      The files added here are taken from
      git://anongit.freedesktop.org/~krh/nosy commit ee29be97 (2009-11-10)
      with the following changes by Stefan Richter:
        - Parts pertaining to the kernel module removed from Makefile.
        - dist target removed from the Makefile.
        - Mentioned nosy-dump in the Kconfig help to nosy's kernel component.
        - Add copyright notice to nosy-dump.c.  This is a duplicate of the
          respective notice in the kernel component nosy.c except for a time
          span of 2002 - 2006, according to Kristian's git log.
      
      "git shortlog decode-fcp.c list.h nosy-dump.[ch]" from nosy's git
      repository:
      
      Jonathan Woithe (1):
            Save logs on Ctrl-C
      
      Kristian Høgsberg (11):
            Pull over nosy from mercurial repo.
            Remove some fields from default view, add logging feature.
            Use infinite time out for poll(), mark more detail fields.
            Fix byte ordering macro.
            Add decoding of iso data and lock packets.
            Add flag to indicate data length field.
            Add cycle start packet decoding, add --iso and --cycle-start flags.
            Distinguish between phy-packets and 0-length iso data.
            Fix transaction and stats view.
            Add simple AV/C decoder.
            Don't break down on big payloads.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: NKristian Høgsberg <krh@bitplanet.net>
      9f6d3c4b
    • S
      firewire: nosy: use generic printk macros · 7429b17d
      Stefan Richter 提交于
      Replace home-grown printk wrapper macros by ones from kernel.h and
      device.h.
      
      Also raise the log level in set_phy_reg() from debug to error because
      these are really error conditions.  Could even be WARN_ON.  Lower the
      log level in the device probe and driver shutdown from notice to info.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      7429b17d
    • S
      firewire: nosy: endianess fixes and annotations · fd8c8d46
      Stefan Richter 提交于
      1.)  The DMA programs (struct pcl) are PCI-endian = little endian data
      (except for the 3rd quadlet in a PCL which the controller does not
      touch).  Annotate them as such.
      
      Fix all accesses of the PCL to work with big endian CPUs also.  Not
      actually tested, I only have a little endian PC to test with.  This
      includes replacement of a bitfield struct pcl_status by open-coded
      shift and mask operations.
      
      2.)  The two __attribute__ ((packed)) at struct pcl are not really
      required since it consists of u32/__le32 only, i.e. there will be no
      padding with or without the attribute.
      
      3.)  The received IEEE 1394 data are byteswapped by the controller from
      IEEE 1394 endian = big endian to PCI endian = little endian because the
      PCL_BIGENDIAN control bit is set.  Therefore annotate the DMA buffer as
      a __le32 array.
      
      Fix the one access of the DMA buffer (the check of the transaction code
      of link packets) to work with big endian CPUs.  Also fix the two
      accesses of the client bounce buffer (the reading of packet length).
      
      4.)  Add a comment to the userspace ABI header that all of the data gets
      out as little endian data, except for the timestamp which is CPU endian.
      (We could make it little endian too, but why?  Vice versa, an ioctl
      could be added to dump packet data in big endian byte order...)
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      fd8c8d46
    • S
    • S
      firewire: nosy: fix device shutdown with active client · 424d66ce
      Stefan Richter 提交于
      Fix race between nosy_open() and remove_card() by replacing the
      unprotected array of card pointers by a mutex-protected list of cards.
      
      Make card instances reference-counted and let each client hold a
      reference.
      
      Notify clients about card removal via POLLHUP in poll()'s events
      bitmap; also let read() fail with errno=ENODEV if the card was removed
      and everything in the buffer was read.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      424d66ce
    • S
      firewire: nosy: handle errors in device probe · b6d9c125
      Stefan Richter 提交于
      and add a missing pci_disable_device() to device shutdown.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      b6d9c125
    • S
      firewire: nosy: fix IRQ handler for card ejection · 16547667
      Stefan Richter 提交于
      Untested, I don't have a PCILynx CardBus card.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      16547667
    • S
      firewire: nosy: unroll some simple functions · 55e77c06
      Stefan Richter 提交于
      nosy_start/stop_snoop() and nosy_add/remove_client() are simple enough
      to be inlined into their callers.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      55e77c06
    • S
      firewire: nosy: use flagless variants of spinlock accessors · 685c3f80
      Stefan Richter 提交于
      nosy_start/stop_snoop() are always only called by the ioctl method, i.e.
      with IRQs enabled.  packet_handler() and bus_reset_handler() are always
      only called by the IRQ handler.  Hence neither one needs to track IRQ
      flags.
      
      To underline the call context of packet_handler() and
      bus_reset_handler(), rename these functions to *_irq_handler().
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      685c3f80
    • S
      firewire: nosy: fix list corruption by NOSY_IOC_STOP · a2d39db9
      Stefan Richter 提交于
      nosy_stop_snoop() would blow up the second time it was called without
      nosy_start_snoop() in between.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a2d39db9
    • S
      firewire: nosy: convert to unlocked ioctl · c7b2a99c
      Stefan Richter 提交于
      The required serialization of NOSY_IOC_START and NOSY_IOC_STOP is
      already provided by the client_list_lock.
      
      NOSY_IOC_FILTER does not really require serialization since accesses
      to tcode_mask are atomic on any sane CPU architecture.  Nevertheless,
      make it explicit that we want this to be atomic by means of
      client_list_lock (which also surrounds the other tcode_mask access in
      the IRQ handler).  While we are at it, change the type of tcode_mask to
      u32 for consistency with the user API.
      
      NOSY_IOC_GET_STATS does not require serialization against itself.  But
      there is a bug here regarding concurrent updates of the two counters
      by the IRQ handler.  Fix it by taking the client_list_lock in this ioctl
      too.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      c7b2a99c
    • S
      firewire: nosy: misc cleanups · b5e47729
      Stefan Richter 提交于
      Extend copyright note to 2007, c.f. Kristian's git log.
      
      Includes:
        - replace some <asm/*.h> by <linux/*.h>
        - add required indirectly included <linux/spinlock.h>
        - order alphabetically
      
      Coding style related changes:
        - change to utf8
        - normalize whitespace
        - normalize comment style
        - remove usages of __FUNCTION__
        - remove an unnecessary cast from void *
      
      Const and static declarations:
        - driver_name is not const in pci_driver.name, drop const qualifier
        - driver_name can be taken from KBUILD_MODNAME
        - the global variable minors[] can and should be static
        - constify struct file_operations instance
      
      Data types:
        - Remove unused struct member struct packet.code.  struct packet is
          only used for driver-internal bookkeeping; it does not appear on the
          wire or in DMA programs or the userspace ABI.  Hence the unused
          member .code can be removed without worries.
      
      Preprocessor macros:
        - unroll a preprocessor macro that containd a return
        - use list_for_each_entry
      
      Printk:
        - add missing terminating \n in some format strings
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      b5e47729
    • S
      firewire: new driver: nosy - IEEE 1394 traffic sniffer · 28646821
      Stefan Richter 提交于
      This adds the traffic sniffer driver for Texas Instruments PCILynx/
      PCILynx2 based cards.  The use cases for nosy are analysis of
      nonstandard protocols and as an aid in development of drivers,
      applications, or firmwares.
      
      Author of the driver is Kristian Høgsberg.  Known contributers are
      Jody McIntyre and Jonathan Woithe.
      
      Nosy programs PCILynx chips to operate in promiscuous mode, which is a
      feature that is not found in OHCI-1394 controllers.  Hence, only special
      hardware as mentioned in the Kconfig help text is suitable for nosy.
      
      This is only the kernelspace part of nosy.  There is a userspace
      interface to it, called nosy-dump, proposed to be added into the tools/
      subdirectory of the kernel sources in a subsequent change.  Kernelspace
      and userspave component of nosy communicate via a 'misc' character
      device file called /dev/nosy with a simple ioctl() and read() based
      protocol, as described by nosy-user.h.
      
      The files added here are taken from
      git://anongit.freedesktop.org/~krh/nosy commit ee29be97 (2009-11-10)
      with the following changes by Stefan Richter:
        - Kconfig and Makefile hunks are written from scratch.
        - Commented out version printk in nosy.c.
        - Included missing <linux/sched.h>, reported by Stephen Rothwell.
      
      "git shortlog nosy{-user.h,.c,.h}" from nosy's git repository:
      
      Jonathan Woithe (2):
            Nosy updates for recent kernels
            Fix uninitialised memory (needed for 2.6.31 kernel)
      
      Kristian Høgsberg (5):
            Pull over nosy from mercurial repo.
            Use a misc device instead.
            Add simple AV/C decoder.
            Don't break down on big payloads.
            Set parent device for misc device.
      
      As a low-level IEEE 1394 driver, its files are placed into
      drivers/firewire/ although nosy is not part of the firewire driver
      stack.
      
      I am aware of the following literature from Texas Instruments about
      PCILynx programming:
            SCPA020A - PCILynx 1394 to PCI Bus Interface TSB12LV21BPGF
                       Functional Specification
            SLLA023  - Initialization and Asynchronous Programming of the
                       TSB12LV21A 1394 Device
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: NKristian Høgsberg <krh@bitplanet.net>
      28646821
    • B
      s2io: fixing DBG_PRINT() macro · 5447080c
      Breno Leitao 提交于
      Patch 9e39f7c5 changed the
      DBG_PRINT() macro and the if clause was wrongly changed. It means
      that currently all the DBG_PRINT are being printed, flooding the
      kernel log buffer with things like:
      
      s2io: eth6: Next block at: c0000000b9c90000
      s2io: eth6: In Neterion Tx routine
      Signed-off-by: NBreno Leitao <leitao@linux.vnet.ibm.com>
      Acked-by: NSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5447080c
    • J
      drm/i915: make sure we shut off the panel in eDP configs · 5620ae29
      Jesse Barnes 提交于
      Fix error from the last pull request.  Making sure we shut the panel off
      is more correct and saves power.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5620ae29
    • X
      [CPUFREQ] fix memory leak in cpufreq_add_dev · 6f90388a
      Xiaotian Feng 提交于
      We didn't free policy->related_cpus in error path err_unlock_policy.
      This is catched by following kmemleak report:
      
      unreferenced object 0xffff88022a0b96d0 (size 512):
        comm "modprobe", pid 886, jiffies 4294689177 (age 780.694s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<ffffffff8111ebe5>] create_object+0x186/0x281
          [<ffffffff814fad4f>] kmemleak_alloc+0x60/0xa7
          [<ffffffff8111127a>] kmem_cache_alloc_node_notrace+0x120/0x142
          [<ffffffff81262e4f>] alloc_cpumask_var_node+0x2c/0xd7
          [<ffffffff81262f0b>] alloc_cpumask_var+0x11/0x13
          [<ffffffff81262f1c>] zalloc_cpumask_var+0xf/0x11
          [<ffffffff8140fac0>] cpufreq_add_dev+0x11f/0x547
          [<ffffffff81334bda>] sysdev_driver_register+0xc2/0x11d
          [<ffffffff8140e334>] cpufreq_register_driver+0xcb/0x1b8
          [<ffffffffa032e040>] 0xffffffffa032e040
          [<ffffffff810021ba>] do_one_initcall+0x5e/0x15c
          [<ffffffff81087f94>] sys_init_module+0xa6/0x1e6
          [<ffffffff81009bc2>] system_call_fastpath+0x16/0x1b
          [<ffffffffffffffff>] 0xffffffffffffffff
      Signed-off-by: NXiaotian Feng <dfeng@redhat.com>
      Cc: Thomas Renninger <trenn@suse.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      6f90388a
    • A
      [CPUFREQ] revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)" · accd8466
      Andrej Gelenberg 提交于
      395913d0 ("[CPUFREQ] remove rwsem lock
      from CPUFREQ_GOV_STOP call (second call site)") is not needed, because
      there is no rwsem lock in cpufreq_ondemand and cpufreq_conservative
      anymore.  Lock should not be released until the work done.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=1594Signed-off-by: NAndrej Gelenberg <andrej.gelenberg@udo.edu>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      accd8466
    • F
      USB: musb: tusb6010: fix compile error with n8x0_defconfig · 2b795ea0
      Felipe Balbi 提交于
      Drop the unnecessary empty stubs in tusb6010.c and avoid
      a compile error when building kernel for n8x0.
      Signed-off-by: NFelipe Balbi <felipe.balbi@nokia.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2b795ea0
    • C
      USB: FTDI: Add support for the RT System VX-7 radio programming cable · fcc6cb78
      Corey Minyard 提交于
      RT Systems has put out bunch of ham radio cables based on the FT232RL
      chip.  Each cable type has a unique PID, this adds one for the Yaesu VX-7
      radios.
      Signed-off-by: NCorey Minyard <minyard@acm.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fcc6cb78