From: Greg Kroah-Hartman Date: Sun, 20 Apr 2014 20:01:03 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.13.11~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c92d163d67f7038fb77f069c690183fc9cda6097;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: backing_dev-fix-hung-task-on-sync.patch bdi-avoid-oops-on-device-removal.patch bluetooth-fix-removing-long-term-key.patch btrfs-skip-submitting-barrier-for-missing-device.patch char-ipmi_bt_sm-fix-infinite-loop.patch pci-enable-intx-in-pci_reenable_device-only-when-msi-msi-x-not-enabled.patch pid_namespace-pidns_get-should-check-task_active_pid_ns-null.patch staging-comedi-8255_pci-initialize-mite-data-window.patch tty-set-correct-tty-name-in-active-sysfs-attribute.patch x86-adjust-irq-remapping-quirk-for-older-revisions-of-5500-5520-chipsets.patch --- diff --git a/queue-3.10/backing_dev-fix-hung-task-on-sync.patch b/queue-3.10/backing_dev-fix-hung-task-on-sync.patch new file mode 100644 index 00000000000..844e6bc5950 --- /dev/null +++ b/queue-3.10/backing_dev-fix-hung-task-on-sync.patch @@ -0,0 +1,94 @@ +From 6ca738d60c563d5c6cf6253ee4b8e76fa77b2b9e Mon Sep 17 00:00:00 2001 +From: Derek Basehore +Date: Thu, 3 Apr 2014 14:46:22 -0700 +Subject: backing_dev: fix hung task on sync + +From: Derek Basehore + +commit 6ca738d60c563d5c6cf6253ee4b8e76fa77b2b9e upstream. + +bdi_wakeup_thread_delayed() used the mod_delayed_work() function to +schedule work to writeback dirty inodes. The problem with this is that +it can delay work that is scheduled for immediate execution, such as the +work from sync_inodes_sb(). This can happen since mod_delayed_work() +can now steal work from a work_queue. This fixes the problem by using +queue_delayed_work() instead. This is a regression caused by commit +839a8e8660b6 ("writeback: replace custom worker pool implementation with +unbound workqueue"). + +The reason that this causes a problem is that laptop-mode will change +the delay, dirty_writeback_centisecs, to 60000 (10 minutes) by default. +In the case that bdi_wakeup_thread_delayed() races with +sync_inodes_sb(), sync will be stopped for 10 minutes and trigger a hung +task. Even if dirty_writeback_centisecs is not long enough to cause a +hung task, we still don't want to delay sync for that long. + +We fix the problem by using queue_delayed_work() when we want to +schedule writeback sometime in future. This function doesn't change the +timer if it is already armed. + +For the same reason, we also change bdi_writeback_workfn() to +immediately queue the work again in the case that the work_list is not +empty. The same problem can happen if the sync work is run on the +rescue worker. + +[jack@suse.cz: update changelog, add comment, use bdi_wakeup_thread_delayed()] +Signed-off-by: Derek Basehore +Reviewed-by: Jan Kara +Cc: Alexander Viro +Reviewed-by: Tejun Heo +Cc: Greg Kroah-Hartman +Cc: "Darrick J. Wong" +Cc: Derek Basehore +Cc: Kees Cook +Cc: Benson Leung +Cc: Sonny Rao +Cc: Luigi Semenzato +Cc: Jens Axboe +Cc: Dave Chinner +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/fs-writeback.c | 8 ++++---- + mm/backing-dev.c | 5 ++++- + 2 files changed, 8 insertions(+), 5 deletions(-) + +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -1038,10 +1038,10 @@ void bdi_writeback_workfn(struct work_st + trace_writeback_pages_written(pages_written); + } + +- if (!list_empty(&bdi->work_list) || +- (wb_has_dirty_io(wb) && dirty_writeback_interval)) +- queue_delayed_work(bdi_wq, &wb->dwork, +- msecs_to_jiffies(dirty_writeback_interval * 10)); ++ if (!list_empty(&bdi->work_list)) ++ mod_delayed_work(bdi_wq, &wb->dwork, 0); ++ else if (wb_has_dirty_io(wb) && dirty_writeback_interval) ++ bdi_wakeup_thread_delayed(bdi); + + current->flags &= ~PF_SWAPWRITE; + } +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -287,13 +287,16 @@ int bdi_has_dirty_io(struct backing_dev_ + * Note, we wouldn't bother setting up the timer, but this function is on the + * fast-path (used by '__mark_inode_dirty()'), so we save few context switches + * by delaying the wake-up. ++ * ++ * We have to be careful not to postpone flush work if it is scheduled for ++ * earlier. Thus we use queue_delayed_work(). + */ + void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi) + { + unsigned long timeout; + + timeout = msecs_to_jiffies(dirty_writeback_interval * 10); +- mod_delayed_work(bdi_wq, &bdi->wb.dwork, timeout); ++ queue_delayed_work(bdi_wq, &bdi->wb.dwork, timeout); + } + + /* diff --git a/queue-3.10/bdi-avoid-oops-on-device-removal.patch b/queue-3.10/bdi-avoid-oops-on-device-removal.patch new file mode 100644 index 00000000000..a5f6d6459c1 --- /dev/null +++ b/queue-3.10/bdi-avoid-oops-on-device-removal.patch @@ -0,0 +1,145 @@ +From 5acda9d12dcf1ad0d9a5a2a7c646de3472fa7555 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 3 Apr 2014 14:46:23 -0700 +Subject: bdi: avoid oops on device removal + +From: Jan Kara + +commit 5acda9d12dcf1ad0d9a5a2a7c646de3472fa7555 upstream. + +After commit 839a8e8660b6 ("writeback: replace custom worker pool +implementation with unbound workqueue") when device is removed while we +are writing to it we crash in bdi_writeback_workfn() -> +set_worker_desc() because bdi->dev is NULL. + +This can happen because even though bdi_unregister() cancels all pending +flushing work, nothing really prevents new ones from being queued from +balance_dirty_pages() or other places. + +Fix the problem by clearing BDI_registered bit in bdi_unregister() and +checking it before scheduling of any flushing work. + +Fixes: 839a8e8660b6777e7fe4e80af1a048aebe2b5977 + +Reviewed-by: Tejun Heo +Signed-off-by: Jan Kara +Cc: Derek Basehore +Cc: Jens Axboe +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/fs-writeback.c | 23 ++++++++++++++++++----- + include/linux/backing-dev.h | 2 +- + mm/backing-dev.c | 13 +++++++++---- + 3 files changed, 28 insertions(+), 10 deletions(-) + +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -87,16 +87,29 @@ static inline struct inode *wb_inode(str + #define CREATE_TRACE_POINTS + #include + ++static void bdi_wakeup_thread(struct backing_dev_info *bdi) ++{ ++ spin_lock_bh(&bdi->wb_lock); ++ if (test_bit(BDI_registered, &bdi->state)) ++ mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0); ++ spin_unlock_bh(&bdi->wb_lock); ++} ++ + static void bdi_queue_work(struct backing_dev_info *bdi, + struct wb_writeback_work *work) + { + trace_writeback_queue(bdi, work); + + spin_lock_bh(&bdi->wb_lock); ++ if (!test_bit(BDI_registered, &bdi->state)) { ++ if (work->done) ++ complete(work->done); ++ goto out_unlock; ++ } + list_add_tail(&work->list, &bdi->work_list); +- spin_unlock_bh(&bdi->wb_lock); +- + mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0); ++out_unlock: ++ spin_unlock_bh(&bdi->wb_lock); + } + + static void +@@ -112,7 +125,7 @@ __bdi_start_writeback(struct backing_dev + work = kzalloc(sizeof(*work), GFP_ATOMIC); + if (!work) { + trace_writeback_nowork(bdi); +- mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0); ++ bdi_wakeup_thread(bdi); + return; + } + +@@ -159,7 +172,7 @@ void bdi_start_background_writeback(stru + * writeback as soon as there is no other work to do. + */ + trace_writeback_wake_background(bdi); +- mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0); ++ bdi_wakeup_thread(bdi); + } + + /* +@@ -1016,7 +1029,7 @@ void bdi_writeback_workfn(struct work_st + current->flags |= PF_SWAPWRITE; + + if (likely(!current_is_workqueue_rescuer() || +- list_empty(&bdi->bdi_list))) { ++ !test_bit(BDI_registered, &bdi->state))) { + /* + * The normal path. Keep writing back @bdi until its + * work_list is empty. Note that this path is also taken +--- a/include/linux/backing-dev.h ++++ b/include/linux/backing-dev.h +@@ -95,7 +95,7 @@ struct backing_dev_info { + unsigned int max_ratio, max_prop_frac; + + struct bdi_writeback wb; /* default writeback info for this bdi */ +- spinlock_t wb_lock; /* protects work_list */ ++ spinlock_t wb_lock; /* protects work_list & wb.dwork scheduling */ + + struct list_head work_list; + +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -296,7 +296,10 @@ void bdi_wakeup_thread_delayed(struct ba + unsigned long timeout; + + timeout = msecs_to_jiffies(dirty_writeback_interval * 10); +- queue_delayed_work(bdi_wq, &bdi->wb.dwork, timeout); ++ spin_lock_bh(&bdi->wb_lock); ++ if (test_bit(BDI_registered, &bdi->state)) ++ queue_delayed_work(bdi_wq, &bdi->wb.dwork, timeout); ++ spin_unlock_bh(&bdi->wb_lock); + } + + /* +@@ -309,9 +312,6 @@ static void bdi_remove_from_list(struct + spin_unlock_bh(&bdi_lock); + + synchronize_rcu_expedited(); +- +- /* bdi_list is now unused, clear it to mark @bdi dying */ +- INIT_LIST_HEAD(&bdi->bdi_list); + } + + int bdi_register(struct backing_dev_info *bdi, struct device *parent, +@@ -362,6 +362,11 @@ static void bdi_wb_shutdown(struct backi + */ + bdi_remove_from_list(bdi); + ++ /* Make sure nobody queues further work */ ++ spin_lock_bh(&bdi->wb_lock); ++ clear_bit(BDI_registered, &bdi->state); ++ spin_unlock_bh(&bdi->wb_lock); ++ + /* + * Drain work list and shutdown the delayed_work. At this point, + * @bdi->bdi_list is empty telling bdi_Writeback_workfn() that @bdi diff --git a/queue-3.10/bluetooth-fix-removing-long-term-key.patch b/queue-3.10/bluetooth-fix-removing-long-term-key.patch new file mode 100644 index 00000000000..74b7240177d --- /dev/null +++ b/queue-3.10/bluetooth-fix-removing-long-term-key.patch @@ -0,0 +1,101 @@ +From 5981a8821b774ada0be512fd9bad7c241e17657e Mon Sep 17 00:00:00 2001 +From: Claudio Takahasi +Date: Thu, 25 Jul 2013 16:34:24 -0300 +Subject: Bluetooth: Fix removing Long Term Key + +From: Claudio Takahasi + +commit 5981a8821b774ada0be512fd9bad7c241e17657e upstream. + +This patch fixes authentication failure on LE link re-connection when +BlueZ acts as slave (peripheral). LTK is removed from the internal list +after its first use causing PIN or Key missing reply when re-connecting +the link. The LE Long Term Key Request event indicates that the master +is attempting to encrypt or re-encrypt the link. + +Pre-condition: BlueZ host paired and running as slave. +How to reproduce(master): + + 1) Establish an ACL LE encrypted link + 2) Disconnect the link + 3) Try to re-establish the ACL LE encrypted link (fails) + +> HCI Event: LE Meta Event (0x3e) plen 19 + LE Connection Complete (0x01) + Status: Success (0x00) + Handle: 64 + Role: Slave (0x01) +... +@ Device Connected: 00:02:72:DC:29:C9 (1) flags 0x0000 +> HCI Event: LE Meta Event (0x3e) plen 13 + LE Long Term Key Request (0x05) + Handle: 64 + Random number: 875be18439d9aa37 + Encryption diversifier: 0x76ed +< HCI Command: LE Long Term Key Request Reply (0x08|0x001a) plen 18 + Handle: 64 + Long term key: 2aa531db2fce9f00a0569c7d23d17409 +> HCI Event: Command Complete (0x0e) plen 6 + LE Long Term Key Request Reply (0x08|0x001a) ncmd 1 + Status: Success (0x00) + Handle: 64 +> HCI Event: Encryption Change (0x08) plen 4 + Status: Success (0x00) + Handle: 64 + Encryption: Enabled with AES-CCM (0x01) +... +@ Device Disconnected: 00:02:72:DC:29:C9 (1) reason 3 +< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1 + Advertising: Enabled (0x01) +> HCI Event: Command Complete (0x0e) plen 4 + LE Set Advertise Enable (0x08|0x000a) ncmd 1 + Status: Success (0x00) +> HCI Event: LE Meta Event (0x3e) plen 19 + LE Connection Complete (0x01) + Status: Success (0x00) + Handle: 64 + Role: Slave (0x01) +... +@ Device Connected: 00:02:72:DC:29:C9 (1) flags 0x0000 +> HCI Event: LE Meta Event (0x3e) plen 13 + LE Long Term Key Request (0x05) + Handle: 64 + Random number: 875be18439d9aa37 + Encryption diversifier: 0x76ed +< HCI Command: LE Long Term Key Request Neg Reply (0x08|0x001b) plen 2 + Handle: 64 +> HCI Event: Command Complete (0x0e) plen 6 + LE Long Term Key Request Neg Reply (0x08|0x001b) ncmd 1 + Status: Success (0x00) + Handle: 64 +> HCI Event: Disconnect Complete (0x05) plen 4 + Status: Success (0x00) + Handle: 64 + Reason: Authentication Failure (0x05) +@ Device Disconnected: 00:02:72:DC:29:C9 (1) reason 0 + +Signed-off-by: Claudio Takahasi +Signed-off-by: Johan Hedberg +Signed-off-by: Greg Kroah-Hartman + +--- + net/bluetooth/hci_event.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/net/bluetooth/hci_event.c ++++ b/net/bluetooth/hci_event.c +@@ -3619,7 +3619,13 @@ static void hci_le_ltk_request_evt(struc + + hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); + +- if (ltk->type & HCI_SMP_STK) { ++ /* Ref. Bluetooth Core SPEC pages 1975 and 2004. STK is a ++ * temporary key used to encrypt a connection following ++ * pairing. It is used during the Encrypted Session Setup to ++ * distribute the keys. Later, security can be re-established ++ * using a distributed LTK. ++ */ ++ if (ltk->type == HCI_SMP_STK_SLAVE) { + list_del(<k->list); + kfree(ltk); + } diff --git a/queue-3.10/btrfs-skip-submitting-barrier-for-missing-device.patch b/queue-3.10/btrfs-skip-submitting-barrier-for-missing-device.patch new file mode 100644 index 00000000000..f710b69d1c8 --- /dev/null +++ b/queue-3.10/btrfs-skip-submitting-barrier-for-missing-device.patch @@ -0,0 +1,53 @@ +From f88ba6a2a44ee98e8d59654463dc157bb6d13c43 Mon Sep 17 00:00:00 2001 +From: Hidetoshi Seto +Date: Wed, 5 Feb 2014 16:34:38 +0900 +Subject: Btrfs: skip submitting barrier for missing device + +From: Hidetoshi Seto + +commit f88ba6a2a44ee98e8d59654463dc157bb6d13c43 upstream. + +I got an error on v3.13: + BTRFS error (device sdf1) in write_all_supers:3378: errno=-5 IO failure (errors while submitting device barriers.) + +how to reproduce: + > mkfs.btrfs -f -d raid1 /dev/sdf1 /dev/sdf2 + > wipefs -a /dev/sdf2 + > mount -o degraded /dev/sdf1 /mnt + > btrfs balance start -f -sconvert=single -mconvert=single -dconvert=single /mnt + +The reason of the error is that barrier_all_devices() failed to submit +barrier to the missing device. However it is clear that we cannot do +anything on missing device, and also it is not necessary to care chunks +on the missing device. + +This patch stops sending/waiting barrier if device is missing. + +Signed-off-by: Hidetoshi Seto +Signed-off-by: Josef Bacik +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/disk-io.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/fs/btrfs/disk-io.c ++++ b/fs/btrfs/disk-io.c +@@ -3161,6 +3161,8 @@ static int barrier_all_devices(struct bt + /* send down all the barriers */ + head = &info->fs_devices->devices; + list_for_each_entry_rcu(dev, head, dev_list) { ++ if (dev->missing) ++ continue; + if (!dev->bdev) { + errors_send++; + continue; +@@ -3175,6 +3177,8 @@ static int barrier_all_devices(struct bt + + /* wait for all the barriers */ + list_for_each_entry_rcu(dev, head, dev_list) { ++ if (dev->missing) ++ continue; + if (!dev->bdev) { + errors_wait++; + continue; diff --git a/queue-3.10/char-ipmi_bt_sm-fix-infinite-loop.patch b/queue-3.10/char-ipmi_bt_sm-fix-infinite-loop.patch new file mode 100644 index 00000000000..d8aea543745 --- /dev/null +++ b/queue-3.10/char-ipmi_bt_sm-fix-infinite-loop.patch @@ -0,0 +1,47 @@ +From a94cdd1f4d30f12904ab528152731fb13a812a16 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Mon, 14 Apr 2014 09:46:50 -0500 +Subject: Char: ipmi_bt_sm, fix infinite loop + +From: Jiri Slaby + +commit a94cdd1f4d30f12904ab528152731fb13a812a16 upstream. + +In read_all_bytes, we do + + unsigned char i; + ... + bt->read_data[0] = BMC2HOST; + bt->read_count = bt->read_data[0]; + ... + for (i = 1; i <= bt->read_count; i++) + bt->read_data[i] = BMC2HOST; + +If bt->read_data[0] == bt->read_count == 255, we loop infinitely in the +'for' loop. Make 'i' an 'int' instead of 'char' to get rid of the +overflow and finish the loop after 255 iterations every time. + +Signed-off-by: Jiri Slaby +Reported-and-debugged-by: Rui Hui Dian +Cc: Tomas Cech +Cc: Corey Minyard +Cc: +Signed-off-by: Corey Minyard +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/ipmi/ipmi_bt_sm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/char/ipmi/ipmi_bt_sm.c ++++ b/drivers/char/ipmi/ipmi_bt_sm.c +@@ -352,7 +352,7 @@ static inline void write_all_bytes(struc + + static inline int read_all_bytes(struct si_sm_data *bt) + { +- unsigned char i; ++ unsigned int i; + + /* + * length is "framing info", minimum = 4: NetFn, Seq, Cmd, cCode. diff --git a/queue-3.10/pci-enable-intx-in-pci_reenable_device-only-when-msi-msi-x-not-enabled.patch b/queue-3.10/pci-enable-intx-in-pci_reenable_device-only-when-msi-msi-x-not-enabled.patch new file mode 100644 index 00000000000..6a5dfc99f9b --- /dev/null +++ b/queue-3.10/pci-enable-intx-in-pci_reenable_device-only-when-msi-msi-x-not-enabled.patch @@ -0,0 +1,47 @@ +From 866d54177b4e671cd52bed1fb487d140d7b691f5 Mon Sep 17 00:00:00 2001 +From: Bjorn Helgaas +Date: Fri, 7 Mar 2014 16:06:05 -0700 +Subject: PCI: Enable INTx in pci_reenable_device() only when MSI/MSI-X not enabled + +From: Bjorn Helgaas + +commit 866d54177b4e671cd52bed1fb487d140d7b691f5 upstream. + +Andreas reported that after 1f42db786b14 ("PCI: Enable INTx if BIOS left +them disabled"), pciehp surprise removal stopped working. + +This happens because pci_reenable_device() on the hotplug bridge (used in +the pciehp_configure_device() path) clears the Interrupt Disable bit, which +apparently breaks the bridge's MSI hotplug event reporting. + +Previously we cleared the Interrupt Disable bit in do_pci_enable_device(), +which is used by both pci_enable_device() and pci_reenable_device(). But +we use pci_reenable_device() after the driver may have enabled MSI or +MSI-X, and we *set* Interrupt Disable as part of enabling MSI/MSI-X. + +This patch clears Interrupt Disable only when MSI/MSI-X has not been +enabled. + +Fixes: 1f42db786b14 PCI: Enable INTx if BIOS left them disabled +Link: https://bugzilla.kernel.org/show_bug.cgi?id=71691 +Reported-and-tested-by: Andreas Noever +Signed-off-by: Bjorn Helgaas +CC: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pci.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/pci/pci.c ++++ b/drivers/pci/pci.c +@@ -1133,6 +1133,9 @@ static int do_pci_enable_device(struct p + if (dev->msi_enabled || dev->msix_enabled) + return 0; + ++ if (dev->msi_enabled || dev->msix_enabled) ++ return 0; ++ + pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); + if (pin) { + pci_read_config_word(dev, PCI_COMMAND, &cmd); diff --git a/queue-3.10/pid_namespace-pidns_get-should-check-task_active_pid_ns-null.patch b/queue-3.10/pid_namespace-pidns_get-should-check-task_active_pid_ns-null.patch new file mode 100644 index 00000000000..0189caf4a2d --- /dev/null +++ b/queue-3.10/pid_namespace-pidns_get-should-check-task_active_pid_ns-null.patch @@ -0,0 +1,36 @@ +From d23082257d83e4bc89727d5aedee197e907999d2 Mon Sep 17 00:00:00 2001 +From: Oleg Nesterov +Date: Wed, 2 Apr 2014 17:45:05 +0200 +Subject: pid_namespace: pidns_get() should check task_active_pid_ns() != NULL + +From: Oleg Nesterov + +commit d23082257d83e4bc89727d5aedee197e907999d2 upstream. + +pidns_get()->get_pid_ns() can hit ns == NULL. This task_struct can't +go away, but task_active_pid_ns(task) is NULL if release_task(task) +was already called. Alternatively we could change get_pid_ns(ns) to +check ns != NULL, but it seems that other callers are fine. + +Signed-off-by: Oleg Nesterov +Cc: Eric W. Biederman ebiederm@xmission.com> +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/pid_namespace.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/pid_namespace.c ++++ b/kernel/pid_namespace.c +@@ -312,7 +312,9 @@ static void *pidns_get(struct task_struc + struct pid_namespace *ns; + + rcu_read_lock(); +- ns = get_pid_ns(task_active_pid_ns(task)); ++ ns = task_active_pid_ns(task); ++ if (ns) ++ get_pid_ns(ns); + rcu_read_unlock(); + + return ns; diff --git a/queue-3.10/series b/queue-3.10/series index 33e150294e1..75fe6bf7daa 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -1 +1,11 @@ user-namespace-fix-incorrect-memory-barriers.patch +char-ipmi_bt_sm-fix-infinite-loop.patch +x86-adjust-irq-remapping-quirk-for-older-revisions-of-5500-5520-chipsets.patch +pci-enable-intx-in-pci_reenable_device-only-when-msi-msi-x-not-enabled.patch +staging-comedi-8255_pci-initialize-mite-data-window.patch +tty-set-correct-tty-name-in-active-sysfs-attribute.patch +pid_namespace-pidns_get-should-check-task_active_pid_ns-null.patch +bluetooth-fix-removing-long-term-key.patch +backing_dev-fix-hung-task-on-sync.patch +bdi-avoid-oops-on-device-removal.patch +btrfs-skip-submitting-barrier-for-missing-device.patch diff --git a/queue-3.10/staging-comedi-8255_pci-initialize-mite-data-window.patch b/queue-3.10/staging-comedi-8255_pci-initialize-mite-data-window.patch new file mode 100644 index 00000000000..8b331b88dc1 --- /dev/null +++ b/queue-3.10/staging-comedi-8255_pci-initialize-mite-data-window.patch @@ -0,0 +1,127 @@ +From 268d1e799663b795cba15c64f5d29407786a9dd4 Mon Sep 17 00:00:00 2001 +From: Ian Abbott +Date: Thu, 13 Mar 2014 15:30:39 +0000 +Subject: staging: comedi: 8255_pci: initialize MITE data window + +From: Ian Abbott + +commit 268d1e799663b795cba15c64f5d29407786a9dd4 upstream. + +According to National Instruments' PCI-DIO-96/PXI-6508/PCI-6503 User +Manual, the physical address in PCI BAR1 needs to be OR'ed with 0x80 and +written to register offset 0xC0 in the "MITE" registers (BAR0). Do so +during initialization of the National Instruments boards handled by the +"8255_pci" driver. The boards were previously handled by the +"ni_pcidio" driver, where the initialization was done by `mite_setup()` +in the "mite" module. The "mite" module comes with too much extra +baggage for the "8255_pci" driver to deal with so use a local, simpler +initialization function. + +Signed-off-by: Ian Abbott +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/comedi/drivers/8255_pci.c | 34 ++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +--- a/drivers/staging/comedi/drivers/8255_pci.c ++++ b/drivers/staging/comedi/drivers/8255_pci.c +@@ -59,6 +59,7 @@ Configuration Options: not applicable, u + #include "../comedidev.h" + + #include "8255.h" ++#include "mite.h" + + enum pci_8255_boardid { + BOARD_ADLINK_PCI7224, +@@ -82,6 +83,7 @@ struct pci_8255_boardinfo { + const char *name; + int dio_badr; + int n_8255; ++ unsigned int has_mite:1; + }; + + static const struct pci_8255_boardinfo pci_8255_boards[] = { +@@ -129,36 +131,43 @@ static const struct pci_8255_boardinfo p + .name = "ni_pci-dio-96", + .dio_badr = 1, + .n_8255 = 4, ++ .has_mite = 1, + }, + [BOARD_NI_PCIDIO96B] = { + .name = "ni_pci-dio-96b", + .dio_badr = 1, + .n_8255 = 4, ++ .has_mite = 1, + }, + [BOARD_NI_PXI6508] = { + .name = "ni_pxi-6508", + .dio_badr = 1, + .n_8255 = 4, ++ .has_mite = 1, + }, + [BOARD_NI_PCI6503] = { + .name = "ni_pci-6503", + .dio_badr = 1, + .n_8255 = 1, ++ .has_mite = 1, + }, + [BOARD_NI_PCI6503B] = { + .name = "ni_pci-6503b", + .dio_badr = 1, + .n_8255 = 1, ++ .has_mite = 1, + }, + [BOARD_NI_PCI6503X] = { + .name = "ni_pci-6503x", + .dio_badr = 1, + .n_8255 = 1, ++ .has_mite = 1, + }, + [BOARD_NI_PXI_6503] = { + .name = "ni_pxi-6503", + .dio_badr = 1, + .n_8255 = 1, ++ .has_mite = 1, + }, + }; + +@@ -166,6 +175,25 @@ struct pci_8255_private { + void __iomem *mmio_base; + }; + ++static int pci_8255_mite_init(struct pci_dev *pcidev) ++{ ++ void __iomem *mite_base; ++ u32 main_phys_addr; ++ ++ /* ioremap the MITE registers (BAR 0) temporarily */ ++ mite_base = pci_ioremap_bar(pcidev, 0); ++ if (!mite_base) ++ return -ENOMEM; ++ ++ /* set data window to main registers (BAR 1) */ ++ main_phys_addr = pci_resource_start(pcidev, 1); ++ writel(main_phys_addr | WENAB, mite_base + MITE_IODWBSR); ++ ++ /* finished with MITE registers */ ++ iounmap(mite_base); ++ return 0; ++} ++ + static int pci_8255_mmio(int dir, int port, int data, unsigned long iobase) + { + void __iomem *mmio_base = (void __iomem *)iobase; +@@ -205,6 +233,12 @@ static int pci_8255_auto_attach(struct c + if (ret) + return ret; + ++ if (board->has_mite) { ++ ret = pci_8255_mite_init(pcidev); ++ if (ret) ++ return ret; ++ } ++ + is_mmio = (pci_resource_flags(pcidev, board->dio_badr) & + IORESOURCE_MEM) != 0; + if (is_mmio) { diff --git a/queue-3.10/tty-set-correct-tty-name-in-active-sysfs-attribute.patch b/queue-3.10/tty-set-correct-tty-name-in-active-sysfs-attribute.patch new file mode 100644 index 00000000000..2752ef30080 --- /dev/null +++ b/queue-3.10/tty-set-correct-tty-name-in-active-sysfs-attribute.patch @@ -0,0 +1,75 @@ +From 723abd87f6e536f1353c8f64f621520bc29523a3 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 27 Feb 2014 12:30:51 +0100 +Subject: tty: Set correct tty name in 'active' sysfs attribute + +From: Hannes Reinecke + +commit 723abd87f6e536f1353c8f64f621520bc29523a3 upstream. + +The 'active' sysfs attribute should refer to the currently active tty +devices the console is running on, not the currently active console. The +console structure doesn't refer to any device in sysfs, only the tty the +console is running on has. So we need to print out the tty names in +'active', not the console names. + +There is one special-case, which is tty0. If the console is directed to +it, we want 'tty0' to show up in the file, so user-space knows that the +messages get forwarded to the active VT. The ->device() callback would +resolve tty0, though. Hence, treat it special and don't call into the VT +layer to resolve it (plymouth is known to depend on it). + +Cc: Lennart Poettering +Cc: Kay Sievers +Cc: Jiri Slaby +Signed-off-by: Werner Fink +Signed-off-by: Hannes Reinecke +Signed-off-by: David Herrmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/tty_io.c | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -1267,12 +1267,13 @@ static void pty_line_name(struct tty_dri + * + * Locking: None + */ +-static void tty_line_name(struct tty_driver *driver, int index, char *p) ++static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p) + { + if (driver->flags & TTY_DRIVER_UNNUMBERED_NODE) +- strcpy(p, driver->name); ++ return sprintf(p, "%s", driver->name); + else +- sprintf(p, "%s%d", driver->name, index + driver->name_base); ++ return sprintf(p, "%s%d", driver->name, ++ index + driver->name_base); + } + + /** +@@ -3538,9 +3539,19 @@ static ssize_t show_cons_active(struct d + if (i >= ARRAY_SIZE(cs)) + break; + } +- while (i--) +- count += sprintf(buf + count, "%s%d%c", +- cs[i]->name, cs[i]->index, i ? ' ':'\n'); ++ while (i--) { ++ int index = cs[i]->index; ++ struct tty_driver *drv = cs[i]->device(cs[i], &index); ++ ++ /* don't resolve tty0 as some programs depend on it */ ++ if (drv && (cs[i]->index > 0 || drv->major != TTY_MAJOR)) ++ count += tty_line_name(drv, index, buf + count); ++ else ++ count += sprintf(buf + count, "%s%d", ++ cs[i]->name, cs[i]->index); ++ ++ count += sprintf(buf + count, "%c", i ? ' ':'\n'); ++ } + console_unlock(); + + return count; diff --git a/queue-3.10/x86-adjust-irq-remapping-quirk-for-older-revisions-of-5500-5520-chipsets.patch b/queue-3.10/x86-adjust-irq-remapping-quirk-for-older-revisions-of-5500-5520-chipsets.patch new file mode 100644 index 00000000000..79766cd9cc0 --- /dev/null +++ b/queue-3.10/x86-adjust-irq-remapping-quirk-for-older-revisions-of-5500-5520-chipsets.patch @@ -0,0 +1,64 @@ +From 6f8a1b335fde143b7407036e2368d3cd6eb55674 Mon Sep 17 00:00:00 2001 +From: Neil Horman +Date: Wed, 12 Mar 2014 14:44:33 -0400 +Subject: x86: Adjust irq remapping quirk for older revisions of 5500/5520 chipsets + +From: Neil Horman + +commit 6f8a1b335fde143b7407036e2368d3cd6eb55674 upstream. + +Commit 03bbcb2e7e2 (iommu/vt-d: add quirk for broken interrupt +remapping on 55XX chipsets) properly disables irq remapping on the +5500/5520 chipsets that don't correctly perform that feature. + +However, when I wrote it, I followed the errata sheet linked in that +commit too closely, and explicitly tied the activation of the quirk to +revision 0x13 of the chip, under the assumption that earlier revisions +were not in the field. Recently a system was reported to be suffering +from this remap bug and the quirk hadn't triggered, because the +revision id register read at a lower value that 0x13, so the quirk +test failed improperly. Given this, it seems only prudent to adjust +this quirk so that any revision less than 0x13 has the quirk asserted. + +[ tglx: Removed the 0x12 comparison of pci id 3405 as this is covered + by the <= 0x13 check already ] + +Signed-off-by: Neil Horman +Cc: Ingo Molnar +Cc: "H. Peter Anvin" +Cc: x86@kernel.org +Link: http://lkml.kernel.org/r/1394649873-14913-1-git-send-email-nhorman@tuxdriver.com +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/early-quirks.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +--- a/arch/x86/kernel/early-quirks.c ++++ b/arch/x86/kernel/early-quirks.c +@@ -202,18 +202,15 @@ static void __init intel_remapping_check + revision = read_pci_config_byte(num, slot, func, PCI_REVISION_ID); + + /* +- * Revision 13 of all triggering devices id in this quirk have +- * a problem draining interrupts when irq remapping is enabled, +- * and should be flagged as broken. Additionally revisions 0x12 +- * and 0x22 of device id 0x3405 has this problem. ++ * Revision <= 13 of all triggering devices id in this quirk ++ * have a problem draining interrupts when irq remapping is ++ * enabled, and should be flagged as broken. Additionally ++ * revision 0x22 of device id 0x3405 has this problem. + */ +- if (revision == 0x13) ++ if (revision <= 0x13) + set_irq_remapping_broken(); +- else if ((device == 0x3405) && +- ((revision == 0x12) || +- (revision == 0x22))) ++ else if (device == 0x3405 && revision == 0x22) + set_irq_remapping_broken(); +- + } + + #define QFLAG_APPLY_ONCE 0x1