From fce5d770a1bcfa6f33ef2a0e7af02b3f0117eb1c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 13 Nov 2017 12:57:06 +0000 Subject: [PATCH 01/26] ftrace: Allow configuring global trace buffer size (for dump-on-oops) We have recently turned on ftrace-dump-on-oops for i915's CI and an issue we have encountered is that the trace buffer size greatly exceeds the pstore capabilities; we get the tail of the oops but not the introduction. Currently the global buffer size is controllable on the cmdline, but at the request of our CI sysadmin, we would like to add a control to the Kconfig as well. The rationale being the cmdline carries the temporary hacks that we want to eradicate, and we want to track the permanent configuration in .config. I have kept the Kconfig option hidden from the user as the default should suffice for the majority of users; reserving the configuration for those that eschew the cmdline option. v2: Add an expert prompt to stop the default value overriding .config changes. Signed-off-by: Chris Wilson Cc: Steven Rostedt Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Tomi Sarvela Cc: Joonas Lahtinen Cc: Daniel Vetter --- kernel/trace/Kconfig | 7 +++++++ kernel/trace/trace.c | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index e08527f50d2a9..1bdc0dc685614 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -115,6 +115,13 @@ config TRACING select EVENT_TRACING select TRACE_CLOCK +config GLOBAL_TRACE_BUF_SIZE + int + prompt "Global ftrace buffer size (for trace_printk)" if EXPERT + range 0 4194034 + default 1441792 # 16384 * 88 (sizeof(struct print_entry)) + depends on TRACING + config GENERIC_TRACER bool select TRACING diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 6a0ee91783656..7390bca22db32 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -637,9 +637,7 @@ int tracing_is_enabled(void) * to not have to wait for all that output. Anyway this can be * boot time and run time configurable. */ -#define TRACE_BUF_SIZE_DEFAULT 1441792UL /* 16384 * 88 (sizeof(entry)) */ - -static unsigned long trace_buf_size = TRACE_BUF_SIZE_DEFAULT; +static unsigned long trace_buf_size = CONFIG_GLOBAL_TRACE_BUF_SIZE; /* trace_types holds a link list of available tracers. */ static struct tracer *trace_types __read_mostly; From 25f9d15102d203fc6d62c77ffcecf5c5b6af4a26 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 29 Nov 2017 10:46:36 +0100 Subject: [PATCH 02/26] lockdep: Up MAX_LOCKDEP_CHAINS cross-release ftl From Chris: "Fwiw, this isn't cross-release but us reloading the module many times, creating a whole host of new lockclasses. Even more fun is when the module gets a slightly different address and the new lock address hashes into an old lock... "I did think about a module-hook to revoke the stale lockclasses, but that still leaves all the hashed chains. "This particular nuisance was temporarily pushed back by teaching igt not to reload i915.ko on a whim." Peter Z. said upstream won't fix this, we need to carry this locally forever: "Its an absolute royal pain to remove all the resources consumed by a module, and if you manage you then have to deal with fragmented storage -- that is, we need to go keep track of which entries are used. "Its a giant heap of complexity that's just not worth it. "Given all that, I don't see why we should up this. Just don't reload modules (or better, don't use modules at all)." Cc: Tvrtko Ursulin Cc: Marta Lofstedt References: https://bugs.freedesktop.org/show_bug.cgi?id=103707 Acked-by: Tvrtko Ursulin Acked-by: Chris Wilson Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20171129094636.18638-2-daniel.vetter@ffwll.ch --- kernel/locking/lockdep_internals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h index 18d85aebbb57f..fce2c3c123331 100644 --- a/kernel/locking/lockdep_internals.h +++ b/kernel/locking/lockdep_internals.h @@ -96,7 +96,7 @@ static const unsigned long LOCKF_USED_IN_IRQ_READ = #else #define MAX_LOCKDEP_ENTRIES 32768UL -#define MAX_LOCKDEP_CHAINS_BITS 16 +#define MAX_LOCKDEP_CHAINS_BITS 17 /* * Stack-trace: tightly packed array of stack backtrace From 1c63c72da4530c7124fc863ae932a62aacff151b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 25 Jun 2019 18:22:12 +0100 Subject: [PATCH 03/26] lockdep: Bump MAX_STACK_TRACE_ENTRIES With our module reloading for selftests, we also quickly exhaust the packed stack trace storage, so give it a little bump at the expense of reserving a lot more memory for lockdep debugging. Signed-off-by: Chris Wilson Cc: Michal Wajdeczko --- kernel/locking/lockdep_internals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h index fce2c3c123331..fea6f89055390 100644 --- a/kernel/locking/lockdep_internals.h +++ b/kernel/locking/lockdep_internals.h @@ -102,7 +102,7 @@ static const unsigned long LOCKF_USED_IN_IRQ_READ = * Stack-trace: tightly packed array of stack backtrace * addresses. Protected by the hash_lock. */ -#define MAX_STACK_TRACE_ENTRIES 524288UL +#define MAX_STACK_TRACE_ENTRIES 1048576UL #define STACK_TRACE_HASH_SIZE 16384 #endif From f8d3b96935de70509fe0e5c7717ad61fc3e3ec2e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 25 Apr 2019 10:19:52 +0100 Subject: [PATCH 04/26] lockdep: Swap storage for pin_count and references As a lockmap takes a reference for every ww_mutex used together, this can be an arbitrarily large number and under control of userspace -- easily overflowing the arbitrary limit of 4096. However, the pin_count (used for detecting unexpected lock dropping) is a full 32b despite nesting being extremely rare (see lockdep_pin_lock). Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20190425092004.9995-33-chris@chris-wilson.co.uk --- include/linux/lockdep.h | 4 ++-- kernel/locking/lockdep.c | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index b8a835fd611b2..e0eca94e58c89 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -271,8 +271,8 @@ struct held_lock { unsigned int read:2; /* see lock_acquire() comment */ unsigned int check:1; /* see lock_acquire() comment */ unsigned int hardirqs_off:1; - unsigned int references:12; /* 32 bits */ - unsigned int pin_count; + unsigned int pin_count:12; /* 32 bits */ + unsigned int references; }; /* diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 233459c03b5ae..e7c0ba2e7459c 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -4330,11 +4330,14 @@ static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock) if (match_held_lock(hlock, lock)) { /* - * Grab 16bits of randomness; this is sufficient to not - * be guessable and still allows some pin nesting in - * our u32 pin_count. + * Grab 6bits of randomness; this is barely sufficient + * to not be guessable and still allows some 32 levels + * of pin nesting in our u12 pin_count. */ - cookie.val = 1 + (prandom_u32() >> 16); + cookie.val = 1 + (prandom_u32() >> 26); + if (DEBUG_LOCKS_WARN_ON(hlock->pin_count + cookie.val >= 1 << 12)) + return NIL_COOKIE; + hlock->pin_count += cookie.val; return cookie; } From 588f932cc66dc8796df7b9febd922de3bc2cce92 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 3 Sep 2018 14:17:45 +0100 Subject: [PATCH 05/26] kernel/panic: Show the stacktrace after additional notifier messages Most systems keep the last messages from the panic, and we value the stacktrace most, so dump it last in order to preserve it for post-mortems. Signed-off-by: Chris Wilson Acked-by: Martin Peres Link: https://patchwork.freedesktop.org/patch/msgid/20180903131745.30593-1-chris@chris-wilson.co.uk --- kernel/panic.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kernel/panic.c b/kernel/panic.c index f470a038b05bd..03caa8a87422c 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -213,13 +213,6 @@ void panic(const char *fmt, ...) buf[len - 1] = '\0'; pr_emerg("Kernel panic - not syncing: %s\n", buf); -#ifdef CONFIG_DEBUG_BUGVERBOSE - /* - * Avoid nested stack-dumping if a panic occurs during oops processing - */ - if (!test_taint(TAINT_DIE) && oops_in_progress <= 1) - dump_stack(); -#endif /* * If kgdb is enabled, give it a chance to run before we stop all @@ -261,6 +254,14 @@ void panic(const char *fmt, ...) */ atomic_notifier_call_chain(&panic_notifier_list, 0, buf); +#ifdef CONFIG_DEBUG_BUGVERBOSE + /* + * Avoid nested stack-dumping if a panic occurs during oops processing + */ + if (!test_taint(TAINT_DIE) && oops_in_progress <= 1) + dump_stack(); +#endif + /* Call flush even twice. It tries harder with a single online CPU */ printk_safe_flush_on_panic(); kmsg_dump(KMSG_DUMP_PANIC); From 58477ab611246a2a2d5f1dd625c3ffa8dcb8cb6d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 9 Oct 2018 12:35:21 +0100 Subject: [PATCH 06/26] x86: Downgrade clock throttling thermal event critical error Under CI testing, it is common for the cpus to overheat with the continuous workloads and end up being throttled. As the cpus still function, it is less of a critical error meriting urgent action, but an expected yet significant condition (pr_note). Signed-off-by: Chris Wilson Cc: Petri Latvala --- arch/x86/kernel/cpu/mce/therm_throt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/therm_throt.c b/arch/x86/kernel/cpu/mce/therm_throt.c index 6e2becf547c5e..e236430cded4f 100644 --- a/arch/x86/kernel/cpu/mce/therm_throt.c +++ b/arch/x86/kernel/cpu/mce/therm_throt.c @@ -188,10 +188,10 @@ static void therm_throt_process(bool new_event, int event, int level) /* if we just entered the thermal event */ if (new_event) { if (event == THERMAL_THROTTLING_EVENT) - pr_crit("CPU%d: %s temperature above threshold, cpu clock throttled (total events = %lu)\n", - this_cpu, - level == CORE_LEVEL ? "Core" : "Package", - state->count); + pr_notice("CPU%d: %s temperature above threshold, cpu clock throttled (total events = %lu)\n", + this_cpu, + level == CORE_LEVEL ? "Core" : "Package", + state->count); return; } if (old_event) { From 9b49bd79467fab7c944e90f57099e18c3954c597 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 9 Oct 2018 11:36:46 +0100 Subject: [PATCH 07/26] libata: Downgrade unsupported feature warnings to notifications Signed-off-by: Chris Wilson Cc: Petri Latvala --- drivers/ata/libata-core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 28c492be0a572..5bd0d6410cd06 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2102,7 +2102,7 @@ static bool ata_identify_page_supported(struct ata_device *dev, u8 page) unsigned int err, i; if (!ata_log_supported(dev, ATA_LOG_IDENTIFY_DEVICE)) { - ata_dev_warn(dev, "ATA Identify Device Log not supported\n"); + ata_dev_notice(dev, "ATA Identify Device Log not supported\n"); return false; } @@ -2176,7 +2176,7 @@ static void ata_dev_config_ncq_send_recv(struct ata_device *dev) unsigned int err_mask; if (!ata_log_supported(dev, ATA_LOG_NCQ_SEND_RECV)) { - ata_dev_warn(dev, "NCQ Send/Recv Log not supported\n"); + ata_dev_notice(dev, "NCQ Send/Recv Log not supported\n"); return; } err_mask = ata_read_log_page(dev, ATA_LOG_NCQ_SEND_RECV, @@ -2205,8 +2205,8 @@ static void ata_dev_config_ncq_non_data(struct ata_device *dev) unsigned int err_mask; if (!ata_log_supported(dev, ATA_LOG_NCQ_NON_DATA)) { - ata_dev_warn(dev, - "NCQ Send/Recv Log not supported\n"); + ata_dev_notice(dev, + "NCQ Send/Recv Log not supported\n"); return; } err_mask = ata_read_log_page(dev, ATA_LOG_NCQ_NON_DATA, @@ -2536,14 +2536,14 @@ int ata_dev_configure(struct ata_device *dev) if (ata_id_is_cfa(id)) { /* CPRM may make this media unusable */ if (id[ATA_ID_CFA_KEY_MGMT] & 1) - ata_dev_warn(dev, + ata_dev_notice(dev, "supports DRM functions and may not be fully accessible\n"); snprintf(revbuf, 7, "CFA"); } else { snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); /* Warn the user if the device has TPM extensions */ if (ata_id_has_tpm(id)) - ata_dev_warn(dev, + ata_dev_notice(dev, "supports DRM functions and may not be fully accessible\n"); } @@ -2759,8 +2759,8 @@ int ata_dev_configure(struct ata_device *dev) } if ((dev->horkage & ATA_HORKAGE_FIRMWARE_WARN) && print_info) { - ata_dev_warn(dev, "WARNING: device requires firmware update to be fully functional\n"); - ata_dev_warn(dev, " contact the vendor or visit http://ata.wiki.kernel.org\n"); + ata_dev_notice(dev, "WARNING: device requires firmware update to be fully functional\n"); + ata_dev_notice(dev, " contact the vendor or visit http://ata.wiki.kernel.org\n"); } return 0; From c6acd48fd2a0a2a9afa3578967ee592d7888ccd7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 12 May 2017 12:45:25 +0100 Subject: [PATCH 08/26] perf/core: Avoid removing shared pmu_context on unregister In commit 1fd7e4169954 ("perf/core: Remove perf_cpu_context::unique_pmu"), the search for another user of the pmu_cpu_context was removed, and so we unconditionally free it during perf_pmu_unregister. This leads to random corruption later and a BUG at mm/percpu.c:689. v2: Check for shared pmu_contexts under the mutex. Fixes: 1fd7e4169954 ("perf/core: Remove perf_cpu_context::unique_pmu") Signed-off-by: Chris Wilson Cc: David Carrillo-Cisneros Cc: Peter Zijlstra (Intel) Cc: Ingo Molnar Cc: # v4.11+ Link: http://patchwork.freedesktop.org/patch/msgid/20170512114525.17575-1-chris@chris-wilson.co.uk --- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index aec8dba2bea40..2973b122867e4 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -10172,7 +10172,8 @@ void perf_pmu_unregister(struct pmu *pmu) device_del(pmu->dev); put_device(pmu->dev); } - free_pmu_context(pmu); + if (!find_pmu_context(pmu->task_ctx_nr)) + free_pmu_context(pmu); mutex_unlock(&pmus_lock); } EXPORT_SYMBOL_GPL(perf_pmu_unregister); From c536e7383eb248d7a8de14e2da41ecdac2cf8f62 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Mon, 2 Jul 2018 16:57:56 +0300 Subject: [PATCH 09/26] ICL HACK: usb/icl: Work around ACPI boottime crash Work around the following boot time crash: [ 10.456056] CPU: 1 PID: 220 Comm: systemd-udevd Tainted: G W 4.17.0-rc7-CI-CI_DRM_4040+ #182 [ 10.465828] Hardware name: Intel Corporation Ice Lake Client Platform/IceLake U DDR4 SODIMM PD RVP, BIOS +ICLSFWR1.R00.2204.A00.1805172221 05/17/2018 [ 10.479168] RIP: 0010:acpi_ps_complete_this_op+0xa7/0x22a [ 10.484627] RSP: 0018:ffffc900003a7578 EFLAGS: 00010202 [ 10.489881] RAX: 6b6b6b6b6b6b6b6b RBX: ffff8804abeda9c8 RCX: 0000000000000020 [ 10.497045] RDX: 0000000000000000 RSI: ffff88049e604a68 RDI: 0000000000000000 [ 10.504213] RBP: 0000000000000000 R08: ffff8804abeda9c8 R09: 0000000000000000 [ 10.511376] R10: 0000000000000000 R11: 0000000000000000 R12: 000000000000000e [ 10.518542] R13: ffff88049e604a68 R14: ffff88049e604a68 R15: ffffffffa00263c2 [ 10.525713] FS: 00007ff6d85f18c0(0000) GS:ffff8804be880000(0000) knlGS:0000000000000000 [ 10.533839] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 10.539616] CR2: 00007ff6d73cff40 CR3: 000000049f794001 CR4: 0000000000760ee0 [ 10.546783] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 10.553949] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 10.561112] PKRU: 55555554 [ 10.563849] Call Trace: [ 10.566323] acpi_ps_complete_op+0x49/0x3f1 [ 10.570537] acpi_ps_parse_loop+0x94c/0x9bb [ 10.574754] ? acpi_ds_delete_walk_state+0x113/0x131 [ 10.579750] acpi_ps_parse_aml+0x1a2/0x4af [ 10.583875] acpi_ps_execute_method+0x1e9/0x2a5 [ 10.588435] acpi_ns_evaluate+0x2e4/0x42c [ 10.592473] acpi_evaluate_object+0x1fd/0x3a8 [ 10.596873] usb_acpi_find_companion+0xee/0x1f0 [usbcore] [ 10.602319] acpi_platform_notify+0x33/0xa0 [ 10.606532] device_add+0x197/0x600 [ 10.610048] ? __init_waitqueue_head+0x36/0x50 [ 10.614529] usb_hub_create_port_device+0x11d/0x340 [usbcore] [ 10.620314] hub_probe+0x9a5/0x1010 [usbcore] [ 10.624701] ? _raw_spin_unlock_irqrestore+0x51/0x60 [ 10.629730] usb_probe_interface+0x13f/0x300 [usbcore] [ 10.634900] driver_probe_device+0x302/0x470 [ 10.639198] ? __driver_attach+0xe0/0xe0 [ 10.643147] bus_for_each_drv+0x59/0x90 [ 10.647013] __device_attach+0xb7/0x130 [ 10.650878] bus_probe_device+0x9c/0xb0 [ 10.654745] device_add+0x3c5/0x600 [ 10.658270] usb_set_configuration+0x540/0x880 [usbcore] [ 10.663621] generic_probe+0x28/0x80 [usbcore] [ 10.668097] driver_probe_device+0x302/0x470 [ 10.672393] ? __driver_attach+0xe0/0xe0 [ 10.676346] bus_for_each_drv+0x59/0x90 [ 10.680211] __device_attach+0xb7/0x130 [ 10.684076] bus_probe_device+0x9c/0xb0 [ 10.687940] device_add+0x3c5/0x600 [ 10.691464] usb_new_device+0x269/0x490 [usbcore] [ 10.696206] usb_add_hcd+0x558/0x850 [usbcore] [ 10.700682] xhci_pci_probe+0x13d/0x240 [xhci_pci] [ 10.705534] pci_device_probe+0xa1/0x130 [ 10.709484] driver_probe_device+0x302/0x470 [ 10.713784] __driver_attach+0xb9/0xe0 [ 10.717562] ? driver_probe_device+0x470/0x470 [ 10.722033] ? driver_probe_device+0x470/0x470 [ 10.726505] bus_for_each_dev+0x64/0x90 [ 10.730370] ? preempt_count_sub+0x92/0xd0 [ 10.734495] bus_add_driver+0x164/0x260 [ 10.738362] ? 0xffffffffa004e000 [ 10.741704] driver_register+0x57/0xc0 [ 10.745482] ? 0xffffffffa004e000 [ 10.748824] do_one_initcall+0x4a/0x350 [ 10.752690] ? do_init_module+0x22/0x20a [ 10.756643] ? rcu_read_lock_sched_held+0x74/0x80 [ 10.761377] ? kmem_cache_alloc_trace+0x284/0x2e0 [ 10.766114] do_init_module+0x5b/0x20a [ 10.769895] load_module+0x250d/0x2b20 [ 10.773678] ? kernel_read+0x2c/0x40 [ 10.777285] ? __se_sys_finit_module+0xaa/0xc0 [ 10.781759] __se_sys_finit_module+0xaa/0xc0 [ 10.786061] do_syscall_64+0x54/0x190 [ 10.789752] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 10.794831] RIP: 0033:0x7ff6d74664d9 [ 10.798430] RSP: 002b:00007ffd91e7dd78 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 10.806033] RAX: ffffffffffffffda RBX: 0000560519bfae20 RCX: 00007ff6d74664d9 [ 10.813195] RDX: 0000000000000000 RSI: 00007ff6d795ce23 RDI: 000000000000000e [ 10.820360] RBP: 00007ff6d795ce23 R08: 0000000000000000 R09: 0000000000000000 [ 10.827523] R10: 000000000000000e R11: 0000000000000246 R12: 0000000000000000 [ 10.834690] R13: 0000560519bf9a30 R14: 0000000000020000 R15: 000000000aba9500 [ 10.841862] Code: c2 10 5f ea 81 48 c7 c6 f0 5e ea 81 bf 7c 00 00 00 e8 0d 7c 00 00 31 ed e9 88 01 00 00 48 8b 03 31 ed 48 85 c0 +0f 84 e9 00 00 00 <4c> 8b 60 28 4d 85 e4 0f 84 dc 00 00 00 0f b7 78 0a e8 62 fe ff [ 10.860832] RIP: acpi_ps_complete_this_op+0xa7/0x22a RSP: ffffc900003a7578 [ 10.867907] ---[ end trace 3a0d2ee1129bc71e ]--- Cc: Chris Wilson Signed-off-by: Imre Deak Tested-by: Tomi Sarvela Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180702135756.12159-1-imre.deak@intel.com --- drivers/usb/core/usb-acpi.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index 9043d7242d67e..a239ea78a7714 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "hub.h" @@ -81,6 +82,20 @@ int usb_acpi_set_power_state(struct usb_device *hdev, int index, bool enable) } EXPORT_SYMBOL_GPL(usb_acpi_set_power_state); +static const struct dmi_system_id intel_icl_broken_acpi[] = { + { + .ident = "ICL RVP", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Ice Lake Client Platform"), + }, + }, + + { } +}; + +static bool acpi_connection_type_broken; + static enum usb_port_connect_type usb_acpi_get_connect_type(acpi_handle handle, struct acpi_pld_info *pld) { @@ -89,6 +104,10 @@ static enum usb_port_connect_type usb_acpi_get_connect_type(acpi_handle handle, union acpi_object *upc; acpi_status status; + /* Work around unknown ACPI instruction error on ICL RVP BIOSes. */ + if (acpi_connection_type_broken) + return USB_PORT_CONNECT_TYPE_UNKNOWN; + /* * According to 9.14 in ACPI Spec 6.2. _PLD indicates whether usb port * is user visible and _UPC indicates whether it is connectable. If @@ -272,6 +291,11 @@ static struct acpi_bus_type usb_acpi_bus = { int usb_acpi_register(void) { + if (dmi_check_system(intel_icl_broken_acpi)) { + pr_info("USB ACPI connection type broken.\n"); + acpi_connection_type_broken = true; + } + return register_acpi_bus_type(&usb_acpi_bus); } From 49d5dec765b93fa1b35e18327e1429a5356728f9 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 2 May 2019 22:46:48 +0200 Subject: [PATCH 10/26] RFC: hung_task: taint kernel There's the hung_task_panic sysctl, but that's a bit an extreme measure. As a fallback taint at least the machine. Our CI uses this to decide when a reboot is necessary, plus to figure out whether the kernel is still happy. v2: Works much better when I put the else { add_taint() } at the right place. Signed-off-by: Daniel Vetter Cc: Andrew Morton Cc: Tetsuo Handa Cc: Dmitry Vyukov Cc: "Paul E. McKenney" Cc: Valdis Kletnieks Cc: Daniel Vetter Cc: Vitaly Kuznetsov Cc: "Liu, Chuansheng" Acked-by: Chris Wilson (for core-for-CI) Link: https://patchwork.freedesktop.org/patch/msgid/20190502204648.5537-1-daniel.vetter@ffwll.ch Signed-off-by: Jani Nikula --- kernel/hung_task.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 14a625c16cb33..60956bd0da084 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -118,6 +118,8 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout) console_verbose(); hung_task_show_lock = true; hung_task_call_panic = true; + } else { + add_taint(TAINT_WARN, LOCKDEP_STILL_OK); } /* From 9cb258f0300621dafdac35c351cb5163ca7aaddc Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 2 May 2019 21:42:08 +0200 Subject: [PATCH 11/26] RFC: soft/hardlookup: taint kernel There's the soft/hardlookup_panic sysctls, but that's a bit an extreme measure. As a fallback taint at least the machine. Our CI uses this to decide when a reboot is necessary, plus to figure out whether the kernel is still happy. Signed-off-by: Daniel Vetter Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Valdis Kletnieks Cc: Laurence Oberman Cc: Vincent Whitchurch Cc: Don Zickus Cc: Andrew Morton Cc: Sergey Senozhatsky Cc: Sinan Kaya Cc: Daniel Vetter Acked-by: Chris Wilson (for core-for-CI) Link: https://patchwork.freedesktop.org/patch/msgid/20190502194208.3535-2-daniel.vetter@ffwll.ch Signed-off-by: Jani Nikula --- kernel/watchdog.c | 2 ++ kernel/watchdog_hld.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index f41334ef09713..b83e2a6407f48 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -469,6 +469,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK); if (softlockup_panic) panic("softlockup: hung tasks"); + else + add_taint(TAINT_WARN, LOCKDEP_STILL_OK); __this_cpu_write(soft_watchdog_warn, true); } else __this_cpu_write(soft_watchdog_warn, false); diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index 247bf0b1582ca..cce46cf75d762 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -154,6 +154,8 @@ static void watchdog_overflow_callback(struct perf_event *event, if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); + else + add_taint(TAINT_WARN, LOCKDEP_STILL_OK); __this_cpu_write(hard_watchdog_warn, true); return; From 0ca01d9a1fb91fc799fd1807cd5100c5bf5e8e08 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 26 Jun 2019 12:36:33 +0100 Subject: [PATCH 12/26] RFC hung_task: Show all process backtrace for lock debugging Include the process backtrace if lock debugging as well as for the panic path, to aide finding the cause of the blockage. Signed-off-by: Chris Wilson --- kernel/hung_task.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 60956bd0da084..87a0b53a8e540 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -52,6 +52,7 @@ int __read_mostly sysctl_hung_task_warnings = 10; static int __read_mostly did_panic; static bool hung_task_show_lock; +static bool hung_task_show_state; static bool hung_task_call_panic; static struct task_struct *watchdog_task; @@ -117,6 +118,7 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout) if (sysctl_hung_task_panic) { console_verbose(); hung_task_show_lock = true; + hung_task_show_state = true; hung_task_call_panic = true; } else { add_taint(TAINT_WARN, LOCKDEP_STILL_OK); @@ -139,6 +141,7 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout) " disables this message.\n"); sched_show_task(t); hung_task_show_lock = true; + hung_task_show_state = true; } touch_nmi_watchdog(); @@ -186,6 +189,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout) return; hung_task_show_lock = false; + hung_task_show_state = false; rcu_read_lock(); for_each_process_thread(g, t) { if (!max_count--) @@ -203,6 +207,10 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout) rcu_read_unlock(); if (hung_task_show_lock) debug_show_all_locks(); + if (hung_task_show_state) { + show_state(); + show_workqueue_state(); + } if (hung_task_call_panic) { trigger_all_cpu_backtrace(); panic("hung_task: blocked tasks"); From 20f972df0128287f472b0ff680cc616f1b50d8ba Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 18 Jul 2017 10:21:10 +0200 Subject: [PATCH 13/26] net/sch_generic: Shut up noise We can't allow spam in CI. Update 26th June 2018: This is still an issue: Update 23rd May 2019: You guessed it, still ocurring. [ 224.739686] ------------[ cut here ]------------ [ 224.739712] WARNING: CPU: 3 PID: 2982 at net/sched/sch_generic.c:461 dev_watchdog+0x1fd/0x210 [ 224.739714] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_pcm i915 asix usbnet mii mei_me mei prime_numbers i2c_hid pinctrl_sunrisepoint pinctrl_intel btusb btrtl btbcm btintel bluetooth ecdh_generic [ 224.739775] CPU: 3 PID: 2982 Comm: gem_exec_suspen Tainted: G U W 4.18.0-rc2-CI-Patchwork_9414+ #1 [ 224.739777] Hardware name: Dell Inc. XPS 13 9350/, BIOS 1.4.12 11/30/2016 [ 224.739780] RIP: 0010:dev_watchdog+0x1fd/0x210 [ 224.739781] Code: 49 63 4c 24 f0 eb 92 4c 89 ef c6 05 21 46 ad 00 01 e8 77 ee fc ff 89 d9 48 89 c2 4c 89 ee 48 c7 c7 88 4c 14 82 e8 a3 fe 84 ff <0f> 0b eb be 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 c7 47 [ 224.739866] RSP: 0018:ffff88027dd83e40 EFLAGS: 00010286 [ 224.739869] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000102 [ 224.739871] RDX: 0000000080000102 RSI: ffffffff820c8c6c RDI: 00000000ffffffff [ 224.739873] RBP: ffff8802644c1540 R08: 0000000071be9b33 R09: 0000000000000000 [ 224.739874] R10: ffff88027dd83dc0 R11: 0000000000000000 R12: ffff8802644c1588 [ 224.739876] R13: ffff8802644c1160 R14: 0000000000000001 R15: ffff88026a5dc728 [ 224.739878] FS: 00007f18f4887980(0000) GS:ffff88027dd80000(0000) knlGS:0000000000000000 [ 224.739880] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 224.739881] CR2: 00007f4c627ae548 CR3: 000000022ca1a002 CR4: 00000000003606e0 [ 224.739883] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 224.739885] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 224.739886] Call Trace: [ 224.739888] [ 224.739892] ? qdisc_reset+0xe0/0xe0 [ 224.739894] ? qdisc_reset+0xe0/0xe0 [ 224.739897] call_timer_fn+0x93/0x360 [ 224.739903] expire_timers+0xc1/0x1d0 [ 224.739908] run_timer_softirq+0xc7/0x170 [ 224.739916] __do_softirq+0xd9/0x505 [ 224.739923] irq_exit+0xa9/0xc0 [ 224.739926] smp_apic_timer_interrupt+0x9c/0x2d0 [ 224.739929] apic_timer_interrupt+0xf/0x20 [ 224.739931] [ 224.739934] RIP: 0010:delay_tsc+0x2e/0xb0 [ 224.739936] Code: 49 89 fc 55 53 bf 01 00 00 00 e8 6d 2c 78 ff e8 88 9d b6 ff 41 89 c5 0f ae e8 0f 31 48 c1 e2 20 48 09 c2 48 89 d5 eb 16 f3 90 01 00 00 00 e8 48 2c 78 ff e8 63 9d b6 ff 44 39 e8 75 36 0f ae [ 224.740021] RSP: 0018:ffffc900002f7d48 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 [ 224.740024] RAX: 0000000080000000 RBX: 0000000649565ca9 RCX: 0000000000000001 [ 224.740026] RDX: 0000000080000001 RSI: ffffffff820c8c6c RDI: 00000000ffffffff [ 224.740027] RBP: 00000006493ea9ce R08: 000000005e81e2ee R09: 0000000000000000 [ 224.740029] R10: 0000000000000120 R11: 0000000000000000 R12: 00000000002ad8d6 [ 224.740030] R13: 0000000000000003 R14: 0000000000000004 R15: ffff88025caf5408 [ 224.740040] ? delay_tsc+0x66/0xb0 [ 224.740045] hibernation_debug_sleep+0x1c/0x30 [ 224.740048] hibernation_snapshot+0x2c1/0x690 [ 224.740053] hibernate+0x142/0x2a4 [ 224.740057] state_store+0xd0/0xe0 [ 224.740063] kernfs_fop_write+0x104/0x190 [ 224.740068] __vfs_write+0x31/0x180 [ 224.740072] ? rcu_read_lock_sched_held+0x6f/0x80 [ 224.740075] ? rcu_sync_lockdep_assert+0x29/0x50 [ 224.740078] ? __sb_start_write+0x152/0x1f0 [ 224.740080] ? __sb_start_write+0x168/0x1f0 [ 224.740084] vfs_write+0xbd/0x1a0 [ 224.740088] ksys_write+0x50/0xc0 [ 224.740094] do_syscall_64+0x55/0x190 [ 224.740097] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 224.740099] RIP: 0033:0x7f18f400a281 [ 224.740100] Code: c3 0f 1f 84 00 00 00 00 00 48 8b 05 59 8d 20 00 c3 0f 1f 84 00 00 00 00 00 8b 05 8a d1 20 00 85 c0 75 16 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 57 f3 c3 0f 1f 44 00 00 41 54 55 49 89 d4 53 [ 224.740186] RSP: 002b:00007fffd1f4fec8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 224.740189] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f18f400a281 [ 224.740190] RDX: 0000000000000004 RSI: 00007f18f448069a RDI: 0000000000000006 [ 224.740192] RBP: 00007fffd1f4fef0 R08: 0000000000000000 R09: 0000000000000000 [ 224.740194] R10: 0000000000000000 R11: 0000000000000246 R12: 000055e795d03400 [ 224.740195] R13: 00007fffd1f50500 R14: 0000000000000000 R15: 0000000000000000 [ 224.740205] irq event stamp: 1582591 [ 224.740207] hardirqs last enabled at (1582590): [] vprintk_emit+0x4bc/0x4d0 [ 224.740210] hardirqs last disabled at (1582591): [] error_entry+0x7c/0x100 [ 224.740212] softirqs last enabled at (1582568): [] __do_softirq+0x34f/0x505 [ 224.740215] softirqs last disabled at (1582571): [] irq_exit+0xa9/0xc0 [ 224.740218] WARNING: CPU: 3 PID: 2982 at net/sched/sch_generic.c:461 dev_watchdog+0x1fd/0x210 [ 224.740219] ---[ end trace 6e41d690e611c338 ]--- References: https://bugzilla.kernel.org/show_bug.cgi?id=196399 Acked-by: Martin Peres Cc: Martin Peres Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20170718082110.12524-1-daniel.vetter@ffwll.ch --- net/sched/sch_generic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 8769b4b8807d9..3518533649964 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -442,7 +442,12 @@ static void dev_watchdog(struct timer_list *t) } } - if (some_queue_timedout) { + /* The noise is pissing off our CI and upstream doesn't + * move on the bug report: + * + * https://bugzilla.kernel.org/show_bug.cgi?id=196399 + */ + if (some_queue_timedout && 0) { trace_net_dev_xmit_timeout(dev, i); WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit queue %u timed out\n", dev->name, netdev_drivername(dev), i); From 542a7e574aca3f4a61971a0a1e98072ec1350ec0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 1 Jul 2019 15:29:03 +0100 Subject: [PATCH 14/26] mm: Show slab debug as offsets from section base not hashed pointers Since the kernel now used hashed pointers for raw addresses, it is very hard to guage the relative placement within a section, and since the hash value will never match up with any contents, using it provides no information relevant for slab debugging. Show the relative offset into each section, so that some reference for the hexdump is provided. Signed-off-by: Chris Wilson --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index b25c807a111f4..4107673987893 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -528,7 +528,7 @@ static void print_section(char *level, char *text, u8 *addr, unsigned int length) { metadata_access_enable(); - print_hex_dump(level, text, DUMP_PREFIX_ADDRESS, 16, 1, addr, + print_hex_dump(level, text, DUMP_PREFIX_OFFSET, 16, 1, addr, length, 1); metadata_access_disable(); } From 6a5907224c6be0974668c9dfa41e94136ef5f222 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 27 Jul 2019 13:17:50 +0100 Subject: [PATCH 15/26] uapi/perf: Squelch compiler warning Remove copious amounts of ./include/uapi/linux/perf_event.h:147:56: warning: cast truncates bits from constant value (8000000000000000 becomes 0) as they are drowning out our warnings. Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20190727121750.20882-1-chris@chris-wilson.co.uk --- include/uapi/linux/perf_event.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index bb7b271397a66..1a23dc5ad2cdb 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h @@ -143,10 +143,10 @@ enum perf_event_sample_format { PERF_SAMPLE_PHYS_ADDR = 1U << 19, PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */ - - __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */ }; +#define __PERF_SAMPLE_CALLCHAIN_EARLY (1ULL << 63) /* non-ABI; internal use */ + /* * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set * From b005d1d968bfecd67994ea1946186811cee3be89 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 10 Sep 2019 15:23:39 +0100 Subject: [PATCH 16/26] drm/i915: Force compilation with intel-iommu for CI validation Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20190910142339.17072-1-chris@chris-wilson.co.uk --- drivers/gpu/drm/i915/Kconfig.debug | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug index 00786a142ff09..4a800faa275ca 100644 --- a/drivers/gpu/drm/i915/Kconfig.debug +++ b/drivers/gpu/drm/i915/Kconfig.debug @@ -20,6 +20,14 @@ config DRM_I915_WERROR config DRM_I915_DEBUG bool "Enable additional driver debugging" depends on DRM_I915 + select PCI_MSI # ... for iommu enabled by default + select IOMMU_API + select IOMMU_IOVA + select IOMMU_SUPPORT + select NEED_DMA_MAP_STATE + select DMAR_TABLE + select INTEL_IOMMU + select INTEL_IOMMU_DEFAULT_ON select DEBUG_FS select PREEMPT_COUNT select REFCOUNT_FULL From cefebf52c32470ed55d4782135d2c5871ab51ed4 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 10 Sep 2019 14:44:17 +0100 Subject: [PATCH 17/26] HAX iommu/intel: Ignore igfx_off CI currently applies intel_iommu=igfx_off on the commandline and we wish to ignore that until it is removed. Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20190910134417.14085-3-chris@chris-wilson.co.uk --- drivers/iommu/intel-iommu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 6db6d969e31c6..89d649e484c3d 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -447,8 +447,6 @@ static int __init intel_iommu_setup(char *str) no_platform_optin = 1; pr_info("IOMMU disabled\n"); } else if (!strncmp(str, "igfx_off", 8)) { - dmar_map_gfx = 0; - pr_info("Disable GFX device mapping\n"); } else if (!strncmp(str, "forcedac", 8)) { pr_info("Forcing DAC for PCI devices\n"); dmar_forcedac = 1; From ebc8a5e393b3412a46f5bda79aef781e90236961 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Oct 2019 08:03:14 +0000 Subject: [PATCH 18/26] Revert "ALSA: hda: Add Tigerlake/Jasperlake PCI ID" This reverts commit 4750c212174892d26645cdf5ad73fb0e9d594ed3. --- sound/pci/hda/hda_intel.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index cf53fbd872ee3..e2c60463cd315 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2399,12 +2399,6 @@ static const struct pci_device_id azx_ids[] = { /* Icelake */ { PCI_DEVICE(0x8086, 0x34c8), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, - /* Jasperlake */ - { PCI_DEVICE(0x8086, 0x38c8), - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, - /* Tigerlake */ - { PCI_DEVICE(0x8086, 0xa0c8), - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, /* Elkhart Lake */ { PCI_DEVICE(0x8086, 0x4b55), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, From 33c006e813c3896741927f86bf30c8b647c9b366 Mon Sep 17 00:00:00 2001 From: Joonas Lahtinen Date: Wed, 6 Nov 2019 12:01:55 +0200 Subject: [PATCH 19/26] Revert "drm/i915: Don't select BROKEN" This reverts commit cea35f5ad5ffac06ea29e0d7a7f748683e1f1b7d. References: https://lists.freedesktop.org/archives/intel-gfx/2019-November/218878.html Suggested-by: Daniel Vetter Signed-off-by: Joonas Lahtinen --- drivers/gpu/drm/i915/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug index d2ba8f7e5e500..ef123eb291684 100644 --- a/drivers/gpu/drm/i915/Kconfig.debug +++ b/drivers/gpu/drm/i915/Kconfig.debug @@ -44,6 +44,7 @@ config DRM_I915_DEBUG select DRM_I915_SELFTEST select DRM_I915_DEBUG_RUNTIME_PM select DRM_I915_DEBUG_MMIO + select BROKEN # for prototype uAPI default n help Choose this option to turn on extra driver debugging that may affect From 883d9554ea8e228c4e6aca8339b1c1c970a938e8 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 12 Nov 2019 15:29:37 +0200 Subject: [PATCH 20/26] Revert "Revert "ALSA: hda: Add Tigerlake/Jasperlake PCI ID"" This reverts commit ebc8a5e393b3412a46f5bda79aef781e90236961. Rebase instead of dropping the original revert because of the merge. Meh. Signed-off-by: Jani Nikula --- sound/pci/hda/hda_intel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index e2c60463cd315..cf53fbd872ee3 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2399,6 +2399,12 @@ static const struct pci_device_id azx_ids[] = { /* Icelake */ { PCI_DEVICE(0x8086, 0x34c8), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, + /* Jasperlake */ + { PCI_DEVICE(0x8086, 0x38c8), + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, + /* Tigerlake */ + { PCI_DEVICE(0x8086, 0xa0c8), + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, /* Elkhart Lake */ { PCI_DEVICE(0x8086, 0x4b55), .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, From a40c273d80f6aff28e619cdcd4b34e9080034c70 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Thu, 21 Nov 2019 13:57:45 +0800 Subject: [PATCH 21/26] drm/i915/gvt: Fix cmd length check for MI_ATOMIC Correct valid command length check for MI_ATOMIC, need to check inline data available field instead of operand data length for whole command. Fixes: 00a33be40634 ("drm/i915/gvt: Add valid length check for MI variable commands") Reported-by: Alex Williamson Acked-by: Gao Fred Cc: stable@vger.kernel.org Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/gvt/cmd_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index e753b1e706e23..fc29a3705354c 100644 --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c @@ -1597,9 +1597,9 @@ static int cmd_handler_mi_op_2f(struct parser_exec_state *s) if (!(cmd_val(s, 0) & (1 << 22))) return ret; - /* check if QWORD */ - if (DWORD_FIELD(0, 20, 19) == 1) - valid_len += 8; + /* check inline data */ + if (cmd_val(s, 0) & BIT(18)) + valid_len = CMD_LEN(9); ret = gvt_check_valid_cmd_length(cmd_length(s), valid_len); if (ret) From 8bd05bdd30fdd1b56307b780ab0f0e8de878c75a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 5 Dec 2019 11:17:11 +1000 Subject: [PATCH 22/26] drm-tip: 2019y-12m-05d-01h-16m-07s UTC integration manifest --- integration-manifest | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 integration-manifest diff --git a/integration-manifest b/integration-manifest new file mode 100644 index 0000000000000..795134e89e4f2 --- /dev/null +++ b/integration-manifest @@ -0,0 +1,32 @@ +drm drm-fixes 51658c04c338d7ef98d6c2c19009e4814632db50 + Merge tag 'drm-intel-fixes-2019-11-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes +drm-misc drm-misc-fixes 6645d42d79d33e8a9fe262660a75d5f4556bbea9 + dma-buf: Fix memory leak in sync_file_merge() +drm-intel drm-intel-fixes 71d122629c04707eb7f65447fb2f5bd092d98ce3 + drm/i915/fbdev: Restore physical addresses for fb_mmap() +drm-amd drm-amd-fixes 2b702e72e33bbdec0764cfb6e1dd00fe1142ae55 + Merge tag 'drm-misc-fixes-2017-09-28-1' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes +drm drm-next b53bd16fec3d52ff7be1648a9b0a747288f52cf8 + Merge tag 'drm-misc-next-fixes-2019-12-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next +drm-misc drm-misc-next-fixes e5a6ca27eb72c67533ddfc11c06df84beaa167fa + drm/dp_mst: Correct the bug in drm_dp_update_payload_part1() +drm-intel drm-intel-next-fixes 01bb630319337be15fc50c211126180198d4e157 + drm/i915/ehl: Make icp_digital_port_connected() use phy instead of port +drm-amd drm-amd-next-fixes 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e + Linux 4.14-rc1 +drm-misc drm-misc-next 99a375519eeaac617a0d5859d5a987049d548f59 + drm/panel: rpi: Drop unused GPIO includes +drm-intel drm-intel-next-queued 126d5de38542d47d5d8385ce374e33c2a7f34e51 + drm/i915/gem: Hook user-extensions upto MMAP_OFFSET_IOCTL +drm-intel drm-intel-next 1883e2999f045e1fd6f76a7f30288a5312085289 + drm/i915: Update DRIVER_DATE to 20191101 +drm-amd drm-amd-next 754270c7c56292e97d0eff924a5d5d83f92add07 + Merge branch 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-next +sound-upstream for-linus 4cc8d6505ab82db3357613d36e6c58a297f57f7c + ALSA: pcm: oss: Avoid potential buffer overflows +sound-upstream for-next 4cc8d6505ab82db3357613d36e6c58a297f57f7c + ALSA: pcm: oss: Avoid potential buffer overflows +drm-intel topic/core-for-CI 883d9554ea8e228c4e6aca8339b1c1c970a938e8 + Revert "Revert "ALSA: hda: Add Tigerlake/Jasperlake PCI ID"" +drm drm-vmwgfx-coherent 0a6cad5df541108cfd3fbd79eef48eb824c89bdc + Merge branch 'vmwgfx-coherent' of git://people.freedesktop.org/~thomash/linux into drm-next From a739a808284a8d61a68d089fe03b4dca99f41a89 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Mon, 2 Dec 2019 15:01:08 +0800 Subject: [PATCH 23/26] drm/i915/gvt: use vgpu lock for active state setting Need to align with deactivate, should only use vgpu's lock for active state setting instead of gvt lock. Fixes: f25a49ab8ab9 ("drm/i915/gvt: Use vgpu_lock to protect per vgpu access") Cc: Colin Xu Reviewed-by: Colin Xu Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/gvt/vgpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c index d5a6e4e3d0fd7..85bd9bf4f6eee 100644 --- a/drivers/gpu/drm/i915/gvt/vgpu.c +++ b/drivers/gpu/drm/i915/gvt/vgpu.c @@ -212,9 +212,9 @@ static void intel_gvt_update_vgpu_types(struct intel_gvt *gvt) */ void intel_gvt_activate_vgpu(struct intel_vgpu *vgpu) { - mutex_lock(&vgpu->gvt->lock); + mutex_lock(&vgpu->vgpu_lock); vgpu->active = true; - mutex_unlock(&vgpu->gvt->lock); + mutex_unlock(&vgpu->vgpu_lock); } /** From bde763a305ef546be5eee32d34335c4fb5afc3e3 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Mon, 2 Dec 2019 15:01:07 +0800 Subject: [PATCH 24/26] drm/i915/gvt: remove unused type attributes Only need to get attribute group instead of attributes and it has no use, so remove it. Reviewed-by: Yan Zhao Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/gvt/gvt.c | 4 +--- drivers/gpu/drm/i915/gvt/gvt.h | 3 +-- drivers/gpu/drm/i915/gvt/kvmgt.c | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c index 8f37eefa0a028..cb5fa30b8e63d 100644 --- a/drivers/gpu/drm/i915/gvt/gvt.c +++ b/drivers/gpu/drm/i915/gvt/gvt.c @@ -120,10 +120,8 @@ static struct attribute_group *gvt_vgpu_type_groups[] = { [0 ... NR_MAX_INTEL_VGPU_TYPES - 1] = NULL, }; -static bool intel_get_gvt_attrs(struct attribute ***type_attrs, - struct attribute_group ***intel_vgpu_type_groups) +static bool intel_get_gvt_attrs(struct attribute_group ***intel_vgpu_type_groups) { - *type_attrs = gvt_type_attrs; *intel_vgpu_type_groups = gvt_vgpu_type_groups; return true; } diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h index b47c6acaf9c0f..0081b051d3e09 100644 --- a/drivers/gpu/drm/i915/gvt/gvt.h +++ b/drivers/gpu/drm/i915/gvt/gvt.h @@ -570,8 +570,7 @@ struct intel_gvt_ops { void (*vgpu_deactivate)(struct intel_vgpu *); struct intel_vgpu_type *(*gvt_find_vgpu_type)(struct intel_gvt *gvt, const char *name); - bool (*get_gvt_attrs)(struct attribute ***type_attrs, - struct attribute_group ***intel_vgpu_type_groups); + bool (*get_gvt_attrs)(struct attribute_group ***intel_vgpu_type_groups); int (*vgpu_query_plane)(struct intel_vgpu *vgpu, void *); int (*vgpu_get_dmabuf)(struct intel_vgpu *vgpu, unsigned int); int (*write_protect_handler)(struct intel_vgpu *, u64, void *, diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 04a5a0d908239..a699ecade3fcf 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -1597,12 +1597,10 @@ static struct mdev_parent_ops intel_vgpu_ops = { static int kvmgt_host_init(struct device *dev, void *gvt, const void *ops) { - struct attribute **kvm_type_attrs; struct attribute_group **kvm_vgpu_type_groups; intel_gvt_ops = ops; - if (!intel_gvt_ops->get_gvt_attrs(&kvm_type_attrs, - &kvm_vgpu_type_groups)) + if (!intel_gvt_ops->get_gvt_attrs(&kvm_vgpu_type_groups)) return -EFAULT; intel_vgpu_ops.supported_type_groups = kvm_vgpu_type_groups; From 0d8fbb85fefc579a312936d4a50ff0d895da350f Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Thu, 5 Dec 2019 15:30:34 +0800 Subject: [PATCH 25/26] gvt-staging: 2019y-12m-05d-15h-30m-02s CST integration manifest --- integration-manifest | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/integration-manifest b/integration-manifest index 795134e89e4f2..6ae234f8df3bf 100644 --- a/integration-manifest +++ b/integration-manifest @@ -1,32 +1,10 @@ -drm drm-fixes 51658c04c338d7ef98d6c2c19009e4814632db50 - Merge tag 'drm-intel-fixes-2019-11-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes -drm-misc drm-misc-fixes 6645d42d79d33e8a9fe262660a75d5f4556bbea9 - dma-buf: Fix memory leak in sync_file_merge() -drm-intel drm-intel-fixes 71d122629c04707eb7f65447fb2f5bd092d98ce3 - drm/i915/fbdev: Restore physical addresses for fb_mmap() -drm-amd drm-amd-fixes 2b702e72e33bbdec0764cfb6e1dd00fe1142ae55 - Merge tag 'drm-misc-fixes-2017-09-28-1' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes -drm drm-next b53bd16fec3d52ff7be1648a9b0a747288f52cf8 - Merge tag 'drm-misc-next-fixes-2019-12-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next -drm-misc drm-misc-next-fixes e5a6ca27eb72c67533ddfc11c06df84beaa167fa - drm/dp_mst: Correct the bug in drm_dp_update_payload_part1() -drm-intel drm-intel-next-fixes 01bb630319337be15fc50c211126180198d4e157 - drm/i915/ehl: Make icp_digital_port_connected() use phy instead of port -drm-amd drm-amd-next-fixes 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e - Linux 4.14-rc1 -drm-misc drm-misc-next 99a375519eeaac617a0d5859d5a987049d548f59 - drm/panel: rpi: Drop unused GPIO includes -drm-intel drm-intel-next-queued 126d5de38542d47d5d8385ce374e33c2a7f34e51 - drm/i915/gem: Hook user-extensions upto MMAP_OFFSET_IOCTL -drm-intel drm-intel-next 1883e2999f045e1fd6f76a7f30288a5312085289 - drm/i915: Update DRIVER_DATE to 20191101 -drm-amd drm-amd-next 754270c7c56292e97d0eff924a5d5d83f92add07 - Merge branch 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-next -sound-upstream for-linus 4cc8d6505ab82db3357613d36e6c58a297f57f7c - ALSA: pcm: oss: Avoid potential buffer overflows -sound-upstream for-next 4cc8d6505ab82db3357613d36e6c58a297f57f7c - ALSA: pcm: oss: Avoid potential buffer overflows -drm-intel topic/core-for-CI 883d9554ea8e228c4e6aca8339b1c1c970a938e8 - Revert "Revert "ALSA: hda: Add Tigerlake/Jasperlake PCI ID"" -drm drm-vmwgfx-coherent 0a6cad5df541108cfd3fbd79eef48eb824c89bdc - Merge branch 'vmwgfx-coherent' of git://people.freedesktop.org/~thomash/linux into drm-next +drm-tip/drm-tip 8bd05bdd30fdd1b56307b780ab0f0e8de878c75a + drm-tip: 2019y-12m-05d-01h-16m-07s UTC integration manifest +vfio-upstream/for-linus 95f89e090618efca63918b658c2002e57d393036 + vfio/type1: Initialize resv_msi_base +origin/gvt-fixes a40c273d80f6aff28e619cdcd4b34e9080034c70 + drm/i915/gvt: Fix cmd length check for MI_ATOMIC +origin/gvt-next-fixes a739a808284a8d61a68d089fe03b4dca99f41a89 + drm/i915/gvt: use vgpu lock for active state setting +origin/gvt-next bde763a305ef546be5eee32d34335c4fb5afc3e3 + drm/i915/gvt: remove unused type attributes From babae496ac54741198f18a0401f258efe1de31bb Mon Sep 17 00:00:00 2001 From: Kshithij Iyer Date: Tue, 10 Dec 2019 11:15:51 +0530 Subject: [PATCH 26/26] Rename README to READme.rst --- README => README.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.rst (100%) diff --git a/README b/README.rst similarity index 100% rename from README rename to README.rst