Merge ae7b2bd3d4 ("mmc: cqhci: Fix checking of CQHCI_HALT state") into android14-6.1-lts

Steps on the way to 6.10.110

Change-Id: I1216c9bbd000b12d4527001399684236d905b6b6
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-10-01 16:52:33 +00:00
30 changed files with 183 additions and 89 deletions

View File

@@ -328,7 +328,6 @@ static bool mmio_read(int size, unsigned long addr, unsigned long *val)
.r12 = size, .r12 = size,
.r13 = EPT_READ, .r13 = EPT_READ,
.r14 = addr, .r14 = addr,
.r15 = *val,
}; };
if (__tdx_hypercall(&args, TDX_HCALL_HAS_OUTPUT)) if (__tdx_hypercall(&args, TDX_HCALL_HAS_OUTPUT))

View File

@@ -4352,6 +4352,25 @@ static u8 adl_get_hybrid_cpu_type(void)
return hybrid_big; return hybrid_big;
} }
static inline bool erratum_hsw11(struct perf_event *event)
{
return (event->hw.config & INTEL_ARCH_EVENT_MASK) ==
X86_CONFIG(.event=0xc0, .umask=0x01);
}
/*
* The HSW11 requires a period larger than 100 which is the same as the BDM11.
* A minimum period of 128 is enforced as well for the INST_RETIRED.ALL.
*
* The message 'interrupt took too long' can be observed on any counter which
* was armed with a period < 32 and two events expired in the same NMI.
* A minimum period of 32 is enforced for the rest of the events.
*/
static void hsw_limit_period(struct perf_event *event, s64 *left)
{
*left = max(*left, erratum_hsw11(event) ? 128 : 32);
}
/* /*
* Broadwell: * Broadwell:
* *
@@ -4369,8 +4388,7 @@ static u8 adl_get_hybrid_cpu_type(void)
*/ */
static void bdw_limit_period(struct perf_event *event, s64 *left) static void bdw_limit_period(struct perf_event *event, s64 *left)
{ {
if ((event->hw.config & INTEL_ARCH_EVENT_MASK) == if (erratum_hsw11(event)) {
X86_CONFIG(.event=0xc0, .umask=0x01)) {
if (*left < 128) if (*left < 128)
*left = 128; *left = 128;
*left &= ~0x3fULL; *left &= ~0x3fULL;
@@ -6180,6 +6198,7 @@ __init int intel_pmu_init(void)
x86_pmu.hw_config = hsw_hw_config; x86_pmu.hw_config = hsw_hw_config;
x86_pmu.get_event_constraints = hsw_get_event_constraints; x86_pmu.get_event_constraints = hsw_get_event_constraints;
x86_pmu.limit_period = hsw_limit_period;
x86_pmu.lbr_double_abort = true; x86_pmu.lbr_double_abort = true;
extra_attr = boot_cpu_has(X86_FEATURE_RTM) ? extra_attr = boot_cpu_has(X86_FEATURE_RTM) ?
hsw_format_attr : nhm_format_attr; hsw_format_attr : nhm_format_attr;

View File

@@ -17,6 +17,7 @@ extern unsigned long phys_base;
extern unsigned long page_offset_base; extern unsigned long page_offset_base;
extern unsigned long vmalloc_base; extern unsigned long vmalloc_base;
extern unsigned long vmemmap_base; extern unsigned long vmemmap_base;
extern unsigned long physmem_end;
static __always_inline unsigned long __phys_addr_nodebug(unsigned long x) static __always_inline unsigned long __phys_addr_nodebug(unsigned long x)
{ {

View File

@@ -139,6 +139,10 @@ extern unsigned int ptrs_per_p4d;
# define VMEMMAP_START __VMEMMAP_BASE_L4 # define VMEMMAP_START __VMEMMAP_BASE_L4
#endif /* CONFIG_DYNAMIC_MEMORY_LAYOUT */ #endif /* CONFIG_DYNAMIC_MEMORY_LAYOUT */
#ifdef CONFIG_RANDOMIZE_MEMORY
# define PHYSMEM_END physmem_end
#endif
/* /*
* End of the region for which vmalloc page tables are pre-allocated. * End of the region for which vmalloc page tables are pre-allocated.
* For non-KMSAN builds, this is the same as VMALLOC_END. * For non-KMSAN builds, this is the same as VMALLOC_END.

View File

@@ -2756,6 +2756,12 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
case MSR_CSTAR: case MSR_CSTAR:
msr_info->data = svm->vmcb01.ptr->save.cstar; msr_info->data = svm->vmcb01.ptr->save.cstar;
break; break;
case MSR_GS_BASE:
msr_info->data = svm->vmcb01.ptr->save.gs.base;
break;
case MSR_FS_BASE:
msr_info->data = svm->vmcb01.ptr->save.fs.base;
break;
case MSR_KERNEL_GS_BASE: case MSR_KERNEL_GS_BASE:
msr_info->data = svm->vmcb01.ptr->save.kernel_gs_base; msr_info->data = svm->vmcb01.ptr->save.kernel_gs_base;
break; break;
@@ -2982,6 +2988,12 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
case MSR_CSTAR: case MSR_CSTAR:
svm->vmcb01.ptr->save.cstar = data; svm->vmcb01.ptr->save.cstar = data;
break; break;
case MSR_GS_BASE:
svm->vmcb01.ptr->save.gs.base = data;
break;
case MSR_FS_BASE:
svm->vmcb01.ptr->save.fs.base = data;
break;
case MSR_KERNEL_GS_BASE: case MSR_KERNEL_GS_BASE:
svm->vmcb01.ptr->save.kernel_gs_base = data; svm->vmcb01.ptr->save.kernel_gs_base = data;
break; break;
@@ -4960,6 +4972,9 @@ static __init void svm_set_cpu_caps(void)
/* CPUID 0x8000001F (SME/SEV features) */ /* CPUID 0x8000001F (SME/SEV features) */
sev_set_cpu_caps(); sev_set_cpu_caps();
/* Don't advertise Bus Lock Detect to guest if SVM support is absent */
kvm_cpu_cap_clear(X86_FEATURE_BUS_LOCK_DETECT);
} }
static __init int svm_hardware_setup(void) static __init int svm_hardware_setup(void)

View File

@@ -5747,7 +5747,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
if (copy_from_user(&events, argp, sizeof(struct kvm_vcpu_events))) if (copy_from_user(&events, argp, sizeof(struct kvm_vcpu_events)))
break; break;
kvm_vcpu_srcu_read_lock(vcpu);
r = kvm_vcpu_ioctl_x86_set_vcpu_events(vcpu, &events); r = kvm_vcpu_ioctl_x86_set_vcpu_events(vcpu, &events);
kvm_vcpu_srcu_read_unlock(vcpu);
break; break;
} }
case KVM_GET_DEBUGREGS: { case KVM_GET_DEBUGREGS: {

View File

@@ -950,8 +950,12 @@ static void update_end_of_memory_vars(u64 start, u64 size)
int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages, int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
struct mhp_params *params) struct mhp_params *params)
{ {
unsigned long end = ((start_pfn + nr_pages) << PAGE_SHIFT) - 1;
int ret; int ret;
if (WARN_ON_ONCE(end > PHYSMEM_END))
return -ERANGE;
ret = __add_pages(nid, start_pfn, nr_pages, params); ret = __add_pages(nid, start_pfn, nr_pages, params);
WARN_ON_ONCE(ret); WARN_ON_ONCE(ret);

View File

@@ -47,13 +47,24 @@ static const unsigned long vaddr_end = CPU_ENTRY_AREA_BASE;
*/ */
static __initdata struct kaslr_memory_region { static __initdata struct kaslr_memory_region {
unsigned long *base; unsigned long *base;
unsigned long *end;
unsigned long size_tb; unsigned long size_tb;
} kaslr_regions[] = { } kaslr_regions[] = {
{ &page_offset_base, 0 }, {
{ &vmalloc_base, 0 }, .base = &page_offset_base,
{ &vmemmap_base, 0 }, .end = &physmem_end,
},
{
.base = &vmalloc_base,
},
{
.base = &vmemmap_base,
},
}; };
/* The end of the possible address space for physical memory */
unsigned long physmem_end __ro_after_init;
/* Get size in bytes used by the memory region */ /* Get size in bytes used by the memory region */
static inline unsigned long get_padding(struct kaslr_memory_region *region) static inline unsigned long get_padding(struct kaslr_memory_region *region)
{ {
@@ -82,6 +93,8 @@ void __init kernel_randomize_memory(void)
BUILD_BUG_ON(vaddr_end != CPU_ENTRY_AREA_BASE); BUILD_BUG_ON(vaddr_end != CPU_ENTRY_AREA_BASE);
BUILD_BUG_ON(vaddr_end > __START_KERNEL_map); BUILD_BUG_ON(vaddr_end > __START_KERNEL_map);
/* Preset the end of the possible address space for physical memory */
physmem_end = ((1ULL << MAX_PHYSMEM_BITS) - 1);
if (!kaslr_memory_enabled()) if (!kaslr_memory_enabled())
return; return;
@@ -128,11 +141,18 @@ void __init kernel_randomize_memory(void)
vaddr += entropy; vaddr += entropy;
*kaslr_regions[i].base = vaddr; *kaslr_regions[i].base = vaddr;
/* /* Calculate the end of the region */
* Jump the region and add a minimum padding based on
* randomization alignment.
*/
vaddr += get_padding(&kaslr_regions[i]); vaddr += get_padding(&kaslr_regions[i]);
/*
* KASLR trims the maximum possible size of the
* direct-map. Update the physmem_end boundary.
* No rounding required as the region starts
* PUD aligned and size is in units of TB.
*/
if (kaslr_regions[i].end)
*kaslr_regions[i].end = __pa_nodebug(vaddr - 1);
/* Add a minimum padding based on randomization alignment. */
vaddr = round_up(vaddr + 1, PUD_SIZE); vaddr = round_up(vaddr + 1, PUD_SIZE);
remain_entropy -= entropy; remain_entropy -= entropy;
} }

View File

@@ -5532,8 +5532,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
} }
dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL); dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL);
if (!dr) if (!dr) {
kfree(host);
goto err_out; goto err_out;
}
devres_add(dev, dr); devres_add(dev, dr);
dev_set_drvdata(dev, host); dev_set_drvdata(dev, host);

View File

@@ -438,12 +438,12 @@ static int __init gicv2m_of_init(struct fwnode_handle *parent_handle,
ret = gicv2m_init_one(&child->fwnode, spi_start, nr_spis, ret = gicv2m_init_one(&child->fwnode, spi_start, nr_spis,
&res, 0); &res, 0);
if (ret) { if (ret)
of_node_put(child);
break; break;
}
} }
if (ret && child)
of_node_put(child);
if (!ret) if (!ret)
ret = gicv2m_allocate_domains(parent); ret = gicv2m_allocate_domains(parent);
if (ret) if (ret)

View File

@@ -15,6 +15,19 @@
#include "card.h" #include "card.h"
static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
/*
* Kingston Canvas Go! Plus microSD cards never finish SD cache flush.
* This has so far only been observed on cards from 11/2019, while new
* cards from 2023/05 do not exhibit this behavior.
*/
_FIXUP_EXT("SD64G", CID_MANFID_KINGSTON_SD, 0x5449, 2019, 11,
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),
END_FIXUP
};
static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = { static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
#define INAND_CMD38_ARG_EXT_CSD 113 #define INAND_CMD38_ARG_EXT_CSD 113
#define INAND_CMD38_ARG_ERASE 0x00 #define INAND_CMD38_ARG_ERASE 0x00
@@ -53,15 +66,6 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
MMC_FIXUP("MMC32G", CID_MANFID_TOSHIBA, CID_OEMID_ANY, add_quirk_mmc, MMC_FIXUP("MMC32G", CID_MANFID_TOSHIBA, CID_OEMID_ANY, add_quirk_mmc,
MMC_QUIRK_BLK_NO_CMD23), MMC_QUIRK_BLK_NO_CMD23),
/*
* Kingston Canvas Go! Plus microSD cards never finish SD cache flush.
* This has so far only been observed on cards from 11/2019, while new
* cards from 2023/05 do not exhibit this behavior.
*/
_FIXUP_EXT("SD64G", CID_MANFID_KINGSTON_SD, 0x5449, 2019, 11,
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),
/* /*
* Some SD cards lockup while using CMD23 multiblock transfers. * Some SD cards lockup while using CMD23 multiblock transfers.
*/ */

View File

@@ -28,6 +28,7 @@
#include "host.h" #include "host.h"
#include "bus.h" #include "bus.h"
#include "mmc_ops.h" #include "mmc_ops.h"
#include "quirks.h"
#include "sd.h" #include "sd.h"
#include "sd_ops.h" #include "sd_ops.h"
@@ -1479,6 +1480,9 @@ retry:
goto free_card; goto free_card;
} }
/* Apply quirks prior to card setup */
mmc_fixup_device(card, mmc_sd_fixups);
err = mmc_sd_setup_card(host, card, oldcard != NULL); err = mmc_sd_setup_card(host, card, oldcard != NULL);
if (err) if (err)
goto free_card; goto free_card;

View File

@@ -612,7 +612,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
cqhci_writel(cq_host, 0, CQHCI_CTL); cqhci_writel(cq_host, 0, CQHCI_CTL);
mmc->cqe_on = true; mmc->cqe_on = true;
pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc)); pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) { if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
pr_err("%s: cqhci: CQE failed to exit halt state\n", pr_err("%s: cqhci: CQE failed to exit halt state\n",
mmc_hostname(mmc)); mmc_hostname(mmc));
} }

View File

@@ -2952,8 +2952,8 @@ static int dw_mci_init_slot(struct dw_mci *host)
if (host->use_dma == TRANS_MODE_IDMAC) { if (host->use_dma == TRANS_MODE_IDMAC) {
mmc->max_segs = host->ring_size; mmc->max_segs = host->ring_size;
mmc->max_blk_size = 65535; mmc->max_blk_size = 65535;
mmc->max_seg_size = 0x1000; mmc->max_req_size = DW_MCI_DESC_DATA_LENGTH * host->ring_size;
mmc->max_req_size = mmc->max_seg_size * host->ring_size; mmc->max_seg_size = mmc->max_req_size;
mmc->max_blk_count = mmc->max_req_size / 512; mmc->max_blk_count = mmc->max_req_size / 512;
} else if (host->use_dma == TRANS_MODE_EDMAC) { } else if (host->use_dma == TRANS_MODE_EDMAC) {
mmc->max_segs = 64; mmc->max_segs = 64;

View File

@@ -513,6 +513,7 @@ static const struct of_device_id aspeed_sdhci_of_match[] = {
{ .compatible = "aspeed,ast2600-sdhci", .data = &ast2600_sdhci_pdata, }, { .compatible = "aspeed,ast2600-sdhci", .data = &ast2600_sdhci_pdata, },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, aspeed_sdhci_of_match);
static struct platform_driver aspeed_sdhci_driver = { static struct platform_driver aspeed_sdhci_driver = {
.driver = { .driver = {

View File

@@ -3108,6 +3108,17 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
dmi_match(DMI_BOARD_NAME, "NS5x_7xPU") || dmi_match(DMI_BOARD_NAME, "NS5x_7xPU") ||
dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1")) dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"))
return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND; return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND;
} else if (pdev->vendor == 0x144d && pdev->device == 0xa80d) {
/*
* Exclude Samsung 990 Evo from NVME_QUIRK_SIMPLE_SUSPEND
* because of high power consumption (> 2 Watt) in s2idle
* sleep. Only some boards with Intel CPU are affected.
*/
if (dmi_match(DMI_BOARD_NAME, "GMxPXxx") ||
dmi_match(DMI_BOARD_NAME, "PH4PG31") ||
dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1") ||
dmi_match(DMI_BOARD_NAME, "PH6PG01_PH6PG71"))
return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND;
} }
/* /*

View File

@@ -1703,6 +1703,8 @@ int smb2_sess_setup(struct ksmbd_work *work)
rc = ksmbd_session_register(conn, sess); rc = ksmbd_session_register(conn, sess);
if (rc) if (rc)
goto out_err; goto out_err;
conn->binding = false;
} else if (conn->dialect >= SMB30_PROT_ID && } else if (conn->dialect >= SMB30_PROT_ID &&
(server_conf.flags & KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL) && (server_conf.flags & KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL) &&
req->Flags & SMB2_SESSION_REQ_FLAG_BINDING) { req->Flags & SMB2_SESSION_REQ_FLAG_BINDING) {
@@ -1781,6 +1783,8 @@ int smb2_sess_setup(struct ksmbd_work *work)
sess = NULL; sess = NULL;
goto out_err; goto out_err;
} }
conn->binding = false;
} }
work->sess = sess; work->sess = sess;

View File

@@ -622,8 +622,10 @@ int ksmbd_tcp_set_interfaces(char *ifc_list, int ifc_list_sz)
for_each_netdev(&init_net, netdev) { for_each_netdev(&init_net, netdev) {
if (netif_is_bridge_port(netdev)) if (netif_is_bridge_port(netdev))
continue; continue;
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL))) if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL))) {
rtnl_unlock();
return -ENOMEM; return -ENOMEM;
}
} }
rtnl_unlock(); rtnl_unlock();
bind_additional_ifaces = 1; bind_additional_ifaces = 1;

View File

@@ -95,6 +95,10 @@ extern const int mmap_rnd_compat_bits_max;
extern int mmap_rnd_compat_bits __read_mostly; extern int mmap_rnd_compat_bits __read_mostly;
#endif #endif
#ifndef PHYSMEM_END
# define PHYSMEM_END ((1ULL << MAX_PHYSMEM_BITS) - 1)
#endif
#include <asm/page.h> #include <asm/page.h>
#include <asm/processor.h> #include <asm/processor.h>

View File

@@ -188,7 +188,6 @@ struct blocked_key {
struct smp_csrk { struct smp_csrk {
bdaddr_t bdaddr; bdaddr_t bdaddr;
u8 bdaddr_type; u8 bdaddr_type;
u8 link_type;
u8 type; u8 type;
u8 val[16]; u8 val[16];
}; };
@@ -198,7 +197,6 @@ struct smp_ltk {
struct rcu_head rcu; struct rcu_head rcu;
bdaddr_t bdaddr; bdaddr_t bdaddr;
u8 bdaddr_type; u8 bdaddr_type;
u8 link_type;
u8 authenticated; u8 authenticated;
u8 type; u8 type;
u8 enc_size; u8 enc_size;
@@ -213,7 +211,6 @@ struct smp_irk {
bdaddr_t rpa; bdaddr_t rpa;
bdaddr_t bdaddr; bdaddr_t bdaddr;
u8 addr_type; u8 addr_type;
u8 link_type;
u8 val[16]; u8 val[16];
}; };
@@ -221,8 +218,6 @@ struct link_key {
struct list_head list; struct list_head list;
struct rcu_head rcu; struct rcu_head rcu;
bdaddr_t bdaddr; bdaddr_t bdaddr;
u8 bdaddr_type;
u8 link_type;
u8 type; u8 type;
u8 val[HCI_LINK_KEY_SIZE]; u8 val[HCI_LINK_KEY_SIZE];
u8 pin_len; u8 pin_len;

View File

@@ -1577,6 +1577,7 @@ static int __sched rt_mutex_slowlock_block(struct rt_mutex_base *lock,
} }
static void __sched rt_mutex_handle_deadlock(int res, int detect_deadlock, static void __sched rt_mutex_handle_deadlock(int res, int detect_deadlock,
struct rt_mutex_base *lock,
struct rt_mutex_waiter *w) struct rt_mutex_waiter *w)
{ {
/* /*
@@ -1589,10 +1590,10 @@ static void __sched rt_mutex_handle_deadlock(int res, int detect_deadlock,
if (build_ww_mutex() && w->ww_ctx) if (build_ww_mutex() && w->ww_ctx)
return; return;
/* raw_spin_unlock_irq(&lock->wait_lock);
* Yell loudly and stop the task right here.
*/
WARN(1, "rtmutex deadlock detected\n"); WARN(1, "rtmutex deadlock detected\n");
while (1) { while (1) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule(); schedule();
@@ -1646,7 +1647,7 @@ static int __sched __rt_mutex_slowlock(struct rt_mutex_base *lock,
} else { } else {
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
remove_waiter(lock, waiter); remove_waiter(lock, waiter);
rt_mutex_handle_deadlock(ret, chwalk, waiter); rt_mutex_handle_deadlock(ret, chwalk, lock, waiter);
} }
/* /*

View File

@@ -1778,8 +1778,7 @@ static resource_size_t gfr_start(struct resource *base, resource_size_t size,
if (flags & GFR_DESCENDING) { if (flags & GFR_DESCENDING) {
resource_size_t end; resource_size_t end;
end = min_t(resource_size_t, base->end, end = min_t(resource_size_t, base->end, PHYSMEM_END);
(1ULL << MAX_PHYSMEM_BITS) - 1);
return end - size + 1; return end - size + 1;
} }
@@ -1796,8 +1795,7 @@ static bool gfr_continue(struct resource *base, resource_size_t addr,
* @size did not wrap 0. * @size did not wrap 0.
*/ */
return addr > addr - size && return addr > addr - size &&
addr <= min_t(resource_size_t, base->end, addr <= min_t(resource_size_t, base->end, PHYSMEM_END);
(1ULL << MAX_PHYSMEM_BITS) - 1);
} }
static resource_size_t gfr_next(resource_size_t addr, resource_size_t size, static resource_size_t gfr_next(resource_size_t addr, resource_size_t size,

View File

@@ -1530,7 +1530,7 @@ struct range __weak arch_get_mappable_range(void)
struct range mhp_get_pluggable_range(bool need_mapping) struct range mhp_get_pluggable_range(bool need_mapping)
{ {
const u64 max_phys = (1ULL << MAX_PHYSMEM_BITS) - 1; const u64 max_phys = PHYSMEM_END;
struct range mhp_range; struct range mhp_range;
if (need_mapping) { if (need_mapping) {

View File

@@ -129,7 +129,7 @@ static inline int sparse_early_nid(struct mem_section *section)
static void __meminit mminit_validate_memmodel_limits(unsigned long *start_pfn, static void __meminit mminit_validate_memmodel_limits(unsigned long *start_pfn,
unsigned long *end_pfn) unsigned long *end_pfn)
{ {
unsigned long max_sparsemem_pfn = 1UL << (MAX_PHYSMEM_BITS-PAGE_SHIFT); unsigned long max_sparsemem_pfn = (PHYSMEM_END + 1) >> PAGE_SHIFT;
/* /*
* Sanity checks - do not allow an architecture to pass * Sanity checks - do not allow an architecture to pass

View File

@@ -2900,16 +2900,6 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data,
bt_dev_dbg(hdev, "debug_keys %u key_count %u", cp->debug_keys, bt_dev_dbg(hdev, "debug_keys %u key_count %u", cp->debug_keys,
key_count); key_count);
for (i = 0; i < key_count; i++) {
struct mgmt_link_key_info *key = &cp->keys[i];
/* Considering SMP over BREDR/LE, there is no need to check addr_type */
if (key->type > 0x08)
return mgmt_cmd_status(sk, hdev->id,
MGMT_OP_LOAD_LINK_KEYS,
MGMT_STATUS_INVALID_PARAMS);
}
hci_dev_lock(hdev); hci_dev_lock(hdev);
hci_link_keys_clear(hdev); hci_link_keys_clear(hdev);
@@ -2934,6 +2924,19 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data,
continue; continue;
} }
if (key->addr.type != BDADDR_BREDR) {
bt_dev_warn(hdev,
"Invalid link address type %u for %pMR",
key->addr.type, &key->addr.bdaddr);
continue;
}
if (key->type > 0x08) {
bt_dev_warn(hdev, "Invalid link key type %u for %pMR",
key->type, &key->addr.bdaddr);
continue;
}
/* Always ignore debug keys and require a new pairing if /* Always ignore debug keys and require a new pairing if
* the user wants to use them. * the user wants to use them.
*/ */
@@ -7154,7 +7157,6 @@ static int load_irks(struct sock *sk, struct hci_dev *hdev, void *cp_data,
for (i = 0; i < irk_count; i++) { for (i = 0; i < irk_count; i++) {
struct mgmt_irk_info *irk = &cp->irks[i]; struct mgmt_irk_info *irk = &cp->irks[i];
u8 addr_type = le_addr_type(irk->addr.type);
if (hci_is_blocked_key(hdev, if (hci_is_blocked_key(hdev,
HCI_BLOCKED_KEY_TYPE_IRK, HCI_BLOCKED_KEY_TYPE_IRK,
@@ -7164,12 +7166,8 @@ static int load_irks(struct sock *sk, struct hci_dev *hdev, void *cp_data,
continue; continue;
} }
/* When using SMP over BR/EDR, the addr type should be set to BREDR */
if (irk->addr.type == BDADDR_BREDR)
addr_type = BDADDR_BREDR;
hci_add_irk(hdev, &irk->addr.bdaddr, hci_add_irk(hdev, &irk->addr.bdaddr,
addr_type, irk->val, le_addr_type(irk->addr.type), irk->val,
BDADDR_ANY); BDADDR_ANY);
} }
@@ -7234,15 +7232,6 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
bt_dev_dbg(hdev, "key_count %u", key_count); bt_dev_dbg(hdev, "key_count %u", key_count);
for (i = 0; i < key_count; i++) {
struct mgmt_ltk_info *key = &cp->keys[i];
if (!ltk_is_valid(key))
return mgmt_cmd_status(sk, hdev->id,
MGMT_OP_LOAD_LONG_TERM_KEYS,
MGMT_STATUS_INVALID_PARAMS);
}
hci_dev_lock(hdev); hci_dev_lock(hdev);
hci_smp_ltks_clear(hdev); hci_smp_ltks_clear(hdev);
@@ -7250,7 +7239,6 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
for (i = 0; i < key_count; i++) { for (i = 0; i < key_count; i++) {
struct mgmt_ltk_info *key = &cp->keys[i]; struct mgmt_ltk_info *key = &cp->keys[i];
u8 type, authenticated; u8 type, authenticated;
u8 addr_type = le_addr_type(key->addr.type);
if (hci_is_blocked_key(hdev, if (hci_is_blocked_key(hdev,
HCI_BLOCKED_KEY_TYPE_LTK, HCI_BLOCKED_KEY_TYPE_LTK,
@@ -7260,6 +7248,12 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
continue; continue;
} }
if (!ltk_is_valid(key)) {
bt_dev_warn(hdev, "Invalid LTK for %pMR",
&key->addr.bdaddr);
continue;
}
switch (key->type) { switch (key->type) {
case MGMT_LTK_UNAUTHENTICATED: case MGMT_LTK_UNAUTHENTICATED:
authenticated = 0x00; authenticated = 0x00;
@@ -7285,12 +7279,8 @@ static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev,
continue; continue;
} }
/* When using SMP over BR/EDR, the addr type should be set to BREDR */
if (key->addr.type == BDADDR_BREDR)
addr_type = BDADDR_BREDR;
hci_add_ltk(hdev, &key->addr.bdaddr, hci_add_ltk(hdev, &key->addr.bdaddr,
addr_type, type, authenticated, le_addr_type(key->addr.type), type, authenticated,
key->val, key->enc_size, key->ediv, key->rand); key->val, key->enc_size, key->ediv, key->rand);
} }
@@ -9558,7 +9548,7 @@ void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
ev.store_hint = persistent; ev.store_hint = persistent;
bacpy(&ev.key.addr.bdaddr, &key->bdaddr); bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type); ev.key.addr.type = BDADDR_BREDR;
ev.key.type = key->type; ev.key.type = key->type;
memcpy(ev.key.val, key->val, HCI_LINK_KEY_SIZE); memcpy(ev.key.val, key->val, HCI_LINK_KEY_SIZE);
ev.key.pin_len = key->pin_len; ev.key.pin_len = key->pin_len;
@@ -9609,7 +9599,7 @@ void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent)
ev.store_hint = persistent; ev.store_hint = persistent;
bacpy(&ev.key.addr.bdaddr, &key->bdaddr); bacpy(&ev.key.addr.bdaddr, &key->bdaddr);
ev.key.addr.type = link_to_bdaddr(key->link_type, key->bdaddr_type); ev.key.addr.type = link_to_bdaddr(LE_LINK, key->bdaddr_type);
ev.key.type = mgmt_ltk_type(key); ev.key.type = mgmt_ltk_type(key);
ev.key.enc_size = key->enc_size; ev.key.enc_size = key->enc_size;
ev.key.ediv = key->ediv; ev.key.ediv = key->ediv;
@@ -9638,7 +9628,7 @@ void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent)
bacpy(&ev.rpa, &irk->rpa); bacpy(&ev.rpa, &irk->rpa);
bacpy(&ev.irk.addr.bdaddr, &irk->bdaddr); bacpy(&ev.irk.addr.bdaddr, &irk->bdaddr);
ev.irk.addr.type = link_to_bdaddr(irk->link_type, irk->addr_type); ev.irk.addr.type = link_to_bdaddr(LE_LINK, irk->addr_type);
memcpy(ev.irk.val, irk->val, sizeof(irk->val)); memcpy(ev.irk.val, irk->val, sizeof(irk->val));
mgmt_event(MGMT_EV_NEW_IRK, hdev, &ev, sizeof(ev), NULL); mgmt_event(MGMT_EV_NEW_IRK, hdev, &ev, sizeof(ev), NULL);
@@ -9667,7 +9657,7 @@ void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk,
ev.store_hint = persistent; ev.store_hint = persistent;
bacpy(&ev.key.addr.bdaddr, &csrk->bdaddr); bacpy(&ev.key.addr.bdaddr, &csrk->bdaddr);
ev.key.addr.type = link_to_bdaddr(csrk->link_type, csrk->bdaddr_type); ev.key.addr.type = link_to_bdaddr(LE_LINK, csrk->bdaddr_type);
ev.key.type = csrk->type; ev.key.type = csrk->type;
memcpy(ev.key.val, csrk->val, sizeof(csrk->val)); memcpy(ev.key.val, csrk->val, sizeof(csrk->val));

View File

@@ -1059,7 +1059,6 @@ static void smp_notify_keys(struct l2cap_conn *conn)
} }
if (smp->remote_irk) { if (smp->remote_irk) {
smp->remote_irk->link_type = hcon->type;
mgmt_new_irk(hdev, smp->remote_irk, persistent); mgmt_new_irk(hdev, smp->remote_irk, persistent);
/* Now that user space can be considered to know the /* Now that user space can be considered to know the
@@ -1074,28 +1073,24 @@ static void smp_notify_keys(struct l2cap_conn *conn)
} }
if (smp->csrk) { if (smp->csrk) {
smp->csrk->link_type = hcon->type;
smp->csrk->bdaddr_type = hcon->dst_type; smp->csrk->bdaddr_type = hcon->dst_type;
bacpy(&smp->csrk->bdaddr, &hcon->dst); bacpy(&smp->csrk->bdaddr, &hcon->dst);
mgmt_new_csrk(hdev, smp->csrk, persistent); mgmt_new_csrk(hdev, smp->csrk, persistent);
} }
if (smp->responder_csrk) { if (smp->responder_csrk) {
smp->responder_csrk->link_type = hcon->type;
smp->responder_csrk->bdaddr_type = hcon->dst_type; smp->responder_csrk->bdaddr_type = hcon->dst_type;
bacpy(&smp->responder_csrk->bdaddr, &hcon->dst); bacpy(&smp->responder_csrk->bdaddr, &hcon->dst);
mgmt_new_csrk(hdev, smp->responder_csrk, persistent); mgmt_new_csrk(hdev, smp->responder_csrk, persistent);
} }
if (smp->ltk) { if (smp->ltk) {
smp->ltk->link_type = hcon->type;
smp->ltk->bdaddr_type = hcon->dst_type; smp->ltk->bdaddr_type = hcon->dst_type;
bacpy(&smp->ltk->bdaddr, &hcon->dst); bacpy(&smp->ltk->bdaddr, &hcon->dst);
mgmt_new_ltk(hdev, smp->ltk, persistent); mgmt_new_ltk(hdev, smp->ltk, persistent);
} }
if (smp->responder_ltk) { if (smp->responder_ltk) {
smp->responder_ltk->link_type = hcon->type;
smp->responder_ltk->bdaddr_type = hcon->dst_type; smp->responder_ltk->bdaddr_type = hcon->dst_type;
bacpy(&smp->responder_ltk->bdaddr, &hcon->dst); bacpy(&smp->responder_ltk->bdaddr, &hcon->dst);
mgmt_new_ltk(hdev, smp->responder_ltk, persistent); mgmt_new_ltk(hdev, smp->responder_ltk, persistent);
@@ -1115,8 +1110,6 @@ static void smp_notify_keys(struct l2cap_conn *conn)
key = hci_add_link_key(hdev, smp->conn->hcon, &hcon->dst, key = hci_add_link_key(hdev, smp->conn->hcon, &hcon->dst,
smp->link_key, type, 0, &persistent); smp->link_key, type, 0, &persistent);
if (key) { if (key) {
key->link_type = hcon->type;
key->bdaddr_type = hcon->dst_type;
mgmt_new_link_key(hdev, key, persistent); mgmt_new_link_key(hdev, key, persistent);
/* Don't keep debug keys around if the relevant /* Don't keep debug keys around if the relevant

View File

@@ -733,11 +733,10 @@ deliver:
err = qdisc_enqueue(skb, q->qdisc, &to_free); err = qdisc_enqueue(skb, q->qdisc, &to_free);
kfree_skb_list(to_free); kfree_skb_list(to_free);
if (err != NET_XMIT_SUCCESS && if (err != NET_XMIT_SUCCESS) {
net_xmit_drop_count(err)) { if (net_xmit_drop_count(err))
qdisc_qstats_drop(sch); qdisc_qstats_drop(sch);
qdisc_tree_reduce_backlog(sch, 1, qdisc_tree_reduce_backlog(sch, 1, pkt_len);
pkt_len);
} }
goto tfifo_dequeue; goto tfifo_dequeue;
} }

View File

@@ -311,6 +311,7 @@ enum {
CXT_FIXUP_HEADSET_MIC, CXT_FIXUP_HEADSET_MIC,
CXT_FIXUP_HP_MIC_NO_PRESENCE, CXT_FIXUP_HP_MIC_NO_PRESENCE,
CXT_PINCFG_SWS_JS201D, CXT_PINCFG_SWS_JS201D,
CXT_PINCFG_TOP_SPEAKER,
}; };
/* for hda_fixup_thinkpad_acpi() */ /* for hda_fixup_thinkpad_acpi() */
@@ -978,6 +979,13 @@ static const struct hda_fixup cxt_fixups[] = {
.type = HDA_FIXUP_PINS, .type = HDA_FIXUP_PINS,
.v.pins = cxt_pincfg_sws_js201d, .v.pins = cxt_pincfg_sws_js201d,
}, },
[CXT_PINCFG_TOP_SPEAKER] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
{ 0x1d, 0x82170111 },
{ }
},
},
}; };
static const struct snd_pci_quirk cxt5045_fixups[] = { static const struct snd_pci_quirk cxt5045_fixups[] = {
@@ -1074,6 +1082,8 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI), SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004), SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205), SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205),
SND_PCI_QUIRK(0x2782, 0x12c3, "Sirius Gen1", CXT_PINCFG_TOP_SPEAKER),
SND_PCI_QUIRK(0x2782, 0x12c5, "Sirius Gen2", CXT_PINCFG_TOP_SPEAKER),
{} {}
}; };
@@ -1093,6 +1103,7 @@ static const struct hda_model_fixup cxt5066_fixup_models[] = {
{ .id = CXT_FIXUP_HP_MIC_NO_PRESENCE, .name = "hp-mic-fix" }, { .id = CXT_FIXUP_HP_MIC_NO_PRESENCE, .name = "hp-mic-fix" },
{ .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" }, { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" },
{ .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" }, { .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" },
{ .id = CXT_PINCFG_TOP_SPEAKER, .name = "sirius-top-speaker" },
{} {}
}; };

View File

@@ -7289,6 +7289,7 @@ enum {
ALC236_FIXUP_HP_GPIO_LED, ALC236_FIXUP_HP_GPIO_LED,
ALC236_FIXUP_HP_MUTE_LED, ALC236_FIXUP_HP_MUTE_LED,
ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
ALC236_FIXUP_LENOVO_INV_DMIC,
ALC298_FIXUP_SAMSUNG_AMP, ALC298_FIXUP_SAMSUNG_AMP,
ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
@@ -8805,6 +8806,12 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc236_fixup_hp_mute_led_micmute_vref, .v.func = alc236_fixup_hp_mute_led_micmute_vref,
}, },
[ALC236_FIXUP_LENOVO_INV_DMIC] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc_fixup_inv_dmic,
.chained = true,
.chain_id = ALC283_FIXUP_INT_MIC,
},
[ALC298_FIXUP_SAMSUNG_AMP] = { [ALC298_FIXUP_SAMSUNG_AMP] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc298_fixup_samsung_amp, .v.func = alc298_fixup_samsung_amp,
@@ -9710,6 +9717,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
@@ -10111,6 +10119,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2), SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
@@ -10359,6 +10368,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"}, {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
{.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
{} {}
}; };
#define ALC225_STANDARD_PINS \ #define ALC225_STANDARD_PINS \

View File

@@ -4015,6 +4015,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
case SND_SOC_DAPM_POST_PMD: case SND_SOC_DAPM_POST_PMD:
kfree(substream->runtime); kfree(substream->runtime);
substream->runtime = NULL;
break; break;
default: default: