aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 17:18:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 17:18:07 -0400
commit43c9fad942b5afb9e03801c0721d83160fa5b0dd (patch)
treec2002d29d5579196b0f54fd78e47ab02efced394 /drivers/acpi/apei
parentcb8a4deaf9b2778653c4391d8ccb24c5ab159f9d (diff)
parentd461003574ebc862c2dae70c9e1ab32b1bf2cda1 (diff)
Merge tag 'pm+acpi-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management and ACPI updates from Rafael Wysocki: "The rework of backlight interface selection API from Hans de Goede stands out from the number of commits and the number of affected places perspective. The cpufreq core fixes from Viresh Kumar are quite significant too as far as the number of commits goes and because they should reduce CPU online/offline overhead quite a bit in the majority of cases. From the new featues point of view, the ACPICA update (to upstream revision 20150515) adding support for new ACPI 6 material to ACPICA is the one that matters the most as some new significant features will be based on it going forward. Also included is an update of the ACPI device power management core to follow ACPI 6 (which in turn reflects the Windows' device PM implementation), a PM core extension to support wakeup interrupts in a more generic way and support for the ACPI _CCA device configuration object. The rest is mostly fixes and cleanups all over and some documentation updates, including new DT bindings for Operating Performance Points. There is one fix for a regression introduced in the 4.1 cycle, but it adds quite a number of lines of code, it wasn't really ready before Thursday and you were on vacation, so I refrained from pushing it on the last minute for 4.1. Specifics: - ACPICA update to upstream revision 20150515 including basic support for ACPI 6 features: new ACPI tables introduced by ACPI 6 (STAO, XENV, WPBT, NFIT, IORT), changes related to the other tables (DTRM, FADT, LPIT, MADT), new predefined names (_BTH, _CR3, _DSD, _LPI, _MTL, _PRR, _RDI, _RST, _TFP, _TSN), fixes and cleanups (Bob Moore, Lv Zheng). - ACPI device power management core code update to follow ACPI 6 which reflects the ACPI device power management implementation in Windows (Rafael J Wysocki). - rework of the backlight interface selection logic to reduce the number of kernel command line options and improve the handling of DMI quirks that may be involved in that and to make the code generally more straightforward (Hans de Goede). - fixes for the ACPI Embedded Controller (EC) driver related to the handling of EC transactions (Lv Zheng). - fix for a regression related to the ACPI resources management and resulting from a recent change of ACPI initialization code ordering (Rafael J Wysocki). - fix for a system initialization regression related to ACPI introduced during the 3.14 cycle and caused by running the code that switches the platform over to the ACPI mode too early in the initialization sequence (Rafael J Wysocki). - support for the ACPI _CCA device configuration object related to DMA cache coherence (Suravee Suthikulpanit). - ACPI/APEI fixes and cleanups (Jiri Kosina, Borislav Petkov). - ACPI battery driver cleanups (Luis Henriques, Mathias Krause). - ACPI processor driver cleanups (Hanjun Guo). - cleanups and documentation update related to the ACPI device properties interface based on _DSD (Rafael J Wysocki). - ACPI device power management fixes (Rafael J Wysocki). - assorted cleanups related to ACPI (Dominik Brodowski, Fabian Frederick, Lorenzo Pieralisi, Mathias Krause, Rafael J Wysocki). - fix for a long-standing issue causing General Protection Faults to be generated occasionally on return to user space after resume from ACPI-based suspend-to-RAM on 32-bit x86 (Ingo Molnar). - fix to make the suspend core code return -EBUSY consistently in all cases when system suspend is aborted due to wakeup detection (Ruchi Kandoi). - support for automated device wakeup IRQ handling allowing drivers to make their PM support more starightforward (Tony Lindgren). - new tracepoints for suspend-to-idle tracing and rework of the prepare/complete callbacks tracing in the PM core (Todd E Brandt, Rafael J Wysocki). - wakeup sources framework enhancements (Jin Qian). - new macro for noirq system PM callbacks (Grygorii Strashko). - assorted cleanups related to system suspend (Rafael J Wysocki). - cpuidle core cleanups to make the code more efficient (Rafael J Wysocki). - powernv/pseries cpuidle driver update (Shilpasri G Bhat). - cpufreq core fixes related to CPU online/offline that should reduce the overhead of these operations quite a bit, unless the CPU in question is physically going away (Viresh Kumar, Saravana Kannan). - serialization of cpufreq governor callbacks to avoid race conditions in some cases (Viresh Kumar). - intel_pstate driver fixes and cleanups (Doug Smythies, Prarit Bhargava, Joe Konno). - cpufreq driver (arm_big_little, cpufreq-dt, qoriq) updates (Sudeep Holla, Felipe Balbi, Tang Yuantian). - assorted cleanups in cpufreq drivers and core (Shailendra Verma, Fabian Frederick, Wang Long). - new Device Tree bindings for representing Operating Performance Points (Viresh Kumar). - updates for the common clock operations support code in the PM core (Rajendra Nayak, Geert Uytterhoeven). - PM domains core code update (Geert Uytterhoeven). - Intel Knights Landing support for the RAPL (Running Average Power Limit) power capping driver (Dasaratharaman Chandramouli). - fixes related to the floor frequency setting on Atom SoCs in the RAPL power capping driver (Ajay Thomas). - runtime PM framework documentation update (Ben Dooks). - cpupower tool fix (Herton R Krzesinski)" * tag 'pm+acpi-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (194 commits) cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state x86: Load __USER_DS into DS/ES after resume PM / OPP: Add binding for 'opp-suspend' PM / OPP: Allow multiple OPP tables to be passed via DT PM / OPP: Add new bindings to address shortcomings of existing bindings ACPI: Constify ACPI device IDs in documentation ACPI / enumeration: Document the rules regarding the PRP0001 device ID ACPI / video: Make acpi_video_unregister_backlight() private acpi-video-detect: Remove old API toshiba-acpi: Port to new backlight interface selection API thinkpad-acpi: Port to new backlight interface selection API sony-laptop: Port to new backlight interface selection API samsung-laptop: Port to new backlight interface selection API msi-wmi: Port to new backlight interface selection API msi-laptop: Port to new backlight interface selection API intel-oaktrail: Port to new backlight interface selection API ideapad-laptop: Port to new backlight interface selection API fujitsu-laptop: Port to new backlight interface selection API eeepc-laptop: Port to new backlight interface selection API dell-wmi: Port to new backlight interface selection API ...
Diffstat (limited to 'drivers/acpi/apei')
-rw-r--r--drivers/acpi/apei/ghes.c108
1 files changed, 55 insertions, 53 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index e82d0976a5d0..2bfd53cbfe80 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -729,10 +729,10 @@ static struct llist_head ghes_estatus_llist;
729static struct irq_work ghes_proc_irq_work; 729static struct irq_work ghes_proc_irq_work;
730 730
731/* 731/*
732 * NMI may be triggered on any CPU, so ghes_nmi_lock is used for 732 * NMI may be triggered on any CPU, so ghes_in_nmi is used for
733 * mutual exclusion. 733 * having only one concurrent reader.
734 */ 734 */
735static DEFINE_RAW_SPINLOCK(ghes_nmi_lock); 735static atomic_t ghes_in_nmi = ATOMIC_INIT(0);
736 736
737static LIST_HEAD(ghes_nmi); 737static LIST_HEAD(ghes_nmi);
738 738
@@ -797,73 +797,75 @@ static void ghes_print_queued_estatus(void)
797 } 797 }
798} 798}
799 799
800/* Save estatus for further processing in IRQ context */
801static void __process_error(struct ghes *ghes)
802{
803#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
804 u32 len, node_len;
805 struct ghes_estatus_node *estatus_node;
806 struct acpi_hest_generic_status *estatus;
807
808 if (ghes_estatus_cached(ghes->estatus))
809 return;
810
811 len = cper_estatus_len(ghes->estatus);
812 node_len = GHES_ESTATUS_NODE_LEN(len);
813
814 estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool, node_len);
815 if (!estatus_node)
816 return;
817
818 estatus_node->ghes = ghes;
819 estatus_node->generic = ghes->generic;
820 estatus = GHES_ESTATUS_FROM_NODE(estatus_node);
821 memcpy(estatus, ghes->estatus, len);
822 llist_add(&estatus_node->llnode, &ghes_estatus_llist);
823#endif
824}
825
826static void __ghes_panic(struct ghes *ghes)
827{
828 oops_begin();
829 ghes_print_queued_estatus();
830 __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
831
832 /* reboot to log the error! */
833 if (panic_timeout == 0)
834 panic_timeout = ghes_panic_timeout;
835 panic("Fatal hardware error!");
836}
837
800static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) 838static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
801{ 839{
802 struct ghes *ghes, *ghes_global = NULL; 840 struct ghes *ghes;
803 int sev, sev_global = -1; 841 int sev, ret = NMI_DONE;
804 int ret = NMI_DONE; 842
843 if (!atomic_add_unless(&ghes_in_nmi, 1, 1))
844 return ret;
805 845
806 raw_spin_lock(&ghes_nmi_lock);
807 list_for_each_entry_rcu(ghes, &ghes_nmi, list) { 846 list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
808 if (ghes_read_estatus(ghes, 1)) { 847 if (ghes_read_estatus(ghes, 1)) {
809 ghes_clear_estatus(ghes); 848 ghes_clear_estatus(ghes);
810 continue; 849 continue;
811 } 850 }
812 sev = ghes_severity(ghes->estatus->error_severity);
813 if (sev > sev_global) {
814 sev_global = sev;
815 ghes_global = ghes;
816 }
817 ret = NMI_HANDLED;
818 }
819
820 if (ret == NMI_DONE)
821 goto out;
822 851
823 if (sev_global >= GHES_SEV_PANIC) { 852 sev = ghes_severity(ghes->estatus->error_severity);
824 oops_begin(); 853 if (sev >= GHES_SEV_PANIC)
825 ghes_print_queued_estatus(); 854 __ghes_panic(ghes);
826 __ghes_print_estatus(KERN_EMERG, ghes_global->generic,
827 ghes_global->estatus);
828 /* reboot to log the error! */
829 if (panic_timeout == 0)
830 panic_timeout = ghes_panic_timeout;
831 panic("Fatal hardware error!");
832 }
833 855
834 list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
835#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
836 u32 len, node_len;
837 struct ghes_estatus_node *estatus_node;
838 struct acpi_hest_generic_status *estatus;
839#endif
840 if (!(ghes->flags & GHES_TO_CLEAR)) 856 if (!(ghes->flags & GHES_TO_CLEAR))
841 continue; 857 continue;
842#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 858
843 if (ghes_estatus_cached(ghes->estatus)) 859 __process_error(ghes);
844 goto next;
845 /* Save estatus for further processing in IRQ context */
846 len = cper_estatus_len(ghes->estatus);
847 node_len = GHES_ESTATUS_NODE_LEN(len);
848 estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool,
849 node_len);
850 if (estatus_node) {
851 estatus_node->ghes = ghes;
852 estatus_node->generic = ghes->generic;
853 estatus = GHES_ESTATUS_FROM_NODE(estatus_node);
854 memcpy(estatus, ghes->estatus, len);
855 llist_add(&estatus_node->llnode, &ghes_estatus_llist);
856 }
857next:
858#endif
859 ghes_clear_estatus(ghes); 860 ghes_clear_estatus(ghes);
861
862 ret = NMI_HANDLED;
860 } 863 }
864
861#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 865#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
862 irq_work_queue(&ghes_proc_irq_work); 866 irq_work_queue(&ghes_proc_irq_work);
863#endif 867#endif
864 868 atomic_dec(&ghes_in_nmi);
865out:
866 raw_spin_unlock(&ghes_nmi_lock);
867 return ret; 869 return ret;
868} 870}
869 871