]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.1 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Dec 2011 22:14:25 +0000 (14:14 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Dec 2011 22:14:25 +0000 (14:14 -0800)
added patches:
ftrace-remove-force-undef-config-value-left-for-testing.patch
iwlagn-fix-hw-crypto-for-tx-only-keys.patch
iwlwifi-do-not-re-configure-ht40-after-associated.patch
rtc-disable-the-alarm-in-the-hardware.patch
rtc-fix-some-bugs-that-allowed-accumulating-time-drift-in-suspend-resume.patch
trace_events_filter-use-rcu_assign_pointer-when-setting-ftrace_event_call-filter.patch

queue-3.1/ftrace-remove-force-undef-config-value-left-for-testing.patch [new file with mode: 0644]
queue-3.1/iwlagn-fix-hw-crypto-for-tx-only-keys.patch [new file with mode: 0644]
queue-3.1/iwlwifi-do-not-re-configure-ht40-after-associated.patch [new file with mode: 0644]
queue-3.1/rtc-disable-the-alarm-in-the-hardware.patch [new file with mode: 0644]
queue-3.1/rtc-fix-some-bugs-that-allowed-accumulating-time-drift-in-suspend-resume.patch [new file with mode: 0644]
queue-3.1/series
queue-3.1/trace_events_filter-use-rcu_assign_pointer-when-setting-ftrace_event_call-filter.patch [new file with mode: 0644]

diff --git a/queue-3.1/ftrace-remove-force-undef-config-value-left-for-testing.patch b/queue-3.1/ftrace-remove-force-undef-config-value-left-for-testing.patch
new file mode 100644 (file)
index 0000000..34e98ab
--- /dev/null
@@ -0,0 +1,41 @@
+From c7c6ec8becaf742b223c7b491f4893014be23a07 Mon Sep 17 00:00:00 2001
+From: Steven Rostedt <srostedt@redhat.com>
+Date: Fri, 4 Nov 2011 10:45:23 -0400
+Subject: ftrace: Remove force undef config value left for testing
+
+From: Steven Rostedt <srostedt@redhat.com>
+
+commit c7c6ec8becaf742b223c7b491f4893014be23a07 upstream.
+
+A forced undef of a config value was used for testing and was
+accidently left in during the final commit. This causes x86 to
+run slower than needed while running function tracing as well
+as causes the function graph selftest to fail when DYNMAIC_FTRACE
+is not set. This is because the code in MCOUNT expects the ftrace
+code to be processed with the config value set that happened to
+be forced not set.
+
+The forced config option was left in by:
+    commit 6331c28c962561aee59e5a493b7556a4bb585957
+    ftrace: Fix dynamic selftest failure on some archs
+
+Link: http://lkml.kernel.org/r/20111102150255.GA6973@debian
+
+Reported-by: Rabin Vincent <rabin@rab.in>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/trace/ftrace.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/kernel/trace/ftrace.c
++++ b/kernel/trace/ftrace.c
+@@ -151,7 +151,6 @@ void clear_ftrace_function(void)
+       ftrace_pid_function = ftrace_stub;
+ }
+-#undef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
+ #ifndef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
+ /*
+  * For those archs that do not test ftrace_trace_stop in their
diff --git a/queue-3.1/iwlagn-fix-hw-crypto-for-tx-only-keys.patch b/queue-3.1/iwlagn-fix-hw-crypto-for-tx-only-keys.patch
new file mode 100644 (file)
index 0000000..94bc425
--- /dev/null
@@ -0,0 +1,69 @@
+From 274b89ca3b006926cb9b45d78ab5906f4c0fc0aa Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Fri, 2 Dec 2011 08:19:17 -0800
+Subject: iwlagn: fix HW crypto for TX-only keys
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit 274b89ca3b006926cb9b45d78ab5906f4c0fc0aa upstream.
+
+Group keys in IBSS or AP mode are not programmed
+into the device since we give the key to it with
+every TX packet. However, we do need mac80211 to
+create the MMIC & PN in all cases. Move the code
+around to set the key flags all the time. We set
+them even when the key is removed again but that
+is obviously harmless.
+
+Reported-by: Reinette Chatre <reinette.chatre@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-agn-sta.c |    5 -----
+ drivers/net/wireless/iwlwifi/iwl-agn.c     |   11 +++++++++++
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+@@ -440,9 +440,6 @@ int iwl_set_dynamic_key(struct iwl_priv
+       switch (keyconf->cipher) {
+       case WLAN_CIPHER_SUITE_TKIP:
+-              keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
+-              keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
+-
+               if (sta)
+                       addr = sta->addr;
+               else /* station mode case only */
+@@ -455,8 +452,6 @@ int iwl_set_dynamic_key(struct iwl_priv
+                                         seq.tkip.iv32, p1k, CMD_SYNC);
+               break;
+       case WLAN_CIPHER_SUITE_CCMP:
+-              keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
+-              /* fall through */
+       case WLAN_CIPHER_SUITE_WEP40:
+       case WLAN_CIPHER_SUITE_WEP104:
+               ret = iwlagn_send_sta_key(priv, keyconf, sta_id,
+--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
+@@ -2793,6 +2793,17 @@ static int iwlagn_mac_set_key(struct iee
+               return -EOPNOTSUPP;
+       }
++      switch (key->cipher) {
++      case WLAN_CIPHER_SUITE_TKIP:
++              key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
++              /* fall through */
++      case WLAN_CIPHER_SUITE_CCMP:
++              key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
++              break;
++      default:
++              break;
++      }
++
+       /*
+        * We could program these keys into the hardware as well, but we
+        * don't expect much multicast traffic in IBSS and having keys
diff --git a/queue-3.1/iwlwifi-do-not-re-configure-ht40-after-associated.patch b/queue-3.1/iwlwifi-do-not-re-configure-ht40-after-associated.patch
new file mode 100644 (file)
index 0000000..8551482
--- /dev/null
@@ -0,0 +1,193 @@
+From 34a5b4b6af104cf18eb50748509528b9bdbc4036 Mon Sep 17 00:00:00 2001
+From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
+Date: Fri, 2 Dec 2011 08:19:18 -0800
+Subject: iwlwifi: do not re-configure HT40 after associated
+
+From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
+
+commit 34a5b4b6af104cf18eb50748509528b9bdbc4036 upstream.
+
+The ht40 setting should not change after association unless channel switch
+
+This fix a problem we are seeing which cause uCode assert because driver
+sending invalid information and make uCode confuse
+
+Here is the firmware assert message:
+kernel: iwlagn 0000:03:00.0: Microcode SW error detected.  Restarting 0x82000000.
+kernel: iwlagn 0000:03:00.0: Loaded firmware version: 17.168.5.3 build 42301
+kernel: iwlagn 0000:03:00.0: Start IWL Error Log Dump:
+kernel: iwlagn 0000:03:00.0: Status: 0x000512E4, count: 6
+kernel: iwlagn 0000:03:00.0: 0x00002078 | ADVANCED_SYSASSERT
+kernel: iwlagn 0000:03:00.0: 0x00009514 | uPc
+kernel: iwlagn 0000:03:00.0: 0x00009496 | branchlink1
+kernel: iwlagn 0000:03:00.0: 0x00009496 | branchlink2
+kernel: iwlagn 0000:03:00.0: 0x0000D1F2 | interruptlink1
+kernel: iwlagn 0000:03:00.0: 0x00000000 | interruptlink2
+kernel: iwlagn 0000:03:00.0: 0x01008035 | data1
+kernel: iwlagn 0000:03:00.0: 0x0000C90F | data2
+kernel: iwlagn 0000:03:00.0: 0x000005A7 | line
+kernel: iwlagn 0000:03:00.0: 0x5080B520 | beacon time
+kernel: iwlagn 0000:03:00.0: 0xCC515AE0 | tsf low
+kernel: iwlagn 0000:03:00.0: 0x00000003 | tsf hi
+kernel: iwlagn 0000:03:00.0: 0x00000000 | time gp1
+kernel: iwlagn 0000:03:00.0: 0x29703BF0 | time gp2
+kernel: iwlagn 0000:03:00.0: 0x00000000 | time gp3
+kernel: iwlagn 0000:03:00.0: 0x000111A8 | uCode version
+kernel: iwlagn 0000:03:00.0: 0x000000B0 | hw version
+kernel: iwlagn 0000:03:00.0: 0x00480303 | board version
+kernel: iwlagn 0000:03:00.0: 0x09E8004E | hcmd
+kernel: iwlagn 0000:03:00.0: CSR values:
+kernel: iwlagn 0000:03:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)
+kernel: iwlagn 0000:03:00.0:        CSR_HW_IF_CONFIG_REG: 0X00480303
+kernel: iwlagn 0000:03:00.0:          CSR_INT_COALESCING: 0X0000ff40
+kernel: iwlagn 0000:03:00.0:                     CSR_INT: 0X00000000
+kernel: iwlagn 0000:03:00.0:                CSR_INT_MASK: 0X00000000
+kernel: iwlagn 0000:03:00.0:           CSR_FH_INT_STATUS: 0X00000000
+kernel: iwlagn 0000:03:00.0:                 CSR_GPIO_IN: 0X00000030
+kernel: iwlagn 0000:03:00.0:                   CSR_RESET: 0X00000000
+kernel: iwlagn 0000:03:00.0:                CSR_GP_CNTRL: 0X080403c5
+kernel: iwlagn 0000:03:00.0:                  CSR_HW_REV: 0X000000b0
+kernel: iwlagn 0000:03:00.0:              CSR_EEPROM_REG: 0X07d60ffd
+kernel: iwlagn 0000:03:00.0:               CSR_EEPROM_GP: 0X90000001
+kernel: iwlagn 0000:03:00.0:              CSR_OTP_GP_REG: 0X00030001
+kernel: iwlagn 0000:03:00.0:                 CSR_GIO_REG: 0X00080044
+kernel: iwlagn 0000:03:00.0:            CSR_GP_UCODE_REG: 0X000093bb
+kernel: iwlagn 0000:03:00.0:           CSR_GP_DRIVER_REG: 0X00000000
+kernel: iwlagn 0000:03:00.0:           CSR_UCODE_DRV_GP1: 0X00000000
+kernel: iwlagn 0000:03:00.0:           CSR_UCODE_DRV_GP2: 0X00000000
+kernel: iwlagn 0000:03:00.0:                 CSR_LED_REG: 0X00000078
+kernel: iwlagn 0000:03:00.0:        CSR_DRAM_INT_TBL_REG: 0X88214dd2
+kernel: iwlagn 0000:03:00.0:        CSR_GIO_CHICKEN_BITS: 0X27800200
+kernel: iwlagn 0000:03:00.0:             CSR_ANA_PLL_CFG: 0X00000000
+kernel: iwlagn 0000:03:00.0:           CSR_HW_REV_WA_REG: 0X0001001a
+kernel: iwlagn 0000:03:00.0:        CSR_DBG_HPET_MEM_REG: 0Xffff0010
+kernel: iwlagn 0000:03:00.0: FH register values:
+kernel: iwlagn 0000:03:00.0:         FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X21316d00
+kernel: iwlagn 0000:03:00.0:        FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X021479c0
+kernel: iwlagn 0000:03:00.0:                  FH_RSCSR_CHNL0_WPTR: 0X00000060
+kernel: iwlagn 0000:03:00.0:         FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104
+kernel: iwlagn 0000:03:00.0:          FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc
+kernel: iwlagn 0000:03:00.0:            FH_MEM_RSSR_RX_STATUS_REG: 0X07030000
+kernel: iwlagn 0000:03:00.0:    FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000
+kernel: iwlagn 0000:03:00.0:                FH_TSSR_TX_STATUS_REG: 0X07ff0001
+kernel: iwlagn 0000:03:00.0:                 FH_TSSR_TX_ERROR_REG: 0X00000000
+kernel: iwlagn 0000:03:00.0: Start IWL Event Log Dump: display last 20 entries
+kernel: ------------[ cut here ]------------
+WARNING: at net/mac80211/util.c:1208 ieee80211_reconfig+0x1f1/0x407()
+kernel: Hardware name: 4290W4H
+kernel: Pid: 1896, comm: kworker/0:0 Not tainted 3.1.0 #2
+kernel: Call Trace:
+kernel:  [<ffffffff81036558>] ? warn_slowpath_common+0x73/0x87
+kernel:  [<ffffffff813b8966>] ? ieee80211_reconfig+0x1f1/0x407
+kernel:  [<ffffffff8139e8dc>] ? ieee80211_recalc_smps_work+0x32/0x32
+kernel:  [<ffffffff8139e95a>] ? ieee80211_restart_work+0x7e/0x87
+kernel:  [<ffffffff810472fa>] ? process_one_work+0x1c8/0x2e3
+kernel:  [<ffffffff810480c9>] ? worker_thread+0x17a/0x23a
+kernel:  [<ffffffff81047f4f>] ? manage_workers.clone.18+0x15b/0x15b
+kernel:  [<ffffffff81047f4f>] ? manage_workers.clone.18+0x15b/0x15b
+kernel:  [<ffffffff8104ba97>] ? kthread+0x7a/0x82
+kernel:  [<ffffffff813d21b4>] ? kernel_thread_helper+0x4/0x10
+kernel:  [<ffffffff8104ba1d>] ? kthread_flush_work_fn+0x11/0x11
+kernel:  [<ffffffff813d21b0>] ? gs_change+0xb/0xb
+
+Reported-by: Udo Steinberg <udo@hypervisor.org>
+Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/wireless/iwlwifi/iwl-agn-rxon.c |   36 +++++++++++++++++-----------
+ drivers/net/wireless/iwlwifi/iwl-agn.c      |   18 ++------------
+ drivers/net/wireless/iwlwifi/iwl-agn.h      |    2 +
+ 3 files changed, 28 insertions(+), 28 deletions(-)
+
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+@@ -542,6 +542,24 @@ int iwlagn_commit_rxon(struct iwl_priv *
+       return 0;
+ }
++void iwlagn_config_ht40(struct ieee80211_conf *conf,
++      struct iwl_rxon_context *ctx)
++{
++      if (conf_is_ht40_minus(conf)) {
++              ctx->ht.extension_chan_offset =
++                      IEEE80211_HT_PARAM_CHA_SEC_BELOW;
++              ctx->ht.is_40mhz = true;
++      } else if (conf_is_ht40_plus(conf)) {
++              ctx->ht.extension_chan_offset =
++                      IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
++              ctx->ht.is_40mhz = true;
++      } else {
++              ctx->ht.extension_chan_offset =
++                      IEEE80211_HT_PARAM_CHA_SEC_NONE;
++              ctx->ht.is_40mhz = false;
++      }
++}
++
+ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
+ {
+       struct iwl_priv *priv = hw->priv;
+@@ -600,19 +618,11 @@ int iwlagn_mac_config(struct ieee80211_h
+                               ctx->ht.enabled = conf_is_ht(conf);
+                       if (ctx->ht.enabled) {
+-                              if (conf_is_ht40_minus(conf)) {
+-                                      ctx->ht.extension_chan_offset =
+-                                              IEEE80211_HT_PARAM_CHA_SEC_BELOW;
+-                                      ctx->ht.is_40mhz = true;
+-                              } else if (conf_is_ht40_plus(conf)) {
+-                                      ctx->ht.extension_chan_offset =
+-                                              IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
+-                                      ctx->ht.is_40mhz = true;
+-                              } else {
+-                                      ctx->ht.extension_chan_offset =
+-                                              IEEE80211_HT_PARAM_CHA_SEC_NONE;
+-                                      ctx->ht.is_40mhz = false;
+-                              }
++                              /* if HT40 is used, it should not change
++                               * after associated except channel switch */
++                              if (iwl_is_associated_ctx(ctx) &&
++                                   !ctx->ht.is_40mhz)
++                                      iwlagn_config_ht40(conf, ctx);
+                       } else
+                               ctx->ht.is_40mhz = false;
+--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
+@@ -3075,21 +3075,9 @@ static void iwlagn_mac_channel_switch(st
+       /* Configure HT40 channels */
+       ctx->ht.enabled = conf_is_ht(conf);
+-      if (ctx->ht.enabled) {
+-              if (conf_is_ht40_minus(conf)) {
+-                      ctx->ht.extension_chan_offset =
+-                              IEEE80211_HT_PARAM_CHA_SEC_BELOW;
+-                      ctx->ht.is_40mhz = true;
+-              } else if (conf_is_ht40_plus(conf)) {
+-                      ctx->ht.extension_chan_offset =
+-                              IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
+-                      ctx->ht.is_40mhz = true;
+-              } else {
+-                      ctx->ht.extension_chan_offset =
+-                              IEEE80211_HT_PARAM_CHA_SEC_NONE;
+-                      ctx->ht.is_40mhz = false;
+-              }
+-      } else
++      if (ctx->ht.enabled)
++              iwlagn_config_ht40(conf, ctx);
++      else
+               ctx->ht.is_40mhz = false;
+       if ((le16_to_cpu(ctx->staging.channel) != ch))
+--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
++++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
+@@ -135,6 +135,8 @@ void iwlagn_bss_info_changed(struct ieee
+                            struct ieee80211_vif *vif,
+                            struct ieee80211_bss_conf *bss_conf,
+                            u32 changes);
++void iwlagn_config_ht40(struct ieee80211_conf *conf,
++                      struct iwl_rxon_context *ctx);
+ /* uCode */
+ void iwlagn_rx_calib_result(struct iwl_priv *priv,
diff --git a/queue-3.1/rtc-disable-the-alarm-in-the-hardware.patch b/queue-3.1/rtc-disable-the-alarm-in-the-hardware.patch
new file mode 100644 (file)
index 0000000..3fb3a8a
--- /dev/null
@@ -0,0 +1,112 @@
+From c0afabd3d553c521e003779c127143ffde55a16f Mon Sep 17 00:00:00 2001
+From: Rabin Vincent <rabin.vincent@stericsson.com>
+Date: Tue, 22 Nov 2011 11:03:14 +0100
+Subject: rtc: Disable the alarm in the hardware
+
+From: Rabin Vincent <rabin.vincent@stericsson.com>
+
+commit c0afabd3d553c521e003779c127143ffde55a16f upstream.
+
+Currently, the RTC code does not disable the alarm in the hardware.
+
+This means that after a sequence such as the one below (the files are in the
+RTC sysfs), the box will boot up after 2 minutes even though we've
+asked for the alarm to be turned off.
+
+       # echo $((`cat since_epoch`)+120) > wakealarm
+       # echo 0 > wakealarm
+       # poweroff
+
+Fix this by disabling the alarm when there are no timers to run.
+
+Cc: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/rtc/interface.c |   44 ++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 34 insertions(+), 10 deletions(-)
+
+--- a/drivers/rtc/interface.c
++++ b/drivers/rtc/interface.c
+@@ -318,6 +318,20 @@ int rtc_read_alarm(struct rtc_device *rt
+ }
+ EXPORT_SYMBOL_GPL(rtc_read_alarm);
++static int ___rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
++{
++      int err;
++
++      if (!rtc->ops)
++              err = -ENODEV;
++      else if (!rtc->ops->set_alarm)
++              err = -EINVAL;
++      else
++              err = rtc->ops->set_alarm(rtc->dev.parent, alarm);
++
++      return err;
++}
++
+ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
+ {
+       struct rtc_time tm;
+@@ -341,14 +355,7 @@ static int __rtc_set_alarm(struct rtc_de
+        * over right here, before we set the alarm.
+        */
+-      if (!rtc->ops)
+-              err = -ENODEV;
+-      else if (!rtc->ops->set_alarm)
+-              err = -EINVAL;
+-      else
+-              err = rtc->ops->set_alarm(rtc->dev.parent, alarm);
+-
+-      return err;
++      return ___rtc_set_alarm(rtc, alarm);
+ }
+ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
+@@ -762,6 +769,20 @@ static int rtc_timer_enqueue(struct rtc_
+       return 0;
+ }
++static void rtc_alarm_disable(struct rtc_device *rtc)
++{
++      struct rtc_wkalrm alarm;
++      struct rtc_time tm;
++
++      __rtc_read_time(rtc, &tm);
++
++      alarm.time = rtc_ktime_to_tm(ktime_add(rtc_tm_to_ktime(tm),
++                                   ktime_set(300, 0)));
++      alarm.enabled = 0;
++
++      ___rtc_set_alarm(rtc, &alarm);
++}
++
+ /**
+  * rtc_timer_remove - Removes a rtc_timer from the rtc_device timerqueue
+  * @rtc rtc device
+@@ -783,8 +804,10 @@ static void rtc_timer_remove(struct rtc_
+               struct rtc_wkalrm alarm;
+               int err;
+               next = timerqueue_getnext(&rtc->timerqueue);
+-              if (!next)
++              if (!next) {
++                      rtc_alarm_disable(rtc);
+                       return;
++              }
+               alarm.time = rtc_ktime_to_tm(next->expires);
+               alarm.enabled = 1;
+               err = __rtc_set_alarm(rtc, &alarm);
+@@ -846,7 +869,8 @@ again:
+               err = __rtc_set_alarm(rtc, &alarm);
+               if (err == -ETIME)
+                       goto again;
+-      }
++      } else
++              rtc_alarm_disable(rtc);
+       mutex_unlock(&rtc->ops_lock);
+ }
diff --git a/queue-3.1/rtc-fix-some-bugs-that-allowed-accumulating-time-drift-in-suspend-resume.patch b/queue-3.1/rtc-fix-some-bugs-that-allowed-accumulating-time-drift-in-suspend-resume.patch
new file mode 100644 (file)
index 0000000..406499b
--- /dev/null
@@ -0,0 +1,64 @@
+From 6a8943d9ec2567572fca25cf69ad45844d0141a3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
+Date: Tue, 22 Nov 2011 18:24:51 -0800
+Subject: rtc: Fix some bugs that allowed accumulating time drift in suspend/resume
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
+
+commit 6a8943d9ec2567572fca25cf69ad45844d0141a3 upstream.
+
+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.
+
+Signed-off-by: Arve Hjønnevåg <arve@android.com>
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/rtc/class.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/rtc/class.c
++++ b/drivers/rtc/class.c
+@@ -66,7 +66,7 @@ static int rtc_suspend(struct device *de
+        */
+       delta = timespec_sub(old_system, old_rtc);
+       delta_delta = timespec_sub(delta, old_delta);
+-      if (abs(delta_delta.tv_sec)  >= 2) {
++      if (delta_delta.tv_sec < -2 || delta_delta.tv_sec >= 2) {
+               /*
+                * if delta_delta is too large, assume time correction
+                * has occured and set old_delta to the current delta.
+@@ -100,9 +100,8 @@ static int rtc_resume(struct device *dev
+       rtc_tm_to_time(&tm, &new_rtc.tv_sec);
+       new_rtc.tv_nsec = 0;
+-      if (new_rtc.tv_sec <= old_rtc.tv_sec) {
+-              if (new_rtc.tv_sec < old_rtc.tv_sec)
+-                      pr_debug("%s:  time travel!\n", dev_name(&rtc->dev));
++      if (new_rtc.tv_sec < old_rtc.tv_sec) {
++              pr_debug("%s:  time travel!\n", dev_name(&rtc->dev));
+               return 0;
+       }
+@@ -119,7 +118,8 @@ static int rtc_resume(struct device *dev
+       sleep_time = timespec_sub(sleep_time,
+                       timespec_sub(new_system, old_system));
+-      timekeeping_inject_sleeptime(&sleep_time);
++      if (sleep_time.tv_sec >= 0)
++              timekeeping_inject_sleeptime(&sleep_time);
+       return 0;
+ }
index c8771a4c362c7d039291e6e7554ff8695f6739cf..5fc19b9415968eea7322ec2a849edd7d1af14d92 100644 (file)
@@ -89,3 +89,9 @@ cfg80211-fix-race-on-init-and-driver-registration.patch
 cfg80211-amend-regulatory-null-dereference-fix.patch
 genirq-fix-race-condition-when-stopping-the-irq-thread.patch
 slab-lockdep-fix-silly-bug.patch
+iwlwifi-do-not-re-configure-ht40-after-associated.patch
+iwlagn-fix-hw-crypto-for-tx-only-keys.patch
+ftrace-remove-force-undef-config-value-left-for-testing.patch
+trace_events_filter-use-rcu_assign_pointer-when-setting-ftrace_event_call-filter.patch
+rtc-disable-the-alarm-in-the-hardware.patch
+rtc-fix-some-bugs-that-allowed-accumulating-time-drift-in-suspend-resume.patch
diff --git a/queue-3.1/trace_events_filter-use-rcu_assign_pointer-when-setting-ftrace_event_call-filter.patch b/queue-3.1/trace_events_filter-use-rcu_assign_pointer-when-setting-ftrace_event_call-filter.patch
new file mode 100644 (file)
index 0000000..587ce54
--- /dev/null
@@ -0,0 +1,58 @@
+From d3d9acf646679c1981032b0985b386d12fccc60c Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Wed, 23 Nov 2011 08:49:49 -0800
+Subject: trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter
+
+From: Tejun Heo <tj@kernel.org>
+
+commit d3d9acf646679c1981032b0985b386d12fccc60c upstream.
+
+ftrace_event_call->filter is sched RCU protected but didn't use
+rcu_assign_pointer().  Use it.
+
+TODO: Add proper __rcu annotation to call->filter and all its users.
+
+-v2: Use RCU_INIT_POINTER() for %NULL clearing as suggested by Eric.
+
+Link: http://lkml.kernel.org/r/20111123164949.GA29639@google.com
+
+Cc: Eric Dumazet <eric.dumazet@gmail.com>
+Cc: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/trace/trace_events_filter.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/kernel/trace/trace_events_filter.c
++++ b/kernel/trace/trace_events_filter.c
+@@ -1766,7 +1766,7 @@ static int replace_system_preds(struct e
+                * replace the filter for the call.
+                */
+               filter = call->filter;
+-              call->filter = filter_item->filter;
++              rcu_assign_pointer(call->filter, filter_item->filter);
+               filter_item->filter = filter;
+               fail = false;
+@@ -1821,7 +1821,7 @@ int apply_event_filter(struct ftrace_eve
+               filter = call->filter;
+               if (!filter)
+                       goto out_unlock;
+-              call->filter = NULL;
++              RCU_INIT_POINTER(call->filter, NULL);
+               /* Make sure the filter is not being used */
+               synchronize_sched();
+               __free_filter(filter);
+@@ -1862,7 +1862,7 @@ out:
+        * string
+        */
+       tmp = call->filter;
+-      call->filter = filter;
++      rcu_assign_pointer(call->filter, filter);
+       if (tmp) {
+               /* Make sure the call is done with the filter */
+               synchronize_sched();