diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 889f1c1a1fa92da3e89861fa206610db8ced888d..52b8895152f491f4780ed775d9b84435c462805e 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -84,11 +84,16 @@ static int acpi_sleep_prepare(u32 acpi_state) return 0; } +static u8 max_sleep_state = -1; + bool acpi_sleep_state_supported(u8 sleep_state) { acpi_status status; u8 type_a, type_b; + if (sleep_state > max_sleep_state) + return false; + status = acpi_get_sleep_type_data(sleep_state, &type_a, &type_b); return ACPI_SUCCESS(status) && (!acpi_gbl_reduced_hardware || (acpi_gbl_FADT.sleep_control.address @@ -165,6 +170,13 @@ static int __init init_nvs_nosave(const struct dmi_system_id *d) return 0; } +static int __init init_nosleep(const struct dmi_system_id *d) +{ + pr_info("Disabling ACPI suspend\n"); + max_sleep_state = 0; + return 0; +} + bool acpi_sleep_default_s3; static int __init init_default_s3(const struct dmi_system_id *d) @@ -385,6 +397,14 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "20GGA00L00"), }, }, + { + .callback = init_nosleep, + .ident = "samus", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"), + DMI_MATCH(DMI_PRODUCT_NAME, "Samus"), + }, + }, {}, }; diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c449d60d9bb962c80ac7e196d08dd722d2c6950b..a4e54b689b65c01984686dca29bc0e1c792dc51a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2207,7 +2207,7 @@ static bool ata_identify_page_supported(struct ata_device *dev, u8 page) * for drives which implement this ATA level or above. */ if (ata_id_major_version(dev->id) >= 10) - ata_dev_warn(dev, + ata_dev_notice(dev, "ATA Identify Device Log not supported\n"); dev->horkage |= ATA_HORKAGE_NO_ID_DEV_LOG; return false; @@ -2279,7 +2279,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, @@ -2304,8 +2304,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, @@ -2958,14 +2958,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"); } @@ -3120,8 +3120,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; diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index c4236564c1cd01422db451f9118b3217b55ada97..a5087cd8491144a95b41bfb0f11e7b132dd98e40 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1273,7 +1273,7 @@ static void phy_error_precise(struct phy_device *phydev, */ void phy_error(struct phy_device *phydev) { - WARN_ON(1); + pr_notice_once("%s\n", __func__); phy_process_error(phydev); } EXPORT_SYMBOL(phy_error); @@ -1499,11 +1499,8 @@ void phy_stop(struct phy_device *phydev) enum phy_state old_state; if (!phy_is_started(phydev) && phydev->state != PHY_DOWN && - phydev->state != PHY_ERROR) { - WARN(1, "called from state %s\n", - phy_state_to_str(phydev->state)); + phydev->state != PHY_ERROR) return; - } mutex_lock(&phydev->lock); old_state = phydev->state; diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index 682fa877478fe9df875c465d2b7d1a92f414aa5a..748af066f4247e9b7edb5dde6ceb825b35e5043d 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -421,8 +421,10 @@ int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec, if (maxvec < minvec) return -ERANGE; - if (WARN_ON_ONCE(dev->msi_enabled)) + if (dev->msi_enabled) { + pci_info(dev, "can't enable MSI, already enabled\n"); return -EINVAL; + } nvec = pci_msi_vec_count(dev); if (nvec < 0) diff --git a/drivers/thermal/intel/therm_throt.c b/drivers/thermal/intel/therm_throt.c index e69868e868eb9e9abd0a2e826dbf75913605b4bc..9d18f2fba7a009f3cf347881872042a9b922c7d3 100644 --- a/drivers/thermal/intel/therm_throt.c +++ b/drivers/thermal/intel/therm_throt.c @@ -345,10 +345,10 @@ static void __maybe_unused throttle_active_work(struct work_struct *work) avg /= ARRAY_SIZE(state->temp_samples); if (state->average > avg) { - pr_warn("CPU%d: %s temperature is above threshold, cpu clock is throttled (total events = %lu)\n", - this_cpu, - state->level == CORE_LEVEL ? "Core" : "Package", - state->count); + pr_notice("CPU%d: %s temperature is above threshold, cpu clock is throttled (total events = %lu)\n", + this_cpu, + state->level == CORE_LEVEL ? "Core" : "Package", + state->count); state->rate_control_active = true; } diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index 7f8a912d4fe2a26e8b3a4902254af659982a2fb5..17454b98732f88963132fe1403c7ed8a554ec3b4 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c @@ -12,6 +12,7 @@ #include <linux/acpi.h> #include <linux/pci.h> #include <linux/usb/hcd.h> +#include <linux/dmi.h> #include "hub.h" @@ -142,6 +143,19 @@ 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; + /* * Private to usb-acpi, all the core needs to know is that * port_dev->location is non-zero when it has been set by the firmware. @@ -157,6 +171,12 @@ usb_acpi_get_connect_type(struct usb_port *port_dev, acpi_handle *handle) struct acpi_pld_info *pld = NULL; acpi_status status; + /* Work around unknown ACPI instruction error on ICL RVP BIOSes. */ + if (acpi_connection_type_broken) { + port_dev->connect_type = USB_PORT_CONNECT_TYPE_UNKNOWN; + return; + } + /* * 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 @@ -321,6 +341,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); } diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h index 70d30d40ea4a9e1e0acb2c250981716eeb8687d7..c6a904df511ac56ccf0b43abe4653c3f5c9f5c43 100644 --- a/include/linux/lockdep_types.h +++ b/include/linux/lockdep_types.h @@ -251,8 +251,8 @@ struct held_lock { unsigned int check:1; /* see lock_acquire() comment */ unsigned int hardirqs_off:1; unsigned int sync:1; - unsigned int references:11; /* 32 bits */ - unsigned int pin_count; + unsigned int pin_count:11; /* 32 bits */ + unsigned int references; }; #else /* !CONFIG_LOCKDEP */ diff --git a/kernel/events/core.c b/kernel/events/core.c index 724e6d7e128f3766f89791861c258fb317297216..442bbe2a54c1c27aeea7f3cec087a1933ef278e4 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5565,20 +5565,16 @@ static int __perf_read_group_add(struct perf_event *leader, } static int perf_read_group(struct perf_event *event, - u64 read_format, char __user *buf) + u64 read_format, char __user *buf, + u64 *values) { struct perf_event *leader = event->group_leader, *child; struct perf_event_context *ctx = leader->ctx; int ret; - u64 *values; lockdep_assert_held(&ctx->mutex); - values = kzalloc(event->read_size, GFP_KERNEL); - if (!values) - return -ENOMEM; - - values[0] = 1 + leader->nr_siblings; + *values = 1 + leader->nr_siblings; mutex_lock(&leader->child_mutex); @@ -5592,25 +5588,17 @@ static int perf_read_group(struct perf_event *event, goto unlock; } - mutex_unlock(&leader->child_mutex); - ret = event->read_size; - if (copy_to_user(buf, values, event->read_size)) - ret = -EFAULT; - goto out; - unlock: mutex_unlock(&leader->child_mutex); -out: - kfree(values); return ret; } static int perf_read_one(struct perf_event *event, - u64 read_format, char __user *buf) + u64 read_format, char __user *buf, + u64 *values) { u64 enabled, running; - u64 values[5]; int n = 0; values[n++] = __perf_event_read_value(event, &enabled, &running); @@ -5623,9 +5611,6 @@ static int perf_read_one(struct perf_event *event, if (read_format & PERF_FORMAT_LOST) values[n++] = atomic64_read(&event->lost_samples); - if (copy_to_user(buf, values, n * sizeof(u64))) - return -EFAULT; - return n * sizeof(u64); } @@ -5646,7 +5631,8 @@ static bool is_event_hup(struct perf_event *event) * Read the performance event - simple non blocking version for now */ static ssize_t -__perf_read(struct perf_event *event, char __user *buf, size_t count) +__perf_read(struct perf_event *event, char __user *buf, + size_t count, u64 *values) { u64 read_format = event->attr.read_format; int ret; @@ -5664,9 +5650,9 @@ __perf_read(struct perf_event *event, char __user *buf, size_t count) WARN_ON_ONCE(event->ctx->parent_ctx); if (read_format & PERF_FORMAT_GROUP) - ret = perf_read_group(event, read_format, buf); + ret = perf_read_group(event, read_format, buf, values); else - ret = perf_read_one(event, read_format, buf); + ret = perf_read_one(event, read_format, buf, values); return ret; } @@ -5676,16 +5662,31 @@ perf_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct perf_event *event = file->private_data; struct perf_event_context *ctx; + u64 stack_values[8]; + u64 *values; int ret; ret = security_perf_event_read(event); if (ret) return ret; + if (event->read_size <= sizeof(stack_values)) + values = memset(stack_values, 0, event->read_size); + else + values = kzalloc(event->read_size, GFP_KERNEL); + if (!values) + return -ENOMEM; + ctx = perf_event_ctx_lock(event); - ret = __perf_read(event, buf, count); + ret = __perf_read(event, buf, count, values); perf_event_ctx_unlock(event, ctx); + if (ret > 0 && copy_to_user(buf, values, ret)) + ret = -EFAULT; + + if (values != stack_values) + kfree(values); + return ret; } diff --git a/kernel/hung_task.c b/kernel/hung_task.c index b2fc2727d65441a3876c72c6d8aa374fda155b8f..5ec94308594369978a9532cdd119780e5c349465 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -121,6 +121,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); } /* diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 151bd3de59363a6b67a3a51274fe568bae4b30dd..1d017f7c3a13c6e39001b80d65d3060d2fc640e2 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -5517,11 +5517,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 u11 pin_count. */ - cookie.val = 1 + (sched_clock() & 0xffff); + cookie.val = 1 + (sched_clock() & 0x3f); + if (DEBUG_LOCKS_WARN_ON(hlock->pin_count + cookie.val >= 1 << 11)) + return NIL_COOKIE; + hlock->pin_count += cookie.val; return cookie; } diff --git a/kernel/panic.c b/kernel/panic.c index 747c3f3d289a234832e6cf5774d92a20951e3cb3..628673ddf1c9ef3b00ac9d5dfe61ea3844899177 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -340,13 +340,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 @@ -376,6 +369,14 @@ void panic(const char *fmt, ...) panic_print_sys_info(false); +#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 + kmsg_dump(KMSG_DUMP_PANIC); /* diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index a04a436af8cc4ece2b391d08032ce5f2f6e5425c..6cf5263d3ddd95f70b36ca19a1df422fd61682df 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -866,7 +866,7 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se) * entity. */ if (dl_time_before(dl_se->deadline, rq_clock(rq))) { - printk_deferred_once("sched: DL replenish lagged too much\n"); + printk_deferred_once(KERN_NOTICE "sched: DL replenish lagged too much\n"); replenish_dl_new_period(dl_se, rq); } diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 3261b067b67e2c8550e7ba45476adbcb7349882e..c78dcfdaba5607a0b7d431025ceea02470962af9 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -975,7 +975,7 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq) */ if (likely(rt_b->rt_runtime)) { rt_rq->rt_throttled = 1; - printk_deferred_once("sched: RT throttling activated\n"); + printk_deferred_once(KERN_NOTICE "sched: RT throttling activated\n"); } else { /* * In case we did anyway, make it go away, diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 47345bf1d4a9f7e850db213999c62ecb02f8fea0..aebaebc77639f6fd5e581771f1af1cf8ec888249 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -165,6 +165,13 @@ config TRACING select TRACE_CLOCK select TASKS_RCU if PREEMPTION +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 233d1af39fffe29b459c09e9a5e0a82fa07e992a..f4fa74735fd567443bfac17cd5adeddafe482266 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -870,9 +870,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; diff --git a/kernel/watchdog.c b/kernel/watchdog.c index d7b2125503af3dd6f9d4b03eee38c14f8d9b3212..db72ab095f8552e5411f7a71e77a647eb4504122 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -198,6 +198,8 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs) if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); + else + add_taint(TAINT_WARN, LOCKDEP_STILL_OK); per_cpu(watchdog_hardlockup_warned, cpu) = true; } else { @@ -556,6 +558,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); } return HRTIMER_RESTART; diff --git a/mm/slub.c b/mm/slub.c index 1bb2a93cf7b6a415de2077e8f4e4f7999b85044c..331d13ef17bb38835f8cc048f21433401a099f07 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -840,7 +840,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, + print_hex_dump(level, text, DUMP_PREFIX_OFFSET, 16, 1, kasan_reset_tag((void *)addr), length, 1); metadata_access_disable(); } diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 4a2c763e2d116693469e6c8bd9ce0ed8f7f667d9..9058525aa7c9c4216342bd7177937934d67cf4aa 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -521,7 +521,12 @@ static void dev_watchdog(struct timer_list *t) } } - if (unlikely(timedout_ms)) { + /* 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 (unlikely(timedout_ms) && 0) { trace_net_dev_xmit_timeout(dev, i); netdev_crit(dev, "NETDEV WATCHDOG: CPU: %d: transmit queue %u timed out %u ms\n", raw_smp_processor_id(), diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index e9425213320eae71dbb5297c03195193fb437665..a214636ed9757fdf6088c2146871b8b79e682b7d 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -170,6 +170,26 @@ static int i915_gfx_present(struct pci_dev *hdac_pci) return false; } +static bool dg1_gfx_present(void) +{ + static const struct pci_device_id ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4905), + .class = PCI_BASE_CLASS_DISPLAY << 16, + .class_mask = 0xff << 16 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4906), + .class = PCI_BASE_CLASS_DISPLAY << 16, + .class_mask = 0xff << 16 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4907), + .class = PCI_BASE_CLASS_DISPLAY << 16, + .class_mask = 0xff << 16 }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4908), + .class = PCI_BASE_CLASS_DISPLAY << 16, + .class_mask = 0xff << 16 }, + {} + }; + return pci_dev_present(ids); +} + /** * snd_hdac_i915_init - Initialize i915 audio component * @bus: HDA core bus @@ -190,6 +210,9 @@ int snd_hdac_i915_init(struct hdac_bus *bus) if (!i915_gfx_present(to_pci_dev(bus->dev))) return -ENODEV; + if (dg1_gfx_present()) + return -ENODEV; + err = snd_hdac_acomp_init(bus, NULL, i915_component_master_match, sizeof(struct i915_audio_component) - sizeof(*acomp)); diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 1b550c42db092739135e5917a74914894e254454..9ea5925401f96e24f2fee99a4cd363188955f308 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2146,9 +2146,6 @@ static int azx_probe(struct pci_dev *pci, * codecs can be on the same link. */ if (HDA_CONTROLLER_IN_GPU(pci)) { - dev_err_probe(card->dev, err, - "HSW/BDW HD-audio HDMI/DP requires binding with gfx driver\n"); - goto out_free; } else { /* don't bother any longer */