Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static inline void check_and_switch_context(struct mm_struct *mm,
#ifndef MODULE
#define finish_arch_post_lock_switch \
finish_arch_post_lock_switch
static inline void finish_arch_post_lock_switch(void)
static __always_inline void finish_arch_post_lock_switch(void)
{
struct mm_struct *mm = current->mm;

Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/include/asm/sync_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* RISC-V implements return to user-space through an xRET instruction,
* which is not core serializing.
*/
static inline void sync_core_before_usermode(void)
static __always_inline void sync_core_before_usermode(void)
{
asm volatile ("fence.i" ::: "memory");
}
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
}

#define finish_arch_post_lock_switch finish_arch_post_lock_switch
static inline void finish_arch_post_lock_switch(void)
static __always_inline void finish_arch_post_lock_switch(void)
{
struct task_struct *tsk = current;
struct mm_struct *mm = tsk->mm;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/mmu_context_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static inline void arch_start_context_switch(struct task_struct *prev)
}

#define finish_arch_post_lock_switch finish_arch_post_lock_switch
static inline void finish_arch_post_lock_switch(void)
static __always_inline void finish_arch_post_lock_switch(void)
{
/* Restore the state of MCDPER register for the new process
* just switched to.
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/sync_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static __always_inline void sync_core(void)
* to user-mode. x86 implements return to user-space through sysexit,
* sysrel, and sysretq, which are not core serializing.
*/
static inline void sync_core_before_usermode(void)
static __always_inline void sync_core_before_usermode(void)
{
/* With PTI, we unconditionally serialize before running user code. */
if (cpu_feature_enabled(X86_FEATURE_PTI))
Expand Down
7 changes: 2 additions & 5 deletions arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,11 +1044,8 @@ static const struct x86_cpu_id zen5_rdseed_microcode[] = {

static void init_amd_zen5(struct cpuinfo_x86 *c)
{
if (!x86_match_min_microcode_rev(zen5_rdseed_microcode)) {
clear_cpu_cap(c, X86_FEATURE_RDSEED);
msr_clear_bit(MSR_AMD64_CPUID_FN_7, 18);
pr_emerg_once("RDSEED32 is broken. Disabling the corresponding CPUID bit.\n");
}
if (!x86_match_min_microcode_rev(zen5_rdseed_microcode))
pr_emerg_once("RDSEED32 is broken. Please update your firmware.\n");
}

static void init_amd(struct cpuinfo_x86 *c)
Expand Down
4 changes: 4 additions & 0 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ static const struct usb_device_id quirks_table[] = {
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x13d3, 0x3612), .driver_info = BTUSB_REALTEK |
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x0489, 0xe112), .driver_info = BTUSB_REALTEK |
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x0489, 0xe122), .driver_info = BTUSB_REALTEK |
BTUSB_WIDEBAND_SPEECH },

Expand Down Expand Up @@ -700,6 +702,8 @@ static const struct usb_device_id quirks_table[] = {
{ USB_DEVICE(0x13d3, 0x3596), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH },
/* MediaTek MT7922 Bluetooth devices */
{ USB_DEVICE(0x13d3, 0x3625), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x13d3, 0x3585), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x13d3, 0x3610), .driver_info = BTUSB_MEDIATEK |
Expand Down
7 changes: 2 additions & 5 deletions drivers/gpu/drm/gud/gud_connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,8 @@ static int gud_connector_add_tv_mode(struct gud_device *gdrm, struct drm_connect
for (i = 0; i < num_modes; i++) {
char *mode = &buf[i * GUD_CONNECTOR_TV_MODE_NAME_LEN];

if (!memchr(mode, '\0', GUD_CONNECTOR_TV_MODE_NAME_LEN)) {
ret = -EIO;
goto free;
}

/* The device is not trusted to NUL-terminate the name */
mode[GUD_CONNECTOR_TV_MODE_NAME_LEN - 1] = '\0';
modes[i] = mode;
}

Expand Down
38 changes: 38 additions & 0 deletions drivers/gpu/drm/i915/display/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4785,6 +4785,38 @@ intel_edp_set_sink_rates(struct intel_dp *intel_dp)
intel_edp_set_data_override_rates(intel_dp);
}

static void intel_edp_wake_sink(struct intel_dp *intel_dp)
{
u8 value = 0;
int ret;

/*
* Read the current sink power state. drm_dp_dpcd_read_byte() already
* retries the AUX transaction internally, so a single read suffices.
* First commercial eDP panels are Ver1.0 or 1.1, on which DPCD
* DP_SET_POWER is supported.
*/
ret = drm_dp_dpcd_read_byte(&intel_dp->aux, DP_SET_POWER, &value);

/*
* If the AUX read failed the sink may be asleep and not responding,
* or it read back D3; in either case wake it up to D0.
* In case of AUX read failure which is usually a POR case, the
* remaining bits of register 0x600 is set to '0' on POR. So a bare
* write should be fine.
*/
if (ret < 0 || value == DP_SET_POWER_D3) {
value &= ~DP_SET_POWER_MASK;
value |= DP_SET_POWER_D0;
drm_dp_dpcd_write_byte(&intel_dp->aux, DP_SET_POWER,
value);
/* After setting to D0 need a min of 1ms to wake (Spec DP2.1 sec 2.3.1.2) */
fsleep(1000);
drm_dp_dpcd_write_byte(&intel_dp->aux, DP_SET_POWER,
value);
}
}

static bool
intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector)
{
Expand All @@ -4795,6 +4827,12 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector
/* this function is meant to be called only once */
drm_WARN_ON(display->drm, intel_dp->dpcd[DP_DPCD_REV] != 0);

/*
* Spec DP2.1 Section 3.5.2.16 page 966.
* Also if sink is asleep, this will wake the sink.
*/
intel_edp_wake_sink(intel_dp);

if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd) != 0)
return false;

Expand Down
13 changes: 12 additions & 1 deletion drivers/gpu/drm/i915/gt/intel_rc6.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/*
* Copyright © 2019 Intel Corporation
*/

#include <linux/pm_runtime.h>
#include <linux/string_helpers.h>
#include <linux/dmi.h>

#include <drm/drm_print.h>
#include <drm/intel/intel_pcode_regs.h>
Expand Down Expand Up @@ -499,6 +499,17 @@ static bool rc6_supported(struct intel_rc6 *rc6)
if (!HAS_RC6(i915))
return false;

if (dmi_match(DMI_PRODUCT_SKU, "IBP1XI08MK1") ||
dmi_match(DMI_PRODUCT_SKU, "IBP14I08MK2") ||
dmi_match(DMI_PRODUCT_SKU, "IBP1XI08MK2") ||
dmi_match(DMI_PRODUCT_SKU, "IBP16I08MK2") ||
dmi_match(DMI_PRODUCT_SKU, "OMNIA08IMK1") ||
dmi_match(DMI_PRODUCT_SKU, "OMNIA08IMK2")) {
drm_notice(&i915->drm,
"RC6 disabled by quirk\n");
return false;
}

if (intel_vgpu_active(i915))
return false;

Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/i2c-core-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ static const struct acpi_device_id i2c_acpi_force_100khz_device_ids[] = {
* the device works without issues on Windows at what is expected to be
* a 400KHz frequency. The root cause of the issue is not known.
*/
{ "ASUE140D", 0 },
{ "DLL0945", 0 },
{ "ELAN0678", 0 },
{ "ELAN06FA", 0 },
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireguard/queueing.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ static inline void wg_reset_packet(struct sk_buff *skb, bool encapsulating)
u8 l4_hash = skb->l4_hash;
u8 sw_hash = skb->sw_hash;
u32 hash = skb->hash;
u8 tstamp_type = skb->tstamp_type;
skb_scrub_packet(skb, true);
memset(&skb->headers, 0, sizeof(skb->headers));
if (encapsulating) {
skb->l4_hash = l4_hash;
skb->sw_hash = sw_hash;
skb->hash = hash;
skb->tstamp_type = tstamp_type;
}
skb->queue_mapping = 0;
skb->nohdr = 0;
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ iwl_mld_mac80211_tx(struct ieee80211_hw *hw,
u32 link_id = u32_get_bits(info->control.flags,
IEEE80211_TX_CTRL_MLO_LINK);

if (unlikely(test_bit(STATUS_FW_ERROR, &mld->trans->status))) {
ieee80211_free_txskb(hw, skb);
return;
}
/* In AP mode, mgmt frames are sent on the bcast station,
* so the FW can't translate the MLD addr to the link addr. Do it here
*/
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mld/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,9 @@ void iwl_mld_tx_from_txq(struct iwl_mld *mld, struct ieee80211_txq *txq)
struct sk_buff *skb = NULL;
u8 zero_addr[ETH_ALEN] = {};

if (unlikely(test_bit(STATUS_FW_ERROR, &mld->trans->status)))
return;

/*
* Don't transmit during firmware restart. The firmware is dead,
* so iwl_trans_tx() would return -EIO for each frame. Avoid the
Expand Down
52 changes: 50 additions & 2 deletions drivers/pci/controller/vmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ enum vmd_features {
* referred to as MEMBAR2 or MSI-X BAR.
*/
VMD_FEAT_USE_BIOS_INFO = (1 << 6),

/*
* Meteor Lake VMD (device ID 0x7d0b) is affected by erratum MTL016:
* the VMD may signal its MSI before the posted writes that carry the
* child device's DMA data have landed in memory. The demuxed handler
* then runs against a not-yet-coherent completion queue and misses the
* completion entirely, so the I/O is only recovered when the block
* layer timeout fires and polls the queue ("timeout, completion
* polled"). Intel's documented workaround is to issue a dummy read
* to the MSI initiator (the child device) before handling the
* interrupt: the read completion cannot pass the device's earlier
* posted writes, so it pulls them into memory per PCIe ordering
* rules. A read that terminates at the VMD itself does not order
* against the child's writes and is not sufficient (measured).
*/
VMD_FEAT_INTERRUPT_QUIRK = (1 << 7),
};

#define VMD_BIOS_PM_QUIRK_LTR 0x1003 /* 3145728 ns */
Expand All @@ -114,6 +130,9 @@ static DEFINE_RAW_SPINLOCK(list_lock);
* @irq: back pointer to parent.
* @enabled: true if driver enabled IRQ
* @virq: the virtual IRQ value provided to the requesting driver.
* @flush_addr: config space address of the initiating device, read before
* demuxing to flush its posted writes (MTL016); NULL if the
* VMD is not affected.
*
* Every MSI/MSI-X IRQ requested for a device in a VMD domain will be mapped to
* a VMD IRQ using this structure.
Expand All @@ -123,21 +142,30 @@ struct vmd_irq {
struct vmd_irq_list *irq;
bool enabled;
unsigned int virq;
void __iomem *flush_addr;
};

struct vmd_dev;

static void __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
unsigned int devfn, int reg, int len);

/**
* struct vmd_irq_list - list of driver requested IRQs mapping to a VMD vector
* @irq_list: the list of irq's the VMD one demuxes to.
* @srcu: SRCU struct for local synchronization.
* @count: number of child IRQs assigned to this vector; used to track
* sharing.
* @virq: The underlying VMD Linux interrupt number
* @vmd: back pointer to the owning VMD device; serializes the MTL016
* flush read against other config space access.
*/
struct vmd_irq_list {
struct list_head irq_list;
struct srcu_struct srcu;
unsigned int count;
unsigned int virq;
struct vmd_dev *vmd;
};

struct vmd_dev {
Expand Down Expand Up @@ -295,6 +323,13 @@ static int vmd_msi_alloc(struct irq_domain *domain, unsigned int virq,
INIT_LIST_HEAD(&vmdirq->node);
vmdirq->irq = vmd_next_irq(vmd, desc);
vmdirq->virq = virq + i;
if (vmd->features & VMD_FEAT_INTERRUPT_QUIRK) {
struct pci_dev *pdev = msi_desc_to_pci_dev(desc);

vmdirq->flush_addr = vmd_cfg_addr(vmd, pdev->bus,
pdev->devfn,
PCI_VENDOR_ID, 2);
}

irq_domain_set_info(domain, virq + i, vmdirq->irq->virq,
&vmd_msi_controller, vmdirq,
Expand Down Expand Up @@ -756,8 +791,20 @@ static irqreturn_t vmd_irq(int irq, void *data)
int idx;

idx = srcu_read_lock(&irqs->srcu);
list_for_each_entry_rcu(vmdirq, &irqs->irq_list, node)
list_for_each_entry_rcu(vmdirq, &irqs->irq_list, node) {
/*
* MTL016: the MSI may have outrun the initiating device's
* posted writes (e.g. its NVMe completion entry). A read
* that completes at the initiator flushes them, so the
* demuxed handler observes a coherent completion queue.
* The value is discarded; only the ordering matters.
*/
if (vmdirq->flush_addr) {
guard(raw_spinlock)(&irqs->vmd->cfg_lock);
readw(vmdirq->flush_addr);
}
generic_handle_irq(vmdirq->virq);
}
srcu_read_unlock(&irqs->srcu, idx);

return IRQ_HANDLED;
Expand Down Expand Up @@ -788,6 +835,7 @@ static int vmd_alloc_irqs(struct vmd_dev *vmd)
return err;

INIT_LIST_HEAD(&vmd->irqs[i].irq_list);
vmd->irqs[i].vmd = vmd;
vmd->irqs[i].virq = pci_irq_vector(dev, i);
err = devm_request_irq(&dev->dev, vmd->irqs[i].virq,
vmd_irq, IRQF_NO_THREAD,
Expand Down Expand Up @@ -1250,7 +1298,7 @@ static const struct pci_device_id vmd_ids[] = {
{PCI_VDEVICE(INTEL, 0xa77f),
.driver_data = VMD_FEATS_CLIENT,},
{PCI_VDEVICE(INTEL, 0x7d0b),
.driver_data = VMD_FEATS_CLIENT,},
.driver_data = VMD_FEATS_CLIENT | VMD_FEAT_INTERRUPT_QUIRK,},
{PCI_VDEVICE(INTEL, 0xad0b),
.driver_data = VMD_FEATS_CLIENT,},
{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_VMD_9A0B),
Expand Down
19 changes: 19 additions & 0 deletions drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,25 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
UTF16_LITTLE_ENDIAN, buf, size);
buf[err] = 0;

/*
* Some devices report string descriptors with a declared length
* greater than the actual serial, leaving uninitialized firmware
* memory (often including C0 control characters) appended to the
* returned string. Truncate at the first control character so
* callers get a clean, well-formed string.
*/
{
int i;
for (i = 0; i < err; i++) {
unsigned char c = buf[i];
if (c < 0x20 || c == 0x7f) {
buf[i] = 0;
err = i;
break;
}
}
}

if (tbuf[1] != USB_DT_STRING)
dev_dbg(&dev->dev,
"wrong descriptor type %02x for string %d (\"%s\")\n",
Expand Down
2 changes: 1 addition & 1 deletion include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ static inline void perf_event_task_migrate(struct task_struct *task)
task->sched_migrated = 1;
}

static inline void perf_event_task_sched_in(struct task_struct *prev,
static __always_inline void perf_event_task_sched_in(struct task_struct *prev,
struct task_struct *task)
{
if (static_branch_unlikely(&perf_sched_events))
Expand Down
Loading