1. 23 Jan, 2015 5 commits
    • Lv Zheng's avatar
      ACPI / EC: Fix issues related to the SCI_EVT handling · 74443bbe
      Lv Zheng authored
      This patch fixes 2 issues related to the draining behavior. But it doesn't
      implement the draining support, it only cleans up code so that further
      draining support is possible.
      
      The draining behavior is expected by some platforms (for example, Samsung)
      where SCI_EVT is set only once for a set of events and might be cleared for
      the very first QR_EC command issued after SCI_EVT is set. EC firmware on
      such platforms will return 0x00 to indicate "no outstanding event". Thus
      after seeing an SCI_EVT indication, EC driver need to fetch events until
      0x00 returned (see acpi_ec_clear()).
      
      Issue 1 - acpi_ec_submit_query():
      It's reported on Samsung laptops that SCI_EVT isn't checked when the
      transactions are advanced in ec_poll(), which leads to SCI_EVT triggering
      source lost:
       If no EC GPE IRQs are arrived after that, EC driver cannot detect this
       event and handle it.
      See comment 244/247 for kernel bugzilla 44161.
      This patch fixes this issue by moving SCI_EVT checks into
      advance_transaction(). So that SCI_EVT is checked each time we are going to
      handle the EC firmware indications. And this check will happen for both IRQ
      context and task context.
      Since after doing that, SCI_EVT is also checked after completing a
      transaction, ec_check_sci() and ec_check_sci_sync() can be removed.
      
      Issue 2 - acpi_ec_complete_query():
      We expect to clear EC_FLAGS_QUERY_PENDING to allow queuing another draining
      QR_EC after writing a QR_EC command and before reading the event. After
      reading the event, SCI_EVT might be cleared by the firmware, thus it may
      not be possible to queue such a draining QR_EC at that time.
      But putting the EC_FLAGS_QUERY_PENDING clearing code after
      start_transaction() is wrong as there are chances that after
      start_transaction(), QR_EC can fail to be sent. If this happens,
      EC_FLAG_QUERY_PENDING will be cleared earlier. As a consequence, the
      draining QR_EC will also be queued earlier than expected.
      This patch also moves this code into advance_transaction() where QR_EC is
      just sent (ACPI_EC_COMMAND_POLL flagged) to fix this issue.
      
      Notes:
      1. After introducing the 2 SCI_EVT related handlings into
         advance_transaction(), a next QR_EC can be queued right after writing
         the current QR_EC command and before reading the event. But this still
         hasn't implemented the draining behavior as the draining support
         requires:
           If a previous returned event value isn't 0x00, a draining QR_EC need
           to be issued even when SCI_EVT isn't set.
      2. In this patch, acpi_os_execute() is also converted into a seperate work
         item to avoid invoking kmalloc() in the atomic context. We can do this
         because of the previous global lock fix.
      3. Originally, EC_FLAGS_EVENT_PENDING is also used to avoid queuing up
         multiple work items (created by acpi_os_execute()), this can be covered
         by only using a single work item. But this patch still keeps this flag
         as there are different usages in the driver initialization steps relying
         on this flag.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=44161Reported-by: default avatarKieran Clancy <clancy.kieran@gmail.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      74443bbe
    • Lv Zheng's avatar
      ACPI / EC: Fix a code path that global lock is not held · f3e14329
      Lv Zheng authored
      Currently QR_EC is queued up on CPU 0 to be safe with SMM because there is
      no global lock held for acpi_ec_gpe_query(). As we are about to move QR_EC
      to a non CPU 0 bound work queue to avoid invoking kmalloc() in
      advance_transaction(), we have to acquire global lock for the new QR_EC
      work item to avoid regressions.
      
      Known issue:
      1. Global lock for acpi_ec_clear().
         This is an existing issue that acpi_ec_clear() which invokes
         acpi_ec_sync_query() also suffers from the same issue. But this patch's
         target is only the code to invoke acpi_ec_sync_query() in a CPU 0 bound
         work queue item, and the acpi_ec_clear() can be automatically fixed by
         further patch that merges the redundant code, so it is left unchanged.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f3e14329
    • Lv Zheng's avatar
      ACPI / EC: Fix returning values in acpi_ec_sync_query() · c2cf5769
      Lv Zheng authored
      The returning value of acpi_os_execute() is erroneously handled as errno.
      This patch corrects it by returning EBUSY to indicate the work queue item
      creation failure.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c2cf5769
    • Lv Zheng's avatar
      ACPI / EC: Add reference counting for query handlers · 01305d41
      Lv Zheng authored
      This patch adds reference counting for query handlers in order to eliminate
      kmalloc()/kfree() usage.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Tested-by: default avatarSteffen Weber <steffen.weber@gmail.com>
      Tested-by: default avatarOrtwin Glück <odi@odi.ch>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      01305d41
    • Lv Zheng's avatar
      ACPI / EC: Cleanup transaction wakeup code · 0c78808f
      Lv Zheng authored
      This patch moves transaction wakeup code into advance_transaction().
      No functional changes.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0c78808f
  2. 18 Jan, 2015 4 commits
    • Linus Torvalds's avatar
      Linux 3.19-rc5 · ec6f34e5
      Linus Torvalds authored
      ec6f34e5
    • Linus Torvalds's avatar
      Merge tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · d0ac5d8e
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "We've been sitting on our fixes branch for a while, so this batch is
        unfortunately on the large side.
      
        A lot of these are tweaks and fixes to device trees, fixing various
        bugs around clocks, reg ranges, etc.  There's also a few defconfig
        updates (which are on the late side, no more of those).
      
        All in all the diffstat is bigger than ideal at this time, but nothing
        in here seems particularly risky"
      
      * tag 'armsoc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (31 commits)
        reset: sunxi: fix spinlock initialization
        ARM: dts: disable CCI on exynos5420 based arndale-octa
        drivers: bus: check cci device tree node status
        ARM: rockchip: disable jtag/sdmmc autoswitching on rk3288
        ARM: nomadik: fix up leftover device tree pins
        ARM: at91: board-dt-sama5: add phy_fixup to override NAND_Tree
        ARM: at91/dt: sam9263: Add missing clocks to lcdc node
        ARM: at91: sama5d3: dt: correct the sound route
        ARM: at91/dt: sama5d4: fix the timer reg length
        ARM: exynos_defconfig: Enable LM90 driver
        ARM: exynos_defconfig: Enable options for display panel support
        arm: dts: Use pmu_system_controller phandle for dp phy
        ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances
        ARM: dts: berlin: correct BG2Q's SM GPIO location.
        ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT
        ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host
        ARM: dts: Revert disabling of smc91x for n900
        ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling
        ARM: dts: dra7-evm: fix qspi device tree partition size
        ARM: omap2plus_defconfig: use CONFIG_CPUFREQ_DT
        ...
      d0ac5d8e
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux · 12ba8571
      Linus Torvalds authored
      Pull clock driver fixes from Mike Turquette:
       "Small number of fixes for clock drivers and a single null pointer
        dereference fix in the framework core code.
      
        The driver fixes vary from fixing section mismatch warnings to
        preventing machines from hanging (and preventing developers from
        crying)"
      
      * tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux:
        clk: fix possible null pointer dereference
        Revert "clk: ppc-corenet: Fix Section mismatch warning"
        clk: rockchip: fix deadlock possibility in cpuclk
        clk: berlin: bg2q: remove non-exist "smemc" gate clock
        clk: at91: keep slow clk enabled to prevent system hang
        clk: rockchip: fix rk3288 cpuclk core dividers
        clk: rockchip: fix rk3066 pll lock bit location
        clk: rockchip: Fix clock gate for rk3188 hclk_emem_peri
        clk: rockchip: add CLK_IGNORE_UNUSED flag to fix rk3066/rk3188 USB Host
      12ba8571
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 901b2082
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is one fix for a Multiqueue sleeping in invalid context problem
        and a MAINTAINER file update for Qlogic"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ->queue_rq can't sleep
        MAINTAINERS: Update maintainer list for qla4xxx
      901b2082
  3. 17 Jan, 2015 18 commits
  4. 16 Jan, 2015 13 commits