Commit Graph

492 Commits

Author SHA1 Message Date
Rohit Vaswani
a76e99abc5 Merge branch 'Linux 3.0.21' into msm-3.0
Merge Upstream's stable 3.0.21 branch into msm-3.0
This consists 814 commits and some merge conflicts.

The merge conflicts are because of some local changes to
msm-3.0 as well as some conflicts between google's tree and
the upstream tree.

Conflicts:
	arch/arm/kernel/head.S
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/mmc/core/core.c
	drivers/tty/serial/serial_core.c
	drivers/usb/host/ehci-hub.c
	drivers/usb/serial/qcserial.c
	fs/namespace.c
	fs/proc/base.c

Change-Id: I62e2edbe213f84915e27f8cd6e4f6ce23db22a21
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2012-03-30 00:09:34 -07:00
Rohit Vaswani
d4e3d52392 Merge branch 'google-android' into msm-3.0
Merge Google's Android tree into msm-3.0
This consists of the following conflicts and 42 commits:

Conflicts:
	drivers/mmc/core/bus.c
	drivers/rtc/class.c
	drivers/usb/gadget/android.c

Most of the conflicts stem from the changes made to the
local msm-3.0 branch.

commit 1f8c5cecfe
Author: Heiko Stuebner <heiko@sntech.de>
Date:   Wed Feb 1 10:33:01 2012 -0800

    Input: evdev - fix variable initialisation

    Commit 509f87c5f564 (evdev - do not block waiting for an event if
    fd
    is nonblock) created a code path were it was possible to use retval
    uninitialized.

    This could lead to the xorg evdev input driver getting corrupt data
    and refusing to work with log messages like
    	AUO-Pixcir touchscreen: Read error: Success
    	sg060_keys: Read error: Success
    	AUO-Pixcir touchscreen: Read error: Success
    	sg060_keys: Read error: Success
    (for drivers auo-pixcir-ts and gpio-keys).

    Signed-off-by: Heiko Stuebner <heiko@sntech.de>

 drivers/input/evdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 4dc43d7079
Author: Arve Hjønnevåg <arve@android.com>
Date:   Fri Oct 17 15:20:55 2008 -0700

    Input: evdev - Add ioctl to block suspend while event queue is not empty.

    Add an ioctl, EVIOCSSUSPENDBLOCK, to enable a wakelock that will block
    suspend while the event queue is not empty. This allows userspace code to
    process input events while the device appears to be asleep.

    The current code holds the wakelock for up 5 seconds for every input
    device and client. This can prevent suspend if sensor with a high data
    rate is active, even when that sensor is not capable of waking the
    device once it is suspended.

    Change-Id: I624d66ef30a0b3abb543685c343382b8419b42b9
    Signed-off-by: Arve Hjønnevåg <arve@android.com>

 drivers/input/evdev.c |   53 +++++++++++++++++++++++++++++++++++++++++++-----
 include/linux/input.h |    3 ++
 2 files changed, 50 insertions(+), 6 deletions(-)

commit 7cc846069a
Author: Arve Hjønnevåg <arve@android.com>
Date:   Mon Jan 23 17:15:45 2012 -0800

    Input: evdev - Don't hold wakelock when no data is available to user-space

    If there is no SYN_REPORT event in the buffer the buffer data is invisible
    to user-space. The wakelock should not be held in this case.

    Change-Id: Idae890ff0da8eb46a2cfce61a95b3a97252551ad
    Signed-off-by: Arve Hjønnevåg <arve@android.com>

 drivers/input/evdev.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

commit 0e80804a2e
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Jan 31 11:06:23 2012 -0800

    net: wireless: bcmdhd: Increase pm_notify callback priority

    Make pm_notify callback to be called the first on suspend/resume path to
    ensure it will always be called.

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

 drivers/net/wireless/bcmdhd/dhd_linux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit dfc896e1c8
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Mon Jan 30 15:43:31 2012 -0800

    net: wireless: bcmdhd: Fix crash on dhdsdio_probe_attach() failure

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

 drivers/net/wireless/bcmdhd/dhd_linux.c |   17 ++++++++++++++---
 drivers/net/wireless/bcmdhd/dhd_sdio.c  |    8 +++++++-
 2 files changed, 21 insertions(+), 4 deletions(-)

commit 256a6b23be
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Mon Jan 30 13:03:19 2012 -0800

    net: wireless: bcmdhd: Daemonize wl_event_handler

    Daemonizing makes thread (besides other things) NON-FREEZABLE, and it will not
    get fake signal on suspend to quicl down_interruptible()

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

 drivers/net/wireless/bcmdhd/dhd_linux.c        |   13 -------------
 drivers/net/wireless/bcmdhd/include/linuxver.h |   12 ++++++++++++
 drivers/net/wireless/bcmdhd/wl_cfg80211.c      |    3 +++
 3 files changed, 15 insertions(+), 13 deletions(-)

commit ff93146589
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Jan 24 13:59:40 2012 -0800

    net: wireless: bcmdhd: Update to Version 5.90.195.23

    - WFD fixes

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

 drivers/net/wireless/bcmdhd/dhd_cfg80211.c    |  269 -------------------------
 drivers/net/wireless/bcmdhd/dhd_linux.c       |    2 +-
 drivers/net/wireless/bcmdhd/dhd_sdio.c        |    8 +-
 drivers/net/wireless/bcmdhd/include/epivers.h |    8 +-
 drivers/net/wireless/bcmdhd/siutils.c         |    5 +
 drivers/net/wireless/bcmdhd/wl_cfg80211.c     |  223 +++++++++++++++------
 drivers/net/wireless/bcmdhd/wl_cfgp2p.c       |  175 ++++++++++++++++-
 drivers/net/wireless/bcmdhd/wl_cfgp2p.h       |   37 ++--
 8 files changed, 368 insertions(+), 359 deletions(-)

commit 96034c2006
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Jan 24 13:55:00 2012 -0800

    net: wireless: bcmdhd: Update to Version 5.90.195.22

    - Disable Ad-hoc support for cfg80211
    - dhd_linux.c: Fix incorrect pid check
    - Merge Android changes from Android tree

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

 drivers/net/wireless/bcmdhd/bcmsdh_linux.c       |   24 ++------------------
 drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c |   25 +++++++++++++++------
 drivers/net/wireless/bcmdhd/dhd_linux.c          |   10 ++++----
 drivers/net/wireless/bcmdhd/dhd_sdio.c           |   11 +++++++--
 drivers/net/wireless/bcmdhd/hndpmu.c             |   16 ++++++++++++++
 drivers/net/wireless/bcmdhd/include/bcmdevs.h    |    2 +
 drivers/net/wireless/bcmdhd/include/epivers.h    |    8 +++---
 drivers/net/wireless/bcmdhd/siutils.c            |    3 ++
 drivers/net/wireless/bcmdhd/wl_cfg80211.c        |   11 ++++++++-
 9 files changed, 68 insertions(+), 42 deletions(-)

commit 494661a1ac
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Jan 24 13:47:47 2012 -0800

    net: wireless: bcmdhd: Update to Version 5.90.195.19

    - Add WFD changes
    - Add extra locking for internal ioctl operations

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

 drivers/net/wireless/bcmdhd/Makefile               |    4 +-
 drivers/net/wireless/bcmdhd/bcmsdh_linux.c         |   25 +-
 drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c         |    4 +-
 drivers/net/wireless/bcmdhd/dhd.h                  |   10 +-
 drivers/net/wireless/bcmdhd/dhd_cdc.c              |    7 +-
 drivers/net/wireless/bcmdhd/dhd_cfg80211.c         |  862 ++++++++
 drivers/net/wireless/bcmdhd/dhd_cfg80211.h         |   42 +
 drivers/net/wireless/bcmdhd/dhd_common.c           |    7 +-
 drivers/net/wireless/bcmdhd/dhd_linux.c            |  103 +-
 drivers/net/wireless/bcmdhd/dhd_linux_mon.c        |  409 ----
 drivers/net/wireless/bcmdhd/dhd_sdio.c             |    4 +-
 drivers/net/wireless/bcmdhd/include/dhdioctl.h     |    3 +-
 drivers/net/wireless/bcmdhd/include/epivers.h      |    8 +-
 drivers/net/wireless/bcmdhd/include/proto/802.11.h |   12 +-
 drivers/net/wireless/bcmdhd/include/wlioctl.h      |   19 +-
 drivers/net/wireless/bcmdhd/wl_android.c           |   22 +-
 drivers/net/wireless/bcmdhd/wl_android.h           |    2 +-
 drivers/net/wireless/bcmdhd/wl_cfg80211.c          | 2142 ++++++--------------
 drivers/net/wireless/bcmdhd/wl_cfg80211.h          |  125 +-
 drivers/net/wireless/bcmdhd/wl_cfgp2p.c            |  245 ++-
 drivers/net/wireless/bcmdhd/wl_cfgp2p.h            |   27 +-
 drivers/net/wireless/bcmdhd/wl_linux_mon.c         |  409 ++++
 drivers/net/wireless/bcmdhd/wldev_common.c         |   69 +-
 drivers/net/wireless/bcmdhd/wldev_common.h         |   20 +-
 24 files changed, 2485 insertions(+), 2095 deletions(-)

commit 1dddb0cc0d
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Jan 24 13:37:34 2012 -0800

    net: wireless: bcmdhd: Update to Version 5.90.195.15

    - Add WFD concurrent mode support

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

 drivers/net/wireless/bcmdhd/bcmevent.c             |    8 +-
 drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c   |   12 +-
 drivers/net/wireless/bcmdhd/bcmutils.c             |    4 +-
 drivers/net/wireless/bcmdhd/dhd.h                  |   25 +-
 drivers/net/wireless/bcmdhd/dhd_cdc.c              |    9 +-
 drivers/net/wireless/bcmdhd/dhd_common.c           |    4 +-
 drivers/net/wireless/bcmdhd/dhd_linux.c            |  148 +++--
 drivers/net/wireless/bcmdhd/dhd_linux_mon.c        |   28 +-
 drivers/net/wireless/bcmdhd/dhd_sdio.c             |   27 +-
 drivers/net/wireless/bcmdhd/dhd_wlfc.h             |   12 +-
 drivers/net/wireless/bcmdhd/hndpmu.c               |   44 +-
 drivers/net/wireless/bcmdhd/include/Makefile       |    2 +-
 drivers/net/wireless/bcmdhd/include/aidmp.h        |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmcdc.h       |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmdefs.h      |   37 +-
 drivers/net/wireless/bcmdhd/include/bcmdevs.h      |  573 +++++++++++++-
 drivers/net/wireless/bcmdhd/include/bcmendian.h    |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmpcispi.h    |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmperf.h      |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmsdbus.h     |   10 +-
 drivers/net/wireless/bcmdhd/include/bcmsdh.h       |   10 +-
 drivers/net/wireless/bcmdhd/include/bcmsdh_sdmmc.h |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmsdpcm.h     |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmsdspi.h     |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmsdstd.h     |   34 +-
 drivers/net/wireless/bcmdhd/include/bcmspi.h       |    2 +-
 drivers/net/wireless/bcmdhd/include/bcmutils.h     |   14 +-
 drivers/net/wireless/bcmdhd/include/bcmwifi.h      |    2 +-
 drivers/net/wireless/bcmdhd/include/dhdioctl.h     |    2 +-
 drivers/net/wireless/bcmdhd/include/epivers.h      |   14 +-
 drivers/net/wireless/bcmdhd/include/hndpmu.h       |    2 +-
 .../net/wireless/bcmdhd/include/hndrte_armtrap.h   |    2 +-
 drivers/net/wireless/bcmdhd/include/hndrte_cons.h  |    2 +-
 drivers/net/wireless/bcmdhd/include/hndsoc.h       |    2 +-
 drivers/net/wireless/bcmdhd/include/htsf.h         |    2 +-
 drivers/net/wireless/bcmdhd/include/linux_osl.h    |    2 +-
 drivers/net/wireless/bcmdhd/include/linuxver.h     |    6 +-
 drivers/net/wireless/bcmdhd/include/miniopt.h      |    2 +-
 drivers/net/wireless/bcmdhd/include/msgtrace.h     |    2 +-
 drivers/net/wireless/bcmdhd/include/osl.h          |    2 +-
 .../wireless/bcmdhd/include/packed_section_end.h   |    2 +-
 .../wireless/bcmdhd/include/packed_section_start.h |    2 +-
 drivers/net/wireless/bcmdhd/include/pcicfg.h       |   28 +-
 drivers/net/wireless/bcmdhd/include/proto/802.11.h |  317 +++++++-
 .../net/wireless/bcmdhd/include/proto/802.11_bta.h |    2 +-
 .../net/wireless/bcmdhd/include/proto/802.11e.h    |    2 +-
 drivers/net/wireless/bcmdhd/include/proto/802.1d.h |    2 +-
 drivers/net/wireless/bcmdhd/include/proto/bcmeth.h |    2 +-
 .../net/wireless/bcmdhd/include/proto/bcmevent.h   |    9 +-
 drivers/net/wireless/bcmdhd/include/proto/bcmip.h  |    2 +-
 .../net/wireless/bcmdhd/include/proto/bt_amp_hci.h |    2 +-
 drivers/net/wireless/bcmdhd/include/proto/eapol.h  |    2 +-
 .../net/wireless/bcmdhd/include/proto/ethernet.h   |    3 +-
 drivers/net/wireless/bcmdhd/include/proto/p2p.h    |    2 +-
 drivers/net/wireless/bcmdhd/include/proto/sdspi.h  |    2 +-
 drivers/net/wireless/bcmdhd/include/proto/vlan.h   |    2 +-
 drivers/net/wireless/bcmdhd/include/proto/wpa.h    |   12 +-
 drivers/net/wireless/bcmdhd/include/sbchipc.h      |  168 ++++-
 drivers/net/wireless/bcmdhd/include/sbconfig.h     |    2 +-
 drivers/net/wireless/bcmdhd/include/sbhnddma.h     |    6 +-
 drivers/net/wireless/bcmdhd/include/sbpcmcia.h     |    2 +-
 drivers/net/wireless/bcmdhd/include/sbsdio.h       |    2 +-
 drivers/net/wireless/bcmdhd/include/sbsdpcmdev.h   |    2 +-
 drivers/net/wireless/bcmdhd/include/sbsocram.h     |    2 +-
 drivers/net/wireless/bcmdhd/include/sdio.h         |    5 +-
 drivers/net/wireless/bcmdhd/include/sdioh.h        |   32 +-
 drivers/net/wireless/bcmdhd/include/sdiovar.h      |    2 +-
 drivers/net/wireless/bcmdhd/include/siutils.h      |   30 +-
 drivers/net/wireless/bcmdhd/include/trxhdr.h       |    3 +-
 drivers/net/wireless/bcmdhd/include/typedefs.h     |    5 +-
 drivers/net/wireless/bcmdhd/include/wlfc_proto.h   |    2 +-
 drivers/net/wireless/bcmdhd/include/wlioctl.h      |   87 ++-
 drivers/net/wireless/bcmdhd/linux_osl.c            |   23 +-
 drivers/net/wireless/bcmdhd/siutils.c              |  195 +++++-
 drivers/net/wireless/bcmdhd/wl_android.c           |    6 +-
 drivers/net/wireless/bcmdhd/wl_cfg80211.c          |  875 ++++++++++++--------
 drivers/net/wireless/bcmdhd/wl_cfg80211.h          |  282 +++++---
 drivers/net/wireless/bcmdhd/wl_cfgp2p.c            |  165 ++++-
 drivers/net/wireless/bcmdhd/wl_cfgp2p.h            |   12 +-
 drivers/net/wireless/bcmdhd/wl_iw.c                |  110 +++-
 drivers/net/wireless/bcmdhd/wl_iw.h                |   17 +-
 81 files changed, 2737 insertions(+), 752 deletions(-)

commit 52bdb6f543
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Mon Jan 23 12:47:21 2012 -0800

    net: wireless: bcmdhd: Add WIPHY_FLAG_SUPPORTS_FW_ROAM flag

    Adding this flag will allow NL80211_ATTR_ROAM_SUPPORT, and will set
      WPA_DRIVER_FLAGS_BSS_SELECTION flag in wpa_supplicant

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

 drivers/net/wireless/bcmdhd/wl_cfg80211.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

commit b1a94205e9
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Fri Jan 20 14:15:05 2012 -0800

    net: wireless: bcmdhd: Fake PNO event to wake up the wpa_supplicant

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

 drivers/net/wireless/bcmdhd/dhd_linux.c   |    4 +++-
 drivers/net/wireless/bcmdhd/wl_cfg80211.c |   20 ++++++++++++++++----
 2 files changed, 19 insertions(+), 5 deletions(-)

commit 09701e3edf
Author: Scott Anderson <saa@google.com>
Date:   Wed Jan 18 15:56:51 2012 -0800

    usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAW

    The maximum current draw was hard coded to 500 mA.  composite.c
    has code that uses CONFIG_USB_GADGET_VBUS_DRAW to set the
    bMaxPower and to set whether or not the device is self-powered if
    they haven't been set.  This change removes the code in android.c
    to allow composite.c to set them.

    Change-Id: I9db37922e91ee86e9e5c0e14519e119e5c41ca48
    Signed-off-by: Scott Anderson <saa@google.com>

 drivers/usb/gadget/android.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

commit a6ccb73389
Author: Benoit Goby <benoit@android.com>
Date:   Fri Jan 20 14:42:41 2012 -0800

    usb: gadget: Fix usb string id allocation

    Don't reset next_string_id every time the gadget is enabled, this makes
    the next strings allocated overwrite strings allocated at probe time.
    Instead, fix rndis not to allocate new string ids on every config bind.

    Change-Id: Ied28ee416bb6f00c434c34176fe5b7f0dcb2b2d4
    Signed-off-by: Benoit Goby <benoit@android.com>

 drivers/usb/gadget/android.c |    1 -
 drivers/usb/gadget/f_rndis.c |   12 +++++-------
 drivers/usb/gadget/rndis.c   |   11 +++++++++++
 3 files changed, 16 insertions(+), 8 deletions(-)

commit 87159de9c3
Author: Jouni Malinen <jouni@qca.qualcomm.com>
Date:   Thu Aug 11 11:46:22 2011 +0300

    nl80211/cfg80211: Make addition of new sinfo fields safer

    Add a comment pointing out the use of enum station_info_flags for
    all new struct station_info fields. In addition, memset the sinfo
    buffer to zero before use on all paths in the current tree to avoid
    leaving uninitialized pointers in the data.

    Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

 include/net/cfg80211.h  |    5 +++++
 net/mac80211/sta_info.c |    1 +
 net/wireless/nl80211.c  |    1 +
 3 files changed, 7 insertions(+), 0 deletions(-)

commit d692df224b
Author: Jouni Malinen <jouni@qca.qualcomm.com>
Date:   Mon Aug 8 12:11:52 2011 +0300

    cfg80211/nl80211: Send AssocReq IEs to user space in AP mode

    When user space SME/MLME (e.g., hostapd) is not used in AP mode, the
    IEs from the (Re)Association Request frame that was processed in
    firmware need to be made available for user space (e.g., RSN IE for
    hostapd). Allow this to be done with cfg80211_new_sta().

    Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
    Acked-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

 include/net/cfg80211.h |    8 ++++++++
 net/wireless/nl80211.c |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

commit d1e94136fc
Author: Dima Zavin <dima@android.com>
Date:   Mon Jan 23 10:39:02 2012 -0800

    misc: remove android pmem driver, it's obsolete.

    Change-Id: I48d9778007e1e9eed2bb34e33ceee818c23afaa5
    Signed-off-by: Dima Zavin <dima@android.com>

 drivers/misc/Kconfig         |    4 -
 drivers/misc/Makefile        |    1 -
 drivers/misc/pmem.c          | 1345 ------------------------------------------
 include/linux/android_pmem.h |   93 ---
 4 files changed, 0 insertions(+), 1443 deletions(-)

commit dac306d896
Author: Dima Zavin <dima@android.com>
Date:   Thu Jan 19 09:51:07 2012 -0800

    Revert "proc: enable writing to /proc/pid/mem"

    This reverts commit 198214a7ee.

 fs/proc/base.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

commit a65e28a014
Author: Dima Zavin <dima@android.com>
Date:   Thu Jan 12 15:55:25 2012 -0800

    ram_console: set CON_ANYTIME console flag

    We want to ensure that we get all the console messages, even ones
    that occur while the printing CPU is not yet online.

    Change-Id: I1d2694d05ac9415669a92f38efdd8e71c927705b
    Signed-off-by: Dima Zavin <dima@android.com>

 drivers/staging/android/ram_console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit f16e6fb3e3
Author: Benoit Goby <benoit@android.com>
Date:   Thu Dec 15 18:40:37 2011 -0800

    Revert "usb: gadget: rndis: don't use dev_get_stats"

    This reverts commit ffdab0c0c4.

    Not needed anymore in 2.6.39 and 3.0, dev_get_stats has been fixed
    and may be called from atomic context. See:
    1ac9ad1 net: remove dev_txq_stats_fold()

 drivers/usb/gadget/rndis.c |   23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)

commit e1493f1544
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Mon Dec 19 10:24:09 2011 -0800

    net: wireless: bcmdhd: Enable wlan access on resume for all sdio functions

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

 drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

commit bbd08c6e95
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Fri Dec 16 12:54:51 2011 -0800

    net: wireless: bcmdhd: Fix P2P interface removal

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

 drivers/net/wireless/bcmdhd/dhd_linux.c   |    3 ++
 drivers/net/wireless/bcmdhd/wl_cfg80211.c |   43 ++++++++++++++++++++++-------
 drivers/net/wireless/bcmdhd/wl_cfg80211.h |    9 ++++--
 3 files changed, 42 insertions(+), 13 deletions(-)

commit 37ff4411a5
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Thu Dec 15 12:12:20 2011 -0800

    net: wireless: bcm4329: Fix pno_enable if disassociated

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

 drivers/net/wireless/bcm4329/dhd_common.c |   43 ++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 7 deletions(-)

commit 599c8566fa
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Dec 13 17:39:48 2011 -0800

    net: wireless: bcmdhd: Fix proper scan command even if request is NULL

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

 drivers/net/wireless/bcmdhd/wl_cfg80211.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

commit f227b88c89
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Dec 13 12:27:49 2011 -0800

    net: wireless: bcmdhd: Decrease event wake_lock timeout to 1500 ms

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

 drivers/net/wireless/bcmdhd/dhd.h       |    4 ++--
 drivers/net/wireless/bcmdhd/dhd_linux.c |    8 ++++----
 drivers/net/wireless/bcmdhd/wl_iw.c     |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

commit ed3f356087
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Mon Dec 12 15:40:33 2011 -0800

    net: wireless: bcmdhd: Fix getting arp_hostip table

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

 drivers/net/wireless/bcmdhd/dhd_common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit c561cedf2b
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Tue Dec 6 16:27:37 2011 -0800

    net: wireless: bcmdhd: Allow to push more packets to FW for Tx

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

 drivers/net/wireless/bcmdhd/dhd_sdio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 4f36cb88d6
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Fri Dec 2 13:24:01 2011 -0800

    net: wireless: bcmdhd: Fix scan crash in ibss mode

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

 drivers/net/wireless/bcmdhd/wl_cfg80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit af16732d4c
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Fri Dec 2 13:10:47 2011 -0800

    net: wireless: bcmdhd: Add FW reloading in case of FW hang

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

 drivers/net/wireless/bcmdhd/dhd_linux.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

commit 7caeacd6ed
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Wed Nov 30 12:49:02 2011 -0800

    net: wireless: bcmdhd: Update to Version 5.90.125.94.1

    - Return zeroed private command buffer
    - Fix memory leak in wl_inform_single_bss()

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

 drivers/net/wireless/bcmdhd/dhd_common.c      |    5 +++--
 drivers/net/wireless/bcmdhd/dhd_linux_mon.c   |   10 ++++++----
 drivers/net/wireless/bcmdhd/include/epivers.h |    2 +-
 drivers/net/wireless/bcmdhd/wl_android.c      |    9 ++++++---
 drivers/net/wireless/bcmdhd/wl_cfg80211.c     |    9 ++++++---
 5 files changed, 22 insertions(+), 13 deletions(-)

commit 8d71d882e7
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Fri Nov 11 16:04:12 2011 -0800

    net: wireless: bcmdhd: Use CONFIG_DHD_USE_STATIC_BUF for preallocated memory

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

 drivers/net/wireless/bcmdhd/Kconfig             |    7 +++
 drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c      |   16 ++++----
 drivers/net/wireless/bcmdhd/dhd.h               |    4 +-
 drivers/net/wireless/bcmdhd/dhd_cdc.c           |    4 +-
 drivers/net/wireless/bcmdhd/dhd_linux.c         |    4 +-
 drivers/net/wireless/bcmdhd/dhd_sdio.c          |    4 +-
 drivers/net/wireless/bcmdhd/include/linux_osl.h |    2 +-
 drivers/net/wireless/bcmdhd/linux_osl.c         |   52 +++++++++++++----------
 drivers/net/wireless/bcmdhd/wl_android.c        |    7 ++-
 9 files changed, 57 insertions(+), 43 deletions(-)

commit 35047200c4
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Mon Dec 19 12:32:21 2011 -0800

    wireless: Protect regdomain change by mutex

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

 net/wireless/reg.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

commit ea693bf7f8
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Fri Dec 16 17:52:18 2011 -0800

    mmc: Set suspend/resume bus operations if CONFIG_PM_RUNTIME is used

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

 drivers/mmc/core/bus.c |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

commit dc1b634039
Author: Benoit Goby <benoit@android.com>
Date:   Fri Dec 9 18:05:00 2011 -0800

    usb: gadget: android: Don't allow changing the functions list if enabled

    Change-Id: I3ad39b420ce79a8602a7eca1daac1f56b30bad5c
    Signed-off-by: Benoit Goby <benoit@android.com>

 drivers/usb/gadget/android.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

commit e0de0a507d
Author: Benoit Goby <benoit@android.com>
Date:   Tue Nov 29 13:49:27 2011 -0800

    usb: gadget: android: Cancel pending ctrlrequest before disabling

    Make sure there is no pending ctrlrequest before removing the config.
    Otherwise the ctrlrequest complete callback could access structures
    after they have been freed. Unbind cancels pending transfers but not
    ep0 requests.

    Bug: 5513065 5440193

    Change-Id: I063c22bf5d104a3d2df71cf622409459fac5f27a
    Signed-off-by: Benoit Goby <benoit@android.com>

 drivers/usb/gadget/android.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

commit b86fd0b622
Author: Colin Cross <ccross@android.com>
Date:   Tue Nov 29 16:37:07 2011 -0800

    ARM: idle: call idle notifiers before stopping nohz tick

    If an idle notifier modifies a timer, calling the notifier after
    the sched tick has been stopped may leave the sched tick set too
    early.  Move teh idle notifier call before the call to
    tick_nohz_stop_sched_tick.

    Change-Id: I0db3284bec6d0193bc5e2a57650ab06bd8342319
    Signed-off-by: Colin Cross <ccross@android.com>

 arch/arm/kernel/process.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 6a4a38525d
Author: Benoit Goby <benoit@android.com>
Date:   Mon Nov 28 18:01:03 2011 -0800

    usb: gadget: android: Reset next_string_id before enable

    Reset next_string_id to 0 before enabling the gadget driver. Otherwise,
    after a large number of enable/disable cycles, bind will fail
    because we cannot allocate new string ids. String ids cannot be larger
    than 254 per USB spec.

    Change-Id: I44f5fece45008b7a0a18c025d4eb5ce842585c28
    Signed-off-by: Benoit Goby <benoit@android.com>

 drivers/usb/gadget/android.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit dbb18fb2c1
Author: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
Date:   Fri Nov 18 13:57:01 2011 +0900

    Bluetooth: Keep master role when SCO or eSCO is active

    This improves compatbility with a lot of headset / chipset
    combinations. Ideally this should not be needed.

    Change-Id: I8b676701e12e416aa7d60801b9d353b15d102709
    Signed-off-by: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
    Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>

 net/bluetooth/hci_event.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

commit 9d187300df
Author: Arve Hjønnevåg <arve@android.com>
Date:   Tue Nov 22 14:56:50 2011 -0800

    rtc: Fix some bugs that allowed accumulating time drift in suspend/resume

    The current code checks if abs(delta_delta.tv_sec) is greater or
    equal to two before it discards the old delta value, but this can
    trigger at close to -1 seconds since -1.000000001 seconds is stored
    as tv_sec -2 and tv_nsec 999999999 in a normalized timespec.

    rtc_resume had an early return check if the rtc value had not changed
    since rtc_suspend. This effectivly stops time for the duration of the
    short sleep. Check if sleep_time is positive after all the adjustments
    have been applied instead since this allows the old_system adjustment
    in rtc_suspend to have an effect even for short sleep cycles.

    Change-Id: I00b45c0349ec91a4bab9b41a126b377515427898
    Signed-off-by: Arve Hjønnevåg <arve@android.com>

 drivers/rtc/class.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

commit 452d440ab2
Author: Arve Hjønnevåg <arve@android.com>
Date:   Tue Nov 22 15:28:27 2011 -0800

    Fix "time: Catch invalid timespec sleep values in __timekeeping_inject_sleeptime" to compile on 3.0

    Change-Id: I1225f279cda04dedbfb7f853f6b58f1032bd6d2b

 kernel/time/timekeeping.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit cf70c6a400
Author: John Stultz <john.stultz@linaro.org>
Date:   Wed Jun 1 18:18:09 2011 -0700

    time: Catch invalid timespec sleep values in __timekeeping_inject_sleeptime

    Arve suggested making sure we catch possible negative sleep time
    intervals that could be passed into timekeeping_inject_sleeptime.

    CC: Arve Hjønnevåg <arve@android.com>
    CC: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <john.stultz@linaro.org>

 kernel/time/timekeeping.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

commit 340ede3671
Author: John Stultz <john.stultz@linaro.org>
Date:   Fri May 27 11:33:18 2011 -0700

    rtc: Avoid accumulating time drift in suspend/resume

    Because the RTC interface is only a second granular interface,
    each time we read from the RTC for suspend/resume, we introduce a
    half second (on average) of error.

    In order to avoid this error accumulating as the system is suspended
    over and over, this patch measures the time delta between the RTC
    and the system CLOCK_REALTIME.

    If the delta is less then 2 seconds from the last suspend, we compensate
    by using the previous time delta (keeping it close). If it is larger
    then 2 seconds, we assume the clock was set or has been changed, so we
    do no correction and update the delta.

    Note: If NTP is running, ths could seem to "fight" with the NTP corrected
    time, where as if the system time was off by 1 second, and NTP slewed the
    value in, a suspend/resume cycle could undo this correction, by trying to
    restore the previous offset from the RTC. However, without this patch,
    since each read could cause almost a full second worth of error, its
    possible to get almost 2 seconds of error just from the suspend/resume
    cycle alone, so this about equal to any offset added by the compensation.

    Further on systems that suspend/resume frequently, this should keep time
    closer then NTP could compensate for if the errors were allowed to
    accumulate.

    Credits to Arve Hjønnevåg for suggesting this solution.

    This patch also improves some of the variable names and adds more clear
    comments.

    CC: Arve Hjønnevåg <arve@android.com>
    CC: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <john.stultz@linaro.org>

 drivers/rtc/class.c |   65 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 48 insertions(+), 17 deletions(-)

Change-Id: I16f522e7ee2b301cbdaea62d52d50d7249f565c2
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2012-03-28 16:03:47 -07:00
Amar Singhal
f10f2a8bad tick-sched: change the cpu that updates rq_stats
It can happen that the scheduler tick stops on cpu 0 but keeps
running on some other cpu. Make the cpu in-charge of updating
the jiffies also update the rq_stats.

Change-Id: Idb1a8132bd96500c68c516b4a99663965cec28e1
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
2012-01-04 12:24:24 -08:00
Linus Torvalds
ef7386b5de Revert "clockevents: Set noop handler in clockevents_exchange_device()"
commit 3b87487ac5008072f138953b07505a7e3493327f upstream.

This reverts commit de28f25e8244c7353abed8de0c7792f5f883588c.

It results in resume problems for various people. See for example

  http://thread.gmane.org/gmane.linux.kernel/1233033
  http://thread.gmane.org/gmane.linux.kernel/1233389
  http://thread.gmane.org/gmane.linux.kernel/1233159
  http://thread.gmane.org/gmane.linux.kernel/1227868/focus=1230877

and the fedora and ubuntu bug reports

  https://bugzilla.redhat.com/show_bug.cgi?id=767248
  https://bugs.launchpad.net/ubuntu/+source/linux/+bug/904569

which got bisected down to the stable version of this commit.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Reported-by: Phil Miller <mille121@illinois.edu>
Reported-by: Philip Langdale <philipl@overt.org>
Reported-by: Tim Gardner <tim.gardner@canonical.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-03 10:42:00 -08:00
Thomas Gleixner
612e5dbc55 alarmtimers: Fix time comparison
commit c9c024b3f3e07d087974db4c0dc46217fff3a6c0 upstream.

The expiry function compares the timer against current time and does
not expire the timer when the expiry time is >= now. That's wrong. If
the timer is set for now, then it must expire.

Make the condition expiry > now for breaking out the loop.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21 12:57:34 -08:00
Thomas Gleixner
b01b383bbd clockevents: Set noop handler in clockevents_exchange_device()
commit de28f25e8244c7353abed8de0c7792f5f883588c upstream.

If a device is shutdown, then there might be a pending interrupt,
which will be processed after we reenable interrupts, which causes the
original handler to be run. If the old handler is the (broadcast)
periodic handler the shutdown state might hang the kernel completely.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 08:52:53 -08:00
Yang Honggang (Joseph)
4078977c46 clocksource: Fix bug with max_deferment margin calculation
commit b1f919664d04a8d0ba29cb76673c7ca3325a2006 upstream.

In order to leave a margin of 12.5% we should >> 3 not >> 5.

Signed-off-by: Yang Honggang (Joseph) <eagle.rtlinux@gmail.com>
[jstultz: Modified commit subject]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 08:52:52 -08:00
Thomas Gleixner
d80dee5453 tick-broadcast: Stop active broadcast device when replacing it
commit c1be84309c58b1e7c6d626e28fba41a22b364c3d upstream.

When a better rated broadcast device is installed, then the current
active device is not disabled, which results in two running broadcast
devices.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 08:52:48 -08:00
Hector Palacios
e1ef77bdad timekeeping: add arch_offset hook to ktime_get functions
commit d004e024058a0eaca097513ce62cbcf978913e0a upstream.

ktime_get and ktime_get_ts were calling timekeeping_get_ns()
but later they were not calling arch_gettimeoffset() so architectures
using this mechanism returned 0 ns when calling these functions.

This happened for example when running Busybox's ping which calls
syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts) which eventually
calls ktime_get. As a result the returned ping travel time was zero.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09 08:52:28 -08:00
Heiko Carstens
45db69a9fd nohz: Remove "Switched to NOHz mode" debugging messages
When performing cpu hotplug tests the kernel printk log buffer gets flooded
with pointless "Switched to NOHz mode..." messages. Especially when afterwards
analyzing a dump this might have removed more interesting stuff out of the
buffer.
Assuming that switching to NOHz mode simply works just remove the printk.

Change-Id: I1746f8c0119a512055716c3fd77a966b735ca49b
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Link: http://lkml.kernel.org/r/20110823112046.GB2540@osiris.boeblingen.de.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
2011-12-07 13:12:14 -08:00
Arve Hjønnevåg
452d440ab2 Fix "time: Catch invalid timespec sleep values in __timekeeping_inject_sleeptime" to compile on 3.0
Change-Id: I1225f279cda04dedbfb7f853f6b58f1032bd6d2b
2011-11-22 16:49:43 -08:00
John Stultz
cf70c6a400 time: Catch invalid timespec sleep values in __timekeeping_inject_sleeptime
Arve suggested making sure we catch possible negative sleep time
intervals that could be passed into timekeeping_inject_sleeptime.

CC: Arve Hjønnevåg <arve@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-11-22 16:49:29 -08:00
Bryan Huntsman
d074fa2796 Merge remote-tracking branch 'common/android-3.0' into msm-3.0
* common/android-3.0: (570 commits)
  misc: remove kernel debugger core
  ARM: common: fiq_debugger: dump sysrq directly to console if enabled
  ARM: common: fiq_debugger: add irq context debug functions
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly
  net: wireless: bcmdhd: Fix possible memory leak in escan/iscan
  cpufreq: interactive governor: default 20ms timer
  cpufreq: interactive governor: go to intermediate hi speed before max
  cpufreq: interactive governor: scale to max only if at min speed
  cpufreq: interactive governor: apply intermediate load on current speed
  ARM: idle: update idle ticks before call idle end notifier
  input: gpio_input: don't print debounce message unless flag is set
  net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Improve suspend/resume processing
  net: wireless: bcmdhd: Check if FW is Ok for internal FW call
  tcp: Don't nuke connections for the wrong protocol
  ARM: common: fiq_debugger: make uart irq be no_suspend
  net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
  mm: avoid livelock on !__GFP_FS allocations
  ...

Conflicts:
	arch/arm/mm/cache-l2x0.c
	arch/arm/vfp/vfpmodule.c
	drivers/mmc/core/host.c
	kernel/power/wakelock.c
	net/bluetooth/hci_event.c

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-11-16 13:52:50 -08:00
Colin Cross
2bb3e31015 Merge commit 'v3.0.8' into android-3.0 2011-10-27 15:01:19 -07:00
Amar Singhal
f49d99bc41 rq_stats: Doing rq_stats calculation in the scheduler tick.
With this change, we do the average run queue statistics calculation
in the scheduler tick itself. This helps avoid any extra timers to
do the same. Also doing this calculation in the scheduler tick avoids
any bias if the calculation is done in a workqueue

Change-Id: I854d90acc05cc7a7226487be5555976826d8c837
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
2011-10-20 14:35:49 -07:00
John Stultz
c3a44b4d23 alarmtimers: Avoid possible denial of service with high freq periodic timers
commit 6af7e471e5a7746b8024d70b4363d3dfe41d36b8 upstream.

Its possible to jam up the alarm timers by setting very small interval
timers, which will cause the alarmtimer subsystem to spend all of its time
firing and restarting timers. This can effectivly lock up a box.

A deeper fix is needed, closely mimicking the hrtimer code, but for now
just cap the interval to 100us to avoid userland hanging the system.

CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:07 -07:00
John Stultz
0898dd1603 alarmtimers: Memset itimerspec passed into alarm_timer_get
commit ea7802f630d356acaf66b3c0b28c00a945fc35dc upstream.

Following common_timer_get, zero out the itimerspec passed in.

CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:07 -07:00
John Stultz
26cf1a7ba1 alarmtimers: Avoid possible null pointer traversal
commit 971c90bfa2f0b4fe52d6d9002178d547706f1343 upstream.

We don't check if old_setting is non null before assigning it, so
correct this.

CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:06 -07:00
Colin Cross
e55d4fa967 Merge commit 'v3.0-rc5' into android-3.0 2011-06-29 13:54:42 -07:00
John Stultz
1c6b39ad3f alarmtimers: Return -ENOTSUPP if no RTC device is present
Toralf Förster and Richard Weinberger noted that if there is
no RTC device, the alarm timers core prints out an annoying
"ALARM timers will not wake from suspend" message.

This warning has been removed in a previous patch, however
the issue still remains:  The original idea was to support
alarm timers even if there was no rtc device, as long as the
system didn't go into suspend.

However, after further consideration, communicating to the application
that alarmtimers are not fully functional seems like the better
solution.

So this patch makes it so we return -ENOTSUPP to any posix _ALARM
clockid calls if there is no backing RTC device on the system.

Further this changes the behavior where when there is no rtc device
we will check for one on clock_getres, clock_gettime, timer_create,
and timer_nsleep instead of on suspend.

CC: Toralf Förster <toralf.foerster@gmx.de>
CC: Richard Weinberger <richard@nod.at
CC: Peter Zijlstra <peterz@infradead.org>
CC: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Reported by: Richard Weinberger <richard@nod.at>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-06-21 16:32:28 -07:00
John Stultz
c008ba58af alarmtimers: Handle late rtc module loading
The alarmtimers code currently picks a rtc device to use at
late init time. However, if your rtc driver is loaded as a module,
it may be registered after the alarmtimers late init code, leaving
the alarmtimers nonfunctional.

This patch moves the the rtcdevice selection to when we actually try
to use it, allowing us to make use of rtc modules that may have been
loaded at any point since bootup.

CC: Thomas Gleixner <tglx@linutronix.de>
CC: Meelis Roos <mroos@ut.ee>
Reported-by: Meelis Roos <mroos@ut.ee>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-06-21 15:38:33 -07:00
Thomas Gleixner
b5199515c2 clocksource: Make watchdog robust vs. interruption
The clocksource watchdog code is interruptible and it has been
observed that this can trigger false positives which disable the TSC.

The reason is that an interrupt storm or a long running interrupt
handler between the read of the watchdog source and the read of the
TSC brings the two far enough apart that the delta is larger than the
unstable treshold. Move both reads into a short interrupt disabled
region to avoid that.

Reported-and-tested-by: Vernon Mauery <vernux@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org
2011-06-16 19:30:53 +02:00
Colin Cross
abbb445f65 HACK: time: Disable alarmtimer
kernel/time/alarmtimer.c conflicts with drivers/rtc/alarm.c,
disable it for now.

Change-Id: I6cdb3b885828d45836a54971adf16143039b0a0e
Signed-off-by: Colin Cross <ccross@android.com>
2011-06-14 11:37:53 -07:00
Thomas Gleixner
1b054b67d3 clockevents: Handle empty cpumask gracefully
For UP it's stupid to request an initialized cpumask for the clock
event devices. Though we need the mask set even on UP to avoid a
horrible ifdeffery especially in the broadcast code.

For SMP we can at least try to survive with a warning and set the
cpumask of the cpu we're running on. That gives a decent chance to
bring the machine up and retrieve the debug info.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Walleij <linus.walleij@linaro.org
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Stephen Boyd <sboyd@codeaurora.org>
2011-06-03 11:13:33 +02:00
Thomas Gleixner
ab8177bc53 hrtimers: Avoid touching inactive timer bases
Instead of iterating over all possible timer bases avoid it by marking
the active bases in the cpu base.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Peter Zijlstra <peterz@infradead.org>
2011-05-23 13:59:54 +02:00
Thomas Gleixner
250f972d85 Merge branch 'timers/urgent' into timers/core
Reason: Get upstream fixes and kfree_rcu which is necessary for a
follow up patch.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-20 20:08:05 +02:00
Thomas Gleixner
c0e299b1a9 clockevents/source: Use u64 to make 32bit happy
unsigned long is not 64bit on 32bit machine.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-20 10:50:52 +02:00
Linus Torvalds
78c4def67e Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  hrtimer: Make lookup table const
  RTC: Disable CONFIG_RTC_CLASS from being built as a module
  timers: Fix alarmtimer build issues when CONFIG_RTC_CLASS=n
  timers: Remove delayed irqwork from alarmtimers implementation
  timers: Improve alarmtimer comments and minor fixes
  timers: Posix interface for alarm-timers
  timers: Introduce in-kernel alarm-timer interface
  timers: Add rb_init_node() to allow for stack allocated rb nodes
  time: Add timekeeping_inject_sleeptime
2011-05-19 17:45:08 -07:00
Linus Torvalds
7e6628e4bc Merge branch 'timers-clockevents-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-clockevents-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: hpet: Cleanup the clockevents init and register code
  x86: Convert PIT to clockevents_config_and_register()
  clockevents: Provide interface to reconfigure an active clock event device
  clockevents: Provide combined configure and register function
  clockevents: Restructure clock_event_device members
  clocksource: Get rid of the hardcoded 5 seconds sleep time limit
  clocksource: Restructure clocksource struct members
2011-05-19 17:44:40 -07:00
Thomas Gleixner
80b816b736 clockevents: Provide interface to reconfigure an active clock event device
Some ARM SoCs have clock event devices which have their frequency
modified due to frequency scaling. Provide an interface which allows
to reconfigure an active device. After reconfiguration reprogram the
current pending event.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: LAK <linux-arm-kernel@lists.infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/r/%3C20110518210136.437459958%40linutronix.de%3E
2011-05-19 14:24:16 +02:00
Thomas Gleixner
57f0fcbe1d clockevents: Provide combined configure and register function
All clockevent devices have the same open coded initialization
functions. Provide an interface which does all necessary
initialization in the core code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/r/%3C20110518210136.331975870%40linutronix.de%3E
2011-05-19 14:24:15 +02:00
Thomas Gleixner
724ed53e8a clocksource: Get rid of the hardcoded 5 seconds sleep time limit
Slow clocksources can have a way longer sleep time than 5 seconds and
even fast ones can easily cope with 600 seconds and still maintain
proper accuracy.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/r/%3C20110518210136.109811585%40linutronix.de%3E
2011-05-19 14:24:15 +02:00
Thomas Gleixner
07f4beb0b5 tick: Clear broadcast active bit when switching to oneshot
The first cpu which switches from periodic to oneshot mode switches
also the broadcast device into oneshot mode. The broadcast device
serves as a backup for per cpu timers which stop in deeper
C-states. To avoid starvation of the cpus which might be in idle and
depend on broadcast mode it marks the other cpus as broadcast active
and sets the brodcast expiry value of those cpus to the next tick.

The oneshot mode broadcast bit for the other cpus is sticky and gets
only cleared when those cpus exit idle. If a cpu was not idle while
the bit got set in consequence the bit prevents that the broadcast
device is armed on behalf of that cpu when it enters idle for the
first time after it switched to oneshot mode.

In most cases that goes unnoticed as one of the other cpus has usually
a timer pending which keeps the broadcast device armed with a short
timeout. Now if the only cpu which has a short timer active has the
bit set then the broadcast device will not be armed on behalf of that
cpu and will fire way after the expected timer expiry. In the case of
Christians bug report it took ~145 seconds which is about half of the
wrap around time of HPET (the limit for that device) due to the fact
that all other cpus had no timers armed which expired before the 145
seconds timeframe.

The solution is simply to clear the broadcast active bit
unconditionally when a cpu switches to oneshot mode after the first
cpu switched the broadcast device over. It's not idle at that point
otherwise it would not be executing that code.

[ I fundamentally hate that broadcast crap. Why the heck thought some
  folks that when going into deep idle it's a brilliant concept to
  switch off the last device which brings the cpu back from that
  state? ]

Thanks to Christian for providing all the valuable debug information!

Reported-and-tested-by: Christian Hoffmann <email@christianhoffmann.info>
Cc: John Stultz <johnstul@us.ibm.com>
Link: http://lkml.kernel.org/r/%3Calpine.LFD.2.02.1105161105170.3078%40ionos%3E
Cc: stable@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-16 23:35:41 +02:00
Andi Kleen
7372b0b122 clockevents: Move C3 stop test outside lock
Avoid taking broadcast_lock in the idle path for systems where the
timer doesn't stop in C3.

[ tglx: Removed the stale label and added comment ]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Dave Kleikamp <dkleikamp@gmail.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: lenb@kernel.org
Cc: paulmck@us.ibm.com
Link: http://lkml.kernel.org/r/%3C20110504234806.GF2925%40one.firstfloor.org%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-05 17:32:13 +02:00
john stultz
e05b2efb82 clocksource: Install completely before selecting
Christian Hoffmann reported that the command line clocksource override
with acpi_pm timer fails:

 Kernel command line: <SNIP> clocksource=acpi_pm
 hpet clockevent registered
 Switching to clocksource hpet
 Override clocksource acpi_pm is not HRT compatible.
 Cannot switch while in HRT/NOHZ mode.

The watchdog code is what enables CLOCK_SOURCE_VALID_FOR_HRES, but we
actually end up selecting the clocksource before we enqueue it into
the watchdog list, so that's why we see the warning and fail to switch
to acpi_pm timer as requested. That's particularly bad when we want to
debug timekeeping related problems in early boot.

Put the selection call last.

Reported-by: Christian Hoffmann <email@christianhoffmann.info>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: stable@kernel.org # 32...
Link: http://lkml.kernel.org/r/%3C1304558210.2943.24.camel%40work-vm%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-05 15:23:26 +02:00
Thomas Gleixner
179eb03268 alarmtimer: Drop device refcount after rtc_open()
class_find_device() takes a refcount on the rtc device. rtc_open()
takes another one, so we can drop it after the rtc_open() call.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
2011-05-04 08:18:34 +02:00
Thomas Gleixner
ce788f930b alarmtimer: Check return value of class_find_device()
alarmtimer_late_init() uses class_find_device() to find a alarm
capable rtc device. The match callback stores a pointer to the name in
the char pointer handed in from the call site. alarmtimer_late_init()
checks the char pointer for NULL, but the pointer is on the stack and
not initialized to NULL before the call. So it can have random content
when the match function did not identify a device, which leads to
random access in the following rtc_open() call where the pointer is
dereferenced

Instead of relying on the char pointer, check the return value of
class_find_device. If a device is found then the name pointer is valid
as well.

Reported-by: Ingo Molnar <mingo@elte.hu>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-04 08:18:17 +02:00
Thomas Gleixner
99ee5315da timerfd: Allow timers to be cancelled when clock was set
Some applications must be aware of clock realtime being set
backward. A simple example is a clock applet which arms a timer for
the next minute display. If clock realtime is set backward then the
applet displays a stale time for the amount of time which the clock
was set backwards. Due to that applications poll the time because we
don't have an interface.

Extend the timerfd interface by adding a flag which puts the timer
onto a different internal realtime clock. All timers on this clock are
expired whenever the clock was set.

The timerfd core records the monotonic offset when the timer is
created. When the timer is armed, then the current offset is compared
to the previous recorded offset. When it has changed, then
timerfd_settime returns -ECANCELED. When a timer is read the offset is
compared and if it changed -ECANCELED returned to user space. Periodic
timers are not rearmed in the cancelation case.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Chris Friesen <chris.friesen@genband.com>
Tested-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Davide Libenzi <davidel@xmailserver.org>
Reviewed-by: Alexander Shishkin <virtuoso@slind.org>
Link: http://lkml.kernel.org/r/%3Calpine.LFD.2.02.1104271359580.3323%40ionos%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-02 21:39:15 +02:00
Thomas Gleixner
b12a03ce48 hrtimers: Prepare for cancel on clock was set timers
Make clock_was_set() unconditional and rename hres_timers_resume to
hrtimers_resume. This is a preparatory patch for hrtimers which are
cancelled when clock realtime was set.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-02 21:37:58 +02:00
John Stultz
472647dcd7 timers: Fix alarmtimer build issues when CONFIG_RTC_CLASS=n
Ingo pointed out that the alarmtimers won't build if CONFIG_RTC_CLASS=n.
This patch adds proper ifdefs to the alarmtimer code to disable the rtc
usage if it is not built in.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-05-02 21:36:57 +02:00
John Stultz
7068b7a162 timers: Remove delayed irqwork from alarmtimers implementation
Thomas asked about the delayed irq work in the alarmtimers code,
and I realized that it was a legacy from when the alarmtimer base
lock was a mutex (due to concerns that we'd be interacting with
the RTC device, which is protected by mutexes).

Since the alarmtimer base is now protected by a spinlock, we can
simply execute alarmtimer functions directly from the hrtimer
callback. Should any future alarmtimer functions sleep, they can
simply manage scheduling any delayed work themselves.

CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-04-28 13:39:18 -07:00
John Stultz
180bf812ce timers: Improve alarmtimer comments and minor fixes
This patch addresses a number of minor comment improvements and
other minor issues from Thomas' review of the alarmtimers code.

CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-04-28 13:39:17 -07:00
John Stultz
9a7adcf5c6 timers: Posix interface for alarm-timers
This patch exposes alarm-timers to userland via the posix clock
and timers interface, using two new clockids: CLOCK_REALTIME_ALARM
and CLOCK_BOOTTIME_ALARM. Both clockids behave identically to
CLOCK_REALTIME and CLOCK_BOOTTIME, respectively, but timers
set against the _ALARM suffixed clockids will wake the system if
it is suspended.

Some background can be found here:
	https://lwn.net/Articles/429925/

The concept for Alarm-timers was inspired by the Android Alarm
driver (by Arve Hjønnevåg) found in the Android kernel tree.

See: http://android.git.kernel.org/?p=kernel/common.git;a=blob;f=drivers/rtc/alarm.c;h=1250edfbdf3302f5e4ea6194847c6ef4bb7beb1c;hb=android-2.6.36

While the in-kernel interface is pretty similar between
alarm-timers and Android alarm driver, the user-space interface
for the Android alarm driver is via ioctls to a new char device.
As mentioned above, I've instead chosen to export this functionality
via the posix interface, as it seemed a little simpler and avoids
creating duplicate interfaces to things like CLOCK_REALTIME and
CLOCK_MONOTONIC under alternate names (ie:ANDROID_ALARM_RTC and
ANDROID_ALARM_SYSTEMTIME).

The semantics of the Android alarm driver are different from what
this posix interface provides. For instance, threads other then
the thread waiting on the Android alarm driver are able to modify
the alarm being waited on. Also this interface does not allow
the same wakelock semantics that the Android driver provides
(ie: kernel takes a wakelock on RTC alarm-interupt, and holds it
through process wakeup, and while the process runs, until the
process either closes the char device or calls back in to wait
on a new alarm).

One potential way to implement similar semantics may be via
the timerfd infrastructure, but this needs more research.

There may also need to be some sort of sysfs system level policy
hooks that allow alarm timers to be disabled to keep them
from firing at inappropriate times (ie: laptop in a well insulated
bag, mid-flight).

CC: Arve Hjønnevåg <arve@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-04-26 14:01:46 -07:00
John Stultz
ff3ead96d1 timers: Introduce in-kernel alarm-timer interface
This provides the in kernel interface and infrastructure for
alarm-timers.

Alarm-timers are a hybrid style timer, similar to hrtimers,
but when the system is suspended, the RTC device is set to
fire and wake the system for when the soonest alarm-timer
expires.

The concept for Alarm-timers was inspired by the Android Alarm
driver (by Arve Hjønnevåg) found in the Android kernel tree.

See: http://android.git.kernel.org/?p=kernel/common.git;a=blob;f=drivers/rtc/alarm.c;h=1250edfbdf3302f5e4ea6194847c6ef4bb7beb1c;hb=android-2.6.36

This in-kernel interface should be fairly compatible with the
Android alarm driver in-kernel interface, but has the advantage
of utilizing the new RTC timerqueue code instead of doing direct
RTC manipulation.

CC: Arve Hjønnevåg <arve@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-04-26 14:01:44 -07:00
John Stultz
304529b1b6 time: Add timekeeping_inject_sleeptime
Some platforms cannot implement read_persistent_clock, as
their RTC devices are only accessible when interrupts are enabled.
This keeps them from being used by the timekeeping code on resume
to measure the time in suspend.

The RTC layer tries to work around this, by calling do_settimeofday
on resume after irqs are reenabled to set the time properly. However,
this only corrects CLOCK_REALTIME, and does not properly adjust
the sleep time value. This causes btime in /proc/stat to be incorrect
as well as making the new CLOCK_BOTTTIME inaccurate.

This patch resolves the issue by introducing a new timekeeping hook
to allow the RTC layer to inject the sleep time on resume.

The code also checks to make sure that read_persistent_clock is
nonfunctional before setting the sleep time, so that should the RTC's
HCTOSYS option be configured in on a system that does support
read_persistent_clock we will not increase the total_sleep_time twice.

CC: Arve Hjønnevåg <arve@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-04-26 14:01:41 -07:00
Richard Cochran
1791f88143 posix clocks: Replace mutex with reader/writer semaphore
A dynamic posix clock is protected from asynchronous removal by a mutex.
However, using a mutex has the unwanted effect that a long running clock
operation in one process will unnecessarily block other processes.

For example, one process might call read() to get an external time stamp
coming in at one pulse per second. A second process calling clock_gettime
would have to wait for almost a whole second.

This patch fixes the issue by using a reader/writer semaphore instead of
a mutex.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Cc: John Stultz <john.stultz@linaro.org>
Link: http://lkml.kernel.org/r/%3C20110330132421.GA31771%40riccoc20.at.omicron.at%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-04-18 10:39:38 +02:00
Linus Torvalds
42933bac11 Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6
* 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6:
  Fix common misspellings
2011-04-07 11:14:49 -07:00
Richard Cochran
4352d9d44b ntp: fix non privileged system time shifting
The ADJ_SETOFFSET bit added in commit 094aa188 ("ntp: Add ADJ_SETOFFSET
mode bit") also introduced a way for any user to change the system time.
Sneaky or buggy calls to adjtimex() could set

    ADJ_OFFSET_SS_READ | ADJ_SETOFFSET

which would result in a successful call to timekeeping_inject_offset().
This patch fixes the issue by adding the capability check.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-04-04 08:31:23 -07:00
Lucas De Marchi
25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Rafael J. Wysocki
e1a85b2c51 timekeeping: Use syscore_ops instead of sysdev class and sysdev
The timekeeping subsystem uses a sysdev class and a sysdev for
executing timekeeping_suspend() after interrupts have been turned off
on the boot CPU (during system suspend) and for executing
timekeeping_resume() before turning on interrupts on the boot CPU
(during system resume).  However, since both of these functions
ignore their arguments, the entire mechanism may be replaced with a
struct syscore_ops object which is simpler.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
2011-03-23 22:16:04 +01:00