Commit b7c2aecc0747f5c86a1959bce6a7ce8170a556b0

Authored by Ursula Braun
Committed by David S. Miller
1 parent 2c1409a0a2

iucv: add work_queue cleanup for suspend

If iucv_work_queue is not empty during kernel freeze, a kernel panic
occurs. This suspend-patch adds flushing of the work queue for
pending connection requests and severing of remaining pending
connections.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 13 additions and 3 deletions Side-by-side Diff

... ... @@ -1768,7 +1768,6 @@
1768 1768 */
1769 1769 static void iucv_work_fn(struct work_struct *work)
1770 1770 {
1771   - typedef void iucv_irq_fn(struct iucv_irq_data *);
1772 1771 LIST_HEAD(work_queue);
1773 1772 struct iucv_irq_list *p, *n;
1774 1773  
1775 1774  
1776 1775  
... ... @@ -1878,14 +1877,25 @@
1878 1877 static int iucv_pm_freeze(struct device *dev)
1879 1878 {
1880 1879 int cpu;
  1880 + struct iucv_irq_list *p, *n;
1881 1881 int rc = 0;
1882 1882  
1883 1883 #ifdef CONFIG_PM_DEBUG
1884 1884 printk(KERN_WARNING "iucv_pm_freeze\n");
1885 1885 #endif
  1886 + if (iucv_pm_state != IUCV_PM_FREEZING) {
  1887 + for_each_cpu_mask_nr(cpu, iucv_irq_cpumask)
  1888 + smp_call_function_single(cpu, iucv_block_cpu_almost,
  1889 + NULL, 1);
  1890 + cancel_work_sync(&iucv_work);
  1891 + list_for_each_entry_safe(p, n, &iucv_work_queue, list) {
  1892 + list_del_init(&p->list);
  1893 + iucv_sever_pathid(p->data.ippathid,
  1894 + iucv_error_no_listener);
  1895 + kfree(p);
  1896 + }
  1897 + }
1886 1898 iucv_pm_state = IUCV_PM_FREEZING;
1887   - for_each_cpu_mask_nr(cpu, iucv_irq_cpumask)
1888   - smp_call_function_single(cpu, iucv_block_cpu_almost, NULL, 1);
1889 1899 if (dev->driver && dev->driver->pm && dev->driver->pm->freeze)
1890 1900 rc = dev->driver->pm->freeze(dev);
1891 1901 if (iucv_path_table_empty())