linux_dsm_epyc7002/arch/x86/kernel/apic
Mika Westerberg db91aa793f x86/irq: Prevent force migration of irqs which are not in the vector domain
When a CPU is about to be offlined we call fixup_irqs() that resets IRQ
affinities related to the CPU in question. The same thing is also done when
the system is suspended to S-states like S3 (mem).

For each IRQ we try to complete any on-going move regardless whether the
IRQ is actually part of x86_vector_domain. For each IRQ descriptor we fetch
its chip_data, assume it is of type struct apic_chip_data and manipulate it
by clearing old_domain mask etc. For irq_chips that are not part of the
x86_vector_domain, like those created by various GPIO drivers, will find
their chip_data being changed unexpectly.

Below is an example where GPIO chip owned by pinctrl-sunrisepoint.c gets
corrupted after resume:

  # cat /sys/kernel/debug/gpio
  gpiochip0: GPIOs 360-511, parent: platform/INT344B:00, INT344B:00:
   gpio-511 (                    |sysfs               ) in  hi

  # rtcwake -s10 -mmem
  <10 seconds passes>

  # cat /sys/kernel/debug/gpio
  gpiochip0: GPIOs 360-511, parent: platform/INT344B:00, INT344B:00:
   gpio-511 (                    |sysfs               ) in  ?

Note '?' in the output. It means the struct gpio_chip ->get function is
NULL whereas before suspend it was there.

Fix this by first checking that the IRQ belongs to x86_vector_domain before
we try to use the chip_data as struct apic_chip_data.

Reported-and-tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: stable@vger.kernel.org # 4.4+
Link: http://lkml.kernel.org/r/20161003101708.34795-1-mika.westerberg@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2016-10-04 13:13:47 +02:00
..
apic_flat_64.c Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 17:18:52 -07:00
apic_noop.c x86: Apply more __ro_after_init and const 2016-08-10 14:55:05 +02:00
apic_numachip.c x86: Clean up various simple wrapper functions 2016-09-13 20:42:58 +02:00
apic.c x86/apic: Fix silent & fatal merge conflict in __generic_processor_info() 2016-09-26 15:51:22 -04:00
bigsmp_32.c x86: Apply more __ro_after_init and const 2016-08-10 14:55:05 +02:00
htirq.c x86: Constify irqdomain ops 2015-05-05 11:14:48 +02:00
hw_nmi.c x86/kernel: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:41 +02:00
io_apic.c x86/apic: Get rid of apic_version[] array 2016-09-20 00:31:19 +02:00
ipi.c x86/kernel: Audit and remove any unnecessary uses of module.h 2016-07-14 15:06:41 +02:00
Makefile kernel: add kcov code coverage 2016-03-22 15:36:02 -07:00
msi.c x86: Apply more __ro_after_init and const 2016-08-10 14:55:05 +02:00
probe_32.c Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 16:13:28 -07:00
probe_64.c x86/apic: Remove duplicated include from probe_64.c 2016-07-19 16:02:31 +02:00
vector.c x86/irq: Prevent force migration of irqs which are not in the vector domain 2016-10-04 13:13:47 +02:00
x2apic_cluster.c Merge branch 'x86/mm' into x86/asm, to unify the two branches for simplicity 2016-09-08 08:41:52 +02:00
x2apic_phys.c x86: Apply more __ro_after_init and const 2016-08-10 14:55:05 +02:00
x2apic_uv_x.c Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00