1. 07 Jul, 2014 2 commits
    • Lv Zheng's avatar
      ACPI / EC: Add asynchronous command byte write support · f92fca00
      Lv Zheng authored
      Move the first command byte write into advance_transaction() so that all
      EC register accesses that can affect the command processing state machine
      can happen in this asynchronous state machine advancement function.
      
      The advance_transaction() function then can be a complete implementation
      of an asyncrhonous transaction for a single command so that:
       1. The first command byte can be written in the interrupt context;
       2. The command completion waiter can also be used to wait the first command
          byte's timeout;
       3. In BURST mode, the follow-up command bytes can be written in the
          interrupt context directly, so that it doesn't need to return to the
          task context. Returning to the task context reduces the throughput of
          the BURST mode and in the worst cases where the system workload is very
          high, this leads to the hardware driven automatic BURST mode exit.
      
      In order not to increase memory consumption, convert 'done' into 'flags'
      to contain multiple indications:
       1. ACPI_EC_COMMAND_COMPLETE: converting from original 'done' condition,
          indicating the completion of the command transaction.
       2. ACPI_EC_COMMAND_POLL: indicating the availability of writing the first
          command byte. A new command can utilize this flag to compete for the
          right of accessing the underlying hardware. There is a follow-up bug
          fix that has utilized this new flag.
      
      The 2 flags are important because it also reflects a key concept of IO
      programs' design used in the system softwares. Normally an IO program
      running in the kernel should first be implemented in the asynchronous way.
      And the 2 flags are the most common way to implement its synchronous
      operations on top of the asynchronous operations:
      1. POLL: This flag can be used to block until the asynchronous operations
               can happen.
      2. COMPLETE: This flag can be used to block until the asynchronous
                   operations have completed.
      By constructing code cleanly in this way, many difficult problems can be
      solved smoothly.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=70891
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=63931
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=59911Reported-and-tested-by: default avatarGareth Williams <gareth@garethwilliams.me.uk>
      Reported-and-tested-by: default avatarHans de Goede <jwrdegoede@fedoraproject.org>
      Reported-by: default avatarBarton Xu <tank.xuhan@gmail.com>
      Tested-by: default avatarSteffen Weber <steffen.weber@gmail.com>
      Tested-by: default avatarArthur Chen <axchen@nvidia.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f92fca00
    • Lv Zheng's avatar
      ACPI / EC: Avoid race condition related to advance_transaction() · 66b42b78
      Lv Zheng authored
      The advance_transaction() will be invoked from the IRQ context GPE handler
      and the task context ec_poll(). The handling of this function is locked so
      that the EC state machine are ensured to be advanced sequentially.
      
      But there is a problem. Before invoking advance_transaction(), EC_SC(R) is
      read. Then for advance_transaction(), there could be race condition around
      the lock from both contexts. The first one reading the register could fail
      this race and when it passes the stale register value to the state machine
      advancement code, the hardware condition is totally different from when
      the register is read. And the hardware accesses determined from the wrong
      hardware status can break the EC state machine. And there could be cases
      that the functionalities of the platform firmware are seriously affected.
      For example:
       1. When 2 EC_DATA(W) writes compete the IBF=0, the 2nd EC_DATA(W) write may
          be invalid due to IBF=1 after the 1st EC_DATA(W) write. Then the
          hardware will either refuse to respond a next EC_SC(W) write of the next
          command or discard the current WR_EC command when it receives a EC_SC(W)
          write of the next command.
       2. When 1 EC_SC(W) write and 1 EC_DATA(W) write compete the IBF=0, the
          EC_DATA(W) write may be invalid due to IBF=1 after the EC_SC(W) write.
          The next EC_DATA(R) could never be responded by the hardware. This is
          the root cause of the reported issue.
      
      Fix this issue by moving the EC_SC(R) access into the lock so that we can
      ensure that the state machine is advanced consistently.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=70891
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=63931
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=59911Reported-and-tested-by: default avatarGareth Williams <gareth@garethwilliams.me.uk>
      Reported-and-tested-by: default avatarHans de Goede <jwrdegoede@fedoraproject.org>
      Reported-by: default avatarBarton Xu <tank.xuhan@gmail.com>
      Tested-by: default avatarSteffen Weber <steffen.weber@gmail.com>
      Tested-by: default avatarArthur Chen <axchen@nvidia.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      66b42b78
  2. 06 Jul, 2014 4 commits
    • Linus Torvalds's avatar
      Linux 3.16-rc4 · cd3de83f
      Linus Torvalds authored
      cd3de83f
    • Linus Torvalds's avatar
      Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux · 100193f5
      Linus Torvalds authored
      Pull devicetree bugfix from Grant Likely:
       "Important bug fix for parsing 64-bit addresses on 32-bit platforms.
        Without this patch the kernel will try to use memory ranges that
        cannot be reached"
      
      * tag 'dt-for-linus' of git://git.secretlab.ca/git/linux:
        of: Check for phys_addr_t overflows in early_init_dt_add_memory_arch
      100193f5
    • Linus Torvalds's avatar
      Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 8addf0c7
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is a set of 13 fixes, a MAINTAINERS update and a sparse update.
        The fixes are mostly correct value initialisations, avoiding NULL
        derefs and some uninitialised pointer avoidance.
      
        All the patches have been incubated in -next for a few days.  The
        final patch (use the scsi data buffer length to extract transfer size)
        has been rebased to add a cc to stable, but only the commit message
        has changed"
      
      * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        [SCSI] use the scsi data buffer length to extract transfer size
        virtio-scsi: fix various bad behavior on aborted requests
        virtio-scsi: avoid cancelling uninitialized work items
        ibmvscsi: Add memory barriers for send / receive
        ibmvscsi: Abort init sequence during error recovery
        qla2xxx: Fix sparse warning in qla_target.c.
        bnx2fc: Improve stats update mechanism
        bnx2fc: do not scan uninitialized lists in case of error.
        fc: ensure scan_work isn't active when freeing fc_rport
        pm8001: Fix potential null pointer dereference and memory leak.
        MAINTAINERS: Update LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) maintainers Email IDs
        be2iscsi: remove potential junk pointer free
        be2iscsi: add an missing goto in error path
        scsi_error: set DID_TIME_OUT correctly
        scsi_error: fix invalid setting of host byte
      8addf0c7
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 110e4308
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "i915, tda998x and vmwgfx fixes,
      
        The main one is i915 fix for missing VGA connectors, along with some
        fixes for the tda998x from Russell fixing some modesetting problems.
      
        (still on holidays, but got a spare moment to find these)"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/vmwgfx: Fix incorrect write to read-only register v2:
        drm/i915: Drop early VLV WA to fix Voltage not getting dropped to Vmin
        drm/i915: only apply crt_present check on VLV
        drm/i915: Wait for vblank after enabling the primary plane on BDW
        drm/i2c: tda998x: add some basic mode validation
        drm/i2c: tda998x: faster polling for edid
        drm/i2c: tda998x: move drm_i2c_encoder_destroy call
      110e4308
  3. 05 Jul, 2014 12 commits
  4. 04 Jul, 2014 15 commits
  5. 03 Jul, 2014 7 commits