This is the 4.19.175 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAjmCsACgkQONu9yGCS aT6zjw//T/sN/vtlHmZZUD/iUcbYHUJiM82izt8yu6SsgcjiUkjwXKH373zX0EsN O7iQIWXMWxXCWc73esvJ1L8uOLmYto3fJq4bb+emsd8R6M/NQuQqSX7fvvlnpLo/ wkTkctk1l+EyVjk67M2izCK35Zz2rVvLHGYXYMj+bJZxxCrnhG06pXcV+0udX53j Nl0ejBoYLhKZW3wyfkLbORQToFATM1IxSaBqUESQj1Wkie989c4ARcJ1mUuOOW6T XMhdxazbV5I4kQzcBWmhVbGX5hv28FIeeugu2aW4bxX4up8zcq+S0Z1I5c0Q0MWL 1AI+4HDS+9/USXuQc4kqgqF893Y25hXwk3tck7boRu0OznLC3j9RTXMrDVl08ZOv 3Y9fkyEoRwwbsik5+8Sf3H0OamNaL6qcWYbJczlz50BltaVH2k960itCGlnfnJjT 9FZQMmWzx3JnZbDHD6iCYuVCnPdZn2AUK5ZwF5kjME7CcJVDWGH23uFpTw5MDXMO 1arKj615PPTKzZ+gODM4Q0H2+ek3uclKpNqDNlR4sZgRxcr+bimw7tke3Pv4L+4p iU5W9o9TBXqoeNwKCO37eoRHySpU/mJ8OslHTrf/YzXH/q9uHNnVo9sM9/SEyqr1 94OrfbKTE8InON0/jgu482i7SHODdNUoD4wDXyZDQ1jb5J/+H3k= =uSwA -----END PGP SIGNATURE----- Merge 4.19.175 into android-4.19-stable Changes in 4.19.175 USB: serial: cp210x: add pid/vid for WSDA-200-USB USB: serial: cp210x: add new VID/PID for supporting Teraoka AD2000 USB: serial: option: Adding support for Cinterion MV31 elfcore: fix building with clang Input: i8042 - unbreak Pegatron C15B rxrpc: Fix deadlock around release of dst cached on udp tunnel arm64: dts: ls1046a: fix dcfg address range net: lapb: Copy the skb before sending a packet net: mvpp2: TCAM entry enable should be written after SRAM data memblock: do not start bottom-up allocations with kernel_end USB: gadget: legacy: fix an error code in eth_bind() USB: usblp: don't call usb_set_interface if there's a single alt usb: renesas_usbhs: Clear pipe running flag in usbhs_pkt_pop() usb: dwc2: Fix endpoint direction check in ep_from_windex usb: dwc3: fix clock issue during resume in OTG mode ovl: fix dentry leak in ovl_get_redirect mac80211: fix station rate table updates on assoc kretprobe: Avoid re-registration of the same kretprobe earlier genirq/msi: Activate Multi-MSI early when MSI_FLAG_ACTIVATE_EARLY is set xhci: fix bounce buffer usage for non-sg list case cifs: report error instead of invalid when revalidating a dentry fails smb3: Fix out-of-bounds bug in SMB2_negotiate() mmc: core: Limit retries when analyse of SDIO tuples fails nvme-pci: avoid the deepest sleep state on Kingston A2000 SSDs KVM: SVM: Treat SVM as unsupported when running as an SEV guest ARM: footbridge: fix dc21285 PCI configuration accessors mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page mm: hugetlb: fix a race between freeing and dissolving the page mm: hugetlb: fix a race between isolating and freeing page mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active mm: thp: fix MADV_REMOVE deadlock on shmem THP x86/build: Disable CET instrumentation in the kernel x86/apic: Add extra serialization for non-serializing MSRs Input: xpad - sync supported devices with fork on GitHub iommu/vt-d: Do not use flush-queue when caching-mode is on md: Set prev_flush_start and flush_bio in an atomic way net: ip_tunnel: fix mtu calculation net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add Linux 4.19.175 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Iac6d5c4ad079946ef1c032791e8e583b9264917b
This commit is contained in:
commit
19d4991aa6
8
Makefile
8
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 174
|
||||
SUBLEVEL = 175
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
@ -952,12 +952,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
|
||||
# change __FILE__ to the relative path from the srctree
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
||||
|
||||
# ensure -fcf-protection is disabled when using retpoline as it is
|
||||
# incompatible with -mindirect-branch=thunk-extern
|
||||
ifdef CONFIG_RETPOLINE
|
||||
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
|
||||
endif
|
||||
|
||||
# use the deterministic mode of AR if available
|
||||
KBUILD_ARFLAGS := $(call ar-option,D)
|
||||
|
||||
|
@ -69,15 +69,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where,
|
||||
if (addr)
|
||||
switch (size) {
|
||||
case 1:
|
||||
asm("ldrb %0, [%1, %2]"
|
||||
asm volatile("ldrb %0, [%1, %2]"
|
||||
: "=r" (v) : "r" (addr), "r" (where) : "cc");
|
||||
break;
|
||||
case 2:
|
||||
asm("ldrh %0, [%1, %2]"
|
||||
asm volatile("ldrh %0, [%1, %2]"
|
||||
: "=r" (v) : "r" (addr), "r" (where) : "cc");
|
||||
break;
|
||||
case 4:
|
||||
asm("ldr %0, [%1, %2]"
|
||||
asm volatile("ldr %0, [%1, %2]"
|
||||
: "=r" (v) : "r" (addr), "r" (where) : "cc");
|
||||
break;
|
||||
}
|
||||
@ -103,17 +103,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where,
|
||||
if (addr)
|
||||
switch (size) {
|
||||
case 1:
|
||||
asm("strb %0, [%1, %2]"
|
||||
asm volatile("strb %0, [%1, %2]"
|
||||
: : "r" (value), "r" (addr), "r" (where)
|
||||
: "cc");
|
||||
break;
|
||||
case 2:
|
||||
asm("strh %0, [%1, %2]"
|
||||
asm volatile("strh %0, [%1, %2]"
|
||||
: : "r" (value), "r" (addr), "r" (where)
|
||||
: "cc");
|
||||
break;
|
||||
case 4:
|
||||
asm("str %0, [%1, %2]"
|
||||
asm volatile("str %0, [%1, %2]"
|
||||
: : "r" (value), "r" (addr), "r" (where)
|
||||
: "cc");
|
||||
break;
|
||||
|
@ -303,7 +303,7 @@
|
||||
|
||||
dcfg: dcfg@1ee0000 {
|
||||
compatible = "fsl,ls1046a-dcfg", "syscon";
|
||||
reg = <0x0 0x1ee0000 0x0 0x10000>;
|
||||
reg = <0x0 0x1ee0000 0x0 0x1000>;
|
||||
big-endian;
|
||||
};
|
||||
|
||||
|
@ -132,6 +132,9 @@ else
|
||||
KBUILD_CFLAGS += -mno-red-zone
|
||||
KBUILD_CFLAGS += -mcmodel=kernel
|
||||
|
||||
# Intel CET isn't enabled in the kernel
|
||||
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
|
||||
|
||||
# -funit-at-a-time shrinks the kernel .text considerably
|
||||
# unfortunately it makes reading oopses harder.
|
||||
KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
|
||||
|
@ -190,16 +190,6 @@ static inline void lapic_assign_legacy_vector(unsigned int i, bool r) { }
|
||||
#endif /* !CONFIG_X86_LOCAL_APIC */
|
||||
|
||||
#ifdef CONFIG_X86_X2APIC
|
||||
/*
|
||||
* Make previous memory operations globally visible before
|
||||
* sending the IPI through x2apic wrmsr. We need a serializing instruction or
|
||||
* mfence for this.
|
||||
*/
|
||||
static inline void x2apic_wrmsr_fence(void)
|
||||
{
|
||||
asm volatile("mfence" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void native_apic_msr_write(u32 reg, u32 v)
|
||||
{
|
||||
if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
|
||||
|
@ -85,4 +85,22 @@ do { \
|
||||
|
||||
#include <asm-generic/barrier.h>
|
||||
|
||||
/*
|
||||
* Make previous memory operations globally visible before
|
||||
* a WRMSR.
|
||||
*
|
||||
* MFENCE makes writes visible, but only affects load/store
|
||||
* instructions. WRMSR is unfortunately not a load/store
|
||||
* instruction and is unaffected by MFENCE. The LFENCE ensures
|
||||
* that the WRMSR is not reordered.
|
||||
*
|
||||
* Most WRMSRs are full serializing instructions themselves and
|
||||
* do not require this barrier. This is only required for the
|
||||
* IA32_TSC_DEADLINE and X2APIC MSRs.
|
||||
*/
|
||||
static inline void weak_wrmsr_fence(void)
|
||||
{
|
||||
asm volatile("mfence; lfence" : : : "memory");
|
||||
}
|
||||
|
||||
#endif /* _ASM_X86_BARRIER_H */
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <asm/x86_init.h>
|
||||
#include <asm/pgalloc.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/barrier.h>
|
||||
#include <asm/mpspec.h>
|
||||
#include <asm/i8259.h>
|
||||
#include <asm/proto.h>
|
||||
@ -465,6 +466,9 @@ static int lapic_next_deadline(unsigned long delta,
|
||||
{
|
||||
u64 tsc;
|
||||
|
||||
/* This MSR is special and need a special fence: */
|
||||
weak_wrmsr_fence();
|
||||
|
||||
tsc = rdtsc();
|
||||
wrmsrl(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR));
|
||||
return 0;
|
||||
|
@ -31,7 +31,8 @@ static void x2apic_send_IPI(int cpu, int vector)
|
||||
{
|
||||
u32 dest = per_cpu(x86_cpu_to_logical_apicid, cpu);
|
||||
|
||||
x2apic_wrmsr_fence();
|
||||
/* x2apic MSRs are special and need a special fence: */
|
||||
weak_wrmsr_fence();
|
||||
__x2apic_send_IPI_dest(dest, vector, APIC_DEST_LOGICAL);
|
||||
}
|
||||
|
||||
@ -43,7 +44,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
|
||||
unsigned long flags;
|
||||
u32 dest;
|
||||
|
||||
x2apic_wrmsr_fence();
|
||||
/* x2apic MSRs are special and need a special fence: */
|
||||
weak_wrmsr_fence();
|
||||
local_irq_save(flags);
|
||||
|
||||
tmpmsk = this_cpu_cpumask_var_ptr(ipi_mask);
|
||||
|
@ -48,7 +48,8 @@ static void x2apic_send_IPI(int cpu, int vector)
|
||||
{
|
||||
u32 dest = per_cpu(x86_cpu_to_apicid, cpu);
|
||||
|
||||
x2apic_wrmsr_fence();
|
||||
/* x2apic MSRs are special and need a special fence: */
|
||||
weak_wrmsr_fence();
|
||||
__x2apic_send_IPI_dest(dest, vector, APIC_DEST_PHYSICAL);
|
||||
}
|
||||
|
||||
@ -59,7 +60,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
|
||||
unsigned long this_cpu;
|
||||
unsigned long flags;
|
||||
|
||||
x2apic_wrmsr_fence();
|
||||
/* x2apic MSRs are special and need a special fence: */
|
||||
weak_wrmsr_fence();
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
|
@ -892,6 +892,11 @@ static int has_svm(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sev_active()) {
|
||||
pr_info("KVM is unsupported when running as an SEV guest\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -229,9 +229,17 @@ static const struct xpad_device {
|
||||
{ 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
|
||||
{ 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
|
||||
{ 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02a0, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02a1, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02a2, "PDP Wired Controller for Xbox One - Crimson Red", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02a7, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02a8, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02ad, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02b3, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x02b8, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 },
|
||||
@ -310,6 +318,9 @@ static const struct xpad_device {
|
||||
{ 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 },
|
||||
{ 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 },
|
||||
{ 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
|
||||
{ 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
{ 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
|
||||
@ -443,8 +454,12 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOX360_VENDOR(0x162e), /* Joytech X-Box 360 controllers */
|
||||
XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
|
||||
XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */
|
||||
XPAD_XBOX360_VENDOR(0x20d6), /* PowerA Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
|
||||
XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -223,6 +223,8 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
|
||||
|
@ -3364,6 +3364,12 @@ static int __init init_dmars(void)
|
||||
|
||||
if (!ecap_pass_through(iommu->ecap))
|
||||
hw_pass_through = 0;
|
||||
|
||||
if (!intel_iommu_strict && cap_caching_mode(iommu->cap)) {
|
||||
pr_info("Disable batched IOTLB flush due to virtualization");
|
||||
intel_iommu_strict = 1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INTEL_IOMMU_SVM
|
||||
if (pasid_enabled(iommu))
|
||||
intel_svm_init(iommu);
|
||||
|
@ -474,8 +474,10 @@ static void md_submit_flush_data(struct work_struct *ws)
|
||||
* could wait for this and below md_handle_request could wait for those
|
||||
* bios because of suspend check
|
||||
*/
|
||||
spin_lock_irq(&mddev->lock);
|
||||
mddev->last_flush = mddev->start_flush;
|
||||
mddev->flush_bio = NULL;
|
||||
spin_unlock_irq(&mddev->lock);
|
||||
wake_up(&mddev->sb_wait);
|
||||
|
||||
if (bio->bi_iter.bi_size == 0) {
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "sdio_cis.h"
|
||||
#include "sdio_ops.h"
|
||||
|
||||
#define SDIO_READ_CIS_TIMEOUT_MS (10 * 1000) /* 10s */
|
||||
|
||||
static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
|
||||
const unsigned char *buf, unsigned size)
|
||||
{
|
||||
@ -270,6 +272,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
|
||||
|
||||
do {
|
||||
unsigned char tpl_code, tpl_link;
|
||||
unsigned long timeout = jiffies +
|
||||
msecs_to_jiffies(SDIO_READ_CIS_TIMEOUT_MS);
|
||||
|
||||
ret = mmc_io_rw_direct(card, 0, 0, ptr++, 0, &tpl_code);
|
||||
if (ret)
|
||||
@ -322,6 +326,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
|
||||
prev = &this->next;
|
||||
|
||||
if (ret == -ENOENT) {
|
||||
if (time_after(jiffies, timeout))
|
||||
break;
|
||||
/* warn about unknown tuples */
|
||||
pr_warn_ratelimited("%s: queuing unknown"
|
||||
" CIS tuple 0x%02x (%u bytes)\n",
|
||||
|
@ -1658,7 +1658,11 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,
|
||||
if (!entry.portvec)
|
||||
entry.state = MV88E6XXX_G1_ATU_DATA_STATE_UNUSED;
|
||||
} else {
|
||||
entry.portvec |= BIT(port);
|
||||
if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC)
|
||||
entry.portvec = BIT(port);
|
||||
else
|
||||
entry.portvec |= BIT(port);
|
||||
|
||||
entry.state = state;
|
||||
}
|
||||
|
||||
|
@ -29,16 +29,16 @@ static int mvpp2_prs_hw_write(struct mvpp2 *priv, struct mvpp2_prs_entry *pe)
|
||||
/* Clear entry invalidation bit */
|
||||
pe->tcam[MVPP2_PRS_TCAM_INV_WORD] &= ~MVPP2_PRS_TCAM_INV_MASK;
|
||||
|
||||
/* Write tcam index - indirect access */
|
||||
mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
|
||||
for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
|
||||
mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);
|
||||
|
||||
/* Write sram index - indirect access */
|
||||
mvpp2_write(priv, MVPP2_PRS_SRAM_IDX_REG, pe->index);
|
||||
for (i = 0; i < MVPP2_PRS_SRAM_WORDS; i++)
|
||||
mvpp2_write(priv, MVPP2_PRS_SRAM_DATA_REG(i), pe->sram[i]);
|
||||
|
||||
/* Write tcam index - indirect access */
|
||||
mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index);
|
||||
for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++)
|
||||
mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2733,6 +2733,8 @@ static const struct pci_device_id nvme_id_table[] = {
|
||||
{ PCI_DEVICE(0x1d1d, 0x2601), /* CNEX Granby */
|
||||
.driver_data = NVME_QUIRK_LIGHTNVM, },
|
||||
{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
|
||||
{ PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */
|
||||
.driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
|
||||
{ 0, }
|
||||
|
@ -1327,14 +1327,17 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol)
|
||||
if (protocol < USBLP_FIRST_PROTOCOL || protocol > USBLP_LAST_PROTOCOL)
|
||||
return -EINVAL;
|
||||
|
||||
alts = usblp->protocol[protocol].alt_setting;
|
||||
if (alts < 0)
|
||||
return -EINVAL;
|
||||
r = usb_set_interface(usblp->dev, usblp->ifnum, alts);
|
||||
if (r < 0) {
|
||||
printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",
|
||||
alts, usblp->ifnum);
|
||||
return r;
|
||||
/* Don't unnecessarily set the interface if there's a single alt. */
|
||||
if (usblp->intf->num_altsetting > 1) {
|
||||
alts = usblp->protocol[protocol].alt_setting;
|
||||
if (alts < 0)
|
||||
return -EINVAL;
|
||||
r = usb_set_interface(usblp->dev, usblp->ifnum, alts);
|
||||
if (r < 0) {
|
||||
printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",
|
||||
alts, usblp->ifnum);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
usblp->bidir = (usblp->protocol[protocol].epread != NULL);
|
||||
|
@ -1453,7 +1453,6 @@ static void dwc2_hsotg_complete_oursetup(struct usb_ep *ep,
|
||||
static struct dwc2_hsotg_ep *ep_from_windex(struct dwc2_hsotg *hsotg,
|
||||
u32 windex)
|
||||
{
|
||||
struct dwc2_hsotg_ep *ep;
|
||||
int dir = (windex & USB_DIR_IN) ? 1 : 0;
|
||||
int idx = windex & 0x7F;
|
||||
|
||||
@ -1463,12 +1462,7 @@ static struct dwc2_hsotg_ep *ep_from_windex(struct dwc2_hsotg *hsotg,
|
||||
if (idx > hsotg->num_of_eps)
|
||||
return NULL;
|
||||
|
||||
ep = index_to_ep(hsotg, idx, dir);
|
||||
|
||||
if (idx && ep->dir_in != dir)
|
||||
return NULL;
|
||||
|
||||
return ep;
|
||||
return index_to_ep(hsotg, idx, dir);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1700,7 +1700,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
|
||||
if (PMSG_IS_AUTO(msg))
|
||||
break;
|
||||
|
||||
ret = dwc3_core_init(dwc);
|
||||
ret = dwc3_core_init_for_resume(dwc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -403,8 +403,10 @@ static int eth_bind(struct usb_composite_dev *cdev)
|
||||
struct usb_descriptor_header *usb_desc;
|
||||
|
||||
usb_desc = usb_otg_descriptor_alloc(gadget);
|
||||
if (!usb_desc)
|
||||
if (!usb_desc) {
|
||||
status = -ENOMEM;
|
||||
goto fail1;
|
||||
}
|
||||
usb_otg_descriptor_init(gadget, usb_desc);
|
||||
otg_desc[0] = usb_desc;
|
||||
otg_desc[1] = NULL;
|
||||
|
@ -670,11 +670,16 @@ static void xhci_unmap_td_bounce_buffer(struct xhci_hcd *xhci,
|
||||
dma_unmap_single(dev, seg->bounce_dma, ring->bounce_buf_len,
|
||||
DMA_FROM_DEVICE);
|
||||
/* for in tranfers we need to copy the data from bounce to sg */
|
||||
len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, seg->bounce_buf,
|
||||
seg->bounce_len, seg->bounce_offs);
|
||||
if (len != seg->bounce_len)
|
||||
xhci_warn(xhci, "WARN Wrong bounce buffer read length: %zu != %d\n",
|
||||
len, seg->bounce_len);
|
||||
if (urb->num_sgs) {
|
||||
len = sg_pcopy_from_buffer(urb->sg, urb->num_sgs, seg->bounce_buf,
|
||||
seg->bounce_len, seg->bounce_offs);
|
||||
if (len != seg->bounce_len)
|
||||
xhci_warn(xhci, "WARN Wrong bounce buffer read length: %zu != %d\n",
|
||||
len, seg->bounce_len);
|
||||
} else {
|
||||
memcpy(urb->transfer_buffer + seg->bounce_offs, seg->bounce_buf,
|
||||
seg->bounce_len);
|
||||
}
|
||||
seg->bounce_len = 0;
|
||||
seg->bounce_offs = 0;
|
||||
}
|
||||
@ -3180,12 +3185,16 @@ static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 enqd_len,
|
||||
|
||||
/* create a max max_pkt sized bounce buffer pointed to by last trb */
|
||||
if (usb_urb_dir_out(urb)) {
|
||||
len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs,
|
||||
seg->bounce_buf, new_buff_len, enqd_len);
|
||||
if (len != new_buff_len)
|
||||
xhci_warn(xhci,
|
||||
"WARN Wrong bounce buffer write length: %zu != %d\n",
|
||||
len, new_buff_len);
|
||||
if (urb->num_sgs) {
|
||||
len = sg_pcopy_to_buffer(urb->sg, urb->num_sgs,
|
||||
seg->bounce_buf, new_buff_len, enqd_len);
|
||||
if (len != new_buff_len)
|
||||
xhci_warn(xhci, "WARN Wrong bounce buffer write length: %zu != %d\n",
|
||||
len, new_buff_len);
|
||||
} else {
|
||||
memcpy(seg->bounce_buf, urb->transfer_buffer + enqd_len, new_buff_len);
|
||||
}
|
||||
|
||||
seg->bounce_dma = dma_map_single(dev, seg->bounce_buf,
|
||||
max_pkt, DMA_TO_DEVICE);
|
||||
} else {
|
||||
|
@ -126,6 +126,7 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
|
||||
}
|
||||
|
||||
usbhs_pipe_clear_without_sequence(pipe, 0, 0);
|
||||
usbhs_pipe_running(pipe, 0);
|
||||
|
||||
__usbhsf_pkt_del(pkt);
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
|
||||
{ USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */
|
||||
{ USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */
|
||||
{ USB_DEVICE(0x0988, 0x0578) }, /* Teraoka AD2000 */
|
||||
{ USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */
|
||||
{ USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
|
||||
{ USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */
|
||||
@ -201,6 +202,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
|
||||
{ USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */
|
||||
{ USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */
|
||||
{ USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */
|
||||
{ USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
|
||||
{ USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
|
||||
{ USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
|
||||
|
@ -425,6 +425,8 @@ static void option_instat_callback(struct urb *urb);
|
||||
#define CINTERION_PRODUCT_AHXX_2RMNET 0x0084
|
||||
#define CINTERION_PRODUCT_AHXX_AUDIO 0x0085
|
||||
#define CINTERION_PRODUCT_CLS8 0x00b0
|
||||
#define CINTERION_PRODUCT_MV31_MBIM 0x00b3
|
||||
#define CINTERION_PRODUCT_MV31_RMNET 0x00b7
|
||||
|
||||
/* Olivetti products */
|
||||
#define OLIVETTI_VENDOR_ID 0x0b3c
|
||||
@ -1914,6 +1916,10 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) },
|
||||
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */
|
||||
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_MBIM, 0xff),
|
||||
.driver_info = RSVD(3)},
|
||||
{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff),
|
||||
.driver_info = RSVD(0)},
|
||||
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
|
||||
.driver_info = RSVD(4) },
|
||||
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
|
||||
|
@ -190,7 +190,7 @@ static int __init afs_init(void)
|
||||
goto error_cache;
|
||||
#endif
|
||||
|
||||
ret = register_pernet_subsys(&afs_net_ops);
|
||||
ret = register_pernet_device(&afs_net_ops);
|
||||
if (ret < 0)
|
||||
goto error_net;
|
||||
|
||||
@ -210,7 +210,7 @@ static int __init afs_init(void)
|
||||
error_proc:
|
||||
afs_fs_exit();
|
||||
error_fs:
|
||||
unregister_pernet_subsys(&afs_net_ops);
|
||||
unregister_pernet_device(&afs_net_ops);
|
||||
error_net:
|
||||
#ifdef CONFIG_AFS_FSCACHE
|
||||
fscache_unregister_netfs(&afs_cache_netfs);
|
||||
@ -241,7 +241,7 @@ static void __exit afs_exit(void)
|
||||
|
||||
proc_remove(afs_proc_symlink);
|
||||
afs_fs_exit();
|
||||
unregister_pernet_subsys(&afs_net_ops);
|
||||
unregister_pernet_device(&afs_net_ops);
|
||||
#ifdef CONFIG_AFS_FSCACHE
|
||||
fscache_unregister_netfs(&afs_cache_netfs);
|
||||
#endif
|
||||
|
@ -840,6 +840,7 @@ static int
|
||||
cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
|
||||
{
|
||||
struct inode *inode;
|
||||
int rc;
|
||||
|
||||
if (flags & LOOKUP_RCU)
|
||||
return -ECHILD;
|
||||
@ -849,8 +850,25 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
|
||||
if ((flags & LOOKUP_REVAL) && !CIFS_CACHE_READ(CIFS_I(inode)))
|
||||
CIFS_I(inode)->time = 0; /* force reval */
|
||||
|
||||
if (cifs_revalidate_dentry(direntry))
|
||||
return 0;
|
||||
rc = cifs_revalidate_dentry(direntry);
|
||||
if (rc) {
|
||||
cifs_dbg(FYI, "cifs_revalidate_dentry failed with rc=%d", rc);
|
||||
switch (rc) {
|
||||
case -ENOENT:
|
||||
case -ESTALE:
|
||||
/*
|
||||
* Those errors mean the dentry is invalid
|
||||
* (file was deleted or recreated)
|
||||
*/
|
||||
return 0;
|
||||
default:
|
||||
/*
|
||||
* Otherwise some unexpected error happened
|
||||
* report it as-is to VFS layer
|
||||
*/
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* If the inode wasn't known to be a dfs entry when
|
||||
|
@ -222,7 +222,7 @@ struct smb2_negotiate_req {
|
||||
__le32 NegotiateContextOffset; /* SMB3.1.1 only. MBZ earlier */
|
||||
__le16 NegotiateContextCount; /* SMB3.1.1 only. MBZ earlier */
|
||||
__le16 Reserved2;
|
||||
__le16 Dialects[1]; /* One dialect (vers=) at a time for now */
|
||||
__le16 Dialects[4]; /* BB expand this if autonegotiate > 4 dialects */
|
||||
} __packed;
|
||||
|
||||
/* Dialects */
|
||||
|
@ -654,9 +654,10 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
|
||||
|
||||
mutex_unlock(&hugetlb_fault_mutex_table[hash]);
|
||||
|
||||
set_page_huge_active(page);
|
||||
/*
|
||||
* unlock_page because locked by add_to_page_cache()
|
||||
* page_put due to reference from alloc_huge_page()
|
||||
* put_page() due to reference from alloc_huge_page()
|
||||
*/
|
||||
unlock_page(page);
|
||||
put_page(page);
|
||||
|
@ -949,8 +949,8 @@ static char *ovl_get_redirect(struct dentry *dentry, bool abs_redirect)
|
||||
|
||||
buflen -= thislen;
|
||||
memcpy(&buf[buflen], name, thislen);
|
||||
tmp = dget_dlock(d->d_parent);
|
||||
spin_unlock(&d->d_lock);
|
||||
tmp = dget_parent(d);
|
||||
|
||||
dput(d);
|
||||
d = tmp;
|
||||
|
@ -58,6 +58,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UM) || defined(CONFIG_IA64)
|
||||
/*
|
||||
* These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
|
||||
* extra segments containing the gate DSO contents. Dumping its
|
||||
@ -72,5 +73,26 @@ elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset);
|
||||
extern int
|
||||
elf_core_write_extra_data(struct coredump_params *cprm);
|
||||
extern size_t elf_core_extra_data_size(void);
|
||||
#else
|
||||
static inline Elf_Half elf_core_extra_phdrs(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int elf_core_write_extra_data(struct coredump_params *cprm)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline size_t elf_core_extra_data_size(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_ELFCORE_H */
|
||||
|
@ -541,6 +541,9 @@ static inline void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr
|
||||
set_huge_pte_at(mm, addr, ptep, pte);
|
||||
}
|
||||
#endif
|
||||
|
||||
void set_page_huge_active(struct page *page);
|
||||
|
||||
#else /* CONFIG_HUGETLB_PAGE */
|
||||
struct hstate {};
|
||||
#define alloc_huge_page(v, a, r) NULL
|
||||
|
@ -118,6 +118,12 @@ struct msi_desc {
|
||||
list_for_each_entry((desc), dev_to_msi_list((dev)), list)
|
||||
#define for_each_msi_entry_safe(desc, tmp, dev) \
|
||||
list_for_each_entry_safe((desc), (tmp), dev_to_msi_list((dev)), list)
|
||||
#define for_each_msi_vector(desc, __irq, dev) \
|
||||
for_each_msi_entry((desc), (dev)) \
|
||||
if ((desc)->irq) \
|
||||
for (__irq = (desc)->irq; \
|
||||
__irq < ((desc)->irq + (desc)->nvec_used); \
|
||||
__irq++)
|
||||
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
#define first_pci_msi_entry(pdev) first_msi_entry(&(pdev)->dev)
|
||||
|
@ -98,7 +98,6 @@ obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
|
||||
obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
|
||||
obj-$(CONFIG_TRACEPOINTS) += tracepoint.o
|
||||
obj-$(CONFIG_LATENCYTOP) += latencytop.o
|
||||
obj-$(CONFIG_ELFCORE) += elfcore.o
|
||||
obj-$(CONFIG_FUNCTION_TRACER) += trace/
|
||||
obj-$(CONFIG_TRACING) += trace/
|
||||
obj-$(CONFIG_TRACE_CLOCK) += trace/
|
||||
|
@ -1,26 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <linux/elf.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/binfmts.h>
|
||||
#include <linux/elfcore.h>
|
||||
|
||||
Elf_Half __weak elf_core_extra_phdrs(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __weak elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int __weak elf_core_write_extra_data(struct coredump_params *cprm)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t __weak elf_core_extra_data_size(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
@ -437,22 +437,22 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
|
||||
|
||||
can_reserve = msi_check_reservation_mode(domain, info, dev);
|
||||
|
||||
for_each_msi_entry(desc, dev) {
|
||||
virq = desc->irq;
|
||||
if (desc->nvec_used == 1)
|
||||
dev_dbg(dev, "irq %d for MSI\n", virq);
|
||||
else
|
||||
/*
|
||||
* This flag is set by the PCI layer as we need to activate
|
||||
* the MSI entries before the PCI layer enables MSI in the
|
||||
* card. Otherwise the card latches a random msi message.
|
||||
*/
|
||||
if (!(info->flags & MSI_FLAG_ACTIVATE_EARLY))
|
||||
goto skip_activate;
|
||||
|
||||
for_each_msi_vector(desc, i, dev) {
|
||||
if (desc->irq == i) {
|
||||
virq = desc->irq;
|
||||
dev_dbg(dev, "irq [%d-%d] for MSI\n",
|
||||
virq, virq + desc->nvec_used - 1);
|
||||
/*
|
||||
* This flag is set by the PCI layer as we need to activate
|
||||
* the MSI entries before the PCI layer enables MSI in the
|
||||
* card. Otherwise the card latches a random msi message.
|
||||
*/
|
||||
if (!(info->flags & MSI_FLAG_ACTIVATE_EARLY))
|
||||
continue;
|
||||
}
|
||||
|
||||
irq_data = irq_domain_get_irq_data(domain, desc->irq);
|
||||
irq_data = irq_domain_get_irq_data(domain, i);
|
||||
if (!can_reserve) {
|
||||
irqd_clr_can_reserve(irq_data);
|
||||
if (domain->flags & IRQ_DOMAIN_MSI_NOMASK_QUIRK)
|
||||
@ -463,28 +463,24 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
skip_activate:
|
||||
/*
|
||||
* If these interrupts use reservation mode, clear the activated bit
|
||||
* so request_irq() will assign the final vector.
|
||||
*/
|
||||
if (can_reserve) {
|
||||
for_each_msi_entry(desc, dev) {
|
||||
irq_data = irq_domain_get_irq_data(domain, desc->irq);
|
||||
for_each_msi_vector(desc, i, dev) {
|
||||
irq_data = irq_domain_get_irq_data(domain, i);
|
||||
irqd_clr_activated(irq_data);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
cleanup:
|
||||
for_each_msi_entry(desc, dev) {
|
||||
struct irq_data *irqd;
|
||||
|
||||
if (desc->irq == virq)
|
||||
break;
|
||||
|
||||
irqd = irq_domain_get_irq_data(domain, desc->irq);
|
||||
if (irqd_is_activated(irqd))
|
||||
irq_domain_deactivate_irq(irqd);
|
||||
for_each_msi_vector(desc, i, dev) {
|
||||
irq_data = irq_domain_get_irq_data(domain, i);
|
||||
if (irqd_is_activated(irq_data))
|
||||
irq_domain_deactivate_irq(irq_data);
|
||||
}
|
||||
msi_domain_free_irqs(domain, dev);
|
||||
return ret;
|
||||
|
@ -1945,6 +1945,10 @@ int register_kretprobe(struct kretprobe *rp)
|
||||
if (!kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset))
|
||||
return -EINVAL;
|
||||
|
||||
/* If only rp->kp.addr is specified, check reregistering kprobes */
|
||||
if (rp->kp.addr && check_kprobe_rereg(&rp->kp))
|
||||
return -EINVAL;
|
||||
|
||||
if (kretprobe_blacklist_size) {
|
||||
addr = kprobe_addr(&rp->kp);
|
||||
if (IS_ERR(addr))
|
||||
|
@ -2278,7 +2278,7 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
|
||||
spinlock_t *ptl;
|
||||
struct mm_struct *mm = vma->vm_mm;
|
||||
unsigned long haddr = address & HPAGE_PMD_MASK;
|
||||
bool was_locked = false;
|
||||
bool do_unlock_page = false;
|
||||
pmd_t _pmd;
|
||||
|
||||
mmu_notifier_invalidate_range_start(mm, haddr, haddr + HPAGE_PMD_SIZE);
|
||||
@ -2291,7 +2291,6 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
|
||||
VM_BUG_ON(freeze && !page);
|
||||
if (page) {
|
||||
VM_WARN_ON_ONCE(!PageLocked(page));
|
||||
was_locked = true;
|
||||
if (page != pmd_page(*pmd))
|
||||
goto out;
|
||||
}
|
||||
@ -2300,19 +2299,29 @@ repeat:
|
||||
if (pmd_trans_huge(*pmd)) {
|
||||
if (!page) {
|
||||
page = pmd_page(*pmd);
|
||||
if (unlikely(!trylock_page(page))) {
|
||||
get_page(page);
|
||||
_pmd = *pmd;
|
||||
spin_unlock(ptl);
|
||||
lock_page(page);
|
||||
spin_lock(ptl);
|
||||
if (unlikely(!pmd_same(*pmd, _pmd))) {
|
||||
unlock_page(page);
|
||||
/*
|
||||
* An anonymous page must be locked, to ensure that a
|
||||
* concurrent reuse_swap_page() sees stable mapcount;
|
||||
* but reuse_swap_page() is not used on shmem or file,
|
||||
* and page lock must not be taken when zap_pmd_range()
|
||||
* calls __split_huge_pmd() while i_mmap_lock is held.
|
||||
*/
|
||||
if (PageAnon(page)) {
|
||||
if (unlikely(!trylock_page(page))) {
|
||||
get_page(page);
|
||||
_pmd = *pmd;
|
||||
spin_unlock(ptl);
|
||||
lock_page(page);
|
||||
spin_lock(ptl);
|
||||
if (unlikely(!pmd_same(*pmd, _pmd))) {
|
||||
unlock_page(page);
|
||||
put_page(page);
|
||||
page = NULL;
|
||||
goto repeat;
|
||||
}
|
||||
put_page(page);
|
||||
page = NULL;
|
||||
goto repeat;
|
||||
}
|
||||
put_page(page);
|
||||
do_unlock_page = true;
|
||||
}
|
||||
}
|
||||
if (PageMlocked(page))
|
||||
@ -2322,7 +2331,7 @@ repeat:
|
||||
__split_huge_pmd_locked(vma, pmd, haddr, freeze);
|
||||
out:
|
||||
spin_unlock(ptl);
|
||||
if (!was_locked && page)
|
||||
if (do_unlock_page)
|
||||
unlock_page(page);
|
||||
/*
|
||||
* No need to double call mmu_notifier->invalidate_range() callback.
|
||||
|
48
mm/hugetlb.c
48
mm/hugetlb.c
@ -68,6 +68,21 @@ DEFINE_SPINLOCK(hugetlb_lock);
|
||||
static int num_fault_mutexes;
|
||||
struct mutex *hugetlb_fault_mutex_table ____cacheline_aligned_in_smp;
|
||||
|
||||
static inline bool PageHugeFreed(struct page *head)
|
||||
{
|
||||
return page_private(head + 4) == -1UL;
|
||||
}
|
||||
|
||||
static inline void SetPageHugeFreed(struct page *head)
|
||||
{
|
||||
set_page_private(head + 4, -1UL);
|
||||
}
|
||||
|
||||
static inline void ClearPageHugeFreed(struct page *head)
|
||||
{
|
||||
set_page_private(head + 4, 0);
|
||||
}
|
||||
|
||||
/* Forward declaration */
|
||||
static int hugetlb_acct_memory(struct hstate *h, long delta);
|
||||
|
||||
@ -858,6 +873,7 @@ static void enqueue_huge_page(struct hstate *h, struct page *page)
|
||||
list_move(&page->lru, &h->hugepage_freelists[nid]);
|
||||
h->free_huge_pages++;
|
||||
h->free_huge_pages_node[nid]++;
|
||||
SetPageHugeFreed(page);
|
||||
}
|
||||
|
||||
static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid)
|
||||
@ -875,6 +891,7 @@ static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid)
|
||||
return NULL;
|
||||
list_move(&page->lru, &h->hugepage_activelist);
|
||||
set_page_refcounted(page);
|
||||
ClearPageHugeFreed(page);
|
||||
h->free_huge_pages--;
|
||||
h->free_huge_pages_node[nid]--;
|
||||
return page;
|
||||
@ -1196,12 +1213,11 @@ struct hstate *size_to_hstate(unsigned long size)
|
||||
*/
|
||||
bool page_huge_active(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(!PageHuge(page), page);
|
||||
return PageHead(page) && PagePrivate(&page[1]);
|
||||
return PageHeadHuge(page) && PagePrivate(&page[1]);
|
||||
}
|
||||
|
||||
/* never called for tail page */
|
||||
static void set_page_huge_active(struct page *page)
|
||||
void set_page_huge_active(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(!PageHeadHuge(page), page);
|
||||
SetPagePrivate(&page[1]);
|
||||
@ -1305,6 +1321,7 @@ static void prep_new_huge_page(struct hstate *h, struct page *page, int nid)
|
||||
set_hugetlb_cgroup(page, NULL);
|
||||
h->nr_huge_pages++;
|
||||
h->nr_huge_pages_node[nid]++;
|
||||
ClearPageHugeFreed(page);
|
||||
spin_unlock(&hugetlb_lock);
|
||||
}
|
||||
|
||||
@ -1500,6 +1517,7 @@ int dissolve_free_huge_page(struct page *page)
|
||||
{
|
||||
int rc = -EBUSY;
|
||||
|
||||
retry:
|
||||
/* Not to disrupt normal path by vainly holding hugetlb_lock */
|
||||
if (!PageHuge(page))
|
||||
return 0;
|
||||
@ -1516,6 +1534,26 @@ int dissolve_free_huge_page(struct page *page)
|
||||
int nid = page_to_nid(head);
|
||||
if (h->free_huge_pages - h->resv_huge_pages == 0)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* We should make sure that the page is already on the free list
|
||||
* when it is dissolved.
|
||||
*/
|
||||
if (unlikely(!PageHugeFreed(head))) {
|
||||
spin_unlock(&hugetlb_lock);
|
||||
cond_resched();
|
||||
|
||||
/*
|
||||
* Theoretically, we should return -EBUSY when we
|
||||
* encounter this race. In fact, we have a chance
|
||||
* to successfully dissolve the page if we do a
|
||||
* retry. Because the race window is quite small.
|
||||
* If we seize this opportunity, it is an optimization
|
||||
* for increasing the success rate of dissolving page.
|
||||
*/
|
||||
goto retry;
|
||||
}
|
||||
|
||||
/*
|
||||
* Move PageHWPoison flag from head page to the raw error page,
|
||||
* which makes any subpages rather than the error page reusable.
|
||||
@ -4940,9 +4978,9 @@ bool isolate_huge_page(struct page *page, struct list_head *list)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
VM_BUG_ON_PAGE(!PageHead(page), page);
|
||||
spin_lock(&hugetlb_lock);
|
||||
if (!page_huge_active(page) || !get_page_unless_zero(page)) {
|
||||
if (!PageHeadHuge(page) || !page_huge_active(page) ||
|
||||
!get_page_unless_zero(page)) {
|
||||
ret = false;
|
||||
goto unlock;
|
||||
}
|
||||
|
@ -234,14 +234,6 @@ __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end,
|
||||
*
|
||||
* Find @size free area aligned to @align in the specified range and node.
|
||||
*
|
||||
* When allocation direction is bottom-up, the @start should be greater
|
||||
* than the end of the kernel image. Otherwise, it will be trimmed. The
|
||||
* reason is that we want the bottom-up allocation just near the kernel
|
||||
* image so it is highly likely that the allocated memory and the kernel
|
||||
* will reside in the same node.
|
||||
*
|
||||
* If bottom-up allocation failed, will try to allocate memory top-down.
|
||||
*
|
||||
* Return:
|
||||
* Found address on success, 0 on failure.
|
||||
*/
|
||||
@ -250,8 +242,6 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size,
|
||||
phys_addr_t end, int nid,
|
||||
enum memblock_flags flags)
|
||||
{
|
||||
phys_addr_t kernel_end, ret;
|
||||
|
||||
/* pump up @end */
|
||||
if (end == MEMBLOCK_ALLOC_ACCESSIBLE ||
|
||||
end == MEMBLOCK_ALLOC_KASAN)
|
||||
@ -260,40 +250,13 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size,
|
||||
/* avoid allocating the first page */
|
||||
start = max_t(phys_addr_t, start, PAGE_SIZE);
|
||||
end = max(start, end);
|
||||
kernel_end = __pa_symbol(_end);
|
||||
|
||||
/*
|
||||
* try bottom-up allocation only when bottom-up mode
|
||||
* is set and @end is above the kernel image.
|
||||
*/
|
||||
if (memblock_bottom_up() && end > kernel_end) {
|
||||
phys_addr_t bottom_up_start;
|
||||
|
||||
/* make sure we will allocate above the kernel */
|
||||
bottom_up_start = max(start, kernel_end);
|
||||
|
||||
/* ok, try bottom-up allocation first */
|
||||
ret = __memblock_find_range_bottom_up(bottom_up_start, end,
|
||||
size, align, nid, flags);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* we always limit bottom-up allocation above the kernel,
|
||||
* but top-down allocation doesn't have the limit, so
|
||||
* retrying top-down allocation may succeed when bottom-up
|
||||
* allocation failed.
|
||||
*
|
||||
* bottom-up allocation is expected to be fail very rarely,
|
||||
* so we use WARN_ONCE() here to see the stack trace if
|
||||
* fail happens.
|
||||
*/
|
||||
WARN_ONCE(IS_ENABLED(CONFIG_MEMORY_HOTREMOVE),
|
||||
"memblock: bottom-up allocation failed, memory hotremove may be affected\n");
|
||||
}
|
||||
|
||||
return __memblock_find_range_top_down(start, end, size, align, nid,
|
||||
flags);
|
||||
if (memblock_bottom_up())
|
||||
return __memblock_find_range_bottom_up(start, end, size, align,
|
||||
nid, flags);
|
||||
else
|
||||
return __memblock_find_range_top_down(start, end, size, align,
|
||||
nid, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -330,7 +330,7 @@ static int ip_tunnel_bind_dev(struct net_device *dev)
|
||||
}
|
||||
|
||||
dev->needed_headroom = t_hlen + hlen;
|
||||
mtu -= (dev->hard_header_len + t_hlen);
|
||||
mtu -= t_hlen;
|
||||
|
||||
if (mtu < IPV4_MIN_MTU)
|
||||
mtu = IPV4_MIN_MTU;
|
||||
@ -360,7 +360,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net,
|
||||
nt = netdev_priv(dev);
|
||||
t_hlen = nt->hlen + sizeof(struct iphdr);
|
||||
dev->min_mtu = ETH_MIN_MTU;
|
||||
dev->max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
|
||||
dev->max_mtu = IP_MAX_MTU - t_hlen;
|
||||
ip_tunnel_add(itn, nt);
|
||||
return nt;
|
||||
|
||||
@ -502,12 +502,11 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
|
||||
const struct iphdr *inner_iph)
|
||||
{
|
||||
struct ip_tunnel *tunnel = netdev_priv(dev);
|
||||
int pkt_size = skb->len - tunnel->hlen - dev->hard_header_len;
|
||||
int pkt_size = skb->len - tunnel->hlen;
|
||||
int mtu;
|
||||
|
||||
if (df)
|
||||
mtu = dst_mtu(&rt->dst) - dev->hard_header_len
|
||||
- sizeof(struct iphdr) - tunnel->hlen;
|
||||
mtu = dst_mtu(&rt->dst) - (sizeof(struct iphdr) + tunnel->hlen);
|
||||
else
|
||||
mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
|
||||
|
||||
@ -935,7 +934,7 @@ int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict)
|
||||
{
|
||||
struct ip_tunnel *tunnel = netdev_priv(dev);
|
||||
int t_hlen = tunnel->hlen + sizeof(struct iphdr);
|
||||
int max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen;
|
||||
int max_mtu = IP_MAX_MTU - t_hlen;
|
||||
|
||||
if (new_mtu < ETH_MIN_MTU)
|
||||
return -EINVAL;
|
||||
@ -1112,10 +1111,9 @@ int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
|
||||
|
||||
mtu = ip_tunnel_bind_dev(dev);
|
||||
if (tb[IFLA_MTU]) {
|
||||
unsigned int max = IP_MAX_MTU - dev->hard_header_len - nt->hlen;
|
||||
unsigned int max = IP_MAX_MTU - (nt->hlen + sizeof(struct iphdr));
|
||||
|
||||
mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
|
||||
(unsigned int)(max - sizeof(struct iphdr)));
|
||||
mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, max);
|
||||
}
|
||||
|
||||
err = dev_set_mtu(dev, mtu);
|
||||
|
@ -87,7 +87,8 @@ void lapb_kick(struct lapb_cb *lapb)
|
||||
skb = skb_dequeue(&lapb->write_queue);
|
||||
|
||||
do {
|
||||
if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
|
||||
skbn = skb_copy(skb, GFP_ATOMIC);
|
||||
if (!skbn) {
|
||||
skb_queue_head(&lapb->write_queue, skb);
|
||||
break;
|
||||
}
|
||||
|
@ -128,8 +128,11 @@ int drv_sta_state(struct ieee80211_local *local,
|
||||
} else if (old_state == IEEE80211_STA_AUTH &&
|
||||
new_state == IEEE80211_STA_ASSOC) {
|
||||
ret = drv_sta_add(local, sdata, &sta->sta);
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
sta->uploaded = true;
|
||||
if (rcu_access_pointer(sta->sta.rates))
|
||||
drv_sta_rate_tbl_update(local, sdata, &sta->sta);
|
||||
}
|
||||
} else if (old_state == IEEE80211_STA_ASSOC &&
|
||||
new_state == IEEE80211_STA_AUTH) {
|
||||
drv_sta_remove(local, sdata, &sta->sta);
|
||||
|
@ -941,7 +941,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
|
||||
if (old)
|
||||
kfree_rcu(old, rcu_head);
|
||||
|
||||
drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
|
||||
if (sta->uploaded)
|
||||
drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
|
||||
|
||||
ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta));
|
||||
|
||||
|
@ -1010,7 +1010,7 @@ static int __init af_rxrpc_init(void)
|
||||
goto error_security;
|
||||
}
|
||||
|
||||
ret = register_pernet_subsys(&rxrpc_net_ops);
|
||||
ret = register_pernet_device(&rxrpc_net_ops);
|
||||
if (ret)
|
||||
goto error_pernet;
|
||||
|
||||
@ -1055,7 +1055,7 @@ error_key_type:
|
||||
error_sock:
|
||||
proto_unregister(&rxrpc_proto);
|
||||
error_proto:
|
||||
unregister_pernet_subsys(&rxrpc_net_ops);
|
||||
unregister_pernet_device(&rxrpc_net_ops);
|
||||
error_pernet:
|
||||
rxrpc_exit_security();
|
||||
error_security:
|
||||
@ -1077,7 +1077,7 @@ static void __exit af_rxrpc_exit(void)
|
||||
unregister_key_type(&key_type_rxrpc);
|
||||
sock_unregister(PF_RXRPC);
|
||||
proto_unregister(&rxrpc_proto);
|
||||
unregister_pernet_subsys(&rxrpc_net_ops);
|
||||
unregister_pernet_device(&rxrpc_net_ops);
|
||||
ASSERTCMP(atomic_read(&rxrpc_n_tx_skbs), ==, 0);
|
||||
ASSERTCMP(atomic_read(&rxrpc_n_rx_skbs), ==, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user