kernel/kernel-mfld-blackbay.git
12 years agoTEST mfld pmu: add arch/x86/platform/mfld/pmu.h
Len Brown [Fri, 12 Aug 2011 21:43:35 +0000 (22:43 +0100)]
TEST mfld pmu: add arch/x86/platform/mfld/pmu.h

from UMG 2.6.35 tree: arch/x86/kernel/mid_pmu.h

commit 1df781ef9bbc9b0fc453537da2a3b1861f363138
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Thu Jun 23 04:58:43 2011 +0530

    mid_pmu:  sparse warnings fixed

    BZ: 3856

    Fixed the following sparse warnings.

    arch/x86/kernel/mid_pmu.c:302:18: warning: symbol 'pmu_wake_lock' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1126:15: warning: symbol 'pmu_get_cstate' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1813:3: warning: symbol 'medfield_lsses' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1874:5: warning: symbol 'medfield_lsses_num' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1876:6: warning: symbol 'lss_device_status' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:2368:5: warning: symbol 'mid_suspend' was not declared. Should it be static?

    fixed make namespacecheck issues.

    Change-Id: I7731a0391b1433a7ecfa28bdd3265591d1389495
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit 5e73c57d106f8c766a5a06221e2817a7c9a5b393
Author: Rajesh Poornachandran <rajesh.poornachandran@intel.com>
Date:   Thu Jun 16 16:59:39 2011 -0700

    Revert "Revert "mid_pmu: Moving NC power management logic to OSPM""

    BZ: 1957

    Currently the PM for north complex was done independently by Gfx and ISP drivers.
    There was no synchronization between ISP and Gfx while sending the PM cmd.

    OSPM patch to provide an API, pmu_nc_set_power_state. This API will take care
    of talking to P-unit and getting the corresponding power islands to ON/OFF.
    Gfx and ISP drivers need to use this API in their drivers.

    Change-Id: I628dd8b03f5d09607e3c931e29943fcdb73613cb
Signed-off-by: Sujith Thomas <sujith.thomas@intel.com>
Signed-off-by: Rajesh Poornachandran <rajesh.poornachandran@intel.com>
commit dd6db50f98b6c0d368b9315124b65ec3b1aae2a1
Author: Erwan Mahe <erwanx.mahe@intel.com>
Date:   Thu Jun 23 18:29:21 2011 +0200

    Revert "Revert "mid_pmu: pick correct D0ix states in choose_state""

    BZ: 2102
    This reverts commit 41ff42ea4b74c89d7ed44b51e46ab7ae45b4b87c.

    Change-Id: I5aa5658cf28696a3c79a939ea8644a3b3c4d73f0

commit 41ff42ea4b74c89d7ed44b51e46ab7ae45b4b87c
Author: Marie-Celine Dubut <marie.celinex.dubut@intel.com>
Date:   Wed Jun 22 12:44:06 2011 +0200

    Revert "mid_pmu: pick correct D0ix states in choose_state"

    BZ 2102
    This reverts commit c60a2ae1f8b33abdabbff9c0de5a57ec6588df9d.

    Change-Id: I7e7aed5071adabc824c303628ba855031892e70a

commit c60a2ae1f8b33abdabbff9c0de5a57ec6588df9d
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Wed Jun 1 13:19:54 2011 +0530

    mid_pmu: pick correct D0ix states in choose_state

    BZ: 2102

    currently pmu_pci_choose_state return PCI_D3hot for all devices.
    For some of devices, it may not be possible to support PCI_D3hot state.
    eg., HSU needs to be put in D0i1, chaabi needs to be put in
    D0i2. It is not appropriate to always choose D0i3 for all devices

    We choose the correct state that is appropriate for each device
    for the  platform.

    This patch should be used only with a FW that is capable of supporting
    Chaabi D0i2.

    Change-Id: Ief7b64bc1ec37d4452ce3222454bdd6102d54c10
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit c4e73f14acb7ffd39a5d965fc23b1f01673363b8
Author: Hari Kanigeri <hari.k.kanigeri@intel.com>
Date:   Fri Jun 3 11:27:13 2011 -0600

    mid_pmu: fix checkpatch violations and some cleanup in exit paths

    BZ: 3066

    Fix the following:

    1. Checkpatch violations and cosmetic changes.
    2. fix correct cleanup in the exit paths of the function mid_pmu_probe

    Below log is related to checkpatch violations.

    1. Checkpatch violations
    =========================

    ERROR: space required before the open parenthesis '('
    + if(pdev->device == 0x81c || pdev->device == 0x81b)

    WARNING: line over 80 characters
    + for (i = 0; i < PMU_MAX_LSS_SHARE && intel_mid_pci_devices[index].dev_driver[i]; i++) {}

    ERROR: trailing statements should be on next line
    + for (i = 0; i < PMU_MAX_LSS_SHARE && intel_mid_pci_devices[index].dev_driver[i]; i++) {}

    WARNING: braces {} are not necessary for single statement blocks
    + for (i = 0; i < PMU_MAX_LSS_SHARE && intel_mid_pci_devices[index].dev_driver[i]; i++) {}

    WARNING: line over 80 characters
    +static pci_power_t  pmu_pci_get_weakest_state_for_lss(int lss_index, struct pci_dev *pdev, pci_power_t state)

    <cut here for brewity, please run checkpatch to see a complete list>

    total: 122 errors, 14 warnings, 2340 lines checked

    Change-Id: I1cdbd6a8b70d303611f0cd426ce63235010d0a07
Signed-off-by: Hari Kanigeri <hari.k.kanigeri@intel.com>
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit d332d4a59c01e1774cd4fdc28d97fe4d865989ee
Author: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
Date:   Thu Feb 16 22:36:00 2006 +0530

    pmu: adding atomisp as part of entry criterion for S0i3

    BZ: 1339

    In current build we dont look at the isp runtime status before
    we enter S0i3 state. In this patch we check for the camera status
    in addition to all other device states that we check today in S0i3.

    Change-Id: If3f024fa22d0d744160b961e637e2b1c25e5e1c9
Signed-off-by: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
commit 53f93b022da79eadc22a2ac5c3adade98380cf84
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Mon May 16 00:26:13 2011 +0530

    mid_pmu: demote c6 to c4 while s0ix is in progress

    BZ: 2120

    While S0ix aborts SCU waits for Ack_C6 timeout, IA comes out of
    mwait and since the SCU is still waiting for Ack_C6 the S0ix
    ACK_C6 timeout error interrupt is not recieved, meanwhile a new
    C6 could be triggered from IA and this could trigger a Ack_C6
    SCU can mistake this Ack_C6 as a ack for the previously aborted
    S0ix and continue S0ix flow. This is not correct.

    We check if the system is in S0ix progress state by checking
    scu_ready_sem if its already acquired that means S0ix is in
    progress and the subsequent C6 should be demoted to C4's

    Change-Id: I1b60824b28f9b6579dd551faa8fe485d2074b712
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit 654da78fa8f45bcf4d64d9c0ea115d589f4374c4
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Sun May 15 23:44:23 2011 +0530

    mid_pmu: c6 offload msr bit cleanup

    BZ: 2116

    We were using magic number for wmsr(0x120) for setting/clearing
    offload bit.

    Fixed this by creating #defines

    Change-Id: I5fe4ec0568e48d12fe30074f8eebbc2a6411b4d8
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit 8118849a0329d0e73761562443ae25c8b1cd3bf9
Author: Fengwei Yin <fengwei.yin@intel.com>
Date:   Sun May 22 11:57:12 2011 +0800

    Revert "mid_pmu:  Moving NC power management logic to OSPM"

    BZ: 2470

    This reverts commit 594c7f0327dd02985fbcde1e0bd83c98e684097f.

commit 594c7f0327dd02985fbcde1e0bd83c98e684097f
Author: Sujith Thomas <sthoma3@umg-lab1.iind.intel.com>
Date:   Thu May 12 10:51:38 2011 +0530

    mid_pmu:  Moving NC power management logic to OSPM

    BZ: 1957

    Currently the PM for north complex was done independently by Gfx and ISP drivers.
    There was no synchronization between ISP and Gfx while sending the PM cmd.

    OSPM patch to provide an API, pmu_nc_set_power_state.
    This API will take care of talking to P-unit and getting the corresponding power
    islands to ON/OFF. Gfx and ISP drivers need to use this API in their drivers.

    Change-Id: I302c9a7a6bb10ae572d340affb2502443d6178fc
Signed-off-by: Sujith Thomas <sujith.thomas@intel.com>
commit cba613f2bde66236706b9c0ba7f1fe6b5ff14ad7
Author: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
Date:   Tue May 10 16:22:10 2011 +0530

    pmu:  renaming lss after new wkc implementation in scu

    BZ 1756

    This patch we are re assigning some of the lss to new lss
    based on the WKC implementation in scu.

    Change-Id: Ic7a9adf37194182b424dcdcc0d61cb09bba4a7a5
Signed-off-by: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
commit 821d3f9513a5126201531e804c98b3618456d637
Author: Jean-Pierre Stierlin <jean-pierrex.stierlin@intel.com>
Date:   Thu May 5 18:19:43 2011 +0200

    OSPM: Add HSI as wake source in s0i3

    BZ: 1705

    HSI wake event was disabled in SCU configuration

    Revert a hack to disable HSI wake event to the SCU due to spurious interrupts.

    Change-Id: I2e9173fdf79fa158394a4b0b5894f643d3a43b8f

commit cfda66e44bc142f836c2e550211997759aa0d8e2
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Wed Mar 30 16:23:28 2011 +0530

    mid_pmu: cleanup added explicit LSS ids for s0ix entry

    Currently the LSS that need to be checked for S0ix/LPMP3
    entry is hardcoded making it difficult to read the sub
    system values.

    Added #defines for all the sub system LSS id's, using this
    defined the target config values to check against the SSS
    register values, that tells which subsystems need to in D0i3
    to issue S0i1/3 or LPMP3 commands.

    Also added a way to keep always ON LSS to be in D0i0.

    Added check for Keyboard, UART0/1/2 LSS in S0i1/lpmp3/S0i3 SSS
    config registers.

    Removed LSS 40, 41 from ignore_lss list.

    Change-Id: Ifd28b58f11c66232dc2993b3946c672bbe9931a3
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit 885ebc4f559cdaa19b3dddd02faa2dba246ae689
Author: Sundar Iyer <sundar.iyer@intel.com>
Date:   Tue Mar 22 15:03:51 2011 +0530

    mid_pmu: correct D0ix states during S0i3

    Enable the UART0/1/2 and the KBD modules to be put into D0i3 states
    during the S0i3.

    Change-Id: Idec4907699ba23506900a249a130cecaed85dc82
Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
commit 56ab6e9474f2e04f50ddede8f2b6db9e1dc852c1
Author: Sundar Iyer <sundar.iyer@intel.com>
Date:   Wed Mar 9 13:19:29 2011 +0530

    mid_pmu: correct USB Dx state during S0i3 entry

    Enable D0i3 state for the USB during S0i3 entry. Making this
    change realizes power figures for the USB rail from ~16mW to ~.4mW

Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
commit 0c2cb76662387a575c6f41b9f91a85cd76064f55
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Sat Feb 5 14:52:41 2011 +0100

    mid_pmu: cleanup: fix sparse check warnings

    moved all #defines to mid_pmu.h

    fixed warnings after installing sparse tool

    Fixed the following warnings from sparse.
    with make C=2 >& sparse.log command.

    arch/x86/kernel/mid_pmu.c:46:3: warning: symbol 'pci_dev_index' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1175:70: warning: incorrect type in argument 2 (different address spaces)
    arch/x86/kernel/mid_pmu.c:1175:70:    expected void volatile [noderef] <asn:2>*addr
    arch/x86/kernel/mid_pmu.c:1175:70:    got unsigned int *
    arch/x86/kernel/mid_pmu.c:1180:76: warning: incorrect type in argument 2 (different address spaces)
    arch/x86/kernel/mid_pmu.c:1180:76:    expected void volatile [noderef] <asn:2>*addr
    arch/x86/kernel/mid_pmu.c:1180:76:    got unsigned int *
    arch/x86/kernel/mid_pmu.c:322:5: warning: symbol 'get_target_platform_state' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:691:6: warning: symbol 'mfld_s0i1_enter' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:717:5: warning: symbol 'mfld_s0i3_enter' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:844:5: warning: symbol 'is_msi_enabled' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1191:59:    got unsigned int *
    arch/x86/kernel/mid_pmu.c:1502:13: warning: incorrect type in assignment (different address spaces)
    arch/x86/kernel/mid_pmu.c:1502:13:    expected struct mrst_pmu_reg *pmu
    arch/x86/kernel/mid_pmu.c:1502:13:    got void [noderef] <asn:2>*
    arch/x86/kernel/mid_pmu.c:1567:27:    expected void [noderef] <asn:2>*<noident>
    arch/x86/kernel/mid_pmu.c:1567:27:    got struct mrst_pmu_reg *static [toplevel] *<noident>
    ...
    and similar warnings.

Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit 33d19d30ff22685f18f184183b1e675d8fe94fea
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Mon Jan 17 08:22:32 2011 +0100

    mid_pmu: driver that controls pmus of intel_mid platforms

    Mobile Internet Devices based on the Intel "Medfield" platform have two
    Platform Management Units (PMU). The first PMU (pmu1) comprises of the
    Silverthorne CPU, Graphics, Video encode/decode and Display engines,
    The second PMU (pmu2) is the IO hub.

    The Platform Management Unit (PMU) driver is a Medfield-specific power
    management driver. Intel's  MID provides fine tuned knobs for
    platform level. Intel's Medfield MID provides control for platform
    level power management and the OS Power Management solution guides the
    power states that the subsystems and CPU needs to be in depending on the
    current usage and power policy set by the user.

    The purpose of the Medfield Power Management architecture is to turn
    off subsystems without affecting the end user functionality/usability of
    the system.

    The Power Management scheme uses the concept of operating modes, which
    define the configuration of all the subsystems under each of the usage model
    that the user might put the system in. Based on current platform usage,
    OSPM decides the target power states for the sub systems, and the PMU
    driver implements the OS-HW interface.

    "Intel" Medfield PMU driver interfaces with two power management units
    (PMU) pmu1 & pmu2. On receiving commands PMU driver interfaces
    with the pmu1 & pmu2 via a well defined register interface to drive the
    required power  management flows.

    This patch contains:
    - key definitions for the PMU driver.
    - core logic of the PMU driver as it interfaces with pmu1 & pmu2 for
    different platform power management flows.

Signed-off-by: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
Signed-off-by: Rajeev D Muralidhar <rajeev.d.muralidhar@intel.com>
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoTEST mfld pmu: add include/linux/intel_mid_pm.h -- for now
Len Brown [Fri, 12 Aug 2011 21:43:16 +0000 (22:43 +0100)]
TEST mfld pmu: add include/linux/intel_mid_pm.h -- for now

needed to compile mfld pmu driver

from UMG 2.6.35 tree:

commit 1df781ef9bbc9b0fc453537da2a3b1861f363138
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Thu Jun 23 04:58:43 2011 +0530

    mid_pmu:  sparse warnings fixed

    BZ: 3856

    Fixed the following sparse warnings.

    arch/x86/kernel/mid_pmu.c:302:18: warning: symbol 'pmu_wake_lock' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1126:15: warning: symbol 'pmu_get_cstate' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1813:3: warning: symbol 'medfield_lsses' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1874:5: warning: symbol 'medfield_lsses_num' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:1876:6: warning: symbol 'lss_device_status' was not declared. Should it be static?
    arch/x86/kernel/mid_pmu.c:2368:5: warning: symbol 'mid_suspend' was not declared. Should it be static?

    fixed make namespacecheck issues.

    Change-Id: I7731a0391b1433a7ecfa28bdd3265591d1389495
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit 0704c9bfd967b44da1e61a05f8789052bc6fbd29
Author: Sujith Thomas <sujith.thomas@intel.com>
Date:   Wed May 25 14:55:42 2011 +0530

    mid_pmu: Defining the OSPM macros to handle CONFIG_INTEL_MID_PM disabled

    BZ: 1957

    Currently the OSPM macros are not defined during CONFIG_INTEL_MID_PM disabled.
    This is breaking the compilation in Gfx and ISP drivers whenc CONFIG_PM is disabled.

    Now the OSPM macros are defined irrespective of CONFIG_INTEL_MID_PM flag.

    Change-Id: I6cf6185d712b728e5733c473d8a2947c36c62e03
Signed-off-by: Sujith Thomas <sujith.thomas@intel.com>
commit 5e73c57d106f8c766a5a06221e2817a7c9a5b393
Author: Rajesh Poornachandran <rajesh.poornachandran@intel.com>
Date:   Thu Jun 16 16:59:39 2011 -0700

    Revert "Revert "mid_pmu: Moving NC power management logic to OSPM""

    BZ: 1957

    Currently the PM for north complex was done independently by Gfx and ISP drivers.
    There was no synchronization between ISP and Gfx while sending the PM cmd.

    OSPM patch to provide an API, pmu_nc_set_power_state. This API will take care
    of talking to P-unit and getting the corresponding power islands to ON/OFF.
    Gfx and ISP drivers need to use this API in their drivers.

    Change-Id: I628dd8b03f5d09607e3c931e29943fcdb73613cb
Signed-off-by: Sujith Thomas <sujith.thomas@intel.com>
Signed-off-by: Rajesh Poornachandran <rajesh.poornachandran@intel.com>
commit 53f93b022da79eadc22a2ac5c3adade98380cf84
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Mon May 16 00:26:13 2011 +0530

    mid_pmu: demote c6 to c4 while s0ix is in progress

    BZ: 2120

    While S0ix aborts SCU waits for Ack_C6 timeout, IA comes out of
    mwait and since the SCU is still waiting for Ack_C6 the S0ix
    ACK_C6 timeout error interrupt is not recieved, meanwhile a new
    C6 could be triggered from IA and this could trigger a Ack_C6
    SCU can mistake this Ack_C6 as a ack for the previously aborted
    S0ix and continue S0ix flow. This is not correct.

    We check if the system is in S0ix progress state by checking
    scu_ready_sem if its already acquired that means S0ix is in
    progress and the subsequent C6 should be demoted to C4's

    Change-Id: I1b60824b28f9b6579dd551faa8fe485d2074b712
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
commit 8118849a0329d0e73761562443ae25c8b1cd3bf9
Author: Fengwei Yin <fengwei.yin@intel.com>
Date:   Sun May 22 11:57:12 2011 +0800

    Revert "mid_pmu:  Moving NC power management logic to OSPM"

    BZ: 2470

    This reverts commit 594c7f0327dd02985fbcde1e0bd83c98e684097f.

commit 594c7f0327dd02985fbcde1e0bd83c98e684097f
Author: Sujith Thomas <sthoma3@umg-lab1.iind.intel.com>
Date:   Thu May 12 10:51:38 2011 +0530

    mid_pmu:  Moving NC power management logic to OSPM

    BZ: 1957

    Currently the PM for north complex was done independently by Gfx and ISP drivers.
    There was no synchronization between ISP and Gfx while sending the PM cmd.

    OSPM patch to provide an API, pmu_nc_set_power_state.
    This API will take care of talking to P-unit and getting the corresponding power
    islands to ON/OFF. Gfx and ISP drivers need to use this API in their drivers.

    Change-Id: I302c9a7a6bb10ae572d340affb2502443d6178fc
Signed-off-by: Sujith Thomas <sujith.thomas@intel.com>
commit 4d0d20d8deda873a1e027ec2710675f58d2e9c7a
Author: Rajesh Poornachandran <rajesh.poornachandran@intel.com>
Date:   Thu May 5 10:01:30 2011 -0700

    GFX/PM: Export GFX APIs to power-gate NC IPs.
    BZ: 791
    Export GFX APIs (ospm_power_island_up/down) to be used by GFX, Video & Camera driver to power-gate NC IPs.

    Change-Id: Iadbc9513bf90df952063ef148245fbcf6d451dd7
Signed-off-by: Rajesh Poornachandran <rajesh.poornachandran@intel.com>
commit 37c03045efcd790183acdbd3cb94db59566bdb6d
Author: Pierre Tardy <pierre.tardy@intel.com>
Date:   Mon Mar 21 14:47:53 2011 +0100

    mid_pmu: allow several devices to be on the same lss

    HSU devices are in HW in the same lss.
    There is a workaround in IAFW, that will not advertise the correct lss
    for HSU0 and HSU1. This does not solve anything, as HSU0 driver will start
    to make fabric errors as soon as HSU2 is suspended.

    We generically solve the issue by maintaining a table of devices
    present in the same lss. For such very short list, we do not take the
    overhead of using linked list. but rather use a 4 slots table for each lss.

    This patch contains ss hardcode for HSU0 and HSU1. To be removed when
    IAFW remove the bad workaround.

    Change-Id: I11240c225edc92984cca7e5e176bbebab6df2d5d
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
commit 33d19d30ff22685f18f184183b1e675d8fe94fea
Author: Illyas Mansoor <illyas.mansoor@intel.com>
Date:   Mon Jan 17 08:22:32 2011 +0100

    mid_pmu: driver that controls pmus of intel_mid platforms

    Mobile Internet Devices based on the Intel "Medfield" platform have two
    Platform Management Units (PMU). The first PMU (pmu1) comprises of the
    Silverthorne CPU, Graphics, Video encode/decode and Display engines,
    The second PMU (pmu2) is the IO hub.

    The Platform Management Unit (PMU) driver is a Medfield-specific power
    management driver. Intel's  MID provides fine tuned knobs for
    platform level. Intel's Medfield MID provides control for platform
    level power management and the OS Power Management solution guides the
    power states that the subsystems and CPU needs to be in depending on the
    current usage and power policy set by the user.

    The purpose of the Medfield Power Management architecture is to turn
    off subsystems without affecting the end user functionality/usability of
    the system.

    The Power Management scheme uses the concept of operating modes, which
    define the configuration of all the subsystems under each of the usage model
    that the user might put the system in. Based on current platform usage,
    OSPM decides the target power states for the sub systems, and the PMU
    driver implements the OS-HW interface.

    "Intel" Medfield PMU driver interfaces with two power management units
    (PMU) pmu1 & pmu2. On receiving commands PMU driver interfaces
    with the pmu1 & pmu2 via a well defined register interface to drive the
    required power  management flows.

    This patch contains:
    - key definitions for the PMU driver.
    - core logic of the PMU driver as it interfaces with pmu1 & pmu2 for
    different platform power management flows.

Signed-off-by: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
Signed-off-by: Rajeev D Muralidhar <rajeev.d.muralidhar@intel.com>
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoTEST mrst idle: update to latest MRST idle code
Len Brown [Fri, 12 Aug 2011 21:42:29 +0000 (22:42 +0100)]
TEST mrst idle: update to latest MRST idle code

replace:

arch/x86/kernel/platform/mrst/pmu.c
arch/x86/kernel/platform/mrst/pmu.h
drivers/idle/intel_idle.c (also: sync w/ 3.1, retain penwell entry)
mrst_s0i3.c, mrst_s0i3_asm.S

minor associated changes:

arch/x86/include/asm/mrst.h
arch/x86/kernel/smpboot.c

n.b. Actual s0i3 support is EXCLUDED from intel_idle for now

Change-Id: Ibd214229062f19a8814ef2371a05f1239758bfa3
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agoRevert "Drop pmu code from medfield gb-stable on top of linux 3.0."
Fei Yang [Tue, 16 Aug 2011 20:50:36 +0000 (13:50 -0700)]
Revert "Drop pmu code from medfield gb-stable on top of linux 3.0."

cherry-pick Len Brown's PMU driver from Alan Cox's linux-3.0-mid-ref tree

This reverts commit 8b0274a0b21b27e82e532b9d7deaf0bbdf5f50b4.

12 years agoDrop pmu code from medfield gb-stable on top of linux 3.0.
Fei Yang [Wed, 27 Jul 2011 18:56:29 +0000 (11:56 -0700)]
Drop pmu code from medfield gb-stable on top of linux 3.0.

Change-Id: Ifc99ac7c2711dae585b3325a9c603bb79816c739
Signed-off-by: Fei Yang <fei.yang@intel.com>
12 years agocpuidle: Add support for the Penwell processor to intel_idle.c
Arjan van de Ven [Fri, 15 Jul 2011 13:39:31 +0000 (14:39 +0100)]
cpuidle: Add support for the Penwell processor to intel_idle.c

The Penwell Atom processor is very similar to the Lincroft processor
in terms of power behavior.. add the device ID.

Change-Id: Idbac8ec87b7ed42a9bc169df2d96172e7685d71f
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agox86: mrst: Add vrtc driver which serves as a wall clock device
Dirk Brandewie [Fri, 15 Jul 2011 13:39:07 +0000 (14:39 +0100)]
x86: mrst: Add vrtc driver which serves as a wall clock device

Moorestown platform doesn't have a m146818 RTC device like traditional
x86 PC, but a firmware emulated virtual RTC device(vrtc), which provides
some basic RTC functions like get/set time. vrtc serves as the only
wall clock device on Moorestown platform.

[ tglx: Changed the exports to _GPL ]

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
LKML-Reference: <20101110172837.3311.40483.stgit@localhost.localdomain>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
12 years agosfi-cpufreq: remove reading the P state from the hardware
Arjan van de Ven [Fri, 15 Jul 2011 13:39:36 +0000 (14:39 +0100)]
sfi-cpufreq: remove reading the P state from the hardware

Reading the P state data from the HW MSR is actually undefined, and does
not work in various circumstances in practice. (The assumption that
you get a value back that you can match to your own table is very iffy
and not actually correct)
It's also not needed....

Change-Id: Ibb43a9b1752a858ad40fec8cadc402cf6bea2e31
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq: The KConfig entry should depend on SFI not MRST
Arjan van de Ven [Fri, 15 Jul 2011 13:39:36 +0000 (14:39 +0100)]
sfi-cpufreq: The KConfig entry should depend on SFI not MRST

with CONFIG_X86_MRST meaning something very different now...
it's clear that the proper dependency should have been on CONFIG_SFI

Change-Id: Ie49f3d8c9734bf938a2a427448dc8826ab0f69c3
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq: delete write-never read-only variable
Arjan van de Ven [Fri, 15 Jul 2011 13:39:31 +0000 (14:39 +0100)]
sfi-cpufreq: delete write-never read-only variable

The SFI cpufreq driver had a variable that never got initialized, but
did get printk'd...
.. which is leaking kernel memory to the user.
Since it's not used... just delete it

Change-Id: I31626b7d317d999a912c492da4242e118e3e9e1c
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq.c: remove set_cpu_to_gfm() function
Arjan van de Ven [Fri, 15 Jul 2011 13:39:30 +0000 (14:39 +0100)]
sfi-cpufreq.c: remove set_cpu_to_gfm() function

The set_cpu_to_gfm() function worked around a bug in a prerelease firmware;
there's no need for this sort of low level MSR banging anymore at this point
in time.... remove the code.

Change-Id: Id969642ebbee26ceb06fa726aa0c04d9aba46f2a
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq.c: fix how the number of cpus is calculated
Arjan van de Ven [Fri, 15 Jul 2011 13:39:30 +0000 (14:39 +0100)]
sfi-cpufreq.c: fix how the number of cpus is calculated

The driver used "u64" as the size of an SFI table format..
... which actually was an incorrect size.

Fix the code by using a proper sizeof()

with this fix, the right number of cpus gets detected,
and the P state code actually works!

Change-Id: I6e7911bd14eccc54b5449b9568c58d5363872fe8
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq.c: checkpatch.pl cleanups
Arjan van de Ven [Fri, 15 Jul 2011 13:39:30 +0000 (14:39 +0100)]
sfi-cpufreq.c: checkpatch.pl cleanups

Fix various checkpatch violations

Change-Id: I777a3d0a72f73407d3d1190a80361ec4b4572277
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq.c: remove redundant CPUID feature check
Arjan van de Ven [Fri, 15 Jul 2011 13:39:30 +0000 (14:39 +0100)]
sfi-cpufreq.c: remove redundant CPUID feature check

If the firmware reports a frequency table, the CPU supports multiple
frequencies, no need to check that extra.

Change-Id: I596cb7dd28eaeb5fd5826e071358c409d620d07e
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq.c: fix the hardware coordination logic
Arjan van de Ven [Fri, 15 Jul 2011 13:39:30 +0000 (14:39 +0100)]
sfi-cpufreq.c: fix the hardware coordination logic

The platforms that support SFI only support hardware coordination of P states.
This means that all the logic in the driver around CPU masks was just overly
complicated without any good reason.

This patch simplifies the driver by just going for one cpu at a time.

Change-Id: Ibface5db4ea457417475a959943369aee38a04f9
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq.c: remove the strict checking feature
Arjan van de Ven [Fri, 15 Jul 2011 13:39:29 +0000 (14:39 +0100)]
sfi-cpufreq.c: remove the strict checking feature

the sfi-cpufreq.c driver has a "debug the hardware" feature where
it will check after entry if a P state was actually entered.
This is no longer needed, so lets remove the code.

Change-Id: I7700f6e28845085a54c771d1e880ea09d0605bab
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq: make use of rdmsr_on_cpu()
Arjan van de Ven [Fri, 15 Jul 2011 13:39:29 +0000 (14:39 +0100)]
sfi-cpufreq: make use of rdmsr_on_cpu()

The kernel has a function to read msr values on different cpus;
sfi-cpufreq has this open coded. By using rdmsr_on_cpu(),
several functions can just be removed.

Change-Id: Ib6740c5bffeb48cc295df1f11ce060dc9a796c5e
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq.c: remove some unused included
Arjan van de Ven [Fri, 15 Jul 2011 13:39:29 +0000 (14:39 +0100)]
sfi-cpufreq.c: remove some unused included

some of the #include'd headers were not used;
also reorder the #includes so that linux comes before asm and before local.

Change-Id: I34b83efe30771e6e4f050c7762874527383a8cbb
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi-cpufreq: use the generic mperf library
Arjan van de Ven [Fri, 15 Jul 2011 13:39:29 +0000 (14:39 +0100)]
sfi-cpufreq: use the generic mperf library

The kernel has a nice library for getting mperf/aperf data in cpufreq drivers.
This patch makes the sfi-cpufreq driver use this library.

Change-Id: I41a774ed83bb16c14409435e46308a75c6fcdfeb
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agosfi: Initial import of the SFI P state driver from the UMG 2.6.35 kernel git
Arjan van de Ven [Fri, 15 Jul 2011 13:39:28 +0000 (14:39 +0100)]
sfi: Initial import of the SFI P state driver from the UMG 2.6.35 kernel git

This patch is a pretty much straight import and port to 2.6.39 of the UMG
SFI P state driver. Cleanups to follow in later patches.

Change-Id: I2ad97eb2ad9fdc55c8deab7d1365bf36cfb8b91b
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agohack to compile re-vert and do better later
mgross [Wed, 20 Jul 2011 00:05:41 +0000 (17:05 -0700)]
hack to compile re-vert and do better later

Change-Id: I56a6db438004ddd2d1906df9b718846bd8adbf91

12 years agomrst: Don't do idle set up on non MRST hardware
Alan Cox [Fri, 15 Jul 2011 13:39:28 +0000 (14:39 +0100)]
mrst: Don't do idle set up on non MRST hardware

Change-Id: I4be71a25f7857d6c47f2ebe42566b18572ca353c
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agox86/mrst: Add platform data for Max3110 devices
Feng Tang [Fri, 15 Jul 2011 13:39:28 +0000 (14:39 +0100)]
x86/mrst: Add platform data for Max3110 devices

Those info will be used when spi controller driver setup
max3110 as a slave device

Change-Id: I20262ed7bca2d6ab52af8043e84787709d82e575
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
12 years agospi/spi-dw.h: Expose interface for platform code to register external CS
Dirk Brandewie [Fri, 15 Jul 2011 13:39:28 +0000 (14:39 +0100)]
spi/spi-dw.h: Expose interface for platform code to register external CS

Some platforms use a chip select mechanism other than that provided by
the controller.  Expose the mechanism for the platform code to
register the external chip select control function with the driver.

Change-Id: If2807645a629833ebd50bab9073c56d70ea1826d
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agospi-dw-pci: Add runtime power management
Dirk Brandewie [Fri, 15 Jul 2011 13:39:27 +0000 (14:39 +0100)]
spi-dw-pci: Add runtime power management

This patch adds runtime power management to the PCI variant of the
designware SPI host controller driver.

Change-Id: Id083e554248d4f0558108e6363d097ad306198ef
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agospi/spi-dw: Rework message processing
Dirk Brandewie [Fri, 15 Jul 2011 13:39:27 +0000 (14:39 +0100)]
spi/spi-dw: Rework message processing

This patch reworks the message pump worker thread function to run
    until all messages queued to the driver have been handled. The
    function to handle individual spi_transfers is now a synchronus
    function the tasklet to handle spi_transfers has been removed. Work
    for the worker thread is only queued in host controller transfer
    function.

    Psuedo code for new thread function:
      message = get_message()
      while (message){
        for_each_transfer_in_msg(message){
          transfer_setup(transfer)
          do_transfer()
        }
        complete_message()
        message = get_message()
      }

    Changes that fell out of the message thread changes:
    Non-DMA transfers that are larger than the size of the controller FIFO
    are handled as interrupt driven transfers.

    Common FIFO handling functions shared PIO and interrupt transfers.

    Simplified queue stop/start funcitons.

    Cleanup fixes:
    Changed exported all exported function names to have spi_dw_ prefix

    Set fifo lenght in dw_spi_mid_init()

    Added dw_spi_{en,dis}able inline functions to replace spi_enable_chip()
    Added dw_spi_{mask,umask}_intr inline functions

Change-Id: I6a5f015ff1dbfa5d41297ca4c37bd3fbd9859959
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agospi/spi-dw: Rename internal functions to match file naming convention.
Dirk Brandewie [Fri, 15 Jul 2011 13:39:27 +0000 (14:39 +0100)]
spi/spi-dw:  Rename internal functions to match file naming convention.

Rename internal functions and data structures to match file name
convention also change the Moorsetown {MRST/mrst} names to be generic
to the driver since the driver is in use in multiple SOC's.

Change-Id: I94fa9837b97fa42d5cc617c722f1fd8ebf61ac17
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agoconfig: Allow a Medfield selection
Alan Cox [Fri, 15 Jul 2011 13:39:35 +0000 (14:39 +0100)]
config: Allow a Medfield selection

We have nothing much Medfield specific - yet but this is the boiler plate for it

Allowing Medfield only does need one fix up for the idle driver - we want the
same idle behaviour as Moorestown but we don't have the PMU hook

Change-Id: I9e27ffb0c78e59a1beaf292971bc55517099b9ff
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agoconfig: Update dependancies for multi MID devices
Alan Cox [Fri, 15 Jul 2011 13:39:35 +0000 (14:39 +0100)]
config: Update dependancies for multi MID devices

We have some stuff shared between Moorestown and Medfield so mark the
Kconfig entries for them as requiring X86_INTEL_MID

Change-Id: I26b87b5e96264c4e0758465cc4f79947491f8b38
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agoconfig: introduce an INTEL_MID configuration
Alan Cox [Fri, 15 Jul 2011 13:39:35 +0000 (14:39 +0100)]
config: introduce an INTEL_MID configuration

We need to carve up the configuration between

- MID general
- Moorestown specific
- Medfield specific
- Future devices

As a base point create an INTEL_MID configuration property. We make the existing
MRST configuration a sub-option. This means that the rest of the kernel config
can still use X86_MRST checks without anything going backwards.

After this is merged future patches will tidy up which devices are MID and
which are X86_MRST, as well as add options for Medfield.

Change-Id: Idbe1121c0b7928273eeca7bb5494d9dff320eca1
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agoThis patch is based on umg's 2.6.35 kernel which adds support for
Alan Cox [Fri, 15 Jul 2011 13:40:05 +0000 (14:40 +0100)]
This patch is based on umg's 2.6.35 kernel which adds support for
a few new commands. It also has a few fixes and and adapt to the
upstram ipc driver structure.

key changes are:
- new ioctl commands to support fw upgrade and access to mip header,
  hand-off buffer and revision
- consolidated fw update logic with moorestown
- misc clean up such as uncessary header files, typos

the fw update flow has not been tested since scu fw support is not
officially released. there is also issue with the current userspace
utiltity which hardcoding search for ipcutil driver as misc char
driver. The overall firmware update flow between ipcutil driver and
userspace should be revisited in that it does not use the existing
request_firmware interface, instead it relies on ioctl calls specific
to the driver. This will likely to happen after fw update support is
in the official scu fw release.

Most ipc commands has been tested with success on iCDK, including
access to MSIC registers, vRTC, OSNIB read. But there are occasional
ipc command timeout on mip and vrtc access. needs futher investigation
with fw team.

Change-Id: I755b5b21b769180a33261e5be71a63e58ea88a1b
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agox86: rtc: Don't register a platform RTC device for Intel MID platforms
Mathias Nyman [Fri, 15 Jul 2011 13:39:53 +0000 (14:39 +0100)]
x86: rtc: Don't register a platform RTC device for Intel MID platforms

Intel MID x86 platforms have a memory mapped virtual RTC instead.
No MID platform have the default ports (and accessing them may do weird stuff)

Change-Id: I768f4918f485fa4fc7d27002a9ac2ed8eef6363c
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agomrst: Change early printk to depend on X86_INTEL_MID
Dirk Brandewie [Fri, 15 Jul 2011 13:39:36 +0000 (14:39 +0100)]
mrst: Change early printk to depend on X86_INTEL_MID

Moorestown and Medfield have the same SPI controller IP block.  Make
early printk support depend on the common X86_INTEL_MID config option.

Change-Id: I21c4c06d5b371a498e8a0ebce14d483aabc8cf2d
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agox86/mrst: Add support for Penwell clock calibration
Dirk Brandewie [Fri, 15 Jul 2011 13:39:23 +0000 (14:39 +0100)]
x86/mrst: Add support for Penwell clock calibration

Change-Id: Ib5ceb933b65bea16b622af6080a08c06224b4ea2
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agopmu: check if it is Moorestown
Alan Cox [Fri, 15 Jul 2011 13:39:23 +0000 (14:39 +0100)]
pmu: check if it is Moorestown

Enabling the Moorestown PMU regardless is rude, fix it

Change-Id: I2d5444760e9424f1fc3708d5f46abf20dddaf74e
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agoThe main thread is waiting on on a wait_queue but wake_up_process() is
Dirk Brandewie [Fri, 15 Jul 2011 13:39:23 +0000 (14:39 +0100)]
The main thread is waiting on on a wait_queue but wake_up_process() is
used to wake the thread. This reads weirdly. Change wake_up_process() to
wake_up().

Tested on the Moorestown tablet build

Change-Id: I780d3ec79cadfb936198a238aca54c517e02c484
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agomrst: added some platform data for board mm
Jekyll Lai [Fri, 15 Jul 2011 13:39:23 +0000 (14:39 +0100)]
mrst: added some platform data for board mm

Add SFI glue for the following devices:

tca6416: a gpio expander compatible with max7315
mpu3050: gyro sensor
ektf2136_spi: ektf2136 with spi interface

[Not all upstream so not yet submittable]

Change-Id: I8c343ccf52afea3c1e152017f10837a43f5c328f
Signed-off-by: Jekyll Lai <jekyll_lai@wistron.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agoMoorestown platform uses IPC commands to perform power off and
Jacob Pan [Fri, 15 Jul 2011 13:39:22 +0000 (14:39 +0100)]
Moorestown platform uses IPC commands to perform power off and
reboot action, based on the IPC command FW will take different
boot path.

Change-Id: Ic25ed4144f648557953a17196932a5a61e355ef0
Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agovrtc: change its year offset from 1960 to 1972
Feng Tang [Fri, 15 Jul 2011 13:39:22 +0000 (14:39 +0100)]
vrtc: change its year offset from 1960 to 1972

Real world year equals the value in vrtc YEAR register plus an offset.
We used 1960 as the offset to make leap year consistent, but for a
device's first use, its YEAR register is 0 and the system year will
be parsed as 1960 which is not a valid UNIX time and will cause many
applications to fail mysteriously. So use 1972 instead to fix this
issue.

Updated patch which adds a sanity check suggested by Mathias

Change-Id: I521271ac79b5657e9b9eb4a81fe6b2e5f5e94e0b
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agopmu: Fixup build
Alan Cox [Fri, 15 Jul 2011 13:39:21 +0000 (14:39 +0100)]
pmu: Fixup build

Quick build fixup for 2.6.39

Change-Id: I16104ec4c6d4e3e19d0429c48a9cbf44484e7faf

12 years agomrst/pmu: workaround for SD HC2 bug in SCU fw
Yong Wang [Fri, 15 Jul 2011 13:39:21 +0000 (14:39 +0100)]
mrst/pmu: workaround for SD HC2 bug in SCU fw

Langwell C0 added a new SD host controller. However, SCU fw has not
been updated yet to support SD HC2. s0i3 will always be blocked before
that is fixed and this patch serves as a workaround before the fw fix
is available.

Change-Id: Idd7a9fdba8e7be1882e6cbb63057f2152331539b
Signed-off-by: Yong Wang <yong.y.wang@intel.com>
12 years agox86/mrst/pci: assign d3_delay to 0 for
Jacob Pan [Fri, 15 Jul 2011 13:39:37 +0000 (14:39 +0100)]
x86/mrst/pci: assign d3_delay to 0 for

Langwell devices are not true pci devices, they are not subject to the 10 ms
d3 to d0 delay required by pci spec. This patch assigns d3_delay to 0 for all
langwell pci devices.

Change-Id: I2d1e2f3c4773ad80582aa0d0185ee37829200e0c
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agomrst-pci: power off some unused devices
Kristen Carlson Accardi [Fri, 15 Jul 2011 13:39:21 +0000 (14:39 +0100)]
mrst-pci: power off some unused devices

For devices which we are not using on Moorestown, send D3 request.

Change-Id: Ie4873da261f3409efa988fbc2a70ea7314f9457f
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agopmu: bugfix for checking pci_state
Kristen Carlson Accardi [Fri, 15 Jul 2011 13:39:21 +0000 (14:39 +0100)]
pmu: bugfix for checking pci_state

Check to make sure new requested pci_state is larger than existing
state, not smaller.

Change-Id: Ic323a024d0da89873d5601750f5622cdeec489c7
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
12 years agopmu: fix kernel panic on for_each_pci_dev
Jekyll Lai [Fri, 15 Jul 2011 13:39:20 +0000 (14:39 +0100)]
pmu: fix kernel panic on for_each_pci_dev

Setting pdev initial value to NULL in order to avoid kernel panic
in "for_each_pci_dev()."

Change-Id: I5970ec466c645bf3ebd168b973ccb612dbd424e3
Signed-off-by: Jekyll Lai <jekyll_lai@wistron.com>
12 years agomrst: Add pmu driver, s0i3 support
Len Brown [Fri, 15 Jul 2011 13:39:20 +0000 (14:39 +0100)]
mrst: Add pmu driver, s0i3 support

(todo: split into multiple patches)

The Moorestown (MRST) Power Management Unit (PMU) driver
directs the SOC power states in the "Langwell" south complex (SCU).
It hooks pci_platform_pm_ops[] and thus observes all PCI .set_state
requests.  For devices in the SC, the pmu driver translates those
PCI requests into the appropriate commands for the SCU.

The PMU driver helps implement S0i3, a deep system idle power idle state.
Entry into S0i3 is via cpuidle, just like regular processor c-states.
S0i3 depends on pre-conditions including uni-processor, graphics off,
and certain IO devices in the SC must be off.  If those pre-conditions
are met, then the PMU allows cpuidle to enter S0i3, otherwise such requests
are demoted to Atom C6.

This driver is based on original prototype work by Bruce Flemming,
Illyas Mansoor, Rajeev D. Muralidhar and Vishwesh M. Rudramuni.
It includes contributions from H. Peter Anvin, Arjan van de Ven and Yong Wang.

Change-Id: I8a3cb79cdc5a671bac9ff2b7eff15dcd1c5f0149
Signed-off-by: Len Brown <len.brown@intel.com>
12 years agox86, mrst: Some drivers need to known when an SCU is available
Alan Cox [Fri, 15 Jul 2011 13:39:19 +0000 (14:39 +0100)]
x86, mrst: Some drivers need to known when an SCU is available

Add a notifier so that drivers can hook into SCU availability in order to
take actions post initialisation when/if the SCU becomes available.

In the ideal world we wouldn't need this and we could avoid any init
dependancies of this form, but in practice we can't do it for some cases.

Change-Id: I8504ff8fac5e8f3ac680aaf2f5334a8284af70c2
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agox86, mrst: change the pmic_gpio device type to IPC
Feng Tang [Fri, 15 Jul 2011 13:39:19 +0000 (14:39 +0100)]
x86, mrst: change the pmic_gpio device type to IPC

In latest firmware's SFI tables, pmic_gpio has been set to
IPC type of device, so we need handle it too.

Change-Id: Ib34b6cc0029b431efde27527487ba968610e0bdd
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agox86/apic: allow use of lapic timer early calibration result
Jacob Pan [Fri, 15 Jul 2011 13:39:17 +0000 (14:39 +0100)]
x86/apic: allow use of lapic timer early calibration result

lapic timer calibration can be combined with tsc in platform specific
calibration functions. if such calibration result is obtained early,
we can skip the redundant calibration loops.

Change-Id: Ib3e4d7ad168172191ff47f3db4368f9869f6ce68
Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
12 years agox86/apic: do not clear nr_irqs_gsi if no legacy irqs
Jacob Pan [Fri, 15 Jul 2011 13:39:07 +0000 (14:39 +0100)]
x86/apic: do not clear nr_irqs_gsi if no legacy irqs

nr_legacy_irqs is set in probe_nr_irqs_gsi, we should not clear it after that.
Otherwise, the result is that MSI irqs will be allocated from the wrong range
for the systems without legacy PIC.

Change-Id: Ib73f1de23d34cf5b8b549d43c371d7d8a58ecb52
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
12 years agox86/mrst: set ISA bus type for fake MP IRQs
Jacob Pan [Fri, 15 Jul 2011 13:39:06 +0000 (14:39 +0100)]
x86/mrst: set ISA bus type for fake MP IRQs

We use MP IRQs for SFI presented timer interrupts, we should also set
mp_bus_not_pci for MP_ISA_BUS so that pin_2_irq mapping is correct.

Change-Id: I04353760d0930d5276d4087245516bacd40a5f2f
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
12 years agox86/ioapic: use legacy_pic to set correct gsi-irq mapping
Jacob Pan [Fri, 15 Jul 2011 13:39:06 +0000 (14:39 +0100)]
x86/ioapic: use legacy_pic to set correct gsi-irq mapping

Using compile time NR_LEGACY_IRQS causes the wrong gsi-irq mapping on
non-PC platforms, such as Moorestown. This patch uses legacy_pic abstraction
to set the correct number of legacy interrupts at runtime. For Moorestown,
nr_legacy_irqs = 0. We have 1:1 mapping for gsi-irq even within the legacy
irq range.

Change-Id: I3ab904292f1270677a55a08a4c1134681a2efd50
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
12 years agox86/platform: add a wallclock_init func to x86_platforms ops
Feng Tang [Fri, 15 Jul 2011 13:39:06 +0000 (14:39 +0100)]
x86/platform: add a wallclock_init func to x86_platforms ops

Some wall clock devices use MMIO based HW register, this new function will
give them a chance to do some initialization work before their get/set_time
service get called.

Change-Id: I81370ba54d6a3ec37b1ed57a0b177c9c951a6c13
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
12 years agointel_mid_ssp_spi: Moorestown and Medfield SPI for SSP devices
Mathieu SOULARD [Fri, 15 Jul 2011 13:38:51 +0000 (14:38 +0100)]
intel_mid_ssp_spi:  Moorestown and Medfield SPI for SSP devices

This driver is a fusion of various internal drivers into a single
driver for the SPI slave/master on the Intel Moorestown and Medfield
SSP devices.

Change-Id: Ie0efd26c3b4664334c768b7a284ebb2b0e9c47f3
Signed-off-by: Mathieu SOULARD <mathieux.soulard@intel.com>
[Ported to the -next tree DMA engine]
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agointel_scu_ipc_utils: Support for reflashing Medfield firmware
Sudha Krishnakumar [Fri, 15 Jul 2011 13:38:51 +0000 (14:38 +0100)]
intel_scu_ipc_utils: Support for reflashing Medfield firmware

Initial flashing support. This will change before any production release.

Change-Id: I563bd1c2385ef504f9292edc7c3adf73e6866d2a
Signed-off-by: Sudha Krishnakumar <sudha.krishnakumar@intel.com>
[Tidied up the bracketing and some oddments]
Signed-off-by: Alan Cox <alan@linux.intel.com>
12 years agoRemove ARM dependencies in alarm
Fei Yang [Mon, 18 Jul 2011 21:33:27 +0000 (14:33 -0700)]
Remove ARM dependencies in alarm

Change-Id: I316548e98f0281e98f2153e0616e2ad2d4d4545f

12 years agofix missing export that breaks cpufreq built as module
mgross [Mon, 18 Jul 2011 23:44:32 +0000 (16:44 -0700)]
fix missing export that breaks cpufreq built as module

Change-Id: I387431accb0177c97298f28fc9d5498cc5a3032e

12 years agofix poortly maintained compass driver from google
mgross [Mon, 18 Jul 2011 21:52:36 +0000 (14:52 -0700)]
fix poortly maintained compass driver from google

Change-Id: I315924931144545e9c1aff043c7b81114f0b13ee

12 years agoupdate with proper console locking in un-maintained android code
mgross [Mon, 18 Jul 2011 21:24:32 +0000 (14:24 -0700)]
update with proper console locking in un-maintained android code

Change-Id: If0b845548eff9baac0ccfcaf52613e6276d9f544

12 years agofix android added armisms in alarm code
mgross [Mon, 18 Jul 2011 21:13:17 +0000 (14:13 -0700)]
fix android added armisms in alarm code

Change-Id: I9a5bd859b0c49071e79a24e9582e43415adda843

12 years agoinput: gpio_input: don't print debounce message unless flag is set
Dima Zavin [Tue, 8 Nov 2011 21:03:11 +0000 (13:03 -0800)]
input: gpio_input: don't print debounce message unless flag is set

Change-Id: I29ccb32e795c5c3e4c51c3d3a209f5b55dfd7d94
Signed-off-by: Dima Zavin <dima@android.com>
12 years agonet: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
Dmitry Shmidt [Fri, 4 Nov 2011 18:10:04 +0000 (11:10 -0700)]
net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
Dmitry Shmidt [Fri, 4 Nov 2011 18:08:37 +0000 (11:08 -0700)]
net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Improve suspend/resume processing
Dmitry Shmidt [Wed, 2 Nov 2011 23:51:29 +0000 (16:51 -0700)]
net: wireless: bcmdhd: Improve suspend/resume processing

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Check if FW is Ok for internal FW call
Dmitry Shmidt [Wed, 2 Nov 2011 22:06:14 +0000 (15:06 -0700)]
net: wireless: bcmdhd: Check if FW is Ok for internal FW call

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agotcp: Don't nuke connections for the wrong protocol
Lorenzo Colitti [Fri, 4 Nov 2011 00:05:11 +0000 (17:05 -0700)]
tcp: Don't nuke connections for the wrong protocol

Currently, calling tcp_nuke_addr to reset IPv6 connections
resets IPv4 connections as well, because all Android
framework sockets are dual-stack (i.e., IPv6) sockets, and
we don't check the source address to see if the connection
was in fact an IPv4 connection.

Fix this by checking the source address and not resetting
the connection if it's a mapped address.

Also slightly tweak the IPv4 code path, which doesn't check
for mapped addresses either. This was not causing any
problems because tcp_is_local normally always returns true
for LOOPBACK4_IPV6 (127.0.0.6), because the loopback
interface is configured as as 127.0.0.0/8. However,
checking explicitly for LOOPBACK4_IPV6 makes the code a bit
more robust.

Bug: 5535055
Change-Id: I4d6ed3497c5b8643c864783cf681f088cf6b8d2a
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
12 years agoARM: common: fiq_debugger: make uart irq be no_suspend
Dima Zavin [Thu, 27 Oct 2011 23:31:24 +0000 (16:31 -0700)]
ARM: common: fiq_debugger: make uart irq be no_suspend

Change-Id: I8e3d2a95c0ddc2706b021cd33534fe2fd302268e
Signed-off-by: Dima Zavin <dima@android.com>
12 years agonet: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
Dmitry Shmidt [Fri, 28 Oct 2011 17:35:37 +0000 (10:35 -0700)]
net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agomm: avoid livelock on !__GFP_FS allocations
Mel Gorman [Mon, 24 Oct 2011 23:33:42 +0000 (16:33 -0700)]
mm: avoid livelock on !__GFP_FS allocations

Under the following conditions, __alloc_pages_slowpath can loop
forever:
gfp_mask & __GFP_WAIT is true
gfp_mask & __GFP_FS is false
reclaim and compaction make no progress
order <= PAGE_ALLOC_COSTLY_ORDER

The gfp conditions are normally invalid, because !__GFP_FS
disables most of the reclaim methods that __GFP_WAIT would
wait for.  However, these conditions happen very often during
suspend and resume, when pm_restrict_gfp_mask() effectively
converts all GFP_KERNEL allocations into __GFP_WAIT.

The oom killer is not run because gfp_mask & __GFP_FS is false,
but should_alloc_retry will always return true when order is less
than PAGE_ALLOC_COSTLY_ORDER.  __alloc_pages_slowpath will
loop forever between the rebalance label and should_alloc_retry,
unless another thread happens to release enough pages to satisfy
the allocation.

Add a check to detect when PM has disabled __GFP_FS, and do not
retry if reclaim is not making any progress.

[taken from patch on lkml by Mel Gorman, commit message by ccross]
Change-Id: I864a24e9d9fd98bd0e3d6e9c1e85b6c1b766850e
Signed-off-by: Colin Cross <ccross@android.com>
12 years agommc: block: Improve logging of handling emmc timeouts
Ken Sumrall [Wed, 26 Oct 2011 01:16:58 +0000 (18:16 -0700)]
mmc: block: Improve logging of handling emmc timeouts

Add some logging to make it clear just how the emmc timeout
was handled.

Change-Id: Id33fd28d8b9778dc4e85db829e2637a328eddab4
Signed-off-by: Ken Sumrall <ksumrall@android.com>
12 years agommc: block: add checking of r/w command response
Russell King - ARM Linux [Mon, 20 Jun 2011 19:10:49 +0000 (20:10 +0100)]
mmc: block: add checking of r/w command response

Check the status bits in the r/w command response for any errors.
If error bits are set, then we won't have seen any data transferred,
so it's pointless doing any further checking.

Change-Id: If118a4bcbb0e57a7d95b5e40d662fca87fdcba7f
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: block: improve error recovery from command channel errors
Russell King - ARM Linux [Mon, 20 Jun 2011 19:10:28 +0000 (20:10 +0100)]
mmc: block: improve error recovery from command channel errors

Command channel errors fall into four classes:

1. The command was issued with the card in the wrong state
2. The command failed to be received by the card correctly
3. The cards response failed to be received by the host (CRC error)
4. The card failed to respond to the card

For (1), in theory we should know that the card is in the correct state.
However, a failed stop command (or other failure) may result in the card
remaining in a data transfer state from the previous command.  If we
detect this condition, we try to recover by sending a stop command.

For the initial commands (set block count and the read/write command)
no data will have been transferred.  All that we need deal with is
retrying at this point.  A failed stop command can be remedied as
above.

If we are unable to recover the card (eg, the card ignores our requests
for status, or we don't recognise the error code) then we immediately
fail the request.

Change-Id: Ief109a57fd21a247381b38f1164c22f0344f0284
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: block: allow get_card_status() to return error status
Russell King - ARM Linux [Mon, 20 Jun 2011 19:10:08 +0000 (20:10 +0100)]
mmc: block: allow get_card_status() to return error status

If the MMC_SEND_STATUS command is not successful, we should not return
a zero status word, but instead allow the caller to know positively
that an error occurred.

Convert the open-coded get_card_status() to use the helper function,
and provide definitions for the card state field.

Change-Id: Icfd6258af78a89c21abac386c556153fa3fac364
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agonet: wireless: bcm4329: Prohibit FW access in case of FW crash
Dmitry Shmidt [Wed, 26 Oct 2011 20:57:26 +0000 (13:57 -0700)]
net: wireless: bcm4329: Prohibit FW access in case of FW crash

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Adjust scan parameters for wl_cfg80211_connect()
Dmitry Shmidt [Wed, 26 Oct 2011 19:22:25 +0000 (12:22 -0700)]
net: wireless: bcmdhd: Adjust scan parameters for wl_cfg80211_connect()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Update to version 5.90.125.94
Dmitry Shmidt [Tue, 25 Oct 2011 23:32:46 +0000 (16:32 -0700)]
net: wireless: bcmdhd: Update to version 5.90.125.94

- Fix WFD interface removal
- Fix profile update
- Keep same mode for softap or WFD during early suspend
- Add dhd_console_ms parameter access

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoARM: common: fiq_debugger: protect the uart state from the sleep timer
Dima Zavin [Fri, 14 Oct 2011 05:38:45 +0000 (22:38 -0700)]
ARM: common: fiq_debugger: protect the uart state from the sleep timer

Change-Id: I6b834d5cab96c3466042f758feb69eae6893ec49
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoARM: common: fiq_debugger: add suspend/resume handlers
Dima Zavin [Mon, 10 Oct 2011 22:24:34 +0000 (15:24 -0700)]
ARM: common: fiq_debugger: add suspend/resume handlers

Change-Id: If6eb75059fdf4867eb9a974d60b9d50e5e3350d4
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoARM: common: fiq_debugger: add uart_enable/disable platform callbacks
Dima Zavin [Wed, 5 Oct 2011 21:08:20 +0000 (14:08 -0700)]
ARM: common: fiq_debugger: add uart_enable/disable platform callbacks

This allows the platform specific drivers to properly enable
and disable the uart at the appropriate times. On some platforms, just
managing the clock is not enough.

Change-Id: I5feaab04cfe313a4a9470ca274838676b9684201
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoARM: common: fiq_debugger: add non-fiq debugger support
Dima Zavin [Mon, 3 Oct 2011 03:35:47 +0000 (20:35 -0700)]
ARM: common: fiq_debugger: add non-fiq debugger support

Add irq-only support to the debugger. This allows the debugger
to always run at irq context. This introduces limitations to
being able to debug certain kinds of issues, but it is still
very useful as a debugging tool.

Change-Id: I1e4223e886cb2d90ef5ed31419bdd5cdd7f904ca
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoARM: common: fiq_debugger: peek the 0th char in ringbuf
Dima Zavin [Wed, 26 Oct 2011 04:24:10 +0000 (21:24 -0700)]
ARM: common: fiq_debugger: peek the 0th char in ringbuf

ringbuf_consume advances the tail ptr, so peek should always
just peek at offset 0

Change-Id: I8d3d22d2ec1e563d73b53ccbad302e6d74e64e53
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoARM: common: fiq_debugger: fix the cleanup on errors in probe
Dima Zavin [Thu, 20 Oct 2011 21:48:37 +0000 (14:48 -0700)]
ARM: common: fiq_debugger: fix the cleanup on errors in probe

Change-Id: I58bd0604c0520b13e11bf02836eb4ddbadba1372
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoARM: common: fiq_debugger: do not disable debug when console is enabled
Dima Zavin [Sun, 9 Oct 2011 18:47:35 +0000 (11:47 -0700)]
ARM: common: fiq_debugger: do not disable debug when console is enabled

Change-Id: I5f8074a860f9b143ee0c87296683bbf2cffb5a36
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoram_console: pass in a boot info string
Colin Cross [Tue, 25 Oct 2011 21:31:58 +0000 (14:31 -0700)]
ram_console: pass in a boot info string

Allow the board file to pass a boot info string through the
platform data that is appended to the /proc/last_kmsg file.

Change-Id: I37065fafb09676085465c93384d8e176fdd942d6
Signed-off-by: Colin Cross <ccross@android.com>
12 years agonet: wireless: bcmdhd: Fix crash in p2p OFF
Dmitry Shmidt [Thu, 20 Oct 2011 20:45:57 +0000 (13:45 -0700)]
net: wireless: bcmdhd: Fix crash in p2p OFF

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoARM: smpboot: Enable irqs on secondary CPU after marking it online/active
Thomas Gleixner [Sat, 15 Oct 2011 00:22:43 +0000 (17:22 -0700)]
ARM: smpboot: Enable irqs on secondary CPU after marking it online/active

Patch is the last version from tglx on Oct 7.

Discussion is at: http://comments.gmane.org/gmane.linux.ports.arm.kernel/131919

The original commit message for the first patch version:

Frank Rowand reported:

 I have a consistent (every boot) hang on boot with the RT patches.
 With a few hacks to get console output, I get:

  rcu_preempt_state detected stalls on CPUs/tasks

 I have also replicated the problem on the ARM RealView (in tree) and
 without the RT patches.

 The problem ended up being caused by the allowed cpus mask being set
 to all possible cpus for the ksoftirqd on the secondary processors.
 So the RCU softirq was never executing on the secondary cpu.

 The problem was that ksoftirqd was woken on the secondary processors before
 the secondary processors were online. This led to allowed cpus being set
 to all cpus.

   wake_up_process()
      try_to_wake_up()
         select_task_rq()
            if (... || !cpu_online(cpu))
               select_fallback_rq(task_cpu(p), p)
                  ...
                  /* No more Mr. Nice Guy. */
                  dest_cpu = cpuset_cpus_allowed_fallback(p)
                     do_set_cpus_allowed(p, cpu_possible_mask)
                        #  Thus ksoftirqd can now run on any cpu...
</report>

The reason is that the ARM SMP boot code for the secondary CPUs enables
interrupts before the newly brought up CPU is marked online and
active.

That causes a wakeup of ksoftirqd or a wakeup of any other kernel
thread which is affine to the brought up CPU break that threads
affinity and therefor being scheduled on already online CPUs.

This problem has been observed on x86 before and the only solution is
to mark the CPU online and wait for the CPU active bit before the
point where interrupts are enabled.

Change-Id: If948ef52d434191579e1ca95d18d0c50e91a03b9
Signed-off-by: Dima Zavin <dima@android.com>
12 years agoARM: smp: implement arch_trigger_all_cpus_backtrace using IPI
Dima Zavin [Tue, 18 Oct 2011 23:59:54 +0000 (16:59 -0700)]
ARM: smp: implement arch_trigger_all_cpus_backtrace using IPI

Based on a rough patch by frank.rowand@am.sony.com

Since ARM doesn't have an NMI (fiq's are not always available),
send an IPI to all other CPUs (current cpu prints the stack directly)
to capture a backtrace.

Change-Id: I8b163c8cec05d521b433ae133795865e8a33d4e2
Signed-off-by: Dima Zavin <dima@android.com>
12 years agopower: cpufreq interactive governor: use default sample time 20ms
Todd Poynor [Wed, 19 Oct 2011 20:12:10 +0000 (13:12 -0700)]
power: cpufreq interactive governor: use default sample time 20ms

Lower the default time at which a higher speed is allowed to run
before lowering based on lower CPU load from 80ms to 20ms.  Most
Android devices should trade power for performance here,
although tablets and non-battery-powered devices may want to
override this default.

Change-Id: I1a4f7faeca12793c51d5b92db30a63cca8d4f1be
Signed-off-by: Todd Poynor <toddpoynor@google.com>
12 years agonet: wireless: bcmdhd: Add wake_lock to dhd_open() and dhd_stop()
Dmitry Shmidt [Wed, 19 Oct 2011 20:45:56 +0000 (13:45 -0700)]
net: wireless: bcmdhd: Add wake_lock to dhd_open() and dhd_stop()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Fix bssid profile update
Dmitry Shmidt [Wed, 19 Oct 2011 20:09:49 +0000 (13:09 -0700)]
net: wireless: bcmdhd: Fix bssid profile update

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: Fix CFG80211_ALLOW_RECONNECT option for disconnect
Dmitry Shmidt [Tue, 18 Oct 2011 19:30:02 +0000 (12:30 -0700)]
net: wireless: Fix CFG80211_ALLOW_RECONNECT option for disconnect

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agocpufreq: interactive governor: default timer 10ms, maxspeed load 95%
Todd Poynor [Mon, 17 Oct 2011 05:40:29 +0000 (22:40 -0700)]
cpufreq: interactive governor: default timer 10ms, maxspeed load 95%

Modify default timer from 30ms to 10ms, sampling 2 jiffies after
idle exit on ARM as in Honeycomb.

Modify default go_maxspeed_load from 85% loaded to 95% loaded, for
use in phones where power savings is more important (tablets may be
best served overriding this).

Change-Id: I3361a6279979bfae1df5262666a2e30ea7a44328
Signed-off-by: Todd Poynor <toddpoynor@google.com>
12 years agonet: wireless: bcmdhd: Add proper cleaning for ap_info structure
Dmitry Shmidt [Mon, 17 Oct 2011 00:12:29 +0000 (17:12 -0700)]
net: wireless: bcmdhd: Add proper cleaning for ap_info structure

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Send cfg80211_disconnected() if fails to get rssi
Dmitry Shmidt [Mon, 17 Oct 2011 00:05:54 +0000 (17:05 -0700)]
net: wireless: bcmdhd: Send cfg80211_disconnected() if fails to get rssi

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonetfilter: xt_qtaguid: fix crash on ctrl delete command
JP Abgrall [Sat, 8 Oct 2011 05:14:24 +0000 (22:14 -0700)]
netfilter: xt_qtaguid: fix crash on ctrl delete command

Because for now the xt_qtaguid module allows procs to use tags without
having /dev/xt_qtaguid open, there was a case where it would try
to delete a resources from a list that was proc specific.
But that resource was never added to that list which is only
used when /dev/xt_qtaguid has been opened by the proc.

Once our userspace is fully updated, we won't need those exceptions.

Change-Id: Idd4bfea926627190c74645142916e10832eb2504
Signed-off-by: JP Abgrall <jpa@google.com>
12 years agobridge: Have tx_bytes count headers like rx_bytes.
Ashish Sharma [Sat, 8 Oct 2011 00:54:16 +0000 (17:54 -0700)]
bridge: Have tx_bytes count headers like rx_bytes.

Since rx_bytes accounting does not include Ethernet Headers in
br_input.c, excluding ETH_HLEN on the transmit path for consistent
measurement of packet length on both the Tx and Rx chains.

The clean way would be for Rx to include the eth header, but the
skb len has already been adjusted by the time the br code sees the skb.
This is only a temporary workaround until we can completely ignore or
cleanly fix the skb->len handling.

Change-Id: I910de95a4686b2119da7f1f326e2154ef31f9972
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
12 years agonetfilter: xt_qtaguid: Fix the stats info display order
Ashish Sharma [Tue, 4 Oct 2011 20:11:47 +0000 (13:11 -0700)]
netfilter: xt_qtaguid: Fix the stats info display order

Change-Id: I3bf165c31f35a6c7dc212f23df5eefaeb8129d0d
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
12 years agonet: wireless: bcmdhd: Use spin_lock_irqsave instead of spin_lock_irq
Dmitry Shmidt [Wed, 5 Oct 2011 17:57:54 +0000 (10:57 -0700)]
net: wireless: bcmdhd: Use spin_lock_irqsave instead of spin_lock_irq

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Fix event thread termination in case of empty queue
Dmitry Shmidt [Wed, 5 Oct 2011 17:48:59 +0000 (10:48 -0700)]
net: wireless: bcmdhd: Fix event thread termination in case of empty queue

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Improve join functionality
Dmitry Shmidt [Tue, 4 Oct 2011 20:42:24 +0000 (13:42 -0700)]
net: wireless: bcmdhd: Improve join functionality

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>