From 75b5a315ef87b835cf77c985e9bc69bf179c26d1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 14 Jun 2013 13:06:48 -0700 Subject: [PATCH] 3.9-stable patches added patches: acpi-video-do-not-bind-to-device-objects-with-a-scan-handler.patch ath9k-disable-powersave-by-default.patch ath9k-use-minstrel-rate-control-by-default.patch bluetooth-fix-mgmt-handling-of-power-on-failures.patch bluetooth-fix-missing-length-checks-for-l2cap-signalling-pdus.patch ceph-add-cpu_to_le32-calls-when-encoding-a-reconnect-capability.patch ceph-ceph_pagelist_append-might-sleep-while-atomic.patch cpu-hotplug-provide-a-generic-helper-to-disable-enable-cpu-hotplug.patch drivers-rtc-rtc-twl.c-fix-missing-device_init_wakeup-when-booted-with-device-tree.patch drm-gma500-cdv-unpin-framebuffer-on-crtc-disable.patch drm-gma500-psb-unpin-framebuffer-on-crtc-disable.patch kmsg-honor-dmesg_restrict-sysctl-on-dev-kmsg.patch libceph-must-hold-mutex-for-reset_changed_osds.patch rbd-don-t-destroy-ceph_opts-in-rbd_add.patch reboot-rigrate-shutdown-reboot-to-boot-cpu.patch revert-ath9k_hw-update-rx-gain-initval-to-improve-rx-sensitivity.patch s390-pci-implement-irq-functions-if-pci.patch --- ...o-device-objects-with-a-scan-handler.patch | 64 +++++ .../ath9k-disable-powersave-by-default.patch | 37 +++ ...use-minstrel-rate-control-by-default.patch | 90 ++++++ ...x-mgmt-handling-of-power-on-failures.patch | 98 +++++++ ...gth-checks-for-l2cap-signalling-pdus.patch | 244 ++++++++++++++++ ...when-encoding-a-reconnect-capability.patch | 67 +++++ ...list_append-might-sleep-while-atomic.patch | 272 ++++++++++++++++++ ...helper-to-disable-enable-cpu-hotplug.patch | 138 +++++++++ ..._wakeup-when-booted-with-device-tree.patch | 43 +++ ...dv-unpin-framebuffer-on-crtc-disable.patch | 54 ++++ ...sb-unpin-framebuffer-on-crtc-disable.patch | 54 ++++ ...or-dmesg_restrict-sysctl-on-dev-kmsg.patch | 240 ++++++++++++++++ ...st-hold-mutex-for-reset_changed_osds.patch | 55 ++++ ...d-don-t-destroy-ceph_opts-in-rbd_add.patch | 72 +++++ ...-rigrate-shutdown-reboot-to-boot-cpu.patch | 100 +++++++ ...in-initval-to-improve-rx-sensitivity.patch | 43 +++ ...0-pci-implement-irq-functions-if-pci.patch | 143 +++++++++ queue-3.9/series | 17 ++ 18 files changed, 1831 insertions(+) create mode 100644 queue-3.9/acpi-video-do-not-bind-to-device-objects-with-a-scan-handler.patch create mode 100644 queue-3.9/ath9k-disable-powersave-by-default.patch create mode 100644 queue-3.9/ath9k-use-minstrel-rate-control-by-default.patch create mode 100644 queue-3.9/bluetooth-fix-mgmt-handling-of-power-on-failures.patch create mode 100644 queue-3.9/bluetooth-fix-missing-length-checks-for-l2cap-signalling-pdus.patch create mode 100644 queue-3.9/ceph-add-cpu_to_le32-calls-when-encoding-a-reconnect-capability.patch create mode 100644 queue-3.9/ceph-ceph_pagelist_append-might-sleep-while-atomic.patch create mode 100644 queue-3.9/cpu-hotplug-provide-a-generic-helper-to-disable-enable-cpu-hotplug.patch create mode 100644 queue-3.9/drivers-rtc-rtc-twl.c-fix-missing-device_init_wakeup-when-booted-with-device-tree.patch create mode 100644 queue-3.9/drm-gma500-cdv-unpin-framebuffer-on-crtc-disable.patch create mode 100644 queue-3.9/drm-gma500-psb-unpin-framebuffer-on-crtc-disable.patch create mode 100644 queue-3.9/kmsg-honor-dmesg_restrict-sysctl-on-dev-kmsg.patch create mode 100644 queue-3.9/libceph-must-hold-mutex-for-reset_changed_osds.patch create mode 100644 queue-3.9/rbd-don-t-destroy-ceph_opts-in-rbd_add.patch create mode 100644 queue-3.9/reboot-rigrate-shutdown-reboot-to-boot-cpu.patch create mode 100644 queue-3.9/revert-ath9k_hw-update-rx-gain-initval-to-improve-rx-sensitivity.patch create mode 100644 queue-3.9/s390-pci-implement-irq-functions-if-pci.patch diff --git a/queue-3.9/acpi-video-do-not-bind-to-device-objects-with-a-scan-handler.patch b/queue-3.9/acpi-video-do-not-bind-to-device-objects-with-a-scan-handler.patch new file mode 100644 index 00000000000..89462dc9d85 --- /dev/null +++ b/queue-3.9/acpi-video-do-not-bind-to-device-objects-with-a-scan-handler.patch @@ -0,0 +1,64 @@ +From 8c9b7a7b2fc2750af418ddc28e707c42e78aa0bf Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Mon, 10 Jun 2013 13:00:29 +0200 +Subject: ACPI / video: Do not bind to device objects with a scan handler + +From: "Rafael J. Wysocki" + +commit 8c9b7a7b2fc2750af418ddc28e707c42e78aa0bf upstream. + +With the introduction of ACPI scan handlers, ACPI device objects +with an ACPI scan handler attached to them must not be bound to +by ACPI drivers any more. Unfortunately, however, the ACPI video +driver attempts to do just that if there is a _ROM ACPI control +method defined under a device object with an ACPI scan handler. + +Prevent that from happening by making the video driver's "add" +routine check if the device object already has an ACPI scan handler +attached to it and return an error code in that case. + +That is not sufficient, though, because acpi_bus_driver_init() would +then clear the device object's driver_data that may be set by its +scan handler, so for the fix to work acpi_bus_driver_init() has to be +modified to leave driver_data as is on errors. + +References: https://bugzilla.kernel.org/show_bug.cgi?id=58091 +Bisected-and-tested-by: Dmitry S. Demin +Reported-and-tested-by: Jason Cassell +Tracked-down-by: Aaron Lu +Signed-off-by: Rafael J. Wysocki +Reviewed-by: Aaron Lu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/scan.c | 5 +---- + drivers/acpi/video.c | 3 +++ + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -830,11 +830,8 @@ acpi_bus_driver_init(struct acpi_device + return -ENOSYS; + + result = driver->ops.add(device); +- if (result) { +- device->driver = NULL; +- device->driver_data = NULL; ++ if (result) + return result; +- } + + device->driver = driver; + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -1646,6 +1646,9 @@ static int acpi_video_bus_add(struct acp + int error; + acpi_status status; + ++ if (device->handler) ++ return -EINVAL; ++ + status = acpi_walk_namespace(ACPI_TYPE_DEVICE, + device->parent->handle, 1, + acpi_video_bus_match, NULL, diff --git a/queue-3.9/ath9k-disable-powersave-by-default.patch b/queue-3.9/ath9k-disable-powersave-by-default.patch new file mode 100644 index 00000000000..ba8e30f6319 --- /dev/null +++ b/queue-3.9/ath9k-disable-powersave-by-default.patch @@ -0,0 +1,37 @@ +From 531671cb17af07281e6f28c1425f754346e65c41 Mon Sep 17 00:00:00 2001 +From: Sujith Manoharan +Date: Sat, 1 Jun 2013 07:08:09 +0530 +Subject: ath9k: Disable PowerSave by default + +From: Sujith Manoharan + +commit 531671cb17af07281e6f28c1425f754346e65c41 upstream. + +Almost all the DMA issues which have plagued ath9k (in station mode) +for years are related to PS. Disabling PS usually "fixes" the user's +connection stablility. Reports of DMA problems are still trickling in +and are sitting in the kernel bugzilla. Until the PS code in ath9k is +given a thorough review, disbale it by default. The slight increase +in chip power consumption is a small price to pay for improved link +stability. + +Signed-off-by: Sujith Manoharan +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath9k/init.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -766,8 +766,7 @@ void ath9k_set_hw_capab(struct ath_softc + hw->wiphy->iface_combinations = &if_comb; + hw->wiphy->n_iface_combinations = 1; + +- if (AR_SREV_5416(sc->sc_ah)) +- hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; ++ hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; + + hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; + hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; diff --git a/queue-3.9/ath9k-use-minstrel-rate-control-by-default.patch b/queue-3.9/ath9k-use-minstrel-rate-control-by-default.patch new file mode 100644 index 00000000000..b84258f1ebc --- /dev/null +++ b/queue-3.9/ath9k-use-minstrel-rate-control-by-default.patch @@ -0,0 +1,90 @@ +From 5efac94999ff218e0101f67a059e44abb4b0b523 Mon Sep 17 00:00:00 2001 +From: Sujith Manoharan +Date: Thu, 6 Jun 2013 10:06:29 +0530 +Subject: ath9k: Use minstrel rate control by default + +From: Sujith Manoharan + +commit 5efac94999ff218e0101f67a059e44abb4b0b523 upstream. + +The ath9k rate control algorithm has various architectural +issues that make it a poor fit in scenarios like congested +environments etc. + +An example: https://bugzilla.redhat.com/show_bug.cgi?id=927191 + +Change the default to minstrel which is more robust in such cases. +The ath9k RC code is left in the driver for now, maybe it can +be removed altogether later on. + +Signed-off-by: Sujith Manoharan +Cc: Jouni Malinen +Cc: Linus Torvalds +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath9k/Kconfig | 10 +++++++--- + drivers/net/wireless/ath/ath9k/Makefile | 2 +- + drivers/net/wireless/ath/ath9k/init.c | 4 ---- + drivers/net/wireless/ath/ath9k/rc.h | 2 +- + 4 files changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/net/wireless/ath/ath9k/Kconfig ++++ b/drivers/net/wireless/ath/ath9k/Kconfig +@@ -92,13 +92,17 @@ config ATH9K_MAC_DEBUG + This option enables collection of statistics for Rx/Tx status + data and some other MAC related statistics + +-config ATH9K_RATE_CONTROL ++config ATH9K_LEGACY_RATE_CONTROL + bool "Atheros ath9k rate control" + depends on ATH9K +- default y ++ default n + ---help--- + Say Y, if you want to use the ath9k specific rate control +- module instead of minstrel_ht. ++ module instead of minstrel_ht. Be warned that there are various ++ issues with the ath9k RC and minstrel is a more robust algorithm. ++ Note that even if this option is selected, "ath9k_rate_control" ++ has to be passed to mac80211 using the module parameter, ++ ieee80211_default_rc_algo. + + config ATH9K_HTC + tristate "Atheros HTC based wireless cards support" +--- a/drivers/net/wireless/ath/ath9k/Makefile ++++ b/drivers/net/wireless/ath/ath9k/Makefile +@@ -8,7 +8,7 @@ ath9k-y += beacon.o \ + antenna.o + + ath9k-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += mci.o +-ath9k-$(CONFIG_ATH9K_RATE_CONTROL) += rc.o ++ath9k-$(CONFIG_ATH9K_LEGACY_RATE_CONTROL) += rc.o + ath9k-$(CONFIG_ATH9K_PCI) += pci.o + ath9k-$(CONFIG_ATH9K_AHB) += ahb.o + ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -808,10 +808,6 @@ void ath9k_set_hw_capab(struct ath_softc + sc->ant_rx = hw->wiphy->available_antennas_rx; + sc->ant_tx = hw->wiphy->available_antennas_tx; + +-#ifdef CONFIG_ATH9K_RATE_CONTROL +- hw->rate_control_algorithm = "ath9k_rate_control"; +-#endif +- + if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) + hw->wiphy->bands[IEEE80211_BAND_2GHZ] = + &sc->sbands[IEEE80211_BAND_2GHZ]; +--- a/drivers/net/wireless/ath/ath9k/rc.h ++++ b/drivers/net/wireless/ath/ath9k/rc.h +@@ -231,7 +231,7 @@ static inline void ath_debug_stat_retrie + } + #endif + +-#ifdef CONFIG_ATH9K_RATE_CONTROL ++#ifdef CONFIG_ATH9K_LEGACY_RATE_CONTROL + int ath_rate_control_register(void); + void ath_rate_control_unregister(void); + #else diff --git a/queue-3.9/bluetooth-fix-mgmt-handling-of-power-on-failures.patch b/queue-3.9/bluetooth-fix-mgmt-handling-of-power-on-failures.patch new file mode 100644 index 00000000000..39d723aeba7 --- /dev/null +++ b/queue-3.9/bluetooth-fix-mgmt-handling-of-power-on-failures.patch @@ -0,0 +1,98 @@ +From 96570ffcca0b872dc8626e97569d2697f374d868 Mon Sep 17 00:00:00 2001 +From: Johan Hedberg +Date: Wed, 29 May 2013 09:51:29 +0300 +Subject: Bluetooth: Fix mgmt handling of power on failures + +From: Johan Hedberg + +commit 96570ffcca0b872dc8626e97569d2697f374d868 upstream. + +If hci_dev_open fails we need to ensure that the corresponding +mgmt_set_powered command gets an appropriate response. This patch fixes +the missing response by adding a new mgmt_set_powered_failed function +that's used to indicate a power on failure to mgmt. Since a situation +with the device being rfkilled may require special handling in user +space the patch uses a new dedicated mgmt status code for this. + +Signed-off-by: Johan Hedberg +Acked-by: Marcel Holtmann +Signed-off-by: Gustavo Padovan +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + include/net/bluetooth/hci_core.h | 1 + + include/net/bluetooth/mgmt.h | 1 + + net/bluetooth/hci_core.c | 6 +++++- + net/bluetooth/mgmt.c | 21 +++++++++++++++++++++ + 4 files changed, 28 insertions(+), 1 deletion(-) + +--- a/include/net/bluetooth/hci_core.h ++++ b/include/net/bluetooth/hci_core.h +@@ -1065,6 +1065,7 @@ void hci_sock_dev_event(struct hci_dev * + int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); + int mgmt_index_added(struct hci_dev *hdev); + int mgmt_index_removed(struct hci_dev *hdev); ++int mgmt_set_powered_failed(struct hci_dev *hdev, int err); + int mgmt_powered(struct hci_dev *hdev, u8 powered); + int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); + int mgmt_connectable(struct hci_dev *hdev, u8 connectable); +--- a/include/net/bluetooth/mgmt.h ++++ b/include/net/bluetooth/mgmt.h +@@ -42,6 +42,7 @@ + #define MGMT_STATUS_NOT_POWERED 0x0f + #define MGMT_STATUS_CANCELLED 0x10 + #define MGMT_STATUS_INVALID_INDEX 0x11 ++#define MGMT_STATUS_RFKILLED 0x12 + + struct mgmt_hdr { + __le16 opcode; +--- a/net/bluetooth/hci_core.c ++++ b/net/bluetooth/hci_core.c +@@ -1139,11 +1139,15 @@ static const struct rfkill_ops hci_rfkil + static void hci_power_on(struct work_struct *work) + { + struct hci_dev *hdev = container_of(work, struct hci_dev, power_on); ++ int err; + + BT_DBG("%s", hdev->name); + +- if (hci_dev_open(hdev->id) < 0) ++ err = hci_dev_open(hdev->id); ++ if (err < 0) { ++ mgmt_set_powered_failed(hdev, err); + return; ++ } + + if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) + queue_delayed_work(hdev->req_workqueue, &hdev->power_off, +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -3124,6 +3124,27 @@ int mgmt_powered(struct hci_dev *hdev, u + return err; + } + ++int mgmt_set_powered_failed(struct hci_dev *hdev, int err) ++{ ++ struct pending_cmd *cmd; ++ u8 status; ++ ++ cmd = mgmt_pending_find(MGMT_OP_SET_POWERED, hdev); ++ if (!cmd) ++ return -ENOENT; ++ ++ if (err == -ERFKILL) ++ status = MGMT_STATUS_RFKILLED; ++ else ++ status = MGMT_STATUS_FAILED; ++ ++ err = cmd_status(cmd->sk, hdev->id, MGMT_OP_SET_POWERED, status); ++ ++ mgmt_pending_remove(cmd); ++ ++ return err; ++} ++ + int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable) + { + struct cmd_lookup match = { NULL, hdev }; diff --git a/queue-3.9/bluetooth-fix-missing-length-checks-for-l2cap-signalling-pdus.patch b/queue-3.9/bluetooth-fix-missing-length-checks-for-l2cap-signalling-pdus.patch new file mode 100644 index 00000000000..9a552c9181d --- /dev/null +++ b/queue-3.9/bluetooth-fix-missing-length-checks-for-l2cap-signalling-pdus.patch @@ -0,0 +1,244 @@ +From cb3b3152b2f5939d67005cff841a1ca748b19888 Mon Sep 17 00:00:00 2001 +From: Johan Hedberg +Date: Tue, 28 May 2013 13:46:30 +0300 +Subject: Bluetooth: Fix missing length checks for L2CAP signalling PDUs + +From: Johan Hedberg + +commit cb3b3152b2f5939d67005cff841a1ca748b19888 upstream. + +There has been code in place to check that the L2CAP length header +matches the amount of data received, but many PDU handlers have not been +checking that the data received actually matches that expected by the +specific PDU. This patch adds passing the length header to the specific +handler functions and ensures that those functions fail cleanly in the +case of an incorrect amount of data. + +Signed-off-by: Johan Hedberg +Signed-off-by: Gustavo Padovan +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + net/bluetooth/l2cap_core.c | 70 +++++++++++++++++++++++++++++++++------------ + 1 file changed, 52 insertions(+), 18 deletions(-) + +--- a/net/bluetooth/l2cap_core.c ++++ b/net/bluetooth/l2cap_core.c +@@ -3568,10 +3568,14 @@ static void l2cap_conf_rfc_get(struct l2 + } + + static inline int l2cap_command_rej(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, ++ u8 *data) + { + struct l2cap_cmd_rej_unk *rej = (struct l2cap_cmd_rej_unk *) data; + ++ if (cmd_len < sizeof(*rej)) ++ return -EPROTO; ++ + if (rej->reason != L2CAP_REJ_NOT_UNDERSTOOD) + return 0; + +@@ -3720,11 +3724,14 @@ sendresp: + } + + static int l2cap_connect_req(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data) + { + struct hci_dev *hdev = conn->hcon->hdev; + struct hci_conn *hcon = conn->hcon; + ++ if (cmd_len < sizeof(struct l2cap_conn_req)) ++ return -EPROTO; ++ + hci_dev_lock(hdev); + if (test_bit(HCI_MGMT, &hdev->dev_flags) && + !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags)) +@@ -3738,7 +3745,8 @@ static int l2cap_connect_req(struct l2ca + } + + static int l2cap_connect_create_rsp(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, ++ u8 *data) + { + struct l2cap_conn_rsp *rsp = (struct l2cap_conn_rsp *) data; + u16 scid, dcid, result, status; +@@ -3746,6 +3754,9 @@ static int l2cap_connect_create_rsp(stru + u8 req[128]; + int err; + ++ if (cmd_len < sizeof(*rsp)) ++ return -EPROTO; ++ + scid = __le16_to_cpu(rsp->scid); + dcid = __le16_to_cpu(rsp->dcid); + result = __le16_to_cpu(rsp->result); +@@ -3843,6 +3854,9 @@ static inline int l2cap_config_req(struc + struct l2cap_chan *chan; + int len, err = 0; + ++ if (cmd_len < sizeof(*req)) ++ return -EPROTO; ++ + dcid = __le16_to_cpu(req->dcid); + flags = __le16_to_cpu(req->flags); + +@@ -3866,7 +3880,7 @@ static inline int l2cap_config_req(struc + + /* Reject if config buffer is too small. */ + len = cmd_len - sizeof(*req); +- if (len < 0 || chan->conf_len + len > sizeof(chan->conf_req)) { ++ if (chan->conf_len + len > sizeof(chan->conf_req)) { + l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, + l2cap_build_conf_rsp(chan, rsp, + L2CAP_CONF_REJECT, flags), rsp); +@@ -3944,14 +3958,18 @@ unlock: + } + + static inline int l2cap_config_rsp(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, ++ u8 *data) + { + struct l2cap_conf_rsp *rsp = (struct l2cap_conf_rsp *)data; + u16 scid, flags, result; + struct l2cap_chan *chan; +- int len = le16_to_cpu(cmd->len) - sizeof(*rsp); ++ int len = cmd_len - sizeof(*rsp); + int err = 0; + ++ if (cmd_len < sizeof(*rsp)) ++ return -EPROTO; ++ + scid = __le16_to_cpu(rsp->scid); + flags = __le16_to_cpu(rsp->flags); + result = __le16_to_cpu(rsp->result); +@@ -4052,7 +4070,8 @@ done: + } + + static inline int l2cap_disconnect_req(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, ++ u8 *data) + { + struct l2cap_disconn_req *req = (struct l2cap_disconn_req *) data; + struct l2cap_disconn_rsp rsp; +@@ -4060,6 +4079,9 @@ static inline int l2cap_disconnect_req(s + struct l2cap_chan *chan; + struct sock *sk; + ++ if (cmd_len != sizeof(*req)) ++ return -EPROTO; ++ + scid = __le16_to_cpu(req->scid); + dcid = __le16_to_cpu(req->dcid); + +@@ -4099,12 +4121,16 @@ static inline int l2cap_disconnect_req(s + } + + static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, ++ u8 *data) + { + struct l2cap_disconn_rsp *rsp = (struct l2cap_disconn_rsp *) data; + u16 dcid, scid; + struct l2cap_chan *chan; + ++ if (cmd_len != sizeof(*rsp)) ++ return -EPROTO; ++ + scid = __le16_to_cpu(rsp->scid); + dcid = __le16_to_cpu(rsp->dcid); + +@@ -4134,11 +4160,15 @@ static inline int l2cap_disconnect_rsp(s + } + + static inline int l2cap_information_req(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, ++ u8 *data) + { + struct l2cap_info_req *req = (struct l2cap_info_req *) data; + u16 type; + ++ if (cmd_len != sizeof(*req)) ++ return -EPROTO; ++ + type = __le16_to_cpu(req->type); + + BT_DBG("type 0x%4.4x", type); +@@ -4185,11 +4215,15 @@ static inline int l2cap_information_req( + } + + static inline int l2cap_information_rsp(struct l2cap_conn *conn, +- struct l2cap_cmd_hdr *cmd, u8 *data) ++ struct l2cap_cmd_hdr *cmd, u16 cmd_len, ++ u8 *data) + { + struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) data; + u16 type, result; + ++ if (cmd_len != sizeof(*rsp)) ++ return -EPROTO; ++ + type = __le16_to_cpu(rsp->type); + result = __le16_to_cpu(rsp->result); + +@@ -5055,16 +5089,16 @@ static inline int l2cap_bredr_sig_cmd(st + + switch (cmd->code) { + case L2CAP_COMMAND_REJ: +- l2cap_command_rej(conn, cmd, data); ++ l2cap_command_rej(conn, cmd, cmd_len, data); + break; + + case L2CAP_CONN_REQ: +- err = l2cap_connect_req(conn, cmd, data); ++ err = l2cap_connect_req(conn, cmd, cmd_len, data); + break; + + case L2CAP_CONN_RSP: + case L2CAP_CREATE_CHAN_RSP: +- err = l2cap_connect_create_rsp(conn, cmd, data); ++ err = l2cap_connect_create_rsp(conn, cmd, cmd_len, data); + break; + + case L2CAP_CONF_REQ: +@@ -5072,15 +5106,15 @@ static inline int l2cap_bredr_sig_cmd(st + break; + + case L2CAP_CONF_RSP: +- err = l2cap_config_rsp(conn, cmd, data); ++ err = l2cap_config_rsp(conn, cmd, cmd_len, data); + break; + + case L2CAP_DISCONN_REQ: +- err = l2cap_disconnect_req(conn, cmd, data); ++ err = l2cap_disconnect_req(conn, cmd, cmd_len, data); + break; + + case L2CAP_DISCONN_RSP: +- err = l2cap_disconnect_rsp(conn, cmd, data); ++ err = l2cap_disconnect_rsp(conn, cmd, cmd_len, data); + break; + + case L2CAP_ECHO_REQ: +@@ -5091,11 +5125,11 @@ static inline int l2cap_bredr_sig_cmd(st + break; + + case L2CAP_INFO_REQ: +- err = l2cap_information_req(conn, cmd, data); ++ err = l2cap_information_req(conn, cmd, cmd_len, data); + break; + + case L2CAP_INFO_RSP: +- err = l2cap_information_rsp(conn, cmd, data); ++ err = l2cap_information_rsp(conn, cmd, cmd_len, data); + break; + + case L2CAP_CREATE_CHAN_REQ: diff --git a/queue-3.9/ceph-add-cpu_to_le32-calls-when-encoding-a-reconnect-capability.patch b/queue-3.9/ceph-add-cpu_to_le32-calls-when-encoding-a-reconnect-capability.patch new file mode 100644 index 00000000000..f014e898e64 --- /dev/null +++ b/queue-3.9/ceph-add-cpu_to_le32-calls-when-encoding-a-reconnect-capability.patch @@ -0,0 +1,67 @@ +From c420276a532a10ef59849adc2681f45306166b89 Mon Sep 17 00:00:00 2001 +From: Jim Schutt +Date: Wed, 15 May 2013 13:03:35 -0500 +Subject: ceph: add cpu_to_le32() calls when encoding a reconnect capability + +From: Jim Schutt + +commit c420276a532a10ef59849adc2681f45306166b89 upstream. + +In his review, Alex Elder mentioned that he hadn't checked that +num_fcntl_locks and num_flock_locks were properly decoded on the +server side, from a le32 over-the-wire type to a cpu type. +I checked, and AFAICS it is done; those interested can consult + Locker::_do_cap_update() +in src/mds/Locker.cc and src/include/encoding.h in the Ceph server +code (git://github.com/ceph/ceph). + +I also checked the server side for flock_len decoding, and I believe +that also happens correctly, by virtue of having been declared +__le32 in struct ceph_mds_cap_reconnect, in src/include/ceph_fs.h. + +Signed-off-by: Jim Schutt +Reviewed-by: Alex Elder +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ceph/locks.c | 7 +++++-- + fs/ceph/mds_client.c | 2 +- + 2 files changed, 6 insertions(+), 3 deletions(-) + +--- a/fs/ceph/locks.c ++++ b/fs/ceph/locks.c +@@ -206,10 +206,12 @@ int ceph_encode_locks(struct inode *inod + int err = 0; + int seen_fcntl = 0; + int seen_flock = 0; ++ __le32 nlocks; + + dout("encoding %d flock and %d fcntl locks", num_flock_locks, + num_fcntl_locks); +- err = ceph_pagelist_append(pagelist, &num_fcntl_locks, sizeof(u32)); ++ nlocks = cpu_to_le32(num_fcntl_locks); ++ err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); + if (err) + goto fail; + for (lock = inode->i_flock; lock != NULL; lock = lock->fl_next) { +@@ -229,7 +231,8 @@ int ceph_encode_locks(struct inode *inod + goto fail; + } + +- err = ceph_pagelist_append(pagelist, &num_flock_locks, sizeof(u32)); ++ nlocks = cpu_to_le32(num_flock_locks); ++ err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); + if (err) + goto fail; + for (lock = inode->i_flock; lock != NULL; lock = lock->fl_next) { +--- a/fs/ceph/mds_client.c ++++ b/fs/ceph/mds_client.c +@@ -2481,7 +2481,7 @@ static int encode_caps_cb(struct inode * + lock_flocks(); + ceph_count_locks(inode, &num_fcntl_locks, + &num_flock_locks); +- rec.v2.flock_len = (2*sizeof(u32) + ++ rec.v2.flock_len = cpu_to_le32(2*sizeof(u32) + + (num_fcntl_locks+num_flock_locks) * + sizeof(struct ceph_filelock)); + unlock_flocks(); diff --git a/queue-3.9/ceph-ceph_pagelist_append-might-sleep-while-atomic.patch b/queue-3.9/ceph-ceph_pagelist_append-might-sleep-while-atomic.patch new file mode 100644 index 00000000000..d9f91c0ebfa --- /dev/null +++ b/queue-3.9/ceph-ceph_pagelist_append-might-sleep-while-atomic.patch @@ -0,0 +1,272 @@ +From 39be95e9c8c0b5668c9f8806ffe29bf9f4bc0f40 Mon Sep 17 00:00:00 2001 +From: Jim Schutt +Date: Wed, 15 May 2013 13:03:35 -0500 +Subject: ceph: ceph_pagelist_append might sleep while atomic + +From: Jim Schutt + +commit 39be95e9c8c0b5668c9f8806ffe29bf9f4bc0f40 upstream. + +Ceph's encode_caps_cb() worked hard to not call __page_cache_alloc() +while holding a lock, but it's spoiled because ceph_pagelist_addpage() +always calls kmap(), which might sleep. Here's the result: + +[13439.295457] ceph: mds0 reconnect start +[13439.300572] BUG: sleeping function called from invalid context at include/linux/highmem.h:58 +[13439.309243] in_atomic(): 1, irqs_disabled(): 0, pid: 12059, name: kworker/1:1 + . . . +[13439.376225] Call Trace: +[13439.378757] [] __might_sleep+0xfc/0x110 +[13439.384353] [] ceph_pagelist_append+0x120/0x1b0 [libceph] +[13439.391491] [] ceph_encode_locks+0x89/0x190 [ceph] +[13439.398035] [] ? _raw_spin_lock+0x49/0x50 +[13439.403775] [] ? lock_flocks+0x15/0x20 +[13439.409277] [] encode_caps_cb+0x41f/0x4a0 [ceph] +[13439.415622] [] ? igrab+0x28/0x70 +[13439.420610] [] ? iterate_session_caps+0xe8/0x250 [ceph] +[13439.427584] [] iterate_session_caps+0x115/0x250 [ceph] +[13439.434499] [] ? set_request_path_attr+0x2d0/0x2d0 [ceph] +[13439.441646] [] send_mds_reconnect+0x238/0x450 [ceph] +[13439.448363] [] ? ceph_mdsmap_decode+0x5e2/0x770 [ceph] +[13439.455250] [] check_new_map+0x352/0x500 [ceph] +[13439.461534] [] ceph_mdsc_handle_map+0x1bd/0x260 [ceph] +[13439.468432] [] ? mutex_unlock+0xe/0x10 +[13439.473934] [] extra_mon_dispatch+0x22/0x30 [ceph] +[13439.480464] [] dispatch+0xbc/0x110 [libceph] +[13439.486492] [] process_message+0x1ad/0x1d0 [libceph] +[13439.493190] [] ? read_partial_message+0x3e8/0x520 [libceph] + . . . +[13439.587132] ceph: mds0 reconnect success +[13490.720032] ceph: mds0 caps stale +[13501.235257] ceph: mds0 recovery completed +[13501.300419] ceph: mds0 caps renewed + +Fix it up by encoding locks into a buffer first, and when the number +of encoded locks is stable, copy that into a ceph_pagelist. + +[elder@inktank.com: abbreviated the stack info a bit.] + +Signed-off-by: Jim Schutt +Reviewed-by: Alex Elder +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ceph/locks.c | 76 +++++++++++++++++++++++++++++++-------------------- + fs/ceph/mds_client.c | 63 ++++++++++++++++++++++-------------------- + fs/ceph/super.h | 9 ++++-- + 3 files changed, 88 insertions(+), 60 deletions(-) + +--- a/fs/ceph/locks.c ++++ b/fs/ceph/locks.c +@@ -191,29 +191,23 @@ void ceph_count_locks(struct inode *inod + } + + /** +- * Encode the flock and fcntl locks for the given inode into the pagelist. +- * Format is: #fcntl locks, sequential fcntl locks, #flock locks, +- * sequential flock locks. +- * Must be called with lock_flocks() already held. +- * If we encounter more of a specific lock type than expected, +- * we return the value 1. ++ * Encode the flock and fcntl locks for the given inode into the ceph_filelock ++ * array. Must be called with lock_flocks() already held. ++ * If we encounter more of a specific lock type than expected, return -ENOSPC. + */ +-int ceph_encode_locks(struct inode *inode, struct ceph_pagelist *pagelist, +- int num_fcntl_locks, int num_flock_locks) ++int ceph_encode_locks_to_buffer(struct inode *inode, ++ struct ceph_filelock *flocks, ++ int num_fcntl_locks, int num_flock_locks) + { + struct file_lock *lock; +- struct ceph_filelock cephlock; + int err = 0; + int seen_fcntl = 0; + int seen_flock = 0; +- __le32 nlocks; ++ int l = 0; + + dout("encoding %d flock and %d fcntl locks", num_flock_locks, + num_fcntl_locks); +- nlocks = cpu_to_le32(num_fcntl_locks); +- err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); +- if (err) +- goto fail; ++ + for (lock = inode->i_flock; lock != NULL; lock = lock->fl_next) { + if (lock->fl_flags & FL_POSIX) { + ++seen_fcntl; +@@ -221,20 +215,12 @@ int ceph_encode_locks(struct inode *inod + err = -ENOSPC; + goto fail; + } +- err = lock_to_ceph_filelock(lock, &cephlock); ++ err = lock_to_ceph_filelock(lock, &flocks[l]); + if (err) + goto fail; +- err = ceph_pagelist_append(pagelist, &cephlock, +- sizeof(struct ceph_filelock)); ++ ++l; + } +- if (err) +- goto fail; + } +- +- nlocks = cpu_to_le32(num_flock_locks); +- err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); +- if (err) +- goto fail; + for (lock = inode->i_flock; lock != NULL; lock = lock->fl_next) { + if (lock->fl_flags & FL_FLOCK) { + ++seen_flock; +@@ -242,19 +228,51 @@ int ceph_encode_locks(struct inode *inod + err = -ENOSPC; + goto fail; + } +- err = lock_to_ceph_filelock(lock, &cephlock); ++ err = lock_to_ceph_filelock(lock, &flocks[l]); + if (err) + goto fail; +- err = ceph_pagelist_append(pagelist, &cephlock, +- sizeof(struct ceph_filelock)); ++ ++l; + } +- if (err) +- goto fail; + } + fail: + return err; + } + ++/** ++ * Copy the encoded flock and fcntl locks into the pagelist. ++ * Format is: #fcntl locks, sequential fcntl locks, #flock locks, ++ * sequential flock locks. ++ * Returns zero on success. ++ */ ++int ceph_locks_to_pagelist(struct ceph_filelock *flocks, ++ struct ceph_pagelist *pagelist, ++ int num_fcntl_locks, int num_flock_locks) ++{ ++ int err = 0; ++ __le32 nlocks; ++ ++ nlocks = cpu_to_le32(num_fcntl_locks); ++ err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); ++ if (err) ++ goto out_fail; ++ ++ err = ceph_pagelist_append(pagelist, flocks, ++ num_fcntl_locks * sizeof(*flocks)); ++ if (err) ++ goto out_fail; ++ ++ nlocks = cpu_to_le32(num_flock_locks); ++ err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); ++ if (err) ++ goto out_fail; ++ ++ err = ceph_pagelist_append(pagelist, ++ &flocks[num_fcntl_locks], ++ num_flock_locks * sizeof(*flocks)); ++out_fail: ++ return err; ++} ++ + /* + * Given a pointer to a lock, convert it to a ceph filelock + */ +--- a/fs/ceph/mds_client.c ++++ b/fs/ceph/mds_client.c +@@ -2474,39 +2474,44 @@ static int encode_caps_cb(struct inode * + + if (recon_state->flock) { + int num_fcntl_locks, num_flock_locks; +- struct ceph_pagelist_cursor trunc_point; ++ struct ceph_filelock *flocks; + +- ceph_pagelist_set_cursor(pagelist, &trunc_point); +- do { +- lock_flocks(); +- ceph_count_locks(inode, &num_fcntl_locks, +- &num_flock_locks); +- rec.v2.flock_len = cpu_to_le32(2*sizeof(u32) + +- (num_fcntl_locks+num_flock_locks) * +- sizeof(struct ceph_filelock)); +- unlock_flocks(); +- +- /* pre-alloc pagelist */ +- ceph_pagelist_truncate(pagelist, &trunc_point); +- err = ceph_pagelist_append(pagelist, &rec, reclen); +- if (!err) +- err = ceph_pagelist_reserve(pagelist, +- rec.v2.flock_len); +- +- /* encode locks */ +- if (!err) { +- lock_flocks(); +- err = ceph_encode_locks(inode, +- pagelist, +- num_fcntl_locks, +- num_flock_locks); +- unlock_flocks(); +- } +- } while (err == -ENOSPC); ++encode_again: ++ lock_flocks(); ++ ceph_count_locks(inode, &num_fcntl_locks, &num_flock_locks); ++ unlock_flocks(); ++ flocks = kmalloc((num_fcntl_locks+num_flock_locks) * ++ sizeof(struct ceph_filelock), GFP_NOFS); ++ if (!flocks) { ++ err = -ENOMEM; ++ goto out_free; ++ } ++ lock_flocks(); ++ err = ceph_encode_locks_to_buffer(inode, flocks, ++ num_fcntl_locks, ++ num_flock_locks); ++ unlock_flocks(); ++ if (err) { ++ kfree(flocks); ++ if (err == -ENOSPC) ++ goto encode_again; ++ goto out_free; ++ } ++ /* ++ * number of encoded locks is stable, so copy to pagelist ++ */ ++ rec.v2.flock_len = cpu_to_le32(2*sizeof(u32) + ++ (num_fcntl_locks+num_flock_locks) * ++ sizeof(struct ceph_filelock)); ++ err = ceph_pagelist_append(pagelist, &rec, reclen); ++ if (!err) ++ err = ceph_locks_to_pagelist(flocks, pagelist, ++ num_fcntl_locks, ++ num_flock_locks); ++ kfree(flocks); + } else { + err = ceph_pagelist_append(pagelist, &rec, reclen); + } +- + out_free: + kfree(path); + out_dput: +--- a/fs/ceph/super.h ++++ b/fs/ceph/super.h +@@ -841,8 +841,13 @@ extern const struct export_operations ce + extern int ceph_lock(struct file *file, int cmd, struct file_lock *fl); + extern int ceph_flock(struct file *file, int cmd, struct file_lock *fl); + extern void ceph_count_locks(struct inode *inode, int *p_num, int *f_num); +-extern int ceph_encode_locks(struct inode *i, struct ceph_pagelist *p, +- int p_locks, int f_locks); ++extern int ceph_encode_locks_to_buffer(struct inode *inode, ++ struct ceph_filelock *flocks, ++ int num_fcntl_locks, ++ int num_flock_locks); ++extern int ceph_locks_to_pagelist(struct ceph_filelock *flocks, ++ struct ceph_pagelist *pagelist, ++ int num_fcntl_locks, int num_flock_locks); + extern int lock_to_ceph_filelock(struct file_lock *fl, struct ceph_filelock *c); + + /* debugfs.c */ diff --git a/queue-3.9/cpu-hotplug-provide-a-generic-helper-to-disable-enable-cpu-hotplug.patch b/queue-3.9/cpu-hotplug-provide-a-generic-helper-to-disable-enable-cpu-hotplug.patch new file mode 100644 index 00000000000..315f5b15238 --- /dev/null +++ b/queue-3.9/cpu-hotplug-provide-a-generic-helper-to-disable-enable-cpu-hotplug.patch @@ -0,0 +1,138 @@ +From 16e53dbf10a2d7e228709a7286310e629ede5e45 Mon Sep 17 00:00:00 2001 +From: "Srivatsa S. Bhat" +Date: Wed, 12 Jun 2013 14:04:36 -0700 +Subject: CPU hotplug: provide a generic helper to disable/enable CPU hotplug + +From: "Srivatsa S. Bhat" + +commit 16e53dbf10a2d7e228709a7286310e629ede5e45 upstream. + +There are instances in the kernel where we would like to disable CPU +hotplug (from sysfs) during some important operation. Today the freezer +code depends on this and the code to do it was kinda tailor-made for +that. + +Restructure the code and make it generic enough to be useful for other +usecases too. + +Signed-off-by: Srivatsa S. Bhat +Signed-off-by: Robin Holt +Cc: H. Peter Anvin +Cc: Thomas Gleixner +Cc: Ingo Molnar +Cc: Russ Anderson +Cc: Robin Holt +Cc: Russell King +Cc: Guan Xuetao +Cc: Shawn Guo +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/cpu.h | 4 +++ + kernel/cpu.c | 55 +++++++++++++++++++++------------------------------- + 2 files changed, 27 insertions(+), 32 deletions(-) + +--- a/include/linux/cpu.h ++++ b/include/linux/cpu.h +@@ -175,6 +175,8 @@ extern struct bus_type cpu_subsys; + + extern void get_online_cpus(void); + extern void put_online_cpus(void); ++extern void cpu_hotplug_disable(void); ++extern void cpu_hotplug_enable(void); + #define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri) + #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) + #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) +@@ -198,6 +200,8 @@ static inline void cpu_hotplug_driver_un + + #define get_online_cpus() do { } while (0) + #define put_online_cpus() do { } while (0) ++#define cpu_hotplug_disable() do { } while (0) ++#define cpu_hotplug_enable() do { } while (0) + #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) + /* These aren't inline functions due to a GCC bug. */ + #define register_hotcpu_notifier(nb) ({ (void)(nb); 0; }) +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -133,6 +133,27 @@ static void cpu_hotplug_done(void) + mutex_unlock(&cpu_hotplug.lock); + } + ++/* ++ * Wait for currently running CPU hotplug operations to complete (if any) and ++ * disable future CPU hotplug (from sysfs). The 'cpu_add_remove_lock' protects ++ * the 'cpu_hotplug_disabled' flag. The same lock is also acquired by the ++ * hotplug path before performing hotplug operations. So acquiring that lock ++ * guarantees mutual exclusion from any currently running hotplug operations. ++ */ ++void cpu_hotplug_disable(void) ++{ ++ cpu_maps_update_begin(); ++ cpu_hotplug_disabled = 1; ++ cpu_maps_update_done(); ++} ++ ++void cpu_hotplug_enable(void) ++{ ++ cpu_maps_update_begin(); ++ cpu_hotplug_disabled = 0; ++ cpu_maps_update_done(); ++} ++ + #else /* #if CONFIG_HOTPLUG_CPU */ + static void cpu_hotplug_begin(void) {} + static void cpu_hotplug_done(void) {} +@@ -541,36 +562,6 @@ static int __init alloc_frozen_cpus(void + core_initcall(alloc_frozen_cpus); + + /* +- * Prevent regular CPU hotplug from racing with the freezer, by disabling CPU +- * hotplug when tasks are about to be frozen. Also, don't allow the freezer +- * to continue until any currently running CPU hotplug operation gets +- * completed. +- * To modify the 'cpu_hotplug_disabled' flag, we need to acquire the +- * 'cpu_add_remove_lock'. And this same lock is also taken by the regular +- * CPU hotplug path and released only after it is complete. Thus, we +- * (and hence the freezer) will block here until any currently running CPU +- * hotplug operation gets completed. +- */ +-void cpu_hotplug_disable_before_freeze(void) +-{ +- cpu_maps_update_begin(); +- cpu_hotplug_disabled = 1; +- cpu_maps_update_done(); +-} +- +- +-/* +- * When tasks have been thawed, re-enable regular CPU hotplug (which had been +- * disabled while beginning to freeze tasks). +- */ +-void cpu_hotplug_enable_after_thaw(void) +-{ +- cpu_maps_update_begin(); +- cpu_hotplug_disabled = 0; +- cpu_maps_update_done(); +-} +- +-/* + * When callbacks for CPU hotplug notifications are being executed, we must + * ensure that the state of the system with respect to the tasks being frozen + * or not, as reported by the notification, remains unchanged *throughout the +@@ -589,12 +580,12 @@ cpu_hotplug_pm_callback(struct notifier_ + + case PM_SUSPEND_PREPARE: + case PM_HIBERNATION_PREPARE: +- cpu_hotplug_disable_before_freeze(); ++ cpu_hotplug_disable(); + break; + + case PM_POST_SUSPEND: + case PM_POST_HIBERNATION: +- cpu_hotplug_enable_after_thaw(); ++ cpu_hotplug_enable(); + break; + + default: diff --git a/queue-3.9/drivers-rtc-rtc-twl.c-fix-missing-device_init_wakeup-when-booted-with-device-tree.patch b/queue-3.9/drivers-rtc-rtc-twl.c-fix-missing-device_init_wakeup-when-booted-with-device-tree.patch new file mode 100644 index 00000000000..6fb34474d31 --- /dev/null +++ b/queue-3.9/drivers-rtc-rtc-twl.c-fix-missing-device_init_wakeup-when-booted-with-device-tree.patch @@ -0,0 +1,43 @@ +From 24b8256a1fb28d357bc6fa09184ba29b4255ba5c Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Wed, 12 Jun 2013 14:04:48 -0700 +Subject: drivers/rtc/rtc-twl.c: fix missing device_init_wakeup() when booted with device tree + +From: Tony Lindgren + +commit 24b8256a1fb28d357bc6fa09184ba29b4255ba5c upstream. + +When booted in legacy mode device_init_wakeup() gets called by +drivers/mfd/twl-core.c when the children are initialized. However, when +booted using device tree, the children are created with +of_platform_populate() instead add_children(). + +This means that the RTC driver will not have device_init_wakeup() set, +and we need to call it from the driver probe like RTC drivers typically +do. + +Without this we cannot test PM wake-up events on omaps for cases where +there may not be any physical wake-up event. + +Signed-off-by: Tony Lindgren +Reported-by: Kevin Hilman +Cc: Alessandro Zummo +Cc: Jingoo Han +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/rtc/rtc-twl.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/rtc/rtc-twl.c ++++ b/drivers/rtc/rtc-twl.c +@@ -524,6 +524,7 @@ static int twl_rtc_probe(struct platform + } + + platform_set_drvdata(pdev, rtc); ++ device_init_wakeup(&pdev->dev, 1); + return 0; + + out2: diff --git a/queue-3.9/drm-gma500-cdv-unpin-framebuffer-on-crtc-disable.patch b/queue-3.9/drm-gma500-cdv-unpin-framebuffer-on-crtc-disable.patch new file mode 100644 index 00000000000..9f0558e4912 --- /dev/null +++ b/queue-3.9/drm-gma500-cdv-unpin-framebuffer-on-crtc-disable.patch @@ -0,0 +1,54 @@ +From 22e7c385a80d771aaf3a15ae7ccea3b0686bbe10 Mon Sep 17 00:00:00 2001 +From: Patrik Jakobsson +Date: Sat, 8 Jun 2013 20:23:08 +0200 +Subject: drm/gma500/cdv: Unpin framebuffer on crtc disable + +From: Patrik Jakobsson + +commit 22e7c385a80d771aaf3a15ae7ccea3b0686bbe10 upstream. + +The framebuffer needs to be unpinned in the crtc->disable callback +because of previous pinning in psb_intel_pipe_set_base(). This will fix +a memory leak where the framebuffer was released but not unpinned +properly. This patch only affects Cedarview. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=889511 +Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=812113 +Reviewed-by: Daniel Vetter +Signed-off-by: Patrik Jakobsson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/gma500/cdv_intel_display.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/gpu/drm/gma500/cdv_intel_display.c ++++ b/drivers/gpu/drm/gma500/cdv_intel_display.c +@@ -1750,6 +1750,19 @@ static void cdv_intel_crtc_destroy(struc + kfree(psb_intel_crtc); + } + ++static void cdv_intel_crtc_disable(struct drm_crtc *crtc) ++{ ++ struct gtt_range *gt; ++ struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; ++ ++ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF); ++ ++ if (crtc->fb) { ++ gt = to_psb_fb(crtc->fb)->gtt; ++ psb_gtt_unpin(gt); ++ } ++} ++ + const struct drm_crtc_helper_funcs cdv_intel_helper_funcs = { + .dpms = cdv_intel_crtc_dpms, + .mode_fixup = cdv_intel_crtc_mode_fixup, +@@ -1757,6 +1770,7 @@ const struct drm_crtc_helper_funcs cdv_i + .mode_set_base = cdv_intel_pipe_set_base, + .prepare = cdv_intel_crtc_prepare, + .commit = cdv_intel_crtc_commit, ++ .disable = cdv_intel_crtc_disable, + }; + + const struct drm_crtc_funcs cdv_intel_crtc_funcs = { diff --git a/queue-3.9/drm-gma500-psb-unpin-framebuffer-on-crtc-disable.patch b/queue-3.9/drm-gma500-psb-unpin-framebuffer-on-crtc-disable.patch new file mode 100644 index 00000000000..ae8a9512a58 --- /dev/null +++ b/queue-3.9/drm-gma500-psb-unpin-framebuffer-on-crtc-disable.patch @@ -0,0 +1,54 @@ +From 820de86a90089ee607d7864538c98a23b503c846 Mon Sep 17 00:00:00 2001 +From: Patrik Jakobsson +Date: Wed, 5 Jun 2013 14:24:01 +0200 +Subject: drm/gma500/psb: Unpin framebuffer on crtc disable + +From: Patrik Jakobsson + +commit 820de86a90089ee607d7864538c98a23b503c846 upstream. + +The framebuffer needs to be unpinned in the crtc->disable callback +because of previous pinning in psb_intel_pipe_set_base(). This will fix +a memory leak where the framebuffer was released but not unpinned +properly. This patch only affects Poulsbo. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=889511 +Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=812113 +Reviewed-by: Daniel Vetter +Signed-off-by: Patrik Jakobsson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/gma500/psb_intel_display.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/gpu/drm/gma500/psb_intel_display.c ++++ b/drivers/gpu/drm/gma500/psb_intel_display.c +@@ -1246,6 +1246,19 @@ void psb_intel_crtc_destroy(struct drm_c + kfree(psb_intel_crtc); + } + ++static void psb_intel_crtc_disable(struct drm_crtc *crtc) ++{ ++ struct gtt_range *gt; ++ struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; ++ ++ crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF); ++ ++ if (crtc->fb) { ++ gt = to_psb_fb(crtc->fb)->gtt; ++ psb_gtt_unpin(gt); ++ } ++} ++ + const struct drm_crtc_helper_funcs psb_intel_helper_funcs = { + .dpms = psb_intel_crtc_dpms, + .mode_fixup = psb_intel_crtc_mode_fixup, +@@ -1253,6 +1266,7 @@ const struct drm_crtc_helper_funcs psb_i + .mode_set_base = psb_intel_pipe_set_base, + .prepare = psb_intel_crtc_prepare, + .commit = psb_intel_crtc_commit, ++ .disable = psb_intel_crtc_disable, + }; + + const struct drm_crtc_funcs psb_intel_crtc_funcs = { diff --git a/queue-3.9/kmsg-honor-dmesg_restrict-sysctl-on-dev-kmsg.patch b/queue-3.9/kmsg-honor-dmesg_restrict-sysctl-on-dev-kmsg.patch new file mode 100644 index 00000000000..c3b937114f8 --- /dev/null +++ b/queue-3.9/kmsg-honor-dmesg_restrict-sysctl-on-dev-kmsg.patch @@ -0,0 +1,240 @@ +From 637241a900cbd982f744d44646b48a273d609b34 Mon Sep 17 00:00:00 2001 +From: Kees Cook +Date: Wed, 12 Jun 2013 14:04:39 -0700 +Subject: kmsg: honor dmesg_restrict sysctl on /dev/kmsg + +From: Kees Cook + +commit 637241a900cbd982f744d44646b48a273d609b34 upstream. + +The dmesg_restrict sysctl currently covers the syslog method for access +dmesg, however /dev/kmsg isn't covered by the same protections. Most +people haven't noticed because util-linux dmesg(1) defaults to using the +syslog method for access in older versions. With util-linux dmesg(1) +defaults to reading directly from /dev/kmsg. + +To fix /dev/kmsg, let's compare the existing interfaces and what they +allow: + + - /proc/kmsg allows: + - open (SYSLOG_ACTION_OPEN) if CAP_SYSLOG since it uses a destructive + single-reader interface (SYSLOG_ACTION_READ). + - everything, after an open. + + - syslog syscall allows: + - anything, if CAP_SYSLOG. + - SYSLOG_ACTION_READ_ALL and SYSLOG_ACTION_SIZE_BUFFER, if + dmesg_restrict==0. + - nothing else (EPERM). + +The use-cases were: + - dmesg(1) needs to do non-destructive SYSLOG_ACTION_READ_ALLs. + - sysklog(1) needs to open /proc/kmsg, drop privs, and still issue the + destructive SYSLOG_ACTION_READs. + +AIUI, dmesg(1) is moving to /dev/kmsg, and systemd-journald doesn't +clear the ring buffer. + +Based on the comments in devkmsg_llseek, it sounds like actions besides +reading aren't going to be supported by /dev/kmsg (i.e. +SYSLOG_ACTION_CLEAR), so we have a strict subset of the non-destructive +syslog syscall actions. + +To this end, move the check as Josh had done, but also rename the +constants to reflect their new uses (SYSLOG_FROM_CALL becomes +SYSLOG_FROM_READER, and SYSLOG_FROM_FILE becomes SYSLOG_FROM_PROC). +SYSLOG_FROM_READER allows non-destructive actions, and SYSLOG_FROM_PROC +allows destructive actions after a capabilities-constrained +SYSLOG_ACTION_OPEN check. + + - /dev/kmsg allows: + - open if CAP_SYSLOG or dmesg_restrict==0 + - reading/polling, after open + +Addresses https://bugzilla.redhat.com/show_bug.cgi?id=903192 + +[akpm@linux-foundation.org: use pr_warn_once()] +Signed-off-by: Kees Cook +Reported-by: Christian Kujau +Tested-by: Josh Boyer +Cc: Kay Sievers +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/proc/kmsg.c | 10 ++--- + include/linux/syslog.h | 4 +- + kernel/printk.c | 91 ++++++++++++++++++++++++++----------------------- + 3 files changed, 57 insertions(+), 48 deletions(-) + +--- a/fs/proc/kmsg.c ++++ b/fs/proc/kmsg.c +@@ -21,12 +21,12 @@ extern wait_queue_head_t log_wait; + + static int kmsg_open(struct inode * inode, struct file * file) + { +- return do_syslog(SYSLOG_ACTION_OPEN, NULL, 0, SYSLOG_FROM_FILE); ++ return do_syslog(SYSLOG_ACTION_OPEN, NULL, 0, SYSLOG_FROM_PROC); + } + + static int kmsg_release(struct inode * inode, struct file * file) + { +- (void) do_syslog(SYSLOG_ACTION_CLOSE, NULL, 0, SYSLOG_FROM_FILE); ++ (void) do_syslog(SYSLOG_ACTION_CLOSE, NULL, 0, SYSLOG_FROM_PROC); + return 0; + } + +@@ -34,15 +34,15 @@ static ssize_t kmsg_read(struct file *fi + size_t count, loff_t *ppos) + { + if ((file->f_flags & O_NONBLOCK) && +- !do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_FILE)) ++ !do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC)) + return -EAGAIN; +- return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_FILE); ++ return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_PROC); + } + + static unsigned int kmsg_poll(struct file *file, poll_table *wait) + { + poll_wait(file, &log_wait, wait); +- if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_FILE)) ++ if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC)) + return POLLIN | POLLRDNORM; + return 0; + } +--- a/include/linux/syslog.h ++++ b/include/linux/syslog.h +@@ -44,8 +44,8 @@ + /* Return size of the log buffer */ + #define SYSLOG_ACTION_SIZE_BUFFER 10 + +-#define SYSLOG_FROM_CALL 0 +-#define SYSLOG_FROM_FILE 1 ++#define SYSLOG_FROM_READER 0 ++#define SYSLOG_FROM_PROC 1 + + int do_syslog(int type, char __user *buf, int count, bool from_file); + +--- a/kernel/printk.c ++++ b/kernel/printk.c +@@ -368,6 +368,53 @@ static void log_store(int facility, int + log_next_seq++; + } + ++#ifdef CONFIG_SECURITY_DMESG_RESTRICT ++int dmesg_restrict = 1; ++#else ++int dmesg_restrict; ++#endif ++ ++static int syslog_action_restricted(int type) ++{ ++ if (dmesg_restrict) ++ return 1; ++ /* ++ * Unless restricted, we allow "read all" and "get buffer size" ++ * for everybody. ++ */ ++ return type != SYSLOG_ACTION_READ_ALL && ++ type != SYSLOG_ACTION_SIZE_BUFFER; ++} ++ ++static int check_syslog_permissions(int type, bool from_file) ++{ ++ /* ++ * If this is from /proc/kmsg and we've already opened it, then we've ++ * already done the capabilities checks at open time. ++ */ ++ if (from_file && type != SYSLOG_ACTION_OPEN) ++ return 0; ++ ++ if (syslog_action_restricted(type)) { ++ if (capable(CAP_SYSLOG)) ++ return 0; ++ /* ++ * For historical reasons, accept CAP_SYS_ADMIN too, with ++ * a warning. ++ */ ++ if (capable(CAP_SYS_ADMIN)) { ++ pr_warn_once("%s (%d): Attempt to access syslog with " ++ "CAP_SYS_ADMIN but no CAP_SYSLOG " ++ "(deprecated).\n", ++ current->comm, task_pid_nr(current)); ++ return 0; ++ } ++ return -EPERM; ++ } ++ return security_syslog(type); ++} ++ ++ + /* /dev/kmsg - userspace message inject/listen interface */ + struct devkmsg_user { + u64 seq; +@@ -624,7 +671,8 @@ static int devkmsg_open(struct inode *in + if ((file->f_flags & O_ACCMODE) == O_WRONLY) + return 0; + +- err = security_syslog(SYSLOG_ACTION_READ_ALL); ++ err = check_syslog_permissions(SYSLOG_ACTION_READ_ALL, ++ SYSLOG_FROM_READER); + if (err) + return err; + +@@ -817,45 +865,6 @@ static inline void boot_delay_msec(int l + } + #endif + +-#ifdef CONFIG_SECURITY_DMESG_RESTRICT +-int dmesg_restrict = 1; +-#else +-int dmesg_restrict; +-#endif +- +-static int syslog_action_restricted(int type) +-{ +- if (dmesg_restrict) +- return 1; +- /* Unless restricted, we allow "read all" and "get buffer size" for everybody */ +- return type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER; +-} +- +-static int check_syslog_permissions(int type, bool from_file) +-{ +- /* +- * If this is from /proc/kmsg and we've already opened it, then we've +- * already done the capabilities checks at open time. +- */ +- if (from_file && type != SYSLOG_ACTION_OPEN) +- return 0; +- +- if (syslog_action_restricted(type)) { +- if (capable(CAP_SYSLOG)) +- return 0; +- /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */ +- if (capable(CAP_SYS_ADMIN)) { +- printk_once(KERN_WARNING "%s (%d): " +- "Attempt to access syslog with CAP_SYS_ADMIN " +- "but no CAP_SYSLOG (deprecated).\n", +- current->comm, task_pid_nr(current)); +- return 0; +- } +- return -EPERM; +- } +- return 0; +-} +- + #if defined(CONFIG_PRINTK_TIME) + static bool printk_time = 1; + #else +@@ -1253,7 +1262,7 @@ out: + + SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) + { +- return do_syslog(type, buf, len, SYSLOG_FROM_CALL); ++ return do_syslog(type, buf, len, SYSLOG_FROM_READER); + } + + /* diff --git a/queue-3.9/libceph-must-hold-mutex-for-reset_changed_osds.patch b/queue-3.9/libceph-must-hold-mutex-for-reset_changed_osds.patch new file mode 100644 index 00000000000..bdb741d6e35 --- /dev/null +++ b/queue-3.9/libceph-must-hold-mutex-for-reset_changed_osds.patch @@ -0,0 +1,55 @@ +From 14d2f38df67fadee34625fcbd282ee22514c4846 Mon Sep 17 00:00:00 2001 +From: Alex Elder +Date: Wed, 15 May 2013 16:28:33 -0500 +Subject: libceph: must hold mutex for reset_changed_osds() + +From: Alex Elder + +commit 14d2f38df67fadee34625fcbd282ee22514c4846 upstream. + +An osd client has a red-black tree describing its osds, and +occasionally we would get crashes due to one of these trees tree +becoming corrupt somehow. + +The problem turned out to be that reset_changed_osds() was being +called without protection of the osd client request mutex. That +function would call __reset_osd() for any osd that had changed, and +__reset_osd() would call __remove_osd() for any osd with no +outstanding requests, and finally __remove_osd() would remove the +corresponding entry from the red-black tree. Thus, the tree was +getting modified without having any lock protection, and was +vulnerable to problems due to concurrent updates. + +This appears to be the only osd tree updating path that has this +problem. It can be fairly easily fixed by moving the call up +a few lines, to just before the request mutex gets dropped +in kick_requests(). + +This resolves: + http://tracker.ceph.com/issues/5043 + +Signed-off-by: Alex Elder +Reviewed-by: Sage Weil +Signed-off-by: Greg Kroah-Hartman + +--- + net/ceph/osd_client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ceph/osd_client.c ++++ b/net/ceph/osd_client.c +@@ -1399,13 +1399,13 @@ static void kick_requests(struct ceph_os + __register_request(osdc, req); + __unregister_linger_request(osdc, req); + } ++ reset_changed_osds(osdc); + mutex_unlock(&osdc->request_mutex); + + if (needmap) { + dout("%d requests for down osds, need new map\n", needmap); + ceph_monc_request_next_osdmap(&osdc->client->monc); + } +- reset_changed_osds(osdc); + } + + diff --git a/queue-3.9/rbd-don-t-destroy-ceph_opts-in-rbd_add.patch b/queue-3.9/rbd-don-t-destroy-ceph_opts-in-rbd_add.patch new file mode 100644 index 00000000000..43c2126b88b --- /dev/null +++ b/queue-3.9/rbd-don-t-destroy-ceph_opts-in-rbd_add.patch @@ -0,0 +1,72 @@ +From 7262cfca430a1a0e0707149af29ae86bc0ded230 Mon Sep 17 00:00:00 2001 +From: Alex Elder +Date: Thu, 16 May 2013 15:04:20 -0500 +Subject: rbd: don't destroy ceph_opts in rbd_add() + +From: Alex Elder + +commit 7262cfca430a1a0e0707149af29ae86bc0ded230 upstream. + +Whether rbd_client_create() successfully creates a new client or +not, it takes responsibility for getting the ceph_opts structure +it's passed destroyed. If successful, the structure becomes +associated with the created client; if not, rbd_client_create() +will destroy it. + +Previously, rbd_get_client() would call ceph_destroy_options() +if rbd_get_client() failed, and that meant it got called twice. +That led freeing various pointers more than once, which is never a +good idea. + +This resolves: + http://tracker.ceph.com/issues/4559 + +Reported-by: Dan van der Ster +Signed-off-by: Alex Elder +Reviewed-by: Josh Durgin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/rbd.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/drivers/block/rbd.c ++++ b/drivers/block/rbd.c +@@ -435,8 +435,8 @@ static const struct block_device_operati + }; + + /* +- * Initialize an rbd client instance. +- * We own *ceph_opts. ++ * Initialize an rbd client instance. Success or not, this function ++ * consumes ceph_opts. + */ + static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts) + { +@@ -583,7 +583,8 @@ static int parse_rbd_opts_token(char *c, + + /* + * Get a ceph client with specific addr and configuration, if one does +- * not exist create it. ++ * not exist create it. Either way, ceph_opts is consumed by this ++ * function. + */ + static struct rbd_client *rbd_get_client(struct ceph_options *ceph_opts) + { +@@ -4104,7 +4105,6 @@ static ssize_t rbd_add(struct bus_type * + rc = PTR_ERR(rbdc); + goto err_out_args; + } +- ceph_opts = NULL; /* rbd_dev client now owns this */ + + /* pick the pool */ + osdc = &rbdc->client->osdc; +@@ -4140,8 +4140,6 @@ err_out_rbd_dev: + err_out_client: + rbd_put_client(rbdc); + err_out_args: +- if (ceph_opts) +- ceph_destroy_options(ceph_opts); + kfree(rbd_opts); + rbd_spec_put(spec); + err_out_module: diff --git a/queue-3.9/reboot-rigrate-shutdown-reboot-to-boot-cpu.patch b/queue-3.9/reboot-rigrate-shutdown-reboot-to-boot-cpu.patch new file mode 100644 index 00000000000..43076b21408 --- /dev/null +++ b/queue-3.9/reboot-rigrate-shutdown-reboot-to-boot-cpu.patch @@ -0,0 +1,100 @@ +From cf7df378aa4ff7da3a44769b7ff6e9eef1a9f3db Mon Sep 17 00:00:00 2001 +From: Robin Holt +Date: Wed, 12 Jun 2013 14:04:37 -0700 +Subject: reboot: rigrate shutdown/reboot to boot cpu + +From: Robin Holt + +commit cf7df378aa4ff7da3a44769b7ff6e9eef1a9f3db upstream. + +We recently noticed that reboot of a 1024 cpu machine takes approx 16 +minutes of just stopping the cpus. The slowdown was tracked to commit +f96972f2dc63 ("kernel/sys.c: call disable_nonboot_cpus() in +kernel_restart()"). + +The current implementation does all the work of hot removing the cpus +before halting the system. We are switching to just migrating to the +boot cpu and then continuing with shutdown/reboot. + +This also has the effect of not breaking x86's command line parameter +for specifying the reboot cpu. Note, this code was shamelessly copied +from arch/x86/kernel/reboot.c with bits removed pertaining to the +reboot_cpu command line parameter. + +Signed-off-by: Robin Holt +Tested-by: Shawn Guo +Cc: "Srivatsa S. Bhat" +Cc: H. Peter Anvin +Cc: Thomas Gleixner +Cc: Ingo Molnar +Cc: Russ Anderson +Cc: Robin Holt +Cc: Russell King +Cc: Guan Xuetao +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sys.c | 29 ++++++++++++++++++++++++++--- + 1 file changed, 26 insertions(+), 3 deletions(-) + +--- a/kernel/sys.c ++++ b/kernel/sys.c +@@ -357,6 +357,29 @@ int unregister_reboot_notifier(struct no + } + EXPORT_SYMBOL(unregister_reboot_notifier); + ++/* Add backwards compatibility for stable trees. */ ++#ifndef PF_NO_SETAFFINITY ++#define PF_NO_SETAFFINITY PF_THREAD_BOUND ++#endif ++ ++static void migrate_to_reboot_cpu(void) ++{ ++ /* The boot cpu is always logical cpu 0 */ ++ int cpu = 0; ++ ++ cpu_hotplug_disable(); ++ ++ /* Make certain the cpu I'm about to reboot on is online */ ++ if (!cpu_online(cpu)) ++ cpu = cpumask_first(cpu_online_mask); ++ ++ /* Prevent races with other tasks migrating this task */ ++ current->flags |= PF_NO_SETAFFINITY; ++ ++ /* Make certain I only run on the appropriate processor */ ++ set_cpus_allowed_ptr(current, cpumask_of(cpu)); ++} ++ + /** + * kernel_restart - reboot the system + * @cmd: pointer to buffer containing command to execute for restart +@@ -368,7 +391,7 @@ EXPORT_SYMBOL(unregister_reboot_notifier + void kernel_restart(char *cmd) + { + kernel_restart_prepare(cmd); +- disable_nonboot_cpus(); ++ migrate_to_reboot_cpu(); + syscore_shutdown(); + if (!cmd) + printk(KERN_EMERG "Restarting system.\n"); +@@ -395,7 +418,7 @@ static void kernel_shutdown_prepare(enum + void kernel_halt(void) + { + kernel_shutdown_prepare(SYSTEM_HALT); +- disable_nonboot_cpus(); ++ migrate_to_reboot_cpu(); + syscore_shutdown(); + printk(KERN_EMERG "System halted.\n"); + kmsg_dump(KMSG_DUMP_HALT); +@@ -414,7 +437,7 @@ void kernel_power_off(void) + kernel_shutdown_prepare(SYSTEM_POWER_OFF); + if (pm_power_off_prepare) + pm_power_off_prepare(); +- disable_nonboot_cpus(); ++ migrate_to_reboot_cpu(); + syscore_shutdown(); + printk(KERN_EMERG "Power down.\n"); + kmsg_dump(KMSG_DUMP_POWEROFF); diff --git a/queue-3.9/revert-ath9k_hw-update-rx-gain-initval-to-improve-rx-sensitivity.patch b/queue-3.9/revert-ath9k_hw-update-rx-gain-initval-to-improve-rx-sensitivity.patch new file mode 100644 index 00000000000..c2798c796bd --- /dev/null +++ b/queue-3.9/revert-ath9k_hw-update-rx-gain-initval-to-improve-rx-sensitivity.patch @@ -0,0 +1,43 @@ +From 96005931785238e1a24febf65ffb5016273e8225 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Mon, 3 Jun 2013 11:18:57 +0200 +Subject: Revert "ath9k_hw: Update rx gain initval to improve rx sensitivity" + +From: Felix Fietkau + +commit 96005931785238e1a24febf65ffb5016273e8225 upstream. + +This reverts commit 68d9e1fa24d9c7c2e527f49df8d18fb8cf0ec943 + +This change reduces rx sensitivity with no apparent extra benefit. +It looks like it was meant for testing in a specific scenario, +but it was never properly validated. + +Signed-off-by: Felix Fietkau +Cc: rmanohar@qca.qualcomm.com +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h ++++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +@@ -958,11 +958,11 @@ static const u32 ar9300Common_rx_gain_ta + {0x0000a074, 0x00000000}, + {0x0000a078, 0x00000000}, + {0x0000a07c, 0x00000000}, +- {0x0000a080, 0x1a1a1a1a}, +- {0x0000a084, 0x1a1a1a1a}, +- {0x0000a088, 0x1a1a1a1a}, +- {0x0000a08c, 0x1a1a1a1a}, +- {0x0000a090, 0x171a1a1a}, ++ {0x0000a080, 0x22222229}, ++ {0x0000a084, 0x1d1d1d1d}, ++ {0x0000a088, 0x1d1d1d1d}, ++ {0x0000a08c, 0x1d1d1d1d}, ++ {0x0000a090, 0x171d1d1d}, + {0x0000a094, 0x11111717}, + {0x0000a098, 0x00030311}, + {0x0000a09c, 0x00000000}, diff --git a/queue-3.9/s390-pci-implement-irq-functions-if-pci.patch b/queue-3.9/s390-pci-implement-irq-functions-if-pci.patch new file mode 100644 index 00000000000..06946320cc7 --- /dev/null +++ b/queue-3.9/s390-pci-implement-irq-functions-if-pci.patch @@ -0,0 +1,143 @@ +From c46b54f7406780ec4cf9c9124d1cfb777674dc70 Mon Sep 17 00:00:00 2001 +From: Ben Hutchings +Date: Mon, 10 Jun 2013 15:34:04 +0200 +Subject: s390/pci: Implement IRQ functions if !PCI + +From: Ben Hutchings + +commit c46b54f7406780ec4cf9c9124d1cfb777674dc70 upstream. + +All architectures must implement IRQ functions. Since various +dependencies on !S390 were removed, there are various drivers that can +be selected but will fail to link. Provide a dummy implementation of +these functions for the !PCI case. + +Signed-off-by: Ben Hutchings +Acked-by: David S. Miller +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/irq.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ + arch/s390/pci/pci.c | 33 ------------------------- + 2 files changed, 64 insertions(+), 33 deletions(-) + +--- a/arch/s390/kernel/irq.c ++++ b/arch/s390/kernel/irq.c +@@ -313,3 +313,67 @@ void measurement_alert_subclass_unregist + spin_unlock(&ma_subclass_lock); + } + EXPORT_SYMBOL(measurement_alert_subclass_unregister); ++ ++void synchronize_irq(unsigned int irq) ++{ ++ /* ++ * Not needed, the handler is protected by a lock and IRQs that occur ++ * after the handler is deleted are just NOPs. ++ */ ++} ++EXPORT_SYMBOL_GPL(synchronize_irq); ++ ++#ifndef CONFIG_PCI ++ ++/* Only PCI devices have dynamically-defined IRQ handlers */ ++ ++int request_irq(unsigned int irq, irq_handler_t handler, ++ unsigned long irqflags, const char *devname, void *dev_id) ++{ ++ return -EINVAL; ++} ++EXPORT_SYMBOL_GPL(request_irq); ++ ++void free_irq(unsigned int irq, void *dev_id) ++{ ++ WARN_ON(1); ++} ++EXPORT_SYMBOL_GPL(free_irq); ++ ++void enable_irq(unsigned int irq) ++{ ++ WARN_ON(1); ++} ++EXPORT_SYMBOL_GPL(enable_irq); ++ ++void disable_irq(unsigned int irq) ++{ ++ WARN_ON(1); ++} ++EXPORT_SYMBOL_GPL(disable_irq); ++ ++#endif /* !CONFIG_PCI */ ++ ++void disable_irq_nosync(unsigned int irq) ++{ ++ disable_irq(irq); ++} ++EXPORT_SYMBOL_GPL(disable_irq_nosync); ++ ++unsigned long probe_irq_on(void) ++{ ++ return 0; ++} ++EXPORT_SYMBOL_GPL(probe_irq_on); ++ ++int probe_irq_off(unsigned long val) ++{ ++ return 0; ++} ++EXPORT_SYMBOL_GPL(probe_irq_off); ++ ++unsigned int probe_irq_mask(unsigned long val) ++{ ++ return val; ++} ++EXPORT_SYMBOL_GPL(probe_irq_mask); +--- a/arch/s390/pci/pci.c ++++ b/arch/s390/pci/pci.c +@@ -306,15 +306,6 @@ static int zpci_cfg_store(struct zpci_de + return rc; + } + +-void synchronize_irq(unsigned int irq) +-{ +- /* +- * Not needed, the handler is protected by a lock and IRQs that occur +- * after the handler is deleted are just NOPs. +- */ +-} +-EXPORT_SYMBOL_GPL(synchronize_irq); +- + void enable_irq(unsigned int irq) + { + struct msi_desc *msi = irq_get_msi_desc(irq); +@@ -331,30 +322,6 @@ void disable_irq(unsigned int irq) + } + EXPORT_SYMBOL_GPL(disable_irq); + +-void disable_irq_nosync(unsigned int irq) +-{ +- disable_irq(irq); +-} +-EXPORT_SYMBOL_GPL(disable_irq_nosync); +- +-unsigned long probe_irq_on(void) +-{ +- return 0; +-} +-EXPORT_SYMBOL_GPL(probe_irq_on); +- +-int probe_irq_off(unsigned long val) +-{ +- return 0; +-} +-EXPORT_SYMBOL_GPL(probe_irq_off); +- +-unsigned int probe_irq_mask(unsigned long val) +-{ +- return val; +-} +-EXPORT_SYMBOL_GPL(probe_irq_mask); +- + void pcibios_fixup_bus(struct pci_bus *bus) + { + } diff --git a/queue-3.9/series b/queue-3.9/series index a3a11cf994d..edf83ab7cbf 100644 --- a/queue-3.9/series +++ b/queue-3.9/series @@ -1,2 +1,19 @@ audit-wait_for_auditd-should-use-task_uninterruptible.patch b43-stop-format-string-leaking-into-error-msgs.patch +acpi-video-do-not-bind-to-device-objects-with-a-scan-handler.patch +libceph-must-hold-mutex-for-reset_changed_osds.patch +ceph-add-cpu_to_le32-calls-when-encoding-a-reconnect-capability.patch +ceph-ceph_pagelist_append-might-sleep-while-atomic.patch +rbd-don-t-destroy-ceph_opts-in-rbd_add.patch +drivers-rtc-rtc-twl.c-fix-missing-device_init_wakeup-when-booted-with-device-tree.patch +drm-gma500-psb-unpin-framebuffer-on-crtc-disable.patch +drm-gma500-cdv-unpin-framebuffer-on-crtc-disable.patch +bluetooth-fix-missing-length-checks-for-l2cap-signalling-pdus.patch +bluetooth-fix-mgmt-handling-of-power-on-failures.patch +s390-pci-implement-irq-functions-if-pci.patch +ath9k-disable-powersave-by-default.patch +revert-ath9k_hw-update-rx-gain-initval-to-improve-rx-sensitivity.patch +ath9k-use-minstrel-rate-control-by-default.patch +cpu-hotplug-provide-a-generic-helper-to-disable-enable-cpu-hotplug.patch +reboot-rigrate-shutdown-reboot-to-boot-cpu.patch +kmsg-honor-dmesg_restrict-sysctl-on-dev-kmsg.patch -- 2.47.3